@wildix/xbees-kite-client 1.4.1 → 3.1.1

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 (128) hide show
  1. package/dist-cjs/Kite.js +3 -3
  2. package/dist-cjs/KiteClient.js +34 -28
  3. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
  4. package/dist-cjs/auth/httpAuthSchemeProvider.js +40 -0
  5. package/dist-cjs/commands/CancelCalendarEventCommand.js +10 -11
  6. package/dist-cjs/commands/CreateOrUpdateWidgetPreviewCommand.js +10 -11
  7. package/dist-cjs/commands/CreateWidgetCommand.js +10 -11
  8. package/dist-cjs/commands/DeleteWidgetCommand.js +10 -11
  9. package/dist-cjs/commands/GetCalendarSlotsCommand.js +10 -11
  10. package/dist-cjs/commands/GetConfigCommand.js +10 -11
  11. package/dist-cjs/commands/GetSmsNumberConfigurationCommand.js +10 -11
  12. package/dist-cjs/commands/GetWhatsAppNumberConfigurationCommand.js +10 -11
  13. package/dist-cjs/commands/GetWidgetCommand.js +10 -11
  14. package/dist-cjs/commands/ListAgentsCommand.js +10 -11
  15. package/dist-cjs/commands/ListServicesCommand.js +10 -11
  16. package/dist-cjs/commands/ListSmsConfigurationsCommand.js +10 -11
  17. package/dist-cjs/commands/ListSmsNumbersCommand.js +10 -11
  18. package/dist-cjs/commands/ListWhatsAppConfigurationsCommand.js +10 -11
  19. package/dist-cjs/commands/ListWhatsAppNumbersCommand.js +10 -11
  20. package/dist-cjs/commands/ListWhatsAppTemplatesCommand.js +10 -11
  21. package/dist-cjs/commands/ListWidgetsCommand.js +10 -11
  22. package/dist-cjs/commands/PutSmsNumberConfigurationCommand.js +10 -11
  23. package/dist-cjs/commands/PutWhatsAppNumberConfigurationCommand.js +10 -11
  24. package/dist-cjs/commands/RescheduleCalendarEventCommand.js +10 -11
  25. package/dist-cjs/commands/ScheduleCalendarEventCommand.js +10 -11
  26. package/dist-cjs/commands/UpdateWidgetCommand.js +10 -11
  27. package/dist-cjs/endpoint/EndpointParameters.js +16 -0
  28. package/dist-cjs/endpoint/bdd.js +28 -0
  29. package/dist-cjs/endpoint/endpointResolver.js +16 -0
  30. package/dist-cjs/index.js +7 -4
  31. package/dist-cjs/models/KiteSyntheticServiceException.js +12 -0
  32. package/dist-cjs/models/enums.js +80 -0
  33. package/dist-cjs/models/errors.js +116 -0
  34. package/dist-cjs/models/models_0.js +0 -303
  35. package/dist-cjs/runtimeConfig.browser.js +11 -11
  36. package/dist-cjs/runtimeConfig.js +22 -18
  37. package/dist-cjs/runtimeConfig.shared.js +30 -10
  38. package/dist-cjs/runtimeExtensions.js +6 -5
  39. package/dist-cjs/schemas/schemas_0.js +1160 -0
  40. package/dist-es/Kite.js +4 -4
  41. package/dist-es/KiteClient.js +30 -24
  42. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  43. package/dist-es/auth/httpAuthSchemeProvider.js +34 -0
  44. package/dist-es/commands/CancelCalendarEventCommand.js +9 -10
  45. package/dist-es/commands/CreateOrUpdateWidgetPreviewCommand.js +9 -10
  46. package/dist-es/commands/CreateWidgetCommand.js +9 -10
  47. package/dist-es/commands/DeleteWidgetCommand.js +9 -10
  48. package/dist-es/commands/GetCalendarSlotsCommand.js +9 -10
  49. package/dist-es/commands/GetConfigCommand.js +9 -10
  50. package/dist-es/commands/GetSmsNumberConfigurationCommand.js +9 -10
  51. package/dist-es/commands/GetWhatsAppNumberConfigurationCommand.js +9 -10
  52. package/dist-es/commands/GetWidgetCommand.js +9 -10
  53. package/dist-es/commands/ListAgentsCommand.js +9 -10
  54. package/dist-es/commands/ListServicesCommand.js +9 -10
  55. package/dist-es/commands/ListSmsConfigurationsCommand.js +9 -10
  56. package/dist-es/commands/ListSmsNumbersCommand.js +9 -10
  57. package/dist-es/commands/ListWhatsAppConfigurationsCommand.js +9 -10
  58. package/dist-es/commands/ListWhatsAppNumbersCommand.js +9 -10
  59. package/dist-es/commands/ListWhatsAppTemplatesCommand.js +9 -10
  60. package/dist-es/commands/ListWidgetsCommand.js +9 -10
  61. package/dist-es/commands/PutSmsNumberConfigurationCommand.js +9 -10
  62. package/dist-es/commands/PutWhatsAppNumberConfigurationCommand.js +9 -10
  63. package/dist-es/commands/RescheduleCalendarEventCommand.js +9 -10
  64. package/dist-es/commands/ScheduleCalendarEventCommand.js +9 -10
  65. package/dist-es/commands/UpdateWidgetCommand.js +9 -10
  66. package/dist-es/endpoint/EndpointParameters.js +12 -0
  67. package/dist-es/endpoint/bdd.js +25 -0
  68. package/dist-es/endpoint/endpointResolver.js +12 -0
  69. package/dist-es/index.js +5 -2
  70. package/dist-es/models/KiteSyntheticServiceException.js +8 -0
  71. package/dist-es/models/enums.js +77 -0
  72. package/dist-es/models/errors.js +105 -0
  73. package/dist-es/models/models_0.js +1 -294
  74. package/dist-es/runtimeConfig.browser.js +7 -7
  75. package/dist-es/runtimeConfig.js +17 -13
  76. package/dist-es/runtimeConfig.shared.js +24 -4
  77. package/dist-es/runtimeExtensions.js +6 -5
  78. package/dist-es/schemas/schemas_0.js +1155 -0
  79. package/dist-types/Kite.d.ts +23 -23
  80. package/dist-types/KiteClient.d.ts +52 -34
  81. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  82. package/dist-types/auth/httpAuthSchemeProvider.d.ts +81 -0
  83. package/dist-types/commands/CancelCalendarEventCommand.d.ts +12 -8
  84. package/dist-types/commands/CreateOrUpdateWidgetPreviewCommand.d.ts +12 -8
  85. package/dist-types/commands/CreateWidgetCommand.d.ts +12 -8
  86. package/dist-types/commands/DeleteWidgetCommand.d.ts +12 -8
  87. package/dist-types/commands/GetCalendarSlotsCommand.d.ts +12 -8
  88. package/dist-types/commands/GetConfigCommand.d.ts +12 -8
  89. package/dist-types/commands/GetSmsNumberConfigurationCommand.d.ts +12 -8
  90. package/dist-types/commands/GetWhatsAppNumberConfigurationCommand.d.ts +12 -8
  91. package/dist-types/commands/GetWidgetCommand.d.ts +12 -8
  92. package/dist-types/commands/ListAgentsCommand.d.ts +12 -8
  93. package/dist-types/commands/ListServicesCommand.d.ts +12 -8
  94. package/dist-types/commands/ListSmsConfigurationsCommand.d.ts +12 -8
  95. package/dist-types/commands/ListSmsNumbersCommand.d.ts +12 -8
  96. package/dist-types/commands/ListWhatsAppConfigurationsCommand.d.ts +12 -8
  97. package/dist-types/commands/ListWhatsAppNumbersCommand.d.ts +12 -8
  98. package/dist-types/commands/ListWhatsAppTemplatesCommand.d.ts +12 -8
  99. package/dist-types/commands/ListWidgetsCommand.d.ts +12 -8
  100. package/dist-types/commands/PutSmsNumberConfigurationCommand.d.ts +12 -8
  101. package/dist-types/commands/PutWhatsAppNumberConfigurationCommand.d.ts +12 -8
  102. package/dist-types/commands/RescheduleCalendarEventCommand.d.ts +12 -8
  103. package/dist-types/commands/ScheduleCalendarEventCommand.d.ts +12 -8
  104. package/dist-types/commands/UpdateWidgetCommand.d.ts +12 -8
  105. package/dist-types/endpoint/EndpointParameters.d.ts +41 -0
  106. package/dist-types/endpoint/bdd.d.ts +2 -0
  107. package/dist-types/endpoint/endpointResolver.d.ts +8 -0
  108. package/dist-types/extensionConfiguration.d.ts +4 -3
  109. package/dist-types/index.d.ts +6 -2
  110. package/dist-types/models/{KiteServiceException.d.ts → KiteSyntheticServiceException.d.ts} +2 -2
  111. package/dist-types/models/enums.d.ts +197 -0
  112. package/dist-types/models/errors.d.ts +110 -0
  113. package/dist-types/models/models_0.d.ts +105 -381
  114. package/dist-types/runtimeConfig.browser.d.ts +35 -16
  115. package/dist-types/runtimeConfig.d.ts +34 -15
  116. package/dist-types/runtimeConfig.native.d.ts +36 -17
  117. package/dist-types/runtimeConfig.shared.d.ts +20 -3
  118. package/dist-types/runtimeExtensions.d.ts +1 -1
  119. package/dist-types/schemas/schemas_0.d.ts +153 -0
  120. package/package.json +14 -40
  121. package/dist-cjs/models/KiteServiceException.js +0 -12
  122. package/dist-cjs/models/index.js +0 -4
  123. package/dist-cjs/protocols/Aws_restJson1.js +0 -963
  124. package/dist-es/models/KiteServiceException.js +0 -8
  125. package/dist-es/models/index.js +0 -1
  126. package/dist-es/protocols/Aws_restJson1.js +0 -916
  127. package/dist-types/models/index.d.ts +0 -1
  128. package/dist-types/protocols/Aws_restJson1.d.ts +0 -200
@@ -1,916 +0,0 @@
1
- import { KiteServiceException as __BaseException } from "../models/KiteServiceException";
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";
4
- import { requestBuilder as rb } from "@smithy/core";
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";
6
- export const se_CancelCalendarEventCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = {};
9
- b.bp("/v2/kite/calendar/channels/{channelId}/events/{eventOwner}/{eventId}");
10
- b.p('channelId', () => input.channelId, '{channelId}', false);
11
- b.p('eventId', () => input.eventId, '{eventId}', false);
12
- b.p('eventOwner', () => input.eventOwner, '{eventOwner}', false);
13
- const query = map({
14
- [_r]: [, input[_r]],
15
- });
16
- let body;
17
- b.m("DELETE")
18
- .h(headers)
19
- .q(query)
20
- .b(body);
21
- return b.build();
22
- };
23
- export const se_CreateOrUpdateWidgetPreviewCommand = async (input, context) => {
24
- const b = rb(input, context);
25
- const headers = {
26
- 'content-type': 'application/json',
27
- };
28
- b.bp("/v2/kite/widgets/preview");
29
- const query = map({
30
- [_c]: [, input[_cI]],
31
- });
32
- let body;
33
- body = JSON.stringify(take(input, {
34
- 'actions': _ => _json(_),
35
- 'anonymousSessionsEnabled': [],
36
- 'anonymousSessionsOnly': [],
37
- 'anonymousSessionsRandomNameEnabled': [],
38
- 'appearance': _ => _json(_),
39
- 'name': [],
40
- 'routes': _ => se_WidgetRoutesList(_, context),
41
- 'target': _ => _json(_),
42
- 'temporaryWidgetId': [],
43
- 'welcomeMessages': _ => _json(_),
44
- }));
45
- b.m("POST")
46
- .h(headers)
47
- .q(query)
48
- .b(body);
49
- return b.build();
50
- };
51
- export const se_CreateWidgetCommand = async (input, context) => {
52
- const b = rb(input, context);
53
- const headers = {
54
- 'content-type': 'application/json',
55
- };
56
- b.bp("/v2/kite/widgets");
57
- const query = map({
58
- [_c]: [, input[_cI]],
59
- });
60
- let body;
61
- body = JSON.stringify(take(input, {
62
- 'actions': _ => _json(_),
63
- 'anonymousSessionsEnabled': [],
64
- 'anonymousSessionsOnly': [],
65
- 'anonymousSessionsRandomNameEnabled': [],
66
- 'appearance': _ => _json(_),
67
- 'name': [],
68
- 'routes': _ => se_WidgetRoutesList(_, context),
69
- 'target': _ => _json(_),
70
- 'welcomeMessages': _ => _json(_),
71
- }));
72
- b.m("POST")
73
- .h(headers)
74
- .q(query)
75
- .b(body);
76
- return b.build();
77
- };
78
- export const se_DeleteWidgetCommand = async (input, context) => {
79
- const b = rb(input, context);
80
- const headers = {};
81
- b.bp("/v2/kite/widgets/{widgetId}");
82
- b.p('widgetId', () => input.widgetId, '{widgetId}', false);
83
- let body;
84
- b.m("DELETE")
85
- .h(headers)
86
- .b(body);
87
- return b.build();
88
- };
89
- export const se_GetCalendarSlotsCommand = async (input, context) => {
90
- const b = rb(input, context);
91
- const headers = {};
92
- b.bp("/v2/kite/calendar/widgets/{targetId}/slots");
93
- b.p('targetId', () => input.targetId, '{targetId}', false);
94
- const query = map({
95
- [_f]: [, __expectNonNull(input[_f], `from`)],
96
- [_t]: [, __expectNonNull(input[_t], `till`)],
97
- [_d]: [, input[_d]],
98
- [_tZ]: [, __expectNonNull(input[_tZ], `timeZone`)],
99
- [_e]: [, input[_e]],
100
- });
101
- let body;
102
- b.m("GET")
103
- .h(headers)
104
- .q(query)
105
- .b(body);
106
- return b.build();
107
- };
108
- export const se_GetConfigCommand = async (input, context) => {
109
- const b = rb(input, context);
110
- const headers = {};
111
- b.bp("/v2/kite/config/{targetId}");
112
- b.p('targetId', () => input.targetId, '{targetId}', false);
113
- const query = map({
114
- [_ro]: [, input[_tRI]],
115
- });
116
- let body;
117
- b.m("GET")
118
- .h(headers)
119
- .q(query)
120
- .b(body);
121
- return b.build();
122
- };
123
- export const se_GetSmsNumberConfigurationCommand = async (input, context) => {
124
- const b = rb(input, context);
125
- const headers = {};
126
- b.bp("/v2/kite/sms/configurations/{serviceNumber}");
127
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
128
- const query = map({
129
- [_c]: [, input[_cI]],
130
- });
131
- let body;
132
- b.m("GET")
133
- .h(headers)
134
- .q(query)
135
- .b(body);
136
- return b.build();
137
- };
138
- export const se_GetWhatsAppNumberConfigurationCommand = async (input, context) => {
139
- const b = rb(input, context);
140
- const headers = {};
141
- b.bp("/v2/kite/whatsapp/configurations/{serviceNumber}");
142
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
143
- const query = map({
144
- [_c]: [, input[_cI]],
145
- });
146
- let body;
147
- b.m("GET")
148
- .h(headers)
149
- .q(query)
150
- .b(body);
151
- return b.build();
152
- };
153
- export const se_GetWidgetCommand = async (input, context) => {
154
- const b = rb(input, context);
155
- const headers = {};
156
- b.bp("/v2/kite/widgets/{widgetId}");
157
- b.p('widgetId', () => input.widgetId, '{widgetId}', false);
158
- let body;
159
- b.m("GET")
160
- .h(headers)
161
- .b(body);
162
- return b.build();
163
- };
164
- export const se_ListAgentsCommand = async (input, context) => {
165
- const b = rb(input, context);
166
- const headers = {
167
- 'content-type': 'application/json',
168
- };
169
- b.bp("/v2/kite/agents");
170
- const query = map({
171
- [_c]: [, input[_cI]],
172
- });
173
- let body;
174
- body = JSON.stringify(take(input, {
175
- 'filter': _ => _json(_),
176
- }));
177
- b.m("POST")
178
- .h(headers)
179
- .q(query)
180
- .b(body);
181
- return b.build();
182
- };
183
- export const se_ListServicesCommand = async (input, context) => {
184
- const b = rb(input, context);
185
- const headers = {};
186
- b.bp("/v2/kite/services");
187
- const query = map({
188
- [_c]: [, input[_cI]],
189
- });
190
- let body;
191
- b.m("GET")
192
- .h(headers)
193
- .q(query)
194
- .b(body);
195
- return b.build();
196
- };
197
- export const se_ListSmsConfigurationsCommand = async (input, context) => {
198
- const b = rb(input, context);
199
- const headers = {};
200
- b.bp("/v2/kite/sms/configurations");
201
- const query = map({
202
- [_c]: [, input[_cI]],
203
- });
204
- let body;
205
- b.m("GET")
206
- .h(headers)
207
- .q(query)
208
- .b(body);
209
- return b.build();
210
- };
211
- export const se_ListSmsNumbersCommand = async (input, context) => {
212
- const b = rb(input, context);
213
- const headers = {};
214
- b.bp("/v2/kite/sms/numbers");
215
- const query = map({
216
- [_c]: [, input[_cI]],
217
- });
218
- let body;
219
- b.m("GET")
220
- .h(headers)
221
- .q(query)
222
- .b(body);
223
- return b.build();
224
- };
225
- export const se_ListWhatsAppConfigurationsCommand = async (input, context) => {
226
- const b = rb(input, context);
227
- const headers = {};
228
- b.bp("/v2/kite/whatsapp/configurations");
229
- const query = map({
230
- [_c]: [, input[_cI]],
231
- });
232
- let body;
233
- b.m("GET")
234
- .h(headers)
235
- .q(query)
236
- .b(body);
237
- return b.build();
238
- };
239
- export const se_ListWhatsAppNumbersCommand = async (input, context) => {
240
- const b = rb(input, context);
241
- const headers = {};
242
- b.bp("/v2/kite/whatsapp/numbers");
243
- const query = map({
244
- [_c]: [, input[_cI]],
245
- });
246
- let body;
247
- b.m("GET")
248
- .h(headers)
249
- .q(query)
250
- .b(body);
251
- return b.build();
252
- };
253
- export const se_ListWhatsAppTemplatesCommand = async (input, context) => {
254
- const b = rb(input, context);
255
- const headers = {};
256
- b.bp("/v2/kite/whatsapp/templates/{serviceNumber}");
257
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
258
- const query = map({
259
- [_c]: [, input[_cI]],
260
- });
261
- let body;
262
- b.m("GET")
263
- .h(headers)
264
- .q(query)
265
- .b(body);
266
- return b.build();
267
- };
268
- export const se_ListWidgetsCommand = async (input, context) => {
269
- const b = rb(input, context);
270
- const headers = {};
271
- b.bp("/v2/kite/widgets");
272
- const query = map({
273
- [_c]: [, input[_cI]],
274
- });
275
- let body;
276
- b.m("GET")
277
- .h(headers)
278
- .q(query)
279
- .b(body);
280
- return b.build();
281
- };
282
- export const se_PutSmsNumberConfigurationCommand = async (input, context) => {
283
- const b = rb(input, context);
284
- const headers = {
285
- 'content-type': 'application/json',
286
- };
287
- b.bp("/v2/kite/sms/configurations/{serviceNumber}");
288
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
289
- const query = map({
290
- [_c]: [, input[_cI]],
291
- });
292
- let body;
293
- body = JSON.stringify(take(input, {
294
- 'actions': _ => _json(_),
295
- 'routes': _ => _json(_),
296
- 'serviceUri': [],
297
- 'target': _ => _json(_),
298
- }));
299
- b.m("PUT")
300
- .h(headers)
301
- .q(query)
302
- .b(body);
303
- return b.build();
304
- };
305
- export const se_PutWhatsAppNumberConfigurationCommand = async (input, context) => {
306
- const b = rb(input, context);
307
- const headers = {
308
- 'content-type': 'application/json',
309
- };
310
- b.bp("/v2/kite/whatsapp/configurations/{serviceNumber}");
311
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
312
- const query = map({
313
- [_c]: [, input[_cI]],
314
- });
315
- let body;
316
- body = JSON.stringify(take(input, {
317
- 'actions': _ => _json(_),
318
- 'routes': _ => _json(_),
319
- 'serviceUri': [],
320
- 'target': _ => _json(_),
321
- }));
322
- b.m("PUT")
323
- .h(headers)
324
- .q(query)
325
- .b(body);
326
- return b.build();
327
- };
328
- export const se_RescheduleCalendarEventCommand = async (input, context) => {
329
- const b = rb(input, context);
330
- const headers = {
331
- 'content-type': 'application/json',
332
- };
333
- b.bp("/v2/kite/calendar/channels/{channelId}/events/{eventOwner}/{eventId}");
334
- b.p('channelId', () => input.channelId, '{channelId}', false);
335
- b.p('eventId', () => input.eventId, '{eventId}', false);
336
- b.p('eventOwner', () => input.eventOwner, '{eventOwner}', false);
337
- let body;
338
- body = JSON.stringify(take(input, {
339
- 'attendees': _ => _json(_),
340
- 'changed': _ => _json(_),
341
- 'duration': [],
342
- 'reason': [],
343
- 'start': [],
344
- 'summary': [],
345
- }));
346
- b.m("PATCH")
347
- .h(headers)
348
- .b(body);
349
- return b.build();
350
- };
351
- export const se_ScheduleCalendarEventCommand = async (input, context) => {
352
- const b = rb(input, context);
353
- const headers = {
354
- 'content-type': 'application/json',
355
- };
356
- b.bp("/v2/kite/calendar/widgets/{targetId}");
357
- b.p('targetId', () => input.targetId, '{targetId}', false);
358
- let body;
359
- body = JSON.stringify(take(input, {
360
- 'attendees': _ => _json(_),
361
- 'channelId': [],
362
- 'duration': [],
363
- 'language': [],
364
- 'start': [],
365
- 'summary': [],
366
- 'timeZone': [],
367
- }));
368
- b.m("POST")
369
- .h(headers)
370
- .b(body);
371
- return b.build();
372
- };
373
- export const se_UpdateWidgetCommand = async (input, context) => {
374
- const b = rb(input, context);
375
- const headers = {
376
- 'content-type': 'application/json',
377
- };
378
- b.bp("/v2/kite/widgets/{widgetId}");
379
- b.p('widgetId', () => input.widgetId, '{widgetId}', false);
380
- const query = map({
381
- [_c]: [, input[_cI]],
382
- });
383
- let body;
384
- body = JSON.stringify(take(input, {
385
- 'actions': _ => _json(_),
386
- 'anonymousSessionsEnabled': [],
387
- 'anonymousSessionsOnly': [],
388
- 'anonymousSessionsRandomNameEnabled': [],
389
- 'appearance': _ => _json(_),
390
- 'name': [],
391
- 'routes': _ => se_WidgetRoutesList(_, context),
392
- 'target': _ => _json(_),
393
- 'welcomeMessages': _ => _json(_),
394
- }));
395
- b.m("PUT")
396
- .h(headers)
397
- .q(query)
398
- .b(body);
399
- return b.build();
400
- };
401
- export const de_CancelCalendarEventCommand = async (output, context) => {
402
- if (output.statusCode !== 200 && output.statusCode >= 300) {
403
- return de_CommandError(output, context);
404
- }
405
- const contents = map({
406
- $metadata: deserializeMetadata(output),
407
- });
408
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
409
- const doc = take(data, {
410
- 'channel': _json,
411
- 'event': _json,
412
- });
413
- Object.assign(contents, doc);
414
- return contents;
415
- };
416
- export const de_CreateOrUpdateWidgetPreviewCommand = async (output, context) => {
417
- if (output.statusCode !== 200 && output.statusCode >= 300) {
418
- return de_CommandError(output, context);
419
- }
420
- const contents = map({
421
- $metadata: deserializeMetadata(output),
422
- });
423
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
424
- const doc = take(data, {
425
- 'widget': _ => de_Widget(_, context),
426
- });
427
- Object.assign(contents, doc);
428
- return contents;
429
- };
430
- export const de_CreateWidgetCommand = async (output, context) => {
431
- if (output.statusCode !== 200 && output.statusCode >= 300) {
432
- return de_CommandError(output, context);
433
- }
434
- const contents = map({
435
- $metadata: deserializeMetadata(output),
436
- });
437
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
438
- const doc = take(data, {
439
- 'widget': _ => de_Widget(_, context),
440
- });
441
- Object.assign(contents, doc);
442
- return contents;
443
- };
444
- export const de_DeleteWidgetCommand = async (output, context) => {
445
- if (output.statusCode !== 200 && output.statusCode >= 300) {
446
- return de_CommandError(output, context);
447
- }
448
- const contents = map({
449
- $metadata: deserializeMetadata(output),
450
- });
451
- await collectBody(output.body, context);
452
- return contents;
453
- };
454
- export const de_GetCalendarSlotsCommand = async (output, context) => {
455
- if (output.statusCode !== 200 && output.statusCode >= 300) {
456
- return de_CommandError(output, context);
457
- }
458
- const contents = map({
459
- $metadata: deserializeMetadata(output),
460
- });
461
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
462
- const doc = take(data, {
463
- 'calendar': _json,
464
- });
465
- Object.assign(contents, doc);
466
- return contents;
467
- };
468
- export const de_GetConfigCommand = async (output, context) => {
469
- if (output.statusCode !== 200 && output.statusCode >= 300) {
470
- return de_CommandError(output, context);
471
- }
472
- const contents = map({
473
- $metadata: deserializeMetadata(output),
474
- });
475
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
476
- const doc = take(data, {
477
- 'config': _json,
478
- });
479
- Object.assign(contents, doc);
480
- return contents;
481
- };
482
- export const de_GetSmsNumberConfigurationCommand = async (output, context) => {
483
- if (output.statusCode !== 200 && output.statusCode >= 300) {
484
- return de_CommandError(output, context);
485
- }
486
- const contents = map({
487
- $metadata: deserializeMetadata(output),
488
- });
489
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
490
- const doc = take(data, {
491
- 'configuration': _json,
492
- });
493
- Object.assign(contents, doc);
494
- return contents;
495
- };
496
- export const de_GetWhatsAppNumberConfigurationCommand = async (output, context) => {
497
- if (output.statusCode !== 200 && output.statusCode >= 300) {
498
- return de_CommandError(output, context);
499
- }
500
- const contents = map({
501
- $metadata: deserializeMetadata(output),
502
- });
503
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
504
- const doc = take(data, {
505
- 'configuration': _json,
506
- });
507
- Object.assign(contents, doc);
508
- return contents;
509
- };
510
- export const de_GetWidgetCommand = async (output, context) => {
511
- if (output.statusCode !== 200 && output.statusCode >= 300) {
512
- return de_CommandError(output, context);
513
- }
514
- const contents = map({
515
- $metadata: deserializeMetadata(output),
516
- });
517
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
518
- const doc = take(data, {
519
- 'widget': _ => de_Widget(_, context),
520
- });
521
- Object.assign(contents, doc);
522
- return contents;
523
- };
524
- export const de_ListAgentsCommand = async (output, context) => {
525
- if (output.statusCode !== 200 && output.statusCode >= 300) {
526
- return de_CommandError(output, context);
527
- }
528
- const contents = map({
529
- $metadata: deserializeMetadata(output),
530
- });
531
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
532
- const doc = take(data, {
533
- 'users': _json,
534
- });
535
- Object.assign(contents, doc);
536
- return contents;
537
- };
538
- export const de_ListServicesCommand = async (output, context) => {
539
- if (output.statusCode !== 200 && output.statusCode >= 300) {
540
- return de_CommandError(output, context);
541
- }
542
- const contents = map({
543
- $metadata: deserializeMetadata(output),
544
- });
545
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
546
- const doc = take(data, {
547
- 'services': _json,
548
- });
549
- Object.assign(contents, doc);
550
- return contents;
551
- };
552
- export const de_ListSmsConfigurationsCommand = async (output, context) => {
553
- if (output.statusCode !== 200 && output.statusCode >= 300) {
554
- return de_CommandError(output, context);
555
- }
556
- const contents = map({
557
- $metadata: deserializeMetadata(output),
558
- });
559
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
560
- const doc = take(data, {
561
- 'configurations': _json,
562
- });
563
- Object.assign(contents, doc);
564
- return contents;
565
- };
566
- export const de_ListSmsNumbersCommand = async (output, context) => {
567
- if (output.statusCode !== 200 && output.statusCode >= 300) {
568
- return de_CommandError(output, context);
569
- }
570
- const contents = map({
571
- $metadata: deserializeMetadata(output),
572
- });
573
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
574
- const doc = take(data, {
575
- 'numbers': _json,
576
- });
577
- Object.assign(contents, doc);
578
- return contents;
579
- };
580
- export const de_ListWhatsAppConfigurationsCommand = async (output, context) => {
581
- if (output.statusCode !== 200 && output.statusCode >= 300) {
582
- return de_CommandError(output, context);
583
- }
584
- const contents = map({
585
- $metadata: deserializeMetadata(output),
586
- });
587
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
588
- const doc = take(data, {
589
- 'configurations': _json,
590
- });
591
- Object.assign(contents, doc);
592
- return contents;
593
- };
594
- export const de_ListWhatsAppNumbersCommand = async (output, context) => {
595
- if (output.statusCode !== 200 && output.statusCode >= 300) {
596
- return de_CommandError(output, context);
597
- }
598
- const contents = map({
599
- $metadata: deserializeMetadata(output),
600
- });
601
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
602
- const doc = take(data, {
603
- 'numbers': _json,
604
- });
605
- Object.assign(contents, doc);
606
- return contents;
607
- };
608
- export const de_ListWhatsAppTemplatesCommand = async (output, context) => {
609
- if (output.statusCode !== 200 && output.statusCode >= 300) {
610
- return de_CommandError(output, context);
611
- }
612
- const contents = map({
613
- $metadata: deserializeMetadata(output),
614
- });
615
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
616
- const doc = take(data, {
617
- 'templates': _json,
618
- });
619
- Object.assign(contents, doc);
620
- return contents;
621
- };
622
- export const de_ListWidgetsCommand = async (output, context) => {
623
- if (output.statusCode !== 200 && output.statusCode >= 300) {
624
- return de_CommandError(output, context);
625
- }
626
- const contents = map({
627
- $metadata: deserializeMetadata(output),
628
- });
629
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
630
- const doc = take(data, {
631
- 'widgets': _ => de_WidgetsList(_, context),
632
- });
633
- Object.assign(contents, doc);
634
- return contents;
635
- };
636
- export const de_PutSmsNumberConfigurationCommand = async (output, context) => {
637
- if (output.statusCode !== 200 && output.statusCode >= 300) {
638
- return de_CommandError(output, context);
639
- }
640
- const contents = map({
641
- $metadata: deserializeMetadata(output),
642
- });
643
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
644
- const doc = take(data, {
645
- 'configuration': _json,
646
- });
647
- Object.assign(contents, doc);
648
- return contents;
649
- };
650
- export const de_PutWhatsAppNumberConfigurationCommand = async (output, context) => {
651
- if (output.statusCode !== 200 && output.statusCode >= 300) {
652
- return de_CommandError(output, context);
653
- }
654
- const contents = map({
655
- $metadata: deserializeMetadata(output),
656
- });
657
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
658
- const doc = take(data, {
659
- 'configuration': _json,
660
- });
661
- Object.assign(contents, doc);
662
- return contents;
663
- };
664
- export const de_RescheduleCalendarEventCommand = async (output, context) => {
665
- if (output.statusCode !== 200 && output.statusCode >= 300) {
666
- return de_CommandError(output, context);
667
- }
668
- const contents = map({
669
- $metadata: deserializeMetadata(output),
670
- });
671
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
672
- const doc = take(data, {
673
- 'channel': _json,
674
- 'event': _json,
675
- });
676
- Object.assign(contents, doc);
677
- return contents;
678
- };
679
- export const de_ScheduleCalendarEventCommand = async (output, context) => {
680
- if (output.statusCode !== 200 && output.statusCode >= 300) {
681
- return de_CommandError(output, context);
682
- }
683
- const contents = map({
684
- $metadata: deserializeMetadata(output),
685
- });
686
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
687
- const doc = take(data, {
688
- 'channel': _json,
689
- 'event': _json,
690
- });
691
- Object.assign(contents, doc);
692
- return contents;
693
- };
694
- export const de_UpdateWidgetCommand = async (output, context) => {
695
- if (output.statusCode !== 200 && output.statusCode >= 300) {
696
- return de_CommandError(output, context);
697
- }
698
- const contents = map({
699
- $metadata: deserializeMetadata(output),
700
- });
701
- const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
702
- const doc = take(data, {
703
- 'widget': _ => de_Widget(_, context),
704
- });
705
- Object.assign(contents, doc);
706
- return contents;
707
- };
708
- const de_CommandError = async (output, context) => {
709
- const parsedOutput = {
710
- ...output,
711
- body: await parseErrorBody(output.body, context)
712
- };
713
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
714
- switch (errorCode) {
715
- case "ChannelNotFoundException":
716
- case "wildix.xbees.conversations#ChannelNotFoundException":
717
- throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
718
- case "ForbiddenException":
719
- case "smithy.framework#ForbiddenException":
720
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
721
- case "NotFoundException":
722
- case "smithy.framework#NotFoundException":
723
- throw await de_NotFoundExceptionRes(parsedOutput, context);
724
- case "RateLimitExceededException":
725
- case "smithy.framework#RateLimitExceededException":
726
- throw await de_RateLimitExceededExceptionRes(parsedOutput, context);
727
- case "ValidationException":
728
- case "smithy.framework#ValidationException":
729
- throw await de_ValidationExceptionRes(parsedOutput, context);
730
- case "TargetNotFoundException":
731
- case "wildix.xbees.kite#TargetNotFoundException":
732
- throw await de_TargetNotFoundExceptionRes(parsedOutput, context);
733
- case "WidgetNotFoundException":
734
- case "wildix.xbees.kite#WidgetNotFoundException":
735
- throw await de_WidgetNotFoundExceptionRes(parsedOutput, context);
736
- case "EventNotFoundException":
737
- case "wildix.xbees.kite#EventNotFoundException":
738
- throw await de_EventNotFoundExceptionRes(parsedOutput, context);
739
- default:
740
- const parsedBody = parsedOutput.body;
741
- return throwDefaultError({
742
- output,
743
- parsedBody,
744
- errorCode
745
- });
746
- }
747
- };
748
- const throwDefaultError = withBaseException(__BaseException);
749
- const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
750
- const contents = map({});
751
- const data = parsedOutput.body;
752
- const doc = take(data, {
753
- 'message': __expectString,
754
- });
755
- Object.assign(contents, doc);
756
- const exception = new ForbiddenException({
757
- $metadata: deserializeMetadata(parsedOutput),
758
- ...contents
759
- });
760
- return __decorateServiceException(exception, parsedOutput.body);
761
- };
762
- const de_NotFoundExceptionRes = async (parsedOutput, context) => {
763
- const contents = map({});
764
- const data = parsedOutput.body;
765
- const doc = take(data, {
766
- 'message': __expectString,
767
- });
768
- Object.assign(contents, doc);
769
- const exception = new NotFoundException({
770
- $metadata: deserializeMetadata(parsedOutput),
771
- ...contents
772
- });
773
- return __decorateServiceException(exception, parsedOutput.body);
774
- };
775
- const de_RateLimitExceededExceptionRes = async (parsedOutput, context) => {
776
- const contents = map({
777
- [_rL]: [, parsedOutput.headers[_xrl]],
778
- [_rLR]: [() => void 0 !== parsedOutput.headers[_xrr], () => __strictParseInt32(parsedOutput.headers[_xrr])],
779
- [_rLRa]: [() => void 0 !== parsedOutput.headers[_xrr_], () => __strictParseInt32(parsedOutput.headers[_xrr_])],
780
- [_rA]: [() => void 0 !== parsedOutput.headers[_ra], () => __strictParseInt32(parsedOutput.headers[_ra])],
781
- });
782
- const data = parsedOutput.body;
783
- const doc = take(data, {
784
- 'message': __expectString,
785
- });
786
- Object.assign(contents, doc);
787
- const exception = new RateLimitExceededException({
788
- $metadata: deserializeMetadata(parsedOutput),
789
- ...contents
790
- });
791
- return __decorateServiceException(exception, parsedOutput.body);
792
- };
793
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
794
- const contents = map({});
795
- const data = parsedOutput.body;
796
- const doc = take(data, {
797
- 'message': __expectString,
798
- });
799
- Object.assign(contents, doc);
800
- const exception = new ValidationException({
801
- $metadata: deserializeMetadata(parsedOutput),
802
- ...contents
803
- });
804
- return __decorateServiceException(exception, parsedOutput.body);
805
- };
806
- const de_ChannelNotFoundExceptionRes = async (parsedOutput, context) => {
807
- const contents = map({});
808
- const data = parsedOutput.body;
809
- const doc = take(data, {
810
- 'message': __expectString,
811
- });
812
- Object.assign(contents, doc);
813
- const exception = new ChannelNotFoundException({
814
- $metadata: deserializeMetadata(parsedOutput),
815
- ...contents
816
- });
817
- return __decorateServiceException(exception, parsedOutput.body);
818
- };
819
- const de_EventNotFoundExceptionRes = async (parsedOutput, context) => {
820
- const contents = map({});
821
- const data = parsedOutput.body;
822
- const doc = take(data, {
823
- 'message': __expectString,
824
- });
825
- Object.assign(contents, doc);
826
- const exception = new EventNotFoundException({
827
- $metadata: deserializeMetadata(parsedOutput),
828
- ...contents
829
- });
830
- return __decorateServiceException(exception, parsedOutput.body);
831
- };
832
- const de_TargetNotFoundExceptionRes = async (parsedOutput, context) => {
833
- const contents = map({});
834
- const data = parsedOutput.body;
835
- const doc = take(data, {
836
- 'message': __expectString,
837
- });
838
- Object.assign(contents, doc);
839
- const exception = new TargetNotFoundException({
840
- $metadata: deserializeMetadata(parsedOutput),
841
- ...contents
842
- });
843
- return __decorateServiceException(exception, parsedOutput.body);
844
- };
845
- const de_WidgetNotFoundExceptionRes = async (parsedOutput, context) => {
846
- const contents = map({});
847
- const data = parsedOutput.body;
848
- const doc = take(data, {
849
- 'message': __expectString,
850
- });
851
- Object.assign(contents, doc);
852
- const exception = new WidgetNotFoundException({
853
- $metadata: deserializeMetadata(parsedOutput),
854
- ...contents
855
- });
856
- return __decorateServiceException(exception, parsedOutput.body);
857
- };
858
- const se_WidgetRoutesList = (input, context) => {
859
- return input.filter((e) => e != null).map(entry => {
860
- return _json(entry);
861
- });
862
- };
863
- const de_Widget = (output, context) => {
864
- return take(output, {
865
- 'actions': _json,
866
- 'anonymousSessionsEnabled': __expectBoolean,
867
- 'anonymousSessionsOnly': __expectBoolean,
868
- 'anonymousSessionsRandomNameEnabled': __expectBoolean,
869
- 'appearance': _json,
870
- 'company': __expectString,
871
- 'createdAt': __expectString,
872
- 'id': __expectString,
873
- 'name': __expectString,
874
- 'routes': (_) => de_WidgetRoutesList(_, context),
875
- 'target': (_) => _json(__expectUnion(_)),
876
- 'updatedAt': __expectString,
877
- 'welcomeMessages': _json,
878
- });
879
- };
880
- const de_WidgetRoutesList = (output, context) => {
881
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
882
- return _json(entry);
883
- });
884
- return retVal;
885
- };
886
- const de_WidgetsList = (output, context) => {
887
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
888
- return de_Widget(entry, context);
889
- });
890
- return retVal;
891
- };
892
- const deserializeMetadata = (output) => ({
893
- httpStatusCode: output.statusCode,
894
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
895
- extendedRequestId: output.headers["x-amz-id-2"],
896
- cfId: output.headers["x-amz-cf-id"],
897
- });
898
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
899
- const _c = "company";
900
- const _cI = "companyId";
901
- const _d = "duration";
902
- const _e = "excluded";
903
- const _f = "from";
904
- const _r = "reason";
905
- const _rA = "retryAfter";
906
- const _rL = "rateLimit";
907
- const _rLR = "rateLimitRemaining";
908
- const _rLRa = "rateLimitReset";
909
- const _ra = "retry-after";
910
- const _ro = "route";
911
- const _t = "till";
912
- const _tRI = "targetRouteId";
913
- const _tZ = "timeZone";
914
- const _xrl = "x-ratelimit-limit";
915
- const _xrr = "x-ratelimit-remaining";
916
- const _xrr_ = "x-ratelimit-reset";