@monolayer/sdk 1.2.5 → 1.3.0-canary.2

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 (47) hide show
  1. package/dist/bin/chunk-2DM36AIF.js +60 -0
  2. package/dist/bin/chunk-3TV5KLB7.js +105 -0
  3. package/dist/bin/chunk-54HDPH52.js +116 -0
  4. package/dist/bin/chunk-AKHG66MJ.js +2359 -0
  5. package/dist/bin/chunk-ASIK3ESJ.js +37 -0
  6. package/dist/bin/chunk-AV7FB56K.js +14 -0
  7. package/dist/bin/chunk-D6MRFOU6.js +62 -0
  8. package/dist/bin/chunk-DQ2PXUF5.js +44 -0
  9. package/dist/bin/chunk-GE4ESXBP.js +57 -0
  10. package/dist/bin/chunk-K4XCYO2X.js +1637 -0
  11. package/dist/bin/chunk-KHQQRHZY.js +969 -0
  12. package/dist/bin/chunk-KSHJCBUY.js +938 -0
  13. package/dist/bin/chunk-KW25ZB6Z.js +14 -0
  14. package/dist/bin/chunk-SYAMBCRY.js +54 -0
  15. package/dist/bin/chunk-T4MZMT2A.js +122 -0
  16. package/dist/bin/chunk-U43L2J36.js +1875 -0
  17. package/dist/bin/chunk-UKX3KEC2.js +37 -0
  18. package/dist/bin/chunk-X7GJVU6X.js +182 -0
  19. package/dist/bin/cli.js +23 -61
  20. package/dist/bin/dist-es-4LCK4BMD.js +81 -0
  21. package/dist/bin/dist-es-4ULGGWP4.js +361 -0
  22. package/dist/bin/dist-es-7BYCFULM.js +7 -0
  23. package/dist/bin/dist-es-A2JHLMIV.js +154 -0
  24. package/dist/bin/dist-es-AWY666YH.js +292 -0
  25. package/dist/bin/dist-es-KUMQWKJB.js +194 -0
  26. package/dist/bin/dist-es-TNZXIBKF.js +292 -0
  27. package/dist/bin/dist-es-TV7F3ZAE.js +7 -0
  28. package/dist/bin/dist-es-XD3WAN5D.js +154 -0
  29. package/dist/bin/dist-es-YGJKPYIO.js +81 -0
  30. package/dist/bin/dist-es-YYROUSP5.js +62 -0
  31. package/dist/bin/dist-es-ZOY57CKU.js +62 -0
  32. package/dist/bin/dist-es-ZVXNFAFI.js +194 -0
  33. package/dist/bin/esm-ID5USS7G.js +4773 -0
  34. package/dist/bin/loadSso-55OGDGPY.js +484 -0
  35. package/dist/bin/loadSso-UYOIOSOA.js +480 -0
  36. package/dist/bin/sso-oidc-BHBT6MBW.js +732 -0
  37. package/dist/bin/sso-oidc-WOAY6JEM.js +733 -0
  38. package/dist/bin/sts-22SIO74C.js +1109 -0
  39. package/dist/bin/sts-SCV3QXFF.js +1064 -0
  40. package/dist/bin/sts-YWYJ3LVJ.js +1064 -0
  41. package/dist/cjs/workloads/stateless/broadcast/client/provider.d.ts +3 -1
  42. package/dist/cjs/workloads/stateless/broadcast/client/provider.js +16 -5
  43. package/dist/cjs/workloads/stateless/task/dispatcher.js +31 -0
  44. package/dist/esm/workloads/stateless/broadcast/client/provider.d.ts +3 -1
  45. package/dist/esm/workloads/stateless/broadcast/client/provider.js +16 -5
  46. package/dist/esm/workloads/stateless/task/dispatcher.js +8 -0
  47. package/package.json +1 -1
@@ -0,0 +1,4773 @@
1
+ import { createRequire } from 'module';
2
+ import { ENV_KEY as ENV_KEY$1, ENV_SECRET as ENV_SECRET$1, fromEnv as fromEnv$1 } from './chunk-UKX3KEC2.js';
3
+ import { parseJsonBody as parseJsonBody$1, parseJsonErrorBody as parseJsonErrorBody$1, loadRestJsonErrorCode as loadRestJsonErrorCode$1 } from './chunk-2DM36AIF.js';
4
+ import { awsEndpointFunctions as awsEndpointFunctions$1, resolveUserAgentConfig as resolveUserAgentConfig$1, resolveHostHeaderConfig as resolveHostHeaderConfig$1, getUserAgentPlugin as getUserAgentPlugin$1, getHostHeaderPlugin as getHostHeaderPlugin$1, getLoggerPlugin as getLoggerPlugin$1, getRecursionDetectionPlugin as getRecursionDetectionPlugin$1, emitWarningIfUnsupportedVersion as emitWarningIfUnsupportedVersion$2, NODE_APP_ID_CONFIG_OPTIONS as NODE_APP_ID_CONFIG_OPTIONS$1, createDefaultUserAgentProvider as createDefaultUserAgentProvider$1, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, resolveAwsSdkSigV4Config as resolveAwsSdkSigV4Config$1, getAwsRegionExtensionConfiguration as getAwsRegionExtensionConfiguration$1, resolveAwsRegionExtensionConfiguration as resolveAwsRegionExtensionConfiguration$1, AwsSdkSigV4Signer as AwsSdkSigV4Signer$1 } from './chunk-KHQQRHZY.js';
5
+ import './chunk-KW25ZB6Z.js';
6
+ import { ENV_KEY, ENV_SECRET, fromEnv } from './chunk-ASIK3ESJ.js';
7
+ import { parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode } from './chunk-GE4ESXBP.js';
8
+ import { awsEndpointFunctions, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin, emitWarningIfUnsupportedVersion as emitWarningIfUnsupportedVersion$1, NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider, resolveAwsSdkSigV4Config, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, AwsSdkSigV4Signer } from './chunk-KSHJCBUY.js';
9
+ import { EndpointCache, customEndpointFunctions, getSerdePlugin, getEndpointPlugin, createPaginator, resolveRetryConfig, resolveRegionConfig, resolveEndpointConfig, getRetryPlugin, getContentLengthPlugin, getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin, resolveDefaultsModeConfig, calculateBodyLength, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, Hash, DEFAULT_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, normalizeProvider, getSmithyContext, resolveEndpoint } from './chunk-AKHG66MJ.js';
10
+ import { loadConfig, parseUrl } from './chunk-3TV5KLB7.js';
11
+ import { withBaseException, Command, ServiceException, collectBody, _json, Client, take, HttpRequest, toUint8Array, toHex, emitWarningIfUnsupportedVersion, streamCollector, NodeHttpHandler, getDefaultExtensionConfiguration, getHttpHandlerExtensionConfiguration, resolveDefaultRuntimeConfig, resolveHttpHandlerRuntimeConfig, expectInt32, decorateServiceException, toUtf8, fromUtf8, NoOpLogger, toBase64, fromBase64, loadConfigsForDefaultMode, limitedParseDouble, expectString, expectBoolean, expectUnion } from './chunk-U43L2J36.js';
12
+ import { ENV_PROFILE } from './chunk-X7GJVU6X.js';
13
+ import './chunk-AV7FB56K.js';
14
+ import './chunk-D6MRFOU6.js';
15
+ import { memoize, chain, CredentialsProviderError } from './chunk-54HDPH52.js';
16
+ import { __commonJS, __toESM } from './chunk-DQ2PXUF5.js';
17
+ import { randomUUID } from 'node:crypto';
18
+
19
+ createRequire(import.meta.url);
20
+
21
+ // ../../node_modules/obliterator/iterator.js
22
+ var require_iterator = __commonJS({
23
+ "../../node_modules/obliterator/iterator.js"(exports$1, module) {
24
+ function Iterator(next) {
25
+ Object.defineProperty(this, "_next", {
26
+ writable: false,
27
+ enumerable: false,
28
+ value: next
29
+ });
30
+ this.done = false;
31
+ }
32
+ Iterator.prototype.next = function() {
33
+ if (this.done)
34
+ return { done: true };
35
+ var step = this._next();
36
+ if (step.done)
37
+ this.done = true;
38
+ return step;
39
+ };
40
+ if (typeof Symbol !== "undefined")
41
+ Iterator.prototype[Symbol.iterator] = function() {
42
+ return this;
43
+ };
44
+ Iterator.of = function() {
45
+ var args = arguments, l3 = args.length, i3 = 0;
46
+ return new Iterator(function() {
47
+ if (i3 >= l3)
48
+ return { done: true };
49
+ return { done: false, value: args[i3++] };
50
+ });
51
+ };
52
+ Iterator.empty = function() {
53
+ var iterator = new Iterator(null);
54
+ iterator.done = true;
55
+ return iterator;
56
+ };
57
+ Iterator.is = function(value) {
58
+ if (value instanceof Iterator)
59
+ return true;
60
+ return typeof value === "object" && value !== null && typeof value.next === "function";
61
+ };
62
+ module.exports = Iterator;
63
+ }
64
+ });
65
+
66
+ // ../../node_modules/obliterator/foreach.js
67
+ var require_foreach = __commonJS({
68
+ "../../node_modules/obliterator/foreach.js"(exports$1, module) {
69
+ var ARRAY_BUFFER_SUPPORT = typeof ArrayBuffer !== "undefined";
70
+ var SYMBOL_SUPPORT = typeof Symbol !== "undefined";
71
+ function forEach(iterable, callback) {
72
+ var iterator, k3, i3, l3, s3;
73
+ if (!iterable)
74
+ throw new Error("obliterator/forEach: invalid iterable.");
75
+ if (typeof callback !== "function")
76
+ throw new Error("obliterator/forEach: expecting a callback.");
77
+ if (Array.isArray(iterable) || ARRAY_BUFFER_SUPPORT && ArrayBuffer.isView(iterable) || typeof iterable === "string" || iterable.toString() === "[object Arguments]") {
78
+ for (i3 = 0, l3 = iterable.length; i3 < l3; i3++)
79
+ callback(iterable[i3], i3);
80
+ return;
81
+ }
82
+ if (typeof iterable.forEach === "function") {
83
+ iterable.forEach(callback);
84
+ return;
85
+ }
86
+ if (SYMBOL_SUPPORT && Symbol.iterator in iterable && typeof iterable.next !== "function") {
87
+ iterable = iterable[Symbol.iterator]();
88
+ }
89
+ if (typeof iterable.next === "function") {
90
+ iterator = iterable;
91
+ i3 = 0;
92
+ while (s3 = iterator.next(), s3.done !== true) {
93
+ callback(s3.value, i3);
94
+ i3++;
95
+ }
96
+ return;
97
+ }
98
+ for (k3 in iterable) {
99
+ if (iterable.hasOwnProperty(k3)) {
100
+ callback(iterable[k3], k3);
101
+ }
102
+ }
103
+ return;
104
+ }
105
+ forEach.forEachWithNullKeys = function(iterable, callback) {
106
+ var iterator, k3, i3, l3, s3;
107
+ if (!iterable)
108
+ throw new Error("obliterator/forEachWithNullKeys: invalid iterable.");
109
+ if (typeof callback !== "function")
110
+ throw new Error("obliterator/forEachWithNullKeys: expecting a callback.");
111
+ if (Array.isArray(iterable) || ARRAY_BUFFER_SUPPORT && ArrayBuffer.isView(iterable) || typeof iterable === "string" || iterable.toString() === "[object Arguments]") {
112
+ for (i3 = 0, l3 = iterable.length; i3 < l3; i3++)
113
+ callback(iterable[i3], null);
114
+ return;
115
+ }
116
+ if (iterable instanceof Set) {
117
+ iterable.forEach(function(value) {
118
+ callback(value, null);
119
+ });
120
+ return;
121
+ }
122
+ if (typeof iterable.forEach === "function") {
123
+ iterable.forEach(callback);
124
+ return;
125
+ }
126
+ if (SYMBOL_SUPPORT && Symbol.iterator in iterable && typeof iterable.next !== "function") {
127
+ iterable = iterable[Symbol.iterator]();
128
+ }
129
+ if (typeof iterable.next === "function") {
130
+ iterator = iterable;
131
+ i3 = 0;
132
+ while (s3 = iterator.next(), s3.done !== true) {
133
+ callback(s3.value, null);
134
+ i3++;
135
+ }
136
+ return;
137
+ }
138
+ for (k3 in iterable) {
139
+ if (iterable.hasOwnProperty(k3)) {
140
+ callback(iterable[k3], k3);
141
+ }
142
+ }
143
+ return;
144
+ };
145
+ module.exports = forEach;
146
+ }
147
+ });
148
+
149
+ // ../../node_modules/mnemonist/utils/typed-arrays.js
150
+ var require_typed_arrays = __commonJS({
151
+ "../../node_modules/mnemonist/utils/typed-arrays.js"(exports$1) {
152
+ var MAX_8BIT_INTEGER = Math.pow(2, 8) - 1;
153
+ var MAX_16BIT_INTEGER = Math.pow(2, 16) - 1;
154
+ var MAX_32BIT_INTEGER = Math.pow(2, 32) - 1;
155
+ var MAX_SIGNED_8BIT_INTEGER = Math.pow(2, 7) - 1;
156
+ var MAX_SIGNED_16BIT_INTEGER = Math.pow(2, 15) - 1;
157
+ var MAX_SIGNED_32BIT_INTEGER = Math.pow(2, 31) - 1;
158
+ exports$1.getPointerArray = function(size) {
159
+ var maxIndex = size - 1;
160
+ if (maxIndex <= MAX_8BIT_INTEGER)
161
+ return Uint8Array;
162
+ if (maxIndex <= MAX_16BIT_INTEGER)
163
+ return Uint16Array;
164
+ if (maxIndex <= MAX_32BIT_INTEGER)
165
+ return Uint32Array;
166
+ return Float64Array;
167
+ };
168
+ exports$1.getSignedPointerArray = function(size) {
169
+ var maxIndex = size - 1;
170
+ if (maxIndex <= MAX_SIGNED_8BIT_INTEGER)
171
+ return Int8Array;
172
+ if (maxIndex <= MAX_SIGNED_16BIT_INTEGER)
173
+ return Int16Array;
174
+ if (maxIndex <= MAX_SIGNED_32BIT_INTEGER)
175
+ return Int32Array;
176
+ return Float64Array;
177
+ };
178
+ exports$1.getNumberType = function(value) {
179
+ if (value === (value | 0)) {
180
+ if (Math.sign(value) === -1) {
181
+ if (value <= 127 && value >= -128)
182
+ return Int8Array;
183
+ if (value <= 32767 && value >= -32768)
184
+ return Int16Array;
185
+ return Int32Array;
186
+ } else {
187
+ if (value <= 255)
188
+ return Uint8Array;
189
+ if (value <= 65535)
190
+ return Uint16Array;
191
+ return Uint32Array;
192
+ }
193
+ }
194
+ return Float64Array;
195
+ };
196
+ var TYPE_PRIORITY = {
197
+ Uint8Array: 1,
198
+ Int8Array: 2,
199
+ Uint16Array: 3,
200
+ Int16Array: 4,
201
+ Uint32Array: 5,
202
+ Int32Array: 6,
203
+ Float32Array: 7,
204
+ Float64Array: 8
205
+ };
206
+ exports$1.getMinimalRepresentation = function(array, getter) {
207
+ var maxType = null, maxPriority = 0, p3, t3, v3, i3, l3;
208
+ for (i3 = 0, l3 = array.length; i3 < l3; i3++) {
209
+ v3 = getter ? getter(array[i3]) : array[i3];
210
+ t3 = exports$1.getNumberType(v3);
211
+ p3 = TYPE_PRIORITY[t3.name];
212
+ if (p3 > maxPriority) {
213
+ maxPriority = p3;
214
+ maxType = t3;
215
+ }
216
+ }
217
+ return maxType;
218
+ };
219
+ exports$1.isTypedArray = function(value) {
220
+ return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value);
221
+ };
222
+ exports$1.concat = function() {
223
+ var length = 0, i3, o3, l3;
224
+ for (i3 = 0, l3 = arguments.length; i3 < l3; i3++)
225
+ length += arguments[i3].length;
226
+ var array = new arguments[0].constructor(length);
227
+ for (i3 = 0, o3 = 0; i3 < l3; i3++) {
228
+ array.set(arguments[i3], o3);
229
+ o3 += arguments[i3].length;
230
+ }
231
+ return array;
232
+ };
233
+ exports$1.indices = function(length) {
234
+ var PointerArray = exports$1.getPointerArray(length);
235
+ var array = new PointerArray(length);
236
+ for (var i3 = 0; i3 < length; i3++)
237
+ array[i3] = i3;
238
+ return array;
239
+ };
240
+ }
241
+ });
242
+
243
+ // ../../node_modules/mnemonist/utils/iterables.js
244
+ var require_iterables = __commonJS({
245
+ "../../node_modules/mnemonist/utils/iterables.js"(exports$1) {
246
+ var forEach = require_foreach();
247
+ var typed = require_typed_arrays();
248
+ function isArrayLike(target) {
249
+ return Array.isArray(target) || typed.isTypedArray(target);
250
+ }
251
+ function guessLength(target) {
252
+ if (typeof target.length === "number")
253
+ return target.length;
254
+ if (typeof target.size === "number")
255
+ return target.size;
256
+ return;
257
+ }
258
+ function toArray(target) {
259
+ var l3 = guessLength(target);
260
+ var array = typeof l3 === "number" ? new Array(l3) : [];
261
+ var i3 = 0;
262
+ forEach(target, function(value) {
263
+ array[i3++] = value;
264
+ });
265
+ return array;
266
+ }
267
+ function toArrayWithIndices(target) {
268
+ var l3 = guessLength(target);
269
+ var IndexArray = typeof l3 === "number" ? typed.getPointerArray(l3) : Array;
270
+ var array = typeof l3 === "number" ? new Array(l3) : [];
271
+ var indices = typeof l3 === "number" ? new IndexArray(l3) : [];
272
+ var i3 = 0;
273
+ forEach(target, function(value) {
274
+ array[i3] = value;
275
+ indices[i3] = i3++;
276
+ });
277
+ return [array, indices];
278
+ }
279
+ exports$1.isArrayLike = isArrayLike;
280
+ exports$1.guessLength = guessLength;
281
+ exports$1.toArray = toArray;
282
+ exports$1.toArrayWithIndices = toArrayWithIndices;
283
+ }
284
+ });
285
+
286
+ // ../../node_modules/mnemonist/lru-cache.js
287
+ var require_lru_cache = __commonJS({
288
+ "../../node_modules/mnemonist/lru-cache.js"(exports$1, module) {
289
+ var Iterator = require_iterator();
290
+ var forEach = require_foreach();
291
+ var typed = require_typed_arrays();
292
+ var iterables = require_iterables();
293
+ function LRUCache2(Keys, Values, capacity) {
294
+ if (arguments.length < 2) {
295
+ capacity = Keys;
296
+ Keys = null;
297
+ Values = null;
298
+ }
299
+ this.capacity = capacity;
300
+ if (typeof this.capacity !== "number" || this.capacity <= 0)
301
+ throw new Error("mnemonist/lru-cache: capacity should be positive number.");
302
+ var PointerArray = typed.getPointerArray(capacity);
303
+ this.forward = new PointerArray(capacity);
304
+ this.backward = new PointerArray(capacity);
305
+ this.K = typeof Keys === "function" ? new Keys(capacity) : new Array(capacity);
306
+ this.V = typeof Values === "function" ? new Values(capacity) : new Array(capacity);
307
+ this.size = 0;
308
+ this.head = 0;
309
+ this.tail = 0;
310
+ this.items = {};
311
+ }
312
+ LRUCache2.prototype.clear = function() {
313
+ this.size = 0;
314
+ this.head = 0;
315
+ this.tail = 0;
316
+ this.items = {};
317
+ };
318
+ LRUCache2.prototype.splayOnTop = function(pointer) {
319
+ var oldHead = this.head;
320
+ if (this.head === pointer)
321
+ return this;
322
+ var previous = this.backward[pointer], next = this.forward[pointer];
323
+ if (this.tail === pointer) {
324
+ this.tail = previous;
325
+ } else {
326
+ this.backward[next] = previous;
327
+ }
328
+ this.forward[previous] = next;
329
+ this.backward[oldHead] = pointer;
330
+ this.head = pointer;
331
+ this.forward[pointer] = oldHead;
332
+ return this;
333
+ };
334
+ LRUCache2.prototype.set = function(key, value) {
335
+ var pointer = this.items[key];
336
+ if (typeof pointer !== "undefined") {
337
+ this.splayOnTop(pointer);
338
+ this.V[pointer] = value;
339
+ return;
340
+ }
341
+ if (this.size < this.capacity) {
342
+ pointer = this.size++;
343
+ } else {
344
+ pointer = this.tail;
345
+ this.tail = this.backward[pointer];
346
+ delete this.items[this.K[pointer]];
347
+ }
348
+ this.items[key] = pointer;
349
+ this.K[pointer] = key;
350
+ this.V[pointer] = value;
351
+ this.forward[pointer] = this.head;
352
+ this.backward[this.head] = pointer;
353
+ this.head = pointer;
354
+ };
355
+ LRUCache2.prototype.setpop = function(key, value) {
356
+ var oldValue = null;
357
+ var oldKey = null;
358
+ var pointer = this.items[key];
359
+ if (typeof pointer !== "undefined") {
360
+ this.splayOnTop(pointer);
361
+ oldValue = this.V[pointer];
362
+ this.V[pointer] = value;
363
+ return { evicted: false, key, value: oldValue };
364
+ }
365
+ if (this.size < this.capacity) {
366
+ pointer = this.size++;
367
+ } else {
368
+ pointer = this.tail;
369
+ this.tail = this.backward[pointer];
370
+ oldValue = this.V[pointer];
371
+ oldKey = this.K[pointer];
372
+ delete this.items[this.K[pointer]];
373
+ }
374
+ this.items[key] = pointer;
375
+ this.K[pointer] = key;
376
+ this.V[pointer] = value;
377
+ this.forward[pointer] = this.head;
378
+ this.backward[this.head] = pointer;
379
+ this.head = pointer;
380
+ if (oldKey) {
381
+ return { evicted: true, key: oldKey, value: oldValue };
382
+ } else {
383
+ return null;
384
+ }
385
+ };
386
+ LRUCache2.prototype.has = function(key) {
387
+ return key in this.items;
388
+ };
389
+ LRUCache2.prototype.get = function(key) {
390
+ var pointer = this.items[key];
391
+ if (typeof pointer === "undefined")
392
+ return;
393
+ this.splayOnTop(pointer);
394
+ return this.V[pointer];
395
+ };
396
+ LRUCache2.prototype.peek = function(key) {
397
+ var pointer = this.items[key];
398
+ if (typeof pointer === "undefined")
399
+ return;
400
+ return this.V[pointer];
401
+ };
402
+ LRUCache2.prototype.forEach = function(callback, scope) {
403
+ scope = arguments.length > 1 ? scope : this;
404
+ var i3 = 0, l3 = this.size;
405
+ var pointer = this.head, keys = this.K, values = this.V, forward = this.forward;
406
+ while (i3 < l3) {
407
+ callback.call(scope, values[pointer], keys[pointer], this);
408
+ pointer = forward[pointer];
409
+ i3++;
410
+ }
411
+ };
412
+ LRUCache2.prototype.keys = function() {
413
+ var i3 = 0, l3 = this.size;
414
+ var pointer = this.head, keys = this.K, forward = this.forward;
415
+ return new Iterator(function() {
416
+ if (i3 >= l3)
417
+ return { done: true };
418
+ var key = keys[pointer];
419
+ i3++;
420
+ if (i3 < l3)
421
+ pointer = forward[pointer];
422
+ return {
423
+ done: false,
424
+ value: key
425
+ };
426
+ });
427
+ };
428
+ LRUCache2.prototype.values = function() {
429
+ var i3 = 0, l3 = this.size;
430
+ var pointer = this.head, values = this.V, forward = this.forward;
431
+ return new Iterator(function() {
432
+ if (i3 >= l3)
433
+ return { done: true };
434
+ var value = values[pointer];
435
+ i3++;
436
+ if (i3 < l3)
437
+ pointer = forward[pointer];
438
+ return {
439
+ done: false,
440
+ value
441
+ };
442
+ });
443
+ };
444
+ LRUCache2.prototype.entries = function() {
445
+ var i3 = 0, l3 = this.size;
446
+ var pointer = this.head, keys = this.K, values = this.V, forward = this.forward;
447
+ return new Iterator(function() {
448
+ if (i3 >= l3)
449
+ return { done: true };
450
+ var key = keys[pointer], value = values[pointer];
451
+ i3++;
452
+ if (i3 < l3)
453
+ pointer = forward[pointer];
454
+ return {
455
+ done: false,
456
+ value: [key, value]
457
+ };
458
+ });
459
+ };
460
+ if (typeof Symbol !== "undefined")
461
+ LRUCache2.prototype[Symbol.iterator] = LRUCache2.prototype.entries;
462
+ LRUCache2.prototype.inspect = function() {
463
+ var proxy = /* @__PURE__ */ new Map();
464
+ var iterator = this.entries(), step;
465
+ while (step = iterator.next(), !step.done)
466
+ proxy.set(step.value[0], step.value[1]);
467
+ Object.defineProperty(proxy, "constructor", {
468
+ value: LRUCache2,
469
+ enumerable: false
470
+ });
471
+ return proxy;
472
+ };
473
+ if (typeof Symbol !== "undefined")
474
+ LRUCache2.prototype[Symbol.for("nodejs.util.inspect.custom")] = LRUCache2.prototype.inspect;
475
+ LRUCache2.from = function(iterable, Keys, Values, capacity) {
476
+ if (arguments.length < 2) {
477
+ capacity = iterables.guessLength(iterable);
478
+ if (typeof capacity !== "number")
479
+ throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.");
480
+ } else if (arguments.length === 2) {
481
+ capacity = Keys;
482
+ Keys = null;
483
+ Values = null;
484
+ }
485
+ var cache3 = new LRUCache2(Keys, Values, capacity);
486
+ forEach(iterable, function(value, key) {
487
+ cache3.set(key, value);
488
+ });
489
+ return cache3;
490
+ };
491
+ module.exports = LRUCache2;
492
+ }
493
+ });
494
+
495
+ // ../../node_modules/@aws-sdk/middleware-sdk-sqs/dist-es/queue-url.js
496
+ var resolveQueueUrlConfig = (config) => {
497
+ return Object.assign(config, {
498
+ useQueueUrlAsEndpoint: config.useQueueUrlAsEndpoint ?? true
499
+ });
500
+ };
501
+ function queueUrlMiddleware({ useQueueUrlAsEndpoint, endpoint }) {
502
+ return (next, context) => {
503
+ return async (args) => {
504
+ const { input } = args;
505
+ const resolvedEndpoint = context.endpointV2;
506
+ if (!endpoint && input.QueueUrl && resolvedEndpoint && useQueueUrlAsEndpoint) {
507
+ const logger = context.logger instanceof NoOpLogger || !context.logger?.warn ? console : context.logger;
508
+ try {
509
+ const queueUrl = new URL(input.QueueUrl);
510
+ const queueUrlOrigin = new URL(queueUrl.origin);
511
+ if (resolvedEndpoint.url.origin !== queueUrlOrigin.origin) {
512
+ logger.warn(`QueueUrl=${input.QueueUrl} differs from SQSClient resolved endpoint=${resolvedEndpoint.url.toString()}, using QueueUrl host as endpoint.
513
+ Set [endpoint=string] or [useQueueUrlAsEndpoint=false] on the SQSClient.`);
514
+ context.endpointV2 = {
515
+ ...resolvedEndpoint,
516
+ url: queueUrlOrigin
517
+ };
518
+ }
519
+ } catch (e3) {
520
+ logger.warn(e3);
521
+ }
522
+ }
523
+ return next(args);
524
+ };
525
+ };
526
+ }
527
+ var queueUrlMiddlewareOptions = {
528
+ name: "queueUrlMiddleware",
529
+ relation: "after",
530
+ toMiddleware: "endpointV2Middleware",
531
+ override: true
532
+ };
533
+ var getQueueUrlPlugin = (config) => ({
534
+ applyToStack: (clientStack) => {
535
+ clientStack.addRelativeTo(queueUrlMiddleware(config), queueUrlMiddlewareOptions);
536
+ }
537
+ });
538
+
539
+ // ../../node_modules/@aws-sdk/middleware-sdk-sqs/dist-es/send-message.js
540
+ var sendMessageMiddleware = (options) => (next) => async (args) => {
541
+ const resp = await next({ ...args });
542
+ if (options.md5 === false) {
543
+ return resp;
544
+ }
545
+ const output = resp.output;
546
+ const hash = new options.md5();
547
+ hash.update(toUint8Array(args.input.MessageBody || ""));
548
+ if (output.MD5OfMessageBody !== toHex(await hash.digest())) {
549
+ throw new Error("InvalidChecksumError");
550
+ }
551
+ return resp;
552
+ };
553
+ var sendMessageMiddlewareOptions = {
554
+ step: "initialize",
555
+ tags: ["VALIDATE_BODY_MD5"],
556
+ name: "sendMessageMiddleware",
557
+ override: true
558
+ };
559
+ var getSendMessagePlugin = (config) => ({
560
+ applyToStack: (clientStack) => {
561
+ clientStack.add(sendMessageMiddleware(config), sendMessageMiddlewareOptions);
562
+ }
563
+ });
564
+
565
+ // ../../node_modules/@aws-sdk/middleware-sdk-sqs/dist-es/send-message-batch.js
566
+ var sendMessageBatchMiddleware = (options) => (next) => async (args) => {
567
+ const resp = await next({ ...args });
568
+ if (options.md5 === false) {
569
+ return resp;
570
+ }
571
+ const output = resp.output;
572
+ const messageIds = [];
573
+ const entries = {};
574
+ if (output.Successful !== void 0) {
575
+ for (const entry of output.Successful) {
576
+ if (entry.Id !== void 0) {
577
+ entries[entry.Id] = entry;
578
+ }
579
+ }
580
+ }
581
+ for (const entry of args.input.Entries) {
582
+ if (entries[entry.Id]) {
583
+ const md5 = entries[entry.Id].MD5OfMessageBody;
584
+ const hash = new options.md5();
585
+ hash.update(toUint8Array(entry.MessageBody || ""));
586
+ if (md5 !== toHex(await hash.digest())) {
587
+ messageIds.push(entries[entry.Id].MessageId);
588
+ }
589
+ }
590
+ }
591
+ if (messageIds.length > 0) {
592
+ throw new Error("Invalid MD5 checksum on messages: " + messageIds.join(", "));
593
+ }
594
+ return resp;
595
+ };
596
+ var sendMessageBatchMiddlewareOptions = {
597
+ step: "initialize",
598
+ tags: ["VALIDATE_BODY_MD5"],
599
+ name: "sendMessageBatchMiddleware",
600
+ override: true
601
+ };
602
+ var getSendMessageBatchPlugin = (config) => ({
603
+ applyToStack: (clientStack) => {
604
+ clientStack.add(sendMessageBatchMiddleware(config), sendMessageBatchMiddlewareOptions);
605
+ }
606
+ });
607
+
608
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js
609
+ var _toStr = (val) => {
610
+ if (val == null) {
611
+ return val;
612
+ }
613
+ if (typeof val === "number" || typeof val === "bigint") {
614
+ const warning = new Error(`Received number ${val} where a string was expected.`);
615
+ warning.name = "Warning";
616
+ console.warn(warning);
617
+ return String(val);
618
+ }
619
+ if (typeof val === "boolean") {
620
+ const warning = new Error(`Received boolean ${val} where a string was expected.`);
621
+ warning.name = "Warning";
622
+ console.warn(warning);
623
+ return String(val);
624
+ }
625
+ return val;
626
+ };
627
+ var _toNum = (val) => {
628
+ if (val == null) {
629
+ return val;
630
+ }
631
+ if (typeof val === "string") {
632
+ const num = Number(val);
633
+ if (num.toString() !== val) {
634
+ const warning = new Error(`Received string "${val}" where a number was expected.`);
635
+ warning.name = "Warning";
636
+ console.warn(warning);
637
+ return val;
638
+ }
639
+ return num;
640
+ }
641
+ return val;
642
+ };
643
+
644
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/auth/httpAuthSchemeProvider.js
645
+ var defaultSQSHttpAuthSchemeParametersProvider = async (config, context, input) => {
646
+ return {
647
+ operation: getSmithyContext(context).operation,
648
+ region: await normalizeProvider(config.region)() || (() => {
649
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
650
+ })()
651
+ };
652
+ };
653
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
654
+ return {
655
+ schemeId: "aws.auth#sigv4",
656
+ signingProperties: {
657
+ name: "sqs",
658
+ region: authParameters.region
659
+ },
660
+ propertiesExtractor: (config, context) => ({
661
+ signingProperties: {
662
+ config,
663
+ context
664
+ }
665
+ })
666
+ };
667
+ }
668
+ var defaultSQSHttpAuthSchemeProvider = (authParameters) => {
669
+ const options = [];
670
+ switch (authParameters.operation) {
671
+ default: {
672
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
673
+ }
674
+ }
675
+ return options;
676
+ };
677
+ var resolveHttpAuthSchemeConfig = (config) => {
678
+ const config_0 = resolveAwsSdkSigV4Config(config);
679
+ return Object.assign(config_0, {
680
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
681
+ });
682
+ };
683
+
684
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/endpoint/EndpointParameters.js
685
+ var resolveClientEndpointParameters = (options) => {
686
+ return Object.assign(options, {
687
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
688
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
689
+ defaultSigningName: "sqs"
690
+ });
691
+ };
692
+ var commonParams = {
693
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
694
+ Endpoint: { type: "builtInParams", name: "endpoint" },
695
+ Region: { type: "builtInParams", name: "region" },
696
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
697
+ };
698
+
699
+ // ../../node_modules/@aws-sdk/client-sqs/package.json
700
+ var package_default = {
701
+ version: "3.797.0"};
702
+
703
+ // ../../node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js
704
+ var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
705
+ var remoteProvider = async (init) => {
706
+ const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await import('./dist-es-4ULGGWP4.js');
707
+ if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {
708
+ init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");
709
+ const { fromHttp } = await import('./dist-es-XD3WAN5D.js');
710
+ return chain(fromHttp(init), fromContainerMetadata(init));
711
+ }
712
+ if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") {
713
+ return async () => {
714
+ throw new CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger });
715
+ };
716
+ }
717
+ init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata");
718
+ return fromInstanceMetadata(init);
719
+ };
720
+
721
+ // ../../node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js
722
+ var multipleCredentialSourceWarningEmitted = false;
723
+ var defaultProvider = (init = {}) => memoize(chain(async () => {
724
+ const profile = init.profile ?? process.env[ENV_PROFILE];
725
+ if (profile) {
726
+ const envStaticCredentialsAreSet = process.env[ENV_KEY] && process.env[ENV_SECRET];
727
+ if (envStaticCredentialsAreSet) {
728
+ if (!multipleCredentialSourceWarningEmitted) {
729
+ const warnFn = init.logger?.warn && init.logger?.constructor?.name !== "NoOpLogger" ? init.logger.warn : console.warn;
730
+ warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
731
+ Multiple credential sources detected:
732
+ Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
733
+ This SDK will proceed with the AWS_PROFILE value.
734
+
735
+ However, a future version may change this behavior to prefer the ENV static credentials.
736
+ Please ensure that your environment only sets either the AWS_PROFILE or the
737
+ AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
738
+ `);
739
+ multipleCredentialSourceWarningEmitted = true;
740
+ }
741
+ }
742
+ throw new CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", {
743
+ logger: init.logger,
744
+ tryNextLink: true
745
+ });
746
+ }
747
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv");
748
+ return fromEnv(init)();
749
+ }, async () => {
750
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");
751
+ const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
752
+ if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
753
+ throw new CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger });
754
+ }
755
+ const { fromSSO } = await import('./dist-es-TNZXIBKF.js');
756
+ return fromSSO(init)();
757
+ }, async () => {
758
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");
759
+ const { fromIni } = await import('./dist-es-ZVXNFAFI.js');
760
+ return fromIni(init)();
761
+ }, async () => {
762
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");
763
+ const { fromProcess } = await import('./dist-es-4LCK4BMD.js');
764
+ return fromProcess(init)();
765
+ }, async () => {
766
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");
767
+ const { fromTokenFile } = await import('./dist-es-ZOY57CKU.js');
768
+ return fromTokenFile(init)();
769
+ }, async () => {
770
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider");
771
+ return (await remoteProvider(init))();
772
+ }, async () => {
773
+ throw new CredentialsProviderError("Could not load credentials from any providers", {
774
+ tryNextLink: false,
775
+ logger: init.logger
776
+ });
777
+ }), credentialsTreatedAsExpired, credentialsWillNeedRefresh);
778
+ var credentialsWillNeedRefresh = (credentials) => credentials?.expiration !== void 0;
779
+ var credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5;
780
+
781
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/endpoint/ruleset.js
782
+ var u = "required";
783
+ var v = "fn";
784
+ var w = "argv";
785
+ var x = "ref";
786
+ var a = true;
787
+ var b = "isSet";
788
+ var c = "booleanEquals";
789
+ var d = "error";
790
+ var e = "endpoint";
791
+ var f = "tree";
792
+ var g = "PartitionResult";
793
+ var h = "getAttr";
794
+ var i = { [u]: false, "type": "String" };
795
+ var j = { [u]: true, "default": false, "type": "Boolean" };
796
+ var k = { [x]: "Endpoint" };
797
+ var l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] };
798
+ var m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] };
799
+ var n = {};
800
+ var o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] };
801
+ var p = { [x]: g };
802
+ var q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] };
803
+ var r = [l];
804
+ var s = [m];
805
+ var t = [{ [x]: "Region" }];
806
+ var _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://sqs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sqs.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://sqs-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://sqs.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://sqs.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
807
+ var ruleSet = _data;
808
+
809
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/endpoint/endpointResolver.js
810
+ var cache = new EndpointCache({
811
+ size: 50,
812
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
813
+ });
814
+ var defaultEndpointResolver = (endpointParams, context = {}) => {
815
+ return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
816
+ endpointParams,
817
+ logger: context.logger
818
+ }));
819
+ };
820
+ customEndpointFunctions.aws = awsEndpointFunctions;
821
+
822
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/runtimeConfig.shared.js
823
+ var getRuntimeConfig = (config) => {
824
+ return {
825
+ apiVersion: "2012-11-05",
826
+ base64Decoder: config?.base64Decoder ?? fromBase64,
827
+ base64Encoder: config?.base64Encoder ?? toBase64,
828
+ disableHostPrefix: config?.disableHostPrefix ?? false,
829
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
830
+ extensions: config?.extensions ?? [],
831
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSQSHttpAuthSchemeProvider,
832
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
833
+ {
834
+ schemeId: "aws.auth#sigv4",
835
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
836
+ signer: new AwsSdkSigV4Signer()
837
+ }
838
+ ],
839
+ logger: config?.logger ?? new NoOpLogger(),
840
+ serviceId: config?.serviceId ?? "SQS",
841
+ urlParser: config?.urlParser ?? parseUrl,
842
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
843
+ utf8Encoder: config?.utf8Encoder ?? toUtf8
844
+ };
845
+ };
846
+
847
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/runtimeConfig.js
848
+ var getRuntimeConfig2 = (config) => {
849
+ emitWarningIfUnsupportedVersion(process.version);
850
+ const defaultsMode = resolveDefaultsModeConfig(config);
851
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
852
+ const clientSharedValues = getRuntimeConfig(config);
853
+ emitWarningIfUnsupportedVersion$1(process.version);
854
+ const profileConfig = { profile: config?.profile };
855
+ return {
856
+ ...clientSharedValues,
857
+ ...config,
858
+ runtime: "node",
859
+ defaultsMode,
860
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
861
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
862
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }),
863
+ maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
864
+ md5: config?.md5 ?? Hash.bind(null, "md5"),
865
+ region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
866
+ requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
867
+ retryMode: config?.retryMode ?? loadConfig({
868
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
869
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE
870
+ }, config),
871
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
872
+ streamCollector: config?.streamCollector ?? streamCollector,
873
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
874
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
875
+ userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig)
876
+ };
877
+ };
878
+
879
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/auth/httpAuthExtensionConfiguration.js
880
+ var getHttpAuthExtensionConfiguration = (runtimeConfig) => {
881
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
882
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
883
+ let _credentials = runtimeConfig.credentials;
884
+ return {
885
+ setHttpAuthScheme(httpAuthScheme) {
886
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
887
+ if (index === -1) {
888
+ _httpAuthSchemes.push(httpAuthScheme);
889
+ } else {
890
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
891
+ }
892
+ },
893
+ httpAuthSchemes() {
894
+ return _httpAuthSchemes;
895
+ },
896
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
897
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
898
+ },
899
+ httpAuthSchemeProvider() {
900
+ return _httpAuthSchemeProvider;
901
+ },
902
+ setCredentials(credentials) {
903
+ _credentials = credentials;
904
+ },
905
+ credentials() {
906
+ return _credentials;
907
+ }
908
+ };
909
+ };
910
+ var resolveHttpAuthRuntimeConfig = (config) => {
911
+ return {
912
+ httpAuthSchemes: config.httpAuthSchemes(),
913
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
914
+ credentials: config.credentials()
915
+ };
916
+ };
917
+
918
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/runtimeExtensions.js
919
+ var resolveRuntimeExtensions = (runtimeConfig, extensions) => {
920
+ const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
921
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
922
+ return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
923
+ };
924
+
925
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/SQSClient.js
926
+ var SQSClient = class extends Client {
927
+ config;
928
+ constructor(...[configuration]) {
929
+ const _config_0 = getRuntimeConfig2(configuration || {});
930
+ super(_config_0);
931
+ this.initConfig = _config_0;
932
+ const _config_1 = resolveClientEndpointParameters(_config_0);
933
+ const _config_2 = resolveUserAgentConfig(_config_1);
934
+ const _config_3 = resolveRetryConfig(_config_2);
935
+ const _config_4 = resolveRegionConfig(_config_3);
936
+ const _config_5 = resolveHostHeaderConfig(_config_4);
937
+ const _config_6 = resolveEndpointConfig(_config_5);
938
+ const _config_7 = resolveQueueUrlConfig(_config_6);
939
+ const _config_8 = resolveHttpAuthSchemeConfig(_config_7);
940
+ const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []);
941
+ this.config = _config_9;
942
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
943
+ this.middlewareStack.use(getRetryPlugin(this.config));
944
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
945
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
946
+ this.middlewareStack.use(getLoggerPlugin(this.config));
947
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
948
+ this.middlewareStack.use(getQueueUrlPlugin(this.config));
949
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
950
+ httpAuthSchemeParametersProvider: defaultSQSHttpAuthSchemeParametersProvider,
951
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
952
+ "aws.auth#sigv4": config.credentials
953
+ })
954
+ }));
955
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
956
+ }
957
+ destroy() {
958
+ super.destroy();
959
+ }
960
+ };
961
+
962
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/models/SQSServiceException.js
963
+ var SQSServiceException = class _SQSServiceException extends ServiceException {
964
+ constructor(options) {
965
+ super(options);
966
+ Object.setPrototypeOf(this, _SQSServiceException.prototype);
967
+ }
968
+ };
969
+
970
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/models/models_0.js
971
+ var InvalidAddress = class _InvalidAddress extends SQSServiceException {
972
+ name = "InvalidAddress";
973
+ $fault = "client";
974
+ constructor(opts) {
975
+ super({
976
+ name: "InvalidAddress",
977
+ $fault: "client",
978
+ ...opts
979
+ });
980
+ Object.setPrototypeOf(this, _InvalidAddress.prototype);
981
+ }
982
+ };
983
+ var InvalidSecurity = class _InvalidSecurity extends SQSServiceException {
984
+ name = "InvalidSecurity";
985
+ $fault = "client";
986
+ constructor(opts) {
987
+ super({
988
+ name: "InvalidSecurity",
989
+ $fault: "client",
990
+ ...opts
991
+ });
992
+ Object.setPrototypeOf(this, _InvalidSecurity.prototype);
993
+ }
994
+ };
995
+ var OverLimit = class _OverLimit extends SQSServiceException {
996
+ name = "OverLimit";
997
+ $fault = "client";
998
+ constructor(opts) {
999
+ super({
1000
+ name: "OverLimit",
1001
+ $fault: "client",
1002
+ ...opts
1003
+ });
1004
+ Object.setPrototypeOf(this, _OverLimit.prototype);
1005
+ }
1006
+ };
1007
+ var QueueDoesNotExist = class _QueueDoesNotExist extends SQSServiceException {
1008
+ name = "QueueDoesNotExist";
1009
+ $fault = "client";
1010
+ constructor(opts) {
1011
+ super({
1012
+ name: "QueueDoesNotExist",
1013
+ $fault: "client",
1014
+ ...opts
1015
+ });
1016
+ Object.setPrototypeOf(this, _QueueDoesNotExist.prototype);
1017
+ }
1018
+ };
1019
+ var RequestThrottled = class _RequestThrottled extends SQSServiceException {
1020
+ name = "RequestThrottled";
1021
+ $fault = "client";
1022
+ constructor(opts) {
1023
+ super({
1024
+ name: "RequestThrottled",
1025
+ $fault: "client",
1026
+ ...opts
1027
+ });
1028
+ Object.setPrototypeOf(this, _RequestThrottled.prototype);
1029
+ }
1030
+ };
1031
+ var UnsupportedOperation = class _UnsupportedOperation extends SQSServiceException {
1032
+ name = "UnsupportedOperation";
1033
+ $fault = "client";
1034
+ constructor(opts) {
1035
+ super({
1036
+ name: "UnsupportedOperation",
1037
+ $fault: "client",
1038
+ ...opts
1039
+ });
1040
+ Object.setPrototypeOf(this, _UnsupportedOperation.prototype);
1041
+ }
1042
+ };
1043
+ var ResourceNotFoundException = class _ResourceNotFoundException extends SQSServiceException {
1044
+ name = "ResourceNotFoundException";
1045
+ $fault = "client";
1046
+ constructor(opts) {
1047
+ super({
1048
+ name: "ResourceNotFoundException",
1049
+ $fault: "client",
1050
+ ...opts
1051
+ });
1052
+ Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
1053
+ }
1054
+ };
1055
+ var MessageNotInflight = class _MessageNotInflight extends SQSServiceException {
1056
+ name = "MessageNotInflight";
1057
+ $fault = "client";
1058
+ constructor(opts) {
1059
+ super({
1060
+ name: "MessageNotInflight",
1061
+ $fault: "client",
1062
+ ...opts
1063
+ });
1064
+ Object.setPrototypeOf(this, _MessageNotInflight.prototype);
1065
+ }
1066
+ };
1067
+ var ReceiptHandleIsInvalid = class _ReceiptHandleIsInvalid extends SQSServiceException {
1068
+ name = "ReceiptHandleIsInvalid";
1069
+ $fault = "client";
1070
+ constructor(opts) {
1071
+ super({
1072
+ name: "ReceiptHandleIsInvalid",
1073
+ $fault: "client",
1074
+ ...opts
1075
+ });
1076
+ Object.setPrototypeOf(this, _ReceiptHandleIsInvalid.prototype);
1077
+ }
1078
+ };
1079
+ var BatchEntryIdsNotDistinct = class _BatchEntryIdsNotDistinct extends SQSServiceException {
1080
+ name = "BatchEntryIdsNotDistinct";
1081
+ $fault = "client";
1082
+ constructor(opts) {
1083
+ super({
1084
+ name: "BatchEntryIdsNotDistinct",
1085
+ $fault: "client",
1086
+ ...opts
1087
+ });
1088
+ Object.setPrototypeOf(this, _BatchEntryIdsNotDistinct.prototype);
1089
+ }
1090
+ };
1091
+ var EmptyBatchRequest = class _EmptyBatchRequest extends SQSServiceException {
1092
+ name = "EmptyBatchRequest";
1093
+ $fault = "client";
1094
+ constructor(opts) {
1095
+ super({
1096
+ name: "EmptyBatchRequest",
1097
+ $fault: "client",
1098
+ ...opts
1099
+ });
1100
+ Object.setPrototypeOf(this, _EmptyBatchRequest.prototype);
1101
+ }
1102
+ };
1103
+ var InvalidBatchEntryId = class _InvalidBatchEntryId extends SQSServiceException {
1104
+ name = "InvalidBatchEntryId";
1105
+ $fault = "client";
1106
+ constructor(opts) {
1107
+ super({
1108
+ name: "InvalidBatchEntryId",
1109
+ $fault: "client",
1110
+ ...opts
1111
+ });
1112
+ Object.setPrototypeOf(this, _InvalidBatchEntryId.prototype);
1113
+ }
1114
+ };
1115
+ var TooManyEntriesInBatchRequest = class _TooManyEntriesInBatchRequest extends SQSServiceException {
1116
+ name = "TooManyEntriesInBatchRequest";
1117
+ $fault = "client";
1118
+ constructor(opts) {
1119
+ super({
1120
+ name: "TooManyEntriesInBatchRequest",
1121
+ $fault: "client",
1122
+ ...opts
1123
+ });
1124
+ Object.setPrototypeOf(this, _TooManyEntriesInBatchRequest.prototype);
1125
+ }
1126
+ };
1127
+ var InvalidAttributeName = class _InvalidAttributeName extends SQSServiceException {
1128
+ name = "InvalidAttributeName";
1129
+ $fault = "client";
1130
+ constructor(opts) {
1131
+ super({
1132
+ name: "InvalidAttributeName",
1133
+ $fault: "client",
1134
+ ...opts
1135
+ });
1136
+ Object.setPrototypeOf(this, _InvalidAttributeName.prototype);
1137
+ }
1138
+ };
1139
+ var InvalidAttributeValue = class _InvalidAttributeValue extends SQSServiceException {
1140
+ name = "InvalidAttributeValue";
1141
+ $fault = "client";
1142
+ constructor(opts) {
1143
+ super({
1144
+ name: "InvalidAttributeValue",
1145
+ $fault: "client",
1146
+ ...opts
1147
+ });
1148
+ Object.setPrototypeOf(this, _InvalidAttributeValue.prototype);
1149
+ }
1150
+ };
1151
+ var QueueDeletedRecently = class _QueueDeletedRecently extends SQSServiceException {
1152
+ name = "QueueDeletedRecently";
1153
+ $fault = "client";
1154
+ constructor(opts) {
1155
+ super({
1156
+ name: "QueueDeletedRecently",
1157
+ $fault: "client",
1158
+ ...opts
1159
+ });
1160
+ Object.setPrototypeOf(this, _QueueDeletedRecently.prototype);
1161
+ }
1162
+ };
1163
+ var QueueNameExists = class _QueueNameExists extends SQSServiceException {
1164
+ name = "QueueNameExists";
1165
+ $fault = "client";
1166
+ constructor(opts) {
1167
+ super({
1168
+ name: "QueueNameExists",
1169
+ $fault: "client",
1170
+ ...opts
1171
+ });
1172
+ Object.setPrototypeOf(this, _QueueNameExists.prototype);
1173
+ }
1174
+ };
1175
+ var InvalidIdFormat = class _InvalidIdFormat extends SQSServiceException {
1176
+ name = "InvalidIdFormat";
1177
+ $fault = "client";
1178
+ constructor(opts) {
1179
+ super({
1180
+ name: "InvalidIdFormat",
1181
+ $fault: "client",
1182
+ ...opts
1183
+ });
1184
+ Object.setPrototypeOf(this, _InvalidIdFormat.prototype);
1185
+ }
1186
+ };
1187
+ var PurgeQueueInProgress = class _PurgeQueueInProgress extends SQSServiceException {
1188
+ name = "PurgeQueueInProgress";
1189
+ $fault = "client";
1190
+ constructor(opts) {
1191
+ super({
1192
+ name: "PurgeQueueInProgress",
1193
+ $fault: "client",
1194
+ ...opts
1195
+ });
1196
+ Object.setPrototypeOf(this, _PurgeQueueInProgress.prototype);
1197
+ }
1198
+ };
1199
+ var KmsAccessDenied = class _KmsAccessDenied extends SQSServiceException {
1200
+ name = "KmsAccessDenied";
1201
+ $fault = "client";
1202
+ constructor(opts) {
1203
+ super({
1204
+ name: "KmsAccessDenied",
1205
+ $fault: "client",
1206
+ ...opts
1207
+ });
1208
+ Object.setPrototypeOf(this, _KmsAccessDenied.prototype);
1209
+ }
1210
+ };
1211
+ var KmsDisabled = class _KmsDisabled extends SQSServiceException {
1212
+ name = "KmsDisabled";
1213
+ $fault = "client";
1214
+ constructor(opts) {
1215
+ super({
1216
+ name: "KmsDisabled",
1217
+ $fault: "client",
1218
+ ...opts
1219
+ });
1220
+ Object.setPrototypeOf(this, _KmsDisabled.prototype);
1221
+ }
1222
+ };
1223
+ var KmsInvalidKeyUsage = class _KmsInvalidKeyUsage extends SQSServiceException {
1224
+ name = "KmsInvalidKeyUsage";
1225
+ $fault = "client";
1226
+ constructor(opts) {
1227
+ super({
1228
+ name: "KmsInvalidKeyUsage",
1229
+ $fault: "client",
1230
+ ...opts
1231
+ });
1232
+ Object.setPrototypeOf(this, _KmsInvalidKeyUsage.prototype);
1233
+ }
1234
+ };
1235
+ var KmsInvalidState = class _KmsInvalidState extends SQSServiceException {
1236
+ name = "KmsInvalidState";
1237
+ $fault = "client";
1238
+ constructor(opts) {
1239
+ super({
1240
+ name: "KmsInvalidState",
1241
+ $fault: "client",
1242
+ ...opts
1243
+ });
1244
+ Object.setPrototypeOf(this, _KmsInvalidState.prototype);
1245
+ }
1246
+ };
1247
+ var KmsNotFound = class _KmsNotFound extends SQSServiceException {
1248
+ name = "KmsNotFound";
1249
+ $fault = "client";
1250
+ constructor(opts) {
1251
+ super({
1252
+ name: "KmsNotFound",
1253
+ $fault: "client",
1254
+ ...opts
1255
+ });
1256
+ Object.setPrototypeOf(this, _KmsNotFound.prototype);
1257
+ }
1258
+ };
1259
+ var KmsOptInRequired = class _KmsOptInRequired extends SQSServiceException {
1260
+ name = "KmsOptInRequired";
1261
+ $fault = "client";
1262
+ constructor(opts) {
1263
+ super({
1264
+ name: "KmsOptInRequired",
1265
+ $fault: "client",
1266
+ ...opts
1267
+ });
1268
+ Object.setPrototypeOf(this, _KmsOptInRequired.prototype);
1269
+ }
1270
+ };
1271
+ var KmsThrottled = class _KmsThrottled extends SQSServiceException {
1272
+ name = "KmsThrottled";
1273
+ $fault = "client";
1274
+ constructor(opts) {
1275
+ super({
1276
+ name: "KmsThrottled",
1277
+ $fault: "client",
1278
+ ...opts
1279
+ });
1280
+ Object.setPrototypeOf(this, _KmsThrottled.prototype);
1281
+ }
1282
+ };
1283
+ var InvalidMessageContents = class _InvalidMessageContents extends SQSServiceException {
1284
+ name = "InvalidMessageContents";
1285
+ $fault = "client";
1286
+ constructor(opts) {
1287
+ super({
1288
+ name: "InvalidMessageContents",
1289
+ $fault: "client",
1290
+ ...opts
1291
+ });
1292
+ Object.setPrototypeOf(this, _InvalidMessageContents.prototype);
1293
+ }
1294
+ };
1295
+ var BatchRequestTooLong = class _BatchRequestTooLong extends SQSServiceException {
1296
+ name = "BatchRequestTooLong";
1297
+ $fault = "client";
1298
+ constructor(opts) {
1299
+ super({
1300
+ name: "BatchRequestTooLong",
1301
+ $fault: "client",
1302
+ ...opts
1303
+ });
1304
+ Object.setPrototypeOf(this, _BatchRequestTooLong.prototype);
1305
+ }
1306
+ };
1307
+
1308
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/protocols/Aws_json1_0.js
1309
+ var se_ChangeMessageVisibilityCommand = async (input, context) => {
1310
+ const headers = sharedHeaders("ChangeMessageVisibility");
1311
+ let body;
1312
+ body = JSON.stringify(se_ChangeMessageVisibilityRequest(input));
1313
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
1314
+ };
1315
+ var se_SendMessageCommand = async (input, context) => {
1316
+ const headers = sharedHeaders("SendMessage");
1317
+ let body;
1318
+ body = JSON.stringify(se_SendMessageRequest(input, context));
1319
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
1320
+ };
1321
+ var se_SendMessageBatchCommand = async (input, context) => {
1322
+ const headers = sharedHeaders("SendMessageBatch");
1323
+ let body;
1324
+ body = JSON.stringify(se_SendMessageBatchRequest(input, context));
1325
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
1326
+ };
1327
+ var de_ChangeMessageVisibilityCommand = async (output, context) => {
1328
+ if (output.statusCode >= 300) {
1329
+ return de_CommandError(output, context);
1330
+ }
1331
+ await collectBody(output.body, context);
1332
+ const response = {
1333
+ $metadata: deserializeMetadata(output)
1334
+ };
1335
+ return response;
1336
+ };
1337
+ var de_SendMessageCommand = async (output, context) => {
1338
+ if (output.statusCode >= 300) {
1339
+ return de_CommandError(output, context);
1340
+ }
1341
+ const data = await parseJsonBody(output.body, context);
1342
+ let contents = {};
1343
+ contents = _json(data);
1344
+ const response = {
1345
+ $metadata: deserializeMetadata(output),
1346
+ ...contents
1347
+ };
1348
+ return response;
1349
+ };
1350
+ var de_SendMessageBatchCommand = async (output, context) => {
1351
+ if (output.statusCode >= 300) {
1352
+ return de_CommandError(output, context);
1353
+ }
1354
+ const data = await parseJsonBody(output.body, context);
1355
+ let contents = {};
1356
+ contents = _json(data);
1357
+ const response = {
1358
+ $metadata: deserializeMetadata(output),
1359
+ ...contents
1360
+ };
1361
+ return response;
1362
+ };
1363
+ var de_CommandError = async (output, context) => {
1364
+ const parsedOutput = {
1365
+ ...output,
1366
+ body: await parseJsonErrorBody(output.body, context)
1367
+ };
1368
+ populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1369
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1370
+ switch (errorCode) {
1371
+ case "InvalidAddress":
1372
+ case "com.amazonaws.sqs#InvalidAddress":
1373
+ throw await de_InvalidAddressRes(parsedOutput);
1374
+ case "InvalidSecurity":
1375
+ case "com.amazonaws.sqs#InvalidSecurity":
1376
+ throw await de_InvalidSecurityRes(parsedOutput);
1377
+ case "OverLimit":
1378
+ case "com.amazonaws.sqs#OverLimit":
1379
+ throw await de_OverLimitRes(parsedOutput);
1380
+ case "QueueDoesNotExist":
1381
+ case "com.amazonaws.sqs#QueueDoesNotExist":
1382
+ throw await de_QueueDoesNotExistRes(parsedOutput);
1383
+ case "RequestThrottled":
1384
+ case "com.amazonaws.sqs#RequestThrottled":
1385
+ throw await de_RequestThrottledRes(parsedOutput);
1386
+ case "UnsupportedOperation":
1387
+ case "com.amazonaws.sqs#UnsupportedOperation":
1388
+ throw await de_UnsupportedOperationRes(parsedOutput);
1389
+ case "ResourceNotFoundException":
1390
+ case "com.amazonaws.sqs#ResourceNotFoundException":
1391
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput);
1392
+ case "MessageNotInflight":
1393
+ case "com.amazonaws.sqs#MessageNotInflight":
1394
+ throw await de_MessageNotInflightRes(parsedOutput);
1395
+ case "ReceiptHandleIsInvalid":
1396
+ case "com.amazonaws.sqs#ReceiptHandleIsInvalid":
1397
+ throw await de_ReceiptHandleIsInvalidRes(parsedOutput);
1398
+ case "BatchEntryIdsNotDistinct":
1399
+ case "com.amazonaws.sqs#BatchEntryIdsNotDistinct":
1400
+ throw await de_BatchEntryIdsNotDistinctRes(parsedOutput);
1401
+ case "EmptyBatchRequest":
1402
+ case "com.amazonaws.sqs#EmptyBatchRequest":
1403
+ throw await de_EmptyBatchRequestRes(parsedOutput);
1404
+ case "InvalidBatchEntryId":
1405
+ case "com.amazonaws.sqs#InvalidBatchEntryId":
1406
+ throw await de_InvalidBatchEntryIdRes(parsedOutput);
1407
+ case "TooManyEntriesInBatchRequest":
1408
+ case "com.amazonaws.sqs#TooManyEntriesInBatchRequest":
1409
+ throw await de_TooManyEntriesInBatchRequestRes(parsedOutput);
1410
+ case "InvalidAttributeName":
1411
+ case "com.amazonaws.sqs#InvalidAttributeName":
1412
+ throw await de_InvalidAttributeNameRes(parsedOutput);
1413
+ case "InvalidAttributeValue":
1414
+ case "com.amazonaws.sqs#InvalidAttributeValue":
1415
+ throw await de_InvalidAttributeValueRes(parsedOutput);
1416
+ case "QueueDeletedRecently":
1417
+ case "com.amazonaws.sqs#QueueDeletedRecently":
1418
+ throw await de_QueueDeletedRecentlyRes(parsedOutput);
1419
+ case "QueueNameExists":
1420
+ case "com.amazonaws.sqs#QueueNameExists":
1421
+ throw await de_QueueNameExistsRes(parsedOutput);
1422
+ case "InvalidIdFormat":
1423
+ case "com.amazonaws.sqs#InvalidIdFormat":
1424
+ throw await de_InvalidIdFormatRes(parsedOutput);
1425
+ case "PurgeQueueInProgress":
1426
+ case "com.amazonaws.sqs#PurgeQueueInProgress":
1427
+ throw await de_PurgeQueueInProgressRes(parsedOutput);
1428
+ case "KmsAccessDenied":
1429
+ case "com.amazonaws.sqs#KmsAccessDenied":
1430
+ throw await de_KmsAccessDeniedRes(parsedOutput);
1431
+ case "KmsDisabled":
1432
+ case "com.amazonaws.sqs#KmsDisabled":
1433
+ throw await de_KmsDisabledRes(parsedOutput);
1434
+ case "KmsInvalidKeyUsage":
1435
+ case "com.amazonaws.sqs#KmsInvalidKeyUsage":
1436
+ throw await de_KmsInvalidKeyUsageRes(parsedOutput);
1437
+ case "KmsInvalidState":
1438
+ case "com.amazonaws.sqs#KmsInvalidState":
1439
+ throw await de_KmsInvalidStateRes(parsedOutput);
1440
+ case "KmsNotFound":
1441
+ case "com.amazonaws.sqs#KmsNotFound":
1442
+ throw await de_KmsNotFoundRes(parsedOutput);
1443
+ case "KmsOptInRequired":
1444
+ case "com.amazonaws.sqs#KmsOptInRequired":
1445
+ throw await de_KmsOptInRequiredRes(parsedOutput);
1446
+ case "KmsThrottled":
1447
+ case "com.amazonaws.sqs#KmsThrottled":
1448
+ throw await de_KmsThrottledRes(parsedOutput);
1449
+ case "InvalidMessageContents":
1450
+ case "com.amazonaws.sqs#InvalidMessageContents":
1451
+ throw await de_InvalidMessageContentsRes(parsedOutput);
1452
+ case "BatchRequestTooLong":
1453
+ case "com.amazonaws.sqs#BatchRequestTooLong":
1454
+ throw await de_BatchRequestTooLongRes(parsedOutput);
1455
+ default:
1456
+ const parsedBody = parsedOutput.body;
1457
+ return throwDefaultError({
1458
+ output,
1459
+ parsedBody,
1460
+ errorCode
1461
+ });
1462
+ }
1463
+ };
1464
+ var de_BatchEntryIdsNotDistinctRes = async (parsedOutput, context) => {
1465
+ const body = parsedOutput.body;
1466
+ const deserialized = _json(body);
1467
+ const exception = new BatchEntryIdsNotDistinct({
1468
+ $metadata: deserializeMetadata(parsedOutput),
1469
+ ...deserialized
1470
+ });
1471
+ return decorateServiceException(exception, body);
1472
+ };
1473
+ var de_BatchRequestTooLongRes = async (parsedOutput, context) => {
1474
+ const body = parsedOutput.body;
1475
+ const deserialized = _json(body);
1476
+ const exception = new BatchRequestTooLong({
1477
+ $metadata: deserializeMetadata(parsedOutput),
1478
+ ...deserialized
1479
+ });
1480
+ return decorateServiceException(exception, body);
1481
+ };
1482
+ var de_EmptyBatchRequestRes = async (parsedOutput, context) => {
1483
+ const body = parsedOutput.body;
1484
+ const deserialized = _json(body);
1485
+ const exception = new EmptyBatchRequest({
1486
+ $metadata: deserializeMetadata(parsedOutput),
1487
+ ...deserialized
1488
+ });
1489
+ return decorateServiceException(exception, body);
1490
+ };
1491
+ var de_InvalidAddressRes = async (parsedOutput, context) => {
1492
+ const body = parsedOutput.body;
1493
+ const deserialized = _json(body);
1494
+ const exception = new InvalidAddress({
1495
+ $metadata: deserializeMetadata(parsedOutput),
1496
+ ...deserialized
1497
+ });
1498
+ return decorateServiceException(exception, body);
1499
+ };
1500
+ var de_InvalidAttributeNameRes = async (parsedOutput, context) => {
1501
+ const body = parsedOutput.body;
1502
+ const deserialized = _json(body);
1503
+ const exception = new InvalidAttributeName({
1504
+ $metadata: deserializeMetadata(parsedOutput),
1505
+ ...deserialized
1506
+ });
1507
+ return decorateServiceException(exception, body);
1508
+ };
1509
+ var de_InvalidAttributeValueRes = async (parsedOutput, context) => {
1510
+ const body = parsedOutput.body;
1511
+ const deserialized = _json(body);
1512
+ const exception = new InvalidAttributeValue({
1513
+ $metadata: deserializeMetadata(parsedOutput),
1514
+ ...deserialized
1515
+ });
1516
+ return decorateServiceException(exception, body);
1517
+ };
1518
+ var de_InvalidBatchEntryIdRes = async (parsedOutput, context) => {
1519
+ const body = parsedOutput.body;
1520
+ const deserialized = _json(body);
1521
+ const exception = new InvalidBatchEntryId({
1522
+ $metadata: deserializeMetadata(parsedOutput),
1523
+ ...deserialized
1524
+ });
1525
+ return decorateServiceException(exception, body);
1526
+ };
1527
+ var de_InvalidIdFormatRes = async (parsedOutput, context) => {
1528
+ const body = parsedOutput.body;
1529
+ const deserialized = _json(body);
1530
+ const exception = new InvalidIdFormat({
1531
+ $metadata: deserializeMetadata(parsedOutput),
1532
+ ...deserialized
1533
+ });
1534
+ return decorateServiceException(exception, body);
1535
+ };
1536
+ var de_InvalidMessageContentsRes = async (parsedOutput, context) => {
1537
+ const body = parsedOutput.body;
1538
+ const deserialized = _json(body);
1539
+ const exception = new InvalidMessageContents({
1540
+ $metadata: deserializeMetadata(parsedOutput),
1541
+ ...deserialized
1542
+ });
1543
+ return decorateServiceException(exception, body);
1544
+ };
1545
+ var de_InvalidSecurityRes = async (parsedOutput, context) => {
1546
+ const body = parsedOutput.body;
1547
+ const deserialized = _json(body);
1548
+ const exception = new InvalidSecurity({
1549
+ $metadata: deserializeMetadata(parsedOutput),
1550
+ ...deserialized
1551
+ });
1552
+ return decorateServiceException(exception, body);
1553
+ };
1554
+ var de_KmsAccessDeniedRes = async (parsedOutput, context) => {
1555
+ const body = parsedOutput.body;
1556
+ const deserialized = _json(body);
1557
+ const exception = new KmsAccessDenied({
1558
+ $metadata: deserializeMetadata(parsedOutput),
1559
+ ...deserialized
1560
+ });
1561
+ return decorateServiceException(exception, body);
1562
+ };
1563
+ var de_KmsDisabledRes = async (parsedOutput, context) => {
1564
+ const body = parsedOutput.body;
1565
+ const deserialized = _json(body);
1566
+ const exception = new KmsDisabled({
1567
+ $metadata: deserializeMetadata(parsedOutput),
1568
+ ...deserialized
1569
+ });
1570
+ return decorateServiceException(exception, body);
1571
+ };
1572
+ var de_KmsInvalidKeyUsageRes = async (parsedOutput, context) => {
1573
+ const body = parsedOutput.body;
1574
+ const deserialized = _json(body);
1575
+ const exception = new KmsInvalidKeyUsage({
1576
+ $metadata: deserializeMetadata(parsedOutput),
1577
+ ...deserialized
1578
+ });
1579
+ return decorateServiceException(exception, body);
1580
+ };
1581
+ var de_KmsInvalidStateRes = async (parsedOutput, context) => {
1582
+ const body = parsedOutput.body;
1583
+ const deserialized = _json(body);
1584
+ const exception = new KmsInvalidState({
1585
+ $metadata: deserializeMetadata(parsedOutput),
1586
+ ...deserialized
1587
+ });
1588
+ return decorateServiceException(exception, body);
1589
+ };
1590
+ var de_KmsNotFoundRes = async (parsedOutput, context) => {
1591
+ const body = parsedOutput.body;
1592
+ const deserialized = _json(body);
1593
+ const exception = new KmsNotFound({
1594
+ $metadata: deserializeMetadata(parsedOutput),
1595
+ ...deserialized
1596
+ });
1597
+ return decorateServiceException(exception, body);
1598
+ };
1599
+ var de_KmsOptInRequiredRes = async (parsedOutput, context) => {
1600
+ const body = parsedOutput.body;
1601
+ const deserialized = _json(body);
1602
+ const exception = new KmsOptInRequired({
1603
+ $metadata: deserializeMetadata(parsedOutput),
1604
+ ...deserialized
1605
+ });
1606
+ return decorateServiceException(exception, body);
1607
+ };
1608
+ var de_KmsThrottledRes = async (parsedOutput, context) => {
1609
+ const body = parsedOutput.body;
1610
+ const deserialized = _json(body);
1611
+ const exception = new KmsThrottled({
1612
+ $metadata: deserializeMetadata(parsedOutput),
1613
+ ...deserialized
1614
+ });
1615
+ return decorateServiceException(exception, body);
1616
+ };
1617
+ var de_MessageNotInflightRes = async (parsedOutput, context) => {
1618
+ const body = parsedOutput.body;
1619
+ const deserialized = _json(body);
1620
+ const exception = new MessageNotInflight({
1621
+ $metadata: deserializeMetadata(parsedOutput),
1622
+ ...deserialized
1623
+ });
1624
+ return decorateServiceException(exception, body);
1625
+ };
1626
+ var de_OverLimitRes = async (parsedOutput, context) => {
1627
+ const body = parsedOutput.body;
1628
+ const deserialized = _json(body);
1629
+ const exception = new OverLimit({
1630
+ $metadata: deserializeMetadata(parsedOutput),
1631
+ ...deserialized
1632
+ });
1633
+ return decorateServiceException(exception, body);
1634
+ };
1635
+ var de_PurgeQueueInProgressRes = async (parsedOutput, context) => {
1636
+ const body = parsedOutput.body;
1637
+ const deserialized = _json(body);
1638
+ const exception = new PurgeQueueInProgress({
1639
+ $metadata: deserializeMetadata(parsedOutput),
1640
+ ...deserialized
1641
+ });
1642
+ return decorateServiceException(exception, body);
1643
+ };
1644
+ var de_QueueDeletedRecentlyRes = async (parsedOutput, context) => {
1645
+ const body = parsedOutput.body;
1646
+ const deserialized = _json(body);
1647
+ const exception = new QueueDeletedRecently({
1648
+ $metadata: deserializeMetadata(parsedOutput),
1649
+ ...deserialized
1650
+ });
1651
+ return decorateServiceException(exception, body);
1652
+ };
1653
+ var de_QueueDoesNotExistRes = async (parsedOutput, context) => {
1654
+ const body = parsedOutput.body;
1655
+ const deserialized = _json(body);
1656
+ const exception = new QueueDoesNotExist({
1657
+ $metadata: deserializeMetadata(parsedOutput),
1658
+ ...deserialized
1659
+ });
1660
+ return decorateServiceException(exception, body);
1661
+ };
1662
+ var de_QueueNameExistsRes = async (parsedOutput, context) => {
1663
+ const body = parsedOutput.body;
1664
+ const deserialized = _json(body);
1665
+ const exception = new QueueNameExists({
1666
+ $metadata: deserializeMetadata(parsedOutput),
1667
+ ...deserialized
1668
+ });
1669
+ return decorateServiceException(exception, body);
1670
+ };
1671
+ var de_ReceiptHandleIsInvalidRes = async (parsedOutput, context) => {
1672
+ const body = parsedOutput.body;
1673
+ const deserialized = _json(body);
1674
+ const exception = new ReceiptHandleIsInvalid({
1675
+ $metadata: deserializeMetadata(parsedOutput),
1676
+ ...deserialized
1677
+ });
1678
+ return decorateServiceException(exception, body);
1679
+ };
1680
+ var de_RequestThrottledRes = async (parsedOutput, context) => {
1681
+ const body = parsedOutput.body;
1682
+ const deserialized = _json(body);
1683
+ const exception = new RequestThrottled({
1684
+ $metadata: deserializeMetadata(parsedOutput),
1685
+ ...deserialized
1686
+ });
1687
+ return decorateServiceException(exception, body);
1688
+ };
1689
+ var de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1690
+ const body = parsedOutput.body;
1691
+ const deserialized = _json(body);
1692
+ const exception = new ResourceNotFoundException({
1693
+ $metadata: deserializeMetadata(parsedOutput),
1694
+ ...deserialized
1695
+ });
1696
+ return decorateServiceException(exception, body);
1697
+ };
1698
+ var de_TooManyEntriesInBatchRequestRes = async (parsedOutput, context) => {
1699
+ const body = parsedOutput.body;
1700
+ const deserialized = _json(body);
1701
+ const exception = new TooManyEntriesInBatchRequest({
1702
+ $metadata: deserializeMetadata(parsedOutput),
1703
+ ...deserialized
1704
+ });
1705
+ return decorateServiceException(exception, body);
1706
+ };
1707
+ var de_UnsupportedOperationRes = async (parsedOutput, context) => {
1708
+ const body = parsedOutput.body;
1709
+ const deserialized = _json(body);
1710
+ const exception = new UnsupportedOperation({
1711
+ $metadata: deserializeMetadata(parsedOutput),
1712
+ ...deserialized
1713
+ });
1714
+ return decorateServiceException(exception, body);
1715
+ };
1716
+ var se_BinaryList = (input, context) => {
1717
+ return input.filter((e3) => e3 != null).map((entry) => {
1718
+ return context.base64Encoder(entry);
1719
+ });
1720
+ };
1721
+ var se_ChangeMessageVisibilityRequest = (input, context) => {
1722
+ return take(input, {
1723
+ QueueUrl: _toStr,
1724
+ ReceiptHandle: _toStr,
1725
+ VisibilityTimeout: _toNum
1726
+ });
1727
+ };
1728
+ var se_MessageAttributeValue = (input, context) => {
1729
+ return take(input, {
1730
+ BinaryListValues: (_) => se_BinaryList(_, context),
1731
+ BinaryValue: context.base64Encoder,
1732
+ DataType: _toStr,
1733
+ StringListValues: (_) => se_StringList(_),
1734
+ StringValue: _toStr
1735
+ });
1736
+ };
1737
+ var se_MessageBodyAttributeMap = (input, context) => {
1738
+ return Object.entries(input).reduce((acc, [key, value]) => {
1739
+ if (value === null) {
1740
+ return acc;
1741
+ }
1742
+ acc[key] = se_MessageAttributeValue(value, context);
1743
+ return acc;
1744
+ }, {});
1745
+ };
1746
+ var se_MessageBodySystemAttributeMap = (input, context) => {
1747
+ return Object.entries(input).reduce((acc, [key, value]) => {
1748
+ if (value === null) {
1749
+ return acc;
1750
+ }
1751
+ acc[key] = se_MessageSystemAttributeValue(value, context);
1752
+ return acc;
1753
+ }, {});
1754
+ };
1755
+ var se_MessageSystemAttributeValue = (input, context) => {
1756
+ return take(input, {
1757
+ BinaryListValues: (_) => se_BinaryList(_, context),
1758
+ BinaryValue: context.base64Encoder,
1759
+ DataType: _toStr,
1760
+ StringListValues: (_) => se_StringList(_),
1761
+ StringValue: _toStr
1762
+ });
1763
+ };
1764
+ var se_SendMessageBatchRequest = (input, context) => {
1765
+ return take(input, {
1766
+ Entries: (_) => se_SendMessageBatchRequestEntryList(_, context),
1767
+ QueueUrl: _toStr
1768
+ });
1769
+ };
1770
+ var se_SendMessageBatchRequestEntry = (input, context) => {
1771
+ return take(input, {
1772
+ DelaySeconds: _toNum,
1773
+ Id: _toStr,
1774
+ MessageAttributes: (_) => se_MessageBodyAttributeMap(_, context),
1775
+ MessageBody: _toStr,
1776
+ MessageDeduplicationId: _toStr,
1777
+ MessageGroupId: _toStr,
1778
+ MessageSystemAttributes: (_) => se_MessageBodySystemAttributeMap(_, context)
1779
+ });
1780
+ };
1781
+ var se_SendMessageBatchRequestEntryList = (input, context) => {
1782
+ return input.filter((e3) => e3 != null).map((entry) => {
1783
+ return se_SendMessageBatchRequestEntry(entry, context);
1784
+ });
1785
+ };
1786
+ var se_SendMessageRequest = (input, context) => {
1787
+ return take(input, {
1788
+ DelaySeconds: _toNum,
1789
+ MessageAttributes: (_) => se_MessageBodyAttributeMap(_, context),
1790
+ MessageBody: _toStr,
1791
+ MessageDeduplicationId: _toStr,
1792
+ MessageGroupId: _toStr,
1793
+ MessageSystemAttributes: (_) => se_MessageBodySystemAttributeMap(_, context),
1794
+ QueueUrl: _toStr
1795
+ });
1796
+ };
1797
+ var se_StringList = (input, context) => {
1798
+ return input.filter((e3) => e3 != null).map((entry) => {
1799
+ return _toStr(entry);
1800
+ });
1801
+ };
1802
+ var deserializeMetadata = (output) => ({
1803
+ httpStatusCode: output.statusCode,
1804
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1805
+ extendedRequestId: output.headers["x-amz-id-2"],
1806
+ cfId: output.headers["x-amz-cf-id"]
1807
+ });
1808
+ var throwDefaultError = withBaseException(SQSServiceException);
1809
+ var buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1810
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1811
+ const contents = {
1812
+ protocol,
1813
+ hostname,
1814
+ port,
1815
+ method: "POST",
1816
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1817
+ headers
1818
+ };
1819
+ if (body !== void 0) {
1820
+ contents.body = body;
1821
+ }
1822
+ return new HttpRequest(contents);
1823
+ };
1824
+ function sharedHeaders(operation) {
1825
+ return {
1826
+ "content-type": "application/x-amz-json-1.0",
1827
+ "x-amz-target": `AmazonSQS.${operation}`,
1828
+ "x-amzn-query-mode": "true"
1829
+ };
1830
+ }
1831
+ var populateBodyWithQueryCompatibility = (parsedOutput, headers) => {
1832
+ const queryErrorHeader = headers["x-amzn-query-error"];
1833
+ if (parsedOutput.body !== void 0 && queryErrorHeader != null) {
1834
+ const codeAndType = queryErrorHeader.split(";");
1835
+ parsedOutput.body.Code = codeAndType[0];
1836
+ parsedOutput.body.Type = codeAndType[1];
1837
+ }
1838
+ };
1839
+
1840
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/commands/ChangeMessageVisibilityCommand.js
1841
+ var ChangeMessageVisibilityCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o3) {
1842
+ return [
1843
+ getSerdePlugin(config, this.serialize, this.deserialize),
1844
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
1845
+ ];
1846
+ }).s("AmazonSQS", "ChangeMessageVisibility", {}).n("SQSClient", "ChangeMessageVisibilityCommand").f(void 0, void 0).ser(se_ChangeMessageVisibilityCommand).de(de_ChangeMessageVisibilityCommand).build() {
1847
+ };
1848
+
1849
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/commands/SendMessageBatchCommand.js
1850
+ var SendMessageBatchCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o3) {
1851
+ return [
1852
+ getSerdePlugin(config, this.serialize, this.deserialize),
1853
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
1854
+ getSendMessageBatchPlugin(config)
1855
+ ];
1856
+ }).s("AmazonSQS", "SendMessageBatch", {}).n("SQSClient", "SendMessageBatchCommand").f(void 0, void 0).ser(se_SendMessageBatchCommand).de(de_SendMessageBatchCommand).build() {
1857
+ };
1858
+
1859
+ // ../../node_modules/@aws-sdk/client-sqs/dist-es/commands/SendMessageCommand.js
1860
+ var SendMessageCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o3) {
1861
+ return [
1862
+ getSerdePlugin(config, this.serialize, this.deserialize),
1863
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
1864
+ getSendMessagePlugin(config)
1865
+ ];
1866
+ }).s("AmazonSQS", "SendMessage", {}).n("SQSClient", "SendMessageCommand").f(void 0, void 0).ser(se_SendMessageCommand).de(de_SendMessageCommand).build() {
1867
+ };
1868
+
1869
+ // ../task-sqs-adapter/dist/esm/snake-case.js
1870
+ var magicSplit = /^[a-zà-öø-ÿа-я]+|[A-ZÀ-ÖØ-ßА-Я][a-zà-öø-ÿа-я]+|[a-zà-öø-ÿа-я]+|[0-9]+|[A-ZÀ-ÖØ-ßА-Я]+(?![a-zà-öø-ÿа-я])/g;
1871
+ var spaceSplit = /\S+/g;
1872
+ function getPartsAndIndexes(string, splitRegex) {
1873
+ const result = { parts: [], prefixes: [] };
1874
+ const matches = string.matchAll(splitRegex);
1875
+ let lastWordEndIndex = 0;
1876
+ for (const match of matches) {
1877
+ if (typeof match.index !== "number")
1878
+ continue;
1879
+ const word = match[0];
1880
+ result.parts.push(word);
1881
+ const prefix = string.slice(lastWordEndIndex, match.index).trim();
1882
+ result.prefixes.push(prefix);
1883
+ lastWordEndIndex = match.index + word.length;
1884
+ }
1885
+ const tail = string.slice(lastWordEndIndex).trim();
1886
+ if (tail) {
1887
+ result.parts.push("");
1888
+ result.prefixes.push(tail);
1889
+ }
1890
+ return result;
1891
+ }
1892
+ function splitAndPrefix(string, options) {
1893
+ const { keepSpecialCharacters = false, keep, prefix = "" } = options || {};
1894
+ const normalString = string.trim().normalize("NFC");
1895
+ const hasSpaces = normalString.includes(" ");
1896
+ const split = hasSpaces ? spaceSplit : magicSplit;
1897
+ const partsAndIndexes = getPartsAndIndexes(normalString, split);
1898
+ return partsAndIndexes.parts.map((_part, i3) => {
1899
+ let foundPrefix = partsAndIndexes.prefixes[i3] || "";
1900
+ let part = _part;
1901
+ if (keepSpecialCharacters === false) {
1902
+ if (keep) {
1903
+ part = part.normalize("NFD").replace(new RegExp(`[^a-zA-Z\xD8\xDF\xF80-9${keep.join("")}]`, "g"), "");
1904
+ }
1905
+ if (!keep) {
1906
+ part = part.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g, "");
1907
+ foundPrefix = "";
1908
+ }
1909
+ }
1910
+ if (keep && foundPrefix) {
1911
+ foundPrefix = foundPrefix.replace(new RegExp(`[^${keep.join("")}]`, "g"), "");
1912
+ }
1913
+ if (i3 === 0) {
1914
+ return foundPrefix + part;
1915
+ }
1916
+ if (!foundPrefix && !part)
1917
+ return "";
1918
+ if (!hasSpaces) {
1919
+ return (foundPrefix || prefix) + part;
1920
+ }
1921
+ if (!foundPrefix && prefix.match(/\s/)) {
1922
+ return " " + part;
1923
+ }
1924
+ return (foundPrefix || prefix) + part;
1925
+ }).filter(Boolean);
1926
+ }
1927
+ function snakeCase(string, options) {
1928
+ return splitAndPrefix(string, { ...options, prefix: "_" }).join("").toLowerCase();
1929
+ }
1930
+
1931
+ // ../task-sqs-adapter/dist/esm/dispatcher.js
1932
+ var sqsClient = new SQSClient({});
1933
+ async function dispatcher(task, data, options) {
1934
+ if (!Array.isArray(data)) {
1935
+ validateJsonStringified(data);
1936
+ return await sendTask(task, options, data);
1937
+ } else {
1938
+ data.forEach((d3) => validateJsonStringified(d3));
1939
+ return await sendTaskBatch(task, options, data);
1940
+ }
1941
+ }
1942
+ async function sendTask(task, options, data) {
1943
+ const queueUrl = sqsTaskQueueURL(task.id);
1944
+ const executionId = randomUUID();
1945
+ await sqsClient.send(new SendMessageCommand(messageEntry(task, queueUrl, options, executionId, data)));
1946
+ return executionId;
1947
+ }
1948
+ async function sendTaskBatch(task, options, data) {
1949
+ const queueUrl = sqsTaskQueueURL(task.id);
1950
+ const entries = data.map((p3) => {
1951
+ const executionId = randomUUID();
1952
+ return {
1953
+ ...messageEntry(task, queueUrl, options, executionId, p3),
1954
+ Id: executionId
1955
+ };
1956
+ });
1957
+ await sqsClient.send(new SendMessageBatchCommand({
1958
+ QueueUrl: queueUrl,
1959
+ Entries: entries
1960
+ }));
1961
+ return entries.map((entry) => entry.Id);
1962
+ }
1963
+ function sqsTaskQueueURL(taskId) {
1964
+ return process.env[`ML_TASK_${snakeCase(taskId).toUpperCase()}_SQS_QUEUE_URL`];
1965
+ }
1966
+ function messageEntry(task, queueUrl, options, executionId, data) {
1967
+ const messageAttributes = {
1968
+ taskId: {
1969
+ DataType: "String",
1970
+ StringValue: task.id
1971
+ },
1972
+ executionId: {
1973
+ DataType: "String",
1974
+ StringValue: executionId
1975
+ },
1976
+ attempts: {
1977
+ DataType: "String",
1978
+ StringValue: String(task.options?.retry?.times ?? 1)
1979
+ }
1980
+ };
1981
+ return {
1982
+ QueueUrl: queueUrl,
1983
+ DelaySeconds: options?.delay ? options.delay / 1e3 : void 0,
1984
+ MessageAttributes: messageAttributes,
1985
+ MessageBody: JSON.stringify(data)
1986
+ };
1987
+ }
1988
+ function validateJsonStringified(data, max = 256e3) {
1989
+ const dataString = JSON.stringify(typeof data === "undefined" ? {} : data);
1990
+ const byteLength = Buffer.byteLength(dataString, "utf8");
1991
+ if (byteLength > max) {
1992
+ throw new Error(`Data size exceeds the limit (${max} bytes)`);
1993
+ }
1994
+ }
1995
+
1996
+ // ../../node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/core/dist-es/submodules/account-id-endpoint/AccountIdEndpointModeConstants.js
1997
+ var DEFAULT_ACCOUNT_ID_ENDPOINT_MODE = "preferred";
1998
+ var ACCOUNT_ID_ENDPOINT_MODE_VALUES = ["disabled", "preferred", "required"];
1999
+ function validateAccountIdEndpointMode(value) {
2000
+ return ACCOUNT_ID_ENDPOINT_MODE_VALUES.includes(value);
2001
+ }
2002
+
2003
+ // ../../node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/core/dist-es/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.js
2004
+ var resolveAccountIdEndpointModeConfig = (input) => {
2005
+ const { accountIdEndpointMode } = input;
2006
+ const accountIdEndpointModeProvider = normalizeProvider(accountIdEndpointMode ?? DEFAULT_ACCOUNT_ID_ENDPOINT_MODE);
2007
+ return Object.assign(input, {
2008
+ accountIdEndpointMode: async () => {
2009
+ const accIdMode = await accountIdEndpointModeProvider();
2010
+ if (!validateAccountIdEndpointMode(accIdMode)) {
2011
+ throw new Error(`Invalid value for accountIdEndpointMode: ${accIdMode}. Valid values are: "required", "preferred", "disabled".`);
2012
+ }
2013
+ return accIdMode;
2014
+ }
2015
+ });
2016
+ };
2017
+
2018
+ // ../../node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/core/dist-es/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.js
2019
+ var err = "Invalid AccountIdEndpointMode value";
2020
+ var _throw = (message) => {
2021
+ throw new Error(message);
2022
+ };
2023
+ var ENV_ACCOUNT_ID_ENDPOINT_MODE = "AWS_ACCOUNT_ID_ENDPOINT_MODE";
2024
+ var CONFIG_ACCOUNT_ID_ENDPOINT_MODE = "account_id_endpoint_mode";
2025
+ var NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS = {
2026
+ environmentVariableSelector: (env) => {
2027
+ const value = env[ENV_ACCOUNT_ID_ENDPOINT_MODE];
2028
+ if (value && !validateAccountIdEndpointMode(value)) {
2029
+ _throw(err);
2030
+ }
2031
+ return value;
2032
+ },
2033
+ configFileSelector: (profile) => {
2034
+ const value = profile[CONFIG_ACCOUNT_ID_ENDPOINT_MODE];
2035
+ if (value && !validateAccountIdEndpointMode(value)) {
2036
+ _throw(err);
2037
+ }
2038
+ return value;
2039
+ },
2040
+ default: DEFAULT_ACCOUNT_ID_ENDPOINT_MODE
2041
+ };
2042
+
2043
+ // ../../node_modules/@aws-sdk/middleware-endpoint-discovery/dist-es/configurations.js
2044
+ var ENV_ENDPOINT_DISCOVERY = ["AWS_ENABLE_ENDPOINT_DISCOVERY", "AWS_ENDPOINT_DISCOVERY_ENABLED"];
2045
+ var CONFIG_ENDPOINT_DISCOVERY = "endpoint_discovery_enabled";
2046
+ var isFalsy = (value) => ["false", "0"].indexOf(value) >= 0;
2047
+ var NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS = {
2048
+ environmentVariableSelector: (env) => {
2049
+ for (let i3 = 0; i3 < ENV_ENDPOINT_DISCOVERY.length; i3++) {
2050
+ const envKey = ENV_ENDPOINT_DISCOVERY[i3];
2051
+ if (envKey in env) {
2052
+ const value = env[envKey];
2053
+ if (value === "") {
2054
+ throw Error(`Environment variable ${envKey} can't be empty of undefined, got "${value}"`);
2055
+ }
2056
+ return !isFalsy(value);
2057
+ }
2058
+ }
2059
+ },
2060
+ configFileSelector: (profile) => {
2061
+ if (CONFIG_ENDPOINT_DISCOVERY in profile) {
2062
+ const value = profile[CONFIG_ENDPOINT_DISCOVERY];
2063
+ if (value === void 0) {
2064
+ throw Error(`Shared config entry ${CONFIG_ENDPOINT_DISCOVERY} can't be undefined, got "${value}"`);
2065
+ }
2066
+ return !isFalsy(value);
2067
+ }
2068
+ },
2069
+ default: void 0
2070
+ };
2071
+
2072
+ // ../../node_modules/@aws-sdk/endpoint-cache/dist-es/EndpointCache.js
2073
+ var import_lru_cache = __toESM(require_lru_cache());
2074
+ var EndpointCache2 = class {
2075
+ cache;
2076
+ constructor(capacity) {
2077
+ this.cache = new import_lru_cache.default(capacity);
2078
+ }
2079
+ getEndpoint(key) {
2080
+ const endpointsWithExpiry = this.get(key);
2081
+ if (!endpointsWithExpiry || endpointsWithExpiry.length === 0) {
2082
+ return void 0;
2083
+ }
2084
+ const endpoints = endpointsWithExpiry.map((endpoint) => endpoint.Address);
2085
+ return endpoints[Math.floor(Math.random() * endpoints.length)];
2086
+ }
2087
+ get(key) {
2088
+ if (!this.has(key)) {
2089
+ return;
2090
+ }
2091
+ const value = this.cache.get(key);
2092
+ if (!value) {
2093
+ return;
2094
+ }
2095
+ const now = Date.now();
2096
+ const endpointsWithExpiry = value.filter((endpoint) => now < endpoint.Expires);
2097
+ if (endpointsWithExpiry.length === 0) {
2098
+ this.delete(key);
2099
+ return void 0;
2100
+ }
2101
+ return endpointsWithExpiry;
2102
+ }
2103
+ set(key, endpoints) {
2104
+ const now = Date.now();
2105
+ this.cache.set(key, endpoints.map(({ Address, CachePeriodInMinutes }) => ({
2106
+ Address,
2107
+ Expires: now + CachePeriodInMinutes * 60 * 1e3
2108
+ })));
2109
+ }
2110
+ delete(key) {
2111
+ this.cache.set(key, []);
2112
+ }
2113
+ has(key) {
2114
+ if (!this.cache.has(key)) {
2115
+ return false;
2116
+ }
2117
+ const endpoints = this.cache.peek(key);
2118
+ if (!endpoints) {
2119
+ return false;
2120
+ }
2121
+ return endpoints.length > 0;
2122
+ }
2123
+ clear() {
2124
+ this.cache.clear();
2125
+ }
2126
+ };
2127
+
2128
+ // ../../node_modules/@aws-sdk/middleware-endpoint-discovery/dist-es/resolveEndpointDiscoveryConfig.js
2129
+ var resolveEndpointDiscoveryConfig = (input, { endpointDiscoveryCommandCtor }) => {
2130
+ const { endpointCacheSize, endpointDiscoveryEnabled, endpointDiscoveryEnabledProvider } = input;
2131
+ return Object.assign(input, {
2132
+ endpointDiscoveryCommandCtor,
2133
+ endpointCache: new EndpointCache2(endpointCacheSize ?? 1e3),
2134
+ endpointDiscoveryEnabled: endpointDiscoveryEnabled !== void 0 ? () => Promise.resolve(endpointDiscoveryEnabled) : endpointDiscoveryEnabledProvider,
2135
+ isClientEndpointDiscoveryEnabled: endpointDiscoveryEnabled !== void 0
2136
+ });
2137
+ };
2138
+
2139
+ // ../../node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js
2140
+ var awsExpectUnion = (value) => {
2141
+ if (value == null) {
2142
+ return void 0;
2143
+ }
2144
+ if (typeof value === "object" && "__type" in value) {
2145
+ delete value.__type;
2146
+ }
2147
+ return expectUnion(value);
2148
+ };
2149
+
2150
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/auth/httpAuthSchemeProvider.js
2151
+ var defaultDynamoDBHttpAuthSchemeParametersProvider = async (config, context, input) => {
2152
+ return {
2153
+ operation: getSmithyContext(context).operation,
2154
+ region: await normalizeProvider(config.region)() || (() => {
2155
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
2156
+ })()
2157
+ };
2158
+ };
2159
+ function createAwsAuthSigv4HttpAuthOption2(authParameters) {
2160
+ return {
2161
+ schemeId: "aws.auth#sigv4",
2162
+ signingProperties: {
2163
+ name: "dynamodb",
2164
+ region: authParameters.region
2165
+ },
2166
+ propertiesExtractor: (config, context) => ({
2167
+ signingProperties: {
2168
+ config,
2169
+ context
2170
+ }
2171
+ })
2172
+ };
2173
+ }
2174
+ var defaultDynamoDBHttpAuthSchemeProvider = (authParameters) => {
2175
+ const options = [];
2176
+ switch (authParameters.operation) {
2177
+ default: {
2178
+ options.push(createAwsAuthSigv4HttpAuthOption2(authParameters));
2179
+ }
2180
+ }
2181
+ return options;
2182
+ };
2183
+ var resolveHttpAuthSchemeConfig2 = (config) => {
2184
+ const config_0 = resolveAwsSdkSigV4Config$1(config);
2185
+ return Object.assign(config_0, {
2186
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
2187
+ });
2188
+ };
2189
+
2190
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/endpoint/EndpointParameters.js
2191
+ var resolveClientEndpointParameters2 = (options) => {
2192
+ return Object.assign(options, {
2193
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
2194
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
2195
+ defaultSigningName: "dynamodb"
2196
+ });
2197
+ };
2198
+ var commonParams2 = {
2199
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
2200
+ AccountId: { type: "builtInParams", name: "accountId" },
2201
+ Endpoint: { type: "builtInParams", name: "endpoint" },
2202
+ Region: { type: "builtInParams", name: "region" },
2203
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
2204
+ AccountIdEndpointMode: { type: "builtInParams", name: "accountIdEndpointMode" }
2205
+ };
2206
+
2207
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/models/DynamoDBServiceException.js
2208
+ var DynamoDBServiceException = class _DynamoDBServiceException extends ServiceException {
2209
+ constructor(options) {
2210
+ super(options);
2211
+ Object.setPrototypeOf(this, _DynamoDBServiceException.prototype);
2212
+ }
2213
+ };
2214
+
2215
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/models/models_0.js
2216
+ var BackupInUseException = class _BackupInUseException extends DynamoDBServiceException {
2217
+ name = "BackupInUseException";
2218
+ $fault = "client";
2219
+ constructor(opts) {
2220
+ super({
2221
+ name: "BackupInUseException",
2222
+ $fault: "client",
2223
+ ...opts
2224
+ });
2225
+ Object.setPrototypeOf(this, _BackupInUseException.prototype);
2226
+ }
2227
+ };
2228
+ var BackupNotFoundException = class _BackupNotFoundException extends DynamoDBServiceException {
2229
+ name = "BackupNotFoundException";
2230
+ $fault = "client";
2231
+ constructor(opts) {
2232
+ super({
2233
+ name: "BackupNotFoundException",
2234
+ $fault: "client",
2235
+ ...opts
2236
+ });
2237
+ Object.setPrototypeOf(this, _BackupNotFoundException.prototype);
2238
+ }
2239
+ };
2240
+ var InternalServerError = class _InternalServerError extends DynamoDBServiceException {
2241
+ name = "InternalServerError";
2242
+ $fault = "server";
2243
+ constructor(opts) {
2244
+ super({
2245
+ name: "InternalServerError",
2246
+ $fault: "server",
2247
+ ...opts
2248
+ });
2249
+ Object.setPrototypeOf(this, _InternalServerError.prototype);
2250
+ }
2251
+ };
2252
+ var RequestLimitExceeded = class _RequestLimitExceeded extends DynamoDBServiceException {
2253
+ name = "RequestLimitExceeded";
2254
+ $fault = "client";
2255
+ constructor(opts) {
2256
+ super({
2257
+ name: "RequestLimitExceeded",
2258
+ $fault: "client",
2259
+ ...opts
2260
+ });
2261
+ Object.setPrototypeOf(this, _RequestLimitExceeded.prototype);
2262
+ }
2263
+ };
2264
+ var InvalidEndpointException = class _InvalidEndpointException extends DynamoDBServiceException {
2265
+ name = "InvalidEndpointException";
2266
+ $fault = "client";
2267
+ Message;
2268
+ constructor(opts) {
2269
+ super({
2270
+ name: "InvalidEndpointException",
2271
+ $fault: "client",
2272
+ ...opts
2273
+ });
2274
+ Object.setPrototypeOf(this, _InvalidEndpointException.prototype);
2275
+ this.Message = opts.Message;
2276
+ }
2277
+ };
2278
+ var ProvisionedThroughputExceededException = class _ProvisionedThroughputExceededException extends DynamoDBServiceException {
2279
+ name = "ProvisionedThroughputExceededException";
2280
+ $fault = "client";
2281
+ constructor(opts) {
2282
+ super({
2283
+ name: "ProvisionedThroughputExceededException",
2284
+ $fault: "client",
2285
+ ...opts
2286
+ });
2287
+ Object.setPrototypeOf(this, _ProvisionedThroughputExceededException.prototype);
2288
+ }
2289
+ };
2290
+ var ResourceNotFoundException2 = class _ResourceNotFoundException extends DynamoDBServiceException {
2291
+ name = "ResourceNotFoundException";
2292
+ $fault = "client";
2293
+ constructor(opts) {
2294
+ super({
2295
+ name: "ResourceNotFoundException",
2296
+ $fault: "client",
2297
+ ...opts
2298
+ });
2299
+ Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
2300
+ }
2301
+ };
2302
+ var ItemCollectionSizeLimitExceededException = class _ItemCollectionSizeLimitExceededException extends DynamoDBServiceException {
2303
+ name = "ItemCollectionSizeLimitExceededException";
2304
+ $fault = "client";
2305
+ constructor(opts) {
2306
+ super({
2307
+ name: "ItemCollectionSizeLimitExceededException",
2308
+ $fault: "client",
2309
+ ...opts
2310
+ });
2311
+ Object.setPrototypeOf(this, _ItemCollectionSizeLimitExceededException.prototype);
2312
+ }
2313
+ };
2314
+ var ContinuousBackupsUnavailableException = class _ContinuousBackupsUnavailableException extends DynamoDBServiceException {
2315
+ name = "ContinuousBackupsUnavailableException";
2316
+ $fault = "client";
2317
+ constructor(opts) {
2318
+ super({
2319
+ name: "ContinuousBackupsUnavailableException",
2320
+ $fault: "client",
2321
+ ...opts
2322
+ });
2323
+ Object.setPrototypeOf(this, _ContinuousBackupsUnavailableException.prototype);
2324
+ }
2325
+ };
2326
+ var LimitExceededException = class _LimitExceededException extends DynamoDBServiceException {
2327
+ name = "LimitExceededException";
2328
+ $fault = "client";
2329
+ constructor(opts) {
2330
+ super({
2331
+ name: "LimitExceededException",
2332
+ $fault: "client",
2333
+ ...opts
2334
+ });
2335
+ Object.setPrototypeOf(this, _LimitExceededException.prototype);
2336
+ }
2337
+ };
2338
+ var TableInUseException = class _TableInUseException extends DynamoDBServiceException {
2339
+ name = "TableInUseException";
2340
+ $fault = "client";
2341
+ constructor(opts) {
2342
+ super({
2343
+ name: "TableInUseException",
2344
+ $fault: "client",
2345
+ ...opts
2346
+ });
2347
+ Object.setPrototypeOf(this, _TableInUseException.prototype);
2348
+ }
2349
+ };
2350
+ var TableNotFoundException = class _TableNotFoundException extends DynamoDBServiceException {
2351
+ name = "TableNotFoundException";
2352
+ $fault = "client";
2353
+ constructor(opts) {
2354
+ super({
2355
+ name: "TableNotFoundException",
2356
+ $fault: "client",
2357
+ ...opts
2358
+ });
2359
+ Object.setPrototypeOf(this, _TableNotFoundException.prototype);
2360
+ }
2361
+ };
2362
+ var GlobalTableAlreadyExistsException = class _GlobalTableAlreadyExistsException extends DynamoDBServiceException {
2363
+ name = "GlobalTableAlreadyExistsException";
2364
+ $fault = "client";
2365
+ constructor(opts) {
2366
+ super({
2367
+ name: "GlobalTableAlreadyExistsException",
2368
+ $fault: "client",
2369
+ ...opts
2370
+ });
2371
+ Object.setPrototypeOf(this, _GlobalTableAlreadyExistsException.prototype);
2372
+ }
2373
+ };
2374
+ var ResourceInUseException = class _ResourceInUseException extends DynamoDBServiceException {
2375
+ name = "ResourceInUseException";
2376
+ $fault = "client";
2377
+ constructor(opts) {
2378
+ super({
2379
+ name: "ResourceInUseException",
2380
+ $fault: "client",
2381
+ ...opts
2382
+ });
2383
+ Object.setPrototypeOf(this, _ResourceInUseException.prototype);
2384
+ }
2385
+ };
2386
+ var ReplicatedWriteConflictException = class _ReplicatedWriteConflictException extends DynamoDBServiceException {
2387
+ name = "ReplicatedWriteConflictException";
2388
+ $fault = "client";
2389
+ constructor(opts) {
2390
+ super({
2391
+ name: "ReplicatedWriteConflictException",
2392
+ $fault: "client",
2393
+ ...opts
2394
+ });
2395
+ Object.setPrototypeOf(this, _ReplicatedWriteConflictException.prototype);
2396
+ }
2397
+ };
2398
+ var TransactionConflictException = class _TransactionConflictException extends DynamoDBServiceException {
2399
+ name = "TransactionConflictException";
2400
+ $fault = "client";
2401
+ constructor(opts) {
2402
+ super({
2403
+ name: "TransactionConflictException",
2404
+ $fault: "client",
2405
+ ...opts
2406
+ });
2407
+ Object.setPrototypeOf(this, _TransactionConflictException.prototype);
2408
+ }
2409
+ };
2410
+ var PolicyNotFoundException = class _PolicyNotFoundException extends DynamoDBServiceException {
2411
+ name = "PolicyNotFoundException";
2412
+ $fault = "client";
2413
+ constructor(opts) {
2414
+ super({
2415
+ name: "PolicyNotFoundException",
2416
+ $fault: "client",
2417
+ ...opts
2418
+ });
2419
+ Object.setPrototypeOf(this, _PolicyNotFoundException.prototype);
2420
+ }
2421
+ };
2422
+ var ExportNotFoundException = class _ExportNotFoundException extends DynamoDBServiceException {
2423
+ name = "ExportNotFoundException";
2424
+ $fault = "client";
2425
+ constructor(opts) {
2426
+ super({
2427
+ name: "ExportNotFoundException",
2428
+ $fault: "client",
2429
+ ...opts
2430
+ });
2431
+ Object.setPrototypeOf(this, _ExportNotFoundException.prototype);
2432
+ }
2433
+ };
2434
+ var GlobalTableNotFoundException = class _GlobalTableNotFoundException extends DynamoDBServiceException {
2435
+ name = "GlobalTableNotFoundException";
2436
+ $fault = "client";
2437
+ constructor(opts) {
2438
+ super({
2439
+ name: "GlobalTableNotFoundException",
2440
+ $fault: "client",
2441
+ ...opts
2442
+ });
2443
+ Object.setPrototypeOf(this, _GlobalTableNotFoundException.prototype);
2444
+ }
2445
+ };
2446
+ var ImportNotFoundException = class _ImportNotFoundException extends DynamoDBServiceException {
2447
+ name = "ImportNotFoundException";
2448
+ $fault = "client";
2449
+ constructor(opts) {
2450
+ super({
2451
+ name: "ImportNotFoundException",
2452
+ $fault: "client",
2453
+ ...opts
2454
+ });
2455
+ Object.setPrototypeOf(this, _ImportNotFoundException.prototype);
2456
+ }
2457
+ };
2458
+ var DuplicateItemException = class _DuplicateItemException extends DynamoDBServiceException {
2459
+ name = "DuplicateItemException";
2460
+ $fault = "client";
2461
+ constructor(opts) {
2462
+ super({
2463
+ name: "DuplicateItemException",
2464
+ $fault: "client",
2465
+ ...opts
2466
+ });
2467
+ Object.setPrototypeOf(this, _DuplicateItemException.prototype);
2468
+ }
2469
+ };
2470
+ var IdempotentParameterMismatchException = class _IdempotentParameterMismatchException extends DynamoDBServiceException {
2471
+ name = "IdempotentParameterMismatchException";
2472
+ $fault = "client";
2473
+ Message;
2474
+ constructor(opts) {
2475
+ super({
2476
+ name: "IdempotentParameterMismatchException",
2477
+ $fault: "client",
2478
+ ...opts
2479
+ });
2480
+ Object.setPrototypeOf(this, _IdempotentParameterMismatchException.prototype);
2481
+ this.Message = opts.Message;
2482
+ }
2483
+ };
2484
+ var TransactionInProgressException = class _TransactionInProgressException extends DynamoDBServiceException {
2485
+ name = "TransactionInProgressException";
2486
+ $fault = "client";
2487
+ Message;
2488
+ constructor(opts) {
2489
+ super({
2490
+ name: "TransactionInProgressException",
2491
+ $fault: "client",
2492
+ ...opts
2493
+ });
2494
+ Object.setPrototypeOf(this, _TransactionInProgressException.prototype);
2495
+ this.Message = opts.Message;
2496
+ }
2497
+ };
2498
+ var ExportConflictException = class _ExportConflictException extends DynamoDBServiceException {
2499
+ name = "ExportConflictException";
2500
+ $fault = "client";
2501
+ constructor(opts) {
2502
+ super({
2503
+ name: "ExportConflictException",
2504
+ $fault: "client",
2505
+ ...opts
2506
+ });
2507
+ Object.setPrototypeOf(this, _ExportConflictException.prototype);
2508
+ }
2509
+ };
2510
+ var InvalidExportTimeException = class _InvalidExportTimeException extends DynamoDBServiceException {
2511
+ name = "InvalidExportTimeException";
2512
+ $fault = "client";
2513
+ constructor(opts) {
2514
+ super({
2515
+ name: "InvalidExportTimeException",
2516
+ $fault: "client",
2517
+ ...opts
2518
+ });
2519
+ Object.setPrototypeOf(this, _InvalidExportTimeException.prototype);
2520
+ }
2521
+ };
2522
+ var PointInTimeRecoveryUnavailableException = class _PointInTimeRecoveryUnavailableException extends DynamoDBServiceException {
2523
+ name = "PointInTimeRecoveryUnavailableException";
2524
+ $fault = "client";
2525
+ constructor(opts) {
2526
+ super({
2527
+ name: "PointInTimeRecoveryUnavailableException",
2528
+ $fault: "client",
2529
+ ...opts
2530
+ });
2531
+ Object.setPrototypeOf(this, _PointInTimeRecoveryUnavailableException.prototype);
2532
+ }
2533
+ };
2534
+ var ImportConflictException = class _ImportConflictException extends DynamoDBServiceException {
2535
+ name = "ImportConflictException";
2536
+ $fault = "client";
2537
+ constructor(opts) {
2538
+ super({
2539
+ name: "ImportConflictException",
2540
+ $fault: "client",
2541
+ ...opts
2542
+ });
2543
+ Object.setPrototypeOf(this, _ImportConflictException.prototype);
2544
+ }
2545
+ };
2546
+ var TableAlreadyExistsException = class _TableAlreadyExistsException extends DynamoDBServiceException {
2547
+ name = "TableAlreadyExistsException";
2548
+ $fault = "client";
2549
+ constructor(opts) {
2550
+ super({
2551
+ name: "TableAlreadyExistsException",
2552
+ $fault: "client",
2553
+ ...opts
2554
+ });
2555
+ Object.setPrototypeOf(this, _TableAlreadyExistsException.prototype);
2556
+ }
2557
+ };
2558
+ var InvalidRestoreTimeException = class _InvalidRestoreTimeException extends DynamoDBServiceException {
2559
+ name = "InvalidRestoreTimeException";
2560
+ $fault = "client";
2561
+ constructor(opts) {
2562
+ super({
2563
+ name: "InvalidRestoreTimeException",
2564
+ $fault: "client",
2565
+ ...opts
2566
+ });
2567
+ Object.setPrototypeOf(this, _InvalidRestoreTimeException.prototype);
2568
+ }
2569
+ };
2570
+ var ReplicaAlreadyExistsException = class _ReplicaAlreadyExistsException extends DynamoDBServiceException {
2571
+ name = "ReplicaAlreadyExistsException";
2572
+ $fault = "client";
2573
+ constructor(opts) {
2574
+ super({
2575
+ name: "ReplicaAlreadyExistsException",
2576
+ $fault: "client",
2577
+ ...opts
2578
+ });
2579
+ Object.setPrototypeOf(this, _ReplicaAlreadyExistsException.prototype);
2580
+ }
2581
+ };
2582
+ var ReplicaNotFoundException = class _ReplicaNotFoundException extends DynamoDBServiceException {
2583
+ name = "ReplicaNotFoundException";
2584
+ $fault = "client";
2585
+ constructor(opts) {
2586
+ super({
2587
+ name: "ReplicaNotFoundException",
2588
+ $fault: "client",
2589
+ ...opts
2590
+ });
2591
+ Object.setPrototypeOf(this, _ReplicaNotFoundException.prototype);
2592
+ }
2593
+ };
2594
+ var IndexNotFoundException = class _IndexNotFoundException extends DynamoDBServiceException {
2595
+ name = "IndexNotFoundException";
2596
+ $fault = "client";
2597
+ constructor(opts) {
2598
+ super({
2599
+ name: "IndexNotFoundException",
2600
+ $fault: "client",
2601
+ ...opts
2602
+ });
2603
+ Object.setPrototypeOf(this, _IndexNotFoundException.prototype);
2604
+ }
2605
+ };
2606
+ var AttributeValue;
2607
+ (function(AttributeValue2) {
2608
+ AttributeValue2.visit = (value, visitor) => {
2609
+ if (value.S !== void 0)
2610
+ return visitor.S(value.S);
2611
+ if (value.N !== void 0)
2612
+ return visitor.N(value.N);
2613
+ if (value.B !== void 0)
2614
+ return visitor.B(value.B);
2615
+ if (value.SS !== void 0)
2616
+ return visitor.SS(value.SS);
2617
+ if (value.NS !== void 0)
2618
+ return visitor.NS(value.NS);
2619
+ if (value.BS !== void 0)
2620
+ return visitor.BS(value.BS);
2621
+ if (value.M !== void 0)
2622
+ return visitor.M(value.M);
2623
+ if (value.L !== void 0)
2624
+ return visitor.L(value.L);
2625
+ if (value.NULL !== void 0)
2626
+ return visitor.NULL(value.NULL);
2627
+ if (value.BOOL !== void 0)
2628
+ return visitor.BOOL(value.BOOL);
2629
+ return visitor._(value.$unknown[0], value.$unknown[1]);
2630
+ };
2631
+ })(AttributeValue || (AttributeValue = {}));
2632
+ var ConditionalCheckFailedException = class _ConditionalCheckFailedException extends DynamoDBServiceException {
2633
+ name = "ConditionalCheckFailedException";
2634
+ $fault = "client";
2635
+ Item;
2636
+ constructor(opts) {
2637
+ super({
2638
+ name: "ConditionalCheckFailedException",
2639
+ $fault: "client",
2640
+ ...opts
2641
+ });
2642
+ Object.setPrototypeOf(this, _ConditionalCheckFailedException.prototype);
2643
+ this.Item = opts.Item;
2644
+ }
2645
+ };
2646
+ var TransactionCanceledException = class _TransactionCanceledException extends DynamoDBServiceException {
2647
+ name = "TransactionCanceledException";
2648
+ $fault = "client";
2649
+ Message;
2650
+ CancellationReasons;
2651
+ constructor(opts) {
2652
+ super({
2653
+ name: "TransactionCanceledException",
2654
+ $fault: "client",
2655
+ ...opts
2656
+ });
2657
+ Object.setPrototypeOf(this, _TransactionCanceledException.prototype);
2658
+ this.Message = opts.Message;
2659
+ this.CancellationReasons = opts.CancellationReasons;
2660
+ }
2661
+ };
2662
+
2663
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/protocols/Aws_json1_0.js
2664
+ var se_BatchWriteItemCommand = async (input, context) => {
2665
+ const headers = sharedHeaders2("BatchWriteItem");
2666
+ let body;
2667
+ body = JSON.stringify(se_BatchWriteItemInput(input, context));
2668
+ return buildHttpRpcRequest2(context, headers, "/", void 0, body);
2669
+ };
2670
+ var se_DescribeEndpointsCommand = async (input, context) => {
2671
+ const headers = sharedHeaders2("DescribeEndpoints");
2672
+ let body;
2673
+ body = JSON.stringify(_json(input));
2674
+ return buildHttpRpcRequest2(context, headers, "/", void 0, body);
2675
+ };
2676
+ var se_PutItemCommand = async (input, context) => {
2677
+ const headers = sharedHeaders2("PutItem");
2678
+ let body;
2679
+ body = JSON.stringify(se_PutItemInput(input, context));
2680
+ return buildHttpRpcRequest2(context, headers, "/", void 0, body);
2681
+ };
2682
+ var se_QueryCommand = async (input, context) => {
2683
+ const headers = sharedHeaders2("Query");
2684
+ let body;
2685
+ body = JSON.stringify(se_QueryInput(input, context));
2686
+ return buildHttpRpcRequest2(context, headers, "/", void 0, body);
2687
+ };
2688
+ var se_ScanCommand = async (input, context) => {
2689
+ const headers = sharedHeaders2("Scan");
2690
+ let body;
2691
+ body = JSON.stringify(se_ScanInput(input, context));
2692
+ return buildHttpRpcRequest2(context, headers, "/", void 0, body);
2693
+ };
2694
+ var se_UpdateItemCommand = async (input, context) => {
2695
+ const headers = sharedHeaders2("UpdateItem");
2696
+ let body;
2697
+ body = JSON.stringify(se_UpdateItemInput(input, context));
2698
+ return buildHttpRpcRequest2(context, headers, "/", void 0, body);
2699
+ };
2700
+ var de_BatchWriteItemCommand = async (output, context) => {
2701
+ if (output.statusCode >= 300) {
2702
+ return de_CommandError2(output, context);
2703
+ }
2704
+ const data = await parseJsonBody$1(output.body, context);
2705
+ let contents = {};
2706
+ contents = de_BatchWriteItemOutput(data, context);
2707
+ const response = {
2708
+ $metadata: deserializeMetadata2(output),
2709
+ ...contents
2710
+ };
2711
+ return response;
2712
+ };
2713
+ var de_DescribeEndpointsCommand = async (output, context) => {
2714
+ if (output.statusCode >= 300) {
2715
+ return de_CommandError2(output, context);
2716
+ }
2717
+ const data = await parseJsonBody$1(output.body, context);
2718
+ let contents = {};
2719
+ contents = _json(data);
2720
+ const response = {
2721
+ $metadata: deserializeMetadata2(output),
2722
+ ...contents
2723
+ };
2724
+ return response;
2725
+ };
2726
+ var de_PutItemCommand = async (output, context) => {
2727
+ if (output.statusCode >= 300) {
2728
+ return de_CommandError2(output, context);
2729
+ }
2730
+ const data = await parseJsonBody$1(output.body, context);
2731
+ let contents = {};
2732
+ contents = de_PutItemOutput(data, context);
2733
+ const response = {
2734
+ $metadata: deserializeMetadata2(output),
2735
+ ...contents
2736
+ };
2737
+ return response;
2738
+ };
2739
+ var de_QueryCommand = async (output, context) => {
2740
+ if (output.statusCode >= 300) {
2741
+ return de_CommandError2(output, context);
2742
+ }
2743
+ const data = await parseJsonBody$1(output.body, context);
2744
+ let contents = {};
2745
+ contents = de_QueryOutput(data, context);
2746
+ const response = {
2747
+ $metadata: deserializeMetadata2(output),
2748
+ ...contents
2749
+ };
2750
+ return response;
2751
+ };
2752
+ var de_ScanCommand = async (output, context) => {
2753
+ if (output.statusCode >= 300) {
2754
+ return de_CommandError2(output, context);
2755
+ }
2756
+ const data = await parseJsonBody$1(output.body, context);
2757
+ let contents = {};
2758
+ contents = de_ScanOutput(data, context);
2759
+ const response = {
2760
+ $metadata: deserializeMetadata2(output),
2761
+ ...contents
2762
+ };
2763
+ return response;
2764
+ };
2765
+ var de_UpdateItemCommand = async (output, context) => {
2766
+ if (output.statusCode >= 300) {
2767
+ return de_CommandError2(output, context);
2768
+ }
2769
+ const data = await parseJsonBody$1(output.body, context);
2770
+ let contents = {};
2771
+ contents = de_UpdateItemOutput(data, context);
2772
+ const response = {
2773
+ $metadata: deserializeMetadata2(output),
2774
+ ...contents
2775
+ };
2776
+ return response;
2777
+ };
2778
+ var de_CommandError2 = async (output, context) => {
2779
+ const parsedOutput = {
2780
+ ...output,
2781
+ body: await parseJsonErrorBody$1(output.body, context)
2782
+ };
2783
+ const errorCode = loadRestJsonErrorCode$1(output, parsedOutput.body);
2784
+ switch (errorCode) {
2785
+ case "InternalServerError":
2786
+ case "com.amazonaws.dynamodb#InternalServerError":
2787
+ throw await de_InternalServerErrorRes(parsedOutput);
2788
+ case "RequestLimitExceeded":
2789
+ case "com.amazonaws.dynamodb#RequestLimitExceeded":
2790
+ throw await de_RequestLimitExceededRes(parsedOutput);
2791
+ case "InvalidEndpointException":
2792
+ case "com.amazonaws.dynamodb#InvalidEndpointException":
2793
+ throw await de_InvalidEndpointExceptionRes(parsedOutput);
2794
+ case "ProvisionedThroughputExceededException":
2795
+ case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException":
2796
+ throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput);
2797
+ case "ResourceNotFoundException":
2798
+ case "com.amazonaws.dynamodb#ResourceNotFoundException":
2799
+ throw await de_ResourceNotFoundExceptionRes2(parsedOutput);
2800
+ case "ItemCollectionSizeLimitExceededException":
2801
+ case "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":
2802
+ throw await de_ItemCollectionSizeLimitExceededExceptionRes(parsedOutput);
2803
+ case "BackupInUseException":
2804
+ case "com.amazonaws.dynamodb#BackupInUseException":
2805
+ throw await de_BackupInUseExceptionRes(parsedOutput);
2806
+ case "ContinuousBackupsUnavailableException":
2807
+ case "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException":
2808
+ throw await de_ContinuousBackupsUnavailableExceptionRes(parsedOutput);
2809
+ case "LimitExceededException":
2810
+ case "com.amazonaws.dynamodb#LimitExceededException":
2811
+ throw await de_LimitExceededExceptionRes(parsedOutput);
2812
+ case "TableInUseException":
2813
+ case "com.amazonaws.dynamodb#TableInUseException":
2814
+ throw await de_TableInUseExceptionRes(parsedOutput);
2815
+ case "TableNotFoundException":
2816
+ case "com.amazonaws.dynamodb#TableNotFoundException":
2817
+ throw await de_TableNotFoundExceptionRes(parsedOutput);
2818
+ case "GlobalTableAlreadyExistsException":
2819
+ case "com.amazonaws.dynamodb#GlobalTableAlreadyExistsException":
2820
+ throw await de_GlobalTableAlreadyExistsExceptionRes(parsedOutput);
2821
+ case "ResourceInUseException":
2822
+ case "com.amazonaws.dynamodb#ResourceInUseException":
2823
+ throw await de_ResourceInUseExceptionRes(parsedOutput);
2824
+ case "BackupNotFoundException":
2825
+ case "com.amazonaws.dynamodb#BackupNotFoundException":
2826
+ throw await de_BackupNotFoundExceptionRes(parsedOutput);
2827
+ case "ConditionalCheckFailedException":
2828
+ case "com.amazonaws.dynamodb#ConditionalCheckFailedException":
2829
+ throw await de_ConditionalCheckFailedExceptionRes(parsedOutput, context);
2830
+ case "ReplicatedWriteConflictException":
2831
+ case "com.amazonaws.dynamodb#ReplicatedWriteConflictException":
2832
+ throw await de_ReplicatedWriteConflictExceptionRes(parsedOutput);
2833
+ case "TransactionConflictException":
2834
+ case "com.amazonaws.dynamodb#TransactionConflictException":
2835
+ throw await de_TransactionConflictExceptionRes(parsedOutput);
2836
+ case "PolicyNotFoundException":
2837
+ case "com.amazonaws.dynamodb#PolicyNotFoundException":
2838
+ throw await de_PolicyNotFoundExceptionRes(parsedOutput);
2839
+ case "ExportNotFoundException":
2840
+ case "com.amazonaws.dynamodb#ExportNotFoundException":
2841
+ throw await de_ExportNotFoundExceptionRes(parsedOutput);
2842
+ case "GlobalTableNotFoundException":
2843
+ case "com.amazonaws.dynamodb#GlobalTableNotFoundException":
2844
+ throw await de_GlobalTableNotFoundExceptionRes(parsedOutput);
2845
+ case "ImportNotFoundException":
2846
+ case "com.amazonaws.dynamodb#ImportNotFoundException":
2847
+ throw await de_ImportNotFoundExceptionRes(parsedOutput);
2848
+ case "DuplicateItemException":
2849
+ case "com.amazonaws.dynamodb#DuplicateItemException":
2850
+ throw await de_DuplicateItemExceptionRes(parsedOutput);
2851
+ case "IdempotentParameterMismatchException":
2852
+ case "com.amazonaws.dynamodb#IdempotentParameterMismatchException":
2853
+ throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput);
2854
+ case "TransactionCanceledException":
2855
+ case "com.amazonaws.dynamodb#TransactionCanceledException":
2856
+ throw await de_TransactionCanceledExceptionRes(parsedOutput, context);
2857
+ case "TransactionInProgressException":
2858
+ case "com.amazonaws.dynamodb#TransactionInProgressException":
2859
+ throw await de_TransactionInProgressExceptionRes(parsedOutput);
2860
+ case "ExportConflictException":
2861
+ case "com.amazonaws.dynamodb#ExportConflictException":
2862
+ throw await de_ExportConflictExceptionRes(parsedOutput);
2863
+ case "InvalidExportTimeException":
2864
+ case "com.amazonaws.dynamodb#InvalidExportTimeException":
2865
+ throw await de_InvalidExportTimeExceptionRes(parsedOutput);
2866
+ case "PointInTimeRecoveryUnavailableException":
2867
+ case "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException":
2868
+ throw await de_PointInTimeRecoveryUnavailableExceptionRes(parsedOutput);
2869
+ case "ImportConflictException":
2870
+ case "com.amazonaws.dynamodb#ImportConflictException":
2871
+ throw await de_ImportConflictExceptionRes(parsedOutput);
2872
+ case "TableAlreadyExistsException":
2873
+ case "com.amazonaws.dynamodb#TableAlreadyExistsException":
2874
+ throw await de_TableAlreadyExistsExceptionRes(parsedOutput);
2875
+ case "InvalidRestoreTimeException":
2876
+ case "com.amazonaws.dynamodb#InvalidRestoreTimeException":
2877
+ throw await de_InvalidRestoreTimeExceptionRes(parsedOutput);
2878
+ case "ReplicaAlreadyExistsException":
2879
+ case "com.amazonaws.dynamodb#ReplicaAlreadyExistsException":
2880
+ throw await de_ReplicaAlreadyExistsExceptionRes(parsedOutput);
2881
+ case "ReplicaNotFoundException":
2882
+ case "com.amazonaws.dynamodb#ReplicaNotFoundException":
2883
+ throw await de_ReplicaNotFoundExceptionRes(parsedOutput);
2884
+ case "IndexNotFoundException":
2885
+ case "com.amazonaws.dynamodb#IndexNotFoundException":
2886
+ throw await de_IndexNotFoundExceptionRes(parsedOutput);
2887
+ default:
2888
+ const parsedBody = parsedOutput.body;
2889
+ return throwDefaultError2({
2890
+ output,
2891
+ parsedBody,
2892
+ errorCode
2893
+ });
2894
+ }
2895
+ };
2896
+ var de_BackupInUseExceptionRes = async (parsedOutput, context) => {
2897
+ const body = parsedOutput.body;
2898
+ const deserialized = _json(body);
2899
+ const exception = new BackupInUseException({
2900
+ $metadata: deserializeMetadata2(parsedOutput),
2901
+ ...deserialized
2902
+ });
2903
+ return decorateServiceException(exception, body);
2904
+ };
2905
+ var de_BackupNotFoundExceptionRes = async (parsedOutput, context) => {
2906
+ const body = parsedOutput.body;
2907
+ const deserialized = _json(body);
2908
+ const exception = new BackupNotFoundException({
2909
+ $metadata: deserializeMetadata2(parsedOutput),
2910
+ ...deserialized
2911
+ });
2912
+ return decorateServiceException(exception, body);
2913
+ };
2914
+ var de_ConditionalCheckFailedExceptionRes = async (parsedOutput, context) => {
2915
+ const body = parsedOutput.body;
2916
+ const deserialized = de_ConditionalCheckFailedException(body, context);
2917
+ const exception = new ConditionalCheckFailedException({
2918
+ $metadata: deserializeMetadata2(parsedOutput),
2919
+ ...deserialized
2920
+ });
2921
+ return decorateServiceException(exception, body);
2922
+ };
2923
+ var de_ContinuousBackupsUnavailableExceptionRes = async (parsedOutput, context) => {
2924
+ const body = parsedOutput.body;
2925
+ const deserialized = _json(body);
2926
+ const exception = new ContinuousBackupsUnavailableException({
2927
+ $metadata: deserializeMetadata2(parsedOutput),
2928
+ ...deserialized
2929
+ });
2930
+ return decorateServiceException(exception, body);
2931
+ };
2932
+ var de_DuplicateItemExceptionRes = async (parsedOutput, context) => {
2933
+ const body = parsedOutput.body;
2934
+ const deserialized = _json(body);
2935
+ const exception = new DuplicateItemException({
2936
+ $metadata: deserializeMetadata2(parsedOutput),
2937
+ ...deserialized
2938
+ });
2939
+ return decorateServiceException(exception, body);
2940
+ };
2941
+ var de_ExportConflictExceptionRes = async (parsedOutput, context) => {
2942
+ const body = parsedOutput.body;
2943
+ const deserialized = _json(body);
2944
+ const exception = new ExportConflictException({
2945
+ $metadata: deserializeMetadata2(parsedOutput),
2946
+ ...deserialized
2947
+ });
2948
+ return decorateServiceException(exception, body);
2949
+ };
2950
+ var de_ExportNotFoundExceptionRes = async (parsedOutput, context) => {
2951
+ const body = parsedOutput.body;
2952
+ const deserialized = _json(body);
2953
+ const exception = new ExportNotFoundException({
2954
+ $metadata: deserializeMetadata2(parsedOutput),
2955
+ ...deserialized
2956
+ });
2957
+ return decorateServiceException(exception, body);
2958
+ };
2959
+ var de_GlobalTableAlreadyExistsExceptionRes = async (parsedOutput, context) => {
2960
+ const body = parsedOutput.body;
2961
+ const deserialized = _json(body);
2962
+ const exception = new GlobalTableAlreadyExistsException({
2963
+ $metadata: deserializeMetadata2(parsedOutput),
2964
+ ...deserialized
2965
+ });
2966
+ return decorateServiceException(exception, body);
2967
+ };
2968
+ var de_GlobalTableNotFoundExceptionRes = async (parsedOutput, context) => {
2969
+ const body = parsedOutput.body;
2970
+ const deserialized = _json(body);
2971
+ const exception = new GlobalTableNotFoundException({
2972
+ $metadata: deserializeMetadata2(parsedOutput),
2973
+ ...deserialized
2974
+ });
2975
+ return decorateServiceException(exception, body);
2976
+ };
2977
+ var de_IdempotentParameterMismatchExceptionRes = async (parsedOutput, context) => {
2978
+ const body = parsedOutput.body;
2979
+ const deserialized = _json(body);
2980
+ const exception = new IdempotentParameterMismatchException({
2981
+ $metadata: deserializeMetadata2(parsedOutput),
2982
+ ...deserialized
2983
+ });
2984
+ return decorateServiceException(exception, body);
2985
+ };
2986
+ var de_ImportConflictExceptionRes = async (parsedOutput, context) => {
2987
+ const body = parsedOutput.body;
2988
+ const deserialized = _json(body);
2989
+ const exception = new ImportConflictException({
2990
+ $metadata: deserializeMetadata2(parsedOutput),
2991
+ ...deserialized
2992
+ });
2993
+ return decorateServiceException(exception, body);
2994
+ };
2995
+ var de_ImportNotFoundExceptionRes = async (parsedOutput, context) => {
2996
+ const body = parsedOutput.body;
2997
+ const deserialized = _json(body);
2998
+ const exception = new ImportNotFoundException({
2999
+ $metadata: deserializeMetadata2(parsedOutput),
3000
+ ...deserialized
3001
+ });
3002
+ return decorateServiceException(exception, body);
3003
+ };
3004
+ var de_IndexNotFoundExceptionRes = async (parsedOutput, context) => {
3005
+ const body = parsedOutput.body;
3006
+ const deserialized = _json(body);
3007
+ const exception = new IndexNotFoundException({
3008
+ $metadata: deserializeMetadata2(parsedOutput),
3009
+ ...deserialized
3010
+ });
3011
+ return decorateServiceException(exception, body);
3012
+ };
3013
+ var de_InternalServerErrorRes = async (parsedOutput, context) => {
3014
+ const body = parsedOutput.body;
3015
+ const deserialized = _json(body);
3016
+ const exception = new InternalServerError({
3017
+ $metadata: deserializeMetadata2(parsedOutput),
3018
+ ...deserialized
3019
+ });
3020
+ return decorateServiceException(exception, body);
3021
+ };
3022
+ var de_InvalidEndpointExceptionRes = async (parsedOutput, context) => {
3023
+ const body = parsedOutput.body;
3024
+ const deserialized = _json(body);
3025
+ const exception = new InvalidEndpointException({
3026
+ $metadata: deserializeMetadata2(parsedOutput),
3027
+ ...deserialized
3028
+ });
3029
+ return decorateServiceException(exception, body);
3030
+ };
3031
+ var de_InvalidExportTimeExceptionRes = async (parsedOutput, context) => {
3032
+ const body = parsedOutput.body;
3033
+ const deserialized = _json(body);
3034
+ const exception = new InvalidExportTimeException({
3035
+ $metadata: deserializeMetadata2(parsedOutput),
3036
+ ...deserialized
3037
+ });
3038
+ return decorateServiceException(exception, body);
3039
+ };
3040
+ var de_InvalidRestoreTimeExceptionRes = async (parsedOutput, context) => {
3041
+ const body = parsedOutput.body;
3042
+ const deserialized = _json(body);
3043
+ const exception = new InvalidRestoreTimeException({
3044
+ $metadata: deserializeMetadata2(parsedOutput),
3045
+ ...deserialized
3046
+ });
3047
+ return decorateServiceException(exception, body);
3048
+ };
3049
+ var de_ItemCollectionSizeLimitExceededExceptionRes = async (parsedOutput, context) => {
3050
+ const body = parsedOutput.body;
3051
+ const deserialized = _json(body);
3052
+ const exception = new ItemCollectionSizeLimitExceededException({
3053
+ $metadata: deserializeMetadata2(parsedOutput),
3054
+ ...deserialized
3055
+ });
3056
+ return decorateServiceException(exception, body);
3057
+ };
3058
+ var de_LimitExceededExceptionRes = async (parsedOutput, context) => {
3059
+ const body = parsedOutput.body;
3060
+ const deserialized = _json(body);
3061
+ const exception = new LimitExceededException({
3062
+ $metadata: deserializeMetadata2(parsedOutput),
3063
+ ...deserialized
3064
+ });
3065
+ return decorateServiceException(exception, body);
3066
+ };
3067
+ var de_PointInTimeRecoveryUnavailableExceptionRes = async (parsedOutput, context) => {
3068
+ const body = parsedOutput.body;
3069
+ const deserialized = _json(body);
3070
+ const exception = new PointInTimeRecoveryUnavailableException({
3071
+ $metadata: deserializeMetadata2(parsedOutput),
3072
+ ...deserialized
3073
+ });
3074
+ return decorateServiceException(exception, body);
3075
+ };
3076
+ var de_PolicyNotFoundExceptionRes = async (parsedOutput, context) => {
3077
+ const body = parsedOutput.body;
3078
+ const deserialized = _json(body);
3079
+ const exception = new PolicyNotFoundException({
3080
+ $metadata: deserializeMetadata2(parsedOutput),
3081
+ ...deserialized
3082
+ });
3083
+ return decorateServiceException(exception, body);
3084
+ };
3085
+ var de_ProvisionedThroughputExceededExceptionRes = async (parsedOutput, context) => {
3086
+ const body = parsedOutput.body;
3087
+ const deserialized = _json(body);
3088
+ const exception = new ProvisionedThroughputExceededException({
3089
+ $metadata: deserializeMetadata2(parsedOutput),
3090
+ ...deserialized
3091
+ });
3092
+ return decorateServiceException(exception, body);
3093
+ };
3094
+ var de_ReplicaAlreadyExistsExceptionRes = async (parsedOutput, context) => {
3095
+ const body = parsedOutput.body;
3096
+ const deserialized = _json(body);
3097
+ const exception = new ReplicaAlreadyExistsException({
3098
+ $metadata: deserializeMetadata2(parsedOutput),
3099
+ ...deserialized
3100
+ });
3101
+ return decorateServiceException(exception, body);
3102
+ };
3103
+ var de_ReplicaNotFoundExceptionRes = async (parsedOutput, context) => {
3104
+ const body = parsedOutput.body;
3105
+ const deserialized = _json(body);
3106
+ const exception = new ReplicaNotFoundException({
3107
+ $metadata: deserializeMetadata2(parsedOutput),
3108
+ ...deserialized
3109
+ });
3110
+ return decorateServiceException(exception, body);
3111
+ };
3112
+ var de_ReplicatedWriteConflictExceptionRes = async (parsedOutput, context) => {
3113
+ const body = parsedOutput.body;
3114
+ const deserialized = _json(body);
3115
+ const exception = new ReplicatedWriteConflictException({
3116
+ $metadata: deserializeMetadata2(parsedOutput),
3117
+ ...deserialized
3118
+ });
3119
+ return decorateServiceException(exception, body);
3120
+ };
3121
+ var de_RequestLimitExceededRes = async (parsedOutput, context) => {
3122
+ const body = parsedOutput.body;
3123
+ const deserialized = _json(body);
3124
+ const exception = new RequestLimitExceeded({
3125
+ $metadata: deserializeMetadata2(parsedOutput),
3126
+ ...deserialized
3127
+ });
3128
+ return decorateServiceException(exception, body);
3129
+ };
3130
+ var de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
3131
+ const body = parsedOutput.body;
3132
+ const deserialized = _json(body);
3133
+ const exception = new ResourceInUseException({
3134
+ $metadata: deserializeMetadata2(parsedOutput),
3135
+ ...deserialized
3136
+ });
3137
+ return decorateServiceException(exception, body);
3138
+ };
3139
+ var de_ResourceNotFoundExceptionRes2 = async (parsedOutput, context) => {
3140
+ const body = parsedOutput.body;
3141
+ const deserialized = _json(body);
3142
+ const exception = new ResourceNotFoundException2({
3143
+ $metadata: deserializeMetadata2(parsedOutput),
3144
+ ...deserialized
3145
+ });
3146
+ return decorateServiceException(exception, body);
3147
+ };
3148
+ var de_TableAlreadyExistsExceptionRes = async (parsedOutput, context) => {
3149
+ const body = parsedOutput.body;
3150
+ const deserialized = _json(body);
3151
+ const exception = new TableAlreadyExistsException({
3152
+ $metadata: deserializeMetadata2(parsedOutput),
3153
+ ...deserialized
3154
+ });
3155
+ return decorateServiceException(exception, body);
3156
+ };
3157
+ var de_TableInUseExceptionRes = async (parsedOutput, context) => {
3158
+ const body = parsedOutput.body;
3159
+ const deserialized = _json(body);
3160
+ const exception = new TableInUseException({
3161
+ $metadata: deserializeMetadata2(parsedOutput),
3162
+ ...deserialized
3163
+ });
3164
+ return decorateServiceException(exception, body);
3165
+ };
3166
+ var de_TableNotFoundExceptionRes = async (parsedOutput, context) => {
3167
+ const body = parsedOutput.body;
3168
+ const deserialized = _json(body);
3169
+ const exception = new TableNotFoundException({
3170
+ $metadata: deserializeMetadata2(parsedOutput),
3171
+ ...deserialized
3172
+ });
3173
+ return decorateServiceException(exception, body);
3174
+ };
3175
+ var de_TransactionCanceledExceptionRes = async (parsedOutput, context) => {
3176
+ const body = parsedOutput.body;
3177
+ const deserialized = de_TransactionCanceledException(body, context);
3178
+ const exception = new TransactionCanceledException({
3179
+ $metadata: deserializeMetadata2(parsedOutput),
3180
+ ...deserialized
3181
+ });
3182
+ return decorateServiceException(exception, body);
3183
+ };
3184
+ var de_TransactionConflictExceptionRes = async (parsedOutput, context) => {
3185
+ const body = parsedOutput.body;
3186
+ const deserialized = _json(body);
3187
+ const exception = new TransactionConflictException({
3188
+ $metadata: deserializeMetadata2(parsedOutput),
3189
+ ...deserialized
3190
+ });
3191
+ return decorateServiceException(exception, body);
3192
+ };
3193
+ var de_TransactionInProgressExceptionRes = async (parsedOutput, context) => {
3194
+ const body = parsedOutput.body;
3195
+ const deserialized = _json(body);
3196
+ const exception = new TransactionInProgressException({
3197
+ $metadata: deserializeMetadata2(parsedOutput),
3198
+ ...deserialized
3199
+ });
3200
+ return decorateServiceException(exception, body);
3201
+ };
3202
+ var se_AttributeUpdates = (input, context) => {
3203
+ return Object.entries(input).reduce((acc, [key, value]) => {
3204
+ if (value === null) {
3205
+ return acc;
3206
+ }
3207
+ acc[key] = se_AttributeValueUpdate(value, context);
3208
+ return acc;
3209
+ }, {});
3210
+ };
3211
+ var se_AttributeValue = (input, context) => {
3212
+ return AttributeValue.visit(input, {
3213
+ B: (value) => ({ B: context.base64Encoder(value) }),
3214
+ BOOL: (value) => ({ BOOL: value }),
3215
+ BS: (value) => ({ BS: se_BinarySetAttributeValue(value, context) }),
3216
+ L: (value) => ({ L: se_ListAttributeValue(value, context) }),
3217
+ M: (value) => ({ M: se_MapAttributeValue(value, context) }),
3218
+ N: (value) => ({ N: value }),
3219
+ NS: (value) => ({ NS: _json(value) }),
3220
+ NULL: (value) => ({ NULL: value }),
3221
+ S: (value) => ({ S: value }),
3222
+ SS: (value) => ({ SS: _json(value) }),
3223
+ _: (name, value) => ({ [name]: value })
3224
+ });
3225
+ };
3226
+ var se_AttributeValueList = (input, context) => {
3227
+ return input.filter((e3) => e3 != null).map((entry) => {
3228
+ return se_AttributeValue(entry, context);
3229
+ });
3230
+ };
3231
+ var se_AttributeValueUpdate = (input, context) => {
3232
+ return take(input, {
3233
+ Action: [],
3234
+ Value: (_) => se_AttributeValue(_, context)
3235
+ });
3236
+ };
3237
+ var se_BatchWriteItemInput = (input, context) => {
3238
+ return take(input, {
3239
+ RequestItems: (_) => se_BatchWriteItemRequestMap(_, context),
3240
+ ReturnConsumedCapacity: [],
3241
+ ReturnItemCollectionMetrics: []
3242
+ });
3243
+ };
3244
+ var se_BatchWriteItemRequestMap = (input, context) => {
3245
+ return Object.entries(input).reduce((acc, [key, value]) => {
3246
+ if (value === null) {
3247
+ return acc;
3248
+ }
3249
+ acc[key] = se_WriteRequests(value, context);
3250
+ return acc;
3251
+ }, {});
3252
+ };
3253
+ var se_BinarySetAttributeValue = (input, context) => {
3254
+ return input.filter((e3) => e3 != null).map((entry) => {
3255
+ return context.base64Encoder(entry);
3256
+ });
3257
+ };
3258
+ var se_Condition = (input, context) => {
3259
+ return take(input, {
3260
+ AttributeValueList: (_) => se_AttributeValueList(_, context),
3261
+ ComparisonOperator: []
3262
+ });
3263
+ };
3264
+ var se_DeleteRequest = (input, context) => {
3265
+ return take(input, {
3266
+ Key: (_) => se_Key(_, context)
3267
+ });
3268
+ };
3269
+ var se_ExpectedAttributeMap = (input, context) => {
3270
+ return Object.entries(input).reduce((acc, [key, value]) => {
3271
+ if (value === null) {
3272
+ return acc;
3273
+ }
3274
+ acc[key] = se_ExpectedAttributeValue(value, context);
3275
+ return acc;
3276
+ }, {});
3277
+ };
3278
+ var se_ExpectedAttributeValue = (input, context) => {
3279
+ return take(input, {
3280
+ AttributeValueList: (_) => se_AttributeValueList(_, context),
3281
+ ComparisonOperator: [],
3282
+ Exists: [],
3283
+ Value: (_) => se_AttributeValue(_, context)
3284
+ });
3285
+ };
3286
+ var se_ExpressionAttributeValueMap = (input, context) => {
3287
+ return Object.entries(input).reduce((acc, [key, value]) => {
3288
+ if (value === null) {
3289
+ return acc;
3290
+ }
3291
+ acc[key] = se_AttributeValue(value, context);
3292
+ return acc;
3293
+ }, {});
3294
+ };
3295
+ var se_FilterConditionMap = (input, context) => {
3296
+ return Object.entries(input).reduce((acc, [key, value]) => {
3297
+ if (value === null) {
3298
+ return acc;
3299
+ }
3300
+ acc[key] = se_Condition(value, context);
3301
+ return acc;
3302
+ }, {});
3303
+ };
3304
+ var se_Key = (input, context) => {
3305
+ return Object.entries(input).reduce((acc, [key, value]) => {
3306
+ if (value === null) {
3307
+ return acc;
3308
+ }
3309
+ acc[key] = se_AttributeValue(value, context);
3310
+ return acc;
3311
+ }, {});
3312
+ };
3313
+ var se_KeyConditions = (input, context) => {
3314
+ return Object.entries(input).reduce((acc, [key, value]) => {
3315
+ if (value === null) {
3316
+ return acc;
3317
+ }
3318
+ acc[key] = se_Condition(value, context);
3319
+ return acc;
3320
+ }, {});
3321
+ };
3322
+ var se_ListAttributeValue = (input, context) => {
3323
+ return input.filter((e3) => e3 != null).map((entry) => {
3324
+ return se_AttributeValue(entry, context);
3325
+ });
3326
+ };
3327
+ var se_MapAttributeValue = (input, context) => {
3328
+ return Object.entries(input).reduce((acc, [key, value]) => {
3329
+ if (value === null) {
3330
+ return acc;
3331
+ }
3332
+ acc[key] = se_AttributeValue(value, context);
3333
+ return acc;
3334
+ }, {});
3335
+ };
3336
+ var se_PutItemInput = (input, context) => {
3337
+ return take(input, {
3338
+ ConditionExpression: [],
3339
+ ConditionalOperator: [],
3340
+ Expected: (_) => se_ExpectedAttributeMap(_, context),
3341
+ ExpressionAttributeNames: _json,
3342
+ ExpressionAttributeValues: (_) => se_ExpressionAttributeValueMap(_, context),
3343
+ Item: (_) => se_PutItemInputAttributeMap(_, context),
3344
+ ReturnConsumedCapacity: [],
3345
+ ReturnItemCollectionMetrics: [],
3346
+ ReturnValues: [],
3347
+ ReturnValuesOnConditionCheckFailure: [],
3348
+ TableName: []
3349
+ });
3350
+ };
3351
+ var se_PutItemInputAttributeMap = (input, context) => {
3352
+ return Object.entries(input).reduce((acc, [key, value]) => {
3353
+ if (value === null) {
3354
+ return acc;
3355
+ }
3356
+ acc[key] = se_AttributeValue(value, context);
3357
+ return acc;
3358
+ }, {});
3359
+ };
3360
+ var se_PutRequest = (input, context) => {
3361
+ return take(input, {
3362
+ Item: (_) => se_PutItemInputAttributeMap(_, context)
3363
+ });
3364
+ };
3365
+ var se_QueryInput = (input, context) => {
3366
+ return take(input, {
3367
+ AttributesToGet: _json,
3368
+ ConditionalOperator: [],
3369
+ ConsistentRead: [],
3370
+ ExclusiveStartKey: (_) => se_Key(_, context),
3371
+ ExpressionAttributeNames: _json,
3372
+ ExpressionAttributeValues: (_) => se_ExpressionAttributeValueMap(_, context),
3373
+ FilterExpression: [],
3374
+ IndexName: [],
3375
+ KeyConditionExpression: [],
3376
+ KeyConditions: (_) => se_KeyConditions(_, context),
3377
+ Limit: [],
3378
+ ProjectionExpression: [],
3379
+ QueryFilter: (_) => se_FilterConditionMap(_, context),
3380
+ ReturnConsumedCapacity: [],
3381
+ ScanIndexForward: [],
3382
+ Select: [],
3383
+ TableName: []
3384
+ });
3385
+ };
3386
+ var se_ScanInput = (input, context) => {
3387
+ return take(input, {
3388
+ AttributesToGet: _json,
3389
+ ConditionalOperator: [],
3390
+ ConsistentRead: [],
3391
+ ExclusiveStartKey: (_) => se_Key(_, context),
3392
+ ExpressionAttributeNames: _json,
3393
+ ExpressionAttributeValues: (_) => se_ExpressionAttributeValueMap(_, context),
3394
+ FilterExpression: [],
3395
+ IndexName: [],
3396
+ Limit: [],
3397
+ ProjectionExpression: [],
3398
+ ReturnConsumedCapacity: [],
3399
+ ScanFilter: (_) => se_FilterConditionMap(_, context),
3400
+ Segment: [],
3401
+ Select: [],
3402
+ TableName: [],
3403
+ TotalSegments: []
3404
+ });
3405
+ };
3406
+ var se_UpdateItemInput = (input, context) => {
3407
+ return take(input, {
3408
+ AttributeUpdates: (_) => se_AttributeUpdates(_, context),
3409
+ ConditionExpression: [],
3410
+ ConditionalOperator: [],
3411
+ Expected: (_) => se_ExpectedAttributeMap(_, context),
3412
+ ExpressionAttributeNames: _json,
3413
+ ExpressionAttributeValues: (_) => se_ExpressionAttributeValueMap(_, context),
3414
+ Key: (_) => se_Key(_, context),
3415
+ ReturnConsumedCapacity: [],
3416
+ ReturnItemCollectionMetrics: [],
3417
+ ReturnValues: [],
3418
+ ReturnValuesOnConditionCheckFailure: [],
3419
+ TableName: [],
3420
+ UpdateExpression: []
3421
+ });
3422
+ };
3423
+ var se_WriteRequest = (input, context) => {
3424
+ return take(input, {
3425
+ DeleteRequest: (_) => se_DeleteRequest(_, context),
3426
+ PutRequest: (_) => se_PutRequest(_, context)
3427
+ });
3428
+ };
3429
+ var se_WriteRequests = (input, context) => {
3430
+ return input.filter((e3) => e3 != null).map((entry) => {
3431
+ return se_WriteRequest(entry, context);
3432
+ });
3433
+ };
3434
+ var de_AttributeMap = (output, context) => {
3435
+ return Object.entries(output).reduce((acc, [key, value]) => {
3436
+ if (value === null) {
3437
+ return acc;
3438
+ }
3439
+ acc[key] = de_AttributeValue(awsExpectUnion(value), context);
3440
+ return acc;
3441
+ }, {});
3442
+ };
3443
+ var de_AttributeValue = (output, context) => {
3444
+ if (output.B != null) {
3445
+ return {
3446
+ B: context.base64Decoder(output.B)
3447
+ };
3448
+ }
3449
+ if (expectBoolean(output.BOOL) !== void 0) {
3450
+ return { BOOL: expectBoolean(output.BOOL) };
3451
+ }
3452
+ if (output.BS != null) {
3453
+ return {
3454
+ BS: de_BinarySetAttributeValue(output.BS, context)
3455
+ };
3456
+ }
3457
+ if (output.L != null) {
3458
+ return {
3459
+ L: de_ListAttributeValue(output.L, context)
3460
+ };
3461
+ }
3462
+ if (output.M != null) {
3463
+ return {
3464
+ M: de_MapAttributeValue(output.M, context)
3465
+ };
3466
+ }
3467
+ if (expectString(output.N) !== void 0) {
3468
+ return { N: expectString(output.N) };
3469
+ }
3470
+ if (output.NS != null) {
3471
+ return {
3472
+ NS: _json(output.NS)
3473
+ };
3474
+ }
3475
+ if (expectBoolean(output.NULL) !== void 0) {
3476
+ return { NULL: expectBoolean(output.NULL) };
3477
+ }
3478
+ if (expectString(output.S) !== void 0) {
3479
+ return { S: expectString(output.S) };
3480
+ }
3481
+ if (output.SS != null) {
3482
+ return {
3483
+ SS: _json(output.SS)
3484
+ };
3485
+ }
3486
+ return { $unknown: Object.entries(output)[0] };
3487
+ };
3488
+ var de_BatchWriteItemOutput = (output, context) => {
3489
+ return take(output, {
3490
+ ConsumedCapacity: (_) => de_ConsumedCapacityMultiple(_),
3491
+ ItemCollectionMetrics: (_) => de_ItemCollectionMetricsPerTable(_, context),
3492
+ UnprocessedItems: (_) => de_BatchWriteItemRequestMap(_, context)
3493
+ });
3494
+ };
3495
+ var de_BatchWriteItemRequestMap = (output, context) => {
3496
+ return Object.entries(output).reduce((acc, [key, value]) => {
3497
+ if (value === null) {
3498
+ return acc;
3499
+ }
3500
+ acc[key] = de_WriteRequests(value, context);
3501
+ return acc;
3502
+ }, {});
3503
+ };
3504
+ var de_BinarySetAttributeValue = (output, context) => {
3505
+ const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
3506
+ return context.base64Decoder(entry);
3507
+ });
3508
+ return retVal;
3509
+ };
3510
+ var de_CancellationReason = (output, context) => {
3511
+ return take(output, {
3512
+ Code: expectString,
3513
+ Item: (_) => de_AttributeMap(_, context),
3514
+ Message: expectString
3515
+ });
3516
+ };
3517
+ var de_CancellationReasonList = (output, context) => {
3518
+ const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
3519
+ return de_CancellationReason(entry, context);
3520
+ });
3521
+ return retVal;
3522
+ };
3523
+ var de_Capacity = (output, context) => {
3524
+ return take(output, {
3525
+ CapacityUnits: limitedParseDouble,
3526
+ ReadCapacityUnits: limitedParseDouble,
3527
+ WriteCapacityUnits: limitedParseDouble
3528
+ });
3529
+ };
3530
+ var de_ConditionalCheckFailedException = (output, context) => {
3531
+ return take(output, {
3532
+ Item: (_) => de_AttributeMap(_, context),
3533
+ message: expectString
3534
+ });
3535
+ };
3536
+ var de_ConsumedCapacity = (output, context) => {
3537
+ return take(output, {
3538
+ CapacityUnits: limitedParseDouble,
3539
+ GlobalSecondaryIndexes: (_) => de_SecondaryIndexesCapacityMap(_),
3540
+ LocalSecondaryIndexes: (_) => de_SecondaryIndexesCapacityMap(_),
3541
+ ReadCapacityUnits: limitedParseDouble,
3542
+ Table: (_) => de_Capacity(_),
3543
+ TableName: expectString,
3544
+ WriteCapacityUnits: limitedParseDouble
3545
+ });
3546
+ };
3547
+ var de_ConsumedCapacityMultiple = (output, context) => {
3548
+ const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
3549
+ return de_ConsumedCapacity(entry);
3550
+ });
3551
+ return retVal;
3552
+ };
3553
+ var de_DeleteRequest = (output, context) => {
3554
+ return take(output, {
3555
+ Key: (_) => de_Key(_, context)
3556
+ });
3557
+ };
3558
+ var de_ItemCollectionKeyAttributeMap = (output, context) => {
3559
+ return Object.entries(output).reduce((acc, [key, value]) => {
3560
+ if (value === null) {
3561
+ return acc;
3562
+ }
3563
+ acc[key] = de_AttributeValue(awsExpectUnion(value), context);
3564
+ return acc;
3565
+ }, {});
3566
+ };
3567
+ var de_ItemCollectionMetrics = (output, context) => {
3568
+ return take(output, {
3569
+ ItemCollectionKey: (_) => de_ItemCollectionKeyAttributeMap(_, context),
3570
+ SizeEstimateRangeGB: (_) => de_ItemCollectionSizeEstimateRange(_)
3571
+ });
3572
+ };
3573
+ var de_ItemCollectionMetricsMultiple = (output, context) => {
3574
+ const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
3575
+ return de_ItemCollectionMetrics(entry, context);
3576
+ });
3577
+ return retVal;
3578
+ };
3579
+ var de_ItemCollectionMetricsPerTable = (output, context) => {
3580
+ return Object.entries(output).reduce((acc, [key, value]) => {
3581
+ if (value === null) {
3582
+ return acc;
3583
+ }
3584
+ acc[key] = de_ItemCollectionMetricsMultiple(value, context);
3585
+ return acc;
3586
+ }, {});
3587
+ };
3588
+ var de_ItemCollectionSizeEstimateRange = (output, context) => {
3589
+ const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
3590
+ return limitedParseDouble(entry);
3591
+ });
3592
+ return retVal;
3593
+ };
3594
+ var de_ItemList = (output, context) => {
3595
+ const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
3596
+ return de_AttributeMap(entry, context);
3597
+ });
3598
+ return retVal;
3599
+ };
3600
+ var de_Key = (output, context) => {
3601
+ return Object.entries(output).reduce((acc, [key, value]) => {
3602
+ if (value === null) {
3603
+ return acc;
3604
+ }
3605
+ acc[key] = de_AttributeValue(awsExpectUnion(value), context);
3606
+ return acc;
3607
+ }, {});
3608
+ };
3609
+ var de_ListAttributeValue = (output, context) => {
3610
+ const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
3611
+ return de_AttributeValue(awsExpectUnion(entry), context);
3612
+ });
3613
+ return retVal;
3614
+ };
3615
+ var de_MapAttributeValue = (output, context) => {
3616
+ return Object.entries(output).reduce((acc, [key, value]) => {
3617
+ if (value === null) {
3618
+ return acc;
3619
+ }
3620
+ acc[key] = de_AttributeValue(awsExpectUnion(value), context);
3621
+ return acc;
3622
+ }, {});
3623
+ };
3624
+ var de_PutItemInputAttributeMap = (output, context) => {
3625
+ return Object.entries(output).reduce((acc, [key, value]) => {
3626
+ if (value === null) {
3627
+ return acc;
3628
+ }
3629
+ acc[key] = de_AttributeValue(awsExpectUnion(value), context);
3630
+ return acc;
3631
+ }, {});
3632
+ };
3633
+ var de_PutItemOutput = (output, context) => {
3634
+ return take(output, {
3635
+ Attributes: (_) => de_AttributeMap(_, context),
3636
+ ConsumedCapacity: (_) => de_ConsumedCapacity(_),
3637
+ ItemCollectionMetrics: (_) => de_ItemCollectionMetrics(_, context)
3638
+ });
3639
+ };
3640
+ var de_PutRequest = (output, context) => {
3641
+ return take(output, {
3642
+ Item: (_) => de_PutItemInputAttributeMap(_, context)
3643
+ });
3644
+ };
3645
+ var de_QueryOutput = (output, context) => {
3646
+ return take(output, {
3647
+ ConsumedCapacity: (_) => de_ConsumedCapacity(_),
3648
+ Count: expectInt32,
3649
+ Items: (_) => de_ItemList(_, context),
3650
+ LastEvaluatedKey: (_) => de_Key(_, context),
3651
+ ScannedCount: expectInt32
3652
+ });
3653
+ };
3654
+ var de_ScanOutput = (output, context) => {
3655
+ return take(output, {
3656
+ ConsumedCapacity: (_) => de_ConsumedCapacity(_),
3657
+ Count: expectInt32,
3658
+ Items: (_) => de_ItemList(_, context),
3659
+ LastEvaluatedKey: (_) => de_Key(_, context),
3660
+ ScannedCount: expectInt32
3661
+ });
3662
+ };
3663
+ var de_SecondaryIndexesCapacityMap = (output, context) => {
3664
+ return Object.entries(output).reduce((acc, [key, value]) => {
3665
+ if (value === null) {
3666
+ return acc;
3667
+ }
3668
+ acc[key] = de_Capacity(value);
3669
+ return acc;
3670
+ }, {});
3671
+ };
3672
+ var de_TransactionCanceledException = (output, context) => {
3673
+ return take(output, {
3674
+ CancellationReasons: (_) => de_CancellationReasonList(_, context),
3675
+ Message: expectString
3676
+ });
3677
+ };
3678
+ var de_UpdateItemOutput = (output, context) => {
3679
+ return take(output, {
3680
+ Attributes: (_) => de_AttributeMap(_, context),
3681
+ ConsumedCapacity: (_) => de_ConsumedCapacity(_),
3682
+ ItemCollectionMetrics: (_) => de_ItemCollectionMetrics(_, context)
3683
+ });
3684
+ };
3685
+ var de_WriteRequest = (output, context) => {
3686
+ return take(output, {
3687
+ DeleteRequest: (_) => de_DeleteRequest(_, context),
3688
+ PutRequest: (_) => de_PutRequest(_, context)
3689
+ });
3690
+ };
3691
+ var de_WriteRequests = (output, context) => {
3692
+ const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
3693
+ return de_WriteRequest(entry, context);
3694
+ });
3695
+ return retVal;
3696
+ };
3697
+ var deserializeMetadata2 = (output) => ({
3698
+ httpStatusCode: output.statusCode,
3699
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
3700
+ extendedRequestId: output.headers["x-amz-id-2"],
3701
+ cfId: output.headers["x-amz-cf-id"]
3702
+ });
3703
+ var throwDefaultError2 = withBaseException(DynamoDBServiceException);
3704
+ var buildHttpRpcRequest2 = async (context, headers, path, resolvedHostname, body) => {
3705
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
3706
+ const contents = {
3707
+ protocol,
3708
+ hostname,
3709
+ port,
3710
+ method: "POST",
3711
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
3712
+ headers
3713
+ };
3714
+ if (body !== void 0) {
3715
+ contents.body = body;
3716
+ }
3717
+ return new HttpRequest(contents);
3718
+ };
3719
+ function sharedHeaders2(operation) {
3720
+ return {
3721
+ "content-type": "application/x-amz-json-1.0",
3722
+ "x-amz-target": `DynamoDB_20120810.${operation}`
3723
+ };
3724
+ }
3725
+
3726
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/commands/DescribeEndpointsCommand.js
3727
+ var DescribeEndpointsCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs, config, o3) {
3728
+ return [
3729
+ getSerdePlugin(config, this.serialize, this.deserialize),
3730
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
3731
+ ];
3732
+ }).s("DynamoDB_20120810", "DescribeEndpoints", {}).n("DynamoDBClient", "DescribeEndpointsCommand").f(void 0, void 0).ser(se_DescribeEndpointsCommand).de(de_DescribeEndpointsCommand).build() {
3733
+ };
3734
+
3735
+ // ../../node_modules/@aws-sdk/client-dynamodb/package.json
3736
+ var package_default2 = {
3737
+ version: "3.828.0"};
3738
+
3739
+ // ../../node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js
3740
+ var ENV_IMDS_DISABLED2 = "AWS_EC2_METADATA_DISABLED";
3741
+ var remoteProvider2 = async (init) => {
3742
+ const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await import('./dist-es-4ULGGWP4.js');
3743
+ if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {
3744
+ init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");
3745
+ const { fromHttp } = await import('./dist-es-A2JHLMIV.js');
3746
+ return chain(fromHttp(init), fromContainerMetadata(init));
3747
+ }
3748
+ if (process.env[ENV_IMDS_DISABLED2] && process.env[ENV_IMDS_DISABLED2] !== "false") {
3749
+ return async () => {
3750
+ throw new CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger });
3751
+ };
3752
+ }
3753
+ init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata");
3754
+ return fromInstanceMetadata(init);
3755
+ };
3756
+
3757
+ // ../../node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js
3758
+ var multipleCredentialSourceWarningEmitted2 = false;
3759
+ var defaultProvider2 = (init = {}) => memoize(chain(async () => {
3760
+ const profile = init.profile ?? process.env[ENV_PROFILE];
3761
+ if (profile) {
3762
+ const envStaticCredentialsAreSet = process.env[ENV_KEY$1] && process.env[ENV_SECRET$1];
3763
+ if (envStaticCredentialsAreSet) {
3764
+ if (!multipleCredentialSourceWarningEmitted2) {
3765
+ const warnFn = init.logger?.warn && init.logger?.constructor?.name !== "NoOpLogger" ? init.logger.warn : console.warn;
3766
+ warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
3767
+ Multiple credential sources detected:
3768
+ Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
3769
+ This SDK will proceed with the AWS_PROFILE value.
3770
+
3771
+ However, a future version may change this behavior to prefer the ENV static credentials.
3772
+ Please ensure that your environment only sets either the AWS_PROFILE or the
3773
+ AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
3774
+ `);
3775
+ multipleCredentialSourceWarningEmitted2 = true;
3776
+ }
3777
+ }
3778
+ throw new CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", {
3779
+ logger: init.logger,
3780
+ tryNextLink: true
3781
+ });
3782
+ }
3783
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv");
3784
+ return fromEnv$1(init)();
3785
+ }, async () => {
3786
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");
3787
+ const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
3788
+ if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
3789
+ throw new CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger });
3790
+ }
3791
+ const { fromSSO } = await import('./dist-es-AWY666YH.js');
3792
+ return fromSSO(init)();
3793
+ }, async () => {
3794
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");
3795
+ const { fromIni } = await import('./dist-es-KUMQWKJB.js');
3796
+ return fromIni(init)();
3797
+ }, async () => {
3798
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");
3799
+ const { fromProcess } = await import('./dist-es-YGJKPYIO.js');
3800
+ return fromProcess(init)();
3801
+ }, async () => {
3802
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");
3803
+ const { fromTokenFile } = await import('./dist-es-YYROUSP5.js');
3804
+ return fromTokenFile(init)();
3805
+ }, async () => {
3806
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider");
3807
+ return (await remoteProvider2(init))();
3808
+ }, async () => {
3809
+ throw new CredentialsProviderError("Could not load credentials from any providers", {
3810
+ tryNextLink: false,
3811
+ logger: init.logger
3812
+ });
3813
+ }), credentialsTreatedAsExpired2, credentialsWillNeedRefresh2);
3814
+ var credentialsWillNeedRefresh2 = (credentials) => credentials?.expiration !== void 0;
3815
+ var credentialsTreatedAsExpired2 = (credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5;
3816
+
3817
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/endpoint/ruleset.js
3818
+ var S = "required";
3819
+ var T = "type";
3820
+ var U = "fn";
3821
+ var V = "argv";
3822
+ var W = "ref";
3823
+ var X = "properties";
3824
+ var Y = "headers";
3825
+ var a2 = false;
3826
+ var b2 = "isSet";
3827
+ var c2 = "error";
3828
+ var d2 = "endpoint";
3829
+ var e2 = "tree";
3830
+ var f2 = "PartitionResult";
3831
+ var g2 = "stringEquals";
3832
+ var h2 = "dynamodb";
3833
+ var i2 = "getAttr";
3834
+ var j2 = "aws.parseArn";
3835
+ var k2 = "ParsedArn";
3836
+ var l2 = "isValidHostLabel";
3837
+ var m2 = "FirstArn";
3838
+ var n2 = { [S]: false, [T]: "String" };
3839
+ var o2 = { [S]: true, "default": false, [T]: "Boolean" };
3840
+ var p2 = { [U]: "booleanEquals", [V]: [{ [W]: "UseFIPS" }, true] };
3841
+ var q2 = { [U]: "booleanEquals", [V]: [{ [W]: "UseDualStack" }, true] };
3842
+ var r2 = {};
3843
+ var s2 = { [W]: "Region" };
3844
+ var t2 = { [U]: "booleanEquals", [V]: [{ [U]: i2, [V]: [{ [W]: f2 }, "supportsFIPS"] }, true] };
3845
+ var u2 = { [U]: "booleanEquals", [V]: [{ [U]: i2, [V]: [{ [W]: f2 }, "supportsDualStack"] }, true] };
3846
+ var v2 = { "conditions": [{ [U]: b2, [V]: [{ [W]: "AccountIdEndpointMode" }] }, { [U]: g2, [V]: [{ [W]: "AccountIdEndpointMode" }, "required"] }], "rules": [{ [c2]: "Invalid Configuration: AccountIdEndpointMode is required and FIPS is enabled, but FIPS account endpoints are not supported", [T]: c2 }], [T]: e2 };
3847
+ var w2 = { [U]: b2, [V]: [{ [W]: "AccountIdEndpointMode" }] };
3848
+ var x2 = { [c2]: "Invalid Configuration: AccountIdEndpointMode is required and FIPS is enabled, but FIPS account endpoints are not supported", [T]: c2 };
3849
+ var y = { [U]: i2, [V]: [{ [W]: f2 }, "name"] };
3850
+ var z = { [d2]: { "url": "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", [X]: {}, [Y]: {} }, [T]: d2 };
3851
+ var A = { [U]: "not", [V]: [p2] };
3852
+ var B = { [c2]: "Invalid Configuration: AccountIdEndpointMode is required and DualStack is enabled, but DualStack account endpoints are not supported", [T]: c2 };
3853
+ var C = { [U]: "not", [V]: [{ [U]: g2, [V]: [{ [W]: "AccountIdEndpointMode" }, "disabled"] }] };
3854
+ var D = { [U]: g2, [V]: [y, "aws"] };
3855
+ var E = { [U]: "not", [V]: [q2] };
3856
+ var F = { [U]: g2, [V]: [{ [U]: i2, [V]: [{ [W]: k2 }, "service"] }, h2] };
3857
+ var G = { [U]: l2, [V]: [{ [U]: i2, [V]: [{ [W]: k2 }, "region"] }, false] };
3858
+ var H = { [U]: g2, [V]: [{ [U]: i2, [V]: [{ [W]: k2 }, "region"] }, "{Region}"] };
3859
+ var I = { [U]: l2, [V]: [{ [U]: i2, [V]: [{ [W]: k2 }, "accountId"] }, false] };
3860
+ var J = { "url": "https://{ParsedArn#accountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", [X]: {}, [Y]: {} };
3861
+ var K = { [W]: "ResourceArnList" };
3862
+ var L = { [W]: "AccountId" };
3863
+ var M = [p2];
3864
+ var N = [q2];
3865
+ var O = [s2];
3866
+ var P = [w2, { [U]: g2, [V]: [{ [W]: "AccountIdEndpointMode" }, "required"] }];
3867
+ var Q = [A];
3868
+ var R = [{ [W]: "ResourceArn" }];
3869
+ var _data2 = { version: "1.0", parameters: { Region: n2, UseDualStack: o2, UseFIPS: o2, Endpoint: n2, AccountId: n2, AccountIdEndpointMode: n2, ResourceArn: n2, ResourceArnList: { [S]: a2, [T]: "stringArray" } }, rules: [{ conditions: [{ [U]: b2, [V]: [{ [W]: "Endpoint" }] }], rules: [{ conditions: M, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [T]: c2 }, { conditions: N, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [T]: c2 }, { endpoint: { url: "{Endpoint}", [X]: r2, [Y]: r2 }, [T]: d2 }], [T]: e2 }, { conditions: [{ [U]: b2, [V]: O }], rules: [{ conditions: [{ [U]: "aws.partition", [V]: O, assign: f2 }], rules: [{ conditions: [{ [U]: g2, [V]: [s2, "local"] }], rules: [{ conditions: M, error: "Invalid Configuration: FIPS and local endpoint are not supported", [T]: c2 }, { conditions: N, error: "Invalid Configuration: Dualstack and local endpoint are not supported", [T]: c2 }, { endpoint: { url: "http://localhost:8000", [X]: { authSchemes: [{ signingRegion: "us-east-1", name: "sigv4", signingName: h2 }] }, [Y]: r2 }, [T]: d2 }], [T]: e2 }, { conditions: [p2, q2], rules: [{ conditions: [t2, u2], rules: [v2, { endpoint: { url: "https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", [X]: r2, [Y]: r2 }, [T]: d2 }], [T]: e2 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [T]: c2 }], [T]: e2 }, { conditions: M, rules: [{ conditions: [t2], rules: [{ conditions: [{ [U]: g2, [V]: [y, "aws-us-gov"] }], rules: [v2, z], [T]: e2 }, v2, { endpoint: { url: "https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", [X]: r2, [Y]: r2 }, [T]: d2 }], [T]: e2 }, { error: "FIPS is enabled but this partition does not support FIPS", [T]: c2 }], [T]: e2 }, { conditions: N, rules: [{ conditions: [u2], rules: [{ conditions: P, rules: [{ conditions: Q, rules: [B], [T]: e2 }, x2], [T]: e2 }, { endpoint: { url: "https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", [X]: r2, [Y]: r2 }, [T]: d2 }], [T]: e2 }, { error: "DualStack is enabled but this partition does not support DualStack", [T]: c2 }], [T]: e2 }, { conditions: [w2, C, D, A, E, { [U]: b2, [V]: R }, { [U]: j2, [V]: R, assign: k2 }, F, G, H, I], endpoint: J, [T]: d2 }, { conditions: [w2, C, D, A, E, { [U]: b2, [V]: [K] }, { [U]: i2, [V]: [K, "[0]"], assign: m2 }, { [U]: j2, [V]: [{ [W]: m2 }], assign: k2 }, F, G, H, I], endpoint: J, [T]: d2 }, { conditions: [w2, C, D, A, E, { [U]: b2, [V]: [L] }], rules: [{ conditions: [{ [U]: l2, [V]: [L, a2] }], rules: [{ endpoint: { url: "https://{AccountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", [X]: r2, [Y]: r2 }, [T]: d2 }], [T]: e2 }, { error: "Credentials-sourced account ID parameter is invalid", [T]: c2 }], [T]: e2 }, { conditions: P, rules: [{ conditions: Q, rules: [{ conditions: [E], rules: [{ conditions: [D], rules: [{ error: "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded", [T]: c2 }], [T]: e2 }, { error: "Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition", [T]: c2 }], [T]: e2 }, B], [T]: e2 }, x2], [T]: e2 }, z], [T]: e2 }], [T]: e2 }, { error: "Invalid Configuration: Missing Region", [T]: c2 }] };
3870
+ var ruleSet2 = _data2;
3871
+
3872
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/endpoint/endpointResolver.js
3873
+ var cache2 = new EndpointCache({
3874
+ size: 50,
3875
+ params: [
3876
+ "AccountId",
3877
+ "AccountIdEndpointMode",
3878
+ "Endpoint",
3879
+ "Region",
3880
+ "ResourceArn",
3881
+ "ResourceArnList",
3882
+ "UseDualStack",
3883
+ "UseFIPS"
3884
+ ]
3885
+ });
3886
+ var defaultEndpointResolver2 = (endpointParams, context = {}) => {
3887
+ return cache2.get(endpointParams, () => resolveEndpoint(ruleSet2, {
3888
+ endpointParams,
3889
+ logger: context.logger
3890
+ }));
3891
+ };
3892
+ customEndpointFunctions.aws = awsEndpointFunctions$1;
3893
+
3894
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/runtimeConfig.shared.js
3895
+ var getRuntimeConfig3 = (config) => {
3896
+ return {
3897
+ apiVersion: "2012-08-10",
3898
+ base64Decoder: config?.base64Decoder ?? fromBase64,
3899
+ base64Encoder: config?.base64Encoder ?? toBase64,
3900
+ disableHostPrefix: config?.disableHostPrefix ?? false,
3901
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver2,
3902
+ extensions: config?.extensions ?? [],
3903
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultDynamoDBHttpAuthSchemeProvider,
3904
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
3905
+ {
3906
+ schemeId: "aws.auth#sigv4",
3907
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
3908
+ signer: new AwsSdkSigV4Signer$1()
3909
+ }
3910
+ ],
3911
+ logger: config?.logger ?? new NoOpLogger(),
3912
+ serviceId: config?.serviceId ?? "DynamoDB",
3913
+ urlParser: config?.urlParser ?? parseUrl,
3914
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
3915
+ utf8Encoder: config?.utf8Encoder ?? toUtf8
3916
+ };
3917
+ };
3918
+
3919
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/runtimeConfig.js
3920
+ var getRuntimeConfig4 = (config) => {
3921
+ emitWarningIfUnsupportedVersion(process.version);
3922
+ const defaultsMode = resolveDefaultsModeConfig(config);
3923
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
3924
+ const clientSharedValues = getRuntimeConfig3(config);
3925
+ emitWarningIfUnsupportedVersion$2(process.version);
3926
+ const loaderConfig = {
3927
+ profile: config?.profile,
3928
+ logger: clientSharedValues.logger
3929
+ };
3930
+ return {
3931
+ ...clientSharedValues,
3932
+ ...config,
3933
+ runtime: "node",
3934
+ defaultsMode,
3935
+ accountIdEndpointMode: config?.accountIdEndpointMode ?? loadConfig(NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS, loaderConfig),
3936
+ authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
3937
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
3938
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider2,
3939
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider$1({ serviceId: clientSharedValues.serviceId, clientVersion: package_default2.version }),
3940
+ endpointDiscoveryEnabledProvider: config?.endpointDiscoveryEnabledProvider ?? loadConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS, loaderConfig),
3941
+ maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
3942
+ region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
3943
+ requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
3944
+ retryMode: config?.retryMode ?? loadConfig({
3945
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
3946
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE
3947
+ }, config),
3948
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
3949
+ streamCollector: config?.streamCollector ?? streamCollector,
3950
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
3951
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
3952
+ userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS$1, loaderConfig)
3953
+ };
3954
+ };
3955
+
3956
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/auth/httpAuthExtensionConfiguration.js
3957
+ var getHttpAuthExtensionConfiguration2 = (runtimeConfig) => {
3958
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3959
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
3960
+ let _credentials = runtimeConfig.credentials;
3961
+ return {
3962
+ setHttpAuthScheme(httpAuthScheme) {
3963
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
3964
+ if (index === -1) {
3965
+ _httpAuthSchemes.push(httpAuthScheme);
3966
+ } else {
3967
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
3968
+ }
3969
+ },
3970
+ httpAuthSchemes() {
3971
+ return _httpAuthSchemes;
3972
+ },
3973
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
3974
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
3975
+ },
3976
+ httpAuthSchemeProvider() {
3977
+ return _httpAuthSchemeProvider;
3978
+ },
3979
+ setCredentials(credentials) {
3980
+ _credentials = credentials;
3981
+ },
3982
+ credentials() {
3983
+ return _credentials;
3984
+ }
3985
+ };
3986
+ };
3987
+ var resolveHttpAuthRuntimeConfig2 = (config) => {
3988
+ return {
3989
+ httpAuthSchemes: config.httpAuthSchemes(),
3990
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
3991
+ credentials: config.credentials()
3992
+ };
3993
+ };
3994
+
3995
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/runtimeExtensions.js
3996
+ var resolveRuntimeExtensions2 = (runtimeConfig, extensions) => {
3997
+ const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration$1(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration2(runtimeConfig));
3998
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
3999
+ return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration$1(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig2(extensionConfiguration));
4000
+ };
4001
+
4002
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/DynamoDBClient.js
4003
+ var DynamoDBClient = class extends Client {
4004
+ config;
4005
+ constructor(...[configuration]) {
4006
+ const _config_0 = getRuntimeConfig4(configuration || {});
4007
+ super(_config_0);
4008
+ this.initConfig = _config_0;
4009
+ const _config_1 = resolveClientEndpointParameters2(_config_0);
4010
+ const _config_2 = resolveAccountIdEndpointModeConfig(_config_1);
4011
+ const _config_3 = resolveUserAgentConfig$1(_config_2);
4012
+ const _config_4 = resolveRetryConfig(_config_3);
4013
+ const _config_5 = resolveRegionConfig(_config_4);
4014
+ const _config_6 = resolveHostHeaderConfig$1(_config_5);
4015
+ const _config_7 = resolveEndpointConfig(_config_6);
4016
+ const _config_8 = resolveHttpAuthSchemeConfig2(_config_7);
4017
+ const _config_9 = resolveEndpointDiscoveryConfig(_config_8, {
4018
+ endpointDiscoveryCommandCtor: DescribeEndpointsCommand
4019
+ });
4020
+ const _config_10 = resolveRuntimeExtensions2(_config_9, configuration?.extensions || []);
4021
+ this.config = _config_10;
4022
+ this.middlewareStack.use(getUserAgentPlugin$1(this.config));
4023
+ this.middlewareStack.use(getRetryPlugin(this.config));
4024
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
4025
+ this.middlewareStack.use(getHostHeaderPlugin$1(this.config));
4026
+ this.middlewareStack.use(getLoggerPlugin$1(this.config));
4027
+ this.middlewareStack.use(getRecursionDetectionPlugin$1(this.config));
4028
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
4029
+ httpAuthSchemeParametersProvider: defaultDynamoDBHttpAuthSchemeParametersProvider,
4030
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
4031
+ "aws.auth#sigv4": config.credentials
4032
+ })
4033
+ }));
4034
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
4035
+ }
4036
+ destroy() {
4037
+ super.destroy();
4038
+ }
4039
+ };
4040
+
4041
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/commands/BatchWriteItemCommand.js
4042
+ var BatchWriteItemCommand = class extends Command.classBuilder().ep({
4043
+ ...commonParams2,
4044
+ ResourceArnList: { type: "operationContextParams", get: (input) => Object.keys(input?.RequestItems ?? {}) }
4045
+ }).m(function(Command2, cs, config, o3) {
4046
+ return [
4047
+ getSerdePlugin(config, this.serialize, this.deserialize),
4048
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
4049
+ ];
4050
+ }).s("DynamoDB_20120810", "BatchWriteItem", {}).n("DynamoDBClient", "BatchWriteItemCommand").f(void 0, void 0).ser(se_BatchWriteItemCommand).de(de_BatchWriteItemCommand).build() {
4051
+ };
4052
+
4053
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/commands/PutItemCommand.js
4054
+ var PutItemCommand = class extends Command.classBuilder().ep({
4055
+ ...commonParams2,
4056
+ ResourceArn: { type: "contextParams", name: "TableName" }
4057
+ }).m(function(Command2, cs, config, o3) {
4058
+ return [
4059
+ getSerdePlugin(config, this.serialize, this.deserialize),
4060
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
4061
+ ];
4062
+ }).s("DynamoDB_20120810", "PutItem", {}).n("DynamoDBClient", "PutItemCommand").f(void 0, void 0).ser(se_PutItemCommand).de(de_PutItemCommand).build() {
4063
+ };
4064
+
4065
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/commands/QueryCommand.js
4066
+ var QueryCommand = class extends Command.classBuilder().ep({
4067
+ ...commonParams2,
4068
+ ResourceArn: { type: "contextParams", name: "TableName" }
4069
+ }).m(function(Command2, cs, config, o3) {
4070
+ return [
4071
+ getSerdePlugin(config, this.serialize, this.deserialize),
4072
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
4073
+ ];
4074
+ }).s("DynamoDB_20120810", "Query", {}).n("DynamoDBClient", "QueryCommand").f(void 0, void 0).ser(se_QueryCommand).de(de_QueryCommand).build() {
4075
+ };
4076
+
4077
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/commands/ScanCommand.js
4078
+ var ScanCommand = class extends Command.classBuilder().ep({
4079
+ ...commonParams2,
4080
+ ResourceArn: { type: "contextParams", name: "TableName" }
4081
+ }).m(function(Command2, cs, config, o3) {
4082
+ return [
4083
+ getSerdePlugin(config, this.serialize, this.deserialize),
4084
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
4085
+ ];
4086
+ }).s("DynamoDB_20120810", "Scan", {}).n("DynamoDBClient", "ScanCommand").f(void 0, void 0).ser(se_ScanCommand).de(de_ScanCommand).build() {
4087
+ };
4088
+
4089
+ // ../../node_modules/@aws-sdk/client-dynamodb/dist-es/commands/UpdateItemCommand.js
4090
+ var UpdateItemCommand = class extends Command.classBuilder().ep({
4091
+ ...commonParams2,
4092
+ ResourceArn: { type: "contextParams", name: "TableName" }
4093
+ }).m(function(Command2, cs, config, o3) {
4094
+ return [
4095
+ getSerdePlugin(config, this.serialize, this.deserialize),
4096
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
4097
+ ];
4098
+ }).s("DynamoDB_20120810", "UpdateItem", {}).n("DynamoDBClient", "UpdateItemCommand").f(void 0, void 0).ser(se_UpdateItemCommand).de(de_UpdateItemCommand).build() {
4099
+ };
4100
+
4101
+ // ../task-sqs-adapter/dist/esm/idempotency.js
4102
+ async function insertId(id, ttlSeconds, opts) {
4103
+ try {
4104
+ const dynamoClient = opts?.client ?? new DynamoDBClient({});
4105
+ const now = /* @__PURE__ */ new Date();
4106
+ now.setSeconds(now.getSeconds() + ttlSeconds * 1e3);
4107
+ await dynamoClient.send(new PutItemCommand({
4108
+ TableName: process.env.DYNAMODB_TABLE_NAME,
4109
+ Item: {
4110
+ PK: { S: id },
4111
+ SK: { S: id },
4112
+ ttl: { N: Math.floor(now.getTime() / 1e3).toString() }
4113
+ },
4114
+ ConditionExpression: "attribute_not_exists(PK)"
4115
+ }));
4116
+ return true;
4117
+ } catch (e3) {
4118
+ if (e3 instanceof ConditionalCheckFailedException) {
4119
+ return false;
4120
+ } else {
4121
+ throw e3;
4122
+ }
4123
+ }
4124
+ }
4125
+
4126
+ // ../../node_modules/@aws-sdk/lib-dynamodb/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
4127
+ function setFeature(context, feature, value) {
4128
+ if (!context.__aws_sdk_context) {
4129
+ context.__aws_sdk_context = {
4130
+ features: {}
4131
+ };
4132
+ } else if (!context.__aws_sdk_context.features) {
4133
+ context.__aws_sdk_context.features = {};
4134
+ }
4135
+ context.__aws_sdk_context.features[feature] = value;
4136
+ }
4137
+
4138
+ // ../../node_modules/@aws-sdk/util-dynamodb/dist-es/NumberValue.js
4139
+ var NumberValue = class _NumberValue {
4140
+ value;
4141
+ constructor(value) {
4142
+ if (typeof value === "object" && "N" in value) {
4143
+ this.value = String(value.N);
4144
+ } else {
4145
+ this.value = String(value);
4146
+ }
4147
+ const valueOf = typeof value.valueOf() === "number" ? value.valueOf() : 0;
4148
+ const imprecise = valueOf > Number.MAX_SAFE_INTEGER || valueOf < Number.MIN_SAFE_INTEGER || Math.abs(valueOf) === Infinity || Number.isNaN(valueOf);
4149
+ if (imprecise) {
4150
+ throw new Error(`NumberValue should not be initialized with an imprecise number=${valueOf}. Use a string instead.`);
4151
+ }
4152
+ }
4153
+ static from(value) {
4154
+ return new _NumberValue(value);
4155
+ }
4156
+ toAttributeValue() {
4157
+ return {
4158
+ N: this.toString()
4159
+ };
4160
+ }
4161
+ toBigInt() {
4162
+ const stringValue = this.toString();
4163
+ return BigInt(stringValue);
4164
+ }
4165
+ toString() {
4166
+ return String(this.value);
4167
+ }
4168
+ valueOf() {
4169
+ return this.toString();
4170
+ }
4171
+ };
4172
+
4173
+ // ../../node_modules/@aws-sdk/util-dynamodb/dist-es/convertToAttr.js
4174
+ var convertToAttr = (data, options) => {
4175
+ if (data === void 0) {
4176
+ throw new Error(`Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.`);
4177
+ } else if (data === null && typeof data === "object") {
4178
+ return convertToNullAttr();
4179
+ } else if (Array.isArray(data)) {
4180
+ return convertToListAttr(data, options);
4181
+ } else if (data?.constructor?.name === "Set") {
4182
+ return convertToSetAttr(data, options);
4183
+ } else if (data?.constructor?.name === "Map") {
4184
+ return convertToMapAttrFromIterable(data, options);
4185
+ } else if (data?.constructor?.name === "Object" || !data.constructor && typeof data === "object") {
4186
+ return convertToMapAttrFromEnumerableProps(data, options);
4187
+ } else if (isBinary(data)) {
4188
+ if (data.length === 0 && options?.convertEmptyValues) {
4189
+ return convertToNullAttr();
4190
+ }
4191
+ return convertToBinaryAttr(data);
4192
+ } else if (typeof data === "boolean" || data?.constructor?.name === "Boolean") {
4193
+ return { BOOL: data.valueOf() };
4194
+ } else if (typeof data === "number" || data?.constructor?.name === "Number") {
4195
+ return convertToNumberAttr(data, options);
4196
+ } else if (data instanceof NumberValue) {
4197
+ return data.toAttributeValue();
4198
+ } else if (typeof data === "bigint") {
4199
+ return convertToBigIntAttr(data);
4200
+ } else if (typeof data === "string" || data?.constructor?.name === "String") {
4201
+ if (data.length === 0 && options?.convertEmptyValues) {
4202
+ return convertToNullAttr();
4203
+ }
4204
+ return convertToStringAttr(data);
4205
+ } else if (options?.convertClassInstanceToMap && typeof data === "object") {
4206
+ return convertToMapAttrFromEnumerableProps(data, options);
4207
+ }
4208
+ throw new Error(`Unsupported type passed: ${data}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`);
4209
+ };
4210
+ var convertToListAttr = (data, options) => ({
4211
+ L: data.filter((item) => typeof item !== "function" && (!options?.removeUndefinedValues || options?.removeUndefinedValues && item !== void 0)).map((item) => convertToAttr(item, options))
4212
+ });
4213
+ var convertToSetAttr = (set, options) => {
4214
+ const setToOperate = options?.removeUndefinedValues ? new Set([...set].filter((value) => value !== void 0)) : set;
4215
+ if (!options?.removeUndefinedValues && setToOperate.has(void 0)) {
4216
+ throw new Error(`Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.`);
4217
+ }
4218
+ if (setToOperate.size === 0) {
4219
+ if (options?.convertEmptyValues) {
4220
+ return convertToNullAttr();
4221
+ }
4222
+ throw new Error(`Pass a non-empty set, or options.convertEmptyValues=true.`);
4223
+ }
4224
+ const item = setToOperate.values().next().value;
4225
+ if (item instanceof NumberValue) {
4226
+ return {
4227
+ NS: Array.from(setToOperate).map((_) => _.toString())
4228
+ };
4229
+ } else if (typeof item === "number") {
4230
+ return {
4231
+ NS: Array.from(setToOperate).map((num) => convertToNumberAttr(num, options)).map((item2) => item2.N)
4232
+ };
4233
+ } else if (typeof item === "bigint") {
4234
+ return {
4235
+ NS: Array.from(setToOperate).map(convertToBigIntAttr).map((item2) => item2.N)
4236
+ };
4237
+ } else if (typeof item === "string") {
4238
+ return {
4239
+ SS: Array.from(setToOperate).map(convertToStringAttr).map((item2) => item2.S)
4240
+ };
4241
+ } else if (isBinary(item)) {
4242
+ return {
4243
+ BS: Array.from(setToOperate).map(convertToBinaryAttr).map((item2) => item2.B)
4244
+ };
4245
+ } else {
4246
+ throw new Error(`Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.`);
4247
+ }
4248
+ };
4249
+ var convertToMapAttrFromIterable = (data, options) => ({
4250
+ M: ((data2) => {
4251
+ const map = {};
4252
+ for (const [key, value] of data2) {
4253
+ if (typeof value !== "function" && (value !== void 0 || !options?.removeUndefinedValues)) {
4254
+ map[key] = convertToAttr(value, options);
4255
+ }
4256
+ }
4257
+ return map;
4258
+ })(data)
4259
+ });
4260
+ var convertToMapAttrFromEnumerableProps = (data, options) => ({
4261
+ M: ((data2) => {
4262
+ const map = {};
4263
+ for (const key in data2) {
4264
+ const value = data2[key];
4265
+ if (typeof value !== "function" && (value !== void 0 || !options?.removeUndefinedValues)) {
4266
+ map[key] = convertToAttr(value, options);
4267
+ }
4268
+ }
4269
+ return map;
4270
+ })(data)
4271
+ });
4272
+ var convertToNullAttr = () => ({ NULL: true });
4273
+ var convertToBinaryAttr = (data) => ({ B: data });
4274
+ var convertToStringAttr = (data) => ({ S: data.toString() });
4275
+ var convertToBigIntAttr = (data) => ({ N: data.toString() });
4276
+ var validateBigIntAndThrow = (errorPrefix) => {
4277
+ throw new Error(`${errorPrefix} Use NumberValue from @aws-sdk/lib-dynamodb.`);
4278
+ };
4279
+ var convertToNumberAttr = (num, options) => {
4280
+ if ([Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY].map((val) => val.toString()).includes(num.toString())) {
4281
+ throw new Error(`Special numeric value ${num.toString()} is not allowed`);
4282
+ } else if (!options?.allowImpreciseNumbers) {
4283
+ if (Number(num) > Number.MAX_SAFE_INTEGER) {
4284
+ validateBigIntAndThrow(`Number ${num.toString()} is greater than Number.MAX_SAFE_INTEGER.`);
4285
+ } else if (Number(num) < Number.MIN_SAFE_INTEGER) {
4286
+ validateBigIntAndThrow(`Number ${num.toString()} is lesser than Number.MIN_SAFE_INTEGER.`);
4287
+ }
4288
+ }
4289
+ return { N: num.toString() };
4290
+ };
4291
+ var isBinary = (data) => {
4292
+ const binaryTypes = [
4293
+ "ArrayBuffer",
4294
+ "Blob",
4295
+ "Buffer",
4296
+ "DataView",
4297
+ "File",
4298
+ "Int8Array",
4299
+ "Uint8Array",
4300
+ "Uint8ClampedArray",
4301
+ "Int16Array",
4302
+ "Uint16Array",
4303
+ "Int32Array",
4304
+ "Uint32Array",
4305
+ "Float32Array",
4306
+ "Float64Array",
4307
+ "BigInt64Array",
4308
+ "BigUint64Array"
4309
+ ];
4310
+ if (data?.constructor) {
4311
+ return binaryTypes.includes(data.constructor.name);
4312
+ }
4313
+ return false;
4314
+ };
4315
+
4316
+ // ../../node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js
4317
+ var convertToNative = (data, options) => {
4318
+ for (const [key, value] of Object.entries(data)) {
4319
+ if (value !== void 0) {
4320
+ switch (key) {
4321
+ case "NULL":
4322
+ return null;
4323
+ case "BOOL":
4324
+ return Boolean(value);
4325
+ case "N":
4326
+ return convertNumber(value, options);
4327
+ case "B":
4328
+ return convertBinary(value);
4329
+ case "S":
4330
+ return convertString(value);
4331
+ case "L":
4332
+ return convertList(value, options);
4333
+ case "M":
4334
+ return convertMap(value, options);
4335
+ case "NS":
4336
+ return new Set(value.map((item) => convertNumber(item, options)));
4337
+ case "BS":
4338
+ return new Set(value.map(convertBinary));
4339
+ case "SS":
4340
+ return new Set(value.map(convertString));
4341
+ default:
4342
+ throw new Error(`Unsupported type passed: ${key}`);
4343
+ }
4344
+ }
4345
+ }
4346
+ throw new Error(`No value defined: ${JSON.stringify(data)}`);
4347
+ };
4348
+ var convertNumber = (numString, options) => {
4349
+ if (typeof options?.wrapNumbers === "function") {
4350
+ return options?.wrapNumbers(numString);
4351
+ }
4352
+ if (options?.wrapNumbers) {
4353
+ return NumberValue.from(numString);
4354
+ }
4355
+ const num = Number(numString);
4356
+ const infinityValues = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];
4357
+ const isLargeFiniteNumber = (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) && !infinityValues.includes(num);
4358
+ if (isLargeFiniteNumber) {
4359
+ if (typeof BigInt === "function") {
4360
+ try {
4361
+ return BigInt(numString);
4362
+ } catch (error) {
4363
+ throw new Error(`${numString} can't be converted to BigInt. Set options.wrapNumbers to get string value.`);
4364
+ }
4365
+ } else {
4366
+ throw new Error(`${numString} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);
4367
+ }
4368
+ }
4369
+ return num;
4370
+ };
4371
+ var convertString = (stringValue) => stringValue;
4372
+ var convertBinary = (binaryValue) => binaryValue;
4373
+ var convertList = (list, options) => list.map((item) => convertToNative(item, options));
4374
+ var convertMap = (map, options) => Object.entries(map).reduce((acc, [key, value]) => (acc[key] = convertToNative(value, options), acc), {});
4375
+
4376
+ // ../../node_modules/@aws-sdk/util-dynamodb/dist-es/marshall.js
4377
+ function marshall(data, options) {
4378
+ const attributeValue = convertToAttr(data, options);
4379
+ const [key, value] = Object.entries(attributeValue)[0];
4380
+ switch (key) {
4381
+ case "M":
4382
+ case "L":
4383
+ return options?.convertTopLevelContainer ? attributeValue : value;
4384
+ case "SS":
4385
+ case "NS":
4386
+ case "BS":
4387
+ case "S":
4388
+ case "N":
4389
+ case "B":
4390
+ case "NULL":
4391
+ case "BOOL":
4392
+ case "$unknown":
4393
+ default:
4394
+ return attributeValue;
4395
+ }
4396
+ }
4397
+
4398
+ // ../../node_modules/@aws-sdk/util-dynamodb/dist-es/unmarshall.js
4399
+ var unmarshall = (data, options) => {
4400
+ if (options?.convertWithoutMapWrapper) {
4401
+ return convertToNative(data, options);
4402
+ }
4403
+ return convertToNative({ M: data }, options);
4404
+ };
4405
+
4406
+ // ../../node_modules/@aws-sdk/lib-dynamodb/dist-es/commands/utils.js
4407
+ var SELF = null;
4408
+ var ALL_VALUES = {};
4409
+ var ALL_MEMBERS = [];
4410
+ var NEXT_LEVEL = "*";
4411
+ var processObj = (obj, processFunc, keyNodes) => {
4412
+ if (obj !== void 0) {
4413
+ if (keyNodes == null) {
4414
+ return processFunc(obj);
4415
+ } else {
4416
+ const keys = Object.keys(keyNodes);
4417
+ const goToNextLevel = keys.length === 1 && keys[0] === NEXT_LEVEL;
4418
+ const someChildren = keys.length >= 1 && !goToNextLevel;
4419
+ const allChildren = keys.length === 0;
4420
+ if (someChildren) {
4421
+ return processKeysInObj(obj, processFunc, keyNodes);
4422
+ } else if (allChildren) {
4423
+ return processAllKeysInObj(obj, processFunc, SELF);
4424
+ } else if (goToNextLevel) {
4425
+ return Object.entries(obj ?? {}).reduce((acc, [k3, v3]) => {
4426
+ if (typeof v3 !== "function") {
4427
+ acc[k3] = processObj(v3, processFunc, keyNodes[NEXT_LEVEL]);
4428
+ }
4429
+ return acc;
4430
+ }, Array.isArray(obj) ? [] : {});
4431
+ }
4432
+ }
4433
+ }
4434
+ return void 0;
4435
+ };
4436
+ var processKeysInObj = (obj, processFunc, keyNodes) => {
4437
+ let accumulator;
4438
+ if (Array.isArray(obj)) {
4439
+ accumulator = obj.filter((item) => typeof item !== "function");
4440
+ } else {
4441
+ accumulator = {};
4442
+ for (const [k3, v3] of Object.entries(obj)) {
4443
+ if (typeof v3 !== "function") {
4444
+ accumulator[k3] = v3;
4445
+ }
4446
+ }
4447
+ }
4448
+ for (const [nodeKey, nodes] of Object.entries(keyNodes)) {
4449
+ if (typeof obj[nodeKey] === "function") {
4450
+ continue;
4451
+ }
4452
+ const processedValue = processObj(obj[nodeKey], processFunc, nodes);
4453
+ if (processedValue !== void 0 && typeof processedValue !== "function") {
4454
+ accumulator[nodeKey] = processedValue;
4455
+ }
4456
+ }
4457
+ return accumulator;
4458
+ };
4459
+ var processAllKeysInObj = (obj, processFunc, keyNodes) => {
4460
+ if (Array.isArray(obj)) {
4461
+ return obj.filter((item) => typeof item !== "function").map((item) => processObj(item, processFunc, keyNodes));
4462
+ }
4463
+ return Object.entries(obj).reduce((acc, [key, value]) => {
4464
+ if (typeof value === "function") {
4465
+ return acc;
4466
+ }
4467
+ const processedValue = processObj(value, processFunc, keyNodes);
4468
+ if (processedValue !== void 0 && typeof processedValue !== "function") {
4469
+ acc[key] = processedValue;
4470
+ }
4471
+ return acc;
4472
+ }, {});
4473
+ };
4474
+ var marshallInput = (obj, keyNodes, options) => {
4475
+ const marshallFunc = (toMarshall) => marshall(toMarshall, options);
4476
+ return processKeysInObj(obj, marshallFunc, keyNodes);
4477
+ };
4478
+ var unmarshallOutput = (obj, keyNodes, options) => {
4479
+ const unmarshallFunc = (toMarshall) => unmarshall(toMarshall, options);
4480
+ return processKeysInObj(obj, unmarshallFunc, keyNodes);
4481
+ };
4482
+
4483
+ // ../../node_modules/@aws-sdk/lib-dynamodb/dist-es/baseCommand/DynamoDBDocumentClientCommand.js
4484
+ var DynamoDBDocumentClientCommand = class extends Command {
4485
+ addMarshallingMiddleware(configuration) {
4486
+ const { marshallOptions = {}, unmarshallOptions = {} } = configuration.translateConfig || {};
4487
+ marshallOptions.convertTopLevelContainer = marshallOptions.convertTopLevelContainer ?? true;
4488
+ unmarshallOptions.convertWithoutMapWrapper = unmarshallOptions.convertWithoutMapWrapper ?? true;
4489
+ this.clientCommand.middlewareStack.addRelativeTo((next, context) => async (args) => {
4490
+ setFeature(context, "DDB_MAPPER", "d");
4491
+ args.input = marshallInput(args.input, this.inputKeyNodes, marshallOptions);
4492
+ return next(args);
4493
+ }, {
4494
+ name: "DocumentMarshall",
4495
+ relation: "before",
4496
+ toMiddleware: "serializerMiddleware",
4497
+ override: true
4498
+ });
4499
+ this.clientCommand.middlewareStack.addRelativeTo((next, context) => async (args) => {
4500
+ const deserialized = await next(args);
4501
+ deserialized.output = unmarshallOutput(deserialized.output, this.outputKeyNodes, unmarshallOptions);
4502
+ return deserialized;
4503
+ }, {
4504
+ name: "DocumentUnmarshall",
4505
+ relation: "before",
4506
+ toMiddleware: "deserializerMiddleware",
4507
+ override: true
4508
+ });
4509
+ }
4510
+ };
4511
+
4512
+ // ../../node_modules/@aws-sdk/lib-dynamodb/dist-es/commands/QueryCommand.js
4513
+ var QueryCommand2 = class extends DynamoDBDocumentClientCommand {
4514
+ input;
4515
+ inputKeyNodes = {
4516
+ KeyConditions: {
4517
+ "*": {
4518
+ AttributeValueList: ALL_MEMBERS
4519
+ }
4520
+ },
4521
+ QueryFilter: {
4522
+ "*": {
4523
+ AttributeValueList: ALL_MEMBERS
4524
+ }
4525
+ },
4526
+ ExclusiveStartKey: ALL_VALUES,
4527
+ ExpressionAttributeValues: ALL_VALUES
4528
+ };
4529
+ outputKeyNodes = {
4530
+ Items: {
4531
+ "*": ALL_VALUES
4532
+ },
4533
+ LastEvaluatedKey: ALL_VALUES
4534
+ };
4535
+ clientCommand;
4536
+ middlewareStack;
4537
+ constructor(input) {
4538
+ super();
4539
+ this.input = input;
4540
+ this.clientCommand = new QueryCommand(this.input);
4541
+ this.middlewareStack = this.clientCommand.middlewareStack;
4542
+ }
4543
+ resolveMiddleware(clientStack, configuration, options) {
4544
+ this.addMarshallingMiddleware(configuration);
4545
+ const stack = clientStack.concat(this.middlewareStack);
4546
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
4547
+ return async () => handler(this.clientCommand);
4548
+ }
4549
+ };
4550
+
4551
+ // ../../node_modules/@aws-sdk/lib-dynamodb/dist-es/commands/ScanCommand.js
4552
+ var ScanCommand2 = class extends DynamoDBDocumentClientCommand {
4553
+ input;
4554
+ inputKeyNodes = {
4555
+ ScanFilter: {
4556
+ "*": {
4557
+ AttributeValueList: ALL_MEMBERS
4558
+ }
4559
+ },
4560
+ ExclusiveStartKey: ALL_VALUES,
4561
+ ExpressionAttributeValues: ALL_VALUES
4562
+ };
4563
+ outputKeyNodes = {
4564
+ Items: {
4565
+ "*": ALL_VALUES
4566
+ },
4567
+ LastEvaluatedKey: ALL_VALUES
4568
+ };
4569
+ clientCommand;
4570
+ middlewareStack;
4571
+ constructor(input) {
4572
+ super();
4573
+ this.input = input;
4574
+ this.clientCommand = new ScanCommand(this.input);
4575
+ this.middlewareStack = this.clientCommand.middlewareStack;
4576
+ }
4577
+ resolveMiddleware(clientStack, configuration, options) {
4578
+ this.addMarshallingMiddleware(configuration);
4579
+ const stack = clientStack.concat(this.middlewareStack);
4580
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
4581
+ return async () => handler(this.clientCommand);
4582
+ }
4583
+ };
4584
+
4585
+ // ../../node_modules/@aws-sdk/lib-dynamodb/dist-es/commands/UpdateCommand.js
4586
+ var UpdateCommand = class extends DynamoDBDocumentClientCommand {
4587
+ input;
4588
+ inputKeyNodes = {
4589
+ Key: ALL_VALUES,
4590
+ AttributeUpdates: {
4591
+ "*": {
4592
+ Value: SELF
4593
+ }
4594
+ },
4595
+ Expected: {
4596
+ "*": {
4597
+ Value: SELF,
4598
+ AttributeValueList: ALL_MEMBERS
4599
+ }
4600
+ },
4601
+ ExpressionAttributeValues: ALL_VALUES
4602
+ };
4603
+ outputKeyNodes = {
4604
+ Attributes: ALL_VALUES,
4605
+ ItemCollectionMetrics: {
4606
+ ItemCollectionKey: ALL_VALUES
4607
+ }
4608
+ };
4609
+ clientCommand;
4610
+ middlewareStack;
4611
+ constructor(input) {
4612
+ super();
4613
+ this.input = input;
4614
+ this.clientCommand = new UpdateItemCommand(this.input);
4615
+ this.middlewareStack = this.clientCommand.middlewareStack;
4616
+ }
4617
+ resolveMiddleware(clientStack, configuration, options) {
4618
+ this.addMarshallingMiddleware(configuration);
4619
+ const stack = clientStack.concat(this.middlewareStack);
4620
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
4621
+ return async () => handler(this.clientCommand);
4622
+ }
4623
+ };
4624
+
4625
+ // ../../node_modules/@aws-sdk/lib-dynamodb/dist-es/DynamoDBDocumentClient.js
4626
+ var DynamoDBDocumentClient = class _DynamoDBDocumentClient extends Client {
4627
+ config;
4628
+ constructor(client2, translateConfig) {
4629
+ super(client2.config);
4630
+ this.config = client2.config;
4631
+ this.config.translateConfig = translateConfig;
4632
+ this.middlewareStack = client2.middlewareStack;
4633
+ if (this.config?.cacheMiddleware) {
4634
+ throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the DynamoDBDocumentClient. This option must be set to false.");
4635
+ }
4636
+ }
4637
+ static from(client2, translateConfig) {
4638
+ return new _DynamoDBDocumentClient(client2, translateConfig);
4639
+ }
4640
+ destroy() {
4641
+ }
4642
+ };
4643
+
4644
+ // ../../node_modules/@aws-sdk/lib-dynamodb/dist-es/pagination/QueryPaginator.js
4645
+ createPaginator(DynamoDBDocumentClient, QueryCommand2, "ExclusiveStartKey", "LastEvaluatedKey", "Limit");
4646
+
4647
+ // ../../node_modules/@aws-sdk/lib-dynamodb/dist-es/pagination/ScanPaginator.js
4648
+ createPaginator(DynamoDBDocumentClient, ScanCommand2, "ExclusiveStartKey", "LastEvaluatedKey", "Limit");
4649
+
4650
+ // ../task-sqs-adapter/dist/esm/queue-stats.js
4651
+ var client = new DynamoDBClient();
4652
+ async function incrementFinished(id) {
4653
+ const response = await client.send(updateCommandInput({ task: id, attribute: "finished" }));
4654
+ return response.Attributes?.finished;
4655
+ }
4656
+ async function incrementFailed(id) {
4657
+ const response = await client.send(updateCommandInput({ task: id, attribute: "failed" }));
4658
+ return response.Attributes?.failed;
4659
+ }
4660
+ function updateCommandInput({ task, attribute }) {
4661
+ return new UpdateCommand({
4662
+ TableName: process.env.DYNAMODB_TABLE_NAME,
4663
+ Key: { PK: `STATS-${task}`, SK: `STATS-${task}` },
4664
+ UpdateExpression: `SET ${attribute} = if_not_exists(${attribute}, :zero) + :inc`,
4665
+ ExpressionAttributeValues: {
4666
+ ":zero": 0,
4667
+ ":inc": 1
4668
+ },
4669
+ ReturnValues: "UPDATED_NEW"
4670
+ });
4671
+ }
4672
+
4673
+ // ../task-sqs-adapter/dist/esm/handler.js
4674
+ var sqsClient2 = new SQSClient();
4675
+ var dynamoDbClient = new DynamoDBClient({});
4676
+ function makeSQSTaskHandler(task) {
4677
+ const handler = async (event) => {
4678
+ const failedRecords = [];
4679
+ for (const record of event.Records) {
4680
+ try {
4681
+ await putIdempotencyRecord(record);
4682
+ await runTask(task, record);
4683
+ } catch (error) {
4684
+ console.error("Could not process record", error, record);
4685
+ failedRecords.push(record);
4686
+ }
4687
+ }
4688
+ try {
4689
+ await putFailures(failedRecords);
4690
+ return { batchItemFailures: [] };
4691
+ } catch {
4692
+ await changeMessageVisibility(failedRecords);
4693
+ return {
4694
+ batchItemFailures: failedRecords.map((record) => ({
4695
+ itemIdentifier: record.messageId
4696
+ }))
4697
+ };
4698
+ }
4699
+ };
4700
+ return handler;
4701
+ }
4702
+ async function changeMessageVisibility(failedRecords) {
4703
+ for (const record of failedRecords) {
4704
+ try {
4705
+ await sqsClient2.send(new ChangeMessageVisibilityCommand({
4706
+ QueueUrl: process.env.QUEUE_URL,
4707
+ ReceiptHandle: record.receiptHandle,
4708
+ VisibilityTimeout: 0
4709
+ }));
4710
+ } catch (e3) {
4711
+ console.debug("Could not change message visibility", e3);
4712
+ }
4713
+ }
4714
+ }
4715
+ async function runTask(task, record) {
4716
+ let error;
4717
+ try {
4718
+ await task.work({
4719
+ taskId: record.messageId,
4720
+ data: JSON.parse(record.body)
4721
+ });
4722
+ } catch (e3) {
4723
+ console.error(`Error in task: ${task.id}`, e3, record);
4724
+ const options = task.options;
4725
+ if (options?.onError) {
4726
+ try {
4727
+ options.onError(new Error("Task error", { cause: e3 }));
4728
+ } catch {
4729
+ }
4730
+ }
4731
+ error = e3;
4732
+ }
4733
+ try {
4734
+ const incrementFn = error ? incrementFailed : incrementFinished;
4735
+ await incrementFn(task.id);
4736
+ } catch (e3) {
4737
+ console.error("error while setting counter", e3);
4738
+ }
4739
+ if (error) {
4740
+ throw error;
4741
+ }
4742
+ }
4743
+ async function putIdempotencyRecord(record) {
4744
+ const messageAttributes = record.messageAttributes;
4745
+ const taskId = messageAttributes["taskId"]?.stringValue;
4746
+ if (taskId === void 0) {
4747
+ throw new Error("Expected message attribute with taskId");
4748
+ }
4749
+ const idempotencyId = messageAttributes["executionId"]?.stringValue;
4750
+ if (idempotencyId === void 0) {
4751
+ throw new Error("Expected message attribute with executionId");
4752
+ }
4753
+ await insertId(idempotencyId, 600, { client: dynamoDbClient });
4754
+ }
4755
+ async function putFailures(records) {
4756
+ if (records.length === 0)
4757
+ return;
4758
+ await dynamoDbClient.send(new BatchWriteItemCommand({
4759
+ RequestItems: {
4760
+ [process.env.DYNAMODB_TABLE_NAME]: records.map((record) => ({
4761
+ PutRequest: {
4762
+ Item: {
4763
+ PK: { S: `FAILED-${process.env.TASK_ID}` },
4764
+ SK: { S: (/* @__PURE__ */ new Date()).toISOString() },
4765
+ data: { S: record.body }
4766
+ }
4767
+ }
4768
+ }))
4769
+ }
4770
+ }));
4771
+ }
4772
+
4773
+ export { dispatcher, makeSQSTaskHandler };