diff --git a/.gitignore b/.gitignore index 33566412..d1404546 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ GB.log gb.log GB.log.json +yarn-error.log diff --git a/package-lock.json b/package-lock.json index 5fedc9cc..9eb46dbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8588,7 +8588,8 @@ "node_modules/ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true }, "node_modules/class-methods": { "version": "1.0.12", @@ -10178,6 +10179,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", "integrity": "sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==", + "dev": true, "engines": { "node": "*" } @@ -18483,7 +18485,8 @@ "node_modules/npm-normalize-package-bin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true }, "node_modules/npm-run-path": { "version": "4.0.1", @@ -21618,6 +21621,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, "dependencies": { "aggregate-error": "^3.0.0" }, @@ -24248,6 +24252,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz", "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==", + "dev": true, "dependencies": { "glob": "^7.1.1", "json-parse-even-better-errors": "^2.3.0", @@ -24258,12 +24263,14 @@ "node_modules/read-package-json/node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true }, "node_modules/read-package-json/node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -24454,6 +24461,7 @@ "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", "deprecated": "This functionality has been moved to @npmcli/fs", + "dev": true, "dependencies": { "debuglog": "^1.0.1", "dezalgo": "^1.0.0", @@ -29254,6 +29262,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, "dependencies": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", @@ -36174,7 +36183,8 @@ "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true }, "class-methods": { "version": "1.0.12", @@ -37434,7 +37444,8 @@ "debuglog": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", - "integrity": "sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==" + "integrity": "sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==", + "dev": true }, "decamelize": { "version": "1.2.0", @@ -45437,7 +45448,8 @@ "npm-normalize-package-bin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true }, "npm-run-path": { "version": "4.0.1", @@ -46004,6 +46016,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, "requires": { "aggregate-error": "^3.0.0" } @@ -47951,6 +47964,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz", "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==", + "dev": true, "requires": { "glob": "^7.1.1", "json-parse-even-better-errors": "^2.3.0", @@ -47961,12 +47975,14 @@ "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, "requires": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -48128,6 +48144,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", + "dev": true, "requires": { "debuglog": "^1.0.1", "dezalgo": "^1.0.0", @@ -51895,6 +51912,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, "requires": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", diff --git a/packages/core.gbapp/models/GBModel.ts b/packages/core.gbapp/models/GBModel.ts index 6e9db486..0842e05e 100644 --- a/packages/core.gbapp/models/GBModel.ts +++ b/packages/core.gbapp/models/GBModel.ts @@ -62,212 +62,212 @@ export class GuaribasInstance extends Model implements IGBInst instanceId: number; @Column(DataType.STRING(255)) - botEndpoint: string; + declare botEndpoint: string; @Column(DataType.STRING(255)) - whoAmIVideo: string; + declare whoAmIVideo: string; @Column(DataType.STRING(255)) - botId: string; + declare botId: string; @Column(DataType.STRING(255)) - title: string; + declare title: string; @Column({ type: DataType.STRING(16) }) - activationCode: string; + declare activationCode: string; @Column(DataType.STRING(255)) - description: string; + declare description: string; @Column({ type: DataType.STRING(16) }) - state: string; + declare state: string; - version: string; + declare version: string; @Column(DataType.STRING(64)) - botKey: string; + declare botKey: string; @Column(DataType.STRING(255)) - enabledAdmin: boolean; + declare enabledAdmin: boolean; @Column(DataType.STRING(255)) - engineName: string; + declare engineName: string; @Column(DataType.STRING(255)) - marketplaceId: string; + declare marketplaceId: string; @Column(DataType.STRING(255)) - textAnalyticsKey: string; + declare textAnalyticsKey: string; @Column(DataType.STRING(255)) - textAnalyticsEndpoint: string; + declare textAnalyticsEndpoint: string; @Column({ type: DataType.STRING(64) }) - translatorKey: string; + declare translatorKey: string; @Column({ type: DataType.STRING(128) }) - translatorEndpoint: string; + declare translatorEndpoint: string; @Column(DataType.STRING(255)) - marketplacePassword: string; + declare marketplacePassword: string; @Column(DataType.STRING(255)) - webchatKey: string; + declare webchatKey: string; @Column(DataType.STRING(255)) - authenticatorTenant: string; + declare authenticatorTenant: string; @Column(DataType.STRING(255)) - authenticatorAuthorityHostUrl: string; + declare authenticatorAuthorityHostUrl: string; @Column(DataType.STRING(255)) - cloudSubscriptionId: string; + declare cloudSubscriptionId: string; @Column(DataType.STRING(255)) - cloudUsername: string; + declare cloudUsername: string; @Column(DataType.STRING(255)) - cloudPassword: string; + declare cloudPassword: string; @Column(DataType.STRING(255)) - cloudLocation: string; + declare cloudLocation: string; @Column(DataType.STRING(255)) - googleBotKey: string; + declare googleBotKey: string; @Column(DataType.STRING(255)) - googleChatApiKey: string; + declare googleChatApiKey: string; @Column(DataType.STRING(255)) - googleChatSubscriptionName: string; + declare googleChatSubscriptionName: string; @Column(DataType.STRING(255)) - googleClientEmail: string; + declare googleClientEmail: string; @Column({ type: DataType.STRING(4000) }) - googlePrivateKey: string; + declare googlePrivateKey: string; @Column(DataType.STRING(255)) - googleProjectId: string; + declare googleProjectId: string; @Column({ type: DataType.STRING(255) }) - facebookWorkplaceVerifyToken: string; + declare facebookWorkplaceVerifyToken: string; @Column({ type: DataType.STRING(255) }) - facebookWorkplaceAppSecret: string; + declare facebookWorkplaceAppSecret: string; @Column({ type: DataType.STRING(512) }) - facebookWorkplaceAccessToken: string; + declare facebookWorkplaceAccessToken: string; @Column(DataType.STRING(255)) - whatsappBotKey: string; + declare whatsappBotKey: string; @Column(DataType.STRING(255)) - whatsappServiceKey: string; + declare whatsappServiceKey: string; @Column(DataType.STRING(255)) - whatsappServiceNumber: string; + declare whatsappServiceNumber: string; @Column(DataType.STRING(255)) - whatsappServiceUrl: string; + declare whatsappServiceUrl: string; @Column(DataType.STRING(255)) - smsKey: string; + declare smsKey: string; @Column(DataType.STRING(255)) - smsSecret: string; + declare smsSecret: string; @Column(DataType.STRING(255)) - smsServiceNumber: string; + declare smsServiceNumber: string; @Column(DataType.STRING(255)) - speechKey: string; + declare speechKey: string; @Column(DataType.STRING(255)) - speechEndpoint: string; + declare speechEndpoint: string; @Column(DataType.STRING(255)) - spellcheckerKey: string; + declare spellcheckerKey: string; @Column(DataType.STRING(255)) - spellcheckerEndpoint: string; + declare spellcheckerEndpoint: string; @Column(DataType.STRING(255)) - theme: string; + declare theme: string; @Column(DataType.STRING(255)) - ui: string; + declare ui: string; @Column(DataType.STRING(255)) - kb: string; + declare kb: string; @Column(DataType.STRING(255)) - nlpAppId: string; + declare nlpAppId: string; @Column(DataType.STRING(255)) - nlpKey: string; + declare nlpKey: string; @Column({ type: DataType.STRING(512) }) - nlpEndpoint: string; + declare nlpEndpoint: string; @Column(DataType.STRING(255)) - nlpAuthoringKey: string; + declare nlpAuthoringKey: string; @Column(DataType.STRING(255)) - deploymentPaths: string; + declare deploymentPaths: string; @Column(DataType.STRING(255)) - searchHost: string; + declare searchHost: string; @Column(DataType.STRING(255)) - searchKey: string; + declare searchKey: string; @Column(DataType.STRING(255)) - searchIndex: string; + declare searchIndex: string; @Column(DataType.STRING(255)) - searchIndexer: string; + declare searchIndexer: string; @Column(DataType.STRING(255)) - storageUsername: string; + declare storageUsername: string; @Column(DataType.STRING(255)) - storagePassword: string; + declare storagePassword: string; @Column(DataType.STRING(255)) - storageName: string; + declare storageName: string; @Column(DataType.STRING(255)) - storageServer: string; + declare storageServer: string; @Column(DataType.STRING(255)) - storageDialect: string; + declare storageDialect: string; @Column(DataType.STRING(255)) - storagePath: string; + declare storagePath: string; @Column(DataType.STRING(255)) - adminPass: string; + declare adminPass: string; @Column(DataType.FLOAT) - nlpVsSearch: number; // TODO: Remove field. + declare nlpVsSearch: number; // TODO: Remove field. @Column(DataType.FLOAT) - searchScore: number; + declare searchScore: number; @Column(DataType.FLOAT) - nlpScore: number; + declare nlpScore: number; @Column(DataType.DATE) @CreatedAt - createdAt: Date; + declare createdAt: Date; @Column(DataType.DATE) @UpdatedAt - updatedAt: Date; + declare updatedAt: Date; @Column(DataType.STRING(4000)) - params: string; + declare params: string; } /** @@ -278,28 +278,28 @@ export class GuaribasPackage extends Model { @PrimaryKey @AutoIncrement @Column(DataType.INTEGER) - packageId: number; + declare packageId: number; @Column(DataType.STRING(255)) - packageName: string; + declare packageName: string; @ForeignKey(() => GuaribasInstance) @Column(DataType.INTEGER) - instanceId: number; + declare instanceId: number; @BelongsTo(() => GuaribasInstance) - instance: GuaribasInstance; + declare instance: GuaribasInstance; @Column(DataType.DATE) @CreatedAt - createdAt: Date; + declare createdAt: Date; @Column(DataType.DATE) @UpdatedAt - updatedAt: Date; + declare updatedAt: Date; @Column({ type: DataType.STRING(512) }) - custom: string; + declare custom: string; } /** @@ -310,18 +310,18 @@ export class GuaribasChannel extends Model { @PrimaryKey @AutoIncrement @Column(DataType.INTEGER) - channelId: number; + declare channelId: number; @Column(DataType.STRING(255)) - title: string; + declare title: string; @Column(DataType.DATE) @CreatedAt - createdAt: Date; + declare createdAt: Date; @Column(DataType.DATE) @UpdatedAt - updatedAt: Date; + declare updatedAt: Date; } /** @@ -333,70 +333,70 @@ export class GuaribasException extends Model { @PrimaryKey @AutoIncrement @Column(DataType.INTEGER) - exceptionId: number; + declare exceptionId: number; @Column(DataType.STRING(255)) - message: string; + declare message: string; @ForeignKey(() => GuaribasInstance) @Column(DataType.INTEGER) - instanceId: number; + declare instanceId: number; @BelongsTo(() => GuaribasInstance) - instance: GuaribasInstance; + declare instance: GuaribasInstance; @Column(DataType.DATE) @CreatedAt - createdAt: Date; + declare createdAt: Date; @Column(DataType.DATE) @UpdatedAt - updatedAt: Date; + declare updatedAt: Date; } @Table //tslint:disable-next-line:max-classes-per-file export class GuaribasApplications extends Model { @Column(DataType.STRING(255)) - name: string; + declare name: string; @ForeignKey(() => GuaribasInstance) @Column(DataType.INTEGER) - instanceId: number; + declare instanceId: number; @BelongsTo(() => GuaribasInstance) - instance: GuaribasInstance; + declare instance: GuaribasInstance; @Column(DataType.DATE) @CreatedAt - createdAt: Date; + declare createdAt: Date; @Column(DataType.DATE) @UpdatedAt - updatedAt: Date; + declare updatedAt: Date; } @Table //tslint:disable-next-line:max-classes-per-file export class GuaribasSchedule extends Model { @Column(DataType.STRING(255)) - name: string; + declare name: string; @Column(DataType.STRING(255)) - schedule: string; + declare schedule: string; @ForeignKey(() => GuaribasInstance) @Column(DataType.INTEGER) - instanceId: number; + declare instanceId: number; @BelongsTo(() => GuaribasInstance) - instance: GuaribasInstance; + declare instance: GuaribasInstance; @Column(DataType.DATE) @CreatedAt - createdAt: Date; + declare createdAt: Date; @Column(DataType.DATE) @UpdatedAt - updatedAt: Date; + declare updatedAt: Date; } diff --git a/packages/kb.gbapp/models/index.ts b/packages/kb.gbapp/models/index.ts index c101160b..4886e85d 100644 --- a/packages/kb.gbapp/models/index.ts +++ b/packages/kb.gbapp/models/index.ts @@ -187,52 +187,52 @@ export class GuaribasAnswer extends Model { @PrimaryKey @AutoIncrement @Column(DataType.INTEGER) - answerId: number; + declare answerId: number; @Length({ min: 0, max: 512 }) @Column(DataType.STRING(512)) - media: string; + declare media: string; @Length({ min: 0, max: 12 }) @Column(DataType.STRING(12)) - format: string; + declare format: string; @Column(DataType.TEXT) - content: string; + declare content: string; @Column(DataType.DATE) @CreatedAt - createdAt: Date; + declare createdAt: Date; @Column(DataType.DATE) @UpdatedAt - updatedAt: Date; + declare updatedAt: Date; @HasMany(() => GuaribasQuestion) - questions: GuaribasQuestion[]; + declare questions: GuaribasQuestion[]; @HasOne(() => GuaribasQuestion) - prev: GuaribasQuestion; + declare prev: GuaribasQuestion; @HasOne(() => GuaribasQuestion) - next: GuaribasQuestion; + declare next: GuaribasQuestion; @ForeignKey(() => GuaribasQuestion) @Column(DataType.INTEGER) - nextId: number; + declare nextId: number; @ForeignKey(() => GuaribasQuestion) @Column(DataType.INTEGER) - prevId: number; + declare prevId: number; @ForeignKey(() => GuaribasInstance) @Column(DataType.INTEGER) - instanceId: number; + declare instanceId: number; @ForeignKey(() => GuaribasPackage) @Column(DataType.INTEGER) - packageId: number; + declare packageId: number; @BelongsTo(() => GuaribasPackage) - package: GuaribasPackage; + declare package: GuaribasPackage; } diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index cfe6267b..4a6a8302 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -36,7 +36,6 @@ import Path from 'path'; import Fs from 'fs'; import { GBLog, GBMinInstance, GBService, IGBPackage } from 'botlib'; import { CollectionUtil } from 'pragmatismo-io-framework'; -import * as request from 'request-promise-native'; import { GBServer } from '../../../src/app.js'; import { GBConversationalService } from '../../core.gbapp/services/GBConversationalService.js'; import { SecService } from '../../security.gbapp/services/SecService.js'; @@ -116,6 +115,8 @@ export class WhatsappDirectLine extends GBService { usePromise: true }); const client = await this.directLineClient; + let url; + let body; client.clientAuthorizations.add( 'AuthorizationBotConnector', @@ -246,9 +247,10 @@ export class WhatsappDirectLine extends GBService { break; case 'chatapi': + url = urlJoin(this.whatsappServiceUrl, 'webhook') options = { method: 'POST', - url: urlJoin(this.whatsappServiceUrl, 'webhook'), + url: url, timeout: 10000, qs: { token: this.whatsappServiceKey, @@ -264,16 +266,17 @@ export class WhatsappDirectLine extends GBService { case 'maytapi': let phoneId = this.whatsappServiceNumber.split(';')[0]; let productId = this.whatsappServiceNumber.split(';')[1]; - let url = `${this.INSTANCE_URL}/${productId}/${phoneId}/config`; + url = `${this.INSTANCE_URL}/${productId}/${phoneId}/config`; + body= { + webhook: `${GBServer.globals.publicAddress}/webhooks/whatsapp/${this.botId}`, + ack_delivery: false + }; WhatsappDirectLine.phones[phoneId] = this.botId; options = { url: url, method: 'POST', - body: { - webhook: `${GBServer.globals.publicAddress}/webhooks/whatsapp/${this.botId}`, - ack_delivery: false - }, + body:body, headers: { 'x-maytapi-key': this.whatsappServiceKey, 'Content-Type': 'application/json' @@ -288,7 +291,9 @@ export class WhatsappDirectLine extends GBService { if (options) { try { - await request.post(options); + + const response: Response = await fetch(url,options); + } catch (error) { GBLog.error(`Error initializing 3rd party Whatsapp provider(1) ${error.message}`); }