@digipair/skill-s3 0.136.3 → 0.136.4

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.
@@ -0,0 +1,4885 @@
1
+ import { H as HttpRequest, n as normalizeProvider, i as isValidHostLabel, e as isIpAddress, h as customEndpointFunctions, j as setFeature, k as CONFIG_PREFIX_SEPARATOR, l as loadConfig, p as parseUrl, m as getSmithyContext, o as setFeature$1, q as normalizeProvider$1, v as toUint8Array, w as fromString, x as fromArrayBuffer } from './index.esm2.js';
2
+ import { release, platform } from 'os';
3
+ import { versions, env } from 'process';
4
+ import { Buffer } from 'buffer';
5
+ import { createHmac, createHash } from 'crypto';
6
+
7
+ function _array_like_to_array$8(arr, len) {
8
+ if (len == null || len > arr.length) len = arr.length;
9
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
10
+ return arr2;
11
+ }
12
+ function _array_with_holes$5(arr) {
13
+ if (Array.isArray(arr)) return arr;
14
+ }
15
+ function _array_without_holes$3(arr) {
16
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
17
+ }
18
+ function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
19
+ try {
20
+ var info = gen[key](arg);
21
+ var value = info.value;
22
+ } catch (error) {
23
+ reject(error);
24
+ return;
25
+ }
26
+ if (info.done) {
27
+ resolve(value);
28
+ } else {
29
+ Promise.resolve(value).then(_next, _throw);
30
+ }
31
+ }
32
+ function _async_to_generator$f(fn) {
33
+ return function() {
34
+ var self = this, args = arguments;
35
+ return new Promise(function(resolve, reject) {
36
+ var gen = fn.apply(self, args);
37
+ function _next(value) {
38
+ asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "next", value);
39
+ }
40
+ function _throw(err) {
41
+ asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "throw", err);
42
+ }
43
+ _next(undefined);
44
+ });
45
+ };
46
+ }
47
+ function _define_property$7(obj, key, value) {
48
+ if (key in obj) {
49
+ Object.defineProperty(obj, key, {
50
+ value: value,
51
+ enumerable: true,
52
+ configurable: true,
53
+ writable: true
54
+ });
55
+ } else {
56
+ obj[key] = value;
57
+ }
58
+ return obj;
59
+ }
60
+ function _iterable_to_array$4(iter) {
61
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
62
+ }
63
+ function _iterable_to_array_limit$4(arr, i) {
64
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
65
+ if (_i == null) return;
66
+ var _arr = [];
67
+ var _n = true;
68
+ var _d = false;
69
+ var _s, _e;
70
+ try {
71
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
72
+ _arr.push(_s.value);
73
+ if (i && _arr.length === i) break;
74
+ }
75
+ } catch (err) {
76
+ _d = true;
77
+ _e = err;
78
+ } finally{
79
+ try {
80
+ if (!_n && _i["return"] != null) _i["return"]();
81
+ } finally{
82
+ if (_d) throw _e;
83
+ }
84
+ }
85
+ return _arr;
86
+ }
87
+ function _non_iterable_rest$5() {
88
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
89
+ }
90
+ function _non_iterable_spread$3() {
91
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
92
+ }
93
+ function _object_spread$5(target) {
94
+ for(var i = 1; i < arguments.length; i++){
95
+ var source = arguments[i] != null ? arguments[i] : {};
96
+ var ownKeys = Object.keys(source);
97
+ if (typeof Object.getOwnPropertySymbols === "function") {
98
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
99
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
100
+ }));
101
+ }
102
+ ownKeys.forEach(function(key) {
103
+ _define_property$7(target, key, source[key]);
104
+ });
105
+ }
106
+ return target;
107
+ }
108
+ function ownKeys$3(object, enumerableOnly) {
109
+ var keys = Object.keys(object);
110
+ if (Object.getOwnPropertySymbols) {
111
+ var symbols = Object.getOwnPropertySymbols(object);
112
+ keys.push.apply(keys, symbols);
113
+ }
114
+ return keys;
115
+ }
116
+ function _object_spread_props$3(target, source) {
117
+ source = source != null ? source : {};
118
+ if (Object.getOwnPropertyDescriptors) {
119
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
120
+ } else {
121
+ ownKeys$3(Object(source)).forEach(function(key) {
122
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
123
+ });
124
+ }
125
+ return target;
126
+ }
127
+ function _sliced_to_array$4(arr, i) {
128
+ return _array_with_holes$5(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$5();
129
+ }
130
+ function _to_consumable_array$3(arr) {
131
+ return _array_without_holes$3(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$3();
132
+ }
133
+ function _type_of$3(obj) {
134
+ "@swc/helpers - typeof";
135
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
136
+ }
137
+ function _unsupported_iterable_to_array$8(o, minLen) {
138
+ if (!o) return;
139
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
140
+ var n = Object.prototype.toString.call(o).slice(8, -1);
141
+ if (n === "Object" && o.constructor) n = o.constructor.name;
142
+ if (n === "Map" || n === "Set") return Array.from(n);
143
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
144
+ }
145
+ function _ts_generator$f(thisArg, body) {
146
+ var f, y, t, g, _ = {
147
+ label: 0,
148
+ sent: function() {
149
+ if (t[0] & 1) throw t[1];
150
+ return t[1];
151
+ },
152
+ trys: [],
153
+ ops: []
154
+ };
155
+ return g = {
156
+ next: verb(0),
157
+ "throw": verb(1),
158
+ "return": verb(2)
159
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
160
+ return this;
161
+ }), g;
162
+ function verb(n) {
163
+ return function(v) {
164
+ return step([
165
+ n,
166
+ v
167
+ ]);
168
+ };
169
+ }
170
+ function step(op) {
171
+ if (f) throw new TypeError("Generator is already executing.");
172
+ while(_)try {
173
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
174
+ if (y = 0, t) op = [
175
+ op[0] & 2,
176
+ t.value
177
+ ];
178
+ switch(op[0]){
179
+ case 0:
180
+ case 1:
181
+ t = op;
182
+ break;
183
+ case 4:
184
+ _.label++;
185
+ return {
186
+ value: op[1],
187
+ done: false
188
+ };
189
+ case 5:
190
+ _.label++;
191
+ y = op[1];
192
+ op = [
193
+ 0
194
+ ];
195
+ continue;
196
+ case 7:
197
+ op = _.ops.pop();
198
+ _.trys.pop();
199
+ continue;
200
+ default:
201
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
202
+ _ = 0;
203
+ continue;
204
+ }
205
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
206
+ _.label = op[1];
207
+ break;
208
+ }
209
+ if (op[0] === 6 && _.label < t[1]) {
210
+ _.label = t[1];
211
+ t = op;
212
+ break;
213
+ }
214
+ if (t && _.label < t[2]) {
215
+ _.label = t[2];
216
+ _.ops.push(op);
217
+ break;
218
+ }
219
+ if (t[2]) _.ops.pop();
220
+ _.trys.pop();
221
+ continue;
222
+ }
223
+ op = body.call(thisArg, _);
224
+ } catch (e) {
225
+ op = [
226
+ 6,
227
+ e
228
+ ];
229
+ y = 0;
230
+ } finally{
231
+ f = t = 0;
232
+ }
233
+ if (op[0] & 5) throw op[1];
234
+ return {
235
+ value: op[0] ? op[1] : void 0,
236
+ done: true
237
+ };
238
+ }
239
+ }
240
+ var createAggregatedClient = function(commands, Client, options) {
241
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
242
+ try {
243
+ var _loop = function() {
244
+ var _step_value = _sliced_to_array$4(_step.value, 2), command = _step_value[0], CommandCtor = _step_value[1];
245
+ var methodImpl = function() {
246
+ var _ref = _async_to_generator$f(function(args, optionsOrCb, cb) {
247
+ var command;
248
+ return _ts_generator$f(this, function(_state) {
249
+ command = new CommandCtor(args);
250
+ if (typeof optionsOrCb === "function") {
251
+ this.send(command, optionsOrCb);
252
+ } else if (typeof cb === "function") {
253
+ if ((typeof optionsOrCb === "undefined" ? "undefined" : _type_of$3(optionsOrCb)) !== "object") throw new Error("Expected http options but got ".concat(typeof optionsOrCb === "undefined" ? "undefined" : _type_of$3(optionsOrCb)));
254
+ this.send(command, optionsOrCb || {}, cb);
255
+ } else {
256
+ return [
257
+ 2,
258
+ this.send(command, optionsOrCb)
259
+ ];
260
+ }
261
+ return [
262
+ 2
263
+ ];
264
+ });
265
+ });
266
+ return function methodImpl(args, optionsOrCb, cb) {
267
+ return _ref.apply(this, arguments);
268
+ };
269
+ }();
270
+ var methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
271
+ Client.prototype[methodName] = methodImpl;
272
+ };
273
+ for(var _iterator = Object.entries(commands)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
274
+ } catch (err) {
275
+ _didIteratorError = true;
276
+ _iteratorError = err;
277
+ } finally{
278
+ try {
279
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
280
+ _iterator.return();
281
+ }
282
+ } finally{
283
+ if (_didIteratorError) {
284
+ throw _iteratorError;
285
+ }
286
+ }
287
+ }
288
+ var _ref = {}, _ref_paginators = _ref.paginators, paginators = _ref_paginators === void 0 ? {} : _ref_paginators, _ref_waiters = _ref.waiters, waiters = _ref_waiters === void 0 ? {} : _ref_waiters;
289
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
290
+ try {
291
+ var _loop1 = function() {
292
+ var _step_value = _sliced_to_array$4(_step1.value, 2), paginatorName = _step_value[0], paginatorFn = _step_value[1];
293
+ if (Client.prototype[paginatorName] === void 0) {
294
+ Client.prototype[paginatorName] = function createAggregatedClient() {
295
+ var commandInput = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, paginationConfiguration = arguments.length > 1 ? arguments[1] : void 0;
296
+ for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
297
+ rest[_key - 2] = arguments[_key];
298
+ }
299
+ return paginatorFn.apply(void 0, [
300
+ _object_spread_props$3(_object_spread$5({}, paginationConfiguration), {
301
+ client: this
302
+ }),
303
+ commandInput
304
+ ].concat(_to_consumable_array$3(rest)));
305
+ };
306
+ }
307
+ };
308
+ for(var _iterator1 = Object.entries(paginators)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true)_loop1();
309
+ } catch (err) {
310
+ _didIteratorError1 = true;
311
+ _iteratorError1 = err;
312
+ } finally{
313
+ try {
314
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
315
+ _iterator1.return();
316
+ }
317
+ } finally{
318
+ if (_didIteratorError1) {
319
+ throw _iteratorError1;
320
+ }
321
+ }
322
+ }
323
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
324
+ try {
325
+ var _loop2 = function() {
326
+ var _step_value = _sliced_to_array$4(_step2.value, 2), waiterName = _step_value[0], waiterFn = _step_value[1];
327
+ if (Client.prototype[waiterName] === void 0) {
328
+ Client.prototype[waiterName] = /*#__PURE__*/ _async_to_generator$f(function() {
329
+ var commandInput, waiterConfiguration, _len, rest, _key, config;
330
+ var _arguments = arguments;
331
+ return _ts_generator$f(this, function(_state) {
332
+ commandInput = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, waiterConfiguration = _arguments.length > 1 ? _arguments[1] : void 0;
333
+ for(_len = _arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
334
+ rest[_key - 2] = _arguments[_key];
335
+ }
336
+ config = waiterConfiguration;
337
+ if (typeof waiterConfiguration === "number") {
338
+ config = {
339
+ maxWaitTime: waiterConfiguration
340
+ };
341
+ }
342
+ return [
343
+ 2,
344
+ waiterFn.apply(void 0, [
345
+ _object_spread_props$3(_object_spread$5({}, config), {
346
+ client: this
347
+ }),
348
+ commandInput
349
+ ].concat(_to_consumable_array$3(rest)))
350
+ ];
351
+ });
352
+ });
353
+ }
354
+ };
355
+ for(var _iterator2 = Object.entries(waiters)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true)_loop2();
356
+ } catch (err) {
357
+ _didIteratorError2 = true;
358
+ _iteratorError2 = err;
359
+ } finally{
360
+ try {
361
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
362
+ _iterator2.return();
363
+ }
364
+ } finally{
365
+ if (_didIteratorError2) {
366
+ throw _iteratorError2;
367
+ }
368
+ }
369
+ }
370
+ };
371
+
372
+ function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
373
+ try {
374
+ var info = gen[key](arg);
375
+ var value = info.value;
376
+ } catch (error) {
377
+ reject(error);
378
+ return;
379
+ }
380
+ if (info.done) {
381
+ resolve(value);
382
+ } else {
383
+ Promise.resolve(value).then(_next, _throw);
384
+ }
385
+ }
386
+ function _async_to_generator$e(fn) {
387
+ return function() {
388
+ var self = this, args = arguments;
389
+ return new Promise(function(resolve, reject) {
390
+ var gen = fn.apply(self, args);
391
+ function _next(value) {
392
+ asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "next", value);
393
+ }
394
+ function _throw(err) {
395
+ asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "throw", err);
396
+ }
397
+ _next(undefined);
398
+ });
399
+ };
400
+ }
401
+ function _ts_generator$e(thisArg, body) {
402
+ var f, y, t, g, _ = {
403
+ label: 0,
404
+ sent: function() {
405
+ if (t[0] & 1) throw t[1];
406
+ return t[1];
407
+ },
408
+ trys: [],
409
+ ops: []
410
+ };
411
+ return g = {
412
+ next: verb(0),
413
+ "throw": verb(1),
414
+ "return": verb(2)
415
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
416
+ return this;
417
+ }), g;
418
+ function verb(n) {
419
+ return function(v) {
420
+ return step([
421
+ n,
422
+ v
423
+ ]);
424
+ };
425
+ }
426
+ function step(op) {
427
+ if (f) throw new TypeError("Generator is already executing.");
428
+ while(_)try {
429
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
430
+ if (y = 0, t) op = [
431
+ op[0] & 2,
432
+ t.value
433
+ ];
434
+ switch(op[0]){
435
+ case 0:
436
+ case 1:
437
+ t = op;
438
+ break;
439
+ case 4:
440
+ _.label++;
441
+ return {
442
+ value: op[1],
443
+ done: false
444
+ };
445
+ case 5:
446
+ _.label++;
447
+ y = op[1];
448
+ op = [
449
+ 0
450
+ ];
451
+ continue;
452
+ case 7:
453
+ op = _.ops.pop();
454
+ _.trys.pop();
455
+ continue;
456
+ default:
457
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
458
+ _ = 0;
459
+ continue;
460
+ }
461
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
462
+ _.label = op[1];
463
+ break;
464
+ }
465
+ if (op[0] === 6 && _.label < t[1]) {
466
+ _.label = t[1];
467
+ t = op;
468
+ break;
469
+ }
470
+ if (t && _.label < t[2]) {
471
+ _.label = t[2];
472
+ _.ops.push(op);
473
+ break;
474
+ }
475
+ if (t[2]) _.ops.pop();
476
+ _.trys.pop();
477
+ continue;
478
+ }
479
+ op = body.call(thisArg, _);
480
+ } catch (e) {
481
+ op = [
482
+ 6,
483
+ e
484
+ ];
485
+ y = 0;
486
+ } finally{
487
+ f = t = 0;
488
+ }
489
+ if (op[0] & 5) throw op[1];
490
+ return {
491
+ value: op[0] ? op[1] : void 0,
492
+ done: true
493
+ };
494
+ }
495
+ }
496
+ function resolveHostHeaderConfig(input) {
497
+ return input;
498
+ }
499
+ var hostHeaderMiddleware = function(options) {
500
+ return function(next) {
501
+ return function() {
502
+ var _ref = _async_to_generator$e(function(args) {
503
+ var request, _ref, _ref_handlerProtocol, handlerProtocol, host;
504
+ return _ts_generator$e(this, function(_state) {
505
+ if (!HttpRequest.isInstance(args.request)) return [
506
+ 2,
507
+ next(args)
508
+ ];
509
+ request = args.request;
510
+ _ref = options.requestHandler.metadata || {}, _ref_handlerProtocol = _ref.handlerProtocol, handlerProtocol = _ref_handlerProtocol === void 0 ? "" : _ref_handlerProtocol;
511
+ if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
512
+ delete request.headers["host"];
513
+ request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
514
+ } else if (!request.headers["host"]) {
515
+ host = request.hostname;
516
+ if (request.port != null) host += ":".concat(request.port);
517
+ request.headers["host"] = host;
518
+ }
519
+ return [
520
+ 2,
521
+ next(args)
522
+ ];
523
+ });
524
+ });
525
+ return function(args) {
526
+ return _ref.apply(this, arguments);
527
+ };
528
+ }();
529
+ };
530
+ };
531
+ var hostHeaderMiddlewareOptions = {
532
+ name: "hostHeaderMiddleware",
533
+ step: "build",
534
+ priority: "low",
535
+ tags: [
536
+ "HOST"
537
+ ],
538
+ override: true
539
+ };
540
+ var getHostHeaderPlugin = function(options) {
541
+ return {
542
+ applyToStack: function(clientStack) {
543
+ clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
544
+ }
545
+ };
546
+ };
547
+
548
+ function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
549
+ try {
550
+ var info = gen[key](arg);
551
+ var value = info.value;
552
+ } catch (error) {
553
+ reject(error);
554
+ return;
555
+ }
556
+ if (info.done) {
557
+ resolve(value);
558
+ } else {
559
+ Promise.resolve(value).then(_next, _throw);
560
+ }
561
+ }
562
+ function _async_to_generator$d(fn) {
563
+ return function() {
564
+ var self = this, args = arguments;
565
+ return new Promise(function(resolve, reject) {
566
+ var gen = fn.apply(self, args);
567
+ function _next(value) {
568
+ asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "next", value);
569
+ }
570
+ function _throw(err) {
571
+ asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "throw", err);
572
+ }
573
+ _next(undefined);
574
+ });
575
+ };
576
+ }
577
+ function _object_without_properties(source, excluded) {
578
+ if (source == null) return {};
579
+ var target = _object_without_properties_loose(source, excluded);
580
+ var key, i;
581
+ if (Object.getOwnPropertySymbols) {
582
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
583
+ for(i = 0; i < sourceSymbolKeys.length; i++){
584
+ key = sourceSymbolKeys[i];
585
+ if (excluded.indexOf(key) >= 0) continue;
586
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
587
+ target[key] = source[key];
588
+ }
589
+ }
590
+ return target;
591
+ }
592
+ function _object_without_properties_loose(source, excluded) {
593
+ if (source == null) return {};
594
+ var target = {};
595
+ var sourceKeys = Object.keys(source);
596
+ var key, i;
597
+ for(i = 0; i < sourceKeys.length; i++){
598
+ key = sourceKeys[i];
599
+ if (excluded.indexOf(key) >= 0) continue;
600
+ target[key] = source[key];
601
+ }
602
+ return target;
603
+ }
604
+ function _ts_generator$d(thisArg, body) {
605
+ var f, y, t, g, _ = {
606
+ label: 0,
607
+ sent: function() {
608
+ if (t[0] & 1) throw t[1];
609
+ return t[1];
610
+ },
611
+ trys: [],
612
+ ops: []
613
+ };
614
+ return g = {
615
+ next: verb(0),
616
+ "throw": verb(1),
617
+ "return": verb(2)
618
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
619
+ return this;
620
+ }), g;
621
+ function verb(n) {
622
+ return function(v) {
623
+ return step([
624
+ n,
625
+ v
626
+ ]);
627
+ };
628
+ }
629
+ function step(op) {
630
+ if (f) throw new TypeError("Generator is already executing.");
631
+ while(_)try {
632
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
633
+ if (y = 0, t) op = [
634
+ op[0] & 2,
635
+ t.value
636
+ ];
637
+ switch(op[0]){
638
+ case 0:
639
+ case 1:
640
+ t = op;
641
+ break;
642
+ case 4:
643
+ _.label++;
644
+ return {
645
+ value: op[1],
646
+ done: false
647
+ };
648
+ case 5:
649
+ _.label++;
650
+ y = op[1];
651
+ op = [
652
+ 0
653
+ ];
654
+ continue;
655
+ case 7:
656
+ op = _.ops.pop();
657
+ _.trys.pop();
658
+ continue;
659
+ default:
660
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
661
+ _ = 0;
662
+ continue;
663
+ }
664
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
665
+ _.label = op[1];
666
+ break;
667
+ }
668
+ if (op[0] === 6 && _.label < t[1]) {
669
+ _.label = t[1];
670
+ t = op;
671
+ break;
672
+ }
673
+ if (t && _.label < t[2]) {
674
+ _.label = t[2];
675
+ _.ops.push(op);
676
+ break;
677
+ }
678
+ if (t[2]) _.ops.pop();
679
+ _.trys.pop();
680
+ continue;
681
+ }
682
+ op = body.call(thisArg, _);
683
+ } catch (e) {
684
+ op = [
685
+ 6,
686
+ e
687
+ ];
688
+ y = 0;
689
+ } finally{
690
+ f = t = 0;
691
+ }
692
+ if (op[0] & 5) throw op[1];
693
+ return {
694
+ value: op[0] ? op[1] : void 0,
695
+ done: true
696
+ };
697
+ }
698
+ }
699
+ var loggerMiddleware = function() {
700
+ return function(next, context) {
701
+ return function() {
702
+ var _ref = _async_to_generator$d(function(args) {
703
+ var _logger_info, response, clientName, commandName, logger, _context_dynamoDbDocumentClientOptions, dynamoDbDocumentClientOptions, overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog, inputFilterSensitiveLog, outputFilterSensitiveLog, _response_output, $metadata, outputWithoutMetadata, error, _logger_error, clientName1, commandName1, logger1, _context_dynamoDbDocumentClientOptions1, dynamoDbDocumentClientOptions1, overrideInputFilterSensitiveLog1, inputFilterSensitiveLog1;
704
+ return _ts_generator$d(this, function(_state) {
705
+ switch(_state.label){
706
+ case 0:
707
+ _state.trys.push([
708
+ 0,
709
+ 2,
710
+ ,
711
+ 3
712
+ ]);
713
+ return [
714
+ 4,
715
+ next(args)
716
+ ];
717
+ case 1:
718
+ response = _state.sent();
719
+ clientName = context.clientName, commandName = context.commandName, logger = context.logger, _context_dynamoDbDocumentClientOptions = context.dynamoDbDocumentClientOptions, dynamoDbDocumentClientOptions = _context_dynamoDbDocumentClientOptions === void 0 ? {} : _context_dynamoDbDocumentClientOptions;
720
+ overrideInputFilterSensitiveLog = dynamoDbDocumentClientOptions.overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog = dynamoDbDocumentClientOptions.overrideOutputFilterSensitiveLog;
721
+ inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog;
722
+ outputFilterSensitiveLog = overrideOutputFilterSensitiveLog !== null && overrideOutputFilterSensitiveLog !== void 0 ? overrideOutputFilterSensitiveLog : context.outputFilterSensitiveLog;
723
+ _response_output = response.output, $metadata = _response_output.$metadata, outputWithoutMetadata = _object_without_properties(_response_output, [
724
+ "$metadata"
725
+ ]);
726
+ logger === null || logger === void 0 ? void 0 : (_logger_info = logger.info) === null || _logger_info === void 0 ? void 0 : _logger_info.call(logger, {
727
+ clientName: clientName,
728
+ commandName: commandName,
729
+ input: inputFilterSensitiveLog(args.input),
730
+ output: outputFilterSensitiveLog(outputWithoutMetadata),
731
+ metadata: $metadata
732
+ });
733
+ return [
734
+ 2,
735
+ response
736
+ ];
737
+ case 2:
738
+ error = _state.sent();
739
+ clientName1 = context.clientName, commandName1 = context.commandName, logger1 = context.logger, _context_dynamoDbDocumentClientOptions1 = context.dynamoDbDocumentClientOptions, dynamoDbDocumentClientOptions1 = _context_dynamoDbDocumentClientOptions1 === void 0 ? {} : _context_dynamoDbDocumentClientOptions1;
740
+ overrideInputFilterSensitiveLog1 = dynamoDbDocumentClientOptions1.overrideInputFilterSensitiveLog;
741
+ inputFilterSensitiveLog1 = overrideInputFilterSensitiveLog1 !== null && overrideInputFilterSensitiveLog1 !== void 0 ? overrideInputFilterSensitiveLog1 : context.inputFilterSensitiveLog;
742
+ logger1 === null || logger1 === void 0 ? void 0 : (_logger_error = logger1.error) === null || _logger_error === void 0 ? void 0 : _logger_error.call(logger1, {
743
+ clientName: clientName1,
744
+ commandName: commandName1,
745
+ input: inputFilterSensitiveLog1(args.input),
746
+ error: error,
747
+ metadata: error.$metadata
748
+ });
749
+ throw error;
750
+ case 3:
751
+ return [
752
+ 2
753
+ ];
754
+ }
755
+ });
756
+ });
757
+ return function(args) {
758
+ return _ref.apply(this, arguments);
759
+ };
760
+ }();
761
+ };
762
+ };
763
+ var loggerMiddlewareOptions = {
764
+ name: "loggerMiddleware",
765
+ tags: [
766
+ "LOGGER"
767
+ ],
768
+ step: "initialize",
769
+ override: true
770
+ };
771
+ var getLoggerPlugin = function(options) {
772
+ return {
773
+ applyToStack: function(clientStack) {
774
+ clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
775
+ }
776
+ };
777
+ };
778
+
779
+ var recursionDetectionMiddlewareOptions = {
780
+ step: "build",
781
+ tags: [
782
+ "RECURSION_DETECTION"
783
+ ],
784
+ name: "recursionDetectionMiddleware",
785
+ override: true,
786
+ priority: "low"
787
+ };
788
+
789
+ function _assert_this_initialized(self) {
790
+ if (self === void 0) {
791
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
792
+ }
793
+ return self;
794
+ }
795
+ function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
796
+ try {
797
+ var info = gen[key](arg);
798
+ var value = info.value;
799
+ } catch (error) {
800
+ reject(error);
801
+ return;
802
+ }
803
+ if (info.done) {
804
+ resolve(value);
805
+ } else {
806
+ Promise.resolve(value).then(_next, _throw);
807
+ }
808
+ }
809
+ function _async_to_generator$c(fn) {
810
+ return function() {
811
+ var self = this, args = arguments;
812
+ return new Promise(function(resolve, reject) {
813
+ var gen = fn.apply(self, args);
814
+ function _next(value) {
815
+ asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "next", value);
816
+ }
817
+ function _throw(err) {
818
+ asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "throw", err);
819
+ }
820
+ _next(undefined);
821
+ });
822
+ };
823
+ }
824
+ function _class_call_check$1(instance, Constructor) {
825
+ if (!(instance instanceof Constructor)) {
826
+ throw new TypeError("Cannot call a class as a function");
827
+ }
828
+ }
829
+ function _defineProperties$1(target, props) {
830
+ for(var i = 0; i < props.length; i++){
831
+ var descriptor = props[i];
832
+ descriptor.enumerable = descriptor.enumerable || false;
833
+ descriptor.configurable = true;
834
+ if ("value" in descriptor) descriptor.writable = true;
835
+ Object.defineProperty(target, descriptor.key, descriptor);
836
+ }
837
+ }
838
+ function _create_class$1(Constructor, protoProps, staticProps) {
839
+ if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
840
+ if (staticProps) _defineProperties$1(Constructor, staticProps);
841
+ return Constructor;
842
+ }
843
+ function _define_property$6(obj, key, value) {
844
+ if (key in obj) {
845
+ Object.defineProperty(obj, key, {
846
+ value: value,
847
+ enumerable: true,
848
+ configurable: true,
849
+ writable: true
850
+ });
851
+ } else {
852
+ obj[key] = value;
853
+ }
854
+ return obj;
855
+ }
856
+ function _get_prototype_of(o) {
857
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
858
+ return o.__proto__ || Object.getPrototypeOf(o);
859
+ };
860
+ return _get_prototype_of(o);
861
+ }
862
+ function _inherits(subClass, superClass) {
863
+ if (typeof superClass !== "function" && superClass !== null) {
864
+ throw new TypeError("Super expression must either be null or a function");
865
+ }
866
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
867
+ constructor: {
868
+ value: subClass,
869
+ writable: true,
870
+ configurable: true
871
+ }
872
+ });
873
+ if (superClass) _set_prototype_of(subClass, superClass);
874
+ }
875
+ function _possible_constructor_return(self, call) {
876
+ if (call && (_type_of$2(call) === "object" || typeof call === "function")) {
877
+ return call;
878
+ }
879
+ return _assert_this_initialized(self);
880
+ }
881
+ function _set_prototype_of(o, p) {
882
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
883
+ o.__proto__ = p;
884
+ return o;
885
+ };
886
+ return _set_prototype_of(o, p);
887
+ }
888
+ function _type_of$2(obj) {
889
+ "@swc/helpers - typeof";
890
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
891
+ }
892
+ function _is_native_reflect_construct() {
893
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
894
+ if (Reflect.construct.sham) return false;
895
+ if (typeof Proxy === "function") return true;
896
+ try {
897
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
898
+ return true;
899
+ } catch (e) {
900
+ return false;
901
+ }
902
+ }
903
+ function _create_super(Derived) {
904
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
905
+ return function _createSuperInternal() {
906
+ var Super = _get_prototype_of(Derived), result;
907
+ if (hasNativeReflectConstruct) {
908
+ var NewTarget = _get_prototype_of(this).constructor;
909
+ result = Reflect.construct(Super, arguments, NewTarget);
910
+ } else {
911
+ result = Super.apply(this, arguments);
912
+ }
913
+ return _possible_constructor_return(this, result);
914
+ };
915
+ }
916
+ function _ts_generator$c(thisArg, body) {
917
+ var f, y, t, g, _ = {
918
+ label: 0,
919
+ sent: function() {
920
+ if (t[0] & 1) throw t[1];
921
+ return t[1];
922
+ },
923
+ trys: [],
924
+ ops: []
925
+ };
926
+ return g = {
927
+ next: verb(0),
928
+ "throw": verb(1),
929
+ "return": verb(2)
930
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
931
+ return this;
932
+ }), g;
933
+ function verb(n) {
934
+ return function(v) {
935
+ return step([
936
+ n,
937
+ v
938
+ ]);
939
+ };
940
+ }
941
+ function step(op) {
942
+ if (f) throw new TypeError("Generator is already executing.");
943
+ while(_)try {
944
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
945
+ if (y = 0, t) op = [
946
+ op[0] & 2,
947
+ t.value
948
+ ];
949
+ switch(op[0]){
950
+ case 0:
951
+ case 1:
952
+ t = op;
953
+ break;
954
+ case 4:
955
+ _.label++;
956
+ return {
957
+ value: op[1],
958
+ done: false
959
+ };
960
+ case 5:
961
+ _.label++;
962
+ y = op[1];
963
+ op = [
964
+ 0
965
+ ];
966
+ continue;
967
+ case 7:
968
+ op = _.ops.pop();
969
+ _.trys.pop();
970
+ continue;
971
+ default:
972
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
973
+ _ = 0;
974
+ continue;
975
+ }
976
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
977
+ _.label = op[1];
978
+ break;
979
+ }
980
+ if (op[0] === 6 && _.label < t[1]) {
981
+ _.label = t[1];
982
+ t = op;
983
+ break;
984
+ }
985
+ if (t && _.label < t[2]) {
986
+ _.label = t[2];
987
+ _.ops.push(op);
988
+ break;
989
+ }
990
+ if (t[2]) _.ops.pop();
991
+ _.trys.pop();
992
+ continue;
993
+ }
994
+ op = body.call(thisArg, _);
995
+ } catch (e) {
996
+ op = [
997
+ 6,
998
+ e
999
+ ];
1000
+ y = 0;
1001
+ } finally{
1002
+ f = t = 0;
1003
+ }
1004
+ if (op[0] & 5) throw op[1];
1005
+ return {
1006
+ value: op[0] ? op[1] : void 0,
1007
+ done: true
1008
+ };
1009
+ }
1010
+ }
1011
+ var _process_env;
1012
+ var PROTECTED_KEYS = {
1013
+ REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"),
1014
+ X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),
1015
+ TENANT_ID: Symbol.for("_AWS_LAMBDA_TENANT_ID")
1016
+ };
1017
+ var _process_env_AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA;
1018
+ var NO_GLOBAL_AWS_LAMBDA = [
1019
+ "true",
1020
+ "1"
1021
+ ].includes((_process_env_AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA = (_process_env = process.env) === null || _process_env === void 0 ? void 0 : _process_env.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA) !== null && _process_env_AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA !== void 0 ? _process_env_AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA : "");
1022
+ if (!NO_GLOBAL_AWS_LAMBDA) {
1023
+ globalThis.awslambda = globalThis.awslambda || {};
1024
+ }
1025
+ var InvokeStoreBase = /*#__PURE__*/ function() {
1026
+ function InvokeStoreBase() {
1027
+ _class_call_check$1(this, InvokeStoreBase);
1028
+ }
1029
+ _create_class$1(InvokeStoreBase, [
1030
+ {
1031
+ key: "isProtectedKey",
1032
+ value: function isProtectedKey(key) {
1033
+ return Object.values(PROTECTED_KEYS).includes(key);
1034
+ }
1035
+ },
1036
+ {
1037
+ key: "getRequestId",
1038
+ value: function getRequestId() {
1039
+ var _this_get;
1040
+ return (_this_get = this.get(PROTECTED_KEYS.REQUEST_ID)) !== null && _this_get !== void 0 ? _this_get : "-";
1041
+ }
1042
+ },
1043
+ {
1044
+ key: "getXRayTraceId",
1045
+ value: function getXRayTraceId() {
1046
+ return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID);
1047
+ }
1048
+ },
1049
+ {
1050
+ key: "getTenantId",
1051
+ value: function getTenantId() {
1052
+ return this.get(PROTECTED_KEYS.TENANT_ID);
1053
+ }
1054
+ }
1055
+ ]);
1056
+ return InvokeStoreBase;
1057
+ }();
1058
+ _define_property$6(InvokeStoreBase, "PROTECTED_KEYS", PROTECTED_KEYS);
1059
+ var InvokeStoreSingle = /*#__PURE__*/ function(InvokeStoreBase) {
1060
+ _inherits(InvokeStoreSingle, InvokeStoreBase);
1061
+ var _super = _create_super(InvokeStoreSingle);
1062
+ function InvokeStoreSingle() {
1063
+ _class_call_check$1(this, InvokeStoreSingle);
1064
+ var _this;
1065
+ _this = _super.apply(this, arguments);
1066
+ _define_property$6(_assert_this_initialized(_this), "currentContext", void 0);
1067
+ return _this;
1068
+ }
1069
+ _create_class$1(InvokeStoreSingle, [
1070
+ {
1071
+ key: "getContext",
1072
+ value: function getContext() {
1073
+ return this.currentContext;
1074
+ }
1075
+ },
1076
+ {
1077
+ key: "hasContext",
1078
+ value: function hasContext() {
1079
+ return this.currentContext !== undefined;
1080
+ }
1081
+ },
1082
+ {
1083
+ key: "get",
1084
+ value: function get(key) {
1085
+ var _this_currentContext;
1086
+ return (_this_currentContext = this.currentContext) === null || _this_currentContext === void 0 ? void 0 : _this_currentContext[key];
1087
+ }
1088
+ },
1089
+ {
1090
+ key: "set",
1091
+ value: function set(key, value) {
1092
+ if (this.isProtectedKey(key)) {
1093
+ throw new Error("Cannot modify protected Lambda context field: ".concat(String(key)));
1094
+ }
1095
+ this.currentContext = this.currentContext || {};
1096
+ this.currentContext[key] = value;
1097
+ }
1098
+ },
1099
+ {
1100
+ key: "run",
1101
+ value: function run(context, fn) {
1102
+ this.currentContext = context;
1103
+ return fn();
1104
+ }
1105
+ }
1106
+ ]);
1107
+ return InvokeStoreSingle;
1108
+ }(InvokeStoreBase);
1109
+ var InvokeStoreMulti = /*#__PURE__*/ function(InvokeStoreBase) {
1110
+ _inherits(InvokeStoreMulti, InvokeStoreBase);
1111
+ var _super = _create_super(InvokeStoreMulti);
1112
+ function InvokeStoreMulti() {
1113
+ _class_call_check$1(this, InvokeStoreMulti);
1114
+ var _this;
1115
+ _this = _super.apply(this, arguments);
1116
+ _define_property$6(_assert_this_initialized(_this), "als", void 0);
1117
+ return _this;
1118
+ }
1119
+ _create_class$1(InvokeStoreMulti, [
1120
+ {
1121
+ key: "getContext",
1122
+ value: function getContext() {
1123
+ return this.als.getStore();
1124
+ }
1125
+ },
1126
+ {
1127
+ key: "hasContext",
1128
+ value: function hasContext() {
1129
+ return this.als.getStore() !== undefined;
1130
+ }
1131
+ },
1132
+ {
1133
+ key: "get",
1134
+ value: function get(key) {
1135
+ var _this_als_getStore;
1136
+ return (_this_als_getStore = this.als.getStore()) === null || _this_als_getStore === void 0 ? void 0 : _this_als_getStore[key];
1137
+ }
1138
+ },
1139
+ {
1140
+ key: "set",
1141
+ value: function set(key, value) {
1142
+ if (this.isProtectedKey(key)) {
1143
+ throw new Error("Cannot modify protected Lambda context field: ".concat(String(key)));
1144
+ }
1145
+ var store = this.als.getStore();
1146
+ if (!store) {
1147
+ throw new Error("No context available");
1148
+ }
1149
+ store[key] = value;
1150
+ }
1151
+ },
1152
+ {
1153
+ key: "run",
1154
+ value: function run(context, fn) {
1155
+ return this.als.run(context, fn);
1156
+ }
1157
+ }
1158
+ ], [
1159
+ {
1160
+ key: "create",
1161
+ value: function create() {
1162
+ return _async_to_generator$c(function() {
1163
+ var instance, asyncHooks;
1164
+ return _ts_generator$c(this, function(_state) {
1165
+ switch(_state.label){
1166
+ case 0:
1167
+ instance = new InvokeStoreMulti();
1168
+ return [
1169
+ 4,
1170
+ import('node:async_hooks')
1171
+ ];
1172
+ case 1:
1173
+ asyncHooks = _state.sent();
1174
+ instance.als = new asyncHooks.AsyncLocalStorage();
1175
+ return [
1176
+ 2,
1177
+ instance
1178
+ ];
1179
+ }
1180
+ });
1181
+ })();
1182
+ }
1183
+ }
1184
+ ]);
1185
+ return InvokeStoreMulti;
1186
+ }(InvokeStoreBase);
1187
+ var InvokeStore;
1188
+ (function(InvokeStore) {
1189
+ var instance = null;
1190
+ function getInstanceAsync() {
1191
+ return _getInstanceAsync.apply(this, arguments);
1192
+ }
1193
+ function _getInstanceAsync() {
1194
+ _getInstanceAsync = _async_to_generator$c(function() {
1195
+ return _ts_generator$c(this, function(_state) {
1196
+ if (!instance) {
1197
+ instance = _async_to_generator$c(function() {
1198
+ var _globalThis_awslambda, isMulti, newInstance, _tmp;
1199
+ return _ts_generator$c(this, function(_state) {
1200
+ switch(_state.label){
1201
+ case 0:
1202
+ isMulti = "AWS_LAMBDA_MAX_CONCURRENCY" in process.env;
1203
+ if (!isMulti) return [
1204
+ 3,
1205
+ 2
1206
+ ];
1207
+ return [
1208
+ 4,
1209
+ InvokeStoreMulti.create()
1210
+ ];
1211
+ case 1:
1212
+ _tmp = _state.sent();
1213
+ return [
1214
+ 3,
1215
+ 3
1216
+ ];
1217
+ case 2:
1218
+ _tmp = new InvokeStoreSingle();
1219
+ _state.label = 3;
1220
+ case 3:
1221
+ newInstance = _tmp;
1222
+ if (!NO_GLOBAL_AWS_LAMBDA && ((_globalThis_awslambda = globalThis.awslambda) === null || _globalThis_awslambda === void 0 ? void 0 : _globalThis_awslambda.InvokeStore)) {
1223
+ return [
1224
+ 2,
1225
+ globalThis.awslambda.InvokeStore
1226
+ ];
1227
+ } else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) {
1228
+ globalThis.awslambda.InvokeStore = newInstance;
1229
+ return [
1230
+ 2,
1231
+ newInstance
1232
+ ];
1233
+ } else {
1234
+ return [
1235
+ 2,
1236
+ newInstance
1237
+ ];
1238
+ }
1239
+ }
1240
+ });
1241
+ })();
1242
+ }
1243
+ return [
1244
+ 2,
1245
+ instance
1246
+ ];
1247
+ });
1248
+ });
1249
+ return _getInstanceAsync.apply(this, arguments);
1250
+ }
1251
+ InvokeStore.getInstanceAsync = getInstanceAsync;
1252
+ InvokeStore._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? {
1253
+ reset: function() {
1254
+ var _globalThis_awslambda;
1255
+ instance = null;
1256
+ if ((_globalThis_awslambda = globalThis.awslambda) === null || _globalThis_awslambda === void 0 ? void 0 : _globalThis_awslambda.InvokeStore) {
1257
+ delete globalThis.awslambda.InvokeStore;
1258
+ }
1259
+ globalThis.awslambda = {
1260
+ InvokeStore: undefined
1261
+ };
1262
+ }
1263
+ } : undefined;
1264
+ })(InvokeStore || (InvokeStore = {}));
1265
+
1266
+ function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
1267
+ try {
1268
+ var info = gen[key](arg);
1269
+ var value = info.value;
1270
+ } catch (error) {
1271
+ reject(error);
1272
+ return;
1273
+ }
1274
+ if (info.done) {
1275
+ resolve(value);
1276
+ } else {
1277
+ Promise.resolve(value).then(_next, _throw);
1278
+ }
1279
+ }
1280
+ function _async_to_generator$b(fn) {
1281
+ return function() {
1282
+ var self = this, args = arguments;
1283
+ return new Promise(function(resolve, reject) {
1284
+ var gen = fn.apply(self, args);
1285
+ function _next(value) {
1286
+ asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "next", value);
1287
+ }
1288
+ function _throw(err) {
1289
+ asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "throw", err);
1290
+ }
1291
+ _next(undefined);
1292
+ });
1293
+ };
1294
+ }
1295
+ function _define_property$5(obj, key, value) {
1296
+ if (key in obj) {
1297
+ Object.defineProperty(obj, key, {
1298
+ value: value,
1299
+ enumerable: true,
1300
+ configurable: true,
1301
+ writable: true
1302
+ });
1303
+ } else {
1304
+ obj[key] = value;
1305
+ }
1306
+ return obj;
1307
+ }
1308
+ function _object_spread$4(target) {
1309
+ for(var i = 1; i < arguments.length; i++){
1310
+ var source = arguments[i] != null ? arguments[i] : {};
1311
+ var ownKeys = Object.keys(source);
1312
+ if (typeof Object.getOwnPropertySymbols === "function") {
1313
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1314
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1315
+ }));
1316
+ }
1317
+ ownKeys.forEach(function(key) {
1318
+ _define_property$5(target, key, source[key]);
1319
+ });
1320
+ }
1321
+ return target;
1322
+ }
1323
+ function ownKeys$2(object, enumerableOnly) {
1324
+ var keys = Object.keys(object);
1325
+ if (Object.getOwnPropertySymbols) {
1326
+ var symbols = Object.getOwnPropertySymbols(object);
1327
+ keys.push.apply(keys, symbols);
1328
+ }
1329
+ return keys;
1330
+ }
1331
+ function _object_spread_props$2(target, source) {
1332
+ source = source != null ? source : {};
1333
+ if (Object.getOwnPropertyDescriptors) {
1334
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1335
+ } else {
1336
+ ownKeys$2(Object(source)).forEach(function(key) {
1337
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1338
+ });
1339
+ }
1340
+ return target;
1341
+ }
1342
+ function _ts_generator$b(thisArg, body) {
1343
+ var f, y, t, g, _ = {
1344
+ label: 0,
1345
+ sent: function() {
1346
+ if (t[0] & 1) throw t[1];
1347
+ return t[1];
1348
+ },
1349
+ trys: [],
1350
+ ops: []
1351
+ };
1352
+ return g = {
1353
+ next: verb(0),
1354
+ "throw": verb(1),
1355
+ "return": verb(2)
1356
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
1357
+ return this;
1358
+ }), g;
1359
+ function verb(n) {
1360
+ return function(v) {
1361
+ return step([
1362
+ n,
1363
+ v
1364
+ ]);
1365
+ };
1366
+ }
1367
+ function step(op) {
1368
+ if (f) throw new TypeError("Generator is already executing.");
1369
+ while(_)try {
1370
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1371
+ if (y = 0, t) op = [
1372
+ op[0] & 2,
1373
+ t.value
1374
+ ];
1375
+ switch(op[0]){
1376
+ case 0:
1377
+ case 1:
1378
+ t = op;
1379
+ break;
1380
+ case 4:
1381
+ _.label++;
1382
+ return {
1383
+ value: op[1],
1384
+ done: false
1385
+ };
1386
+ case 5:
1387
+ _.label++;
1388
+ y = op[1];
1389
+ op = [
1390
+ 0
1391
+ ];
1392
+ continue;
1393
+ case 7:
1394
+ op = _.ops.pop();
1395
+ _.trys.pop();
1396
+ continue;
1397
+ default:
1398
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1399
+ _ = 0;
1400
+ continue;
1401
+ }
1402
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
1403
+ _.label = op[1];
1404
+ break;
1405
+ }
1406
+ if (op[0] === 6 && _.label < t[1]) {
1407
+ _.label = t[1];
1408
+ t = op;
1409
+ break;
1410
+ }
1411
+ if (t && _.label < t[2]) {
1412
+ _.label = t[2];
1413
+ _.ops.push(op);
1414
+ break;
1415
+ }
1416
+ if (t[2]) _.ops.pop();
1417
+ _.trys.pop();
1418
+ continue;
1419
+ }
1420
+ op = body.call(thisArg, _);
1421
+ } catch (e) {
1422
+ op = [
1423
+ 6,
1424
+ e
1425
+ ];
1426
+ y = 0;
1427
+ } finally{
1428
+ f = t = 0;
1429
+ }
1430
+ if (op[0] & 5) throw op[1];
1431
+ return {
1432
+ value: op[0] ? op[1] : void 0,
1433
+ done: true
1434
+ };
1435
+ }
1436
+ }
1437
+ var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
1438
+ var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
1439
+ var ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
1440
+ var recursionDetectionMiddleware = function() {
1441
+ return function(next) {
1442
+ return function() {
1443
+ var _ref = _async_to_generator$b(function(args) {
1444
+ var request, _request_headers, _Object_keys_find, traceIdHeader, functionName, traceIdFromEnv, invokeStore, traceIdFromInvokeStore, traceId, nonEmptyString;
1445
+ return _ts_generator$b(this, function(_state) {
1446
+ switch(_state.label){
1447
+ case 0:
1448
+ request = args.request;
1449
+ if (!HttpRequest.isInstance(request)) {
1450
+ return [
1451
+ 2,
1452
+ next(args)
1453
+ ];
1454
+ }
1455
+ traceIdHeader = (_Object_keys_find = Object.keys((_request_headers = request.headers) !== null && _request_headers !== void 0 ? _request_headers : {}).find(function(h) {
1456
+ return h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase();
1457
+ })) !== null && _Object_keys_find !== void 0 ? _Object_keys_find : TRACE_ID_HEADER_NAME;
1458
+ if (request.headers.hasOwnProperty(traceIdHeader)) {
1459
+ return [
1460
+ 2,
1461
+ next(args)
1462
+ ];
1463
+ }
1464
+ functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
1465
+ traceIdFromEnv = process.env[ENV_TRACE_ID];
1466
+ return [
1467
+ 4,
1468
+ InvokeStore.getInstanceAsync()
1469
+ ];
1470
+ case 1:
1471
+ invokeStore = _state.sent();
1472
+ traceIdFromInvokeStore = invokeStore === null || invokeStore === void 0 ? void 0 : invokeStore.getXRayTraceId();
1473
+ traceId = traceIdFromInvokeStore !== null && traceIdFromInvokeStore !== void 0 ? traceIdFromInvokeStore : traceIdFromEnv;
1474
+ nonEmptyString = function(str) {
1475
+ return typeof str === "string" && str.length > 0;
1476
+ };
1477
+ if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
1478
+ request.headers[TRACE_ID_HEADER_NAME] = traceId;
1479
+ }
1480
+ return [
1481
+ 2,
1482
+ next(_object_spread_props$2(_object_spread$4({}, args), {
1483
+ request: request
1484
+ }))
1485
+ ];
1486
+ }
1487
+ });
1488
+ });
1489
+ return function(args) {
1490
+ return _ref.apply(this, arguments);
1491
+ };
1492
+ }();
1493
+ };
1494
+ };
1495
+
1496
+ var getRecursionDetectionPlugin = function(options) {
1497
+ return {
1498
+ applyToStack: function(clientStack) {
1499
+ clientStack.add(recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions);
1500
+ }
1501
+ };
1502
+ };
1503
+
1504
+ function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
1505
+ try {
1506
+ var info = gen[key](arg);
1507
+ var value = info.value;
1508
+ } catch (error) {
1509
+ reject(error);
1510
+ return;
1511
+ }
1512
+ if (info.done) {
1513
+ resolve(value);
1514
+ } else {
1515
+ Promise.resolve(value).then(_next, _throw);
1516
+ }
1517
+ }
1518
+ function _async_to_generator$a(fn) {
1519
+ return function() {
1520
+ var self = this, args = arguments;
1521
+ return new Promise(function(resolve, reject) {
1522
+ var gen = fn.apply(self, args);
1523
+ function _next(value) {
1524
+ asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "next", value);
1525
+ }
1526
+ function _throw(err) {
1527
+ asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "throw", err);
1528
+ }
1529
+ _next(undefined);
1530
+ });
1531
+ };
1532
+ }
1533
+ function _ts_generator$a(thisArg, body) {
1534
+ var f, y, t, g, _ = {
1535
+ label: 0,
1536
+ sent: function() {
1537
+ if (t[0] & 1) throw t[1];
1538
+ return t[1];
1539
+ },
1540
+ trys: [],
1541
+ ops: []
1542
+ };
1543
+ return g = {
1544
+ next: verb(0),
1545
+ "throw": verb(1),
1546
+ "return": verb(2)
1547
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
1548
+ return this;
1549
+ }), g;
1550
+ function verb(n) {
1551
+ return function(v) {
1552
+ return step([
1553
+ n,
1554
+ v
1555
+ ]);
1556
+ };
1557
+ }
1558
+ function step(op) {
1559
+ if (f) throw new TypeError("Generator is already executing.");
1560
+ while(_)try {
1561
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1562
+ if (y = 0, t) op = [
1563
+ op[0] & 2,
1564
+ t.value
1565
+ ];
1566
+ switch(op[0]){
1567
+ case 0:
1568
+ case 1:
1569
+ t = op;
1570
+ break;
1571
+ case 4:
1572
+ _.label++;
1573
+ return {
1574
+ value: op[1],
1575
+ done: false
1576
+ };
1577
+ case 5:
1578
+ _.label++;
1579
+ y = op[1];
1580
+ op = [
1581
+ 0
1582
+ ];
1583
+ continue;
1584
+ case 7:
1585
+ op = _.ops.pop();
1586
+ _.trys.pop();
1587
+ continue;
1588
+ default:
1589
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1590
+ _ = 0;
1591
+ continue;
1592
+ }
1593
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
1594
+ _.label = op[1];
1595
+ break;
1596
+ }
1597
+ if (op[0] === 6 && _.label < t[1]) {
1598
+ _.label = t[1];
1599
+ t = op;
1600
+ break;
1601
+ }
1602
+ if (t && _.label < t[2]) {
1603
+ _.label = t[2];
1604
+ _.ops.push(op);
1605
+ break;
1606
+ }
1607
+ if (t[2]) _.ops.pop();
1608
+ _.trys.pop();
1609
+ continue;
1610
+ }
1611
+ op = body.call(thisArg, _);
1612
+ } catch (e) {
1613
+ op = [
1614
+ 6,
1615
+ e
1616
+ ];
1617
+ y = 0;
1618
+ } finally{
1619
+ f = t = 0;
1620
+ }
1621
+ if (op[0] & 5) throw op[1];
1622
+ return {
1623
+ value: op[0] ? op[1] : void 0,
1624
+ done: true
1625
+ };
1626
+ }
1627
+ }
1628
+ var DEFAULT_UA_APP_ID = undefined;
1629
+ function isValidUserAgentAppId(appId) {
1630
+ if (appId === undefined) {
1631
+ return true;
1632
+ }
1633
+ return typeof appId === "string" && appId.length <= 50;
1634
+ }
1635
+ function resolveUserAgentConfig(input) {
1636
+ var _input_userAgentAppId;
1637
+ var normalizedAppIdProvider = normalizeProvider((_input_userAgentAppId = input.userAgentAppId) !== null && _input_userAgentAppId !== void 0 ? _input_userAgentAppId : DEFAULT_UA_APP_ID);
1638
+ var customUserAgent = input.customUserAgent;
1639
+ return Object.assign(input, {
1640
+ customUserAgent: typeof customUserAgent === "string" ? [
1641
+ [
1642
+ customUserAgent
1643
+ ]
1644
+ ] : customUserAgent,
1645
+ userAgentAppId: /*#__PURE__*/ _async_to_generator$a(function() {
1646
+ var appId, _input_logger_constructor, _input_logger, logger;
1647
+ return _ts_generator$a(this, function(_state) {
1648
+ switch(_state.label){
1649
+ case 0:
1650
+ return [
1651
+ 4,
1652
+ normalizedAppIdProvider()
1653
+ ];
1654
+ case 1:
1655
+ appId = _state.sent();
1656
+ if (!isValidUserAgentAppId(appId)) {
1657
+ logger = ((_input_logger = input.logger) === null || _input_logger === void 0 ? void 0 : (_input_logger_constructor = _input_logger.constructor) === null || _input_logger_constructor === void 0 ? void 0 : _input_logger_constructor.name) === "NoOpLogger" || !input.logger ? console : input.logger;
1658
+ if (typeof appId !== "string") {
1659
+ logger === null || logger === void 0 ? void 0 : logger.warn("userAgentAppId must be a string or undefined.");
1660
+ } else if (appId.length > 50) {
1661
+ logger === null || logger === void 0 ? void 0 : logger.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
1662
+ }
1663
+ }
1664
+ return [
1665
+ 2,
1666
+ appId
1667
+ ];
1668
+ }
1669
+ });
1670
+ })
1671
+ });
1672
+ }
1673
+
1674
+ var isVirtualHostableS3Bucket = function(value) {
1675
+ var allowSubDomains = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
1676
+ if (allowSubDomains) {
1677
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1678
+ try {
1679
+ for(var _iterator = value.split(".")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1680
+ var label = _step.value;
1681
+ if (!isVirtualHostableS3Bucket(label)) {
1682
+ return false;
1683
+ }
1684
+ }
1685
+ } catch (err) {
1686
+ _didIteratorError = true;
1687
+ _iteratorError = err;
1688
+ } finally{
1689
+ try {
1690
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1691
+ _iterator.return();
1692
+ }
1693
+ } finally{
1694
+ if (_didIteratorError) {
1695
+ throw _iteratorError;
1696
+ }
1697
+ }
1698
+ }
1699
+ return true;
1700
+ }
1701
+ if (!isValidHostLabel(value)) {
1702
+ return false;
1703
+ }
1704
+ if (value.length < 3 || value.length > 63) {
1705
+ return false;
1706
+ }
1707
+ if (value !== value.toLowerCase()) {
1708
+ return false;
1709
+ }
1710
+ if (isIpAddress(value)) {
1711
+ return false;
1712
+ }
1713
+ return true;
1714
+ };
1715
+
1716
+ function _array_like_to_array$7(arr, len) {
1717
+ if (len == null || len > arr.length) len = arr.length;
1718
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1719
+ return arr2;
1720
+ }
1721
+ function _array_with_holes$4(arr) {
1722
+ if (Array.isArray(arr)) return arr;
1723
+ }
1724
+ function _iterable_to_array$3(iter) {
1725
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1726
+ }
1727
+ function _non_iterable_rest$4() {
1728
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1729
+ }
1730
+ function _to_array(arr) {
1731
+ return _array_with_holes$4(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_rest$4();
1732
+ }
1733
+ function _unsupported_iterable_to_array$7(o, minLen) {
1734
+ if (!o) return;
1735
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
1736
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1737
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1738
+ if (n === "Map" || n === "Set") return Array.from(n);
1739
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
1740
+ }
1741
+ var ARN_DELIMITER = ":";
1742
+ var RESOURCE_DELIMITER = "/";
1743
+ var parseArn = function(value) {
1744
+ var segments = value.split(ARN_DELIMITER);
1745
+ if (segments.length < 6) return null;
1746
+ var _segments = _to_array(segments), arn = _segments[0], partition = _segments[1], service = _segments[2], region = _segments[3], accountId = _segments[4], resourcePath = _segments.slice(5);
1747
+ if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") return null;
1748
+ var resourceId = resourcePath.map(function(resource) {
1749
+ return resource.split(RESOURCE_DELIMITER);
1750
+ }).flat();
1751
+ return {
1752
+ partition: partition,
1753
+ service: service,
1754
+ region: region,
1755
+ accountId: accountId,
1756
+ resourceId: resourceId
1757
+ };
1758
+ };
1759
+
1760
+ var partitions = [
1761
+ {
1762
+ id: "aws",
1763
+ outputs: {
1764
+ dnsSuffix: "amazonaws.com",
1765
+ dualStackDnsSuffix: "api.aws",
1766
+ implicitGlobalRegion: "us-east-1",
1767
+ name: "aws",
1768
+ supportsDualStack: true,
1769
+ supportsFIPS: true
1770
+ },
1771
+ regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
1772
+ regions: {
1773
+ "af-south-1": {
1774
+ description: "Africa (Cape Town)"
1775
+ },
1776
+ "ap-east-1": {
1777
+ description: "Asia Pacific (Hong Kong)"
1778
+ },
1779
+ "ap-east-2": {
1780
+ description: "Asia Pacific (Taipei)"
1781
+ },
1782
+ "ap-northeast-1": {
1783
+ description: "Asia Pacific (Tokyo)"
1784
+ },
1785
+ "ap-northeast-2": {
1786
+ description: "Asia Pacific (Seoul)"
1787
+ },
1788
+ "ap-northeast-3": {
1789
+ description: "Asia Pacific (Osaka)"
1790
+ },
1791
+ "ap-south-1": {
1792
+ description: "Asia Pacific (Mumbai)"
1793
+ },
1794
+ "ap-south-2": {
1795
+ description: "Asia Pacific (Hyderabad)"
1796
+ },
1797
+ "ap-southeast-1": {
1798
+ description: "Asia Pacific (Singapore)"
1799
+ },
1800
+ "ap-southeast-2": {
1801
+ description: "Asia Pacific (Sydney)"
1802
+ },
1803
+ "ap-southeast-3": {
1804
+ description: "Asia Pacific (Jakarta)"
1805
+ },
1806
+ "ap-southeast-4": {
1807
+ description: "Asia Pacific (Melbourne)"
1808
+ },
1809
+ "ap-southeast-5": {
1810
+ description: "Asia Pacific (Malaysia)"
1811
+ },
1812
+ "ap-southeast-6": {
1813
+ description: "Asia Pacific (New Zealand)"
1814
+ },
1815
+ "ap-southeast-7": {
1816
+ description: "Asia Pacific (Thailand)"
1817
+ },
1818
+ "aws-global": {
1819
+ description: "aws global region"
1820
+ },
1821
+ "ca-central-1": {
1822
+ description: "Canada (Central)"
1823
+ },
1824
+ "ca-west-1": {
1825
+ description: "Canada West (Calgary)"
1826
+ },
1827
+ "eu-central-1": {
1828
+ description: "Europe (Frankfurt)"
1829
+ },
1830
+ "eu-central-2": {
1831
+ description: "Europe (Zurich)"
1832
+ },
1833
+ "eu-north-1": {
1834
+ description: "Europe (Stockholm)"
1835
+ },
1836
+ "eu-south-1": {
1837
+ description: "Europe (Milan)"
1838
+ },
1839
+ "eu-south-2": {
1840
+ description: "Europe (Spain)"
1841
+ },
1842
+ "eu-west-1": {
1843
+ description: "Europe (Ireland)"
1844
+ },
1845
+ "eu-west-2": {
1846
+ description: "Europe (London)"
1847
+ },
1848
+ "eu-west-3": {
1849
+ description: "Europe (Paris)"
1850
+ },
1851
+ "il-central-1": {
1852
+ description: "Israel (Tel Aviv)"
1853
+ },
1854
+ "me-central-1": {
1855
+ description: "Middle East (UAE)"
1856
+ },
1857
+ "me-south-1": {
1858
+ description: "Middle East (Bahrain)"
1859
+ },
1860
+ "mx-central-1": {
1861
+ description: "Mexico (Central)"
1862
+ },
1863
+ "sa-east-1": {
1864
+ description: "South America (Sao Paulo)"
1865
+ },
1866
+ "us-east-1": {
1867
+ description: "US East (N. Virginia)"
1868
+ },
1869
+ "us-east-2": {
1870
+ description: "US East (Ohio)"
1871
+ },
1872
+ "us-west-1": {
1873
+ description: "US West (N. California)"
1874
+ },
1875
+ "us-west-2": {
1876
+ description: "US West (Oregon)"
1877
+ }
1878
+ }
1879
+ },
1880
+ {
1881
+ id: "aws-cn",
1882
+ outputs: {
1883
+ dnsSuffix: "amazonaws.com.cn",
1884
+ dualStackDnsSuffix: "api.amazonwebservices.com.cn",
1885
+ implicitGlobalRegion: "cn-northwest-1",
1886
+ name: "aws-cn",
1887
+ supportsDualStack: true,
1888
+ supportsFIPS: true
1889
+ },
1890
+ regionRegex: "^cn\\-\\w+\\-\\d+$",
1891
+ regions: {
1892
+ "aws-cn-global": {
1893
+ description: "aws-cn global region"
1894
+ },
1895
+ "cn-north-1": {
1896
+ description: "China (Beijing)"
1897
+ },
1898
+ "cn-northwest-1": {
1899
+ description: "China (Ningxia)"
1900
+ }
1901
+ }
1902
+ },
1903
+ {
1904
+ id: "aws-eusc",
1905
+ outputs: {
1906
+ dnsSuffix: "amazonaws.eu",
1907
+ dualStackDnsSuffix: "api.amazonwebservices.eu",
1908
+ implicitGlobalRegion: "eusc-de-east-1",
1909
+ name: "aws-eusc",
1910
+ supportsDualStack: true,
1911
+ supportsFIPS: true
1912
+ },
1913
+ regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$",
1914
+ regions: {
1915
+ "eusc-de-east-1": {
1916
+ description: "AWS European Sovereign Cloud (Germany)"
1917
+ }
1918
+ }
1919
+ },
1920
+ {
1921
+ id: "aws-iso",
1922
+ outputs: {
1923
+ dnsSuffix: "c2s.ic.gov",
1924
+ dualStackDnsSuffix: "api.aws.ic.gov",
1925
+ implicitGlobalRegion: "us-iso-east-1",
1926
+ name: "aws-iso",
1927
+ supportsDualStack: true,
1928
+ supportsFIPS: true
1929
+ },
1930
+ regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
1931
+ regions: {
1932
+ "aws-iso-global": {
1933
+ description: "aws-iso global region"
1934
+ },
1935
+ "us-iso-east-1": {
1936
+ description: "US ISO East"
1937
+ },
1938
+ "us-iso-west-1": {
1939
+ description: "US ISO WEST"
1940
+ }
1941
+ }
1942
+ },
1943
+ {
1944
+ id: "aws-iso-b",
1945
+ outputs: {
1946
+ dnsSuffix: "sc2s.sgov.gov",
1947
+ dualStackDnsSuffix: "api.aws.scloud",
1948
+ implicitGlobalRegion: "us-isob-east-1",
1949
+ name: "aws-iso-b",
1950
+ supportsDualStack: true,
1951
+ supportsFIPS: true
1952
+ },
1953
+ regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
1954
+ regions: {
1955
+ "aws-iso-b-global": {
1956
+ description: "aws-iso-b global region"
1957
+ },
1958
+ "us-isob-east-1": {
1959
+ description: "US ISOB East (Ohio)"
1960
+ },
1961
+ "us-isob-west-1": {
1962
+ description: "US ISOB West"
1963
+ }
1964
+ }
1965
+ },
1966
+ {
1967
+ id: "aws-iso-e",
1968
+ outputs: {
1969
+ dnsSuffix: "cloud.adc-e.uk",
1970
+ dualStackDnsSuffix: "api.cloud-aws.adc-e.uk",
1971
+ implicitGlobalRegion: "eu-isoe-west-1",
1972
+ name: "aws-iso-e",
1973
+ supportsDualStack: true,
1974
+ supportsFIPS: true
1975
+ },
1976
+ regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
1977
+ regions: {
1978
+ "aws-iso-e-global": {
1979
+ description: "aws-iso-e global region"
1980
+ },
1981
+ "eu-isoe-west-1": {
1982
+ description: "EU ISOE West"
1983
+ }
1984
+ }
1985
+ },
1986
+ {
1987
+ id: "aws-iso-f",
1988
+ outputs: {
1989
+ dnsSuffix: "csp.hci.ic.gov",
1990
+ dualStackDnsSuffix: "api.aws.hci.ic.gov",
1991
+ implicitGlobalRegion: "us-isof-south-1",
1992
+ name: "aws-iso-f",
1993
+ supportsDualStack: true,
1994
+ supportsFIPS: true
1995
+ },
1996
+ regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
1997
+ regions: {
1998
+ "aws-iso-f-global": {
1999
+ description: "aws-iso-f global region"
2000
+ },
2001
+ "us-isof-east-1": {
2002
+ description: "US ISOF EAST"
2003
+ },
2004
+ "us-isof-south-1": {
2005
+ description: "US ISOF SOUTH"
2006
+ }
2007
+ }
2008
+ },
2009
+ {
2010
+ id: "aws-us-gov",
2011
+ outputs: {
2012
+ dnsSuffix: "amazonaws.com",
2013
+ dualStackDnsSuffix: "api.aws",
2014
+ implicitGlobalRegion: "us-gov-west-1",
2015
+ name: "aws-us-gov",
2016
+ supportsDualStack: true,
2017
+ supportsFIPS: true
2018
+ },
2019
+ regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
2020
+ regions: {
2021
+ "aws-us-gov-global": {
2022
+ description: "aws-us-gov global region"
2023
+ },
2024
+ "us-gov-east-1": {
2025
+ description: "AWS GovCloud (US-East)"
2026
+ },
2027
+ "us-gov-west-1": {
2028
+ description: "AWS GovCloud (US-West)"
2029
+ }
2030
+ }
2031
+ }
2032
+ ];
2033
+ var partitionsInfo = {
2034
+ partitions: partitions};
2035
+
2036
+ function _array_like_to_array$6(arr, len) {
2037
+ if (len == null || len > arr.length) len = arr.length;
2038
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2039
+ return arr2;
2040
+ }
2041
+ function _array_with_holes$3(arr) {
2042
+ if (Array.isArray(arr)) return arr;
2043
+ }
2044
+ function _define_property$4(obj, key, value) {
2045
+ if (key in obj) {
2046
+ Object.defineProperty(obj, key, {
2047
+ value: value,
2048
+ enumerable: true,
2049
+ configurable: true,
2050
+ writable: true
2051
+ });
2052
+ } else {
2053
+ obj[key] = value;
2054
+ }
2055
+ return obj;
2056
+ }
2057
+ function _iterable_to_array_limit$3(arr, i) {
2058
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2059
+ if (_i == null) return;
2060
+ var _arr = [];
2061
+ var _n = true;
2062
+ var _d = false;
2063
+ var _s, _e;
2064
+ try {
2065
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
2066
+ _arr.push(_s.value);
2067
+ if (i && _arr.length === i) break;
2068
+ }
2069
+ } catch (err) {
2070
+ _d = true;
2071
+ _e = err;
2072
+ } finally{
2073
+ try {
2074
+ if (!_n && _i["return"] != null) _i["return"]();
2075
+ } finally{
2076
+ if (_d) throw _e;
2077
+ }
2078
+ }
2079
+ return _arr;
2080
+ }
2081
+ function _non_iterable_rest$3() {
2082
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2083
+ }
2084
+ function _object_spread$3(target) {
2085
+ for(var i = 1; i < arguments.length; i++){
2086
+ var source = arguments[i] != null ? arguments[i] : {};
2087
+ var ownKeys = Object.keys(source);
2088
+ if (typeof Object.getOwnPropertySymbols === "function") {
2089
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
2090
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
2091
+ }));
2092
+ }
2093
+ ownKeys.forEach(function(key) {
2094
+ _define_property$4(target, key, source[key]);
2095
+ });
2096
+ }
2097
+ return target;
2098
+ }
2099
+ function _sliced_to_array$3(arr, i) {
2100
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$3();
2101
+ }
2102
+ function _unsupported_iterable_to_array$6(o, minLen) {
2103
+ if (!o) return;
2104
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
2105
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2106
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2107
+ if (n === "Map" || n === "Set") return Array.from(n);
2108
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
2109
+ }
2110
+ var selectedPartitionsInfo = partitionsInfo;
2111
+ var selectedUserAgentPrefix = "";
2112
+ var partition = function(value) {
2113
+ var partitions = selectedPartitionsInfo.partitions;
2114
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2115
+ try {
2116
+ for(var _iterator = partitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2117
+ var partition = _step.value;
2118
+ var regions = partition.regions, outputs = partition.outputs;
2119
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
2120
+ try {
2121
+ for(var _iterator1 = Object.entries(regions)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
2122
+ var _step_value = _sliced_to_array$3(_step1.value, 2), region = _step_value[0], regionData = _step_value[1];
2123
+ if (region === value) {
2124
+ return _object_spread$3({}, outputs, regionData);
2125
+ }
2126
+ }
2127
+ } catch (err) {
2128
+ _didIteratorError1 = true;
2129
+ _iteratorError1 = err;
2130
+ } finally{
2131
+ try {
2132
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
2133
+ _iterator1.return();
2134
+ }
2135
+ } finally{
2136
+ if (_didIteratorError1) {
2137
+ throw _iteratorError1;
2138
+ }
2139
+ }
2140
+ }
2141
+ }
2142
+ } catch (err) {
2143
+ _didIteratorError = true;
2144
+ _iteratorError = err;
2145
+ } finally{
2146
+ try {
2147
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2148
+ _iterator.return();
2149
+ }
2150
+ } finally{
2151
+ if (_didIteratorError) {
2152
+ throw _iteratorError;
2153
+ }
2154
+ }
2155
+ }
2156
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
2157
+ try {
2158
+ for(var _iterator2 = partitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
2159
+ var partition1 = _step2.value;
2160
+ var regionRegex = partition1.regionRegex, outputs1 = partition1.outputs;
2161
+ if (new RegExp(regionRegex).test(value)) {
2162
+ return _object_spread$3({}, outputs1);
2163
+ }
2164
+ }
2165
+ } catch (err) {
2166
+ _didIteratorError2 = true;
2167
+ _iteratorError2 = err;
2168
+ } finally{
2169
+ try {
2170
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
2171
+ _iterator2.return();
2172
+ }
2173
+ } finally{
2174
+ if (_didIteratorError2) {
2175
+ throw _iteratorError2;
2176
+ }
2177
+ }
2178
+ }
2179
+ var DEFAULT_PARTITION = partitions.find(function(partition) {
2180
+ return partition.id === "aws";
2181
+ });
2182
+ if (!DEFAULT_PARTITION) {
2183
+ throw new Error("Provided region was not found in the partition array or regex," + " and default partition with id 'aws' doesn't exist.");
2184
+ }
2185
+ return _object_spread$3({}, DEFAULT_PARTITION.outputs);
2186
+ };
2187
+ var getUserAgentPrefix = function() {
2188
+ return selectedUserAgentPrefix;
2189
+ };
2190
+
2191
+ var awsEndpointFunctions = {
2192
+ isVirtualHostableS3Bucket: isVirtualHostableS3Bucket,
2193
+ parseArn: parseArn,
2194
+ partition: partition
2195
+ };
2196
+ customEndpointFunctions.aws = awsEndpointFunctions;
2197
+
2198
+ function _array_like_to_array$5(arr, len) {
2199
+ if (len == null || len > arr.length) len = arr.length;
2200
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2201
+ return arr2;
2202
+ }
2203
+ function _array_with_holes$2(arr) {
2204
+ if (Array.isArray(arr)) return arr;
2205
+ }
2206
+ function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
2207
+ try {
2208
+ var info = gen[key](arg);
2209
+ var value = info.value;
2210
+ } catch (error) {
2211
+ reject(error);
2212
+ return;
2213
+ }
2214
+ if (info.done) {
2215
+ resolve(value);
2216
+ } else {
2217
+ Promise.resolve(value).then(_next, _throw);
2218
+ }
2219
+ }
2220
+ function _async_to_generator$9(fn) {
2221
+ return function() {
2222
+ var self = this, args = arguments;
2223
+ return new Promise(function(resolve, reject) {
2224
+ var gen = fn.apply(self, args);
2225
+ function _next(value) {
2226
+ asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "next", value);
2227
+ }
2228
+ function _throw(err) {
2229
+ asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "throw", err);
2230
+ }
2231
+ _next(undefined);
2232
+ });
2233
+ };
2234
+ }
2235
+ function _iterable_to_array_limit$2(arr, i) {
2236
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2237
+ if (_i == null) return;
2238
+ var _arr = [];
2239
+ var _n = true;
2240
+ var _d = false;
2241
+ var _s, _e;
2242
+ try {
2243
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
2244
+ _arr.push(_s.value);
2245
+ if (i && _arr.length === i) break;
2246
+ }
2247
+ } catch (err) {
2248
+ _d = true;
2249
+ _e = err;
2250
+ } finally{
2251
+ try {
2252
+ if (!_n && _i["return"] != null) _i["return"]();
2253
+ } finally{
2254
+ if (_d) throw _e;
2255
+ }
2256
+ }
2257
+ return _arr;
2258
+ }
2259
+ function _non_iterable_rest$2() {
2260
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2261
+ }
2262
+ function _sliced_to_array$2(arr, i) {
2263
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$2();
2264
+ }
2265
+ function _unsupported_iterable_to_array$5(o, minLen) {
2266
+ if (!o) return;
2267
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
2268
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2269
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2270
+ if (n === "Map" || n === "Set") return Array.from(n);
2271
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
2272
+ }
2273
+ function _ts_generator$9(thisArg, body) {
2274
+ var f, y, t, g, _ = {
2275
+ label: 0,
2276
+ sent: function() {
2277
+ if (t[0] & 1) throw t[1];
2278
+ return t[1];
2279
+ },
2280
+ trys: [],
2281
+ ops: []
2282
+ };
2283
+ return g = {
2284
+ next: verb(0),
2285
+ "throw": verb(1),
2286
+ "return": verb(2)
2287
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
2288
+ return this;
2289
+ }), g;
2290
+ function verb(n) {
2291
+ return function(v) {
2292
+ return step([
2293
+ n,
2294
+ v
2295
+ ]);
2296
+ };
2297
+ }
2298
+ function step(op) {
2299
+ if (f) throw new TypeError("Generator is already executing.");
2300
+ while(_)try {
2301
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
2302
+ if (y = 0, t) op = [
2303
+ op[0] & 2,
2304
+ t.value
2305
+ ];
2306
+ switch(op[0]){
2307
+ case 0:
2308
+ case 1:
2309
+ t = op;
2310
+ break;
2311
+ case 4:
2312
+ _.label++;
2313
+ return {
2314
+ value: op[1],
2315
+ done: false
2316
+ };
2317
+ case 5:
2318
+ _.label++;
2319
+ y = op[1];
2320
+ op = [
2321
+ 0
2322
+ ];
2323
+ continue;
2324
+ case 7:
2325
+ op = _.ops.pop();
2326
+ _.trys.pop();
2327
+ continue;
2328
+ default:
2329
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
2330
+ _ = 0;
2331
+ continue;
2332
+ }
2333
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
2334
+ _.label = op[1];
2335
+ break;
2336
+ }
2337
+ if (op[0] === 6 && _.label < t[1]) {
2338
+ _.label = t[1];
2339
+ t = op;
2340
+ break;
2341
+ }
2342
+ if (t && _.label < t[2]) {
2343
+ _.label = t[2];
2344
+ _.ops.push(op);
2345
+ break;
2346
+ }
2347
+ if (t[2]) _.ops.pop();
2348
+ _.trys.pop();
2349
+ continue;
2350
+ }
2351
+ op = body.call(thisArg, _);
2352
+ } catch (e) {
2353
+ op = [
2354
+ 6,
2355
+ e
2356
+ ];
2357
+ y = 0;
2358
+ } finally{
2359
+ f = t = 0;
2360
+ }
2361
+ if (op[0] & 5) throw op[1];
2362
+ return {
2363
+ value: op[0] ? op[1] : void 0,
2364
+ done: true
2365
+ };
2366
+ }
2367
+ }
2368
+ var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
2369
+ function checkFeatures(context, config, args) {
2370
+ return _checkFeatures.apply(this, arguments);
2371
+ }
2372
+ function _checkFeatures() {
2373
+ _checkFeatures = _async_to_generator$9(function(context, config, args) {
2374
+ var _request_headers, _context___smithy_context_selectedHttpAuthScheme, _context___smithy_context, request, retryStrategy, _retryStrategy_constructor_name, _retryStrategy_constructor, _endpointV2_url, _config_accountIdEndpointMode, endpointV2, identity, credentials, _credentials_$source, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, key, value;
2375
+ return _ts_generator$9(this, function(_state) {
2376
+ switch(_state.label){
2377
+ case 0:
2378
+ request = args.request;
2379
+ if ((request === null || request === void 0 ? void 0 : (_request_headers = request.headers) === null || _request_headers === void 0 ? void 0 : _request_headers["smithy-protocol"]) === "rpc-v2-cbor") {
2380
+ setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
2381
+ }
2382
+ if (!(typeof config.retryStrategy === "function")) return [
2383
+ 3,
2384
+ 2
2385
+ ];
2386
+ return [
2387
+ 4,
2388
+ config.retryStrategy()
2389
+ ];
2390
+ case 1:
2391
+ retryStrategy = _state.sent();
2392
+ if (typeof retryStrategy.acquireInitialRetryToken === "function") {
2393
+ if ((_retryStrategy_constructor = retryStrategy.constructor) === null || _retryStrategy_constructor === void 0 ? void 0 : (_retryStrategy_constructor_name = _retryStrategy_constructor.name) === null || _retryStrategy_constructor_name === void 0 ? void 0 : _retryStrategy_constructor_name.includes("Adaptive")) {
2394
+ setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
2395
+ } else {
2396
+ setFeature(context, "RETRY_MODE_STANDARD", "E");
2397
+ }
2398
+ } else {
2399
+ setFeature(context, "RETRY_MODE_LEGACY", "D");
2400
+ }
2401
+ _state.label = 2;
2402
+ case 2:
2403
+ if (!(typeof config.accountIdEndpointMode === "function")) return [
2404
+ 3,
2405
+ 4
2406
+ ];
2407
+ endpointV2 = context.endpointV2;
2408
+ if (String(endpointV2 === null || endpointV2 === void 0 ? void 0 : (_endpointV2_url = endpointV2.url) === null || _endpointV2_url === void 0 ? void 0 : _endpointV2_url.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
2409
+ setFeature(context, "ACCOUNT_ID_ENDPOINT", "O");
2410
+ }
2411
+ return [
2412
+ 4,
2413
+ (_config_accountIdEndpointMode = config.accountIdEndpointMode) === null || _config_accountIdEndpointMode === void 0 ? void 0 : _config_accountIdEndpointMode.call(config)
2414
+ ];
2415
+ case 3:
2416
+ switch(_state.sent()){
2417
+ case "disabled":
2418
+ setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
2419
+ break;
2420
+ case "preferred":
2421
+ setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
2422
+ break;
2423
+ case "required":
2424
+ setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
2425
+ break;
2426
+ }
2427
+ _state.label = 4;
2428
+ case 4:
2429
+ identity = (_context___smithy_context = context.__smithy_context) === null || _context___smithy_context === void 0 ? void 0 : (_context___smithy_context_selectedHttpAuthScheme = _context___smithy_context.selectedHttpAuthScheme) === null || _context___smithy_context_selectedHttpAuthScheme === void 0 ? void 0 : _context___smithy_context_selectedHttpAuthScheme.identity;
2430
+ if (identity === null || identity === void 0 ? void 0 : identity.$source) {
2431
+ credentials = identity;
2432
+ if (credentials.accountId) {
2433
+ setFeature(context, "RESOLVED_ACCOUNT_ID", "T");
2434
+ }
2435
+ _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2436
+ try {
2437
+ for(_iterator = Object.entries((_credentials_$source = credentials.$source) !== null && _credentials_$source !== void 0 ? _credentials_$source : {})[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2438
+ _step_value = _sliced_to_array$2(_step.value, 2), key = _step_value[0], value = _step_value[1];
2439
+ setFeature(context, key, value);
2440
+ }
2441
+ } catch (err) {
2442
+ _didIteratorError = true;
2443
+ _iteratorError = err;
2444
+ } finally{
2445
+ try {
2446
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2447
+ _iterator.return();
2448
+ }
2449
+ } finally{
2450
+ if (_didIteratorError) {
2451
+ throw _iteratorError;
2452
+ }
2453
+ }
2454
+ }
2455
+ }
2456
+ return [
2457
+ 2
2458
+ ];
2459
+ }
2460
+ });
2461
+ });
2462
+ return _checkFeatures.apply(this, arguments);
2463
+ }
2464
+
2465
+ var USER_AGENT = "user-agent";
2466
+ var X_AMZ_USER_AGENT = "x-amz-user-agent";
2467
+ var SPACE = " ";
2468
+ var UA_NAME_SEPARATOR = "/";
2469
+ var UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g;
2470
+ var UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g;
2471
+ var UA_ESCAPE_CHAR = "-";
2472
+
2473
+ var BYTE_LIMIT = 1024;
2474
+ function encodeFeatures(features) {
2475
+ var buffer = "";
2476
+ for(var key in features){
2477
+ var val = features[key];
2478
+ if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
2479
+ if (buffer.length) {
2480
+ buffer += "," + val;
2481
+ } else {
2482
+ buffer += val;
2483
+ }
2484
+ continue;
2485
+ }
2486
+ break;
2487
+ }
2488
+ return buffer;
2489
+ }
2490
+
2491
+ function _array_like_to_array$4(arr, len) {
2492
+ if (len == null || len > arr.length) len = arr.length;
2493
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2494
+ return arr2;
2495
+ }
2496
+ function _array_without_holes$2(arr) {
2497
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
2498
+ }
2499
+ function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
2500
+ try {
2501
+ var info = gen[key](arg);
2502
+ var value = info.value;
2503
+ } catch (error) {
2504
+ reject(error);
2505
+ return;
2506
+ }
2507
+ if (info.done) {
2508
+ resolve(value);
2509
+ } else {
2510
+ Promise.resolve(value).then(_next, _throw);
2511
+ }
2512
+ }
2513
+ function _async_to_generator$8(fn) {
2514
+ return function() {
2515
+ var self = this, args = arguments;
2516
+ return new Promise(function(resolve, reject) {
2517
+ var gen = fn.apply(self, args);
2518
+ function _next(value) {
2519
+ asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "next", value);
2520
+ }
2521
+ function _throw(err) {
2522
+ asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "throw", err);
2523
+ }
2524
+ _next(undefined);
2525
+ });
2526
+ };
2527
+ }
2528
+ function _define_property$3(obj, key, value) {
2529
+ if (key in obj) {
2530
+ Object.defineProperty(obj, key, {
2531
+ value: value,
2532
+ enumerable: true,
2533
+ configurable: true,
2534
+ writable: true
2535
+ });
2536
+ } else {
2537
+ obj[key] = value;
2538
+ }
2539
+ return obj;
2540
+ }
2541
+ function _iterable_to_array$2(iter) {
2542
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2543
+ }
2544
+ function _non_iterable_spread$2() {
2545
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2546
+ }
2547
+ function _object_spread$2(target) {
2548
+ for(var i = 1; i < arguments.length; i++){
2549
+ var source = arguments[i] != null ? arguments[i] : {};
2550
+ var ownKeys = Object.keys(source);
2551
+ if (typeof Object.getOwnPropertySymbols === "function") {
2552
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
2553
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
2554
+ }));
2555
+ }
2556
+ ownKeys.forEach(function(key) {
2557
+ _define_property$3(target, key, source[key]);
2558
+ });
2559
+ }
2560
+ return target;
2561
+ }
2562
+ function ownKeys$1(object, enumerableOnly) {
2563
+ var keys = Object.keys(object);
2564
+ if (Object.getOwnPropertySymbols) {
2565
+ var symbols = Object.getOwnPropertySymbols(object);
2566
+ keys.push.apply(keys, symbols);
2567
+ }
2568
+ return keys;
2569
+ }
2570
+ function _object_spread_props$1(target, source) {
2571
+ source = source != null ? source : {};
2572
+ if (Object.getOwnPropertyDescriptors) {
2573
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2574
+ } else {
2575
+ ownKeys$1(Object(source)).forEach(function(key) {
2576
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2577
+ });
2578
+ }
2579
+ return target;
2580
+ }
2581
+ function _to_consumable_array$2(arr) {
2582
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
2583
+ }
2584
+ function _unsupported_iterable_to_array$4(o, minLen) {
2585
+ if (!o) return;
2586
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
2587
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2588
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2589
+ if (n === "Map" || n === "Set") return Array.from(n);
2590
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
2591
+ }
2592
+ function _ts_generator$8(thisArg, body) {
2593
+ var f, y, t, g, _ = {
2594
+ label: 0,
2595
+ sent: function() {
2596
+ if (t[0] & 1) throw t[1];
2597
+ return t[1];
2598
+ },
2599
+ trys: [],
2600
+ ops: []
2601
+ };
2602
+ return g = {
2603
+ next: verb(0),
2604
+ "throw": verb(1),
2605
+ "return": verb(2)
2606
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
2607
+ return this;
2608
+ }), g;
2609
+ function verb(n) {
2610
+ return function(v) {
2611
+ return step([
2612
+ n,
2613
+ v
2614
+ ]);
2615
+ };
2616
+ }
2617
+ function step(op) {
2618
+ if (f) throw new TypeError("Generator is already executing.");
2619
+ while(_)try {
2620
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
2621
+ if (y = 0, t) op = [
2622
+ op[0] & 2,
2623
+ t.value
2624
+ ];
2625
+ switch(op[0]){
2626
+ case 0:
2627
+ case 1:
2628
+ t = op;
2629
+ break;
2630
+ case 4:
2631
+ _.label++;
2632
+ return {
2633
+ value: op[1],
2634
+ done: false
2635
+ };
2636
+ case 5:
2637
+ _.label++;
2638
+ y = op[1];
2639
+ op = [
2640
+ 0
2641
+ ];
2642
+ continue;
2643
+ case 7:
2644
+ op = _.ops.pop();
2645
+ _.trys.pop();
2646
+ continue;
2647
+ default:
2648
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
2649
+ _ = 0;
2650
+ continue;
2651
+ }
2652
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
2653
+ _.label = op[1];
2654
+ break;
2655
+ }
2656
+ if (op[0] === 6 && _.label < t[1]) {
2657
+ _.label = t[1];
2658
+ t = op;
2659
+ break;
2660
+ }
2661
+ if (t && _.label < t[2]) {
2662
+ _.label = t[2];
2663
+ _.ops.push(op);
2664
+ break;
2665
+ }
2666
+ if (t[2]) _.ops.pop();
2667
+ _.trys.pop();
2668
+ continue;
2669
+ }
2670
+ op = body.call(thisArg, _);
2671
+ } catch (e) {
2672
+ op = [
2673
+ 6,
2674
+ e
2675
+ ];
2676
+ y = 0;
2677
+ } finally{
2678
+ f = t = 0;
2679
+ }
2680
+ if (op[0] & 5) throw op[1];
2681
+ return {
2682
+ value: op[0] ? op[1] : void 0,
2683
+ done: true
2684
+ };
2685
+ }
2686
+ }
2687
+ var userAgentMiddleware = function(options) {
2688
+ return function(next, context) {
2689
+ return function() {
2690
+ var _ref = _async_to_generator$8(function(args) {
2691
+ var _context_userAgent, _context___smithy_context, _awsContext___aws_sdk_context, _options_customUserAgent, request, headers, userAgent, defaultUserAgent, awsContext, customUserAgent, appId, prefix, sdkUserAgentValue, normalUAValue;
2692
+ return _ts_generator$8(this, function(_state) {
2693
+ switch(_state.label){
2694
+ case 0:
2695
+ request = args.request;
2696
+ if (!HttpRequest.isInstance(request)) {
2697
+ return [
2698
+ 2,
2699
+ next(args)
2700
+ ];
2701
+ }
2702
+ headers = request.headers;
2703
+ userAgent = (context === null || context === void 0 ? void 0 : (_context_userAgent = context.userAgent) === null || _context_userAgent === void 0 ? void 0 : _context_userAgent.map(escapeUserAgent)) || [];
2704
+ return [
2705
+ 4,
2706
+ options.defaultUserAgentProvider()
2707
+ ];
2708
+ case 1:
2709
+ defaultUserAgent = _state.sent().map(escapeUserAgent);
2710
+ return [
2711
+ 4,
2712
+ checkFeatures(context, options, args)
2713
+ ];
2714
+ case 2:
2715
+ _state.sent();
2716
+ awsContext = context;
2717
+ defaultUserAgent.push("m/".concat(encodeFeatures(Object.assign({}, (_context___smithy_context = context.__smithy_context) === null || _context___smithy_context === void 0 ? void 0 : _context___smithy_context.features, (_awsContext___aws_sdk_context = awsContext.__aws_sdk_context) === null || _awsContext___aws_sdk_context === void 0 ? void 0 : _awsContext___aws_sdk_context.features))));
2718
+ customUserAgent = (options === null || options === void 0 ? void 0 : (_options_customUserAgent = options.customUserAgent) === null || _options_customUserAgent === void 0 ? void 0 : _options_customUserAgent.map(escapeUserAgent)) || [];
2719
+ return [
2720
+ 4,
2721
+ options.userAgentAppId()
2722
+ ];
2723
+ case 3:
2724
+ appId = _state.sent();
2725
+ if (appId) {
2726
+ defaultUserAgent.push(escapeUserAgent([
2727
+ "app",
2728
+ "".concat(appId)
2729
+ ]));
2730
+ }
2731
+ prefix = getUserAgentPrefix();
2732
+ sdkUserAgentValue = (prefix ? [
2733
+ prefix
2734
+ ] : []).concat(_to_consumable_array$2(defaultUserAgent).concat(_to_consumable_array$2(userAgent), _to_consumable_array$2(customUserAgent))).join(SPACE);
2735
+ normalUAValue = _to_consumable_array$2(defaultUserAgent.filter(function(section) {
2736
+ return section.startsWith("aws-sdk-");
2737
+ })).concat(_to_consumable_array$2(customUserAgent)).join(SPACE);
2738
+ if (options.runtime !== "browser") {
2739
+ if (normalUAValue) {
2740
+ headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? "".concat(headers[USER_AGENT], " ").concat(normalUAValue) : normalUAValue;
2741
+ }
2742
+ headers[USER_AGENT] = sdkUserAgentValue;
2743
+ } else {
2744
+ headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
2745
+ }
2746
+ return [
2747
+ 2,
2748
+ next(_object_spread_props$1(_object_spread$2({}, args), {
2749
+ request: request
2750
+ }))
2751
+ ];
2752
+ }
2753
+ });
2754
+ });
2755
+ return function(args) {
2756
+ return _ref.apply(this, arguments);
2757
+ };
2758
+ }();
2759
+ };
2760
+ };
2761
+ var escapeUserAgent = function(userAgentPair) {
2762
+ var _userAgentPair_;
2763
+ var name = userAgentPair[0].split(UA_NAME_SEPARATOR).map(function(part) {
2764
+ return part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR);
2765
+ }).join(UA_NAME_SEPARATOR);
2766
+ var version = (_userAgentPair_ = userAgentPair[1]) === null || _userAgentPair_ === void 0 ? void 0 : _userAgentPair_.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
2767
+ var prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
2768
+ var prefix = name.substring(0, prefixSeparatorIndex);
2769
+ var uaName = name.substring(prefixSeparatorIndex + 1);
2770
+ if (prefix === "api") {
2771
+ uaName = uaName.toLowerCase();
2772
+ }
2773
+ return [
2774
+ prefix,
2775
+ uaName,
2776
+ version
2777
+ ].filter(function(item) {
2778
+ return item && item.length > 0;
2779
+ }).reduce(function(acc, item, index) {
2780
+ switch(index){
2781
+ case 0:
2782
+ return item;
2783
+ case 1:
2784
+ return "".concat(acc, "/").concat(item);
2785
+ default:
2786
+ return "".concat(acc, "#").concat(item);
2787
+ }
2788
+ }, "");
2789
+ };
2790
+ var getUserAgentMiddlewareOptions = {
2791
+ name: "getUserAgentMiddleware",
2792
+ step: "build",
2793
+ priority: "low",
2794
+ tags: [
2795
+ "SET_USER_AGENT",
2796
+ "USER_AGENT"
2797
+ ],
2798
+ override: true
2799
+ };
2800
+ var getUserAgentPlugin = function(config) {
2801
+ return {
2802
+ applyToStack: function(clientStack) {
2803
+ clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
2804
+ }
2805
+ };
2806
+ };
2807
+
2808
+ function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
2809
+ try {
2810
+ var info = gen[key](arg);
2811
+ var value = info.value;
2812
+ } catch (error) {
2813
+ reject(error);
2814
+ return;
2815
+ }
2816
+ if (info.done) {
2817
+ resolve(value);
2818
+ } else {
2819
+ Promise.resolve(value).then(_next, _throw);
2820
+ }
2821
+ }
2822
+ function _async_to_generator$7(fn) {
2823
+ return function() {
2824
+ var self = this, args = arguments;
2825
+ return new Promise(function(resolve, reject) {
2826
+ var gen = fn.apply(self, args);
2827
+ function _next(value) {
2828
+ asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
2829
+ }
2830
+ function _throw(err) {
2831
+ asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
2832
+ }
2833
+ _next(undefined);
2834
+ });
2835
+ };
2836
+ }
2837
+ function _define_property$2(obj, key, value) {
2838
+ if (key in obj) {
2839
+ Object.defineProperty(obj, key, {
2840
+ value: value,
2841
+ enumerable: true,
2842
+ configurable: true,
2843
+ writable: true
2844
+ });
2845
+ } else {
2846
+ obj[key] = value;
2847
+ }
2848
+ return obj;
2849
+ }
2850
+ function _object_spread$1(target) {
2851
+ for(var i = 1; i < arguments.length; i++){
2852
+ var source = arguments[i] != null ? arguments[i] : {};
2853
+ var ownKeys = Object.keys(source);
2854
+ if (typeof Object.getOwnPropertySymbols === "function") {
2855
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
2856
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
2857
+ }));
2858
+ }
2859
+ ownKeys.forEach(function(key) {
2860
+ _define_property$2(target, key, source[key]);
2861
+ });
2862
+ }
2863
+ return target;
2864
+ }
2865
+ function ownKeys(object, enumerableOnly) {
2866
+ var keys = Object.keys(object);
2867
+ if (Object.getOwnPropertySymbols) {
2868
+ var symbols = Object.getOwnPropertySymbols(object);
2869
+ keys.push.apply(keys, symbols);
2870
+ }
2871
+ return keys;
2872
+ }
2873
+ function _object_spread_props(target, source) {
2874
+ source = source != null ? source : {};
2875
+ if (Object.getOwnPropertyDescriptors) {
2876
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2877
+ } else {
2878
+ ownKeys(Object(source)).forEach(function(key) {
2879
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2880
+ });
2881
+ }
2882
+ return target;
2883
+ }
2884
+ function _ts_generator$7(thisArg, body) {
2885
+ var f, y, t, g, _ = {
2886
+ label: 0,
2887
+ sent: function() {
2888
+ if (t[0] & 1) throw t[1];
2889
+ return t[1];
2890
+ },
2891
+ trys: [],
2892
+ ops: []
2893
+ };
2894
+ return g = {
2895
+ next: verb(0),
2896
+ "throw": verb(1),
2897
+ "return": verb(2)
2898
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
2899
+ return this;
2900
+ }), g;
2901
+ function verb(n) {
2902
+ return function(v) {
2903
+ return step([
2904
+ n,
2905
+ v
2906
+ ]);
2907
+ };
2908
+ }
2909
+ function step(op) {
2910
+ if (f) throw new TypeError("Generator is already executing.");
2911
+ while(_)try {
2912
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
2913
+ if (y = 0, t) op = [
2914
+ op[0] & 2,
2915
+ t.value
2916
+ ];
2917
+ switch(op[0]){
2918
+ case 0:
2919
+ case 1:
2920
+ t = op;
2921
+ break;
2922
+ case 4:
2923
+ _.label++;
2924
+ return {
2925
+ value: op[1],
2926
+ done: false
2927
+ };
2928
+ case 5:
2929
+ _.label++;
2930
+ y = op[1];
2931
+ op = [
2932
+ 0
2933
+ ];
2934
+ continue;
2935
+ case 7:
2936
+ op = _.ops.pop();
2937
+ _.trys.pop();
2938
+ continue;
2939
+ default:
2940
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
2941
+ _ = 0;
2942
+ continue;
2943
+ }
2944
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
2945
+ _.label = op[1];
2946
+ break;
2947
+ }
2948
+ if (op[0] === 6 && _.label < t[1]) {
2949
+ _.label = t[1];
2950
+ t = op;
2951
+ break;
2952
+ }
2953
+ if (t && _.label < t[2]) {
2954
+ _.label = t[2];
2955
+ _.ops.push(op);
2956
+ break;
2957
+ }
2958
+ if (t[2]) _.ops.pop();
2959
+ _.trys.pop();
2960
+ continue;
2961
+ }
2962
+ op = body.call(thisArg, _);
2963
+ } catch (e) {
2964
+ op = [
2965
+ 6,
2966
+ e
2967
+ ];
2968
+ y = 0;
2969
+ } finally{
2970
+ f = t = 0;
2971
+ }
2972
+ if (op[0] & 5) throw op[1];
2973
+ return {
2974
+ value: op[0] ? op[1] : void 0,
2975
+ done: true
2976
+ };
2977
+ }
2978
+ }
2979
+ var CONTENT_LENGTH_HEADER = "content-length";
2980
+ function contentLengthMiddleware(bodyLengthChecker) {
2981
+ return function(next) {
2982
+ return function() {
2983
+ var _ref = _async_to_generator$7(function(args) {
2984
+ var request, body, headers, length;
2985
+ return _ts_generator$7(this, function(_state) {
2986
+ request = args.request;
2987
+ if (HttpRequest.isInstance(request)) {
2988
+ body = request.body, headers = request.headers;
2989
+ if (body && Object.keys(headers).map(function(str) {
2990
+ return str.toLowerCase();
2991
+ }).indexOf(CONTENT_LENGTH_HEADER) === -1) {
2992
+ try {
2993
+ length = bodyLengthChecker(body);
2994
+ request.headers = _object_spread_props(_object_spread$1({}, request.headers), _define_property$2({}, CONTENT_LENGTH_HEADER, String(length)));
2995
+ } catch (error) {}
2996
+ }
2997
+ }
2998
+ return [
2999
+ 2,
3000
+ next(_object_spread_props(_object_spread$1({}, args), {
3001
+ request: request
3002
+ }))
3003
+ ];
3004
+ });
3005
+ });
3006
+ return function(args) {
3007
+ return _ref.apply(this, arguments);
3008
+ };
3009
+ }();
3010
+ };
3011
+ }
3012
+ var contentLengthMiddlewareOptions = {
3013
+ step: "build",
3014
+ tags: [
3015
+ "SET_CONTENT_LENGTH",
3016
+ "CONTENT_LENGTH"
3017
+ ],
3018
+ name: "contentLengthMiddleware",
3019
+ override: true
3020
+ };
3021
+ var getContentLengthPlugin = function(options) {
3022
+ return {
3023
+ applyToStack: function(clientStack) {
3024
+ clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
3025
+ }
3026
+ };
3027
+ };
3028
+
3029
+ function _array_like_to_array$3(arr, len) {
3030
+ if (len == null || len > arr.length) len = arr.length;
3031
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3032
+ return arr2;
3033
+ }
3034
+ function _array_with_holes$1(arr) {
3035
+ if (Array.isArray(arr)) return arr;
3036
+ }
3037
+ function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
3038
+ try {
3039
+ var info = gen[key](arg);
3040
+ var value = info.value;
3041
+ } catch (error) {
3042
+ reject(error);
3043
+ return;
3044
+ }
3045
+ if (info.done) {
3046
+ resolve(value);
3047
+ } else {
3048
+ Promise.resolve(value).then(_next, _throw);
3049
+ }
3050
+ }
3051
+ function _async_to_generator$6(fn) {
3052
+ return function() {
3053
+ var self = this, args = arguments;
3054
+ return new Promise(function(resolve, reject) {
3055
+ var gen = fn.apply(self, args);
3056
+ function _next(value) {
3057
+ asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
3058
+ }
3059
+ function _throw(err) {
3060
+ asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
3061
+ }
3062
+ _next(undefined);
3063
+ });
3064
+ };
3065
+ }
3066
+ function _iterable_to_array_limit$1(arr, i) {
3067
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
3068
+ if (_i == null) return;
3069
+ var _arr = [];
3070
+ var _n = true;
3071
+ var _d = false;
3072
+ var _s, _e;
3073
+ try {
3074
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
3075
+ _arr.push(_s.value);
3076
+ if (i && _arr.length === i) break;
3077
+ }
3078
+ } catch (err) {
3079
+ _d = true;
3080
+ _e = err;
3081
+ } finally{
3082
+ try {
3083
+ if (!_n && _i["return"] != null) _i["return"]();
3084
+ } finally{
3085
+ if (_d) throw _e;
3086
+ }
3087
+ }
3088
+ return _arr;
3089
+ }
3090
+ function _non_iterable_rest$1() {
3091
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3092
+ }
3093
+ function _sliced_to_array$1(arr, i) {
3094
+ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$1();
3095
+ }
3096
+ function _unsupported_iterable_to_array$3(o, minLen) {
3097
+ if (!o) return;
3098
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
3099
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3100
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3101
+ if (n === "Map" || n === "Set") return Array.from(n);
3102
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
3103
+ }
3104
+ function _ts_generator$6(thisArg, body) {
3105
+ var f, y, t, g, _ = {
3106
+ label: 0,
3107
+ sent: function() {
3108
+ if (t[0] & 1) throw t[1];
3109
+ return t[1];
3110
+ },
3111
+ trys: [],
3112
+ ops: []
3113
+ };
3114
+ return g = {
3115
+ next: verb(0),
3116
+ "throw": verb(1),
3117
+ "return": verb(2)
3118
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
3119
+ return this;
3120
+ }), g;
3121
+ function verb(n) {
3122
+ return function(v) {
3123
+ return step([
3124
+ n,
3125
+ v
3126
+ ]);
3127
+ };
3128
+ }
3129
+ function step(op) {
3130
+ if (f) throw new TypeError("Generator is already executing.");
3131
+ while(_)try {
3132
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3133
+ if (y = 0, t) op = [
3134
+ op[0] & 2,
3135
+ t.value
3136
+ ];
3137
+ switch(op[0]){
3138
+ case 0:
3139
+ case 1:
3140
+ t = op;
3141
+ break;
3142
+ case 4:
3143
+ _.label++;
3144
+ return {
3145
+ value: op[1],
3146
+ done: false
3147
+ };
3148
+ case 5:
3149
+ _.label++;
3150
+ y = op[1];
3151
+ op = [
3152
+ 0
3153
+ ];
3154
+ continue;
3155
+ case 7:
3156
+ op = _.ops.pop();
3157
+ _.trys.pop();
3158
+ continue;
3159
+ default:
3160
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
3161
+ _ = 0;
3162
+ continue;
3163
+ }
3164
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
3165
+ _.label = op[1];
3166
+ break;
3167
+ }
3168
+ if (op[0] === 6 && _.label < t[1]) {
3169
+ _.label = t[1];
3170
+ t = op;
3171
+ break;
3172
+ }
3173
+ if (t && _.label < t[2]) {
3174
+ _.label = t[2];
3175
+ _.ops.push(op);
3176
+ break;
3177
+ }
3178
+ if (t[2]) _.ops.pop();
3179
+ _.trys.pop();
3180
+ continue;
3181
+ }
3182
+ op = body.call(thisArg, _);
3183
+ } catch (e) {
3184
+ op = [
3185
+ 6,
3186
+ e
3187
+ ];
3188
+ y = 0;
3189
+ } finally{
3190
+ f = t = 0;
3191
+ }
3192
+ if (op[0] & 5) throw op[1];
3193
+ return {
3194
+ value: op[0] ? op[1] : void 0,
3195
+ done: true
3196
+ };
3197
+ }
3198
+ }
3199
+ var resolveParamsForS3 = function() {
3200
+ var _ref = _async_to_generator$6(function(endpointParams) {
3201
+ var bucket;
3202
+ return _ts_generator$6(this, function(_state) {
3203
+ bucket = (endpointParams === null || endpointParams === void 0 ? void 0 : endpointParams.Bucket) || "";
3204
+ if (typeof endpointParams.Bucket === "string") {
3205
+ endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
3206
+ }
3207
+ if (isArnBucketName(bucket)) {
3208
+ if (endpointParams.ForcePathStyle === true) {
3209
+ throw new Error("Path-style addressing cannot be used with ARN buckets");
3210
+ }
3211
+ } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) {
3212
+ endpointParams.ForcePathStyle = true;
3213
+ }
3214
+ if (endpointParams.DisableMultiRegionAccessPoints) {
3215
+ endpointParams.disableMultiRegionAccessPoints = true;
3216
+ endpointParams.DisableMRAP = true;
3217
+ }
3218
+ return [
3219
+ 2,
3220
+ endpointParams
3221
+ ];
3222
+ });
3223
+ });
3224
+ return function resolveParamsForS3(endpointParams) {
3225
+ return _ref.apply(this, arguments);
3226
+ };
3227
+ }();
3228
+ var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
3229
+ var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
3230
+ var DOTS_PATTERN = /\.\./;
3231
+ var isDnsCompatibleBucketName = function(bucketName) {
3232
+ return DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);
3233
+ };
3234
+ var isArnBucketName = function(bucketName) {
3235
+ var _bucketName_split = _sliced_to_array$1(bucketName.split(":"), 6), arn = _bucketName_split[0], partition = _bucketName_split[1], service = _bucketName_split[2], bucket = _bucketName_split[5];
3236
+ var isArn = arn === "arn" && bucketName.split(":").length >= 6;
3237
+ var isValidArn = Boolean(isArn && partition && service && bucket);
3238
+ if (isArn && !isValidArn) {
3239
+ throw new Error("Invalid ARN: ".concat(bucketName, " was an invalid ARN."));
3240
+ }
3241
+ return isValidArn;
3242
+ };
3243
+
3244
+ function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
3245
+ try {
3246
+ var info = gen[key](arg);
3247
+ var value = info.value;
3248
+ } catch (error) {
3249
+ reject(error);
3250
+ return;
3251
+ }
3252
+ if (info.done) {
3253
+ resolve(value);
3254
+ } else {
3255
+ Promise.resolve(value).then(_next, _throw);
3256
+ }
3257
+ }
3258
+ function _async_to_generator$5(fn) {
3259
+ return function() {
3260
+ var self = this, args = arguments;
3261
+ return new Promise(function(resolve, reject) {
3262
+ var gen = fn.apply(self, args);
3263
+ function _next(value) {
3264
+ asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
3265
+ }
3266
+ function _throw(err) {
3267
+ asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
3268
+ }
3269
+ _next(undefined);
3270
+ });
3271
+ };
3272
+ }
3273
+ function _type_of$1(obj) {
3274
+ "@swc/helpers - typeof";
3275
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
3276
+ }
3277
+ function _ts_generator$5(thisArg, body) {
3278
+ var f, y, t, g, _ = {
3279
+ label: 0,
3280
+ sent: function() {
3281
+ if (t[0] & 1) throw t[1];
3282
+ return t[1];
3283
+ },
3284
+ trys: [],
3285
+ ops: []
3286
+ };
3287
+ return g = {
3288
+ next: verb(0),
3289
+ "throw": verb(1),
3290
+ "return": verb(2)
3291
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
3292
+ return this;
3293
+ }), g;
3294
+ function verb(n) {
3295
+ return function(v) {
3296
+ return step([
3297
+ n,
3298
+ v
3299
+ ]);
3300
+ };
3301
+ }
3302
+ function step(op) {
3303
+ if (f) throw new TypeError("Generator is already executing.");
3304
+ while(_)try {
3305
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3306
+ if (y = 0, t) op = [
3307
+ op[0] & 2,
3308
+ t.value
3309
+ ];
3310
+ switch(op[0]){
3311
+ case 0:
3312
+ case 1:
3313
+ t = op;
3314
+ break;
3315
+ case 4:
3316
+ _.label++;
3317
+ return {
3318
+ value: op[1],
3319
+ done: false
3320
+ };
3321
+ case 5:
3322
+ _.label++;
3323
+ y = op[1];
3324
+ op = [
3325
+ 0
3326
+ ];
3327
+ continue;
3328
+ case 7:
3329
+ op = _.ops.pop();
3330
+ _.trys.pop();
3331
+ continue;
3332
+ default:
3333
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
3334
+ _ = 0;
3335
+ continue;
3336
+ }
3337
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
3338
+ _.label = op[1];
3339
+ break;
3340
+ }
3341
+ if (op[0] === 6 && _.label < t[1]) {
3342
+ _.label = t[1];
3343
+ t = op;
3344
+ break;
3345
+ }
3346
+ if (t && _.label < t[2]) {
3347
+ _.label = t[2];
3348
+ _.ops.push(op);
3349
+ break;
3350
+ }
3351
+ if (t[2]) _.ops.pop();
3352
+ _.trys.pop();
3353
+ continue;
3354
+ }
3355
+ op = body.call(thisArg, _);
3356
+ } catch (e) {
3357
+ op = [
3358
+ 6,
3359
+ e
3360
+ ];
3361
+ y = 0;
3362
+ } finally{
3363
+ f = t = 0;
3364
+ }
3365
+ if (op[0] & 5) throw op[1];
3366
+ return {
3367
+ value: op[0] ? op[1] : void 0,
3368
+ done: true
3369
+ };
3370
+ }
3371
+ }
3372
+ var createConfigValueProvider = function(configKey, canonicalEndpointParamKey, config) {
3373
+ var isClientContextParam = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
3374
+ var configProvider = function() {
3375
+ var _ref = _async_to_generator$5(function() {
3376
+ var configValue, clientContextParams, nestedValue, _ref, _config_configKey;
3377
+ return _ts_generator$5(this, function(_state) {
3378
+ if (isClientContextParam) {
3379
+ clientContextParams = config.clientContextParams;
3380
+ nestedValue = clientContextParams === null || clientContextParams === void 0 ? void 0 : clientContextParams[configKey];
3381
+ configValue = (_ref = nestedValue !== null && nestedValue !== void 0 ? nestedValue : config[configKey]) !== null && _ref !== void 0 ? _ref : config[canonicalEndpointParamKey];
3382
+ } else {
3383
+ configValue = (_config_configKey = config[configKey]) !== null && _config_configKey !== void 0 ? _config_configKey : config[canonicalEndpointParamKey];
3384
+ }
3385
+ if (typeof configValue === "function") {
3386
+ return [
3387
+ 2,
3388
+ configValue()
3389
+ ];
3390
+ }
3391
+ return [
3392
+ 2,
3393
+ configValue
3394
+ ];
3395
+ });
3396
+ });
3397
+ return function configProvider() {
3398
+ return _ref.apply(this, arguments);
3399
+ };
3400
+ }();
3401
+ if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
3402
+ return /*#__PURE__*/ _async_to_generator$5(function() {
3403
+ var credentials, _tmp, _credentials_credentialScope, configValue;
3404
+ return _ts_generator$5(this, function(_state) {
3405
+ switch(_state.label){
3406
+ case 0:
3407
+ if (!(typeof config.credentials === "function")) return [
3408
+ 3,
3409
+ 2
3410
+ ];
3411
+ return [
3412
+ 4,
3413
+ config.credentials()
3414
+ ];
3415
+ case 1:
3416
+ _tmp = _state.sent();
3417
+ return [
3418
+ 3,
3419
+ 3
3420
+ ];
3421
+ case 2:
3422
+ _tmp = config.credentials;
3423
+ _state.label = 3;
3424
+ case 3:
3425
+ credentials = _tmp;
3426
+ configValue = (_credentials_credentialScope = credentials === null || credentials === void 0 ? void 0 : credentials.credentialScope) !== null && _credentials_credentialScope !== void 0 ? _credentials_credentialScope : credentials === null || credentials === void 0 ? void 0 : credentials.CredentialScope;
3427
+ return [
3428
+ 2,
3429
+ configValue
3430
+ ];
3431
+ }
3432
+ });
3433
+ });
3434
+ }
3435
+ if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
3436
+ return /*#__PURE__*/ _async_to_generator$5(function() {
3437
+ var credentials, _tmp, _credentials_accountId, configValue;
3438
+ return _ts_generator$5(this, function(_state) {
3439
+ switch(_state.label){
3440
+ case 0:
3441
+ if (!(typeof config.credentials === "function")) return [
3442
+ 3,
3443
+ 2
3444
+ ];
3445
+ return [
3446
+ 4,
3447
+ config.credentials()
3448
+ ];
3449
+ case 1:
3450
+ _tmp = _state.sent();
3451
+ return [
3452
+ 3,
3453
+ 3
3454
+ ];
3455
+ case 2:
3456
+ _tmp = config.credentials;
3457
+ _state.label = 3;
3458
+ case 3:
3459
+ credentials = _tmp;
3460
+ configValue = (_credentials_accountId = credentials === null || credentials === void 0 ? void 0 : credentials.accountId) !== null && _credentials_accountId !== void 0 ? _credentials_accountId : credentials === null || credentials === void 0 ? void 0 : credentials.AccountId;
3461
+ return [
3462
+ 2,
3463
+ configValue
3464
+ ];
3465
+ }
3466
+ });
3467
+ });
3468
+ }
3469
+ if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
3470
+ return /*#__PURE__*/ _async_to_generator$5(function() {
3471
+ var endpoint, protocol, hostname, port, path;
3472
+ return _ts_generator$5(this, function(_state) {
3473
+ switch(_state.label){
3474
+ case 0:
3475
+ if (config.isCustomEndpoint === false) {
3476
+ return [
3477
+ 2,
3478
+ undefined
3479
+ ];
3480
+ }
3481
+ return [
3482
+ 4,
3483
+ configProvider()
3484
+ ];
3485
+ case 1:
3486
+ endpoint = _state.sent();
3487
+ if (endpoint && (typeof endpoint === "undefined" ? "undefined" : _type_of$1(endpoint)) === "object") {
3488
+ if ("url" in endpoint) {
3489
+ return [
3490
+ 2,
3491
+ endpoint.url.href
3492
+ ];
3493
+ }
3494
+ if ("hostname" in endpoint) {
3495
+ protocol = endpoint.protocol, hostname = endpoint.hostname, port = endpoint.port, path = endpoint.path;
3496
+ return [
3497
+ 2,
3498
+ "".concat(protocol, "//").concat(hostname).concat(port ? ":" + port : "").concat(path)
3499
+ ];
3500
+ }
3501
+ }
3502
+ return [
3503
+ 2,
3504
+ endpoint
3505
+ ];
3506
+ }
3507
+ });
3508
+ });
3509
+ }
3510
+ return configProvider;
3511
+ };
3512
+
3513
+ function _array_like_to_array$2(arr, len) {
3514
+ if (len == null || len > arr.length) len = arr.length;
3515
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3516
+ return arr2;
3517
+ }
3518
+ function _array_without_holes$1(arr) {
3519
+ if (Array.isArray(arr)) return _array_like_to_array$2(arr);
3520
+ }
3521
+ function _iterable_to_array$1(iter) {
3522
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3523
+ }
3524
+ function _non_iterable_spread$1() {
3525
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3526
+ }
3527
+ function _to_consumable_array$1(arr) {
3528
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$1();
3529
+ }
3530
+ function _unsupported_iterable_to_array$2(o, minLen) {
3531
+ if (!o) return;
3532
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
3533
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3534
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3535
+ if (n === "Map" || n === "Set") return Array.from(n);
3536
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
3537
+ }
3538
+ var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
3539
+ var CONFIG_ENDPOINT_URL = "endpoint_url";
3540
+ var getEndpointUrlConfig = function(serviceId) {
3541
+ return {
3542
+ environmentVariableSelector: function(env) {
3543
+ var serviceSuffixParts = serviceId.split(" ").map(function(w) {
3544
+ return w.toUpperCase();
3545
+ });
3546
+ var serviceEndpointUrl = env[[
3547
+ ENV_ENDPOINT_URL
3548
+ ].concat(_to_consumable_array$1(serviceSuffixParts)).join("_")];
3549
+ if (serviceEndpointUrl) return serviceEndpointUrl;
3550
+ var endpointUrl = env[ENV_ENDPOINT_URL];
3551
+ if (endpointUrl) return endpointUrl;
3552
+ return undefined;
3553
+ },
3554
+ configFileSelector: function(profile, config) {
3555
+ if (config && profile.services) {
3556
+ var servicesSection = config[[
3557
+ "services",
3558
+ profile.services
3559
+ ].join(CONFIG_PREFIX_SEPARATOR)];
3560
+ if (servicesSection) {
3561
+ var servicePrefixParts = serviceId.split(" ").map(function(w) {
3562
+ return w.toLowerCase();
3563
+ });
3564
+ var endpointUrl = servicesSection[[
3565
+ servicePrefixParts.join("_"),
3566
+ CONFIG_ENDPOINT_URL
3567
+ ].join(CONFIG_PREFIX_SEPARATOR)];
3568
+ if (endpointUrl) return endpointUrl;
3569
+ }
3570
+ }
3571
+ var endpointUrl1 = profile[CONFIG_ENDPOINT_URL];
3572
+ if (endpointUrl1) return endpointUrl1;
3573
+ return undefined;
3574
+ },
3575
+ default: undefined
3576
+ };
3577
+ };
3578
+
3579
+ function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
3580
+ try {
3581
+ var info = gen[key](arg);
3582
+ var value = info.value;
3583
+ } catch (error) {
3584
+ reject(error);
3585
+ return;
3586
+ }
3587
+ if (info.done) {
3588
+ resolve(value);
3589
+ } else {
3590
+ Promise.resolve(value).then(_next, _throw);
3591
+ }
3592
+ }
3593
+ function _async_to_generator$4(fn) {
3594
+ return function() {
3595
+ var self = this, args = arguments;
3596
+ return new Promise(function(resolve, reject) {
3597
+ var gen = fn.apply(self, args);
3598
+ function _next(value) {
3599
+ asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
3600
+ }
3601
+ function _throw(err) {
3602
+ asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
3603
+ }
3604
+ _next(undefined);
3605
+ });
3606
+ };
3607
+ }
3608
+ function _ts_generator$4(thisArg, body) {
3609
+ var f, y, t, g, _ = {
3610
+ label: 0,
3611
+ sent: function() {
3612
+ if (t[0] & 1) throw t[1];
3613
+ return t[1];
3614
+ },
3615
+ trys: [],
3616
+ ops: []
3617
+ };
3618
+ return g = {
3619
+ next: verb(0),
3620
+ "throw": verb(1),
3621
+ "return": verb(2)
3622
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
3623
+ return this;
3624
+ }), g;
3625
+ function verb(n) {
3626
+ return function(v) {
3627
+ return step([
3628
+ n,
3629
+ v
3630
+ ]);
3631
+ };
3632
+ }
3633
+ function step(op) {
3634
+ if (f) throw new TypeError("Generator is already executing.");
3635
+ while(_)try {
3636
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3637
+ if (y = 0, t) op = [
3638
+ op[0] & 2,
3639
+ t.value
3640
+ ];
3641
+ switch(op[0]){
3642
+ case 0:
3643
+ case 1:
3644
+ t = op;
3645
+ break;
3646
+ case 4:
3647
+ _.label++;
3648
+ return {
3649
+ value: op[1],
3650
+ done: false
3651
+ };
3652
+ case 5:
3653
+ _.label++;
3654
+ y = op[1];
3655
+ op = [
3656
+ 0
3657
+ ];
3658
+ continue;
3659
+ case 7:
3660
+ op = _.ops.pop();
3661
+ _.trys.pop();
3662
+ continue;
3663
+ default:
3664
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
3665
+ _ = 0;
3666
+ continue;
3667
+ }
3668
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
3669
+ _.label = op[1];
3670
+ break;
3671
+ }
3672
+ if (op[0] === 6 && _.label < t[1]) {
3673
+ _.label = t[1];
3674
+ t = op;
3675
+ break;
3676
+ }
3677
+ if (t && _.label < t[2]) {
3678
+ _.label = t[2];
3679
+ _.ops.push(op);
3680
+ break;
3681
+ }
3682
+ if (t[2]) _.ops.pop();
3683
+ _.trys.pop();
3684
+ continue;
3685
+ }
3686
+ op = body.call(thisArg, _);
3687
+ } catch (e) {
3688
+ op = [
3689
+ 6,
3690
+ e
3691
+ ];
3692
+ y = 0;
3693
+ } finally{
3694
+ f = t = 0;
3695
+ }
3696
+ if (op[0] & 5) throw op[1];
3697
+ return {
3698
+ value: op[0] ? op[1] : void 0,
3699
+ done: true
3700
+ };
3701
+ }
3702
+ }
3703
+ var getEndpointFromConfig = function() {
3704
+ var _ref = _async_to_generator$4(function(serviceId) {
3705
+ return _ts_generator$4(this, function(_state) {
3706
+ return [
3707
+ 2,
3708
+ loadConfig(getEndpointUrlConfig(serviceId !== null && serviceId !== void 0 ? serviceId : ""))()
3709
+ ];
3710
+ });
3711
+ });
3712
+ return function getEndpointFromConfig(serviceId) {
3713
+ return _ref.apply(this, arguments);
3714
+ };
3715
+ }();
3716
+
3717
+ function _type_of(obj) {
3718
+ "@swc/helpers - typeof";
3719
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
3720
+ }
3721
+ var toEndpointV1 = function(endpoint) {
3722
+ if ((typeof endpoint === "undefined" ? "undefined" : _type_of(endpoint)) === "object") {
3723
+ if ("url" in endpoint) {
3724
+ return parseUrl(endpoint.url);
3725
+ }
3726
+ return endpoint;
3727
+ }
3728
+ return parseUrl(endpoint);
3729
+ };
3730
+
3731
+ function _array_like_to_array$1(arr, len) {
3732
+ if (len == null || len > arr.length) len = arr.length;
3733
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3734
+ return arr2;
3735
+ }
3736
+ function _array_with_holes(arr) {
3737
+ if (Array.isArray(arr)) return arr;
3738
+ }
3739
+ function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
3740
+ try {
3741
+ var info = gen[key](arg);
3742
+ var value = info.value;
3743
+ } catch (error) {
3744
+ reject(error);
3745
+ return;
3746
+ }
3747
+ if (info.done) {
3748
+ resolve(value);
3749
+ } else {
3750
+ Promise.resolve(value).then(_next, _throw);
3751
+ }
3752
+ }
3753
+ function _async_to_generator$3(fn) {
3754
+ return function() {
3755
+ var self = this, args = arguments;
3756
+ return new Promise(function(resolve, reject) {
3757
+ var gen = fn.apply(self, args);
3758
+ function _next(value) {
3759
+ asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
3760
+ }
3761
+ function _throw(err) {
3762
+ asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
3763
+ }
3764
+ _next(undefined);
3765
+ });
3766
+ };
3767
+ }
3768
+ function _iterable_to_array_limit(arr, i) {
3769
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
3770
+ if (_i == null) return;
3771
+ var _arr = [];
3772
+ var _n = true;
3773
+ var _d = false;
3774
+ var _s, _e;
3775
+ try {
3776
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
3777
+ _arr.push(_s.value);
3778
+ if (i && _arr.length === i) break;
3779
+ }
3780
+ } catch (err) {
3781
+ _d = true;
3782
+ _e = err;
3783
+ } finally{
3784
+ try {
3785
+ if (!_n && _i["return"] != null) _i["return"]();
3786
+ } finally{
3787
+ if (_d) throw _e;
3788
+ }
3789
+ }
3790
+ return _arr;
3791
+ }
3792
+ function _non_iterable_rest() {
3793
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3794
+ }
3795
+ function _sliced_to_array(arr, i) {
3796
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest();
3797
+ }
3798
+ function _unsupported_iterable_to_array$1(o, minLen) {
3799
+ if (!o) return;
3800
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
3801
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3802
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3803
+ if (n === "Map" || n === "Set") return Array.from(n);
3804
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
3805
+ }
3806
+ function _ts_generator$3(thisArg, body) {
3807
+ var f, y, t, g, _ = {
3808
+ label: 0,
3809
+ sent: function() {
3810
+ if (t[0] & 1) throw t[1];
3811
+ return t[1];
3812
+ },
3813
+ trys: [],
3814
+ ops: []
3815
+ };
3816
+ return g = {
3817
+ next: verb(0),
3818
+ "throw": verb(1),
3819
+ "return": verb(2)
3820
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
3821
+ return this;
3822
+ }), g;
3823
+ function verb(n) {
3824
+ return function(v) {
3825
+ return step([
3826
+ n,
3827
+ v
3828
+ ]);
3829
+ };
3830
+ }
3831
+ function step(op) {
3832
+ if (f) throw new TypeError("Generator is already executing.");
3833
+ while(_)try {
3834
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3835
+ if (y = 0, t) op = [
3836
+ op[0] & 2,
3837
+ t.value
3838
+ ];
3839
+ switch(op[0]){
3840
+ case 0:
3841
+ case 1:
3842
+ t = op;
3843
+ break;
3844
+ case 4:
3845
+ _.label++;
3846
+ return {
3847
+ value: op[1],
3848
+ done: false
3849
+ };
3850
+ case 5:
3851
+ _.label++;
3852
+ y = op[1];
3853
+ op = [
3854
+ 0
3855
+ ];
3856
+ continue;
3857
+ case 7:
3858
+ op = _.ops.pop();
3859
+ _.trys.pop();
3860
+ continue;
3861
+ default:
3862
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
3863
+ _ = 0;
3864
+ continue;
3865
+ }
3866
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
3867
+ _.label = op[1];
3868
+ break;
3869
+ }
3870
+ if (op[0] === 6 && _.label < t[1]) {
3871
+ _.label = t[1];
3872
+ t = op;
3873
+ break;
3874
+ }
3875
+ if (t && _.label < t[2]) {
3876
+ _.label = t[2];
3877
+ _.ops.push(op);
3878
+ break;
3879
+ }
3880
+ if (t[2]) _.ops.pop();
3881
+ _.trys.pop();
3882
+ continue;
3883
+ }
3884
+ op = body.call(thisArg, _);
3885
+ } catch (e) {
3886
+ op = [
3887
+ 6,
3888
+ e
3889
+ ];
3890
+ y = 0;
3891
+ } finally{
3892
+ f = t = 0;
3893
+ }
3894
+ if (op[0] & 5) throw op[1];
3895
+ return {
3896
+ value: op[0] ? op[1] : void 0,
3897
+ done: true
3898
+ };
3899
+ }
3900
+ }
3901
+ var getEndpointFromInstructions = function() {
3902
+ var _ref = _async_to_generator$3(function(commandInput, instructionsSupplier, clientConfig, context) {
3903
+ var endpointFromConfig, endpointParams, endpoint;
3904
+ return _ts_generator$3(this, function(_state) {
3905
+ switch(_state.label){
3906
+ case 0:
3907
+ if (!!clientConfig.isCustomEndpoint) return [
3908
+ 3,
3909
+ 5
3910
+ ];
3911
+ if (!clientConfig.serviceConfiguredEndpoint) return [
3912
+ 3,
3913
+ 2
3914
+ ];
3915
+ return [
3916
+ 4,
3917
+ clientConfig.serviceConfiguredEndpoint()
3918
+ ];
3919
+ case 1:
3920
+ endpointFromConfig = _state.sent();
3921
+ return [
3922
+ 3,
3923
+ 4
3924
+ ];
3925
+ case 2:
3926
+ return [
3927
+ 4,
3928
+ getEndpointFromConfig(clientConfig.serviceId)
3929
+ ];
3930
+ case 3:
3931
+ endpointFromConfig = _state.sent();
3932
+ _state.label = 4;
3933
+ case 4:
3934
+ if (endpointFromConfig) {
3935
+ clientConfig.endpoint = function() {
3936
+ return Promise.resolve(toEndpointV1(endpointFromConfig));
3937
+ };
3938
+ clientConfig.isCustomEndpoint = true;
3939
+ }
3940
+ _state.label = 5;
3941
+ case 5:
3942
+ return [
3943
+ 4,
3944
+ resolveParams(commandInput, instructionsSupplier, clientConfig)
3945
+ ];
3946
+ case 6:
3947
+ endpointParams = _state.sent();
3948
+ if (typeof clientConfig.endpointProvider !== "function") {
3949
+ throw new Error("config.endpointProvider is not set.");
3950
+ }
3951
+ endpoint = clientConfig.endpointProvider(endpointParams, context);
3952
+ return [
3953
+ 2,
3954
+ endpoint
3955
+ ];
3956
+ }
3957
+ });
3958
+ });
3959
+ return function getEndpointFromInstructions(commandInput, instructionsSupplier, clientConfig, context) {
3960
+ return _ref.apply(this, arguments);
3961
+ };
3962
+ }();
3963
+ var resolveParams = function() {
3964
+ var _ref = _async_to_generator$3(function(commandInput, instructionsSupplier, clientConfig) {
3965
+ var _instructionsSupplier_getEndpointParameterInstructions, endpointParams, instructions, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, name, instruction, _, err;
3966
+ return _ts_generator$3(this, function(_state) {
3967
+ switch(_state.label){
3968
+ case 0:
3969
+ endpointParams = {};
3970
+ instructions = (instructionsSupplier === null || instructionsSupplier === void 0 ? void 0 : (_instructionsSupplier_getEndpointParameterInstructions = instructionsSupplier.getEndpointParameterInstructions) === null || _instructionsSupplier_getEndpointParameterInstructions === void 0 ? void 0 : _instructionsSupplier_getEndpointParameterInstructions.call(instructionsSupplier)) || {};
3971
+ _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
3972
+ _state.label = 1;
3973
+ case 1:
3974
+ _state.trys.push([
3975
+ 1,
3976
+ 11,
3977
+ 12,
3978
+ 13
3979
+ ]);
3980
+ _iterator = Object.entries(instructions)[Symbol.iterator]();
3981
+ _state.label = 2;
3982
+ case 2:
3983
+ if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
3984
+ 3,
3985
+ 10
3986
+ ];
3987
+ _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], instruction = _step_value[1];
3988
+ _ = instruction.type;
3989
+ switch(_){
3990
+ case "staticContextParams":
3991
+ return [
3992
+ 3,
3993
+ 3
3994
+ ];
3995
+ case "contextParams":
3996
+ return [
3997
+ 3,
3998
+ 4
3999
+ ];
4000
+ case "clientContextParams":
4001
+ return [
4002
+ 3,
4003
+ 5
4004
+ ];
4005
+ case "builtInParams":
4006
+ return [
4007
+ 3,
4008
+ 5
4009
+ ];
4010
+ case "operationContextParams":
4011
+ return [
4012
+ 3,
4013
+ 7
4014
+ ];
4015
+ }
4016
+ return [
4017
+ 3,
4018
+ 8
4019
+ ];
4020
+ case 3:
4021
+ endpointParams[name] = instruction.value;
4022
+ return [
4023
+ 3,
4024
+ 9
4025
+ ];
4026
+ case 4:
4027
+ endpointParams[name] = commandInput[instruction.name];
4028
+ return [
4029
+ 3,
4030
+ 9
4031
+ ];
4032
+ case 5:
4033
+ return [
4034
+ 4,
4035
+ createConfigValueProvider(instruction.name, name, clientConfig, instruction.type !== "builtInParams")()
4036
+ ];
4037
+ case 6:
4038
+ endpointParams[name] = _state.sent();
4039
+ return [
4040
+ 3,
4041
+ 9
4042
+ ];
4043
+ case 7:
4044
+ endpointParams[name] = instruction.get(commandInput);
4045
+ return [
4046
+ 3,
4047
+ 9
4048
+ ];
4049
+ case 8:
4050
+ throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
4051
+ case 9:
4052
+ _iteratorNormalCompletion = true;
4053
+ return [
4054
+ 3,
4055
+ 2
4056
+ ];
4057
+ case 10:
4058
+ return [
4059
+ 3,
4060
+ 13
4061
+ ];
4062
+ case 11:
4063
+ err = _state.sent();
4064
+ _didIteratorError = true;
4065
+ _iteratorError = err;
4066
+ return [
4067
+ 3,
4068
+ 13
4069
+ ];
4070
+ case 12:
4071
+ try {
4072
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
4073
+ _iterator.return();
4074
+ }
4075
+ } finally{
4076
+ if (_didIteratorError) {
4077
+ throw _iteratorError;
4078
+ }
4079
+ }
4080
+ return [
4081
+ 7
4082
+ ];
4083
+ case 13:
4084
+ if (Object.keys(instructions).length === 0) {
4085
+ Object.assign(endpointParams, clientConfig);
4086
+ }
4087
+ if (!(String(clientConfig.serviceId).toLowerCase() === "s3")) return [
4088
+ 3,
4089
+ 15
4090
+ ];
4091
+ return [
4092
+ 4,
4093
+ resolveParamsForS3(endpointParams)
4094
+ ];
4095
+ case 14:
4096
+ _state.sent();
4097
+ _state.label = 15;
4098
+ case 15:
4099
+ return [
4100
+ 2,
4101
+ endpointParams
4102
+ ];
4103
+ }
4104
+ });
4105
+ });
4106
+ return function resolveParams(commandInput, instructionsSupplier, clientConfig) {
4107
+ return _ref.apply(this, arguments);
4108
+ };
4109
+ }();
4110
+
4111
+ function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
4112
+ try {
4113
+ var info = gen[key](arg);
4114
+ var value = info.value;
4115
+ } catch (error) {
4116
+ reject(error);
4117
+ return;
4118
+ }
4119
+ if (info.done) {
4120
+ resolve(value);
4121
+ } else {
4122
+ Promise.resolve(value).then(_next, _throw);
4123
+ }
4124
+ }
4125
+ function _async_to_generator$2(fn) {
4126
+ return function() {
4127
+ var self = this, args = arguments;
4128
+ return new Promise(function(resolve, reject) {
4129
+ var gen = fn.apply(self, args);
4130
+ function _next(value) {
4131
+ asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
4132
+ }
4133
+ function _throw(err) {
4134
+ asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
4135
+ }
4136
+ _next(undefined);
4137
+ });
4138
+ };
4139
+ }
4140
+ function _define_property$1(obj, key, value) {
4141
+ if (key in obj) {
4142
+ Object.defineProperty(obj, key, {
4143
+ value: value,
4144
+ enumerable: true,
4145
+ configurable: true,
4146
+ writable: true
4147
+ });
4148
+ } else {
4149
+ obj[key] = value;
4150
+ }
4151
+ return obj;
4152
+ }
4153
+ function _object_spread(target) {
4154
+ for(var i = 1; i < arguments.length; i++){
4155
+ var source = arguments[i] != null ? arguments[i] : {};
4156
+ var ownKeys = Object.keys(source);
4157
+ if (typeof Object.getOwnPropertySymbols === "function") {
4158
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
4159
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
4160
+ }));
4161
+ }
4162
+ ownKeys.forEach(function(key) {
4163
+ _define_property$1(target, key, source[key]);
4164
+ });
4165
+ }
4166
+ return target;
4167
+ }
4168
+ function _ts_generator$2(thisArg, body) {
4169
+ var f, y, t, g, _ = {
4170
+ label: 0,
4171
+ sent: function() {
4172
+ if (t[0] & 1) throw t[1];
4173
+ return t[1];
4174
+ },
4175
+ trys: [],
4176
+ ops: []
4177
+ };
4178
+ return g = {
4179
+ next: verb(0),
4180
+ "throw": verb(1),
4181
+ "return": verb(2)
4182
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
4183
+ return this;
4184
+ }), g;
4185
+ function verb(n) {
4186
+ return function(v) {
4187
+ return step([
4188
+ n,
4189
+ v
4190
+ ]);
4191
+ };
4192
+ }
4193
+ function step(op) {
4194
+ if (f) throw new TypeError("Generator is already executing.");
4195
+ while(_)try {
4196
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
4197
+ if (y = 0, t) op = [
4198
+ op[0] & 2,
4199
+ t.value
4200
+ ];
4201
+ switch(op[0]){
4202
+ case 0:
4203
+ case 1:
4204
+ t = op;
4205
+ break;
4206
+ case 4:
4207
+ _.label++;
4208
+ return {
4209
+ value: op[1],
4210
+ done: false
4211
+ };
4212
+ case 5:
4213
+ _.label++;
4214
+ y = op[1];
4215
+ op = [
4216
+ 0
4217
+ ];
4218
+ continue;
4219
+ case 7:
4220
+ op = _.ops.pop();
4221
+ _.trys.pop();
4222
+ continue;
4223
+ default:
4224
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
4225
+ _ = 0;
4226
+ continue;
4227
+ }
4228
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
4229
+ _.label = op[1];
4230
+ break;
4231
+ }
4232
+ if (op[0] === 6 && _.label < t[1]) {
4233
+ _.label = t[1];
4234
+ t = op;
4235
+ break;
4236
+ }
4237
+ if (t && _.label < t[2]) {
4238
+ _.label = t[2];
4239
+ _.ops.push(op);
4240
+ break;
4241
+ }
4242
+ if (t[2]) _.ops.pop();
4243
+ _.trys.pop();
4244
+ continue;
4245
+ }
4246
+ op = body.call(thisArg, _);
4247
+ } catch (e) {
4248
+ op = [
4249
+ 6,
4250
+ e
4251
+ ];
4252
+ y = 0;
4253
+ } finally{
4254
+ f = t = 0;
4255
+ }
4256
+ if (op[0] & 5) throw op[1];
4257
+ return {
4258
+ value: op[0] ? op[1] : void 0,
4259
+ done: true
4260
+ };
4261
+ }
4262
+ }
4263
+ var endpointMiddleware = function(param) {
4264
+ var config = param.config, instructions = param.instructions;
4265
+ return function(next, context) {
4266
+ return function() {
4267
+ var _ref = _async_to_generator$2(function(args) {
4268
+ var _endpoint_properties, _context_authSchemes, endpoint, authScheme, _smithyContext_selectedHttpAuthScheme, smithyContext, httpAuthOption;
4269
+ return _ts_generator$2(this, function(_state) {
4270
+ switch(_state.label){
4271
+ case 0:
4272
+ if (config.isCustomEndpoint) {
4273
+ setFeature$1(context, "ENDPOINT_OVERRIDE", "N");
4274
+ }
4275
+ return [
4276
+ 4,
4277
+ getEndpointFromInstructions(args.input, {
4278
+ getEndpointParameterInstructions: function getEndpointParameterInstructions() {
4279
+ return instructions;
4280
+ }
4281
+ }, _object_spread({}, config), context)
4282
+ ];
4283
+ case 1:
4284
+ endpoint = _state.sent();
4285
+ context.endpointV2 = endpoint;
4286
+ context.authSchemes = (_endpoint_properties = endpoint.properties) === null || _endpoint_properties === void 0 ? void 0 : _endpoint_properties.authSchemes;
4287
+ authScheme = (_context_authSchemes = context.authSchemes) === null || _context_authSchemes === void 0 ? void 0 : _context_authSchemes[0];
4288
+ if (authScheme) {
4289
+ context["signing_region"] = authScheme.signingRegion;
4290
+ context["signing_service"] = authScheme.signingName;
4291
+ smithyContext = getSmithyContext(context);
4292
+ httpAuthOption = smithyContext === null || smithyContext === void 0 ? void 0 : (_smithyContext_selectedHttpAuthScheme = smithyContext.selectedHttpAuthScheme) === null || _smithyContext_selectedHttpAuthScheme === void 0 ? void 0 : _smithyContext_selectedHttpAuthScheme.httpAuthOption;
4293
+ if (httpAuthOption) {
4294
+ httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
4295
+ signing_region: authScheme.signingRegion,
4296
+ signingRegion: authScheme.signingRegion,
4297
+ signing_service: authScheme.signingName,
4298
+ signingName: authScheme.signingName,
4299
+ signingRegionSet: authScheme.signingRegionSet
4300
+ }, authScheme.properties);
4301
+ }
4302
+ }
4303
+ return [
4304
+ 2,
4305
+ next(_object_spread({}, args))
4306
+ ];
4307
+ }
4308
+ });
4309
+ });
4310
+ return function(args) {
4311
+ return _ref.apply(this, arguments);
4312
+ };
4313
+ }();
4314
+ };
4315
+ };
4316
+
4317
+ var serializerMiddlewareOption = {
4318
+ name: "serializerMiddleware"};
4319
+
4320
+ var endpointMiddlewareOptions = {
4321
+ step: "serialize",
4322
+ tags: [
4323
+ "ENDPOINT_PARAMETERS",
4324
+ "ENDPOINT_V2",
4325
+ "ENDPOINT"
4326
+ ],
4327
+ name: "endpointV2Middleware",
4328
+ override: true,
4329
+ relation: "before",
4330
+ toMiddleware: serializerMiddlewareOption.name
4331
+ };
4332
+ var getEndpointPlugin = function(config, instructions) {
4333
+ return {
4334
+ applyToStack: function(clientStack) {
4335
+ clientStack.addRelativeTo(endpointMiddleware({
4336
+ config: config,
4337
+ instructions: instructions
4338
+ }), endpointMiddlewareOptions);
4339
+ }
4340
+ };
4341
+ };
4342
+
4343
+ function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
4344
+ try {
4345
+ var info = gen[key](arg);
4346
+ var value = info.value;
4347
+ } catch (error) {
4348
+ reject(error);
4349
+ return;
4350
+ }
4351
+ if (info.done) {
4352
+ resolve(value);
4353
+ } else {
4354
+ Promise.resolve(value).then(_next, _throw);
4355
+ }
4356
+ }
4357
+ function _async_to_generator$1(fn) {
4358
+ return function() {
4359
+ var self = this, args = arguments;
4360
+ return new Promise(function(resolve, reject) {
4361
+ var gen = fn.apply(self, args);
4362
+ function _next(value) {
4363
+ asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
4364
+ }
4365
+ function _throw(err) {
4366
+ asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
4367
+ }
4368
+ _next(undefined);
4369
+ });
4370
+ };
4371
+ }
4372
+ function _ts_generator$1(thisArg, body) {
4373
+ var f, y, t, g, _ = {
4374
+ label: 0,
4375
+ sent: function() {
4376
+ if (t[0] & 1) throw t[1];
4377
+ return t[1];
4378
+ },
4379
+ trys: [],
4380
+ ops: []
4381
+ };
4382
+ return g = {
4383
+ next: verb(0),
4384
+ "throw": verb(1),
4385
+ "return": verb(2)
4386
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
4387
+ return this;
4388
+ }), g;
4389
+ function verb(n) {
4390
+ return function(v) {
4391
+ return step([
4392
+ n,
4393
+ v
4394
+ ]);
4395
+ };
4396
+ }
4397
+ function step(op) {
4398
+ if (f) throw new TypeError("Generator is already executing.");
4399
+ while(_)try {
4400
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
4401
+ if (y = 0, t) op = [
4402
+ op[0] & 2,
4403
+ t.value
4404
+ ];
4405
+ switch(op[0]){
4406
+ case 0:
4407
+ case 1:
4408
+ t = op;
4409
+ break;
4410
+ case 4:
4411
+ _.label++;
4412
+ return {
4413
+ value: op[1],
4414
+ done: false
4415
+ };
4416
+ case 5:
4417
+ _.label++;
4418
+ y = op[1];
4419
+ op = [
4420
+ 0
4421
+ ];
4422
+ continue;
4423
+ case 7:
4424
+ op = _.ops.pop();
4425
+ _.trys.pop();
4426
+ continue;
4427
+ default:
4428
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
4429
+ _ = 0;
4430
+ continue;
4431
+ }
4432
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
4433
+ _.label = op[1];
4434
+ break;
4435
+ }
4436
+ if (op[0] === 6 && _.label < t[1]) {
4437
+ _.label = t[1];
4438
+ t = op;
4439
+ break;
4440
+ }
4441
+ if (t && _.label < t[2]) {
4442
+ _.label = t[2];
4443
+ _.ops.push(op);
4444
+ break;
4445
+ }
4446
+ if (t[2]) _.ops.pop();
4447
+ _.trys.pop();
4448
+ continue;
4449
+ }
4450
+ op = body.call(thisArg, _);
4451
+ } catch (e) {
4452
+ op = [
4453
+ 6,
4454
+ e
4455
+ ];
4456
+ y = 0;
4457
+ } finally{
4458
+ f = t = 0;
4459
+ }
4460
+ if (op[0] & 5) throw op[1];
4461
+ return {
4462
+ value: op[0] ? op[1] : void 0,
4463
+ done: true
4464
+ };
4465
+ }
4466
+ }
4467
+ var resolveEndpointConfig = function(input) {
4468
+ var _input_tls;
4469
+ var tls = (_input_tls = input.tls) !== null && _input_tls !== void 0 ? _input_tls : true;
4470
+ var endpoint = input.endpoint, useDualstackEndpoint = input.useDualstackEndpoint, useFipsEndpoint = input.useFipsEndpoint;
4471
+ var customEndpointProvider = endpoint != null ? /*#__PURE__*/ _async_to_generator$1(function() {
4472
+ return _ts_generator$1(this, function(_state) {
4473
+ switch(_state.label){
4474
+ case 0:
4475
+ return [
4476
+ 4,
4477
+ normalizeProvider$1(endpoint)()
4478
+ ];
4479
+ case 1:
4480
+ return [
4481
+ 2,
4482
+ toEndpointV1.apply(void 0, [
4483
+ _state.sent()
4484
+ ])
4485
+ ];
4486
+ }
4487
+ });
4488
+ }) : undefined;
4489
+ var isCustomEndpoint = !!endpoint;
4490
+ var resolvedConfig = Object.assign(input, {
4491
+ endpoint: customEndpointProvider,
4492
+ tls: tls,
4493
+ isCustomEndpoint: isCustomEndpoint,
4494
+ useDualstackEndpoint: normalizeProvider$1(useDualstackEndpoint !== null && useDualstackEndpoint !== void 0 ? useDualstackEndpoint : false),
4495
+ useFipsEndpoint: normalizeProvider$1(useFipsEndpoint !== null && useFipsEndpoint !== void 0 ? useFipsEndpoint : false)
4496
+ });
4497
+ var configuredEndpointPromise = undefined;
4498
+ resolvedConfig.serviceConfiguredEndpoint = /*#__PURE__*/ _async_to_generator$1(function() {
4499
+ return _ts_generator$1(this, function(_state) {
4500
+ if (input.serviceId && !configuredEndpointPromise) {
4501
+ configuredEndpointPromise = getEndpointFromConfig(input.serviceId);
4502
+ }
4503
+ return [
4504
+ 2,
4505
+ configuredEndpointPromise
4506
+ ];
4507
+ });
4508
+ });
4509
+ return resolvedConfig;
4510
+ };
4511
+
4512
+ var version = "3.993.0";
4513
+ var packageInfo = {
4514
+ version: version};
4515
+
4516
+ var getRuntimeUserAgentPair = function() {
4517
+ var runtimesToCheck = [
4518
+ "deno",
4519
+ "bun",
4520
+ "llrt"
4521
+ ];
4522
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4523
+ try {
4524
+ for(var _iterator = runtimesToCheck[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4525
+ var runtime = _step.value;
4526
+ if (versions[runtime]) {
4527
+ return [
4528
+ "md/".concat(runtime),
4529
+ versions[runtime]
4530
+ ];
4531
+ }
4532
+ }
4533
+ } catch (err) {
4534
+ _didIteratorError = true;
4535
+ _iteratorError = err;
4536
+ } finally{
4537
+ try {
4538
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
4539
+ _iterator.return();
4540
+ }
4541
+ } finally{
4542
+ if (_didIteratorError) {
4543
+ throw _iteratorError;
4544
+ }
4545
+ }
4546
+ }
4547
+ return [
4548
+ "md/nodejs",
4549
+ versions.node
4550
+ ];
4551
+ };
4552
+
4553
+ var isCrtAvailable = function() {
4554
+ return null;
4555
+ };
4556
+
4557
+ function _array_like_to_array(arr, len) {
4558
+ if (len == null || len > arr.length) len = arr.length;
4559
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4560
+ return arr2;
4561
+ }
4562
+ function _array_without_holes(arr) {
4563
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
4564
+ }
4565
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
4566
+ try {
4567
+ var info = gen[key](arg);
4568
+ var value = info.value;
4569
+ } catch (error) {
4570
+ reject(error);
4571
+ return;
4572
+ }
4573
+ if (info.done) {
4574
+ resolve(value);
4575
+ } else {
4576
+ Promise.resolve(value).then(_next, _throw);
4577
+ }
4578
+ }
4579
+ function _async_to_generator(fn) {
4580
+ return function() {
4581
+ var self = this, args = arguments;
4582
+ return new Promise(function(resolve, reject) {
4583
+ var gen = fn.apply(self, args);
4584
+ function _next(value) {
4585
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
4586
+ }
4587
+ function _throw(err) {
4588
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
4589
+ }
4590
+ _next(undefined);
4591
+ });
4592
+ };
4593
+ }
4594
+ function _iterable_to_array(iter) {
4595
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4596
+ }
4597
+ function _non_iterable_spread() {
4598
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4599
+ }
4600
+ function _to_consumable_array(arr) {
4601
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
4602
+ }
4603
+ function _unsupported_iterable_to_array(o, minLen) {
4604
+ if (!o) return;
4605
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
4606
+ var n = Object.prototype.toString.call(o).slice(8, -1);
4607
+ if (n === "Object" && o.constructor) n = o.constructor.name;
4608
+ if (n === "Map" || n === "Set") return Array.from(n);
4609
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
4610
+ }
4611
+ function _ts_generator(thisArg, body) {
4612
+ var f, y, t, g, _ = {
4613
+ label: 0,
4614
+ sent: function() {
4615
+ if (t[0] & 1) throw t[1];
4616
+ return t[1];
4617
+ },
4618
+ trys: [],
4619
+ ops: []
4620
+ };
4621
+ return g = {
4622
+ next: verb(0),
4623
+ "throw": verb(1),
4624
+ "return": verb(2)
4625
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
4626
+ return this;
4627
+ }), g;
4628
+ function verb(n) {
4629
+ return function(v) {
4630
+ return step([
4631
+ n,
4632
+ v
4633
+ ]);
4634
+ };
4635
+ }
4636
+ function step(op) {
4637
+ if (f) throw new TypeError("Generator is already executing.");
4638
+ while(_)try {
4639
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
4640
+ if (y = 0, t) op = [
4641
+ op[0] & 2,
4642
+ t.value
4643
+ ];
4644
+ switch(op[0]){
4645
+ case 0:
4646
+ case 1:
4647
+ t = op;
4648
+ break;
4649
+ case 4:
4650
+ _.label++;
4651
+ return {
4652
+ value: op[1],
4653
+ done: false
4654
+ };
4655
+ case 5:
4656
+ _.label++;
4657
+ y = op[1];
4658
+ op = [
4659
+ 0
4660
+ ];
4661
+ continue;
4662
+ case 7:
4663
+ op = _.ops.pop();
4664
+ _.trys.pop();
4665
+ continue;
4666
+ default:
4667
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
4668
+ _ = 0;
4669
+ continue;
4670
+ }
4671
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
4672
+ _.label = op[1];
4673
+ break;
4674
+ }
4675
+ if (op[0] === 6 && _.label < t[1]) {
4676
+ _.label = t[1];
4677
+ t = op;
4678
+ break;
4679
+ }
4680
+ if (t && _.label < t[2]) {
4681
+ _.label = t[2];
4682
+ _.ops.push(op);
4683
+ break;
4684
+ }
4685
+ if (t[2]) _.ops.pop();
4686
+ _.trys.pop();
4687
+ continue;
4688
+ }
4689
+ op = body.call(thisArg, _);
4690
+ } catch (e) {
4691
+ op = [
4692
+ 6,
4693
+ e
4694
+ ];
4695
+ y = 0;
4696
+ } finally{
4697
+ f = t = 0;
4698
+ }
4699
+ if (op[0] & 5) throw op[1];
4700
+ return {
4701
+ value: op[0] ? op[1] : void 0,
4702
+ done: true
4703
+ };
4704
+ }
4705
+ }
4706
+ var createDefaultUserAgentProvider = function(param) {
4707
+ var serviceId = param.serviceId, clientVersion = param.clientVersion;
4708
+ var runtimeUserAgentPair = getRuntimeUserAgentPair();
4709
+ return function() {
4710
+ var _ref = _async_to_generator(function(config) {
4711
+ var _config_userAgentAppId, sections, crtAvailable, appId, resolvedUserAgent;
4712
+ return _ts_generator(this, function(_state) {
4713
+ switch(_state.label){
4714
+ case 0:
4715
+ sections = [
4716
+ [
4717
+ "aws-sdk-js",
4718
+ clientVersion
4719
+ ],
4720
+ [
4721
+ "ua",
4722
+ "2.1"
4723
+ ],
4724
+ [
4725
+ "os/".concat(platform()),
4726
+ release()
4727
+ ],
4728
+ [
4729
+ "lang/js"
4730
+ ],
4731
+ runtimeUserAgentPair
4732
+ ];
4733
+ crtAvailable = isCrtAvailable();
4734
+ if (crtAvailable) {
4735
+ sections.push(crtAvailable);
4736
+ }
4737
+ if (serviceId) {
4738
+ sections.push([
4739
+ "api/".concat(serviceId),
4740
+ clientVersion
4741
+ ]);
4742
+ }
4743
+ if (env.AWS_EXECUTION_ENV) {
4744
+ sections.push([
4745
+ "exec-env/".concat(env.AWS_EXECUTION_ENV)
4746
+ ]);
4747
+ }
4748
+ return [
4749
+ 4,
4750
+ config === null || config === void 0 ? void 0 : (_config_userAgentAppId = config.userAgentAppId) === null || _config_userAgentAppId === void 0 ? void 0 : _config_userAgentAppId.call(config)
4751
+ ];
4752
+ case 1:
4753
+ appId = _state.sent();
4754
+ resolvedUserAgent = appId ? _to_consumable_array(sections).concat([
4755
+ [
4756
+ "app/".concat(appId)
4757
+ ]
4758
+ ]) : _to_consumable_array(sections);
4759
+ return [
4760
+ 2,
4761
+ resolvedUserAgent
4762
+ ];
4763
+ }
4764
+ });
4765
+ });
4766
+ return function(config) {
4767
+ return _ref.apply(this, arguments);
4768
+ };
4769
+ }();
4770
+ };
4771
+
4772
+ var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
4773
+ var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
4774
+ var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
4775
+ var NODE_APP_ID_CONFIG_OPTIONS = {
4776
+ environmentVariableSelector: function(env) {
4777
+ return env[UA_APP_ID_ENV_NAME];
4778
+ },
4779
+ configFileSelector: function(profile) {
4780
+ var _profile_UA_APP_ID_INI_NAME;
4781
+ return (_profile_UA_APP_ID_INI_NAME = profile[UA_APP_ID_INI_NAME]) !== null && _profile_UA_APP_ID_INI_NAME !== void 0 ? _profile_UA_APP_ID_INI_NAME : profile[UA_APP_ID_INI_NAME_DEPRECATED];
4782
+ },
4783
+ default: DEFAULT_UA_APP_ID
4784
+ };
4785
+
4786
+ function _class_call_check(instance, Constructor) {
4787
+ if (!(instance instanceof Constructor)) {
4788
+ throw new TypeError("Cannot call a class as a function");
4789
+ }
4790
+ }
4791
+ function _defineProperties(target, props) {
4792
+ for(var i = 0; i < props.length; i++){
4793
+ var descriptor = props[i];
4794
+ descriptor.enumerable = descriptor.enumerable || false;
4795
+ descriptor.configurable = true;
4796
+ if ("value" in descriptor) descriptor.writable = true;
4797
+ Object.defineProperty(target, descriptor.key, descriptor);
4798
+ }
4799
+ }
4800
+ function _create_class(Constructor, protoProps, staticProps) {
4801
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
4802
+ return Constructor;
4803
+ }
4804
+ function _define_property(obj, key, value) {
4805
+ if (key in obj) {
4806
+ Object.defineProperty(obj, key, {
4807
+ value: value,
4808
+ enumerable: true,
4809
+ configurable: true,
4810
+ writable: true
4811
+ });
4812
+ } else {
4813
+ obj[key] = value;
4814
+ }
4815
+ return obj;
4816
+ }
4817
+ var Hash = /*#__PURE__*/ function() {
4818
+ function Hash(algorithmIdentifier, secret) {
4819
+ _class_call_check(this, Hash);
4820
+ _define_property(this, "algorithmIdentifier", void 0);
4821
+ _define_property(this, "secret", void 0);
4822
+ _define_property(this, "hash", void 0);
4823
+ this.algorithmIdentifier = algorithmIdentifier;
4824
+ this.secret = secret;
4825
+ this.reset();
4826
+ }
4827
+ _create_class(Hash, [
4828
+ {
4829
+ key: "update",
4830
+ value: function update(toHash, encoding) {
4831
+ this.hash.update(toUint8Array(castSourceData(toHash, encoding)));
4832
+ }
4833
+ },
4834
+ {
4835
+ key: "digest",
4836
+ value: function digest() {
4837
+ return Promise.resolve(this.hash.digest());
4838
+ }
4839
+ },
4840
+ {
4841
+ key: "reset",
4842
+ value: function reset() {
4843
+ this.hash = this.secret ? createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : createHash(this.algorithmIdentifier);
4844
+ }
4845
+ }
4846
+ ]);
4847
+ return Hash;
4848
+ }();
4849
+ function castSourceData(toCast, encoding) {
4850
+ if (Buffer.isBuffer(toCast)) {
4851
+ return toCast;
4852
+ }
4853
+ if (typeof toCast === "string") {
4854
+ return fromString(toCast, encoding);
4855
+ }
4856
+ if (ArrayBuffer.isView(toCast)) {
4857
+ return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);
4858
+ }
4859
+ return fromArrayBuffer(toCast);
4860
+ }
4861
+
4862
+ var RETRY_MODES;
4863
+ (function(RETRY_MODES) {
4864
+ RETRY_MODES["STANDARD"] = "standard";
4865
+ RETRY_MODES["ADAPTIVE"] = "adaptive";
4866
+ })(RETRY_MODES || (RETRY_MODES = {}));
4867
+ var DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
4868
+
4869
+ var getAwsRegionExtensionConfiguration = function(runtimeConfig) {
4870
+ return {
4871
+ setRegion: function setRegion(region) {
4872
+ runtimeConfig.region = region;
4873
+ },
4874
+ region: function region() {
4875
+ return runtimeConfig.region;
4876
+ }
4877
+ };
4878
+ };
4879
+ var resolveAwsRegionExtensionConfiguration = function(awsRegionExtensionConfiguration) {
4880
+ return {
4881
+ region: awsRegionExtensionConfiguration.region()
4882
+ };
4883
+ };
4884
+
4885
+ export { DEFAULT_RETRY_MODE as D, Hash as H, NODE_APP_ID_CONFIG_OPTIONS as N, awsEndpointFunctions as a, resolveUserAgentConfig as b, createDefaultUserAgentProvider as c, resolveEndpointConfig as d, resolveHostHeaderConfig as e, getUserAgentPlugin as f, getAwsRegionExtensionConfiguration as g, getContentLengthPlugin as h, getHostHeaderPlugin as i, getLoggerPlugin as j, getRecursionDetectionPlugin as k, getEndpointPlugin as l, createAggregatedClient as m, packageInfo as p, resolveAwsRegionExtensionConfiguration as r };