Skip to content

Commit d61d2f8

Browse files
fix(core.gbapp): ms-rest-azure updated due to Azure/ms-rest-js#347.
1 parent f29c8c2 commit d61d2f8

File tree

5 files changed

+81
-27
lines changed

5 files changed

+81
-27
lines changed

gbot.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ ECHO Compiling...
1212
CALL tsc
1313

1414
:ALLSET
15-
node app.js
15+
node boot.js

package-lock.json

Lines changed: 61 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"mocha-typescript": "1.1.17",
8484
"ms": "2.1.1",
8585
"ms-rest-azure": "2.6.0",
86-
"ms-rest-js": "1.0.1",
86+
"@azure/ms-rest-js": "1.8.13",
8787
"nexmo": "2.4.1",
8888
"ngrok": "3.1.1",
8989
"npm": "6.9.0",

packages/azuredeployer.gbapp/services/AzureDeployerService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@
3636

3737
'use strict';
3838

39+
import { HttpHeaders, HttpMethods, ServiceClient, WebResource } from '@azure/ms-rest-js';
3940
import { CognitiveServicesManagementClient } from 'azure-arm-cognitiveservices';
4041
import { ResourceManagementClient, SubscriptionClient } from 'azure-arm-resource';
4142
import { SearchManagementClient } from 'azure-arm-search';
4243
import { SqlManagementClient } from 'azure-arm-sql';
4344
import { WebSiteManagementClient } from 'azure-arm-website';
4445
//tslint:disable-next-line:no-submodule-imports
45-
import { AppServicePlan, Site, SiteConfigResource, SiteSourceControl, SiteLogsConfig } from 'azure-arm-website/lib/models';
46+
import { AppServicePlan, Site, SiteConfigResource, SiteLogsConfig, SiteSourceControl } from 'azure-arm-website/lib/models';
4647
import { GBLog, IGBInstallationDeployer, IGBInstance } from 'botlib';
47-
import { HttpHeaders, HttpMethods, ServiceClient, WebResource } from 'ms-rest-js';
4848
import { GBAdminService } from '../../../packages/admin.gbapp/services/GBAdminService';
4949
import { GBCorePackage } from '../../../packages/core.gbapp';
5050
import { GBConfigService } from '../../../packages/core.gbapp/services/GBConfigService';
@@ -719,7 +719,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
719719
serverFarmId: serverFarmId,
720720
siteConfig: {
721721
appSettings: [
722-
{ name: 'WEBSITES_CONTAINER_START_TIME_LIMIT', value: WebSiteResponseTimeout },
722+
{ name: 'WEBSITES_CONTAINER_START_TIME_LIMIT', value: `${WebSiteResponseTimeout}` },
723723
{ name: 'WEBSITE_NODE_DEFAULT_VERSION', value: GBAdminService.getNodeVersion() },
724724
{ name: 'ADDITIONAL_DEPLOY_PATH', value: `` },
725725
{ name: 'ADMIN_PASS', value: `${instance.adminPass}` },

packages/whatsapp.gblib/services/WhatsappDirectLine.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export class WhatsappDirectLine extends GBService {
1717
public whatsappServiceKey: string;
1818
public whatsappServiceNumber: string;
1919
public whatsappServiceUrl: string;
20-
public whatsappServiceWebhookUrl: string;
2120
public botId: string;
2221
public watermark: string;
2322

@@ -28,17 +27,15 @@ export class WhatsappDirectLine extends GBService {
2827
directLineSecret,
2928
whatsappServiceKey,
3029
whatsappServiceNumber,
31-
whatsappServiceUrl,
32-
whatsappServiceWebhookUrl
30+
whatsappServiceUrl
3331
) {
3432
super();
3533

3634
this.botId = botId;
3735
this.whatsappServiceKey = whatsappServiceKey;
3836
this.whatsappServiceNumber = whatsappServiceNumber;
3937
this.whatsappServiceUrl = whatsappServiceUrl;
40-
this.whatsappServiceWebhookUrl = whatsappServiceWebhookUrl;
41-
var fs = require('fs')
38+
const fs = require('fs');
4239

4340
this.directLineClient =
4441
new Swagger({
@@ -94,7 +91,10 @@ export class WhatsappDirectLine extends GBService {
9491
client.Conversations.Conversations_StartConversation()
9592
.then(response => {
9693
return response.obj.conversationId;
94+
}).catch(err => {
95+
GBLog.error(`Error calling Conversations_StartConversation on Whatsapp channel ${err}`);
9796
})
97+
9898
.then(generatedConversationId => {
9999
this.conversationIds[from] = generatedConversationId;
100100
this.inputMessage(client, generatedConversationId, text, from, fromName);
@@ -108,7 +108,10 @@ export class WhatsappDirectLine extends GBService {
108108
this.inputMessage(client, conversationId, text, from, fromName);
109109
}
110110
res.end();
111+
}).catch(err => {
112+
GBLog.error(`Error initializing DirectLine for Whatsapp channel ${err}`);
111113
});
114+
112115
}
113116

114117
public inputMessage(client, conversationId, text, from, fromName) {
@@ -143,9 +146,16 @@ export class WhatsappDirectLine extends GBService {
143146

144147
return response.obj.activities;
145148
})
149+
.catch(err => {
150+
GBLog.error(`Error calling Conversations_GetActivities on Whatsapp channel ${err}`);
151+
})
146152
.then(activities => {
147153
this.printMessages(activities, conversationId, from, fromName);
154+
})
155+
.catch(err => {
156+
GBLog.error(`Error calling printMessages on Whatsapp channel ${err}`);
148157
});
158+
149159
}, this.pollInterval);
150160
}
151161

0 commit comments

Comments
 (0)