@wildix/xbees-kite-client 1.0.15 → 1.0.18

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 (65) hide show
  1. package/dist-cjs/Kite.js +18 -0
  2. package/dist-cjs/KiteClient.js +4 -5
  3. package/dist-cjs/commands/GetSmsNumberConfigurationCommand.js +21 -0
  4. package/dist-cjs/commands/GetWhatsAppNumberConfigurationCommand.js +21 -0
  5. package/dist-cjs/commands/ListSmsConfigurationsCommand.js +21 -0
  6. package/dist-cjs/commands/ListSmsNumbersCommand.js +21 -0
  7. package/dist-cjs/commands/ListWhatsAppConfigurationsCommand.js +21 -0
  8. package/dist-cjs/commands/ListWhatsAppNumbersCommand.js +21 -0
  9. package/dist-cjs/commands/ListWhatsAppTemplatesCommand.js +21 -0
  10. package/dist-cjs/commands/PutSmsNumberConfigurationCommand.js +21 -0
  11. package/dist-cjs/commands/PutWhatsAppNumberConfigurationCommand.js +21 -0
  12. package/dist-cjs/commands/index.js +9 -0
  13. package/dist-cjs/models/models_0.js +113 -22
  14. package/dist-cjs/protocols/Aws_restJson1.js +347 -76
  15. package/dist-cjs/runtimeConfig.browser.js +1 -1
  16. package/dist-cjs/runtimeConfig.js +4 -3
  17. package/dist-cjs/runtimeExtensions.js +2 -10
  18. package/dist-es/Kite.js +18 -0
  19. package/dist-es/KiteClient.js +4 -5
  20. package/dist-es/commands/GetSmsNumberConfigurationCommand.js +17 -0
  21. package/dist-es/commands/GetWhatsAppNumberConfigurationCommand.js +17 -0
  22. package/dist-es/commands/ListSmsConfigurationsCommand.js +17 -0
  23. package/dist-es/commands/ListSmsNumbersCommand.js +17 -0
  24. package/dist-es/commands/ListWhatsAppConfigurationsCommand.js +17 -0
  25. package/dist-es/commands/ListWhatsAppNumbersCommand.js +17 -0
  26. package/dist-es/commands/ListWhatsAppTemplatesCommand.js +17 -0
  27. package/dist-es/commands/PutSmsNumberConfigurationCommand.js +17 -0
  28. package/dist-es/commands/PutWhatsAppNumberConfigurationCommand.js +17 -0
  29. package/dist-es/commands/index.js +9 -0
  30. package/dist-es/models/models_0.js +105 -15
  31. package/dist-es/protocols/Aws_restJson1.js +301 -48
  32. package/dist-es/runtimeConfig.browser.js +2 -2
  33. package/dist-es/runtimeConfig.js +5 -4
  34. package/dist-es/runtimeExtensions.js +2 -10
  35. package/dist-types/Kite.d.ts +67 -0
  36. package/dist-types/KiteClient.d.ts +11 -2
  37. package/dist-types/commands/CancelCalendarEventCommand.d.ts +17 -0
  38. package/dist-types/commands/CreateOrUpdateWidgetPreviewCommand.d.ts +120 -0
  39. package/dist-types/commands/CreateWidgetCommand.d.ts +120 -0
  40. package/dist-types/commands/DeleteWidgetCommand.d.ts +14 -0
  41. package/dist-types/commands/GetCalendarSlotsCommand.d.ts +14 -0
  42. package/dist-types/commands/GetConfigCommand.d.ts +14 -0
  43. package/dist-types/commands/GetSmsNumberConfigurationCommand.d.ts +179 -0
  44. package/dist-types/commands/GetWhatsAppNumberConfigurationCommand.d.ts +179 -0
  45. package/dist-types/commands/GetWidgetCommand.d.ts +67 -0
  46. package/dist-types/commands/ListAgentsCommand.d.ts +14 -0
  47. package/dist-types/commands/ListServicesCommand.d.ts +14 -0
  48. package/dist-types/commands/ListSmsConfigurationsCommand.d.ts +180 -0
  49. package/dist-types/commands/ListSmsNumbersCommand.d.ts +82 -0
  50. package/dist-types/commands/ListWhatsAppConfigurationsCommand.d.ts +180 -0
  51. package/dist-types/commands/ListWhatsAppNumbersCommand.d.ts +82 -0
  52. package/dist-types/commands/ListWhatsAppTemplatesCommand.d.ts +118 -0
  53. package/dist-types/commands/ListWidgetsCommand.d.ts +67 -0
  54. package/dist-types/commands/PutSmsNumberConfigurationCommand.d.ts +272 -0
  55. package/dist-types/commands/PutWhatsAppNumberConfigurationCommand.d.ts +272 -0
  56. package/dist-types/commands/RescheduleCalendarEventCommand.d.ts +17 -0
  57. package/dist-types/commands/ScheduleCalendarEventCommand.d.ts +17 -0
  58. package/dist-types/commands/UpdateWidgetCommand.d.ts +120 -0
  59. package/dist-types/commands/index.d.ts +9 -0
  60. package/dist-types/models/models_0.d.ts +908 -165
  61. package/dist-types/protocols/Aws_restJson1.d.ts +81 -0
  62. package/dist-types/runtimeConfig.browser.d.ts +2 -1
  63. package/dist-types/runtimeConfig.d.ts +2 -1
  64. package/dist-types/runtimeConfig.native.d.ts +2 -1
  65. package/package.json +37 -33
@@ -1,7 +1,8 @@
1
1
  import { KiteServiceException as __BaseException } from "../models/KiteServiceException";
2
- import { ChannelNotFoundException, EventNotFoundException, ForbiddenException, RateLimitExceededException, TargetNotFoundException, ValidationException, WidgetNotFoundException, } from "../models/models_0";
2
+ import { ChannelNotFoundException, EventNotFoundException, ForbiddenException, NotFoundException, RateLimitExceededException, TargetNotFoundException, ValidationException, WidgetNotFoundException, } from "../models/models_0";
3
+ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
3
4
  import { requestBuilder as rb } from "@smithy/core";
4
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, strictParseInt32 as __strictParseInt32, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, strictParseInt32 as __strictParseInt32, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
6
  export const se_CancelCalendarEventCommand = async (input, context) => {
6
7
  const b = rb(input, context);
7
8
  const headers = {};
@@ -30,8 +31,10 @@ export const se_CreateOrUpdateWidgetPreviewCommand = async (input, context) => {
30
31
  });
31
32
  let body;
32
33
  body = JSON.stringify(take(input, {
34
+ 'actions': _ => _json(_),
33
35
  'appearance': _ => _json(_),
34
36
  'name': [],
37
+ 'reassign': [],
35
38
  'routes': _ => se_WidgetRoutesList(_, context),
36
39
  'target': _ => _json(_),
37
40
  'temporaryWidgetId': [],
@@ -54,8 +57,10 @@ export const se_CreateWidgetCommand = async (input, context) => {
54
57
  });
55
58
  let body;
56
59
  body = JSON.stringify(take(input, {
60
+ 'actions': _ => _json(_),
57
61
  'appearance': _ => _json(_),
58
62
  'name': [],
63
+ 'reassign': [],
59
64
  'routes': _ => se_WidgetRoutesList(_, context),
60
65
  'target': _ => _json(_),
61
66
  'welcomeMessages': _ => _json(_),
@@ -111,6 +116,36 @@ export const se_GetConfigCommand = async (input, context) => {
111
116
  .b(body);
112
117
  return b.build();
113
118
  };
119
+ export const se_GetSmsNumberConfigurationCommand = async (input, context) => {
120
+ const b = rb(input, context);
121
+ const headers = {};
122
+ b.bp("/v2/kite/sms/configurations/{serviceNumber}");
123
+ b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
124
+ const query = map({
125
+ [_c]: [, input[_cI]],
126
+ });
127
+ let body;
128
+ b.m("GET")
129
+ .h(headers)
130
+ .q(query)
131
+ .b(body);
132
+ return b.build();
133
+ };
134
+ export const se_GetWhatsAppNumberConfigurationCommand = async (input, context) => {
135
+ const b = rb(input, context);
136
+ const headers = {};
137
+ b.bp("/v2/kite/whatsapp/configurations/{serviceNumber}");
138
+ b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
139
+ const query = map({
140
+ [_c]: [, input[_cI]],
141
+ });
142
+ let body;
143
+ b.m("GET")
144
+ .h(headers)
145
+ .q(query)
146
+ .b(body);
147
+ return b.build();
148
+ };
114
149
  export const se_GetWidgetCommand = async (input, context) => {
115
150
  const b = rb(input, context);
116
151
  const headers = {};
@@ -155,6 +190,77 @@ export const se_ListServicesCommand = async (input, context) => {
155
190
  .b(body);
156
191
  return b.build();
157
192
  };
193
+ export const se_ListSmsConfigurationsCommand = async (input, context) => {
194
+ const b = rb(input, context);
195
+ const headers = {};
196
+ b.bp("/v2/kite/sms/configurations");
197
+ const query = map({
198
+ [_c]: [, input[_cI]],
199
+ });
200
+ let body;
201
+ b.m("GET")
202
+ .h(headers)
203
+ .q(query)
204
+ .b(body);
205
+ return b.build();
206
+ };
207
+ export const se_ListSmsNumbersCommand = async (input, context) => {
208
+ const b = rb(input, context);
209
+ const headers = {};
210
+ b.bp("/v2/kite/sms/numbers");
211
+ const query = map({
212
+ [_c]: [, input[_cI]],
213
+ });
214
+ let body;
215
+ b.m("GET")
216
+ .h(headers)
217
+ .q(query)
218
+ .b(body);
219
+ return b.build();
220
+ };
221
+ export const se_ListWhatsAppConfigurationsCommand = async (input, context) => {
222
+ const b = rb(input, context);
223
+ const headers = {};
224
+ b.bp("/v2/kite/whatsapp/configurations");
225
+ const query = map({
226
+ [_c]: [, input[_cI]],
227
+ });
228
+ let body;
229
+ b.m("GET")
230
+ .h(headers)
231
+ .q(query)
232
+ .b(body);
233
+ return b.build();
234
+ };
235
+ export const se_ListWhatsAppNumbersCommand = async (input, context) => {
236
+ const b = rb(input, context);
237
+ const headers = {};
238
+ b.bp("/v2/kite/whatsapp/numbers");
239
+ const query = map({
240
+ [_c]: [, input[_cI]],
241
+ });
242
+ let body;
243
+ b.m("GET")
244
+ .h(headers)
245
+ .q(query)
246
+ .b(body);
247
+ return b.build();
248
+ };
249
+ export const se_ListWhatsAppTemplatesCommand = async (input, context) => {
250
+ const b = rb(input, context);
251
+ const headers = {};
252
+ b.bp("/v2/kite/whatsapp/templates/{serviceNumber}");
253
+ b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
254
+ const query = map({
255
+ [_c]: [, input[_cI]],
256
+ });
257
+ let body;
258
+ b.m("GET")
259
+ .h(headers)
260
+ .q(query)
261
+ .b(body);
262
+ return b.build();
263
+ };
158
264
  export const se_ListWidgetsCommand = async (input, context) => {
159
265
  const b = rb(input, context);
160
266
  const headers = {};
@@ -169,6 +275,53 @@ export const se_ListWidgetsCommand = async (input, context) => {
169
275
  .b(body);
170
276
  return b.build();
171
277
  };
278
+ export const se_PutSmsNumberConfigurationCommand = async (input, context) => {
279
+ const b = rb(input, context);
280
+ const headers = {
281
+ 'content-type': 'application/json',
282
+ };
283
+ b.bp("/v2/kite/sms/configurations/{serviceNumber}");
284
+ b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
285
+ const query = map({
286
+ [_c]: [, input[_cI]],
287
+ });
288
+ let body;
289
+ body = JSON.stringify(take(input, {
290
+ 'actions': _ => _json(_),
291
+ 'reassign': [],
292
+ 'routes': _ => _json(_),
293
+ 'serviceUri': [],
294
+ 'target': _ => _json(_),
295
+ }));
296
+ b.m("PUT")
297
+ .h(headers)
298
+ .q(query)
299
+ .b(body);
300
+ return b.build();
301
+ };
302
+ export const se_PutWhatsAppNumberConfigurationCommand = async (input, context) => {
303
+ const b = rb(input, context);
304
+ const headers = {
305
+ 'content-type': 'application/json',
306
+ };
307
+ b.bp("/v2/kite/whatsapp/configurations/{serviceNumber}");
308
+ b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
309
+ const query = map({
310
+ [_c]: [, input[_cI]],
311
+ });
312
+ let body;
313
+ body = JSON.stringify(take(input, {
314
+ 'actions': _ => _json(_),
315
+ 'routes': _ => _json(_),
316
+ 'serviceUri': [],
317
+ 'target': _ => _json(_),
318
+ }));
319
+ b.m("PUT")
320
+ .h(headers)
321
+ .q(query)
322
+ .b(body);
323
+ return b.build();
324
+ };
172
325
  export const se_RescheduleCalendarEventCommand = async (input, context) => {
173
326
  const b = rb(input, context);
174
327
  const headers = {
@@ -226,8 +379,10 @@ export const se_UpdateWidgetCommand = async (input, context) => {
226
379
  });
227
380
  let body;
228
381
  body = JSON.stringify(take(input, {
382
+ 'actions': _ => _json(_),
229
383
  'appearance': _ => _json(_),
230
384
  'name': [],
385
+ 'reassign': [],
231
386
  'routes': _ => se_WidgetRoutesList(_, context),
232
387
  'target': _ => _json(_),
233
388
  'welcomeMessages': _ => _json(_),
@@ -319,6 +474,34 @@ export const de_GetConfigCommand = async (output, context) => {
319
474
  Object.assign(contents, doc);
320
475
  return contents;
321
476
  };
477
+ export const de_GetSmsNumberConfigurationCommand = async (output, context) => {
478
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
479
+ return de_CommandError(output, context);
480
+ }
481
+ const contents = map({
482
+ $metadata: deserializeMetadata(output),
483
+ });
484
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
485
+ const doc = take(data, {
486
+ 'configuration': _json,
487
+ });
488
+ Object.assign(contents, doc);
489
+ return contents;
490
+ };
491
+ export const de_GetWhatsAppNumberConfigurationCommand = async (output, context) => {
492
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
493
+ return de_CommandError(output, context);
494
+ }
495
+ const contents = map({
496
+ $metadata: deserializeMetadata(output),
497
+ });
498
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
499
+ const doc = take(data, {
500
+ 'configuration': _json,
501
+ });
502
+ Object.assign(contents, doc);
503
+ return contents;
504
+ };
322
505
  export const de_GetWidgetCommand = async (output, context) => {
323
506
  if (output.statusCode !== 200 && output.statusCode >= 300) {
324
507
  return de_CommandError(output, context);
@@ -361,6 +544,76 @@ export const de_ListServicesCommand = async (output, context) => {
361
544
  Object.assign(contents, doc);
362
545
  return contents;
363
546
  };
547
+ export const de_ListSmsConfigurationsCommand = async (output, context) => {
548
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
549
+ return de_CommandError(output, context);
550
+ }
551
+ const contents = map({
552
+ $metadata: deserializeMetadata(output),
553
+ });
554
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
555
+ const doc = take(data, {
556
+ 'configurations': _json,
557
+ });
558
+ Object.assign(contents, doc);
559
+ return contents;
560
+ };
561
+ export const de_ListSmsNumbersCommand = async (output, context) => {
562
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
563
+ return de_CommandError(output, context);
564
+ }
565
+ const contents = map({
566
+ $metadata: deserializeMetadata(output),
567
+ });
568
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
569
+ const doc = take(data, {
570
+ 'numbers': _json,
571
+ });
572
+ Object.assign(contents, doc);
573
+ return contents;
574
+ };
575
+ export const de_ListWhatsAppConfigurationsCommand = async (output, context) => {
576
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
577
+ return de_CommandError(output, context);
578
+ }
579
+ const contents = map({
580
+ $metadata: deserializeMetadata(output),
581
+ });
582
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
583
+ const doc = take(data, {
584
+ 'configurations': _json,
585
+ });
586
+ Object.assign(contents, doc);
587
+ return contents;
588
+ };
589
+ export const de_ListWhatsAppNumbersCommand = async (output, context) => {
590
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
591
+ return de_CommandError(output, context);
592
+ }
593
+ const contents = map({
594
+ $metadata: deserializeMetadata(output),
595
+ });
596
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
597
+ const doc = take(data, {
598
+ 'numbers': _json,
599
+ });
600
+ Object.assign(contents, doc);
601
+ return contents;
602
+ };
603
+ export const de_ListWhatsAppTemplatesCommand = async (output, context) => {
604
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
605
+ return de_CommandError(output, context);
606
+ }
607
+ const contents = map({
608
+ $metadata: deserializeMetadata(output),
609
+ });
610
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
611
+ const doc = take(data, {
612
+ 'templates': _json,
613
+ });
614
+ Object.assign(contents, doc);
615
+ return contents;
616
+ };
364
617
  export const de_ListWidgetsCommand = async (output, context) => {
365
618
  if (output.statusCode !== 200 && output.statusCode >= 300) {
366
619
  return de_CommandError(output, context);
@@ -375,6 +628,34 @@ export const de_ListWidgetsCommand = async (output, context) => {
375
628
  Object.assign(contents, doc);
376
629
  return contents;
377
630
  };
631
+ export const de_PutSmsNumberConfigurationCommand = async (output, context) => {
632
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
633
+ return de_CommandError(output, context);
634
+ }
635
+ const contents = map({
636
+ $metadata: deserializeMetadata(output),
637
+ });
638
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
639
+ const doc = take(data, {
640
+ 'configuration': _json,
641
+ });
642
+ Object.assign(contents, doc);
643
+ return contents;
644
+ };
645
+ export const de_PutWhatsAppNumberConfigurationCommand = async (output, context) => {
646
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
647
+ return de_CommandError(output, context);
648
+ }
649
+ const contents = map({
650
+ $metadata: deserializeMetadata(output),
651
+ });
652
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
653
+ const doc = take(data, {
654
+ 'configuration': _json,
655
+ });
656
+ Object.assign(contents, doc);
657
+ return contents;
658
+ };
378
659
  export const de_RescheduleCalendarEventCommand = async (output, context) => {
379
660
  if (output.statusCode !== 200 && output.statusCode >= 300) {
380
661
  return de_CommandError(output, context);
@@ -432,6 +713,9 @@ const de_CommandError = async (output, context) => {
432
713
  case "ForbiddenException":
433
714
  case "smithy.framework#ForbiddenException":
434
715
  throw await de_ForbiddenExceptionRes(parsedOutput, context);
716
+ case "NotFoundException":
717
+ case "smithy.framework#NotFoundException":
718
+ throw await de_NotFoundExceptionRes(parsedOutput, context);
435
719
  case "RateLimitExceededException":
436
720
  case "smithy.framework#RateLimitExceededException":
437
721
  throw await de_RateLimitExceededExceptionRes(parsedOutput, context);
@@ -470,6 +754,19 @@ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
470
754
  });
471
755
  return __decorateServiceException(exception, parsedOutput.body);
472
756
  };
757
+ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
758
+ const contents = map({});
759
+ const data = parsedOutput.body;
760
+ const doc = take(data, {
761
+ 'message': __expectString,
762
+ });
763
+ Object.assign(contents, doc);
764
+ const exception = new NotFoundException({
765
+ $metadata: deserializeMetadata(parsedOutput),
766
+ ...contents
767
+ });
768
+ return __decorateServiceException(exception, parsedOutput.body);
769
+ };
473
770
  const de_RateLimitExceededExceptionRes = async (parsedOutput, context) => {
474
771
  const contents = map({
475
772
  [_rL]: [, parsedOutput.headers[_xrl]],
@@ -560,11 +857,13 @@ const se_WidgetRoutesList = (input, context) => {
560
857
  };
561
858
  const de_Widget = (output, context) => {
562
859
  return take(output, {
860
+ 'actions': _json,
563
861
  'appearance': _json,
564
862
  'company': __expectString,
565
863
  'createdAt': __expectString,
566
864
  'id': __expectString,
567
865
  'name': __expectString,
866
+ 'reassign': __expectBoolean,
568
867
  'routes': (_) => de_WidgetRoutesList(_, context),
569
868
  'target': (_) => _json(__expectUnion(_)),
570
869
  'updatedAt': __expectString,
@@ -590,12 +889,6 @@ const deserializeMetadata = (output) => ({
590
889
  cfId: output.headers["x-amz-cf-id"],
591
890
  });
592
891
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
593
- const isSerializableHeaderValue = (value) => value !== undefined &&
594
- value !== null &&
595
- value !== "" &&
596
- (!Object.getOwnPropertyNames(value).includes("length") ||
597
- value.length != 0) &&
598
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
599
892
  const _c = "company";
600
893
  const _cI = "companyId";
601
894
  const _d = "duration";
@@ -614,43 +907,3 @@ const _tZ = "timeZone";
614
907
  const _xrl = "x-ratelimit-limit";
615
908
  const _xrr = "x-ratelimit-remaining";
616
909
  const _xrr_ = "x-ratelimit-reset";
617
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
618
- if (encoded.length) {
619
- return JSON.parse(encoded);
620
- }
621
- return {};
622
- });
623
- const parseErrorBody = async (errorBody, context) => {
624
- const value = await parseBody(errorBody, context);
625
- value.message = value.message ?? value.Message;
626
- return value;
627
- };
628
- const loadRestJsonErrorCode = (output, data) => {
629
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
630
- const sanitizeErrorCode = (rawValue) => {
631
- let cleanValue = rawValue;
632
- if (typeof cleanValue === "number") {
633
- cleanValue = cleanValue.toString();
634
- }
635
- if (cleanValue.indexOf(",") >= 0) {
636
- cleanValue = cleanValue.split(",")[0];
637
- }
638
- if (cleanValue.indexOf(":") >= 0) {
639
- cleanValue = cleanValue.split(":")[0];
640
- }
641
- if (cleanValue.indexOf("#") >= 0) {
642
- cleanValue = cleanValue.split("#")[1];
643
- }
644
- return cleanValue;
645
- };
646
- const headerKey = findKey(output.headers, "x-amzn-errortype");
647
- if (headerKey !== undefined) {
648
- return sanitizeErrorCode(output.headers[headerKey]);
649
- }
650
- if (data.code !== undefined) {
651
- return sanitizeErrorCode(data.code);
652
- }
653
- if (data["__type"] !== undefined) {
654
- return sanitizeErrorCode(data["__type"]);
655
- }
656
- };
@@ -1,6 +1,6 @@
1
1
  import packageInfo from "../package.json";
2
2
  import { Sha256 } from "@aws-crypto/sha256-browser";
3
- import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
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 ?? defaultUserAgent({ serviceId: packageInfo.name, clientVersion: packageInfo.version }),
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),
@@ -1,5 +1,5 @@
1
1
  import packageInfo from "../package.json";
2
- import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
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 ?? defaultUserAgent({ serviceId: packageInfo.name, clientVersion: packageInfo.version }),
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
  };
@@ -5,10 +5,19 @@ import { CreateWidgetCommandInput, CreateWidgetCommandOutput } from "./commands/
5
5
  import { DeleteWidgetCommandInput, DeleteWidgetCommandOutput } from "./commands/DeleteWidgetCommand";
6
6
  import { GetCalendarSlotsCommandInput, GetCalendarSlotsCommandOutput } from "./commands/GetCalendarSlotsCommand";
7
7
  import { GetConfigCommandInput, GetConfigCommandOutput } from "./commands/GetConfigCommand";
8
+ import { GetSmsNumberConfigurationCommandInput, GetSmsNumberConfigurationCommandOutput } from "./commands/GetSmsNumberConfigurationCommand";
9
+ import { GetWhatsAppNumberConfigurationCommandInput, GetWhatsAppNumberConfigurationCommandOutput } from "./commands/GetWhatsAppNumberConfigurationCommand";
8
10
  import { GetWidgetCommandInput, GetWidgetCommandOutput } from "./commands/GetWidgetCommand";
9
11
  import { ListAgentsCommandInput, ListAgentsCommandOutput } from "./commands/ListAgentsCommand";
10
12
  import { ListServicesCommandInput, ListServicesCommandOutput } from "./commands/ListServicesCommand";
13
+ import { ListSmsConfigurationsCommandInput, ListSmsConfigurationsCommandOutput } from "./commands/ListSmsConfigurationsCommand";
14
+ import { ListSmsNumbersCommandInput, ListSmsNumbersCommandOutput } from "./commands/ListSmsNumbersCommand";
15
+ import { ListWhatsAppConfigurationsCommandInput, ListWhatsAppConfigurationsCommandOutput } from "./commands/ListWhatsAppConfigurationsCommand";
16
+ import { ListWhatsAppNumbersCommandInput, ListWhatsAppNumbersCommandOutput } from "./commands/ListWhatsAppNumbersCommand";
17
+ import { ListWhatsAppTemplatesCommandInput, ListWhatsAppTemplatesCommandOutput } from "./commands/ListWhatsAppTemplatesCommand";
11
18
  import { ListWidgetsCommandInput, ListWidgetsCommandOutput } from "./commands/ListWidgetsCommand";
19
+ import { PutSmsNumberConfigurationCommandInput, PutSmsNumberConfigurationCommandOutput } from "./commands/PutSmsNumberConfigurationCommand";
20
+ import { PutWhatsAppNumberConfigurationCommandInput, PutWhatsAppNumberConfigurationCommandOutput } from "./commands/PutWhatsAppNumberConfigurationCommand";
12
21
  import { RescheduleCalendarEventCommandInput, RescheduleCalendarEventCommandOutput } from "./commands/RescheduleCalendarEventCommand";
13
22
  import { ScheduleCalendarEventCommandInput, ScheduleCalendarEventCommandOutput } from "./commands/ScheduleCalendarEventCommand";
14
23
  import { UpdateWidgetCommandInput, UpdateWidgetCommandOutput } from "./commands/UpdateWidgetCommand";
@@ -50,6 +59,18 @@ export interface Kite {
50
59
  getConfig(args: GetConfigCommandInput, options?: __HttpHandlerOptions): Promise<GetConfigCommandOutput>;
51
60
  getConfig(args: GetConfigCommandInput, cb: (err: any, data?: GetConfigCommandOutput) => void): void;
52
61
  getConfig(args: GetConfigCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetConfigCommandOutput) => void): void;
62
+ /**
63
+ * @see {@link GetSmsNumberConfigurationCommand}
64
+ */
65
+ getSmsNumberConfiguration(args: GetSmsNumberConfigurationCommandInput, options?: __HttpHandlerOptions): Promise<GetSmsNumberConfigurationCommandOutput>;
66
+ getSmsNumberConfiguration(args: GetSmsNumberConfigurationCommandInput, cb: (err: any, data?: GetSmsNumberConfigurationCommandOutput) => void): void;
67
+ getSmsNumberConfiguration(args: GetSmsNumberConfigurationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetSmsNumberConfigurationCommandOutput) => void): void;
68
+ /**
69
+ * @see {@link GetWhatsAppNumberConfigurationCommand}
70
+ */
71
+ getWhatsAppNumberConfiguration(args: GetWhatsAppNumberConfigurationCommandInput, options?: __HttpHandlerOptions): Promise<GetWhatsAppNumberConfigurationCommandOutput>;
72
+ getWhatsAppNumberConfiguration(args: GetWhatsAppNumberConfigurationCommandInput, cb: (err: any, data?: GetWhatsAppNumberConfigurationCommandOutput) => void): void;
73
+ getWhatsAppNumberConfiguration(args: GetWhatsAppNumberConfigurationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetWhatsAppNumberConfigurationCommandOutput) => void): void;
53
74
  /**
54
75
  * @see {@link GetWidgetCommand}
55
76
  */
@@ -69,6 +90,40 @@ export interface Kite {
69
90
  listServices(args: ListServicesCommandInput, options?: __HttpHandlerOptions): Promise<ListServicesCommandOutput>;
70
91
  listServices(args: ListServicesCommandInput, cb: (err: any, data?: ListServicesCommandOutput) => void): void;
71
92
  listServices(args: ListServicesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListServicesCommandOutput) => void): void;
93
+ /**
94
+ * @see {@link ListSmsConfigurationsCommand}
95
+ */
96
+ listSmsConfigurations(): Promise<ListSmsConfigurationsCommandOutput>;
97
+ listSmsConfigurations(args: ListSmsConfigurationsCommandInput, options?: __HttpHandlerOptions): Promise<ListSmsConfigurationsCommandOutput>;
98
+ listSmsConfigurations(args: ListSmsConfigurationsCommandInput, cb: (err: any, data?: ListSmsConfigurationsCommandOutput) => void): void;
99
+ listSmsConfigurations(args: ListSmsConfigurationsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListSmsConfigurationsCommandOutput) => void): void;
100
+ /**
101
+ * @see {@link ListSmsNumbersCommand}
102
+ */
103
+ listSmsNumbers(): Promise<ListSmsNumbersCommandOutput>;
104
+ listSmsNumbers(args: ListSmsNumbersCommandInput, options?: __HttpHandlerOptions): Promise<ListSmsNumbersCommandOutput>;
105
+ listSmsNumbers(args: ListSmsNumbersCommandInput, cb: (err: any, data?: ListSmsNumbersCommandOutput) => void): void;
106
+ listSmsNumbers(args: ListSmsNumbersCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListSmsNumbersCommandOutput) => void): void;
107
+ /**
108
+ * @see {@link ListWhatsAppConfigurationsCommand}
109
+ */
110
+ listWhatsAppConfigurations(): Promise<ListWhatsAppConfigurationsCommandOutput>;
111
+ listWhatsAppConfigurations(args: ListWhatsAppConfigurationsCommandInput, options?: __HttpHandlerOptions): Promise<ListWhatsAppConfigurationsCommandOutput>;
112
+ listWhatsAppConfigurations(args: ListWhatsAppConfigurationsCommandInput, cb: (err: any, data?: ListWhatsAppConfigurationsCommandOutput) => void): void;
113
+ listWhatsAppConfigurations(args: ListWhatsAppConfigurationsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListWhatsAppConfigurationsCommandOutput) => void): void;
114
+ /**
115
+ * @see {@link ListWhatsAppNumbersCommand}
116
+ */
117
+ listWhatsAppNumbers(): Promise<ListWhatsAppNumbersCommandOutput>;
118
+ listWhatsAppNumbers(args: ListWhatsAppNumbersCommandInput, options?: __HttpHandlerOptions): Promise<ListWhatsAppNumbersCommandOutput>;
119
+ listWhatsAppNumbers(args: ListWhatsAppNumbersCommandInput, cb: (err: any, data?: ListWhatsAppNumbersCommandOutput) => void): void;
120
+ listWhatsAppNumbers(args: ListWhatsAppNumbersCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListWhatsAppNumbersCommandOutput) => void): void;
121
+ /**
122
+ * @see {@link ListWhatsAppTemplatesCommand}
123
+ */
124
+ listWhatsAppTemplates(args: ListWhatsAppTemplatesCommandInput, options?: __HttpHandlerOptions): Promise<ListWhatsAppTemplatesCommandOutput>;
125
+ listWhatsAppTemplates(args: ListWhatsAppTemplatesCommandInput, cb: (err: any, data?: ListWhatsAppTemplatesCommandOutput) => void): void;
126
+ listWhatsAppTemplates(args: ListWhatsAppTemplatesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListWhatsAppTemplatesCommandOutput) => void): void;
72
127
  /**
73
128
  * @see {@link ListWidgetsCommand}
74
129
  */
@@ -76,6 +131,18 @@ export interface Kite {
76
131
  listWidgets(args: ListWidgetsCommandInput, options?: __HttpHandlerOptions): Promise<ListWidgetsCommandOutput>;
77
132
  listWidgets(args: ListWidgetsCommandInput, cb: (err: any, data?: ListWidgetsCommandOutput) => void): void;
78
133
  listWidgets(args: ListWidgetsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListWidgetsCommandOutput) => void): void;
134
+ /**
135
+ * @see {@link PutSmsNumberConfigurationCommand}
136
+ */
137
+ putSmsNumberConfiguration(args: PutSmsNumberConfigurationCommandInput, options?: __HttpHandlerOptions): Promise<PutSmsNumberConfigurationCommandOutput>;
138
+ putSmsNumberConfiguration(args: PutSmsNumberConfigurationCommandInput, cb: (err: any, data?: PutSmsNumberConfigurationCommandOutput) => void): void;
139
+ putSmsNumberConfiguration(args: PutSmsNumberConfigurationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutSmsNumberConfigurationCommandOutput) => void): void;
140
+ /**
141
+ * @see {@link PutWhatsAppNumberConfigurationCommand}
142
+ */
143
+ putWhatsAppNumberConfiguration(args: PutWhatsAppNumberConfigurationCommandInput, options?: __HttpHandlerOptions): Promise<PutWhatsAppNumberConfigurationCommandOutput>;
144
+ putWhatsAppNumberConfiguration(args: PutWhatsAppNumberConfigurationCommandInput, cb: (err: any, data?: PutWhatsAppNumberConfigurationCommandOutput) => void): void;
145
+ putWhatsAppNumberConfiguration(args: PutWhatsAppNumberConfigurationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutWhatsAppNumberConfigurationCommandOutput) => void): void;
79
146
  /**
80
147
  * @see {@link RescheduleCalendarEventCommand}
81
148
  */
@@ -4,10 +4,19 @@ import { CreateWidgetCommandInput, CreateWidgetCommandOutput } from "./commands/
4
4
  import { DeleteWidgetCommandInput, DeleteWidgetCommandOutput } from "./commands/DeleteWidgetCommand";
5
5
  import { GetCalendarSlotsCommandInput, GetCalendarSlotsCommandOutput } from "./commands/GetCalendarSlotsCommand";
6
6
  import { GetConfigCommandInput, GetConfigCommandOutput } from "./commands/GetConfigCommand";
7
+ import { GetSmsNumberConfigurationCommandInput, GetSmsNumberConfigurationCommandOutput } from "./commands/GetSmsNumberConfigurationCommand";
8
+ import { GetWhatsAppNumberConfigurationCommandInput, GetWhatsAppNumberConfigurationCommandOutput } from "./commands/GetWhatsAppNumberConfigurationCommand";
7
9
  import { GetWidgetCommandInput, GetWidgetCommandOutput } from "./commands/GetWidgetCommand";
8
10
  import { ListAgentsCommandInput, ListAgentsCommandOutput } from "./commands/ListAgentsCommand";
9
11
  import { ListServicesCommandInput, ListServicesCommandOutput } from "./commands/ListServicesCommand";
12
+ import { ListSmsConfigurationsCommandInput, ListSmsConfigurationsCommandOutput } from "./commands/ListSmsConfigurationsCommand";
13
+ import { ListSmsNumbersCommandInput, ListSmsNumbersCommandOutput } from "./commands/ListSmsNumbersCommand";
14
+ import { ListWhatsAppConfigurationsCommandInput, ListWhatsAppConfigurationsCommandOutput } from "./commands/ListWhatsAppConfigurationsCommand";
15
+ import { ListWhatsAppNumbersCommandInput, ListWhatsAppNumbersCommandOutput } from "./commands/ListWhatsAppNumbersCommand";
16
+ import { ListWhatsAppTemplatesCommandInput, ListWhatsAppTemplatesCommandOutput } from "./commands/ListWhatsAppTemplatesCommand";
10
17
  import { ListWidgetsCommandInput, ListWidgetsCommandOutput } from "./commands/ListWidgetsCommand";
18
+ import { PutSmsNumberConfigurationCommandInput, PutSmsNumberConfigurationCommandOutput } from "./commands/PutSmsNumberConfigurationCommand";
19
+ import { PutWhatsAppNumberConfigurationCommandInput, PutWhatsAppNumberConfigurationCommandOutput } from "./commands/PutWhatsAppNumberConfigurationCommand";
11
20
  import { RescheduleCalendarEventCommandInput, RescheduleCalendarEventCommandOutput } from "./commands/RescheduleCalendarEventCommand";
12
21
  import { ScheduleCalendarEventCommandInput, ScheduleCalendarEventCommandOutput } from "./commands/ScheduleCalendarEventCommand";
13
22
  import { UpdateWidgetCommandInput, UpdateWidgetCommandOutput } from "./commands/UpdateWidgetCommand";
@@ -22,11 +31,11 @@ export { __Client };
22
31
  /**
23
32
  * @public
24
33
  */
25
- export type ServiceInputTypes = CancelCalendarEventCommandInput | CreateOrUpdateWidgetPreviewCommandInput | CreateWidgetCommandInput | DeleteWidgetCommandInput | GetCalendarSlotsCommandInput | GetConfigCommandInput | GetWidgetCommandInput | ListAgentsCommandInput | ListServicesCommandInput | ListWidgetsCommandInput | RescheduleCalendarEventCommandInput | ScheduleCalendarEventCommandInput | UpdateWidgetCommandInput;
34
+ export type ServiceInputTypes = CancelCalendarEventCommandInput | CreateOrUpdateWidgetPreviewCommandInput | CreateWidgetCommandInput | DeleteWidgetCommandInput | GetCalendarSlotsCommandInput | GetConfigCommandInput | GetSmsNumberConfigurationCommandInput | GetWhatsAppNumberConfigurationCommandInput | GetWidgetCommandInput | ListAgentsCommandInput | ListServicesCommandInput | ListSmsConfigurationsCommandInput | ListSmsNumbersCommandInput | ListWhatsAppConfigurationsCommandInput | ListWhatsAppNumbersCommandInput | ListWhatsAppTemplatesCommandInput | ListWidgetsCommandInput | PutSmsNumberConfigurationCommandInput | PutWhatsAppNumberConfigurationCommandInput | RescheduleCalendarEventCommandInput | ScheduleCalendarEventCommandInput | UpdateWidgetCommandInput;
26
35
  /**
27
36
  * @public
28
37
  */
29
- export type ServiceOutputTypes = CancelCalendarEventCommandOutput | CreateOrUpdateWidgetPreviewCommandOutput | CreateWidgetCommandOutput | DeleteWidgetCommandOutput | GetCalendarSlotsCommandOutput | GetConfigCommandOutput | GetWidgetCommandOutput | ListAgentsCommandOutput | ListServicesCommandOutput | ListWidgetsCommandOutput | RescheduleCalendarEventCommandOutput | ScheduleCalendarEventCommandOutput | UpdateWidgetCommandOutput;
38
+ export type ServiceOutputTypes = CancelCalendarEventCommandOutput | CreateOrUpdateWidgetPreviewCommandOutput | CreateWidgetCommandOutput | DeleteWidgetCommandOutput | GetCalendarSlotsCommandOutput | GetConfigCommandOutput | GetSmsNumberConfigurationCommandOutput | GetWhatsAppNumberConfigurationCommandOutput | GetWidgetCommandOutput | ListAgentsCommandOutput | ListServicesCommandOutput | ListSmsConfigurationsCommandOutput | ListSmsNumbersCommandOutput | ListWhatsAppConfigurationsCommandOutput | ListWhatsAppNumbersCommandOutput | ListWhatsAppTemplatesCommandOutput | ListWidgetsCommandOutput | PutSmsNumberConfigurationCommandOutput | PutWhatsAppNumberConfigurationCommandOutput | RescheduleCalendarEventCommandOutput | ScheduleCalendarEventCommandOutput | UpdateWidgetCommandOutput;
30
39
  /**
31
40
  * @public
32
41
  */