@wildix/wda-stream-client 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MatchNotFoundException = exports.WebsocketTopic = exports.WebsocketEvent = exports.WebhookEventType = exports.PresenceEventType = exports.PresenceAnalyticsEventType = exports.ConsumeEventInputEvent = exports.SmsStatus = exports.SmsChannelType = exports.SmsConsumeEventType = exports.ConferenceEventType = exports.ConferenceConsumeEventType = exports.ChatEventType = exports.ChatConsumeEventType = exports.ChatTag = exports.ChatStatus = exports.ChatParticipantType = exports.ChatParticipantRole = exports.ChatDirection = exports.ChannelType = exports.CallFlowConsumeStatus = exports.CallEventType = exports.CallEndConsume = exports.CallFlowAttachmentConsumeType = exports.CallEndBy = exports.CallFlowStatus = exports.CallAnalyticsLiveProgressEventTrigger = exports.LiveEventType = exports.CallConsumeEventType = exports.ConferenceTranscriptionStatus = exports.ConferenceParticipantType = exports.ConferenceParticipantRole = exports.PbxLicenseType = exports.ConferenceDirection = exports.CallTranscriptionSpeaker = exports.CallFlowTranscriptionStatus = exports.CallRecordPauseReason = exports.CallRecordOwner = exports.License = exports.CallDirection = exports.ConversationStatus = exports.CallDevice = exports.CallParticipantType = exports.CallParticipantRole = exports.CallFlowAttachmentType = exports.ForbiddenException = exports.ValidationException = void 0;
3
+ exports.MatchNotFoundException = exports.WebsocketTopic = exports.WebsocketEvent = exports.WebhookEventType = exports.PresenceEventType = exports.PresenceAnalyticsEventType = exports.ConsumeEventInputEvent = exports.SmsStatus = exports.SmsChannelType = exports.SmsConsumeEventType = exports.ConferenceEventType = exports.ConferenceConsumeEventType = exports.ChatEventType = exports.ChatConsumeEventType = exports.ChatTag = exports.ChatStatus = exports.ChatParticipantType = exports.ChatParticipantRole = exports.ChatDirection = exports.ChannelType = exports.CallFlowConsumeStatus = exports.CallEventType = exports.CallEndConsume = exports.CallFlowAttachmentConsumeType = exports.CallEndBy = exports.CallFlowStatus = exports.CallAnalyticsLiveProgressEventTrigger = exports.LiveEventType = exports.CallConsumeEventType = exports.ConferenceTranscriptionStatus = exports.ConferenceParticipantType = exports.ConferenceParticipantRole = exports.PbxLicenseType = exports.ConferenceDirection = exports.CallTranscriptionSpeaker = exports.CallFlowTranscriptionStatus = exports.CallRecordPauseReason = exports.CallRecordOwner = exports.License = exports.CallDirection = exports.ConversationStatus = exports.CallDevice = exports.CallParticipantType = exports.CallParticipantRole = exports.CallFlowAttachmentType = exports.WhatsAppStatus = exports.WhatsAppEventType = exports.ForbiddenException = exports.ValidationException = void 0;
4
4
  const WdaStreamServiceException_1 = require("./WdaStreamServiceException");
5
5
  class ValidationException extends WdaStreamServiceException_1.WdaStreamServiceException {
6
6
  constructor(opts) {
@@ -28,6 +28,18 @@ class ForbiddenException extends WdaStreamServiceException_1.WdaStreamServiceExc
28
28
  }
29
29
  }
30
30
  exports.ForbiddenException = ForbiddenException;
31
+ exports.WhatsAppEventType = {
32
+ WHATSAPP_INBOUND: "WHATSAPP.INBOUND",
33
+ WHATSAPP_STATUS: "WHATSAPP.STATUS",
34
+ };
35
+ exports.WhatsAppStatus = {
36
+ CHANNEL_CLOSED: "24H_CHANNEL_CLOSED",
37
+ DELETED: "DELETED",
38
+ DELIVERED: "DELIVERED",
39
+ ERROR: "ERROR",
40
+ READ: "READ",
41
+ SENT: "SENT",
42
+ };
31
43
  exports.CallFlowAttachmentType = {
32
44
  FAX: "FAX",
33
45
  VOICEMAIL: "VOICEMAIL",
@@ -207,6 +219,7 @@ exports.ChatStatus = {
207
219
  exports.ChatTag = {
208
220
  SMS: "sms",
209
221
  TELEPHONY: "telephony",
222
+ WHATSAPP: "whatsapp",
210
223
  };
211
224
  exports.ChatConsumeEventType = {
212
225
  CHAT_NEW: "CHAT.NEW",
@@ -282,6 +295,10 @@ var ConsumeEventInputEvent;
282
295
  return visitor.smsInbound(value.smsInbound);
283
296
  if (value.smsStatus !== undefined)
284
297
  return visitor.smsStatus(value.smsStatus);
298
+ if (value.whatsappInbound !== undefined)
299
+ return visitor.whatsappInbound(value.whatsappInbound);
300
+ if (value.whatsappStatus !== undefined)
301
+ return visitor.whatsappStatus(value.whatsappStatus);
285
302
  return visitor._(value.$unknown[0], value.$unknown[1]);
286
303
  };
287
304
  })(ConsumeEventInputEvent = exports.ConsumeEventInputEvent || (exports.ConsumeEventInputEvent = {}));
@@ -13,7 +13,7 @@ const se_ConsumeEventCommand = async (input, context) => {
13
13
  b.bp("/v2/stream/events/consume");
14
14
  let body;
15
15
  body = JSON.stringify((0, smithy_client_1.take)(input, {
16
- 'event': _ => (0, smithy_client_1._json)(_),
16
+ 'event': _ => se_ConsumeEventInputEvent(_, context),
17
17
  }));
18
18
  b.m("POST")
19
19
  .h(headers)
@@ -31,6 +31,8 @@ const se_DescribeEventCommand = async (input, context) => {
31
31
  body = JSON.stringify((0, smithy_client_1.take)(input, {
32
32
  'SmsInboundEvent': _ => (0, smithy_client_1._json)(_),
33
33
  'SmsStatusEvent': _ => (0, smithy_client_1._json)(_),
34
+ 'WhatsAppInboundEvent': _ => se_WhatsAppInboundEvent(_, context),
35
+ 'WhatsAppStatusEvent': _ => se_WhatsAppStatusEvent(_, context),
34
36
  }));
35
37
  b.m("POST")
36
38
  .h(headers)
@@ -245,6 +247,65 @@ const de_MatchNotFoundExceptionRes = async (parsedOutput, context) => {
245
247
  });
246
248
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
247
249
  };
250
+ const se_ConsumeEventInputEvent = (input, context) => {
251
+ return models_0_1.ConsumeEventInputEvent.visit(input, {
252
+ callAgentsCancel: value => ({ "callAgentsCancel": (0, smithy_client_1._json)(value) }),
253
+ callAgentsStart: value => ({ "callAgentsStart": (0, smithy_client_1._json)(value) }),
254
+ callAttachment: value => ({ "callAttachment": (0, smithy_client_1._json)(value) }),
255
+ callEnd: value => ({ "callEnd": (0, smithy_client_1._json)(value) }),
256
+ callLive: value => ({ "callLive": (0, smithy_client_1._json)(value) }),
257
+ callRecordStart: value => ({ "callRecordStart": (0, smithy_client_1._json)(value) }),
258
+ callRecordStop: value => ({ "callRecordStop": (0, smithy_client_1._json)(value) }),
259
+ callSplit: value => ({ "callSplit": (0, smithy_client_1._json)(value) }),
260
+ callStart: value => ({ "callStart": (0, smithy_client_1._json)(value) }),
261
+ callTranscription: value => ({ "callTranscription": (0, smithy_client_1._json)(value) }),
262
+ callUpdate: value => ({ "callUpdate": (0, smithy_client_1._json)(value) }),
263
+ chatNew: value => ({ "chatNew": (0, smithy_client_1._json)(value) }),
264
+ chatUpdate: value => ({ "chatUpdate": (0, smithy_client_1._json)(value) }),
265
+ conferenceTimeFrames: value => ({ "conferenceTimeFrames": (0, smithy_client_1._json)(value) }),
266
+ smsInbound: value => ({ "smsInbound": (0, smithy_client_1._json)(value) }),
267
+ smsStatus: value => ({ "smsStatus": (0, smithy_client_1._json)(value) }),
268
+ whatsappInbound: value => ({ "whatsappInbound": se_WhatsAppInboundConsumeEvent(value, context) }),
269
+ whatsappStatus: value => ({ "whatsappStatus": se_WhatsAppStatusConsumeEvent(value, context) }),
270
+ _: (name, value) => ({ name: value })
271
+ });
272
+ };
273
+ const se_WhatsAppInboundConsumeEvent = (input, context) => {
274
+ return (0, smithy_client_1.take)(input, {
275
+ 'company': [],
276
+ 'data': smithy_client_1._json,
277
+ 'pbx': [],
278
+ 'time': _ => Math.round(_.getTime() / 1000),
279
+ 'type': [],
280
+ });
281
+ };
282
+ const se_WhatsAppInboundEvent = (input, context) => {
283
+ return (0, smithy_client_1.take)(input, {
284
+ 'company': [],
285
+ 'data': smithy_client_1._json,
286
+ 'pbx': [],
287
+ 'time': _ => Math.round(_.getTime() / 1000),
288
+ 'type': [],
289
+ });
290
+ };
291
+ const se_WhatsAppStatusConsumeEvent = (input, context) => {
292
+ return (0, smithy_client_1.take)(input, {
293
+ 'company': [],
294
+ 'data': smithy_client_1._json,
295
+ 'pbx': [],
296
+ 'time': _ => Math.round(_.getTime() / 1000),
297
+ 'type': [],
298
+ });
299
+ };
300
+ const se_WhatsAppStatusEvent = (input, context) => {
301
+ return (0, smithy_client_1.take)(input, {
302
+ 'company': [],
303
+ 'data': smithy_client_1._json,
304
+ 'pbx': [],
305
+ 'time': _ => Math.round(_.getTime() / 1000),
306
+ 'type': [],
307
+ });
308
+ };
248
309
  const de_Document = (output, context) => {
249
310
  return output;
250
311
  };
@@ -23,6 +23,18 @@ export class ForbiddenException extends __BaseException {
23
23
  Object.setPrototypeOf(this, ForbiddenException.prototype);
24
24
  }
25
25
  }
26
+ export const WhatsAppEventType = {
27
+ WHATSAPP_INBOUND: "WHATSAPP.INBOUND",
28
+ WHATSAPP_STATUS: "WHATSAPP.STATUS",
29
+ };
30
+ export const WhatsAppStatus = {
31
+ CHANNEL_CLOSED: "24H_CHANNEL_CLOSED",
32
+ DELETED: "DELETED",
33
+ DELIVERED: "DELIVERED",
34
+ ERROR: "ERROR",
35
+ READ: "READ",
36
+ SENT: "SENT",
37
+ };
26
38
  export const CallFlowAttachmentType = {
27
39
  FAX: "FAX",
28
40
  VOICEMAIL: "VOICEMAIL",
@@ -202,6 +214,7 @@ export const ChatStatus = {
202
214
  export const ChatTag = {
203
215
  SMS: "sms",
204
216
  TELEPHONY: "telephony",
217
+ WHATSAPP: "whatsapp",
205
218
  };
206
219
  export const ChatConsumeEventType = {
207
220
  CHAT_NEW: "CHAT.NEW",
@@ -277,6 +290,10 @@ export var ConsumeEventInputEvent;
277
290
  return visitor.smsInbound(value.smsInbound);
278
291
  if (value.smsStatus !== undefined)
279
292
  return visitor.smsStatus(value.smsStatus);
293
+ if (value.whatsappInbound !== undefined)
294
+ return visitor.whatsappInbound(value.whatsappInbound);
295
+ if (value.whatsappStatus !== undefined)
296
+ return visitor.whatsappStatus(value.whatsappStatus);
280
297
  return visitor._(value.$unknown[0], value.$unknown[1]);
281
298
  };
282
299
  })(ConsumeEventInputEvent || (ConsumeEventInputEvent = {}));
@@ -1,5 +1,5 @@
1
1
  import { WdaStreamServiceException as __BaseException } from "../models/WdaStreamServiceException";
2
- import { ForbiddenException, MatchNotFoundException, ValidationException, } from "../models/models_0";
2
+ import { ConsumeEventInputEvent, ForbiddenException, MatchNotFoundException, ValidationException, } from "../models/models_0";
3
3
  import { requestBuilder as rb } from "@smithy/core";
4
4
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
5
  export const se_ConsumeEventCommand = async (input, context) => {
@@ -10,7 +10,7 @@ export const se_ConsumeEventCommand = async (input, context) => {
10
10
  b.bp("/v2/stream/events/consume");
11
11
  let body;
12
12
  body = JSON.stringify(take(input, {
13
- 'event': _ => _json(_),
13
+ 'event': _ => se_ConsumeEventInputEvent(_, context),
14
14
  }));
15
15
  b.m("POST")
16
16
  .h(headers)
@@ -27,6 +27,8 @@ export const se_DescribeEventCommand = async (input, context) => {
27
27
  body = JSON.stringify(take(input, {
28
28
  'SmsInboundEvent': _ => _json(_),
29
29
  'SmsStatusEvent': _ => _json(_),
30
+ 'WhatsAppInboundEvent': _ => se_WhatsAppInboundEvent(_, context),
31
+ 'WhatsAppStatusEvent': _ => se_WhatsAppStatusEvent(_, context),
30
32
  }));
31
33
  b.m("POST")
32
34
  .h(headers)
@@ -234,6 +236,65 @@ const de_MatchNotFoundExceptionRes = async (parsedOutput, context) => {
234
236
  });
235
237
  return __decorateServiceException(exception, parsedOutput.body);
236
238
  };
239
+ const se_ConsumeEventInputEvent = (input, context) => {
240
+ return ConsumeEventInputEvent.visit(input, {
241
+ callAgentsCancel: value => ({ "callAgentsCancel": _json(value) }),
242
+ callAgentsStart: value => ({ "callAgentsStart": _json(value) }),
243
+ callAttachment: value => ({ "callAttachment": _json(value) }),
244
+ callEnd: value => ({ "callEnd": _json(value) }),
245
+ callLive: value => ({ "callLive": _json(value) }),
246
+ callRecordStart: value => ({ "callRecordStart": _json(value) }),
247
+ callRecordStop: value => ({ "callRecordStop": _json(value) }),
248
+ callSplit: value => ({ "callSplit": _json(value) }),
249
+ callStart: value => ({ "callStart": _json(value) }),
250
+ callTranscription: value => ({ "callTranscription": _json(value) }),
251
+ callUpdate: value => ({ "callUpdate": _json(value) }),
252
+ chatNew: value => ({ "chatNew": _json(value) }),
253
+ chatUpdate: value => ({ "chatUpdate": _json(value) }),
254
+ conferenceTimeFrames: value => ({ "conferenceTimeFrames": _json(value) }),
255
+ smsInbound: value => ({ "smsInbound": _json(value) }),
256
+ smsStatus: value => ({ "smsStatus": _json(value) }),
257
+ whatsappInbound: value => ({ "whatsappInbound": se_WhatsAppInboundConsumeEvent(value, context) }),
258
+ whatsappStatus: value => ({ "whatsappStatus": se_WhatsAppStatusConsumeEvent(value, context) }),
259
+ _: (name, value) => ({ name: value })
260
+ });
261
+ };
262
+ const se_WhatsAppInboundConsumeEvent = (input, context) => {
263
+ return take(input, {
264
+ 'company': [],
265
+ 'data': _json,
266
+ 'pbx': [],
267
+ 'time': _ => Math.round(_.getTime() / 1000),
268
+ 'type': [],
269
+ });
270
+ };
271
+ const se_WhatsAppInboundEvent = (input, context) => {
272
+ return take(input, {
273
+ 'company': [],
274
+ 'data': _json,
275
+ 'pbx': [],
276
+ 'time': _ => Math.round(_.getTime() / 1000),
277
+ 'type': [],
278
+ });
279
+ };
280
+ const se_WhatsAppStatusConsumeEvent = (input, context) => {
281
+ return take(input, {
282
+ 'company': [],
283
+ 'data': _json,
284
+ 'pbx': [],
285
+ 'time': _ => Math.round(_.getTime() / 1000),
286
+ 'type': [],
287
+ });
288
+ };
289
+ const se_WhatsAppStatusEvent = (input, context) => {
290
+ return take(input, {
291
+ 'company': [],
292
+ 'data': _json,
293
+ 'pbx': [],
294
+ 'time': _ => Math.round(_.getTime() / 1000),
295
+ 'type': [],
296
+ });
297
+ };
237
298
  const de_Document = (output, context) => {
238
299
  return output;
239
300
  };
@@ -393,7 +393,7 @@ declare const ConsumeEventCommand_base: {
393
393
  * customersCount: Number("int"), // required
394
394
  * },
395
395
  * tags: [ // ChatTags
396
- * "sms" || "telephony",
396
+ * "sms" || "telephony" || "whatsapp",
397
397
  * ],
398
398
  * sender: {
399
399
  * id: "STRING_VALUE", // required
@@ -467,7 +467,7 @@ declare const ConsumeEventCommand_base: {
467
467
  * customersCount: Number("int"), // required
468
468
  * },
469
469
  * tags: [
470
- * "sms" || "telephony",
470
+ * "sms" || "telephony" || "whatsapp",
471
471
  * ],
472
472
  * },
473
473
  * },
@@ -497,6 +497,36 @@ declare const ConsumeEventCommand_base: {
497
497
  * parts: Number("int"), // required
498
498
  * },
499
499
  * },
500
+ * whatsappInbound: { // WhatsAppInboundConsumeEvent
501
+ * pbx: "STRING_VALUE", // required
502
+ * company: "STRING_VALUE", // required
503
+ * time: new Date("TIMESTAMP"), // required
504
+ * type: "WHATSAPP.INBOUND" || "WHATSAPP.STATUS", // required
505
+ * data: { // WhatsAppInboundEventData
506
+ * from: "STRING_VALUE", // required
507
+ * to: "STRING_VALUE", // required
508
+ * id: "STRING_VALUE", // required
509
+ * message: "STRING_VALUE", // required
510
+ * media: [ // StringList
511
+ * "STRING_VALUE",
512
+ * ],
513
+ * },
514
+ * },
515
+ * whatsappStatus: { // WhatsAppStatusConsumeEvent
516
+ * pbx: "STRING_VALUE", // required
517
+ * company: "STRING_VALUE", // required
518
+ * time: new Date("TIMESTAMP"), // required
519
+ * type: "WHATSAPP.INBOUND" || "WHATSAPP.STATUS", // required
520
+ * data: { // WhatsAppStatusEventData
521
+ * from: "STRING_VALUE", // required
522
+ * to: "STRING_VALUE", // required
523
+ * id: "STRING_VALUE", // required
524
+ * status: "SENT" || "DELIVERED" || "ERROR" || "READ" || "DELETED" || "24H_CHANNEL_CLOSED", // required
525
+ * reason: "STRING_VALUE", // required
526
+ * channel: "STRING_VALUE",
527
+ * parts: Number("int"),
528
+ * },
529
+ * },
500
530
  * },
501
531
  * };
502
532
  * const command = new ConsumeEventCommand(input);
@@ -61,6 +61,36 @@ declare const DescribeEventCommand_base: {
61
61
  * parts: Number("int"), // required
62
62
  * },
63
63
  * },
64
+ * WhatsAppInboundEvent: { // WhatsAppInboundEvent
65
+ * pbx: "STRING_VALUE", // required
66
+ * company: "STRING_VALUE", // required
67
+ * time: new Date("TIMESTAMP"), // required
68
+ * type: "WHATSAPP.INBOUND" || "WHATSAPP.STATUS", // required
69
+ * data: { // WhatsAppInboundEventData
70
+ * from: "STRING_VALUE", // required
71
+ * to: "STRING_VALUE", // required
72
+ * id: "STRING_VALUE", // required
73
+ * message: "STRING_VALUE", // required
74
+ * media: [ // StringList
75
+ * "STRING_VALUE",
76
+ * ],
77
+ * },
78
+ * },
79
+ * WhatsAppStatusEvent: { // WhatsAppStatusEvent
80
+ * pbx: "STRING_VALUE", // required
81
+ * company: "STRING_VALUE", // required
82
+ * time: new Date("TIMESTAMP"), // required
83
+ * type: "WHATSAPP.INBOUND" || "WHATSAPP.STATUS", // required
84
+ * data: { // WhatsAppStatusEventData
85
+ * from: "STRING_VALUE", // required
86
+ * to: "STRING_VALUE", // required
87
+ * id: "STRING_VALUE", // required
88
+ * status: "SENT" || "DELIVERED" || "ERROR" || "READ" || "DELETED" || "24H_CHANNEL_CLOSED", // required
89
+ * reason: "STRING_VALUE", // required
90
+ * channel: "STRING_VALUE",
91
+ * parts: Number("int"),
92
+ * },
93
+ * },
64
94
  * };
65
95
  * const command = new DescribeEventCommand(input);
66
96
  * const response = await client.send(command);
@@ -514,7 +544,7 @@ declare const DescribeEventCommand_base: {
514
544
  * // ],
515
545
  * // customersCount: Number("int"), // required
516
546
  * // tags: [ // ChatTags
517
- * // "sms" || "telephony",
547
+ * // "sms" || "telephony" || "whatsapp",
518
548
  * // ],
519
549
  * // direction: "INTERNAL" || "INBOUND" || "OUTBOUND", // required
520
550
  * // status: "WAITFIRSTREPLY" || "WAITREPLYFROMGUEST" || "WAITREPLYFROMAGENT" || "COMPLETED" || "MISSED", // required
@@ -536,7 +566,7 @@ declare const DescribeEventCommand_base: {
536
566
  * // service: "STRING_VALUE",
537
567
  * // serviceTitle: "STRING_VALUE",
538
568
  * // tags: [
539
- * // "sms" || "telephony",
569
+ * // "sms" || "telephony" || "whatsapp",
540
570
  * // ],
541
571
  * // status: "WAITFIRSTREPLY" || "WAITREPLYFROMGUEST" || "WAITREPLYFROMAGENT" || "COMPLETED" || "MISSED",
542
572
  * // participants: [ // ChatAnalyticsRecordParticipantList
@@ -1342,7 +1372,7 @@ declare const DescribeEventCommand_base: {
1342
1372
  * // ],
1343
1373
  * // customersCount: Number("int"), // required
1344
1374
  * // tags: [
1345
- * // "sms" || "telephony",
1375
+ * // "sms" || "telephony" || "whatsapp",
1346
1376
  * // ],
1347
1377
  * // direction: "INTERNAL" || "INBOUND" || "OUTBOUND", // required
1348
1378
  * // status: "WAITFIRSTREPLY" || "WAITREPLYFROMGUEST" || "WAITREPLYFROMAGENT" || "COMPLETED" || "MISSED", // required
@@ -1408,7 +1438,7 @@ declare const DescribeEventCommand_base: {
1408
1438
  * // service: "STRING_VALUE",
1409
1439
  * // serviceTitle: "STRING_VALUE",
1410
1440
  * // tags: [
1411
- * // "sms" || "telephony",
1441
+ * // "sms" || "telephony" || "whatsapp",
1412
1442
  * // ],
1413
1443
  * // status: "WAITFIRSTREPLY" || "WAITREPLYFROMGUEST" || "WAITREPLYFROMAGENT" || "COMPLETED" || "MISSED",
1414
1444
  * // participants: [
@@ -1428,38 +1458,8 @@ declare const DescribeEventCommand_base: {
1428
1458
  * // integrationId: "STRING_VALUE", // required
1429
1459
  * // data: { // WebhookOutdatedCallEventData
1430
1460
  * // status: "STRING_VALUE",
1431
- * // caller: { // WebhookOutdatedCallParticipant
1432
- * // type: "STRING_VALUE", // required
1433
- * // phone: "STRING_VALUE",
1434
- * // name: "STRING_VALUE",
1435
- * // company: "STRING_VALUE",
1436
- * // email: "STRING_VALUE",
1437
- * // userId: "STRING_VALUE",
1438
- * // userExtension: "STRING_VALUE",
1439
- * // userDepartment: "STRING_VALUE",
1440
- * // groupId: "STRING_VALUE",
1441
- * // groupName: "STRING_VALUE",
1442
- * // userAgent: "STRING_VALUE",
1443
- * // userDevice: "COLLABORATION_WEB" || "COLLABORATION_IOS" || "COLLABORATION_ANDROID" || "XBEES_WEB" || "XBEES_IOS" || "XBEES_ANDROID" || "WILDIX_PHONE" || "WILDIX_DEVICE" || "UNKNOWN",
1444
- * // role: "STRING_VALUE", // required
1445
- * // license: "STRING_VALUE",
1446
- * // },
1447
- * // callee: {
1448
- * // type: "STRING_VALUE", // required
1449
- * // phone: "STRING_VALUE",
1450
- * // name: "STRING_VALUE",
1451
- * // company: "STRING_VALUE",
1452
- * // email: "STRING_VALUE",
1453
- * // userId: "STRING_VALUE",
1454
- * // userExtension: "STRING_VALUE",
1455
- * // userDepartment: "STRING_VALUE",
1456
- * // groupId: "STRING_VALUE",
1457
- * // groupName: "STRING_VALUE",
1458
- * // userAgent: "STRING_VALUE",
1459
- * // userDevice: "COLLABORATION_WEB" || "COLLABORATION_IOS" || "COLLABORATION_ANDROID" || "XBEES_WEB" || "XBEES_IOS" || "XBEES_ANDROID" || "WILDIX_PHONE" || "WILDIX_DEVICE" || "UNKNOWN",
1460
- * // role: "STRING_VALUE", // required
1461
- * // license: "STRING_VALUE",
1462
- * // },
1461
+ * // caller: "<CallParticipant>",
1462
+ * // callee: "<CallParticipant>",
1463
1463
  * // service: "STRING_VALUE",
1464
1464
  * // destination: "STRING_VALUE",
1465
1465
  * // trunkName: "STRING_VALUE",
@@ -1481,38 +1481,8 @@ declare const DescribeEventCommand_base: {
1481
1481
  * // integrationId: "STRING_VALUE", // required
1482
1482
  * // data: {
1483
1483
  * // status: "STRING_VALUE",
1484
- * // caller: {
1485
- * // type: "STRING_VALUE", // required
1486
- * // phone: "STRING_VALUE",
1487
- * // name: "STRING_VALUE",
1488
- * // company: "STRING_VALUE",
1489
- * // email: "STRING_VALUE",
1490
- * // userId: "STRING_VALUE",
1491
- * // userExtension: "STRING_VALUE",
1492
- * // userDepartment: "STRING_VALUE",
1493
- * // groupId: "STRING_VALUE",
1494
- * // groupName: "STRING_VALUE",
1495
- * // userAgent: "STRING_VALUE",
1496
- * // userDevice: "COLLABORATION_WEB" || "COLLABORATION_IOS" || "COLLABORATION_ANDROID" || "XBEES_WEB" || "XBEES_IOS" || "XBEES_ANDROID" || "WILDIX_PHONE" || "WILDIX_DEVICE" || "UNKNOWN",
1497
- * // role: "STRING_VALUE", // required
1498
- * // license: "STRING_VALUE",
1499
- * // },
1500
- * // callee: {
1501
- * // type: "STRING_VALUE", // required
1502
- * // phone: "STRING_VALUE",
1503
- * // name: "STRING_VALUE",
1504
- * // company: "STRING_VALUE",
1505
- * // email: "STRING_VALUE",
1506
- * // userId: "STRING_VALUE",
1507
- * // userExtension: "STRING_VALUE",
1508
- * // userDepartment: "STRING_VALUE",
1509
- * // groupId: "STRING_VALUE",
1510
- * // groupName: "STRING_VALUE",
1511
- * // userAgent: "STRING_VALUE",
1512
- * // userDevice: "COLLABORATION_WEB" || "COLLABORATION_IOS" || "COLLABORATION_ANDROID" || "XBEES_WEB" || "XBEES_IOS" || "XBEES_ANDROID" || "WILDIX_PHONE" || "WILDIX_DEVICE" || "UNKNOWN",
1513
- * // role: "STRING_VALUE", // required
1514
- * // license: "STRING_VALUE",
1515
- * // },
1484
+ * // caller: "<CallParticipant>",
1485
+ * // callee: "<CallParticipant>",
1516
1486
  * // service: "STRING_VALUE",
1517
1487
  * // destination: "STRING_VALUE",
1518
1488
  * // trunkName: "STRING_VALUE",
@@ -1534,23 +1504,8 @@ declare const DescribeEventCommand_base: {
1534
1504
  * // integrationId: "STRING_VALUE", // required
1535
1505
  * // data: {
1536
1506
  * // status: "STRING_VALUE",
1537
- * // caller: {
1538
- * // type: "STRING_VALUE", // required
1539
- * // phone: "STRING_VALUE",
1540
- * // name: "STRING_VALUE",
1541
- * // company: "STRING_VALUE",
1542
- * // email: "STRING_VALUE",
1543
- * // userId: "STRING_VALUE",
1544
- * // userExtension: "STRING_VALUE",
1545
- * // userDepartment: "STRING_VALUE",
1546
- * // groupId: "STRING_VALUE",
1547
- * // groupName: "STRING_VALUE",
1548
- * // userAgent: "STRING_VALUE",
1549
- * // userDevice: "COLLABORATION_WEB" || "COLLABORATION_IOS" || "COLLABORATION_ANDROID" || "XBEES_WEB" || "XBEES_IOS" || "XBEES_ANDROID" || "WILDIX_PHONE" || "WILDIX_DEVICE" || "UNKNOWN",
1550
- * // role: "STRING_VALUE", // required
1551
- * // license: "STRING_VALUE",
1552
- * // },
1553
- * // callee: "<WebhookOutdatedCallParticipant>",
1507
+ * // caller: "<CallParticipant>",
1508
+ * // callee: "<CallParticipant>",
1554
1509
  * // service: "STRING_VALUE",
1555
1510
  * // destination: "STRING_VALUE",
1556
1511
  * // trunkName: "STRING_VALUE",
@@ -264,7 +264,7 @@ declare const GetConversationsCommand_base: {
264
264
  * // ],
265
265
  * // customersCount: Number("int"), // required
266
266
  * // tags: [ // ChatTags
267
- * // "sms" || "telephony",
267
+ * // "sms" || "telephony" || "whatsapp",
268
268
  * // ],
269
269
  * // direction: "INTERNAL" || "INBOUND" || "OUTBOUND", // required
270
270
  * // status: "WAITFIRSTREPLY" || "WAITREPLYFROMGUEST" || "WAITREPLYFROMAGENT" || "COMPLETED" || "MISSED", // required
@@ -23,6 +23,60 @@ export declare class ForbiddenException extends __BaseException {
23
23
  */
24
24
  constructor(opts: __ExceptionOptionType<ForbiddenException, __BaseException>);
25
25
  }
26
+ /**
27
+ * @public
28
+ * @enum
29
+ */
30
+ export declare const WhatsAppEventType: {
31
+ readonly WHATSAPP_INBOUND: "WHATSAPP.INBOUND";
32
+ readonly WHATSAPP_STATUS: "WHATSAPP.STATUS";
33
+ };
34
+ /**
35
+ * @public
36
+ */
37
+ export type WhatsAppEventType = typeof WhatsAppEventType[keyof typeof WhatsAppEventType];
38
+ /**
39
+ * @public
40
+ */
41
+ export interface WhatsAppInboundEventData {
42
+ from: string;
43
+ to: string;
44
+ /**
45
+ * A unique ID of the WhatsApp message
46
+ * @public
47
+ */
48
+ id: string;
49
+ message: string;
50
+ media?: (string)[];
51
+ }
52
+ /**
53
+ * @public
54
+ * @enum
55
+ */
56
+ export declare const WhatsAppStatus: {
57
+ readonly CHANNEL_CLOSED: "24H_CHANNEL_CLOSED";
58
+ readonly DELETED: "DELETED";
59
+ readonly DELIVERED: "DELIVERED";
60
+ readonly ERROR: "ERROR";
61
+ readonly READ: "READ";
62
+ readonly SENT: "SENT";
63
+ };
64
+ /**
65
+ * @public
66
+ */
67
+ export type WhatsAppStatus = typeof WhatsAppStatus[keyof typeof WhatsAppStatus];
68
+ /**
69
+ * @public
70
+ */
71
+ export interface WhatsAppStatusEventData {
72
+ from: string;
73
+ to: string;
74
+ id: string;
75
+ status: WhatsAppStatus;
76
+ reason: string;
77
+ channel?: string;
78
+ parts?: number;
79
+ }
26
80
  /**
27
81
  * @public
28
82
  */
@@ -1119,6 +1173,7 @@ export type ChatStatus = typeof ChatStatus[keyof typeof ChatStatus];
1119
1173
  export declare const ChatTag: {
1120
1174
  readonly SMS: "sms";
1121
1175
  readonly TELEPHONY: "telephony";
1176
+ readonly WHATSAPP: "whatsapp";
1122
1177
  };
1123
1178
  /**
1124
1179
  * @public
@@ -1506,7 +1561,27 @@ export interface SmsStatusConsumeEvent {
1506
1561
  /**
1507
1562
  * @public
1508
1563
  */
1509
- export type ConsumeEventInputEvent = ConsumeEventInputEvent.CallAgentsCancelMember | ConsumeEventInputEvent.CallAgentsStartMember | ConsumeEventInputEvent.CallAttachmentMember | ConsumeEventInputEvent.CallEndMember | ConsumeEventInputEvent.CallLiveMember | ConsumeEventInputEvent.CallRecordStartMember | ConsumeEventInputEvent.CallRecordStopMember | ConsumeEventInputEvent.CallSplitMember | ConsumeEventInputEvent.CallStartMember | ConsumeEventInputEvent.CallTranscriptionMember | ConsumeEventInputEvent.CallUpdateMember | ConsumeEventInputEvent.ChatNewMember | ConsumeEventInputEvent.ChatUpdateMember | ConsumeEventInputEvent.ConferenceTimeFramesMember | ConsumeEventInputEvent.SmsInboundMember | ConsumeEventInputEvent.SmsStatusMember | ConsumeEventInputEvent.$UnknownMember;
1564
+ export interface WhatsAppInboundConsumeEvent {
1565
+ pbx: string;
1566
+ company: string;
1567
+ time: Date;
1568
+ type: WhatsAppEventType;
1569
+ data: WhatsAppInboundEventData;
1570
+ }
1571
+ /**
1572
+ * @public
1573
+ */
1574
+ export interface WhatsAppStatusConsumeEvent {
1575
+ pbx: string;
1576
+ company: string;
1577
+ time: Date;
1578
+ type: WhatsAppEventType;
1579
+ data: WhatsAppStatusEventData;
1580
+ }
1581
+ /**
1582
+ * @public
1583
+ */
1584
+ export type ConsumeEventInputEvent = ConsumeEventInputEvent.CallAgentsCancelMember | ConsumeEventInputEvent.CallAgentsStartMember | ConsumeEventInputEvent.CallAttachmentMember | ConsumeEventInputEvent.CallEndMember | ConsumeEventInputEvent.CallLiveMember | ConsumeEventInputEvent.CallRecordStartMember | ConsumeEventInputEvent.CallRecordStopMember | ConsumeEventInputEvent.CallSplitMember | ConsumeEventInputEvent.CallStartMember | ConsumeEventInputEvent.CallTranscriptionMember | ConsumeEventInputEvent.CallUpdateMember | ConsumeEventInputEvent.ChatNewMember | ConsumeEventInputEvent.ChatUpdateMember | ConsumeEventInputEvent.ConferenceTimeFramesMember | ConsumeEventInputEvent.SmsInboundMember | ConsumeEventInputEvent.SmsStatusMember | ConsumeEventInputEvent.WhatsappInboundMember | ConsumeEventInputEvent.WhatsappStatusMember | ConsumeEventInputEvent.$UnknownMember;
1510
1585
  /**
1511
1586
  * @public
1512
1587
  */
@@ -1528,6 +1603,8 @@ export declare namespace ConsumeEventInputEvent {
1528
1603
  chatUpdate?: never;
1529
1604
  smsInbound?: never;
1530
1605
  smsStatus?: never;
1606
+ whatsappInbound?: never;
1607
+ whatsappStatus?: never;
1531
1608
  $unknown?: never;
1532
1609
  }
1533
1610
  interface CallUpdateMember {
@@ -1547,6 +1624,8 @@ export declare namespace ConsumeEventInputEvent {
1547
1624
  chatUpdate?: never;
1548
1625
  smsInbound?: never;
1549
1626
  smsStatus?: never;
1627
+ whatsappInbound?: never;
1628
+ whatsappStatus?: never;
1550
1629
  $unknown?: never;
1551
1630
  }
1552
1631
  interface CallSplitMember {
@@ -1566,6 +1645,8 @@ export declare namespace ConsumeEventInputEvent {
1566
1645
  chatUpdate?: never;
1567
1646
  smsInbound?: never;
1568
1647
  smsStatus?: never;
1648
+ whatsappInbound?: never;
1649
+ whatsappStatus?: never;
1569
1650
  $unknown?: never;
1570
1651
  }
1571
1652
  interface CallLiveMember {
@@ -1585,6 +1666,8 @@ export declare namespace ConsumeEventInputEvent {
1585
1666
  chatUpdate?: never;
1586
1667
  smsInbound?: never;
1587
1668
  smsStatus?: never;
1669
+ whatsappInbound?: never;
1670
+ whatsappStatus?: never;
1588
1671
  $unknown?: never;
1589
1672
  }
1590
1673
  interface CallAgentsStartMember {
@@ -1604,6 +1687,8 @@ export declare namespace ConsumeEventInputEvent {
1604
1687
  chatUpdate?: never;
1605
1688
  smsInbound?: never;
1606
1689
  smsStatus?: never;
1690
+ whatsappInbound?: never;
1691
+ whatsappStatus?: never;
1607
1692
  $unknown?: never;
1608
1693
  }
1609
1694
  interface CallAgentsCancelMember {
@@ -1623,6 +1708,8 @@ export declare namespace ConsumeEventInputEvent {
1623
1708
  chatUpdate?: never;
1624
1709
  smsInbound?: never;
1625
1710
  smsStatus?: never;
1711
+ whatsappInbound?: never;
1712
+ whatsappStatus?: never;
1626
1713
  $unknown?: never;
1627
1714
  }
1628
1715
  interface CallEndMember {
@@ -1642,6 +1729,8 @@ export declare namespace ConsumeEventInputEvent {
1642
1729
  chatUpdate?: never;
1643
1730
  smsInbound?: never;
1644
1731
  smsStatus?: never;
1732
+ whatsappInbound?: never;
1733
+ whatsappStatus?: never;
1645
1734
  $unknown?: never;
1646
1735
  }
1647
1736
  interface CallRecordStartMember {
@@ -1661,6 +1750,8 @@ export declare namespace ConsumeEventInputEvent {
1661
1750
  chatUpdate?: never;
1662
1751
  smsInbound?: never;
1663
1752
  smsStatus?: never;
1753
+ whatsappInbound?: never;
1754
+ whatsappStatus?: never;
1664
1755
  $unknown?: never;
1665
1756
  }
1666
1757
  interface CallRecordStopMember {
@@ -1680,6 +1771,8 @@ export declare namespace ConsumeEventInputEvent {
1680
1771
  chatUpdate?: never;
1681
1772
  smsInbound?: never;
1682
1773
  smsStatus?: never;
1774
+ whatsappInbound?: never;
1775
+ whatsappStatus?: never;
1683
1776
  $unknown?: never;
1684
1777
  }
1685
1778
  interface CallAttachmentMember {
@@ -1699,6 +1792,8 @@ export declare namespace ConsumeEventInputEvent {
1699
1792
  chatUpdate?: never;
1700
1793
  smsInbound?: never;
1701
1794
  smsStatus?: never;
1795
+ whatsappInbound?: never;
1796
+ whatsappStatus?: never;
1702
1797
  $unknown?: never;
1703
1798
  }
1704
1799
  interface CallTranscriptionMember {
@@ -1718,6 +1813,8 @@ export declare namespace ConsumeEventInputEvent {
1718
1813
  chatUpdate?: never;
1719
1814
  smsInbound?: never;
1720
1815
  smsStatus?: never;
1816
+ whatsappInbound?: never;
1817
+ whatsappStatus?: never;
1721
1818
  $unknown?: never;
1722
1819
  }
1723
1820
  interface ConferenceTimeFramesMember {
@@ -1737,6 +1834,8 @@ export declare namespace ConsumeEventInputEvent {
1737
1834
  chatUpdate?: never;
1738
1835
  smsInbound?: never;
1739
1836
  smsStatus?: never;
1837
+ whatsappInbound?: never;
1838
+ whatsappStatus?: never;
1740
1839
  $unknown?: never;
1741
1840
  }
1742
1841
  interface ChatNewMember {
@@ -1756,6 +1855,8 @@ export declare namespace ConsumeEventInputEvent {
1756
1855
  chatUpdate?: never;
1757
1856
  smsInbound?: never;
1758
1857
  smsStatus?: never;
1858
+ whatsappInbound?: never;
1859
+ whatsappStatus?: never;
1759
1860
  $unknown?: never;
1760
1861
  }
1761
1862
  interface ChatUpdateMember {
@@ -1775,6 +1876,8 @@ export declare namespace ConsumeEventInputEvent {
1775
1876
  chatUpdate: ChatUpdateConsumeEvent;
1776
1877
  smsInbound?: never;
1777
1878
  smsStatus?: never;
1879
+ whatsappInbound?: never;
1880
+ whatsappStatus?: never;
1778
1881
  $unknown?: never;
1779
1882
  }
1780
1883
  interface SmsInboundMember {
@@ -1794,6 +1897,8 @@ export declare namespace ConsumeEventInputEvent {
1794
1897
  chatUpdate?: never;
1795
1898
  smsInbound: SmsInboundConsumeEvent;
1796
1899
  smsStatus?: never;
1900
+ whatsappInbound?: never;
1901
+ whatsappStatus?: never;
1797
1902
  $unknown?: never;
1798
1903
  }
1799
1904
  interface SmsStatusMember {
@@ -1813,6 +1918,50 @@ export declare namespace ConsumeEventInputEvent {
1813
1918
  chatUpdate?: never;
1814
1919
  smsInbound?: never;
1815
1920
  smsStatus: SmsStatusConsumeEvent;
1921
+ whatsappInbound?: never;
1922
+ whatsappStatus?: never;
1923
+ $unknown?: never;
1924
+ }
1925
+ interface WhatsappInboundMember {
1926
+ callStart?: never;
1927
+ callUpdate?: never;
1928
+ callSplit?: never;
1929
+ callLive?: never;
1930
+ callAgentsStart?: never;
1931
+ callAgentsCancel?: never;
1932
+ callEnd?: never;
1933
+ callRecordStart?: never;
1934
+ callRecordStop?: never;
1935
+ callAttachment?: never;
1936
+ callTranscription?: never;
1937
+ conferenceTimeFrames?: never;
1938
+ chatNew?: never;
1939
+ chatUpdate?: never;
1940
+ smsInbound?: never;
1941
+ smsStatus?: never;
1942
+ whatsappInbound: WhatsAppInboundConsumeEvent;
1943
+ whatsappStatus?: never;
1944
+ $unknown?: never;
1945
+ }
1946
+ interface WhatsappStatusMember {
1947
+ callStart?: never;
1948
+ callUpdate?: never;
1949
+ callSplit?: never;
1950
+ callLive?: never;
1951
+ callAgentsStart?: never;
1952
+ callAgentsCancel?: never;
1953
+ callEnd?: never;
1954
+ callRecordStart?: never;
1955
+ callRecordStop?: never;
1956
+ callAttachment?: never;
1957
+ callTranscription?: never;
1958
+ conferenceTimeFrames?: never;
1959
+ chatNew?: never;
1960
+ chatUpdate?: never;
1961
+ smsInbound?: never;
1962
+ smsStatus?: never;
1963
+ whatsappInbound?: never;
1964
+ whatsappStatus: WhatsAppStatusConsumeEvent;
1816
1965
  $unknown?: never;
1817
1966
  }
1818
1967
  /**
@@ -1835,6 +1984,8 @@ export declare namespace ConsumeEventInputEvent {
1835
1984
  chatUpdate?: never;
1836
1985
  smsInbound?: never;
1837
1986
  smsStatus?: never;
1987
+ whatsappInbound?: never;
1988
+ whatsappStatus?: never;
1838
1989
  $unknown: [string, any];
1839
1990
  }
1840
1991
  interface Visitor<T> {
@@ -1854,6 +2005,8 @@ export declare namespace ConsumeEventInputEvent {
1854
2005
  chatUpdate: (value: ChatUpdateConsumeEvent) => T;
1855
2006
  smsInbound: (value: SmsInboundConsumeEvent) => T;
1856
2007
  smsStatus: (value: SmsStatusConsumeEvent) => T;
2008
+ whatsappInbound: (value: WhatsAppInboundConsumeEvent) => T;
2009
+ whatsappStatus: (value: WhatsAppStatusConsumeEvent) => T;
1857
2010
  _: (name: string, value: any) => T;
1858
2011
  }
1859
2012
  const visit: <T>(value: ConsumeEventInputEvent, visitor: Visitor<T>) => T;
@@ -1889,12 +2042,34 @@ export interface SmsStatusEvent {
1889
2042
  type: SmsConsumeEventType;
1890
2043
  data: SmsStatusConsumeEventData;
1891
2044
  }
2045
+ /**
2046
+ * @public
2047
+ */
2048
+ export interface WhatsAppInboundEvent {
2049
+ pbx: string;
2050
+ company: string;
2051
+ time: Date;
2052
+ type: WhatsAppEventType;
2053
+ data: WhatsAppInboundEventData;
2054
+ }
2055
+ /**
2056
+ * @public
2057
+ */
2058
+ export interface WhatsAppStatusEvent {
2059
+ pbx: string;
2060
+ company: string;
2061
+ time: Date;
2062
+ type: WhatsAppEventType;
2063
+ data: WhatsAppStatusEventData;
2064
+ }
1892
2065
  /**
1893
2066
  * @public
1894
2067
  */
1895
2068
  export interface DescribeEventInput {
1896
2069
  SmsInboundEvent?: SmsInboundEvent;
1897
2070
  SmsStatusEvent?: SmsStatusEvent;
2071
+ WhatsAppInboundEvent?: WhatsAppInboundEvent;
2072
+ WhatsAppStatusEvent?: WhatsAppStatusEvent;
1898
2073
  }
1899
2074
  /**
1900
2075
  * @public
@@ -2208,32 +2383,13 @@ export interface WebhookConferenceLiveTranscriptionEvent {
2208
2383
  integrationId: string;
2209
2384
  data: ConferenceAnalyticsLiveTranscriptionEvent;
2210
2385
  }
2211
- /**
2212
- * @public
2213
- */
2214
- export interface WebhookOutdatedCallParticipant {
2215
- type: string;
2216
- phone?: string;
2217
- name?: string;
2218
- company?: string;
2219
- email?: string;
2220
- userId?: string;
2221
- userExtension?: string;
2222
- userDepartment?: string;
2223
- groupId?: string;
2224
- groupName?: string;
2225
- userAgent?: string;
2226
- userDevice?: CallDevice;
2227
- role: string;
2228
- license?: string;
2229
- }
2230
2386
  /**
2231
2387
  * @public
2232
2388
  */
2233
2389
  export interface WebhookOutdatedCallEventData {
2234
2390
  status?: string;
2235
- caller?: WebhookOutdatedCallParticipant;
2236
- callee?: WebhookOutdatedCallParticipant;
2391
+ caller?: CallParticipant;
2392
+ callee?: CallParticipant;
2237
2393
  service?: string;
2238
2394
  destination?: string;
2239
2395
  trunkName?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wda-stream-client",
3
3
  "description": "@wildix/wda-stream-client client",
4
- "version": "1.0.20",
4
+ "version": "1.0.21",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -75,4 +75,4 @@
75
75
  "react-native": {
76
76
  "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
77
77
  }
78
- }
78
+ }