chore(core.gbapp): Some useful refactoring

This commit is contained in:
Joao Antonio Ferreira 2019-10-23 23:25:31 -03:00
commit 566899d369
7 changed files with 871 additions and 438 deletions

View file

@ -1,3 +1,10 @@
## [1.7.6](https://github.com/pragmatismo-io/BotServer/compare/1.7.5...1.7.6) (2019-10-24)
### Bug Fixes
* **core.gbapp:** fix of sts token generation ([d6aa65d](https://github.com/pragmatismo-io/BotServer/commit/d6aa65d))
## [1.7.5](https://github.com/pragmatismo-io/BotServer/compare/1.7.4...1.7.5) (2019-10-18)

1277
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "botserver",
"version": "1.7.5",
"version": "1.7.6",
"description": "General Bot Community Edition open-core server.",
"main": "./boot.js",
"bugs": "https://github.com/pragmatismo-io/BotServer/issues",

View file

@ -406,16 +406,17 @@ export class AzureDeployerService implements IGBInstallationDeployer {
instance.textAnalyticsEndpoint = textAnalytics.endpoint.replace(`/text/analytics/v2.0`, '');
instance.textAnalyticsKey = keys.key1;
if (false) {
GBLog.info(`Deploying NLP...`);
const nlp = await this.createNLP(name, `${name}-nlp`, instance.cloudLocation);
keys = await this.cognitiveClient.accounts.listKeys(name, nlp.name);
const nlpAppId = await this.createNLPService(name, name, instance.cloudLocation, culture, instance.nlpAuthoringKey);
instance.nlpEndpoint = nlp.endpoint; // TODO: Add this final URL /apps/a149dae1-5134-4624-96b5-885e9e674c9e
instance.nlpKey = keys.key1;
instance.nlpAppId = nlpAppId;
GBLog.info(`Deploying NLP...`);
const nlp = await this.createNLP(name, `${name}-nlp`, instance.cloudLocation);
keys = await this.cognitiveClient.accounts.listKeys(name, nlp.name);
const nlpAppId = await this.createNLPService(name, name, instance.cloudLocation, culture, instance.nlpAuthoringKey);
instance.nlpEndpoint = nlp.endpoint; // TODO: Add this final URL /apps/a149dae1-5134-4624-96b5-885e9e674c9e
instance.nlpKey = keys.key1;
instance.nlpAppId = nlpAppId;
}
GBLog.info(`Deploying Bot...`);
instance.botEndpoint = this.defaultEndPoint;

View file

@ -373,7 +373,7 @@ export class GBDeployer {
});
}
public runOnce() {
public setupDefaultGBUI() {
const root = 'packages/default.gbui';
const npm = urlJoin(process.env.PWD, 'node_modules', '.bin', 'npm');
if (!Fs.existsSync(`${root}/build`)) {

View file

@ -348,7 +348,7 @@ export class GBMinService {
private async getSTSToken(instance: any) {
const options = {
url: 'https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken',
url: instance.speechEndpoint,
method: 'POST',
headers: {
'Ocp-Apim-Subscription-Key': instance.speechKey

View file

@ -176,7 +176,7 @@ export class GBServer {
// Deployment of local applications for the first time.
deployer.runOnce();
deployer.setupDefaultGBUI();
GBLog.info(`The Bot Server is in RUNNING mode...`);