nowbackup 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1387 @@
1
+ import {
2
+ SignatureV4MultiRegion,
3
+ XmlShapeDeserializer
4
+ } from "./chunk-ZHQB65KV.js";
5
+ import {
6
+ NoAuthSigner,
7
+ package_default
8
+ } from "./chunk-SSPSJLWK.js";
9
+ import {
10
+ AwsSdkSigV4ASigner,
11
+ AwsSdkSigV4Signer,
12
+ DEFAULT_RETRY_MODE,
13
+ DefaultIdentityProviderConfig,
14
+ NODE_APP_ID_CONFIG_OPTIONS,
15
+ NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,
16
+ NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
17
+ NODE_RETRY_MODE_CONFIG_OPTIONS,
18
+ NODE_SIGV4A_CONFIG_OPTIONS,
19
+ ProtocolLib,
20
+ SerdeContextConfig,
21
+ awsEndpointFunctions,
22
+ createDefaultUserAgentProvider,
23
+ emitWarningIfUnsupportedVersion as emitWarningIfUnsupportedVersion2,
24
+ getAwsRegionExtensionConfiguration,
25
+ getHostHeaderPlugin,
26
+ getHttpAuthSchemeEndpointRuleSetPlugin,
27
+ getHttpSigningPlugin,
28
+ getLoggerPlugin,
29
+ getRecursionDetectionPlugin,
30
+ getRetryPlugin,
31
+ getSchemaSerdePlugin,
32
+ getUserAgentPlugin,
33
+ resolveAwsRegionExtensionConfiguration,
34
+ resolveAwsSdkSigV4AConfig,
35
+ resolveAwsSdkSigV4Config,
36
+ resolveHostHeaderConfig,
37
+ resolveRetryConfig,
38
+ resolveUserAgentConfig,
39
+ streamCollector
40
+ } from "./chunk-57ZU5VQ4.js";
41
+ import {
42
+ NodeHttpHandler
43
+ } from "./chunk-KKIIHNPF.js";
44
+ import {
45
+ setCredentialFeature
46
+ } from "./chunk-V5IHRGZ2.js";
47
+ import {
48
+ BinaryDecisionDiagram,
49
+ Client,
50
+ Command,
51
+ EndpointCache,
52
+ NODE_REGION_CONFIG_FILE_OPTIONS,
53
+ NODE_REGION_CONFIG_OPTIONS,
54
+ NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
55
+ NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
56
+ NoOpLogger,
57
+ NormalizedSchema,
58
+ RpcProtocol,
59
+ ServiceException,
60
+ TypeRegistry,
61
+ collectBody,
62
+ createAggregatedClient,
63
+ customEndpointFunctions,
64
+ decideEndpoint,
65
+ deref,
66
+ determineTimestampFormat,
67
+ emitWarningIfUnsupportedVersion,
68
+ extendedEncodeURIComponent,
69
+ getContentLengthPlugin,
70
+ getDefaultExtensionConfiguration,
71
+ getEndpointPlugin,
72
+ getHttpHandlerExtensionConfiguration,
73
+ getSmithyContext,
74
+ loadConfig,
75
+ loadConfigsForDefaultMode,
76
+ normalizeProvider,
77
+ parseUrl,
78
+ resolveDefaultRuntimeConfig,
79
+ resolveDefaultsModeConfig,
80
+ resolveEndpointConfig,
81
+ resolveHttpHandlerRuntimeConfig,
82
+ resolveParams,
83
+ resolveRegionConfig
84
+ } from "./chunk-YMVDJI7O.js";
85
+ import {
86
+ Hash,
87
+ NumericValue,
88
+ calculateBodyLength,
89
+ dateToUtcString,
90
+ fromBase64,
91
+ fromUtf8,
92
+ generateIdempotencyToken,
93
+ toBase64,
94
+ toUtf8
95
+ } from "./chunk-APZ4HNNC.js";
96
+
97
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js
98
+ var q = "ref";
99
+ var a = -1;
100
+ var b = true;
101
+ var c = "isSet";
102
+ var d = "PartitionResult";
103
+ var e = "booleanEquals";
104
+ var f = "stringEquals";
105
+ var g = "getAttr";
106
+ var h = "us-east-1";
107
+ var i = "sigv4";
108
+ var j = "sts";
109
+ var k = "https://sts.{Region}.{PartitionResult#dnsSuffix}";
110
+ var l = { [q]: "Endpoint" };
111
+ var m = { [q]: "Region" };
112
+ var n = { [q]: d };
113
+ var o = {};
114
+ var p = [m];
115
+ var _data = {
116
+ conditions: [
117
+ [c, [l]],
118
+ [c, p],
119
+ ["aws.partition", p, d],
120
+ [e, [{ [q]: "UseFIPS" }, b]],
121
+ [e, [{ [q]: "UseDualStack" }, b]],
122
+ [f, [m, "aws-global"]],
123
+ [e, [{ [q]: "UseGlobalEndpoint" }, b]],
124
+ [f, [m, "eu-central-1"]],
125
+ [e, [{ fn: g, argv: [n, "supportsDualStack"] }, b]],
126
+ [e, [{ fn: g, argv: [n, "supportsFIPS"] }, b]],
127
+ [f, [m, "ap-south-1"]],
128
+ [f, [m, "eu-north-1"]],
129
+ [f, [m, "eu-west-1"]],
130
+ [f, [m, "eu-west-2"]],
131
+ [f, [m, "eu-west-3"]],
132
+ [f, [m, "sa-east-1"]],
133
+ [f, [m, h]],
134
+ [f, [m, "us-east-2"]],
135
+ [f, [m, "us-west-2"]],
136
+ [f, [m, "us-west-1"]],
137
+ [f, [m, "ca-central-1"]],
138
+ [f, [m, "ap-southeast-1"]],
139
+ [f, [m, "ap-northeast-1"]],
140
+ [f, [m, "ap-southeast-2"]],
141
+ [f, [{ fn: g, argv: [n, "name"] }, "aws-us-gov"]]
142
+ ],
143
+ results: [
144
+ [a],
145
+ ["https://sts.amazonaws.com", { authSchemes: [{ name: i, signingName: j, signingRegion: h }] }],
146
+ [k, { authSchemes: [{ name: i, signingName: j, signingRegion: "{Region}" }] }],
147
+ [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
148
+ [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
149
+ [l, o],
150
+ ["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
151
+ [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
152
+ ["https://sts.{Region}.amazonaws.com", o],
153
+ ["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o],
154
+ [a, "FIPS is enabled but this partition does not support FIPS"],
155
+ ["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
156
+ [a, "DualStack is enabled but this partition does not support DualStack"],
157
+ [k, o],
158
+ [a, "Invalid Configuration: Missing Region"]
159
+ ]
160
+ };
161
+ var root = 2;
162
+ var r = 1e8;
163
+ var nodes = new Int32Array([
164
+ -1,
165
+ 1,
166
+ -1,
167
+ 0,
168
+ 30,
169
+ 3,
170
+ 1,
171
+ 4,
172
+ r + 14,
173
+ 2,
174
+ 5,
175
+ r + 14,
176
+ 3,
177
+ 25,
178
+ 6,
179
+ 4,
180
+ 24,
181
+ 7,
182
+ 5,
183
+ r + 1,
184
+ 8,
185
+ 6,
186
+ 9,
187
+ r + 13,
188
+ 7,
189
+ r + 1,
190
+ 10,
191
+ 10,
192
+ r + 1,
193
+ 11,
194
+ 11,
195
+ r + 1,
196
+ 12,
197
+ 12,
198
+ r + 1,
199
+ 13,
200
+ 13,
201
+ r + 1,
202
+ 14,
203
+ 14,
204
+ r + 1,
205
+ 15,
206
+ 15,
207
+ r + 1,
208
+ 16,
209
+ 16,
210
+ r + 1,
211
+ 17,
212
+ 17,
213
+ r + 1,
214
+ 18,
215
+ 18,
216
+ r + 1,
217
+ 19,
218
+ 19,
219
+ r + 1,
220
+ 20,
221
+ 20,
222
+ r + 1,
223
+ 21,
224
+ 21,
225
+ r + 1,
226
+ 22,
227
+ 22,
228
+ r + 1,
229
+ 23,
230
+ 23,
231
+ r + 1,
232
+ r + 2,
233
+ 8,
234
+ r + 11,
235
+ r + 12,
236
+ 4,
237
+ 28,
238
+ 26,
239
+ 9,
240
+ 27,
241
+ r + 10,
242
+ 24,
243
+ r + 8,
244
+ r + 9,
245
+ 8,
246
+ 29,
247
+ r + 7,
248
+ 9,
249
+ r + 6,
250
+ r + 7,
251
+ 3,
252
+ r + 3,
253
+ 31,
254
+ 4,
255
+ r + 4,
256
+ r + 5
257
+ ]);
258
+ var bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
259
+
260
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js
261
+ var cache = new EndpointCache({
262
+ size: 50,
263
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"]
264
+ });
265
+ var defaultEndpointResolver = (endpointParams, context = {}) => {
266
+ return cache.get(endpointParams, () => decideEndpoint(bdd, {
267
+ endpointParams,
268
+ logger: context.logger
269
+ }));
270
+ };
271
+ customEndpointFunctions.aws = awsEndpointFunctions;
272
+
273
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js
274
+ var createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
275
+ var _a2, _b, _c2;
276
+ if (!input) {
277
+ throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
278
+ }
279
+ const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
280
+ const instructionsFn = (_c2 = (_b = (_a2 = getSmithyContext(context)) == null ? void 0 : _a2.commandInstance) == null ? void 0 : _b.constructor) == null ? void 0 : _c2.getEndpointParameterInstructions;
281
+ if (!instructionsFn) {
282
+ throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
283
+ }
284
+ const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
285
+ return Object.assign(defaultParameters, endpointParameters);
286
+ };
287
+ var _defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
288
+ return {
289
+ operation: getSmithyContext(context).operation,
290
+ region: await normalizeProvider(config.region)() || (() => {
291
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
292
+ })()
293
+ };
294
+ };
295
+ var defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider);
296
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
297
+ return {
298
+ schemeId: "aws.auth#sigv4",
299
+ signingProperties: {
300
+ name: "sts",
301
+ region: authParameters.region
302
+ },
303
+ propertiesExtractor: (config, context) => ({
304
+ signingProperties: {
305
+ config,
306
+ context
307
+ }
308
+ })
309
+ };
310
+ }
311
+ function createAwsAuthSigv4aHttpAuthOption(authParameters) {
312
+ return {
313
+ schemeId: "aws.auth#sigv4a",
314
+ signingProperties: {
315
+ name: "sts",
316
+ region: authParameters.region
317
+ },
318
+ propertiesExtractor: (config, context) => ({
319
+ signingProperties: {
320
+ config,
321
+ context
322
+ }
323
+ })
324
+ };
325
+ }
326
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
327
+ return {
328
+ schemeId: "smithy.api#noAuth"
329
+ };
330
+ }
331
+ var createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver2, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
332
+ const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
333
+ var _a2;
334
+ const endpoint = defaultEndpointResolver2(authParameters);
335
+ const authSchemes = (_a2 = endpoint.properties) == null ? void 0 : _a2.authSchemes;
336
+ if (!authSchemes) {
337
+ return defaultHttpAuthSchemeResolver(authParameters);
338
+ }
339
+ const options = [];
340
+ for (const scheme of authSchemes) {
341
+ const { name: resolvedName, properties = {}, ...rest } = scheme;
342
+ const name = resolvedName.toLowerCase();
343
+ if (resolvedName !== name) {
344
+ console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
345
+ }
346
+ let schemeId;
347
+ if (name === "sigv4a") {
348
+ schemeId = "aws.auth#sigv4a";
349
+ const sigv4Present = authSchemes.find((s) => {
350
+ const name2 = s.name.toLowerCase();
351
+ return name2 !== "sigv4a" && name2.startsWith("sigv4");
352
+ });
353
+ if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
354
+ continue;
355
+ }
356
+ } else if (name.startsWith("sigv4")) {
357
+ schemeId = "aws.auth#sigv4";
358
+ } else {
359
+ throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
360
+ }
361
+ const createOption = createHttpAuthOptionFunctions[schemeId];
362
+ if (!createOption) {
363
+ throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
364
+ }
365
+ const option = createOption(authParameters);
366
+ option.schemeId = schemeId;
367
+ option.signingProperties = { ...option.signingProperties || {}, ...rest, ...properties };
368
+ options.push(option);
369
+ }
370
+ return options;
371
+ };
372
+ return endpointRuleSetHttpAuthSchemeProvider;
373
+ };
374
+ var _defaultSTSHttpAuthSchemeProvider = (authParameters) => {
375
+ const options = [];
376
+ switch (authParameters.operation) {
377
+ case "AssumeRoleWithWebIdentity": {
378
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
379
+ options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
380
+ break;
381
+ }
382
+ default: {
383
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
384
+ options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
385
+ }
386
+ }
387
+ return options;
388
+ };
389
+ var defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider, {
390
+ "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
391
+ "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
392
+ "smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption
393
+ });
394
+ var resolveHttpAuthSchemeConfig = (config) => {
395
+ const config_0 = resolveAwsSdkSigV4Config(config);
396
+ const config_1 = resolveAwsSdkSigV4AConfig(config_0);
397
+ return Object.assign(config_1, {
398
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
399
+ });
400
+ };
401
+
402
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js
403
+ var resolveClientEndpointParameters = (options) => {
404
+ return Object.assign(options, {
405
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
406
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
407
+ useGlobalEndpoint: options.useGlobalEndpoint ?? false,
408
+ defaultSigningName: "sts"
409
+ });
410
+ };
411
+ var commonParams = {
412
+ UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
413
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
414
+ Endpoint: { type: "builtInParams", name: "endpoint" },
415
+ Region: { type: "builtInParams", name: "region" },
416
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
417
+ };
418
+
419
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js
420
+ var QueryShapeSerializer = class extends SerdeContextConfig {
421
+ settings;
422
+ buffer;
423
+ constructor(settings) {
424
+ super();
425
+ this.settings = settings;
426
+ }
427
+ write(schema, value, prefix = "") {
428
+ var _a2;
429
+ if (this.buffer === void 0) {
430
+ this.buffer = "";
431
+ }
432
+ const ns = NormalizedSchema.of(schema);
433
+ if (prefix && !prefix.endsWith(".")) {
434
+ prefix += ".";
435
+ }
436
+ if (ns.isBlobSchema()) {
437
+ if (typeof value === "string" || value instanceof Uint8Array) {
438
+ this.writeKey(prefix);
439
+ this.writeValue((((_a2 = this.serdeContext) == null ? void 0 : _a2.base64Encoder) ?? toBase64)(value));
440
+ }
441
+ } else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) {
442
+ if (value != null) {
443
+ this.writeKey(prefix);
444
+ this.writeValue(String(value));
445
+ } else if (ns.isIdempotencyToken()) {
446
+ this.writeKey(prefix);
447
+ this.writeValue(generateIdempotencyToken());
448
+ }
449
+ } else if (ns.isBigIntegerSchema()) {
450
+ if (value != null) {
451
+ this.writeKey(prefix);
452
+ this.writeValue(String(value));
453
+ }
454
+ } else if (ns.isBigDecimalSchema()) {
455
+ if (value != null) {
456
+ this.writeKey(prefix);
457
+ this.writeValue(value instanceof NumericValue ? value.string : String(value));
458
+ }
459
+ } else if (ns.isTimestampSchema()) {
460
+ if (value instanceof Date) {
461
+ this.writeKey(prefix);
462
+ const format = determineTimestampFormat(ns, this.settings);
463
+ switch (format) {
464
+ case 5:
465
+ this.writeValue(value.toISOString().replace(".000Z", "Z"));
466
+ break;
467
+ case 6:
468
+ this.writeValue(dateToUtcString(value));
469
+ break;
470
+ case 7:
471
+ this.writeValue(String(value.getTime() / 1e3));
472
+ break;
473
+ }
474
+ }
475
+ } else if (ns.isDocumentSchema()) {
476
+ if (Array.isArray(value)) {
477
+ this.write(64 | 15, value, prefix);
478
+ } else if (value instanceof Date) {
479
+ this.write(4, value, prefix);
480
+ } else if (value instanceof Uint8Array) {
481
+ this.write(21, value, prefix);
482
+ } else if (value && typeof value === "object") {
483
+ this.write(128 | 15, value, prefix);
484
+ } else {
485
+ this.writeKey(prefix);
486
+ this.writeValue(String(value));
487
+ }
488
+ } else if (ns.isListSchema()) {
489
+ if (Array.isArray(value)) {
490
+ if (value.length === 0) {
491
+ if (this.settings.serializeEmptyLists) {
492
+ this.writeKey(prefix);
493
+ this.writeValue("");
494
+ }
495
+ } else {
496
+ const member = ns.getValueSchema();
497
+ const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened;
498
+ let i2 = 1;
499
+ for (const item of value) {
500
+ if (item == null) {
501
+ continue;
502
+ }
503
+ const traits = member.getMergedTraits();
504
+ const suffix = this.getKey("member", traits.xmlName, traits.ec2QueryName);
505
+ const key = flat ? `${prefix}${i2}` : `${prefix}${suffix}.${i2}`;
506
+ this.write(member, item, key);
507
+ ++i2;
508
+ }
509
+ }
510
+ }
511
+ } else if (ns.isMapSchema()) {
512
+ if (value && typeof value === "object") {
513
+ const keySchema = ns.getKeySchema();
514
+ const memberSchema = ns.getValueSchema();
515
+ const flat = ns.getMergedTraits().xmlFlattened;
516
+ let i2 = 1;
517
+ for (const k2 in value) {
518
+ const v = value[k2];
519
+ if (v == null) {
520
+ continue;
521
+ }
522
+ const keyTraits = keySchema.getMergedTraits();
523
+ const keySuffix = this.getKey("key", keyTraits.xmlName, keyTraits.ec2QueryName);
524
+ const key = flat ? `${prefix}${i2}.${keySuffix}` : `${prefix}entry.${i2}.${keySuffix}`;
525
+ const valTraits = memberSchema.getMergedTraits();
526
+ const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName);
527
+ const valueKey = flat ? `${prefix}${i2}.${valueSuffix}` : `${prefix}entry.${i2}.${valueSuffix}`;
528
+ this.write(keySchema, k2, key);
529
+ this.write(memberSchema, v, valueKey);
530
+ ++i2;
531
+ }
532
+ }
533
+ } else if (ns.isStructSchema()) {
534
+ if (value && typeof value === "object") {
535
+ let didWriteMember = false;
536
+ for (const [memberName, member] of ns.structIterator()) {
537
+ if (value[memberName] == null && !member.isIdempotencyToken()) {
538
+ continue;
539
+ }
540
+ const traits = member.getMergedTraits();
541
+ const suffix = this.getKey(memberName, traits.xmlName, traits.ec2QueryName, "struct");
542
+ const key = `${prefix}${suffix}`;
543
+ this.write(member, value[memberName], key);
544
+ didWriteMember = true;
545
+ }
546
+ if (!didWriteMember && ns.isUnionSchema()) {
547
+ const { $unknown } = value;
548
+ if (Array.isArray($unknown)) {
549
+ const [k2, v] = $unknown;
550
+ const key = `${prefix}${k2}`;
551
+ this.write(15, v, key);
552
+ }
553
+ }
554
+ }
555
+ } else if (ns.isUnitSchema()) {
556
+ } else {
557
+ throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`);
558
+ }
559
+ }
560
+ flush() {
561
+ if (this.buffer === void 0) {
562
+ throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");
563
+ }
564
+ const str = this.buffer;
565
+ delete this.buffer;
566
+ return str;
567
+ }
568
+ getKey(memberName, xmlName, ec2QueryName, keySource) {
569
+ const { ec2, capitalizeKeys } = this.settings;
570
+ if (ec2 && ec2QueryName) {
571
+ return ec2QueryName;
572
+ }
573
+ const key = xmlName ?? memberName;
574
+ if (capitalizeKeys && keySource === "struct") {
575
+ return key[0].toUpperCase() + key.slice(1);
576
+ }
577
+ return key;
578
+ }
579
+ writeKey(key) {
580
+ if (key.endsWith(".")) {
581
+ key = key.slice(0, key.length - 1);
582
+ }
583
+ this.buffer += `&${extendedEncodeURIComponent(key)}=`;
584
+ }
585
+ writeValue(value) {
586
+ this.buffer += extendedEncodeURIComponent(value);
587
+ }
588
+ };
589
+
590
+ // ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js
591
+ var AwsQueryProtocol = class extends RpcProtocol {
592
+ options;
593
+ serializer;
594
+ deserializer;
595
+ mixin = new ProtocolLib();
596
+ constructor(options) {
597
+ super({
598
+ defaultNamespace: options.defaultNamespace,
599
+ errorTypeRegistries: options.errorTypeRegistries
600
+ });
601
+ this.options = options;
602
+ const settings = {
603
+ timestampFormat: {
604
+ useTrait: true,
605
+ default: 5
606
+ },
607
+ httpBindings: false,
608
+ xmlNamespace: options.xmlNamespace,
609
+ serviceNamespace: options.defaultNamespace,
610
+ serializeEmptyLists: true
611
+ };
612
+ this.serializer = new QueryShapeSerializer(settings);
613
+ this.deserializer = new XmlShapeDeserializer(settings);
614
+ }
615
+ getShapeId() {
616
+ return "aws.protocols#awsQuery";
617
+ }
618
+ setSerdeContext(serdeContext) {
619
+ this.serializer.setSerdeContext(serdeContext);
620
+ this.deserializer.setSerdeContext(serdeContext);
621
+ }
622
+ getPayloadCodec() {
623
+ throw new Error("AWSQuery protocol has no payload codec.");
624
+ }
625
+ async serializeRequest(operationSchema, input, context) {
626
+ const request = await super.serializeRequest(operationSchema, input, context);
627
+ if (!request.path.endsWith("/")) {
628
+ request.path += "/";
629
+ }
630
+ request.headers["content-type"] = "application/x-www-form-urlencoded";
631
+ if (deref(operationSchema.input) === "unit" || !request.body) {
632
+ request.body = "";
633
+ }
634
+ const action = operationSchema.name.split("#")[1] ?? operationSchema.name;
635
+ request.body = `Action=${action}&Version=${this.options.version}` + request.body;
636
+ if (request.body.endsWith("&")) {
637
+ request.body = request.body.slice(-1);
638
+ }
639
+ return request;
640
+ }
641
+ async deserializeResponse(operationSchema, context, response) {
642
+ const deserializer = this.deserializer;
643
+ const ns = NormalizedSchema.of(operationSchema.output);
644
+ const dataObject = {};
645
+ if (response.statusCode >= 300) {
646
+ const bytes2 = await collectBody(response.body, context);
647
+ if (bytes2.byteLength > 0) {
648
+ Object.assign(dataObject, await deserializer.read(15, bytes2));
649
+ }
650
+ await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
651
+ }
652
+ for (const header in response.headers) {
653
+ const value = response.headers[header];
654
+ delete response.headers[header];
655
+ response.headers[header.toLowerCase()] = value;
656
+ }
657
+ const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name;
658
+ const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : void 0;
659
+ const bytes = await collectBody(response.body, context);
660
+ if (bytes.byteLength > 0) {
661
+ Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));
662
+ }
663
+ dataObject.$metadata = this.deserializeMetadata(response);
664
+ return dataObject;
665
+ }
666
+ useNestedResult() {
667
+ return true;
668
+ }
669
+ async handleError(operationSchema, context, response, dataObject, metadata) {
670
+ const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown";
671
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
672
+ const errorData = this.loadQueryError(dataObject) ?? {};
673
+ const message = this.loadQueryErrorMessage(dataObject);
674
+ errorData.message = message;
675
+ errorData.Error = {
676
+ Type: errorData.Type,
677
+ Code: errorData.Code,
678
+ Message: message
679
+ };
680
+ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError);
681
+ const ns = NormalizedSchema.of(errorSchema);
682
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
683
+ const exception = new ErrorCtor({});
684
+ const output = {
685
+ Type: errorData.Error.Type,
686
+ Code: errorData.Error.Code,
687
+ Error: errorData.Error
688
+ };
689
+ for (const [name, member] of ns.structIterator()) {
690
+ const target = member.getMergedTraits().xmlName ?? name;
691
+ const value = errorData[target] ?? dataObject[target];
692
+ output[name] = this.deserializer.readSchema(member, value);
693
+ }
694
+ throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
695
+ $fault: ns.getMergedTraits().error,
696
+ message
697
+ }, output), dataObject);
698
+ }
699
+ loadQueryErrorCode(output, data) {
700
+ var _a2, _b, _c2, _d;
701
+ const code = (_d = ((_b = (_a2 = data.Errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.Error) ?? ((_c2 = data.Errors) == null ? void 0 : _c2.Error) ?? data.Error) == null ? void 0 : _d.Code;
702
+ if (code !== void 0) {
703
+ return code;
704
+ }
705
+ if (output.statusCode == 404) {
706
+ return "NotFound";
707
+ }
708
+ }
709
+ loadQueryError(data) {
710
+ var _a2, _b, _c2;
711
+ return ((_b = (_a2 = data.Errors) == null ? void 0 : _a2[0]) == null ? void 0 : _b.Error) ?? ((_c2 = data.Errors) == null ? void 0 : _c2.Error) ?? data.Error;
712
+ }
713
+ loadQueryErrorMessage(data) {
714
+ const errorData = this.loadQueryError(data);
715
+ return (errorData == null ? void 0 : errorData.message) ?? (errorData == null ? void 0 : errorData.Message) ?? data.message ?? data.Message ?? "Unknown";
716
+ }
717
+ getDefaultContentType() {
718
+ return "application/x-www-form-urlencoded";
719
+ }
720
+ };
721
+
722
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js
723
+ var STSServiceException = class _STSServiceException extends ServiceException {
724
+ constructor(options) {
725
+ super(options);
726
+ Object.setPrototypeOf(this, _STSServiceException.prototype);
727
+ }
728
+ };
729
+
730
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js
731
+ var ExpiredTokenException = class _ExpiredTokenException extends STSServiceException {
732
+ name = "ExpiredTokenException";
733
+ $fault = "client";
734
+ constructor(opts) {
735
+ super({
736
+ name: "ExpiredTokenException",
737
+ $fault: "client",
738
+ ...opts
739
+ });
740
+ Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
741
+ }
742
+ };
743
+ var MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException {
744
+ name = "MalformedPolicyDocumentException";
745
+ $fault = "client";
746
+ constructor(opts) {
747
+ super({
748
+ name: "MalformedPolicyDocumentException",
749
+ $fault: "client",
750
+ ...opts
751
+ });
752
+ Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
753
+ }
754
+ };
755
+ var PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException {
756
+ name = "PackedPolicyTooLargeException";
757
+ $fault = "client";
758
+ constructor(opts) {
759
+ super({
760
+ name: "PackedPolicyTooLargeException",
761
+ $fault: "client",
762
+ ...opts
763
+ });
764
+ Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype);
765
+ }
766
+ };
767
+ var RegionDisabledException = class _RegionDisabledException extends STSServiceException {
768
+ name = "RegionDisabledException";
769
+ $fault = "client";
770
+ constructor(opts) {
771
+ super({
772
+ name: "RegionDisabledException",
773
+ $fault: "client",
774
+ ...opts
775
+ });
776
+ Object.setPrototypeOf(this, _RegionDisabledException.prototype);
777
+ }
778
+ };
779
+ var IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException {
780
+ name = "IDPRejectedClaimException";
781
+ $fault = "client";
782
+ constructor(opts) {
783
+ super({
784
+ name: "IDPRejectedClaimException",
785
+ $fault: "client",
786
+ ...opts
787
+ });
788
+ Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype);
789
+ }
790
+ };
791
+ var InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException {
792
+ name = "InvalidIdentityTokenException";
793
+ $fault = "client";
794
+ constructor(opts) {
795
+ super({
796
+ name: "InvalidIdentityTokenException",
797
+ $fault: "client",
798
+ ...opts
799
+ });
800
+ Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype);
801
+ }
802
+ };
803
+ var IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException {
804
+ name = "IDPCommunicationErrorException";
805
+ $fault = "client";
806
+ $retryable = {};
807
+ constructor(opts) {
808
+ super({
809
+ name: "IDPCommunicationErrorException",
810
+ $fault: "client",
811
+ ...opts
812
+ });
813
+ Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype);
814
+ }
815
+ };
816
+
817
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js
818
+ var _A = "Arn";
819
+ var _AKI = "AccessKeyId";
820
+ var _AR = "AssumeRole";
821
+ var _ARI = "AssumedRoleId";
822
+ var _ARR = "AssumeRoleRequest";
823
+ var _ARRs = "AssumeRoleResponse";
824
+ var _ARU = "AssumedRoleUser";
825
+ var _ARWWI = "AssumeRoleWithWebIdentity";
826
+ var _ARWWIR = "AssumeRoleWithWebIdentityRequest";
827
+ var _ARWWIRs = "AssumeRoleWithWebIdentityResponse";
828
+ var _Au = "Audience";
829
+ var _C = "Credentials";
830
+ var _CA = "ContextAssertion";
831
+ var _DS = "DurationSeconds";
832
+ var _E = "Expiration";
833
+ var _EI = "ExternalId";
834
+ var _ETE = "ExpiredTokenException";
835
+ var _IDPCEE = "IDPCommunicationErrorException";
836
+ var _IDPRCE = "IDPRejectedClaimException";
837
+ var _IITE = "InvalidIdentityTokenException";
838
+ var _K = "Key";
839
+ var _MPDE = "MalformedPolicyDocumentException";
840
+ var _P = "Policy";
841
+ var _PA = "PolicyArns";
842
+ var _PAr = "ProviderArn";
843
+ var _PC = "ProvidedContexts";
844
+ var _PCLT = "ProvidedContextsListType";
845
+ var _PCr = "ProvidedContext";
846
+ var _PDT = "PolicyDescriptorType";
847
+ var _PI = "ProviderId";
848
+ var _PPS = "PackedPolicySize";
849
+ var _PPTLE = "PackedPolicyTooLargeException";
850
+ var _Pr = "Provider";
851
+ var _RA = "RoleArn";
852
+ var _RDE = "RegionDisabledException";
853
+ var _RSN = "RoleSessionName";
854
+ var _SAK = "SecretAccessKey";
855
+ var _SFWIT = "SubjectFromWebIdentityToken";
856
+ var _SI = "SourceIdentity";
857
+ var _SN = "SerialNumber";
858
+ var _ST = "SessionToken";
859
+ var _T = "Tags";
860
+ var _TC = "TokenCode";
861
+ var _TTK = "TransitiveTagKeys";
862
+ var _Ta = "Tag";
863
+ var _V = "Value";
864
+ var _WIT = "WebIdentityToken";
865
+ var _a = "arn";
866
+ var _aKST = "accessKeySecretType";
867
+ var _aQE = "awsQueryError";
868
+ var _c = "client";
869
+ var _cTT = "clientTokenType";
870
+ var _e = "error";
871
+ var _hE = "httpError";
872
+ var _m = "message";
873
+ var _pDLT = "policyDescriptorListType";
874
+ var _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts";
875
+ var _tLT = "tagListType";
876
+ var n0 = "com.amazonaws.sts";
877
+ var _s_registry = TypeRegistry.for(_s);
878
+ var STSServiceException$ = [-3, _s, "STSServiceException", 0, [], []];
879
+ _s_registry.registerError(STSServiceException$, STSServiceException);
880
+ var n0_registry = TypeRegistry.for(n0);
881
+ var ExpiredTokenException$ = [
882
+ -3,
883
+ n0,
884
+ _ETE,
885
+ { [_aQE]: [`ExpiredTokenException`, 400], [_e]: _c, [_hE]: 400 },
886
+ [_m],
887
+ [0]
888
+ ];
889
+ n0_registry.registerError(ExpiredTokenException$, ExpiredTokenException);
890
+ var IDPCommunicationErrorException$ = [
891
+ -3,
892
+ n0,
893
+ _IDPCEE,
894
+ { [_aQE]: [`IDPCommunicationError`, 400], [_e]: _c, [_hE]: 400 },
895
+ [_m],
896
+ [0]
897
+ ];
898
+ n0_registry.registerError(IDPCommunicationErrorException$, IDPCommunicationErrorException);
899
+ var IDPRejectedClaimException$ = [
900
+ -3,
901
+ n0,
902
+ _IDPRCE,
903
+ { [_aQE]: [`IDPRejectedClaim`, 403], [_e]: _c, [_hE]: 403 },
904
+ [_m],
905
+ [0]
906
+ ];
907
+ n0_registry.registerError(IDPRejectedClaimException$, IDPRejectedClaimException);
908
+ var InvalidIdentityTokenException$ = [
909
+ -3,
910
+ n0,
911
+ _IITE,
912
+ { [_aQE]: [`InvalidIdentityToken`, 400], [_e]: _c, [_hE]: 400 },
913
+ [_m],
914
+ [0]
915
+ ];
916
+ n0_registry.registerError(InvalidIdentityTokenException$, InvalidIdentityTokenException);
917
+ var MalformedPolicyDocumentException$ = [
918
+ -3,
919
+ n0,
920
+ _MPDE,
921
+ { [_aQE]: [`MalformedPolicyDocument`, 400], [_e]: _c, [_hE]: 400 },
922
+ [_m],
923
+ [0]
924
+ ];
925
+ n0_registry.registerError(MalformedPolicyDocumentException$, MalformedPolicyDocumentException);
926
+ var PackedPolicyTooLargeException$ = [
927
+ -3,
928
+ n0,
929
+ _PPTLE,
930
+ { [_aQE]: [`PackedPolicyTooLarge`, 400], [_e]: _c, [_hE]: 400 },
931
+ [_m],
932
+ [0]
933
+ ];
934
+ n0_registry.registerError(PackedPolicyTooLargeException$, PackedPolicyTooLargeException);
935
+ var RegionDisabledException$ = [
936
+ -3,
937
+ n0,
938
+ _RDE,
939
+ { [_aQE]: [`RegionDisabledException`, 403], [_e]: _c, [_hE]: 403 },
940
+ [_m],
941
+ [0]
942
+ ];
943
+ n0_registry.registerError(RegionDisabledException$, RegionDisabledException);
944
+ var errorTypeRegistries = [_s_registry, n0_registry];
945
+ var accessKeySecretType = [0, n0, _aKST, 8, 0];
946
+ var clientTokenType = [0, n0, _cTT, 8, 0];
947
+ var AssumedRoleUser$ = [3, n0, _ARU, 0, [_ARI, _A], [0, 0], 2];
948
+ var AssumeRoleRequest$ = [
949
+ 3,
950
+ n0,
951
+ _ARR,
952
+ 0,
953
+ [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC],
954
+ [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType],
955
+ 2
956
+ ];
957
+ var AssumeRoleResponse$ = [
958
+ 3,
959
+ n0,
960
+ _ARRs,
961
+ 0,
962
+ [_C, _ARU, _PPS, _SI],
963
+ [[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0]
964
+ ];
965
+ var AssumeRoleWithWebIdentityRequest$ = [
966
+ 3,
967
+ n0,
968
+ _ARWWIR,
969
+ 0,
970
+ [_RA, _RSN, _WIT, _PI, _PA, _P, _DS],
971
+ [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1],
972
+ 3
973
+ ];
974
+ var AssumeRoleWithWebIdentityResponse$ = [
975
+ 3,
976
+ n0,
977
+ _ARWWIRs,
978
+ 0,
979
+ [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI],
980
+ [[() => Credentials$, 0], 0, () => AssumedRoleUser$, 1, 0, 0, 0]
981
+ ];
982
+ var Credentials$ = [
983
+ 3,
984
+ n0,
985
+ _C,
986
+ 0,
987
+ [_AKI, _SAK, _ST, _E],
988
+ [0, [() => accessKeySecretType, 0], 0, 4],
989
+ 4
990
+ ];
991
+ var PolicyDescriptorType$ = [3, n0, _PDT, 0, [_a], [0]];
992
+ var ProvidedContext$ = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]];
993
+ var Tag$ = [3, n0, _Ta, 0, [_K, _V], [0, 0], 2];
994
+ var policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType$];
995
+ var ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext$];
996
+ var tagKeyListType = 64 | 0;
997
+ var tagListType = [1, n0, _tLT, 0, () => Tag$];
998
+ var AssumeRole$ = [9, n0, _AR, 0, () => AssumeRoleRequest$, () => AssumeRoleResponse$];
999
+ var AssumeRoleWithWebIdentity$ = [
1000
+ 9,
1001
+ n0,
1002
+ _ARWWI,
1003
+ 0,
1004
+ () => AssumeRoleWithWebIdentityRequest$,
1005
+ () => AssumeRoleWithWebIdentityResponse$
1006
+ ];
1007
+
1008
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js
1009
+ var getRuntimeConfig = (config) => {
1010
+ return {
1011
+ apiVersion: "2011-06-15",
1012
+ base64Decoder: (config == null ? void 0 : config.base64Decoder) ?? fromBase64,
1013
+ base64Encoder: (config == null ? void 0 : config.base64Encoder) ?? toBase64,
1014
+ disableHostPrefix: (config == null ? void 0 : config.disableHostPrefix) ?? false,
1015
+ endpointProvider: (config == null ? void 0 : config.endpointProvider) ?? defaultEndpointResolver,
1016
+ extensions: (config == null ? void 0 : config.extensions) ?? [],
1017
+ httpAuthSchemeProvider: (config == null ? void 0 : config.httpAuthSchemeProvider) ?? defaultSTSHttpAuthSchemeProvider,
1018
+ httpAuthSchemes: (config == null ? void 0 : config.httpAuthSchemes) ?? [
1019
+ {
1020
+ schemeId: "aws.auth#sigv4",
1021
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
1022
+ signer: new AwsSdkSigV4Signer()
1023
+ },
1024
+ {
1025
+ schemeId: "aws.auth#sigv4a",
1026
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
1027
+ signer: new AwsSdkSigV4ASigner()
1028
+ },
1029
+ {
1030
+ schemeId: "smithy.api#noAuth",
1031
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
1032
+ signer: new NoAuthSigner()
1033
+ }
1034
+ ],
1035
+ logger: (config == null ? void 0 : config.logger) ?? new NoOpLogger(),
1036
+ protocol: (config == null ? void 0 : config.protocol) ?? AwsQueryProtocol,
1037
+ protocolSettings: (config == null ? void 0 : config.protocolSettings) ?? {
1038
+ defaultNamespace: "com.amazonaws.sts",
1039
+ errorTypeRegistries,
1040
+ xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/",
1041
+ version: "2011-06-15",
1042
+ serviceTarget: "AWSSecurityTokenServiceV20110615"
1043
+ },
1044
+ serviceId: (config == null ? void 0 : config.serviceId) ?? "STS",
1045
+ signerConstructor: (config == null ? void 0 : config.signerConstructor) ?? SignatureV4MultiRegion,
1046
+ urlParser: (config == null ? void 0 : config.urlParser) ?? parseUrl,
1047
+ utf8Decoder: (config == null ? void 0 : config.utf8Decoder) ?? fromUtf8,
1048
+ utf8Encoder: (config == null ? void 0 : config.utf8Encoder) ?? toUtf8
1049
+ };
1050
+ };
1051
+
1052
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js
1053
+ var getRuntimeConfig2 = (config) => {
1054
+ emitWarningIfUnsupportedVersion(process.version);
1055
+ const defaultsMode = resolveDefaultsModeConfig(config);
1056
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
1057
+ const clientSharedValues = getRuntimeConfig(config);
1058
+ emitWarningIfUnsupportedVersion2(process.version);
1059
+ const loaderConfig = {
1060
+ profile: config == null ? void 0 : config.profile,
1061
+ logger: clientSharedValues.logger
1062
+ };
1063
+ return {
1064
+ ...clientSharedValues,
1065
+ ...config,
1066
+ runtime: "node",
1067
+ defaultsMode,
1068
+ authSchemePreference: (config == null ? void 0 : config.authSchemePreference) ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
1069
+ bodyLengthChecker: (config == null ? void 0 : config.bodyLengthChecker) ?? calculateBodyLength,
1070
+ defaultUserAgentProvider: (config == null ? void 0 : config.defaultUserAgentProvider) ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }),
1071
+ httpAuthSchemes: (config == null ? void 0 : config.httpAuthSchemes) ?? [
1072
+ {
1073
+ schemeId: "aws.auth#sigv4",
1074
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await config.credentialDefaultProvider((idProps == null ? void 0 : idProps.__config) || {})()),
1075
+ signer: new AwsSdkSigV4Signer()
1076
+ },
1077
+ {
1078
+ schemeId: "aws.auth#sigv4a",
1079
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
1080
+ signer: new AwsSdkSigV4ASigner()
1081
+ },
1082
+ {
1083
+ schemeId: "smithy.api#noAuth",
1084
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
1085
+ signer: new NoAuthSigner()
1086
+ }
1087
+ ],
1088
+ maxAttempts: (config == null ? void 0 : config.maxAttempts) ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
1089
+ region: (config == null ? void 0 : config.region) ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
1090
+ requestHandler: NodeHttpHandler.create((config == null ? void 0 : config.requestHandler) ?? defaultConfigProvider),
1091
+ retryMode: (config == null ? void 0 : config.retryMode) ?? loadConfig({
1092
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
1093
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE
1094
+ }, config),
1095
+ sha256: (config == null ? void 0 : config.sha256) ?? Hash.bind(null, "sha256"),
1096
+ sigv4aSigningRegionSet: (config == null ? void 0 : config.sigv4aSigningRegionSet) ?? loadConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
1097
+ streamCollector: (config == null ? void 0 : config.streamCollector) ?? streamCollector,
1098
+ useDualstackEndpoint: (config == null ? void 0 : config.useDualstackEndpoint) ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
1099
+ useFipsEndpoint: (config == null ? void 0 : config.useFipsEndpoint) ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
1100
+ userAgentAppId: (config == null ? void 0 : config.userAgentAppId) ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig)
1101
+ };
1102
+ };
1103
+
1104
+ // ../../node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.js
1105
+ function stsRegionDefaultResolver(loaderConfig = {}) {
1106
+ return loadConfig({
1107
+ ...NODE_REGION_CONFIG_OPTIONS,
1108
+ async default() {
1109
+ if (!warning.silence) {
1110
+ console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");
1111
+ }
1112
+ return "us-east-1";
1113
+ }
1114
+ }, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig });
1115
+ }
1116
+ var warning = {
1117
+ silence: false
1118
+ };
1119
+
1120
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js
1121
+ var getHttpAuthExtensionConfiguration = (runtimeConfig) => {
1122
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
1123
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
1124
+ let _credentials = runtimeConfig.credentials;
1125
+ return {
1126
+ setHttpAuthScheme(httpAuthScheme) {
1127
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
1128
+ if (index === -1) {
1129
+ _httpAuthSchemes.push(httpAuthScheme);
1130
+ } else {
1131
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
1132
+ }
1133
+ },
1134
+ httpAuthSchemes() {
1135
+ return _httpAuthSchemes;
1136
+ },
1137
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
1138
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
1139
+ },
1140
+ httpAuthSchemeProvider() {
1141
+ return _httpAuthSchemeProvider;
1142
+ },
1143
+ setCredentials(credentials) {
1144
+ _credentials = credentials;
1145
+ },
1146
+ credentials() {
1147
+ return _credentials;
1148
+ }
1149
+ };
1150
+ };
1151
+ var resolveHttpAuthRuntimeConfig = (config) => {
1152
+ return {
1153
+ httpAuthSchemes: config.httpAuthSchemes(),
1154
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
1155
+ credentials: config.credentials()
1156
+ };
1157
+ };
1158
+
1159
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js
1160
+ var resolveRuntimeExtensions = (runtimeConfig, extensions) => {
1161
+ const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
1162
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
1163
+ return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
1164
+ };
1165
+
1166
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js
1167
+ var STSClient = class extends Client {
1168
+ config;
1169
+ constructor(...[configuration]) {
1170
+ const _config_0 = getRuntimeConfig2(configuration || {});
1171
+ super(_config_0);
1172
+ this.initConfig = _config_0;
1173
+ const _config_1 = resolveClientEndpointParameters(_config_0);
1174
+ const _config_2 = resolveUserAgentConfig(_config_1);
1175
+ const _config_3 = resolveRetryConfig(_config_2);
1176
+ const _config_4 = resolveRegionConfig(_config_3);
1177
+ const _config_5 = resolveHostHeaderConfig(_config_4);
1178
+ const _config_6 = resolveEndpointConfig(_config_5);
1179
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
1180
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
1181
+ this.config = _config_8;
1182
+ this.middlewareStack.use(getSchemaSerdePlugin(this.config));
1183
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
1184
+ this.middlewareStack.use(getRetryPlugin(this.config));
1185
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
1186
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
1187
+ this.middlewareStack.use(getLoggerPlugin(this.config));
1188
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
1189
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
1190
+ httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider,
1191
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
1192
+ "aws.auth#sigv4": config.credentials,
1193
+ "aws.auth#sigv4a": config.credentials
1194
+ })
1195
+ }));
1196
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
1197
+ }
1198
+ destroy() {
1199
+ super.destroy();
1200
+ }
1201
+ };
1202
+
1203
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js
1204
+ var AssumeRoleCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
1205
+ return [getEndpointPlugin(config, Command2.getEndpointParameterInstructions())];
1206
+ }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole$).build() {
1207
+ };
1208
+
1209
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js
1210
+ var AssumeRoleWithWebIdentityCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
1211
+ return [getEndpointPlugin(config, Command2.getEndpointParameterInstructions())];
1212
+ }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity$).build() {
1213
+ };
1214
+
1215
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js
1216
+ var commands = {
1217
+ AssumeRoleCommand,
1218
+ AssumeRoleWithWebIdentityCommand
1219
+ };
1220
+ var STS = class extends STSClient {
1221
+ };
1222
+ createAggregatedClient(commands, STS);
1223
+
1224
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js
1225
+ var getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {
1226
+ if (typeof (assumedRoleUser == null ? void 0 : assumedRoleUser.Arn) === "string") {
1227
+ const arnComponents = assumedRoleUser.Arn.split(":");
1228
+ if (arnComponents.length > 4 && arnComponents[4] !== "") {
1229
+ return arnComponents[4];
1230
+ }
1231
+ }
1232
+ return void 0;
1233
+ };
1234
+ var resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => {
1235
+ var _a2;
1236
+ const region = typeof _region === "function" ? await _region() : _region;
1237
+ const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
1238
+ let stsDefaultRegion = "";
1239
+ const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await stsRegionDefaultResolver(loaderConfig)());
1240
+ (_a2 = credentialProviderLogger == null ? void 0 : credentialProviderLogger.debug) == null ? void 0 : _a2.call(credentialProviderLogger, "@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`);
1241
+ return resolvedRegion;
1242
+ };
1243
+ var getDefaultRoleAssumer = (stsOptions, STSClient2) => {
1244
+ let stsClient;
1245
+ let closureSourceCreds;
1246
+ return async (sourceCreds, params) => {
1247
+ var _a2, _b, _c2, _d, _e2;
1248
+ closureSourceCreds = sourceCreds;
1249
+ if (!stsClient) {
1250
+ const { logger = (_a2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _a2.logger, profile = (_b = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _b.profile, region, requestHandler = (_c2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _c2.requestHandler, credentialProviderLogger, userAgentAppId = (_d = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _d.userAgentAppId } = stsOptions;
1251
+ const resolvedRegion = await resolveRegion(region, (_e2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _e2.region, credentialProviderLogger, {
1252
+ logger,
1253
+ profile
1254
+ });
1255
+ const isCompatibleRequestHandler = !isH2(requestHandler);
1256
+ stsClient = new STSClient2({
1257
+ ...stsOptions,
1258
+ userAgentAppId,
1259
+ profile,
1260
+ credentialDefaultProvider: () => async () => closureSourceCreds,
1261
+ region: resolvedRegion,
1262
+ requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
1263
+ logger
1264
+ });
1265
+ }
1266
+ const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params));
1267
+ if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
1268
+ throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
1269
+ }
1270
+ const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
1271
+ const credentials = {
1272
+ accessKeyId: Credentials.AccessKeyId,
1273
+ secretAccessKey: Credentials.SecretAccessKey,
1274
+ sessionToken: Credentials.SessionToken,
1275
+ expiration: Credentials.Expiration,
1276
+ ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope },
1277
+ ...accountId && { accountId }
1278
+ };
1279
+ setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
1280
+ return credentials;
1281
+ };
1282
+ };
1283
+ var getDefaultRoleAssumerWithWebIdentity = (stsOptions, STSClient2) => {
1284
+ let stsClient;
1285
+ return async (params) => {
1286
+ var _a2, _b, _c2, _d, _e2;
1287
+ if (!stsClient) {
1288
+ const { logger = (_a2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _a2.logger, profile = (_b = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _b.profile, region, requestHandler = (_c2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _c2.requestHandler, credentialProviderLogger, userAgentAppId = (_d = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _d.userAgentAppId } = stsOptions;
1289
+ const resolvedRegion = await resolveRegion(region, (_e2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _e2.region, credentialProviderLogger, {
1290
+ logger,
1291
+ profile
1292
+ });
1293
+ const isCompatibleRequestHandler = !isH2(requestHandler);
1294
+ stsClient = new STSClient2({
1295
+ ...stsOptions,
1296
+ userAgentAppId,
1297
+ profile,
1298
+ region: resolvedRegion,
1299
+ requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
1300
+ logger
1301
+ });
1302
+ }
1303
+ const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
1304
+ if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
1305
+ throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
1306
+ }
1307
+ const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
1308
+ const credentials = {
1309
+ accessKeyId: Credentials.AccessKeyId,
1310
+ secretAccessKey: Credentials.SecretAccessKey,
1311
+ sessionToken: Credentials.SessionToken,
1312
+ expiration: Credentials.Expiration,
1313
+ ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope },
1314
+ ...accountId && { accountId }
1315
+ };
1316
+ if (accountId) {
1317
+ setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T");
1318
+ }
1319
+ setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
1320
+ return credentials;
1321
+ };
1322
+ };
1323
+ var isH2 = (requestHandler) => {
1324
+ var _a2;
1325
+ return ((_a2 = requestHandler == null ? void 0 : requestHandler.metadata) == null ? void 0 : _a2.handlerProtocol) === "h2";
1326
+ };
1327
+
1328
+ // ../../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js
1329
+ var getCustomizableStsClientCtor = (baseCtor, customizations) => {
1330
+ if (!customizations)
1331
+ return baseCtor;
1332
+ else
1333
+ return class CustomizableSTSClient extends baseCtor {
1334
+ constructor(config) {
1335
+ super(config);
1336
+ for (const customization of customizations) {
1337
+ this.middlewareStack.use(customization);
1338
+ }
1339
+ }
1340
+ };
1341
+ };
1342
+ var getDefaultRoleAssumer2 = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins));
1343
+ var getDefaultRoleAssumerWithWebIdentity2 = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins));
1344
+ var decorateDefaultCredentialProvider = (provider) => (input) => provider({
1345
+ roleAssumer: getDefaultRoleAssumer2(input),
1346
+ roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input),
1347
+ ...input
1348
+ });
1349
+ export {
1350
+ Command as $Command,
1351
+ AssumeRole$,
1352
+ AssumeRoleCommand,
1353
+ AssumeRoleRequest$,
1354
+ AssumeRoleResponse$,
1355
+ AssumeRoleWithWebIdentity$,
1356
+ AssumeRoleWithWebIdentityCommand,
1357
+ AssumeRoleWithWebIdentityRequest$,
1358
+ AssumeRoleWithWebIdentityResponse$,
1359
+ AssumedRoleUser$,
1360
+ Credentials$,
1361
+ ExpiredTokenException,
1362
+ ExpiredTokenException$,
1363
+ IDPCommunicationErrorException,
1364
+ IDPCommunicationErrorException$,
1365
+ IDPRejectedClaimException,
1366
+ IDPRejectedClaimException$,
1367
+ InvalidIdentityTokenException,
1368
+ InvalidIdentityTokenException$,
1369
+ MalformedPolicyDocumentException,
1370
+ MalformedPolicyDocumentException$,
1371
+ PackedPolicyTooLargeException,
1372
+ PackedPolicyTooLargeException$,
1373
+ PolicyDescriptorType$,
1374
+ ProvidedContext$,
1375
+ RegionDisabledException,
1376
+ RegionDisabledException$,
1377
+ STS,
1378
+ STSClient,
1379
+ STSServiceException,
1380
+ STSServiceException$,
1381
+ Tag$,
1382
+ Client as __Client,
1383
+ decorateDefaultCredentialProvider,
1384
+ errorTypeRegistries,
1385
+ getDefaultRoleAssumer2 as getDefaultRoleAssumer,
1386
+ getDefaultRoleAssumerWithWebIdentity2 as getDefaultRoleAssumerWithWebIdentity
1387
+ };