fix(gbot): gbot.cmd now installs packages and compiles the server before running.
This commit is contained in:
		
							parent
							
								
									b7abf5f90a
								
							
						
					
					
						commit
						dca0325ad8
					
				
					 5 changed files with 107 additions and 25 deletions
				
			
		
							
								
								
									
										52
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										52
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							| 
						 | 
					@ -6964,7 +6964,8 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "ansi-regex": {
 | 
					        "ansi-regex": {
 | 
				
			||||||
          "version": "2.1.1",
 | 
					          "version": "2.1.1",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "aproba": {
 | 
					        "aproba": {
 | 
				
			||||||
          "version": "1.2.0",
 | 
					          "version": "1.2.0",
 | 
				
			||||||
| 
						 | 
					@ -6982,11 +6983,13 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "balanced-match": {
 | 
					        "balanced-match": {
 | 
				
			||||||
          "version": "1.0.0",
 | 
					          "version": "1.0.0",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "brace-expansion": {
 | 
					        "brace-expansion": {
 | 
				
			||||||
          "version": "1.1.11",
 | 
					          "version": "1.1.11",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "balanced-match": "^1.0.0",
 | 
					            "balanced-match": "^1.0.0",
 | 
				
			||||||
            "concat-map": "0.0.1"
 | 
					            "concat-map": "0.0.1"
 | 
				
			||||||
| 
						 | 
					@ -6999,15 +7002,18 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "code-point-at": {
 | 
					        "code-point-at": {
 | 
				
			||||||
          "version": "1.1.0",
 | 
					          "version": "1.1.0",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "concat-map": {
 | 
					        "concat-map": {
 | 
				
			||||||
          "version": "0.0.1",
 | 
					          "version": "0.0.1",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "console-control-strings": {
 | 
					        "console-control-strings": {
 | 
				
			||||||
          "version": "1.1.0",
 | 
					          "version": "1.1.0",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "core-util-is": {
 | 
					        "core-util-is": {
 | 
				
			||||||
          "version": "1.0.2",
 | 
					          "version": "1.0.2",
 | 
				
			||||||
| 
						 | 
					@ -7110,7 +7116,8 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "inherits": {
 | 
					        "inherits": {
 | 
				
			||||||
          "version": "2.0.3",
 | 
					          "version": "2.0.3",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "ini": {
 | 
					        "ini": {
 | 
				
			||||||
          "version": "1.3.5",
 | 
					          "version": "1.3.5",
 | 
				
			||||||
| 
						 | 
					@ -7120,6 +7127,7 @@
 | 
				
			||||||
        "is-fullwidth-code-point": {
 | 
					        "is-fullwidth-code-point": {
 | 
				
			||||||
          "version": "1.0.0",
 | 
					          "version": "1.0.0",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "number-is-nan": "^1.0.0"
 | 
					            "number-is-nan": "^1.0.0"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
| 
						 | 
					@ -7132,17 +7140,20 @@
 | 
				
			||||||
        "minimatch": {
 | 
					        "minimatch": {
 | 
				
			||||||
          "version": "3.0.4",
 | 
					          "version": "3.0.4",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "brace-expansion": "^1.1.7"
 | 
					            "brace-expansion": "^1.1.7"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "minimist": {
 | 
					        "minimist": {
 | 
				
			||||||
          "version": "0.0.8",
 | 
					          "version": "0.0.8",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "minipass": {
 | 
					        "minipass": {
 | 
				
			||||||
          "version": "2.2.4",
 | 
					          "version": "2.2.4",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "safe-buffer": "^5.1.1",
 | 
					            "safe-buffer": "^5.1.1",
 | 
				
			||||||
            "yallist": "^3.0.0"
 | 
					            "yallist": "^3.0.0"
 | 
				
			||||||
| 
						 | 
					@ -7159,6 +7170,7 @@
 | 
				
			||||||
        "mkdirp": {
 | 
					        "mkdirp": {
 | 
				
			||||||
          "version": "0.5.1",
 | 
					          "version": "0.5.1",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "minimist": "0.0.8"
 | 
					            "minimist": "0.0.8"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
| 
						 | 
					@ -7231,7 +7243,8 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "number-is-nan": {
 | 
					        "number-is-nan": {
 | 
				
			||||||
          "version": "1.0.1",
 | 
					          "version": "1.0.1",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "object-assign": {
 | 
					        "object-assign": {
 | 
				
			||||||
          "version": "4.1.1",
 | 
					          "version": "4.1.1",
 | 
				
			||||||
| 
						 | 
					@ -7241,6 +7254,7 @@
 | 
				
			||||||
        "once": {
 | 
					        "once": {
 | 
				
			||||||
          "version": "1.4.0",
 | 
					          "version": "1.4.0",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "wrappy": "1"
 | 
					            "wrappy": "1"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
| 
						 | 
					@ -7316,7 +7330,8 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "safe-buffer": {
 | 
					        "safe-buffer": {
 | 
				
			||||||
          "version": "5.1.1",
 | 
					          "version": "5.1.1",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "safer-buffer": {
 | 
					        "safer-buffer": {
 | 
				
			||||||
          "version": "2.1.2",
 | 
					          "version": "2.1.2",
 | 
				
			||||||
| 
						 | 
					@ -7346,6 +7361,7 @@
 | 
				
			||||||
        "string-width": {
 | 
					        "string-width": {
 | 
				
			||||||
          "version": "1.0.2",
 | 
					          "version": "1.0.2",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "code-point-at": "^1.0.0",
 | 
					            "code-point-at": "^1.0.0",
 | 
				
			||||||
            "is-fullwidth-code-point": "^1.0.0",
 | 
					            "is-fullwidth-code-point": "^1.0.0",
 | 
				
			||||||
| 
						 | 
					@ -7363,6 +7379,7 @@
 | 
				
			||||||
        "strip-ansi": {
 | 
					        "strip-ansi": {
 | 
				
			||||||
          "version": "3.0.1",
 | 
					          "version": "3.0.1",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "ansi-regex": "^2.0.0"
 | 
					            "ansi-regex": "^2.0.0"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
| 
						 | 
					@ -7401,11 +7418,13 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "wrappy": {
 | 
					        "wrappy": {
 | 
				
			||||||
          "version": "1.0.2",
 | 
					          "version": "1.0.2",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "yallist": {
 | 
					        "yallist": {
 | 
				
			||||||
          "version": "3.0.2",
 | 
					          "version": "3.0.2",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
| 
						 | 
					@ -13608,6 +13627,7 @@
 | 
				
			||||||
        "align-text": {
 | 
					        "align-text": {
 | 
				
			||||||
          "version": "0.1.4",
 | 
					          "version": "0.1.4",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "kind-of": "^3.0.2",
 | 
					            "kind-of": "^3.0.2",
 | 
				
			||||||
            "longest": "^1.0.1",
 | 
					            "longest": "^1.0.1",
 | 
				
			||||||
| 
						 | 
					@ -13887,7 +13907,8 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "is-buffer": {
 | 
					        "is-buffer": {
 | 
				
			||||||
          "version": "1.1.6",
 | 
					          "version": "1.1.6",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "is-builtin-module": {
 | 
					        "is-builtin-module": {
 | 
				
			||||||
          "version": "1.0.0",
 | 
					          "version": "1.0.0",
 | 
				
			||||||
| 
						 | 
					@ -13959,6 +13980,7 @@
 | 
				
			||||||
        "kind-of": {
 | 
					        "kind-of": {
 | 
				
			||||||
          "version": "3.2.2",
 | 
					          "version": "3.2.2",
 | 
				
			||||||
          "bundled": true,
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true,
 | 
				
			||||||
          "requires": {
 | 
					          "requires": {
 | 
				
			||||||
            "is-buffer": "^1.1.5"
 | 
					            "is-buffer": "^1.1.5"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
| 
						 | 
					@ -13999,7 +14021,8 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "longest": {
 | 
					        "longest": {
 | 
				
			||||||
          "version": "1.0.1",
 | 
					          "version": "1.0.1",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "lru-cache": {
 | 
					        "lru-cache": {
 | 
				
			||||||
          "version": "4.1.3",
 | 
					          "version": "4.1.3",
 | 
				
			||||||
| 
						 | 
					@ -14228,7 +14251,8 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "repeat-string": {
 | 
					        "repeat-string": {
 | 
				
			||||||
          "version": "1.6.1",
 | 
					          "version": "1.6.1",
 | 
				
			||||||
          "bundled": true
 | 
					          "bundled": true,
 | 
				
			||||||
 | 
					          "optional": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "require-directory": {
 | 
					        "require-directory": {
 | 
				
			||||||
          "version": "2.1.1",
 | 
					          "version": "2.1.1",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,21 +37,45 @@ import { WaterfallStepContext } from 'botbuilder-dialogs';
 | 
				
			||||||
import { GBMinInstance } from 'botlib';
 | 
					import { GBMinInstance } from 'botlib';
 | 
				
			||||||
const WaitUntil = require('wait-until');
 | 
					const WaitUntil = require('wait-until');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					class SysClass {
 | 
				
			||||||
 * @fileoverview General Bots server core.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export class DialogClass {
 | 
					 | 
				
			||||||
  public min: GBMinInstance;
 | 
					  public min: GBMinInstance;
 | 
				
			||||||
  public context: TurnContext;
 | 
					 | 
				
			||||||
  public step: WaterfallStepContext;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor(min: GBMinInstance) {
 | 
					  constructor(min: GBMinInstance) {
 | 
				
			||||||
    this.min = min;
 | 
					    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) {
 | 
					  public async hear(cb) {
 | 
				
			||||||
    let idCallback = Math.floor(Math.random() * 1000000000000);
 | 
					    const idCallback = Math.floor(Math.random() * 1000000000000);
 | 
				
			||||||
    this.min.cbMap[idCallback] = cb;
 | 
					    this.min.cbMap[idCallback] = cb;
 | 
				
			||||||
    await this.step.beginDialog('/hear', { id: idCallback});
 | 
					    await this.step.beginDialog('/hear', { id: idCallback});
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@
 | 
				
			||||||
import { WaterfallDialog } from 'botbuilder-dialogs';
 | 
					import { WaterfallDialog } from 'botbuilder-dialogs';
 | 
				
			||||||
import { GBMinInstance, IGBCoreService } from 'botlib';
 | 
					import { GBMinInstance, IGBCoreService } from 'botlib';
 | 
				
			||||||
import * as fs from 'fs';
 | 
					import * as fs from 'fs';
 | 
				
			||||||
import { DialogClass } from './GBAPIService';
 | 
					import DialogClass from './GBAPIService';
 | 
				
			||||||
import { GBDeployer } from './GBDeployer';
 | 
					import { GBDeployer } from './GBDeployer';
 | 
				
			||||||
import { TSCompiler } from './TSCompiler';
 | 
					import { TSCompiler } from './TSCompiler';
 | 
				
			||||||
const util = require('util');
 | 
					const util = require('util');
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,8 +34,6 @@
 | 
				
			||||||
'                                                                             
 | 
					'                                                                             
 | 
				
			||||||
'****************************************************************************
 | 
					'****************************************************************************
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
talk ("How many installments do you want to pay your Credit?")
 | 
					talk ("How many installments do you want to pay your Credit?")
 | 
				
			||||||
installments = hear ()
 | 
					installments = hear ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										36
									
								
								packages/default.gbdialog/sys-bot-farm-creation.vbs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								packages/default.gbdialog/sys-bot-farm-creation.vbs
									
										
									
									
									
										Normal 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)
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue