/*****************************************************************************\
|                                               ( )_  _                       |
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___   ___     _     |
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| (˅) |( (_) )  |
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
|   | |                ( )_) |                                                |
|   (_)                 \___/'                                                |
|                                                                             |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved.             |
| Licensed under the AGPL-3.0.                                                |
|                                                                             |
| According to our dual licensing model, this program can be used either      |
| under the terms of the GNU Affero General Public License, version 3,        |
| or under a proprietary license.                                             |
|                                                                             |
| The texts of the GNU Affero General Public License with an additional       |
| permission and of our proprietary license can be found at and               |
| in the LICENSE file you have received along with this program.              |
|                                                                             |
| This program is distributed in the hope that it will be useful,             |
| but WITHOUT ANY WARRANTY, without even the implied warranty of              |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                |
| GNU Affero General Public License for more details.                         |
|                                                                             |
| "General Bots" is a registered trademark of Pragmatismo.io.                 |
| The licensing of the program under the AGPLv3 does not imply a              |
| trademark license. Therefore any rights, title and interest in              |
| our trademarks remain entirely with us.                                     |
|                                                                             |
\*****************************************************************************/
/**
 * @fileoverview General Bots server core.
 */
'use strict';
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { AutoIncrement, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Model, PrimaryKey, Table, UpdatedAt } from 'sequelize-typescript';
/**
 * Base instance data for a bot.
 */
let GuaribasInstance = class GuaribasInstance extends Model {
};
__decorate([
    PrimaryKey,
    AutoIncrement,
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasInstance.prototype, "instanceId", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "botEndpoint", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "whoAmIVideo", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "botId", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "title", void 0);
__decorate([
    Column({ type: DataType.STRING(16) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "activationCode", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "description", void 0);
__decorate([
    Column({ type: DataType.STRING(16) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "state", void 0);
__decorate([
    Column(DataType.STRING(64)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "botKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", Boolean)
], GuaribasInstance.prototype, "enabledAdmin", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "engineName", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "marketplaceId", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "textAnalyticsKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "textAnalyticsEndpoint", void 0);
__decorate([
    Column({ type: DataType.STRING(64) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "translatorKey", void 0);
__decorate([
    Column({ type: DataType.STRING(128) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "translatorEndpoint", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "marketplacePassword", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "webchatKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "authenticatorTenant", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "authenticatorAuthorityHostUrl", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "cloudSubscriptionId", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "cloudUsername", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "cloudPassword", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "cloudLocation", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "googleBotKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "googleChatApiKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "googleChatSubscriptionName", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "googleClientEmail", void 0);
__decorate([
    Column({ type: DataType.STRING(4000) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "googlePrivateKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "googleProjectId", void 0);
__decorate([
    Column({ type: DataType.STRING(255) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "facebookWorkplaceVerifyToken", void 0);
__decorate([
    Column({ type: DataType.STRING(255) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "facebookWorkplaceAppSecret", void 0);
__decorate([
    Column({ type: DataType.STRING(512) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "facebookWorkplaceAccessToken", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "whatsappBotKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "whatsappServiceKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "whatsappServiceNumber", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "whatsappServiceUrl", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "smsKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "smsSecret", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "smsServiceNumber", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "speechKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "speechEndpoint", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "spellcheckerKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "spellcheckerEndpoint", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "theme", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "ui", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "kb", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "nlpAppId", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "nlpKey", void 0);
__decorate([
    Column({ type: DataType.STRING(512) }),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "nlpEndpoint", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "nlpAuthoringKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "deploymentPaths", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "searchHost", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "searchKey", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "searchIndex", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "searchIndexer", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "storageUsername", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "storagePassword", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "storageName", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "storageServer", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "storageDialect", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "storagePath", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "adminPass", void 0);
__decorate([
    Column(DataType.FLOAT),
    __metadata("design:type", Number)
], GuaribasInstance.prototype, "searchScore", void 0);
__decorate([
    Column(DataType.FLOAT),
    __metadata("design:type", Number)
], GuaribasInstance.prototype, "nlpScore", void 0);
__decorate([
    Column(DataType.DATE),
    CreatedAt,
    __metadata("design:type", Date)
], GuaribasInstance.prototype, "createdAt", void 0);
__decorate([
    Column(DataType.DATE),
    UpdatedAt,
    __metadata("design:type", Date)
], GuaribasInstance.prototype, "updatedAt", void 0);
__decorate([
    Column(DataType.STRING(4000)),
    __metadata("design:type", String)
], GuaribasInstance.prototype, "params", void 0);
GuaribasInstance = __decorate([
    Table
], GuaribasInstance);
export { GuaribasInstance };
/**
 * Each packaged listed for use in a bot instance.
 */
let GuaribasPackage = class GuaribasPackage extends Model {
};
__decorate([
    PrimaryKey,
    AutoIncrement,
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasPackage.prototype, "packageId", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasPackage.prototype, "packageName", void 0);
__decorate([
    ForeignKey(() => GuaribasInstance),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasPackage.prototype, "instanceId", void 0);
__decorate([
    BelongsTo(() => GuaribasInstance),
    __metadata("design:type", GuaribasInstance)
], GuaribasPackage.prototype, "instance", void 0);
__decorate([
    Column(DataType.DATE),
    CreatedAt,
    __metadata("design:type", Date)
], GuaribasPackage.prototype, "createdAt", void 0);
__decorate([
    Column(DataType.DATE),
    UpdatedAt,
    __metadata("design:type", Date)
], GuaribasPackage.prototype, "updatedAt", void 0);
__decorate([
    Column({ type: DataType.STRING(512) }),
    __metadata("design:type", String)
], GuaribasPackage.prototype, "custom", void 0);
GuaribasPackage = __decorate([
    Table
], GuaribasPackage);
export { GuaribasPackage };
/**
 * A bot channel.
 */
let GuaribasChannel = class GuaribasChannel extends Model {
};
__decorate([
    PrimaryKey,
    AutoIncrement,
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasChannel.prototype, "channelId", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasChannel.prototype, "title", void 0);
__decorate([
    Column(DataType.DATE),
    CreatedAt,
    __metadata("design:type", Date)
], GuaribasChannel.prototype, "createdAt", void 0);
__decorate([
    Column(DataType.DATE),
    UpdatedAt,
    __metadata("design:type", Date)
], GuaribasChannel.prototype, "updatedAt", void 0);
GuaribasChannel = __decorate([
    Table
], GuaribasChannel);
export { GuaribasChannel };
/**
 * An exception that has been thrown.
 */
let GuaribasLog = class GuaribasLog extends Model {
};
__decorate([
    PrimaryKey,
    AutoIncrement,
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasLog.prototype, "logId", void 0);
__decorate([
    Column(DataType.STRING(1024)),
    __metadata("design:type", String)
], GuaribasLog.prototype, "message", void 0);
__decorate([
    Column(DataType.STRING(1)),
    __metadata("design:type", String)
], GuaribasLog.prototype, "kind", void 0);
__decorate([
    ForeignKey(() => GuaribasInstance),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasLog.prototype, "instanceId", void 0);
__decorate([
    BelongsTo(() => GuaribasInstance),
    __metadata("design:type", GuaribasInstance)
], GuaribasLog.prototype, "instance", void 0);
__decorate([
    Column(DataType.DATE),
    CreatedAt,
    __metadata("design:type", Date)
], GuaribasLog.prototype, "createdAt", void 0);
__decorate([
    Column(DataType.DATE),
    UpdatedAt,
    __metadata("design:type", Date)
], GuaribasLog.prototype, "updatedAt", void 0);
GuaribasLog = __decorate([
    Table
    //tslint:disable-next-line:max-classes-per-file
], GuaribasLog);
export { GuaribasLog };
let GuaribasApplications = class GuaribasApplications extends Model {
};
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasApplications.prototype, "name", void 0);
__decorate([
    ForeignKey(() => GuaribasInstance),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasApplications.prototype, "instanceId", void 0);
__decorate([
    BelongsTo(() => GuaribasInstance),
    __metadata("design:type", GuaribasInstance)
], GuaribasApplications.prototype, "instance", void 0);
__decorate([
    Column(DataType.DATE),
    CreatedAt,
    __metadata("design:type", Date)
], GuaribasApplications.prototype, "createdAt", void 0);
__decorate([
    Column(DataType.DATE),
    UpdatedAt,
    __metadata("design:type", Date)
], GuaribasApplications.prototype, "updatedAt", void 0);
GuaribasApplications = __decorate([
    Table
    //tslint:disable-next-line:max-classes-per-file
], GuaribasApplications);
export { GuaribasApplications };
let GuaribasSchedule = class GuaribasSchedule extends Model {
};
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasSchedule.prototype, "name", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasSchedule.prototype, "schedule", void 0);
__decorate([
    ForeignKey(() => GuaribasInstance),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasSchedule.prototype, "instanceId", void 0);
__decorate([
    BelongsTo(() => GuaribasInstance),
    __metadata("design:type", GuaribasInstance)
], GuaribasSchedule.prototype, "instance", void 0);
__decorate([
    Column(DataType.DATE),
    CreatedAt,
    __metadata("design:type", Date)
], GuaribasSchedule.prototype, "createdAt", void 0);
__decorate([
    Column(DataType.DATE),
    UpdatedAt,
    __metadata("design:type", Date)
], GuaribasSchedule.prototype, "updatedAt", void 0);
GuaribasSchedule = __decorate([
    Table
    //tslint:disable-next-line:max-classes-per-file
], GuaribasSchedule);
export { GuaribasSchedule };
//# sourceMappingURL=GBModel.js.map