write service_provider_sid with alerts

This commit is contained in:
Dave Horton
2022-09-07 23:51:40 +02:00
parent e90ef6bc70
commit 889257d7db
14 changed files with 85 additions and 175 deletions

View File

@@ -9,8 +9,8 @@ const MAX_RECONNECTS = 5;
const RESPONSE_TIMEOUT_MS = process.env.JAMBONES_WS_API_MSG_RESPONSE_TIMEOUT || 5000;
class WsRequestor extends BaseRequestor {
constructor(logger, account_sid, hook, secret) {
super(logger, account_sid, hook, secret);
constructor(logger, service_provider_sid, account_sid, hook, secret) {
super(logger, service_provider_sid, account_sid, hook, secret);
this.connections = 0;
this.messagesInFlight = new Map();
this.maliciousClient = false;
@@ -54,7 +54,7 @@ class WsRequestor extends BaseRequestor {
/* if we have an absolute url, and it is http then do a standard webhook */
if (this._isAbsoluteUrl(url) && url.startsWith('http')) {
this.logger.debug({hook}, 'WsRequestor: sending a webhook (HTTP)');
const requestor = new HttpRequestor(this.logger, this.account_sid, hook, this.secret);
const requestor = new HttpRequestor(this.logger, this.service_provider_sid, this.account_sid, hook, this.secret);
return requestor.request(type, hook, params, httpHeaders);
}