@wildix/wda-stream-client 1.0.48 → 1.0.49
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/WdaStreamClient.js +4 -5
- package/dist-cjs/models/models_0.js +13 -12
- package/dist-cjs/protocols/Aws_restJson1.js +17 -62
- package/dist-cjs/runtimeConfig.browser.js +1 -1
- package/dist-cjs/runtimeConfig.js +4 -3
- package/dist-cjs/runtimeExtensions.js +2 -10
- package/dist-es/WdaStreamClient.js +4 -5
- package/dist-es/models/models_0.js +11 -10
- package/dist-es/protocols/Aws_restJson1.js +2 -47
- package/dist-es/runtimeConfig.browser.js +2 -2
- package/dist-es/runtimeConfig.js +5 -4
- package/dist-es/runtimeExtensions.js +2 -10
- package/dist-types/commands/ConsumeEventCommand.d.ts +13 -1
- package/dist-types/commands/DescribeEventCommand.d.ts +17 -5
- package/dist-types/commands/GetConferenceIdCommand.d.ts +12 -0
- package/dist-types/commands/GetConversationsCommand.d.ts +13 -1
- package/dist-types/commands/QueryPresenceCommand.d.ts +12 -0
- package/dist-types/commands/QueryPresencesCommand.d.ts +12 -0
- package/dist-types/commands/UpdatePresenceLastSeenCommand.d.ts +12 -0
- package/dist-types/models/models_0.d.ts +623 -622
- package/dist-types/runtimeConfig.browser.d.ts +2 -1
- package/dist-types/runtimeConfig.d.ts +2 -1
- package/dist-types/runtimeConfig.native.d.ts +2 -1
- package/package.json +37 -33
|
@@ -10,8 +10,11 @@ const smithy_client_1 = require("@smithy/smithy-client");
|
|
|
10
10
|
Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
|
|
11
11
|
const smithy_utils_1 = require("@wildix/smithy-utils");
|
|
12
12
|
class WdaStreamClient extends smithy_client_1.Client {
|
|
13
|
+
config;
|
|
13
14
|
constructor(...[configuration]) {
|
|
14
15
|
let _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
|
|
16
|
+
super(_config_0);
|
|
17
|
+
this.initConfig = _config_0;
|
|
15
18
|
let _config_1 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_0);
|
|
16
19
|
let _config_2 = (0, middleware_retry_1.resolveRetryConfig)(_config_1);
|
|
17
20
|
let _config_3 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_2, configuration?.extensions || []);
|
|
@@ -24,11 +27,7 @@ class WdaStreamClient extends smithy_client_1.Client {
|
|
|
24
27
|
path: ''
|
|
25
28
|
};
|
|
26
29
|
};
|
|
27
|
-
const config = {
|
|
28
|
-
..._config_3,
|
|
29
|
-
endpoint,
|
|
30
|
-
};
|
|
31
|
-
super(config);
|
|
30
|
+
const config = { ..._config_3, endpoint };
|
|
32
31
|
this.config = config;
|
|
33
32
|
this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
34
33
|
this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
|
|
@@ -4,14 +4,14 @@ exports.SmsStatus = exports.SmsChannelType = exports.SmsConsumeEventType = expor
|
|
|
4
4
|
exports.PresenceNotAvailableException = exports.TelephonyStatus = exports.PresenceStatus = exports.MatchNotFoundException = exports.WebsocketEvent = exports.WebhookEventType = exports.PresenceEventType = exports.PresenceAnalyticsEventType = exports.WebsocketTopic = exports.WebsocketAction = exports.ConsumeEventInputEvent = void 0;
|
|
5
5
|
const WdaStreamServiceException_1 = require("./WdaStreamServiceException");
|
|
6
6
|
class ValidationException extends WdaStreamServiceException_1.WdaStreamServiceException {
|
|
7
|
+
name = "ValidationException";
|
|
8
|
+
$fault = "client";
|
|
7
9
|
constructor(opts) {
|
|
8
10
|
super({
|
|
9
11
|
name: "ValidationException",
|
|
10
12
|
$fault: "client",
|
|
11
13
|
...opts
|
|
12
14
|
});
|
|
13
|
-
this.name = "ValidationException";
|
|
14
|
-
this.$fault = "client";
|
|
15
15
|
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -27,27 +27,27 @@ exports.ConversationStatus = {
|
|
|
27
27
|
MISSED: "MISSED",
|
|
28
28
|
};
|
|
29
29
|
class ForbiddenException extends WdaStreamServiceException_1.WdaStreamServiceException {
|
|
30
|
+
name = "ForbiddenException";
|
|
31
|
+
$fault = "client";
|
|
30
32
|
constructor(opts) {
|
|
31
33
|
super({
|
|
32
34
|
name: "ForbiddenException",
|
|
33
35
|
$fault: "client",
|
|
34
36
|
...opts
|
|
35
37
|
});
|
|
36
|
-
this.name = "ForbiddenException";
|
|
37
|
-
this.$fault = "client";
|
|
38
38
|
Object.setPrototypeOf(this, ForbiddenException.prototype);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
exports.ForbiddenException = ForbiddenException;
|
|
42
42
|
class BadRequestException extends WdaStreamServiceException_1.WdaStreamServiceException {
|
|
43
|
+
name = "BadRequestException";
|
|
44
|
+
$fault = "client";
|
|
43
45
|
constructor(opts) {
|
|
44
46
|
super({
|
|
45
47
|
name: "BadRequestException",
|
|
46
48
|
$fault: "client",
|
|
47
49
|
...opts
|
|
48
50
|
});
|
|
49
|
-
this.name = "BadRequestException";
|
|
50
|
-
this.$fault = "client";
|
|
51
51
|
Object.setPrototypeOf(this, BadRequestException.prototype);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -88,7 +88,7 @@ var CallFlowAttachment;
|
|
|
88
88
|
return visitor.voicemail(value.voicemail);
|
|
89
89
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
90
90
|
};
|
|
91
|
-
})(CallFlowAttachment
|
|
91
|
+
})(CallFlowAttachment || (exports.CallFlowAttachment = CallFlowAttachment = {}));
|
|
92
92
|
exports.CallFlowAttachmentType = {
|
|
93
93
|
FAX: "FAX",
|
|
94
94
|
VOICEMAIL: "VOICEMAIL",
|
|
@@ -113,6 +113,7 @@ exports.CallDevice = {
|
|
|
113
113
|
XBEES_WEB: "XBEES_WEB",
|
|
114
114
|
};
|
|
115
115
|
exports.License = {
|
|
116
|
+
UC: "uc",
|
|
116
117
|
XBEES: "x-bees",
|
|
117
118
|
};
|
|
118
119
|
exports.CallFlowTranscriptionStatus = {
|
|
@@ -386,7 +387,7 @@ var ConsumeEventInputEvent;
|
|
|
386
387
|
return visitor.presenceTelephony(value.presenceTelephony);
|
|
387
388
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
388
389
|
};
|
|
389
|
-
})(ConsumeEventInputEvent
|
|
390
|
+
})(ConsumeEventInputEvent || (exports.ConsumeEventInputEvent = ConsumeEventInputEvent = {}));
|
|
390
391
|
exports.WebsocketAction = {
|
|
391
392
|
AUTHORIZE: "authorize",
|
|
392
393
|
SUBSCRIBE: "subscribe",
|
|
@@ -445,14 +446,14 @@ exports.WebsocketEvent = {
|
|
|
445
446
|
UNSUBSCRIBE: "unsubscribed",
|
|
446
447
|
};
|
|
447
448
|
class MatchNotFoundException extends WdaStreamServiceException_1.WdaStreamServiceException {
|
|
449
|
+
name = "MatchNotFoundException";
|
|
450
|
+
$fault = "client";
|
|
448
451
|
constructor(opts) {
|
|
449
452
|
super({
|
|
450
453
|
name: "MatchNotFoundException",
|
|
451
454
|
$fault: "client",
|
|
452
455
|
...opts
|
|
453
456
|
});
|
|
454
|
-
this.name = "MatchNotFoundException";
|
|
455
|
-
this.$fault = "client";
|
|
456
457
|
Object.setPrototypeOf(this, MatchNotFoundException.prototype);
|
|
457
458
|
}
|
|
458
459
|
}
|
|
@@ -472,14 +473,14 @@ exports.TelephonyStatus = {
|
|
|
472
473
|
UNREGISTERED: "UNREGISTERED",
|
|
473
474
|
};
|
|
474
475
|
class PresenceNotAvailableException extends WdaStreamServiceException_1.WdaStreamServiceException {
|
|
476
|
+
name = "PresenceNotAvailableException";
|
|
477
|
+
$fault = "client";
|
|
475
478
|
constructor(opts) {
|
|
476
479
|
super({
|
|
477
480
|
name: "PresenceNotAvailableException",
|
|
478
481
|
$fault: "client",
|
|
479
482
|
...opts
|
|
480
483
|
});
|
|
481
|
-
this.name = "PresenceNotAvailableException";
|
|
482
|
-
this.$fault = "client";
|
|
483
484
|
Object.setPrototypeOf(this, PresenceNotAvailableException.prototype);
|
|
484
485
|
}
|
|
485
486
|
}
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.de_UpdatePresenceLastSeenCommand = exports.de_QueryPresencesCommand = exports.de_QueryPresenceCommand = exports.de_GetConversationsCommand = exports.de_GetConferenceIdCommand = exports.de_DescribeEventCommand = exports.de_ConsumeEventCommand = exports.se_UpdatePresenceLastSeenCommand = exports.se_QueryPresencesCommand = exports.se_QueryPresenceCommand = 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
|
-
const core_1 = require("@
|
|
6
|
+
const core_1 = require("@aws-sdk/core");
|
|
7
|
+
const core_2 = require("@smithy/core");
|
|
7
8
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
8
9
|
const se_ConsumeEventCommand = async (input, context) => {
|
|
9
|
-
const b = (0,
|
|
10
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
10
11
|
const headers = {
|
|
11
12
|
'content-type': 'application/json',
|
|
12
13
|
};
|
|
@@ -22,7 +23,7 @@ const se_ConsumeEventCommand = async (input, context) => {
|
|
|
22
23
|
};
|
|
23
24
|
exports.se_ConsumeEventCommand = se_ConsumeEventCommand;
|
|
24
25
|
const se_DescribeEventCommand = async (input, context) => {
|
|
25
|
-
const b = (0,
|
|
26
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
26
27
|
const headers = {
|
|
27
28
|
'content-type': 'application/json',
|
|
28
29
|
};
|
|
@@ -44,7 +45,7 @@ const se_DescribeEventCommand = async (input, context) => {
|
|
|
44
45
|
};
|
|
45
46
|
exports.se_DescribeEventCommand = se_DescribeEventCommand;
|
|
46
47
|
const se_GetConferenceIdCommand = async (input, context) => {
|
|
47
|
-
const b = (0,
|
|
48
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
48
49
|
const headers = {};
|
|
49
50
|
b.bp("/v2/stream/conferences/match/{channelId}");
|
|
50
51
|
b.p('channelId', () => input.channelId, '{channelId}', false);
|
|
@@ -60,7 +61,7 @@ const se_GetConferenceIdCommand = async (input, context) => {
|
|
|
60
61
|
};
|
|
61
62
|
exports.se_GetConferenceIdCommand = se_GetConferenceIdCommand;
|
|
62
63
|
const se_GetConversationsCommand = async (input, context) => {
|
|
63
|
-
const b = (0,
|
|
64
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
64
65
|
const headers = {};
|
|
65
66
|
b.bp("/v2/stream/conversations");
|
|
66
67
|
const query = (0, smithy_client_1.map)({
|
|
@@ -75,7 +76,7 @@ const se_GetConversationsCommand = async (input, context) => {
|
|
|
75
76
|
};
|
|
76
77
|
exports.se_GetConversationsCommand = se_GetConversationsCommand;
|
|
77
78
|
const se_QueryPresenceCommand = async (input, context) => {
|
|
78
|
-
const b = (0,
|
|
79
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
79
80
|
const headers = {
|
|
80
81
|
'content-type': 'application/json',
|
|
81
82
|
};
|
|
@@ -91,7 +92,7 @@ const se_QueryPresenceCommand = async (input, context) => {
|
|
|
91
92
|
};
|
|
92
93
|
exports.se_QueryPresenceCommand = se_QueryPresenceCommand;
|
|
93
94
|
const se_QueryPresencesCommand = async (input, context) => {
|
|
94
|
-
const b = (0,
|
|
95
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
95
96
|
const headers = {
|
|
96
97
|
'content-type': 'application/json',
|
|
97
98
|
};
|
|
@@ -107,7 +108,7 @@ const se_QueryPresencesCommand = async (input, context) => {
|
|
|
107
108
|
};
|
|
108
109
|
exports.se_QueryPresencesCommand = se_QueryPresencesCommand;
|
|
109
110
|
const se_UpdatePresenceLastSeenCommand = async (input, context) => {
|
|
110
|
-
const b = (0,
|
|
111
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
111
112
|
const headers = {};
|
|
112
113
|
b.bp("/v2/stream/presence/update_last_seen");
|
|
113
114
|
const query = (0, smithy_client_1.map)({
|
|
@@ -139,7 +140,7 @@ const de_DescribeEventCommand = async (output, context) => {
|
|
|
139
140
|
const contents = (0, smithy_client_1.map)({
|
|
140
141
|
$metadata: deserializeMetadata(output),
|
|
141
142
|
});
|
|
142
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
143
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
143
144
|
const doc = (0, smithy_client_1.take)(data, {
|
|
144
145
|
'CallAnalyticsCostRecordEvent': _ => de_CallAnalyticsCostRecordEvent(_, context),
|
|
145
146
|
'CallAnalyticsLiveCompleteEvent': smithy_client_1._json,
|
|
@@ -218,7 +219,7 @@ const de_GetConferenceIdCommand = async (output, context) => {
|
|
|
218
219
|
const contents = (0, smithy_client_1.map)({
|
|
219
220
|
$metadata: deserializeMetadata(output),
|
|
220
221
|
});
|
|
221
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
222
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
222
223
|
const doc = (0, smithy_client_1.take)(data, {
|
|
223
224
|
'id': smithy_client_1.expectString,
|
|
224
225
|
});
|
|
@@ -233,7 +234,7 @@ const de_GetConversationsCommand = async (output, context) => {
|
|
|
233
234
|
const contents = (0, smithy_client_1.map)({
|
|
234
235
|
$metadata: deserializeMetadata(output),
|
|
235
236
|
});
|
|
236
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
237
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
237
238
|
const doc = (0, smithy_client_1.take)(data, {
|
|
238
239
|
'calls': smithy_client_1._json,
|
|
239
240
|
'chats': smithy_client_1._json,
|
|
@@ -250,7 +251,7 @@ const de_QueryPresenceCommand = async (output, context) => {
|
|
|
250
251
|
const contents = (0, smithy_client_1.map)({
|
|
251
252
|
$metadata: deserializeMetadata(output),
|
|
252
253
|
});
|
|
253
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
254
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
254
255
|
const doc = (0, smithy_client_1.take)(data, {
|
|
255
256
|
'presence': smithy_client_1._json,
|
|
256
257
|
});
|
|
@@ -265,7 +266,7 @@ const de_QueryPresencesCommand = async (output, context) => {
|
|
|
265
266
|
const contents = (0, smithy_client_1.map)({
|
|
266
267
|
$metadata: deserializeMetadata(output),
|
|
267
268
|
});
|
|
268
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
269
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
269
270
|
const doc = (0, smithy_client_1.take)(data, {
|
|
270
271
|
'presences': smithy_client_1._json,
|
|
271
272
|
});
|
|
@@ -287,9 +288,9 @@ exports.de_UpdatePresenceLastSeenCommand = de_UpdatePresenceLastSeenCommand;
|
|
|
287
288
|
const de_CommandError = async (output, context) => {
|
|
288
289
|
const parsedOutput = {
|
|
289
290
|
...output,
|
|
290
|
-
body: await
|
|
291
|
+
body: await (0, core_1.parseJsonErrorBody)(output.body, context)
|
|
291
292
|
};
|
|
292
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
293
|
+
const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
293
294
|
switch (errorCode) {
|
|
294
295
|
case "ForbiddenException":
|
|
295
296
|
case "smithy.framework#ForbiddenException":
|
|
@@ -415,7 +416,7 @@ const se_ConsumeEventInputEvent = (input, context) => {
|
|
|
415
416
|
smsStatus: value => ({ "smsStatus": (0, smithy_client_1._json)(value) }),
|
|
416
417
|
whatsappInbound: value => ({ "whatsappInbound": se_WhatsAppInboundConsumeEvent(value, context) }),
|
|
417
418
|
whatsappStatus: value => ({ "whatsappStatus": se_WhatsAppStatusConsumeEvent(value, context) }),
|
|
418
|
-
_: (name, value) => ({ name: value })
|
|
419
|
+
_: (name, value) => ({ [name]: value })
|
|
419
420
|
});
|
|
420
421
|
};
|
|
421
422
|
const se_WebsocketSubscribeAction = (input, context) => {
|
|
@@ -582,52 +583,6 @@ const deserializeMetadata = (output) => ({
|
|
|
582
583
|
cfId: output.headers["x-amz-cf-id"],
|
|
583
584
|
});
|
|
584
585
|
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
|
|
585
|
-
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
586
|
-
value !== null &&
|
|
587
|
-
value !== "" &&
|
|
588
|
-
(!Object.getOwnPropertyNames(value).includes("length") ||
|
|
589
|
-
value.length != 0) &&
|
|
590
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
591
586
|
const _c = "company";
|
|
592
587
|
const _u = "user";
|
|
593
588
|
const _uI = "userId";
|
|
594
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
|
|
595
|
-
if (encoded.length) {
|
|
596
|
-
return JSON.parse(encoded);
|
|
597
|
-
}
|
|
598
|
-
return {};
|
|
599
|
-
});
|
|
600
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
601
|
-
const value = await parseBody(errorBody, context);
|
|
602
|
-
value.message = value.message ?? value.Message;
|
|
603
|
-
return value;
|
|
604
|
-
};
|
|
605
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
606
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
607
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
608
|
-
let cleanValue = rawValue;
|
|
609
|
-
if (typeof cleanValue === "number") {
|
|
610
|
-
cleanValue = cleanValue.toString();
|
|
611
|
-
}
|
|
612
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
613
|
-
cleanValue = cleanValue.split(",")[0];
|
|
614
|
-
}
|
|
615
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
616
|
-
cleanValue = cleanValue.split(":")[0];
|
|
617
|
-
}
|
|
618
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
619
|
-
cleanValue = cleanValue.split("#")[1];
|
|
620
|
-
}
|
|
621
|
-
return cleanValue;
|
|
622
|
-
};
|
|
623
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
624
|
-
if (headerKey !== undefined) {
|
|
625
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
626
|
-
}
|
|
627
|
-
if (data.code !== undefined) {
|
|
628
|
-
return sanitizeErrorCode(data.code);
|
|
629
|
-
}
|
|
630
|
-
if (data["__type"] !== undefined) {
|
|
631
|
-
return sanitizeErrorCode(data["__type"]);
|
|
632
|
-
}
|
|
633
|
-
};
|
|
@@ -21,7 +21,7 @@ const getRuntimeConfig = (config) => {
|
|
|
21
21
|
runtime: "browser",
|
|
22
22
|
defaultsMode,
|
|
23
23
|
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
|
24
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_browser_1.
|
|
24
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_browser_1.createDefaultUserAgentProvider)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
|
|
25
25
|
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
26
26
|
requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
27
|
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
|
@@ -25,12 +25,13 @@ const getRuntimeConfig = (config) => {
|
|
|
25
25
|
runtime: "node",
|
|
26
26
|
defaultsMode,
|
|
27
27
|
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
28
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.
|
|
29
|
-
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
28
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
|
|
29
|
+
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
30
30
|
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
31
|
-
retryMode: config?.retryMode ?? (0, node_config_provider_1.loadConfig)({ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, }),
|
|
31
|
+
retryMode: config?.retryMode ?? (0, node_config_provider_1.loadConfig)({ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, }, config),
|
|
32
32
|
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
33
33
|
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
34
|
+
userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, { profile: 'wildix' }),
|
|
34
35
|
};
|
|
35
36
|
};
|
|
36
37
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -3,17 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.resolveRuntimeExtensions = void 0;
|
|
4
4
|
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
-
const asPartial = (t) => t;
|
|
7
6
|
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
8
|
-
const extensionConfiguration =
|
|
9
|
-
...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
10
|
-
...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
|
|
11
|
-
};
|
|
7
|
+
const extensionConfiguration = Object.assign((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig));
|
|
12
8
|
extensions.forEach(extension => extension.configure(extensionConfiguration));
|
|
13
|
-
return
|
|
14
|
-
...runtimeConfig,
|
|
15
|
-
...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
16
|
-
...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
|
|
17
|
-
};
|
|
9
|
+
return Object.assign(runtimeConfig, (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration));
|
|
18
10
|
};
|
|
19
11
|
exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
|
|
@@ -7,8 +7,11 @@ import { Client as __Client, } from "@smithy/smithy-client";
|
|
|
7
7
|
import { authorizationMiddleware } from '@wildix/smithy-utils';
|
|
8
8
|
export { __Client };
|
|
9
9
|
export class WdaStreamClient extends __Client {
|
|
10
|
+
config;
|
|
10
11
|
constructor(...[configuration]) {
|
|
11
12
|
let _config_0 = __getRuntimeConfig(configuration || {});
|
|
13
|
+
super(_config_0);
|
|
14
|
+
this.initConfig = _config_0;
|
|
12
15
|
let _config_1 = resolveUserAgentConfig(_config_0);
|
|
13
16
|
let _config_2 = resolveRetryConfig(_config_1);
|
|
14
17
|
let _config_3 = resolveRuntimeExtensions(_config_2, configuration?.extensions || []);
|
|
@@ -21,11 +24,7 @@ export class WdaStreamClient extends __Client {
|
|
|
21
24
|
path: ''
|
|
22
25
|
};
|
|
23
26
|
};
|
|
24
|
-
const config = {
|
|
25
|
-
..._config_3,
|
|
26
|
-
endpoint,
|
|
27
|
-
};
|
|
28
|
-
super(config);
|
|
27
|
+
const config = { ..._config_3, endpoint };
|
|
29
28
|
this.config = config;
|
|
30
29
|
this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
31
30
|
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { WdaStreamServiceException as __BaseException } from "./WdaStreamServiceException";
|
|
2
2
|
export class ValidationException extends __BaseException {
|
|
3
|
+
name = "ValidationException";
|
|
4
|
+
$fault = "client";
|
|
3
5
|
constructor(opts) {
|
|
4
6
|
super({
|
|
5
7
|
name: "ValidationException",
|
|
6
8
|
$fault: "client",
|
|
7
9
|
...opts
|
|
8
10
|
});
|
|
9
|
-
this.name = "ValidationException";
|
|
10
|
-
this.$fault = "client";
|
|
11
11
|
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -22,26 +22,26 @@ export const ConversationStatus = {
|
|
|
22
22
|
MISSED: "MISSED",
|
|
23
23
|
};
|
|
24
24
|
export class ForbiddenException extends __BaseException {
|
|
25
|
+
name = "ForbiddenException";
|
|
26
|
+
$fault = "client";
|
|
25
27
|
constructor(opts) {
|
|
26
28
|
super({
|
|
27
29
|
name: "ForbiddenException",
|
|
28
30
|
$fault: "client",
|
|
29
31
|
...opts
|
|
30
32
|
});
|
|
31
|
-
this.name = "ForbiddenException";
|
|
32
|
-
this.$fault = "client";
|
|
33
33
|
Object.setPrototypeOf(this, ForbiddenException.prototype);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
export class BadRequestException extends __BaseException {
|
|
37
|
+
name = "BadRequestException";
|
|
38
|
+
$fault = "client";
|
|
37
39
|
constructor(opts) {
|
|
38
40
|
super({
|
|
39
41
|
name: "BadRequestException",
|
|
40
42
|
$fault: "client",
|
|
41
43
|
...opts
|
|
42
44
|
});
|
|
43
|
-
this.name = "BadRequestException";
|
|
44
|
-
this.$fault = "client";
|
|
45
45
|
Object.setPrototypeOf(this, BadRequestException.prototype);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -106,6 +106,7 @@ export const CallDevice = {
|
|
|
106
106
|
XBEES_WEB: "XBEES_WEB",
|
|
107
107
|
};
|
|
108
108
|
export const License = {
|
|
109
|
+
UC: "uc",
|
|
109
110
|
XBEES: "x-bees",
|
|
110
111
|
};
|
|
111
112
|
export const CallFlowTranscriptionStatus = {
|
|
@@ -438,14 +439,14 @@ export const WebsocketEvent = {
|
|
|
438
439
|
UNSUBSCRIBE: "unsubscribed",
|
|
439
440
|
};
|
|
440
441
|
export class MatchNotFoundException extends __BaseException {
|
|
442
|
+
name = "MatchNotFoundException";
|
|
443
|
+
$fault = "client";
|
|
441
444
|
constructor(opts) {
|
|
442
445
|
super({
|
|
443
446
|
name: "MatchNotFoundException",
|
|
444
447
|
$fault: "client",
|
|
445
448
|
...opts
|
|
446
449
|
});
|
|
447
|
-
this.name = "MatchNotFoundException";
|
|
448
|
-
this.$fault = "client";
|
|
449
450
|
Object.setPrototypeOf(this, MatchNotFoundException.prototype);
|
|
450
451
|
}
|
|
451
452
|
}
|
|
@@ -464,14 +465,14 @@ export const TelephonyStatus = {
|
|
|
464
465
|
UNREGISTERED: "UNREGISTERED",
|
|
465
466
|
};
|
|
466
467
|
export class PresenceNotAvailableException extends __BaseException {
|
|
468
|
+
name = "PresenceNotAvailableException";
|
|
469
|
+
$fault = "client";
|
|
467
470
|
constructor(opts) {
|
|
468
471
|
super({
|
|
469
472
|
name: "PresenceNotAvailableException",
|
|
470
473
|
$fault: "client",
|
|
471
474
|
...opts
|
|
472
475
|
});
|
|
473
|
-
this.name = "PresenceNotAvailableException";
|
|
474
|
-
this.$fault = "client";
|
|
475
476
|
Object.setPrototypeOf(this, PresenceNotAvailableException.prototype);
|
|
476
477
|
}
|
|
477
478
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WdaStreamServiceException as __BaseException } from "../models/WdaStreamServiceException";
|
|
2
2
|
import { BadRequestException, ConsumeEventInputEvent, ForbiddenException, MatchNotFoundException, PresenceNotAvailableException, ValidationException, } from "../models/models_0";
|
|
3
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
3
4
|
import { requestBuilder as rb } from "@smithy/core";
|
|
4
5
|
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
6
|
export const se_ConsumeEventCommand = async (input, context) => {
|
|
@@ -398,7 +399,7 @@ const se_ConsumeEventInputEvent = (input, context) => {
|
|
|
398
399
|
smsStatus: value => ({ "smsStatus": _json(value) }),
|
|
399
400
|
whatsappInbound: value => ({ "whatsappInbound": se_WhatsAppInboundConsumeEvent(value, context) }),
|
|
400
401
|
whatsappStatus: value => ({ "whatsappStatus": se_WhatsAppStatusConsumeEvent(value, context) }),
|
|
401
|
-
_: (name, value) => ({ name: value })
|
|
402
|
+
_: (name, value) => ({ [name]: value })
|
|
402
403
|
});
|
|
403
404
|
};
|
|
404
405
|
const se_WebsocketSubscribeAction = (input, context) => {
|
|
@@ -565,52 +566,6 @@ const deserializeMetadata = (output) => ({
|
|
|
565
566
|
cfId: output.headers["x-amz-cf-id"],
|
|
566
567
|
});
|
|
567
568
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
|
|
568
|
-
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
569
|
-
value !== null &&
|
|
570
|
-
value !== "" &&
|
|
571
|
-
(!Object.getOwnPropertyNames(value).includes("length") ||
|
|
572
|
-
value.length != 0) &&
|
|
573
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
574
569
|
const _c = "company";
|
|
575
570
|
const _u = "user";
|
|
576
571
|
const _uI = "userId";
|
|
577
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
|
|
578
|
-
if (encoded.length) {
|
|
579
|
-
return JSON.parse(encoded);
|
|
580
|
-
}
|
|
581
|
-
return {};
|
|
582
|
-
});
|
|
583
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
584
|
-
const value = await parseBody(errorBody, context);
|
|
585
|
-
value.message = value.message ?? value.Message;
|
|
586
|
-
return value;
|
|
587
|
-
};
|
|
588
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
589
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
590
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
591
|
-
let cleanValue = rawValue;
|
|
592
|
-
if (typeof cleanValue === "number") {
|
|
593
|
-
cleanValue = cleanValue.toString();
|
|
594
|
-
}
|
|
595
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
596
|
-
cleanValue = cleanValue.split(",")[0];
|
|
597
|
-
}
|
|
598
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
599
|
-
cleanValue = cleanValue.split(":")[0];
|
|
600
|
-
}
|
|
601
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
602
|
-
cleanValue = cleanValue.split("#")[1];
|
|
603
|
-
}
|
|
604
|
-
return cleanValue;
|
|
605
|
-
};
|
|
606
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
607
|
-
if (headerKey !== undefined) {
|
|
608
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
609
|
-
}
|
|
610
|
-
if (data.code !== undefined) {
|
|
611
|
-
return sanitizeErrorCode(data.code);
|
|
612
|
-
}
|
|
613
|
-
if (data["__type"] !== undefined) {
|
|
614
|
-
return sanitizeErrorCode(data["__type"]);
|
|
615
|
-
}
|
|
616
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import packageInfo from "../package.json";
|
|
2
2
|
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
-
import {
|
|
3
|
+
import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser";
|
|
4
4
|
import { FetchHttpHandler as RequestHandler, streamCollector, } from "@smithy/fetch-http-handler";
|
|
5
5
|
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
6
6
|
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE, } from "@smithy/util-retry";
|
|
@@ -17,7 +17,7 @@ export const getRuntimeConfig = (config) => {
|
|
|
17
17
|
runtime: "browser",
|
|
18
18
|
defaultsMode,
|
|
19
19
|
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
20
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
20
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: packageInfo.name, clientVersion: packageInfo.version }),
|
|
21
21
|
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
22
22
|
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
23
23
|
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import packageInfo from "../package.json";
|
|
2
|
-
import {
|
|
2
|
+
import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider, } from "@aws-sdk/util-user-agent-node";
|
|
3
3
|
import { Hash } from "@smithy/hash-node";
|
|
4
4
|
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, } from "@smithy/middleware-retry";
|
|
5
5
|
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
@@ -21,11 +21,12 @@ export const getRuntimeConfig = (config) => {
|
|
|
21
21
|
runtime: "node",
|
|
22
22
|
defaultsMode,
|
|
23
23
|
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
24
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
25
|
-
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
24
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: packageInfo.name, clientVersion: packageInfo.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
26
26
|
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
|
-
retryMode: config?.retryMode ?? loadNodeConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, }),
|
|
27
|
+
retryMode: config?.retryMode ?? loadNodeConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, }, config),
|
|
28
28
|
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
29
29
|
streamCollector: config?.streamCollector ?? streamCollector,
|
|
30
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, { profile: 'wildix' }),
|
|
30
31
|
};
|
|
31
32
|
};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, } from "@smithy/protocol-http";
|
|
2
2
|
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, } from "@smithy/smithy-client";
|
|
3
|
-
const asPartial = (t) => t;
|
|
4
3
|
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
5
|
-
const extensionConfiguration =
|
|
6
|
-
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
7
|
-
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
8
|
-
};
|
|
4
|
+
const extensionConfiguration = Object.assign(getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig));
|
|
9
5
|
extensions.forEach(extension => extension.configure(extensionConfiguration));
|
|
10
|
-
return
|
|
11
|
-
...runtimeConfig,
|
|
12
|
-
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
13
|
-
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
14
|
-
};
|
|
6
|
+
return Object.assign(runtimeConfig, resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration));
|
|
15
7
|
};
|
|
@@ -89,7 +89,7 @@ declare const ConsumeEventCommand_base: {
|
|
|
89
89
|
* "STRING_VALUE",
|
|
90
90
|
* ],
|
|
91
91
|
* licenses: [ // LicensesList
|
|
92
|
-
* "x-bees",
|
|
92
|
+
* "x-bees" || "uc",
|
|
93
93
|
* ],
|
|
94
94
|
* },
|
|
95
95
|
* },
|
|
@@ -688,6 +688,18 @@ declare const ConsumeEventCommand_base: {
|
|
|
688
688
|
* @throws {@link WdaStreamServiceException}
|
|
689
689
|
* <p>Base exception class for all service exceptions from WdaStream service.</p>
|
|
690
690
|
*
|
|
691
|
+
*
|
|
691
692
|
*/
|
|
692
693
|
export declare class ConsumeEventCommand extends ConsumeEventCommand_base {
|
|
694
|
+
/** @internal type navigation helper, not in runtime. */
|
|
695
|
+
protected static __types: {
|
|
696
|
+
api: {
|
|
697
|
+
input: ConsumeEventInput;
|
|
698
|
+
output: {};
|
|
699
|
+
};
|
|
700
|
+
sdk: {
|
|
701
|
+
input: ConsumeEventCommandInput;
|
|
702
|
+
output: ConsumeEventCommandOutput;
|
|
703
|
+
};
|
|
704
|
+
};
|
|
693
705
|
}
|