@etainabl/nodejs-sdk 1.3.164 → 1.3.166

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 (78) hide show
  1. package/dist/esm/chunk-5UJEKK4C.js +22 -0
  2. package/dist/esm/chunk-5UJEKK4C.js.map +1 -0
  3. package/dist/esm/chunk-72KZNKH6.js +180 -0
  4. package/dist/esm/chunk-72KZNKH6.js.map +1 -0
  5. package/dist/esm/{chunk-V42NON4H.js → chunk-7QBJXGSP.js} +23 -1
  6. package/dist/esm/chunk-7QBJXGSP.js.map +1 -0
  7. package/dist/esm/{chunk-GEJJRBZZ.js → chunk-AQUTK7AW.js} +15 -5
  8. package/dist/esm/chunk-AQUTK7AW.js.map +1 -0
  9. package/dist/esm/{chunk-JFJBZL6W.js → chunk-EVJULQPT.js} +1458 -230
  10. package/dist/esm/chunk-EVJULQPT.js.map +1 -0
  11. package/dist/esm/chunk-GA2PLVMV.js +29 -0
  12. package/dist/esm/chunk-GA2PLVMV.js.map +1 -0
  13. package/dist/esm/{chunk-ITNQSW66.js → chunk-IMDTX6W5.js} +57 -7
  14. package/dist/esm/chunk-IMDTX6W5.js.map +1 -0
  15. package/dist/esm/chunk-JI6PVVK3.js +739 -0
  16. package/dist/esm/chunk-JI6PVVK3.js.map +1 -0
  17. package/dist/esm/chunk-KH6HADHN.js +31 -0
  18. package/dist/esm/chunk-KH6HADHN.js.map +1 -0
  19. package/dist/esm/{chunk-64PZMULY.js → chunk-LARQKHST.js} +2 -2
  20. package/dist/esm/chunk-PZ5AY32C.js +10 -0
  21. package/dist/esm/chunk-R2ZTENKB.js +37 -0
  22. package/dist/esm/chunk-R2ZTENKB.js.map +1 -0
  23. package/dist/esm/chunk-RREOR7G6.js +9 -0
  24. package/dist/esm/chunk-RREOR7G6.js.map +1 -0
  25. package/dist/esm/chunk-STDLTQUB.js +180 -0
  26. package/dist/esm/chunk-STDLTQUB.js.map +1 -0
  27. package/dist/esm/chunk-STQV3LF2.js +29 -0
  28. package/dist/esm/chunk-STQV3LF2.js.map +1 -0
  29. package/dist/esm/chunk-WRTOEGQL.js +255 -0
  30. package/dist/esm/chunk-WRTOEGQL.js.map +1 -0
  31. package/dist/esm/{chunk-HAEAETXR.js → chunk-ZW5YT27C.js} +55 -96
  32. package/dist/esm/chunk-ZW5YT27C.js.map +1 -0
  33. package/dist/esm/{dist-es-W6M73SKO.js → dist-es-32LEW3C7.js} +6 -5
  34. package/dist/esm/{dist-es-W6M73SKO.js.map → dist-es-32LEW3C7.js.map} +1 -1
  35. package/dist/esm/{dist-es-SHHKSG6R.js → dist-es-GCETMDH7.js} +4 -3
  36. package/dist/esm/dist-es-GCETMDH7.js.map +1 -0
  37. package/dist/esm/{dist-es-UQHTRG6U.js → dist-es-MHO4ZWXK.js} +7 -5
  38. package/dist/esm/{dist-es-UQHTRG6U.js.map → dist-es-MHO4ZWXK.js.map} +1 -1
  39. package/dist/esm/{dist-es-IIKV4LDE.js → dist-es-MRJ45ZBG.js} +19 -15
  40. package/dist/esm/{dist-es-IIKV4LDE.js.map → dist-es-MRJ45ZBG.js.map} +1 -1
  41. package/dist/esm/{dist-es-CQVI4NNF.js → dist-es-NBFOPILZ.js} +53 -14
  42. package/dist/esm/dist-es-NBFOPILZ.js.map +1 -0
  43. package/dist/esm/{dist-es-AV5FKRC6.js → dist-es-YDCANF64.js} +12 -7
  44. package/dist/esm/{dist-es-AV5FKRC6.js.map → dist-es-YDCANF64.js.map} +1 -1
  45. package/dist/esm/{dist-es-HQRLUYWI.js → dist-es-YPLWYQ2P.js} +4 -3
  46. package/dist/esm/{dist-es-HQRLUYWI.js.map → dist-es-YPLWYQ2P.js.map} +1 -1
  47. package/dist/esm/event-streams-C2D437DF.js +198 -0
  48. package/dist/esm/event-streams-C2D437DF.js.map +1 -0
  49. package/dist/esm/index.js +8421 -7505
  50. package/dist/esm/index.js.map +1 -1
  51. package/dist/esm/{loadSso-2Q7LGXOS.js → loadSso-QXCYUPG5.js} +54 -48
  52. package/dist/esm/loadSso-QXCYUPG5.js.map +1 -0
  53. package/dist/esm/{sso-oidc-7RZV73L6.js → sso-oidc-EU7F5QE4.js} +38 -34
  54. package/dist/esm/{sso-oidc-7RZV73L6.js.map → sso-oidc-EU7F5QE4.js.map} +1 -1
  55. package/dist/esm/{sts-IERANB7E.js → sts-7N2XX5PT.js} +34 -28
  56. package/dist/esm/{sts-IERANB7E.js.map → sts-7N2XX5PT.js.map} +1 -1
  57. package/dist/index.d.cts +411 -11
  58. package/dist/index.d.ts +411 -11
  59. package/dist/index.js +20412 -19412
  60. package/dist/index.js.map +1 -1
  61. package/package.json +7 -2
  62. package/dist/esm/chunk-3YGWW265.js +0 -64
  63. package/dist/esm/chunk-3YGWW265.js.map +0 -1
  64. package/dist/esm/chunk-5VQORBLK.js +0 -136
  65. package/dist/esm/chunk-5VQORBLK.js.map +0 -1
  66. package/dist/esm/chunk-6ZE6VFBF.js +0 -2420
  67. package/dist/esm/chunk-6ZE6VFBF.js.map +0 -1
  68. package/dist/esm/chunk-GEJJRBZZ.js.map +0 -1
  69. package/dist/esm/chunk-HAEAETXR.js.map +0 -1
  70. package/dist/esm/chunk-ITNQSW66.js.map +0 -1
  71. package/dist/esm/chunk-JFJBZL6W.js.map +0 -1
  72. package/dist/esm/chunk-JVMEEBKP.js +0 -127
  73. package/dist/esm/chunk-JVMEEBKP.js.map +0 -1
  74. package/dist/esm/chunk-V42NON4H.js.map +0 -1
  75. package/dist/esm/dist-es-CQVI4NNF.js.map +0 -1
  76. package/dist/esm/loadSso-2Q7LGXOS.js.map +0 -1
  77. /package/dist/esm/{chunk-64PZMULY.js.map → chunk-LARQKHST.js.map} +0 -0
  78. /package/dist/esm/{dist-es-SHHKSG6R.js.map → chunk-PZ5AY32C.js.map} +0 -0
@@ -1,2420 +0,0 @@
1
- import {
2
- AlgorithmId,
3
- SMITHY_CONTEXT_KEY
4
- } from "./chunk-3YGWW265.js";
5
-
6
- // node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js
7
- var getAllAliases = (name, aliases) => {
8
- const _aliases = [];
9
- if (name) {
10
- _aliases.push(name);
11
- }
12
- if (aliases) {
13
- for (const alias of aliases) {
14
- _aliases.push(alias);
15
- }
16
- }
17
- return _aliases;
18
- };
19
- var getMiddlewareNameWithAliases = (name, aliases) => {
20
- return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
21
- };
22
- var constructStack = () => {
23
- let absoluteEntries = [];
24
- let relativeEntries = [];
25
- let identifyOnResolve = false;
26
- const entriesNameSet = /* @__PURE__ */ new Set();
27
- const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]);
28
- const removeByName = (toRemove) => {
29
- let isRemoved = false;
30
- const filterCb = (entry) => {
31
- const aliases = getAllAliases(entry.name, entry.aliases);
32
- if (aliases.includes(toRemove)) {
33
- isRemoved = true;
34
- for (const alias of aliases) {
35
- entriesNameSet.delete(alias);
36
- }
37
- return false;
38
- }
39
- return true;
40
- };
41
- absoluteEntries = absoluteEntries.filter(filterCb);
42
- relativeEntries = relativeEntries.filter(filterCb);
43
- return isRemoved;
44
- };
45
- const removeByReference = (toRemove) => {
46
- let isRemoved = false;
47
- const filterCb = (entry) => {
48
- if (entry.middleware === toRemove) {
49
- isRemoved = true;
50
- for (const alias of getAllAliases(entry.name, entry.aliases)) {
51
- entriesNameSet.delete(alias);
52
- }
53
- return false;
54
- }
55
- return true;
56
- };
57
- absoluteEntries = absoluteEntries.filter(filterCb);
58
- relativeEntries = relativeEntries.filter(filterCb);
59
- return isRemoved;
60
- };
61
- const cloneTo = (toStack) => {
62
- absoluteEntries.forEach((entry) => {
63
- toStack.add(entry.middleware, { ...entry });
64
- });
65
- relativeEntries.forEach((entry) => {
66
- toStack.addRelativeTo(entry.middleware, { ...entry });
67
- });
68
- toStack.identifyOnResolve?.(stack.identifyOnResolve());
69
- return toStack;
70
- };
71
- const expandRelativeMiddlewareList = (from) => {
72
- const expandedMiddlewareList = [];
73
- from.before.forEach((entry) => {
74
- if (entry.before.length === 0 && entry.after.length === 0) {
75
- expandedMiddlewareList.push(entry);
76
- } else {
77
- expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
78
- }
79
- });
80
- expandedMiddlewareList.push(from);
81
- from.after.reverse().forEach((entry) => {
82
- if (entry.before.length === 0 && entry.after.length === 0) {
83
- expandedMiddlewareList.push(entry);
84
- } else {
85
- expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
86
- }
87
- });
88
- return expandedMiddlewareList;
89
- };
90
- const getMiddlewareList = (debug = false) => {
91
- const normalizedAbsoluteEntries = [];
92
- const normalizedRelativeEntries = [];
93
- const normalizedEntriesNameMap = {};
94
- absoluteEntries.forEach((entry) => {
95
- const normalizedEntry = {
96
- ...entry,
97
- before: [],
98
- after: []
99
- };
100
- for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
101
- normalizedEntriesNameMap[alias] = normalizedEntry;
102
- }
103
- normalizedAbsoluteEntries.push(normalizedEntry);
104
- });
105
- relativeEntries.forEach((entry) => {
106
- const normalizedEntry = {
107
- ...entry,
108
- before: [],
109
- after: []
110
- };
111
- for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
112
- normalizedEntriesNameMap[alias] = normalizedEntry;
113
- }
114
- normalizedRelativeEntries.push(normalizedEntry);
115
- });
116
- normalizedRelativeEntries.forEach((entry) => {
117
- if (entry.toMiddleware) {
118
- const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];
119
- if (toMiddleware === void 0) {
120
- if (debug) {
121
- return;
122
- }
123
- throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`);
124
- }
125
- if (entry.relation === "after") {
126
- toMiddleware.after.push(entry);
127
- }
128
- if (entry.relation === "before") {
129
- toMiddleware.before.push(entry);
130
- }
131
- }
132
- });
133
- const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => {
134
- wholeList.push(...expandedMiddlewareList);
135
- return wholeList;
136
- }, []);
137
- return mainChain;
138
- };
139
- const stack = {
140
- add: (middleware, options = {}) => {
141
- const { name, override, aliases: _aliases } = options;
142
- const entry = {
143
- step: "initialize",
144
- priority: "normal",
145
- middleware,
146
- ...options
147
- };
148
- const aliases = getAllAliases(name, _aliases);
149
- if (aliases.length > 0) {
150
- if (aliases.some((alias) => entriesNameSet.has(alias))) {
151
- if (!override)
152
- throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
153
- for (const alias of aliases) {
154
- const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
155
- if (toOverrideIndex === -1) {
156
- continue;
157
- }
158
- const toOverride = absoluteEntries[toOverrideIndex];
159
- if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {
160
- 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.`);
161
- }
162
- absoluteEntries.splice(toOverrideIndex, 1);
163
- }
164
- }
165
- for (const alias of aliases) {
166
- entriesNameSet.add(alias);
167
- }
168
- }
169
- absoluteEntries.push(entry);
170
- },
171
- addRelativeTo: (middleware, options) => {
172
- const { name, override, aliases: _aliases } = options;
173
- const entry = {
174
- middleware,
175
- ...options
176
- };
177
- const aliases = getAllAliases(name, _aliases);
178
- if (aliases.length > 0) {
179
- if (aliases.some((alias) => entriesNameSet.has(alias))) {
180
- if (!override)
181
- throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
182
- for (const alias of aliases) {
183
- const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
184
- if (toOverrideIndex === -1) {
185
- continue;
186
- }
187
- const toOverride = relativeEntries[toOverrideIndex];
188
- if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {
189
- 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.`);
190
- }
191
- relativeEntries.splice(toOverrideIndex, 1);
192
- }
193
- }
194
- for (const alias of aliases) {
195
- entriesNameSet.add(alias);
196
- }
197
- }
198
- relativeEntries.push(entry);
199
- },
200
- clone: () => cloneTo(constructStack()),
201
- use: (plugin) => {
202
- plugin.applyToStack(stack);
203
- },
204
- remove: (toRemove) => {
205
- if (typeof toRemove === "string")
206
- return removeByName(toRemove);
207
- else
208
- return removeByReference(toRemove);
209
- },
210
- removeByTag: (toRemove) => {
211
- let isRemoved = false;
212
- const filterCb = (entry) => {
213
- const { tags, name, aliases: _aliases } = entry;
214
- if (tags && tags.includes(toRemove)) {
215
- const aliases = getAllAliases(name, _aliases);
216
- for (const alias of aliases) {
217
- entriesNameSet.delete(alias);
218
- }
219
- isRemoved = true;
220
- return false;
221
- }
222
- return true;
223
- };
224
- absoluteEntries = absoluteEntries.filter(filterCb);
225
- relativeEntries = relativeEntries.filter(filterCb);
226
- return isRemoved;
227
- },
228
- concat: (from) => {
229
- const cloned = cloneTo(constructStack());
230
- cloned.use(from);
231
- cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false));
232
- return cloned;
233
- },
234
- applyToStack: cloneTo,
235
- identify: () => {
236
- return getMiddlewareList(true).map((mw) => {
237
- const step = mw.step ?? mw.relation + " " + mw.toMiddleware;
238
- return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step;
239
- });
240
- },
241
- identifyOnResolve(toggle) {
242
- if (typeof toggle === "boolean")
243
- identifyOnResolve = toggle;
244
- return identifyOnResolve;
245
- },
246
- resolve: (handler, context) => {
247
- for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {
248
- handler = middleware(handler, context);
249
- }
250
- if (identifyOnResolve) {
251
- console.log(stack.identify());
252
- }
253
- return handler;
254
- }
255
- };
256
- return stack;
257
- };
258
- var stepWeights = {
259
- initialize: 5,
260
- serialize: 4,
261
- build: 3,
262
- finalizeRequest: 2,
263
- deserialize: 1
264
- };
265
- var priorityWeights = {
266
- high: 3,
267
- normal: 2,
268
- low: 1
269
- };
270
-
271
- // node_modules/@smithy/smithy-client/dist-es/client.js
272
- var Client = class {
273
- constructor(config) {
274
- this.config = config;
275
- this.middlewareStack = constructStack();
276
- }
277
- send(command, optionsOrCb, cb) {
278
- const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0;
279
- const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
280
- const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true;
281
- let handler;
282
- if (useHandlerCache) {
283
- if (!this.handlers) {
284
- this.handlers = /* @__PURE__ */ new WeakMap();
285
- }
286
- const handlers = this.handlers;
287
- if (handlers.has(command.constructor)) {
288
- handler = handlers.get(command.constructor);
289
- } else {
290
- handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
291
- handlers.set(command.constructor, handler);
292
- }
293
- } else {
294
- delete this.handlers;
295
- handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
296
- }
297
- if (callback) {
298
- handler(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => {
299
- });
300
- } else {
301
- return handler(command).then((result) => result.output);
302
- }
303
- }
304
- destroy() {
305
- this.config?.requestHandler?.destroy?.();
306
- delete this.handlers;
307
- }
308
- };
309
-
310
- // node_modules/@smithy/smithy-client/dist-es/command.js
311
- var Command = class {
312
- constructor() {
313
- this.middlewareStack = constructStack();
314
- }
315
- static classBuilder() {
316
- return new ClassBuilder();
317
- }
318
- resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) {
319
- for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {
320
- this.middlewareStack.use(mw);
321
- }
322
- const stack = clientStack.concat(this.middlewareStack);
323
- const { logger: logger2 } = configuration;
324
- const handlerExecutionContext = {
325
- logger: logger2,
326
- clientName,
327
- commandName,
328
- inputFilterSensitiveLog,
329
- outputFilterSensitiveLog,
330
- [SMITHY_CONTEXT_KEY]: {
331
- commandInstance: this,
332
- ...smithyContext
333
- },
334
- ...additionalContext
335
- };
336
- const { requestHandler } = configuration;
337
- return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
338
- }
339
- };
340
- var ClassBuilder = class {
341
- constructor() {
342
- this._init = () => {
343
- };
344
- this._ep = {};
345
- this._middlewareFn = () => [];
346
- this._commandName = "";
347
- this._clientName = "";
348
- this._additionalContext = {};
349
- this._smithyContext = {};
350
- this._inputFilterSensitiveLog = (_) => _;
351
- this._outputFilterSensitiveLog = (_) => _;
352
- this._serializer = null;
353
- this._deserializer = null;
354
- }
355
- init(cb) {
356
- this._init = cb;
357
- }
358
- ep(endpointParameterInstructions) {
359
- this._ep = endpointParameterInstructions;
360
- return this;
361
- }
362
- m(middlewareSupplier) {
363
- this._middlewareFn = middlewareSupplier;
364
- return this;
365
- }
366
- s(service, operation, smithyContext = {}) {
367
- this._smithyContext = {
368
- service,
369
- operation,
370
- ...smithyContext
371
- };
372
- return this;
373
- }
374
- c(additionalContext = {}) {
375
- this._additionalContext = additionalContext;
376
- return this;
377
- }
378
- n(clientName, commandName) {
379
- this._clientName = clientName;
380
- this._commandName = commandName;
381
- return this;
382
- }
383
- f(inputFilter = (_) => _, outputFilter = (_) => _) {
384
- this._inputFilterSensitiveLog = inputFilter;
385
- this._outputFilterSensitiveLog = outputFilter;
386
- return this;
387
- }
388
- ser(serializer) {
389
- this._serializer = serializer;
390
- return this;
391
- }
392
- de(deserializer) {
393
- this._deserializer = deserializer;
394
- return this;
395
- }
396
- sc(operation) {
397
- this._operationSchema = operation;
398
- this._smithyContext.operationSchema = operation;
399
- return this;
400
- }
401
- build() {
402
- const closure = this;
403
- let CommandRef;
404
- return CommandRef = class extends Command {
405
- static getEndpointParameterInstructions() {
406
- return closure._ep;
407
- }
408
- constructor(...[input]) {
409
- super();
410
- this.serialize = closure._serializer;
411
- this.deserialize = closure._deserializer;
412
- this.input = input ?? {};
413
- closure._init(this);
414
- this.schema = closure._operationSchema;
415
- }
416
- resolveMiddleware(stack, configuration, options) {
417
- return this.resolveMiddlewareWithContext(stack, configuration, options, {
418
- CommandCtor: CommandRef,
419
- middlewareFn: closure._middlewareFn,
420
- clientName: closure._clientName,
421
- commandName: closure._commandName,
422
- inputFilterSensitiveLog: closure._inputFilterSensitiveLog,
423
- outputFilterSensitiveLog: closure._outputFilterSensitiveLog,
424
- smithyContext: closure._smithyContext,
425
- additionalContext: closure._additionalContext
426
- });
427
- }
428
- };
429
- }
430
- };
431
-
432
- // node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js
433
- var getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
434
- return {
435
- setHttpHandler(handler) {
436
- runtimeConfig.httpHandler = handler;
437
- },
438
- httpHandler() {
439
- return runtimeConfig.httpHandler;
440
- },
441
- updateHttpClientConfig(key, value) {
442
- runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
443
- },
444
- httpHandlerConfigs() {
445
- return runtimeConfig.httpHandler.httpHandlerConfigs();
446
- }
447
- };
448
- };
449
- var resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
450
- return {
451
- httpHandler: httpHandlerExtensionConfiguration.httpHandler()
452
- };
453
- };
454
-
455
- // node_modules/@smithy/protocol-http/dist-es/httpRequest.js
456
- var HttpRequest = class _HttpRequest {
457
- constructor(options) {
458
- this.method = options.method || "GET";
459
- this.hostname = options.hostname || "localhost";
460
- this.port = options.port;
461
- this.query = options.query || {};
462
- this.headers = options.headers || {};
463
- this.body = options.body;
464
- this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:";
465
- this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/";
466
- this.username = options.username;
467
- this.password = options.password;
468
- this.fragment = options.fragment;
469
- }
470
- static clone(request) {
471
- const cloned = new _HttpRequest({
472
- ...request,
473
- headers: { ...request.headers }
474
- });
475
- if (cloned.query) {
476
- cloned.query = cloneQuery(cloned.query);
477
- }
478
- return cloned;
479
- }
480
- static isInstance(request) {
481
- if (!request) {
482
- return false;
483
- }
484
- const req = request;
485
- return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
486
- }
487
- clone() {
488
- return _HttpRequest.clone(this);
489
- }
490
- };
491
- function cloneQuery(query) {
492
- return Object.keys(query).reduce((carry, paramName) => {
493
- const param = query[paramName];
494
- return {
495
- ...carry,
496
- [paramName]: Array.isArray(param) ? [...param] : param
497
- };
498
- }, {});
499
- }
500
-
501
- // node_modules/@smithy/protocol-http/dist-es/httpResponse.js
502
- var HttpResponse = class {
503
- constructor(options) {
504
- this.statusCode = options.statusCode;
505
- this.reason = options.reason;
506
- this.headers = options.headers || {};
507
- this.body = options.body;
508
- }
509
- static isInstance(response) {
510
- if (!response)
511
- return false;
512
- const resp = response;
513
- return typeof resp.statusCode === "number" && typeof resp.headers === "object";
514
- }
515
- };
516
-
517
- // node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js
518
- var escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
519
- var hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;
520
-
521
- // node_modules/@smithy/querystring-builder/dist-es/index.js
522
- function buildQueryString(query) {
523
- const parts = [];
524
- for (let key of Object.keys(query).sort()) {
525
- const value = query[key];
526
- key = escapeUri(key);
527
- if (Array.isArray(value)) {
528
- for (let i = 0, iLen = value.length; i < iLen; i++) {
529
- parts.push(`${key}=${escapeUri(value[i])}`);
530
- }
531
- } else {
532
- let qsEntry = key;
533
- if (value || typeof value === "string") {
534
- qsEntry += `=${escapeUri(value)}`;
535
- }
536
- parts.push(qsEntry);
537
- }
538
- }
539
- return parts.join("&");
540
- }
541
-
542
- // node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js
543
- import { Agent as hAgent, request as hRequest } from "http";
544
- import { Agent as hsAgent, request as hsRequest } from "https";
545
-
546
- // node_modules/@smithy/node-http-handler/dist-es/constants.js
547
- var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
548
-
549
- // node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js
550
- var getTransformedHeaders = (headers) => {
551
- const transformedHeaders = {};
552
- for (const name of Object.keys(headers)) {
553
- const headerValues = headers[name];
554
- transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
555
- }
556
- return transformedHeaders;
557
- };
558
-
559
- // node_modules/@smithy/node-http-handler/dist-es/timing.js
560
- var timing = {
561
- setTimeout: (cb, ms) => setTimeout(cb, ms),
562
- clearTimeout: (timeoutId) => clearTimeout(timeoutId)
563
- };
564
-
565
- // node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js
566
- var DEFER_EVENT_LISTENER_TIME = 1e3;
567
- var setConnectionTimeout = (request, reject, timeoutInMs = 0) => {
568
- if (!timeoutInMs) {
569
- return -1;
570
- }
571
- const registerTimeout = (offset) => {
572
- const timeoutId = timing.setTimeout(() => {
573
- request.destroy();
574
- reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), {
575
- name: "TimeoutError"
576
- }));
577
- }, timeoutInMs - offset);
578
- const doWithSocket = (socket) => {
579
- if (socket?.connecting) {
580
- socket.on("connect", () => {
581
- timing.clearTimeout(timeoutId);
582
- });
583
- } else {
584
- timing.clearTimeout(timeoutId);
585
- }
586
- };
587
- if (request.socket) {
588
- doWithSocket(request.socket);
589
- } else {
590
- request.on("socket", doWithSocket);
591
- }
592
- };
593
- if (timeoutInMs < 2e3) {
594
- registerTimeout(0);
595
- return 0;
596
- }
597
- return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
598
- };
599
-
600
- // node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js
601
- var DEFER_EVENT_LISTENER_TIME2 = 3e3;
602
- var setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => {
603
- if (keepAlive !== true) {
604
- return -1;
605
- }
606
- const registerListener = () => {
607
- if (request.socket) {
608
- request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
609
- } else {
610
- request.on("socket", (socket) => {
611
- socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
612
- });
613
- }
614
- };
615
- if (deferTimeMs === 0) {
616
- registerListener();
617
- return 0;
618
- }
619
- return timing.setTimeout(registerListener, deferTimeMs);
620
- };
621
-
622
- // node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js
623
- var DEFER_EVENT_LISTENER_TIME3 = 3e3;
624
- var setSocketTimeout = (request, reject, timeoutInMs = DEFAULT_REQUEST_TIMEOUT) => {
625
- const registerTimeout = (offset) => {
626
- const timeout = timeoutInMs - offset;
627
- const onTimeout = () => {
628
- request.destroy();
629
- reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" }));
630
- };
631
- if (request.socket) {
632
- request.socket.setTimeout(timeout, onTimeout);
633
- request.on("close", () => request.socket?.removeListener("timeout", onTimeout));
634
- } else {
635
- request.setTimeout(timeout, onTimeout);
636
- }
637
- };
638
- if (0 < timeoutInMs && timeoutInMs < 6e3) {
639
- registerTimeout(0);
640
- return 0;
641
- }
642
- return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), DEFER_EVENT_LISTENER_TIME3);
643
- };
644
-
645
- // node_modules/@smithy/node-http-handler/dist-es/write-request-body.js
646
- import { Readable } from "stream";
647
- var MIN_WAIT_TIME = 6e3;
648
- async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) {
649
- const headers = request.headers ?? {};
650
- const expect = headers["Expect"] || headers["expect"];
651
- let timeoutId = -1;
652
- let sendBody = true;
653
- if (expect === "100-continue") {
654
- sendBody = await Promise.race([
655
- new Promise((resolve) => {
656
- timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
657
- }),
658
- new Promise((resolve) => {
659
- httpRequest.on("continue", () => {
660
- timing.clearTimeout(timeoutId);
661
- resolve(true);
662
- });
663
- httpRequest.on("response", () => {
664
- timing.clearTimeout(timeoutId);
665
- resolve(false);
666
- });
667
- httpRequest.on("error", () => {
668
- timing.clearTimeout(timeoutId);
669
- resolve(false);
670
- });
671
- })
672
- ]);
673
- }
674
- if (sendBody) {
675
- writeBody(httpRequest, request.body);
676
- }
677
- }
678
- function writeBody(httpRequest, body) {
679
- if (body instanceof Readable) {
680
- body.pipe(httpRequest);
681
- return;
682
- }
683
- if (body) {
684
- if (Buffer.isBuffer(body) || typeof body === "string") {
685
- httpRequest.end(body);
686
- return;
687
- }
688
- const uint8 = body;
689
- if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") {
690
- httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));
691
- return;
692
- }
693
- httpRequest.end(Buffer.from(body));
694
- return;
695
- }
696
- httpRequest.end();
697
- }
698
-
699
- // node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js
700
- var DEFAULT_REQUEST_TIMEOUT = 0;
701
- var NodeHttpHandler = class _NodeHttpHandler {
702
- static create(instanceOrOptions) {
703
- if (typeof instanceOrOptions?.handle === "function") {
704
- return instanceOrOptions;
705
- }
706
- return new _NodeHttpHandler(instanceOrOptions);
707
- }
708
- static checkSocketUsage(agent, socketWarningTimestamp, logger2 = console) {
709
- const { sockets, requests, maxSockets } = agent;
710
- if (typeof maxSockets !== "number" || maxSockets === Infinity) {
711
- return socketWarningTimestamp;
712
- }
713
- const interval = 15e3;
714
- if (Date.now() - interval < socketWarningTimestamp) {
715
- return socketWarningTimestamp;
716
- }
717
- if (sockets && requests) {
718
- for (const origin in sockets) {
719
- const socketsInUse = sockets[origin]?.length ?? 0;
720
- const requestsEnqueued = requests[origin]?.length ?? 0;
721
- if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
722
- logger2?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
723
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
724
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`);
725
- return Date.now();
726
- }
727
- }
728
- }
729
- return socketWarningTimestamp;
730
- }
731
- constructor(options) {
732
- this.socketWarningTimestamp = 0;
733
- this.metadata = { handlerProtocol: "http/1.1" };
734
- this.configProvider = new Promise((resolve, reject) => {
735
- if (typeof options === "function") {
736
- options().then((_options) => {
737
- resolve(this.resolveDefaultConfig(_options));
738
- }).catch(reject);
739
- } else {
740
- resolve(this.resolveDefaultConfig(options));
741
- }
742
- });
743
- }
744
- resolveDefaultConfig(options) {
745
- const { requestTimeout: requestTimeout2, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent } = options || {};
746
- const keepAlive = true;
747
- const maxSockets = 50;
748
- return {
749
- connectionTimeout,
750
- requestTimeout: requestTimeout2 ?? socketTimeout,
751
- socketAcquisitionWarningTimeout,
752
- httpAgent: (() => {
753
- if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") {
754
- return httpAgent;
755
- }
756
- return new hAgent({ keepAlive, maxSockets, ...httpAgent });
757
- })(),
758
- httpsAgent: (() => {
759
- if (httpsAgent instanceof hsAgent || typeof httpsAgent?.destroy === "function") {
760
- return httpsAgent;
761
- }
762
- return new hsAgent({ keepAlive, maxSockets, ...httpsAgent });
763
- })(),
764
- logger: console
765
- };
766
- }
767
- destroy() {
768
- this.config?.httpAgent?.destroy();
769
- this.config?.httpsAgent?.destroy();
770
- }
771
- async handle(request, { abortSignal, requestTimeout: requestTimeout2 } = {}) {
772
- if (!this.config) {
773
- this.config = await this.configProvider;
774
- }
775
- return new Promise((_resolve, _reject) => {
776
- let writeRequestBodyPromise = void 0;
777
- const timeouts = [];
778
- const resolve = async (arg) => {
779
- await writeRequestBodyPromise;
780
- timeouts.forEach(timing.clearTimeout);
781
- _resolve(arg);
782
- };
783
- const reject = async (arg) => {
784
- await writeRequestBodyPromise;
785
- timeouts.forEach(timing.clearTimeout);
786
- _reject(arg);
787
- };
788
- if (!this.config) {
789
- throw new Error("Node HTTP request handler config is not resolved");
790
- }
791
- if (abortSignal?.aborted) {
792
- const abortError = new Error("Request aborted");
793
- abortError.name = "AbortError";
794
- reject(abortError);
795
- return;
796
- }
797
- const isSSL = request.protocol === "https:";
798
- const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;
799
- timeouts.push(timing.setTimeout(() => {
800
- this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, this.config.logger);
801
- }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)));
802
- const queryString = buildQueryString(request.query || {});
803
- let auth = void 0;
804
- if (request.username != null || request.password != null) {
805
- const username = request.username ?? "";
806
- const password = request.password ?? "";
807
- auth = `${username}:${password}`;
808
- }
809
- let path = request.path;
810
- if (queryString) {
811
- path += `?${queryString}`;
812
- }
813
- if (request.fragment) {
814
- path += `#${request.fragment}`;
815
- }
816
- let hostname = request.hostname ?? "";
817
- if (hostname[0] === "[" && hostname.endsWith("]")) {
818
- hostname = request.hostname.slice(1, -1);
819
- } else {
820
- hostname = request.hostname;
821
- }
822
- const nodeHttpsOptions = {
823
- headers: request.headers,
824
- host: hostname,
825
- method: request.method,
826
- path,
827
- port: request.port,
828
- agent,
829
- auth
830
- };
831
- const requestFunc = isSSL ? hsRequest : hRequest;
832
- const req = requestFunc(nodeHttpsOptions, (res) => {
833
- const httpResponse = new HttpResponse({
834
- statusCode: res.statusCode || -1,
835
- reason: res.statusMessage,
836
- headers: getTransformedHeaders(res.headers),
837
- body: res
838
- });
839
- resolve({ response: httpResponse });
840
- });
841
- req.on("error", (err) => {
842
- if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
843
- reject(Object.assign(err, { name: "TimeoutError" }));
844
- } else {
845
- reject(err);
846
- }
847
- });
848
- if (abortSignal) {
849
- const onAbort = () => {
850
- req.destroy();
851
- const abortError = new Error("Request aborted");
852
- abortError.name = "AbortError";
853
- reject(abortError);
854
- };
855
- if (typeof abortSignal.addEventListener === "function") {
856
- const signal = abortSignal;
857
- signal.addEventListener("abort", onAbort, { once: true });
858
- req.once("close", () => signal.removeEventListener("abort", onAbort));
859
- } else {
860
- abortSignal.onabort = onAbort;
861
- }
862
- }
863
- const effectiveRequestTimeout = requestTimeout2 ?? this.config.requestTimeout;
864
- timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout));
865
- timeouts.push(setSocketTimeout(req, reject, effectiveRequestTimeout));
866
- const httpAgent = nodeHttpsOptions.agent;
867
- if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
868
- timeouts.push(setSocketKeepAlive(req, {
869
- keepAlive: httpAgent.keepAlive,
870
- keepAliveMsecs: httpAgent.keepAliveMsecs
871
- }));
872
- }
873
- writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout).catch((e) => {
874
- timeouts.forEach(timing.clearTimeout);
875
- return _reject(e);
876
- });
877
- });
878
- }
879
- updateHttpClientConfig(key, value) {
880
- this.config = void 0;
881
- this.configProvider = this.configProvider.then((config) => {
882
- return {
883
- ...config,
884
- [key]: value
885
- };
886
- });
887
- }
888
- httpHandlerConfigs() {
889
- return this.config ?? {};
890
- }
891
- };
892
-
893
- // node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js
894
- import { Writable } from "stream";
895
- var Collector = class extends Writable {
896
- constructor() {
897
- super(...arguments);
898
- this.bufferedBytes = [];
899
- }
900
- _write(chunk, encoding, callback) {
901
- this.bufferedBytes.push(chunk);
902
- callback();
903
- }
904
- };
905
-
906
- // node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js
907
- var streamCollector = (stream) => {
908
- if (isReadableStreamInstance(stream)) {
909
- return collectReadableStream(stream);
910
- }
911
- return new Promise((resolve, reject) => {
912
- const collector = new Collector();
913
- stream.pipe(collector);
914
- stream.on("error", (err) => {
915
- collector.end();
916
- reject(err);
917
- });
918
- collector.on("error", reject);
919
- collector.on("finish", function() {
920
- const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
921
- resolve(bytes);
922
- });
923
- });
924
- };
925
- var isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
926
- async function collectReadableStream(stream) {
927
- const chunks = [];
928
- const reader = stream.getReader();
929
- let isDone = false;
930
- let length = 0;
931
- while (!isDone) {
932
- const { done, value } = await reader.read();
933
- if (value) {
934
- chunks.push(value);
935
- length += value.length;
936
- }
937
- isDone = done;
938
- }
939
- const collected = new Uint8Array(length);
940
- let offset = 0;
941
- for (const chunk of chunks) {
942
- collected.set(chunk, offset);
943
- offset += chunk.length;
944
- }
945
- return collected;
946
- }
947
-
948
- // node_modules/@smithy/smithy-client/dist-es/constants.js
949
- var SENSITIVE_STRING = "***SensitiveInformation***";
950
-
951
- // node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js
952
- var createAggregatedClient = (commands, Client2) => {
953
- for (const command of Object.keys(commands)) {
954
- const CommandCtor = commands[command];
955
- const methodImpl = async function(args, optionsOrCb, cb) {
956
- const command2 = new CommandCtor(args);
957
- if (typeof optionsOrCb === "function") {
958
- this.send(command2, optionsOrCb);
959
- } else if (typeof cb === "function") {
960
- if (typeof optionsOrCb !== "object")
961
- throw new Error(`Expected http options but got ${typeof optionsOrCb}`);
962
- this.send(command2, optionsOrCb || {}, cb);
963
- } else {
964
- return this.send(command2, optionsOrCb);
965
- }
966
- };
967
- const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
968
- Client2.prototype[methodName] = methodImpl;
969
- }
970
- };
971
-
972
- // node_modules/@smithy/smithy-client/dist-es/exceptions.js
973
- var ServiceException = class _ServiceException extends Error {
974
- constructor(options) {
975
- super(options.message);
976
- Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype);
977
- this.name = options.name;
978
- this.$fault = options.$fault;
979
- this.$metadata = options.$metadata;
980
- }
981
- static isInstance(value) {
982
- if (!value)
983
- return false;
984
- const candidate = value;
985
- return _ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server");
986
- }
987
- static [Symbol.hasInstance](instance) {
988
- if (!instance)
989
- return false;
990
- const candidate = instance;
991
- if (this === _ServiceException) {
992
- return _ServiceException.isInstance(instance);
993
- }
994
- if (_ServiceException.isInstance(instance)) {
995
- if (candidate.name && this.name) {
996
- return this.prototype.isPrototypeOf(instance) || candidate.name === this.name;
997
- }
998
- return this.prototype.isPrototypeOf(instance);
999
- }
1000
- return false;
1001
- }
1002
- };
1003
- var decorateServiceException = (exception, additions = {}) => {
1004
- Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => {
1005
- if (exception[k] == void 0 || exception[k] === "") {
1006
- exception[k] = v;
1007
- }
1008
- });
1009
- const message = exception.message || exception.Message || "UnknownError";
1010
- exception.message = message;
1011
- delete exception.Message;
1012
- return exception;
1013
- };
1014
-
1015
- // node_modules/@smithy/is-array-buffer/dist-es/index.js
1016
- var isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
1017
-
1018
- // node_modules/@smithy/util-buffer-from/dist-es/index.js
1019
- import { Buffer as Buffer2 } from "buffer";
1020
- var fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
1021
- if (!isArrayBuffer(input)) {
1022
- throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
1023
- }
1024
- return Buffer2.from(input, offset, length);
1025
- };
1026
- var fromString = (input, encoding) => {
1027
- if (typeof input !== "string") {
1028
- throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
1029
- }
1030
- return encoding ? Buffer2.from(input, encoding) : Buffer2.from(input);
1031
- };
1032
-
1033
- // node_modules/@smithy/util-base64/dist-es/fromBase64.js
1034
- var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
1035
- var fromBase64 = (input) => {
1036
- if (input.length * 3 % 4 !== 0) {
1037
- throw new TypeError(`Incorrect padding on base64 string.`);
1038
- }
1039
- if (!BASE64_REGEX.exec(input)) {
1040
- throw new TypeError(`Invalid base64 string.`);
1041
- }
1042
- const buffer = fromString(input, "base64");
1043
- return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
1044
- };
1045
-
1046
- // node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
1047
- var fromUtf8 = (input) => {
1048
- const buf = fromString(input, "utf8");
1049
- return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
1050
- };
1051
-
1052
- // node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
1053
- var toUint8Array = (data) => {
1054
- if (typeof data === "string") {
1055
- return fromUtf8(data);
1056
- }
1057
- if (ArrayBuffer.isView(data)) {
1058
- return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
1059
- }
1060
- return new Uint8Array(data);
1061
- };
1062
-
1063
- // node_modules/@smithy/util-utf8/dist-es/toUtf8.js
1064
- var toUtf8 = (input) => {
1065
- if (typeof input === "string") {
1066
- return input;
1067
- }
1068
- if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
1069
- throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
1070
- }
1071
- return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
1072
- };
1073
-
1074
- // node_modules/@smithy/util-base64/dist-es/toBase64.js
1075
- var toBase64 = (_input) => {
1076
- let input;
1077
- if (typeof _input === "string") {
1078
- input = fromUtf8(_input);
1079
- } else {
1080
- input = _input;
1081
- }
1082
- if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
1083
- throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
1084
- }
1085
- return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64");
1086
- };
1087
-
1088
- // node_modules/@smithy/util-stream/dist-es/blob/transforms.js
1089
- function transformToString(payload, encoding = "utf-8") {
1090
- if (encoding === "base64") {
1091
- return toBase64(payload);
1092
- }
1093
- return toUtf8(payload);
1094
- }
1095
- function transformFromString(str, encoding) {
1096
- if (encoding === "base64") {
1097
- return Uint8ArrayBlobAdapter.mutate(fromBase64(str));
1098
- }
1099
- return Uint8ArrayBlobAdapter.mutate(fromUtf8(str));
1100
- }
1101
-
1102
- // node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js
1103
- var Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
1104
- static fromString(source, encoding = "utf-8") {
1105
- switch (typeof source) {
1106
- case "string":
1107
- return transformFromString(source, encoding);
1108
- default:
1109
- throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
1110
- }
1111
- }
1112
- static mutate(source) {
1113
- Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype);
1114
- return source;
1115
- }
1116
- transformToString(encoding = "utf-8") {
1117
- return transformToString(this, encoding);
1118
- }
1119
- };
1120
-
1121
- // node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js
1122
- import { Duplex } from "stream";
1123
- var ChecksumStream = class extends Duplex {
1124
- constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) {
1125
- super();
1126
- if (typeof source.pipe === "function") {
1127
- this.source = source;
1128
- } else {
1129
- throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
1130
- }
1131
- this.base64Encoder = base64Encoder ?? toBase64;
1132
- this.expectedChecksum = expectedChecksum;
1133
- this.checksum = checksum;
1134
- this.checksumSourceLocation = checksumSourceLocation;
1135
- this.source.pipe(this);
1136
- }
1137
- _read(size) {
1138
- }
1139
- _write(chunk, encoding, callback) {
1140
- try {
1141
- this.checksum.update(chunk);
1142
- this.push(chunk);
1143
- } catch (e) {
1144
- return callback(e);
1145
- }
1146
- return callback();
1147
- }
1148
- async _final(callback) {
1149
- try {
1150
- const digest = await this.checksum.digest();
1151
- const received = this.base64Encoder(digest);
1152
- if (this.expectedChecksum !== received) {
1153
- return callback(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`));
1154
- }
1155
- } catch (e) {
1156
- return callback(e);
1157
- }
1158
- this.push(null);
1159
- return callback();
1160
- }
1161
- };
1162
-
1163
- // node_modules/@smithy/util-stream/dist-es/stream-type-check.js
1164
- var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
1165
- var isBlob = (blob) => {
1166
- return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);
1167
- };
1168
-
1169
- // node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.browser.js
1170
- var ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() {
1171
- };
1172
- var ChecksumStream2 = class extends ReadableStreamRef {
1173
- };
1174
-
1175
- // node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.browser.js
1176
- var createChecksumStream = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => {
1177
- if (!isReadableStream(source)) {
1178
- throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
1179
- }
1180
- const encoder = base64Encoder ?? toBase64;
1181
- if (typeof TransformStream !== "function") {
1182
- throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");
1183
- }
1184
- const transform = new TransformStream({
1185
- start() {
1186
- },
1187
- async transform(chunk, controller) {
1188
- checksum.update(chunk);
1189
- controller.enqueue(chunk);
1190
- },
1191
- async flush(controller) {
1192
- const digest = await checksum.digest();
1193
- const received = encoder(digest);
1194
- if (expectedChecksum !== received) {
1195
- const error = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`);
1196
- controller.error(error);
1197
- } else {
1198
- controller.terminate();
1199
- }
1200
- }
1201
- });
1202
- source.pipeThrough(transform);
1203
- const readable = transform.readable;
1204
- Object.setPrototypeOf(readable, ChecksumStream2.prototype);
1205
- return readable;
1206
- };
1207
-
1208
- // node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.js
1209
- function createChecksumStream2(init) {
1210
- if (typeof ReadableStream === "function" && isReadableStream(init.source)) {
1211
- return createChecksumStream(init);
1212
- }
1213
- return new ChecksumStream(init);
1214
- }
1215
-
1216
- // node_modules/@smithy/util-stream/dist-es/createBufferedReadable.js
1217
- import { Readable as Readable2 } from "node:stream";
1218
-
1219
- // node_modules/@smithy/util-stream/dist-es/ByteArrayCollector.js
1220
- var ByteArrayCollector = class {
1221
- constructor(allocByteArray) {
1222
- this.allocByteArray = allocByteArray;
1223
- this.byteLength = 0;
1224
- this.byteArrays = [];
1225
- }
1226
- push(byteArray) {
1227
- this.byteArrays.push(byteArray);
1228
- this.byteLength += byteArray.byteLength;
1229
- }
1230
- flush() {
1231
- if (this.byteArrays.length === 1) {
1232
- const bytes = this.byteArrays[0];
1233
- this.reset();
1234
- return bytes;
1235
- }
1236
- const aggregation = this.allocByteArray(this.byteLength);
1237
- let cursor = 0;
1238
- for (let i = 0; i < this.byteArrays.length; ++i) {
1239
- const bytes = this.byteArrays[i];
1240
- aggregation.set(bytes, cursor);
1241
- cursor += bytes.byteLength;
1242
- }
1243
- this.reset();
1244
- return aggregation;
1245
- }
1246
- reset() {
1247
- this.byteArrays = [];
1248
- this.byteLength = 0;
1249
- }
1250
- };
1251
-
1252
- // node_modules/@smithy/util-stream/dist-es/createBufferedReadableStream.js
1253
- function createBufferedReadableStream(upstream, size, logger2) {
1254
- const reader = upstream.getReader();
1255
- let streamBufferingLoggedWarning = false;
1256
- let bytesSeen = 0;
1257
- const buffers = ["", new ByteArrayCollector((size2) => new Uint8Array(size2))];
1258
- let mode = -1;
1259
- const pull = async (controller) => {
1260
- const { value, done } = await reader.read();
1261
- const chunk = value;
1262
- if (done) {
1263
- if (mode !== -1) {
1264
- const remainder = flush(buffers, mode);
1265
- if (sizeOf(remainder) > 0) {
1266
- controller.enqueue(remainder);
1267
- }
1268
- }
1269
- controller.close();
1270
- } else {
1271
- const chunkMode = modeOf(chunk, false);
1272
- if (mode !== chunkMode) {
1273
- if (mode >= 0) {
1274
- controller.enqueue(flush(buffers, mode));
1275
- }
1276
- mode = chunkMode;
1277
- }
1278
- if (mode === -1) {
1279
- controller.enqueue(chunk);
1280
- return;
1281
- }
1282
- const chunkSize = sizeOf(chunk);
1283
- bytesSeen += chunkSize;
1284
- const bufferSize = sizeOf(buffers[mode]);
1285
- if (chunkSize >= size && bufferSize === 0) {
1286
- controller.enqueue(chunk);
1287
- } else {
1288
- const newSize = merge(buffers, mode, chunk);
1289
- if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
1290
- streamBufferingLoggedWarning = true;
1291
- logger2?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
1292
- }
1293
- if (newSize >= size) {
1294
- controller.enqueue(flush(buffers, mode));
1295
- } else {
1296
- await pull(controller);
1297
- }
1298
- }
1299
- }
1300
- };
1301
- return new ReadableStream({
1302
- pull
1303
- });
1304
- }
1305
- function merge(buffers, mode, chunk) {
1306
- switch (mode) {
1307
- case 0:
1308
- buffers[0] += chunk;
1309
- return sizeOf(buffers[0]);
1310
- case 1:
1311
- case 2:
1312
- buffers[mode].push(chunk);
1313
- return sizeOf(buffers[mode]);
1314
- }
1315
- }
1316
- function flush(buffers, mode) {
1317
- switch (mode) {
1318
- case 0:
1319
- const s = buffers[0];
1320
- buffers[0] = "";
1321
- return s;
1322
- case 1:
1323
- case 2:
1324
- return buffers[mode].flush();
1325
- }
1326
- throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`);
1327
- }
1328
- function sizeOf(chunk) {
1329
- return chunk?.byteLength ?? chunk?.length ?? 0;
1330
- }
1331
- function modeOf(chunk, allowBuffer = true) {
1332
- if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) {
1333
- return 2;
1334
- }
1335
- if (chunk instanceof Uint8Array) {
1336
- return 1;
1337
- }
1338
- if (typeof chunk === "string") {
1339
- return 0;
1340
- }
1341
- return -1;
1342
- }
1343
-
1344
- // node_modules/@smithy/util-stream/dist-es/createBufferedReadable.js
1345
- function createBufferedReadable(upstream, size, logger2) {
1346
- if (isReadableStream(upstream)) {
1347
- return createBufferedReadableStream(upstream, size, logger2);
1348
- }
1349
- const downstream = new Readable2({ read() {
1350
- } });
1351
- let streamBufferingLoggedWarning = false;
1352
- let bytesSeen = 0;
1353
- const buffers = [
1354
- "",
1355
- new ByteArrayCollector((size2) => new Uint8Array(size2)),
1356
- new ByteArrayCollector((size2) => Buffer.from(new Uint8Array(size2)))
1357
- ];
1358
- let mode = -1;
1359
- upstream.on("data", (chunk) => {
1360
- const chunkMode = modeOf(chunk, true);
1361
- if (mode !== chunkMode) {
1362
- if (mode >= 0) {
1363
- downstream.push(flush(buffers, mode));
1364
- }
1365
- mode = chunkMode;
1366
- }
1367
- if (mode === -1) {
1368
- downstream.push(chunk);
1369
- return;
1370
- }
1371
- const chunkSize = sizeOf(chunk);
1372
- bytesSeen += chunkSize;
1373
- const bufferSize = sizeOf(buffers[mode]);
1374
- if (chunkSize >= size && bufferSize === 0) {
1375
- downstream.push(chunk);
1376
- } else {
1377
- const newSize = merge(buffers, mode, chunk);
1378
- if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
1379
- streamBufferingLoggedWarning = true;
1380
- logger2?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
1381
- }
1382
- if (newSize >= size) {
1383
- downstream.push(flush(buffers, mode));
1384
- }
1385
- }
1386
- });
1387
- upstream.on("end", () => {
1388
- if (mode !== -1) {
1389
- const remainder = flush(buffers, mode);
1390
- if (sizeOf(remainder) > 0) {
1391
- downstream.push(remainder);
1392
- }
1393
- }
1394
- downstream.push(null);
1395
- });
1396
- return downstream;
1397
- }
1398
-
1399
- // node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.js
1400
- import { Readable as Readable3 } from "stream";
1401
- var getAwsChunkedEncodingStream = (readableStream, options) => {
1402
- const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
1403
- const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0;
1404
- const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0;
1405
- const awsChunkedEncodingStream = new Readable3({ read: () => {
1406
- } });
1407
- readableStream.on("data", (data) => {
1408
- const length = bodyLengthChecker(data) || 0;
1409
- awsChunkedEncodingStream.push(`${length.toString(16)}\r
1410
- `);
1411
- awsChunkedEncodingStream.push(data);
1412
- awsChunkedEncodingStream.push("\r\n");
1413
- });
1414
- readableStream.on("end", async () => {
1415
- awsChunkedEncodingStream.push(`0\r
1416
- `);
1417
- if (checksumRequired) {
1418
- const checksum = base64Encoder(await digest);
1419
- awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r
1420
- `);
1421
- awsChunkedEncodingStream.push(`\r
1422
- `);
1423
- }
1424
- awsChunkedEncodingStream.push(null);
1425
- });
1426
- return awsChunkedEncodingStream;
1427
- };
1428
-
1429
- // node_modules/@smithy/util-stream/dist-es/headStream.js
1430
- import { Writable as Writable2 } from "stream";
1431
-
1432
- // node_modules/@smithy/util-stream/dist-es/headStream.browser.js
1433
- async function headStream(stream, bytes) {
1434
- let byteLengthCounter = 0;
1435
- const chunks = [];
1436
- const reader = stream.getReader();
1437
- let isDone = false;
1438
- while (!isDone) {
1439
- const { done, value } = await reader.read();
1440
- if (value) {
1441
- chunks.push(value);
1442
- byteLengthCounter += value?.byteLength ?? 0;
1443
- }
1444
- if (byteLengthCounter >= bytes) {
1445
- break;
1446
- }
1447
- isDone = done;
1448
- }
1449
- reader.releaseLock();
1450
- const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
1451
- let offset = 0;
1452
- for (const chunk of chunks) {
1453
- if (chunk.byteLength > collected.byteLength - offset) {
1454
- collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
1455
- break;
1456
- } else {
1457
- collected.set(chunk, offset);
1458
- }
1459
- offset += chunk.length;
1460
- }
1461
- return collected;
1462
- }
1463
-
1464
- // node_modules/@smithy/util-stream/dist-es/headStream.js
1465
- var headStream2 = (stream, bytes) => {
1466
- if (isReadableStream(stream)) {
1467
- return headStream(stream, bytes);
1468
- }
1469
- return new Promise((resolve, reject) => {
1470
- const collector = new Collector2();
1471
- collector.limit = bytes;
1472
- stream.pipe(collector);
1473
- stream.on("error", (err) => {
1474
- collector.end();
1475
- reject(err);
1476
- });
1477
- collector.on("error", reject);
1478
- collector.on("finish", function() {
1479
- const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
1480
- resolve(bytes2);
1481
- });
1482
- });
1483
- };
1484
- var Collector2 = class extends Writable2 {
1485
- constructor() {
1486
- super(...arguments);
1487
- this.buffers = [];
1488
- this.limit = Infinity;
1489
- this.bytesBuffered = 0;
1490
- }
1491
- _write(chunk, encoding, callback) {
1492
- this.buffers.push(chunk);
1493
- this.bytesBuffered += chunk.byteLength ?? 0;
1494
- if (this.bytesBuffered >= this.limit) {
1495
- const excess = this.bytesBuffered - this.limit;
1496
- const tailBuffer = this.buffers[this.buffers.length - 1];
1497
- this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);
1498
- this.emit("finish");
1499
- }
1500
- callback();
1501
- }
1502
- };
1503
-
1504
- // node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
1505
- import { Readable as Readable4 } from "stream";
1506
-
1507
- // node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js
1508
- var streamCollector2 = async (stream) => {
1509
- if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") {
1510
- if (Blob.prototype.arrayBuffer !== void 0) {
1511
- return new Uint8Array(await stream.arrayBuffer());
1512
- }
1513
- return collectBlob(stream);
1514
- }
1515
- return collectStream(stream);
1516
- };
1517
- async function collectBlob(blob) {
1518
- const base64 = await readToBase64(blob);
1519
- const arrayBuffer = fromBase64(base64);
1520
- return new Uint8Array(arrayBuffer);
1521
- }
1522
- async function collectStream(stream) {
1523
- const chunks = [];
1524
- const reader = stream.getReader();
1525
- let isDone = false;
1526
- let length = 0;
1527
- while (!isDone) {
1528
- const { done, value } = await reader.read();
1529
- if (value) {
1530
- chunks.push(value);
1531
- length += value.length;
1532
- }
1533
- isDone = done;
1534
- }
1535
- const collected = new Uint8Array(length);
1536
- let offset = 0;
1537
- for (const chunk of chunks) {
1538
- collected.set(chunk, offset);
1539
- offset += chunk.length;
1540
- }
1541
- return collected;
1542
- }
1543
- function readToBase64(blob) {
1544
- return new Promise((resolve, reject) => {
1545
- const reader = new FileReader();
1546
- reader.onloadend = () => {
1547
- if (reader.readyState !== 2) {
1548
- return reject(new Error("Reader aborted too early"));
1549
- }
1550
- const result = reader.result ?? "";
1551
- const commaIndex = result.indexOf(",");
1552
- const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
1553
- resolve(result.substring(dataOffset));
1554
- };
1555
- reader.onabort = () => reject(new Error("Read aborted"));
1556
- reader.onerror = () => reject(reader.error);
1557
- reader.readAsDataURL(blob);
1558
- });
1559
- }
1560
-
1561
- // node_modules/@smithy/util-hex-encoding/dist-es/index.js
1562
- var SHORT_TO_HEX = {};
1563
- var HEX_TO_SHORT = {};
1564
- for (let i = 0; i < 256; i++) {
1565
- let encodedByte = i.toString(16).toLowerCase();
1566
- if (encodedByte.length === 1) {
1567
- encodedByte = `0${encodedByte}`;
1568
- }
1569
- SHORT_TO_HEX[i] = encodedByte;
1570
- HEX_TO_SHORT[encodedByte] = i;
1571
- }
1572
- function fromHex(encoded) {
1573
- if (encoded.length % 2 !== 0) {
1574
- throw new Error("Hex encoded strings must have an even number length");
1575
- }
1576
- const out = new Uint8Array(encoded.length / 2);
1577
- for (let i = 0; i < encoded.length; i += 2) {
1578
- const encodedByte = encoded.slice(i, i + 2).toLowerCase();
1579
- if (encodedByte in HEX_TO_SHORT) {
1580
- out[i / 2] = HEX_TO_SHORT[encodedByte];
1581
- } else {
1582
- throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
1583
- }
1584
- }
1585
- return out;
1586
- }
1587
- function toHex(bytes) {
1588
- let out = "";
1589
- for (let i = 0; i < bytes.byteLength; i++) {
1590
- out += SHORT_TO_HEX[bytes[i]];
1591
- }
1592
- return out;
1593
- }
1594
-
1595
- // node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js
1596
- var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
1597
- var sdkStreamMixin = (stream) => {
1598
- if (!isBlobInstance(stream) && !isReadableStream(stream)) {
1599
- const name = stream?.__proto__?.constructor?.name || stream;
1600
- throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
1601
- }
1602
- let transformed = false;
1603
- const transformToByteArray = async () => {
1604
- if (transformed) {
1605
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
1606
- }
1607
- transformed = true;
1608
- return await streamCollector2(stream);
1609
- };
1610
- const blobToWebStream = (blob) => {
1611
- if (typeof blob.stream !== "function") {
1612
- throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
1613
- }
1614
- return blob.stream();
1615
- };
1616
- return Object.assign(stream, {
1617
- transformToByteArray,
1618
- transformToString: async (encoding) => {
1619
- const buf = await transformToByteArray();
1620
- if (encoding === "base64") {
1621
- return toBase64(buf);
1622
- } else if (encoding === "hex") {
1623
- return toHex(buf);
1624
- } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") {
1625
- return toUtf8(buf);
1626
- } else if (typeof TextDecoder === "function") {
1627
- return new TextDecoder(encoding).decode(buf);
1628
- } else {
1629
- throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
1630
- }
1631
- },
1632
- transformToWebStream: () => {
1633
- if (transformed) {
1634
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
1635
- }
1636
- transformed = true;
1637
- if (isBlobInstance(stream)) {
1638
- return blobToWebStream(stream);
1639
- } else if (isReadableStream(stream)) {
1640
- return stream;
1641
- } else {
1642
- throw new Error(`Cannot transform payload to web stream, got ${stream}`);
1643
- }
1644
- }
1645
- });
1646
- };
1647
- var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
1648
-
1649
- // node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
1650
- var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2 = "The stream has already been transformed.";
1651
- var sdkStreamMixin2 = (stream) => {
1652
- if (!(stream instanceof Readable4)) {
1653
- try {
1654
- return sdkStreamMixin(stream);
1655
- } catch (e) {
1656
- const name = stream?.__proto__?.constructor?.name || stream;
1657
- throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
1658
- }
1659
- }
1660
- let transformed = false;
1661
- const transformToByteArray = async () => {
1662
- if (transformed) {
1663
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
1664
- }
1665
- transformed = true;
1666
- return await streamCollector(stream);
1667
- };
1668
- return Object.assign(stream, {
1669
- transformToByteArray,
1670
- transformToString: async (encoding) => {
1671
- const buf = await transformToByteArray();
1672
- if (encoding === void 0 || Buffer.isEncoding(encoding)) {
1673
- return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
1674
- } else {
1675
- const decoder = new TextDecoder(encoding);
1676
- return decoder.decode(buf);
1677
- }
1678
- },
1679
- transformToWebStream: () => {
1680
- if (transformed) {
1681
- throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
1682
- }
1683
- if (stream.readableFlowing !== null) {
1684
- throw new Error("The stream has been consumed by other callbacks.");
1685
- }
1686
- if (typeof Readable4.toWeb !== "function") {
1687
- throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
1688
- }
1689
- transformed = true;
1690
- return Readable4.toWeb(stream);
1691
- }
1692
- });
1693
- };
1694
-
1695
- // node_modules/@smithy/util-stream/dist-es/splitStream.js
1696
- import { PassThrough } from "stream";
1697
-
1698
- // node_modules/@smithy/util-stream/dist-es/splitStream.browser.js
1699
- async function splitStream(stream) {
1700
- if (typeof stream.stream === "function") {
1701
- stream = stream.stream();
1702
- }
1703
- const readableStream = stream;
1704
- return readableStream.tee();
1705
- }
1706
-
1707
- // node_modules/@smithy/util-stream/dist-es/splitStream.js
1708
- async function splitStream2(stream) {
1709
- if (isReadableStream(stream) || isBlob(stream)) {
1710
- return splitStream(stream);
1711
- }
1712
- const stream1 = new PassThrough();
1713
- const stream2 = new PassThrough();
1714
- stream.pipe(stream1);
1715
- stream.pipe(stream2);
1716
- return [stream1, stream2];
1717
- }
1718
-
1719
- // node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
1720
- var collectBody = async (streamBody = new Uint8Array(), context) => {
1721
- if (streamBody instanceof Uint8Array) {
1722
- return Uint8ArrayBlobAdapter.mutate(streamBody);
1723
- }
1724
- if (!streamBody) {
1725
- return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
1726
- }
1727
- const fromContext = context.streamCollector(streamBody);
1728
- return Uint8ArrayBlobAdapter.mutate(await fromContext);
1729
- };
1730
-
1731
- // node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js
1732
- function extendedEncodeURIComponent(str) {
1733
- return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
1734
- return "%" + c.charCodeAt(0).toString(16).toUpperCase();
1735
- });
1736
- }
1737
-
1738
- // node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js
1739
- var parseBoolean = (value) => {
1740
- switch (value) {
1741
- case "true":
1742
- return true;
1743
- case "false":
1744
- return false;
1745
- default:
1746
- throw new Error(`Unable to parse boolean value "${value}"`);
1747
- }
1748
- };
1749
- var expectNumber = (value) => {
1750
- if (value === null || value === void 0) {
1751
- return void 0;
1752
- }
1753
- if (typeof value === "string") {
1754
- const parsed = parseFloat(value);
1755
- if (!Number.isNaN(parsed)) {
1756
- if (String(parsed) !== String(value)) {
1757
- logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
1758
- }
1759
- return parsed;
1760
- }
1761
- }
1762
- if (typeof value === "number") {
1763
- return value;
1764
- }
1765
- throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
1766
- };
1767
- var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
1768
- var expectFloat32 = (value) => {
1769
- const expected = expectNumber(value);
1770
- if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
1771
- if (Math.abs(expected) > MAX_FLOAT) {
1772
- throw new TypeError(`Expected 32-bit float, got ${value}`);
1773
- }
1774
- }
1775
- return expected;
1776
- };
1777
- var expectLong = (value) => {
1778
- if (value === null || value === void 0) {
1779
- return void 0;
1780
- }
1781
- if (Number.isInteger(value) && !Number.isNaN(value)) {
1782
- return value;
1783
- }
1784
- throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
1785
- };
1786
- var expectInt32 = (value) => expectSizedInt(value, 32);
1787
- var expectShort = (value) => expectSizedInt(value, 16);
1788
- var expectByte = (value) => expectSizedInt(value, 8);
1789
- var expectSizedInt = (value, size) => {
1790
- const expected = expectLong(value);
1791
- if (expected !== void 0 && castInt(expected, size) !== expected) {
1792
- throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
1793
- }
1794
- return expected;
1795
- };
1796
- var castInt = (value, size) => {
1797
- switch (size) {
1798
- case 32:
1799
- return Int32Array.of(value)[0];
1800
- case 16:
1801
- return Int16Array.of(value)[0];
1802
- case 8:
1803
- return Int8Array.of(value)[0];
1804
- }
1805
- };
1806
- var expectNonNull = (value, location) => {
1807
- if (value === null || value === void 0) {
1808
- if (location) {
1809
- throw new TypeError(`Expected a non-null value for ${location}`);
1810
- }
1811
- throw new TypeError("Expected a non-null value");
1812
- }
1813
- return value;
1814
- };
1815
- var expectObject = (value) => {
1816
- if (value === null || value === void 0) {
1817
- return void 0;
1818
- }
1819
- if (typeof value === "object" && !Array.isArray(value)) {
1820
- return value;
1821
- }
1822
- const receivedType = Array.isArray(value) ? "array" : typeof value;
1823
- throw new TypeError(`Expected object, got ${receivedType}: ${value}`);
1824
- };
1825
- var expectString = (value) => {
1826
- if (value === null || value === void 0) {
1827
- return void 0;
1828
- }
1829
- if (typeof value === "string") {
1830
- return value;
1831
- }
1832
- if (["boolean", "number", "bigint"].includes(typeof value)) {
1833
- logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
1834
- return String(value);
1835
- }
1836
- throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
1837
- };
1838
- var strictParseFloat32 = (value) => {
1839
- if (typeof value == "string") {
1840
- return expectFloat32(parseNumber(value));
1841
- }
1842
- return expectFloat32(value);
1843
- };
1844
- var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
1845
- var parseNumber = (value) => {
1846
- const matches = value.match(NUMBER_REGEX);
1847
- if (matches === null || matches[0].length !== value.length) {
1848
- throw new TypeError(`Expected real number, got implicit NaN`);
1849
- }
1850
- return parseFloat(value);
1851
- };
1852
- var strictParseLong = (value) => {
1853
- if (typeof value === "string") {
1854
- return expectLong(parseNumber(value));
1855
- }
1856
- return expectLong(value);
1857
- };
1858
- var strictParseInt32 = (value) => {
1859
- if (typeof value === "string") {
1860
- return expectInt32(parseNumber(value));
1861
- }
1862
- return expectInt32(value);
1863
- };
1864
- var strictParseShort = (value) => {
1865
- if (typeof value === "string") {
1866
- return expectShort(parseNumber(value));
1867
- }
1868
- return expectShort(value);
1869
- };
1870
- var strictParseByte = (value) => {
1871
- if (typeof value === "string") {
1872
- return expectByte(parseNumber(value));
1873
- }
1874
- return expectByte(value);
1875
- };
1876
- var stackTraceWarning = (message) => {
1877
- return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n");
1878
- };
1879
- var logger = {
1880
- warn: console.warn
1881
- };
1882
-
1883
- // node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js
1884
- var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
1885
- var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1886
- function dateToUtcString(date) {
1887
- const year = date.getUTCFullYear();
1888
- const month = date.getUTCMonth();
1889
- const dayOfWeek = date.getUTCDay();
1890
- const dayOfMonthInt = date.getUTCDate();
1891
- const hoursInt = date.getUTCHours();
1892
- const minutesInt = date.getUTCMinutes();
1893
- const secondsInt = date.getUTCSeconds();
1894
- const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
1895
- const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
1896
- const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
1897
- const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
1898
- return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;
1899
- }
1900
- var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
1901
- var parseRfc3339DateTime = (value) => {
1902
- if (value === null || value === void 0) {
1903
- return void 0;
1904
- }
1905
- if (typeof value !== "string") {
1906
- throw new TypeError("RFC-3339 date-times must be expressed as strings");
1907
- }
1908
- const match = RFC3339.exec(value);
1909
- if (!match) {
1910
- throw new TypeError("Invalid RFC-3339 date-time value");
1911
- }
1912
- const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
1913
- const year = strictParseShort(stripLeadingZeroes(yearStr));
1914
- const month = parseDateValue(monthStr, "month", 1, 12);
1915
- const day = parseDateValue(dayStr, "day", 1, 31);
1916
- return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
1917
- };
1918
- 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])$/);
1919
- var parseRfc3339DateTimeWithOffset = (value) => {
1920
- if (value === null || value === void 0) {
1921
- return void 0;
1922
- }
1923
- if (typeof value !== "string") {
1924
- throw new TypeError("RFC-3339 date-times must be expressed as strings");
1925
- }
1926
- const match = RFC3339_WITH_OFFSET.exec(value);
1927
- if (!match) {
1928
- throw new TypeError("Invalid RFC-3339 date-time value");
1929
- }
1930
- const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;
1931
- const year = strictParseShort(stripLeadingZeroes(yearStr));
1932
- const month = parseDateValue(monthStr, "month", 1, 12);
1933
- const day = parseDateValue(dayStr, "day", 1, 31);
1934
- const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
1935
- if (offsetStr.toUpperCase() != "Z") {
1936
- date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));
1937
- }
1938
- return date;
1939
- };
1940
- 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$/);
1941
- 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$/);
1942
- 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})$/);
1943
- var parseRfc7231DateTime = (value) => {
1944
- if (value === null || value === void 0) {
1945
- return void 0;
1946
- }
1947
- if (typeof value !== "string") {
1948
- throw new TypeError("RFC-7231 date-times must be expressed as strings");
1949
- }
1950
- let match = IMF_FIXDATE.exec(value);
1951
- if (match) {
1952
- const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
1953
- return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
1954
- }
1955
- match = RFC_850_DATE.exec(value);
1956
- if (match) {
1957
- const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
1958
- return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
1959
- hours,
1960
- minutes,
1961
- seconds,
1962
- fractionalMilliseconds
1963
- }));
1964
- }
1965
- match = ASC_TIME.exec(value);
1966
- if (match) {
1967
- const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;
1968
- return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
1969
- }
1970
- throw new TypeError("Invalid RFC-7231 date-time value");
1971
- };
1972
- var buildDate = (year, month, day, time) => {
1973
- const adjustedMonth = month - 1;
1974
- validateDayOfMonth(year, adjustedMonth, day);
1975
- 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)));
1976
- };
1977
- var parseTwoDigitYear = (value) => {
1978
- const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear();
1979
- const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));
1980
- if (valueInThisCentury < thisYear) {
1981
- return valueInThisCentury + 100;
1982
- }
1983
- return valueInThisCentury;
1984
- };
1985
- var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3;
1986
- var adjustRfc850Year = (input) => {
1987
- if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) {
1988
- return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds()));
1989
- }
1990
- return input;
1991
- };
1992
- var parseMonthByShortName = (value) => {
1993
- const monthIdx = MONTHS.indexOf(value);
1994
- if (monthIdx < 0) {
1995
- throw new TypeError(`Invalid month: ${value}`);
1996
- }
1997
- return monthIdx + 1;
1998
- };
1999
- var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2000
- var validateDayOfMonth = (year, month, day) => {
2001
- let maxDays = DAYS_IN_MONTH[month];
2002
- if (month === 1 && isLeapYear(year)) {
2003
- maxDays = 29;
2004
- }
2005
- if (day > maxDays) {
2006
- throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);
2007
- }
2008
- };
2009
- var isLeapYear = (year) => {
2010
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
2011
- };
2012
- var parseDateValue = (value, type, lower, upper) => {
2013
- const dateVal = strictParseByte(stripLeadingZeroes(value));
2014
- if (dateVal < lower || dateVal > upper) {
2015
- throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
2016
- }
2017
- return dateVal;
2018
- };
2019
- var parseMilliseconds = (value) => {
2020
- if (value === null || value === void 0) {
2021
- return 0;
2022
- }
2023
- return strictParseFloat32("0." + value) * 1e3;
2024
- };
2025
- var parseOffsetToMilliseconds = (value) => {
2026
- const directionStr = value[0];
2027
- let direction = 1;
2028
- if (directionStr == "+") {
2029
- direction = 1;
2030
- } else if (directionStr == "-") {
2031
- direction = -1;
2032
- } else {
2033
- throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
2034
- }
2035
- const hour = Number(value.substring(1, 3));
2036
- const minute = Number(value.substring(4, 6));
2037
- return direction * (hour * 60 + minute) * 60 * 1e3;
2038
- };
2039
- var stripLeadingZeroes = (value) => {
2040
- let idx = 0;
2041
- while (idx < value.length - 1 && value.charAt(idx) === "0") {
2042
- idx++;
2043
- }
2044
- if (idx === 0) {
2045
- return value;
2046
- }
2047
- return value.slice(idx);
2048
- };
2049
-
2050
- // node_modules/uuid/dist/esm-node/rng.js
2051
- import crypto from "crypto";
2052
- var rnds8Pool = new Uint8Array(256);
2053
- var poolPtr = rnds8Pool.length;
2054
- function rng() {
2055
- if (poolPtr > rnds8Pool.length - 16) {
2056
- crypto.randomFillSync(rnds8Pool);
2057
- poolPtr = 0;
2058
- }
2059
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
2060
- }
2061
-
2062
- // node_modules/uuid/dist/esm-node/stringify.js
2063
- var byteToHex = [];
2064
- for (let i = 0; i < 256; ++i) {
2065
- byteToHex.push((i + 256).toString(16).slice(1));
2066
- }
2067
- function unsafeStringify(arr, offset = 0) {
2068
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
2069
- }
2070
-
2071
- // node_modules/uuid/dist/esm-node/native.js
2072
- import crypto2 from "crypto";
2073
- var native_default = {
2074
- randomUUID: crypto2.randomUUID
2075
- };
2076
-
2077
- // node_modules/uuid/dist/esm-node/v4.js
2078
- function v4(options, buf, offset) {
2079
- if (native_default.randomUUID && !buf && !options) {
2080
- return native_default.randomUUID();
2081
- }
2082
- options = options || {};
2083
- const rnds = options.random || (options.rng || rng)();
2084
- rnds[6] = rnds[6] & 15 | 64;
2085
- rnds[8] = rnds[8] & 63 | 128;
2086
- if (buf) {
2087
- offset = offset || 0;
2088
- for (let i = 0; i < 16; ++i) {
2089
- buf[offset + i] = rnds[i];
2090
- }
2091
- return buf;
2092
- }
2093
- return unsafeStringify(rnds);
2094
- }
2095
- var v4_default = v4;
2096
-
2097
- // node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js
2098
- var resolvedPath = (resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
2099
- if (input != null && input[memberName] !== void 0) {
2100
- const labelValue = labelValueProvider();
2101
- if (labelValue.length <= 0) {
2102
- throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
2103
- }
2104
- resolvedPath2 = resolvedPath2.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue));
2105
- } else {
2106
- throw new Error("No value provided for input HTTP label: " + memberName + ".");
2107
- }
2108
- return resolvedPath2;
2109
- };
2110
-
2111
- // node_modules/@smithy/smithy-client/dist-es/default-error-handler.js
2112
- var throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => {
2113
- const $metadata = deserializeMetadata(output);
2114
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0;
2115
- const response = new exceptionCtor({
2116
- name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError",
2117
- $fault: "client",
2118
- $metadata
2119
- });
2120
- throw decorateServiceException(response, parsedBody);
2121
- };
2122
- var withBaseException = (ExceptionCtor) => {
2123
- return ({ output, parsedBody, errorCode }) => {
2124
- throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode });
2125
- };
2126
- };
2127
- var deserializeMetadata = (output) => ({
2128
- httpStatusCode: output.statusCode,
2129
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
2130
- extendedRequestId: output.headers["x-amz-id-2"],
2131
- cfId: output.headers["x-amz-cf-id"]
2132
- });
2133
-
2134
- // node_modules/@smithy/smithy-client/dist-es/defaults-mode.js
2135
- var loadConfigsForDefaultMode = (mode) => {
2136
- switch (mode) {
2137
- case "standard":
2138
- return {
2139
- retryMode: "standard",
2140
- connectionTimeout: 3100
2141
- };
2142
- case "in-region":
2143
- return {
2144
- retryMode: "standard",
2145
- connectionTimeout: 1100
2146
- };
2147
- case "cross-region":
2148
- return {
2149
- retryMode: "standard",
2150
- connectionTimeout: 3100
2151
- };
2152
- case "mobile":
2153
- return {
2154
- retryMode: "standard",
2155
- connectionTimeout: 3e4
2156
- };
2157
- default:
2158
- return {};
2159
- }
2160
- };
2161
-
2162
- // node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js
2163
- var warningEmitted = false;
2164
- var emitWarningIfUnsupportedVersion = (version) => {
2165
- if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
2166
- warningEmitted = true;
2167
- }
2168
- };
2169
-
2170
- // node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js
2171
- var getChecksumConfiguration = (runtimeConfig) => {
2172
- const checksumAlgorithms = [];
2173
- for (const id in AlgorithmId) {
2174
- const algorithmId = AlgorithmId[id];
2175
- if (runtimeConfig[algorithmId] === void 0) {
2176
- continue;
2177
- }
2178
- checksumAlgorithms.push({
2179
- algorithmId: () => algorithmId,
2180
- checksumConstructor: () => runtimeConfig[algorithmId]
2181
- });
2182
- }
2183
- return {
2184
- addChecksumAlgorithm(algo) {
2185
- checksumAlgorithms.push(algo);
2186
- },
2187
- checksumAlgorithms() {
2188
- return checksumAlgorithms;
2189
- }
2190
- };
2191
- };
2192
- var resolveChecksumRuntimeConfig = (clientConfig) => {
2193
- const runtimeConfig = {};
2194
- clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
2195
- runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
2196
- });
2197
- return runtimeConfig;
2198
- };
2199
-
2200
- // node_modules/@smithy/smithy-client/dist-es/extensions/retry.js
2201
- var getRetryConfiguration = (runtimeConfig) => {
2202
- return {
2203
- setRetryStrategy(retryStrategy) {
2204
- runtimeConfig.retryStrategy = retryStrategy;
2205
- },
2206
- retryStrategy() {
2207
- return runtimeConfig.retryStrategy;
2208
- }
2209
- };
2210
- };
2211
- var resolveRetryRuntimeConfig = (retryStrategyConfiguration) => {
2212
- const runtimeConfig = {};
2213
- runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();
2214
- return runtimeConfig;
2215
- };
2216
-
2217
- // node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js
2218
- var getDefaultExtensionConfiguration = (runtimeConfig) => {
2219
- return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig));
2220
- };
2221
- var resolveDefaultRuntimeConfig = (config) => {
2222
- return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config));
2223
- };
2224
-
2225
- // node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js
2226
- var getValueFromTextNode = (obj) => {
2227
- const textNodeName = "#text";
2228
- for (const key in obj) {
2229
- if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) {
2230
- obj[key] = obj[key][textNodeName];
2231
- } else if (typeof obj[key] === "object" && obj[key] !== null) {
2232
- obj[key] = getValueFromTextNode(obj[key]);
2233
- }
2234
- }
2235
- return obj;
2236
- };
2237
-
2238
- // node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js
2239
- var isSerializableHeaderValue = (value) => {
2240
- return value != null;
2241
- };
2242
-
2243
- // node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js
2244
- var NoOpLogger = class {
2245
- trace() {
2246
- }
2247
- debug() {
2248
- }
2249
- info() {
2250
- }
2251
- warn() {
2252
- }
2253
- error() {
2254
- }
2255
- };
2256
-
2257
- // node_modules/@smithy/smithy-client/dist-es/object-mapping.js
2258
- function map(arg0, arg1, arg2) {
2259
- let target;
2260
- let filter;
2261
- let instructions;
2262
- if (typeof arg1 === "undefined" && typeof arg2 === "undefined") {
2263
- target = {};
2264
- instructions = arg0;
2265
- } else {
2266
- target = arg0;
2267
- if (typeof arg1 === "function") {
2268
- filter = arg1;
2269
- instructions = arg2;
2270
- return mapWithFilter(target, filter, instructions);
2271
- } else {
2272
- instructions = arg1;
2273
- }
2274
- }
2275
- for (const key of Object.keys(instructions)) {
2276
- if (!Array.isArray(instructions[key])) {
2277
- target[key] = instructions[key];
2278
- continue;
2279
- }
2280
- applyInstruction(target, null, instructions, key);
2281
- }
2282
- return target;
2283
- }
2284
- var take = (source, instructions) => {
2285
- const out = {};
2286
- for (const key in instructions) {
2287
- applyInstruction(out, source, instructions, key);
2288
- }
2289
- return out;
2290
- };
2291
- var mapWithFilter = (target, filter, instructions) => {
2292
- return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => {
2293
- if (Array.isArray(value)) {
2294
- _instructions[key] = value;
2295
- } else {
2296
- if (typeof value === "function") {
2297
- _instructions[key] = [filter, value()];
2298
- } else {
2299
- _instructions[key] = [filter, value];
2300
- }
2301
- }
2302
- return _instructions;
2303
- }, {}));
2304
- };
2305
- var applyInstruction = (target, source, instructions, targetKey) => {
2306
- if (source !== null) {
2307
- let instruction = instructions[targetKey];
2308
- if (typeof instruction === "function") {
2309
- instruction = [, instruction];
2310
- }
2311
- const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction;
2312
- if (typeof filter2 === "function" && filter2(source[sourceKey]) || typeof filter2 !== "function" && !!filter2) {
2313
- target[targetKey] = valueFn(source[sourceKey]);
2314
- }
2315
- return;
2316
- }
2317
- let [filter, value] = instructions[targetKey];
2318
- if (typeof value === "function") {
2319
- let _value;
2320
- const defaultFilterPassed = filter === void 0 && (_value = value()) != null;
2321
- const customFilterPassed = typeof filter === "function" && !!filter(void 0) || typeof filter !== "function" && !!filter;
2322
- if (defaultFilterPassed) {
2323
- target[targetKey] = _value;
2324
- } else if (customFilterPassed) {
2325
- target[targetKey] = value();
2326
- }
2327
- } else {
2328
- const defaultFilterPassed = filter === void 0 && value != null;
2329
- const customFilterPassed = typeof filter === "function" && !!filter(value) || typeof filter !== "function" && !!filter;
2330
- if (defaultFilterPassed || customFilterPassed) {
2331
- target[targetKey] = value;
2332
- }
2333
- }
2334
- };
2335
- var nonNullish = (_) => _ != null;
2336
- var pass = (_) => _;
2337
-
2338
- // node_modules/@smithy/smithy-client/dist-es/ser-utils.js
2339
- var serializeDateTime = (date) => date.toISOString().replace(".000Z", "Z");
2340
-
2341
- // node_modules/@smithy/smithy-client/dist-es/serde-json.js
2342
- var _json = (obj) => {
2343
- if (obj == null) {
2344
- return {};
2345
- }
2346
- if (Array.isArray(obj)) {
2347
- return obj.filter((_) => _ != null).map(_json);
2348
- }
2349
- if (typeof obj === "object") {
2350
- const target = {};
2351
- for (const key of Object.keys(obj)) {
2352
- if (obj[key] == null) {
2353
- continue;
2354
- }
2355
- target[key] = _json(obj[key]);
2356
- }
2357
- return target;
2358
- }
2359
- return obj;
2360
- };
2361
-
2362
- export {
2363
- getHttpHandlerExtensionConfiguration,
2364
- resolveHttpHandlerRuntimeConfig,
2365
- HttpRequest,
2366
- HttpResponse,
2367
- isArrayBuffer,
2368
- fromArrayBuffer,
2369
- fromString,
2370
- fromBase64,
2371
- fromUtf8,
2372
- toUint8Array,
2373
- toUtf8,
2374
- toBase64,
2375
- createChecksumStream2 as createChecksumStream,
2376
- createBufferedReadable,
2377
- getAwsChunkedEncodingStream,
2378
- headStream2 as headStream,
2379
- escapeUri,
2380
- NodeHttpHandler,
2381
- streamCollector,
2382
- fromHex,
2383
- toHex,
2384
- sdkStreamMixin2 as sdkStreamMixin,
2385
- splitStream2 as splitStream,
2386
- collectBody,
2387
- extendedEncodeURIComponent,
2388
- parseBoolean,
2389
- expectInt32,
2390
- expectNonNull,
2391
- expectObject,
2392
- expectString,
2393
- strictParseLong,
2394
- strictParseInt32,
2395
- dateToUtcString,
2396
- parseRfc3339DateTime,
2397
- parseRfc3339DateTimeWithOffset,
2398
- parseRfc7231DateTime,
2399
- v4_default,
2400
- resolvedPath,
2401
- Client,
2402
- Command,
2403
- SENSITIVE_STRING,
2404
- createAggregatedClient,
2405
- ServiceException,
2406
- decorateServiceException,
2407
- withBaseException,
2408
- loadConfigsForDefaultMode,
2409
- emitWarningIfUnsupportedVersion,
2410
- getDefaultExtensionConfiguration,
2411
- resolveDefaultRuntimeConfig,
2412
- getValueFromTextNode,
2413
- isSerializableHeaderValue,
2414
- NoOpLogger,
2415
- map,
2416
- take,
2417
- serializeDateTime,
2418
- _json
2419
- };
2420
- //# sourceMappingURL=chunk-6ZE6VFBF.js.map