nowbackup 1.0.3

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,2994 @@
1
+ import {
2
+ setCredentialFeature
3
+ } from "./chunk-V5IHRGZ2.js";
4
+ import {
5
+ HttpRequest,
6
+ HttpResponse,
7
+ NoOpLogger,
8
+ NormalizedSchema,
9
+ ProviderError,
10
+ SelectorType,
11
+ TypeRegistry,
12
+ booleanSelector,
13
+ customEndpointFunctions,
14
+ decorateServiceException,
15
+ escapeUri,
16
+ getSmithyContext,
17
+ isIpAddress,
18
+ isValidHostLabel,
19
+ normalizeProvider,
20
+ toEndpointV1
21
+ } from "./chunk-YMVDJI7O.js";
22
+ import {
23
+ __dirname,
24
+ fromHex,
25
+ fromUtf8,
26
+ isArrayBuffer,
27
+ parseRfc7231DateTime,
28
+ toHex,
29
+ toUint8Array,
30
+ v4
31
+ } from "./chunk-APZ4HNNC.js";
32
+
33
+ // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js
34
+ var operation = (namespace, name, traits, input, output) => ({
35
+ name,
36
+ namespace,
37
+ traits,
38
+ input,
39
+ output
40
+ });
41
+
42
+ // ../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js
43
+ var schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {
44
+ var _a4, _b, _c, _d;
45
+ const { response } = await next(args);
46
+ const { operationSchema } = getSmithyContext(context);
47
+ const [, ns, n, t, i, o] = operationSchema ?? [];
48
+ try {
49
+ const parsed = await config.protocol.deserializeResponse(operation(ns, n, t, i, o), {
50
+ ...config,
51
+ ...context
52
+ }, response);
53
+ return {
54
+ response,
55
+ output: parsed
56
+ };
57
+ } catch (error) {
58
+ Object.defineProperty(error, "$response", {
59
+ value: response,
60
+ enumerable: false,
61
+ writable: false,
62
+ configurable: false
63
+ });
64
+ if (!("$metadata" in error)) {
65
+ const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
66
+ try {
67
+ error.message += "\n " + hint;
68
+ } catch (e) {
69
+ if (!context.logger || ((_b = (_a4 = context.logger) == null ? void 0 : _a4.constructor) == null ? void 0 : _b.name) === "NoOpLogger") {
70
+ console.warn(hint);
71
+ } else {
72
+ (_d = (_c = context.logger) == null ? void 0 : _c.warn) == null ? void 0 : _d.call(_c, hint);
73
+ }
74
+ }
75
+ if (typeof error.$responseBodyText !== "undefined") {
76
+ if (error.$response) {
77
+ error.$response.body = error.$responseBodyText;
78
+ }
79
+ }
80
+ try {
81
+ if (HttpResponse.isInstance(response)) {
82
+ const { headers = {} } = response;
83
+ const headerEntries = Object.entries(headers);
84
+ error.$metadata = {
85
+ httpStatusCode: response.statusCode,
86
+ requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
87
+ extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
88
+ cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries)
89
+ };
90
+ }
91
+ } catch (e) {
92
+ }
93
+ }
94
+ throw error;
95
+ }
96
+ };
97
+ var findHeader = (pattern, headers) => {
98
+ return (headers.find(([k]) => {
99
+ return k.match(pattern);
100
+ }) || [void 0, void 0])[1];
101
+ };
102
+
103
+ // ../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js
104
+ var schemaSerializationMiddleware = (config) => (next, context) => async (args) => {
105
+ const { operationSchema } = getSmithyContext(context);
106
+ const [, ns, n, t, i, o] = operationSchema ?? [];
107
+ const endpoint = context.endpointV2 ? async () => toEndpointV1(context.endpointV2) : config.endpoint;
108
+ const request = await config.protocol.serializeRequest(operation(ns, n, t, i, o), args.input, {
109
+ ...config,
110
+ ...context,
111
+ endpoint
112
+ });
113
+ return next({
114
+ ...args,
115
+ request
116
+ });
117
+ };
118
+
119
+ // ../../node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js
120
+ var deserializerMiddlewareOption = {
121
+ name: "deserializerMiddleware",
122
+ step: "deserialize",
123
+ tags: ["DESERIALIZER"],
124
+ override: true
125
+ };
126
+ var serializerMiddlewareOption = {
127
+ name: "serializerMiddleware",
128
+ step: "serialize",
129
+ tags: ["SERIALIZER"],
130
+ override: true
131
+ };
132
+ function getSchemaSerdePlugin(config) {
133
+ return {
134
+ applyToStack: (commandStack) => {
135
+ commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption);
136
+ commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption);
137
+ config.protocol.setSerdeContext(config);
138
+ }
139
+ };
140
+ }
141
+
142
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js
143
+ var THROTTLING_ERROR_CODES = [
144
+ "BandwidthLimitExceeded",
145
+ "EC2ThrottledException",
146
+ "LimitExceededException",
147
+ "PriorRequestNotComplete",
148
+ "ProvisionedThroughputExceededException",
149
+ "RequestLimitExceeded",
150
+ "RequestThrottled",
151
+ "RequestThrottledException",
152
+ "SlowDown",
153
+ "ThrottledException",
154
+ "Throttling",
155
+ "ThrottlingException",
156
+ "TooManyRequestsException",
157
+ "TransactionInProgressException"
158
+ ];
159
+ var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
160
+ var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
161
+ var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
162
+ var NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"];
163
+
164
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js
165
+ var isRetryableByTrait = (error) => (error == null ? void 0 : error.$retryable) !== void 0;
166
+ var isClockSkewCorrectedError = (error) => {
167
+ var _a4;
168
+ return (_a4 = error.$metadata) == null ? void 0 : _a4.clockSkewCorrected;
169
+ };
170
+ var isBrowserNetworkError = (error) => {
171
+ const errorMessages = /* @__PURE__ */ new Set([
172
+ "Failed to fetch",
173
+ "NetworkError when attempting to fetch resource",
174
+ "The Internet connection appears to be offline",
175
+ "Load failed",
176
+ "Network request failed"
177
+ ]);
178
+ const isValid = error && error instanceof TypeError;
179
+ if (!isValid) {
180
+ return false;
181
+ }
182
+ return errorMessages.has(error.message);
183
+ };
184
+ var isThrottlingError = (error) => {
185
+ var _a4, _b;
186
+ return ((_a4 = error.$metadata) == null ? void 0 : _a4.httpStatusCode) === 429 || THROTTLING_ERROR_CODES.includes(error.name) || ((_b = error.$retryable) == null ? void 0 : _b.throttling) == true;
187
+ };
188
+ var isTransientError = (error, depth = 0) => {
189
+ var _a4, _b;
190
+ return isRetryableByTrait(error) || isClockSkewCorrectedError(error) || error.name === "InvalidSignatureException" && ((_a4 = error.message) == null ? void 0 : _a4.includes("Signature expired")) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || NODEJS_NETWORK_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_b = error.$metadata) == null ? void 0 : _b.httpStatusCode) || 0) || isBrowserNetworkError(error) || isNodeJsHttp2TransientError(error) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1);
191
+ };
192
+ var isServerError = (error) => {
193
+ var _a4;
194
+ if (((_a4 = error.$metadata) == null ? void 0 : _a4.httpStatusCode) !== void 0) {
195
+ const statusCode = error.$metadata.httpStatusCode;
196
+ if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
197
+ return true;
198
+ }
199
+ return false;
200
+ }
201
+ return false;
202
+ };
203
+ function isNodeJsHttp2TransientError(error) {
204
+ return error.code === "ERR_HTTP2_STREAM_ERROR" && error.message.includes("NGHTTP2_REFUSED_STREAM");
205
+ }
206
+
207
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRateLimiter.js
208
+ var DefaultRateLimiter = class _DefaultRateLimiter {
209
+ static setTimeoutFn = setTimeout;
210
+ beta;
211
+ minCapacity;
212
+ minFillRate;
213
+ scaleConstant;
214
+ smooth;
215
+ enabled = false;
216
+ availableTokens = 0;
217
+ lastMaxRate = 0;
218
+ measuredTxRate = 0;
219
+ requestCount = 0;
220
+ fillRate;
221
+ lastThrottleTime;
222
+ lastTimestamp = 0;
223
+ lastTxRateBucket;
224
+ maxCapacity;
225
+ timeWindow = 0;
226
+ constructor(options) {
227
+ this.beta = (options == null ? void 0 : options.beta) ?? 0.7;
228
+ this.minCapacity = (options == null ? void 0 : options.minCapacity) ?? 1;
229
+ this.minFillRate = (options == null ? void 0 : options.minFillRate) ?? 0.5;
230
+ this.scaleConstant = (options == null ? void 0 : options.scaleConstant) ?? 0.4;
231
+ this.smooth = (options == null ? void 0 : options.smooth) ?? 0.8;
232
+ this.lastThrottleTime = this.getCurrentTimeInSeconds();
233
+ this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
234
+ this.fillRate = this.minFillRate;
235
+ this.maxCapacity = this.minCapacity;
236
+ }
237
+ async getSendToken() {
238
+ return this.acquireTokenBucket(1);
239
+ }
240
+ updateClientSendingRate(response) {
241
+ let calculatedRate;
242
+ this.updateMeasuredRate();
243
+ const retryErrorInfo = response;
244
+ const isThrottling = (retryErrorInfo == null ? void 0 : retryErrorInfo.errorType) === "THROTTLING" || isThrottlingError((retryErrorInfo == null ? void 0 : retryErrorInfo.error) ?? response);
245
+ if (isThrottling) {
246
+ const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
247
+ this.lastMaxRate = rateToUse;
248
+ this.calculateTimeWindow();
249
+ this.lastThrottleTime = this.getCurrentTimeInSeconds();
250
+ calculatedRate = this.cubicThrottle(rateToUse);
251
+ this.enableTokenBucket();
252
+ } else {
253
+ this.calculateTimeWindow();
254
+ calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
255
+ }
256
+ const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
257
+ this.updateTokenBucketRate(newRate);
258
+ }
259
+ getCurrentTimeInSeconds() {
260
+ return Date.now() / 1e3;
261
+ }
262
+ async acquireTokenBucket(amount) {
263
+ if (!this.enabled) {
264
+ return;
265
+ }
266
+ this.refillTokenBucket();
267
+ while (amount > this.availableTokens) {
268
+ const delay = (amount - this.availableTokens) / this.fillRate * 1e3;
269
+ await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay));
270
+ this.refillTokenBucket();
271
+ }
272
+ this.availableTokens = this.availableTokens - amount;
273
+ }
274
+ refillTokenBucket() {
275
+ const timestamp = this.getCurrentTimeInSeconds();
276
+ if (!this.lastTimestamp) {
277
+ this.lastTimestamp = timestamp;
278
+ return;
279
+ }
280
+ const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
281
+ this.availableTokens = Math.min(this.maxCapacity, this.availableTokens + fillAmount);
282
+ this.lastTimestamp = timestamp;
283
+ }
284
+ calculateTimeWindow() {
285
+ this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
286
+ }
287
+ cubicThrottle(rateToUse) {
288
+ return this.getPrecise(rateToUse * this.beta);
289
+ }
290
+ cubicSuccess(timestamp) {
291
+ return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
292
+ }
293
+ enableTokenBucket() {
294
+ this.enabled = true;
295
+ }
296
+ updateTokenBucketRate(newRate) {
297
+ this.refillTokenBucket();
298
+ this.fillRate = Math.max(newRate, this.minFillRate);
299
+ this.maxCapacity = Math.max(newRate, this.minCapacity);
300
+ this.availableTokens = Math.min(this.availableTokens, this.maxCapacity);
301
+ }
302
+ updateMeasuredRate() {
303
+ const t = this.getCurrentTimeInSeconds();
304
+ const timeBucket = Math.floor(t * 2) / 2;
305
+ this.requestCount++;
306
+ if (timeBucket > this.lastTxRateBucket) {
307
+ const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
308
+ this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
309
+ this.requestCount = 0;
310
+ this.lastTxRateBucket = timeBucket;
311
+ }
312
+ }
313
+ getPrecise(num) {
314
+ return parseFloat(num.toFixed(8));
315
+ }
316
+ };
317
+
318
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/constants.js
319
+ var MAXIMUM_RETRY_DELAY = 20 * 1e3;
320
+ var INITIAL_RETRY_TOKENS = 500;
321
+ var NO_RETRY_INCREMENT = 1;
322
+ var INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
323
+ var REQUEST_HEADER = "amz-sdk-request";
324
+
325
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js
326
+ var _a;
327
+ var Retry = class _Retry {
328
+ static v2026 = typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.SMITHY_NEW_RETRIES_2026) === "true";
329
+ static delay() {
330
+ return _Retry.v2026 ? 50 : 100;
331
+ }
332
+ static throttlingDelay() {
333
+ return _Retry.v2026 ? 1e3 : 500;
334
+ }
335
+ static cost() {
336
+ return _Retry.v2026 ? 14 : 5;
337
+ }
338
+ static throttlingCost() {
339
+ return _Retry.v2026 ? 5 : 10;
340
+ }
341
+ static modifiedCostType() {
342
+ return _Retry.v2026 ? "THROTTLING" : "TRANSIENT";
343
+ }
344
+ };
345
+
346
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryBackoffStrategy.js
347
+ var DefaultRetryBackoffStrategy = class {
348
+ x = Retry.delay();
349
+ computeNextBackoffDelay(i) {
350
+ const b = Math.random();
351
+ const r = 2;
352
+ const t_i = b * Math.min(this.x * r ** i, MAXIMUM_RETRY_DELAY);
353
+ return Math.floor(t_i);
354
+ }
355
+ setDelayBase(delay) {
356
+ this.x = delay;
357
+ }
358
+ };
359
+
360
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryToken.js
361
+ var DefaultRetryToken = class {
362
+ delay;
363
+ count;
364
+ cost;
365
+ longPoll;
366
+ constructor(delay, count, cost, longPoll) {
367
+ this.delay = delay;
368
+ this.count = count;
369
+ this.cost = cost;
370
+ this.longPoll = longPoll;
371
+ }
372
+ getRetryCount() {
373
+ return this.count;
374
+ }
375
+ getRetryDelay() {
376
+ return Math.min(MAXIMUM_RETRY_DELAY, this.delay);
377
+ }
378
+ getRetryCost() {
379
+ return this.cost;
380
+ }
381
+ isLongPoll() {
382
+ return this.longPoll;
383
+ }
384
+ };
385
+
386
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/config.js
387
+ var RETRY_MODES;
388
+ (function(RETRY_MODES2) {
389
+ RETRY_MODES2["STANDARD"] = "standard";
390
+ RETRY_MODES2["ADAPTIVE"] = "adaptive";
391
+ })(RETRY_MODES || (RETRY_MODES = {}));
392
+ var DEFAULT_MAX_ATTEMPTS = 3;
393
+ var DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
394
+
395
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js
396
+ var refusal = {
397
+ incompatible: 1,
398
+ attempts: 2,
399
+ capacity: 3
400
+ };
401
+ var StandardRetryStrategy = class {
402
+ mode = RETRY_MODES.STANDARD;
403
+ capacity = INITIAL_RETRY_TOKENS;
404
+ retryBackoffStrategy;
405
+ maxAttemptsProvider;
406
+ baseDelay;
407
+ constructor(arg1) {
408
+ if (typeof arg1 === "number") {
409
+ this.maxAttemptsProvider = async () => arg1;
410
+ } else if (typeof arg1 === "function") {
411
+ this.maxAttemptsProvider = arg1;
412
+ } else if (arg1 && typeof arg1 === "object") {
413
+ this.maxAttemptsProvider = async () => arg1.maxAttempts;
414
+ this.baseDelay = arg1.baseDelay;
415
+ this.retryBackoffStrategy = arg1.backoff;
416
+ }
417
+ this.maxAttemptsProvider ??= async () => DEFAULT_MAX_ATTEMPTS;
418
+ this.baseDelay ??= Retry.delay();
419
+ this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
420
+ }
421
+ async acquireInitialRetryToken(retryTokenScope) {
422
+ return new DefaultRetryToken(Retry.delay(), 0, void 0, Retry.v2026 && retryTokenScope.includes(":longpoll"));
423
+ }
424
+ async refreshRetryTokenForRetry(token, errorInfo) {
425
+ var _a4, _b;
426
+ const maxAttempts = await this.getMaxAttempts();
427
+ const retryCode = this.retryCode(token, errorInfo, maxAttempts);
428
+ const shouldRetry = retryCode === 0;
429
+ const isLongPoll = (_a4 = token.isLongPoll) == null ? void 0 : _a4.call(token);
430
+ if (shouldRetry || isLongPoll) {
431
+ const errorType = errorInfo.errorType;
432
+ this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? Retry.throttlingDelay() : this.baseDelay);
433
+ const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
434
+ let retryDelay = delayFromErrorType;
435
+ if (errorInfo.retryAfterHint instanceof Date) {
436
+ retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5e3));
437
+ }
438
+ if (!shouldRetry) {
439
+ throw Object.assign(new Error("No retry token available"), {
440
+ $backoff: Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0
441
+ });
442
+ } else {
443
+ const capacityCost = this.getCapacityCost(errorType);
444
+ this.capacity -= capacityCost;
445
+ return new DefaultRetryToken(retryDelay, token.getRetryCount() + 1, capacityCost, ((_b = token.isLongPoll) == null ? void 0 : _b.call(token)) ?? false);
446
+ }
447
+ }
448
+ throw new Error("No retry token available");
449
+ }
450
+ recordSuccess(token) {
451
+ this.capacity = Math.min(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
452
+ }
453
+ getCapacity() {
454
+ return this.capacity;
455
+ }
456
+ async maxAttempts() {
457
+ return this.maxAttemptsProvider();
458
+ }
459
+ async getMaxAttempts() {
460
+ try {
461
+ return await this.maxAttemptsProvider();
462
+ } catch (error) {
463
+ console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
464
+ return DEFAULT_MAX_ATTEMPTS;
465
+ }
466
+ }
467
+ retryCode(tokenToRenew, errorInfo, maxAttempts) {
468
+ const attempts = tokenToRenew.getRetryCount() + 1;
469
+ const retryableStatus = this.isRetryableError(errorInfo.errorType) ? 0 : refusal.incompatible;
470
+ const attemptStatus = attempts < maxAttempts ? 0 : refusal.attempts;
471
+ const capacityStatus = this.capacity >= this.getCapacityCost(errorInfo.errorType) ? 0 : refusal.capacity;
472
+ return retryableStatus || attemptStatus || capacityStatus;
473
+ }
474
+ getCapacityCost(errorType) {
475
+ return errorType === Retry.modifiedCostType() ? Retry.throttlingCost() : Retry.cost();
476
+ }
477
+ isRetryableError(errorType) {
478
+ return errorType === "THROTTLING" || errorType === "TRANSIENT";
479
+ }
480
+ };
481
+
482
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/AdaptiveRetryStrategy.js
483
+ var AdaptiveRetryStrategy = class {
484
+ mode = RETRY_MODES.ADAPTIVE;
485
+ rateLimiter;
486
+ standardRetryStrategy;
487
+ constructor(maxAttemptsProvider, options) {
488
+ const { rateLimiter } = options ?? {};
489
+ this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
490
+ this.standardRetryStrategy = options ? new StandardRetryStrategy({
491
+ maxAttempts: typeof maxAttemptsProvider === "number" ? maxAttemptsProvider : 3,
492
+ ...options
493
+ }) : new StandardRetryStrategy(maxAttemptsProvider);
494
+ }
495
+ async acquireInitialRetryToken(retryTokenScope) {
496
+ const token = await this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
497
+ await this.rateLimiter.getSendToken();
498
+ return token;
499
+ }
500
+ async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
501
+ this.rateLimiter.updateClientSendingRate(errorInfo);
502
+ const token = await this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
503
+ await this.rateLimiter.getSendToken();
504
+ return token;
505
+ }
506
+ recordSuccess(token) {
507
+ this.rateLimiter.updateClientSendingRate({});
508
+ this.standardRetryStrategy.recordSuccess(token);
509
+ }
510
+ async maxAttemptsProvider() {
511
+ return this.standardRetryStrategy.maxAttempts();
512
+ }
513
+ };
514
+
515
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js
516
+ var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
517
+ var CONFIG_MAX_ATTEMPTS = "max_attempts";
518
+ var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
519
+ environmentVariableSelector: (env2) => {
520
+ const value = env2[ENV_MAX_ATTEMPTS];
521
+ if (!value)
522
+ return void 0;
523
+ const maxAttempt = parseInt(value);
524
+ if (Number.isNaN(maxAttempt)) {
525
+ throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
526
+ }
527
+ return maxAttempt;
528
+ },
529
+ configFileSelector: (profile) => {
530
+ const value = profile[CONFIG_MAX_ATTEMPTS];
531
+ if (!value)
532
+ return void 0;
533
+ const maxAttempt = parseInt(value);
534
+ if (Number.isNaN(maxAttempt)) {
535
+ throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
536
+ }
537
+ return maxAttempt;
538
+ },
539
+ default: DEFAULT_MAX_ATTEMPTS
540
+ };
541
+ var resolveRetryConfig = (input) => {
542
+ const { retryStrategy, retryMode } = input;
543
+ const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
544
+ let controller = retryStrategy ? Promise.resolve(retryStrategy) : void 0;
545
+ const getDefault = async () => await normalizeProvider(retryMode)() === RETRY_MODES.ADAPTIVE ? new AdaptiveRetryStrategy(maxAttempts) : new StandardRetryStrategy(maxAttempts);
546
+ return Object.assign(input, {
547
+ maxAttempts,
548
+ retryStrategy: () => controller ??= getDefault()
549
+ });
550
+ };
551
+ var ENV_RETRY_MODE = "AWS_RETRY_MODE";
552
+ var CONFIG_RETRY_MODE = "retry_mode";
553
+ var NODE_RETRY_MODE_CONFIG_OPTIONS = {
554
+ environmentVariableSelector: (env2) => env2[ENV_RETRY_MODE],
555
+ configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
556
+ default: DEFAULT_RETRY_MODE
557
+ };
558
+
559
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.js
560
+ import { Readable } from "stream";
561
+ var isStreamingPayload = (request) => (request == null ? void 0 : request.body) instanceof Readable || typeof ReadableStream !== "undefined" && (request == null ? void 0 : request.body) instanceof ReadableStream;
562
+
563
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js
564
+ function parseRetryAfterHeader(response, logger) {
565
+ var _a4, _b, _c, _d;
566
+ if (!HttpResponse.isInstance(response)) {
567
+ return;
568
+ }
569
+ for (const header of Object.keys(response.headers)) {
570
+ const h = header.toLowerCase();
571
+ if (h === "retry-after") {
572
+ const retryAfter = response.headers[header];
573
+ let retryAfterSeconds = NaN;
574
+ if (retryAfter.endsWith("GMT")) {
575
+ try {
576
+ const date = parseRfc7231DateTime(retryAfter);
577
+ retryAfterSeconds = (date.getTime() - Date.now()) / 1e3;
578
+ } catch (e) {
579
+ (_a4 = logger == null ? void 0 : logger.trace) == null ? void 0 : _a4.call(logger, "Failed to parse retry-after header");
580
+ (_b = logger == null ? void 0 : logger.trace) == null ? void 0 : _b.call(logger, e);
581
+ }
582
+ } else if (retryAfter.match(/ GMT, ((\d+)|(\d+\.\d+))$/)) {
583
+ retryAfterSeconds = Number((_c = retryAfter.match(/ GMT, ([\d.]+)$/)) == null ? void 0 : _c[1]);
584
+ } else if (retryAfter.match(/^((\d+)|(\d+\.\d+))$/)) {
585
+ retryAfterSeconds = Number(retryAfter);
586
+ } else if (Date.parse(retryAfter) >= Date.now()) {
587
+ retryAfterSeconds = (Date.parse(retryAfter) - Date.now()) / 1e3;
588
+ }
589
+ if (isNaN(retryAfterSeconds)) {
590
+ return;
591
+ }
592
+ return new Date(Date.now() + retryAfterSeconds * 1e3);
593
+ } else if (h === "x-amz-retry-after") {
594
+ const v = response.headers[header];
595
+ const backoffMilliseconds = Number(v);
596
+ if (isNaN(backoffMilliseconds)) {
597
+ (_d = logger == null ? void 0 : logger.trace) == null ? void 0 : _d.call(logger, `Failed to parse x-amz-retry-after=${v}`);
598
+ return;
599
+ }
600
+ return new Date(Date.now() + backoffMilliseconds);
601
+ }
602
+ }
603
+ }
604
+
605
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js
606
+ var asSdkError = (error) => {
607
+ if (error instanceof Error)
608
+ return error;
609
+ if (error instanceof Object)
610
+ return Object.assign(new Error(), error);
611
+ if (typeof error === "string")
612
+ return new Error(error);
613
+ return new Error(`AWS SDK error wrapper for ${error}`);
614
+ };
615
+
616
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js
617
+ function bindRetryMiddleware(isStreamingPayload2) {
618
+ return (options) => (next, context) => async (args) => {
619
+ var _a4;
620
+ let retryStrategy = await options.retryStrategy();
621
+ const maxAttempts = await options.maxAttempts();
622
+ if (isRetryStrategyV2(retryStrategy)) {
623
+ retryStrategy = retryStrategy;
624
+ let retryToken = await retryStrategy.acquireInitialRetryToken((context["partition_id"] ?? "") + (context.__retryLongPoll ? ":longpoll" : ""));
625
+ let lastError = new Error();
626
+ let attempts = 0;
627
+ let totalRetryDelay = 0;
628
+ const { request } = args;
629
+ const isRequest = HttpRequest.isInstance(request);
630
+ if (isRequest) {
631
+ request.headers[INVOCATION_ID_HEADER] = v4();
632
+ }
633
+ while (true) {
634
+ try {
635
+ if (isRequest) {
636
+ request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
637
+ }
638
+ const { response, output } = await next(args);
639
+ retryStrategy.recordSuccess(retryToken);
640
+ output.$metadata.attempts = attempts + 1;
641
+ output.$metadata.totalRetryDelay = totalRetryDelay;
642
+ return { response, output };
643
+ } catch (e) {
644
+ const retryErrorInfo = getRetryErrorInfo(e, options.logger);
645
+ lastError = asSdkError(e);
646
+ if (isRequest && isStreamingPayload2(request)) {
647
+ (_a4 = context.logger instanceof NoOpLogger ? console : context.logger) == null ? void 0 : _a4.warn("An error was encountered in a non-retryable streaming request.");
648
+ throw lastError;
649
+ }
650
+ try {
651
+ retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
652
+ } catch (refreshError) {
653
+ if (typeof refreshError.$backoff === "number") {
654
+ await cooldown(refreshError.$backoff);
655
+ }
656
+ if (!lastError.$metadata) {
657
+ lastError.$metadata = {};
658
+ }
659
+ lastError.$metadata.attempts = attempts + 1;
660
+ lastError.$metadata.totalRetryDelay = totalRetryDelay;
661
+ throw lastError;
662
+ }
663
+ attempts = retryToken.getRetryCount();
664
+ const delay = retryToken.getRetryDelay();
665
+ totalRetryDelay += delay;
666
+ await cooldown(delay);
667
+ }
668
+ }
669
+ } else {
670
+ retryStrategy = retryStrategy;
671
+ if (retryStrategy == null ? void 0 : retryStrategy.mode) {
672
+ context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
673
+ }
674
+ return retryStrategy.retry(next, args);
675
+ }
676
+ };
677
+ }
678
+ var cooldown = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
679
+ var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
680
+ var getRetryErrorInfo = (error, logger) => {
681
+ const errorInfo = {
682
+ error,
683
+ errorType: getRetryErrorType(error)
684
+ };
685
+ const retryAfterHint = parseRetryAfterHeader(error.$response, logger);
686
+ if (retryAfterHint) {
687
+ errorInfo.retryAfterHint = retryAfterHint;
688
+ }
689
+ return errorInfo;
690
+ };
691
+ var getRetryErrorType = (error) => {
692
+ if (isThrottlingError(error))
693
+ return "THROTTLING";
694
+ if (isTransientError(error))
695
+ return "TRANSIENT";
696
+ if (isServerError(error))
697
+ return "SERVER_ERROR";
698
+ return "CLIENT_ERROR";
699
+ };
700
+ var retryMiddlewareOptions = {
701
+ name: "retryMiddleware",
702
+ tags: ["RETRY"],
703
+ step: "finalizeRequest",
704
+ priority: "high",
705
+ override: true
706
+ };
707
+ function bindGetRetryPlugin(isStreamingPayload2) {
708
+ const retryMiddleware2 = bindRetryMiddleware(isStreamingPayload2);
709
+ return (options) => ({
710
+ applyToStack: (clientStack) => {
711
+ clientStack.add(retryMiddleware2(options), retryMiddlewareOptions);
712
+ }
713
+ });
714
+ }
715
+
716
+ // ../../node_modules/@smithy/core/dist-es/submodules/retry/index.js
717
+ var retryMiddleware = bindRetryMiddleware(isStreamingPayload);
718
+ var getRetryPlugin = bindGetRetryPlugin(isStreamingPayload);
719
+
720
+ // ../../node_modules/@aws-sdk/middleware-host-header/dist-es/index.js
721
+ function resolveHostHeaderConfig(input) {
722
+ return input;
723
+ }
724
+ var hostHeaderMiddleware = (options) => (next) => async (args) => {
725
+ if (!HttpRequest.isInstance(args.request))
726
+ return next(args);
727
+ const { request } = args;
728
+ const { handlerProtocol = "" } = options.requestHandler.metadata || {};
729
+ if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
730
+ delete request.headers["host"];
731
+ request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
732
+ } else if (!request.headers["host"]) {
733
+ let host = request.hostname;
734
+ if (request.port != null)
735
+ host += `:${request.port}`;
736
+ request.headers["host"] = host;
737
+ }
738
+ return next(args);
739
+ };
740
+ var hostHeaderMiddlewareOptions = {
741
+ name: "hostHeaderMiddleware",
742
+ step: "build",
743
+ priority: "low",
744
+ tags: ["HOST"],
745
+ override: true
746
+ };
747
+ var getHostHeaderPlugin = (options) => ({
748
+ applyToStack: (clientStack) => {
749
+ clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
750
+ }
751
+ });
752
+
753
+ // ../../node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js
754
+ var loggerMiddleware = () => (next, context) => async (args) => {
755
+ var _a4, _b;
756
+ try {
757
+ const response = await next(args);
758
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
759
+ const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
760
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
761
+ const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
762
+ const { $metadata, ...outputWithoutMetadata } = response.output;
763
+ (_a4 = logger == null ? void 0 : logger.info) == null ? void 0 : _a4.call(logger, {
764
+ clientName,
765
+ commandName,
766
+ input: inputFilterSensitiveLog(args.input),
767
+ output: outputFilterSensitiveLog(outputWithoutMetadata),
768
+ metadata: $metadata
769
+ });
770
+ return response;
771
+ } catch (error) {
772
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
773
+ const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
774
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
775
+ (_b = logger == null ? void 0 : logger.error) == null ? void 0 : _b.call(logger, {
776
+ clientName,
777
+ commandName,
778
+ input: inputFilterSensitiveLog(args.input),
779
+ error,
780
+ metadata: error.$metadata
781
+ });
782
+ throw error;
783
+ }
784
+ };
785
+ var loggerMiddlewareOptions = {
786
+ name: "loggerMiddleware",
787
+ tags: ["LOGGER"],
788
+ step: "initialize",
789
+ override: true
790
+ };
791
+ var getLoggerPlugin = (options) => ({
792
+ applyToStack: (clientStack) => {
793
+ clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
794
+ }
795
+ });
796
+
797
+ // ../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/configuration.js
798
+ var recursionDetectionMiddlewareOptions = {
799
+ step: "build",
800
+ tags: ["RECURSION_DETECTION"],
801
+ name: "recursionDetectionMiddleware",
802
+ override: true,
803
+ priority: "low"
804
+ };
805
+
806
+ // ../../node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js
807
+ var PROTECTED_KEYS = {
808
+ REQUEST_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_REQUEST_ID"),
809
+ X_RAY_TRACE_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),
810
+ TENANT_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_TENANT_ID")
811
+ };
812
+ var _a2;
813
+ var NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(((_a2 = process.env) == null ? void 0 : _a2.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA) ?? "");
814
+ if (!NO_GLOBAL_AWS_LAMBDA) {
815
+ globalThis.awslambda = globalThis.awslambda || {};
816
+ }
817
+ var InvokeStoreBase = class {
818
+ static PROTECTED_KEYS = PROTECTED_KEYS;
819
+ isProtectedKey(key) {
820
+ return Object.values(PROTECTED_KEYS).includes(key);
821
+ }
822
+ getRequestId() {
823
+ return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-";
824
+ }
825
+ getXRayTraceId() {
826
+ return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID);
827
+ }
828
+ getTenantId() {
829
+ return this.get(PROTECTED_KEYS.TENANT_ID);
830
+ }
831
+ };
832
+ var InvokeStoreSingle = class extends InvokeStoreBase {
833
+ currentContext;
834
+ getContext() {
835
+ return this.currentContext;
836
+ }
837
+ hasContext() {
838
+ return this.currentContext !== void 0;
839
+ }
840
+ get(key) {
841
+ var _a4;
842
+ return (_a4 = this.currentContext) == null ? void 0 : _a4[key];
843
+ }
844
+ set(key, value) {
845
+ if (this.isProtectedKey(key)) {
846
+ throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
847
+ }
848
+ this.currentContext = this.currentContext || {};
849
+ this.currentContext[key] = value;
850
+ }
851
+ run(context, fn) {
852
+ this.currentContext = context;
853
+ return fn();
854
+ }
855
+ };
856
+ var InvokeStoreMulti = class _InvokeStoreMulti extends InvokeStoreBase {
857
+ als;
858
+ static async create() {
859
+ const instance = new _InvokeStoreMulti();
860
+ const asyncHooks = await import("async_hooks");
861
+ instance.als = new asyncHooks.AsyncLocalStorage();
862
+ return instance;
863
+ }
864
+ getContext() {
865
+ return this.als.getStore();
866
+ }
867
+ hasContext() {
868
+ return this.als.getStore() !== void 0;
869
+ }
870
+ get(key) {
871
+ var _a4;
872
+ return (_a4 = this.als.getStore()) == null ? void 0 : _a4[key];
873
+ }
874
+ set(key, value) {
875
+ if (this.isProtectedKey(key)) {
876
+ throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
877
+ }
878
+ const store = this.als.getStore();
879
+ if (!store) {
880
+ throw new Error("No context available");
881
+ }
882
+ store[key] = value;
883
+ }
884
+ run(context, fn) {
885
+ return this.als.run(context, fn);
886
+ }
887
+ };
888
+ var InvokeStore;
889
+ (function(InvokeStore2) {
890
+ let instance = null;
891
+ async function getInstanceAsync(forceInvokeStoreMulti) {
892
+ if (!instance) {
893
+ instance = (async () => {
894
+ var _a4;
895
+ const isMulti = forceInvokeStoreMulti === true || "AWS_LAMBDA_MAX_CONCURRENCY" in process.env;
896
+ const newInstance = isMulti ? await InvokeStoreMulti.create() : new InvokeStoreSingle();
897
+ if (!NO_GLOBAL_AWS_LAMBDA && ((_a4 = globalThis.awslambda) == null ? void 0 : _a4.InvokeStore)) {
898
+ return globalThis.awslambda.InvokeStore;
899
+ } else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) {
900
+ globalThis.awslambda.InvokeStore = newInstance;
901
+ return newInstance;
902
+ } else {
903
+ return newInstance;
904
+ }
905
+ })();
906
+ }
907
+ return instance;
908
+ }
909
+ InvokeStore2.getInstanceAsync = getInstanceAsync;
910
+ InvokeStore2._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? {
911
+ reset: () => {
912
+ var _a4;
913
+ instance = null;
914
+ if ((_a4 = globalThis.awslambda) == null ? void 0 : _a4.InvokeStore) {
915
+ delete globalThis.awslambda.InvokeStore;
916
+ }
917
+ globalThis.awslambda = { InvokeStore: void 0 };
918
+ }
919
+ } : void 0;
920
+ })(InvokeStore || (InvokeStore = {}));
921
+
922
+ // ../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/recursionDetectionMiddleware.js
923
+ var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
924
+ var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
925
+ var ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
926
+ var recursionDetectionMiddleware = () => (next) => async (args) => {
927
+ const { request } = args;
928
+ if (!HttpRequest.isInstance(request)) {
929
+ return next(args);
930
+ }
931
+ const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME;
932
+ if (request.headers.hasOwnProperty(traceIdHeader)) {
933
+ return next(args);
934
+ }
935
+ const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
936
+ const traceIdFromEnv = process.env[ENV_TRACE_ID];
937
+ const invokeStore = await InvokeStore.getInstanceAsync();
938
+ const traceIdFromInvokeStore = invokeStore == null ? void 0 : invokeStore.getXRayTraceId();
939
+ const traceId = traceIdFromInvokeStore ?? traceIdFromEnv;
940
+ const nonEmptyString = (str) => typeof str === "string" && str.length > 0;
941
+ if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
942
+ request.headers[TRACE_ID_HEADER_NAME] = traceId;
943
+ }
944
+ return next({
945
+ ...args,
946
+ request
947
+ });
948
+ };
949
+
950
+ // ../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/getRecursionDetectionPlugin.js
951
+ var getRecursionDetectionPlugin = (options) => ({
952
+ applyToStack: (clientStack) => {
953
+ clientStack.add(recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions);
954
+ }
955
+ });
956
+
957
+ // ../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js
958
+ var resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
959
+ if (!authSchemePreference || authSchemePreference.length === 0) {
960
+ return candidateAuthOptions;
961
+ }
962
+ const preferredAuthOptions = [];
963
+ for (const preferredSchemeName of authSchemePreference) {
964
+ for (const candidateAuthOption of candidateAuthOptions) {
965
+ const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
966
+ if (candidateAuthSchemeName === preferredSchemeName) {
967
+ preferredAuthOptions.push(candidateAuthOption);
968
+ }
969
+ }
970
+ }
971
+ for (const candidateAuthOption of candidateAuthOptions) {
972
+ if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
973
+ preferredAuthOptions.push(candidateAuthOption);
974
+ }
975
+ }
976
+ return preferredAuthOptions;
977
+ };
978
+
979
+ // ../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
980
+ function convertHttpAuthSchemesToMap(httpAuthSchemes) {
981
+ const map = /* @__PURE__ */ new Map();
982
+ for (const scheme of httpAuthSchemes) {
983
+ map.set(scheme.schemeId, scheme);
984
+ }
985
+ return map;
986
+ }
987
+ var httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
988
+ var _a4;
989
+ const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
990
+ const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
991
+ const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
992
+ const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
993
+ const smithyContext = getSmithyContext(context);
994
+ const failureReasons = [];
995
+ for (const option of resolvedOptions) {
996
+ const scheme = authSchemes.get(option.schemeId);
997
+ if (!scheme) {
998
+ failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
999
+ continue;
1000
+ }
1001
+ const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
1002
+ if (!identityProvider) {
1003
+ failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
1004
+ continue;
1005
+ }
1006
+ const { identityProperties = {}, signingProperties = {} } = ((_a4 = option.propertiesExtractor) == null ? void 0 : _a4.call(option, config, context)) || {};
1007
+ option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
1008
+ option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
1009
+ smithyContext.selectedHttpAuthScheme = {
1010
+ httpAuthOption: option,
1011
+ identity: await identityProvider(option.identityProperties),
1012
+ signer: scheme.signer
1013
+ };
1014
+ break;
1015
+ }
1016
+ if (!smithyContext.selectedHttpAuthScheme) {
1017
+ throw new Error(failureReasons.join("\n"));
1018
+ }
1019
+ return next(args);
1020
+ };
1021
+
1022
+ // ../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js
1023
+ var httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
1024
+ step: "serialize",
1025
+ tags: ["HTTP_AUTH_SCHEME"],
1026
+ name: "httpAuthSchemeMiddleware",
1027
+ override: true,
1028
+ relation: "before",
1029
+ toMiddleware: "endpointV2Middleware"
1030
+ };
1031
+ var getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
1032
+ applyToStack: (clientStack) => {
1033
+ clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
1034
+ httpAuthSchemeParametersProvider,
1035
+ identityProviderConfigProvider
1036
+ }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
1037
+ }
1038
+ });
1039
+
1040
+ // ../../node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js
1041
+ var defaultErrorHandler = (signingProperties) => (error) => {
1042
+ throw error;
1043
+ };
1044
+ var defaultSuccessHandler = (httpResponse, signingProperties) => {
1045
+ };
1046
+ var httpSigningMiddleware = (config) => (next, context) => async (args) => {
1047
+ if (!HttpRequest.isInstance(args.request)) {
1048
+ return next(args);
1049
+ }
1050
+ const smithyContext = getSmithyContext(context);
1051
+ const scheme = smithyContext.selectedHttpAuthScheme;
1052
+ if (!scheme) {
1053
+ throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
1054
+ }
1055
+ const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
1056
+ const output = await next({
1057
+ ...args,
1058
+ request: await signer.sign(args.request, identity, signingProperties)
1059
+ }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
1060
+ (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
1061
+ return output;
1062
+ };
1063
+
1064
+ // ../../node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js
1065
+ var httpSigningMiddlewareOptions = {
1066
+ step: "finalizeRequest",
1067
+ tags: ["HTTP_SIGNING"],
1068
+ name: "httpSigningMiddleware",
1069
+ aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
1070
+ override: true,
1071
+ relation: "after",
1072
+ toMiddleware: "retryMiddleware"
1073
+ };
1074
+ var getHttpSigningPlugin = (config) => ({
1075
+ applyToStack: (clientStack) => {
1076
+ clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
1077
+ }
1078
+ });
1079
+
1080
+ // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js
1081
+ var DefaultIdentityProviderConfig = class {
1082
+ authSchemes = /* @__PURE__ */ new Map();
1083
+ constructor(config) {
1084
+ for (const key in config) {
1085
+ const value = config[key];
1086
+ if (value !== void 0) {
1087
+ this.authSchemes.set(key, value);
1088
+ }
1089
+ }
1090
+ }
1091
+ getIdentityProvider(schemeId) {
1092
+ return this.authSchemes.get(schemeId);
1093
+ }
1094
+ };
1095
+
1096
+ // ../../node_modules/@smithy/core/dist-es/normalizeProvider.js
1097
+ var normalizeProvider2 = (input) => {
1098
+ if (typeof input === "function")
1099
+ return input;
1100
+ const promisified = Promise.resolve(input);
1101
+ return () => promisified;
1102
+ };
1103
+
1104
+ // ../../node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js
1105
+ var createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(identity) {
1106
+ return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
1107
+ };
1108
+ var EXPIRATION_MS = 3e5;
1109
+ var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
1110
+ var doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0;
1111
+ var memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
1112
+ if (provider === void 0) {
1113
+ return void 0;
1114
+ }
1115
+ const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
1116
+ let resolved;
1117
+ let pending;
1118
+ let hasResult;
1119
+ let isConstant = false;
1120
+ const coalesceProvider = async (options) => {
1121
+ if (!pending) {
1122
+ pending = normalizedProvider(options);
1123
+ }
1124
+ try {
1125
+ resolved = await pending;
1126
+ hasResult = true;
1127
+ isConstant = false;
1128
+ } finally {
1129
+ pending = void 0;
1130
+ }
1131
+ return resolved;
1132
+ };
1133
+ if (isExpired === void 0) {
1134
+ return async (options) => {
1135
+ if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
1136
+ resolved = await coalesceProvider(options);
1137
+ }
1138
+ return resolved;
1139
+ };
1140
+ }
1141
+ return async (options) => {
1142
+ if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
1143
+ resolved = await coalesceProvider(options);
1144
+ }
1145
+ if (isConstant) {
1146
+ return resolved;
1147
+ }
1148
+ if (!requiresRefresh(resolved)) {
1149
+ isConstant = true;
1150
+ return resolved;
1151
+ }
1152
+ if (isExpired(resolved)) {
1153
+ await coalesceProvider(options);
1154
+ return resolved;
1155
+ }
1156
+ return resolved;
1157
+ };
1158
+ };
1159
+
1160
+ // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js
1161
+ var DEFAULT_UA_APP_ID = void 0;
1162
+ function isValidUserAgentAppId(appId) {
1163
+ if (appId === void 0) {
1164
+ return true;
1165
+ }
1166
+ return typeof appId === "string" && appId.length <= 50;
1167
+ }
1168
+ function resolveUserAgentConfig(input) {
1169
+ const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
1170
+ const { customUserAgent } = input;
1171
+ return Object.assign(input, {
1172
+ customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
1173
+ userAgentAppId: async () => {
1174
+ var _a4, _b;
1175
+ const appId = await normalizedAppIdProvider();
1176
+ if (!isValidUserAgentAppId(appId)) {
1177
+ const logger = ((_b = (_a4 = input.logger) == null ? void 0 : _a4.constructor) == null ? void 0 : _b.name) === "NoOpLogger" || !input.logger ? console : input.logger;
1178
+ if (typeof appId !== "string") {
1179
+ logger == null ? void 0 : logger.warn("userAgentAppId must be a string or undefined.");
1180
+ } else if (appId.length > 50) {
1181
+ logger == null ? void 0 : logger.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
1182
+ }
1183
+ }
1184
+ return appId;
1185
+ }
1186
+ });
1187
+ }
1188
+
1189
+ // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js
1190
+ var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
1191
+ if (allowSubDomains) {
1192
+ for (const label of value.split(".")) {
1193
+ if (!isVirtualHostableS3Bucket(label)) {
1194
+ return false;
1195
+ }
1196
+ }
1197
+ return true;
1198
+ }
1199
+ if (!isValidHostLabel(value)) {
1200
+ return false;
1201
+ }
1202
+ if (value.length < 3 || value.length > 63) {
1203
+ return false;
1204
+ }
1205
+ if (value !== value.toLowerCase()) {
1206
+ return false;
1207
+ }
1208
+ if (isIpAddress(value)) {
1209
+ return false;
1210
+ }
1211
+ return true;
1212
+ };
1213
+
1214
+ // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js
1215
+ var ARN_DELIMITER = ":";
1216
+ var RESOURCE_DELIMITER = "/";
1217
+ var parseArn = (value) => {
1218
+ const segments = value.split(ARN_DELIMITER);
1219
+ if (segments.length < 6)
1220
+ return null;
1221
+ const [arn, partition2, service, region, accountId, ...resourcePath] = segments;
1222
+ if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
1223
+ return null;
1224
+ const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
1225
+ return {
1226
+ partition: partition2,
1227
+ service,
1228
+ region,
1229
+ accountId,
1230
+ resourceId
1231
+ };
1232
+ };
1233
+
1234
+ // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json
1235
+ var partitions_default = {
1236
+ partitions: [{
1237
+ id: "aws",
1238
+ outputs: {
1239
+ dnsSuffix: "amazonaws.com",
1240
+ dualStackDnsSuffix: "api.aws",
1241
+ implicitGlobalRegion: "us-east-1",
1242
+ name: "aws",
1243
+ supportsDualStack: true,
1244
+ supportsFIPS: true
1245
+ },
1246
+ regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
1247
+ regions: {
1248
+ "af-south-1": {
1249
+ description: "Africa (Cape Town)"
1250
+ },
1251
+ "ap-east-1": {
1252
+ description: "Asia Pacific (Hong Kong)"
1253
+ },
1254
+ "ap-east-2": {
1255
+ description: "Asia Pacific (Taipei)"
1256
+ },
1257
+ "ap-northeast-1": {
1258
+ description: "Asia Pacific (Tokyo)"
1259
+ },
1260
+ "ap-northeast-2": {
1261
+ description: "Asia Pacific (Seoul)"
1262
+ },
1263
+ "ap-northeast-3": {
1264
+ description: "Asia Pacific (Osaka)"
1265
+ },
1266
+ "ap-south-1": {
1267
+ description: "Asia Pacific (Mumbai)"
1268
+ },
1269
+ "ap-south-2": {
1270
+ description: "Asia Pacific (Hyderabad)"
1271
+ },
1272
+ "ap-southeast-1": {
1273
+ description: "Asia Pacific (Singapore)"
1274
+ },
1275
+ "ap-southeast-2": {
1276
+ description: "Asia Pacific (Sydney)"
1277
+ },
1278
+ "ap-southeast-3": {
1279
+ description: "Asia Pacific (Jakarta)"
1280
+ },
1281
+ "ap-southeast-4": {
1282
+ description: "Asia Pacific (Melbourne)"
1283
+ },
1284
+ "ap-southeast-5": {
1285
+ description: "Asia Pacific (Malaysia)"
1286
+ },
1287
+ "ap-southeast-6": {
1288
+ description: "Asia Pacific (New Zealand)"
1289
+ },
1290
+ "ap-southeast-7": {
1291
+ description: "Asia Pacific (Thailand)"
1292
+ },
1293
+ "aws-global": {
1294
+ description: "aws global region"
1295
+ },
1296
+ "ca-central-1": {
1297
+ description: "Canada (Central)"
1298
+ },
1299
+ "ca-west-1": {
1300
+ description: "Canada West (Calgary)"
1301
+ },
1302
+ "eu-central-1": {
1303
+ description: "Europe (Frankfurt)"
1304
+ },
1305
+ "eu-central-2": {
1306
+ description: "Europe (Zurich)"
1307
+ },
1308
+ "eu-north-1": {
1309
+ description: "Europe (Stockholm)"
1310
+ },
1311
+ "eu-south-1": {
1312
+ description: "Europe (Milan)"
1313
+ },
1314
+ "eu-south-2": {
1315
+ description: "Europe (Spain)"
1316
+ },
1317
+ "eu-west-1": {
1318
+ description: "Europe (Ireland)"
1319
+ },
1320
+ "eu-west-2": {
1321
+ description: "Europe (London)"
1322
+ },
1323
+ "eu-west-3": {
1324
+ description: "Europe (Paris)"
1325
+ },
1326
+ "il-central-1": {
1327
+ description: "Israel (Tel Aviv)"
1328
+ },
1329
+ "me-central-1": {
1330
+ description: "Middle East (UAE)"
1331
+ },
1332
+ "me-south-1": {
1333
+ description: "Middle East (Bahrain)"
1334
+ },
1335
+ "mx-central-1": {
1336
+ description: "Mexico (Central)"
1337
+ },
1338
+ "sa-east-1": {
1339
+ description: "South America (Sao Paulo)"
1340
+ },
1341
+ "us-east-1": {
1342
+ description: "US East (N. Virginia)"
1343
+ },
1344
+ "us-east-2": {
1345
+ description: "US East (Ohio)"
1346
+ },
1347
+ "us-west-1": {
1348
+ description: "US West (N. California)"
1349
+ },
1350
+ "us-west-2": {
1351
+ description: "US West (Oregon)"
1352
+ }
1353
+ }
1354
+ }, {
1355
+ id: "aws-cn",
1356
+ outputs: {
1357
+ dnsSuffix: "amazonaws.com.cn",
1358
+ dualStackDnsSuffix: "api.amazonwebservices.com.cn",
1359
+ implicitGlobalRegion: "cn-northwest-1",
1360
+ name: "aws-cn",
1361
+ supportsDualStack: true,
1362
+ supportsFIPS: true
1363
+ },
1364
+ regionRegex: "^cn\\-\\w+\\-\\d+$",
1365
+ regions: {
1366
+ "aws-cn-global": {
1367
+ description: "aws-cn global region"
1368
+ },
1369
+ "cn-north-1": {
1370
+ description: "China (Beijing)"
1371
+ },
1372
+ "cn-northwest-1": {
1373
+ description: "China (Ningxia)"
1374
+ }
1375
+ }
1376
+ }, {
1377
+ id: "aws-eusc",
1378
+ outputs: {
1379
+ dnsSuffix: "amazonaws.eu",
1380
+ dualStackDnsSuffix: "api.amazonwebservices.eu",
1381
+ implicitGlobalRegion: "eusc-de-east-1",
1382
+ name: "aws-eusc",
1383
+ supportsDualStack: true,
1384
+ supportsFIPS: true
1385
+ },
1386
+ regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$",
1387
+ regions: {
1388
+ "eusc-de-east-1": {
1389
+ description: "AWS European Sovereign Cloud (Germany)"
1390
+ }
1391
+ }
1392
+ }, {
1393
+ id: "aws-iso",
1394
+ outputs: {
1395
+ dnsSuffix: "c2s.ic.gov",
1396
+ dualStackDnsSuffix: "api.aws.ic.gov",
1397
+ implicitGlobalRegion: "us-iso-east-1",
1398
+ name: "aws-iso",
1399
+ supportsDualStack: true,
1400
+ supportsFIPS: true
1401
+ },
1402
+ regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
1403
+ regions: {
1404
+ "aws-iso-global": {
1405
+ description: "aws-iso global region"
1406
+ },
1407
+ "us-iso-east-1": {
1408
+ description: "US ISO East"
1409
+ },
1410
+ "us-iso-west-1": {
1411
+ description: "US ISO WEST"
1412
+ }
1413
+ }
1414
+ }, {
1415
+ id: "aws-iso-b",
1416
+ outputs: {
1417
+ dnsSuffix: "sc2s.sgov.gov",
1418
+ dualStackDnsSuffix: "api.aws.scloud",
1419
+ implicitGlobalRegion: "us-isob-east-1",
1420
+ name: "aws-iso-b",
1421
+ supportsDualStack: true,
1422
+ supportsFIPS: true
1423
+ },
1424
+ regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
1425
+ regions: {
1426
+ "aws-iso-b-global": {
1427
+ description: "aws-iso-b global region"
1428
+ },
1429
+ "us-isob-east-1": {
1430
+ description: "US ISOB East (Ohio)"
1431
+ },
1432
+ "us-isob-west-1": {
1433
+ description: "US ISOB West"
1434
+ }
1435
+ }
1436
+ }, {
1437
+ id: "aws-iso-e",
1438
+ outputs: {
1439
+ dnsSuffix: "cloud.adc-e.uk",
1440
+ dualStackDnsSuffix: "api.cloud-aws.adc-e.uk",
1441
+ implicitGlobalRegion: "eu-isoe-west-1",
1442
+ name: "aws-iso-e",
1443
+ supportsDualStack: true,
1444
+ supportsFIPS: true
1445
+ },
1446
+ regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
1447
+ regions: {
1448
+ "aws-iso-e-global": {
1449
+ description: "aws-iso-e global region"
1450
+ },
1451
+ "eu-isoe-west-1": {
1452
+ description: "EU ISOE West"
1453
+ }
1454
+ }
1455
+ }, {
1456
+ id: "aws-iso-f",
1457
+ outputs: {
1458
+ dnsSuffix: "csp.hci.ic.gov",
1459
+ dualStackDnsSuffix: "api.aws.hci.ic.gov",
1460
+ implicitGlobalRegion: "us-isof-south-1",
1461
+ name: "aws-iso-f",
1462
+ supportsDualStack: true,
1463
+ supportsFIPS: true
1464
+ },
1465
+ regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
1466
+ regions: {
1467
+ "aws-iso-f-global": {
1468
+ description: "aws-iso-f global region"
1469
+ },
1470
+ "us-isof-east-1": {
1471
+ description: "US ISOF EAST"
1472
+ },
1473
+ "us-isof-south-1": {
1474
+ description: "US ISOF SOUTH"
1475
+ }
1476
+ }
1477
+ }, {
1478
+ id: "aws-us-gov",
1479
+ outputs: {
1480
+ dnsSuffix: "amazonaws.com",
1481
+ dualStackDnsSuffix: "api.aws",
1482
+ implicitGlobalRegion: "us-gov-west-1",
1483
+ name: "aws-us-gov",
1484
+ supportsDualStack: true,
1485
+ supportsFIPS: true
1486
+ },
1487
+ regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
1488
+ regions: {
1489
+ "aws-us-gov-global": {
1490
+ description: "aws-us-gov global region"
1491
+ },
1492
+ "us-gov-east-1": {
1493
+ description: "AWS GovCloud (US-East)"
1494
+ },
1495
+ "us-gov-west-1": {
1496
+ description: "AWS GovCloud (US-West)"
1497
+ }
1498
+ }
1499
+ }],
1500
+ version: "1.1"
1501
+ };
1502
+
1503
+ // ../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js
1504
+ var selectedPartitionsInfo = partitions_default;
1505
+ var selectedUserAgentPrefix = "";
1506
+ var partition = (value) => {
1507
+ const { partitions } = selectedPartitionsInfo;
1508
+ for (const partition2 of partitions) {
1509
+ const { regions, outputs } = partition2;
1510
+ for (const [region, regionData] of Object.entries(regions)) {
1511
+ if (region === value) {
1512
+ return {
1513
+ ...outputs,
1514
+ ...regionData
1515
+ };
1516
+ }
1517
+ }
1518
+ }
1519
+ for (const partition2 of partitions) {
1520
+ const { regionRegex, outputs } = partition2;
1521
+ if (new RegExp(regionRegex).test(value)) {
1522
+ return {
1523
+ ...outputs
1524
+ };
1525
+ }
1526
+ }
1527
+ const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
1528
+ if (!DEFAULT_PARTITION) {
1529
+ throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");
1530
+ }
1531
+ return {
1532
+ ...DEFAULT_PARTITION.outputs
1533
+ };
1534
+ };
1535
+ var getUserAgentPrefix = () => selectedUserAgentPrefix;
1536
+
1537
+ // ../../node_modules/@aws-sdk/util-endpoints/dist-es/aws.js
1538
+ var awsEndpointFunctions = {
1539
+ isVirtualHostableS3Bucket,
1540
+ parseArn,
1541
+ partition
1542
+ };
1543
+ customEndpointFunctions.aws = awsEndpointFunctions;
1544
+
1545
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js
1546
+ var state = {
1547
+ warningEmitted: false
1548
+ };
1549
+ var emitWarningIfUnsupportedVersion = (version) => {
1550
+ if (version && !state.warningEmitted) {
1551
+ if (process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED === "true") {
1552
+ state.warningEmitted = true;
1553
+ return;
1554
+ }
1555
+ const userMajorVersion = parseInt(version.substring(1, version.indexOf(".")));
1556
+ const vv = 22;
1557
+ if (userMajorVersion < vv) {
1558
+ state.warningEmitted = true;
1559
+ process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
1560
+ versions published after the first week of January 2027
1561
+ will require node >=${vv}. You are running node ${version}.
1562
+
1563
+ To continue receiving updates to AWS services, bug fixes,
1564
+ and security updates please upgrade to node >=${vv}.
1565
+
1566
+ More information can be found at: https://a.co/c895JFp`);
1567
+ }
1568
+ }
1569
+ };
1570
+
1571
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
1572
+ var _a3;
1573
+ Retry.v2026 ||= typeof process === "object" && ((_a3 = process.env) == null ? void 0 : _a3.AWS_NEW_RETRIES_2026) === "true";
1574
+ function setFeature(context, feature, value) {
1575
+ if (!context.__aws_sdk_context) {
1576
+ context.__aws_sdk_context = {
1577
+ features: {}
1578
+ };
1579
+ } else if (!context.__aws_sdk_context.features) {
1580
+ context.__aws_sdk_context.features = {};
1581
+ }
1582
+ context.__aws_sdk_context.features[feature] = value;
1583
+ }
1584
+
1585
+ // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js
1586
+ var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
1587
+ async function checkFeatures(context, config, args) {
1588
+ var _a4, _b, _c, _d, _e;
1589
+ const request = args.request;
1590
+ if (((_a4 = request == null ? void 0 : request.headers) == null ? void 0 : _a4["smithy-protocol"]) === "rpc-v2-cbor") {
1591
+ setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
1592
+ }
1593
+ if (typeof config.retryStrategy === "function") {
1594
+ const retryStrategy = await config.retryStrategy();
1595
+ if (typeof retryStrategy.mode === "string") {
1596
+ switch (retryStrategy.mode) {
1597
+ case RETRY_MODES.ADAPTIVE:
1598
+ setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
1599
+ break;
1600
+ case RETRY_MODES.STANDARD:
1601
+ setFeature(context, "RETRY_MODE_STANDARD", "E");
1602
+ break;
1603
+ }
1604
+ }
1605
+ }
1606
+ if (typeof config.accountIdEndpointMode === "function") {
1607
+ const endpointV2 = context.endpointV2;
1608
+ if (String((_b = endpointV2 == null ? void 0 : endpointV2.url) == null ? void 0 : _b.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
1609
+ setFeature(context, "ACCOUNT_ID_ENDPOINT", "O");
1610
+ }
1611
+ switch (await ((_c = config.accountIdEndpointMode) == null ? void 0 : _c.call(config))) {
1612
+ case "disabled":
1613
+ setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
1614
+ break;
1615
+ case "preferred":
1616
+ setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
1617
+ break;
1618
+ case "required":
1619
+ setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
1620
+ break;
1621
+ }
1622
+ }
1623
+ const identity = (_e = (_d = context.__smithy_context) == null ? void 0 : _d.selectedHttpAuthScheme) == null ? void 0 : _e.identity;
1624
+ if (identity == null ? void 0 : identity.$source) {
1625
+ const credentials = identity;
1626
+ if (credentials.accountId) {
1627
+ setFeature(context, "RESOLVED_ACCOUNT_ID", "T");
1628
+ }
1629
+ for (const [key, value] of Object.entries(credentials.$source ?? {})) {
1630
+ setFeature(context, key, value);
1631
+ }
1632
+ }
1633
+ }
1634
+
1635
+ // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js
1636
+ var USER_AGENT = "user-agent";
1637
+ var X_AMZ_USER_AGENT = "x-amz-user-agent";
1638
+ var SPACE = " ";
1639
+ var UA_NAME_SEPARATOR = "/";
1640
+ var UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g;
1641
+ var UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g;
1642
+ var UA_ESCAPE_CHAR = "-";
1643
+
1644
+ // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js
1645
+ var BYTE_LIMIT = 1024;
1646
+ function encodeFeatures(features) {
1647
+ let buffer = "";
1648
+ for (const key in features) {
1649
+ const val = features[key];
1650
+ if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
1651
+ if (buffer.length) {
1652
+ buffer += "," + val;
1653
+ } else {
1654
+ buffer += val;
1655
+ }
1656
+ continue;
1657
+ }
1658
+ break;
1659
+ }
1660
+ return buffer;
1661
+ }
1662
+
1663
+ // ../../node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js
1664
+ var userAgentMiddleware = (options) => (next, context) => async (args) => {
1665
+ var _a4, _b, _c, _d;
1666
+ const { request } = args;
1667
+ if (!HttpRequest.isInstance(request)) {
1668
+ return next(args);
1669
+ }
1670
+ const { headers } = request;
1671
+ const userAgent = ((_a4 = context == null ? void 0 : context.userAgent) == null ? void 0 : _a4.map(escapeUserAgent)) || [];
1672
+ const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
1673
+ await checkFeatures(context, options, args);
1674
+ const awsContext = context;
1675
+ defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, (_b = context.__smithy_context) == null ? void 0 : _b.features, (_c = awsContext.__aws_sdk_context) == null ? void 0 : _c.features))}`);
1676
+ const customUserAgent = ((_d = options == null ? void 0 : options.customUserAgent) == null ? void 0 : _d.map(escapeUserAgent)) || [];
1677
+ const appId = await options.userAgentAppId();
1678
+ if (appId) {
1679
+ defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`]));
1680
+ }
1681
+ const prefix = getUserAgentPrefix();
1682
+ const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE);
1683
+ const normalUAValue = [
1684
+ ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
1685
+ ...customUserAgent
1686
+ ].join(SPACE);
1687
+ if (options.runtime !== "browser") {
1688
+ if (normalUAValue) {
1689
+ headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;
1690
+ }
1691
+ headers[USER_AGENT] = sdkUserAgentValue;
1692
+ } else {
1693
+ headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
1694
+ }
1695
+ return next({
1696
+ ...args,
1697
+ request
1698
+ });
1699
+ };
1700
+ var escapeUserAgent = (userAgentPair) => {
1701
+ var _a4;
1702
+ const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR);
1703
+ const version = (_a4 = userAgentPair[1]) == null ? void 0 : _a4.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
1704
+ const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
1705
+ const prefix = name.substring(0, prefixSeparatorIndex);
1706
+ let uaName = name.substring(prefixSeparatorIndex + 1);
1707
+ if (prefix === "api") {
1708
+ uaName = uaName.toLowerCase();
1709
+ }
1710
+ return [prefix, uaName, version].filter((item) => item && item.length > 0).reduce((acc, item, index) => {
1711
+ switch (index) {
1712
+ case 0:
1713
+ return item;
1714
+ case 1:
1715
+ return `${acc}/${item}`;
1716
+ default:
1717
+ return `${acc}#${item}`;
1718
+ }
1719
+ }, "");
1720
+ };
1721
+ var getUserAgentMiddlewareOptions = {
1722
+ name: "getUserAgentMiddleware",
1723
+ step: "build",
1724
+ priority: "low",
1725
+ tags: ["SET_USER_AGENT", "USER_AGENT"],
1726
+ override: true
1727
+ };
1728
+ var getUserAgentPlugin = (config) => ({
1729
+ applyToStack: (clientStack) => {
1730
+ clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
1731
+ }
1732
+ });
1733
+
1734
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js
1735
+ var getDateHeader = (response) => {
1736
+ var _a4, _b;
1737
+ return HttpResponse.isInstance(response) ? ((_a4 = response.headers) == null ? void 0 : _a4.date) ?? ((_b = response.headers) == null ? void 0 : _b.Date) : void 0;
1738
+ };
1739
+
1740
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js
1741
+ var getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);
1742
+
1743
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js
1744
+ var isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5;
1745
+
1746
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js
1747
+ var getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => {
1748
+ const clockTimeInMs = Date.parse(clockTime);
1749
+ if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
1750
+ return clockTimeInMs - Date.now();
1751
+ }
1752
+ return currentSystemClockOffset;
1753
+ };
1754
+
1755
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js
1756
+ var throwSigningPropertyError = (name, property) => {
1757
+ if (!property) {
1758
+ throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
1759
+ }
1760
+ return property;
1761
+ };
1762
+ var validateSigningProperties = async (signingProperties) => {
1763
+ var _a4, _b, _c;
1764
+ const context = throwSigningPropertyError("context", signingProperties.context);
1765
+ const config = throwSigningPropertyError("config", signingProperties.config);
1766
+ const authScheme = (_c = (_b = (_a4 = context.endpointV2) == null ? void 0 : _a4.properties) == null ? void 0 : _b.authSchemes) == null ? void 0 : _c[0];
1767
+ const signerFunction = throwSigningPropertyError("signer", config.signer);
1768
+ const signer = await signerFunction(authScheme);
1769
+ const signingRegion = signingProperties == null ? void 0 : signingProperties.signingRegion;
1770
+ const signingRegionSet = signingProperties == null ? void 0 : signingProperties.signingRegionSet;
1771
+ const signingName = signingProperties == null ? void 0 : signingProperties.signingName;
1772
+ return {
1773
+ config,
1774
+ signer,
1775
+ signingRegion,
1776
+ signingRegionSet,
1777
+ signingName
1778
+ };
1779
+ };
1780
+ var AwsSdkSigV4Signer = class {
1781
+ async sign(httpRequest, identity, signingProperties) {
1782
+ var _a4;
1783
+ if (!HttpRequest.isInstance(httpRequest)) {
1784
+ throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
1785
+ }
1786
+ const validatedProps = await validateSigningProperties(signingProperties);
1787
+ const { config, signer } = validatedProps;
1788
+ let { signingRegion, signingName } = validatedProps;
1789
+ const handlerExecutionContext = signingProperties.context;
1790
+ if (((_a4 = handlerExecutionContext == null ? void 0 : handlerExecutionContext.authSchemes) == null ? void 0 : _a4.length) ?? 0 > 1) {
1791
+ const [first, second] = handlerExecutionContext.authSchemes;
1792
+ if ((first == null ? void 0 : first.name) === "sigv4a" && (second == null ? void 0 : second.name) === "sigv4") {
1793
+ signingRegion = (second == null ? void 0 : second.signingRegion) ?? signingRegion;
1794
+ signingName = (second == null ? void 0 : second.signingName) ?? signingName;
1795
+ }
1796
+ }
1797
+ const signedRequest = await signer.sign(httpRequest, {
1798
+ signingDate: getSkewCorrectedDate(config.systemClockOffset),
1799
+ signingRegion,
1800
+ signingService: signingName
1801
+ });
1802
+ return signedRequest;
1803
+ }
1804
+ errorHandler(signingProperties) {
1805
+ return (error) => {
1806
+ const serverTime = error.ServerTime ?? getDateHeader(error.$response);
1807
+ if (serverTime) {
1808
+ const config = throwSigningPropertyError("config", signingProperties.config);
1809
+ const initialSystemClockOffset = config.systemClockOffset;
1810
+ config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
1811
+ const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
1812
+ if (clockSkewCorrected && error.$metadata) {
1813
+ error.$metadata.clockSkewCorrected = true;
1814
+ }
1815
+ }
1816
+ throw error;
1817
+ };
1818
+ }
1819
+ successHandler(httpResponse, signingProperties) {
1820
+ const dateHeader = getDateHeader(httpResponse);
1821
+ if (dateHeader) {
1822
+ const config = throwSigningPropertyError("config", signingProperties.config);
1823
+ config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
1824
+ }
1825
+ }
1826
+ };
1827
+
1828
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js
1829
+ var AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer {
1830
+ async sign(httpRequest, identity, signingProperties) {
1831
+ var _a4;
1832
+ if (!HttpRequest.isInstance(httpRequest)) {
1833
+ throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
1834
+ }
1835
+ const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
1836
+ const configResolvedSigningRegionSet = await ((_a4 = config.sigv4aSigningRegionSet) == null ? void 0 : _a4.call(config));
1837
+ const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(",");
1838
+ const signedRequest = await signer.sign(httpRequest, {
1839
+ signingDate: getSkewCorrectedDate(config.systemClockOffset),
1840
+ signingRegion: multiRegionOverride,
1841
+ signingService: signingName
1842
+ });
1843
+ return signedRequest;
1844
+ }
1845
+ };
1846
+
1847
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js
1848
+ var getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : [];
1849
+
1850
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js
1851
+ var getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`;
1852
+
1853
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js
1854
+ var NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE";
1855
+ var NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference";
1856
+ var NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {
1857
+ environmentVariableSelector: (env2, options) => {
1858
+ if (options == null ? void 0 : options.signingName) {
1859
+ const bearerTokenKey = getBearerTokenEnvKey(options.signingName);
1860
+ if (bearerTokenKey in env2)
1861
+ return ["httpBearerAuth"];
1862
+ }
1863
+ if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env2))
1864
+ return void 0;
1865
+ return getArrayForCommaSeparatedString(env2[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);
1866
+ },
1867
+ configFileSelector: (profile) => {
1868
+ if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile))
1869
+ return void 0;
1870
+ return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);
1871
+ },
1872
+ default: []
1873
+ };
1874
+
1875
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js
1876
+ var resolveAwsSdkSigV4AConfig = (config) => {
1877
+ config.sigv4aSigningRegionSet = normalizeProvider2(config.sigv4aSigningRegionSet);
1878
+ return config;
1879
+ };
1880
+ var NODE_SIGV4A_CONFIG_OPTIONS = {
1881
+ environmentVariableSelector(env2) {
1882
+ if (env2.AWS_SIGV4A_SIGNING_REGION_SET) {
1883
+ return env2.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
1884
+ }
1885
+ throw new ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
1886
+ tryNextLink: true
1887
+ });
1888
+ },
1889
+ configFileSelector(profile) {
1890
+ if (profile.sigv4a_signing_region_set) {
1891
+ return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
1892
+ }
1893
+ throw new ProviderError("sigv4a_signing_region_set not set in profile.", {
1894
+ tryNextLink: true
1895
+ });
1896
+ },
1897
+ default: void 0
1898
+ };
1899
+
1900
+ // ../../node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js
1901
+ var HeaderFormatter = class {
1902
+ format(headers) {
1903
+ const chunks = [];
1904
+ for (const headerName of Object.keys(headers)) {
1905
+ const bytes = fromUtf8(headerName);
1906
+ chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
1907
+ }
1908
+ const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
1909
+ let position = 0;
1910
+ for (const chunk of chunks) {
1911
+ out.set(chunk, position);
1912
+ position += chunk.byteLength;
1913
+ }
1914
+ return out;
1915
+ }
1916
+ formatHeaderValue(header) {
1917
+ switch (header.type) {
1918
+ case "boolean":
1919
+ return Uint8Array.from([header.value ? 0 : 1]);
1920
+ case "byte":
1921
+ return Uint8Array.from([2, header.value]);
1922
+ case "short":
1923
+ const shortView = new DataView(new ArrayBuffer(3));
1924
+ shortView.setUint8(0, 3);
1925
+ shortView.setInt16(1, header.value, false);
1926
+ return new Uint8Array(shortView.buffer);
1927
+ case "integer":
1928
+ const intView = new DataView(new ArrayBuffer(5));
1929
+ intView.setUint8(0, 4);
1930
+ intView.setInt32(1, header.value, false);
1931
+ return new Uint8Array(intView.buffer);
1932
+ case "long":
1933
+ const longBytes = new Uint8Array(9);
1934
+ longBytes[0] = 5;
1935
+ longBytes.set(header.value.bytes, 1);
1936
+ return longBytes;
1937
+ case "binary":
1938
+ const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
1939
+ binView.setUint8(0, 6);
1940
+ binView.setUint16(1, header.value.byteLength, false);
1941
+ const binBytes = new Uint8Array(binView.buffer);
1942
+ binBytes.set(header.value, 3);
1943
+ return binBytes;
1944
+ case "string":
1945
+ const utf8Bytes = fromUtf8(header.value);
1946
+ const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
1947
+ strView.setUint8(0, 7);
1948
+ strView.setUint16(1, utf8Bytes.byteLength, false);
1949
+ const strBytes = new Uint8Array(strView.buffer);
1950
+ strBytes.set(utf8Bytes, 3);
1951
+ return strBytes;
1952
+ case "timestamp":
1953
+ const tsBytes = new Uint8Array(9);
1954
+ tsBytes[0] = 8;
1955
+ tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
1956
+ return tsBytes;
1957
+ case "uuid":
1958
+ if (!UUID_PATTERN.test(header.value)) {
1959
+ throw new Error(`Invalid UUID received: ${header.value}`);
1960
+ }
1961
+ const uuidBytes = new Uint8Array(17);
1962
+ uuidBytes[0] = 9;
1963
+ uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
1964
+ return uuidBytes;
1965
+ }
1966
+ }
1967
+ };
1968
+ var HEADER_VALUE_TYPE;
1969
+ (function(HEADER_VALUE_TYPE2) {
1970
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolTrue"] = 0] = "boolTrue";
1971
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolFalse"] = 1] = "boolFalse";
1972
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byte"] = 2] = "byte";
1973
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["short"] = 3] = "short";
1974
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["integer"] = 4] = "integer";
1975
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["long"] = 5] = "long";
1976
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byteArray"] = 6] = "byteArray";
1977
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["string"] = 7] = "string";
1978
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["timestamp"] = 8] = "timestamp";
1979
+ HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["uuid"] = 9] = "uuid";
1980
+ })(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));
1981
+ var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
1982
+ var Int64 = class _Int64 {
1983
+ bytes;
1984
+ constructor(bytes) {
1985
+ this.bytes = bytes;
1986
+ if (bytes.byteLength !== 8) {
1987
+ throw new Error("Int64 buffers must be exactly 8 bytes");
1988
+ }
1989
+ }
1990
+ static fromNumber(number) {
1991
+ if (number > 9223372036854776e3 || number < -9223372036854776e3) {
1992
+ throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
1993
+ }
1994
+ const bytes = new Uint8Array(8);
1995
+ for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {
1996
+ bytes[i] = remaining;
1997
+ }
1998
+ if (number < 0) {
1999
+ negate(bytes);
2000
+ }
2001
+ return new _Int64(bytes);
2002
+ }
2003
+ valueOf() {
2004
+ const bytes = this.bytes.slice(0);
2005
+ const negative = bytes[0] & 128;
2006
+ if (negative) {
2007
+ negate(bytes);
2008
+ }
2009
+ return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
2010
+ }
2011
+ toString() {
2012
+ return String(this.valueOf());
2013
+ }
2014
+ };
2015
+ function negate(bytes) {
2016
+ for (let i = 0; i < 8; i++) {
2017
+ bytes[i] ^= 255;
2018
+ }
2019
+ for (let i = 7; i > -1; i--) {
2020
+ bytes[i]++;
2021
+ if (bytes[i] !== 0)
2022
+ break;
2023
+ }
2024
+ }
2025
+
2026
+ // ../../node_modules/@smithy/signature-v4/dist-es/constants.js
2027
+ var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
2028
+ var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
2029
+ var AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
2030
+ var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
2031
+ var EXPIRES_QUERY_PARAM = "X-Amz-Expires";
2032
+ var SIGNATURE_QUERY_PARAM = "X-Amz-Signature";
2033
+ var TOKEN_QUERY_PARAM = "X-Amz-Security-Token";
2034
+ var AUTH_HEADER = "authorization";
2035
+ var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();
2036
+ var DATE_HEADER = "date";
2037
+ var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];
2038
+ var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();
2039
+ var SHA256_HEADER = "x-amz-content-sha256";
2040
+ var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();
2041
+ var ALWAYS_UNSIGNABLE_HEADERS = {
2042
+ authorization: true,
2043
+ "cache-control": true,
2044
+ connection: true,
2045
+ expect: true,
2046
+ from: true,
2047
+ "keep-alive": true,
2048
+ "max-forwards": true,
2049
+ pragma: true,
2050
+ referer: true,
2051
+ te: true,
2052
+ trailer: true,
2053
+ "transfer-encoding": true,
2054
+ upgrade: true,
2055
+ "user-agent": true,
2056
+ "x-amzn-trace-id": true
2057
+ };
2058
+ var PROXY_HEADER_PATTERN = /^proxy-/;
2059
+ var SEC_HEADER_PATTERN = /^sec-/;
2060
+ var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
2061
+ var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD";
2062
+ var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
2063
+ var MAX_CACHE_SIZE = 50;
2064
+ var KEY_TYPE_IDENTIFIER = "aws4_request";
2065
+ var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;
2066
+
2067
+ // ../../node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js
2068
+ var getCanonicalQuery = ({ query = {} }) => {
2069
+ const keys = [];
2070
+ const serialized = {};
2071
+ for (const key of Object.keys(query)) {
2072
+ if (key.toLowerCase() === SIGNATURE_HEADER) {
2073
+ continue;
2074
+ }
2075
+ const encodedKey = escapeUri(key);
2076
+ keys.push(encodedKey);
2077
+ const value = query[key];
2078
+ if (typeof value === "string") {
2079
+ serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`;
2080
+ } else if (Array.isArray(value)) {
2081
+ serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${escapeUri(value2)}`]), []).sort().join("&");
2082
+ }
2083
+ }
2084
+ return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&");
2085
+ };
2086
+
2087
+ // ../../node_modules/@smithy/signature-v4/dist-es/utilDate.js
2088
+ var iso8601 = (time) => toDate(time).toISOString().replace(/\.\d{3}Z$/, "Z");
2089
+ var toDate = (time) => {
2090
+ if (typeof time === "number") {
2091
+ return new Date(time * 1e3);
2092
+ }
2093
+ if (typeof time === "string") {
2094
+ if (Number(time)) {
2095
+ return new Date(Number(time) * 1e3);
2096
+ }
2097
+ return new Date(time);
2098
+ }
2099
+ return time;
2100
+ };
2101
+
2102
+ // ../../node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js
2103
+ var SignatureV4Base = class {
2104
+ service;
2105
+ regionProvider;
2106
+ credentialProvider;
2107
+ sha256;
2108
+ uriEscapePath;
2109
+ applyChecksum;
2110
+ constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) {
2111
+ this.service = service;
2112
+ this.sha256 = sha256;
2113
+ this.uriEscapePath = uriEscapePath;
2114
+ this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true;
2115
+ this.regionProvider = normalizeProvider(region);
2116
+ this.credentialProvider = normalizeProvider(credentials);
2117
+ }
2118
+ createCanonicalRequest(request, canonicalHeaders, payloadHash) {
2119
+ const sortedHeaders = Object.keys(canonicalHeaders).sort();
2120
+ return `${request.method}
2121
+ ${this.getCanonicalPath(request)}
2122
+ ${getCanonicalQuery(request)}
2123
+ ${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")}
2124
+
2125
+ ${sortedHeaders.join(";")}
2126
+ ${payloadHash}`;
2127
+ }
2128
+ async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) {
2129
+ const hash = new this.sha256();
2130
+ hash.update(toUint8Array(canonicalRequest));
2131
+ const hashedRequest = await hash.digest();
2132
+ return `${algorithmIdentifier}
2133
+ ${longDate}
2134
+ ${credentialScope}
2135
+ ${toHex(hashedRequest)}`;
2136
+ }
2137
+ getCanonicalPath({ path }) {
2138
+ if (this.uriEscapePath) {
2139
+ const normalizedPathSegments = [];
2140
+ for (const pathSegment of path.split("/")) {
2141
+ if ((pathSegment == null ? void 0 : pathSegment.length) === 0)
2142
+ continue;
2143
+ if (pathSegment === ".")
2144
+ continue;
2145
+ if (pathSegment === "..") {
2146
+ normalizedPathSegments.pop();
2147
+ } else {
2148
+ normalizedPathSegments.push(pathSegment);
2149
+ }
2150
+ }
2151
+ const normalizedPath = `${(path == null ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path == null ? void 0 : path.endsWith("/")) ? "/" : ""}`;
2152
+ const doubleEncoded = escapeUri(normalizedPath);
2153
+ return doubleEncoded.replace(/%2F/g, "/");
2154
+ }
2155
+ return path;
2156
+ }
2157
+ validateResolvedCredentials(credentials) {
2158
+ if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
2159
+ throw new Error("Resolved credential object is not valid");
2160
+ }
2161
+ }
2162
+ formatDate(now) {
2163
+ const longDate = iso8601(now).replace(/[\-:]/g, "");
2164
+ return {
2165
+ longDate,
2166
+ shortDate: longDate.slice(0, 8)
2167
+ };
2168
+ }
2169
+ getCanonicalHeaderList(headers) {
2170
+ return Object.keys(headers).sort().join(";");
2171
+ }
2172
+ };
2173
+
2174
+ // ../../node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js
2175
+ var signingKeyCache = {};
2176
+ var cacheQueue = [];
2177
+ var createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`;
2178
+ var getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => {
2179
+ const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);
2180
+ const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`;
2181
+ if (cacheKey in signingKeyCache) {
2182
+ return signingKeyCache[cacheKey];
2183
+ }
2184
+ cacheQueue.push(cacheKey);
2185
+ while (cacheQueue.length > MAX_CACHE_SIZE) {
2186
+ delete signingKeyCache[cacheQueue.shift()];
2187
+ }
2188
+ let key = `AWS4${credentials.secretAccessKey}`;
2189
+ for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {
2190
+ key = await hmac(sha256Constructor, key, signable);
2191
+ }
2192
+ return signingKeyCache[cacheKey] = key;
2193
+ };
2194
+ var hmac = (ctor, secret, data) => {
2195
+ const hash = new ctor(secret);
2196
+ hash.update(toUint8Array(data));
2197
+ return hash.digest();
2198
+ };
2199
+
2200
+ // ../../node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js
2201
+ var getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => {
2202
+ const canonical = {};
2203
+ for (const headerName of Object.keys(headers).sort()) {
2204
+ if (headers[headerName] == void 0) {
2205
+ continue;
2206
+ }
2207
+ const canonicalHeaderName = headerName.toLowerCase();
2208
+ if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || (unsignableHeaders == null ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) {
2209
+ if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) {
2210
+ continue;
2211
+ }
2212
+ }
2213
+ canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " ");
2214
+ }
2215
+ return canonical;
2216
+ };
2217
+
2218
+ // ../../node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js
2219
+ var getPayloadHash = async ({ headers, body }, hashConstructor) => {
2220
+ for (const headerName of Object.keys(headers)) {
2221
+ if (headerName.toLowerCase() === SHA256_HEADER) {
2222
+ return headers[headerName];
2223
+ }
2224
+ }
2225
+ if (body == void 0) {
2226
+ return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
2227
+ } else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {
2228
+ const hashCtor = new hashConstructor();
2229
+ hashCtor.update(toUint8Array(body));
2230
+ return toHex(await hashCtor.digest());
2231
+ }
2232
+ return UNSIGNED_PAYLOAD;
2233
+ };
2234
+
2235
+ // ../../node_modules/@smithy/signature-v4/dist-es/headerUtil.js
2236
+ var hasHeader = (soughtHeader, headers) => {
2237
+ soughtHeader = soughtHeader.toLowerCase();
2238
+ for (const headerName of Object.keys(headers)) {
2239
+ if (soughtHeader === headerName.toLowerCase()) {
2240
+ return true;
2241
+ }
2242
+ }
2243
+ return false;
2244
+ };
2245
+
2246
+ // ../../node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js
2247
+ var moveHeadersToQuery = (request, options = {}) => {
2248
+ var _a4, _b;
2249
+ const { headers, query = {} } = HttpRequest.clone(request);
2250
+ for (const name of Object.keys(headers)) {
2251
+ const lname = name.toLowerCase();
2252
+ if (lname.slice(0, 6) === "x-amz-" && !((_a4 = options.unhoistableHeaders) == null ? void 0 : _a4.has(lname)) || ((_b = options.hoistableHeaders) == null ? void 0 : _b.has(lname))) {
2253
+ query[name] = headers[name];
2254
+ delete headers[name];
2255
+ }
2256
+ }
2257
+ return {
2258
+ ...request,
2259
+ headers,
2260
+ query
2261
+ };
2262
+ };
2263
+
2264
+ // ../../node_modules/@smithy/signature-v4/dist-es/prepareRequest.js
2265
+ var prepareRequest = (request) => {
2266
+ request = HttpRequest.clone(request);
2267
+ for (const headerName of Object.keys(request.headers)) {
2268
+ if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
2269
+ delete request.headers[headerName];
2270
+ }
2271
+ }
2272
+ return request;
2273
+ };
2274
+
2275
+ // ../../node_modules/@smithy/signature-v4/dist-es/SignatureV4.js
2276
+ var SignatureV4 = class extends SignatureV4Base {
2277
+ headerFormatter = new HeaderFormatter();
2278
+ constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) {
2279
+ super({
2280
+ applyChecksum,
2281
+ credentials,
2282
+ region,
2283
+ service,
2284
+ sha256,
2285
+ uriEscapePath
2286
+ });
2287
+ }
2288
+ async presign(originalRequest, options = {}) {
2289
+ const { signingDate = /* @__PURE__ */ new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService } = options;
2290
+ const credentials = await this.credentialProvider();
2291
+ this.validateResolvedCredentials(credentials);
2292
+ const region = signingRegion ?? await this.regionProvider();
2293
+ const { longDate, shortDate } = this.formatDate(signingDate);
2294
+ if (expiresIn > MAX_PRESIGNED_TTL) {
2295
+ return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");
2296
+ }
2297
+ const scope = createScope(shortDate, region, signingService ?? this.service);
2298
+ const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders });
2299
+ if (credentials.sessionToken) {
2300
+ request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;
2301
+ }
2302
+ request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;
2303
+ request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;
2304
+ request.query[AMZ_DATE_QUERY_PARAM] = longDate;
2305
+ request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);
2306
+ const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
2307
+ request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders);
2308
+ request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256)));
2309
+ return request;
2310
+ }
2311
+ async sign(toSign, options) {
2312
+ if (typeof toSign === "string") {
2313
+ return this.signString(toSign, options);
2314
+ } else if (toSign.headers && toSign.payload) {
2315
+ return this.signEvent(toSign, options);
2316
+ } else if (toSign.message) {
2317
+ return this.signMessage(toSign, options);
2318
+ } else {
2319
+ return this.signRequest(toSign, options);
2320
+ }
2321
+ }
2322
+ async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService, eventStreamCredentials }) {
2323
+ const region = signingRegion ?? await this.regionProvider();
2324
+ const { shortDate, longDate } = this.formatDate(signingDate);
2325
+ const scope = createScope(shortDate, region, signingService ?? this.service);
2326
+ const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256);
2327
+ const hash = new this.sha256();
2328
+ hash.update(headers);
2329
+ const hashedHeaders = toHex(await hash.digest());
2330
+ const stringToSign = [
2331
+ EVENT_ALGORITHM_IDENTIFIER,
2332
+ longDate,
2333
+ scope,
2334
+ priorSignature,
2335
+ hashedHeaders,
2336
+ hashedPayload
2337
+ ].join("\n");
2338
+ return this.signString(stringToSign, {
2339
+ signingDate,
2340
+ signingRegion: region,
2341
+ signingService,
2342
+ eventStreamCredentials
2343
+ });
2344
+ }
2345
+ async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService, eventStreamCredentials }) {
2346
+ const promise = this.signEvent({
2347
+ headers: this.headerFormatter.format(signableMessage.message.headers),
2348
+ payload: signableMessage.message.body
2349
+ }, {
2350
+ signingDate,
2351
+ signingRegion,
2352
+ signingService,
2353
+ priorSignature: signableMessage.priorSignature,
2354
+ eventStreamCredentials
2355
+ });
2356
+ return promise.then((signature) => {
2357
+ return { message: signableMessage.message, signature };
2358
+ });
2359
+ }
2360
+ async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService, eventStreamCredentials } = {}) {
2361
+ const credentials = eventStreamCredentials ?? await this.credentialProvider();
2362
+ this.validateResolvedCredentials(credentials);
2363
+ const region = signingRegion ?? await this.regionProvider();
2364
+ const { shortDate } = this.formatDate(signingDate);
2365
+ const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
2366
+ hash.update(toUint8Array(stringToSign));
2367
+ return toHex(await hash.digest());
2368
+ }
2369
+ async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) {
2370
+ const credentials = await this.credentialProvider();
2371
+ this.validateResolvedCredentials(credentials);
2372
+ const region = signingRegion ?? await this.regionProvider();
2373
+ const request = prepareRequest(requestToSign);
2374
+ const { longDate, shortDate } = this.formatDate(signingDate);
2375
+ const scope = createScope(shortDate, region, signingService ?? this.service);
2376
+ request.headers[AMZ_DATE_HEADER] = longDate;
2377
+ if (credentials.sessionToken) {
2378
+ request.headers[TOKEN_HEADER] = credentials.sessionToken;
2379
+ }
2380
+ const payloadHash = await getPayloadHash(request, this.sha256);
2381
+ if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {
2382
+ request.headers[SHA256_HEADER] = payloadHash;
2383
+ }
2384
+ const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
2385
+ const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash));
2386
+ request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`;
2387
+ return request;
2388
+ }
2389
+ async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {
2390
+ const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER);
2391
+ const hash = new this.sha256(await keyPromise);
2392
+ hash.update(toUint8Array(stringToSign));
2393
+ return toHex(await hash.digest());
2394
+ }
2395
+ getSigningKey(credentials, region, shortDate, service) {
2396
+ return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);
2397
+ }
2398
+ };
2399
+
2400
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js
2401
+ var resolveAwsSdkSigV4Config = (config) => {
2402
+ let inputCredentials = config.credentials;
2403
+ let isUserSupplied = !!config.credentials;
2404
+ let resolvedCredentials = void 0;
2405
+ Object.defineProperty(config, "credentials", {
2406
+ set(credentials) {
2407
+ if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) {
2408
+ isUserSupplied = true;
2409
+ }
2410
+ inputCredentials = credentials;
2411
+ const memoizedProvider = normalizeCredentialProvider(config, {
2412
+ credentials: inputCredentials,
2413
+ credentialDefaultProvider: config.credentialDefaultProvider
2414
+ });
2415
+ const boundProvider = bindCallerConfig(config, memoizedProvider);
2416
+ if (isUserSupplied && !boundProvider.attributed) {
2417
+ const isCredentialObject = typeof inputCredentials === "object" && inputCredentials !== null;
2418
+ resolvedCredentials = async (options) => {
2419
+ const creds = await boundProvider(options);
2420
+ const attributedCreds = creds;
2421
+ if (isCredentialObject && (!attributedCreds.$source || Object.keys(attributedCreds.$source).length === 0)) {
2422
+ return setCredentialFeature(attributedCreds, "CREDENTIALS_CODE", "e");
2423
+ }
2424
+ return attributedCreds;
2425
+ };
2426
+ resolvedCredentials.memoized = boundProvider.memoized;
2427
+ resolvedCredentials.configBound = boundProvider.configBound;
2428
+ resolvedCredentials.attributed = true;
2429
+ } else {
2430
+ resolvedCredentials = boundProvider;
2431
+ }
2432
+ },
2433
+ get() {
2434
+ return resolvedCredentials;
2435
+ },
2436
+ enumerable: true,
2437
+ configurable: true
2438
+ });
2439
+ config.credentials = inputCredentials;
2440
+ const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config;
2441
+ let signer;
2442
+ if (config.signer) {
2443
+ signer = normalizeProvider2(config.signer);
2444
+ } else if (config.regionInfoProvider) {
2445
+ signer = () => normalizeProvider2(config.region)().then(async (region) => [
2446
+ await config.regionInfoProvider(region, {
2447
+ useFipsEndpoint: await config.useFipsEndpoint(),
2448
+ useDualstackEndpoint: await config.useDualstackEndpoint()
2449
+ }) || {},
2450
+ region
2451
+ ]).then(([regionInfo, region]) => {
2452
+ const { signingRegion, signingService } = regionInfo;
2453
+ config.signingRegion = config.signingRegion || signingRegion || region;
2454
+ config.signingName = config.signingName || signingService || config.serviceId;
2455
+ const params = {
2456
+ ...config,
2457
+ credentials: config.credentials,
2458
+ region: config.signingRegion,
2459
+ service: config.signingName,
2460
+ sha256,
2461
+ uriEscapePath: signingEscapePath
2462
+ };
2463
+ const SignerCtor = config.signerConstructor || SignatureV4;
2464
+ return new SignerCtor(params);
2465
+ });
2466
+ } else {
2467
+ signer = async (authScheme) => {
2468
+ authScheme = Object.assign({}, {
2469
+ name: "sigv4",
2470
+ signingName: config.signingName || config.defaultSigningName,
2471
+ signingRegion: await normalizeProvider2(config.region)(),
2472
+ properties: {}
2473
+ }, authScheme);
2474
+ const signingRegion = authScheme.signingRegion;
2475
+ const signingService = authScheme.signingName;
2476
+ config.signingRegion = config.signingRegion || signingRegion;
2477
+ config.signingName = config.signingName || signingService || config.serviceId;
2478
+ const params = {
2479
+ ...config,
2480
+ credentials: config.credentials,
2481
+ region: config.signingRegion,
2482
+ service: config.signingName,
2483
+ sha256,
2484
+ uriEscapePath: signingEscapePath
2485
+ };
2486
+ const SignerCtor = config.signerConstructor || SignatureV4;
2487
+ return new SignerCtor(params);
2488
+ };
2489
+ }
2490
+ const resolvedConfig = Object.assign(config, {
2491
+ systemClockOffset,
2492
+ signingEscapePath,
2493
+ signer
2494
+ });
2495
+ return resolvedConfig;
2496
+ };
2497
+ function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider }) {
2498
+ let credentialsProvider;
2499
+ if (credentials) {
2500
+ if (!(credentials == null ? void 0 : credentials.memoized)) {
2501
+ credentialsProvider = memoizeIdentityProvider(credentials, isIdentityExpired, doesIdentityRequireRefresh);
2502
+ } else {
2503
+ credentialsProvider = credentials;
2504
+ }
2505
+ } else {
2506
+ if (credentialDefaultProvider) {
2507
+ credentialsProvider = normalizeProvider2(credentialDefaultProvider(Object.assign({}, config, {
2508
+ parentClientConfig: config
2509
+ })));
2510
+ } else {
2511
+ credentialsProvider = async () => {
2512
+ throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.");
2513
+ };
2514
+ }
2515
+ }
2516
+ credentialsProvider.memoized = true;
2517
+ return credentialsProvider;
2518
+ }
2519
+ function bindCallerConfig(config, credentialsProvider) {
2520
+ if (credentialsProvider.configBound) {
2521
+ return credentialsProvider;
2522
+ }
2523
+ const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config });
2524
+ fn.memoized = credentialsProvider.memoized;
2525
+ fn.configBound = true;
2526
+ return fn;
2527
+ }
2528
+
2529
+ // ../../node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js
2530
+ import { Writable } from "stream";
2531
+ var Collector = class extends Writable {
2532
+ bufferedBytes = [];
2533
+ _write(chunk, encoding, callback) {
2534
+ this.bufferedBytes.push(chunk);
2535
+ callback();
2536
+ }
2537
+ };
2538
+
2539
+ // ../../node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js
2540
+ var streamCollector = (stream) => {
2541
+ if (isReadableStreamInstance(stream)) {
2542
+ return collectReadableStream(stream);
2543
+ }
2544
+ return new Promise((resolve, reject) => {
2545
+ const collector = new Collector();
2546
+ stream.pipe(collector);
2547
+ stream.on("error", (err) => {
2548
+ collector.end();
2549
+ reject(err);
2550
+ });
2551
+ collector.on("error", reject);
2552
+ collector.on("finish", function() {
2553
+ const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
2554
+ resolve(bytes);
2555
+ });
2556
+ });
2557
+ };
2558
+ var isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
2559
+ async function collectReadableStream(stream) {
2560
+ const chunks = [];
2561
+ const reader = stream.getReader();
2562
+ let isDone = false;
2563
+ let length = 0;
2564
+ while (!isDone) {
2565
+ const { done, value } = await reader.read();
2566
+ if (value) {
2567
+ chunks.push(value);
2568
+ length += value.length;
2569
+ }
2570
+ isDone = done;
2571
+ }
2572
+ const collected = new Uint8Array(length);
2573
+ let offset = 0;
2574
+ for (const chunk of chunks) {
2575
+ collected.set(chunk, offset);
2576
+ offset += chunk.length;
2577
+ }
2578
+ return collected;
2579
+ }
2580
+
2581
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js
2582
+ import { platform, release } from "os";
2583
+ import { env } from "process";
2584
+
2585
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/getRuntimeUserAgentPair.js
2586
+ import { versions } from "process";
2587
+ var getRuntimeUserAgentPair = () => {
2588
+ const runtimesToCheck = ["deno", "bun", "llrt"];
2589
+ for (const runtime of runtimesToCheck) {
2590
+ if (versions[runtime]) {
2591
+ return [`md/${runtime}`, versions[runtime]];
2592
+ }
2593
+ }
2594
+ return ["md/nodejs", versions.node];
2595
+ };
2596
+
2597
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js
2598
+ import { readFile } from "fs/promises";
2599
+ import { join } from "path";
2600
+
2601
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js
2602
+ import { normalize, sep } from "path";
2603
+ var getNodeModulesParentDirs = (dirname) => {
2604
+ const cwd = process.cwd();
2605
+ if (!dirname) {
2606
+ return [cwd];
2607
+ }
2608
+ const normalizedPath = normalize(dirname);
2609
+ const parts = normalizedPath.split(sep);
2610
+ const nodeModulesIndex = parts.indexOf("node_modules");
2611
+ const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep) : normalizedPath;
2612
+ if (cwd === parentDir) {
2613
+ return [cwd];
2614
+ }
2615
+ return [parentDir, cwd];
2616
+ };
2617
+
2618
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedTypeScriptVersion.js
2619
+ var SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
2620
+ var getSanitizedTypeScriptVersion = (version = "") => {
2621
+ const match = version.match(SEMVER_REGEX);
2622
+ if (!match) {
2623
+ return void 0;
2624
+ }
2625
+ const [major, minor, patch, prerelease] = [match[1], match[2], match[3], match[4]];
2626
+ return prerelease ? `${major}.${minor}.${patch}-${prerelease}` : `${major}.${minor}.${patch}`;
2627
+ };
2628
+
2629
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedDevTypeScriptVersion.js
2630
+ var ALLOWED_PREFIXES = ["^", "~", ">=", "<=", ">", "<"];
2631
+ var ALLOWED_DIST_TAGS = ["latest", "beta", "dev", "rc", "insiders", "next"];
2632
+ var getSanitizedDevTypeScriptVersion = (version = "") => {
2633
+ if (ALLOWED_DIST_TAGS.includes(version)) {
2634
+ return version;
2635
+ }
2636
+ const prefix = ALLOWED_PREFIXES.find((p) => version.startsWith(p)) ?? "";
2637
+ const sanitizedTypeScriptVersion = getSanitizedTypeScriptVersion(version.slice(prefix.length));
2638
+ if (!sanitizedTypeScriptVersion) {
2639
+ return void 0;
2640
+ }
2641
+ return `${prefix}${sanitizedTypeScriptVersion}`;
2642
+ };
2643
+
2644
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js
2645
+ var tscVersion;
2646
+ var TS_PACKAGE_JSON = join("node_modules", "typescript", "package.json");
2647
+ var getTypeScriptUserAgentPair = async () => {
2648
+ if (tscVersion === null) {
2649
+ return void 0;
2650
+ } else if (typeof tscVersion === "string") {
2651
+ return ["md/tsc", tscVersion];
2652
+ }
2653
+ let isTypeScriptDetectionDisabled = false;
2654
+ try {
2655
+ isTypeScriptDetectionDisabled = booleanSelector(process.env, "AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED", SelectorType.ENV) || false;
2656
+ } catch {
2657
+ }
2658
+ if (isTypeScriptDetectionDisabled) {
2659
+ tscVersion = null;
2660
+ return void 0;
2661
+ }
2662
+ const dirname = typeof __dirname !== "undefined" ? __dirname : void 0;
2663
+ const nodeModulesParentDirs = getNodeModulesParentDirs(dirname);
2664
+ let versionFromApp;
2665
+ for (const nodeModulesParentDir of nodeModulesParentDirs) {
2666
+ try {
2667
+ const appPackageJsonPath = join(nodeModulesParentDir, "package.json");
2668
+ const packageJson = await readFile(appPackageJsonPath, "utf-8");
2669
+ const { dependencies, devDependencies } = JSON.parse(packageJson);
2670
+ const version = (devDependencies == null ? void 0 : devDependencies.typescript) ?? (dependencies == null ? void 0 : dependencies.typescript);
2671
+ if (typeof version !== "string") {
2672
+ continue;
2673
+ }
2674
+ versionFromApp = version;
2675
+ break;
2676
+ } catch {
2677
+ }
2678
+ }
2679
+ if (!versionFromApp) {
2680
+ tscVersion = null;
2681
+ return void 0;
2682
+ }
2683
+ let versionFromNodeModules;
2684
+ for (const nodeModulesParentDir of nodeModulesParentDirs) {
2685
+ try {
2686
+ const tsPackageJsonPath = join(nodeModulesParentDir, TS_PACKAGE_JSON);
2687
+ const packageJson = await readFile(tsPackageJsonPath, "utf-8");
2688
+ const { version } = JSON.parse(packageJson);
2689
+ const sanitizedVersion2 = getSanitizedTypeScriptVersion(version);
2690
+ if (typeof sanitizedVersion2 !== "string") {
2691
+ continue;
2692
+ }
2693
+ versionFromNodeModules = sanitizedVersion2;
2694
+ break;
2695
+ } catch {
2696
+ }
2697
+ }
2698
+ if (versionFromNodeModules) {
2699
+ tscVersion = versionFromNodeModules;
2700
+ return ["md/tsc", tscVersion];
2701
+ }
2702
+ const sanitizedVersion = getSanitizedDevTypeScriptVersion(versionFromApp);
2703
+ if (typeof sanitizedVersion !== "string") {
2704
+ tscVersion = null;
2705
+ return void 0;
2706
+ }
2707
+ tscVersion = `dev_${sanitizedVersion}`;
2708
+ return ["md/tsc", tscVersion];
2709
+ };
2710
+
2711
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js
2712
+ var crtAvailability = {
2713
+ isCrtAvailable: false
2714
+ };
2715
+
2716
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js
2717
+ var isCrtAvailable = () => {
2718
+ if (crtAvailability.isCrtAvailable) {
2719
+ return ["md/crt-avail"];
2720
+ }
2721
+ return null;
2722
+ };
2723
+
2724
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js
2725
+ var createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
2726
+ const runtimeUserAgentPair = getRuntimeUserAgentPair();
2727
+ return async (config) => {
2728
+ var _a4;
2729
+ const sections = [
2730
+ ["aws-sdk-js", clientVersion],
2731
+ ["ua", "2.1"],
2732
+ [`os/${platform()}`, release()],
2733
+ ["lang/js"],
2734
+ runtimeUserAgentPair
2735
+ ];
2736
+ const typescriptUserAgentPair = await getTypeScriptUserAgentPair();
2737
+ if (typescriptUserAgentPair) {
2738
+ sections.push(typescriptUserAgentPair);
2739
+ }
2740
+ const crtAvailable = isCrtAvailable();
2741
+ if (crtAvailable) {
2742
+ sections.push(crtAvailable);
2743
+ }
2744
+ if (serviceId) {
2745
+ sections.push([`api/${serviceId}`, clientVersion]);
2746
+ }
2747
+ if (env.AWS_EXECUTION_ENV) {
2748
+ sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]);
2749
+ }
2750
+ const appId = await ((_a4 = config == null ? void 0 : config.userAgentAppId) == null ? void 0 : _a4.call(config));
2751
+ const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
2752
+ return resolvedUserAgent;
2753
+ };
2754
+ };
2755
+
2756
+ // ../../node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js
2757
+ var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
2758
+ var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
2759
+ var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
2760
+ var NODE_APP_ID_CONFIG_OPTIONS = {
2761
+ environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME],
2762
+ configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED],
2763
+ default: DEFAULT_UA_APP_ID
2764
+ };
2765
+
2766
+ // ../../node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js
2767
+ var getAwsRegionExtensionConfiguration = (runtimeConfig) => {
2768
+ return {
2769
+ setRegion(region) {
2770
+ runtimeConfig.region = region;
2771
+ },
2772
+ region() {
2773
+ return runtimeConfig.region;
2774
+ }
2775
+ };
2776
+ };
2777
+ var resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => {
2778
+ return {
2779
+ region: awsRegionExtensionConfiguration.region()
2780
+ };
2781
+ };
2782
+
2783
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js
2784
+ var ProtocolLib = class {
2785
+ queryCompat;
2786
+ errorRegistry;
2787
+ constructor(queryCompat = false) {
2788
+ this.queryCompat = queryCompat;
2789
+ }
2790
+ resolveRestContentType(defaultContentType, inputSchema) {
2791
+ const members = inputSchema.getMemberSchemas();
2792
+ const httpPayloadMember = Object.values(members).find((m) => {
2793
+ return !!m.getMergedTraits().httpPayload;
2794
+ });
2795
+ if (httpPayloadMember) {
2796
+ const mediaType = httpPayloadMember.getMergedTraits().mediaType;
2797
+ if (mediaType) {
2798
+ return mediaType;
2799
+ } else if (httpPayloadMember.isStringSchema()) {
2800
+ return "text/plain";
2801
+ } else if (httpPayloadMember.isBlobSchema()) {
2802
+ return "application/octet-stream";
2803
+ } else {
2804
+ return defaultContentType;
2805
+ }
2806
+ } else if (!inputSchema.isUnitSchema()) {
2807
+ const hasBody = Object.values(members).find((m) => {
2808
+ const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m.getMergedTraits();
2809
+ const noPrefixHeaders = httpPrefixHeaders === void 0;
2810
+ return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders;
2811
+ });
2812
+ if (hasBody) {
2813
+ return defaultContentType;
2814
+ }
2815
+ }
2816
+ }
2817
+ async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) {
2818
+ var _a4, _b;
2819
+ let errorName = errorIdentifier;
2820
+ if (errorIdentifier.includes("#")) {
2821
+ [, errorName] = errorIdentifier.split("#");
2822
+ }
2823
+ const errorMetadata = {
2824
+ $metadata: metadata,
2825
+ $fault: response.statusCode < 500 ? "client" : "server"
2826
+ };
2827
+ if (!this.errorRegistry) {
2828
+ throw new Error("@aws-sdk/core/protocols - error handler not initialized.");
2829
+ }
2830
+ try {
2831
+ const errorSchema = (getErrorSchema == null ? void 0 : getErrorSchema(this.errorRegistry, errorName)) ?? this.errorRegistry.getSchema(errorIdentifier);
2832
+ return { errorSchema, errorMetadata };
2833
+ } catch (e) {
2834
+ dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError";
2835
+ const synthetic = this.errorRegistry;
2836
+ const baseExceptionSchema = synthetic.getBaseException();
2837
+ if (baseExceptionSchema) {
2838
+ const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;
2839
+ throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject);
2840
+ }
2841
+ const d = dataObject;
2842
+ const message = (d == null ? void 0 : d.message) ?? (d == null ? void 0 : d.Message) ?? ((_a4 = d == null ? void 0 : d.Error) == null ? void 0 : _a4.Message) ?? ((_b = d == null ? void 0 : d.Error) == null ? void 0 : _b.message);
2843
+ throw this.decorateServiceException(Object.assign(new Error(message), {
2844
+ name: errorName
2845
+ }, errorMetadata), dataObject);
2846
+ }
2847
+ }
2848
+ compose(composite, errorIdentifier, defaultNamespace) {
2849
+ let namespace = defaultNamespace;
2850
+ if (errorIdentifier.includes("#")) {
2851
+ [namespace] = errorIdentifier.split("#");
2852
+ }
2853
+ const staticRegistry = TypeRegistry.for(namespace);
2854
+ const defaultSyntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + defaultNamespace);
2855
+ composite.copyFrom(staticRegistry);
2856
+ composite.copyFrom(defaultSyntheticRegistry);
2857
+ this.errorRegistry = composite;
2858
+ }
2859
+ decorateServiceException(exception, additions = {}) {
2860
+ var _a4, _b, _c, _d;
2861
+ if (this.queryCompat) {
2862
+ const msg = exception.Message ?? additions.Message;
2863
+ const error = decorateServiceException(exception, additions);
2864
+ if (msg) {
2865
+ error.message = msg;
2866
+ }
2867
+ const errorObj = error.Error ?? {};
2868
+ errorObj.Type = (_a4 = error.Error) == null ? void 0 : _a4.Type;
2869
+ errorObj.Code = (_b = error.Error) == null ? void 0 : _b.Code;
2870
+ errorObj.Message = ((_c = error.Error) == null ? void 0 : _c.message) ?? ((_d = error.Error) == null ? void 0 : _d.Message) ?? msg;
2871
+ error.Error = errorObj;
2872
+ const reqId = error.$metadata.requestId;
2873
+ if (reqId) {
2874
+ error.RequestId = reqId;
2875
+ }
2876
+ return error;
2877
+ }
2878
+ return decorateServiceException(exception, additions);
2879
+ }
2880
+ setQueryCompatError(output, response) {
2881
+ var _a4;
2882
+ const queryErrorHeader = (_a4 = response.headers) == null ? void 0 : _a4["x-amzn-query-error"];
2883
+ if (output !== void 0 && queryErrorHeader != null) {
2884
+ const [Code, Type] = queryErrorHeader.split(";");
2885
+ const keys = Object.keys(output);
2886
+ const Error2 = {
2887
+ Code,
2888
+ Type
2889
+ };
2890
+ output.Code = Code;
2891
+ output.Type = Type;
2892
+ for (let i = 0; i < keys.length; i++) {
2893
+ const k = keys[i];
2894
+ Error2[k === "message" ? "Message" : k] = output[k];
2895
+ }
2896
+ delete Error2.__type;
2897
+ output.Error = Error2;
2898
+ }
2899
+ }
2900
+ queryCompatOutput(queryCompatErrorData, errorData) {
2901
+ if (queryCompatErrorData.Error) {
2902
+ errorData.Error = queryCompatErrorData.Error;
2903
+ }
2904
+ if (queryCompatErrorData.Type) {
2905
+ errorData.Type = queryCompatErrorData.Type;
2906
+ }
2907
+ if (queryCompatErrorData.Code) {
2908
+ errorData.Code = queryCompatErrorData.Code;
2909
+ }
2910
+ }
2911
+ findQueryCompatibleError(registry, errorName) {
2912
+ try {
2913
+ return registry.getSchema(errorName);
2914
+ } catch (e) {
2915
+ return registry.find((schema) => {
2916
+ var _a4;
2917
+ return ((_a4 = NormalizedSchema.of(schema).getMergedTraits().awsQueryError) == null ? void 0 : _a4[0]) === errorName;
2918
+ });
2919
+ }
2920
+ }
2921
+ };
2922
+
2923
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js
2924
+ var SerdeContextConfig = class {
2925
+ serdeContext;
2926
+ setSerdeContext(serdeContext) {
2927
+ this.serdeContext = serdeContext;
2928
+ }
2929
+ };
2930
+
2931
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js
2932
+ var UnionSerde = class {
2933
+ from;
2934
+ to;
2935
+ keys;
2936
+ constructor(from, to) {
2937
+ this.from = from;
2938
+ this.to = to;
2939
+ const keys = Object.keys(this.from);
2940
+ const set = new Set(keys);
2941
+ set.delete("__type");
2942
+ this.keys = set;
2943
+ }
2944
+ mark(key) {
2945
+ this.keys.delete(key);
2946
+ }
2947
+ hasUnknown() {
2948
+ return this.keys.size === 1 && Object.keys(this.to).length === 0;
2949
+ }
2950
+ writeUnknown() {
2951
+ if (this.hasUnknown()) {
2952
+ const k = this.keys.values().next().value;
2953
+ const v = this.from[k];
2954
+ this.to.$unknown = [k, v];
2955
+ }
2956
+ }
2957
+ };
2958
+
2959
+ export {
2960
+ getSchemaSerdePlugin,
2961
+ emitWarningIfUnsupportedVersion,
2962
+ DEFAULT_RETRY_MODE,
2963
+ NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
2964
+ resolveRetryConfig,
2965
+ NODE_RETRY_MODE_CONFIG_OPTIONS,
2966
+ getRetryPlugin,
2967
+ setFeature,
2968
+ resolveHostHeaderConfig,
2969
+ getHostHeaderPlugin,
2970
+ getLoggerPlugin,
2971
+ getRecursionDetectionPlugin,
2972
+ SignatureV4,
2973
+ getHttpAuthSchemeEndpointRuleSetPlugin,
2974
+ httpSigningMiddlewareOptions,
2975
+ getHttpSigningPlugin,
2976
+ DefaultIdentityProviderConfig,
2977
+ ProtocolLib,
2978
+ SerdeContextConfig,
2979
+ UnionSerde,
2980
+ resolveUserAgentConfig,
2981
+ awsEndpointFunctions,
2982
+ getUserAgentPlugin,
2983
+ AwsSdkSigV4Signer,
2984
+ AwsSdkSigV4ASigner,
2985
+ NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,
2986
+ resolveAwsSdkSigV4AConfig,
2987
+ NODE_SIGV4A_CONFIG_OPTIONS,
2988
+ resolveAwsSdkSigV4Config,
2989
+ streamCollector,
2990
+ createDefaultUserAgentProvider,
2991
+ NODE_APP_ID_CONFIG_OPTIONS,
2992
+ getAwsRegionExtensionConfiguration,
2993
+ resolveAwsRegionExtensionConfiguration
2994
+ };