@junando/core 0.11.0 → 0.11.1

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