- FIX: Packages updated.

- FIX: Missing some 'use strict'.
This commit is contained in:
Jorge Ramos 2018-06-03 16:44:47 -03:00
parent 8ba9cfbaf6
commit a2fdfcbc91
13 changed files with 418 additions and 412 deletions

View file

@ -1,5 +1,14 @@
# History # History
## Version 0.0.30
- FIX: Packages updated.
- FIX: Missing some 'use strict'.
## Version 0.0.29
- FIX: Packages updated.
## Version 0.0.28 ## Version 0.0.28
- FIX: Package compiled. - FIX: Package compiled.

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "botlib", "name": "botlib",
"version": "0.0.26", "version": "0.0.30",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View file

@ -1,7 +1,7 @@
{ {
"name": "botlib", "name": "botlib",
"version": "0.0.28", "version": "0.0.30",
"description": "General Bot base library for building Node.js TypeScript Apps packages (.gbapp)", "description": "General Bot base library for building Node.js TypeScript Apps packages (.gbapp)",
"main": "dist/src/index.js", "main": "dist/src/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
"homepage": "http://www.generalbot.com", "homepage": "http://www.generalbot.com",

View file

@ -1,48 +1,47 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
"use strict";
'use strict';
export enum GBERROR_TYPE { export enum GBERROR_TYPE {
generalError = 2, generalError = 2,
nlpGeneralError = 3, nlpGeneralError = 3,
} }
export class GBError{ export class GBError {
static createFromCode(GBERROR_TYPE): any {} static createFromCode(GBERROR_TYPE): any { }
getMessageFromErrorCode(type: GBERROR_TYPE) { getMessageFromErrorCode(type: GBERROR_TYPE) {
if (type == GBERROR_TYPE.nlpGeneralError){ if (type == GBERROR_TYPE.nlpGeneralError) {
return `GuaribasBusinessError: Error accessing NLP, check of the service.`; return `GuaribasBusinessError: Error accessing NLP, check of the service.`;
} }
} }

View file

@ -1,41 +1,42 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
'use strict';
import { UniversalBot } from "botbuilder"; import { UniversalBot } from 'botbuilder';
import { IGBInstance } from "./IGBinstance"; import { AzureText } from 'pragmatismo-io-framework';
import { IGBCoreService } from "./IGBCoreService"; import { IGBInstance } from './IGBinstance';
import { IGBConversationalService, IGBPackage } from "."; import { IGBCoreService } from './IGBCoreService';
import { AzureText } from "pragmatismo-io-framework"; import { IGBConversationalService, IGBPackage } from '.';
/** Minimal services for bot. */ /** Minimal services for bot. */
@ -51,4 +52,4 @@ export class GBMinInstance {
constructor() { constructor() {
this.packages = []; this.packages = [];
} }
} }

View file

@ -1,39 +1,39 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
"use strict"; 'use strict';
import { GBError } from './GBError'; import { GBError } from './GBError';
export interface GBServiceCallback<T> { (data: T, error: GBError): void } export interface GBServiceCallback<T> { (data: T, error: GBError): void }
export class GBService {} export class GBService { }

View file

@ -1,48 +1,47 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
"use strict"; 'use strict';
import { UniversalBot, Session } from "botbuilder"; import { UniversalBot, Session } from 'botbuilder';
import { GBMinInstance } from "./GBMinInstance"; import { GBMinInstance } from './GBMinInstance';
import { GBServiceCallback } from "./GBService"; import { GBServiceCallback } from './GBService';
export interface IGBConversationalService { export interface IGBConversationalService {
sendEvent(session: Session, name: string, value: any); sendEvent(session: Session, name: string, value: any);
runNLP( runNLP(
session: Session, session: Session,
min: GBMinInstance, min: GBMinInstance,
text: string, text: string,
cb: GBServiceCallback<any> cb: GBServiceCallback<any>
); );
} }

View file

@ -1,48 +1,47 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
"use strict"; 'use strict';
import { UniversalBot, Session } from "botbuilder"; import { Sequelize } from 'sequelize-typescript';
import { GBMinInstance } from "./GBMinInstance"; import { UniversalBot, Session } from 'botbuilder';
import { GBServiceCallback } from "./GBService"; import { GBMinInstance } from './GBMinInstance';
import { Sequelize } from "sequelize-typescript"; import { GBServiceCallback } from './GBService';
import { IGBInstance } from "./IGBInstance"; import { IGBInstance } from './IGBInstance';
export interface IGBCoreService { export interface IGBCoreService {
sequelize: Sequelize; sequelize: Sequelize;
initDatabase(cb); initDatabase(cb);
syncDatabaseStructure(cb); syncDatabaseStructure(cb);
loadInstances(cb: GBServiceCallback<IGBInstance[]>); loadInstances(cb: GBServiceCallback<IGBInstance[]>);
loadInstance(botId: string, cb: GBServiceCallback<IGBInstance>); loadInstance(botId: string, cb: GBServiceCallback<IGBInstance>);
} }

View file

@ -1,36 +1,36 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
"use strict"; 'use strict';
import { import {
IChatConnectorSettings, IChatConnectorSettings,
@ -40,13 +40,13 @@ import {
Prompts, Prompts,
ChatConnector, ChatConnector,
UniversalBot UniversalBot
} from "botbuilder"; } from 'botbuilder';
import { GBService } from "./GBService";
import { GBService } from './GBService';
export class IGBDialog { export class IGBDialog {
bot: UniversalBot; bot: UniversalBot;
service: GBService; service: GBService;
constructor(bot: UniversalBot) { constructor(bot: UniversalBot) {
} }
} }

View file

@ -1,66 +1,66 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
"use strict"; 'use strict';
export interface IGBInstance { export interface IGBInstance {
botId:string; botId: string;
whoAmIVideo: string; whoAmIVideo: string;
instanceId: number; instanceId: number;
title: string; title: string;
description: string; description: string;
version: string; version: string;
enabledAdmin: boolean; enabledAdmin: boolean;
engineName: string; engineName: string;
marketplaceId: string; marketplaceId: string;
textAnalyticsKey: string; textAnalyticsKey: string;
marketplacePassword: string; marketplacePassword: string;
webchatKey: string; webchatKey: string;
whatsappServiceKey: string; whatsappServiceKey: string;
whatsappBotKey: string; whatsappBotKey: string;
whatsappServiceNumber: string; whatsappServiceNumber: string;
whatsappServiceUrl: string; whatsappServiceUrl: string;
whatsappServiceWebhookUrl: string; whatsappServiceWebhookUrl: string;
theme: string; theme: string;
ui: string; ui: string;
kb: string; kb: string;
nlpServerUrl: string; nlpServerUrl: string;
speechKey: string; speechKey: string;
spellcheckerKey: string; spellcheckerKey: string;
searchHost: string; searchHost: string;
searchKey: string; searchKey: string;
searchIndex: string; searchIndex: string;
searchIndexer: string; searchIndexer: string;
nlpVsSearch: number; nlpVsSearch: number;
searchScore: number; searchScore: number;
nlpScore: number; nlpScore: number;
} }

View file

@ -1,61 +1,59 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
'use strict';
import { IGBCoreService } from './IGBCoreService'; import { Sequelize } from 'sequelize-typescript';
import { Sequelize, Model } from 'sequelize-typescript';
import { GBMinInstance } from '.';
import { Session } from 'botbuilder'; import { Session } from 'botbuilder';
import { IGBCoreService } from './IGBCoreService';
import { GBMinInstance } from '.';
"use strict"; export interface IGBPackage {
export interface IGBPackage{ /** Each app has its own set of sys packages. */
sysPackages: IGBPackage[];
/** Each app has its own set of sys packages. */ /** Called when a package is being loaded, once per server or at demand. */
sysPackages: IGBPackage[]; loadPackage(core: IGBCoreService, sequelize: Sequelize): void;
/** Called when a package is being loaded, once per server or at demand. */ /** Called when a package needs to be unloaded. */
loadPackage(core: IGBCoreService, sequelize: Sequelize): void; unloadPackage(core: IGBCoreService): void;
/** Called when a package needs to be unloaded. */ /** Called when a new bot instance is loaded. */
unloadPackage(core: IGBCoreService): void; loadBot(min: GBMinInstance): void;
/** Called when a new bot instance is loaded. */ /** Called whenever a bot instance needs to be shutdown. */
loadBot(min: GBMinInstance): void; unloadBot(min: GBMinInstance): void;
/** Called whenever a bot instance needs to be shutdown. */ /** Called in each new session. */
unloadBot(min: GBMinInstance): void; onNewSession(min: GBMinInstance, session: Session): void;
}
/** Called in each new session. */
onNewSession(min: GBMinInstance, session: Session): void;
}

View file

@ -1,36 +1,38 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
"use strict"; 'use strict';
export { Sequelize } from 'sequelize';
import { GBMinInstance } from './GBMinInstance'; import { GBMinInstance } from './GBMinInstance';
import { GBService } from './GBService'; import { GBService } from './GBService';
@ -49,4 +51,3 @@ export { GBError, GBERROR_TYPE } from './GBError';
export { GBService } from './GBService'; export { GBService } from './GBService';
export { GBServiceCallback } from './GBService'; export { GBServiceCallback } from './GBService';
export { GBMinInstance } from './GBMinInstance'; export { GBMinInstance } from './GBMinInstance';
export { Sequelize } from 'sequelize';

View file

@ -1,45 +1,45 @@
/*****************************************************************************\ /******************************************************************************\
| ( )_ _ | | ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ | | ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ ` _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) | | | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' | | | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_) (_)`\___/' |
| | | ( )_) | | | | | ( )_) | |
| (_) \___/' | | (_) \___/' |
| | | |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved. | | General Bots Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the AGPL-3.0. | | Licensed under the AGPL-3.0. |
| | | |
| According to our dual licensing model, this program can be used either | | According to our dual licensing model, this program can be used either |
| under the terms of the GNU Affero General Public License, version 3, | | under the terms of the GNU Affero General Public License, version 3, |
| or under a proprietary license. | | or under a proprietary license. |
| | | |
| The texts of the GNU Affero General Public License with an additional | | The texts of the GNU Affero General Public License with an additional |
| permission and of our proprietary license can be found at and | | permission and of our proprietary license can be found at and |
| in the LICENSE file you have received along with this program. | | in the LICENSE file you have received along with this program. |
| | | |
| This program is distributed in the hope that it will be useful, | | 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 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. | | GNU Affero General Public License for more details. |
| | | |
| "General Bots" is a registered trademark of Pragmatismo.io. | | "General Bots" is a registered trademark of Pragmatismo.io. |
| The licensing of the program under the AGPLv3 does not imply a | | The licensing of the program under the AGPLv3 does not imply a |
| trademark license. Therefore any rights, title and interest in | | trademark license. Therefore any rights, title and interest in |
| our trademarks remain entirely with us. | | our trademarks remain entirely with us. |
| | | |
\*****************************************************************************/ \******************************************************************************/
"use strict"; 'use strict';
const assert = require('assert'); const assert = require('assert');
describe('Array', () => { describe('Array', () => {
describe('#indexOf()', () => { describe('#indexOf()', () => {
it('should return -1 when the value is not present',()=> { it('should return -1 when the value is not present', () => {
assert.equal([1,2,3].indexOf(4), -1); assert.equal([1, 2, 3].indexOf(4), -1);
}); });
}); });
}); });