@wildix/wim-voicebots-client 1.0.21 → 1.0.23

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.
Files changed (43) hide show
  1. package/dist-cjs/VoiceBots.js +4 -0
  2. package/dist-cjs/VoiceBotsClient.js +4 -5
  3. package/dist-cjs/commands/SendPlayCommand.js +21 -0
  4. package/dist-cjs/commands/SendStopCommand.js +21 -0
  5. package/dist-cjs/commands/index.js +2 -0
  6. package/dist-cjs/models/models_0.js +28 -22
  7. package/dist-cjs/protocols/Aws_restJson1.js +104 -85
  8. package/dist-cjs/runtimeConfig.browser.js +1 -1
  9. package/dist-cjs/runtimeConfig.js +4 -3
  10. package/dist-cjs/runtimeExtensions.js +2 -10
  11. package/dist-es/VoiceBots.js +4 -0
  12. package/dist-es/VoiceBotsClient.js +4 -5
  13. package/dist-es/commands/SendPlayCommand.js +17 -0
  14. package/dist-es/commands/SendStopCommand.js +17 -0
  15. package/dist-es/commands/index.js +2 -0
  16. package/dist-es/models/models_0.js +16 -10
  17. package/dist-es/protocols/Aws_restJson1.js +68 -53
  18. package/dist-es/runtimeConfig.browser.js +2 -2
  19. package/dist-es/runtimeConfig.js +5 -4
  20. package/dist-es/runtimeExtensions.js +2 -10
  21. package/dist-types/VoiceBots.d.ts +14 -0
  22. package/dist-types/VoiceBotsClient.d.ts +5 -3
  23. package/dist-types/commands/CreateVoiceBotCommand.d.ts +12 -0
  24. package/dist-types/commands/DeleteVoiceBotCommand.d.ts +12 -0
  25. package/dist-types/commands/DescribeEventCommand.d.ts +78 -22
  26. package/dist-types/commands/GetTraceCommand.d.ts +33 -8
  27. package/dist-types/commands/GetVoiceBotCommand.d.ts +12 -0
  28. package/dist-types/commands/ListTracesCommand.d.ts +12 -0
  29. package/dist-types/commands/ListVoiceBotsCommand.d.ts +12 -0
  30. package/dist-types/commands/ListVoiceBotsNamesCommand.d.ts +12 -0
  31. package/dist-types/commands/SendHangupCommand.d.ts +12 -0
  32. package/dist-types/commands/SendPlayCommand.d.ts +79 -0
  33. package/dist-types/commands/SendSayCommand.d.ts +16 -0
  34. package/dist-types/commands/SendStopCommand.d.ts +76 -0
  35. package/dist-types/commands/SendTransferCommand.d.ts +12 -0
  36. package/dist-types/commands/UpdateVoiceBotCommand.d.ts +12 -0
  37. package/dist-types/commands/index.d.ts +2 -0
  38. package/dist-types/models/models_0.d.ts +212 -109
  39. package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
  40. package/dist-types/runtimeConfig.browser.d.ts +3 -2
  41. package/dist-types/runtimeConfig.d.ts +3 -2
  42. package/dist-types/runtimeConfig.native.d.ts +3 -2
  43. package/package.json +37 -33
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateVoiceBotCommand = exports.de_SendTransferCommand = exports.de_SendSayCommand = exports.de_SendHangupCommand = exports.de_ListVoiceBotsNamesCommand = exports.de_ListVoiceBotsCommand = exports.de_ListTracesCommand = exports.de_GetVoiceBotCommand = exports.de_GetTraceCommand = exports.de_DescribeEventCommand = exports.de_DeleteVoiceBotCommand = exports.de_CreateVoiceBotCommand = exports.se_UpdateVoiceBotCommand = exports.se_SendTransferCommand = exports.se_SendSayCommand = exports.se_SendHangupCommand = exports.se_ListVoiceBotsNamesCommand = exports.se_ListVoiceBotsCommand = exports.se_ListTracesCommand = exports.se_GetVoiceBotCommand = exports.se_GetTraceCommand = exports.se_DescribeEventCommand = exports.se_DeleteVoiceBotCommand = exports.se_CreateVoiceBotCommand = void 0;
3
+ exports.de_UpdateVoiceBotCommand = exports.de_SendTransferCommand = exports.de_SendStopCommand = exports.de_SendSayCommand = exports.de_SendPlayCommand = exports.de_SendHangupCommand = exports.de_ListVoiceBotsNamesCommand = exports.de_ListVoiceBotsCommand = exports.de_ListTracesCommand = exports.de_GetVoiceBotCommand = exports.de_GetTraceCommand = exports.de_DescribeEventCommand = exports.de_DeleteVoiceBotCommand = exports.de_CreateVoiceBotCommand = exports.se_UpdateVoiceBotCommand = exports.se_SendTransferCommand = exports.se_SendStopCommand = exports.se_SendSayCommand = exports.se_SendPlayCommand = exports.se_SendHangupCommand = exports.se_ListVoiceBotsNamesCommand = exports.se_ListVoiceBotsCommand = exports.se_ListTracesCommand = exports.se_GetVoiceBotCommand = exports.se_GetTraceCommand = exports.se_DescribeEventCommand = exports.se_DeleteVoiceBotCommand = exports.se_CreateVoiceBotCommand = void 0;
4
4
  const VoiceBotsServiceException_1 = require("../models/VoiceBotsServiceException");
5
5
  const models_0_1 = require("../models/models_0");
6
- const core_1 = require("@smithy/core");
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_CreateVoiceBotCommand = async (input, context) => {
9
- const b = (0, core_1.requestBuilder)(input, context);
10
+ const b = (0, core_2.requestBuilder)(input, context);
10
11
  const headers = {
11
12
  'content-type': 'application/json',
12
13
  };
@@ -29,7 +30,7 @@ const se_CreateVoiceBotCommand = async (input, context) => {
29
30
  };
30
31
  exports.se_CreateVoiceBotCommand = se_CreateVoiceBotCommand;
31
32
  const se_DeleteVoiceBotCommand = async (input, context) => {
32
- const b = (0, core_1.requestBuilder)(input, context);
33
+ const b = (0, core_2.requestBuilder)(input, context);
33
34
  const headers = {};
34
35
  b.bp("/v2/voicebots/bots/{botId}");
35
36
  b.p('botId', () => input.botId, '{botId}', false);
@@ -45,13 +46,10 @@ const se_DeleteVoiceBotCommand = async (input, context) => {
45
46
  };
46
47
  exports.se_DeleteVoiceBotCommand = se_DeleteVoiceBotCommand;
47
48
  const se_DescribeEventCommand = async (input, context) => {
48
- const b = (0, core_1.requestBuilder)(input, context);
49
- const headers = {
50
- 'content-type': 'application/json',
51
- };
49
+ const b = (0, core_2.requestBuilder)(input, context);
50
+ const headers = {};
52
51
  b.bp("/v2/voicebots/describe");
53
52
  let body;
54
- body = "";
55
53
  b.m("POST")
56
54
  .h(headers)
57
55
  .b(body);
@@ -59,7 +57,7 @@ const se_DescribeEventCommand = async (input, context) => {
59
57
  };
60
58
  exports.se_DescribeEventCommand = se_DescribeEventCommand;
61
59
  const se_GetTraceCommand = async (input, context) => {
62
- const b = (0, core_1.requestBuilder)(input, context);
60
+ const b = (0, core_2.requestBuilder)(input, context);
63
61
  const headers = {};
64
62
  b.bp("/v2/voicebots/traces/{sessionId}");
65
63
  b.p('sessionId', () => input.sessionId, '{sessionId}', false);
@@ -75,7 +73,7 @@ const se_GetTraceCommand = async (input, context) => {
75
73
  };
76
74
  exports.se_GetTraceCommand = se_GetTraceCommand;
77
75
  const se_GetVoiceBotCommand = async (input, context) => {
78
- const b = (0, core_1.requestBuilder)(input, context);
76
+ const b = (0, core_2.requestBuilder)(input, context);
79
77
  const headers = {};
80
78
  b.bp("/v2/voicebots/bots/{botId}");
81
79
  b.p('botId', () => input.botId, '{botId}', false);
@@ -91,7 +89,7 @@ const se_GetVoiceBotCommand = async (input, context) => {
91
89
  };
92
90
  exports.se_GetVoiceBotCommand = se_GetVoiceBotCommand;
93
91
  const se_ListTracesCommand = async (input, context) => {
94
- const b = (0, core_1.requestBuilder)(input, context);
92
+ const b = (0, core_2.requestBuilder)(input, context);
95
93
  const headers = {};
96
94
  b.bp("/v2/voicebots/traces");
97
95
  const query = (0, smithy_client_1.map)({
@@ -106,7 +104,7 @@ const se_ListTracesCommand = async (input, context) => {
106
104
  };
107
105
  exports.se_ListTracesCommand = se_ListTracesCommand;
108
106
  const se_ListVoiceBotsCommand = async (input, context) => {
109
- const b = (0, core_1.requestBuilder)(input, context);
107
+ const b = (0, core_2.requestBuilder)(input, context);
110
108
  const headers = {};
111
109
  b.bp("/v2/voicebots/bots");
112
110
  const query = (0, smithy_client_1.map)({
@@ -121,7 +119,7 @@ const se_ListVoiceBotsCommand = async (input, context) => {
121
119
  };
122
120
  exports.se_ListVoiceBotsCommand = se_ListVoiceBotsCommand;
123
121
  const se_ListVoiceBotsNamesCommand = async (input, context) => {
124
- const b = (0, core_1.requestBuilder)(input, context);
122
+ const b = (0, core_2.requestBuilder)(input, context);
125
123
  const headers = {};
126
124
  b.bp("/v2/voicebots/names");
127
125
  const query = (0, smithy_client_1.map)({
@@ -136,7 +134,7 @@ const se_ListVoiceBotsNamesCommand = async (input, context) => {
136
134
  };
137
135
  exports.se_ListVoiceBotsNamesCommand = se_ListVoiceBotsNamesCommand;
138
136
  const se_SendHangupCommand = async (input, context) => {
139
- const b = (0, core_1.requestBuilder)(input, context);
137
+ const b = (0, core_2.requestBuilder)(input, context);
140
138
  const headers = {
141
139
  'content-type': 'application/json',
142
140
  };
@@ -152,8 +150,27 @@ const se_SendHangupCommand = async (input, context) => {
152
150
  return b.build();
153
151
  };
154
152
  exports.se_SendHangupCommand = se_SendHangupCommand;
153
+ const se_SendPlayCommand = async (input, context) => {
154
+ const b = (0, core_2.requestBuilder)(input, context);
155
+ const headers = {
156
+ 'content-type': 'application/json',
157
+ };
158
+ b.bp("/v2/voicebots/sessions/{sessionId}/play");
159
+ b.p('sessionId', () => input.sessionId, '{sessionId}', false);
160
+ let body;
161
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
162
+ 'data': [],
163
+ 'replyId': [],
164
+ 'streamId': [],
165
+ }));
166
+ b.m("POST")
167
+ .h(headers)
168
+ .b(body);
169
+ return b.build();
170
+ };
171
+ exports.se_SendPlayCommand = se_SendPlayCommand;
155
172
  const se_SendSayCommand = async (input, context) => {
156
- const b = (0, core_1.requestBuilder)(input, context);
173
+ const b = (0, core_2.requestBuilder)(input, context);
157
174
  const headers = {
158
175
  'content-type': 'application/json',
159
176
  };
@@ -161,6 +178,7 @@ const se_SendSayCommand = async (input, context) => {
161
178
  b.p('sessionId', () => input.sessionId, '{sessionId}', false);
162
179
  let body;
163
180
  body = JSON.stringify((0, smithy_client_1.take)(input, {
181
+ 'audio': _ => (0, smithy_client_1._json)(_),
164
182
  'interruptible': [],
165
183
  'replyId': [],
166
184
  'text': [],
@@ -171,8 +189,20 @@ const se_SendSayCommand = async (input, context) => {
171
189
  return b.build();
172
190
  };
173
191
  exports.se_SendSayCommand = se_SendSayCommand;
192
+ const se_SendStopCommand = async (input, context) => {
193
+ const b = (0, core_2.requestBuilder)(input, context);
194
+ const headers = {};
195
+ b.bp("/v2/voicebots/sessions/{sessionId}/stop");
196
+ b.p('sessionId', () => input.sessionId, '{sessionId}', false);
197
+ let body;
198
+ b.m("POST")
199
+ .h(headers)
200
+ .b(body);
201
+ return b.build();
202
+ };
203
+ exports.se_SendStopCommand = se_SendStopCommand;
174
204
  const se_SendTransferCommand = async (input, context) => {
175
- const b = (0, core_1.requestBuilder)(input, context);
205
+ const b = (0, core_2.requestBuilder)(input, context);
176
206
  const headers = {
177
207
  'content-type': 'application/json',
178
208
  };
@@ -190,7 +220,7 @@ const se_SendTransferCommand = async (input, context) => {
190
220
  };
191
221
  exports.se_SendTransferCommand = se_SendTransferCommand;
192
222
  const se_UpdateVoiceBotCommand = async (input, context) => {
193
- const b = (0, core_1.requestBuilder)(input, context);
223
+ const b = (0, core_2.requestBuilder)(input, context);
194
224
  const headers = {
195
225
  'content-type': 'application/json',
196
226
  };
@@ -220,7 +250,7 @@ const de_CreateVoiceBotCommand = async (output, context) => {
220
250
  const contents = (0, smithy_client_1.map)({
221
251
  $metadata: deserializeMetadata(output),
222
252
  });
223
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
253
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
224
254
  const doc = (0, smithy_client_1.take)(data, {
225
255
  'bot': _ => de_VoiceBot(_, context),
226
256
  });
@@ -246,13 +276,15 @@ const de_DescribeEventCommand = async (output, context) => {
246
276
  const contents = (0, smithy_client_1.map)({
247
277
  $metadata: deserializeMetadata(output),
248
278
  });
249
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
279
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
250
280
  const doc = (0, smithy_client_1.take)(data, {
281
+ 'AudioWebhookEvent': smithy_client_1._json,
251
282
  'CompleteWebhookEvent': smithy_client_1._json,
252
283
  'CompleteWebsocketEvent': smithy_client_1._json,
253
284
  'HangupWebsocketCommand': smithy_client_1._json,
254
285
  'InterruptionWebhookEvent': smithy_client_1._json,
255
286
  'InterruptionWebsocketEvent': smithy_client_1._json,
287
+ 'PlayWebsocketCommand': smithy_client_1._json,
256
288
  'PlaybackWebhookEvent': smithy_client_1._json,
257
289
  'PlaybackWebsocketEvent': smithy_client_1._json,
258
290
  'PubSubBroadcastWebsocketEvent': _ => de_PubSubBroadcastWebsocketEvent(_, context),
@@ -265,6 +297,7 @@ const de_DescribeEventCommand = async (output, context) => {
265
297
  'SayWebsocketCommand': smithy_client_1._json,
266
298
  'SessionEndedWebhookEvent': smithy_client_1._json,
267
299
  'SessionStartedWebhookEvent': smithy_client_1._json,
300
+ 'StopWebsocketCommand': smithy_client_1._json,
268
301
  'TranscriptionWebhookEvent': smithy_client_1._json,
269
302
  'TranscriptionWebsocketEvent': smithy_client_1._json,
270
303
  'TransferWebsocketCommand': smithy_client_1._json,
@@ -280,7 +313,7 @@ const de_GetTraceCommand = async (output, context) => {
280
313
  const contents = (0, smithy_client_1.map)({
281
314
  $metadata: deserializeMetadata(output),
282
315
  });
283
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
316
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
284
317
  const doc = (0, smithy_client_1.take)(data, {
285
318
  'trace': _ => de_Trace(_, context),
286
319
  });
@@ -295,7 +328,7 @@ const de_GetVoiceBotCommand = async (output, context) => {
295
328
  const contents = (0, smithy_client_1.map)({
296
329
  $metadata: deserializeMetadata(output),
297
330
  });
298
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
331
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
299
332
  const doc = (0, smithy_client_1.take)(data, {
300
333
  'bot': _ => de_VoiceBot(_, context),
301
334
  });
@@ -310,7 +343,7 @@ const de_ListTracesCommand = async (output, context) => {
310
343
  const contents = (0, smithy_client_1.map)({
311
344
  $metadata: deserializeMetadata(output),
312
345
  });
313
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
346
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
314
347
  const doc = (0, smithy_client_1.take)(data, {
315
348
  'traces': _ => de_TraceSessionsList(_, context),
316
349
  });
@@ -325,7 +358,7 @@ const de_ListVoiceBotsCommand = async (output, context) => {
325
358
  const contents = (0, smithy_client_1.map)({
326
359
  $metadata: deserializeMetadata(output),
327
360
  });
328
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
361
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
329
362
  const doc = (0, smithy_client_1.take)(data, {
330
363
  'bots': _ => de_VoiceBotsList(_, context),
331
364
  });
@@ -340,7 +373,7 @@ const de_ListVoiceBotsNamesCommand = async (output, context) => {
340
373
  const contents = (0, smithy_client_1.map)({
341
374
  $metadata: deserializeMetadata(output),
342
375
  });
343
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
376
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
344
377
  const doc = (0, smithy_client_1.take)(data, {
345
378
  'bots': smithy_client_1._json,
346
379
  });
@@ -359,6 +392,17 @@ const de_SendHangupCommand = async (output, context) => {
359
392
  return contents;
360
393
  };
361
394
  exports.de_SendHangupCommand = de_SendHangupCommand;
395
+ const de_SendPlayCommand = async (output, context) => {
396
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
397
+ return de_CommandError(output, context);
398
+ }
399
+ const contents = (0, smithy_client_1.map)({
400
+ $metadata: deserializeMetadata(output),
401
+ });
402
+ await (0, smithy_client_1.collectBody)(output.body, context);
403
+ return contents;
404
+ };
405
+ exports.de_SendPlayCommand = de_SendPlayCommand;
362
406
  const de_SendSayCommand = async (output, context) => {
363
407
  if (output.statusCode !== 200 && output.statusCode >= 300) {
364
408
  return de_CommandError(output, context);
@@ -370,6 +414,17 @@ const de_SendSayCommand = async (output, context) => {
370
414
  return contents;
371
415
  };
372
416
  exports.de_SendSayCommand = de_SendSayCommand;
417
+ const de_SendStopCommand = async (output, context) => {
418
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
419
+ return de_CommandError(output, context);
420
+ }
421
+ const contents = (0, smithy_client_1.map)({
422
+ $metadata: deserializeMetadata(output),
423
+ });
424
+ await (0, smithy_client_1.collectBody)(output.body, context);
425
+ return contents;
426
+ };
427
+ exports.de_SendStopCommand = de_SendStopCommand;
373
428
  const de_SendTransferCommand = async (output, context) => {
374
429
  if (output.statusCode !== 200 && output.statusCode >= 300) {
375
430
  return de_CommandError(output, context);
@@ -388,7 +443,7 @@ const de_UpdateVoiceBotCommand = async (output, context) => {
388
443
  const contents = (0, smithy_client_1.map)({
389
444
  $metadata: deserializeMetadata(output),
390
445
  });
391
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
446
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
392
447
  const doc = (0, smithy_client_1.take)(data, {
393
448
  'bot': _ => de_VoiceBot(_, context),
394
449
  });
@@ -399,9 +454,9 @@ exports.de_UpdateVoiceBotCommand = de_UpdateVoiceBotCommand;
399
454
  const de_CommandError = async (output, context) => {
400
455
  const parsedOutput = {
401
456
  ...output,
402
- body: await parseErrorBody(output.body, context)
457
+ body: await (0, core_1.parseJsonErrorBody)(output.body, context)
403
458
  };
404
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
459
+ const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
405
460
  switch (errorCode) {
406
461
  case "ForbiddenException":
407
462
  case "smithy.framework#ForbiddenException":
@@ -518,7 +573,7 @@ const se_VoiceBotEndpoint = (input, context) => {
518
573
  openAiAssistant: value => ({ "openAiAssistant": (0, smithy_client_1._json)(value) }),
519
574
  sqs: value => ({ "sqs": (0, smithy_client_1._json)(value) }),
520
575
  webhook: value => ({ "webhook": (0, smithy_client_1._json)(value) }),
521
- _: (name, value) => ({ name: value })
576
+ _: (name, value) => ({ [name]: value })
522
577
  });
523
578
  };
524
579
  const se_VoiceBotFunctionDefinition = (input, context) => {
@@ -532,7 +587,7 @@ const se_VoiceBotFunctionDefinition = (input, context) => {
532
587
  const se_VoiceBotFunctionIntegration = (input, context) => {
533
588
  return models_0_1.VoiceBotFunctionIntegration.visit(input, {
534
589
  webhook: value => ({ "webhook": se_VoiceBotFunctionIntegrationWebhook(value, context) }),
535
- _: (name, value) => ({ name: value })
590
+ _: (name, value) => ({ [name]: value })
536
591
  });
537
592
  };
538
593
  const se_VoiceBotFunctionIntegrationWebhook = (input, context) => {
@@ -614,10 +669,11 @@ const de_TraceActivity = (output, context) => {
614
669
  return (0, smithy_client_1.take)(output, {
615
670
  'duration': smithy_client_1.expectInt32,
616
671
  'id': smithy_client_1.expectString,
617
- 'result': (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
672
+ 'result': (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
618
673
  'start': smithy_client_1.limitedParseDouble,
619
674
  'status': smithy_client_1.expectString,
620
- 'trigger': (_) => de_TraceActivityTrigger((0, smithy_client_1.expectUnion)(_), context),
675
+ 'timings': (_) => de_TraceTimings(_, context),
676
+ 'trigger': (_) => de_TraceActivityTrigger((0, core_1.awsExpectUnion)(_), context),
621
677
  'usage': smithy_client_1._json,
622
678
  'version': smithy_client_1.expectInt32,
623
679
  });
@@ -708,7 +764,7 @@ const de_TraceGenericInput = (output, context) => {
708
764
  };
709
765
  const de_TraceGenericInputBlock = (output, context) => {
710
766
  return (0, smithy_client_1.take)(output, {
711
- 'content': (_) => de_TraceGenericInputBlockContent((0, smithy_client_1.expectUnion)(_), context),
767
+ 'content': (_) => de_TraceGenericInputBlockContent((0, core_1.awsExpectUnion)(_), context),
712
768
  'title': smithy_client_1.expectString,
713
769
  });
714
770
  };
@@ -734,8 +790,8 @@ const de_TraceSegment = (output, context) => {
734
790
  'activityId': smithy_client_1.expectString,
735
791
  'duration': smithy_client_1.expectInt32,
736
792
  'id': smithy_client_1.expectString,
737
- 'input': (_) => de_TraceSegmentInput((0, smithy_client_1.expectUnion)(_), context),
738
- 'result': (_) => de_TraceSegmentResult((0, smithy_client_1.expectUnion)(_), context),
793
+ 'input': (_) => de_TraceSegmentInput((0, core_1.awsExpectUnion)(_), context),
794
+ 'result': (_) => de_TraceSegmentResult((0, core_1.awsExpectUnion)(_), context),
739
795
  'start': smithy_client_1.limitedParseDouble,
740
796
  'status': smithy_client_1.expectString,
741
797
  'version': smithy_client_1.expectInt32,
@@ -759,7 +815,7 @@ const de_TraceSegmentInput = (output, context) => {
759
815
  }
760
816
  if (output.tool != null) {
761
817
  return {
762
- tool: (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(output.tool))
818
+ tool: (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(output.tool))
763
819
  };
764
820
  }
765
821
  return { $unknown: Object.entries(output)[0] };
@@ -819,10 +875,19 @@ const de_TraceSilenceTimeoutTaskTrigger = (output, context) => {
819
875
  'parameters': (_) => de_Document(_, context),
820
876
  });
821
877
  };
878
+ const de_TraceTimings = (output, context) => {
879
+ return Object.entries(output).reduce((acc, [key, value]) => {
880
+ if (value === null) {
881
+ return acc;
882
+ }
883
+ acc[key] = (0, smithy_client_1.limitedParseDouble)(value);
884
+ return acc;
885
+ }, {});
886
+ };
822
887
  const de_VoiceBot = (output, context) => {
823
888
  return (0, smithy_client_1.take)(output, {
824
889
  'createdAt': smithy_client_1.expectString,
825
- 'endpoint': (_) => de_VoiceBotEndpoint((0, smithy_client_1.expectUnion)(_), context),
890
+ 'endpoint': (_) => de_VoiceBotEndpoint((0, core_1.awsExpectUnion)(_), context),
826
891
  'id': smithy_client_1.expectString,
827
892
  'message': smithy_client_1.expectString,
828
893
  'name': smithy_client_1.expectString,
@@ -874,7 +939,7 @@ const de_VoiceBotEndpoint = (output, context) => {
874
939
  const de_VoiceBotFunctionDefinition = (output, context) => {
875
940
  return (0, smithy_client_1.take)(output, {
876
941
  'description': smithy_client_1.expectString,
877
- 'integration': (_) => de_VoiceBotFunctionIntegration((0, smithy_client_1.expectUnion)(_), context),
942
+ 'integration': (_) => de_VoiceBotFunctionIntegration((0, core_1.awsExpectUnion)(_), context),
878
943
  'name': smithy_client_1.expectString,
879
944
  'parameters': (_) => de_Document(_, context),
880
945
  });
@@ -890,7 +955,7 @@ const de_VoiceBotFunctionIntegration = (output, context) => {
890
955
  const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
891
956
  return (0, smithy_client_1.take)(output, {
892
957
  'async': smithy_client_1.expectBoolean,
893
- 'authorization': (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
958
+ 'authorization': (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
894
959
  'headers': smithy_client_1._json,
895
960
  'method': smithy_client_1.expectString,
896
961
  'parameters': (_) => de_Document(_, context),
@@ -937,50 +1002,4 @@ const deserializeMetadata = (output) => ({
937
1002
  cfId: output.headers["x-amz-cf-id"],
938
1003
  });
939
1004
  const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
940
- const isSerializableHeaderValue = (value) => value !== undefined &&
941
- value !== null &&
942
- value !== "" &&
943
- (!Object.getOwnPropertyNames(value).includes("length") ||
944
- value.length != 0) &&
945
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
946
1005
  const _c = "company";
947
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
948
- if (encoded.length) {
949
- return JSON.parse(encoded);
950
- }
951
- return {};
952
- });
953
- const parseErrorBody = async (errorBody, context) => {
954
- const value = await parseBody(errorBody, context);
955
- value.message = value.message ?? value.Message;
956
- return value;
957
- };
958
- const loadRestJsonErrorCode = (output, data) => {
959
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
960
- const sanitizeErrorCode = (rawValue) => {
961
- let cleanValue = rawValue;
962
- if (typeof cleanValue === "number") {
963
- cleanValue = cleanValue.toString();
964
- }
965
- if (cleanValue.indexOf(",") >= 0) {
966
- cleanValue = cleanValue.split(",")[0];
967
- }
968
- if (cleanValue.indexOf(":") >= 0) {
969
- cleanValue = cleanValue.split(":")[0];
970
- }
971
- if (cleanValue.indexOf("#") >= 0) {
972
- cleanValue = cleanValue.split("#")[1];
973
- }
974
- return cleanValue;
975
- };
976
- const headerKey = findKey(output.headers, "x-amzn-errortype");
977
- if (headerKey !== undefined) {
978
- return sanitizeErrorCode(output.headers[headerKey]);
979
- }
980
- if (data.code !== undefined) {
981
- return sanitizeErrorCode(data.code);
982
- }
983
- if (data["__type"] !== undefined) {
984
- return sanitizeErrorCode(data["__type"]);
985
- }
986
- };
@@ -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.defaultUserAgent)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
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.defaultUserAgent)({ 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),
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;
@@ -8,7 +8,9 @@ import { ListTracesCommand, } from "./commands/ListTracesCommand";
8
8
  import { ListVoiceBotsCommand, } from "./commands/ListVoiceBotsCommand";
9
9
  import { ListVoiceBotsNamesCommand, } from "./commands/ListVoiceBotsNamesCommand";
10
10
  import { SendHangupCommand, } from "./commands/SendHangupCommand";
11
+ import { SendPlayCommand, } from "./commands/SendPlayCommand";
11
12
  import { SendSayCommand, } from "./commands/SendSayCommand";
13
+ import { SendStopCommand, } from "./commands/SendStopCommand";
12
14
  import { SendTransferCommand, } from "./commands/SendTransferCommand";
13
15
  import { UpdateVoiceBotCommand, } from "./commands/UpdateVoiceBotCommand";
14
16
  import { createAggregatedClient } from "@smithy/smithy-client";
@@ -22,7 +24,9 @@ const commands = {
22
24
  ListVoiceBotsCommand,
23
25
  ListVoiceBotsNamesCommand,
24
26
  SendHangupCommand,
27
+ SendPlayCommand,
25
28
  SendSayCommand,
29
+ SendStopCommand,
26
30
  SendTransferCommand,
27
31
  UpdateVoiceBotCommand,
28
32
  };
@@ -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 VoiceBotsClient 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 VoiceBotsClient 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));
@@ -0,0 +1,17 @@
1
+ import { de_SendPlayCommand, se_SendPlayCommand, } 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 SendPlayCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("VoiceBots", "SendPlay", {})
12
+ .n("VoiceBotsClient", "SendPlayCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_SendPlayCommand)
15
+ .de(de_SendPlayCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_SendStopCommand, se_SendStopCommand, } 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 SendStopCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("VoiceBots", "SendStop", {})
12
+ .n("VoiceBotsClient", "SendStopCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_SendStopCommand)
15
+ .de(de_SendStopCommand)
16
+ .build() {
17
+ }
@@ -7,6 +7,8 @@ export * from "./ListTracesCommand";
7
7
  export * from "./ListVoiceBotsCommand";
8
8
  export * from "./ListVoiceBotsNamesCommand";
9
9
  export * from "./SendHangupCommand";
10
+ export * from "./SendPlayCommand";
10
11
  export * from "./SendSayCommand";
12
+ export * from "./SendStopCommand";
11
13
  export * from "./SendTransferCommand";
12
14
  export * from "./UpdateVoiceBotCommand";