@larkup/cli 0.2.24 → 0.2.26

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 (45) hide show
  1. package/README.md +8 -0
  2. package/dist/{analytics-store-KI3NXDYV.js → analytics-store-4NYU7DMO.js} +2 -2
  3. package/dist/api-X4PHQJTH.js +6943 -0
  4. package/dist/bowser-GZLEN3PD.js +2821 -0
  5. package/dist/{chroma-BCASZNMJ.js → chroma-RJVBZZMP.js} +2 -11
  6. package/dist/chunk-3EBUYTA7.js +136 -0
  7. package/dist/chunk-4XN2IRCG.js +46 -0
  8. package/dist/{chunk-FM6HYXZ5.js → chunk-5UWKP64Q.js} +24 -72
  9. package/dist/chunk-65EVYGDT.js +2904 -0
  10. package/dist/chunk-A7HMSODH.js +126 -0
  11. package/dist/chunk-BDMLJQRN.js +534 -0
  12. package/dist/chunk-FUTLPXFR.js +921 -0
  13. package/dist/chunk-HAABLEPO.js +1570 -0
  14. package/dist/chunk-HOPZALAP.js +449 -0
  15. package/dist/{chunk-L34L3RDQ.js → chunk-JZ3UCEGF.js} +157 -197
  16. package/dist/chunk-MACWQEJS.js +2091 -0
  17. package/dist/chunk-MYOADNR2.js +515 -0
  18. package/dist/chunk-N6IF5QLH.js +1850 -0
  19. package/dist/chunk-ODWAFTDP.js +1711 -0
  20. package/dist/chunk-QGM4M3NI.js +37 -0
  21. package/dist/chunk-S5DCG3CZ.js +41 -0
  22. package/dist/{chunk-I6JJWCUQ.js → chunk-V3VNCOZ6.js} +118 -29
  23. package/dist/dist-es-5DTOPEBY.js +322 -0
  24. package/dist/dist-es-BM4STLL5.js +70 -0
  25. package/dist/dist-es-DS5SFRTK.js +377 -0
  26. package/dist/dist-es-F6WXDZQY.js +88 -0
  27. package/dist/dist-es-KMHWFNXI.js +295 -0
  28. package/dist/dist-es-LRDDK5LI.js +11761 -0
  29. package/dist/dist-es-LWW2DNRF.js +139 -0
  30. package/dist/dist-es-NEADJWQM.js +176 -0
  31. package/dist/dist-es-S5FAFKBD.js +23 -0
  32. package/dist/dist-es-YD724GH3.js +221 -0
  33. package/dist/event-streams-NPIZBVLJ.js +43 -0
  34. package/dist/index.js +2163 -1798
  35. package/dist/{lancedb-UB2EPDCN.js → lancedb-TCUZKSHN.js} +1 -1
  36. package/dist/lexer-DQCqS3nf-CGRGK47I.js +62 -0
  37. package/dist/loadSso-HXXA5UNF.js +584 -0
  38. package/dist/{pinecone-OHOY4YYM.js → pinecone-ME3YOCQJ.js} +3 -21
  39. package/dist/signin-7FUGJFG3.js +822 -0
  40. package/dist/sso-oidc-EPMF7LMF.js +838 -0
  41. package/dist/sts-RBEOIBEJ.js +1118 -0
  42. package/dist/{tool-loader-KKODIWEV.js → tool-loader-PEQZZWTB.js} +3 -3
  43. package/dist/{tool-registry-CXCFMOWA.js → tool-registry-VJYLRXKJ.js} +2 -2
  44. package/package.json +20 -16
  45. package/dist/chunk-3RG5ZIWI.js +0 -10
@@ -0,0 +1,1850 @@
1
+ import {
2
+ NoOpLogger,
3
+ customEndpointFunctions,
4
+ isIpAddress
5
+ } from "./chunk-ODWAFTDP.js";
6
+ import {
7
+ NODE_REGION_CONFIG_FILE_OPTIONS,
8
+ NODE_REGION_CONFIG_OPTIONS,
9
+ loadConfig
10
+ } from "./chunk-HAABLEPO.js";
11
+ import {
12
+ HttpRequest,
13
+ HttpResponse,
14
+ getSmithyContext,
15
+ hasOwn,
16
+ isValidHostLabel,
17
+ normalizeProvider,
18
+ parseRfc7231DateTime,
19
+ v4
20
+ } from "./chunk-MACWQEJS.js";
21
+
22
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js
23
+ function setCredentialFeature(credentials, feature, value) {
24
+ if (!credentials.$source) {
25
+ credentials.$source = {};
26
+ }
27
+ credentials.$source[feature] = value;
28
+ return credentials;
29
+ }
30
+
31
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/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.33.3/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;
67
+ }
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) => 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;
77
+ }
78
+ return false;
79
+ }
80
+ return false;
81
+ };
82
+ function isNodeJsHttp2TransientError(error) {
83
+ return error.code === "ERR_HTTP2_STREAM_ERROR" && error.message.includes("NGHTTP2_REFUSED_STREAM");
84
+ }
85
+
86
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/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;
115
+ }
116
+ async getSendToken() {
117
+ return this.acquireTokenBucket(1);
118
+ }
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);
137
+ }
138
+ getCurrentTimeInSeconds() {
139
+ return Date.now() / 1e3;
140
+ }
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;
152
+ }
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;
162
+ }
163
+ calculateTimeWindow() {
164
+ this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
165
+ }
166
+ cubicThrottle(rateToUse) {
167
+ return this.getPrecise(rateToUse * this.beta);
168
+ }
169
+ cubicSuccess(timestamp) {
170
+ return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
171
+ }
172
+ enableTokenBucket() {
173
+ this.enabled = true;
174
+ }
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);
180
+ }
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
+ }
191
+ }
192
+ getPrecise(num) {
193
+ return parseFloat(num.toFixed(8));
194
+ }
195
+ };
196
+
197
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/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.33.3/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";
221
+ }
222
+ };
223
+
224
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/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;
235
+ }
236
+ };
237
+
238
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/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;
252
+ }
253
+ getRetryCount() {
254
+ return this.count;
255
+ }
256
+ getRetryDelay() {
257
+ return Math.min(MAXIMUM_RETRY_DELAY, this.delay);
258
+ }
259
+ getRetryCost() {
260
+ return this.cost;
261
+ }
262
+ isLongPoll() {
263
+ return this.longPoll;
264
+ }
265
+ };
266
+
267
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/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.33.3/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;
297
+ }
298
+ this.maxAttemptsProvider ??= async () => DEFAULT_MAX_ATTEMPTS;
299
+ this.baseDelay ??= Retry.delay();
300
+ this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
301
+ }
302
+ async acquireInitialRetryToken(retryTokenScope) {
303
+ return new DefaultRetryToken(Retry.delay(), 0, void 0, Retry.v2026 && retryTokenScope.includes(":longpoll"));
304
+ }
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));
317
+ }
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));
322
+ }
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
+ }
331
+ }
332
+ throw new Error("No retry token available");
333
+ }
334
+ recordSuccess(token) {
335
+ this.capacity = Math.min(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
336
+ }
337
+ getCapacity() {
338
+ return this.capacity;
339
+ }
340
+ async maxAttempts() {
341
+ return this.maxAttemptsProvider();
342
+ }
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;
349
+ }
350
+ }
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";
363
+ }
364
+ };
365
+
366
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/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;
389
+ }
390
+ recordSuccess(token) {
391
+ this.rateLimiter.updateClientSendingRate({});
392
+ this.standardRetryStrategy.recordSuccess(token);
393
+ }
394
+ async maxAttemptsProvider() {
395
+ return this.standardRetryStrategy.maxAttempts();
396
+ }
397
+ };
398
+
399
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/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
+ const maxAttempt = parseInt(value);
408
+ if (Number.isNaN(maxAttempt)) {
409
+ throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
410
+ }
411
+ return maxAttempt;
412
+ },
413
+ configFileSelector: (profile) => {
414
+ const value = profile[CONFIG_MAX_ATTEMPTS];
415
+ if (!value)
416
+ return void 0;
417
+ const maxAttempt = parseInt(value);
418
+ if (Number.isNaN(maxAttempt)) {
419
+ throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
420
+ }
421
+ return maxAttempt;
422
+ },
423
+ default: DEFAULT_MAX_ATTEMPTS
424
+ };
425
+ var resolveRetryConfig = (input, defaults) => {
426
+ const { retryStrategy, retryMode } = input;
427
+ const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
428
+ const maxAttemptsProvider = normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
429
+ let controller = retryStrategy ? Promise.resolve(retryStrategy) : void 0;
430
+ const getDefault = async () => {
431
+ const maxAttempts = await maxAttemptsProvider();
432
+ const adaptive = await normalizeProvider(retryMode)() === RETRY_MODES.ADAPTIVE;
433
+ if (adaptive) {
434
+ return new AdaptiveRetryStrategy(maxAttemptsProvider, {
435
+ maxAttempts,
436
+ baseDelay: defaultBaseDelay
437
+ });
438
+ }
439
+ return new StandardRetryStrategy({
440
+ maxAttempts,
441
+ baseDelay: defaultBaseDelay
442
+ });
443
+ };
444
+ return Object.assign(input, {
445
+ maxAttempts: maxAttemptsProvider,
446
+ retryStrategy: () => controller ??= getDefault()
447
+ });
448
+ };
449
+ var ENV_RETRY_MODE = "AWS_RETRY_MODE";
450
+ var CONFIG_RETRY_MODE = "retry_mode";
451
+ var NODE_RETRY_MODE_CONFIG_OPTIONS = {
452
+ environmentVariableSelector: (env2) => env2[ENV_RETRY_MODE],
453
+ configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
454
+ default: DEFAULT_RETRY_MODE
455
+ };
456
+
457
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.js
458
+ import { Readable } from "stream";
459
+ var isStreamingPayload = (request) => request?.body instanceof Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream;
460
+
461
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js
462
+ function parseRetryAfterHeader(response, logger) {
463
+ if (!HttpResponse.isInstance(response)) {
464
+ return;
465
+ }
466
+ for (const header in response.headers) {
467
+ if (!hasOwn(response.headers, header))
468
+ continue;
469
+ const h = header.toLowerCase();
470
+ if (h === "retry-after") {
471
+ const retryAfter = response.headers[header];
472
+ let retryAfterSeconds = NaN;
473
+ if (retryAfter.endsWith("GMT")) {
474
+ try {
475
+ const date = parseRfc7231DateTime(retryAfter);
476
+ retryAfterSeconds = (date.getTime() - Date.now()) / 1e3;
477
+ } catch (e) {
478
+ logger?.trace?.("Failed to parse retry-after header");
479
+ logger?.trace?.(e);
480
+ }
481
+ } else if (retryAfter.match(/ GMT, ((\d+)|(\d+\.\d+))$/)) {
482
+ retryAfterSeconds = Number(retryAfter.match(/ GMT, ([\d.]+)$/)?.[1]);
483
+ } else if (retryAfter.match(/^((\d+)|(\d+\.\d+))$/)) {
484
+ retryAfterSeconds = Number(retryAfter);
485
+ } else if (Date.parse(retryAfter) >= Date.now()) {
486
+ retryAfterSeconds = (Date.parse(retryAfter) - Date.now()) / 1e3;
487
+ }
488
+ if (isNaN(retryAfterSeconds)) {
489
+ return;
490
+ }
491
+ return new Date(Date.now() + retryAfterSeconds * 1e3);
492
+ } else if (h === "x-amz-retry-after") {
493
+ const v = response.headers[header];
494
+ const backoffMilliseconds = Number(v);
495
+ if (isNaN(backoffMilliseconds)) {
496
+ logger?.trace?.(`Failed to parse x-amz-retry-after=${v}`);
497
+ return;
498
+ }
499
+ return new Date(Date.now() + backoffMilliseconds);
500
+ }
501
+ }
502
+ }
503
+
504
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js
505
+ var asSdkError = (error) => {
506
+ if (error instanceof Error)
507
+ return error;
508
+ if (error instanceof Object)
509
+ return Object.assign(new Error(), error);
510
+ if (typeof error === "string")
511
+ return new Error(error);
512
+ return new Error(`AWS SDK error wrapper for ${error}`);
513
+ };
514
+
515
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js
516
+ function bindRetryMiddleware(isStreamingPayload2) {
517
+ return (options) => (next, context) => async (args) => {
518
+ let retryStrategy = await options.retryStrategy();
519
+ const maxAttempts = await options.maxAttempts();
520
+ if (isRetryStrategyV2(retryStrategy)) {
521
+ retryStrategy = retryStrategy;
522
+ let retryToken = await retryStrategy.acquireInitialRetryToken((context["partition_id"] ?? "") + (context.__retryLongPoll ? ":longpoll" : ""));
523
+ let lastError = new Error();
524
+ let attempts = 0;
525
+ let totalRetryDelay = 0;
526
+ const { request } = args;
527
+ const isRequest = HttpRequest.isInstance(request);
528
+ if (isRequest) {
529
+ request.headers[INVOCATION_ID_HEADER] = v4();
530
+ }
531
+ while (true) {
532
+ try {
533
+ if (isRequest) {
534
+ request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
535
+ }
536
+ const { response, output } = await next(args);
537
+ retryStrategy.recordSuccess(retryToken);
538
+ output.$metadata.attempts = attempts + 1;
539
+ output.$metadata.totalRetryDelay = totalRetryDelay;
540
+ return { response, output };
541
+ } catch (e) {
542
+ const retryErrorInfo = getRetryErrorInfo(e, options.logger);
543
+ lastError = asSdkError(e);
544
+ if (isRequest && isStreamingPayload2(request)) {
545
+ (context.logger instanceof NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
546
+ throw lastError;
547
+ }
548
+ try {
549
+ retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
550
+ } catch (ignoredRefreshError) {
551
+ if (!lastError.$metadata) {
552
+ lastError.$metadata = {};
553
+ }
554
+ lastError.$metadata.attempts = attempts + 1;
555
+ lastError.$metadata.totalRetryDelay = totalRetryDelay;
556
+ throw lastError;
557
+ }
558
+ attempts = retryToken.getRetryCount();
559
+ const delay = retryToken.getRetryDelay();
560
+ totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay;
561
+ if (delay > 0) {
562
+ await cooldown(delay);
563
+ }
564
+ }
565
+ }
566
+ } else {
567
+ retryStrategy = retryStrategy;
568
+ if (retryStrategy?.mode) {
569
+ context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
570
+ }
571
+ return retryStrategy.retry(next, args);
572
+ }
573
+ };
574
+ }
575
+ var cooldown = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
576
+ var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
577
+ var getRetryErrorInfo = (error, logger) => {
578
+ const errorInfo = {
579
+ error,
580
+ errorType: getRetryErrorType(error)
581
+ };
582
+ const retryAfterHint = parseRetryAfterHeader(error.$response, logger);
583
+ if (retryAfterHint) {
584
+ errorInfo.retryAfterHint = retryAfterHint;
585
+ }
586
+ return errorInfo;
587
+ };
588
+ var getRetryErrorType = (error) => {
589
+ if (isThrottlingError(error))
590
+ return "THROTTLING";
591
+ if (isTransientError(error))
592
+ return "TRANSIENT";
593
+ if (isServerError(error))
594
+ return "SERVER_ERROR";
595
+ return "CLIENT_ERROR";
596
+ };
597
+ var retryMiddlewareOptions = {
598
+ name: "retryMiddleware",
599
+ tags: ["RETRY"],
600
+ step: "finalizeRequest",
601
+ priority: "high",
602
+ override: true
603
+ };
604
+ function bindGetRetryPlugin(isStreamingPayload2) {
605
+ const retryMiddleware2 = bindRetryMiddleware(isStreamingPayload2);
606
+ return (options) => ({
607
+ applyToStack: (clientStack) => {
608
+ clientStack.add(retryMiddleware2(options), retryMiddlewareOptions);
609
+ }
610
+ });
611
+ }
612
+
613
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/retry/index.js
614
+ var retryMiddleware = bindRetryMiddleware(isStreamingPayload);
615
+ var getRetryPlugin = bindGetRetryPlugin(isStreamingPayload);
616
+
617
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js
618
+ function resolveHostHeaderConfig(input) {
619
+ return input;
620
+ }
621
+ var hostHeaderMiddleware = (options) => (next) => async (args) => {
622
+ if (!HttpRequest.isInstance(args.request))
623
+ return next(args);
624
+ const { request } = args;
625
+ const { handlerProtocol = "" } = options.requestHandler.metadata || {};
626
+ if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
627
+ delete request.headers["host"];
628
+ request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
629
+ } else if (!request.headers["host"]) {
630
+ let host = request.hostname;
631
+ if (request.port != null)
632
+ host += `:${request.port}`;
633
+ request.headers["host"] = host;
634
+ }
635
+ return next(args);
636
+ };
637
+ var hostHeaderMiddlewareOptions = {
638
+ name: "hostHeaderMiddleware",
639
+ step: "build",
640
+ priority: "low",
641
+ tags: ["HOST"],
642
+ override: true
643
+ };
644
+ var getHostHeaderPlugin = (options) => ({
645
+ applyToStack: (clientStack) => {
646
+ clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
647
+ }
648
+ });
649
+
650
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-logger/loggerMiddleware.js
651
+ var loggerMiddleware = () => (next, context) => async (args) => {
652
+ try {
653
+ const response = await next(args);
654
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
655
+ const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
656
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
657
+ const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
658
+ const { $metadata, ...outputWithoutMetadata } = response.output;
659
+ logger?.info?.({
660
+ clientName,
661
+ commandName,
662
+ input: inputFilterSensitiveLog(args.input),
663
+ output: outputFilterSensitiveLog(outputWithoutMetadata),
664
+ metadata: $metadata
665
+ });
666
+ return response;
667
+ } catch (error) {
668
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
669
+ const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
670
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
671
+ logger?.error?.({
672
+ clientName,
673
+ commandName,
674
+ input: inputFilterSensitiveLog(args.input),
675
+ error,
676
+ metadata: error.$metadata
677
+ });
678
+ throw error;
679
+ }
680
+ };
681
+ var loggerMiddlewareOptions = {
682
+ name: "loggerMiddleware",
683
+ tags: ["LOGGER"],
684
+ step: "initialize",
685
+ override: true
686
+ };
687
+ var getLoggerPlugin = (options) => ({
688
+ applyToStack: (clientStack) => {
689
+ clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
690
+ }
691
+ });
692
+
693
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/configuration.js
694
+ var recursionDetectionMiddlewareOptions = {
695
+ step: "build",
696
+ tags: ["RECURSION_DETECTION", "TRACE_CONTEXT_PROPAGATION"],
697
+ name: "recursionDetectionMiddleware",
698
+ override: true,
699
+ priority: "low"
700
+ };
701
+
702
+ // ../../node_modules/.pnpm/@aws+lambda-invoke-store@0.3.0/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js
703
+ var PROTECTED_KEYS = {
704
+ REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"),
705
+ X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),
706
+ TENANT_ID: Symbol.for("_AWS_LAMBDA_TENANT_ID"),
707
+ TRACEPARENT: Symbol.for("_AWS_LAMBDA_TRACEPARENT"),
708
+ TRACESTATE: Symbol.for("_AWS_LAMBDA_TRACESTATE"),
709
+ BAGGAGE: Symbol.for("_AWS_LAMBDA_BAGGAGE")
710
+ };
711
+ var NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? "");
712
+ if (!NO_GLOBAL_AWS_LAMBDA) {
713
+ globalThis.awslambda = globalThis.awslambda || {};
714
+ }
715
+ var InvokeStoreBase = class {
716
+ static PROTECTED_KEYS = PROTECTED_KEYS;
717
+ isProtectedKey(key) {
718
+ return Object.values(PROTECTED_KEYS).includes(key);
719
+ }
720
+ getRequestId() {
721
+ return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-";
722
+ }
723
+ getXRayTraceId() {
724
+ return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID);
725
+ }
726
+ getTenantId() {
727
+ return this.get(PROTECTED_KEYS.TENANT_ID);
728
+ }
729
+ getTraceparent() {
730
+ return this.get(PROTECTED_KEYS.TRACEPARENT);
731
+ }
732
+ getTracestate() {
733
+ return this.get(PROTECTED_KEYS.TRACESTATE);
734
+ }
735
+ getBaggage() {
736
+ return this.get(PROTECTED_KEYS.BAGGAGE);
737
+ }
738
+ };
739
+ var InvokeStoreSingle = class extends InvokeStoreBase {
740
+ currentContext;
741
+ getContext() {
742
+ return this.currentContext;
743
+ }
744
+ hasContext() {
745
+ return this.currentContext !== void 0;
746
+ }
747
+ get(key) {
748
+ return this.currentContext?.[key];
749
+ }
750
+ set(key, value) {
751
+ if (this.isProtectedKey(key)) {
752
+ throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
753
+ }
754
+ this.currentContext = this.currentContext || {};
755
+ this.currentContext[key] = value;
756
+ }
757
+ run(context, fn) {
758
+ this.currentContext = context;
759
+ return fn();
760
+ }
761
+ };
762
+ var InvokeStoreMulti = class _InvokeStoreMulti extends InvokeStoreBase {
763
+ als;
764
+ static async create() {
765
+ const instance = new _InvokeStoreMulti();
766
+ const asyncHooks = await import("async_hooks");
767
+ instance.als = new asyncHooks.AsyncLocalStorage();
768
+ return instance;
769
+ }
770
+ getContext() {
771
+ return this.als.getStore();
772
+ }
773
+ hasContext() {
774
+ return this.als.getStore() !== void 0;
775
+ }
776
+ get(key) {
777
+ return this.als.getStore()?.[key];
778
+ }
779
+ set(key, value) {
780
+ if (this.isProtectedKey(key)) {
781
+ throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
782
+ }
783
+ const store = this.als.getStore();
784
+ if (!store) {
785
+ throw new Error("No context available");
786
+ }
787
+ store[key] = value;
788
+ }
789
+ run(context, fn) {
790
+ return this.als.run(context, fn);
791
+ }
792
+ };
793
+ var InvokeStore;
794
+ (function(InvokeStore2) {
795
+ let instance = null;
796
+ async function getInstanceAsync(forceInvokeStoreMulti) {
797
+ if (!instance) {
798
+ instance = (async () => {
799
+ const isMulti = forceInvokeStoreMulti === true || "AWS_LAMBDA_MAX_CONCURRENCY" in process.env;
800
+ const newInstance = isMulti ? await InvokeStoreMulti.create() : new InvokeStoreSingle();
801
+ if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) {
802
+ return globalThis.awslambda.InvokeStore;
803
+ } else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) {
804
+ globalThis.awslambda.InvokeStore = newInstance;
805
+ return newInstance;
806
+ } else {
807
+ return newInstance;
808
+ }
809
+ })();
810
+ }
811
+ return instance;
812
+ }
813
+ InvokeStore2.getInstanceAsync = getInstanceAsync;
814
+ InvokeStore2._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? {
815
+ reset: () => {
816
+ instance = null;
817
+ if (globalThis.awslambda?.InvokeStore) {
818
+ delete globalThis.awslambda.InvokeStore;
819
+ }
820
+ globalThis.awslambda = { InvokeStore: void 0 };
821
+ }
822
+ } : void 0;
823
+ })(InvokeStore || (InvokeStore = {}));
824
+
825
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.js
826
+ var AWS_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
827
+ var _X_AMZN_TRACE_ID = "_X_AMZN_TRACE_ID";
828
+ var X_AMZN_TRACE_ID = "X-Amzn-Trace-Id";
829
+ var TRACEPARENT = "traceparent";
830
+ var TRACESTATE = "tracestate";
831
+ var BAGGAGE = "baggage";
832
+ var recursionDetectionMiddleware = () => (next) => async (args) => {
833
+ const { request } = args;
834
+ if (!HttpRequest.isInstance(request)) {
835
+ return next(args);
836
+ }
837
+ let invokeStore;
838
+ {
839
+ const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === X_AMZN_TRACE_ID.toLowerCase()) ?? X_AMZN_TRACE_ID;
840
+ if (!request.headers.hasOwnProperty(traceIdHeader)) {
841
+ const functionName = process.env[AWS_LAMBDA_FUNCTION_NAME];
842
+ const traceIdFromEnv = process.env[_X_AMZN_TRACE_ID];
843
+ invokeStore ??= await InvokeStore.getInstanceAsync();
844
+ const traceIdFromInvokeStore = invokeStore?.getXRayTraceId();
845
+ const traceId = traceIdFromInvokeStore ?? traceIdFromEnv;
846
+ const nonEmptyString = (str) => typeof str === "string" && str.length > 0;
847
+ if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
848
+ request.headers[X_AMZN_TRACE_ID] = traceId;
849
+ }
850
+ }
851
+ }
852
+ {
853
+ sanitizeTraceHeaders(request.headers);
854
+ const existingTraceparent = request.headers[TRACEPARENT];
855
+ if (!existingTraceparent) {
856
+ const traceparent = (invokeStore ??= await InvokeStore.getInstanceAsync())?.getTraceparent?.();
857
+ if (traceparent) {
858
+ request.headers[TRACEPARENT] = traceparent;
859
+ const tracestate = invokeStore?.getTracestate?.();
860
+ if (tracestate) {
861
+ request.headers[TRACESTATE] = tracestate;
862
+ }
863
+ const baggage = invokeStore?.getBaggage?.();
864
+ if (baggage) {
865
+ request.headers[BAGGAGE] = baggage;
866
+ }
867
+ }
868
+ }
869
+ }
870
+ return next(args);
871
+ };
872
+ function sanitizeTraceHeaders(headers) {
873
+ for (const header of Object.keys(headers)) {
874
+ const lower = header.toLowerCase();
875
+ if (header !== lower && (lower === TRACEPARENT || lower === TRACESTATE || lower === BAGGAGE)) {
876
+ headers[lower] = headers[header];
877
+ delete headers[header];
878
+ }
879
+ }
880
+ }
881
+
882
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.js
883
+ var getRecursionDetectionPlugin = (options) => ({
884
+ applyToStack: (clientStack) => {
885
+ clientStack.add(recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions);
886
+ }
887
+ });
888
+
889
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/resolveAuthOptions.js
890
+ var resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
891
+ if (!authSchemePreference || authSchemePreference.length === 0) {
892
+ return candidateAuthOptions;
893
+ }
894
+ const preferredAuthOptions = [];
895
+ for (const preferredSchemeName of authSchemePreference) {
896
+ for (const candidateAuthOption of candidateAuthOptions) {
897
+ const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
898
+ if (candidateAuthSchemeName === preferredSchemeName) {
899
+ preferredAuthOptions.push(candidateAuthOption);
900
+ }
901
+ }
902
+ }
903
+ for (const candidateAuthOption of candidateAuthOptions) {
904
+ if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
905
+ preferredAuthOptions.push(candidateAuthOption);
906
+ }
907
+ }
908
+ return preferredAuthOptions;
909
+ };
910
+
911
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
912
+ function convertHttpAuthSchemesToMap(httpAuthSchemes) {
913
+ const map = /* @__PURE__ */ new Map();
914
+ for (const scheme of httpAuthSchemes) {
915
+ map.set(scheme.schemeId, scheme);
916
+ }
917
+ return map;
918
+ }
919
+ var httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
920
+ const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
921
+ const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
922
+ const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
923
+ const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
924
+ const smithyContext = getSmithyContext(context);
925
+ const failureReasons = [];
926
+ for (const option of resolvedOptions) {
927
+ const scheme = authSchemes.get(option.schemeId);
928
+ if (!scheme) {
929
+ failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
930
+ continue;
931
+ }
932
+ const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
933
+ if (!identityProvider) {
934
+ failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
935
+ continue;
936
+ }
937
+ const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
938
+ option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
939
+ option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
940
+ smithyContext.selectedHttpAuthScheme = {
941
+ httpAuthOption: option,
942
+ identity: await identityProvider(option.identityProperties),
943
+ signer: scheme.signer
944
+ };
945
+ break;
946
+ }
947
+ if (!smithyContext.selectedHttpAuthScheme) {
948
+ throw new Error(failureReasons.join("\n"));
949
+ }
950
+ return next(args);
951
+ };
952
+
953
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js
954
+ var httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
955
+ step: "serialize",
956
+ tags: ["HTTP_AUTH_SCHEME"],
957
+ name: "httpAuthSchemeMiddleware",
958
+ override: true,
959
+ relation: "before",
960
+ toMiddleware: "endpointV2Middleware"
961
+ };
962
+ var getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
963
+ applyToStack: (clientStack) => {
964
+ clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
965
+ httpAuthSchemeParametersProvider,
966
+ identityProviderConfigProvider
967
+ }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
968
+ }
969
+ });
970
+
971
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js
972
+ var defaultErrorHandler = (signingProperties) => (error) => {
973
+ throw error;
974
+ };
975
+ var defaultSuccessHandler = (httpResponse, signingProperties) => {
976
+ };
977
+ var httpSigningMiddleware = (config) => (next, context) => async (args) => {
978
+ if (!HttpRequest.isInstance(args.request)) {
979
+ return next(args);
980
+ }
981
+ const smithyContext = getSmithyContext(context);
982
+ const scheme = smithyContext.selectedHttpAuthScheme;
983
+ if (!scheme) {
984
+ throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
985
+ }
986
+ const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
987
+ const output = await next({
988
+ ...args,
989
+ request: await signer.sign(args.request, identity, signingProperties)
990
+ }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
991
+ (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
992
+ return output;
993
+ };
994
+
995
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/getHttpSigningMiddleware.js
996
+ var httpSigningMiddlewareOptions = {
997
+ step: "finalizeRequest",
998
+ tags: ["HTTP_SIGNING"],
999
+ name: "httpSigningMiddleware",
1000
+ aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
1001
+ override: true,
1002
+ relation: "after",
1003
+ toMiddleware: "retryMiddleware"
1004
+ };
1005
+ var getHttpSigningPlugin = (config) => ({
1006
+ applyToStack: (clientStack) => {
1007
+ clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
1008
+ }
1009
+ });
1010
+
1011
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/pagination/createPaginator.js
1012
+ var makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => {
1013
+ let command = new CommandCtor(input);
1014
+ command = withCommand(command) ?? command;
1015
+ return await client.send(command, ...args);
1016
+ };
1017
+ function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
1018
+ return async function* paginateOperation(config, input, ...additionalArguments) {
1019
+ const _input = input;
1020
+ let token = config.startingToken ?? _input[inputTokenName];
1021
+ let hasNext = true;
1022
+ let page;
1023
+ while (hasNext) {
1024
+ _input[inputTokenName] = token;
1025
+ if (pageSizeTokenName) {
1026
+ _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;
1027
+ }
1028
+ if (config.client instanceof ClientCtor) {
1029
+ page = await makePagedClientRequest(CommandCtor, config.client, input, config.withCommand, ...additionalArguments);
1030
+ } else {
1031
+ throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
1032
+ }
1033
+ yield page;
1034
+ const prevToken = token;
1035
+ token = get(page, outputTokenName);
1036
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
1037
+ }
1038
+ return void 0;
1039
+ };
1040
+ }
1041
+ var get = (fromObject, path) => {
1042
+ let cursor = fromObject;
1043
+ const pathComponents = path.split(".");
1044
+ for (const step of pathComponents) {
1045
+ if (!cursor || typeof cursor !== "object") {
1046
+ return void 0;
1047
+ }
1048
+ cursor = cursor[step];
1049
+ }
1050
+ return cursor;
1051
+ };
1052
+
1053
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js
1054
+ var DefaultIdentityProviderConfig = class {
1055
+ authSchemes = /* @__PURE__ */ new Map();
1056
+ constructor(config) {
1057
+ for (const key in config) {
1058
+ if (!hasOwn(config, key))
1059
+ continue;
1060
+ const value = config[key];
1061
+ if (value !== void 0) {
1062
+ this.authSchemes.set(key, value);
1063
+ }
1064
+ }
1065
+ }
1066
+ getIdentityProvider(schemeId) {
1067
+ return this.authSchemes.get(schemeId);
1068
+ }
1069
+ };
1070
+
1071
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/noAuth.js
1072
+ var NoAuthSigner = class {
1073
+ async sign(httpRequest, identity, signingProperties) {
1074
+ return httpRequest;
1075
+ }
1076
+ };
1077
+
1078
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/memoizeIdentityProvider.js
1079
+ var createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(identity) {
1080
+ return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
1081
+ };
1082
+ var EXPIRATION_MS = 3e5;
1083
+ var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
1084
+ var doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0;
1085
+ var memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
1086
+ if (provider === void 0) {
1087
+ return void 0;
1088
+ }
1089
+ const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
1090
+ let resolved;
1091
+ let pending;
1092
+ let hasResult;
1093
+ let isConstant = false;
1094
+ const coalesceProvider = async (options) => {
1095
+ if (!pending) {
1096
+ pending = normalizedProvider(options);
1097
+ }
1098
+ try {
1099
+ resolved = await pending;
1100
+ hasResult = true;
1101
+ isConstant = false;
1102
+ } finally {
1103
+ pending = void 0;
1104
+ }
1105
+ return resolved;
1106
+ };
1107
+ if (isExpired === void 0) {
1108
+ return async (options) => {
1109
+ if (!hasResult || options?.forceRefresh) {
1110
+ resolved = await coalesceProvider(options);
1111
+ }
1112
+ return resolved;
1113
+ };
1114
+ }
1115
+ return async (options) => {
1116
+ if (!hasResult || options?.forceRefresh) {
1117
+ resolved = await coalesceProvider(options);
1118
+ }
1119
+ if (isConstant) {
1120
+ return resolved;
1121
+ }
1122
+ if (!requiresRefresh(resolved)) {
1123
+ isConstant = true;
1124
+ return resolved;
1125
+ }
1126
+ if (isExpired(resolved)) {
1127
+ await coalesceProvider(options);
1128
+ return resolved;
1129
+ }
1130
+ return resolved;
1131
+ };
1132
+ };
1133
+
1134
+ // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/normalizeProvider.js
1135
+ var normalizeProvider2 = (input) => {
1136
+ if (typeof input === "function")
1137
+ return input;
1138
+ const promisified = Promise.resolve(input);
1139
+ return () => promisified;
1140
+ };
1141
+
1142
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/configurations.js
1143
+ var DEFAULT_UA_APP_ID = void 0;
1144
+ function isValidUserAgentAppId(appId) {
1145
+ if (appId === void 0) {
1146
+ return true;
1147
+ }
1148
+ return typeof appId === "string" && appId.length <= 50;
1149
+ }
1150
+ function resolveUserAgentConfig(input) {
1151
+ const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
1152
+ const { customUserAgent } = input;
1153
+ return Object.assign(input, {
1154
+ customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
1155
+ userAgentAppId: async () => {
1156
+ const appId = await normalizedAppIdProvider();
1157
+ if (!isValidUserAgentAppId(appId)) {
1158
+ const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
1159
+ if (typeof appId !== "string") {
1160
+ logger?.warn("userAgentAppId must be a string or undefined.");
1161
+ } else if (appId.length > 50) {
1162
+ logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
1163
+ }
1164
+ }
1165
+ return appId;
1166
+ }
1167
+ });
1168
+ }
1169
+
1170
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js
1171
+ var partitionsInfo = {
1172
+ "partitions": [
1173
+ {
1174
+ "id": "aws",
1175
+ "outputs": {
1176
+ "dnsSuffix": "amazonaws.com",
1177
+ "dualStackDnsSuffix": "api.aws",
1178
+ "implicitGlobalRegion": "us-east-1",
1179
+ "name": "aws",
1180
+ "supportsDualStack": true,
1181
+ "supportsFIPS": true
1182
+ },
1183
+ "regionRegex": "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
1184
+ "regions": {
1185
+ "af-south-1": {
1186
+ "description": "Africa (Cape Town)"
1187
+ },
1188
+ "ap-east-1": {
1189
+ "description": "Asia Pacific (Hong Kong)"
1190
+ },
1191
+ "ap-east-2": {
1192
+ "description": "Asia Pacific (Taipei)"
1193
+ },
1194
+ "ap-northeast-1": {
1195
+ "description": "Asia Pacific (Tokyo)"
1196
+ },
1197
+ "ap-northeast-2": {
1198
+ "description": "Asia Pacific (Seoul)"
1199
+ },
1200
+ "ap-northeast-3": {
1201
+ "description": "Asia Pacific (Osaka)"
1202
+ },
1203
+ "ap-south-1": {
1204
+ "description": "Asia Pacific (Mumbai)"
1205
+ },
1206
+ "ap-south-2": {
1207
+ "description": "Asia Pacific (Hyderabad)"
1208
+ },
1209
+ "ap-southeast-1": {
1210
+ "description": "Asia Pacific (Singapore)"
1211
+ },
1212
+ "ap-southeast-2": {
1213
+ "description": "Asia Pacific (Sydney)"
1214
+ },
1215
+ "ap-southeast-3": {
1216
+ "description": "Asia Pacific (Jakarta)"
1217
+ },
1218
+ "ap-southeast-4": {
1219
+ "description": "Asia Pacific (Melbourne)"
1220
+ },
1221
+ "ap-southeast-5": {
1222
+ "description": "Asia Pacific (Malaysia)"
1223
+ },
1224
+ "ap-southeast-6": {
1225
+ "description": "Asia Pacific (New Zealand)"
1226
+ },
1227
+ "ap-southeast-7": {
1228
+ "description": "Asia Pacific (Thailand)"
1229
+ },
1230
+ "aws-global": {
1231
+ "description": "aws global region"
1232
+ },
1233
+ "ca-central-1": {
1234
+ "description": "Canada (Central)"
1235
+ },
1236
+ "ca-west-1": {
1237
+ "description": "Canada West (Calgary)"
1238
+ },
1239
+ "eu-central-1": {
1240
+ "description": "Europe (Frankfurt)"
1241
+ },
1242
+ "eu-central-2": {
1243
+ "description": "Europe (Zurich)"
1244
+ },
1245
+ "eu-north-1": {
1246
+ "description": "Europe (Stockholm)"
1247
+ },
1248
+ "eu-south-1": {
1249
+ "description": "Europe (Milan)"
1250
+ },
1251
+ "eu-south-2": {
1252
+ "description": "Europe (Spain)"
1253
+ },
1254
+ "eu-west-1": {
1255
+ "description": "Europe (Ireland)"
1256
+ },
1257
+ "eu-west-2": {
1258
+ "description": "Europe (London)"
1259
+ },
1260
+ "eu-west-3": {
1261
+ "description": "Europe (Paris)"
1262
+ },
1263
+ "il-central-1": {
1264
+ "description": "Israel (Tel Aviv)"
1265
+ },
1266
+ "me-central-1": {
1267
+ "description": "Middle East (UAE)"
1268
+ },
1269
+ "me-south-1": {
1270
+ "description": "Middle East (Bahrain)"
1271
+ },
1272
+ "mx-central-1": {
1273
+ "description": "Mexico (Central)"
1274
+ },
1275
+ "sa-east-1": {
1276
+ "description": "South America (Sao Paulo)"
1277
+ },
1278
+ "us-east-1": {
1279
+ "description": "US East (N. Virginia)"
1280
+ },
1281
+ "us-east-2": {
1282
+ "description": "US East (Ohio)"
1283
+ },
1284
+ "us-west-1": {
1285
+ "description": "US West (N. California)"
1286
+ },
1287
+ "us-west-2": {
1288
+ "description": "US West (Oregon)"
1289
+ }
1290
+ }
1291
+ },
1292
+ {
1293
+ "id": "aws-cn",
1294
+ "outputs": {
1295
+ "dnsSuffix": "amazonaws.com.cn",
1296
+ "dualStackDnsSuffix": "api.amazonwebservices.com.cn",
1297
+ "implicitGlobalRegion": "cn-northwest-1",
1298
+ "name": "aws-cn",
1299
+ "supportsDualStack": true,
1300
+ "supportsFIPS": true
1301
+ },
1302
+ "regionRegex": "^cn\\-\\w+\\-\\d+$",
1303
+ "regions": {
1304
+ "aws-cn-global": {
1305
+ "description": "aws-cn global region"
1306
+ },
1307
+ "cn-north-1": {
1308
+ "description": "China (Beijing)"
1309
+ },
1310
+ "cn-northwest-1": {
1311
+ "description": "China (Ningxia)"
1312
+ }
1313
+ }
1314
+ },
1315
+ {
1316
+ "id": "aws-eusc",
1317
+ "outputs": {
1318
+ "dnsSuffix": "amazonaws.eu",
1319
+ "dualStackDnsSuffix": "api.amazonwebservices.eu",
1320
+ "implicitGlobalRegion": "eusc-de-east-1",
1321
+ "name": "aws-eusc",
1322
+ "supportsDualStack": true,
1323
+ "supportsFIPS": true
1324
+ },
1325
+ "regionRegex": "^eusc\\-(de)\\-\\w+\\-\\d+$",
1326
+ "regions": {
1327
+ "eusc-de-east-1": {
1328
+ "description": "AWS European Sovereign Cloud (Germany)"
1329
+ }
1330
+ }
1331
+ },
1332
+ {
1333
+ "id": "aws-iso",
1334
+ "outputs": {
1335
+ "dnsSuffix": "c2s.ic.gov",
1336
+ "dualStackDnsSuffix": "api.aws.ic.gov",
1337
+ "implicitGlobalRegion": "us-iso-east-1",
1338
+ "name": "aws-iso",
1339
+ "supportsDualStack": true,
1340
+ "supportsFIPS": true
1341
+ },
1342
+ "regionRegex": "^us\\-iso\\-\\w+\\-\\d+$",
1343
+ "regions": {
1344
+ "aws-iso-global": {
1345
+ "description": "aws-iso global region"
1346
+ },
1347
+ "us-iso-east-1": {
1348
+ "description": "US ISO East"
1349
+ },
1350
+ "us-iso-west-1": {
1351
+ "description": "US ISO WEST"
1352
+ }
1353
+ }
1354
+ },
1355
+ {
1356
+ "id": "aws-iso-b",
1357
+ "outputs": {
1358
+ "dnsSuffix": "sc2s.sgov.gov",
1359
+ "dualStackDnsSuffix": "api.aws.scloud",
1360
+ "implicitGlobalRegion": "us-isob-east-1",
1361
+ "name": "aws-iso-b",
1362
+ "supportsDualStack": true,
1363
+ "supportsFIPS": true
1364
+ },
1365
+ "regionRegex": "^us\\-isob\\-\\w+\\-\\d+$",
1366
+ "regions": {
1367
+ "aws-iso-b-global": {
1368
+ "description": "aws-iso-b global region"
1369
+ },
1370
+ "us-isob-east-1": {
1371
+ "description": "US ISOB East (Ohio)"
1372
+ },
1373
+ "us-isob-west-1": {
1374
+ "description": "US ISOB West"
1375
+ }
1376
+ }
1377
+ },
1378
+ {
1379
+ "id": "aws-iso-e",
1380
+ "outputs": {
1381
+ "dnsSuffix": "cloud.adc-e.uk",
1382
+ "dualStackDnsSuffix": "api.cloud-aws.adc-e.uk",
1383
+ "implicitGlobalRegion": "eu-isoe-west-1",
1384
+ "name": "aws-iso-e",
1385
+ "supportsDualStack": true,
1386
+ "supportsFIPS": true
1387
+ },
1388
+ "regionRegex": "^eu\\-isoe\\-\\w+\\-\\d+$",
1389
+ "regions": {
1390
+ "aws-iso-e-global": {
1391
+ "description": "aws-iso-e global region"
1392
+ },
1393
+ "eu-isoe-west-1": {
1394
+ "description": "EU ISOE West"
1395
+ }
1396
+ }
1397
+ },
1398
+ {
1399
+ "id": "aws-iso-f",
1400
+ "outputs": {
1401
+ "dnsSuffix": "csp.hci.ic.gov",
1402
+ "dualStackDnsSuffix": "api.aws.hci.ic.gov",
1403
+ "implicitGlobalRegion": "us-isof-south-1",
1404
+ "name": "aws-iso-f",
1405
+ "supportsDualStack": true,
1406
+ "supportsFIPS": true
1407
+ },
1408
+ "regionRegex": "^us\\-isof\\-\\w+\\-\\d+$",
1409
+ "regions": {
1410
+ "aws-iso-f-global": {
1411
+ "description": "aws-iso-f global region"
1412
+ },
1413
+ "us-isof-east-1": {
1414
+ "description": "US ISOF EAST"
1415
+ },
1416
+ "us-isof-south-1": {
1417
+ "description": "US ISOF SOUTH"
1418
+ }
1419
+ }
1420
+ },
1421
+ {
1422
+ "id": "aws-us-gov",
1423
+ "outputs": {
1424
+ "dnsSuffix": "amazonaws.com",
1425
+ "dualStackDnsSuffix": "api.aws",
1426
+ "implicitGlobalRegion": "us-gov-west-1",
1427
+ "name": "aws-us-gov",
1428
+ "supportsDualStack": true,
1429
+ "supportsFIPS": true
1430
+ },
1431
+ "regionRegex": "^us\\-gov\\-\\w+\\-\\d+$",
1432
+ "regions": {
1433
+ "aws-us-gov-global": {
1434
+ "description": "aws-us-gov global region"
1435
+ },
1436
+ "us-gov-east-1": {
1437
+ "description": "AWS GovCloud (US-East)"
1438
+ },
1439
+ "us-gov-west-1": {
1440
+ "description": "AWS GovCloud (US-West)"
1441
+ }
1442
+ }
1443
+ }
1444
+ ],
1445
+ "version": "1.1"
1446
+ };
1447
+
1448
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partition.js
1449
+ var selectedPartitionsInfo = partitionsInfo;
1450
+ var selectedUserAgentPrefix = "";
1451
+ var partition = (value) => {
1452
+ const { partitions } = selectedPartitionsInfo;
1453
+ for (const partition2 of partitions) {
1454
+ const { regions, outputs } = partition2;
1455
+ for (const [region, regionData] of Object.entries(regions)) {
1456
+ if (region === value) {
1457
+ return {
1458
+ ...outputs,
1459
+ ...regionData
1460
+ };
1461
+ }
1462
+ }
1463
+ }
1464
+ for (const partition2 of partitions) {
1465
+ const { regionRegex, outputs } = partition2;
1466
+ if (new RegExp(regionRegex).test(value)) {
1467
+ return {
1468
+ ...outputs
1469
+ };
1470
+ }
1471
+ }
1472
+ const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
1473
+ if (!DEFAULT_PARTITION) {
1474
+ throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");
1475
+ }
1476
+ return {
1477
+ ...DEFAULT_PARTITION.outputs
1478
+ };
1479
+ };
1480
+ var getUserAgentPrefix = () => selectedUserAgentPrefix;
1481
+
1482
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
1483
+ Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
1484
+ function setFeature(context, feature, value) {
1485
+ if (!context.__aws_sdk_context) {
1486
+ context.__aws_sdk_context = {
1487
+ features: {}
1488
+ };
1489
+ } else if (!context.__aws_sdk_context.features) {
1490
+ context.__aws_sdk_context.features = {};
1491
+ }
1492
+ context.__aws_sdk_context.features[feature] = value;
1493
+ }
1494
+
1495
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/check-features.js
1496
+ var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
1497
+ async function checkFeatures(context, config, args) {
1498
+ const request = args.request;
1499
+ if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
1500
+ setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
1501
+ }
1502
+ if (typeof config.retryStrategy === "function") {
1503
+ const retryStrategy = await config.retryStrategy();
1504
+ if (typeof retryStrategy.mode === "string") {
1505
+ switch (retryStrategy.mode) {
1506
+ case RETRY_MODES.ADAPTIVE:
1507
+ setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
1508
+ break;
1509
+ case RETRY_MODES.STANDARD:
1510
+ setFeature(context, "RETRY_MODE_STANDARD", "E");
1511
+ break;
1512
+ }
1513
+ }
1514
+ }
1515
+ if (typeof config.accountIdEndpointMode === "function") {
1516
+ const endpointV2 = context.endpointV2;
1517
+ if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
1518
+ setFeature(context, "ACCOUNT_ID_ENDPOINT", "O");
1519
+ }
1520
+ switch (await config.accountIdEndpointMode?.()) {
1521
+ case "disabled":
1522
+ setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
1523
+ break;
1524
+ case "preferred":
1525
+ setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
1526
+ break;
1527
+ case "required":
1528
+ setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
1529
+ break;
1530
+ }
1531
+ }
1532
+ const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity;
1533
+ if (identity?.$source) {
1534
+ const credentials = identity;
1535
+ if (credentials.accountId) {
1536
+ setFeature(context, "RESOLVED_ACCOUNT_ID", "T");
1537
+ }
1538
+ for (const [key, value] of Object.entries(credentials.$source ?? {})) {
1539
+ setFeature(context, key, value);
1540
+ }
1541
+ }
1542
+ }
1543
+
1544
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/constants.js
1545
+ var USER_AGENT = "user-agent";
1546
+ var X_AMZ_USER_AGENT = "x-amz-user-agent";
1547
+ var SPACE = " ";
1548
+ var UA_NAME_SEPARATOR = "/";
1549
+ var UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g;
1550
+ var UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g;
1551
+ var UA_ESCAPE_CHAR = "-";
1552
+
1553
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/encode-features.js
1554
+ var BYTE_LIMIT = 1024;
1555
+ function encodeFeatures(features) {
1556
+ let buffer = "";
1557
+ for (const key in features) {
1558
+ const val = features[key];
1559
+ if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
1560
+ if (buffer.length) {
1561
+ buffer += "," + val;
1562
+ } else {
1563
+ buffer += val;
1564
+ }
1565
+ continue;
1566
+ }
1567
+ break;
1568
+ }
1569
+ return buffer;
1570
+ }
1571
+
1572
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/user-agent-middleware.js
1573
+ var userAgentMiddleware = (options) => (next, context) => async (args) => {
1574
+ const { request } = args;
1575
+ if (!HttpRequest.isInstance(request)) {
1576
+ return next(args);
1577
+ }
1578
+ const { headers } = request;
1579
+ const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
1580
+ const defaultUserAgent2 = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
1581
+ await checkFeatures(context, options, args);
1582
+ const awsContext = context;
1583
+ defaultUserAgent2.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
1584
+ const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
1585
+ const appId = await options.userAgentAppId();
1586
+ if (appId) {
1587
+ defaultUserAgent2.push(escapeUserAgent([`app`, `${appId}`]));
1588
+ }
1589
+ const prefix = getUserAgentPrefix();
1590
+ const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent2, ...userAgent, ...customUserAgent]).join(SPACE);
1591
+ const normalUAValue = [
1592
+ ...defaultUserAgent2.filter((section) => section.startsWith("aws-sdk-")),
1593
+ ...customUserAgent
1594
+ ].join(SPACE);
1595
+ if (options.runtime !== "browser") {
1596
+ if (normalUAValue) {
1597
+ headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;
1598
+ }
1599
+ headers[USER_AGENT] = sdkUserAgentValue;
1600
+ } else {
1601
+ headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
1602
+ }
1603
+ return next({
1604
+ ...args,
1605
+ request
1606
+ });
1607
+ };
1608
+ var escapeUserAgent = (userAgentPair) => {
1609
+ const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR);
1610
+ const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
1611
+ const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
1612
+ const prefix = name.substring(0, prefixSeparatorIndex);
1613
+ let uaName = name.substring(prefixSeparatorIndex + 1);
1614
+ if (prefix === "api") {
1615
+ uaName = uaName.toLowerCase();
1616
+ }
1617
+ return [prefix, uaName, version].filter((item) => item && item.length > 0).reduce((acc, item, index) => {
1618
+ switch (index) {
1619
+ case 0:
1620
+ return item;
1621
+ case 1:
1622
+ return `${acc}/${item}`;
1623
+ default:
1624
+ return `${acc}#${item}`;
1625
+ }
1626
+ }, "");
1627
+ };
1628
+ var getUserAgentMiddlewareOptions = {
1629
+ name: "getUserAgentMiddleware",
1630
+ step: "build",
1631
+ priority: "low",
1632
+ tags: ["SET_USER_AGENT", "USER_AGENT"],
1633
+ override: true
1634
+ };
1635
+ var getUserAgentPlugin = (config) => ({
1636
+ applyToStack: (clientStack) => {
1637
+ clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
1638
+ }
1639
+ });
1640
+
1641
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js
1642
+ var state = {
1643
+ warningEmitted: false
1644
+ };
1645
+ var emitWarningIfUnsupportedVersion = (version) => {
1646
+ if (version && !state.warningEmitted) {
1647
+ if (process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED === "true") {
1648
+ state.warningEmitted = true;
1649
+ return;
1650
+ }
1651
+ const userMajorVersion = parseInt(version.substring(1, version.indexOf(".")));
1652
+ const vv = 22;
1653
+ if (userMajorVersion < vv) {
1654
+ state.warningEmitted = true;
1655
+ process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
1656
+ versions published after the first week of January 2027
1657
+ will require node >=${vv}. You are running node ${version}.
1658
+
1659
+ To continue receiving updates to AWS services, bug fixes,
1660
+ and security updates please upgrade to node >=${vv}.
1661
+
1662
+ More information can be found at: https://a.co/c895JFp`);
1663
+ }
1664
+ }
1665
+ };
1666
+
1667
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js
1668
+ import { platform, release } from "os";
1669
+ import { env } from "process";
1670
+
1671
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.js
1672
+ import { versions } from "process";
1673
+ var getRuntimeUserAgentPair = () => {
1674
+ const runtimesToCheck = ["deno", "bun", "llrt"];
1675
+ for (const runtime of runtimesToCheck) {
1676
+ if (versions[runtime]) {
1677
+ return [`md/${runtime}`, versions[runtime]];
1678
+ }
1679
+ }
1680
+ return ["md/nodejs", versions.node];
1681
+ };
1682
+
1683
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/crt-availability.js
1684
+ var crtAvailability = {
1685
+ isCrtAvailable: false
1686
+ };
1687
+
1688
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/is-crt-available.js
1689
+ var isCrtAvailable = () => {
1690
+ if (crtAvailability.isCrtAvailable) {
1691
+ return ["md/crt-avail"];
1692
+ }
1693
+ return null;
1694
+ };
1695
+
1696
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js
1697
+ var createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
1698
+ const runtimeUserAgentPair = getRuntimeUserAgentPair();
1699
+ return async (config) => {
1700
+ const sections = [
1701
+ ["aws-sdk-js", clientVersion],
1702
+ ["ua", "2.1"],
1703
+ [`os/${platform()}`, release()],
1704
+ ["lang/js"],
1705
+ runtimeUserAgentPair
1706
+ ];
1707
+ const crtAvailable = isCrtAvailable();
1708
+ if (crtAvailable) {
1709
+ sections.push(crtAvailable);
1710
+ }
1711
+ if (serviceId) {
1712
+ sections.push([`api/${serviceId}`, clientVersion]);
1713
+ }
1714
+ if (env.AWS_EXECUTION_ENV) {
1715
+ sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]);
1716
+ }
1717
+ const appId = await config?.userAgentAppId?.();
1718
+ const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
1719
+ return resolvedUserAgent;
1720
+ };
1721
+ };
1722
+
1723
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.js
1724
+ var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
1725
+ var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
1726
+ var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
1727
+ var NODE_APP_ID_CONFIG_OPTIONS = {
1728
+ environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME],
1729
+ configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED],
1730
+ default: DEFAULT_UA_APP_ID
1731
+ };
1732
+
1733
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.js
1734
+ var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
1735
+ if (allowSubDomains) {
1736
+ for (const label of value.split(".")) {
1737
+ if (!isVirtualHostableS3Bucket(label)) {
1738
+ return false;
1739
+ }
1740
+ }
1741
+ return true;
1742
+ }
1743
+ if (!isValidHostLabel(value)) {
1744
+ return false;
1745
+ }
1746
+ if (value.length < 3 || value.length > 63) {
1747
+ return false;
1748
+ }
1749
+ if (value !== value.toLowerCase()) {
1750
+ return false;
1751
+ }
1752
+ if (isIpAddress(value)) {
1753
+ return false;
1754
+ }
1755
+ return true;
1756
+ };
1757
+
1758
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js
1759
+ var ARN_DELIMITER = ":";
1760
+ var RESOURCE_DELIMITER = "/";
1761
+ var parseArn = (value) => {
1762
+ const segments = value.split(ARN_DELIMITER);
1763
+ if (segments.length < 6)
1764
+ return null;
1765
+ const [arn, partition2, service, region, accountId, ...resourcePath] = segments;
1766
+ if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
1767
+ return null;
1768
+ const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
1769
+ return {
1770
+ partition: partition2,
1771
+ service,
1772
+ region,
1773
+ accountId,
1774
+ resourceId
1775
+ };
1776
+ };
1777
+
1778
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/aws.js
1779
+ var awsEndpointFunctions = {
1780
+ isVirtualHostableS3Bucket,
1781
+ parseArn,
1782
+ partition
1783
+ };
1784
+ customEndpointFunctions.aws = awsEndpointFunctions;
1785
+
1786
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.js
1787
+ function stsRegionDefaultResolver(loaderConfig = {}) {
1788
+ return loadConfig({
1789
+ ...NODE_REGION_CONFIG_OPTIONS,
1790
+ async default() {
1791
+ if (!warning.silence) {
1792
+ console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");
1793
+ }
1794
+ return "us-east-1";
1795
+ }
1796
+ }, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig });
1797
+ }
1798
+ var warning = {
1799
+ silence: false
1800
+ };
1801
+
1802
+ // ../../node_modules/.pnpm/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/extensions.js
1803
+ var getAwsRegionExtensionConfiguration = (runtimeConfig) => {
1804
+ return {
1805
+ setRegion(region) {
1806
+ runtimeConfig.region = region;
1807
+ },
1808
+ region() {
1809
+ return runtimeConfig.region;
1810
+ }
1811
+ };
1812
+ };
1813
+ var resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => {
1814
+ return {
1815
+ region: awsRegionExtensionConfiguration.region()
1816
+ };
1817
+ };
1818
+
1819
+ export {
1820
+ emitWarningIfUnsupportedVersion,
1821
+ setCredentialFeature,
1822
+ DEFAULT_RETRY_MODE,
1823
+ NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
1824
+ resolveRetryConfig,
1825
+ NODE_RETRY_MODE_CONFIG_OPTIONS,
1826
+ getRetryPlugin,
1827
+ setFeature,
1828
+ resolveHostHeaderConfig,
1829
+ getHostHeaderPlugin,
1830
+ getLoggerPlugin,
1831
+ getRecursionDetectionPlugin,
1832
+ getHttpAuthSchemeEndpointRuleSetPlugin,
1833
+ httpSigningMiddlewareOptions,
1834
+ getHttpSigningPlugin,
1835
+ normalizeProvider2 as normalizeProvider,
1836
+ createPaginator,
1837
+ DefaultIdentityProviderConfig,
1838
+ NoAuthSigner,
1839
+ isIdentityExpired,
1840
+ doesIdentityRequireRefresh,
1841
+ memoizeIdentityProvider,
1842
+ resolveUserAgentConfig,
1843
+ getUserAgentPlugin,
1844
+ createDefaultUserAgentProvider,
1845
+ NODE_APP_ID_CONFIG_OPTIONS,
1846
+ awsEndpointFunctions,
1847
+ stsRegionDefaultResolver,
1848
+ getAwsRegionExtensionConfiguration,
1849
+ resolveAwsRegionExtensionConfiguration
1850
+ };