@larkup/cli 0.3.22 → 0.3.25

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