fix(gbot): gbot.cmd now installs packages and compiles the server before running.

This commit is contained in:
Rodrigo Rodriguez 2019-02-19 15:30:07 -03:00
parent b7abf5f90a
commit dca0325ad8
5 changed files with 107 additions and 25 deletions

52
package-lock.json generated
View file

@ -6964,7 +6964,8 @@
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true
"bundled": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -6982,11 +6983,13 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true
"bundled": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -6999,15 +7002,18 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -7110,7 +7116,8 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true
"bundled": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -7120,6 +7127,7 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -7132,17 +7140,20 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true
"bundled": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -7159,6 +7170,7 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -7231,7 +7243,8 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -7241,6 +7254,7 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -7316,7 +7330,8 @@
},
"safe-buffer": {
"version": "5.1.1",
"bundled": true
"bundled": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -7346,6 +7361,7 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -7363,6 +7379,7 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -7401,11 +7418,13 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true
"bundled": true,
"optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true
"bundled": true,
"optional": true
}
}
},
@ -13608,6 +13627,7 @@
"align-text": {
"version": "0.1.4",
"bundled": true,
"optional": true,
"requires": {
"kind-of": "^3.0.2",
"longest": "^1.0.1",
@ -13887,7 +13907,8 @@
},
"is-buffer": {
"version": "1.1.6",
"bundled": true
"bundled": true,
"optional": true
},
"is-builtin-module": {
"version": "1.0.0",
@ -13959,6 +13980,7 @@
"kind-of": {
"version": "3.2.2",
"bundled": true,
"optional": true,
"requires": {
"is-buffer": "^1.1.5"
}
@ -13999,7 +14021,8 @@
},
"longest": {
"version": "1.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"lru-cache": {
"version": "4.1.3",
@ -14228,7 +14251,8 @@
},
"repeat-string": {
"version": "1.6.1",
"bundled": true
"bundled": true,
"optional": true
},
"require-directory": {
"version": "2.1.1",

View file

@ -37,21 +37,45 @@ import { WaterfallStepContext } from 'botbuilder-dialogs';
import { GBMinInstance } from 'botlib';
const WaitUntil = require('wait-until');
/**
* @fileoverview General Bots server core.
*/
export class DialogClass {
class SysClass {
public min: GBMinInstance;
public context: TurnContext;
public step: WaterfallStepContext;
constructor(min: GBMinInstance) {
this.min = min;
}
public async deployBot(
botId,
description,
location,
nlpAuthoringKey,
appId,
appPassword,
subscriptionId
) {
}
}
/**
* @fileoverview General Bots server core.
*/
export default class DialogClass {
public min: GBMinInstance;
public context: TurnContext;
public step: WaterfallStepContext;
public internalSys: SysClass;
constructor(min: GBMinInstance) {
this.min = min;
}
public async sys() {
return this.internalSys;
}
public async hear(cb) {
let idCallback = Math.floor(Math.random() * 1000000000000);
const idCallback = Math.floor(Math.random() * 1000000000000);
this.min.cbMap[idCallback] = cb;
await this.step.beginDialog('/hear', { id: idCallback});
}

View file

@ -35,7 +35,7 @@
import { WaterfallDialog } from 'botbuilder-dialogs';
import { GBMinInstance, IGBCoreService } from 'botlib';
import * as fs from 'fs';
import { DialogClass } from './GBAPIService';
import DialogClass from './GBAPIService';
import { GBDeployer } from './GBDeployer';
import { TSCompiler } from './TSCompiler';
const util = require('util');

View file

@ -34,8 +34,6 @@
'
'****************************************************************************
talk ("How many installments do you want to pay your Credit?")
installments = hear ()

View file

@ -0,0 +1,36 @@
' General Bots Copyright (c) Pragmatismo.io. All rights reserved.
' Licensed under the AGPL-3.0.
talk "Please, tell me what is the Bot name?"
hear name
talk "If you tell me your username/password, I can show service subscription list to you."
talk "What is your Username (eg.: human@domain.bot)"
hear email
talk "Your password? (Will be discarded after sigining process)"
talk "Let's generate a very dificult to guess password for the new bot:"
generate a password
talk "Your password is *" + password + "*. Keep it on a safe place only acessible to you."
talk "Can you describe in a few words what the bot is about?"
hear description
talk "Please, choose what subscription would you like to connect to:"
hear one of subscriptions (email, password) into subscriptionId
talk "Please, provide the cloud location just like 'westus'?"
hear cloudLocation
talk "Please, provide the Authoring Key for NLP service (LUIS)?"
hear nlpKey
talk "Sorry, this part cannot be automated yet due to Microsoft schedule, please go to https://apps.dev.microsoft.com/portal/register-app to generate manually an App ID and App Secret."
wait 1
talk "Please, provide the App ID you just generated:"
hear appId
talk "Please, provide the Generated Password:"
hear appPassword
talk "Now, I am going to create a Bot farm... Wait 5 minutes or more..."
create bot farm (name, username, password, description, cloudLocation, nlpKey, appId, appPassword, subscriptionId)