diff --git a/src/GBError.ts b/src/GBError.ts index 5b98ceb..85be345 100644 --- a/src/GBError.ts +++ b/src/GBError.ts @@ -19,7 +19,7 @@ | 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 | +| 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. | | | @@ -30,7 +30,7 @@ | | \******************************************************************************/ -'use strict'; +'use strict' export enum GBERROR_TYPE { generalError = 2, @@ -42,17 +42,17 @@ export class GBError { getMessageFromErrorCode(type: GBERROR_TYPE) { if (type == GBERROR_TYPE.nlpGeneralError) { - return `GuaribasBusinessError: Error accessing NLP, check of the service.`; + return `GuaribasBusinessError: Error accessing NLP, check of the service.` } } - e: Error; + e: Error constructor(e: Error, type: GBERROR_TYPE = GBERROR_TYPE.generalError) { - this.e = e; + this.e = e } static create(message) { - return new GBError(Error(message)); + return new GBError(Error(message)) } } diff --git a/src/GBMinInstance.ts b/src/GBMinInstance.ts index e4580a9..fb42405 100644 --- a/src/GBMinInstance.ts +++ b/src/GBMinInstance.ts @@ -19,7 +19,7 @@ | 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 | +| 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. | | | @@ -31,28 +31,28 @@ \*****************************************************************************/ -import { BotAdapter, UserState } from "botbuilder"; +import { BotAdapter, UserState } from "botbuilder" import { DialogSet } from "botbuilder-dialogs" -import { IGBInstance } from "./IGBinstance"; -import { IGBCoreService } from "./IGBCoreService"; -import { IGBConversationalService, IGBPackage } from "."; -import { AzureText } from "pragmatismo-io-framework"; +import { IGBInstance } from "./IGBinstance" +import { IGBCoreService } from "./IGBCoreService" +import { IGBConversationalService, IGBPackage } from "." +import { AzureText } from "pragmatismo-io-framework" /** Minimal services for bot. */ export class GBMinInstance { - packages: IGBPackage[]; - botId: string; - instance: IGBInstance; - core: IGBCoreService; - conversationalService: IGBConversationalService; - textServices: AzureText; - bot: BotAdapter; - dialogs: DialogSet; - userState: UserState; + packages: IGBPackage[] + botId: string + instance: IGBInstance + core: IGBCoreService + conversationalService: IGBConversationalService + textServices: AzureText + bot: BotAdapter + dialogs: DialogSet + userState: UserState constructor() { - this.packages = []; - this.dialogs = new DialogSet(); + this.packages = [] + this.dialogs = new DialogSet() } } \ No newline at end of file diff --git a/src/GBService.ts b/src/GBService.ts index 0e55a5e..e496ee5 100644 --- a/src/GBService.ts +++ b/src/GBService.ts @@ -19,7 +19,7 @@ | 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 | +| 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. | | | @@ -30,6 +30,6 @@ | | \******************************************************************************/ -'use strict'; +'use strict' export class GBService { } diff --git a/src/IGBConversationalService.ts b/src/IGBConversationalService.ts index b9aa849..535356d 100644 --- a/src/IGBConversationalService.ts +++ b/src/IGBConversationalService.ts @@ -19,7 +19,7 @@ | 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 | +| 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. | | | @@ -30,15 +30,15 @@ | | \*****************************************************************************/ -"use strict"; +"use strict" -import { GBMinInstance } from "./GBMinInstance"; +import { GBMinInstance } from "./GBMinInstance" export interface IGBConversationalService { - sendEvent(dc:any, name: string, value: any); + sendEvent(dc:any, name: string, value: any) runNLP( dc:any, min: GBMinInstance, text: string - ); + ) } diff --git a/src/IGBCoreService.ts b/src/IGBCoreService.ts index 99e47a6..71ef805 100644 --- a/src/IGBCoreService.ts +++ b/src/IGBCoreService.ts @@ -19,7 +19,7 @@ | 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 | +| 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. | | | @@ -30,19 +30,19 @@ | | \*****************************************************************************/ -"use strict"; +"use strict" -import { Sequelize } from "sequelize-typescript"; -import { IGBInstance } from "./IGBInstance"; +import { Sequelize } from "sequelize-typescript" +import { IGBInstance } from "./IGBInstance" /** * This interface defines the core service which is shared among * bot packages so they can have direct access to base services. */ export interface IGBCoreService { - sequelize: Sequelize; - initDatabase(); - syncDatabaseStructure(); - loadInstances(): IGBInstance[]; - loadInstance(botId: string): IGBInstance; + sequelize: Sequelize + initDatabase() + syncDatabaseStructure() + loadInstances(): IGBInstance[] + loadInstance(botId: string): IGBInstance } \ No newline at end of file diff --git a/src/IGBDialog.ts b/src/IGBDialog.ts index 33f70da..ef5c776 100644 --- a/src/IGBDialog.ts +++ b/src/IGBDialog.ts @@ -1,4 +1,4 @@ -import { BotAdapter } from 'botbuilder'; +import { BotAdapter } from 'botbuilder' /*****************************************************************************\ | ( )_ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | @@ -20,7 +20,7 @@ import { BotAdapter } from 'botbuilder'; | 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 | +| 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. | | | @@ -31,13 +31,13 @@ import { BotAdapter } from 'botbuilder'; | | \*****************************************************************************/ -"use strict"; +"use strict" -import { GBService } from "./GBService"; +import { GBService } from "./GBService" export class IGBDialog { - bot: BotAdapter; - service: GBService; + bot: BotAdapter + service: GBService constructor(bot: BotAdapter) { } } diff --git a/src/IGBInstance.ts b/src/IGBInstance.ts index 086c262..31a6eb4 100644 --- a/src/IGBInstance.ts +++ b/src/IGBInstance.ts @@ -19,7 +19,7 @@ | 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 | +| 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. | | | @@ -30,43 +30,44 @@ | | \*****************************************************************************/ -"use strict"; +"use strict" export interface IGBInstance { - botId:string; - whoAmIVideo: string; - applicationPrincipal: string; - authenticatorTenant: string; - authenticatorsignUpSignInPolicy: string; - authenticatorClientID: string; - instanceId: number; - title: string; - description: string; - version: string; - enabledAdmin: boolean; - engineName: string; - marketplaceId: string; - textAnalyticsKey: string; - marketplacePassword: string; - webchatKey: string; - whatsappServiceKey: string; - whatsappBotKey: string; - whatsappServiceNumber: string; - whatsappServiceUrl: string; - whatsappServiceWebhookUrl: string; - theme: string; - ui: string; - kb: string; - nlpAppId: string; - nlpSubscriptionKey: string; - nlpServerUrl: string; - speechKey: string; - spellcheckerKey: string; - searchHost: string; - searchKey: string; - searchIndex: string; - searchIndexer: string; - nlpVsSearch: number; - searchScore: number; - nlpScore: number; + botId:string + whoAmIVideo: string + applicationPrincipal: string + authenticatorTenant: string + authenticatorsignUpSignInPolicy: string + authenticatorClientID: string + instanceId: number + title: string + description: string + version: string + enabledAdmin: boolean + engineName: string + marketplaceId: string + textAnalyticsKey: string + textAnalyticsServerUrl: string + marketplacePassword: string + webchatKey: string + whatsappServiceKey: string + whatsappBotKey: string + whatsappServiceNumber: string + whatsappServiceUrl: string + whatsappServiceWebhookUrl: string + theme: string + ui: string + kb: string + nlpAppId: string + nlpSubscriptionKey: string + nlpServerUrl: string + speechKey: string + spellcheckerKey: string + searchHost: string + searchKey: string + searchIndex: string + searchIndexer: string + nlpVsSearch: number + searchScore: number + nlpScore: number } \ No newline at end of file diff --git a/src/IGBPackage.ts b/src/IGBPackage.ts index 917f198..49268b3 100644 --- a/src/IGBPackage.ts +++ b/src/IGBPackage.ts @@ -19,7 +19,7 @@ | 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 | +| 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. | | | @@ -31,41 +31,41 @@ \*****************************************************************************/ -import { IGBCoreService } from './IGBCoreService'; -import { Sequelize } from 'sequelize-typescript'; -import { GBMinInstance } from '.'; +import { IGBCoreService } from './IGBCoreService' +import { Sequelize } from 'sequelize-typescript' +import { GBMinInstance } from '.' -// TODO: Include "use strict"; in all files. +// TODO: Include "use strict" in all files. export interface IGBPackage{ /** * Each app has its own set of sys packages. */ - sysPackages: IGBPackage[]; + sysPackages: IGBPackage[] /** * Called when a package is being loaded, once per server or at demand. */ - loadPackage(core: IGBCoreService, sequelize: Sequelize): void; + loadPackage(core: IGBCoreService, sequelize: Sequelize): void /** * Called when a package needs to be unloaded. */ - unloadPackage(core: IGBCoreService): void; + unloadPackage(core: IGBCoreService): void /** * Called when a new bot instance is loaded. */ - loadBot(min: GBMinInstance): void; + loadBot(min: GBMinInstance): void /** * Called whenever a bot instance needs to be shutdown. */ - unloadBot(min: GBMinInstance): void; + unloadBot(min: GBMinInstance): void /** * Called in each new dc. */ - onNewSession(min: GBMinInstance, dc: any): void; + onNewSession(min: GBMinInstance, dc: any): void } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 6de4c74..b56250a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,7 +19,7 @@ | 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 | +| 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. | | | @@ -30,14 +30,14 @@ | | \******************************************************************************/ -'use strict'; +'use strict' -export { Sequelize } from 'sequelize-typescript'; -export { IGBConversationalService } from './IGBConversationalService'; -export { IGBCoreService } from './IGBCoreService'; -export { IGBDialog } from './IGBDialog'; -export { IGBPackage } from './IGBPackage'; -export { IGBInstance } from './IGBInstance'; -export { GBError, GBERROR_TYPE } from './GBError'; -export { GBService } from './GBService'; -export { GBMinInstance } from './GBMinInstance'; +export { Sequelize } from 'sequelize-typescript' +export { IGBConversationalService } from './IGBConversationalService' +export { IGBCoreService } from './IGBCoreService' +export { IGBDialog } from './IGBDialog' +export { IGBPackage } from './IGBPackage' +export { IGBInstance } from './IGBInstance' +export { GBError, GBERROR_TYPE } from './GBError' +export { GBService } from './GBService' +export { GBMinInstance } from './GBMinInstance'