@wildix/wda-stream-client 1.0.27 → 1.0.29
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.
- package/dist-cjs/WdaStream.js +4 -0
- package/dist-cjs/commands/QueryPresencesCommand.js +21 -0
- package/dist-cjs/commands/UpdatePresenceCommand.js +21 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/models/models_0.js +37 -1
- package/dist-cjs/protocols/Aws_restJson1.js +139 -2
- package/dist-es/WdaStream.js +4 -0
- package/dist-es/commands/QueryPresencesCommand.js +17 -0
- package/dist-es/commands/UpdatePresenceCommand.js +17 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/models_0.js +35 -0
- package/dist-es/protocols/Aws_restJson1.js +136 -3
- package/dist-types/WdaStream.d.ts +16 -0
- package/dist-types/WdaStreamClient.d.ts +4 -2
- package/dist-types/commands/ConsumeEventCommand.d.ts +34 -3
- package/dist-types/commands/DescribeEventCommand.d.ts +36 -5
- package/dist-types/commands/GetConferenceIdCommand.d.ts +2 -1
- package/dist-types/commands/GetConversationsCommand.d.ts +3 -2
- package/dist-types/commands/QueryPresencesCommand.d.ts +85 -0
- package/dist-types/commands/UpdatePresenceCommand.d.ts +87 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/index.d.ts +2 -2
- package/dist-types/models/WdaStreamServiceException.d.ts +2 -1
- package/dist-types/models/models_0.d.ts +322 -1
- package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
- package/package.json +13 -13
package/dist-cjs/WdaStream.js
CHANGED
|
@@ -6,12 +6,16 @@ const ConsumeEventCommand_1 = require("./commands/ConsumeEventCommand");
|
|
|
6
6
|
const DescribeEventCommand_1 = require("./commands/DescribeEventCommand");
|
|
7
7
|
const GetConferenceIdCommand_1 = require("./commands/GetConferenceIdCommand");
|
|
8
8
|
const GetConversationsCommand_1 = require("./commands/GetConversationsCommand");
|
|
9
|
+
const QueryPresencesCommand_1 = require("./commands/QueryPresencesCommand");
|
|
10
|
+
const UpdatePresenceCommand_1 = require("./commands/UpdatePresenceCommand");
|
|
9
11
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
10
12
|
const commands = {
|
|
11
13
|
ConsumeEventCommand: ConsumeEventCommand_1.ConsumeEventCommand,
|
|
12
14
|
DescribeEventCommand: DescribeEventCommand_1.DescribeEventCommand,
|
|
13
15
|
GetConferenceIdCommand: GetConferenceIdCommand_1.GetConferenceIdCommand,
|
|
14
16
|
GetConversationsCommand: GetConversationsCommand_1.GetConversationsCommand,
|
|
17
|
+
QueryPresencesCommand: QueryPresencesCommand_1.QueryPresencesCommand,
|
|
18
|
+
UpdatePresenceCommand: UpdatePresenceCommand_1.UpdatePresenceCommand,
|
|
15
19
|
};
|
|
16
20
|
class WdaStream extends WdaStreamClient_1.WdaStreamClient {
|
|
17
21
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryPresencesCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class QueryPresencesCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("WdaStream", "QueryPresences", {})
|
|
15
|
+
.n("WdaStreamClient", "QueryPresencesCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_QueryPresencesCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_QueryPresencesCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.QueryPresencesCommand = QueryPresencesCommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePresenceCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class UpdatePresenceCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("WdaStream", "UpdatePresence", {})
|
|
15
|
+
.n("WdaStreamClient", "UpdatePresenceCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_UpdatePresenceCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_UpdatePresenceCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.UpdatePresenceCommand = UpdatePresenceCommand;
|
|
@@ -5,3 +5,5 @@ tslib_1.__exportStar(require("./ConsumeEventCommand"), exports);
|
|
|
5
5
|
tslib_1.__exportStar(require("./DescribeEventCommand"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./GetConferenceIdCommand"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./GetConversationsCommand"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./QueryPresencesCommand"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./UpdatePresenceCommand"), exports);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WebsocketEvent = exports.WebhookEventType = exports.PresenceEventType = exports.PresenceAnalyticsEventType = exports.ConsumeEventInputEvent = exports.SmsStatus = exports.SmsChannelType = exports.SmsConsumeEventType = exports.PresenceConsumeEventType = exports.ConferenceTranscriptionSentiment = exports.ConferenceEventType = exports.ConferenceConsumeEventType = exports.ConferenceConsumeDirection = 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
|
+
exports.UpdatePresenceOutputType = exports.TelephonyStatuses = exports.PresenceStatus = exports.MatchNotFoundException = exports.WebsocketTopic = void 0;
|
|
4
5
|
const WdaStreamServiceException_1 = require("./WdaStreamServiceException");
|
|
5
6
|
class ValidationException extends WdaStreamServiceException_1.WdaStreamServiceException {
|
|
6
7
|
constructor(opts) {
|
|
@@ -28,6 +29,18 @@ class ForbiddenException extends WdaStreamServiceException_1.WdaStreamServiceExc
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
exports.ForbiddenException = ForbiddenException;
|
|
32
|
+
exports.WhatsAppEventType = {
|
|
33
|
+
WHATSAPP_INBOUND: "WHATSAPP.INBOUND",
|
|
34
|
+
WHATSAPP_STATUS: "WHATSAPP.STATUS",
|
|
35
|
+
};
|
|
36
|
+
exports.WhatsAppStatus = {
|
|
37
|
+
CHANNEL_CLOSED: "24H_CHANNEL_CLOSED",
|
|
38
|
+
DELETED: "DELETED",
|
|
39
|
+
DELIVERED: "DELIVERED",
|
|
40
|
+
ERROR: "ERROR",
|
|
41
|
+
READ: "READ",
|
|
42
|
+
SENT: "SENT",
|
|
43
|
+
};
|
|
31
44
|
exports.CallFlowAttachmentType = {
|
|
32
45
|
FAX: "FAX",
|
|
33
46
|
VOICEMAIL: "VOICEMAIL",
|
|
@@ -207,6 +220,7 @@ exports.ChatStatus = {
|
|
|
207
220
|
exports.ChatTag = {
|
|
208
221
|
SMS: "sms",
|
|
209
222
|
TELEPHONY: "telephony",
|
|
223
|
+
WHATSAPP: "whatsapp",
|
|
210
224
|
};
|
|
211
225
|
exports.ChatConsumeEventType = {
|
|
212
226
|
CHAT_NEW: "CHAT.NEW",
|
|
@@ -321,6 +335,10 @@ var ConsumeEventInputEvent;
|
|
|
321
335
|
return visitor.smsInbound(value.smsInbound);
|
|
322
336
|
if (value.smsStatus !== undefined)
|
|
323
337
|
return visitor.smsStatus(value.smsStatus);
|
|
338
|
+
if (value.whatsappInbound !== undefined)
|
|
339
|
+
return visitor.whatsappInbound(value.whatsappInbound);
|
|
340
|
+
if (value.whatsappStatus !== undefined)
|
|
341
|
+
return visitor.whatsappStatus(value.whatsappStatus);
|
|
324
342
|
if (value.presence !== undefined)
|
|
325
343
|
return visitor.presence(value.presence);
|
|
326
344
|
if (value.presenceTelephony !== undefined)
|
|
@@ -385,3 +403,21 @@ class MatchNotFoundException extends WdaStreamServiceException_1.WdaStreamServic
|
|
|
385
403
|
}
|
|
386
404
|
}
|
|
387
405
|
exports.MatchNotFoundException = MatchNotFoundException;
|
|
406
|
+
exports.PresenceStatus = {
|
|
407
|
+
AWAY: "AWAY",
|
|
408
|
+
DND: "DND",
|
|
409
|
+
OFFLINE: "OFFLINE",
|
|
410
|
+
ONLINE: "ONLINE",
|
|
411
|
+
ONLY_SIP: "ONLY_SIP",
|
|
412
|
+
};
|
|
413
|
+
exports.TelephonyStatuses = {
|
|
414
|
+
REGISTERED: "REGISTERED",
|
|
415
|
+
RINGING: "RINGING",
|
|
416
|
+
RT: "RT",
|
|
417
|
+
TALKING: "TALKING",
|
|
418
|
+
UNREGISTERED: "UNREGISTERED",
|
|
419
|
+
};
|
|
420
|
+
exports.UpdatePresenceOutputType = {
|
|
421
|
+
ERROR: "error",
|
|
422
|
+
RESULT: "result",
|
|
423
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_GetConversationsCommand = exports.de_GetConferenceIdCommand = exports.de_DescribeEventCommand = exports.de_ConsumeEventCommand = exports.se_GetConversationsCommand = exports.se_GetConferenceIdCommand = exports.se_DescribeEventCommand = exports.se_ConsumeEventCommand = void 0;
|
|
3
|
+
exports.de_UpdatePresenceCommand = exports.de_QueryPresencesCommand = exports.de_GetConversationsCommand = exports.de_GetConferenceIdCommand = exports.de_DescribeEventCommand = exports.de_ConsumeEventCommand = exports.se_UpdatePresenceCommand = exports.se_QueryPresencesCommand = exports.se_GetConversationsCommand = exports.se_GetConferenceIdCommand = exports.se_DescribeEventCommand = exports.se_ConsumeEventCommand = void 0;
|
|
4
4
|
const WdaStreamServiceException_1 = require("../models/WdaStreamServiceException");
|
|
5
5
|
const models_0_1 = require("../models/models_0");
|
|
6
6
|
const core_1 = require("@smithy/core");
|
|
@@ -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': _ => (
|
|
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)
|
|
@@ -69,6 +71,39 @@ const se_GetConversationsCommand = async (input, context) => {
|
|
|
69
71
|
return b.build();
|
|
70
72
|
};
|
|
71
73
|
exports.se_GetConversationsCommand = se_GetConversationsCommand;
|
|
74
|
+
const se_QueryPresencesCommand = async (input, context) => {
|
|
75
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
76
|
+
const headers = {
|
|
77
|
+
'content-type': 'application/json',
|
|
78
|
+
};
|
|
79
|
+
b.bp("/v2/stream/query_presences");
|
|
80
|
+
let body;
|
|
81
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
82
|
+
'filter': _ => (0, smithy_client_1._json)(_),
|
|
83
|
+
}));
|
|
84
|
+
b.m("POST")
|
|
85
|
+
.h(headers)
|
|
86
|
+
.b(body);
|
|
87
|
+
return b.build();
|
|
88
|
+
};
|
|
89
|
+
exports.se_QueryPresencesCommand = se_QueryPresencesCommand;
|
|
90
|
+
const se_UpdatePresenceCommand = async (input, context) => {
|
|
91
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
92
|
+
const headers = {
|
|
93
|
+
'content-type': 'application/json',
|
|
94
|
+
};
|
|
95
|
+
b.bp("/v2/stream/update_presence");
|
|
96
|
+
let body;
|
|
97
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
98
|
+
'presence': _ => (0, smithy_client_1._json)(_),
|
|
99
|
+
'set': _ => (0, smithy_client_1._json)(_),
|
|
100
|
+
}));
|
|
101
|
+
b.m("POST")
|
|
102
|
+
.h(headers)
|
|
103
|
+
.b(body);
|
|
104
|
+
return b.build();
|
|
105
|
+
};
|
|
106
|
+
exports.se_UpdatePresenceCommand = se_UpdatePresenceCommand;
|
|
72
107
|
const de_ConsumeEventCommand = async (output, context) => {
|
|
73
108
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
74
109
|
return de_CommandError(output, context);
|
|
@@ -180,6 +215,39 @@ const de_GetConversationsCommand = async (output, context) => {
|
|
|
180
215
|
return contents;
|
|
181
216
|
};
|
|
182
217
|
exports.de_GetConversationsCommand = de_GetConversationsCommand;
|
|
218
|
+
const de_QueryPresencesCommand = async (output, context) => {
|
|
219
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
220
|
+
return de_CommandError(output, context);
|
|
221
|
+
}
|
|
222
|
+
const contents = (0, smithy_client_1.map)({
|
|
223
|
+
$metadata: deserializeMetadata(output),
|
|
224
|
+
});
|
|
225
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
226
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
227
|
+
'result': smithy_client_1._json,
|
|
228
|
+
'success': smithy_client_1.expectBoolean,
|
|
229
|
+
});
|
|
230
|
+
Object.assign(contents, doc);
|
|
231
|
+
return contents;
|
|
232
|
+
};
|
|
233
|
+
exports.de_QueryPresencesCommand = de_QueryPresencesCommand;
|
|
234
|
+
const de_UpdatePresenceCommand = async (output, context) => {
|
|
235
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
236
|
+
return de_CommandError(output, context);
|
|
237
|
+
}
|
|
238
|
+
const contents = (0, smithy_client_1.map)({
|
|
239
|
+
$metadata: deserializeMetadata(output),
|
|
240
|
+
});
|
|
241
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
242
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
243
|
+
'duration': smithy_client_1.expectInt32,
|
|
244
|
+
'result': smithy_client_1._json,
|
|
245
|
+
'type': smithy_client_1.expectString,
|
|
246
|
+
});
|
|
247
|
+
Object.assign(contents, doc);
|
|
248
|
+
return contents;
|
|
249
|
+
};
|
|
250
|
+
exports.de_UpdatePresenceCommand = de_UpdatePresenceCommand;
|
|
183
251
|
const de_CommandError = async (output, context) => {
|
|
184
252
|
const parsedOutput = {
|
|
185
253
|
...output,
|
|
@@ -245,6 +313,75 @@ const de_MatchNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
245
313
|
});
|
|
246
314
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
247
315
|
};
|
|
316
|
+
const se_ConsumeEventInputEvent = (input, context) => {
|
|
317
|
+
return models_0_1.ConsumeEventInputEvent.visit(input, {
|
|
318
|
+
callAgentsCancel: value => ({ "callAgentsCancel": (0, smithy_client_1._json)(value) }),
|
|
319
|
+
callAgentsStart: value => ({ "callAgentsStart": (0, smithy_client_1._json)(value) }),
|
|
320
|
+
callAttachment: value => ({ "callAttachment": (0, smithy_client_1._json)(value) }),
|
|
321
|
+
callEnd: value => ({ "callEnd": (0, smithy_client_1._json)(value) }),
|
|
322
|
+
callLive: value => ({ "callLive": (0, smithy_client_1._json)(value) }),
|
|
323
|
+
callRecordStart: value => ({ "callRecordStart": (0, smithy_client_1._json)(value) }),
|
|
324
|
+
callRecordStop: value => ({ "callRecordStop": (0, smithy_client_1._json)(value) }),
|
|
325
|
+
callSplit: value => ({ "callSplit": (0, smithy_client_1._json)(value) }),
|
|
326
|
+
callStart: value => ({ "callStart": (0, smithy_client_1._json)(value) }),
|
|
327
|
+
callTranscription: value => ({ "callTranscription": (0, smithy_client_1._json)(value) }),
|
|
328
|
+
callUpdate: value => ({ "callUpdate": (0, smithy_client_1._json)(value) }),
|
|
329
|
+
chatNew: value => ({ "chatNew": (0, smithy_client_1._json)(value) }),
|
|
330
|
+
chatUpdate: value => ({ "chatUpdate": (0, smithy_client_1._json)(value) }),
|
|
331
|
+
conferenceEnd: value => ({ "conferenceEnd": (0, smithy_client_1._json)(value) }),
|
|
332
|
+
conferenceJoin: value => ({ "conferenceJoin": (0, smithy_client_1._json)(value) }),
|
|
333
|
+
conferenceKeepAlive: value => ({ "conferenceKeepAlive": (0, smithy_client_1._json)(value) }),
|
|
334
|
+
conferenceLeave: value => ({ "conferenceLeave": (0, smithy_client_1._json)(value) }),
|
|
335
|
+
conferenceRecordStart: value => ({ "conferenceRecordStart": (0, smithy_client_1._json)(value) }),
|
|
336
|
+
conferenceRecordStop: value => ({ "conferenceRecordStop": (0, smithy_client_1._json)(value) }),
|
|
337
|
+
conferenceStart: value => ({ "conferenceStart": (0, smithy_client_1._json)(value) }),
|
|
338
|
+
conferenceTimeFrames: value => ({ "conferenceTimeFrames": (0, smithy_client_1._json)(value) }),
|
|
339
|
+
conferenceTranscription: value => ({ "conferenceTranscription": (0, smithy_client_1._json)(value) }),
|
|
340
|
+
presence: value => ({ "presence": (0, smithy_client_1._json)(value) }),
|
|
341
|
+
presenceTelephony: value => ({ "presenceTelephony": (0, smithy_client_1._json)(value) }),
|
|
342
|
+
smsInbound: value => ({ "smsInbound": (0, smithy_client_1._json)(value) }),
|
|
343
|
+
smsStatus: value => ({ "smsStatus": (0, smithy_client_1._json)(value) }),
|
|
344
|
+
whatsappInbound: value => ({ "whatsappInbound": se_WhatsAppInboundConsumeEvent(value, context) }),
|
|
345
|
+
whatsappStatus: value => ({ "whatsappStatus": se_WhatsAppStatusConsumeEvent(value, context) }),
|
|
346
|
+
_: (name, value) => ({ name: value })
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
const se_WhatsAppInboundConsumeEvent = (input, context) => {
|
|
350
|
+
return (0, smithy_client_1.take)(input, {
|
|
351
|
+
'company': [],
|
|
352
|
+
'data': smithy_client_1._json,
|
|
353
|
+
'pbx': [],
|
|
354
|
+
'time': _ => (_.getTime() / 1000),
|
|
355
|
+
'type': [],
|
|
356
|
+
});
|
|
357
|
+
};
|
|
358
|
+
const se_WhatsAppInboundEvent = (input, context) => {
|
|
359
|
+
return (0, smithy_client_1.take)(input, {
|
|
360
|
+
'company': [],
|
|
361
|
+
'data': smithy_client_1._json,
|
|
362
|
+
'pbx': [],
|
|
363
|
+
'time': _ => (_.getTime() / 1000),
|
|
364
|
+
'type': [],
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
const se_WhatsAppStatusConsumeEvent = (input, context) => {
|
|
368
|
+
return (0, smithy_client_1.take)(input, {
|
|
369
|
+
'company': [],
|
|
370
|
+
'data': smithy_client_1._json,
|
|
371
|
+
'pbx': [],
|
|
372
|
+
'time': _ => (_.getTime() / 1000),
|
|
373
|
+
'type': [],
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
const se_WhatsAppStatusEvent = (input, context) => {
|
|
377
|
+
return (0, smithy_client_1.take)(input, {
|
|
378
|
+
'company': [],
|
|
379
|
+
'data': smithy_client_1._json,
|
|
380
|
+
'pbx': [],
|
|
381
|
+
'time': _ => (_.getTime() / 1000),
|
|
382
|
+
'type': [],
|
|
383
|
+
});
|
|
384
|
+
};
|
|
248
385
|
const de_Document = (output, context) => {
|
|
249
386
|
return output;
|
|
250
387
|
};
|
package/dist-es/WdaStream.js
CHANGED
|
@@ -3,12 +3,16 @@ import { ConsumeEventCommand, } from "./commands/ConsumeEventCommand";
|
|
|
3
3
|
import { DescribeEventCommand, } from "./commands/DescribeEventCommand";
|
|
4
4
|
import { GetConferenceIdCommand, } from "./commands/GetConferenceIdCommand";
|
|
5
5
|
import { GetConversationsCommand, } from "./commands/GetConversationsCommand";
|
|
6
|
+
import { QueryPresencesCommand, } from "./commands/QueryPresencesCommand";
|
|
7
|
+
import { UpdatePresenceCommand, } from "./commands/UpdatePresenceCommand";
|
|
6
8
|
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
7
9
|
const commands = {
|
|
8
10
|
ConsumeEventCommand,
|
|
9
11
|
DescribeEventCommand,
|
|
10
12
|
GetConferenceIdCommand,
|
|
11
13
|
GetConversationsCommand,
|
|
14
|
+
QueryPresencesCommand,
|
|
15
|
+
UpdatePresenceCommand,
|
|
12
16
|
};
|
|
13
17
|
export class WdaStream extends WdaStreamClient {
|
|
14
18
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_QueryPresencesCommand, se_QueryPresencesCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
export { $Command };
|
|
5
|
+
export class QueryPresencesCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("WdaStream", "QueryPresences", {})
|
|
12
|
+
.n("WdaStreamClient", "QueryPresencesCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_QueryPresencesCommand)
|
|
15
|
+
.de(de_QueryPresencesCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_UpdatePresenceCommand, se_UpdatePresenceCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
export { $Command };
|
|
5
|
+
export class UpdatePresenceCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("WdaStream", "UpdatePresence", {})
|
|
12
|
+
.n("WdaStreamClient", "UpdatePresenceCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_UpdatePresenceCommand)
|
|
15
|
+
.de(de_UpdatePresenceCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -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",
|
|
@@ -316,6 +329,10 @@ export var ConsumeEventInputEvent;
|
|
|
316
329
|
return visitor.smsInbound(value.smsInbound);
|
|
317
330
|
if (value.smsStatus !== undefined)
|
|
318
331
|
return visitor.smsStatus(value.smsStatus);
|
|
332
|
+
if (value.whatsappInbound !== undefined)
|
|
333
|
+
return visitor.whatsappInbound(value.whatsappInbound);
|
|
334
|
+
if (value.whatsappStatus !== undefined)
|
|
335
|
+
return visitor.whatsappStatus(value.whatsappStatus);
|
|
319
336
|
if (value.presence !== undefined)
|
|
320
337
|
return visitor.presence(value.presence);
|
|
321
338
|
if (value.presenceTelephony !== undefined)
|
|
@@ -379,3 +396,21 @@ export class MatchNotFoundException extends __BaseException {
|
|
|
379
396
|
Object.setPrototypeOf(this, MatchNotFoundException.prototype);
|
|
380
397
|
}
|
|
381
398
|
}
|
|
399
|
+
export const PresenceStatus = {
|
|
400
|
+
AWAY: "AWAY",
|
|
401
|
+
DND: "DND",
|
|
402
|
+
OFFLINE: "OFFLINE",
|
|
403
|
+
ONLINE: "ONLINE",
|
|
404
|
+
ONLY_SIP: "ONLY_SIP",
|
|
405
|
+
};
|
|
406
|
+
export const TelephonyStatuses = {
|
|
407
|
+
REGISTERED: "REGISTERED",
|
|
408
|
+
RINGING: "RINGING",
|
|
409
|
+
RT: "RT",
|
|
410
|
+
TALKING: "TALKING",
|
|
411
|
+
UNREGISTERED: "UNREGISTERED",
|
|
412
|
+
};
|
|
413
|
+
export const UpdatePresenceOutputType = {
|
|
414
|
+
ERROR: "error",
|
|
415
|
+
RESULT: "result",
|
|
416
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
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";
|
|
4
|
+
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, 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) => {
|
|
6
6
|
const b = rb(input, context);
|
|
7
7
|
const headers = {
|
|
@@ -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': _ =>
|
|
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)
|
|
@@ -62,6 +64,37 @@ export const se_GetConversationsCommand = async (input, context) => {
|
|
|
62
64
|
.b(body);
|
|
63
65
|
return b.build();
|
|
64
66
|
};
|
|
67
|
+
export const se_QueryPresencesCommand = async (input, context) => {
|
|
68
|
+
const b = rb(input, context);
|
|
69
|
+
const headers = {
|
|
70
|
+
'content-type': 'application/json',
|
|
71
|
+
};
|
|
72
|
+
b.bp("/v2/stream/query_presences");
|
|
73
|
+
let body;
|
|
74
|
+
body = JSON.stringify(take(input, {
|
|
75
|
+
'filter': _ => _json(_),
|
|
76
|
+
}));
|
|
77
|
+
b.m("POST")
|
|
78
|
+
.h(headers)
|
|
79
|
+
.b(body);
|
|
80
|
+
return b.build();
|
|
81
|
+
};
|
|
82
|
+
export const se_UpdatePresenceCommand = async (input, context) => {
|
|
83
|
+
const b = rb(input, context);
|
|
84
|
+
const headers = {
|
|
85
|
+
'content-type': 'application/json',
|
|
86
|
+
};
|
|
87
|
+
b.bp("/v2/stream/update_presence");
|
|
88
|
+
let body;
|
|
89
|
+
body = JSON.stringify(take(input, {
|
|
90
|
+
'presence': _ => _json(_),
|
|
91
|
+
'set': _ => _json(_),
|
|
92
|
+
}));
|
|
93
|
+
b.m("POST")
|
|
94
|
+
.h(headers)
|
|
95
|
+
.b(body);
|
|
96
|
+
return b.build();
|
|
97
|
+
};
|
|
65
98
|
export const de_ConsumeEventCommand = async (output, context) => {
|
|
66
99
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
67
100
|
return de_CommandError(output, context);
|
|
@@ -169,6 +202,37 @@ export const de_GetConversationsCommand = async (output, context) => {
|
|
|
169
202
|
Object.assign(contents, doc);
|
|
170
203
|
return contents;
|
|
171
204
|
};
|
|
205
|
+
export const de_QueryPresencesCommand = async (output, context) => {
|
|
206
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
207
|
+
return de_CommandError(output, context);
|
|
208
|
+
}
|
|
209
|
+
const contents = map({
|
|
210
|
+
$metadata: deserializeMetadata(output),
|
|
211
|
+
});
|
|
212
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
213
|
+
const doc = take(data, {
|
|
214
|
+
'result': _json,
|
|
215
|
+
'success': __expectBoolean,
|
|
216
|
+
});
|
|
217
|
+
Object.assign(contents, doc);
|
|
218
|
+
return contents;
|
|
219
|
+
};
|
|
220
|
+
export const de_UpdatePresenceCommand = async (output, context) => {
|
|
221
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
222
|
+
return de_CommandError(output, context);
|
|
223
|
+
}
|
|
224
|
+
const contents = map({
|
|
225
|
+
$metadata: deserializeMetadata(output),
|
|
226
|
+
});
|
|
227
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
228
|
+
const doc = take(data, {
|
|
229
|
+
'duration': __expectInt32,
|
|
230
|
+
'result': _json,
|
|
231
|
+
'type': __expectString,
|
|
232
|
+
});
|
|
233
|
+
Object.assign(contents, doc);
|
|
234
|
+
return contents;
|
|
235
|
+
};
|
|
172
236
|
const de_CommandError = async (output, context) => {
|
|
173
237
|
const parsedOutput = {
|
|
174
238
|
...output,
|
|
@@ -234,6 +298,75 @@ const de_MatchNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
234
298
|
});
|
|
235
299
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
236
300
|
};
|
|
301
|
+
const se_ConsumeEventInputEvent = (input, context) => {
|
|
302
|
+
return ConsumeEventInputEvent.visit(input, {
|
|
303
|
+
callAgentsCancel: value => ({ "callAgentsCancel": _json(value) }),
|
|
304
|
+
callAgentsStart: value => ({ "callAgentsStart": _json(value) }),
|
|
305
|
+
callAttachment: value => ({ "callAttachment": _json(value) }),
|
|
306
|
+
callEnd: value => ({ "callEnd": _json(value) }),
|
|
307
|
+
callLive: value => ({ "callLive": _json(value) }),
|
|
308
|
+
callRecordStart: value => ({ "callRecordStart": _json(value) }),
|
|
309
|
+
callRecordStop: value => ({ "callRecordStop": _json(value) }),
|
|
310
|
+
callSplit: value => ({ "callSplit": _json(value) }),
|
|
311
|
+
callStart: value => ({ "callStart": _json(value) }),
|
|
312
|
+
callTranscription: value => ({ "callTranscription": _json(value) }),
|
|
313
|
+
callUpdate: value => ({ "callUpdate": _json(value) }),
|
|
314
|
+
chatNew: value => ({ "chatNew": _json(value) }),
|
|
315
|
+
chatUpdate: value => ({ "chatUpdate": _json(value) }),
|
|
316
|
+
conferenceEnd: value => ({ "conferenceEnd": _json(value) }),
|
|
317
|
+
conferenceJoin: value => ({ "conferenceJoin": _json(value) }),
|
|
318
|
+
conferenceKeepAlive: value => ({ "conferenceKeepAlive": _json(value) }),
|
|
319
|
+
conferenceLeave: value => ({ "conferenceLeave": _json(value) }),
|
|
320
|
+
conferenceRecordStart: value => ({ "conferenceRecordStart": _json(value) }),
|
|
321
|
+
conferenceRecordStop: value => ({ "conferenceRecordStop": _json(value) }),
|
|
322
|
+
conferenceStart: value => ({ "conferenceStart": _json(value) }),
|
|
323
|
+
conferenceTimeFrames: value => ({ "conferenceTimeFrames": _json(value) }),
|
|
324
|
+
conferenceTranscription: value => ({ "conferenceTranscription": _json(value) }),
|
|
325
|
+
presence: value => ({ "presence": _json(value) }),
|
|
326
|
+
presenceTelephony: value => ({ "presenceTelephony": _json(value) }),
|
|
327
|
+
smsInbound: value => ({ "smsInbound": _json(value) }),
|
|
328
|
+
smsStatus: value => ({ "smsStatus": _json(value) }),
|
|
329
|
+
whatsappInbound: value => ({ "whatsappInbound": se_WhatsAppInboundConsumeEvent(value, context) }),
|
|
330
|
+
whatsappStatus: value => ({ "whatsappStatus": se_WhatsAppStatusConsumeEvent(value, context) }),
|
|
331
|
+
_: (name, value) => ({ name: value })
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
const se_WhatsAppInboundConsumeEvent = (input, context) => {
|
|
335
|
+
return take(input, {
|
|
336
|
+
'company': [],
|
|
337
|
+
'data': _json,
|
|
338
|
+
'pbx': [],
|
|
339
|
+
'time': _ => (_.getTime() / 1000),
|
|
340
|
+
'type': [],
|
|
341
|
+
});
|
|
342
|
+
};
|
|
343
|
+
const se_WhatsAppInboundEvent = (input, context) => {
|
|
344
|
+
return take(input, {
|
|
345
|
+
'company': [],
|
|
346
|
+
'data': _json,
|
|
347
|
+
'pbx': [],
|
|
348
|
+
'time': _ => (_.getTime() / 1000),
|
|
349
|
+
'type': [],
|
|
350
|
+
});
|
|
351
|
+
};
|
|
352
|
+
const se_WhatsAppStatusConsumeEvent = (input, context) => {
|
|
353
|
+
return take(input, {
|
|
354
|
+
'company': [],
|
|
355
|
+
'data': _json,
|
|
356
|
+
'pbx': [],
|
|
357
|
+
'time': _ => (_.getTime() / 1000),
|
|
358
|
+
'type': [],
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
const se_WhatsAppStatusEvent = (input, context) => {
|
|
362
|
+
return take(input, {
|
|
363
|
+
'company': [],
|
|
364
|
+
'data': _json,
|
|
365
|
+
'pbx': [],
|
|
366
|
+
'time': _ => (_.getTime() / 1000),
|
|
367
|
+
'type': [],
|
|
368
|
+
});
|
|
369
|
+
};
|
|
237
370
|
const de_Document = (output, context) => {
|
|
238
371
|
return output;
|
|
239
372
|
};
|
|
@@ -3,6 +3,8 @@ import { ConsumeEventCommandInput, ConsumeEventCommandOutput } from "./commands/
|
|
|
3
3
|
import { DescribeEventCommandInput, DescribeEventCommandOutput } from "./commands/DescribeEventCommand";
|
|
4
4
|
import { GetConferenceIdCommandInput, GetConferenceIdCommandOutput } from "./commands/GetConferenceIdCommand";
|
|
5
5
|
import { GetConversationsCommandInput, GetConversationsCommandOutput } from "./commands/GetConversationsCommand";
|
|
6
|
+
import { QueryPresencesCommandInput, QueryPresencesCommandOutput } from "./commands/QueryPresencesCommand";
|
|
7
|
+
import { UpdatePresenceCommandInput, UpdatePresenceCommandOutput } from "./commands/UpdatePresenceCommand";
|
|
6
8
|
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
7
9
|
export interface WdaStream {
|
|
8
10
|
/**
|
|
@@ -31,6 +33,20 @@ export interface WdaStream {
|
|
|
31
33
|
getConversations(args: GetConversationsCommandInput, options?: __HttpHandlerOptions): Promise<GetConversationsCommandOutput>;
|
|
32
34
|
getConversations(args: GetConversationsCommandInput, cb: (err: any, data?: GetConversationsCommandOutput) => void): void;
|
|
33
35
|
getConversations(args: GetConversationsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetConversationsCommandOutput) => void): void;
|
|
36
|
+
/**
|
|
37
|
+
* @see {@link QueryPresencesCommand}
|
|
38
|
+
*/
|
|
39
|
+
queryPresences(): Promise<QueryPresencesCommandOutput>;
|
|
40
|
+
queryPresences(args: QueryPresencesCommandInput, options?: __HttpHandlerOptions): Promise<QueryPresencesCommandOutput>;
|
|
41
|
+
queryPresences(args: QueryPresencesCommandInput, cb: (err: any, data?: QueryPresencesCommandOutput) => void): void;
|
|
42
|
+
queryPresences(args: QueryPresencesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: QueryPresencesCommandOutput) => void): void;
|
|
43
|
+
/**
|
|
44
|
+
* @see {@link UpdatePresenceCommand}
|
|
45
|
+
*/
|
|
46
|
+
updatePresence(): Promise<UpdatePresenceCommandOutput>;
|
|
47
|
+
updatePresence(args: UpdatePresenceCommandInput, options?: __HttpHandlerOptions): Promise<UpdatePresenceCommandOutput>;
|
|
48
|
+
updatePresence(args: UpdatePresenceCommandInput, cb: (err: any, data?: UpdatePresenceCommandOutput) => void): void;
|
|
49
|
+
updatePresence(args: UpdatePresenceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UpdatePresenceCommandOutput) => void): void;
|
|
34
50
|
}
|
|
35
51
|
/**
|
|
36
52
|
* @public
|