@stacksjs/buddy 0.63.0 → 0.64.0

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 (73) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-12tkdbmy.js +7 -0
  3. package/dist/{chunk-8420n19j.js.map → chunk-12tkdbmy.js.map} +6 -5
  4. package/dist/chunk-1f6t66bt.js +5 -0
  5. package/dist/{chunk-1f1xhs02.js.map → chunk-1f6t66bt.js.map} +2 -2
  6. package/dist/chunk-463qxvjp.js +5 -0
  7. package/dist/{chunk-7jmyxm7k.js.map → chunk-463qxvjp.js.map} +2 -2
  8. package/dist/chunk-47n7wt6x.js +12 -0
  9. package/dist/{chunk-qx96ff3m.js.map → chunk-47n7wt6x.js.map} +2 -2
  10. package/dist/chunk-97kwnfsa.js +5 -0
  11. package/dist/{chunk-as72s87r.js.map → chunk-97kwnfsa.js.map} +2 -2
  12. package/dist/chunk-a8vj9csq.js +6 -0
  13. package/dist/{chunk-q2vnqdcs.js.map → chunk-a8vj9csq.js.map} +6 -6
  14. package/dist/chunk-b8124fjs.js +9 -0
  15. package/dist/{chunk-afhgv4v9.js.map → chunk-b8124fjs.js.map} +2 -2
  16. package/dist/chunk-cnvpbb2z.js +5 -0
  17. package/dist/{chunk-xhsvfzz8.js.map → chunk-cnvpbb2z.js.map} +4 -4
  18. package/dist/chunk-ehm10xxj.js +21 -0
  19. package/dist/{chunk-tegm7yex.js.map → chunk-ehm10xxj.js.map} +11 -15
  20. package/dist/chunk-f9qdyafb.js +5 -0
  21. package/dist/{chunk-582dnm6a.js.map → chunk-f9qdyafb.js.map} +5 -5
  22. package/dist/chunk-fcgh2sfr.js +5 -0
  23. package/dist/{chunk-mmbfc5ft.js.map → chunk-fcgh2sfr.js.map} +2 -2
  24. package/dist/chunk-fft99hka.js +4 -0
  25. package/dist/chunk-fft99hka.js.map +16 -0
  26. package/dist/chunk-g5tqs4wa.js +5 -0
  27. package/dist/{chunk-03ckp0m6.js.map → chunk-g5tqs4wa.js.map} +4 -4
  28. package/dist/chunk-gvpcxxae.js +5 -0
  29. package/dist/{chunk-6pac0yn5.js.map → chunk-gvpcxxae.js.map} +2 -2
  30. package/dist/chunk-hd0zdkj9.js +4 -0
  31. package/dist/{chunk-zzerxbrm.js.map → chunk-hd0zdkj9.js.map} +2 -2
  32. package/dist/chunk-hj9p7vjp.js +5 -0
  33. package/dist/{chunk-yrsms9d2.js.map → chunk-hj9p7vjp.js.map} +4 -4
  34. package/dist/chunk-hxzqmyb0.js +5 -0
  35. package/dist/{chunk-rt463pw6.js.map → chunk-hxzqmyb0.js.map} +2 -2
  36. package/dist/chunk-pabnt45p.js +5 -0
  37. package/dist/{chunk-nr24kzd1.js.map → chunk-pabnt45p.js.map} +2 -2
  38. package/dist/chunk-svr5ddhq.js +4 -0
  39. package/dist/{chunk-sc3etgb7.js.map → chunk-svr5ddhq.js.map} +2 -2
  40. package/dist/chunk-wmfxrbxe.js +5 -0
  41. package/dist/{chunk-cnvp47g4.js.map → chunk-wmfxrbxe.js.map} +1 -1
  42. package/dist/cli.js +2 -126
  43. package/dist/cli.js.map +3 -3
  44. package/dist/index.js +2 -84
  45. package/dist/index.js.map +1 -1
  46. package/dist/stacks +0 -0
  47. package/package.json +1 -46
  48. package/src/cli.ts +1 -0
  49. package/src/commands/build.ts +5 -4
  50. package/src/commands/index.ts +1 -0
  51. package/src/commands/make.ts +2 -2
  52. package/src/commands/outdated.ts +31 -0
  53. package/dist/chunk-03ckp0m6.js +0 -1222
  54. package/dist/chunk-1f1xhs02.js +0 -2223
  55. package/dist/chunk-582dnm6a.js +0 -664
  56. package/dist/chunk-6pac0yn5.js +0 -126
  57. package/dist/chunk-7jmyxm7k.js +0 -85
  58. package/dist/chunk-8217wvpy.js +0 -108
  59. package/dist/chunk-8217wvpy.js.map +0 -16
  60. package/dist/chunk-8420n19j.js +0 -7417
  61. package/dist/chunk-afhgv4v9.js +0 -164
  62. package/dist/chunk-as72s87r.js +0 -61
  63. package/dist/chunk-cnvp47g4.js +0 -22
  64. package/dist/chunk-mmbfc5ft.js +0 -287
  65. package/dist/chunk-nr24kzd1.js +0 -178
  66. package/dist/chunk-q2vnqdcs.js +0 -1696
  67. package/dist/chunk-qx96ff3m.js +0 -95
  68. package/dist/chunk-rt463pw6.js +0 -46
  69. package/dist/chunk-sc3etgb7.js +0 -208
  70. package/dist/chunk-tegm7yex.js +0 -10767
  71. package/dist/chunk-xhsvfzz8.js +0 -381
  72. package/dist/chunk-yrsms9d2.js +0 -1746
  73. package/dist/chunk-zzerxbrm.js +0 -110
@@ -1,1696 +0,0 @@
1
- import {
2
- __commonJS,
3
- __toESM
4
- } from "./chunk-cnvp47g4.js";
5
- import {
6
- require_dist_cjs
7
- } from "./chunk-6pac0yn5.js";
8
-
9
- // ../../../../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js
10
- var require_dist_cjs2 = __commonJS((exports, module) => {
11
- function fromHex(encoded) {
12
- if (encoded.length % 2 !== 0) {
13
- throw new Error("Hex encoded strings must have an even number length");
14
- }
15
- const out = new Uint8Array(encoded.length / 2);
16
- for (let i = 0;i < encoded.length; i += 2) {
17
- const encodedByte = encoded.slice(i, i + 2).toLowerCase();
18
- if (encodedByte in HEX_TO_SHORT) {
19
- out[i / 2] = HEX_TO_SHORT[encodedByte];
20
- } else {
21
- throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
22
- }
23
- }
24
- return out;
25
- }
26
- function toHex(bytes) {
27
- let out = "";
28
- for (let i = 0;i < bytes.byteLength; i++) {
29
- out += SHORT_TO_HEX[bytes[i]];
30
- }
31
- return out;
32
- }
33
- var __defProp = Object.defineProperty;
34
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
35
- var __getOwnPropNames = Object.getOwnPropertyNames;
36
- var __hasOwnProp = Object.prototype.hasOwnProperty;
37
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
38
- var __export = (target, all) => {
39
- for (var name in all)
40
- __defProp(target, name, { get: all[name], enumerable: true });
41
- };
42
- var __copyProps = (to, from, except, desc) => {
43
- if (from && typeof from === "object" || typeof from === "function") {
44
- for (let key of __getOwnPropNames(from))
45
- if (!__hasOwnProp.call(to, key) && key !== except)
46
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
47
- }
48
- return to;
49
- };
50
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
51
- var src_exports = {};
52
- __export(src_exports, {
53
- fromHex: () => fromHex,
54
- toHex: () => toHex
55
- });
56
- module.exports = __toCommonJS(src_exports);
57
- var SHORT_TO_HEX = {};
58
- var HEX_TO_SHORT = {};
59
- for (let i = 0;i < 256; i++) {
60
- let encodedByte = i.toString(16).toLowerCase();
61
- if (encodedByte.length === 1) {
62
- encodedByte = `0${encodedByte}`;
63
- }
64
- SHORT_TO_HEX[i] = encodedByte;
65
- HEX_TO_SHORT[encodedByte] = i;
66
- }
67
- __name(fromHex, "fromHex");
68
- __name(toHex, "toHex");
69
- });
70
-
71
- // ../../../../node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js
72
- var getAllAliases = (name, aliases) => {
73
- const _aliases = [];
74
- if (name) {
75
- _aliases.push(name);
76
- }
77
- if (aliases) {
78
- for (const alias of aliases) {
79
- _aliases.push(alias);
80
- }
81
- }
82
- return _aliases;
83
- };
84
- var getMiddlewareNameWithAliases = (name, aliases) => {
85
- return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
86
- };
87
- var constructStack = () => {
88
- let absoluteEntries = [];
89
- let relativeEntries = [];
90
- let identifyOnResolve = false;
91
- const entriesNameSet = new Set;
92
- const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]);
93
- const removeByName = (toRemove) => {
94
- let isRemoved = false;
95
- const filterCb = (entry) => {
96
- const aliases = getAllAliases(entry.name, entry.aliases);
97
- if (aliases.includes(toRemove)) {
98
- isRemoved = true;
99
- for (const alias of aliases) {
100
- entriesNameSet.delete(alias);
101
- }
102
- return false;
103
- }
104
- return true;
105
- };
106
- absoluteEntries = absoluteEntries.filter(filterCb);
107
- relativeEntries = relativeEntries.filter(filterCb);
108
- return isRemoved;
109
- };
110
- const removeByReference = (toRemove) => {
111
- let isRemoved = false;
112
- const filterCb = (entry) => {
113
- if (entry.middleware === toRemove) {
114
- isRemoved = true;
115
- for (const alias of getAllAliases(entry.name, entry.aliases)) {
116
- entriesNameSet.delete(alias);
117
- }
118
- return false;
119
- }
120
- return true;
121
- };
122
- absoluteEntries = absoluteEntries.filter(filterCb);
123
- relativeEntries = relativeEntries.filter(filterCb);
124
- return isRemoved;
125
- };
126
- const cloneTo = (toStack) => {
127
- absoluteEntries.forEach((entry) => {
128
- toStack.add(entry.middleware, { ...entry });
129
- });
130
- relativeEntries.forEach((entry) => {
131
- toStack.addRelativeTo(entry.middleware, { ...entry });
132
- });
133
- toStack.identifyOnResolve?.(stack.identifyOnResolve());
134
- return toStack;
135
- };
136
- const expandRelativeMiddlewareList = (from) => {
137
- const expandedMiddlewareList = [];
138
- from.before.forEach((entry) => {
139
- if (entry.before.length === 0 && entry.after.length === 0) {
140
- expandedMiddlewareList.push(entry);
141
- } else {
142
- expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
143
- }
144
- });
145
- expandedMiddlewareList.push(from);
146
- from.after.reverse().forEach((entry) => {
147
- if (entry.before.length === 0 && entry.after.length === 0) {
148
- expandedMiddlewareList.push(entry);
149
- } else {
150
- expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
151
- }
152
- });
153
- return expandedMiddlewareList;
154
- };
155
- const getMiddlewareList = (debug = false) => {
156
- const normalizedAbsoluteEntries = [];
157
- const normalizedRelativeEntries = [];
158
- const normalizedEntriesNameMap = {};
159
- absoluteEntries.forEach((entry) => {
160
- const normalizedEntry = {
161
- ...entry,
162
- before: [],
163
- after: []
164
- };
165
- for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
166
- normalizedEntriesNameMap[alias] = normalizedEntry;
167
- }
168
- normalizedAbsoluteEntries.push(normalizedEntry);
169
- });
170
- relativeEntries.forEach((entry) => {
171
- const normalizedEntry = {
172
- ...entry,
173
- before: [],
174
- after: []
175
- };
176
- for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
177
- normalizedEntriesNameMap[alias] = normalizedEntry;
178
- }
179
- normalizedRelativeEntries.push(normalizedEntry);
180
- });
181
- normalizedRelativeEntries.forEach((entry) => {
182
- if (entry.toMiddleware) {
183
- const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];
184
- if (toMiddleware === undefined) {
185
- if (debug) {
186
- return;
187
- }
188
- throw new Error(`${entry.toMiddleware} is not found when adding ` + `${getMiddlewareNameWithAliases(entry.name, entry.aliases)} ` + `middleware ${entry.relation} ${entry.toMiddleware}`);
189
- }
190
- if (entry.relation === "after") {
191
- toMiddleware.after.push(entry);
192
- }
193
- if (entry.relation === "before") {
194
- toMiddleware.before.push(entry);
195
- }
196
- }
197
- });
198
- const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => {
199
- wholeList.push(...expandedMiddlewareList);
200
- return wholeList;
201
- }, []);
202
- return mainChain;
203
- };
204
- const stack = {
205
- add: (middleware, options = {}) => {
206
- const { name, override, aliases: _aliases } = options;
207
- const entry = {
208
- step: "initialize",
209
- priority: "normal",
210
- middleware,
211
- ...options
212
- };
213
- const aliases = getAllAliases(name, _aliases);
214
- if (aliases.length > 0) {
215
- if (aliases.some((alias) => entriesNameSet.has(alias))) {
216
- if (!override)
217
- throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
218
- for (const alias of aliases) {
219
- const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
220
- if (toOverrideIndex === -1) {
221
- continue;
222
- }
223
- const toOverride = absoluteEntries[toOverrideIndex];
224
- if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {
225
- throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ` + `${toOverride.priority} priority in ${toOverride.step} step cannot ` + `be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ` + `${entry.priority} priority in ${entry.step} step.`);
226
- }
227
- absoluteEntries.splice(toOverrideIndex, 1);
228
- }
229
- }
230
- for (const alias of aliases) {
231
- entriesNameSet.add(alias);
232
- }
233
- }
234
- absoluteEntries.push(entry);
235
- },
236
- addRelativeTo: (middleware, options) => {
237
- const { name, override, aliases: _aliases } = options;
238
- const entry = {
239
- middleware,
240
- ...options
241
- };
242
- const aliases = getAllAliases(name, _aliases);
243
- if (aliases.length > 0) {
244
- if (aliases.some((alias) => entriesNameSet.has(alias))) {
245
- if (!override)
246
- throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
247
- for (const alias of aliases) {
248
- const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
249
- if (toOverrideIndex === -1) {
250
- continue;
251
- }
252
- const toOverride = relativeEntries[toOverrideIndex];
253
- if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {
254
- throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ` + `${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden ` + `by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} ` + `"${entry.toMiddleware}" middleware.`);
255
- }
256
- relativeEntries.splice(toOverrideIndex, 1);
257
- }
258
- }
259
- for (const alias of aliases) {
260
- entriesNameSet.add(alias);
261
- }
262
- }
263
- relativeEntries.push(entry);
264
- },
265
- clone: () => cloneTo(constructStack()),
266
- use: (plugin) => {
267
- plugin.applyToStack(stack);
268
- },
269
- remove: (toRemove) => {
270
- if (typeof toRemove === "string")
271
- return removeByName(toRemove);
272
- else
273
- return removeByReference(toRemove);
274
- },
275
- removeByTag: (toRemove) => {
276
- let isRemoved = false;
277
- const filterCb = (entry) => {
278
- const { tags, name, aliases: _aliases } = entry;
279
- if (tags && tags.includes(toRemove)) {
280
- const aliases = getAllAliases(name, _aliases);
281
- for (const alias of aliases) {
282
- entriesNameSet.delete(alias);
283
- }
284
- isRemoved = true;
285
- return false;
286
- }
287
- return true;
288
- };
289
- absoluteEntries = absoluteEntries.filter(filterCb);
290
- relativeEntries = relativeEntries.filter(filterCb);
291
- return isRemoved;
292
- },
293
- concat: (from) => {
294
- const cloned = cloneTo(constructStack());
295
- cloned.use(from);
296
- cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false));
297
- return cloned;
298
- },
299
- applyToStack: cloneTo,
300
- identify: () => {
301
- return getMiddlewareList(true).map((mw) => {
302
- const step = mw.step ?? mw.relation + " " + mw.toMiddleware;
303
- return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step;
304
- });
305
- },
306
- identifyOnResolve(toggle) {
307
- if (typeof toggle === "boolean")
308
- identifyOnResolve = toggle;
309
- return identifyOnResolve;
310
- },
311
- resolve: (handler, context) => {
312
- for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {
313
- handler = middleware(handler, context);
314
- }
315
- if (identifyOnResolve) {
316
- console.log(stack.identify());
317
- }
318
- return handler;
319
- }
320
- };
321
- return stack;
322
- };
323
- var stepWeights = {
324
- initialize: 5,
325
- serialize: 4,
326
- build: 3,
327
- finalizeRequest: 2,
328
- deserialize: 1
329
- };
330
- var priorityWeights = {
331
- high: 3,
332
- normal: 2,
333
- low: 1
334
- };
335
- // ../../../../node_modules/@smithy/smithy-client/dist-es/client.js
336
- class Client {
337
- constructor(config) {
338
- this.middlewareStack = constructStack();
339
- this.config = config;
340
- }
341
- send(command, optionsOrCb, cb) {
342
- const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined;
343
- const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
344
- const handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
345
- if (callback) {
346
- handler(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => {
347
- });
348
- } else {
349
- return handler(command).then((result) => result.output);
350
- }
351
- }
352
- destroy() {
353
- if (this.config.requestHandler.destroy)
354
- this.config.requestHandler.destroy();
355
- }
356
- }
357
-
358
- // ../../../../node_modules/@smithy/smithy-client/dist-es/command.js
359
- var types = __toESM(require_dist_cjs(), 1);
360
-
361
- class Command {
362
- constructor() {
363
- this.middlewareStack = constructStack();
364
- }
365
- static classBuilder() {
366
- return new ClassBuilder;
367
- }
368
- resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) {
369
- for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {
370
- this.middlewareStack.use(mw);
371
- }
372
- const stack = clientStack.concat(this.middlewareStack);
373
- const { logger } = configuration;
374
- const handlerExecutionContext = {
375
- logger,
376
- clientName,
377
- commandName,
378
- inputFilterSensitiveLog,
379
- outputFilterSensitiveLog,
380
- [types.SMITHY_CONTEXT_KEY]: {
381
- commandInstance: this,
382
- ...smithyContext
383
- },
384
- ...additionalContext
385
- };
386
- const { requestHandler } = configuration;
387
- return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
388
- }
389
- }
390
-
391
- class ClassBuilder {
392
- constructor() {
393
- this._init = () => {
394
- };
395
- this._ep = {};
396
- this._middlewareFn = () => [];
397
- this._commandName = "";
398
- this._clientName = "";
399
- this._additionalContext = {};
400
- this._smithyContext = {};
401
- this._inputFilterSensitiveLog = (_) => _;
402
- this._outputFilterSensitiveLog = (_) => _;
403
- this._serializer = null;
404
- this._deserializer = null;
405
- }
406
- init(cb) {
407
- this._init = cb;
408
- }
409
- ep(endpointParameterInstructions) {
410
- this._ep = endpointParameterInstructions;
411
- return this;
412
- }
413
- m(middlewareSupplier) {
414
- this._middlewareFn = middlewareSupplier;
415
- return this;
416
- }
417
- s(service, operation, smithyContext = {}) {
418
- this._smithyContext = {
419
- service,
420
- operation,
421
- ...smithyContext
422
- };
423
- return this;
424
- }
425
- c(additionalContext = {}) {
426
- this._additionalContext = additionalContext;
427
- return this;
428
- }
429
- n(clientName, commandName) {
430
- this._clientName = clientName;
431
- this._commandName = commandName;
432
- return this;
433
- }
434
- f(inputFilter = (_) => _, outputFilter = (_) => _) {
435
- this._inputFilterSensitiveLog = inputFilter;
436
- this._outputFilterSensitiveLog = outputFilter;
437
- return this;
438
- }
439
- ser(serializer) {
440
- this._serializer = serializer;
441
- return this;
442
- }
443
- de(deserializer) {
444
- this._deserializer = deserializer;
445
- return this;
446
- }
447
- build() {
448
- const closure = this;
449
- let CommandRef;
450
- return CommandRef = class extends Command {
451
- static getEndpointParameterInstructions() {
452
- return closure._ep;
453
- }
454
- constructor(...[input]) {
455
- super();
456
- this.serialize = closure._serializer;
457
- this.deserialize = closure._deserializer;
458
- this.input = input ?? {};
459
- closure._init(this);
460
- }
461
- resolveMiddleware(stack, configuration, options) {
462
- return this.resolveMiddlewareWithContext(stack, configuration, options, {
463
- CommandCtor: CommandRef,
464
- middlewareFn: closure._middlewareFn,
465
- clientName: closure._clientName,
466
- commandName: closure._commandName,
467
- inputFilterSensitiveLog: closure._inputFilterSensitiveLog,
468
- outputFilterSensitiveLog: closure._outputFilterSensitiveLog,
469
- smithyContext: closure._smithyContext,
470
- additionalContext: closure._additionalContext
471
- });
472
- }
473
- };
474
- }
475
- }
476
-
477
- // ../../../../node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js
478
- var getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
479
- let httpHandler = runtimeConfig.httpHandler;
480
- return {
481
- setHttpHandler(handler) {
482
- httpHandler = handler;
483
- },
484
- httpHandler() {
485
- return httpHandler;
486
- },
487
- updateHttpClientConfig(key, value) {
488
- httpHandler.updateHttpClientConfig(key, value);
489
- },
490
- httpHandlerConfigs() {
491
- return httpHandler.httpHandlerConfigs();
492
- }
493
- };
494
- };
495
- var resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
496
- return {
497
- httpHandler: httpHandlerExtensionConfiguration.httpHandler()
498
- };
499
- };
500
- // ../../../../node_modules/@smithy/protocol-http/dist-es/Field.js
501
- var types2 = __toESM(require_dist_cjs(), 1);
502
- // ../../../../node_modules/@smithy/protocol-http/dist-es/httpRequest.js
503
- function cloneQuery(query) {
504
- return Object.keys(query).reduce((carry, paramName) => {
505
- const param = query[paramName];
506
- return {
507
- ...carry,
508
- [paramName]: Array.isArray(param) ? [...param] : param
509
- };
510
- }, {});
511
- }
512
-
513
- class HttpRequest {
514
- constructor(options) {
515
- this.method = options.method || "GET";
516
- this.hostname = options.hostname || "localhost";
517
- this.port = options.port;
518
- this.query = options.query || {};
519
- this.headers = options.headers || {};
520
- this.body = options.body;
521
- this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:";
522
- this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/";
523
- this.username = options.username;
524
- this.password = options.password;
525
- this.fragment = options.fragment;
526
- }
527
- static clone(request) {
528
- const cloned = new HttpRequest({
529
- ...request,
530
- headers: { ...request.headers }
531
- });
532
- if (cloned.query) {
533
- cloned.query = cloneQuery(cloned.query);
534
- }
535
- return cloned;
536
- }
537
- static isInstance(request) {
538
- if (!request) {
539
- return false;
540
- }
541
- const req = request;
542
- return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
543
- }
544
- clone() {
545
- return HttpRequest.clone(this);
546
- }
547
- }
548
- // ../../../../node_modules/@smithy/protocol-http/dist-es/httpResponse.js
549
- class HttpResponse {
550
- constructor(options) {
551
- this.statusCode = options.statusCode;
552
- this.reason = options.reason;
553
- this.headers = options.headers || {};
554
- this.body = options.body;
555
- }
556
- static isInstance(response) {
557
- if (!response)
558
- return false;
559
- const resp = response;
560
- return typeof resp.statusCode === "number" && typeof resp.headers === "object";
561
- }
562
- }
563
- // ../../../../node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js
564
- var escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
565
- var hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;
566
- // ../../../../node_modules/@smithy/querystring-builder/dist-es/index.js
567
- function buildQueryString(query) {
568
- const parts = [];
569
- for (let key of Object.keys(query).sort()) {
570
- const value = query[key];
571
- key = escapeUri(key);
572
- if (Array.isArray(value)) {
573
- for (let i = 0, iLen = value.length;i < iLen; i++) {
574
- parts.push(`${key}=${escapeUri(value[i])}`);
575
- }
576
- } else {
577
- let qsEntry = key;
578
- if (value || typeof value === "string") {
579
- qsEntry += `=${escapeUri(value)}`;
580
- }
581
- parts.push(qsEntry);
582
- }
583
- }
584
- return parts.join("&");
585
- }
586
-
587
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js
588
- import {Agent as hAgent, request as hRequest} from "http";
589
- import {Agent as hsAgent, request as hsRequest} from "https";
590
-
591
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/constants.js
592
- var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
593
-
594
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js
595
- var getTransformedHeaders = (headers) => {
596
- const transformedHeaders = {};
597
- for (const name of Object.keys(headers)) {
598
- const headerValues = headers[name];
599
- transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
600
- }
601
- return transformedHeaders;
602
- };
603
-
604
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js
605
- var setConnectionTimeout = (request, reject, timeoutInMs = 0) => {
606
- if (!timeoutInMs) {
607
- return;
608
- }
609
- const timeoutId = setTimeout(() => {
610
- request.destroy();
611
- reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), {
612
- name: "TimeoutError"
613
- }));
614
- }, timeoutInMs);
615
- request.on("socket", (socket) => {
616
- if (socket.connecting) {
617
- socket.on("connect", () => {
618
- clearTimeout(timeoutId);
619
- });
620
- } else {
621
- clearTimeout(timeoutId);
622
- }
623
- });
624
- };
625
-
626
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js
627
- var setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => {
628
- if (keepAlive !== true) {
629
- return;
630
- }
631
- request.on("socket", (socket) => {
632
- socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
633
- });
634
- };
635
-
636
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js
637
- var setSocketTimeout = (request, reject, timeoutInMs = 0) => {
638
- request.setTimeout(timeoutInMs, () => {
639
- request.destroy();
640
- reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" }));
641
- });
642
- };
643
-
644
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/write-request-body.js
645
- import {Readable} from "stream";
646
- async function writeRequestBody(httpRequest2, request, maxContinueTimeoutMs = MIN_WAIT_TIME) {
647
- const headers = request.headers ?? {};
648
- const expect = headers["Expect"] || headers["expect"];
649
- let timeoutId = -1;
650
- let hasError = false;
651
- if (expect === "100-continue") {
652
- await Promise.race([
653
- new Promise((resolve) => {
654
- timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
655
- }),
656
- new Promise((resolve) => {
657
- httpRequest2.on("continue", () => {
658
- clearTimeout(timeoutId);
659
- resolve();
660
- });
661
- httpRequest2.on("error", () => {
662
- hasError = true;
663
- clearTimeout(timeoutId);
664
- resolve();
665
- });
666
- })
667
- ]);
668
- }
669
- if (!hasError) {
670
- writeBody(httpRequest2, request.body);
671
- }
672
- }
673
- function writeBody(httpRequest2, body) {
674
- if (body instanceof Readable) {
675
- body.pipe(httpRequest2);
676
- return;
677
- }
678
- if (body) {
679
- if (Buffer.isBuffer(body) || typeof body === "string") {
680
- httpRequest2.end(body);
681
- return;
682
- }
683
- const uint8 = body;
684
- if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") {
685
- httpRequest2.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));
686
- return;
687
- }
688
- httpRequest2.end(Buffer.from(body));
689
- return;
690
- }
691
- httpRequest2.end();
692
- }
693
- var MIN_WAIT_TIME = 1000;
694
-
695
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js
696
- class NodeHttpHandler {
697
- static create(instanceOrOptions) {
698
- if (typeof instanceOrOptions?.handle === "function") {
699
- return instanceOrOptions;
700
- }
701
- return new NodeHttpHandler(instanceOrOptions);
702
- }
703
- static checkSocketUsage(agent, socketWarningTimestamp, logger = console) {
704
- const { sockets, requests, maxSockets } = agent;
705
- if (typeof maxSockets !== "number" || maxSockets === Infinity) {
706
- return socketWarningTimestamp;
707
- }
708
- const interval = 15000;
709
- if (Date.now() - interval < socketWarningTimestamp) {
710
- return socketWarningTimestamp;
711
- }
712
- if (sockets && requests) {
713
- for (const origin in sockets) {
714
- const socketsInUse = sockets[origin]?.length ?? 0;
715
- const requestsEnqueued = requests[origin]?.length ?? 0;
716
- if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
717
- logger?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
718
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
719
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`);
720
- return Date.now();
721
- }
722
- }
723
- }
724
- return socketWarningTimestamp;
725
- }
726
- constructor(options) {
727
- this.socketWarningTimestamp = 0;
728
- this.metadata = { handlerProtocol: "http/1.1" };
729
- this.configProvider = new Promise((resolve, reject) => {
730
- if (typeof options === "function") {
731
- options().then((_options) => {
732
- resolve(this.resolveDefaultConfig(_options));
733
- }).catch(reject);
734
- } else {
735
- resolve(this.resolveDefaultConfig(options));
736
- }
737
- });
738
- }
739
- resolveDefaultConfig(options) {
740
- const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {};
741
- const keepAlive = true;
742
- const maxSockets = 50;
743
- return {
744
- connectionTimeout,
745
- requestTimeout: requestTimeout ?? socketTimeout,
746
- httpAgent: (() => {
747
- if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") {
748
- return httpAgent;
749
- }
750
- return new hAgent({ keepAlive, maxSockets, ...httpAgent });
751
- })(),
752
- httpsAgent: (() => {
753
- if (httpsAgent instanceof hsAgent || typeof httpsAgent?.destroy === "function") {
754
- return httpsAgent;
755
- }
756
- return new hsAgent({ keepAlive, maxSockets, ...httpsAgent });
757
- })(),
758
- logger: console
759
- };
760
- }
761
- destroy() {
762
- this.config?.httpAgent?.destroy();
763
- this.config?.httpsAgent?.destroy();
764
- }
765
- async handle(request, { abortSignal } = {}) {
766
- if (!this.config) {
767
- this.config = await this.configProvider;
768
- }
769
- let socketCheckTimeoutId;
770
- return new Promise((_resolve, _reject) => {
771
- let writeRequestBodyPromise = undefined;
772
- const resolve = async (arg) => {
773
- await writeRequestBodyPromise;
774
- clearTimeout(socketCheckTimeoutId);
775
- _resolve(arg);
776
- };
777
- const reject = async (arg) => {
778
- await writeRequestBodyPromise;
779
- clearTimeout(socketCheckTimeoutId);
780
- _reject(arg);
781
- };
782
- if (!this.config) {
783
- throw new Error("Node HTTP request handler config is not resolved");
784
- }
785
- if (abortSignal?.aborted) {
786
- const abortError = new Error("Request aborted");
787
- abortError.name = "AbortError";
788
- reject(abortError);
789
- return;
790
- }
791
- const isSSL = request.protocol === "https:";
792
- const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;
793
- socketCheckTimeoutId = setTimeout(() => {
794
- this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, this.config.logger);
795
- }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2000) + (this.config.connectionTimeout ?? 1000));
796
- const queryString = buildQueryString(request.query || {});
797
- let auth = undefined;
798
- if (request.username != null || request.password != null) {
799
- const username = request.username ?? "";
800
- const password = request.password ?? "";
801
- auth = `${username}:${password}`;
802
- }
803
- let path = request.path;
804
- if (queryString) {
805
- path += `?${queryString}`;
806
- }
807
- if (request.fragment) {
808
- path += `#${request.fragment}`;
809
- }
810
- const nodeHttpsOptions = {
811
- headers: request.headers,
812
- host: request.hostname,
813
- method: request.method,
814
- path,
815
- port: request.port,
816
- agent,
817
- auth
818
- };
819
- const requestFunc = isSSL ? hsRequest : hRequest;
820
- const req = requestFunc(nodeHttpsOptions, (res) => {
821
- const httpResponse2 = new HttpResponse({
822
- statusCode: res.statusCode || -1,
823
- reason: res.statusMessage,
824
- headers: getTransformedHeaders(res.headers),
825
- body: res
826
- });
827
- resolve({ response: httpResponse2 });
828
- });
829
- req.on("error", (err) => {
830
- if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
831
- reject(Object.assign(err, { name: "TimeoutError" }));
832
- } else {
833
- reject(err);
834
- }
835
- });
836
- setConnectionTimeout(req, reject, this.config.connectionTimeout);
837
- setSocketTimeout(req, reject, this.config.requestTimeout);
838
- if (abortSignal) {
839
- const onAbort = () => {
840
- req.destroy();
841
- const abortError = new Error("Request aborted");
842
- abortError.name = "AbortError";
843
- reject(abortError);
844
- };
845
- if (typeof abortSignal.addEventListener === "function") {
846
- const signal = abortSignal;
847
- signal.addEventListener("abort", onAbort, { once: true });
848
- req.once("close", () => signal.removeEventListener("abort", onAbort));
849
- } else {
850
- abortSignal.onabort = onAbort;
851
- }
852
- }
853
- const httpAgent = nodeHttpsOptions.agent;
854
- if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
855
- setSocketKeepAlive(req, {
856
- keepAlive: httpAgent.keepAlive,
857
- keepAliveMsecs: httpAgent.keepAliveMsecs
858
- });
859
- }
860
- writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch((e) => {
861
- clearTimeout(socketCheckTimeoutId);
862
- return _reject(e);
863
- });
864
- });
865
- }
866
- updateHttpClientConfig(key, value) {
867
- this.config = undefined;
868
- this.configProvider = this.configProvider.then((config) => {
869
- return {
870
- ...config,
871
- [key]: value
872
- };
873
- });
874
- }
875
- httpHandlerConfigs() {
876
- return this.config ?? {};
877
- }
878
- }
879
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js
880
- import {Writable} from "stream";
881
-
882
- class Collector extends Writable {
883
- constructor() {
884
- super(...arguments);
885
- this.bufferedBytes = [];
886
- }
887
- _write(chunk, encoding, callback) {
888
- this.bufferedBytes.push(chunk);
889
- callback();
890
- }
891
- }
892
-
893
- // ../../../../node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js
894
- async function collectReadableStream(stream) {
895
- const chunks = [];
896
- const reader = stream.getReader();
897
- let isDone = false;
898
- let length = 0;
899
- while (!isDone) {
900
- const { done, value } = await reader.read();
901
- if (value) {
902
- chunks.push(value);
903
- length += value.length;
904
- }
905
- isDone = done;
906
- }
907
- const collected = new Uint8Array(length);
908
- let offset = 0;
909
- for (const chunk of chunks) {
910
- collected.set(chunk, offset);
911
- offset += chunk.length;
912
- }
913
- return collected;
914
- }
915
- var streamCollector = (stream) => {
916
- if (isReadableStreamInstance(stream)) {
917
- return collectReadableStream(stream);
918
- }
919
- return new Promise((resolve, reject) => {
920
- const collector2 = new Collector;
921
- stream.pipe(collector2);
922
- stream.on("error", (err) => {
923
- collector2.end();
924
- reject(err);
925
- });
926
- collector2.on("error", reject);
927
- collector2.on("finish", function() {
928
- const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
929
- resolve(bytes);
930
- });
931
- });
932
- };
933
- var isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
934
- // ../../../../node_modules/@smithy/smithy-client/dist-es/constants.js
935
- var SENSITIVE_STRING = "***SensitiveInformation***";
936
-
937
- // ../../../../node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js
938
- var createAggregatedClient = (commands, Client2) => {
939
- for (const command of Object.keys(commands)) {
940
- const CommandCtor = commands[command];
941
- const methodImpl = async function(args, optionsOrCb, cb) {
942
- const command2 = new CommandCtor(args);
943
- if (typeof optionsOrCb === "function") {
944
- this.send(command2, optionsOrCb);
945
- } else if (typeof cb === "function") {
946
- if (typeof optionsOrCb !== "object")
947
- throw new Error(`Expected http options but got ${typeof optionsOrCb}`);
948
- this.send(command2, optionsOrCb || {}, cb);
949
- } else {
950
- return this.send(command2, optionsOrCb);
951
- }
952
- };
953
- const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
954
- Client2.prototype[methodName] = methodImpl;
955
- }
956
- };
957
-
958
- // ../../../../node_modules/@smithy/smithy-client/dist-es/exceptions.js
959
- class ServiceException extends Error {
960
- constructor(options) {
961
- super(options.message);
962
- Object.setPrototypeOf(this, ServiceException.prototype);
963
- this.name = options.name;
964
- this.$fault = options.$fault;
965
- this.$metadata = options.$metadata;
966
- }
967
- }
968
- var decorateServiceException = (exception, additions = {}) => {
969
- Object.entries(additions).filter(([, v]) => v !== undefined).forEach(([k, v]) => {
970
- if (exception[k] == undefined || exception[k] === "") {
971
- exception[k] = v;
972
- }
973
- });
974
- const message = exception.message || exception.Message || "UnknownError";
975
- exception.message = message;
976
- delete exception.Message;
977
- return exception;
978
- };
979
-
980
- // ../../../../node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js
981
- class NoOpLogger {
982
- trace() {
983
- }
984
- debug() {
985
- }
986
- info() {
987
- }
988
- warn() {
989
- }
990
- error() {
991
- }
992
- }
993
- // ../../../../node_modules/@smithy/is-array-buffer/dist-es/index.js
994
- var isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
995
-
996
- // ../../../../node_modules/@smithy/util-buffer-from/dist-es/index.js
997
- import {Buffer as Buffer2} from "buffer";
998
- var fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
999
- if (!isArrayBuffer(input)) {
1000
- throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
1001
- }
1002
- return Buffer2.from(input, offset, length);
1003
- };
1004
- var fromString = (input, encoding) => {
1005
- if (typeof input !== "string") {
1006
- throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
1007
- }
1008
- return encoding ? Buffer2.from(input, encoding) : Buffer2.from(input);
1009
- };
1010
-
1011
- // ../../../../node_modules/@smithy/util-base64/dist-es/fromBase64.js
1012
- var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
1013
- var fromBase64 = (input) => {
1014
- if (input.length * 3 % 4 !== 0) {
1015
- throw new TypeError(`Incorrect padding on base64 string.`);
1016
- }
1017
- if (!BASE64_REGEX.exec(input)) {
1018
- throw new TypeError(`Invalid base64 string.`);
1019
- }
1020
- const buffer = fromString(input, "base64");
1021
- return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
1022
- };
1023
- // ../../../../node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
1024
- var fromUtf8 = (input) => {
1025
- const buf = fromString(input, "utf8");
1026
- return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
1027
- };
1028
- // ../../../../node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
1029
- var toUint8Array = (data) => {
1030
- if (typeof data === "string") {
1031
- return fromUtf8(data);
1032
- }
1033
- if (ArrayBuffer.isView(data)) {
1034
- return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
1035
- }
1036
- return new Uint8Array(data);
1037
- };
1038
- // ../../../../node_modules/@smithy/util-utf8/dist-es/toUtf8.js
1039
- var toUtf8 = (input) => {
1040
- if (typeof input === "string") {
1041
- return input;
1042
- }
1043
- if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
1044
- throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
1045
- }
1046
- return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
1047
- };
1048
- // ../../../../node_modules/@smithy/util-base64/dist-es/toBase64.js
1049
- var toBase64 = (_input) => {
1050
- let input;
1051
- if (typeof _input === "string") {
1052
- input = fromUtf8(_input);
1053
- } else {
1054
- input = _input;
1055
- }
1056
- if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
1057
- throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
1058
- }
1059
- return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64");
1060
- };
1061
- // ../../../../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
1062
- import {Readable as Readable2} from "stream";
1063
- import {TextDecoder as TextDecoder2} from "util";
1064
- // ../../../../node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js
1065
- async function collectBlob(blob) {
1066
- const base64 = await readToBase64(blob);
1067
- const arrayBuffer = fromBase64(base64);
1068
- return new Uint8Array(arrayBuffer);
1069
- }
1070
- async function collectStream(stream) {
1071
- const chunks = [];
1072
- const reader = stream.getReader();
1073
- let isDone = false;
1074
- let length = 0;
1075
- while (!isDone) {
1076
- const { done, value } = await reader.read();
1077
- if (value) {
1078
- chunks.push(value);
1079
- length += value.length;
1080
- }
1081
- isDone = done;
1082
- }
1083
- const collected = new Uint8Array(length);
1084
- let offset = 0;
1085
- for (const chunk of chunks) {
1086
- collected.set(chunk, offset);
1087
- offset += chunk.length;
1088
- }
1089
- return collected;
1090
- }
1091
- function readToBase64(blob) {
1092
- return new Promise((resolve, reject) => {
1093
- const reader = new FileReader;
1094
- reader.onloadend = () => {
1095
- if (reader.readyState !== 2) {
1096
- return reject(new Error("Reader aborted too early"));
1097
- }
1098
- const result = reader.result ?? "";
1099
- const commaIndex = result.indexOf(",");
1100
- const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
1101
- resolve(result.substring(dataOffset));
1102
- };
1103
- reader.onabort = () => reject(new Error("Read aborted"));
1104
- reader.onerror = () => reject(reader.error);
1105
- reader.readAsDataURL(blob);
1106
- });
1107
- }
1108
- var streamCollector2 = (stream) => {
1109
- if (typeof Blob === "function" && stream instanceof Blob) {
1110
- return collectBlob(stream);
1111
- }
1112
- return collectStream(stream);
1113
- };
1114
- // ../../../../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js
1115
- var util_hex_encoding = __toESM(require_dist_cjs2(), 1);
1116
-
1117
- // ../../../../node_modules/@smithy/util-stream/dist-es/stream-type-check.js
1118
- var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
1119
-
1120
- // ../../../../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js
1121
- var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
1122
- var sdkStreamMixin = (stream) => {
1123
- if (!isBlobInstance(stream) && !isReadableStream(stream)) {
1124
- const name = stream?.__proto__?.constructor?.name || stream;
1125
- throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
1126
- }
1127
- let transformed = false;
1128
- const transformToByteArray = async () => {
1129
- if (transformed) {
1130
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
1131
- }
1132
- transformed = true;
1133
- return await streamCollector2(stream);
1134
- };
1135
- const blobToWebStream = (blob) => {
1136
- if (typeof blob.stream !== "function") {
1137
- throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\n" + "If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
1138
- }
1139
- return blob.stream();
1140
- };
1141
- return Object.assign(stream, {
1142
- transformToByteArray,
1143
- transformToString: async (encoding) => {
1144
- const buf = await transformToByteArray();
1145
- if (encoding === "base64") {
1146
- return toBase64(buf);
1147
- } else if (encoding === "hex") {
1148
- return util_hex_encoding.toHex(buf);
1149
- } else if (encoding === undefined || encoding === "utf8" || encoding === "utf-8") {
1150
- return toUtf8(buf);
1151
- } else if (typeof TextDecoder === "function") {
1152
- return new TextDecoder(encoding).decode(buf);
1153
- } else {
1154
- throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
1155
- }
1156
- },
1157
- transformToWebStream: () => {
1158
- if (transformed) {
1159
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
1160
- }
1161
- transformed = true;
1162
- if (isBlobInstance(stream)) {
1163
- return blobToWebStream(stream);
1164
- } else if (isReadableStream(stream)) {
1165
- return stream;
1166
- } else {
1167
- throw new Error(`Cannot transform payload to web stream, got ${stream}`);
1168
- }
1169
- }
1170
- });
1171
- };
1172
- var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
1173
-
1174
- // ../../../../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
1175
- var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2 = "The stream has already been transformed.";
1176
- var sdkStreamMixin2 = (stream) => {
1177
- if (!(stream instanceof Readable2)) {
1178
- try {
1179
- return sdkStreamMixin(stream);
1180
- } catch (e) {
1181
- const name = stream?.__proto__?.constructor?.name || stream;
1182
- throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
1183
- }
1184
- }
1185
- let transformed = false;
1186
- const transformToByteArray = async () => {
1187
- if (transformed) {
1188
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
1189
- }
1190
- transformed = true;
1191
- return await streamCollector(stream);
1192
- };
1193
- return Object.assign(stream, {
1194
- transformToByteArray,
1195
- transformToString: async (encoding) => {
1196
- const buf = await transformToByteArray();
1197
- if (encoding === undefined || Buffer.isEncoding(encoding)) {
1198
- return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
1199
- } else {
1200
- const decoder = new TextDecoder2(encoding);
1201
- return decoder.decode(buf);
1202
- }
1203
- },
1204
- transformToWebStream: () => {
1205
- if (transformed) {
1206
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
1207
- }
1208
- if (stream.readableFlowing !== null) {
1209
- throw new Error("The stream has been consumed by other callbacks.");
1210
- }
1211
- if (typeof Readable2.toWeb !== "function") {
1212
- throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");
1213
- }
1214
- transformed = true;
1215
- return Readable2.toWeb(stream);
1216
- }
1217
- });
1218
- };
1219
- // ../../../../node_modules/@smithy/smithy-client/dist-es/parse-utils.js
1220
- var expectNumber = (value) => {
1221
- if (value === null || value === undefined) {
1222
- return;
1223
- }
1224
- if (typeof value === "string") {
1225
- const parsed = parseFloat(value);
1226
- if (!Number.isNaN(parsed)) {
1227
- if (String(parsed) !== String(value)) {
1228
- logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
1229
- }
1230
- return parsed;
1231
- }
1232
- }
1233
- if (typeof value === "number") {
1234
- return value;
1235
- }
1236
- throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
1237
- };
1238
- var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
1239
- var expectFloat32 = (value) => {
1240
- const expected = expectNumber(value);
1241
- if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
1242
- if (Math.abs(expected) > MAX_FLOAT) {
1243
- throw new TypeError(`Expected 32-bit float, got ${value}`);
1244
- }
1245
- }
1246
- return expected;
1247
- };
1248
- var expectLong = (value) => {
1249
- if (value === null || value === undefined) {
1250
- return;
1251
- }
1252
- if (Number.isInteger(value) && !Number.isNaN(value)) {
1253
- return value;
1254
- }
1255
- throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
1256
- };
1257
- var expectInt32 = (value) => expectSizedInt(value, 32);
1258
- var expectShort = (value) => expectSizedInt(value, 16);
1259
- var expectByte = (value) => expectSizedInt(value, 8);
1260
- var expectSizedInt = (value, size) => {
1261
- const expected = expectLong(value);
1262
- if (expected !== undefined && castInt(expected, size) !== expected) {
1263
- throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
1264
- }
1265
- return expected;
1266
- };
1267
- var castInt = (value, size) => {
1268
- switch (size) {
1269
- case 32:
1270
- return Int32Array.of(value)[0];
1271
- case 16:
1272
- return Int16Array.of(value)[0];
1273
- case 8:
1274
- return Int8Array.of(value)[0];
1275
- }
1276
- };
1277
- var expectNonNull = (value, location) => {
1278
- if (value === null || value === undefined) {
1279
- if (location) {
1280
- throw new TypeError(`Expected a non-null value for ${location}`);
1281
- }
1282
- throw new TypeError("Expected a non-null value");
1283
- }
1284
- return value;
1285
- };
1286
- var expectObject = (value) => {
1287
- if (value === null || value === undefined) {
1288
- return;
1289
- }
1290
- if (typeof value === "object" && !Array.isArray(value)) {
1291
- return value;
1292
- }
1293
- const receivedType = Array.isArray(value) ? "array" : typeof value;
1294
- throw new TypeError(`Expected object, got ${receivedType}: ${value}`);
1295
- };
1296
- var expectString = (value) => {
1297
- if (value === null || value === undefined) {
1298
- return;
1299
- }
1300
- if (typeof value === "string") {
1301
- return value;
1302
- }
1303
- if (["boolean", "number", "bigint"].includes(typeof value)) {
1304
- logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
1305
- return String(value);
1306
- }
1307
- throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
1308
- };
1309
- var strictParseFloat32 = (value) => {
1310
- if (typeof value == "string") {
1311
- return expectFloat32(parseNumber(value));
1312
- }
1313
- return expectFloat32(value);
1314
- };
1315
- var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
1316
- var parseNumber = (value) => {
1317
- const matches = value.match(NUMBER_REGEX);
1318
- if (matches === null || matches[0].length !== value.length) {
1319
- throw new TypeError(`Expected real number, got implicit NaN`);
1320
- }
1321
- return parseFloat(value);
1322
- };
1323
- var strictParseInt32 = (value) => {
1324
- if (typeof value === "string") {
1325
- return expectInt32(parseNumber(value));
1326
- }
1327
- return expectInt32(value);
1328
- };
1329
- var strictParseShort = (value) => {
1330
- if (typeof value === "string") {
1331
- return expectShort(parseNumber(value));
1332
- }
1333
- return expectShort(value);
1334
- };
1335
- var strictParseByte = (value) => {
1336
- if (typeof value === "string") {
1337
- return expectByte(parseNumber(value));
1338
- }
1339
- return expectByte(value);
1340
- };
1341
- var stackTraceWarning = (message) => {
1342
- return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n");
1343
- };
1344
- var logger = {
1345
- warn: console.warn
1346
- };
1347
-
1348
- // ../../../../node_modules/@smithy/smithy-client/dist-es/date-utils.js
1349
- var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1350
- var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
1351
- var parseRfc3339DateTime = (value) => {
1352
- if (value === null || value === undefined) {
1353
- return;
1354
- }
1355
- if (typeof value !== "string") {
1356
- throw new TypeError("RFC-3339 date-times must be expressed as strings");
1357
- }
1358
- const match = RFC3339.exec(value);
1359
- if (!match) {
1360
- throw new TypeError("Invalid RFC-3339 date-time value");
1361
- }
1362
- const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
1363
- const year = strictParseShort(stripLeadingZeroes(yearStr));
1364
- const month = parseDateValue(monthStr, "month", 1, 12);
1365
- const day = parseDateValue(dayStr, "day", 1, 31);
1366
- return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
1367
- };
1368
- var RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
1369
- var parseRfc3339DateTimeWithOffset = (value) => {
1370
- if (value === null || value === undefined) {
1371
- return;
1372
- }
1373
- if (typeof value !== "string") {
1374
- throw new TypeError("RFC-3339 date-times must be expressed as strings");
1375
- }
1376
- const match = RFC3339_WITH_OFFSET.exec(value);
1377
- if (!match) {
1378
- throw new TypeError("Invalid RFC-3339 date-time value");
1379
- }
1380
- const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;
1381
- const year = strictParseShort(stripLeadingZeroes(yearStr));
1382
- const month = parseDateValue(monthStr, "month", 1, 12);
1383
- const day = parseDateValue(dayStr, "day", 1, 31);
1384
- const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
1385
- if (offsetStr.toUpperCase() != "Z") {
1386
- date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));
1387
- }
1388
- return date;
1389
- };
1390
- var IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
1391
- var RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
1392
- var ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);
1393
- var buildDate = (year, month, day, time) => {
1394
- const adjustedMonth = month - 1;
1395
- validateDayOfMonth(year, adjustedMonth, day);
1396
- return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds)));
1397
- };
1398
- var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000;
1399
- var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1400
- var validateDayOfMonth = (year, month, day) => {
1401
- let maxDays = DAYS_IN_MONTH[month];
1402
- if (month === 1 && isLeapYear(year)) {
1403
- maxDays = 29;
1404
- }
1405
- if (day > maxDays) {
1406
- throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);
1407
- }
1408
- };
1409
- var isLeapYear = (year) => {
1410
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
1411
- };
1412
- var parseDateValue = (value, type, lower, upper) => {
1413
- const dateVal = strictParseByte(stripLeadingZeroes(value));
1414
- if (dateVal < lower || dateVal > upper) {
1415
- throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
1416
- }
1417
- return dateVal;
1418
- };
1419
- var parseMilliseconds = (value) => {
1420
- if (value === null || value === undefined) {
1421
- return 0;
1422
- }
1423
- return strictParseFloat32("0." + value) * 1000;
1424
- };
1425
- var parseOffsetToMilliseconds = (value) => {
1426
- const directionStr = value[0];
1427
- let direction = 1;
1428
- if (directionStr == "+") {
1429
- direction = 1;
1430
- } else if (directionStr == "-") {
1431
- direction = -1;
1432
- } else {
1433
- throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
1434
- }
1435
- const hour = Number(value.substring(1, 3));
1436
- const minute = Number(value.substring(4, 6));
1437
- return direction * (hour * 60 + minute) * 60 * 1000;
1438
- };
1439
- var stripLeadingZeroes = (value) => {
1440
- let idx = 0;
1441
- while (idx < value.length - 1 && value.charAt(idx) === "0") {
1442
- idx++;
1443
- }
1444
- if (idx === 0) {
1445
- return value;
1446
- }
1447
- return value.slice(idx);
1448
- };
1449
- // ../../../../node_modules/@smithy/smithy-client/dist-es/default-error-handler.js
1450
- var throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => {
1451
- const $metadata = deserializeMetadata(output);
1452
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1453
- const response = new exceptionCtor({
1454
- name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError",
1455
- $fault: "client",
1456
- $metadata
1457
- });
1458
- throw decorateServiceException(response, parsedBody);
1459
- };
1460
- var withBaseException = (ExceptionCtor) => {
1461
- return ({ output, parsedBody, errorCode }) => {
1462
- throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode });
1463
- };
1464
- };
1465
- var deserializeMetadata = (output) => ({
1466
- httpStatusCode: output.statusCode,
1467
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1468
- extendedRequestId: output.headers["x-amz-id-2"],
1469
- cfId: output.headers["x-amz-cf-id"]
1470
- });
1471
- // ../../../../node_modules/@smithy/smithy-client/dist-es/defaults-mode.js
1472
- var loadConfigsForDefaultMode = (mode) => {
1473
- switch (mode) {
1474
- case "standard":
1475
- return {
1476
- retryMode: "standard",
1477
- connectionTimeout: 3100
1478
- };
1479
- case "in-region":
1480
- return {
1481
- retryMode: "standard",
1482
- connectionTimeout: 1100
1483
- };
1484
- case "cross-region":
1485
- return {
1486
- retryMode: "standard",
1487
- connectionTimeout: 3100
1488
- };
1489
- case "mobile":
1490
- return {
1491
- retryMode: "standard",
1492
- connectionTimeout: 30000
1493
- };
1494
- default:
1495
- return {};
1496
- }
1497
- };
1498
- // ../../../../node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js
1499
- var warningEmitted = false;
1500
- var emitWarningIfUnsupportedVersion = (version) => {
1501
- if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
1502
- warningEmitted = true;
1503
- }
1504
- };
1505
- // ../../../../node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js
1506
- var types4 = __toESM(require_dist_cjs(), 1);
1507
- var getChecksumConfiguration = (runtimeConfig) => {
1508
- const checksumAlgorithms = [];
1509
- for (const id in types4.AlgorithmId) {
1510
- const algorithmId = types4.AlgorithmId[id];
1511
- if (runtimeConfig[algorithmId] === undefined) {
1512
- continue;
1513
- }
1514
- checksumAlgorithms.push({
1515
- algorithmId: () => algorithmId,
1516
- checksumConstructor: () => runtimeConfig[algorithmId]
1517
- });
1518
- }
1519
- return {
1520
- _checksumAlgorithms: checksumAlgorithms,
1521
- addChecksumAlgorithm(algo) {
1522
- this._checksumAlgorithms.push(algo);
1523
- },
1524
- checksumAlgorithms() {
1525
- return this._checksumAlgorithms;
1526
- }
1527
- };
1528
- };
1529
- var resolveChecksumRuntimeConfig = (clientConfig) => {
1530
- const runtimeConfig = {};
1531
- clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
1532
- runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
1533
- });
1534
- return runtimeConfig;
1535
- };
1536
-
1537
- // ../../../../node_modules/@smithy/smithy-client/dist-es/extensions/retry.js
1538
- var getRetryConfiguration = (runtimeConfig) => {
1539
- let _retryStrategy = runtimeConfig.retryStrategy;
1540
- return {
1541
- setRetryStrategy(retryStrategy) {
1542
- _retryStrategy = retryStrategy;
1543
- },
1544
- retryStrategy() {
1545
- return _retryStrategy;
1546
- }
1547
- };
1548
- };
1549
- var resolveRetryRuntimeConfig = (retryStrategyConfiguration) => {
1550
- const runtimeConfig = {};
1551
- runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();
1552
- return runtimeConfig;
1553
- };
1554
-
1555
- // ../../../../node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js
1556
- var getDefaultExtensionConfiguration = (runtimeConfig) => {
1557
- return {
1558
- ...getChecksumConfiguration(runtimeConfig),
1559
- ...getRetryConfiguration(runtimeConfig)
1560
- };
1561
- };
1562
- var resolveDefaultRuntimeConfig = (config) => {
1563
- return {
1564
- ...resolveChecksumRuntimeConfig(config),
1565
- ...resolveRetryRuntimeConfig(config)
1566
- };
1567
- };
1568
- // ../../../../node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js
1569
- function extendedEncodeURIComponent(str) {
1570
- return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
1571
- return "%" + c.charCodeAt(0).toString(16).toUpperCase();
1572
- });
1573
- }
1574
- // ../../../../node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js
1575
- var getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray];
1576
- // ../../../../node_modules/@smithy/smithy-client/dist-es/lazy-json.js
1577
- var StringWrapper = function() {
1578
- const Class = Object.getPrototypeOf(this).constructor;
1579
- const Constructor = Function.bind.apply(String, [null, ...arguments]);
1580
- const instance = new Constructor;
1581
- Object.setPrototypeOf(instance, Class.prototype);
1582
- return instance;
1583
- };
1584
- StringWrapper.prototype = Object.create(String.prototype, {
1585
- constructor: {
1586
- value: StringWrapper,
1587
- enumerable: false,
1588
- writable: true,
1589
- configurable: true
1590
- }
1591
- });
1592
- Object.setPrototypeOf(StringWrapper, String);
1593
- // ../../../../node_modules/@smithy/smithy-client/dist-es/object-mapping.js
1594
- function map(arg0, arg1, arg2) {
1595
- let target;
1596
- let filter;
1597
- let instructions;
1598
- if (typeof arg1 === "undefined" && typeof arg2 === "undefined") {
1599
- target = {};
1600
- instructions = arg0;
1601
- } else {
1602
- target = arg0;
1603
- if (typeof arg1 === "function") {
1604
- filter = arg1;
1605
- instructions = arg2;
1606
- return mapWithFilter(target, filter, instructions);
1607
- } else {
1608
- instructions = arg1;
1609
- }
1610
- }
1611
- for (const key of Object.keys(instructions)) {
1612
- if (!Array.isArray(instructions[key])) {
1613
- target[key] = instructions[key];
1614
- continue;
1615
- }
1616
- applyInstruction(target, null, instructions, key);
1617
- }
1618
- return target;
1619
- }
1620
- var take = (source, instructions) => {
1621
- const out = {};
1622
- for (const key in instructions) {
1623
- applyInstruction(out, source, instructions, key);
1624
- }
1625
- return out;
1626
- };
1627
- var mapWithFilter = (target, filter, instructions) => {
1628
- return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => {
1629
- if (Array.isArray(value)) {
1630
- _instructions[key] = value;
1631
- } else {
1632
- if (typeof value === "function") {
1633
- _instructions[key] = [filter, value()];
1634
- } else {
1635
- _instructions[key] = [filter, value];
1636
- }
1637
- }
1638
- return _instructions;
1639
- }, {}));
1640
- };
1641
- var applyInstruction = (target, source, instructions, targetKey) => {
1642
- if (source !== null) {
1643
- let instruction = instructions[targetKey];
1644
- if (typeof instruction === "function") {
1645
- instruction = [, instruction];
1646
- }
1647
- const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction;
1648
- if (typeof filter2 === "function" && filter2(source[sourceKey]) || typeof filter2 !== "function" && !!filter2) {
1649
- target[targetKey] = valueFn(source[sourceKey]);
1650
- }
1651
- return;
1652
- }
1653
- let [filter, value] = instructions[targetKey];
1654
- if (typeof value === "function") {
1655
- let _value;
1656
- const defaultFilterPassed = filter === undefined && (_value = value()) != null;
1657
- const customFilterPassed = typeof filter === "function" && !!filter(undefined) || typeof filter !== "function" && !!filter;
1658
- if (defaultFilterPassed) {
1659
- target[targetKey] = _value;
1660
- } else if (customFilterPassed) {
1661
- target[targetKey] = value();
1662
- }
1663
- } else {
1664
- const defaultFilterPassed = filter === undefined && value != null;
1665
- const customFilterPassed = typeof filter === "function" && !!filter(value) || typeof filter !== "function" && !!filter;
1666
- if (defaultFilterPassed || customFilterPassed) {
1667
- target[targetKey] = value;
1668
- }
1669
- }
1670
- };
1671
- var nonNullish = (_) => _ != null;
1672
- var pass = (_) => _;
1673
- // ../../../../node_modules/@smithy/smithy-client/dist-es/serde-json.js
1674
- var _json = (obj) => {
1675
- if (obj == null) {
1676
- return {};
1677
- }
1678
- if (Array.isArray(obj)) {
1679
- return obj.filter((_) => _ != null).map(_json);
1680
- }
1681
- if (typeof obj === "object") {
1682
- const target = {};
1683
- for (const key of Object.keys(obj)) {
1684
- if (obj[key] == null) {
1685
- continue;
1686
- }
1687
- target[key] = _json(obj[key]);
1688
- }
1689
- return target;
1690
- }
1691
- return obj;
1692
- };
1693
- export { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, HttpRequest, HttpResponse, require_dist_cjs2 as require_dist_cjs, NoOpLogger, Client, fromArrayBuffer, fromString, fromBase64, fromUtf8, toUint8Array, toUtf8, toBase64, NodeHttpHandler, streamCollector, sdkStreamMixin2 as sdkStreamMixin, Command, SENSITIVE_STRING, createAggregatedClient, expectLong, expectInt32, expectNonNull, expectObject, expectString, strictParseInt32, parseRfc3339DateTime, parseRfc3339DateTimeWithOffset, ServiceException, decorateServiceException, withBaseException, loadConfigsForDefaultMode, emitWarningIfUnsupportedVersion, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, extendedEncodeURIComponent, getArrayIfSingleItem, map, take, _json };
1694
-
1695
- //# debugId=F87C016872839D0364756E2164756E21
1696
- //# sourceMappingURL=chunk-q2vnqdcs.js.map