Skip to content

Commit

Permalink
fix(gbot): gbot.cmd now installs packages and compiles the server bef…
Browse files Browse the repository at this point in the history
…ore running.
  • Loading branch information
rodrigorodriguez committed Feb 19, 2019
1 parent b7abf5f commit dca0325
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 19 deletions.
52 changes: 38 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 26 additions & 2 deletions packages/core.gbapp/services/GBAPIService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,45 @@ import { WaterfallStepContext } from 'botbuilder-dialogs';
import { GBMinInstance } from 'botlib';
const WaitUntil = require('wait-until');

class SysClass {
public min: GBMinInstance;

constructor(min: GBMinInstance) {
this.min = min;
}

public async deployBot(
botId,
description,
location,
nlpAuthoringKey,
appId,
appPassword,
subscriptionId
) {

}
}
/**
* @fileoverview General Bots server core.
*/

export class DialogClass {
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});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBVMService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 0 additions & 2 deletions packages/default.gbdialog/bot.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
'
'****************************************************************************



talk ("How many installments do you want to pay your Credit?")
installments = hear ()

Expand Down
36 changes: 36 additions & 0 deletions packages/default.gbdialog/sys-bot-farm-creation.vbs
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit dca0325

Please sign in to comment.