@larkup/cli 0.3.21 → 0.3.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/{analytics-store-UU5MX3JA.js → analytics-store-6SZQ7JBE.js} +1 -1
  2. package/dist/{chunk-RV756WXU.js → chunk-52FEKTCQ.js} +1079 -1033
  3. package/dist/{chunk-2PEO3NCV.js → chunk-5VCEWBIF.js} +4 -4
  4. package/dist/{chunk-5YXDD2GC.js → chunk-7MWCEBXG.js} +139 -139
  5. package/dist/{chunk-4SOSQVIA.js → chunk-D4V74FXY.js} +4 -4
  6. package/dist/{chunk-2QOWBHZK.js → chunk-IYRX2FOU.js} +10 -10
  7. package/dist/{chunk-FDCIUBLI.js → chunk-MA7PMBAQ.js} +18 -18
  8. package/dist/{chunk-EFPXIMED.js → chunk-MSJ5HF3C.js} +3 -3
  9. package/dist/{chunk-G5BURVQB.js → chunk-MXXWLVUQ.js} +3 -3
  10. package/dist/{chunk-JAIHHTKN.js → chunk-OMUGJ6MM.js} +62 -61
  11. package/dist/{chunk-HTNZPVID.js → chunk-RAMGCJ3D.js} +38 -35
  12. package/dist/{chunk-OXX5AQPP.js → chunk-TBMEIDA5.js} +39 -2
  13. package/dist/{chunk-PTQR3VCA.js → chunk-TPHCE6EK.js} +44 -45
  14. package/dist/{chunk-D3H2VEHZ.js → chunk-VFPIXPQD.js} +9 -9
  15. package/dist/{chunk-6B7OTI2Y.js → chunk-VV5N6AER.js} +2 -2
  16. package/dist/{chunk-RUMUOFC7.js → chunk-WXYQJAMD.js} +2 -2
  17. package/dist/{chunk-WSDGBXA3.js → chunk-WZJD24FL.js} +71 -71
  18. package/dist/{dist-es-DXUGAPLS.js → dist-es-3EVRA57P.js} +8 -8
  19. package/dist/{dist-es-OOS7VNC3.js → dist-es-6NUJXRYS.js} +10 -10
  20. package/dist/{dist-es-2OQPXBWH.js → dist-es-A6GXGSOI.js} +8 -8
  21. package/dist/{dist-es-ZM2PC6Y7.js → dist-es-BNVRZPYQ.js} +22 -22
  22. package/dist/{dist-es-MNMQ7EY7.js → dist-es-FBYK33UR.js} +2 -2
  23. package/dist/{dist-es-27PHRDP5.js → dist-es-JD3OKSCB.js} +11 -9
  24. package/dist/{dist-es-I2CSW44W.js → dist-es-O2QZUQ4K.js} +219 -219
  25. package/dist/{dist-es-YACWQ6TD.js → dist-es-XSLSUFFE.js} +18 -18
  26. package/dist/{dist-es-P55SOOJS.js → dist-es-YYRJPI37.js} +5 -5
  27. package/dist/{dist-es-TVPOX7SI.js → dist-es-ZZIU2OSM.js} +9 -9
  28. package/dist/{event-streams-7VYAXCGO.js → event-streams-5YVZPWZL.js} +3 -3
  29. package/dist/index.js +22 -27
  30. package/dist/{loadSso-MPKJCJHV.js → loadSso-HQ4CEKJL.js} +25 -23
  31. package/dist/{signin-WY5DIZ6I.js → signin-EGXTPMOE.js} +28 -26
  32. package/dist/{sso-oidc-6P6INS3W.js → sso-oidc-XLG4JOZS.js} +27 -25
  33. package/dist/{sts-2EDS5GKI.js → sts-643ZZLFZ.js} +30 -28
  34. package/dist/{tool-loader-LURY25XY.js → tool-loader-BOX7F5OA.js} +2 -2
  35. package/dist/{tool-registry-I7553RRN.js → tool-registry-X2BVIZJS.js} +1 -1
  36. package/package.json +14 -14
@@ -2,24 +2,25 @@ import {
2
2
  NoOpLogger,
3
3
  customEndpointFunctions,
4
4
  isIpAddress
5
- } from "./chunk-JAIHHTKN.js";
5
+ } from "./chunk-OMUGJ6MM.js";
6
6
  import {
7
7
  NODE_REGION_CONFIG_FILE_OPTIONS,
8
8
  NODE_REGION_CONFIG_OPTIONS,
9
9
  loadConfig
10
- } from "./chunk-WSDGBXA3.js";
10
+ } from "./chunk-WZJD24FL.js";
11
11
  import {
12
12
  HttpRequest,
13
13
  HttpResponse,
14
+ SMITHY_CONTEXT_KEY,
14
15
  getSmithyContext,
15
16
  hasOwn,
16
17
  isValidHostLabel,
17
18
  normalizeProvider,
18
19
  parseRfc7231DateTime,
19
20
  v4
20
- } from "./chunk-5YXDD2GC.js";
21
+ } from "./chunk-7MWCEBXG.js";
21
22
 
22
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js
23
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js
23
24
  function setCredentialFeature(credentials, feature, value) {
24
25
  if (!credentials.$source) {
25
26
  credentials.$source = {};
@@ -28,1159 +29,1186 @@ function setCredentialFeature(credentials, feature, value) {
28
29
  return credentials;
29
30
  }
30
31
 
31
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js
32
- var THROTTLING_ERROR_CODES = [
33
- "BandwidthLimitExceeded",
34
- "EC2ThrottledException",
35
- "LimitExceededException",
36
- "PriorRequestNotComplete",
37
- "ProvisionedThroughputExceededException",
38
- "RequestLimitExceeded",
39
- "RequestThrottled",
40
- "RequestThrottledException",
41
- "SlowDown",
42
- "ThrottledException",
43
- "Throttling",
44
- "ThrottlingException",
45
- "TooManyRequestsException",
46
- "TransactionInProgressException"
47
- ];
48
- var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
49
- var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
50
- var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
51
- var NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND", "EAI_AGAIN"];
52
-
53
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js
54
- var isRetryableByTrait = (error) => error?.$retryable !== void 0;
55
- var isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCorrected;
56
- var isBrowserNetworkError = (error) => {
57
- const errorMessages = /* @__PURE__ */ new Set([
58
- "Failed to fetch",
59
- "NetworkError when attempting to fetch resource",
60
- "The Internet connection appears to be offline",
61
- "Load failed",
62
- "Network request failed"
63
- ]);
64
- const isValid = error && error instanceof TypeError;
65
- if (!isValid) {
66
- return false;
32
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js
33
+ function resolveHostHeaderConfig(input) {
34
+ return input;
35
+ }
36
+ var hostHeaderMiddleware = (options) => (next) => async (args) => {
37
+ if (!HttpRequest.isInstance(args.request)) {
38
+ return next(args);
67
39
  }
68
- return errorMessages.has(error.message);
69
- };
70
- var isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error.name) || error.$retryable?.throttling == true;
71
- var isTransientError = (error, depth = 0) => error?.name !== "AbortError" && (isRetryableByTrait(error) || isClockSkewCorrectedError(error) || error.name === "InvalidSignatureException" && error.message?.includes("Signature expired") || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error) || isNodeJsHttp2TransientError(error) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1));
72
- var isServerError = (error) => {
73
- if (error.$metadata?.httpStatusCode !== void 0) {
74
- const statusCode = error.$metadata.httpStatusCode;
75
- if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
76
- return true;
40
+ const { request } = args;
41
+ const { handlerProtocol = "" } = options.requestHandler.metadata || {};
42
+ if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
43
+ delete request.headers["host"];
44
+ request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
45
+ } else if (!request.headers["host"]) {
46
+ let host = request.hostname;
47
+ if (request.port != null) {
48
+ host += `:${request.port}`;
77
49
  }
78
- return false;
50
+ request.headers["host"] = host;
79
51
  }
80
- return false;
52
+ return next(args);
81
53
  };
82
- function isNodeJsHttp2TransientError(error) {
83
- return error.code === "ERR_HTTP2_STREAM_ERROR" && error.message.includes("NGHTTP2_REFUSED_STREAM");
84
- }
54
+ var hostHeaderMiddlewareOptions = {
55
+ name: "hostHeaderMiddleware",
56
+ step: "build",
57
+ priority: "low",
58
+ tags: ["HOST"],
59
+ override: true
60
+ };
61
+ var getHostHeaderPlugin = (options) => ({
62
+ applyToStack: (clientStack) => {
63
+ clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
64
+ }
65
+ });
85
66
 
86
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRateLimiter.js
87
- var DefaultRateLimiter = class _DefaultRateLimiter {
88
- static setTimeoutFn = (fn, delay) => setTimeout(fn, delay);
89
- beta;
90
- minCapacity;
91
- minFillRate;
92
- scaleConstant;
93
- smooth;
94
- enabled = false;
95
- availableTokens = 0;
96
- lastMaxRate = 0;
97
- measuredTxRate = 0;
98
- requestCount = 0;
99
- fillRate;
100
- lastThrottleTime;
101
- lastTimestamp = 0;
102
- lastTxRateBucket;
103
- maxCapacity;
104
- timeWindow = 0;
105
- constructor(options) {
106
- this.beta = options?.beta ?? 0.7;
107
- this.minCapacity = options?.minCapacity ?? 1;
108
- this.minFillRate = options?.minFillRate ?? 0.5;
109
- this.scaleConstant = options?.scaleConstant ?? 0.4;
110
- this.smooth = options?.smooth ?? 0.8;
111
- this.lastThrottleTime = this.getCurrentTimeInSeconds();
112
- this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
113
- this.fillRate = this.minFillRate;
114
- this.maxCapacity = this.minCapacity;
67
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-logger/loggerMiddleware.js
68
+ var loggerMiddleware = () => (next, context) => async (args) => {
69
+ try {
70
+ const response = await next(args);
71
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
72
+ const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
73
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
74
+ const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
75
+ const { $metadata, ...outputWithoutMetadata } = response.output;
76
+ logger?.info?.({
77
+ clientName,
78
+ commandName,
79
+ input: inputFilterSensitiveLog(args.input),
80
+ output: outputFilterSensitiveLog(outputWithoutMetadata),
81
+ metadata: $metadata
82
+ });
83
+ return response;
84
+ } catch (error) {
85
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
86
+ const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
87
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
88
+ logger?.error?.({
89
+ clientName,
90
+ commandName,
91
+ input: inputFilterSensitiveLog(args.input),
92
+ error,
93
+ metadata: error.$metadata
94
+ });
95
+ throw error;
115
96
  }
116
- async getSendToken() {
117
- return this.acquireTokenBucket(1);
97
+ };
98
+ var loggerMiddlewareOptions = {
99
+ name: "loggerMiddleware",
100
+ tags: ["LOGGER"],
101
+ step: "initialize",
102
+ override: true
103
+ };
104
+ var getLoggerPlugin = (options) => ({
105
+ applyToStack: (clientStack) => {
106
+ clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
118
107
  }
119
- updateClientSendingRate(response) {
120
- let calculatedRate;
121
- this.updateMeasuredRate();
122
- const retryErrorInfo = response;
123
- const isThrottling = retryErrorInfo?.errorType === "THROTTLING" || isThrottlingError(retryErrorInfo?.error ?? response);
124
- if (isThrottling) {
125
- const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
126
- this.lastMaxRate = rateToUse;
127
- this.calculateTimeWindow();
128
- this.lastThrottleTime = this.getCurrentTimeInSeconds();
129
- calculatedRate = this.cubicThrottle(rateToUse);
130
- this.enableTokenBucket();
131
- } else {
132
- this.calculateTimeWindow();
133
- calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
134
- }
135
- const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
136
- this.updateTokenBucketRate(newRate);
108
+ });
109
+
110
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/configuration.js
111
+ var recursionDetectionMiddlewareOptions = {
112
+ step: "build",
113
+ tags: ["RECURSION_DETECTION", "TRACE_CONTEXT_PROPAGATION"],
114
+ name: "recursionDetectionMiddleware",
115
+ override: true,
116
+ priority: "low"
117
+ };
118
+
119
+ // ../../node_modules/.pnpm/@aws+lambda-invoke-store@0.3.0/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js
120
+ var PROTECTED_KEYS = {
121
+ REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"),
122
+ X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),
123
+ TENANT_ID: Symbol.for("_AWS_LAMBDA_TENANT_ID"),
124
+ TRACEPARENT: Symbol.for("_AWS_LAMBDA_TRACEPARENT"),
125
+ TRACESTATE: Symbol.for("_AWS_LAMBDA_TRACESTATE"),
126
+ BAGGAGE: Symbol.for("_AWS_LAMBDA_BAGGAGE")
127
+ };
128
+ var NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? "");
129
+ if (!NO_GLOBAL_AWS_LAMBDA) {
130
+ globalThis.awslambda = globalThis.awslambda || {};
131
+ }
132
+ var InvokeStoreBase = class {
133
+ static PROTECTED_KEYS = PROTECTED_KEYS;
134
+ isProtectedKey(key) {
135
+ return Object.values(PROTECTED_KEYS).includes(key);
137
136
  }
138
- getCurrentTimeInSeconds() {
139
- return Date.now() / 1e3;
137
+ getRequestId() {
138
+ return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-";
140
139
  }
141
- async acquireTokenBucket(amount) {
142
- if (!this.enabled) {
143
- return;
144
- }
145
- this.refillTokenBucket();
146
- while (amount > this.availableTokens) {
147
- const delay = (amount - this.availableTokens) / this.fillRate * 1e3;
148
- await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay));
149
- this.refillTokenBucket();
150
- }
151
- this.availableTokens = this.availableTokens - amount;
140
+ getXRayTraceId() {
141
+ return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID);
152
142
  }
153
- refillTokenBucket() {
154
- const timestamp = this.getCurrentTimeInSeconds();
155
- if (!this.lastTimestamp) {
156
- this.lastTimestamp = timestamp;
157
- return;
158
- }
159
- const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
160
- this.availableTokens = Math.min(this.maxCapacity, this.availableTokens + fillAmount);
161
- this.lastTimestamp = timestamp;
143
+ getTenantId() {
144
+ return this.get(PROTECTED_KEYS.TENANT_ID);
162
145
  }
163
- calculateTimeWindow() {
164
- this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
146
+ getTraceparent() {
147
+ return this.get(PROTECTED_KEYS.TRACEPARENT);
165
148
  }
166
- cubicThrottle(rateToUse) {
167
- return this.getPrecise(rateToUse * this.beta);
149
+ getTracestate() {
150
+ return this.get(PROTECTED_KEYS.TRACESTATE);
168
151
  }
169
- cubicSuccess(timestamp) {
170
- return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
152
+ getBaggage() {
153
+ return this.get(PROTECTED_KEYS.BAGGAGE);
171
154
  }
172
- enableTokenBucket() {
173
- this.enabled = true;
155
+ };
156
+ var InvokeStoreSingle = class extends InvokeStoreBase {
157
+ currentContext;
158
+ getContext() {
159
+ return this.currentContext;
174
160
  }
175
- updateTokenBucketRate(newRate) {
176
- this.refillTokenBucket();
177
- this.fillRate = Math.max(newRate, this.minFillRate);
178
- this.maxCapacity = Math.max(newRate, this.minCapacity);
179
- this.availableTokens = Math.min(this.availableTokens, this.maxCapacity);
161
+ hasContext() {
162
+ return this.currentContext !== void 0;
180
163
  }
181
- updateMeasuredRate() {
182
- const t = this.getCurrentTimeInSeconds();
183
- const timeBucket = Math.floor(t * 2) / 2;
184
- this.requestCount++;
185
- if (timeBucket > this.lastTxRateBucket) {
186
- const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
187
- this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
188
- this.requestCount = 0;
189
- this.lastTxRateBucket = timeBucket;
190
- }
164
+ get(key) {
165
+ return this.currentContext?.[key];
191
166
  }
192
- getPrecise(num) {
193
- return parseFloat(num.toFixed(8));
194
- }
195
- };
196
-
197
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/constants.js
198
- var MAXIMUM_RETRY_DELAY = 20 * 1e3;
199
- var INITIAL_RETRY_TOKENS = 500;
200
- var NO_RETRY_INCREMENT = 1;
201
- var INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
202
- var REQUEST_HEADER = "amz-sdk-request";
203
-
204
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js
205
- var Retry = class _Retry {
206
- static v2026 = typeof process !== "undefined" && process.env?.SMITHY_NEW_RETRIES_2026 === "true";
207
- static delay() {
208
- return _Retry.v2026 ? 50 : 100;
209
- }
210
- static throttlingDelay() {
211
- return _Retry.v2026 ? 1e3 : 500;
212
- }
213
- static cost() {
214
- return _Retry.v2026 ? 14 : 5;
215
- }
216
- static throttlingCost() {
217
- return _Retry.v2026 ? 5 : 10;
167
+ set(key, value) {
168
+ if (this.isProtectedKey(key)) {
169
+ throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
170
+ }
171
+ this.currentContext = this.currentContext || {};
172
+ this.currentContext[key] = value;
218
173
  }
219
- static modifiedCostType() {
220
- return _Retry.v2026 ? "THROTTLING" : "TRANSIENT";
174
+ run(context, fn) {
175
+ this.currentContext = context;
176
+ return fn();
221
177
  }
222
178
  };
223
-
224
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryBackoffStrategy.js
225
- var DefaultRetryBackoffStrategy = class {
226
- x = Retry.delay();
227
- computeNextBackoffDelay(i) {
228
- const b = Math.random();
229
- const r = 2;
230
- const t_i = b * Math.min(this.x * r ** i, MAXIMUM_RETRY_DELAY);
231
- return Math.floor(t_i);
232
- }
233
- setDelayBase(delay) {
234
- this.x = delay;
179
+ var InvokeStoreMulti = class _InvokeStoreMulti extends InvokeStoreBase {
180
+ als;
181
+ static async create() {
182
+ const instance = new _InvokeStoreMulti();
183
+ const asyncHooks = await import("async_hooks");
184
+ instance.als = new asyncHooks.AsyncLocalStorage();
185
+ return instance;
235
186
  }
236
- };
237
-
238
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryToken.js
239
- var DefaultRetryToken = class {
240
- delay;
241
- count;
242
- cost;
243
- longPoll;
244
- $retryLog = {
245
- acquisitionDelay: 0
246
- };
247
- constructor(delay, count, cost, longPoll) {
248
- this.delay = delay;
249
- this.count = count;
250
- this.cost = cost;
251
- this.longPoll = longPoll;
187
+ getContext() {
188
+ return this.als.getStore();
252
189
  }
253
- getRetryCount() {
254
- return this.count;
190
+ hasContext() {
191
+ return this.als.getStore() !== void 0;
255
192
  }
256
- getRetryDelay() {
257
- return Math.min(MAXIMUM_RETRY_DELAY, this.delay);
193
+ get(key) {
194
+ return this.als.getStore()?.[key];
258
195
  }
259
- getRetryCost() {
260
- return this.cost;
196
+ set(key, value) {
197
+ if (this.isProtectedKey(key)) {
198
+ throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
199
+ }
200
+ const store = this.als.getStore();
201
+ if (!store) {
202
+ throw new Error("No context available");
203
+ }
204
+ store[key] = value;
261
205
  }
262
- isLongPoll() {
263
- return this.longPoll;
206
+ run(context, fn) {
207
+ return this.als.run(context, fn);
264
208
  }
265
209
  };
266
-
267
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/config.js
268
- var RETRY_MODES;
269
- (function(RETRY_MODES2) {
270
- RETRY_MODES2["STANDARD"] = "standard";
271
- RETRY_MODES2["ADAPTIVE"] = "adaptive";
272
- })(RETRY_MODES || (RETRY_MODES = {}));
273
- var DEFAULT_MAX_ATTEMPTS = 3;
274
- var DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
275
-
276
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js
277
- var refusal = {
278
- incompatible: 1,
279
- attempts: 2,
280
- capacity: 3
281
- };
282
- var StandardRetryStrategy = class {
283
- mode = RETRY_MODES.STANDARD;
284
- retryBackoffStrategy;
285
- capacity = INITIAL_RETRY_TOKENS;
286
- maxAttemptsProvider;
287
- baseDelay;
288
- constructor(arg1) {
289
- if (typeof arg1 === "number") {
290
- this.maxAttemptsProvider = async () => arg1;
291
- } else if (typeof arg1 === "function") {
292
- this.maxAttemptsProvider = arg1;
293
- } else if (arg1 && typeof arg1 === "object") {
294
- this.maxAttemptsProvider = async () => arg1.maxAttempts;
295
- this.baseDelay = arg1.baseDelay;
296
- this.retryBackoffStrategy = arg1.backoff;
210
+ var InvokeStore;
211
+ (function(InvokeStore2) {
212
+ let instance = null;
213
+ async function getInstanceAsync(forceInvokeStoreMulti) {
214
+ if (!instance) {
215
+ instance = (async () => {
216
+ const isMulti = forceInvokeStoreMulti === true || "AWS_LAMBDA_MAX_CONCURRENCY" in process.env;
217
+ const newInstance = isMulti ? await InvokeStoreMulti.create() : new InvokeStoreSingle();
218
+ if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) {
219
+ return globalThis.awslambda.InvokeStore;
220
+ } else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) {
221
+ globalThis.awslambda.InvokeStore = newInstance;
222
+ return newInstance;
223
+ } else {
224
+ return newInstance;
225
+ }
226
+ })();
297
227
  }
298
- this.maxAttemptsProvider ??= async () => DEFAULT_MAX_ATTEMPTS;
299
- this.baseDelay ??= Retry.delay();
300
- this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
228
+ return instance;
301
229
  }
302
- async acquireInitialRetryToken(retryTokenScope) {
303
- return new DefaultRetryToken(Retry.delay(), 0, void 0, Retry.v2026 && retryTokenScope.includes(":longpoll"));
230
+ InvokeStore2.getInstanceAsync = getInstanceAsync;
231
+ InvokeStore2._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? {
232
+ reset: () => {
233
+ instance = null;
234
+ if (globalThis.awslambda?.InvokeStore) {
235
+ delete globalThis.awslambda.InvokeStore;
236
+ }
237
+ globalThis.awslambda = { InvokeStore: void 0 };
238
+ }
239
+ } : void 0;
240
+ })(InvokeStore || (InvokeStore = {}));
241
+
242
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.js
243
+ var AWS_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
244
+ var _X_AMZN_TRACE_ID = "_X_AMZN_TRACE_ID";
245
+ var X_AMZN_TRACE_ID = "X-Amzn-Trace-Id";
246
+ var TRACEPARENT = "traceparent";
247
+ var TRACESTATE = "tracestate";
248
+ var BAGGAGE = "baggage";
249
+ var recursionDetectionMiddleware = () => (next) => async (args) => {
250
+ const { request } = args;
251
+ if (!HttpRequest.isInstance(request)) {
252
+ return next(args);
304
253
  }
305
- async refreshRetryTokenForRetry(token, errorInfo) {
306
- const maxAttempts = await this.getMaxAttempts();
307
- const retryCode = this.retryCode(token, errorInfo, maxAttempts);
308
- const shouldRetry = retryCode === 0;
309
- const isLongPoll = token.isLongPoll?.();
310
- if (shouldRetry || isLongPoll) {
311
- const errorType = errorInfo.errorType;
312
- this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? Retry.throttlingDelay() : this.baseDelay);
313
- const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
314
- let retryDelay = delayFromErrorType;
315
- if (errorInfo.retryAfterHint instanceof Date) {
316
- retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5e3));
254
+ let invokeStore;
255
+ {
256
+ const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === X_AMZN_TRACE_ID.toLowerCase()) ?? X_AMZN_TRACE_ID;
257
+ if (!request.headers.hasOwnProperty(traceIdHeader)) {
258
+ const functionName = process.env[AWS_LAMBDA_FUNCTION_NAME];
259
+ const traceIdFromEnv = process.env[_X_AMZN_TRACE_ID];
260
+ invokeStore ??= await InvokeStore.getInstanceAsync();
261
+ const traceIdFromInvokeStore = invokeStore?.getXRayTraceId();
262
+ const traceId = traceIdFromInvokeStore ?? traceIdFromEnv;
263
+ const nonEmptyString = (str) => typeof str === "string" && str.length > 0;
264
+ if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
265
+ request.headers[X_AMZN_TRACE_ID] = traceId;
317
266
  }
318
- if (!shouldRetry) {
319
- const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
320
- if (longPollBackoff > 0) {
321
- await new Promise((r) => setTimeout(r, longPollBackoff));
267
+ }
268
+ }
269
+ {
270
+ sanitizeTraceHeaders(request.headers);
271
+ const existingTraceparent = request.headers[TRACEPARENT];
272
+ if (!existingTraceparent) {
273
+ const traceparent = (invokeStore ??= await InvokeStore.getInstanceAsync())?.getTraceparent?.();
274
+ if (traceparent) {
275
+ request.headers[TRACEPARENT] = traceparent;
276
+ const tracestate = invokeStore?.getTracestate?.();
277
+ if (tracestate) {
278
+ request.headers[TRACESTATE] = tracestate;
279
+ }
280
+ const baggage = invokeStore?.getBaggage?.();
281
+ if (baggage) {
282
+ request.headers[BAGGAGE] = baggage;
322
283
  }
323
- } else {
324
- const capacityCost = this.getCapacityCost(errorType);
325
- this.capacity -= capacityCost;
326
- const nextToken = new DefaultRetryToken(0, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false);
327
- await new Promise((r) => setTimeout(r, retryDelay));
328
- nextToken.$retryLog.acquisitionDelay = retryDelay;
329
- return nextToken;
330
284
  }
331
285
  }
332
- throw new Error("No retry token available");
333
286
  }
334
- recordSuccess(token) {
335
- this.capacity = Math.min(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
287
+ return next(args);
288
+ };
289
+ function sanitizeTraceHeaders(headers) {
290
+ for (const header of Object.keys(headers)) {
291
+ const lower = header.toLowerCase();
292
+ if (header !== lower && (lower === TRACEPARENT || lower === TRACESTATE || lower === BAGGAGE)) {
293
+ headers[lower] = headers[header];
294
+ delete headers[header];
295
+ }
336
296
  }
337
- getCapacity() {
338
- return this.capacity;
297
+ }
298
+
299
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.js
300
+ var getRecursionDetectionPlugin = (options) => ({
301
+ applyToStack: (clientStack) => {
302
+ clientStack.add(recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions);
339
303
  }
340
- async maxAttempts() {
341
- return this.maxAttemptsProvider();
304
+ });
305
+
306
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/resolveAuthOptions.js
307
+ var resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
308
+ if (!authSchemePreference || authSchemePreference.length === 0) {
309
+ return candidateAuthOptions;
342
310
  }
343
- async getMaxAttempts() {
344
- try {
345
- return await this.maxAttemptsProvider();
346
- } catch (ignored) {
347
- console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
348
- return DEFAULT_MAX_ATTEMPTS;
311
+ const preferredAuthOptions = [];
312
+ for (const preferredSchemeName of authSchemePreference) {
313
+ for (const candidateAuthOption of candidateAuthOptions) {
314
+ const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
315
+ if (candidateAuthSchemeName === preferredSchemeName) {
316
+ preferredAuthOptions.push(candidateAuthOption);
317
+ }
349
318
  }
350
319
  }
351
- retryCode(tokenToRenew, errorInfo, maxAttempts) {
352
- const attempts = tokenToRenew.getRetryCount() + 1;
353
- const retryableStatus = this.isRetryableError(errorInfo.errorType) ? 0 : refusal.incompatible;
354
- const attemptStatus = attempts < maxAttempts ? 0 : refusal.attempts;
355
- const capacityStatus = this.capacity >= this.getCapacityCost(errorInfo.errorType) ? 0 : refusal.capacity;
356
- return retryableStatus || attemptStatus || capacityStatus;
357
- }
358
- getCapacityCost(errorType) {
359
- return errorType === Retry.modifiedCostType() ? Retry.throttlingCost() : Retry.cost();
360
- }
361
- isRetryableError(errorType) {
362
- return errorType === "THROTTLING" || errorType === "TRANSIENT";
320
+ for (const candidateAuthOption of candidateAuthOptions) {
321
+ if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
322
+ preferredAuthOptions.push(candidateAuthOption);
323
+ }
363
324
  }
325
+ return preferredAuthOptions;
364
326
  };
365
327
 
366
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/AdaptiveRetryStrategy.js
367
- var AdaptiveRetryStrategy = class {
368
- mode = RETRY_MODES.ADAPTIVE;
369
- rateLimiter;
370
- standardRetryStrategy;
371
- constructor(maxAttemptsProvider, options) {
372
- const { rateLimiter } = options ?? {};
373
- this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
374
- this.standardRetryStrategy = options ? new StandardRetryStrategy({
375
- maxAttempts: typeof maxAttemptsProvider === "number" ? maxAttemptsProvider : 3,
376
- ...options
377
- }) : new StandardRetryStrategy(maxAttemptsProvider);
328
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
329
+ function convertHttpAuthSchemesToMap(httpAuthSchemes) {
330
+ const map = /* @__PURE__ */ new Map();
331
+ for (const scheme of httpAuthSchemes) {
332
+ map.set(scheme.schemeId, scheme);
378
333
  }
379
- async acquireInitialRetryToken(retryTokenScope) {
380
- const token = await this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
381
- await this.rateLimiter.getSendToken();
382
- return token;
334
+ return map;
335
+ }
336
+ var httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
337
+ const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
338
+ const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
339
+ const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
340
+ const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
341
+ const smithyContext = getSmithyContext(context);
342
+ const failureReasons = [];
343
+ for (const option of resolvedOptions) {
344
+ const scheme = authSchemes.get(option.schemeId);
345
+ if (!scheme) {
346
+ failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
347
+ continue;
348
+ }
349
+ const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
350
+ if (!identityProvider) {
351
+ failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
352
+ continue;
353
+ }
354
+ const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
355
+ option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
356
+ option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
357
+ smithyContext.selectedHttpAuthScheme = {
358
+ httpAuthOption: option,
359
+ identity: await identityProvider(option.identityProperties),
360
+ signer: scheme.signer
361
+ };
362
+ break;
383
363
  }
384
- async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
385
- this.rateLimiter.updateClientSendingRate(errorInfo);
386
- const token = await this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
387
- await this.rateLimiter.getSendToken();
388
- return token;
364
+ if (!smithyContext.selectedHttpAuthScheme) {
365
+ throw new Error(failureReasons.join("\n"));
389
366
  }
390
- recordSuccess(token) {
391
- this.rateLimiter.updateClientSendingRate({});
392
- this.standardRetryStrategy.recordSuccess(token);
367
+ return next(args);
368
+ };
369
+
370
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js
371
+ var httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
372
+ step: "serialize",
373
+ tags: ["HTTP_AUTH_SCHEME"],
374
+ name: "httpAuthSchemeMiddleware",
375
+ override: true,
376
+ relation: "before",
377
+ toMiddleware: "endpointV2Middleware"
378
+ };
379
+ var getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
380
+ applyToStack: (clientStack) => {
381
+ clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
382
+ httpAuthSchemeParametersProvider,
383
+ identityProviderConfigProvider
384
+ }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
393
385
  }
394
- async maxAttemptsProvider() {
395
- return this.standardRetryStrategy.maxAttempts();
386
+ });
387
+
388
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js
389
+ var defaultErrorHandler = (signingProperties) => (error) => {
390
+ throw error;
391
+ };
392
+ var defaultSuccessHandler = (httpResponse, signingProperties) => {
393
+ };
394
+ var httpSigningMiddleware = (config) => (next, context) => async (args) => {
395
+ if (!HttpRequest.isInstance(args.request)) {
396
+ return next(args);
396
397
  }
398
+ const smithyContext = getSmithyContext(context);
399
+ const scheme = smithyContext.selectedHttpAuthScheme;
400
+ if (!scheme) {
401
+ throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
402
+ }
403
+ const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
404
+ const output = await next({
405
+ ...args,
406
+ request: await signer.sign(args.request, identity, signingProperties)
407
+ }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
408
+ (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
409
+ return output;
397
410
  };
398
411
 
399
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js
400
- var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
401
- var CONFIG_MAX_ATTEMPTS = "max_attempts";
402
- var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
403
- environmentVariableSelector: (env2) => {
404
- const value = env2[ENV_MAX_ATTEMPTS];
405
- if (!value) {
406
- return void 0;
407
- }
408
- const maxAttempt = parseInt(value);
409
- if (Number.isNaN(maxAttempt)) {
410
- throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
412
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/getHttpSigningMiddleware.js
413
+ var httpSigningMiddlewareOptions = {
414
+ step: "finalizeRequest",
415
+ tags: ["HTTP_SIGNING"],
416
+ name: "httpSigningMiddleware",
417
+ aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
418
+ override: true,
419
+ relation: "after",
420
+ toMiddleware: "retryMiddleware"
421
+ };
422
+ var getHttpSigningPlugin = (config) => ({
423
+ applyToStack: (clientStack) => {
424
+ clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
425
+ }
426
+ });
427
+
428
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/pagination/createPaginator.js
429
+ var makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => {
430
+ let command = new CommandCtor(input);
431
+ command = withCommand(command) ?? command;
432
+ return await client.send(command, ...args);
433
+ };
434
+ function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
435
+ return async function* paginateOperation(config, input, ...additionalArguments) {
436
+ const _input = input;
437
+ let token = config.startingToken ?? _input[inputTokenName];
438
+ let hasNext = true;
439
+ let page;
440
+ while (hasNext) {
441
+ _input[inputTokenName] = token;
442
+ if (pageSizeTokenName) {
443
+ _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;
444
+ }
445
+ if (config.client instanceof ClientCtor) {
446
+ page = await makePagedClientRequest(CommandCtor, config.client, input, config.withCommand, ...additionalArguments);
447
+ } else {
448
+ throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
449
+ }
450
+ yield page;
451
+ const prevToken = token;
452
+ token = get(page, outputTokenName);
453
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
411
454
  }
412
- return maxAttempt;
413
- },
414
- configFileSelector: (profile) => {
415
- const value = profile[CONFIG_MAX_ATTEMPTS];
416
- if (!value) {
455
+ return void 0;
456
+ };
457
+ }
458
+ var get = (fromObject, path) => {
459
+ let cursor = fromObject;
460
+ const pathComponents = path.split(".");
461
+ for (const step of pathComponents) {
462
+ if (!cursor || typeof cursor !== "object") {
417
463
  return void 0;
418
464
  }
419
- const maxAttempt = parseInt(value);
420
- if (Number.isNaN(maxAttempt)) {
421
- throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
422
- }
423
- return maxAttempt;
424
- },
425
- default: DEFAULT_MAX_ATTEMPTS
465
+ cursor = cursor[step];
466
+ }
467
+ return cursor;
426
468
  };
427
- var resolveRetryConfig = (input, defaults) => {
428
- const { retryStrategy, retryMode } = input;
429
- const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
430
- const maxAttemptsProvider = normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
431
- let controller = retryStrategy ? Promise.resolve(retryStrategy) : void 0;
432
- const getDefault = async () => {
433
- const maxAttempts = await maxAttemptsProvider();
434
- const adaptive = await normalizeProvider(retryMode)() === RETRY_MODES.ADAPTIVE;
435
- if (adaptive) {
436
- return new AdaptiveRetryStrategy(maxAttemptsProvider, {
437
- maxAttempts,
438
- baseDelay: defaultBaseDelay
439
- });
469
+
470
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js
471
+ var DefaultIdentityProviderConfig = class {
472
+ authSchemes = /* @__PURE__ */ new Map();
473
+ constructor(config) {
474
+ for (const key in config) {
475
+ if (!hasOwn(config, key)) {
476
+ continue;
477
+ }
478
+ const value = config[key];
479
+ if (value !== void 0) {
480
+ this.authSchemes.set(key, value);
481
+ }
440
482
  }
441
- return new StandardRetryStrategy({
442
- maxAttempts,
443
- baseDelay: defaultBaseDelay
444
- });
445
- };
446
- return Object.assign(input, {
447
- maxAttempts: maxAttemptsProvider,
448
- retryStrategy: () => controller ??= getDefault()
449
- });
450
- };
451
- var ENV_RETRY_MODE = "AWS_RETRY_MODE";
452
- var CONFIG_RETRY_MODE = "retry_mode";
453
- var NODE_RETRY_MODE_CONFIG_OPTIONS = {
454
- environmentVariableSelector: (env2) => env2[ENV_RETRY_MODE],
455
- configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
456
- default: DEFAULT_RETRY_MODE
483
+ }
484
+ getIdentityProvider(schemeId) {
485
+ return this.authSchemes.get(schemeId);
486
+ }
457
487
  };
458
488
 
459
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.js
460
- import { Readable } from "stream";
461
- var isStreamingPayload = (request) => request?.body instanceof Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream;
489
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/noAuth.js
490
+ var NoAuthSigner = class {
491
+ async sign(httpRequest, identity, signingProperties) {
492
+ return httpRequest;
493
+ }
494
+ };
462
495
 
463
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js
464
- function parseRetryAfterHeader(response, logger) {
465
- if (!HttpResponse.isInstance(response)) {
466
- return;
496
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/memoizeIdentityProvider.js
497
+ var createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(identity) {
498
+ return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
499
+ };
500
+ var EXPIRATION_MS = 3e5;
501
+ var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
502
+ var doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0;
503
+ var memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
504
+ if (provider === void 0) {
505
+ return void 0;
467
506
  }
468
- for (const header in response.headers) {
469
- if (!hasOwn(response.headers, header)) {
470
- continue;
471
- }
472
- const h = header.toLowerCase();
473
- if (h === "retry-after") {
474
- const retryAfter = response.headers[header];
475
- let retryAfterSeconds = NaN;
476
- if (retryAfter.endsWith("GMT")) {
477
- try {
478
- const date = parseRfc7231DateTime(retryAfter);
479
- retryAfterSeconds = (date.getTime() - Date.now()) / 1e3;
480
- } catch (e) {
481
- logger?.trace?.("Failed to parse retry-after header");
482
- logger?.trace?.(e);
483
- }
484
- } else if (retryAfter.match(/ GMT, ((\d+)|(\d+\.\d+))$/)) {
485
- retryAfterSeconds = Number(retryAfter.match(/ GMT, ([\d.]+)$/)?.[1]);
486
- } else if (retryAfter.match(/^((\d+)|(\d+\.\d+))$/)) {
487
- retryAfterSeconds = Number(retryAfter);
488
- } else if (Date.parse(retryAfter) >= Date.now()) {
489
- retryAfterSeconds = (Date.parse(retryAfter) - Date.now()) / 1e3;
490
- }
491
- if (isNaN(retryAfterSeconds)) {
492
- return;
493
- }
494
- return new Date(Date.now() + retryAfterSeconds * 1e3);
495
- } else if (h === "x-amz-retry-after") {
496
- const v = response.headers[header];
497
- const backoffMilliseconds = Number(v);
498
- if (isNaN(backoffMilliseconds)) {
499
- logger?.trace?.(`Failed to parse x-amz-retry-after=${v}`);
500
- return;
501
- }
502
- return new Date(Date.now() + backoffMilliseconds);
507
+ const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
508
+ let resolved;
509
+ let pending;
510
+ let hasResult;
511
+ let isConstant = false;
512
+ const coalesceProvider = async (options) => {
513
+ if (!pending) {
514
+ pending = normalizedProvider(options);
503
515
  }
516
+ try {
517
+ resolved = await pending;
518
+ hasResult = true;
519
+ isConstant = false;
520
+ } finally {
521
+ pending = void 0;
522
+ }
523
+ return resolved;
524
+ };
525
+ if (isExpired === void 0) {
526
+ return async (options) => {
527
+ if (!hasResult || options?.forceRefresh) {
528
+ resolved = await coalesceProvider(options);
529
+ }
530
+ return resolved;
531
+ };
504
532
  }
505
- }
533
+ return async (options) => {
534
+ if (!hasResult || options?.forceRefresh) {
535
+ resolved = await coalesceProvider(options);
536
+ }
537
+ if (isConstant) {
538
+ return resolved;
539
+ }
540
+ if (!requiresRefresh(resolved)) {
541
+ isConstant = true;
542
+ return resolved;
543
+ }
544
+ if (isExpired(resolved)) {
545
+ await coalesceProvider(options);
546
+ return resolved;
547
+ }
548
+ return resolved;
549
+ };
550
+ };
506
551
 
507
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js
508
- var asSdkError = (error) => {
509
- if (error instanceof Error) {
510
- return error;
511
- }
512
- if (error instanceof Object) {
513
- return Object.assign(new Error(), error);
514
- }
515
- if (typeof error === "string") {
516
- return new Error(error);
552
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/normalizeProvider.js
553
+ var normalizeProvider2 = (input) => {
554
+ if (typeof input === "function") {
555
+ return input;
517
556
  }
518
- return new Error(`AWS SDK error wrapper for ${error}`);
557
+ const promisified = Promise.resolve(input);
558
+ return () => promisified;
519
559
  };
520
560
 
521
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js
522
- function bindRetryMiddleware(isStreamingPayload2) {
523
- return (options) => (next, context) => async (args) => {
524
- let retryStrategy = await options.retryStrategy();
525
- const maxAttempts = await options.maxAttempts();
526
- if (isRetryStrategyV2(retryStrategy)) {
527
- retryStrategy = retryStrategy;
528
- let retryToken = await retryStrategy.acquireInitialRetryToken((context["partition_id"] ?? "") + (context.__retryLongPoll ? ":longpoll" : ""));
529
- let lastError = new Error();
530
- let attempts = 0;
531
- let totalRetryDelay = 0;
532
- const { request } = args;
533
- const isRequest = HttpRequest.isInstance(request);
534
- if (isRequest) {
535
- request.headers[INVOCATION_ID_HEADER] = v4();
536
- }
537
- while (true) {
538
- try {
539
- if (isRequest) {
540
- request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
541
- }
542
- const { response, output } = await next(args);
543
- retryStrategy.recordSuccess(retryToken);
544
- output.$metadata.attempts = attempts + 1;
545
- output.$metadata.totalRetryDelay = totalRetryDelay;
546
- return { response, output };
547
- } catch (e) {
548
- const retryErrorInfo = getRetryErrorInfo(e, options.logger);
549
- lastError = asSdkError(e);
550
- if (isRequest && isStreamingPayload2(request)) {
551
- (context.logger instanceof NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
552
- throw lastError;
553
- }
554
- try {
555
- retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
556
- } catch (ignoredRefreshError) {
557
- if (!lastError.$metadata) {
558
- lastError.$metadata = {};
559
- }
560
- lastError.$metadata.attempts = attempts + 1;
561
- lastError.$metadata.totalRetryDelay = totalRetryDelay;
562
- throw lastError;
563
- }
564
- attempts = retryToken.getRetryCount();
565
- const delay = retryToken.getRetryDelay();
566
- totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay;
567
- if (delay > 0) {
568
- await cooldown(delay);
569
- }
561
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/configurations.js
562
+ var DEFAULT_UA_APP_ID = void 0;
563
+ function isValidUserAgentAppId(appId) {
564
+ if (appId === void 0) {
565
+ return true;
566
+ }
567
+ return typeof appId === "string" && appId.length <= 50;
568
+ }
569
+ function resolveUserAgentConfig(input) {
570
+ const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
571
+ const { customUserAgent } = input;
572
+ return Object.assign(input, {
573
+ customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
574
+ userAgentAppId: async () => {
575
+ const appId = await normalizedAppIdProvider();
576
+ if (!isValidUserAgentAppId(appId)) {
577
+ const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
578
+ if (typeof appId !== "string") {
579
+ logger?.warn("userAgentAppId must be a string or undefined.");
580
+ } else if (appId.length > 50) {
581
+ logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
570
582
  }
571
583
  }
572
- } else {
573
- retryStrategy = retryStrategy;
574
- if (retryStrategy?.mode) {
575
- context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
576
- }
577
- return retryStrategy.retry(next, args);
584
+ return appId;
578
585
  }
579
- };
586
+ });
580
587
  }
581
- var cooldown = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
582
- var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
583
- var getRetryErrorInfo = (error, logger) => {
584
- const errorInfo = {
585
- error,
586
- errorType: getRetryErrorType(error)
587
- };
588
- const retryAfterHint = parseRetryAfterHeader(error.$response, logger);
589
- if (retryAfterHint) {
590
- errorInfo.retryAfterHint = retryAfterHint;
588
+
589
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js
590
+ var THROTTLING_ERROR_CODES = [
591
+ "BandwidthLimitExceeded",
592
+ "EC2ThrottledException",
593
+ "LimitExceededException",
594
+ "PriorRequestNotComplete",
595
+ "ProvisionedThroughputExceededException",
596
+ "RequestLimitExceeded",
597
+ "RequestThrottled",
598
+ "RequestThrottledException",
599
+ "SlowDown",
600
+ "ThrottledException",
601
+ "Throttling",
602
+ "ThrottlingException",
603
+ "TooManyRequestsException",
604
+ "TransactionInProgressException"
605
+ ];
606
+ var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
607
+ var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
608
+ var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
609
+ var NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND", "EAI_AGAIN"];
610
+
611
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js
612
+ var isRetryableByTrait = (error) => error?.$retryable !== void 0;
613
+ var isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCorrected;
614
+ var isBrowserNetworkError = (error) => {
615
+ const errorMessages = /* @__PURE__ */ new Set([
616
+ "Failed to fetch",
617
+ "NetworkError when attempting to fetch resource",
618
+ "The Internet connection appears to be offline",
619
+ "Load failed",
620
+ "Network request failed"
621
+ ]);
622
+ const isValid = error && error instanceof TypeError;
623
+ if (!isValid) {
624
+ return false;
591
625
  }
592
- return errorInfo;
626
+ return errorMessages.has(error.message);
593
627
  };
594
- var getRetryErrorType = (error) => {
595
- if (isThrottlingError(error)) {
596
- return "THROTTLING";
597
- }
598
- if (isTransientError(error)) {
599
- return "TRANSIENT";
600
- }
601
- if (isServerError(error)) {
602
- return "SERVER_ERROR";
628
+ var isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error.name) || error.$retryable?.throttling == true;
629
+ var isTransientError = (error, depth = 0) => error?.name !== "AbortError" && (isRetryableByTrait(error) || isClockSkewCorrectedError(error) || error.name === "InvalidSignatureException" && error.message?.includes("Signature expired") || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error) || isNodeJsHttp2TransientError(error) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1));
630
+ var isServerError = (error) => {
631
+ if (error.$metadata?.httpStatusCode !== void 0) {
632
+ const statusCode = error.$metadata.httpStatusCode;
633
+ if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
634
+ return true;
635
+ }
636
+ return false;
603
637
  }
604
- return "CLIENT_ERROR";
605
- };
606
- var retryMiddlewareOptions = {
607
- name: "retryMiddleware",
608
- tags: ["RETRY"],
609
- step: "finalizeRequest",
610
- priority: "high",
611
- override: true
638
+ return false;
612
639
  };
613
- function bindGetRetryPlugin(isStreamingPayload2) {
614
- const retryMiddleware2 = bindRetryMiddleware(isStreamingPayload2);
615
- return (options) => ({
616
- applyToStack: (clientStack) => {
617
- clientStack.add(retryMiddleware2(options), retryMiddlewareOptions);
618
- }
619
- });
640
+ function isNodeJsHttp2TransientError(error) {
641
+ return error.code === "ERR_HTTP2_STREAM_ERROR" && error.message.includes("NGHTTP2_REFUSED_STREAM");
620
642
  }
621
643
 
622
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/submodules/retry/index.js
623
- var retryMiddleware = bindRetryMiddleware(isStreamingPayload);
624
- var getRetryPlugin = bindGetRetryPlugin(isStreamingPayload);
625
-
626
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js
627
- function resolveHostHeaderConfig(input) {
628
- return input;
629
- }
630
- var hostHeaderMiddleware = (options) => (next) => async (args) => {
631
- if (!HttpRequest.isInstance(args.request)) {
632
- return next(args);
644
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRateLimiter.js
645
+ var DefaultRateLimiter = class _DefaultRateLimiter {
646
+ static setTimeoutFn = (fn, delay) => setTimeout(fn, delay);
647
+ beta;
648
+ minCapacity;
649
+ minFillRate;
650
+ scaleConstant;
651
+ smooth;
652
+ enabled = false;
653
+ availableTokens = 0;
654
+ lastMaxRate = 0;
655
+ measuredTxRate = 0;
656
+ requestCount = 0;
657
+ fillRate;
658
+ lastThrottleTime;
659
+ lastTimestamp = 0;
660
+ lastTxRateBucket;
661
+ maxCapacity;
662
+ timeWindow = 0;
663
+ constructor(options) {
664
+ this.beta = options?.beta ?? 0.7;
665
+ this.minCapacity = options?.minCapacity ?? 1;
666
+ this.minFillRate = options?.minFillRate ?? 0.5;
667
+ this.scaleConstant = options?.scaleConstant ?? 0.4;
668
+ this.smooth = options?.smooth ?? 0.8;
669
+ this.lastThrottleTime = this.getCurrentTimeInSeconds();
670
+ this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
671
+ this.fillRate = this.minFillRate;
672
+ this.maxCapacity = this.minCapacity;
633
673
  }
634
- const { request } = args;
635
- const { handlerProtocol = "" } = options.requestHandler.metadata || {};
636
- if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
637
- delete request.headers["host"];
638
- request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
639
- } else if (!request.headers["host"]) {
640
- let host = request.hostname;
641
- if (request.port != null) {
642
- host += `:${request.port}`;
674
+ async getSendToken() {
675
+ return this.acquireTokenBucket(1);
676
+ }
677
+ updateClientSendingRate(response) {
678
+ let calculatedRate;
679
+ this.updateMeasuredRate();
680
+ const retryErrorInfo = response;
681
+ const isThrottling = retryErrorInfo?.errorType === "THROTTLING" || isThrottlingError(retryErrorInfo?.error ?? response);
682
+ if (isThrottling) {
683
+ const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
684
+ this.lastMaxRate = rateToUse;
685
+ this.calculateTimeWindow();
686
+ this.lastThrottleTime = this.getCurrentTimeInSeconds();
687
+ calculatedRate = this.cubicThrottle(rateToUse);
688
+ this.enableTokenBucket();
689
+ } else {
690
+ this.calculateTimeWindow();
691
+ calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
643
692
  }
644
- request.headers["host"] = host;
693
+ const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
694
+ this.updateTokenBucketRate(newRate);
645
695
  }
646
- return next(args);
647
- };
648
- var hostHeaderMiddlewareOptions = {
649
- name: "hostHeaderMiddleware",
650
- step: "build",
651
- priority: "low",
652
- tags: ["HOST"],
653
- override: true
654
- };
655
- var getHostHeaderPlugin = (options) => ({
656
- applyToStack: (clientStack) => {
657
- clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
696
+ getCurrentTimeInSeconds() {
697
+ return Date.now() / 1e3;
658
698
  }
659
- });
660
-
661
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-logger/loggerMiddleware.js
662
- var loggerMiddleware = () => (next, context) => async (args) => {
663
- try {
664
- const response = await next(args);
665
- const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
666
- const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
667
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
668
- const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
669
- const { $metadata, ...outputWithoutMetadata } = response.output;
670
- logger?.info?.({
671
- clientName,
672
- commandName,
673
- input: inputFilterSensitiveLog(args.input),
674
- output: outputFilterSensitiveLog(outputWithoutMetadata),
675
- metadata: $metadata
676
- });
677
- return response;
678
- } catch (error) {
679
- const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
680
- const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
681
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
682
- logger?.error?.({
683
- clientName,
684
- commandName,
685
- input: inputFilterSensitiveLog(args.input),
686
- error,
687
- metadata: error.$metadata
688
- });
689
- throw error;
699
+ async acquireTokenBucket(amount) {
700
+ if (!this.enabled) {
701
+ return;
702
+ }
703
+ this.refillTokenBucket();
704
+ while (amount > this.availableTokens) {
705
+ const delay = (amount - this.availableTokens) / this.fillRate * 1e3;
706
+ await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay));
707
+ this.refillTokenBucket();
708
+ }
709
+ this.availableTokens = this.availableTokens - amount;
690
710
  }
691
- };
692
- var loggerMiddlewareOptions = {
693
- name: "loggerMiddleware",
694
- tags: ["LOGGER"],
695
- step: "initialize",
696
- override: true
697
- };
698
- var getLoggerPlugin = (options) => ({
699
- applyToStack: (clientStack) => {
700
- clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
711
+ refillTokenBucket() {
712
+ const timestamp = this.getCurrentTimeInSeconds();
713
+ if (!this.lastTimestamp) {
714
+ this.lastTimestamp = timestamp;
715
+ return;
716
+ }
717
+ const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
718
+ this.availableTokens = Math.min(this.maxCapacity, this.availableTokens + fillAmount);
719
+ this.lastTimestamp = timestamp;
701
720
  }
702
- });
703
-
704
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/configuration.js
705
- var recursionDetectionMiddlewareOptions = {
706
- step: "build",
707
- tags: ["RECURSION_DETECTION", "TRACE_CONTEXT_PROPAGATION"],
708
- name: "recursionDetectionMiddleware",
709
- override: true,
710
- priority: "low"
711
- };
712
-
713
- // ../../node_modules/.pnpm/@aws+lambda-invoke-store@0.3.0/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js
714
- var PROTECTED_KEYS = {
715
- REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"),
716
- X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),
717
- TENANT_ID: Symbol.for("_AWS_LAMBDA_TENANT_ID"),
718
- TRACEPARENT: Symbol.for("_AWS_LAMBDA_TRACEPARENT"),
719
- TRACESTATE: Symbol.for("_AWS_LAMBDA_TRACESTATE"),
720
- BAGGAGE: Symbol.for("_AWS_LAMBDA_BAGGAGE")
721
- };
722
- var NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? "");
723
- if (!NO_GLOBAL_AWS_LAMBDA) {
724
- globalThis.awslambda = globalThis.awslambda || {};
725
- }
726
- var InvokeStoreBase = class {
727
- static PROTECTED_KEYS = PROTECTED_KEYS;
728
- isProtectedKey(key) {
729
- return Object.values(PROTECTED_KEYS).includes(key);
721
+ calculateTimeWindow() {
722
+ this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
730
723
  }
731
- getRequestId() {
732
- return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-";
724
+ cubicThrottle(rateToUse) {
725
+ return this.getPrecise(rateToUse * this.beta);
733
726
  }
734
- getXRayTraceId() {
735
- return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID);
727
+ cubicSuccess(timestamp) {
728
+ return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
736
729
  }
737
- getTenantId() {
738
- return this.get(PROTECTED_KEYS.TENANT_ID);
730
+ enableTokenBucket() {
731
+ this.enabled = true;
739
732
  }
740
- getTraceparent() {
741
- return this.get(PROTECTED_KEYS.TRACEPARENT);
733
+ updateTokenBucketRate(newRate) {
734
+ this.refillTokenBucket();
735
+ this.fillRate = Math.max(newRate, this.minFillRate);
736
+ this.maxCapacity = Math.max(newRate, this.minCapacity);
737
+ this.availableTokens = Math.min(this.availableTokens, this.maxCapacity);
742
738
  }
743
- getTracestate() {
744
- return this.get(PROTECTED_KEYS.TRACESTATE);
739
+ updateMeasuredRate() {
740
+ const t = this.getCurrentTimeInSeconds();
741
+ const timeBucket = Math.floor(t * 2) / 2;
742
+ this.requestCount++;
743
+ if (timeBucket > this.lastTxRateBucket) {
744
+ const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
745
+ this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
746
+ this.requestCount = 0;
747
+ this.lastTxRateBucket = timeBucket;
748
+ }
745
749
  }
746
- getBaggage() {
747
- return this.get(PROTECTED_KEYS.BAGGAGE);
750
+ getPrecise(num) {
751
+ return parseFloat(num.toFixed(8));
748
752
  }
749
753
  };
750
- var InvokeStoreSingle = class extends InvokeStoreBase {
751
- currentContext;
752
- getContext() {
753
- return this.currentContext;
754
+
755
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/constants.js
756
+ var MAXIMUM_RETRY_DELAY = 20 * 1e3;
757
+ var INITIAL_RETRY_TOKENS = 500;
758
+ var NO_RETRY_INCREMENT = 1;
759
+ var INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
760
+ var REQUEST_HEADER = "amz-sdk-request";
761
+
762
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js
763
+ var Retry = class {
764
+ static v2026 = true;
765
+ static delay() {
766
+ return 50;
754
767
  }
755
- hasContext() {
756
- return this.currentContext !== void 0;
768
+ static throttlingDelay() {
769
+ return 1e3;
757
770
  }
758
- get(key) {
759
- return this.currentContext?.[key];
771
+ static cost() {
772
+ return 14;
760
773
  }
761
- set(key, value) {
762
- if (this.isProtectedKey(key)) {
763
- throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
764
- }
765
- this.currentContext = this.currentContext || {};
766
- this.currentContext[key] = value;
774
+ static throttlingCost() {
775
+ return 5;
767
776
  }
768
- run(context, fn) {
769
- this.currentContext = context;
770
- return fn();
777
+ static modifiedCostType() {
778
+ return "THROTTLING";
771
779
  }
772
780
  };
773
- var InvokeStoreMulti = class _InvokeStoreMulti extends InvokeStoreBase {
774
- als;
775
- static async create() {
776
- const instance = new _InvokeStoreMulti();
777
- const asyncHooks = await import("async_hooks");
778
- instance.als = new asyncHooks.AsyncLocalStorage();
779
- return instance;
781
+
782
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryBackoffStrategy.js
783
+ var DefaultRetryBackoffStrategy = class {
784
+ x = Retry.delay();
785
+ computeNextBackoffDelay(i) {
786
+ const b = Math.random();
787
+ const r = 2;
788
+ const t_i = b * Math.min(this.x * r ** i, MAXIMUM_RETRY_DELAY);
789
+ return Math.floor(t_i);
780
790
  }
781
- getContext() {
782
- return this.als.getStore();
791
+ setDelayBase(delay) {
792
+ this.x = delay;
783
793
  }
784
- hasContext() {
785
- return this.als.getStore() !== void 0;
794
+ };
795
+
796
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryToken.js
797
+ var DefaultRetryToken = class {
798
+ delay;
799
+ count;
800
+ cost;
801
+ longPoll;
802
+ $retryLog = {
803
+ acquisitionDelay: 0
804
+ };
805
+ constructor(delay, count, cost, longPoll) {
806
+ this.delay = delay;
807
+ this.count = count;
808
+ this.cost = cost;
809
+ this.longPoll = longPoll;
786
810
  }
787
- get(key) {
788
- return this.als.getStore()?.[key];
811
+ getRetryCount() {
812
+ return this.count;
789
813
  }
790
- set(key, value) {
791
- if (this.isProtectedKey(key)) {
792
- throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
793
- }
794
- const store = this.als.getStore();
795
- if (!store) {
796
- throw new Error("No context available");
797
- }
798
- store[key] = value;
814
+ getRetryDelay() {
815
+ return Math.min(MAXIMUM_RETRY_DELAY, this.delay);
799
816
  }
800
- run(context, fn) {
801
- return this.als.run(context, fn);
817
+ getRetryCost() {
818
+ return this.cost;
819
+ }
820
+ isLongPoll() {
821
+ return this.longPoll;
802
822
  }
803
823
  };
804
- var InvokeStore;
805
- (function(InvokeStore2) {
806
- let instance = null;
807
- async function getInstanceAsync(forceInvokeStoreMulti) {
808
- if (!instance) {
809
- instance = (async () => {
810
- const isMulti = forceInvokeStoreMulti === true || "AWS_LAMBDA_MAX_CONCURRENCY" in process.env;
811
- const newInstance = isMulti ? await InvokeStoreMulti.create() : new InvokeStoreSingle();
812
- if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) {
813
- return globalThis.awslambda.InvokeStore;
814
- } else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) {
815
- globalThis.awslambda.InvokeStore = newInstance;
816
- return newInstance;
817
- } else {
818
- return newInstance;
819
- }
820
- })();
824
+
825
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/config.js
826
+ var RETRY_MODES;
827
+ (function(RETRY_MODES2) {
828
+ RETRY_MODES2["STANDARD"] = "standard";
829
+ RETRY_MODES2["ADAPTIVE"] = "adaptive";
830
+ })(RETRY_MODES || (RETRY_MODES = {}));
831
+ var DEFAULT_MAX_ATTEMPTS = 3;
832
+ var DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
833
+
834
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js
835
+ var refusal = {
836
+ incompatible: 1,
837
+ attempts: 2,
838
+ capacity: 3
839
+ };
840
+ var StandardRetryStrategy = class {
841
+ mode = RETRY_MODES.STANDARD;
842
+ retryBackoffStrategy;
843
+ capacity = INITIAL_RETRY_TOKENS;
844
+ maxAttemptsProvider;
845
+ baseDelay;
846
+ constructor(arg1) {
847
+ if (typeof arg1 === "number") {
848
+ this.maxAttemptsProvider = async () => arg1;
849
+ } else if (typeof arg1 === "function") {
850
+ this.maxAttemptsProvider = arg1;
851
+ } else if (arg1 && typeof arg1 === "object") {
852
+ this.maxAttemptsProvider = async () => arg1.maxAttempts;
853
+ this.baseDelay = arg1.baseDelay;
854
+ this.retryBackoffStrategy = arg1.backoff;
821
855
  }
822
- return instance;
856
+ this.maxAttemptsProvider ??= async () => DEFAULT_MAX_ATTEMPTS;
857
+ this.baseDelay ??= Retry.delay();
858
+ this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
823
859
  }
824
- InvokeStore2.getInstanceAsync = getInstanceAsync;
825
- InvokeStore2._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? {
826
- reset: () => {
827
- instance = null;
828
- if (globalThis.awslambda?.InvokeStore) {
829
- delete globalThis.awslambda.InvokeStore;
830
- }
831
- globalThis.awslambda = { InvokeStore: void 0 };
832
- }
833
- } : void 0;
834
- })(InvokeStore || (InvokeStore = {}));
835
-
836
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.js
837
- var AWS_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
838
- var _X_AMZN_TRACE_ID = "_X_AMZN_TRACE_ID";
839
- var X_AMZN_TRACE_ID = "X-Amzn-Trace-Id";
840
- var TRACEPARENT = "traceparent";
841
- var TRACESTATE = "tracestate";
842
- var BAGGAGE = "baggage";
843
- var recursionDetectionMiddleware = () => (next) => async (args) => {
844
- const { request } = args;
845
- if (!HttpRequest.isInstance(request)) {
846
- return next(args);
860
+ async acquireInitialRetryToken(retryTokenScope) {
861
+ return new DefaultRetryToken(Retry.delay(), 0, void 0, retryTokenScope.includes(":longpoll"));
847
862
  }
848
- let invokeStore;
849
- {
850
- const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === X_AMZN_TRACE_ID.toLowerCase()) ?? X_AMZN_TRACE_ID;
851
- if (!request.headers.hasOwnProperty(traceIdHeader)) {
852
- const functionName = process.env[AWS_LAMBDA_FUNCTION_NAME];
853
- const traceIdFromEnv = process.env[_X_AMZN_TRACE_ID];
854
- invokeStore ??= await InvokeStore.getInstanceAsync();
855
- const traceIdFromInvokeStore = invokeStore?.getXRayTraceId();
856
- const traceId = traceIdFromInvokeStore ?? traceIdFromEnv;
857
- const nonEmptyString = (str) => typeof str === "string" && str.length > 0;
858
- if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
859
- request.headers[X_AMZN_TRACE_ID] = traceId;
863
+ async refreshRetryTokenForRetry(token, errorInfo) {
864
+ const maxAttempts = await this.getMaxAttempts();
865
+ const retryCode = this.retryCode(token, errorInfo, maxAttempts);
866
+ const shouldRetry = retryCode === 0;
867
+ const isLongPoll = token.isLongPoll?.();
868
+ if (shouldRetry || isLongPoll) {
869
+ const errorType = errorInfo.errorType;
870
+ this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? Retry.throttlingDelay() : this.baseDelay);
871
+ const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
872
+ let retryDelay = delayFromErrorType;
873
+ if (errorInfo.retryAfterHint instanceof Date) {
874
+ retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5e3));
860
875
  }
861
- }
862
- }
863
- {
864
- sanitizeTraceHeaders(request.headers);
865
- const existingTraceparent = request.headers[TRACEPARENT];
866
- if (!existingTraceparent) {
867
- const traceparent = (invokeStore ??= await InvokeStore.getInstanceAsync())?.getTraceparent?.();
868
- if (traceparent) {
869
- request.headers[TRACEPARENT] = traceparent;
870
- const tracestate = invokeStore?.getTracestate?.();
871
- if (tracestate) {
872
- request.headers[TRACESTATE] = tracestate;
873
- }
874
- const baggage = invokeStore?.getBaggage?.();
875
- if (baggage) {
876
- request.headers[BAGGAGE] = baggage;
876
+ if (!shouldRetry) {
877
+ const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
878
+ if (longPollBackoff > 0) {
879
+ await new Promise((r) => setTimeout(r, longPollBackoff));
877
880
  }
878
- }
879
- }
880
- }
881
- return next(args);
882
- };
883
- function sanitizeTraceHeaders(headers) {
884
- for (const header of Object.keys(headers)) {
885
- const lower = header.toLowerCase();
886
- if (header !== lower && (lower === TRACEPARENT || lower === TRACESTATE || lower === BAGGAGE)) {
887
- headers[lower] = headers[header];
888
- delete headers[header];
881
+ } else {
882
+ const capacityCost = this.getCapacityCost(errorType);
883
+ this.capacity -= capacityCost;
884
+ const nextToken = new DefaultRetryToken(0, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false);
885
+ await new Promise((r) => setTimeout(r, retryDelay));
886
+ nextToken.$retryLog.acquisitionDelay = retryDelay;
887
+ return nextToken;
888
+ }
889
889
  }
890
+ throw new Error("No retry token available");
890
891
  }
891
- }
892
-
893
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.js
894
- var getRecursionDetectionPlugin = (options) => ({
895
- applyToStack: (clientStack) => {
896
- clientStack.add(recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions);
892
+ recordSuccess(token) {
893
+ this.capacity = Math.min(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
897
894
  }
898
- });
899
-
900
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/resolveAuthOptions.js
901
- var resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
902
- if (!authSchemePreference || authSchemePreference.length === 0) {
903
- return candidateAuthOptions;
895
+ getCapacity() {
896
+ return this.capacity;
904
897
  }
905
- const preferredAuthOptions = [];
906
- for (const preferredSchemeName of authSchemePreference) {
907
- for (const candidateAuthOption of candidateAuthOptions) {
908
- const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
909
- if (candidateAuthSchemeName === preferredSchemeName) {
910
- preferredAuthOptions.push(candidateAuthOption);
911
- }
912
- }
898
+ async maxAttempts() {
899
+ return this.maxAttemptsProvider();
913
900
  }
914
- for (const candidateAuthOption of candidateAuthOptions) {
915
- if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
916
- preferredAuthOptions.push(candidateAuthOption);
901
+ async getMaxAttempts() {
902
+ try {
903
+ return await this.maxAttemptsProvider();
904
+ } catch (ignored) {
905
+ console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
906
+ return DEFAULT_MAX_ATTEMPTS;
917
907
  }
918
908
  }
919
- return preferredAuthOptions;
920
- };
921
-
922
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
923
- function convertHttpAuthSchemesToMap(httpAuthSchemes) {
924
- const map = /* @__PURE__ */ new Map();
925
- for (const scheme of httpAuthSchemes) {
926
- map.set(scheme.schemeId, scheme);
909
+ retryCode(tokenToRenew, errorInfo, maxAttempts) {
910
+ const attempts = tokenToRenew.getRetryCount() + 1;
911
+ const retryableStatus = this.isRetryableError(errorInfo.errorType) ? 0 : refusal.incompatible;
912
+ const attemptStatus = attempts < maxAttempts ? 0 : refusal.attempts;
913
+ const capacityStatus = this.capacity >= this.getCapacityCost(errorInfo.errorType) ? 0 : refusal.capacity;
914
+ return retryableStatus || attemptStatus || capacityStatus;
927
915
  }
928
- return map;
929
- }
930
- var httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
931
- const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
932
- const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
933
- const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
934
- const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
935
- const smithyContext = getSmithyContext(context);
936
- const failureReasons = [];
937
- for (const option of resolvedOptions) {
938
- const scheme = authSchemes.get(option.schemeId);
939
- if (!scheme) {
940
- failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
941
- continue;
942
- }
943
- const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
944
- if (!identityProvider) {
945
- failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
946
- continue;
947
- }
948
- const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
949
- option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
950
- option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
951
- smithyContext.selectedHttpAuthScheme = {
952
- httpAuthOption: option,
953
- identity: await identityProvider(option.identityProperties),
954
- signer: scheme.signer
955
- };
956
- break;
916
+ getCapacityCost(errorType) {
917
+ return errorType === Retry.modifiedCostType() ? Retry.throttlingCost() : Retry.cost();
957
918
  }
958
- if (!smithyContext.selectedHttpAuthScheme) {
959
- throw new Error(failureReasons.join("\n"));
919
+ isRetryableError(errorType) {
920
+ return errorType === "THROTTLING" || errorType === "TRANSIENT";
960
921
  }
961
- return next(args);
962
922
  };
963
923
 
964
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js
965
- var httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
966
- step: "serialize",
967
- tags: ["HTTP_AUTH_SCHEME"],
968
- name: "httpAuthSchemeMiddleware",
969
- override: true,
970
- relation: "before",
971
- toMiddleware: "endpointV2Middleware"
972
- };
973
- var getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
974
- applyToStack: (clientStack) => {
975
- clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
976
- httpAuthSchemeParametersProvider,
977
- identityProviderConfigProvider
978
- }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
924
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/AdaptiveRetryStrategy.js
925
+ var AdaptiveRetryStrategy = class {
926
+ mode = RETRY_MODES.ADAPTIVE;
927
+ rateLimiter;
928
+ standardRetryStrategy;
929
+ constructor(maxAttemptsProvider, options) {
930
+ const { rateLimiter } = options ?? {};
931
+ this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
932
+ this.standardRetryStrategy = options ? new StandardRetryStrategy({
933
+ maxAttempts: typeof maxAttemptsProvider === "number" ? maxAttemptsProvider : 3,
934
+ ...options
935
+ }) : new StandardRetryStrategy(maxAttemptsProvider);
979
936
  }
980
- });
981
-
982
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js
983
- var defaultErrorHandler = (signingProperties) => (error) => {
984
- throw error;
985
- };
986
- var defaultSuccessHandler = (httpResponse, signingProperties) => {
987
- };
988
- var httpSigningMiddleware = (config) => (next, context) => async (args) => {
989
- if (!HttpRequest.isInstance(args.request)) {
990
- return next(args);
937
+ async acquireInitialRetryToken(retryTokenScope) {
938
+ const token = await this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
939
+ await this.rateLimiter.getSendToken();
940
+ return token;
991
941
  }
992
- const smithyContext = getSmithyContext(context);
993
- const scheme = smithyContext.selectedHttpAuthScheme;
994
- if (!scheme) {
995
- throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
942
+ async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
943
+ this.rateLimiter.updateClientSendingRate(errorInfo);
944
+ const token = await this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
945
+ await this.rateLimiter.getSendToken();
946
+ return token;
996
947
  }
997
- const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
998
- const output = await next({
999
- ...args,
1000
- request: await signer.sign(args.request, identity, signingProperties)
1001
- }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
1002
- (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
1003
- return output;
1004
- };
1005
-
1006
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/getHttpSigningMiddleware.js
1007
- var httpSigningMiddlewareOptions = {
1008
- step: "finalizeRequest",
1009
- tags: ["HTTP_SIGNING"],
1010
- name: "httpSigningMiddleware",
1011
- aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
1012
- override: true,
1013
- relation: "after",
1014
- toMiddleware: "retryMiddleware"
1015
- };
1016
- var getHttpSigningPlugin = (config) => ({
1017
- applyToStack: (clientStack) => {
1018
- clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
948
+ recordSuccess(token) {
949
+ this.rateLimiter.updateClientSendingRate({});
950
+ this.standardRetryStrategy.recordSuccess(token);
951
+ }
952
+ async maxAttemptsProvider() {
953
+ return this.standardRetryStrategy.maxAttempts();
1019
954
  }
1020
- });
1021
-
1022
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/pagination/createPaginator.js
1023
- var makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => {
1024
- let command = new CommandCtor(input);
1025
- command = withCommand(command) ?? command;
1026
- return await client.send(command, ...args);
1027
955
  };
1028
- function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
1029
- return async function* paginateOperation(config, input, ...additionalArguments) {
1030
- const _input = input;
1031
- let token = config.startingToken ?? _input[inputTokenName];
1032
- let hasNext = true;
1033
- let page;
1034
- while (hasNext) {
1035
- _input[inputTokenName] = token;
1036
- if (pageSizeTokenName) {
1037
- _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;
1038
- }
1039
- if (config.client instanceof ClientCtor) {
1040
- page = await makePagedClientRequest(CommandCtor, config.client, input, config.withCommand, ...additionalArguments);
1041
- } else {
1042
- throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
1043
- }
1044
- yield page;
1045
- const prevToken = token;
1046
- token = get(page, outputTokenName);
1047
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
956
+
957
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js
958
+ var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
959
+ var CONFIG_MAX_ATTEMPTS = "max_attempts";
960
+ var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
961
+ environmentVariableSelector: (env2) => {
962
+ const value = env2[ENV_MAX_ATTEMPTS];
963
+ if (!value) {
964
+ return void 0;
1048
965
  }
1049
- return void 0;
1050
- };
1051
- }
1052
- var get = (fromObject, path) => {
1053
- let cursor = fromObject;
1054
- const pathComponents = path.split(".");
1055
- for (const step of pathComponents) {
1056
- if (!cursor || typeof cursor !== "object") {
966
+ const maxAttempt = parseInt(value);
967
+ if (Number.isNaN(maxAttempt)) {
968
+ throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
969
+ }
970
+ return maxAttempt;
971
+ },
972
+ configFileSelector: (profile) => {
973
+ const value = profile[CONFIG_MAX_ATTEMPTS];
974
+ if (!value) {
1057
975
  return void 0;
1058
976
  }
1059
- cursor = cursor[step];
977
+ const maxAttempt = parseInt(value);
978
+ if (Number.isNaN(maxAttempt)) {
979
+ throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
980
+ }
981
+ return maxAttempt;
982
+ },
983
+ default: DEFAULT_MAX_ATTEMPTS
984
+ };
985
+ var resolveRetryConfig = (input, defaults) => {
986
+ const { retryStrategy, retryMode } = input;
987
+ const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
988
+ const maxAttemptsProvider = normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
989
+ let controller = retryStrategy ? Promise.resolve(retryStrategy) : void 0;
990
+ const getDefault = async () => {
991
+ const maxAttempts = await maxAttemptsProvider();
992
+ const adaptive = await normalizeProvider(retryMode)() === RETRY_MODES.ADAPTIVE;
993
+ if (adaptive) {
994
+ return new AdaptiveRetryStrategy(maxAttemptsProvider, {
995
+ maxAttempts,
996
+ baseDelay: defaultBaseDelay
997
+ });
998
+ }
999
+ return new StandardRetryStrategy({
1000
+ maxAttempts,
1001
+ baseDelay: defaultBaseDelay
1002
+ });
1003
+ };
1004
+ return Object.assign(input, {
1005
+ maxAttempts: maxAttemptsProvider,
1006
+ retryStrategy: () => controller ??= getDefault()
1007
+ });
1008
+ };
1009
+ var ENV_RETRY_MODE = "AWS_RETRY_MODE";
1010
+ var CONFIG_RETRY_MODE = "retry_mode";
1011
+ var NODE_RETRY_MODE_CONFIG_OPTIONS = {
1012
+ environmentVariableSelector: (env2) => env2[ENV_RETRY_MODE],
1013
+ configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
1014
+ default: DEFAULT_RETRY_MODE
1015
+ };
1016
+
1017
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.js
1018
+ import { Readable } from "stream";
1019
+ var isStreamingPayload = (request) => request?.body instanceof Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream;
1020
+
1021
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/race.js
1022
+ var race = (promise, signal) => {
1023
+ if (!signal) {
1024
+ return promise;
1060
1025
  }
1061
- return cursor;
1026
+ let cleanup = () => {
1027
+ };
1028
+ const aborted = new Promise((_, reject) => {
1029
+ const handler = () => reject(createAbortError());
1030
+ if (signal.aborted) {
1031
+ handler();
1032
+ } else if (typeof signal.addEventListener === "function") {
1033
+ signal.addEventListener("abort", handler, { once: true });
1034
+ cleanup = () => signal.removeEventListener("abort", handler);
1035
+ } else {
1036
+ signal.onabort = handler;
1037
+ }
1038
+ });
1039
+ return Promise.race([promise, aborted]).finally(cleanup);
1062
1040
  };
1041
+ var createAbortError = () => Object.assign(new Error("Request aborted"), { name: "AbortError" });
1042
+ var isAbortError = (error) => typeof error === "object" && error !== null && "name" in error && error.name === "AbortError";
1063
1043
 
1064
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js
1065
- var DefaultIdentityProviderConfig = class {
1066
- authSchemes = /* @__PURE__ */ new Map();
1067
- constructor(config) {
1068
- for (const key in config) {
1069
- if (!hasOwn(config, key)) {
1070
- continue;
1044
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js
1045
+ function parseRetryAfterHeader(response, logger) {
1046
+ if (!HttpResponse.isInstance(response)) {
1047
+ return;
1048
+ }
1049
+ for (const header in response.headers) {
1050
+ if (!hasOwn(response.headers, header)) {
1051
+ continue;
1052
+ }
1053
+ const h = header.toLowerCase();
1054
+ if (h === "retry-after") {
1055
+ const retryAfter = response.headers[header];
1056
+ let retryAfterSeconds = NaN;
1057
+ if (retryAfter.endsWith("GMT")) {
1058
+ try {
1059
+ const date = parseRfc7231DateTime(retryAfter);
1060
+ retryAfterSeconds = (date.getTime() - Date.now()) / 1e3;
1061
+ } catch (e) {
1062
+ logger?.trace?.("Failed to parse retry-after header");
1063
+ logger?.trace?.(e);
1064
+ }
1065
+ } else if (retryAfter.match(/ GMT, ((\d+)|(\d+\.\d+))$/)) {
1066
+ retryAfterSeconds = Number(retryAfter.match(/ GMT, ([\d.]+)$/)?.[1]);
1067
+ } else if (retryAfter.match(/^((\d+)|(\d+\.\d+))$/)) {
1068
+ retryAfterSeconds = Number(retryAfter);
1069
+ } else if (Date.parse(retryAfter) >= Date.now()) {
1070
+ retryAfterSeconds = (Date.parse(retryAfter) - Date.now()) / 1e3;
1071
1071
  }
1072
- const value = config[key];
1073
- if (value !== void 0) {
1074
- this.authSchemes.set(key, value);
1072
+ if (isNaN(retryAfterSeconds)) {
1073
+ return;
1074
+ }
1075
+ return new Date(Date.now() + retryAfterSeconds * 1e3);
1076
+ } else if (h === "x-amz-retry-after") {
1077
+ const v = response.headers[header];
1078
+ const backoffMilliseconds = Number(v);
1079
+ if (isNaN(backoffMilliseconds)) {
1080
+ logger?.trace?.(`Failed to parse x-amz-retry-after=${v}`);
1081
+ return;
1075
1082
  }
1083
+ return new Date(Date.now() + backoffMilliseconds);
1076
1084
  }
1077
1085
  }
1078
- getIdentityProvider(schemeId) {
1079
- return this.authSchemes.get(schemeId);
1080
- }
1081
- };
1086
+ }
1082
1087
 
1083
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/noAuth.js
1084
- var NoAuthSigner = class {
1085
- async sign(httpRequest, identity, signingProperties) {
1086
- return httpRequest;
1088
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js
1089
+ var asSdkError = (error) => {
1090
+ if (error instanceof Error) {
1091
+ return error;
1092
+ }
1093
+ if (error instanceof Object) {
1094
+ return Object.assign(new Error(), error);
1095
+ }
1096
+ if (typeof error === "string") {
1097
+ return new Error(error);
1087
1098
  }
1099
+ return new Error(`AWS SDK error wrapper for ${error}`);
1088
1100
  };
1089
1101
 
1090
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/memoizeIdentityProvider.js
1091
- var createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(identity) {
1092
- return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
1093
- };
1094
- var EXPIRATION_MS = 3e5;
1095
- var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
1096
- var doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0;
1097
- var memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
1098
- if (provider === void 0) {
1099
- return void 0;
1100
- }
1101
- const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
1102
- let resolved;
1103
- let pending;
1104
- let hasResult;
1105
- let isConstant = false;
1106
- const coalesceProvider = async (options) => {
1107
- if (!pending) {
1108
- pending = normalizedProvider(options);
1109
- }
1110
- try {
1111
- resolved = await pending;
1112
- hasResult = true;
1113
- isConstant = false;
1114
- } finally {
1115
- pending = void 0;
1116
- }
1117
- return resolved;
1118
- };
1119
- if (isExpired === void 0) {
1120
- return async (options) => {
1121
- if (!hasResult || options?.forceRefresh) {
1122
- resolved = await coalesceProvider(options);
1102
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js
1103
+ function bindRetryMiddleware(isStreamingPayload2) {
1104
+ return (options) => (next, context) => async (args) => {
1105
+ let retryStrategy = await options.retryStrategy();
1106
+ const maxAttempts = await options.maxAttempts();
1107
+ const abortSignal = context[SMITHY_CONTEXT_KEY]?.abortSignal;
1108
+ if (isRetryStrategyV2(retryStrategy)) {
1109
+ retryStrategy = retryStrategy;
1110
+ const retryTokenScope = (context["partition_id"] ?? "") + (context.__retryLongPoll ? ":longpoll" : "");
1111
+ let retryToken = await race(retryStrategy.acquireInitialRetryToken(retryTokenScope), abortSignal);
1112
+ let lastError = new Error();
1113
+ let attempts = 0;
1114
+ let totalRetryDelay = 0;
1115
+ const { request } = args;
1116
+ const isRequest = HttpRequest.isInstance(request);
1117
+ if (isRequest) {
1118
+ request.headers[INVOCATION_ID_HEADER] = v4();
1123
1119
  }
1124
- return resolved;
1125
- };
1126
- }
1127
- return async (options) => {
1128
- if (!hasResult || options?.forceRefresh) {
1129
- resolved = await coalesceProvider(options);
1130
- }
1131
- if (isConstant) {
1132
- return resolved;
1133
- }
1134
- if (!requiresRefresh(resolved)) {
1135
- isConstant = true;
1136
- return resolved;
1137
- }
1138
- if (isExpired(resolved)) {
1139
- await coalesceProvider(options);
1140
- return resolved;
1120
+ while (true) {
1121
+ try {
1122
+ if (isRequest) {
1123
+ request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
1124
+ }
1125
+ const { response, output } = await next(args);
1126
+ retryStrategy.recordSuccess(retryToken);
1127
+ output.$metadata.attempts = attempts + 1;
1128
+ output.$metadata.totalRetryDelay = totalRetryDelay;
1129
+ return { response, output };
1130
+ } catch (e) {
1131
+ const retryErrorInfo = getRetryErrorInfo(e, options.logger);
1132
+ lastError = asSdkError(e);
1133
+ if (isRequest && isStreamingPayload2(request)) {
1134
+ (context.logger instanceof NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
1135
+ throw lastError;
1136
+ }
1137
+ try {
1138
+ retryToken = await race(retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo), abortSignal);
1139
+ } catch (refreshError) {
1140
+ if (abortSignal?.aborted && isAbortError(refreshError)) {
1141
+ throw refreshError;
1142
+ }
1143
+ if (!lastError.$metadata) {
1144
+ lastError.$metadata = {};
1145
+ }
1146
+ lastError.$metadata.attempts = attempts + 1;
1147
+ lastError.$metadata.totalRetryDelay = totalRetryDelay;
1148
+ throw lastError;
1149
+ }
1150
+ attempts = retryToken.getRetryCount();
1151
+ const delay = retryToken.getRetryDelay();
1152
+ totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay;
1153
+ if (delay > 0) {
1154
+ await race(new Promise((resolve) => setTimeout(resolve, delay)), abortSignal);
1155
+ }
1156
+ }
1157
+ }
1158
+ } else {
1159
+ retryStrategy = retryStrategy;
1160
+ if (retryStrategy?.mode) {
1161
+ context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
1162
+ }
1163
+ return retryStrategy.retry(next, args);
1141
1164
  }
1142
- return resolved;
1143
1165
  };
1144
- };
1145
-
1146
- // ../../node_modules/.pnpm/@smithy+core@3.38.1/node_modules/@smithy/core/dist-es/normalizeProvider.js
1147
- var normalizeProvider2 = (input) => {
1148
- if (typeof input === "function") {
1149
- return input;
1166
+ }
1167
+ var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
1168
+ var getRetryErrorInfo = (error, logger) => {
1169
+ const errorInfo = {
1170
+ error,
1171
+ errorType: getRetryErrorType(error)
1172
+ };
1173
+ const retryAfterHint = parseRetryAfterHeader(error.$response, logger);
1174
+ if (retryAfterHint) {
1175
+ errorInfo.retryAfterHint = retryAfterHint;
1150
1176
  }
1151
- const promisified = Promise.resolve(input);
1152
- return () => promisified;
1177
+ return errorInfo;
1153
1178
  };
1154
-
1155
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/configurations.js
1156
- var DEFAULT_UA_APP_ID = void 0;
1157
- function isValidUserAgentAppId(appId) {
1158
- if (appId === void 0) {
1159
- return true;
1179
+ var getRetryErrorType = (error) => {
1180
+ if (isThrottlingError(error)) {
1181
+ return "THROTTLING";
1160
1182
  }
1161
- return typeof appId === "string" && appId.length <= 50;
1162
- }
1163
- function resolveUserAgentConfig(input) {
1164
- const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
1165
- const { customUserAgent } = input;
1166
- return Object.assign(input, {
1167
- customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
1168
- userAgentAppId: async () => {
1169
- const appId = await normalizedAppIdProvider();
1170
- if (!isValidUserAgentAppId(appId)) {
1171
- const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
1172
- if (typeof appId !== "string") {
1173
- logger?.warn("userAgentAppId must be a string or undefined.");
1174
- } else if (appId.length > 50) {
1175
- logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
1176
- }
1177
- }
1178
- return appId;
1183
+ if (isTransientError(error)) {
1184
+ return "TRANSIENT";
1185
+ }
1186
+ if (isServerError(error)) {
1187
+ return "SERVER_ERROR";
1188
+ }
1189
+ return "CLIENT_ERROR";
1190
+ };
1191
+ var retryMiddlewareOptions = {
1192
+ name: "retryMiddleware",
1193
+ tags: ["RETRY"],
1194
+ step: "finalizeRequest",
1195
+ priority: "high",
1196
+ override: true
1197
+ };
1198
+ function bindGetRetryPlugin(isStreamingPayload2) {
1199
+ const retryMiddleware2 = bindRetryMiddleware(isStreamingPayload2);
1200
+ return (options) => ({
1201
+ applyToStack: (clientStack) => {
1202
+ clientStack.add(retryMiddleware2(options), retryMiddlewareOptions);
1179
1203
  }
1180
1204
  });
1181
1205
  }
1182
1206
 
1183
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js
1207
+ // ../../node_modules/.pnpm/@smithy+core@3.40.0/node_modules/@smithy/core/dist-es/submodules/retry/index.js
1208
+ var retryMiddleware = bindRetryMiddleware(isStreamingPayload);
1209
+ var getRetryPlugin = bindGetRetryPlugin(isStreamingPayload);
1210
+
1211
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js
1184
1212
  var partitionsInfo = {
1185
1213
  "partitions": [
1186
1214
  {
@@ -1282,12 +1310,18 @@ var partitionsInfo = {
1282
1310
  "me-south-1": {
1283
1311
  "description": "Middle East (Bahrain)"
1284
1312
  },
1313
+ "me-west-1": {
1314
+ "description": "Middle East (Saudi Arabia)"
1315
+ },
1285
1316
  "mx-central-1": {
1286
1317
  "description": "Mexico (Central)"
1287
1318
  },
1288
1319
  "sa-east-1": {
1289
1320
  "description": "South America (Sao Paulo)"
1290
1321
  },
1322
+ "sa-west-1": {
1323
+ "description": "South America (Chile)"
1324
+ },
1291
1325
  "us-east-1": {
1292
1326
  "description": "US East (N. Virginia)"
1293
1327
  },
@@ -1458,7 +1492,7 @@ var partitionsInfo = {
1458
1492
  "version": "1.1"
1459
1493
  };
1460
1494
 
1461
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partition.js
1495
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partition.js
1462
1496
  var selectedPartitionsInfo = partitionsInfo;
1463
1497
  var selectedUserAgentPrefix = "";
1464
1498
  var partition = (value) => {
@@ -1492,8 +1526,7 @@ var partition = (value) => {
1492
1526
  };
1493
1527
  var getUserAgentPrefix = () => selectedUserAgentPrefix;
1494
1528
 
1495
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
1496
- Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
1529
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
1497
1530
  function setFeature(context, feature, value) {
1498
1531
  if (!context.__aws_sdk_context) {
1499
1532
  context.__aws_sdk_context = {
@@ -1505,7 +1538,7 @@ function setFeature(context, feature, value) {
1505
1538
  context.__aws_sdk_context.features[feature] = value;
1506
1539
  }
1507
1540
 
1508
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/check-features.js
1541
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/check-features.js
1509
1542
  var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
1510
1543
  async function checkFeatures(context, config, args) {
1511
1544
  const request = args.request;
@@ -1554,7 +1587,7 @@ async function checkFeatures(context, config, args) {
1554
1587
  }
1555
1588
  }
1556
1589
 
1557
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/constants.js
1590
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/constants.js
1558
1591
  var USER_AGENT = "user-agent";
1559
1592
  var X_AMZ_USER_AGENT = "x-amz-user-agent";
1560
1593
  var SPACE = " ";
@@ -1563,7 +1596,7 @@ var UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g;
1563
1596
  var UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g;
1564
1597
  var UA_ESCAPE_CHAR = "-";
1565
1598
 
1566
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/encode-features.js
1599
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/encode-features.js
1567
1600
  var BYTE_LIMIT = 1024;
1568
1601
  function encodeFeatures(features) {
1569
1602
  let buffer = "";
@@ -1582,7 +1615,7 @@ function encodeFeatures(features) {
1582
1615
  return buffer;
1583
1616
  }
1584
1617
 
1585
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/user-agent-middleware.js
1618
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/user-agent-middleware.js
1586
1619
  var userAgentMiddleware = (options) => (next, context) => async (args) => {
1587
1620
  const { request } = args;
1588
1621
  if (!HttpRequest.isInstance(request)) {
@@ -1651,7 +1684,7 @@ var getUserAgentPlugin = (config) => ({
1651
1684
  }
1652
1685
  });
1653
1686
 
1654
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js
1687
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js
1655
1688
  var state = {
1656
1689
  warningEmitted: false
1657
1690
  };
@@ -1677,11 +1710,23 @@ More information can be found at: https://a.co/c895JFp`);
1677
1710
  }
1678
1711
  };
1679
1712
 
1680
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js
1713
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/getDefaultSocketTimeout.js
1714
+ var isDefaultSocketTimeoutEnabled = () => typeof process === "object" && process?.env?.AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026 === "true";
1715
+ var getDefaultSocketTimeout = (requestHandler, timeoutMs) => {
1716
+ if (!isDefaultSocketTimeoutEnabled()) {
1717
+ return void 0;
1718
+ }
1719
+ if (typeof requestHandler?.handle === "function") {
1720
+ return void 0;
1721
+ }
1722
+ return timeoutMs;
1723
+ };
1724
+
1725
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js
1681
1726
  import { platform, release } from "os";
1682
1727
  import { env } from "process";
1683
1728
 
1684
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.js
1729
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.js
1685
1730
  import { versions } from "process";
1686
1731
  var getRuntimeUserAgentPair = () => {
1687
1732
  const runtimesToCheck = ["deno", "bun", "llrt"];
@@ -1693,12 +1738,12 @@ var getRuntimeUserAgentPair = () => {
1693
1738
  return ["md/nodejs", versions.node];
1694
1739
  };
1695
1740
 
1696
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/crt-availability.js
1741
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/crt-availability.js
1697
1742
  var crtAvailability = {
1698
1743
  isCrtAvailable: false
1699
1744
  };
1700
1745
 
1701
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/is-crt-available.js
1746
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/is-crt-available.js
1702
1747
  var isCrtAvailable = () => {
1703
1748
  if (crtAvailability.isCrtAvailable) {
1704
1749
  return ["md/crt-avail"];
@@ -1706,7 +1751,7 @@ var isCrtAvailable = () => {
1706
1751
  return null;
1707
1752
  };
1708
1753
 
1709
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js
1754
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js
1710
1755
  var createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
1711
1756
  const runtimeUserAgentPair = getRuntimeUserAgentPair();
1712
1757
  return async (config) => {
@@ -1733,7 +1778,7 @@ var createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
1733
1778
  };
1734
1779
  };
1735
1780
 
1736
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.js
1781
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.js
1737
1782
  var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
1738
1783
  var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
1739
1784
  var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
@@ -1743,7 +1788,7 @@ var NODE_APP_ID_CONFIG_OPTIONS = {
1743
1788
  default: DEFAULT_UA_APP_ID
1744
1789
  };
1745
1790
 
1746
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.js
1791
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.js
1747
1792
  var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
1748
1793
  if (allowSubDomains) {
1749
1794
  for (const label of value.split(".")) {
@@ -1768,7 +1813,7 @@ var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
1768
1813
  return true;
1769
1814
  };
1770
1815
 
1771
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js
1816
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js
1772
1817
  var ARN_DELIMITER = ":";
1773
1818
  var RESOURCE_DELIMITER = "/";
1774
1819
  var parseArn = (value) => {
@@ -1790,7 +1835,7 @@ var parseArn = (value) => {
1790
1835
  };
1791
1836
  };
1792
1837
 
1793
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/aws.js
1838
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/aws.js
1794
1839
  var awsEndpointFunctions = {
1795
1840
  isVirtualHostableS3Bucket,
1796
1841
  parseArn,
@@ -1798,7 +1843,7 @@ var awsEndpointFunctions = {
1798
1843
  };
1799
1844
  customEndpointFunctions.aws = awsEndpointFunctions;
1800
1845
 
1801
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.js
1846
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.js
1802
1847
  function stsRegionDefaultResolver(loaderConfig = {}) {
1803
1848
  return loadConfig({
1804
1849
  ...NODE_REGION_CONFIG_OPTIONS,
@@ -1814,7 +1859,7 @@ var warning = {
1814
1859
  silence: false
1815
1860
  };
1816
1861
 
1817
- // ../../node_modules/.pnpm/@aws-sdk+core@3.979.1/node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/extensions.js
1862
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.981.0/node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/extensions.js
1818
1863
  var getAwsRegionExtensionConfiguration = (runtimeConfig) => {
1819
1864
  return {
1820
1865
  setRegion(region) {
@@ -1834,12 +1879,8 @@ var resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) =
1834
1879
  export {
1835
1880
  emitWarningIfUnsupportedVersion,
1836
1881
  setCredentialFeature,
1837
- DEFAULT_RETRY_MODE,
1838
- NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
1839
- resolveRetryConfig,
1840
- NODE_RETRY_MODE_CONFIG_OPTIONS,
1841
- getRetryPlugin,
1842
1882
  setFeature,
1883
+ getDefaultSocketTimeout,
1843
1884
  resolveHostHeaderConfig,
1844
1885
  getHostHeaderPlugin,
1845
1886
  getLoggerPlugin,
@@ -1855,6 +1896,11 @@ export {
1855
1896
  doesIdentityRequireRefresh,
1856
1897
  memoizeIdentityProvider,
1857
1898
  resolveUserAgentConfig,
1899
+ DEFAULT_RETRY_MODE,
1900
+ NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
1901
+ resolveRetryConfig,
1902
+ NODE_RETRY_MODE_CONFIG_OPTIONS,
1903
+ getRetryPlugin,
1858
1904
  getUserAgentPlugin,
1859
1905
  createDefaultUserAgentProvider,
1860
1906
  NODE_APP_ID_CONFIG_OPTIONS,