@wildix/xbees-kite-client 1.0.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 (64) hide show
  1. package/dist-cjs/Kite.js +25 -0
  2. package/dist-cjs/KiteClient.js +37 -0
  3. package/dist-cjs/commands/CreateWidgetCommand.js +21 -0
  4. package/dist-cjs/commands/DeleteWidgetCommand.js +21 -0
  5. package/dist-cjs/commands/GetConfigCommand.js +21 -0
  6. package/dist-cjs/commands/GetWidgetCommand.js +21 -0
  7. package/dist-cjs/commands/ListServicesCommand.js +21 -0
  8. package/dist-cjs/commands/ListWidgetsCommand.js +21 -0
  9. package/dist-cjs/commands/UpdateWidgetCommand.js +21 -0
  10. package/dist-cjs/commands/index.js +10 -0
  11. package/dist-cjs/extensionConfiguration.js +2 -0
  12. package/dist-cjs/index.js +10 -0
  13. package/dist-cjs/models/KiteServiceException.js +12 -0
  14. package/dist-cjs/models/index.js +4 -0
  15. package/dist-cjs/models/models_0.js +112 -0
  16. package/dist-cjs/protocols/Aws_restJson1.js +387 -0
  17. package/dist-cjs/runtimeConfig.browser.js +32 -0
  18. package/dist-cjs/runtimeConfig.js +36 -0
  19. package/dist-cjs/runtimeConfig.native.js +15 -0
  20. package/dist-cjs/runtimeConfig.shared.js +21 -0
  21. package/dist-cjs/runtimeExtensions.js +19 -0
  22. package/dist-es/Kite.js +21 -0
  23. package/dist-es/KiteClient.js +33 -0
  24. package/dist-es/commands/CreateWidgetCommand.js +17 -0
  25. package/dist-es/commands/DeleteWidgetCommand.js +17 -0
  26. package/dist-es/commands/GetConfigCommand.js +17 -0
  27. package/dist-es/commands/GetWidgetCommand.js +17 -0
  28. package/dist-es/commands/ListServicesCommand.js +17 -0
  29. package/dist-es/commands/ListWidgetsCommand.js +17 -0
  30. package/dist-es/commands/UpdateWidgetCommand.js +17 -0
  31. package/dist-es/commands/index.js +7 -0
  32. package/dist-es/extensionConfiguration.js +1 -0
  33. package/dist-es/index.js +5 -0
  34. package/dist-es/models/KiteServiceException.js +8 -0
  35. package/dist-es/models/index.js +1 -0
  36. package/dist-es/models/models_0.js +104 -0
  37. package/dist-es/protocols/Aws_restJson1.js +370 -0
  38. package/dist-es/runtimeConfig.browser.js +27 -0
  39. package/dist-es/runtimeConfig.js +31 -0
  40. package/dist-es/runtimeConfig.native.js +11 -0
  41. package/dist-es/runtimeConfig.shared.js +17 -0
  42. package/dist-es/runtimeExtensions.js +15 -0
  43. package/dist-types/Kite.d.ts +60 -0
  44. package/dist-types/KiteClient.d.ts +149 -0
  45. package/dist-types/commands/CreateWidgetCommand.d.ts +199 -0
  46. package/dist-types/commands/DeleteWidgetCommand.d.ts +64 -0
  47. package/dist-types/commands/GetConfigCommand.d.ts +107 -0
  48. package/dist-types/commands/GetWidgetCommand.d.ts +137 -0
  49. package/dist-types/commands/ListServicesCommand.d.ts +94 -0
  50. package/dist-types/commands/ListWidgetsCommand.d.ts +137 -0
  51. package/dist-types/commands/UpdateWidgetCommand.d.ts +200 -0
  52. package/dist-types/commands/index.d.ts +7 -0
  53. package/dist-types/extensionConfiguration.d.ts +7 -0
  54. package/dist-types/index.d.ts +7 -0
  55. package/dist-types/models/KiteServiceException.d.ts +14 -0
  56. package/dist-types/models/index.d.ts +1 -0
  57. package/dist-types/models/models_0.d.ts +617 -0
  58. package/dist-types/protocols/Aws_restJson1.d.ts +65 -0
  59. package/dist-types/runtimeConfig.browser.d.ts +28 -0
  60. package/dist-types/runtimeConfig.d.ts +28 -0
  61. package/dist-types/runtimeConfig.native.d.ts +27 -0
  62. package/dist-types/runtimeConfig.shared.d.ts +15 -0
  63. package/dist-types/runtimeExtensions.d.ts +17 -0
  64. package/package.json +78 -0
@@ -0,0 +1,387 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.de_UpdateWidgetCommand = exports.de_ListWidgetsCommand = exports.de_ListServicesCommand = exports.de_GetWidgetCommand = exports.de_GetConfigCommand = exports.de_DeleteWidgetCommand = exports.de_CreateWidgetCommand = exports.se_UpdateWidgetCommand = exports.se_ListWidgetsCommand = exports.se_ListServicesCommand = exports.se_GetWidgetCommand = exports.se_GetConfigCommand = exports.se_DeleteWidgetCommand = exports.se_CreateWidgetCommand = void 0;
4
+ const KiteServiceException_1 = require("../models/KiteServiceException");
5
+ const models_0_1 = require("../models/models_0");
6
+ const core_1 = require("@smithy/core");
7
+ const smithy_client_1 = require("@smithy/smithy-client");
8
+ const se_CreateWidgetCommand = async (input, context) => {
9
+ const b = (0, core_1.requestBuilder)(input, context);
10
+ const headers = {
11
+ 'content-type': 'application/json',
12
+ };
13
+ b.bp("/v2/kite/widgets");
14
+ const query = (0, smithy_client_1.map)({
15
+ [_c]: [, input[_cI]],
16
+ });
17
+ let body;
18
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
19
+ 'appearance': _ => (0, smithy_client_1._json)(_),
20
+ 'name': [],
21
+ 'routes': _ => (0, smithy_client_1._json)(_),
22
+ 'target': _ => (0, smithy_client_1._json)(_),
23
+ 'welcomeMessages': _ => (0, smithy_client_1._json)(_),
24
+ }));
25
+ b.m("POST")
26
+ .h(headers)
27
+ .q(query)
28
+ .b(body);
29
+ return b.build();
30
+ };
31
+ exports.se_CreateWidgetCommand = se_CreateWidgetCommand;
32
+ const se_DeleteWidgetCommand = async (input, context) => {
33
+ const b = (0, core_1.requestBuilder)(input, context);
34
+ const headers = {};
35
+ b.bp("/v2/kite/widgets/{widgetId}");
36
+ b.p('widgetId', () => input.widgetId, '{widgetId}', false);
37
+ let body;
38
+ b.m("DELETE")
39
+ .h(headers)
40
+ .b(body);
41
+ return b.build();
42
+ };
43
+ exports.se_DeleteWidgetCommand = se_DeleteWidgetCommand;
44
+ const se_GetConfigCommand = async (input, context) => {
45
+ const b = (0, core_1.requestBuilder)(input, context);
46
+ const headers = {};
47
+ b.bp("/v2/kite/config/{targetId}");
48
+ b.p('targetId', () => input.targetId, '{targetId}', false);
49
+ let body;
50
+ b.m("GET")
51
+ .h(headers)
52
+ .b(body);
53
+ return b.build();
54
+ };
55
+ exports.se_GetConfigCommand = se_GetConfigCommand;
56
+ const se_GetWidgetCommand = async (input, context) => {
57
+ const b = (0, core_1.requestBuilder)(input, context);
58
+ const headers = {};
59
+ b.bp("/v2/kite/widgets/{widgetId}");
60
+ b.p('widgetId', () => input.widgetId, '{widgetId}', false);
61
+ let body;
62
+ b.m("GET")
63
+ .h(headers)
64
+ .b(body);
65
+ return b.build();
66
+ };
67
+ exports.se_GetWidgetCommand = se_GetWidgetCommand;
68
+ const se_ListServicesCommand = async (input, context) => {
69
+ const b = (0, core_1.requestBuilder)(input, context);
70
+ const headers = {
71
+ 'content-type': 'application/json',
72
+ };
73
+ b.bp("/v2/kite/services");
74
+ let body;
75
+ body = "";
76
+ b.m("GET")
77
+ .h(headers)
78
+ .b(body);
79
+ return b.build();
80
+ };
81
+ exports.se_ListServicesCommand = se_ListServicesCommand;
82
+ const se_ListWidgetsCommand = async (input, context) => {
83
+ const b = (0, core_1.requestBuilder)(input, context);
84
+ const headers = {};
85
+ b.bp("/v2/kite/widgets");
86
+ const query = (0, smithy_client_1.map)({
87
+ [_c]: [, input[_cI]],
88
+ });
89
+ let body;
90
+ b.m("GET")
91
+ .h(headers)
92
+ .q(query)
93
+ .b(body);
94
+ return b.build();
95
+ };
96
+ exports.se_ListWidgetsCommand = se_ListWidgetsCommand;
97
+ const se_UpdateWidgetCommand = async (input, context) => {
98
+ const b = (0, core_1.requestBuilder)(input, context);
99
+ const headers = {
100
+ 'content-type': 'application/json',
101
+ };
102
+ b.bp("/v2/kite/widgets/{widgetId}");
103
+ b.p('widgetId', () => input.widgetId, '{widgetId}', false);
104
+ const query = (0, smithy_client_1.map)({
105
+ [_c]: [, input[_cI]],
106
+ });
107
+ let body;
108
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
109
+ 'appearance': _ => (0, smithy_client_1._json)(_),
110
+ 'name': [],
111
+ 'routes': _ => (0, smithy_client_1._json)(_),
112
+ 'target': _ => (0, smithy_client_1._json)(_),
113
+ 'welcomeMessages': _ => (0, smithy_client_1._json)(_),
114
+ }));
115
+ b.m("PUT")
116
+ .h(headers)
117
+ .q(query)
118
+ .b(body);
119
+ return b.build();
120
+ };
121
+ exports.se_UpdateWidgetCommand = se_UpdateWidgetCommand;
122
+ const de_CreateWidgetCommand = async (output, context) => {
123
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
124
+ return de_CommandError(output, context);
125
+ }
126
+ const contents = (0, smithy_client_1.map)({
127
+ $metadata: deserializeMetadata(output),
128
+ });
129
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
130
+ const doc = (0, smithy_client_1.take)(data, {
131
+ 'widget': smithy_client_1._json,
132
+ });
133
+ Object.assign(contents, doc);
134
+ return contents;
135
+ };
136
+ exports.de_CreateWidgetCommand = de_CreateWidgetCommand;
137
+ const de_DeleteWidgetCommand = async (output, context) => {
138
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
139
+ return de_CommandError(output, context);
140
+ }
141
+ const contents = (0, smithy_client_1.map)({
142
+ $metadata: deserializeMetadata(output),
143
+ });
144
+ await (0, smithy_client_1.collectBody)(output.body, context);
145
+ return contents;
146
+ };
147
+ exports.de_DeleteWidgetCommand = de_DeleteWidgetCommand;
148
+ const de_GetConfigCommand = async (output, context) => {
149
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
150
+ return de_CommandError(output, context);
151
+ }
152
+ const contents = (0, smithy_client_1.map)({
153
+ $metadata: deserializeMetadata(output),
154
+ });
155
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
156
+ const doc = (0, smithy_client_1.take)(data, {
157
+ 'config': smithy_client_1._json,
158
+ });
159
+ Object.assign(contents, doc);
160
+ return contents;
161
+ };
162
+ exports.de_GetConfigCommand = de_GetConfigCommand;
163
+ const de_GetWidgetCommand = async (output, context) => {
164
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
165
+ return de_CommandError(output, context);
166
+ }
167
+ const contents = (0, smithy_client_1.map)({
168
+ $metadata: deserializeMetadata(output),
169
+ });
170
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
171
+ const doc = (0, smithy_client_1.take)(data, {
172
+ 'widget': smithy_client_1._json,
173
+ });
174
+ Object.assign(contents, doc);
175
+ return contents;
176
+ };
177
+ exports.de_GetWidgetCommand = de_GetWidgetCommand;
178
+ const de_ListServicesCommand = async (output, context) => {
179
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
180
+ return de_CommandError(output, context);
181
+ }
182
+ const contents = (0, smithy_client_1.map)({
183
+ $metadata: deserializeMetadata(output),
184
+ });
185
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
186
+ const doc = (0, smithy_client_1.take)(data, {
187
+ 'services': smithy_client_1._json,
188
+ });
189
+ Object.assign(contents, doc);
190
+ return contents;
191
+ };
192
+ exports.de_ListServicesCommand = de_ListServicesCommand;
193
+ const de_ListWidgetsCommand = async (output, context) => {
194
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
195
+ return de_CommandError(output, context);
196
+ }
197
+ const contents = (0, smithy_client_1.map)({
198
+ $metadata: deserializeMetadata(output),
199
+ });
200
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
201
+ const doc = (0, smithy_client_1.take)(data, {
202
+ 'widgets': smithy_client_1._json,
203
+ });
204
+ Object.assign(contents, doc);
205
+ return contents;
206
+ };
207
+ exports.de_ListWidgetsCommand = de_ListWidgetsCommand;
208
+ const de_UpdateWidgetCommand = async (output, context) => {
209
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
210
+ return de_CommandError(output, context);
211
+ }
212
+ const contents = (0, smithy_client_1.map)({
213
+ $metadata: deserializeMetadata(output),
214
+ });
215
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
216
+ const doc = (0, smithy_client_1.take)(data, {
217
+ 'widget': smithy_client_1._json,
218
+ });
219
+ Object.assign(contents, doc);
220
+ return contents;
221
+ };
222
+ exports.de_UpdateWidgetCommand = de_UpdateWidgetCommand;
223
+ const de_CommandError = async (output, context) => {
224
+ const parsedOutput = {
225
+ ...output,
226
+ body: await parseErrorBody(output.body, context)
227
+ };
228
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
229
+ switch (errorCode) {
230
+ case "ForbiddenException":
231
+ case "smithy.framework#ForbiddenException":
232
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
233
+ case "LimitExceededException":
234
+ case "smithy.framework#LimitExceededException":
235
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
236
+ case "ValidationException":
237
+ case "smithy.framework#ValidationException":
238
+ throw await de_ValidationExceptionRes(parsedOutput, context);
239
+ case "TargetNotFoundException":
240
+ case "wildix.xbees.kite#TargetNotFoundException":
241
+ throw await de_TargetNotFoundExceptionRes(parsedOutput, context);
242
+ case "WidgetNotFoundException":
243
+ case "wildix.xbees.kite#WidgetNotFoundException":
244
+ throw await de_WidgetNotFoundExceptionRes(parsedOutput, context);
245
+ default:
246
+ const parsedBody = parsedOutput.body;
247
+ return throwDefaultError({
248
+ output,
249
+ parsedBody,
250
+ errorCode
251
+ });
252
+ }
253
+ };
254
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(KiteServiceException_1.KiteServiceException);
255
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
256
+ const contents = (0, smithy_client_1.map)({});
257
+ const data = parsedOutput.body;
258
+ const doc = (0, smithy_client_1.take)(data, {
259
+ 'message': smithy_client_1.expectString,
260
+ });
261
+ Object.assign(contents, doc);
262
+ const exception = new models_0_1.ForbiddenException({
263
+ $metadata: deserializeMetadata(parsedOutput),
264
+ ...contents
265
+ });
266
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
267
+ };
268
+ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
269
+ const contents = (0, smithy_client_1.map)({
270
+ [_rL]: [, parsedOutput.headers[_xrl]],
271
+ [_rLR]: [() => void 0 !== parsedOutput.headers[_xrr], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_xrr])],
272
+ [_rLRa]: [() => void 0 !== parsedOutput.headers[_xrr_], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_xrr_])],
273
+ [_rA]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
274
+ });
275
+ const data = parsedOutput.body;
276
+ const doc = (0, smithy_client_1.take)(data, {
277
+ 'message': smithy_client_1.expectString,
278
+ });
279
+ Object.assign(contents, doc);
280
+ const exception = new models_0_1.LimitExceededException({
281
+ $metadata: deserializeMetadata(parsedOutput),
282
+ ...contents
283
+ });
284
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
285
+ };
286
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
287
+ const contents = (0, smithy_client_1.map)({});
288
+ const data = parsedOutput.body;
289
+ const doc = (0, smithy_client_1.take)(data, {
290
+ 'message': smithy_client_1.expectString,
291
+ });
292
+ Object.assign(contents, doc);
293
+ const exception = new models_0_1.ValidationException({
294
+ $metadata: deserializeMetadata(parsedOutput),
295
+ ...contents
296
+ });
297
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
298
+ };
299
+ const de_TargetNotFoundExceptionRes = async (parsedOutput, context) => {
300
+ const contents = (0, smithy_client_1.map)({});
301
+ const data = parsedOutput.body;
302
+ const doc = (0, smithy_client_1.take)(data, {
303
+ 'message': smithy_client_1.expectString,
304
+ });
305
+ Object.assign(contents, doc);
306
+ const exception = new models_0_1.TargetNotFoundException({
307
+ $metadata: deserializeMetadata(parsedOutput),
308
+ ...contents
309
+ });
310
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
311
+ };
312
+ const de_WidgetNotFoundExceptionRes = async (parsedOutput, context) => {
313
+ const contents = (0, smithy_client_1.map)({});
314
+ const data = parsedOutput.body;
315
+ const doc = (0, smithy_client_1.take)(data, {
316
+ 'message': smithy_client_1.expectString,
317
+ });
318
+ Object.assign(contents, doc);
319
+ const exception = new models_0_1.WidgetNotFoundException({
320
+ $metadata: deserializeMetadata(parsedOutput),
321
+ ...contents
322
+ });
323
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
324
+ };
325
+ const deserializeMetadata = (output) => ({
326
+ httpStatusCode: output.statusCode,
327
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
328
+ extendedRequestId: output.headers["x-amz-id-2"],
329
+ cfId: output.headers["x-amz-cf-id"],
330
+ });
331
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
332
+ const isSerializableHeaderValue = (value) => value !== undefined &&
333
+ value !== null &&
334
+ value !== "" &&
335
+ (!Object.getOwnPropertyNames(value).includes("length") ||
336
+ value.length != 0) &&
337
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
338
+ const _c = "company";
339
+ const _cI = "companyId";
340
+ const _rA = "retryAfter";
341
+ const _rL = "rateLimit";
342
+ const _rLR = "rateLimitRemaining";
343
+ const _rLRa = "rateLimitReset";
344
+ const _ra = "retry-after";
345
+ const _xrl = "x-ratelimit-limit";
346
+ const _xrr = "x-ratelimit-remaining";
347
+ const _xrr_ = "x-ratelimit-reset";
348
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
349
+ if (encoded.length) {
350
+ return JSON.parse(encoded);
351
+ }
352
+ return {};
353
+ });
354
+ const parseErrorBody = async (errorBody, context) => {
355
+ const value = await parseBody(errorBody, context);
356
+ value.message = value.message ?? value.Message;
357
+ return value;
358
+ };
359
+ const loadRestJsonErrorCode = (output, data) => {
360
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
361
+ const sanitizeErrorCode = (rawValue) => {
362
+ let cleanValue = rawValue;
363
+ if (typeof cleanValue === "number") {
364
+ cleanValue = cleanValue.toString();
365
+ }
366
+ if (cleanValue.indexOf(",") >= 0) {
367
+ cleanValue = cleanValue.split(",")[0];
368
+ }
369
+ if (cleanValue.indexOf(":") >= 0) {
370
+ cleanValue = cleanValue.split(":")[0];
371
+ }
372
+ if (cleanValue.indexOf("#") >= 0) {
373
+ cleanValue = cleanValue.split("#")[1];
374
+ }
375
+ return cleanValue;
376
+ };
377
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
378
+ if (headerKey !== undefined) {
379
+ return sanitizeErrorCode(output.headers[headerKey]);
380
+ }
381
+ if (data.code !== undefined) {
382
+ return sanitizeErrorCode(data.code);
383
+ }
384
+ if (data["__type"] !== undefined) {
385
+ return sanitizeErrorCode(data["__type"]);
386
+ }
387
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const sha256_browser_1 = require("@aws-crypto/sha256-browser");
7
+ const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
8
+ const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
9
+ const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
10
+ const util_retry_1 = require("@smithy/util-retry");
11
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
12
+ const smithy_client_1 = require("@smithy/smithy-client");
13
+ const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
14
+ const getRuntimeConfig = (config) => {
15
+ const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
16
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
17
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
18
+ return {
19
+ ...clientSharedValues,
20
+ ...config,
21
+ runtime: "browser",
22
+ defaultsMode,
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 }),
25
+ maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
26
+ requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
27
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
28
+ sha256: config?.sha256 ?? sha256_browser_1.Sha256,
29
+ streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
30
+ };
31
+ };
32
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
7
+ const hash_node_1 = require("@smithy/hash-node");
8
+ const middleware_retry_1 = require("@smithy/middleware-retry");
9
+ const node_config_provider_1 = require("@smithy/node-config-provider");
10
+ const node_http_handler_1 = require("@smithy/node-http-handler");
11
+ const util_body_length_node_1 = require("@smithy/util-body-length-node");
12
+ const util_retry_1 = require("@smithy/util-retry");
13
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
14
+ const smithy_client_1 = require("@smithy/smithy-client");
15
+ const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
16
+ const smithy_client_2 = require("@smithy/smithy-client");
17
+ const getRuntimeConfig = (config) => {
18
+ (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
19
+ const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
20
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
21
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
22
+ return {
23
+ ...clientSharedValues,
24
+ ...config,
25
+ runtime: "node",
26
+ defaultsMode,
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),
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, }),
32
+ sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
33
+ streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
34
+ };
35
+ };
36
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const sha256_js_1 = require("@aws-crypto/sha256-js");
5
+ const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
6
+ const getRuntimeConfig = (config) => {
7
+ const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
8
+ return {
9
+ ...browserDefaults,
10
+ ...config,
11
+ runtime: "react-native",
12
+ sha256: config?.sha256 ?? sha256_js_1.Sha256,
13
+ };
14
+ };
15
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const smithy_client_1 = require("@smithy/smithy-client");
5
+ const url_parser_1 = require("@smithy/url-parser");
6
+ const util_base64_1 = require("@smithy/util-base64");
7
+ const util_utf8_1 = require("@smithy/util-utf8");
8
+ const getRuntimeConfig = (config) => {
9
+ return {
10
+ apiVersion: "v2",
11
+ base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
12
+ base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
13
+ disableHostPrefix: config?.disableHostPrefix ?? false,
14
+ extensions: config?.extensions ?? [],
15
+ logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
16
+ urlParser: config?.urlParser ?? url_parser_1.parseUrl,
17
+ utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
18
+ utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
19
+ };
20
+ };
21
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveRuntimeExtensions = void 0;
4
+ const protocol_http_1 = require("@smithy/protocol-http");
5
+ const smithy_client_1 = require("@smithy/smithy-client");
6
+ const asPartial = (t) => t;
7
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
8
+ const extensionConfiguration = {
9
+ ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
10
+ ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
11
+ };
12
+ 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
+ };
18
+ };
19
+ exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
@@ -0,0 +1,21 @@
1
+ import { KiteClient, } from "./KiteClient";
2
+ import { CreateWidgetCommand, } from "./commands/CreateWidgetCommand";
3
+ import { DeleteWidgetCommand, } from "./commands/DeleteWidgetCommand";
4
+ import { GetConfigCommand, } from "./commands/GetConfigCommand";
5
+ import { GetWidgetCommand, } from "./commands/GetWidgetCommand";
6
+ import { ListServicesCommand, } from "./commands/ListServicesCommand";
7
+ import { ListWidgetsCommand, } from "./commands/ListWidgetsCommand";
8
+ import { UpdateWidgetCommand, } from "./commands/UpdateWidgetCommand";
9
+ import { createAggregatedClient } from "@smithy/smithy-client";
10
+ const commands = {
11
+ CreateWidgetCommand,
12
+ DeleteWidgetCommand,
13
+ GetConfigCommand,
14
+ GetWidgetCommand,
15
+ ListServicesCommand,
16
+ ListWidgetsCommand,
17
+ UpdateWidgetCommand,
18
+ };
19
+ export class Kite extends KiteClient {
20
+ }
21
+ createAggregatedClient(commands, Kite);
@@ -0,0 +1,33 @@
1
+ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
2
+ import { resolveRuntimeExtensions, } from "./runtimeExtensions";
3
+ import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
4
+ import { Client as __Client, } from "@smithy/smithy-client";
5
+ import { authorizationMiddleware } from '@wildix/smithy-utils';
6
+ export { __Client };
7
+ export class KiteClient extends __Client {
8
+ constructor(...[configuration]) {
9
+ let _config_0 = __getRuntimeConfig(configuration || {});
10
+ let _config_1 = resolveUserAgentConfig(_config_0);
11
+ let _config_2 = resolveRuntimeExtensions(_config_1, configuration?.extensions || []);
12
+ const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `api-${configuration.env}.x-bees.com` : 'api.x-bees.com';
13
+ const endpoint = () => {
14
+ return {
15
+ hostname,
16
+ protocol: "https",
17
+ port: '443',
18
+ path: ''
19
+ };
20
+ };
21
+ const config = {
22
+ ..._config_2,
23
+ endpoint,
24
+ };
25
+ super(config);
26
+ this.config = config;
27
+ this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
28
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
29
+ }
30
+ destroy() {
31
+ super.destroy();
32
+ }
33
+ }
@@ -0,0 +1,17 @@
1
+ import { de_CreateWidgetCommand, se_CreateWidgetCommand, } 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 CreateWidgetCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "CreateWidget", {})
12
+ .n("KiteClient", "CreateWidgetCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_CreateWidgetCommand)
15
+ .de(de_CreateWidgetCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_DeleteWidgetCommand, se_DeleteWidgetCommand, } 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 DeleteWidgetCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "DeleteWidget", {})
12
+ .n("KiteClient", "DeleteWidgetCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_DeleteWidgetCommand)
15
+ .de(de_DeleteWidgetCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_GetConfigCommand, se_GetConfigCommand, } 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 GetConfigCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "GetConfig", {})
12
+ .n("KiteClient", "GetConfigCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_GetConfigCommand)
15
+ .de(de_GetConfigCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_GetWidgetCommand, se_GetWidgetCommand, } 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 GetWidgetCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "GetWidget", {})
12
+ .n("KiteClient", "GetWidgetCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_GetWidgetCommand)
15
+ .de(de_GetWidgetCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_ListServicesCommand, se_ListServicesCommand, } 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 ListServicesCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "ListServices", {})
12
+ .n("KiteClient", "ListServicesCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_ListServicesCommand)
15
+ .de(de_ListServicesCommand)
16
+ .build() {
17
+ }