fix(whatsapp.gblib): Applied WhatsApp-web-js patch.
This commit is contained in:
parent
693e12300d
commit
316b5262ee
4 changed files with 6 additions and 6 deletions
|
@ -181,7 +181,7 @@
|
||||||
"vm2-process": "2.1.1",
|
"vm2-process": "2.1.1",
|
||||||
"walk-promise": "0.2.0",
|
"walk-promise": "0.2.0",
|
||||||
"washyourmouthoutwithsoap": "1.0.2",
|
"washyourmouthoutwithsoap": "1.0.2",
|
||||||
"whatsapp-web.js": "1.16.4-alpha.0",
|
"whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_7",
|
||||||
"winston": "3.8.2",
|
"winston": "3.8.2",
|
||||||
"winston-logs-display": "1.0.0",
|
"winston-logs-display": "1.0.0",
|
||||||
"ws": "8.12.1",
|
"ws": "8.12.1",
|
||||||
|
|
|
@ -607,7 +607,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
|
||||||
const resChannel = await httpClient.sendRequest(req);
|
const resChannel = await httpClient.sendRequest(req);
|
||||||
const key = JSON.parse(resChannel.bodyAsText).properties.properties.sites[0].key;
|
const key = JSON.parse(resChannel.bodyAsText).properties.properties.sites[0].key;
|
||||||
instance.webchatKey = key;
|
instance.webchatKey = key;
|
||||||
instance.whatsappBotKey = key;
|
instance.webchatKey = key;
|
||||||
resolve(instance);
|
resolve(instance);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
reject(error);
|
reject(error);
|
||||||
|
|
|
@ -746,7 +746,7 @@ export class GBMinService {
|
||||||
min.whatsAppDirectLine = new WhatsappDirectLine(
|
min.whatsAppDirectLine = new WhatsappDirectLine(
|
||||||
min,
|
min,
|
||||||
min.botId,
|
min.botId,
|
||||||
min.instance.whatsappBotKey,
|
min.instance.webchatKey,
|
||||||
min.instance.whatsappServiceKey,
|
min.instance.whatsappServiceKey,
|
||||||
min.instance.whatsappServiceNumber,
|
min.instance.whatsappServiceNumber,
|
||||||
min.instance.whatsappServiceUrl,
|
min.instance.whatsappServiceUrl,
|
||||||
|
@ -759,7 +759,7 @@ export class GBMinService {
|
||||||
min.whatsAppDirectLine = new WhatsappDirectLine(
|
min.whatsAppDirectLine = new WhatsappDirectLine(
|
||||||
min,
|
min,
|
||||||
min.botId,
|
min.botId,
|
||||||
min.instance.whatsappBotKey,
|
min.instance.webchatKey,
|
||||||
minBoot.instance.whatsappServiceKey,
|
minBoot.instance.whatsappServiceKey,
|
||||||
minBoot.instance.whatsappServiceNumber,
|
minBoot.instance.whatsappServiceNumber,
|
||||||
minBoot.instance.whatsappServiceUrl,
|
minBoot.instance.whatsappServiceUrl,
|
||||||
|
|
|
@ -123,7 +123,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
const client = await new SwaggerClient({
|
const client = await new SwaggerClient({
|
||||||
spec: JSON.parse(Fs.readFileSync('directline-3.0.json', 'utf8')),
|
spec: JSON.parse(Fs.readFileSync('directline-3.0.json', 'utf8')),
|
||||||
requestInterceptor: req => {
|
requestInterceptor: req => {
|
||||||
req.headers['Authorization'] = `Bearer ${this.min.instance.whatsappBotKey}`;
|
req.headers['Authorization'] = `Bearer ${this.min.instance.webchatKey}`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.directLineClient = client;
|
this.directLineClient = client;
|
||||||
|
@ -318,7 +318,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
// If there is a number specified, checks if it
|
// If there is a number specified, checks if it
|
||||||
// is related to a custom bot and reroutes immediately.
|
// is related to a custom bot and reroutes immediately.
|
||||||
|
|
||||||
if (newThis !== this && newThis.min.botId !== GBServer.globals.minBoot.botId) {
|
if (newThis && newThis !== this && newThis.min.botId !== GBServer.globals.minBoot.botId) {
|
||||||
await newThis.received(req, res);
|
await newThis.received(req, res);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue