From 089e9d8af66be29c0365445f63ba008855f2557c Mon Sep 17 00:00:00 2001 From: Eli Polonsky Date: Sun, 17 Nov 2024 23:45:42 +0200 Subject: [PATCH 1/5] fix(cli): `cdk diff` always falls back to template only diff (#32165) Closes https://github.com/aws/aws-cdk/issues/32160 ### Reason for this change When running `cdk deploy`, it is supposed to (by default) create a read-only change set and incorporate it within the diff. However, it currently fails creating the change-set and always falls back to template only diffs. ### Description of changes There was a wrong invocation of the `makeBodyParameter` parameter after the [migration to sdk v3](https://github.com/aws/aws-cdk/pull/31702). ### Description of how you validated changes Added missing integration tests. Unit test for this code are tricky because they require too many mocks. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../cli-integ/resources/cdk-apps/app/app.js | 11 +++++ .../tests/cli-integ-tests/cli.integtest.ts | 40 +++++++++++++++++++ .../aws-cdk/lib/api/util/cloudformation.ts | 1 - 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js index 0f88ddf3bd467..54eb8842eeee8 100755 --- a/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js +++ b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js @@ -776,6 +776,15 @@ class AppSyncHotswapStack extends cdk.Stack { } } +class MetadataStack extends cdk.Stack { + constructor(parent, id, props) { + super(parent, id, props); + const handle = new cdk.CfnWaitConditionHandle(this, 'WaitConditionHandle'); + handle.addMetadata('Key', process.env.INTEG_METADATA_VALUE ?? 'default') + + } +} + const app = new cdk.App({ context: { '@aws-cdk/core:assetHashSalt': process.env.CODEBUILD_BUILD_ID, // Force all assets to be unique, but consistent in one build @@ -877,6 +886,8 @@ switch (stackSet) { new ExportValueStack(app, `${stackPrefix}-export-value-stack`); new BundlingStage(app, `${stackPrefix}-bundling-stage`); + + new MetadataStack(app, `${stackPrefix}-metadata`); break; case 'stage-using-context': diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts index de888c9062f22..82f18672cfac2 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts @@ -1064,6 +1064,46 @@ integTest( }), ); +integTest( + 'cdk diff doesnt show resource metadata changes', + withDefaultFixture(async (fixture) => { + + // GIVEN - small initial stack with default resource metadata + await fixture.cdkDeploy('metadata'); + + // WHEN - changing resource metadata value + const diff = await fixture.cdk(['diff', fixture.fullStackName('metadata')], { + verbose: true, + modEnv: { + INTEG_METADATA_VALUE: 'custom', + }, + }); + + // Assert there are no changes + expect(diff).toContain('There were no differences'); + }), +); + +integTest( + 'cdk diff shows resource metadata changes with --no-change-set', + withDefaultFixture(async (fixture) => { + + // GIVEN - small initial stack with default resource metadata + await fixture.cdkDeploy('metadata'); + + // WHEN - changing resource metadata value + const diff = await fixture.cdk(['diff --no-change-set', fixture.fullStackName('metadata')], { + verbose: true, + modEnv: { + INTEG_METADATA_VALUE: 'custom', + }, + }); + + // Assert there are changes + expect(diff).not.toContain('There were no differences'); + }), +); + integTest('cdk diff with large changeset and custom toolkit stack name and qualifier does not fail', withoutBootstrap(async (fixture) => { // Bootstrapping with custom toolkit stack name and qualifier const qualifier = 'abc1111'; diff --git a/packages/aws-cdk/lib/api/util/cloudformation.ts b/packages/aws-cdk/lib/api/util/cloudformation.ts index 79ac7cb461c1a..dcfe8a62dc6ef 100644 --- a/packages/aws-cdk/lib/api/util/cloudformation.ts +++ b/packages/aws-cdk/lib/api/util/cloudformation.ts @@ -400,7 +400,6 @@ async function uploadBodyParameterAndCreateChangeSet( env.resolvedEnvironment, new AssetManifestBuilder(), env.resources, - env.sdk, ); const cfn = env.sdk.cloudFormation(); const exists = (await CloudFormationStack.lookup(cfn, options.stack.stackName, false)).exists; From f75dc72ce7fec3293a4b768a4402e75857039583 Mon Sep 17 00:00:00 2001 From: Otavio Macedo <288203+otaviomacedo@users.noreply.github.com> Date: Sun, 17 Nov 2024 22:15:47 +0000 Subject: [PATCH 2/5] fix(cli): the LoadBalancerProvider doesn't match LBs when querying by a subset of tags (#32164) There was a regression in the load balancer lookup, in which we started requiring that the set of tags in the query is strictly the same as the set of tags in the load balancer (rather than merely a subset of it). Remove the length equality constraint and also simplify the code to make the intent clearer. Fixes https://github.com/aws/aws-cdk/issues/32161. ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* Co-authored-by: Momo Kornher --- .../lib/context-providers/load-balancers.ts | 15 +++--- .../context-providers/load-balancers.test.ts | 46 +++++++++++++++++++ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/packages/aws-cdk/lib/context-providers/load-balancers.ts b/packages/aws-cdk/lib/context-providers/load-balancers.ts index 5441a118fa210..f9f2e53089295 100644 --- a/packages/aws-cdk/lib/context-providers/load-balancers.ts +++ b/packages/aws-cdk/lib/context-providers/load-balancers.ts @@ -160,15 +160,12 @@ class LoadBalancerProvider { } return (await this.describeTags(loadBalancers.map((lb) => lb.LoadBalancerArn!))) .filter((tagDescription) => { - return ( - tagDescription.Tags?.length === this.filter.loadBalancerTags?.length && - tagDescription.Tags?.filter( - (tag) => - !this.filter.loadBalancerTags!.some((filter) => { - return filter.key === tag.Key && filter.value === tag.Value; - }), - ).length === 0 - ); + // For every tag in the filter, there is some tag in the LB that matches it. + // In other words, the set of tags in the filter is a subset of the set of tags in the LB. + return this.filter.loadBalancerTags!.every((filter) => { + return tagDescription.Tags?.some((tag) => + filter.key === tag.Key && filter.value === tag.Value); + }); }) .flatMap((tag) => loadBalancers.filter((loadBalancer) => tag.ResourceArn === loadBalancer.LoadBalancerArn)); } diff --git a/packages/aws-cdk/test/context-providers/load-balancers.test.ts b/packages/aws-cdk/test/context-providers/load-balancers.test.ts index 7ccb952a75ee1..c3ffa75e8d7a3 100644 --- a/packages/aws-cdk/test/context-providers/load-balancers.test.ts +++ b/packages/aws-cdk/test/context-providers/load-balancers.test.ts @@ -199,6 +199,52 @@ describe('load balancer context provider plugin', () => { }); }); + test('looks up by tags - query by subset', async () => { + // GIVEN + mockElasticLoadBalancingV2Client + .on(DescribeLoadBalancersCommand) + .resolves({ + LoadBalancers: [ + { + IpAddressType: 'ipv4', + LoadBalancerArn: 'arn:load-balancer2', + DNSName: 'dns2.example.com', + CanonicalHostedZoneId: 'Z1234', + SecurityGroups: ['sg-1234'], + VpcId: 'vpc-1234', + Type: 'application', + }, + ], + }) + .on(DescribeTagsCommand) + .resolves({ + TagDescriptions: [ + { + ResourceArn: 'arn:load-balancer2', + Tags: [ + // Load balancer has two tags... + { Key: 'some', Value: 'tag' }, + { Key: 'second', Value: 'tag2' }, + ], + }, + ], + }); + const provider = new LoadBalancerContextProviderPlugin(mockSDK); + + // WHEN + const result = await provider.getValue({ + account: '1234', + region: 'us-east-1', + loadBalancerType: LoadBalancerType.APPLICATION, + loadBalancerTags: [ + // ...but we are querying for only one of them + { key: 'second', value: 'tag2' }, + ], + }); + + expect(result.loadBalancerArn).toEqual('arn:load-balancer2'); + }); + test('filters by type', async () => { // GIVEN mockElasticLoadBalancingV2Client From 50d11a3c79fa69ca0fb1cf2e4f00509adef46011 Mon Sep 17 00:00:00 2001 From: Matsuda Date: Mon, 18 Nov 2024 07:46:31 +0900 Subject: [PATCH 3/5] chore(opensearch): support OpenSearch version 2.17 (#32121) ### Issue # (if applicable) N/A ### Reason for this change Support OpenSearch version 2.17. https://docs.aws.amazon.com/opensearch-service/latest/developerguide/release-notes.html ### Description of changes Add Enum. ### Description of how you validated changes Add unit tests and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../cdk-integ-opensearch-min.assets.json | 6 +-- .../cdk-integ-opensearch-min.template.json | 31 +++++++++++ .../integ.opensearch.min.js.snapshot/cdk.out | 2 +- .../integ.json | 2 +- ...efaultTestDeployAssert0EB58658.assets.json | 2 +- .../manifest.json | 12 ++++- .../tree.json | 51 ++++++++++++++++++- .../test/integ.opensearch.min.ts | 1 + .../aws-opensearchservice/lib/version.ts | 3 ++ .../aws-opensearchservice/test/domain.test.ts | 2 + 10 files changed, 102 insertions(+), 10 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch-min.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch-min.assets.json index 1cec4f1cb8e0b..1a46aff65cd8a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch-min.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch-min.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { - "1255c7b5b61b498b41414039e46e2ac24d67f3f62d55fc817ef805f24fb4cccd": { + "347efe751381e33cbd7eb536719de834e98b857f37d84f81a62011031d13966c": { "source": { "path": "cdk-integ-opensearch-min.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1255c7b5b61b498b41414039e46e2ac24d67f3f62d55fc817ef805f24fb4cccd.json", + "objectKey": "347efe751381e33cbd7eb536719de834e98b857f37d84f81a62011031d13966c.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch-min.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch-min.template.json index d432e084b1001..b250d80512a0e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch-min.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch-min.template.json @@ -61,6 +61,37 @@ }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" + }, + "OpenSearch2174B754FE5": { + "Type": "AWS::OpenSearchService::Domain", + "Properties": { + "ClusterConfig": { + "DedicatedMasterEnabled": false, + "InstanceCount": 1, + "InstanceType": "r5.large.search", + "MultiAZWithStandbyEnabled": false, + "ZoneAwarenessEnabled": false + }, + "DomainEndpointOptions": { + "EnforceHTTPS": false, + "TLSSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "EBSOptions": { + "EBSEnabled": true, + "VolumeSize": 10, + "VolumeType": "gp2" + }, + "EncryptionAtRestOptions": { + "Enabled": false + }, + "EngineVersion": "OpenSearch_2.17", + "LogPublishingOptions": {}, + "NodeToNodeEncryptionOptions": { + "Enabled": false + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk.out index bd5311dc372de..c6e612584e352 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.5"} \ No newline at end of file +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/integ.json index dd0a795a8eeac..f73c9099f27f9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "testCases": { "integ-openseach-min/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/integopenseachminDefaultTestDeployAssert0EB58658.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/integopenseachminDefaultTestDeployAssert0EB58658.assets.json index 400ae1dfbb9cc..06ec1d9e8848d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/integopenseachminDefaultTestDeployAssert0EB58658.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/integopenseachminDefaultTestDeployAssert0EB58658.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/manifest.json index afd7651b2df69..5296543aa28c7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.5", + "version": "38.0.1", "artifacts": { "cdk-integ-opensearch-min.assets": { "type": "cdk:asset-manifest", @@ -16,9 +16,10 @@ "templateFile": "cdk-integ-opensearch-min.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/1255c7b5b61b498b41414039e46e2ac24d67f3f62d55fc817ef805f24fb4cccd.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/347efe751381e33cbd7eb536719de834e98b857f37d84f81a62011031d13966c.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -46,6 +47,12 @@ "data": "OpenSearch21566632C3A" } ], + "/cdk-integ-opensearch-min/OpenSearch_2.17/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "OpenSearch2174B754FE5" + } + ], "/cdk-integ-opensearch-min/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -76,6 +83,7 @@ "templateFile": "integopenseachminDefaultTestDeployAssert0EB58658.template.json", "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/tree.json index 7e6411c8151b4..e1a8dac723875 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/tree.json @@ -102,6 +102,53 @@ "version": "0.0.0" } }, + "OpenSearch_2.17": { + "id": "OpenSearch_2.17", + "path": "cdk-integ-opensearch-min/OpenSearch_2.17", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-integ-opensearch-min/OpenSearch_2.17/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::OpenSearchService::Domain", + "aws:cdk:cloudformation:props": { + "clusterConfig": { + "dedicatedMasterEnabled": false, + "instanceCount": 1, + "instanceType": "r5.large.search", + "multiAzWithStandbyEnabled": false, + "zoneAwarenessEnabled": false + }, + "domainEndpointOptions": { + "enforceHttps": false, + "tlsSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "ebsOptions": { + "ebsEnabled": true, + "volumeSize": 10, + "volumeType": "gp2" + }, + "encryptionAtRestOptions": { + "enabled": false + }, + "engineVersion": "OpenSearch_2.17", + "logPublishingOptions": {}, + "nodeToNodeEncryptionOptions": { + "enabled": false + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_opensearchservice.CfnDomain", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_opensearchservice.Domain", + "version": "0.0.0" + } + }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "cdk-integ-opensearch-min/BootstrapVersion", @@ -137,7 +184,7 @@ "path": "integ-openseach-min/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "DeployAssert": { @@ -183,7 +230,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.ts index 79813d35d5d75..a59fbba674a60 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.ts @@ -10,6 +10,7 @@ class TestStack extends Stack { const versions = [ opensearch.EngineVersion.OPENSEARCH_2_13, opensearch.EngineVersion.OPENSEARCH_2_15, + opensearch.EngineVersion.OPENSEARCH_2_17, ]; // deploy opensearch domain with minimal configuration diff --git a/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts b/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts index 68b508559daa7..821d0b58cd791 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts @@ -105,6 +105,9 @@ export class EngineVersion { /** AWS OpenSearch 2.15 */ public static readonly OPENSEARCH_2_15 = EngineVersion.openSearch('2.15'); + /** AWS OpenSearch 2.17 */ + public static readonly OPENSEARCH_2_17 = EngineVersion.openSearch('2.17'); + /** * Custom ElasticSearch version * @param version custom version number diff --git a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts index f1eb4f1a12e41..2fffbebd72777 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts @@ -44,6 +44,7 @@ const testedOpenSearchVersions = [ EngineVersion.OPENSEARCH_2_11, EngineVersion.OPENSEARCH_2_13, EngineVersion.OPENSEARCH_2_15, + EngineVersion.OPENSEARCH_2_17, ]; each(testedOpenSearchVersions).test('connections throws if domain is not placed inside a vpc', (engineVersion) => { @@ -211,6 +212,7 @@ each([ [EngineVersion.OPENSEARCH_2_11, 'OpenSearch_2.11'], [EngineVersion.OPENSEARCH_2_13, 'OpenSearch_2.13'], [EngineVersion.OPENSEARCH_2_15, 'OpenSearch_2.15'], + [EngineVersion.OPENSEARCH_2_17, 'OpenSearch_2.17'], ]).test('minimal example renders correctly', (engineVersion, expectedCfVersion) => { new Domain(stack, 'Domain', { version: engineVersion }); From 11384f0718947aebe519e346ffe31429289a9a63 Mon Sep 17 00:00:00 2001 From: Grace Luo <54298030+gracelu0@users.noreply.github.com> Date: Sun, 17 Nov 2024 15:17:11 -0800 Subject: [PATCH 4/5] fix(scheduler-targets-alpha): kinesis data firehose target uses l1 instead of l2 (#32150) ### Issue # (if applicable) Tracking #31785 ### Reason for this change Since the Kinesis Data Firehose Alpha module is in developer preview and contains the L2 construct for a Firehose Delivery Stream, we should make this upgrade from L1 to L2 now while the module is experimental instead of in the future, where we would need to add a V2 for this target (like for event targets, see https://github.com/aws/aws-cdk/pull/30189) to avoid breaking customers. ### Description of changes Replace CfnDeliveryStream with IDeliveryStream. The L1 uses `S3DestinationConfiguration` property whereas the L2 uses `ExtendedS3DestinationConfiguration` property (includes additional fields on top of S3DestinationConfiguration fields). According to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesisfirehose-deliverystream.html, "If you change the delivery stream destination from an Amazon S3 destination to an Amazon ES destination, update requires [some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)." ### Description of how you validated changes - Updated unit tests and integration test - Deployed locally using CfnDeliveryStream then IDeliveryStream and verified the objects are written to the S3 bucket. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* BREAKING CHANGE: KinesisDataFirehosePutRecord scheduler target now accepts IDeliveryStream instead of CfnDeliveryStream. --- .../aws-scheduler-targets-alpha/README.md | 4 +- .../lib/kinesis-data-firehose-put-record.ts | 8 +- .../aws-scheduler-targets-alpha/package.json | 12 +- .../index.js | 25632 +++++++--------- ...er-targets-firehose-put-record.assets.json | 4 +- ...-targets-firehose-put-record.template.json | 168 +- ...efaultTestDeployAssert781A189E.assets.json | 10 +- ...aultTestDeployAssert781A189E.template.json | 8 +- .../manifest.json | 61 +- .../tree.json | 182 +- .../integ.kinesis-data-firehose-put-record.ts | 18 +- .../kinesis-data-firehose-put-record.test.ts | 105 +- 12 files changed, 10934 insertions(+), 15278 deletions(-) rename packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/{asset.d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.bundle => asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle}/index.js (87%) diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/README.md b/packages/@aws-cdk/aws-scheduler-targets-alpha/README.md index f6f28b8b7853b..43b0581471849 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/README.md +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/README.md @@ -257,8 +257,8 @@ The code snippet below creates an event rule with a delivery stream as a target called every hour by EventBridge Scheduler with a custom payload. ```ts -import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose'; -declare const deliveryStream: firehose.CfnDeliveryStream; +import * as firehose from '@aws-cdk/aws-kinesisfirehose-alpha'; +declare const deliveryStream: firehose.IDeliveryStream; const payload = { Data: "record", diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/lib/kinesis-data-firehose-put-record.ts b/packages/@aws-cdk/aws-scheduler-targets-alpha/lib/kinesis-data-firehose-put-record.ts index 83586c5e7126c..f4d48b4f9bcad 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/lib/kinesis-data-firehose-put-record.ts +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/lib/kinesis-data-firehose-put-record.ts @@ -1,6 +1,6 @@ +import { IDeliveryStream } from '@aws-cdk/aws-kinesisfirehose-alpha'; import { IScheduleTarget } from '@aws-cdk/aws-scheduler-alpha'; import { IRole, PolicyStatement } from 'aws-cdk-lib/aws-iam'; -import { CfnDeliveryStream } from 'aws-cdk-lib/aws-kinesisfirehose'; import { ScheduleTargetBase, ScheduleTargetBaseProps } from './target'; /** @@ -8,17 +8,17 @@ import { ScheduleTargetBase, ScheduleTargetBaseProps } from './target'; */ export class KinesisDataFirehosePutRecord extends ScheduleTargetBase implements IScheduleTarget { constructor( - private readonly deliveryStream: CfnDeliveryStream, + private readonly deliveryStream: IDeliveryStream, props: ScheduleTargetBaseProps = {}, ) { - super(props, deliveryStream.attrArn); + super(props, deliveryStream.deliveryStreamArn); } protected addTargetActionToRole(role: IRole): void { role.addToPrincipalPolicy(new PolicyStatement({ actions: ['firehose:PutRecord'], - resources: [this.deliveryStream.attrArn], + resources: [this.deliveryStream.deliveryStreamArn], })); } } diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/package.json b/packages/@aws-cdk/aws-scheduler-targets-alpha/package.json index 9a0f7dc965f60..c7842a6fa637b 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/package.json +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/package.json @@ -82,19 +82,23 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/aws-kinesisfirehose-destinations-alpha": "0.0.0", + "@aws-cdk/aws-kinesisfirehose-alpha": "0.0.0", + "@aws-cdk/aws-scheduler-alpha": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", + "@aws-cdk/integ-tests-alpha": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^29.5.14", "aws-cdk-lib": "0.0.0", - "@aws-cdk/aws-scheduler-alpha": "0.0.0", - "constructs": "^10.0.0", - "@aws-cdk/integ-tests-alpha": "0.0.0" + "constructs": "^10.0.0" }, "dependencies": {}, "peerDependencies": { - "aws-cdk-lib": "^0.0.0", + "@aws-cdk/aws-kinesisfirehose-destinations-alpha": "0.0.0", + "@aws-cdk/aws-kinesisfirehose-alpha": "0.0.0", "@aws-cdk/aws-scheduler-alpha": "0.0.0", + "aws-cdk-lib": "^0.0.0", "constructs": "^10.0.0" }, "engines": { diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/asset.d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.bundle/index.js b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js similarity index 87% rename from packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/asset.d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.bundle/index.js rename to packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js index bcc09cb30ad90..b585fd2bb4a19 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/asset.d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.bundle/index.js +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js @@ -786,7 +786,8 @@ var require_helpers_internal = __commonJS({ "../../aws-cdk-lib/assertions/lib/helpers-internal/index.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; + if (k2 === void 0) + k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { @@ -795,15 +796,23 @@ var require_helpers_internal = __commonJS({ } Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; + if (k2 === void 0) + k2 = k; o[k2] = m[k]; }); var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) + __createBinding2(exports3, m, p); }; Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar2((init_match(), __toCommonJS(match_exports)), exports2); - __exportStar2((init_matcher(), __toCommonJS(matcher_exports)), exports2); + var _noFold; + exports2.Match = void 0; + Object.defineProperty(exports2, _noFold = "Match", { enumerable: true, configurable: true, get: () => (init_match(), __toCommonJS(match_exports)).Match }); + exports2.Matcher = void 0; + Object.defineProperty(exports2, _noFold = "Matcher", { enumerable: true, configurable: true, get: () => (init_matcher(), __toCommonJS(matcher_exports)).Matcher }); + exports2.MatchResult = void 0; + Object.defineProperty(exports2, _noFold = "MatchResult", { enumerable: true, configurable: true, get: () => (init_matcher(), __toCommonJS(matcher_exports)).MatchResult }); } }); @@ -2598,41 +2607,12 @@ var require_dist_cjs11 = __commonJS({ } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/util-middleware/dist-cjs/index.js -var require_dist_cjs12 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - getSmithyContext: () => getSmithyContext4, - normalizeProvider: () => normalizeProvider2 - }); - module2.exports = __toCommonJS2(src_exports); - var import_types5 = require_dist_cjs(); - var getSmithyContext4 = /* @__PURE__ */ __name((context) => context[import_types5.SMITHY_CONTEXT_KEY] || (context[import_types5.SMITHY_CONTEXT_KEY] = {}), "getSmithyContext"); - var normalizeProvider2 = /* @__PURE__ */ __name((input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; - }, "normalizeProvider"); +// ../../../node_modules/@smithy/core/dist-es/getSmithyContext.js +var import_types, getSmithyContext; +var init_getSmithyContext = __esm({ + "../../../node_modules/@smithy/core/dist-es/getSmithyContext.js"() { + import_types = __toESM(require_dist_cjs()); + getSmithyContext = (context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {}); } }); @@ -2644,11 +2624,11 @@ function convertHttpAuthSchemesToMap(httpAuthSchemes) { } return map; } -var import_types, import_util_middleware, httpAuthSchemeMiddleware; +var import_types2, import_util_middleware, httpAuthSchemeMiddleware; var init_httpAuthSchemeMiddleware = __esm({ "../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() { - import_types = __toESM(require_dist_cjs()); - import_util_middleware = __toESM(require_dist_cjs12()); + import_types2 = __toESM(require_dist_cjs()); + import_util_middleware = __toESM(require_dist_cjs10()); httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => { const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input)); const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); @@ -2683,9 +2663,33 @@ var init_httpAuthSchemeMiddleware = __esm({ } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/property-provider/dist-cjs/index.js -var require_dist_cjs13 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/property-provider/dist-cjs/index.js"(exports2, module2) { +// ../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +var httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin; +var init_getHttpAuthSchemeEndpointRuleSetPlugin = __esm({ + "../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js"() { + init_httpAuthSchemeMiddleware(); + httpAuthSchemeEndpointRuleSetMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", + override: true, + relation: "before", + toMiddleware: "endpointV2Middleware" + }; + getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider + }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); + } + }); + } +}); + +// ../../../node_modules/@smithy/middleware-serde/dist-cjs/index.js +var require_dist_cjs12 = __commonJS({ + "../../../node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -2706,222 +2710,259 @@ var require_dist_cjs13 = __commonJS({ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - CredentialsProviderError: () => CredentialsProviderError, - ProviderError: () => ProviderError2, - TokenProviderError: () => TokenProviderError, - chain: () => chain, - fromStatic: () => fromStatic, - memoize: () => memoize + deserializerMiddleware: () => deserializerMiddleware, + deserializerMiddlewareOption: () => deserializerMiddlewareOption, + getSerdePlugin: () => getSerdePlugin, + serializerMiddleware: () => serializerMiddleware, + serializerMiddlewareOption: () => serializerMiddlewareOption2 }); module2.exports = __toCommonJS2(src_exports); - var _ProviderError = class _ProviderError2 extends Error { - constructor(message, options = true) { - var _a; - let logger; - let tryNextLink = true; - if (typeof options === "boolean") { - logger = void 0; - tryNextLink = options; - } else if (options != null && typeof options === "object") { - logger = options.logger; - tryNextLink = options.tryNextLink ?? true; + var deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (next) => async (args) => { + const { response } = await next(args); + try { + const parsed = await deserializer(response, options); + return { + response, + output: parsed + }; + } catch (error) { + Object.defineProperty(error, "$response", { + value: response + }); + if (!("$metadata" in error)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + error.message += "\n " + hint; + if (typeof error.$responseBodyText !== "undefined") { + if (error.$response) { + error.$response.body = error.$responseBodyText; + } + } } - super(message); - this.name = "ProviderError"; - this.tryNextLink = tryNextLink; - Object.setPrototypeOf(this, _ProviderError2.prototype); - (_a = logger == null ? void 0 : logger.debug) == null ? void 0 : _a.call(logger, `@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); - } - /** - * @deprecated use new operator. - */ - static from(error, options = true) { - return Object.assign(new this(error.message, options), error); + throw error; } - }; - __name(_ProviderError, "ProviderError"); - var ProviderError2 = _ProviderError; - var _CredentialsProviderError = class _CredentialsProviderError2 extends ProviderError2 { - /** - * @override - */ - constructor(message, options = true) { - super(message, options); - this.name = "CredentialsProviderError"; - Object.setPrototypeOf(this, _CredentialsProviderError2.prototype); + }, "deserializerMiddleware"); + var serializerMiddleware = /* @__PURE__ */ __name((options, serializer) => (next, context) => async (args) => { + var _a; + const endpoint = ((_a = context.endpointV2) == null ? void 0 : _a.url) && options.urlParser ? async () => options.urlParser(context.endpointV2.url) : options.endpoint; + if (!endpoint) { + throw new Error("No valid endpoint provider available."); } + const request2 = await serializer(args.input, { ...options, endpoint }); + return next({ + ...args, + request: request2 + }); + }, "serializerMiddleware"); + var deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true }; - __name(_CredentialsProviderError, "CredentialsProviderError"); - var CredentialsProviderError = _CredentialsProviderError; - var _TokenProviderError = class _TokenProviderError2 extends ProviderError2 { - /** - * @override - */ - constructor(message, options = true) { - super(message, options); - this.name = "TokenProviderError"; - Object.setPrototypeOf(this, _TokenProviderError2.prototype); - } + var serializerMiddlewareOption2 = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true }; - __name(_TokenProviderError, "TokenProviderError"); - var TokenProviderError = _TokenProviderError; - var chain = /* @__PURE__ */ __name((...providers) => async () => { - if (providers.length === 0) { - throw new ProviderError2("No providers in chain"); - } - let lastProviderError; - for (const provider of providers) { - try { - const credentials = await provider(); - return credentials; - } catch (err) { - lastProviderError = err; - if (err == null ? void 0 : err.tryNextLink) { - continue; - } - throw err; - } - } - throw lastProviderError; - }, "chain"); - var fromStatic = /* @__PURE__ */ __name((staticValue) => () => Promise.resolve(staticValue), "fromStatic"); - var memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = /* @__PURE__ */ __name(async () => { - if (!pending) { - pending = provider(); - } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } finally { - pending = void 0; - } - return resolved; - }, "coalesceProvider"); - if (isExpired === void 0) { - return async (options) => { - if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - return resolved; - }; - } - return async (options) => { - if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - if (isConstant) { - return resolved; - } - if (requiresRefresh && !requiresRefresh(resolved)) { - isConstant = true; - return resolved; - } - if (isExpired(resolved)) { - await coalesceProvider(); - return resolved; + function getSerdePlugin(config, serializer, deserializer) { + return { + applyToStack: (commandStack) => { + commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption); + commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption2); } - return resolved; }; - }, "memoize"); + } + __name(getSerdePlugin, "getSerdePlugin"); } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js -var require_getHomeDir = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getHomeDir = void 0; - var os_1 = require("os"); - var path_1 = require("path"); - var homeDirCache = {}; - var getHomeDirCacheKey = () => { - if (process && process.geteuid) { - return `${process.geteuid()}`; - } - return "DEFAULT"; - }; - var getHomeDir2 = () => { - const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; - if (HOME) - return HOME; - if (USERPROFILE) - return USERPROFILE; - if (HOMEPATH) - return `${HOMEDRIVE}${HOMEPATH}`; - const homeDirCacheKey = getHomeDirCacheKey(); - if (!homeDirCache[homeDirCacheKey]) - homeDirCache[homeDirCacheKey] = (0, os_1.homedir)(); - return homeDirCache[homeDirCacheKey]; +// ../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +var import_middleware_serde, httpAuthSchemeMiddlewareOptions, getHttpAuthSchemePlugin; +var init_getHttpAuthSchemePlugin = __esm({ + "../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() { + import_middleware_serde = __toESM(require_dist_cjs12()); + init_httpAuthSchemeMiddleware(); + httpAuthSchemeMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", + override: true, + relation: "before", + toMiddleware: import_middleware_serde.serializerMiddlewareOption.name }; - exports2.getHomeDir = getHomeDir2; + getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider + }), httpAuthSchemeMiddlewareOptions); + } + }); } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js -var require_getSSOTokenFilepath = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSSOTokenFilepath = void 0; - var crypto_1 = require("crypto"); - var path_1 = require("path"); - var getHomeDir_1 = require_getHomeDir(); - var getSSOTokenFilepath2 = (id) => { - const hasher = (0, crypto_1.createHash)("sha1"); - const cacheName = hasher.update(id).digest("hex"); - return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); +// ../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js +var init_middleware_http_auth_scheme = __esm({ + "../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js"() { + init_httpAuthSchemeMiddleware(); + init_getHttpAuthSchemeEndpointRuleSetPlugin(); + init_getHttpAuthSchemePlugin(); + } +}); + +// ../../../node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js +var import_protocol_http, import_types3, import_util_middleware2, defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware; +var init_httpSigningMiddleware = __esm({ + "../../../node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() { + import_protocol_http = __toESM(require_dist_cjs2()); + import_types3 = __toESM(require_dist_cjs()); + import_util_middleware2 = __toESM(require_dist_cjs10()); + defaultErrorHandler = (signingProperties) => (error) => { + throw error; + }; + defaultSuccessHandler = (httpResponse, signingProperties) => { + }; + httpSigningMiddleware = (config) => (next, context) => async (args) => { + if (!import_protocol_http.HttpRequest.isInstance(args.request)) { + return next(args); + } + const smithyContext = (0, import_util_middleware2.getSmithyContext)(context); + const scheme = smithyContext.selectedHttpAuthScheme; + if (!scheme) { + throw new Error(`No HttpAuthScheme was selected: unable to sign request`); + } + const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme; + const output = await next({ + ...args, + request: await signer.sign(args.request, identity, signingProperties) + }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); + (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); + return output; }; - exports2.getSSOTokenFilepath = getSSOTokenFilepath2; } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js -var require_getSSOTokenFromFile = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSSOTokenFromFile = void 0; - var fs_1 = require("fs"); - var getSSOTokenFilepath_1 = require_getSSOTokenFilepath(); - var { readFile } = fs_1.promises; - var getSSOTokenFromFile2 = async (id) => { - const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); - const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); +// ../../../node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js +var httpSigningMiddlewareOptions, getHttpSigningPlugin; +var init_getHttpSigningMiddleware = __esm({ + "../../../node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js"() { + init_httpSigningMiddleware(); + httpSigningMiddlewareOptions = { + step: "finalizeRequest", + tags: ["HTTP_SIGNING"], + name: "httpSigningMiddleware", + aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], + override: true, + relation: "after", + toMiddleware: "retryMiddleware" }; - exports2.getSSOTokenFromFile = getSSOTokenFromFile2; + getHttpSigningPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions); + } + }); } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js -var require_slurpFile = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.slurpFile = void 0; - var fs_1 = require("fs"); - var { readFile } = fs_1.promises; - var filePromisesHash = {}; - var slurpFile = (path, options) => { - if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) { - filePromisesHash[path] = readFile(path, "utf8"); +// ../../../node_modules/@smithy/core/dist-es/middleware-http-signing/index.js +var init_middleware_http_signing = __esm({ + "../../../node_modules/@smithy/core/dist-es/middleware-http-signing/index.js"() { + init_httpSigningMiddleware(); + init_getHttpSigningMiddleware(); + } +}); + +// ../../../node_modules/@smithy/core/dist-es/normalizeProvider.js +var normalizeProvider; +var init_normalizeProvider = __esm({ + "../../../node_modules/@smithy/core/dist-es/normalizeProvider.js"() { + normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; + }; + } +}); + +// ../../../node_modules/@smithy/core/dist-es/pagination/createPaginator.js +function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { + return async function* paginateOperation(config, input, ...additionalArguments) { + let token = config.startingToken || void 0; + let hasNext = true; + let page; + while (hasNext) { + input[inputTokenName] = token; + if (pageSizeTokenName) { + input[pageSizeTokenName] = input[pageSizeTokenName] ?? config.pageSize; } - return filePromisesHash[path]; + if (config.client instanceof ClientCtor) { + page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments); + } else { + throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); + } + yield page; + const prevToken = token; + token = get(page, outputTokenName); + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return void 0; + }; +} +var makePagedClientRequest, get; +var init_createPaginator = __esm({ + "../../../node_modules/@smithy/core/dist-es/pagination/createPaginator.js"() { + makePagedClientRequest = async (CommandCtor, client, input, ...args) => { + return await client.send(new CommandCtor(input), ...args); }; - exports2.slurpFile = slurpFile; + get = (fromObject, path) => { + let cursor = fromObject; + const pathComponents = path.split("."); + for (const step of pathComponents) { + if (!cursor || typeof cursor !== "object") { + return void 0; + } + cursor = cursor[step]; + } + return cursor; + }; + } +}); + +// ../../../node_modules/@smithy/is-array-buffer/dist-cjs/index.js +var require_dist_cjs13 = __commonJS({ + "../../../node_modules/@smithy/is-array-buffer/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + isArrayBuffer: () => isArrayBuffer + }); + module2.exports = __toCommonJS2(src_exports); + var isArrayBuffer = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer"); } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +// ../../../node_modules/@smithy/util-buffer-from/dist-cjs/index.js var require_dist_cjs14 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js"(exports2, module2) { + "../../../node_modules/@smithy/util-buffer-from/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -2939,154 +2980,55 @@ var require_dist_cjs14 = __commonJS({ } return to; }; - var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR, - DEFAULT_PROFILE: () => DEFAULT_PROFILE, - ENV_PROFILE: () => ENV_PROFILE, - getProfileName: () => getProfileName, - loadSharedConfigFiles: () => loadSharedConfigFiles, - loadSsoSessionData: () => loadSsoSessionData, - parseKnownFiles: () => parseKnownFiles + fromArrayBuffer: () => fromArrayBuffer, + fromString: () => fromString }); module2.exports = __toCommonJS2(src_exports); - __reExport(src_exports, require_getHomeDir(), module2.exports); - var ENV_PROFILE = "AWS_PROFILE"; - var DEFAULT_PROFILE = "default"; - var getProfileName = /* @__PURE__ */ __name((init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE, "getProfileName"); - __reExport(src_exports, require_getSSOTokenFilepath(), module2.exports); - __reExport(src_exports, require_getSSOTokenFromFile(), module2.exports); - var import_types5 = require_dist_cjs(); - var getConfigData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - if (indexOfSeparator === -1) { - return false; + var import_is_array_buffer = require_dist_cjs13(); + var import_buffer = require("buffer"); + var fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => { + if (!(0, import_is_array_buffer.isArrayBuffer)(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); } - return Object.values(import_types5.IniSectionType).includes(key.substring(0, indexOfSeparator)); - }).reduce( - (acc, [key, value]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - const updatedKey = key.substring(0, indexOfSeparator) === import_types5.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; - acc[updatedKey] = value; - return acc; - }, - { - // Populate default profile, if present. - ...data.default && { default: data.default } + return import_buffer.Buffer.from(input, offset, length); + }, "fromArrayBuffer"); + var fromString = /* @__PURE__ */ __name((input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); } - ), "getConfigData"); - var import_path = require("path"); - var import_getHomeDir = require_getHomeDir(); - var ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; - var getConfigFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CONFIG_PATH] || (0, import_path.join)((0, import_getHomeDir.getHomeDir)(), ".aws", "config"), "getConfigFilepath"); - var import_getHomeDir2 = require_getHomeDir(); - var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; - var getCredentialsFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CREDENTIALS_PATH] || (0, import_path.join)((0, import_getHomeDir2.getHomeDir)(), ".aws", "credentials"), "getCredentialsFilepath"); - var import_getHomeDir3 = require_getHomeDir(); - var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; - var profileNameBlockList = ["__proto__", "profile __proto__"]; - var parseIni = /* @__PURE__ */ __name((iniData) => { - const map = {}; - let currentSection; - let currentSubSection; - for (const iniLine of iniData.split(/\r?\n/)) { - const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); - const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; - if (isSection) { - currentSection = void 0; - currentSubSection = void 0; - const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); - const matches = prefixKeyRegex.exec(sectionName); - if (matches) { - const [, prefix, , name] = matches; - if (Object.values(import_types5.IniSectionType).includes(prefix)) { - currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR); - } - } else { - currentSection = sectionName; - } - if (profileNameBlockList.includes(sectionName)) { - throw new Error(`Found invalid profile name "${sectionName}"`); - } - } else if (currentSection) { - const indexOfEqualsSign = trimmedLine.indexOf("="); - if (![0, -1].includes(indexOfEqualsSign)) { - const [name, value] = [ - trimmedLine.substring(0, indexOfEqualsSign).trim(), - trimmedLine.substring(indexOfEqualsSign + 1).trim() - ]; - if (value === "") { - currentSubSection = name; - } else { - if (currentSubSection && iniLine.trimStart() === iniLine) { - currentSubSection = void 0; - } - map[currentSection] = map[currentSection] || {}; - const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; - map[currentSection][key] = value; - } - } - } - } - return map; - }, "parseIni"); - var import_slurpFile = require_slurpFile(); - var swallowError = /* @__PURE__ */ __name(() => ({}), "swallowError"); - var CONFIG_PREFIX_SEPARATOR = "."; - var loadSharedConfigFiles = /* @__PURE__ */ __name(async (init = {}) => { - const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; - const homeDir = (0, import_getHomeDir3.getHomeDir)(); - const relativeHomeDirPrefix = "~/"; - let resolvedFilepath = filepath; - if (filepath.startsWith(relativeHomeDirPrefix)) { - resolvedFilepath = (0, import_path.join)(homeDir, filepath.slice(2)); - } - let resolvedConfigFilepath = configFilepath; - if (configFilepath.startsWith(relativeHomeDirPrefix)) { - resolvedConfigFilepath = (0, import_path.join)(homeDir, configFilepath.slice(2)); + return encoding ? import_buffer.Buffer.from(input, encoding) : import_buffer.Buffer.from(input); + }, "fromString"); + } +}); + +// ../../../node_modules/@smithy/util-base64/dist-cjs/fromBase64.js +var require_fromBase64 = __commonJS({ + "../../../node_modules/@smithy/util-base64/dist-cjs/fromBase64.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fromBase64 = void 0; + var util_buffer_from_1 = require_dist_cjs14(); + var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; + var fromBase642 = (input) => { + if (input.length * 3 % 4 !== 0) { + throw new TypeError(`Incorrect padding on base64 string.`); } - const parsedFiles = await Promise.all([ - (0, import_slurpFile.slurpFile)(resolvedConfigFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).then(getConfigData).catch(swallowError), - (0, import_slurpFile.slurpFile)(resolvedFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).catch(swallowError) - ]); - return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1] - }; - }, "loadSharedConfigFiles"); - var getSsoSessionData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => key.startsWith(import_types5.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}), "getSsoSessionData"); - var import_slurpFile2 = require_slurpFile(); - var swallowError2 = /* @__PURE__ */ __name(() => ({}), "swallowError"); - var loadSsoSessionData = /* @__PURE__ */ __name(async (init = {}) => (0, import_slurpFile2.slurpFile)(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2), "loadSsoSessionData"); - var mergeConfigFiles = /* @__PURE__ */ __name((...files) => { - const merged = {}; - for (const file of files) { - for (const [key, values] of Object.entries(file)) { - if (merged[key] !== void 0) { - Object.assign(merged[key], values); - } else { - merged[key] = values; - } - } + if (!BASE64_REGEX.exec(input)) { + throw new TypeError(`Invalid base64 string.`); } - return merged; - }, "mergeConfigFiles"); - var parseKnownFiles = /* @__PURE__ */ __name(async (init) => { - const parsedFiles = await loadSharedConfigFiles(init); - return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); - }, "parseKnownFiles"); + const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); + }; + exports2.fromBase64 = fromBase642; } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/node-config-provider/dist-cjs/index.js +// ../../../node_modules/@smithy/util-utf8/dist-cjs/index.js var require_dist_cjs15 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/node-config-provider/dist-cjs/index.js"(exports2, module2) { + "../../../node_modules/@smithy/util-utf8/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -3107,135 +3049,68 @@ var require_dist_cjs15 = __commonJS({ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - loadConfig: () => loadConfig + fromUtf8: () => fromUtf8, + toUint8Array: () => toUint8Array, + toUtf8: () => toUtf8 }); module2.exports = __toCommonJS2(src_exports); - var import_property_provider2 = require_dist_cjs13(); - function getSelectorName(functionString) { - try { - const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); - constants.delete("CONFIG"); - constants.delete("CONFIG_PREFIX_SEPARATOR"); - constants.delete("ENV"); - return [...constants].join(", "); - } catch (e) { - return functionString; + var import_util_buffer_from = require_dist_cjs14(); + var fromUtf8 = /* @__PURE__ */ __name((input) => { + const buf = (0, import_util_buffer_from.fromString)(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); + }, "fromUtf8"); + var toUint8Array = /* @__PURE__ */ __name((data) => { + if (typeof data === "string") { + return fromUtf8(data); } - } - __name(getSelectorName, "getSelectorName"); - var fromEnv = /* @__PURE__ */ __name((envVarSelector, logger) => async () => { - try { - const config = envVarSelector(process.env); - if (config === void 0) { - throw new Error(); - } - return config; - } catch (e) { - throw new import_property_provider2.CredentialsProviderError( - e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, - { logger } - ); + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); } - }, "fromEnv"); - var import_shared_ini_file_loader = require_dist_cjs14(); - var fromSharedConfigFiles = /* @__PURE__ */ __name((configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = (0, import_shared_ini_file_loader.getProfileName)(init); - const { configFile, credentialsFile } = await (0, import_shared_ini_file_loader.loadSharedConfigFiles)(init); - const profileFromCredentials = credentialsFile[profile] || {}; - const profileFromConfig = configFile[profile] || {}; - const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials }; - try { - const cfgFile = preferredFile === "config" ? configFile : credentialsFile; - const configValue = configSelector(mergedProfile, cfgFile); - if (configValue === void 0) { - throw new Error(); - } - return configValue; - } catch (e) { - throw new import_property_provider2.CredentialsProviderError( - e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, - { logger: init.logger } - ); + return new Uint8Array(data); + }, "toUint8Array"); + var toUtf8 = /* @__PURE__ */ __name((input) => { + if (typeof input === "string") { + return input; } - }, "fromSharedConfigFiles"); - var isFunction = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction"); - var fromStatic = /* @__PURE__ */ __name((defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, import_property_provider2.fromStatic)(defaultValue), "fromStatic"); - var loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, import_property_provider2.memoize)( - (0, import_property_provider2.chain)( - fromEnv(environmentVariableSelector), - fromSharedConfigFiles(configFileSelector, configuration), - fromStatic(defaultValue) - ) - ), "loadConfig"); - } -}); - -// ../../../node_modules/@smithy/core/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js -var require_getEndpointUrlConfig = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getEndpointUrlConfig = void 0; - var shared_ini_file_loader_1 = require_dist_cjs14(); - var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; - var CONFIG_ENDPOINT_URL = "endpoint_url"; - var getEndpointUrlConfig = (serviceId) => ({ - environmentVariableSelector: (env) => { - const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); - const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; - if (serviceEndpointUrl) - return serviceEndpointUrl; - const endpointUrl = env[ENV_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return void 0; - }, - configFileSelector: (profile, config) => { - if (config && profile.services) { - const servicesSection = config[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (servicesSection) { - const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); - const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (endpointUrl2) - return endpointUrl2; - } - } - const endpointUrl = profile[CONFIG_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return void 0; - }, - default: void 0 - }); - exports2.getEndpointUrlConfig = getEndpointUrlConfig; + if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { + throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array."); + } + return (0, import_util_buffer_from.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); + }, "toUtf8"); } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js -var require_getEndpointFromConfig = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js"(exports2) { +// ../../../node_modules/@smithy/util-base64/dist-cjs/toBase64.js +var require_toBase64 = __commonJS({ + "../../../node_modules/@smithy/util-base64/dist-cjs/toBase64.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getEndpointFromConfig = void 0; - var node_config_provider_1 = require_dist_cjs15(); - var getEndpointUrlConfig_1 = require_getEndpointUrlConfig(); - var getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId !== null && serviceId !== void 0 ? serviceId : ""))(); - exports2.getEndpointFromConfig = getEndpointFromConfig; + exports2.toBase64 = void 0; + var util_buffer_from_1 = require_dist_cjs14(); + var util_utf8_1 = require_dist_cjs15(); + var toBase642 = (_input) => { + let input; + if (typeof _input === "string") { + input = (0, util_utf8_1.fromUtf8)(_input); + } else { + input = _input; + } + if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { + throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); + } + return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); + }; + exports2.toBase64 = toBase642; } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/querystring-parser/dist-cjs/index.js +// ../../../node_modules/@smithy/util-base64/dist-cjs/index.js var require_dist_cjs16 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports2, module2) { + "../../../node_modules/@smithy/util-base64/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; var __copyProps2 = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames2(from)) @@ -3244,40 +3119,56 @@ var require_dist_cjs16 = __commonJS({ } return to; }; + var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; - __export2(src_exports, { - parseQueryString: () => parseQueryString - }); module2.exports = __toCommonJS2(src_exports); - function parseQueryString(querystring) { - const query = {}; - querystring = querystring.replace(/^\?/, ""); - if (querystring) { - for (const pair of querystring.split("&")) { - let [key, value = null] = pair.split("="); - key = decodeURIComponent(key); - if (value) { - value = decodeURIComponent(value); - } - if (!(key in query)) { - query[key] = value; - } else if (Array.isArray(query[key])) { - query[key].push(value); - } else { - query[key] = [query[key], value]; - } + __reExport(src_exports, require_fromBase64(), module2.exports); + __reExport(src_exports, require_toBase64(), module2.exports); + } +}); + +// ../../../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js +var require_getAwsChunkedEncodingStream = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getAwsChunkedEncodingStream = void 0; + var stream_1 = require("stream"); + var getAwsChunkedEncodingStream2 = (readableStream, options) => { + const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; + const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; + const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0; + const awsChunkedEncodingStream = new stream_1.Readable({ read: () => { + } }); + readableStream.on("data", (data) => { + const length = bodyLengthChecker(data) || 0; + awsChunkedEncodingStream.push(`${length.toString(16)}\r +`); + awsChunkedEncodingStream.push(data); + awsChunkedEncodingStream.push("\r\n"); + }); + readableStream.on("end", async () => { + awsChunkedEncodingStream.push(`0\r +`); + if (checksumRequired) { + const checksum = base64Encoder(await digest); + awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r +`); + awsChunkedEncodingStream.push(`\r +`); } - } - return query; - } - __name(parseQueryString, "parseQueryString"); + awsChunkedEncodingStream.push(null); + }); + return awsChunkedEncodingStream; + }; + exports2.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream2; } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/url-parser/dist-cjs/index.js +// ../../../node_modules/@smithy/util-uri-escape/dist-cjs/index.js var require_dist_cjs17 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/url-parser/dist-cjs/index.js"(exports2, module2) { + "../../../node_modules/@smithy/util-uri-escape/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -3298,33 +3189,22 @@ var require_dist_cjs17 = __commonJS({ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - parseUrl: () => parseUrl + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath }); module2.exports = __toCommonJS2(src_exports); - var import_querystring_parser = require_dist_cjs16(); - var parseUrl = /* @__PURE__ */ __name((url2) => { - if (typeof url2 === "string") { - return parseUrl(new URL(url2)); - } - const { hostname, pathname, port, protocol, search } = url2; - let query; - if (search) { - query = (0, import_querystring_parser.parseQueryString)(search); - } - return { - hostname, - port: port ? parseInt(port) : void 0, - protocol, - path: pathname, - query - }; - }, "parseUrl"); + var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) + ), "escapeUri"); + var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); + var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/middleware-serde/dist-cjs/index.js +// ../../../node_modules/@smithy/querystring-builder/dist-cjs/index.js var require_dist_cjs18 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports2, module2) { + "../../../node_modules/@smithy/querystring-builder/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -3345,79 +3225,41 @@ var require_dist_cjs18 = __commonJS({ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - deserializerMiddleware: () => deserializerMiddleware, - deserializerMiddlewareOption: () => deserializerMiddlewareOption, - getSerdePlugin: () => getSerdePlugin, - serializerMiddleware: () => serializerMiddleware, - serializerMiddlewareOption: () => serializerMiddlewareOption2 + buildQueryString: () => buildQueryString }); module2.exports = __toCommonJS2(src_exports); - var deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (next) => async (args) => { - const { response } = await next(args); - try { - const parsed = await deserializer(response, options); - return { - response, - output: parsed - }; - } catch (error) { - Object.defineProperty(error, "$response", { - value: response - }); - if (!("$metadata" in error)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - error.message += "\n " + hint; - if (typeof error.$responseBodyText !== "undefined") { - if (error.$response) { - error.$response.body = error.$responseBodyText; - } + var import_util_uri_escape = require_dist_cjs17(); + function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, import_util_uri_escape.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; } + parts.push(qsEntry); } - throw error; } - }, "deserializerMiddleware"); - var serializerMiddleware = /* @__PURE__ */ __name((options, serializer) => (next, context) => async (args) => { - var _a; - const endpoint = ((_a = context.endpointV2) == null ? void 0 : _a.url) && options.urlParser ? async () => options.urlParser(context.endpointV2.url) : options.endpoint; - if (!endpoint) { - throw new Error("No valid endpoint provider available."); - } - const request2 = await serializer(args.input, { ...options, endpoint }); - return next({ - ...args, - request: request2 - }); - }, "serializerMiddleware"); - var deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true - }; - var serializerMiddlewareOption2 = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true - }; - function getSerdePlugin(config, serializer, deserializer) { - return { - applyToStack: (commandStack) => { - commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption); - commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption2); - } - }; + return parts.join("&"); } - __name(getSerdePlugin, "getSerdePlugin"); + __name(buildQueryString, "buildQueryString"); } }); -// ../../../node_modules/@smithy/core/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +// ../../../node_modules/@smithy/node-http-handler/dist-cjs/index.js var require_dist_cjs19 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js"(exports2, module2) { + "../../../node_modules/@smithy/node-http-handler/dist-cjs/index.js"(exports2, module2) { + var __create2 = Object.create; var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __getProtoOf2 = Object.getPrototypeOf; var __hasOwnProp2 = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); var __export2 = (target, all) => { @@ -3432,5854 +3274,955 @@ var require_dist_cjs19 = __commonJS({ } return to; }; + var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, + mod + )); var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - endpointMiddleware: () => endpointMiddleware, - endpointMiddlewareOptions: () => endpointMiddlewareOptions2, - getEndpointFromInstructions: () => getEndpointFromInstructions, - getEndpointPlugin: () => getEndpointPlugin, - resolveEndpointConfig: () => resolveEndpointConfig, - resolveParams: () => resolveParams, - toEndpointV1: () => toEndpointV1 + DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, + NodeHttp2Handler: () => NodeHttp2Handler, + NodeHttpHandler: () => NodeHttpHandler, + streamCollector: () => streamCollector }); module2.exports = __toCommonJS2(src_exports); - var resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => { - const bucket = (endpointParams == null ? void 0 : endpointParams.Bucket) || ""; - if (typeof endpointParams.Bucket === "string") { - endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); + var import_protocol_http8 = require_dist_cjs2(); + var import_querystring_builder = require_dist_cjs18(); + var import_http2 = require("http"); + var import_https = require("https"); + var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; } - if (isArnBucketName(bucket)) { - if (endpointParams.ForcePathStyle === true) { - throw new Error("Path-style addressing cannot be used with ARN buckets"); + return transformedHeaders; + }, "getTransformedHeaders"); + var DEFER_EVENT_LISTENER_TIME = 1e3; + var setConnectionTimeout = /* @__PURE__ */ __name((request2, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return -1; + } + const registerTimeout = /* @__PURE__ */ __name((offset) => { + const timeoutId = setTimeout(() => { + request2.destroy(); + reject( + Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError" + }) + ); + }, timeoutInMs - offset); + const doWithSocket = /* @__PURE__ */ __name((socket) => { + if (socket == null ? void 0 : socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } else { + clearTimeout(timeoutId); + } + }, "doWithSocket"); + if (request2.socket) { + doWithSocket(request2.socket); + } else { + request2.on("socket", doWithSocket); } - } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) { - endpointParams.ForcePathStyle = true; + }, "registerTimeout"); + if (timeoutInMs < 2e3) { + registerTimeout(0); + return 0; } - if (endpointParams.DisableMultiRegionAccessPoints) { - endpointParams.disableMultiRegionAccessPoints = true; - endpointParams.DisableMRAP = true; + return setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); + }, "setConnectionTimeout"); + var DEFER_EVENT_LISTENER_TIME2 = 3e3; + var setSocketKeepAlive = /* @__PURE__ */ __name((request2, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => { + if (keepAlive !== true) { + return -1; } - return endpointParams; - }, "resolveParamsForS3"); - var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; - var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; - var DOTS_PATTERN = /\.\./; - var isDnsCompatibleBucketName = /* @__PURE__ */ __name((bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName), "isDnsCompatibleBucketName"); - var isArnBucketName = /* @__PURE__ */ __name((bucketName) => { - const [arn, partition, service, , , bucket] = bucketName.split(":"); - const isArn = arn === "arn" && bucketName.split(":").length >= 6; - const isValidArn = Boolean(isArn && partition && service && bucket); - if (isArn && !isValidArn) { - throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); - } - return isValidArn; - }, "isArnBucketName"); - var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config) => { - const configProvider = /* @__PURE__ */ __name(async () => { - const configValue = config[configKey] ?? config[canonicalEndpointParamKey]; - if (typeof configValue === "function") { - return configValue(); + const registerListener = /* @__PURE__ */ __name(() => { + if (request2.socket) { + request2.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + } else { + request2.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); } - return configValue; - }, "configProvider"); - if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { - return async () => { - const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; - const configValue = (credentials == null ? void 0 : credentials.credentialScope) ?? (credentials == null ? void 0 : credentials.CredentialScope); - return configValue; - }; + }, "registerListener"); + if (deferTimeMs === 0) { + registerListener(); + return 0; } - if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { - return async () => { - const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; - const configValue = (credentials == null ? void 0 : credentials.accountId) ?? (credentials == null ? void 0 : credentials.AccountId); - return configValue; - }; + return setTimeout(registerListener, deferTimeMs); + }, "setSocketKeepAlive"); + var DEFER_EVENT_LISTENER_TIME3 = 3e3; + var setSocketTimeout = /* @__PURE__ */ __name((request2, reject, timeoutInMs = 0) => { + const registerTimeout = /* @__PURE__ */ __name((offset) => { + request2.setTimeout(timeoutInMs - offset, () => { + request2.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); + }, "registerTimeout"); + if (0 < timeoutInMs && timeoutInMs < 6e3) { + registerTimeout(0); + return 0; } - if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { - return async () => { - const endpoint = await configProvider(); - if (endpoint && typeof endpoint === "object") { - if ("url" in endpoint) { - return endpoint.url.href; - } - if ("hostname" in endpoint) { - const { protocol, hostname, port, path } = endpoint; - return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; - } - } - return endpoint; - }; + return setTimeout( + registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), + DEFER_EVENT_LISTENER_TIME3 + ); + }, "setSocketTimeout"); + var import_stream = require("stream"); + var MIN_WAIT_TIME = 1e3; + async function writeRequestBody(httpRequest, request2, maxContinueTimeoutMs = MIN_WAIT_TIME) { + const headers = request2.headers ?? {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }) + ]); } - return configProvider; - }, "createConfigValueProvider"); - var import_getEndpointFromConfig = require_getEndpointFromConfig(); - var import_url_parser = require_dist_cjs17(); - var toEndpointV1 = /* @__PURE__ */ __name((endpoint) => { - if (typeof endpoint === "object") { - if ("url" in endpoint) { - return (0, import_url_parser.parseUrl)(endpoint.url); - } - return endpoint; + if (!hasError) { + writeBody(httpRequest, request2.body); } - return (0, import_url_parser.parseUrl)(endpoint); - }, "toEndpointV1"); - var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context) => { - if (!clientConfig.endpoint) { - let endpointFromConfig; - if (clientConfig.serviceConfiguredEndpoint) { - endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); - } else { - endpointFromConfig = await (0, import_getEndpointFromConfig.getEndpointFromConfig)(clientConfig.serviceId); + } + __name(writeRequestBody, "writeRequestBody"); + function writeBody(httpRequest, body) { + if (body instanceof import_stream.Readable) { + body.pipe(httpRequest); + return; + } + if (body) { + if (Buffer.isBuffer(body) || typeof body === "string") { + httpRequest.end(body); + return; } - if (endpointFromConfig) { - clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); + const uint8 = body; + if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { + httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); + return; } + httpRequest.end(Buffer.from(body)); + return; } - const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); - if (typeof clientConfig.endpointProvider !== "function") { - throw new Error("config.endpointProvider is not set."); + httpRequest.end(); + } + __name(writeBody, "writeBody"); + var DEFAULT_REQUEST_TIMEOUT = 0; + var _NodeHttpHandler = class _NodeHttpHandler2 { + constructor(options) { + this.socketWarningTimestamp = 0; + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); } - const endpoint = clientConfig.endpointProvider(endpointParams, context); - return endpoint; - }, "getEndpointFromInstructions"); - var resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => { - var _a; - const endpointParams = {}; - const instructions = ((_a = instructionsSupplier == null ? void 0 : instructionsSupplier.getEndpointParameterInstructions) == null ? void 0 : _a.call(instructionsSupplier)) || {}; - for (const [name, instruction] of Object.entries(instructions)) { - switch (instruction.type) { - case "staticContextParams": - endpointParams[name] = instruction.value; - break; - case "contextParams": - endpointParams[name] = commandInput[instruction.name]; - break; - case "clientContextParams": - case "builtInParams": - endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)(); - break; - default: - throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; } + return new _NodeHttpHandler2(instanceOrOptions); } - if (Object.keys(instructions).length === 0) { - Object.assign(endpointParams, clientConfig); - } - if (String(clientConfig.serviceId).toLowerCase() === "s3") { - await resolveParamsForS3(endpointParams); - } - return endpointParams; - }, "resolveParams"); - var import_util_middleware3 = require_dist_cjs12(); - var endpointMiddleware = /* @__PURE__ */ __name(({ - config, - instructions - }) => { - return (next, context) => async (args) => { + /** + * @internal + * + * @param agent - http(s) agent in use by the NodeHttpHandler instance. + * @param socketWarningTimestamp - last socket usage check timestamp. + * @param logger - channel for the warning. + * @returns timestamp of last emitted warning. + */ + static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { var _a, _b, _c; - const endpoint = await getEndpointFromInstructions( - args.input, - { - getEndpointParameterInstructions() { - return instructions; - } - }, - { ...config }, - context - ); - context.endpointV2 = endpoint; - context.authSchemes = (_a = endpoint.properties) == null ? void 0 : _a.authSchemes; - const authScheme = (_b = context.authSchemes) == null ? void 0 : _b[0]; - if (authScheme) { - context["signing_region"] = authScheme.signingRegion; - context["signing_service"] = authScheme.signingName; - const smithyContext = (0, import_util_middleware3.getSmithyContext)(context); - const httpAuthOption = (_c = smithyContext == null ? void 0 : smithyContext.selectedHttpAuthScheme) == null ? void 0 : _c.httpAuthOption; - if (httpAuthOption) { - httpAuthOption.signingProperties = Object.assign( - httpAuthOption.signingProperties || {}, - { - signing_region: authScheme.signingRegion, - signingRegion: authScheme.signingRegion, - signing_service: authScheme.signingName, - signingName: authScheme.signingName, - signingRegionSet: authScheme.signingRegionSet - }, - authScheme.properties - ); - } + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; } - return next({ - ...args - }); - }; - }, "endpointMiddleware"); - var import_middleware_serde2 = require_dist_cjs18(); - var endpointMiddlewareOptions2 = { - step: "serialize", - tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], - name: "endpointV2Middleware", - override: true, - relation: "before", - toMiddleware: import_middleware_serde2.serializerMiddlewareOption.name - }; - var getEndpointPlugin = /* @__PURE__ */ __name((config, instructions) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo( - endpointMiddleware({ - config, - instructions - }), - endpointMiddlewareOptions2 - ); - } - }), "getEndpointPlugin"); - var import_getEndpointFromConfig2 = require_getEndpointFromConfig(); - var resolveEndpointConfig = /* @__PURE__ */ __name((input) => { - const tls = input.tls ?? true; - const { endpoint } = input; - const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await (0, import_util_middleware3.normalizeProvider)(endpoint)()) : void 0; - const isCustomEndpoint = !!endpoint; - const resolvedConfig = { - ...input, - endpoint: customEndpointProvider, - tls, - isCustomEndpoint, - useDualstackEndpoint: (0, import_util_middleware3.normalizeProvider)(input.useDualstackEndpoint ?? false), - useFipsEndpoint: (0, import_util_middleware3.normalizeProvider)(input.useFipsEndpoint ?? false) - }; - let configuredEndpointPromise = void 0; - resolvedConfig.serviceConfiguredEndpoint = async () => { - if (input.serviceId && !configuredEndpointPromise) { - configuredEndpointPromise = (0, import_getEndpointFromConfig2.getEndpointFromConfig)(input.serviceId); - } - return configuredEndpointPromise; - }; - return resolvedConfig; - }, "resolveEndpointConfig"); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js -var import_middleware_endpoint, httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin; -var init_getHttpAuthSchemeEndpointRuleSetPlugin = __esm({ - "../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js"() { - import_middleware_endpoint = __toESM(require_dist_cjs19()); - init_httpAuthSchemeMiddleware(); - httpAuthSchemeEndpointRuleSetMiddlewareOptions = { - step: "serialize", - tags: ["HTTP_AUTH_SCHEME"], - name: "httpAuthSchemeMiddleware", - override: true, - relation: "before", - toMiddleware: import_middleware_endpoint.endpointMiddlewareOptions.name - }; - getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { - httpAuthSchemeParametersProvider, - identityProviderConfigProvider - }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); - } - }); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js -var import_middleware_serde, httpAuthSchemeMiddlewareOptions, getHttpAuthSchemePlugin; -var init_getHttpAuthSchemePlugin = __esm({ - "../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() { - import_middleware_serde = __toESM(require_dist_cjs18()); - init_httpAuthSchemeMiddleware(); - httpAuthSchemeMiddlewareOptions = { - step: "serialize", - tags: ["HTTP_AUTH_SCHEME"], - name: "httpAuthSchemeMiddleware", - override: true, - relation: "before", - toMiddleware: import_middleware_serde.serializerMiddlewareOption.name - }; - getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { - httpAuthSchemeParametersProvider, - identityProviderConfigProvider - }), httpAuthSchemeMiddlewareOptions); - } - }); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js -var init_middleware_http_auth_scheme = __esm({ - "../../../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js"() { - init_httpAuthSchemeMiddleware(); - init_getHttpAuthSchemeEndpointRuleSetPlugin(); - init_getHttpAuthSchemePlugin(); - } -}); - -// ../../../node_modules/@smithy/core/node_modules/@smithy/protocol-http/dist-cjs/index.js -var require_dist_cjs20 = __commonJS({ - "../../../node_modules/@smithy/core/node_modules/@smithy/protocol-http/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - Field: () => Field, - Fields: () => Fields, - HttpRequest: () => HttpRequest7, - HttpResponse: () => HttpResponse2, - IHttpRequest: () => import_types5.HttpRequest, - getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, - isValidHostname: () => isValidHostname, - resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig - }); - module2.exports = __toCommonJS2(src_exports); - var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler2) { - httpHandler = handler2; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - } - }; - }, "getHttpHandlerExtensionConfiguration"); - var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler() - }; - }, "resolveHttpHandlerRuntimeConfig"); - var import_types5 = require_dist_cjs(); - var _Field = class _Field { - constructor({ name, kind = import_types5.FieldPosition.HEADER, values = [] }) { - this.name = name; - this.kind = kind; - this.values = values; - } - /** - * Appends a value to the field. - * - * @param value The value to append. - */ - add(value) { - this.values.push(value); - } - /** - * Overwrite existing field values. - * - * @param values The new field values. - */ - set(values) { - this.values = values; - } - /** - * Remove all matching entries from list. - * - * @param value Value to remove. - */ - remove(value) { - this.values = this.values.filter((v) => v !== value); - } - /** - * Get comma-delimited string. - * - * @returns String representation of {@link Field}. - */ - toString() { - return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); - } - /** - * Get string values as a list - * - * @returns Values in {@link Field} as a list. - */ - get() { - return this.values; - } - }; - __name(_Field, "Field"); - var Field = _Field; - var _Fields = class _Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - fields.forEach(this.setField.bind(this)); - this.encoding = encoding; - } - /** - * Set entry for a {@link Field} name. The `name` - * attribute will be used to key the collection. - * - * @param field The {@link Field} to set. - */ - setField(field) { - this.entries[field.name.toLowerCase()] = field; - } - /** - * Retrieve {@link Field} entry by name. - * - * @param name The name of the {@link Field} entry - * to retrieve - * @returns The {@link Field} if it exists. - */ - getField(name) { - return this.entries[name.toLowerCase()]; - } - /** - * Delete entry from collection. - * - * @param name Name of the entry to delete. - */ - removeField(name) { - delete this.entries[name.toLowerCase()]; - } - /** - * Helper function for retrieving specific types of fields. - * Used to grab all headers or all trailers. - * - * @param kind {@link FieldPosition} of entries to retrieve. - * @returns The {@link Field} entries with the specified - * {@link FieldPosition}. - */ - getByType(kind) { - return Object.values(this.entries).filter((field) => field.kind === kind); - } - }; - __name(_Fields, "Fields"); - var Fields = _Fields; - var _HttpRequest = class _HttpRequest2 { - constructor(options) { - this.method = options.method || "GET"; - this.hostname = options.hostname || "localhost"; - this.port = options.port; - this.query = options.query || {}; - this.headers = options.headers || {}; - this.body = options.body; - this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:"; - this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/"; - this.username = options.username; - this.password = options.password; - this.fragment = options.fragment; - } - /** - * Note: this does not deep-clone the body. - */ - static clone(request2) { - const cloned = new _HttpRequest2({ - ...request2, - headers: { ...request2.headers } - }); - if (cloned.query) { - cloned.query = cloneQuery(cloned.query); - } - return cloned; - } - /** - * This method only actually asserts that request is the interface {@link IHttpRequest}, - * and not necessarily this concrete class. Left in place for API stability. - * - * Do not call instance methods on the input of this function, and - * do not assume it has the HttpRequest prototype. - */ - static isInstance(request2) { - if (!request2) { - return false; - } - const req = request2; - return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; - } - /** - * @deprecated use static HttpRequest.clone(request) instead. It's not safe to call - * this method because {@link HttpRequest.isInstance} incorrectly - * asserts that IHttpRequest (interface) objects are of type HttpRequest (class). - */ - clone() { - return _HttpRequest2.clone(this); - } - }; - __name(_HttpRequest, "HttpRequest"); - var HttpRequest7 = _HttpRequest; - function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param - }; - }, {}); - } - __name(cloneQuery, "cloneQuery"); - var _HttpResponse = class _HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } - }; - __name(_HttpResponse, "HttpResponse"); - var HttpResponse2 = _HttpResponse; - function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); - } - __name(isValidHostname, "isValidHostname"); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js -var import_protocol_http, import_types2, import_util_middleware2, defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware; -var init_httpSigningMiddleware = __esm({ - "../../../node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() { - import_protocol_http = __toESM(require_dist_cjs20()); - import_types2 = __toESM(require_dist_cjs()); - import_util_middleware2 = __toESM(require_dist_cjs12()); - defaultErrorHandler = (signingProperties) => (error) => { - throw error; - }; - defaultSuccessHandler = (httpResponse, signingProperties) => { - }; - httpSigningMiddleware = (config) => (next, context) => async (args) => { - if (!import_protocol_http.HttpRequest.isInstance(args.request)) { - return next(args); - } - const smithyContext = (0, import_util_middleware2.getSmithyContext)(context); - const scheme = smithyContext.selectedHttpAuthScheme; - if (!scheme) { - throw new Error(`No HttpAuthScheme was selected: unable to sign request`); - } - const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme; - const output = await next({ - ...args, - request: await signer.sign(args.request, identity, signingProperties) - }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); - (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); - return output; - }; - } -}); - -// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/index.js -var require_dist_cjs21 = __commonJS({ - "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - Field: () => Field, - Fields: () => Fields, - HttpRequest: () => HttpRequest7, - HttpResponse: () => HttpResponse2, - IHttpRequest: () => import_types5.HttpRequest, - getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, - isValidHostname: () => isValidHostname, - resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig - }); - module2.exports = __toCommonJS2(src_exports); - var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler2) { - httpHandler = handler2; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - } - }; - }, "getHttpHandlerExtensionConfiguration"); - var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler() - }; - }, "resolveHttpHandlerRuntimeConfig"); - var import_types5 = require_dist_cjs(); - var _Field = class _Field { - constructor({ name, kind = import_types5.FieldPosition.HEADER, values = [] }) { - this.name = name; - this.kind = kind; - this.values = values; - } - /** - * Appends a value to the field. - * - * @param value The value to append. - */ - add(value) { - this.values.push(value); - } - /** - * Overwrite existing field values. - * - * @param values The new field values. - */ - set(values) { - this.values = values; - } - /** - * Remove all matching entries from list. - * - * @param value Value to remove. - */ - remove(value) { - this.values = this.values.filter((v) => v !== value); - } - /** - * Get comma-delimited string. - * - * @returns String representation of {@link Field}. - */ - toString() { - return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); - } - /** - * Get string values as a list - * - * @returns Values in {@link Field} as a list. - */ - get() { - return this.values; - } - }; - __name(_Field, "Field"); - var Field = _Field; - var _Fields = class _Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - fields.forEach(this.setField.bind(this)); - this.encoding = encoding; - } - /** - * Set entry for a {@link Field} name. The `name` - * attribute will be used to key the collection. - * - * @param field The {@link Field} to set. - */ - setField(field) { - this.entries[field.name.toLowerCase()] = field; - } - /** - * Retrieve {@link Field} entry by name. - * - * @param name The name of the {@link Field} entry - * to retrieve - * @returns The {@link Field} if it exists. - */ - getField(name) { - return this.entries[name.toLowerCase()]; - } - /** - * Delete entry from collection. - * - * @param name Name of the entry to delete. - */ - removeField(name) { - delete this.entries[name.toLowerCase()]; - } - /** - * Helper function for retrieving specific types of fields. - * Used to grab all headers or all trailers. - * - * @param kind {@link FieldPosition} of entries to retrieve. - * @returns The {@link Field} entries with the specified - * {@link FieldPosition}. - */ - getByType(kind) { - return Object.values(this.entries).filter((field) => field.kind === kind); - } - }; - __name(_Fields, "Fields"); - var Fields = _Fields; - var _HttpRequest = class _HttpRequest2 { - constructor(options) { - this.method = options.method || "GET"; - this.hostname = options.hostname || "localhost"; - this.port = options.port; - this.query = options.query || {}; - this.headers = options.headers || {}; - this.body = options.body; - this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:"; - this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/"; - this.username = options.username; - this.password = options.password; - this.fragment = options.fragment; - } - /** - * Note: this does not deep-clone the body. - */ - static clone(request2) { - const cloned = new _HttpRequest2({ - ...request2, - headers: { ...request2.headers } - }); - if (cloned.query) { - cloned.query = cloneQuery(cloned.query); - } - return cloned; - } - /** - * This method only actually asserts that request is the interface {@link IHttpRequest}, - * and not necessarily this concrete class. Left in place for API stability. - * - * Do not call instance methods on the input of this function, and - * do not assume it has the HttpRequest prototype. - */ - static isInstance(request2) { - if (!request2) { - return false; - } - const req = request2; - return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; - } - /** - * @deprecated use static HttpRequest.clone(request) instead. It's not safe to call - * this method because {@link HttpRequest.isInstance} incorrectly - * asserts that IHttpRequest (interface) objects are of type HttpRequest (class). - */ - clone() { - return _HttpRequest2.clone(this); - } - }; - __name(_HttpRequest, "HttpRequest"); - var HttpRequest7 = _HttpRequest; - function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param - }; - }, {}); - } - __name(cloneQuery, "cloneQuery"); - var _HttpResponse = class _HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } - }; - __name(_HttpResponse, "HttpResponse"); - var HttpResponse2 = _HttpResponse; - function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); - } - __name(isValidHostname, "isValidHostname"); - } -}); - -// ../../../node_modules/uuid/dist/esm-node/rng.js -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - import_crypto.default.randomFillSync(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} -var import_crypto, rnds8Pool, poolPtr; -var init_rng = __esm({ - "../../../node_modules/uuid/dist/esm-node/rng.js"() { - import_crypto = __toESM(require("crypto")); - rnds8Pool = new Uint8Array(256); - poolPtr = rnds8Pool.length; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/regex.js -var regex_default; -var init_regex = __esm({ - "../../../node_modules/uuid/dist/esm-node/regex.js"() { - regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/validate.js -function validate(uuid) { - return typeof uuid === "string" && regex_default.test(uuid); -} -var validate_default; -var init_validate = __esm({ - "../../../node_modules/uuid/dist/esm-node/validate.js"() { - init_regex(); - validate_default = validate; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/stringify.js -function unsafeStringify(arr, offset = 0) { - return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; -} -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); - if (!validate_default(uuid)) { - throw TypeError("Stringified UUID is invalid"); - } - return uuid; -} -var byteToHex, stringify_default; -var init_stringify = __esm({ - "../../../node_modules/uuid/dist/esm-node/stringify.js"() { - init_validate(); - byteToHex = []; - for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).slice(1)); - } - stringify_default = stringify; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/v1.js -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq; - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || rng)(); - if (node == null) { - node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - if (clockseq == null) { - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; - } - } - let msecs = options.msecs !== void 0 ? options.msecs : Date.now(); - let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; - if (dt < 0 && options.clockseq === void 0) { - clockseq = clockseq + 1 & 16383; - } - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) { - nsecs = 0; - } - if (nsecs >= 1e4) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - msecs += 122192928e5; - const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; - b[i++] = tl >>> 24 & 255; - b[i++] = tl >>> 16 & 255; - b[i++] = tl >>> 8 & 255; - b[i++] = tl & 255; - const tmh = msecs / 4294967296 * 1e4 & 268435455; - b[i++] = tmh >>> 8 & 255; - b[i++] = tmh & 255; - b[i++] = tmh >>> 24 & 15 | 16; - b[i++] = tmh >>> 16 & 255; - b[i++] = clockseq >>> 8 | 128; - b[i++] = clockseq & 255; - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - return buf || unsafeStringify(b); -} -var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default; -var init_v1 = __esm({ - "../../../node_modules/uuid/dist/esm-node/v1.js"() { - init_rng(); - init_stringify(); - _lastMSecs = 0; - _lastNSecs = 0; - v1_default = v1; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/parse.js -function parse(uuid) { - if (!validate_default(uuid)) { - throw TypeError("Invalid UUID"); - } - let v; - const arr = new Uint8Array(16); - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 255; - arr[2] = v >>> 8 & 255; - arr[3] = v & 255; - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 255; - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 255; - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 255; - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255; - arr[11] = v / 4294967296 & 255; - arr[12] = v >>> 24 & 255; - arr[13] = v >>> 16 & 255; - arr[14] = v >>> 8 & 255; - arr[15] = v & 255; - return arr; -} -var parse_default; -var init_parse = __esm({ - "../../../node_modules/uuid/dist/esm-node/parse.js"() { - init_validate(); - parse_default = parse; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/v35.js -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); - const bytes = []; - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - return bytes; -} -function v35(name, version2, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - var _namespace; - if (typeof value === "string") { - value = stringToBytes(value); - } - if (typeof namespace === "string") { - namespace = parse_default(namespace); - } - if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { - throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); - } - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 15 | version2; - bytes[8] = bytes[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - return buf; - } - return unsafeStringify(bytes); - } - try { - generateUUID.name = name; - } catch (err) { - } - generateUUID.DNS = DNS; - generateUUID.URL = URL2; - return generateUUID; -} -var DNS, URL2; -var init_v35 = __esm({ - "../../../node_modules/uuid/dist/esm-node/v35.js"() { - init_stringify(); - init_parse(); - DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; - URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/md5.js -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return import_crypto2.default.createHash("md5").update(bytes).digest(); -} -var import_crypto2, md5_default; -var init_md5 = __esm({ - "../../../node_modules/uuid/dist/esm-node/md5.js"() { - import_crypto2 = __toESM(require("crypto")); - md5_default = md5; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/v3.js -var v3, v3_default; -var init_v3 = __esm({ - "../../../node_modules/uuid/dist/esm-node/v3.js"() { - init_v35(); - init_md5(); - v3 = v35("v3", 48, md5_default); - v3_default = v3; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/native.js -var import_crypto3, native_default; -var init_native = __esm({ - "../../../node_modules/uuid/dist/esm-node/native.js"() { - import_crypto3 = __toESM(require("crypto")); - native_default = { - randomUUID: import_crypto3.default.randomUUID - }; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/v4.js -function v4(options, buf, offset) { - if (native_default.randomUUID && !buf && !options) { - return native_default.randomUUID(); - } - options = options || {}; - const rnds = options.random || (options.rng || rng)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return unsafeStringify(rnds); -} -var v4_default; -var init_v4 = __esm({ - "../../../node_modules/uuid/dist/esm-node/v4.js"() { - init_native(); - init_rng(); - init_stringify(); - v4_default = v4; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/sha1.js -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return import_crypto4.default.createHash("sha1").update(bytes).digest(); -} -var import_crypto4, sha1_default; -var init_sha1 = __esm({ - "../../../node_modules/uuid/dist/esm-node/sha1.js"() { - import_crypto4 = __toESM(require("crypto")); - sha1_default = sha1; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/v5.js -var v5, v5_default; -var init_v5 = __esm({ - "../../../node_modules/uuid/dist/esm-node/v5.js"() { - init_v35(); - init_sha1(); - v5 = v35("v5", 80, sha1_default); - v5_default = v5; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/nil.js -var nil_default; -var init_nil = __esm({ - "../../../node_modules/uuid/dist/esm-node/nil.js"() { - nil_default = "00000000-0000-0000-0000-000000000000"; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/version.js -function version(uuid) { - if (!validate_default(uuid)) { - throw TypeError("Invalid UUID"); - } - return parseInt(uuid.slice(14, 15), 16); -} -var version_default; -var init_version = __esm({ - "../../../node_modules/uuid/dist/esm-node/version.js"() { - init_validate(); - version_default = version; - } -}); - -// ../../../node_modules/uuid/dist/esm-node/index.js -var esm_node_exports = {}; -__export(esm_node_exports, { - NIL: () => nil_default, - parse: () => parse_default, - stringify: () => stringify_default, - v1: () => v1_default, - v3: () => v3_default, - v4: () => v4_default, - v5: () => v5_default, - validate: () => validate_default, - version: () => version_default -}); -var init_esm_node = __esm({ - "../../../node_modules/uuid/dist/esm-node/index.js"() { - init_v1(); - init_v3(); - init_v4(); - init_v5(); - init_nil(); - init_version(); - init_validate(); - init_stringify(); - init_parse(); - } -}); - -// ../../../node_modules/@smithy/service-error-classification/dist-cjs/index.js -var require_dist_cjs22 = __commonJS({ - "../../../node_modules/@smithy/service-error-classification/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - isClockSkewCorrectedError: () => isClockSkewCorrectedError, - isClockSkewError: () => isClockSkewError, - isRetryableByTrait: () => isRetryableByTrait, - isServerError: () => isServerError, - isThrottlingError: () => isThrottlingError, - isTransientError: () => isTransientError - }); - module2.exports = __toCommonJS2(src_exports); - var CLOCK_SKEW_ERROR_CODES = [ - "AuthFailure", - "InvalidSignatureException", - "RequestExpired", - "RequestInTheFuture", - "RequestTimeTooSkewed", - "SignatureDoesNotMatch" - ]; - var THROTTLING_ERROR_CODES = [ - "BandwidthLimitExceeded", - "EC2ThrottledException", - "LimitExceededException", - "PriorRequestNotComplete", - "ProvisionedThroughputExceededException", - "RequestLimitExceeded", - "RequestThrottled", - "RequestThrottledException", - "SlowDown", - "ThrottledException", - "Throttling", - "ThrottlingException", - "TooManyRequestsException", - "TransactionInProgressException" - // DynamoDB - ]; - var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; - var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; - var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; - var isRetryableByTrait = /* @__PURE__ */ __name((error) => error.$retryable !== void 0, "isRetryableByTrait"); - var isClockSkewError = /* @__PURE__ */ __name((error) => CLOCK_SKEW_ERROR_CODES.includes(error.name), "isClockSkewError"); - var isClockSkewCorrectedError = /* @__PURE__ */ __name((error) => { - var _a; - return (_a = error.$metadata) == null ? void 0 : _a.clockSkewCorrected; - }, "isClockSkewCorrectedError"); - var isThrottlingError = /* @__PURE__ */ __name((error) => { - var _a, _b; - return ((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) === 429 || THROTTLING_ERROR_CODES.includes(error.name) || ((_b = error.$retryable) == null ? void 0 : _b.throttling) == true; - }, "isThrottlingError"); - var isTransientError = /* @__PURE__ */ __name((error) => { - var _a; - return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0); - }, "isTransientError"); - var isServerError = /* @__PURE__ */ __name((error) => { - var _a; - if (((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) !== void 0) { - const statusCode = error.$metadata.httpStatusCode; - if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) { - return true; - } - return false; - } - return false; - }, "isServerError"); - } -}); - -// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/util-retry/dist-cjs/index.js -var require_dist_cjs23 = __commonJS({ - "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/util-retry/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - AdaptiveRetryStrategy: () => AdaptiveRetryStrategy, - ConfiguredRetryStrategy: () => ConfiguredRetryStrategy, - DEFAULT_MAX_ATTEMPTS: () => DEFAULT_MAX_ATTEMPTS, - DEFAULT_RETRY_DELAY_BASE: () => DEFAULT_RETRY_DELAY_BASE, - DEFAULT_RETRY_MODE: () => DEFAULT_RETRY_MODE, - DefaultRateLimiter: () => DefaultRateLimiter, - INITIAL_RETRY_TOKENS: () => INITIAL_RETRY_TOKENS, - INVOCATION_ID_HEADER: () => INVOCATION_ID_HEADER, - MAXIMUM_RETRY_DELAY: () => MAXIMUM_RETRY_DELAY, - NO_RETRY_INCREMENT: () => NO_RETRY_INCREMENT, - REQUEST_HEADER: () => REQUEST_HEADER, - RETRY_COST: () => RETRY_COST, - RETRY_MODES: () => RETRY_MODES, - StandardRetryStrategy: () => StandardRetryStrategy, - THROTTLING_RETRY_DELAY_BASE: () => THROTTLING_RETRY_DELAY_BASE, - TIMEOUT_RETRY_COST: () => TIMEOUT_RETRY_COST - }); - module2.exports = __toCommonJS2(src_exports); - var RETRY_MODES = /* @__PURE__ */ ((RETRY_MODES2) => { - RETRY_MODES2["STANDARD"] = "standard"; - RETRY_MODES2["ADAPTIVE"] = "adaptive"; - return RETRY_MODES2; - })(RETRY_MODES || {}); - var DEFAULT_MAX_ATTEMPTS = 3; - var DEFAULT_RETRY_MODE = "standard"; - var import_service_error_classification = require_dist_cjs22(); - var _DefaultRateLimiter = class _DefaultRateLimiter { - constructor(options) { - this.currentCapacity = 0; - this.enabled = false; - this.lastMaxRate = 0; - this.measuredTxRate = 0; - this.requestCount = 0; - this.lastTimestamp = 0; - this.timeWindow = 0; - this.beta = (options == null ? void 0 : options.beta) ?? 0.7; - this.minCapacity = (options == null ? void 0 : options.minCapacity) ?? 1; - this.minFillRate = (options == null ? void 0 : options.minFillRate) ?? 0.5; - this.scaleConstant = (options == null ? void 0 : options.scaleConstant) ?? 0.4; - this.smooth = (options == null ? void 0 : options.smooth) ?? 0.8; - const currentTimeInSeconds = this.getCurrentTimeInSeconds(); - this.lastThrottleTime = currentTimeInSeconds; - this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); - this.fillRate = this.minFillRate; - this.maxCapacity = this.minCapacity; - } - getCurrentTimeInSeconds() { - return Date.now() / 1e3; - } - async getSendToken() { - return this.acquireTokenBucket(1); - } - async acquireTokenBucket(amount) { - if (!this.enabled) { - return; - } - this.refillTokenBucket(); - if (amount > this.currentCapacity) { - const delay = (amount - this.currentCapacity) / this.fillRate * 1e3; - await new Promise((resolve) => setTimeout(resolve, delay)); - } - this.currentCapacity = this.currentCapacity - amount; - } - refillTokenBucket() { - const timestamp = this.getCurrentTimeInSeconds(); - if (!this.lastTimestamp) { - this.lastTimestamp = timestamp; - return; - } - const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; - this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); - this.lastTimestamp = timestamp; - } - updateClientSendingRate(response) { - let calculatedRate; - this.updateMeasuredRate(); - if ((0, import_service_error_classification.isThrottlingError)(response)) { - const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); - this.lastMaxRate = rateToUse; - this.calculateTimeWindow(); - this.lastThrottleTime = this.getCurrentTimeInSeconds(); - calculatedRate = this.cubicThrottle(rateToUse); - this.enableTokenBucket(); - } else { - this.calculateTimeWindow(); - calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); - } - const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); - this.updateTokenBucketRate(newRate); - } - calculateTimeWindow() { - this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); - } - cubicThrottle(rateToUse) { - return this.getPrecise(rateToUse * this.beta); - } - cubicSuccess(timestamp) { - return this.getPrecise( - this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate - ); - } - enableTokenBucket() { - this.enabled = true; - } - updateTokenBucketRate(newRate) { - this.refillTokenBucket(); - this.fillRate = Math.max(newRate, this.minFillRate); - this.maxCapacity = Math.max(newRate, this.minCapacity); - this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); - } - updateMeasuredRate() { - const t = this.getCurrentTimeInSeconds(); - const timeBucket = Math.floor(t * 2) / 2; - this.requestCount++; - if (timeBucket > this.lastTxRateBucket) { - const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); - this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); - this.requestCount = 0; - this.lastTxRateBucket = timeBucket; - } - } - getPrecise(num) { - return parseFloat(num.toFixed(8)); - } - }; - __name(_DefaultRateLimiter, "DefaultRateLimiter"); - var DefaultRateLimiter = _DefaultRateLimiter; - var DEFAULT_RETRY_DELAY_BASE = 100; - var MAXIMUM_RETRY_DELAY = 20 * 1e3; - var THROTTLING_RETRY_DELAY_BASE = 500; - var INITIAL_RETRY_TOKENS = 500; - var RETRY_COST = 5; - var TIMEOUT_RETRY_COST = 10; - var NO_RETRY_INCREMENT = 1; - var INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; - var REQUEST_HEADER = "amz-sdk-request"; - var getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => { - let delayBase = DEFAULT_RETRY_DELAY_BASE; - const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => { - return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); - }, "computeNextBackoffDelay"); - const setDelayBase = /* @__PURE__ */ __name((delay) => { - delayBase = delay; - }, "setDelayBase"); - return { - computeNextBackoffDelay, - setDelayBase - }; - }, "getDefaultRetryBackoffStrategy"); - var createDefaultRetryToken = /* @__PURE__ */ __name(({ - retryDelay, - retryCount, - retryCost - }) => { - const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount"); - const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay"); - const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost"); - return { - getRetryCount, - getRetryDelay, - getRetryCost - }; - }, "createDefaultRetryToken"); - var _StandardRetryStrategy = class _StandardRetryStrategy { - constructor(maxAttempts) { - this.maxAttempts = maxAttempts; - this.mode = "standard"; - this.capacity = INITIAL_RETRY_TOKENS; - this.retryBackoffStrategy = getDefaultRetryBackoffStrategy(); - this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - async acquireInitialRetryToken(retryTokenScope) { - return createDefaultRetryToken({ - retryDelay: DEFAULT_RETRY_DELAY_BASE, - retryCount: 0 - }); - } - async refreshRetryTokenForRetry(token, errorInfo) { - const maxAttempts = await this.getMaxAttempts(); - if (this.shouldRetry(token, errorInfo, maxAttempts)) { - const errorType = errorInfo.errorType; - this.retryBackoffStrategy.setDelayBase( - errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE - ); - const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); - const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; - const capacityCost = this.getCapacityCost(errorType); - this.capacity -= capacityCost; - return createDefaultRetryToken({ - retryDelay, - retryCount: token.getRetryCount() + 1, - retryCost: capacityCost - }); - } - throw new Error("No retry token available"); - } - recordSuccess(token) { - this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); - } - /** - * @returns the current available retry capacity. - * - * This number decreases when retries are executed and refills when requests or retries succeed. - */ - getCapacity() { - return this.capacity; - } - async getMaxAttempts() { - try { - return await this.maxAttemptsProvider(); - } catch (error) { - console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); - return DEFAULT_MAX_ATTEMPTS; - } - } - shouldRetry(tokenToRenew, errorInfo, maxAttempts) { - const attempts = tokenToRenew.getRetryCount() + 1; - return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); - } - getCapacityCost(errorType) { - return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; - } - isRetryableError(errorType) { - return errorType === "THROTTLING" || errorType === "TRANSIENT"; - } - }; - __name(_StandardRetryStrategy, "StandardRetryStrategy"); - var StandardRetryStrategy = _StandardRetryStrategy; - var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy { - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - this.mode = "adaptive"; - const { rateLimiter } = options ?? {}; - this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); - this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); - } - async acquireInitialRetryToken(retryTokenScope) { - await this.rateLimiter.getSendToken(); - return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); - } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - this.rateLimiter.updateClientSendingRate(errorInfo); - return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - } - recordSuccess(token) { - this.rateLimiter.updateClientSendingRate({}); - this.standardRetryStrategy.recordSuccess(token); - } - }; - __name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); - var AdaptiveRetryStrategy = _AdaptiveRetryStrategy; - var _ConfiguredRetryStrategy = class _ConfiguredRetryStrategy extends StandardRetryStrategy { - /** - * @param maxAttempts - the maximum number of retry attempts allowed. - * e.g., if set to 3, then 4 total requests are possible. - * @param computeNextBackoffDelay - a millisecond delay for each retry or a function that takes the retry attempt - * and returns the delay. - * - * @example exponential backoff. - * ```js - * new Client({ - * retryStrategy: new ConfiguredRetryStrategy(3, (attempt) => attempt ** 2) - * }); - * ``` - * @example constant delay. - * ```js - * new Client({ - * retryStrategy: new ConfiguredRetryStrategy(3, 2000) - * }); - * ``` - */ - constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) { - super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); - if (typeof computeNextBackoffDelay === "number") { - this.computeNextBackoffDelay = () => computeNextBackoffDelay; - } else { - this.computeNextBackoffDelay = computeNextBackoffDelay; - } - } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); - return token; - } - }; - __name(_ConfiguredRetryStrategy, "ConfiguredRetryStrategy"); - var ConfiguredRetryStrategy = _ConfiguredRetryStrategy; - } -}); - -// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/util-middleware/dist-cjs/index.js -var require_dist_cjs24 = __commonJS({ - "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - getSmithyContext: () => getSmithyContext4, - normalizeProvider: () => normalizeProvider2 - }); - module2.exports = __toCommonJS2(src_exports); - var import_types5 = require_dist_cjs(); - var getSmithyContext4 = /* @__PURE__ */ __name((context) => context[import_types5.SMITHY_CONTEXT_KEY] || (context[import_types5.SMITHY_CONTEXT_KEY] = {}), "getSmithyContext"); - var normalizeProvider2 = /* @__PURE__ */ __name((input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; - }, "normalizeProvider"); - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/middleware-stack/dist-cjs/index.js -var require_dist_cjs25 = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/middleware-stack/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - constructStack: () => constructStack - }); - module2.exports = __toCommonJS2(src_exports); - var getAllAliases = /* @__PURE__ */ __name((name, aliases) => { - const _aliases = []; - if (name) { - _aliases.push(name); - } - if (aliases) { - for (const alias of aliases) { - _aliases.push(alias); - } - } - return _aliases; - }, "getAllAliases"); - var getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name, aliases) => { - return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; - }, "getMiddlewareNameWithAliases"); - var constructStack = /* @__PURE__ */ __name(() => { - let absoluteEntries = []; - let relativeEntries = []; - let identifyOnResolve = false; - const entriesNameSet = /* @__PURE__ */ new Set(); - const sort = /* @__PURE__ */ __name((entries) => entries.sort( - (a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"] - ), "sort"); - const removeByName = /* @__PURE__ */ __name((toRemove) => { - let isRemoved = false; - const filterCb = /* @__PURE__ */ __name((entry) => { - const aliases = getAllAliases(entry.name, entry.aliases); - if (aliases.includes(toRemove)) { - isRemoved = true; - for (const alias of aliases) { - entriesNameSet.delete(alias); - } - return false; - } - return true; - }, "filterCb"); - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, "removeByName"); - const removeByReference = /* @__PURE__ */ __name((toRemove) => { - let isRemoved = false; - const filterCb = /* @__PURE__ */ __name((entry) => { - if (entry.middleware === toRemove) { - isRemoved = true; - for (const alias of getAllAliases(entry.name, entry.aliases)) { - entriesNameSet.delete(alias); - } - return false; - } - return true; - }, "filterCb"); - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, "removeByReference"); - const cloneTo = /* @__PURE__ */ __name((toStack) => { - var _a; - absoluteEntries.forEach((entry) => { - toStack.add(entry.middleware, { ...entry }); - }); - relativeEntries.forEach((entry) => { - toStack.addRelativeTo(entry.middleware, { ...entry }); - }); - (_a = toStack.identifyOnResolve) == null ? void 0 : _a.call(toStack, stack.identifyOnResolve()); - return toStack; - }, "cloneTo"); - const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => { - const expandedMiddlewareList = []; - from.before.forEach((entry) => { - if (entry.before.length === 0 && entry.after.length === 0) { - expandedMiddlewareList.push(entry); - } else { - expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); - } - }); - expandedMiddlewareList.push(from); - from.after.reverse().forEach((entry) => { - if (entry.before.length === 0 && entry.after.length === 0) { - expandedMiddlewareList.push(entry); - } else { - expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); - } - }); - return expandedMiddlewareList; - }, "expandRelativeMiddlewareList"); - const getMiddlewareList = /* @__PURE__ */ __name((debug = false) => { - const normalizedAbsoluteEntries = []; - const normalizedRelativeEntries = []; - const normalizedEntriesNameMap = {}; - absoluteEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [] - }; - for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { - normalizedEntriesNameMap[alias] = normalizedEntry; - } - normalizedAbsoluteEntries.push(normalizedEntry); - }); - relativeEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [] - }; - for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { - normalizedEntriesNameMap[alias] = normalizedEntry; - } - normalizedRelativeEntries.push(normalizedEntry); - }); - normalizedRelativeEntries.forEach((entry) => { - if (entry.toMiddleware) { - const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; - if (toMiddleware === void 0) { - if (debug) { - return; - } - throw new Error( - `${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}` - ); - } - if (entry.relation === "after") { - toMiddleware.after.push(entry); - } - if (entry.relation === "before") { - toMiddleware.before.push(entry); - } - } - }); - const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce( - (wholeList, expandedMiddlewareList) => { - wholeList.push(...expandedMiddlewareList); - return wholeList; - }, - [] - ); - return mainChain; - }, "getMiddlewareList"); - const stack = { - add: (middleware, options = {}) => { - const { name, override, aliases: _aliases } = options; - const entry = { - step: "initialize", - priority: "normal", - middleware, - ...options - }; - const aliases = getAllAliases(name, _aliases); - if (aliases.length > 0) { - if (aliases.some((alias) => entriesNameSet.has(alias))) { - if (!override) - throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); - for (const alias of aliases) { - const toOverrideIndex = absoluteEntries.findIndex( - (entry2) => { - var _a; - return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias)); - } - ); - if (toOverrideIndex === -1) { - continue; - } - const toOverride = absoluteEntries[toOverrideIndex]; - if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) { - throw new Error( - `"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.` - ); - } - absoluteEntries.splice(toOverrideIndex, 1); - } - } - for (const alias of aliases) { - entriesNameSet.add(alias); - } - } - absoluteEntries.push(entry); - }, - addRelativeTo: (middleware, options) => { - const { name, override, aliases: _aliases } = options; - const entry = { - middleware, - ...options - }; - const aliases = getAllAliases(name, _aliases); - if (aliases.length > 0) { - if (aliases.some((alias) => entriesNameSet.has(alias))) { - if (!override) - throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); - for (const alias of aliases) { - const toOverrideIndex = relativeEntries.findIndex( - (entry2) => { - var _a; - return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias)); - } - ); - if (toOverrideIndex === -1) { - continue; - } - const toOverride = relativeEntries[toOverrideIndex]; - if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { - throw new Error( - `"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.` - ); - } - relativeEntries.splice(toOverrideIndex, 1); - } - } - for (const alias of aliases) { - entriesNameSet.add(alias); - } - } - relativeEntries.push(entry); - }, - clone: () => cloneTo(constructStack()), - use: (plugin) => { - plugin.applyToStack(stack); - }, - remove: (toRemove) => { - if (typeof toRemove === "string") - return removeByName(toRemove); - else - return removeByReference(toRemove); - }, - removeByTag: (toRemove) => { - let isRemoved = false; - const filterCb = /* @__PURE__ */ __name((entry) => { - const { tags, name, aliases: _aliases } = entry; - if (tags && tags.includes(toRemove)) { - const aliases = getAllAliases(name, _aliases); - for (const alias of aliases) { - entriesNameSet.delete(alias); - } - isRemoved = true; - return false; - } - return true; - }, "filterCb"); - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, - concat: (from) => { - var _a; - const cloned = cloneTo(constructStack()); - cloned.use(from); - cloned.identifyOnResolve( - identifyOnResolve || cloned.identifyOnResolve() || (((_a = from.identifyOnResolve) == null ? void 0 : _a.call(from)) ?? false) - ); - return cloned; - }, - applyToStack: cloneTo, - identify: () => { - return getMiddlewareList(true).map((mw) => { - const step = mw.step ?? mw.relation + " " + mw.toMiddleware; - return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; - }); - }, - identifyOnResolve(toggle) { - if (typeof toggle === "boolean") - identifyOnResolve = toggle; - return identifyOnResolve; - }, - resolve: (handler2, context) => { - for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) { - handler2 = middleware(handler2, context); - } - if (identifyOnResolve) { - console.log(stack.identify()); - } - return handler2; - } - }; - return stack; - }, "constructStack"); - var stepWeights = { - initialize: 5, - serialize: 4, - build: 3, - finalizeRequest: 2, - deserialize: 1 - }; - var priorityWeights = { - high: 3, - normal: 2, - low: 1 - }; - } -}); - -// ../../../node_modules/@smithy/is-array-buffer/dist-cjs/index.js -var require_dist_cjs26 = __commonJS({ - "../../../node_modules/@smithy/is-array-buffer/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - isArrayBuffer: () => isArrayBuffer - }); - module2.exports = __toCommonJS2(src_exports); - var isArrayBuffer = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer"); - } -}); - -// ../../../node_modules/@smithy/util-buffer-from/dist-cjs/index.js -var require_dist_cjs27 = __commonJS({ - "../../../node_modules/@smithy/util-buffer-from/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - fromArrayBuffer: () => fromArrayBuffer, - fromString: () => fromString - }); - module2.exports = __toCommonJS2(src_exports); - var import_is_array_buffer = require_dist_cjs26(); - var import_buffer = require("buffer"); - var fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => { - if (!(0, import_is_array_buffer.isArrayBuffer)(input)) { - throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); - } - return import_buffer.Buffer.from(input, offset, length); - }, "fromArrayBuffer"); - var fromString = /* @__PURE__ */ __name((input, encoding) => { - if (typeof input !== "string") { - throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); - } - return encoding ? import_buffer.Buffer.from(input, encoding) : import_buffer.Buffer.from(input); - }, "fromString"); - } -}); - -// ../../../node_modules/@smithy/util-base64/dist-cjs/fromBase64.js -var require_fromBase64 = __commonJS({ - "../../../node_modules/@smithy/util-base64/dist-cjs/fromBase64.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.fromBase64 = void 0; - var util_buffer_from_1 = require_dist_cjs27(); - var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; - var fromBase642 = (input) => { - if (input.length * 3 % 4 !== 0) { - throw new TypeError(`Incorrect padding on base64 string.`); - } - if (!BASE64_REGEX.exec(input)) { - throw new TypeError(`Invalid base64 string.`); - } - const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - }; - exports2.fromBase64 = fromBase642; - } -}); - -// ../../../node_modules/@smithy/util-utf8/dist-cjs/index.js -var require_dist_cjs28 = __commonJS({ - "../../../node_modules/@smithy/util-utf8/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - fromUtf8: () => fromUtf8, - toUint8Array: () => toUint8Array, - toUtf8: () => toUtf8 - }); - module2.exports = __toCommonJS2(src_exports); - var import_util_buffer_from = require_dist_cjs27(); - var fromUtf8 = /* @__PURE__ */ __name((input) => { - const buf = (0, import_util_buffer_from.fromString)(input, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); - }, "fromUtf8"); - var toUint8Array = /* @__PURE__ */ __name((data) => { - if (typeof data === "string") { - return fromUtf8(data); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); - } - return new Uint8Array(data); - }, "toUint8Array"); - var toUtf8 = /* @__PURE__ */ __name((input) => { - if (typeof input === "string") { - return input; - } - if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { - throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array."); - } - return (0, import_util_buffer_from.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); - }, "toUtf8"); - } -}); - -// ../../../node_modules/@smithy/util-base64/dist-cjs/toBase64.js -var require_toBase64 = __commonJS({ - "../../../node_modules/@smithy/util-base64/dist-cjs/toBase64.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toBase64 = void 0; - var util_buffer_from_1 = require_dist_cjs27(); - var util_utf8_1 = require_dist_cjs28(); - var toBase642 = (_input) => { - let input; - if (typeof _input === "string") { - input = (0, util_utf8_1.fromUtf8)(_input); - } else { - input = _input; - } - if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { - throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); - } - return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); - }; - exports2.toBase64 = toBase642; - } -}); - -// ../../../node_modules/@smithy/util-base64/dist-cjs/index.js -var require_dist_cjs29 = __commonJS({ - "../../../node_modules/@smithy/util-base64/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - module2.exports = __toCommonJS2(src_exports); - __reExport(src_exports, require_fromBase64(), module2.exports); - __reExport(src_exports, require_toBase64(), module2.exports); - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js -var require_getAwsChunkedEncodingStream = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getAwsChunkedEncodingStream = void 0; - var stream_1 = require("stream"); - var getAwsChunkedEncodingStream2 = (readableStream, options) => { - const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; - const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; - const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0; - const awsChunkedEncodingStream = new stream_1.Readable({ read: () => { - } }); - readableStream.on("data", (data) => { - const length = bodyLengthChecker(data) || 0; - awsChunkedEncodingStream.push(`${length.toString(16)}\r -`); - awsChunkedEncodingStream.push(data); - awsChunkedEncodingStream.push("\r\n"); - }); - readableStream.on("end", async () => { - awsChunkedEncodingStream.push(`0\r -`); - if (checksumRequired) { - const checksum = base64Encoder(await digest); - awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r -`); - awsChunkedEncodingStream.push(`\r -`); - } - awsChunkedEncodingStream.push(null); - }); - return awsChunkedEncodingStream; - }; - exports2.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream2; - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/protocol-http/dist-cjs/index.js -var require_dist_cjs30 = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/protocol-http/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - Field: () => Field, - Fields: () => Fields, - HttpRequest: () => HttpRequest7, - HttpResponse: () => HttpResponse2, - IHttpRequest: () => import_types5.HttpRequest, - getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, - isValidHostname: () => isValidHostname, - resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig - }); - module2.exports = __toCommonJS2(src_exports); - var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler2) { - httpHandler = handler2; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - } - }; - }, "getHttpHandlerExtensionConfiguration"); - var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler() - }; - }, "resolveHttpHandlerRuntimeConfig"); - var import_types5 = require_dist_cjs(); - var _Field = class _Field { - constructor({ name, kind = import_types5.FieldPosition.HEADER, values = [] }) { - this.name = name; - this.kind = kind; - this.values = values; - } - /** - * Appends a value to the field. - * - * @param value The value to append. - */ - add(value) { - this.values.push(value); - } - /** - * Overwrite existing field values. - * - * @param values The new field values. - */ - set(values) { - this.values = values; - } - /** - * Remove all matching entries from list. - * - * @param value Value to remove. - */ - remove(value) { - this.values = this.values.filter((v) => v !== value); - } - /** - * Get comma-delimited string. - * - * @returns String representation of {@link Field}. - */ - toString() { - return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); - } - /** - * Get string values as a list - * - * @returns Values in {@link Field} as a list. - */ - get() { - return this.values; - } - }; - __name(_Field, "Field"); - var Field = _Field; - var _Fields = class _Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - fields.forEach(this.setField.bind(this)); - this.encoding = encoding; - } - /** - * Set entry for a {@link Field} name. The `name` - * attribute will be used to key the collection. - * - * @param field The {@link Field} to set. - */ - setField(field) { - this.entries[field.name.toLowerCase()] = field; - } - /** - * Retrieve {@link Field} entry by name. - * - * @param name The name of the {@link Field} entry - * to retrieve - * @returns The {@link Field} if it exists. - */ - getField(name) { - return this.entries[name.toLowerCase()]; - } - /** - * Delete entry from collection. - * - * @param name Name of the entry to delete. - */ - removeField(name) { - delete this.entries[name.toLowerCase()]; - } - /** - * Helper function for retrieving specific types of fields. - * Used to grab all headers or all trailers. - * - * @param kind {@link FieldPosition} of entries to retrieve. - * @returns The {@link Field} entries with the specified - * {@link FieldPosition}. - */ - getByType(kind) { - return Object.values(this.entries).filter((field) => field.kind === kind); - } - }; - __name(_Fields, "Fields"); - var Fields = _Fields; - var _HttpRequest = class _HttpRequest2 { - constructor(options) { - this.method = options.method || "GET"; - this.hostname = options.hostname || "localhost"; - this.port = options.port; - this.query = options.query || {}; - this.headers = options.headers || {}; - this.body = options.body; - this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:"; - this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/"; - this.username = options.username; - this.password = options.password; - this.fragment = options.fragment; - } - /** - * Note: this does not deep-clone the body. - */ - static clone(request2) { - const cloned = new _HttpRequest2({ - ...request2, - headers: { ...request2.headers } - }); - if (cloned.query) { - cloned.query = cloneQuery(cloned.query); - } - return cloned; - } - /** - * This method only actually asserts that request is the interface {@link IHttpRequest}, - * and not necessarily this concrete class. Left in place for API stability. - * - * Do not call instance methods on the input of this function, and - * do not assume it has the HttpRequest prototype. - */ - static isInstance(request2) { - if (!request2) { - return false; - } - const req = request2; - return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; - } - /** - * @deprecated use static HttpRequest.clone(request) instead. It's not safe to call - * this method because {@link HttpRequest.isInstance} incorrectly - * asserts that IHttpRequest (interface) objects are of type HttpRequest (class). - */ - clone() { - return _HttpRequest2.clone(this); - } - }; - __name(_HttpRequest, "HttpRequest"); - var HttpRequest7 = _HttpRequest; - function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param - }; - }, {}); - } - __name(cloneQuery, "cloneQuery"); - var _HttpResponse = class _HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } - }; - __name(_HttpResponse, "HttpResponse"); - var HttpResponse2 = _HttpResponse; - function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); - } - __name(isValidHostname, "isValidHostname"); - } -}); - -// ../../../node_modules/@smithy/util-uri-escape/dist-cjs/index.js -var require_dist_cjs31 = __commonJS({ - "../../../node_modules/@smithy/util-uri-escape/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - escapeUri: () => escapeUri, - escapeUriPath: () => escapeUriPath - }); - module2.exports = __toCommonJS2(src_exports); - var escapeUri = /* @__PURE__ */ __name((uri) => ( - // AWS percent-encodes some extra non-standard characters in a URI - encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) - ), "escapeUri"); - var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); - var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); - } -}); - -// ../../../node_modules/@smithy/querystring-builder/dist-cjs/index.js -var require_dist_cjs32 = __commonJS({ - "../../../node_modules/@smithy/querystring-builder/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - buildQueryString: () => buildQueryString - }); - module2.exports = __toCommonJS2(src_exports); - var import_util_uri_escape = require_dist_cjs31(); - function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, import_util_uri_escape.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); - } - } else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); - } - __name(buildQueryString, "buildQueryString"); - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/node-http-handler/dist-cjs/index.js -var require_dist_cjs33 = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/node-http-handler/dist-cjs/index.js"(exports2, module2) { - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, - mod - )); - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, - NodeHttp2Handler: () => NodeHttp2Handler, - NodeHttpHandler: () => NodeHttpHandler, - streamCollector: () => streamCollector - }); - module2.exports = __toCommonJS2(src_exports); - var import_protocol_http8 = require_dist_cjs30(); - var import_querystring_builder = require_dist_cjs32(); - var import_http2 = require("http"); - var import_https = require("https"); - var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { - const transformedHeaders = {}; - for (const name of Object.keys(headers)) { - const headerValues = headers[name]; - transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; - } - return transformedHeaders; - }, "getTransformedHeaders"); - var DEFER_EVENT_LISTENER_TIME = 1e3; - var setConnectionTimeout = /* @__PURE__ */ __name((request2, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return -1; - } - const registerTimeout = /* @__PURE__ */ __name((offset) => { - const timeoutId = setTimeout(() => { - request2.destroy(); - reject( - Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError" - }) - ); - }, timeoutInMs - offset); - const doWithSocket = /* @__PURE__ */ __name((socket) => { - if (socket == null ? void 0 : socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } else { - clearTimeout(timeoutId); - } - }, "doWithSocket"); - if (request2.socket) { - doWithSocket(request2.socket); - } else { - request2.on("socket", doWithSocket); - } - }, "registerTimeout"); - if (timeoutInMs < 2e3) { - registerTimeout(0); - return 0; - } - return setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); - }, "setConnectionTimeout"); - var DEFER_EVENT_LISTENER_TIME2 = 3e3; - var setSocketKeepAlive = /* @__PURE__ */ __name((request2, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => { - if (keepAlive !== true) { - return -1; - } - const registerListener = /* @__PURE__ */ __name(() => { - if (request2.socket) { - request2.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - } else { - request2.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); - } - }, "registerListener"); - if (deferTimeMs === 0) { - registerListener(); - return 0; - } - return setTimeout(registerListener, deferTimeMs); - }, "setSocketKeepAlive"); - var DEFER_EVENT_LISTENER_TIME3 = 3e3; - var setSocketTimeout = /* @__PURE__ */ __name((request2, reject, timeoutInMs = 0) => { - const registerTimeout = /* @__PURE__ */ __name((offset) => { - request2.setTimeout(timeoutInMs - offset, () => { - request2.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); - }, "registerTimeout"); - if (0 < timeoutInMs && timeoutInMs < 6e3) { - registerTimeout(0); - return 0; - } - return setTimeout( - registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), - DEFER_EVENT_LISTENER_TIME3 - ); - }, "setSocketTimeout"); - var import_stream = require("stream"); - var MIN_WAIT_TIME = 1e3; - async function writeRequestBody(httpRequest, request2, maxContinueTimeoutMs = MIN_WAIT_TIME) { - const headers = request2.headers ?? {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }) - ]); - } - if (!hasError) { - writeBody(httpRequest, request2.body); - } - } - __name(writeRequestBody, "writeRequestBody"); - function writeBody(httpRequest, body) { - if (body instanceof import_stream.Readable) { - body.pipe(httpRequest); - return; - } - if (body) { - if (Buffer.isBuffer(body) || typeof body === "string") { - httpRequest.end(body); - return; - } - const uint8 = body; - if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { - httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); - return; - } - httpRequest.end(Buffer.from(body)); - return; - } - httpRequest.end(); - } - __name(writeBody, "writeBody"); - var DEFAULT_REQUEST_TIMEOUT = 0; - var _NodeHttpHandler = class _NodeHttpHandler2 { - constructor(options) { - this.socketWarningTimestamp = 0; - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options().then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }).catch(reject); - } else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - /** - * @returns the input if it is an HttpHandler of any class, - * or instantiates a new instance of this handler. - */ - static create(instanceOrOptions) { - if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new _NodeHttpHandler2(instanceOrOptions); - } - /** - * @internal - * - * @param agent - http(s) agent in use by the NodeHttpHandler instance. - * @param socketWarningTimestamp - last socket usage check timestamp. - * @param logger - channel for the warning. - * @returns timestamp of last emitted warning. - */ - static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { - var _a, _b, _c; - const { sockets, requests, maxSockets } = agent; - if (typeof maxSockets !== "number" || maxSockets === Infinity) { - return socketWarningTimestamp; - } - const interval = 15e3; - if (Date.now() - interval < socketWarningTimestamp) { - return socketWarningTimestamp; - } - if (sockets && requests) { - for (const origin in sockets) { - const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; - const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; - if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { - (_c = logger == null ? void 0 : logger.warn) == null ? void 0 : _c.call( - logger, - `@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued. -See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html -or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.` - ); - return Date.now(); - } - } - } - return socketWarningTimestamp; - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout ?? socketTimeout, - httpAgent: (() => { - if (httpAgent instanceof import_http2.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { - return httpAgent; - } - return new import_http2.Agent({ keepAlive, maxSockets, ...httpAgent }); - })(), - httpsAgent: (() => { - if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { - return httpsAgent; - } - return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); - })(), - logger: console - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); - (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); - } - async handle(request2, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - let writeRequestBodyPromise = void 0; - const timeouts = []; - const resolve = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - timeouts.forEach(clearTimeout); - _resolve(arg); - }, "resolve"); - const reject = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - timeouts.forEach(clearTimeout); - _reject(arg); - }, "reject"); - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal == null ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request2.protocol === "https:"; - const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; - timeouts.push( - setTimeout( - () => { - this.socketWarningTimestamp = _NodeHttpHandler2.checkSocketUsage( - agent, - this.socketWarningTimestamp, - this.config.logger - ); - }, - this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3) - ) - ); - const queryString = (0, import_querystring_builder.buildQueryString)(request2.query || {}); - let auth = void 0; - if (request2.username != null || request2.password != null) { - const username = request2.username ?? ""; - const password = request2.password ?? ""; - auth = `${username}:${password}`; - } - let path = request2.path; - if (queryString) { - path += `?${queryString}`; - } - if (request2.fragment) { - path += `#${request2.fragment}`; - } - let hostname = request2.hostname ?? ""; - if (hostname[0] === "[" && hostname.endsWith("]")) { - hostname = request2.hostname.slice(1, -1); - } else { - hostname = request2.hostname; - } - const nodeHttpsOptions = { - headers: request2.headers, - host: hostname, - method: request2.method, - path, - port: request2.port, - agent, - auth - }; - const requestFunc = isSSL ? import_https.request : import_http2.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new import_protocol_http8.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: getTransformedHeaders(res.headers), - body: res - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } else { - reject(err); - } - }); - if (abortSignal) { - const onAbort = /* @__PURE__ */ __name(() => { - req.destroy(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }, "onAbort"); - if (typeof abortSignal.addEventListener === "function") { - const signal = abortSignal; - signal.addEventListener("abort", onAbort, { once: true }); - req.once("close", () => signal.removeEventListener("abort", onAbort)); - } else { - abortSignal.onabort = onAbort; - } - } - timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout)); - timeouts.push(setSocketTimeout(req, reject, this.config.requestTimeout)); - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - timeouts.push( - setSocketKeepAlive(req, { - // @ts-expect-error keepAlive is not public on httpAgent. - keepAlive: httpAgent.keepAlive, - // @ts-expect-error keepAliveMsecs is not public on httpAgent. - keepAliveMsecs: httpAgent.keepAliveMsecs - }) - ); - } - writeRequestBodyPromise = writeRequestBody(req, request2, this.config.requestTimeout).catch((e) => { - timeouts.forEach(clearTimeout); - return _reject(e); - }); - }); - } - updateHttpClientConfig(key, value) { - this.config = void 0; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value - }; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - }; - __name(_NodeHttpHandler, "NodeHttpHandler"); - var NodeHttpHandler = _NodeHttpHandler; - var import_http22 = require("http2"); - var import_http23 = __toESM2(require("http2")); - var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions ?? []; - } - poll() { - if (this.sessions.length > 0) { - return this.sessions.shift(); - } - } - offerLast(session) { - this.sessions.push(session); - } - contains(session) { - return this.sessions.includes(session); - } - remove(session) { - this.sessions = this.sessions.filter((s) => s !== session); - } - [Symbol.iterator]() { - return this.sessions[Symbol.iterator](); - } - destroy(connection) { - for (const session of this.sessions) { - if (session === connection) { - if (!session.destroyed) { - session.destroy(); - } - } - } - } - }; - __name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); - var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; - var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = /* @__PURE__ */ new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const url2 = this.getUrlString(requestContext); - const existingPool = this.sessionCache.get(url2); - if (existingPool) { - const existingSession = existingPool.poll(); - if (existingSession && !this.config.disableConcurrency) { - return existingSession; - } - } - const session = import_http23.default.connect(url2); - if (this.config.maxConcurrency) { - session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => { - if (err) { - throw new Error( - "Fail to set maxConcurrentStreams to " + this.config.maxConcurrency + "when creating new session for " + requestContext.destination.toString() - ); - } - }); - } - session.unref(); - const destroySessionCb = /* @__PURE__ */ __name(() => { - session.destroy(); - this.deleteSession(url2, session); - }, "destroySessionCb"); - session.on("goaway", destroySessionCb); - session.on("error", destroySessionCb); - session.on("frameError", destroySessionCb); - session.on("close", () => this.deleteSession(url2, session)); - if (connectionConfiguration.requestTimeout) { - session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); - } - const connectionPool = this.sessionCache.get(url2) || new NodeHttp2ConnectionPool(); - connectionPool.offerLast(session); - this.sessionCache.set(url2, connectionPool); - return session; - } - /** - * Delete a session from the connection pool. - * @param authority The authority of the session to delete. - * @param session The session to delete. - */ - deleteSession(authority, session) { - const existingConnectionPool = this.sessionCache.get(authority); - if (!existingConnectionPool) { - return; - } - if (!existingConnectionPool.contains(session)) { - return; - } - existingConnectionPool.remove(session); - this.sessionCache.set(authority, existingConnectionPool); - } - release(requestContext, session) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request2) { - return request2.destination.toString(); - } - }; - __name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); - var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; - var _NodeHttp2Handler = class _NodeHttp2Handler2 { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new NodeHttp2ConnectionManager({}); - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options().then((opts) => { - resolve(opts || {}); - }).catch(reject); - } else { - resolve(options || {}); - } - }); - } - /** - * @returns the input if it is an HttpHandler of any class, - * or instantiates a new instance of this handler. - */ - static create(instanceOrOptions) { - if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new _NodeHttp2Handler2(instanceOrOptions); - } - destroy() { - this.connectionManager.destroy(); - } - async handle(request2, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a; - let fulfilled = false; - let writeRequestBodyPromise = void 0; - const resolve = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }, "resolve"); - const reject = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }, "reject"); - if (abortSignal == null ? void 0 : abortSignal.aborted) { - fulfilled = true; - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const { hostname, method, port, protocol, query } = request2; - let auth = ""; - if (request2.username != null || request2.password != null) { - const username = request2.username ?? ""; - const password = request2.password ?? ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_a = this.config) == null ? void 0 : _a.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false - }); - const rejectWithDestroy = /* @__PURE__ */ __name((err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }, "rejectWithDestroy"); - const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); - let path = request2.path; - if (queryString) { - path += `?${queryString}`; - } - if (request2.fragment) { - path += `#${request2.fragment}`; - } - const req = session.request({ - ...request2.headers, - [import_http22.constants.HTTP2_HEADER_PATH]: path, - [import_http22.constants.HTTP2_HEADER_METHOD]: method - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new import_protocol_http8.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: getTransformedHeaders(headers), - body: req - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - const onAbort = /* @__PURE__ */ __name(() => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }, "onAbort"); - if (typeof abortSignal.addEventListener === "function") { - const signal = abortSignal; - signal.addEventListener("abort", onAbort, { once: true }); - req.once("close", () => signal.removeEventListener("abort", onAbort)); - } else { - abortSignal.onabort = onAbort; - } - } - req.on("frameError", (type, code, id) => { - rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); - }); - req.on("error", rejectWithDestroy); - req.on("aborted", () => { - rejectWithDestroy( - new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`) - ); - }); - req.on("close", () => { - session.unref(); - if (disableConcurrentStreams) { - session.destroy(); - } - if (!fulfilled) { - rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); - } - }); - writeRequestBodyPromise = writeRequestBody(req, request2, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = void 0; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value - }; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - /** - * Destroys a session. - * @param session The session to destroy. - */ - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } - }; - __name(_NodeHttp2Handler, "NodeHttp2Handler"); - var NodeHttp2Handler = _NodeHttp2Handler; - var _Collector = class _Collector extends import_stream.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } - }; - __name(_Collector, "Collector"); - var Collector = _Collector; - var streamCollector = /* @__PURE__ */ __name((stream) => { - if (isReadableStreamInstance(stream)) { - return collectReadableStream(stream); - } - return new Promise((resolve, reject) => { - const collector = new Collector(); - stream.pipe(collector); - stream.on("error", (err) => { - collector.end(); - reject(err); - }); - collector.on("error", reject); - collector.on("finish", function() { - const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); - resolve(bytes); - }); - }); - }, "streamCollector"); - var isReadableStreamInstance = /* @__PURE__ */ __name((stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream, "isReadableStreamInstance"); - async function collectReadableStream(stream) { - const chunks = []; - const reader = stream.getReader(); - let isDone = false; - let length = 0; - while (!isDone) { - const { done, value } = await reader.read(); - if (value) { - chunks.push(value); - length += value.length; - } - isDone = done; - } - const collected = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - collected.set(chunk, offset); - offset += chunk.length; - } - return collected; - } - __name(collectReadableStream, "collectReadableStream"); - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js -var require_dist_cjs34 = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - FetchHttpHandler: () => FetchHttpHandler, - keepAliveSupport: () => keepAliveSupport, - streamCollector: () => streamCollector - }); - module2.exports = __toCommonJS2(src_exports); - var import_protocol_http8 = require_dist_cjs30(); - var import_querystring_builder = require_dist_cjs32(); - function requestTimeout(timeoutInMs = 0) { - return new Promise((resolve, reject) => { - if (timeoutInMs) { - setTimeout(() => { - const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); - timeoutError.name = "TimeoutError"; - reject(timeoutError); - }, timeoutInMs); - } - }); - } - __name(requestTimeout, "requestTimeout"); - var keepAliveSupport = { - supported: void 0 - }; - var _FetchHttpHandler = class _FetchHttpHandler2 { - /** - * @returns the input if it is an HttpHandler of any class, - * or instantiates a new instance of this handler. - */ - static create(instanceOrOptions) { - if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new _FetchHttpHandler2(instanceOrOptions); - } - constructor(options) { - if (typeof options === "function") { - this.configProvider = options().then((opts) => opts || {}); - } else { - this.config = options ?? {}; - this.configProvider = Promise.resolve(this.config); - } - if (keepAliveSupport.supported === void 0) { - keepAliveSupport.supported = Boolean( - typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]") - ); - } - } - destroy() { - } - async handle(request2, { abortSignal } = {}) { - var _a; - if (!this.config) { - this.config = await this.configProvider; - } - const requestTimeoutInMs = this.config.requestTimeout; - const keepAlive = this.config.keepAlive === true; - const credentials = this.config.credentials; - if (abortSignal == null ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - return Promise.reject(abortError); - } - let path = request2.path; - const queryString = (0, import_querystring_builder.buildQueryString)(request2.query || {}); - if (queryString) { - path += `?${queryString}`; - } - if (request2.fragment) { - path += `#${request2.fragment}`; - } - let auth = ""; - if (request2.username != null || request2.password != null) { - const username = request2.username ?? ""; - const password = request2.password ?? ""; - auth = `${username}:${password}@`; - } - const { port, method } = request2; - const url2 = `${request2.protocol}//${auth}${request2.hostname}${port ? `:${port}` : ""}${path}`; - const body = method === "GET" || method === "HEAD" ? void 0 : request2.body; - const requestOptions = { - body, - headers: new Headers(request2.headers), - method, - credentials - }; - if ((_a = this.config) == null ? void 0 : _a.cache) { - requestOptions.cache = this.config.cache; - } - if (body) { - requestOptions.duplex = "half"; - } - if (typeof AbortController !== "undefined") { - requestOptions.signal = abortSignal; - } - if (keepAliveSupport.supported) { - requestOptions.keepalive = keepAlive; - } - if (typeof this.config.requestInit === "function") { - Object.assign(requestOptions, this.config.requestInit(request2)); - } - let removeSignalEventListener = /* @__PURE__ */ __name(() => { - }, "removeSignalEventListener"); - const fetchRequest = new Request(url2, requestOptions); - const raceOfPromises = [ - fetch(fetchRequest).then((response) => { - const fetchHeaders = response.headers; - const transformedHeaders = {}; - for (const pair of fetchHeaders.entries()) { - transformedHeaders[pair[0]] = pair[1]; - } - const hasReadableStream = response.body != void 0; - if (!hasReadableStream) { - return response.blob().then((body2) => ({ - response: new import_protocol_http8.HttpResponse({ - headers: transformedHeaders, - reason: response.statusText, - statusCode: response.status, - body: body2 - }) - })); - } - return { - response: new import_protocol_http8.HttpResponse({ - headers: transformedHeaders, - reason: response.statusText, - statusCode: response.status, - body: response.body - }) - }; - }), - requestTimeout(requestTimeoutInMs) - ]; - if (abortSignal) { - raceOfPromises.push( - new Promise((resolve, reject) => { - const onAbort = /* @__PURE__ */ __name(() => { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }, "onAbort"); - if (typeof abortSignal.addEventListener === "function") { - const signal = abortSignal; - signal.addEventListener("abort", onAbort, { once: true }); - removeSignalEventListener = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "removeSignalEventListener"); - } else { - abortSignal.onabort = onAbort; - } - }) - ); - } - return Promise.race(raceOfPromises).finally(removeSignalEventListener); - } - updateHttpClientConfig(key, value) { - this.config = void 0; - this.configProvider = this.configProvider.then((config) => { - config[key] = value; - return config; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - }; - __name(_FetchHttpHandler, "FetchHttpHandler"); - var FetchHttpHandler = _FetchHttpHandler; - var import_util_base64 = require_dist_cjs29(); - var streamCollector = /* @__PURE__ */ __name((stream) => { - if (typeof Blob === "function" && stream instanceof Blob) { - return collectBlob(stream); - } - return collectStream(stream); - }, "streamCollector"); - async function collectBlob(blob) { - const base64 = await readToBase64(blob); - const arrayBuffer = (0, import_util_base64.fromBase64)(base64); - return new Uint8Array(arrayBuffer); - } - __name(collectBlob, "collectBlob"); - async function collectStream(stream) { - const chunks = []; - const reader = stream.getReader(); - let isDone = false; - let length = 0; - while (!isDone) { - const { done, value } = await reader.read(); - if (value) { - chunks.push(value); - length += value.length; - } - isDone = done; - } - const collected = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - collected.set(chunk, offset); - offset += chunk.length; - } - return collected; - } - __name(collectStream, "collectStream"); - function readToBase64(blob) { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.onloadend = () => { - if (reader.readyState !== 2) { - return reject(new Error("Reader aborted too early")); - } - const result = reader.result ?? ""; - const commaIndex = result.indexOf(","); - const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; - resolve(result.substring(dataOffset)); - }; - reader.onabort = () => reject(new Error("Read aborted")); - reader.onerror = () => reject(reader.error); - reader.readAsDataURL(blob); - }); - } - __name(readToBase64, "readToBase64"); - } -}); - -// ../../../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js -var require_dist_cjs35 = __commonJS({ - "../../../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - fromHex: () => fromHex, - toHex: () => toHex - }); - module2.exports = __toCommonJS2(src_exports); - var SHORT_TO_HEX = {}; - var HEX_TO_SHORT = {}; - for (let i = 0; i < 256; i++) { - let encodedByte = i.toString(16).toLowerCase(); - if (encodedByte.length === 1) { - encodedByte = `0${encodedByte}`; - } - SHORT_TO_HEX[i] = encodedByte; - HEX_TO_SHORT[encodedByte] = i; - } - function fromHex(encoded) { - if (encoded.length % 2 !== 0) { - throw new Error("Hex encoded strings must have an even number length"); - } - const out = new Uint8Array(encoded.length / 2); - for (let i = 0; i < encoded.length; i += 2) { - const encodedByte = encoded.slice(i, i + 2).toLowerCase(); - if (encodedByte in HEX_TO_SHORT) { - out[i / 2] = HEX_TO_SHORT[encodedByte]; - } else { - throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); - } - } - return out; - } - __name(fromHex, "fromHex"); - function toHex(bytes) { - let out = ""; - for (let i = 0; i < bytes.byteLength; i++) { - out += SHORT_TO_HEX[bytes[i]]; - } - return out; - } - __name(toHex, "toHex"); - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js -var require_stream_type_check = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReadableStream = void 0; - var isReadableStream2 = (stream) => { - var _a; - return typeof ReadableStream === "function" && (((_a = stream === null || stream === void 0 ? void 0 : stream.constructor) === null || _a === void 0 ? void 0 : _a.name) === ReadableStream.name || stream instanceof ReadableStream); - }; - exports2.isReadableStream = isReadableStream2; - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js -var require_sdk_stream_mixin_browser = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sdkStreamMixin = void 0; - var fetch_http_handler_1 = require_dist_cjs34(); - var util_base64_1 = require_dist_cjs29(); - var util_hex_encoding_1 = require_dist_cjs35(); - var util_utf8_1 = require_dist_cjs28(); - var stream_type_check_1 = require_stream_type_check(); - var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; - var sdkStreamMixin2 = (stream) => { - var _a, _b; - if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) { - const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; - throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`); - } - let transformed = false; - const transformToByteArray = async () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - return await (0, fetch_http_handler_1.streamCollector)(stream); - }; - const blobToWebStream = (blob) => { - if (typeof blob.stream !== "function") { - throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body"); - } - return blob.stream(); - }; - return Object.assign(stream, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === "base64") { - return (0, util_base64_1.toBase64)(buf); - } else if (encoding === "hex") { - return (0, util_hex_encoding_1.toHex)(buf); - } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { - return (0, util_utf8_1.toUtf8)(buf); - } else if (typeof TextDecoder === "function") { - return new TextDecoder(encoding).decode(buf); - } else { - throw new Error("TextDecoder is not available, please make sure polyfill is provided."); - } - }, - transformToWebStream: () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - if (isBlobInstance(stream)) { - return blobToWebStream(stream); - } else if ((0, stream_type_check_1.isReadableStream)(stream)) { - return stream; - } else { - throw new Error(`Cannot transform payload to web stream, got ${stream}`); - } - } - }); - }; - exports2.sdkStreamMixin = sdkStreamMixin2; - var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob; - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js -var require_sdk_stream_mixin = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sdkStreamMixin = void 0; - var node_http_handler_1 = require_dist_cjs33(); - var util_buffer_from_1 = require_dist_cjs27(); - var stream_1 = require("stream"); - var util_1 = require("util"); - var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser(); - var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; - var sdkStreamMixin2 = (stream) => { - var _a, _b; - if (!(stream instanceof stream_1.Readable)) { - try { - return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream); - } catch (e) { - const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; - throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); - } - } - let transformed = false; - const transformToByteArray = async () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - return await (0, node_http_handler_1.streamCollector)(stream); - }; - return Object.assign(stream, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === void 0 || Buffer.isEncoding(encoding)) { - return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); - } else { - const decoder2 = new util_1.TextDecoder(encoding); - return decoder2.decode(buf); - } - }, - transformToWebStream: () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - if (stream.readableFlowing !== null) { - throw new Error("The stream has been consumed by other callbacks."); - } - if (typeof stream_1.Readable.toWeb !== "function") { - throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available."); - } - transformed = true; - return stream_1.Readable.toWeb(stream); - } - }); - }; - exports2.sdkStreamMixin = sdkStreamMixin2; - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js -var require_splitStream_browser = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.splitStream = void 0; - async function splitStream2(stream) { - if (typeof stream.stream === "function") { - stream = stream.stream(); - } - const readableStream = stream; - return readableStream.tee(); - } - exports2.splitStream = splitStream2; - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/splitStream.js -var require_splitStream = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/splitStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.splitStream = void 0; - var stream_1 = require("stream"); - var splitStream_browser_1 = require_splitStream_browser(); - var stream_type_check_1 = require_stream_type_check(); - async function splitStream2(stream) { - if ((0, stream_type_check_1.isReadableStream)(stream)) { - return (0, splitStream_browser_1.splitStream)(stream); - } - const stream1 = new stream_1.PassThrough(); - const stream2 = new stream_1.PassThrough(); - stream.pipe(stream1); - stream.pipe(stream2); - return [stream1, stream2]; - } - exports2.splitStream = splitStream2; - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js -var require_headStream_browser = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.headStream = void 0; - async function headStream2(stream, bytes) { - var _a; - let byteLengthCounter = 0; - const chunks = []; - const reader = stream.getReader(); - let isDone = false; - while (!isDone) { - const { done, value } = await reader.read(); - if (value) { - chunks.push(value); - byteLengthCounter += (_a = value === null || value === void 0 ? void 0 : value.byteLength) !== null && _a !== void 0 ? _a : 0; - } - if (byteLengthCounter >= bytes) { - break; - } - isDone = done; - } - reader.releaseLock(); - const collected = new Uint8Array(Math.min(bytes, byteLengthCounter)); - let offset = 0; - for (const chunk of chunks) { - if (chunk.byteLength > collected.byteLength - offset) { - collected.set(chunk.subarray(0, collected.byteLength - offset), offset); - break; - } else { - collected.set(chunk, offset); - } - offset += chunk.length; - } - return collected; - } - exports2.headStream = headStream2; - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/headStream.js -var require_headStream = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/headStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.headStream = void 0; - var stream_1 = require("stream"); - var headStream_browser_1 = require_headStream_browser(); - var stream_type_check_1 = require_stream_type_check(); - var headStream2 = (stream, bytes) => { - if ((0, stream_type_check_1.isReadableStream)(stream)) { - return (0, headStream_browser_1.headStream)(stream, bytes); - } - return new Promise((resolve, reject) => { - const collector = new Collector(); - collector.limit = bytes; - stream.pipe(collector); - stream.on("error", (err) => { - collector.end(); - reject(err); - }); - collector.on("error", reject); - collector.on("finish", function() { - const bytes2 = new Uint8Array(Buffer.concat(this.buffers)); - resolve(bytes2); - }); - }); - }; - exports2.headStream = headStream2; - var Collector = class extends stream_1.Writable { - constructor() { - super(...arguments); - this.buffers = []; - this.limit = Infinity; - this.bytesBuffered = 0; - } - _write(chunk, encoding, callback) { - var _a; - this.buffers.push(chunk); - this.bytesBuffered += (_a = chunk.byteLength) !== null && _a !== void 0 ? _a : 0; - if (this.bytesBuffered >= this.limit) { - const excess = this.bytesBuffered - this.limit; - const tailBuffer = this.buffers[this.buffers.length - 1]; - this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess); - this.emit("finish"); - } - callback(); - } - }; - } -}); - -// ../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/index.js -var require_dist_cjs36 = __commonJS({ - "../../../node_modules/@smithy/smithy-client/node_modules/@smithy/util-stream/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - Uint8ArrayBlobAdapter: () => Uint8ArrayBlobAdapter - }); - module2.exports = __toCommonJS2(src_exports); - var import_util_base64 = require_dist_cjs29(); - var import_util_utf8 = require_dist_cjs28(); - function transformToString(payload, encoding = "utf-8") { - if (encoding === "base64") { - return (0, import_util_base64.toBase64)(payload); - } - return (0, import_util_utf8.toUtf8)(payload); - } - __name(transformToString, "transformToString"); - function transformFromString(str, encoding) { - if (encoding === "base64") { - return Uint8ArrayBlobAdapter.mutate((0, import_util_base64.fromBase64)(str)); - } - return Uint8ArrayBlobAdapter.mutate((0, import_util_utf8.fromUtf8)(str)); - } - __name(transformFromString, "transformFromString"); - var _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter2 extends Uint8Array { - /** - * @param source - such as a string or Stream. - * @returns a new Uint8ArrayBlobAdapter extending Uint8Array. - */ - static fromString(source, encoding = "utf-8") { - switch (typeof source) { - case "string": - return transformFromString(source, encoding); - default: - throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); - } - } - /** - * @param source - Uint8Array to be mutated. - * @returns the same Uint8Array but with prototype switched to Uint8ArrayBlobAdapter. - */ - static mutate(source) { - Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter2.prototype); - return source; - } - /** - * @param encoding - default 'utf-8'. - * @returns the blob as string. - */ - transformToString(encoding = "utf-8") { - return transformToString(this, encoding); - } - }; - __name(_Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter"); - var Uint8ArrayBlobAdapter = _Uint8ArrayBlobAdapter; - __reExport(src_exports, require_getAwsChunkedEncodingStream(), module2.exports); - __reExport(src_exports, require_sdk_stream_mixin(), module2.exports); - __reExport(src_exports, require_splitStream(), module2.exports); - __reExport(src_exports, require_headStream(), module2.exports); - __reExport(src_exports, require_stream_type_check(), module2.exports); - } -}); - -// ../../../node_modules/@smithy/smithy-client/dist-cjs/index.js -var require_dist_cjs37 = __commonJS({ - "../../../node_modules/@smithy/smithy-client/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - Client: () => Client, - Command: () => Command, - LazyJsonString: () => LazyJsonString, - NoOpLogger: () => NoOpLogger, - SENSITIVE_STRING: () => SENSITIVE_STRING, - ServiceException: () => ServiceException, - StringWrapper: () => StringWrapper, - _json: () => _json, - collectBody: () => collectBody2, - convertMap: () => convertMap, - createAggregatedClient: () => createAggregatedClient, - dateToUtcString: () => dateToUtcString, - decorateServiceException: () => decorateServiceException, - emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion2, - expectBoolean: () => expectBoolean, - expectByte: () => expectByte, - expectFloat32: () => expectFloat32, - expectInt: () => expectInt, - expectInt32: () => expectInt32, - expectLong: () => expectLong, - expectNonNull: () => expectNonNull, - expectNumber: () => expectNumber, - expectObject: () => expectObject, - expectShort: () => expectShort, - expectString: () => expectString, - expectUnion: () => expectUnion2, - extendedEncodeURIComponent: () => extendedEncodeURIComponent, - getArrayIfSingleItem: () => getArrayIfSingleItem, - getDefaultClientConfiguration: () => getDefaultClientConfiguration, - getDefaultExtensionConfiguration: () => getDefaultExtensionConfiguration, - getValueFromTextNode: () => getValueFromTextNode2, - handleFloat: () => handleFloat, - isSerializableHeaderValue: () => isSerializableHeaderValue, - limitedParseDouble: () => limitedParseDouble, - limitedParseFloat: () => limitedParseFloat, - limitedParseFloat32: () => limitedParseFloat32, - loadConfigsForDefaultMode: () => loadConfigsForDefaultMode, - logger: () => logger, - map: () => map, - parseBoolean: () => parseBoolean, - parseEpochTimestamp: () => parseEpochTimestamp, - parseRfc3339DateTime: () => parseRfc3339DateTime, - parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset, - parseRfc7231DateTime: () => parseRfc7231DateTime, - quoteHeader: () => quoteHeader, - resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig, - resolvedPath: () => resolvedPath2, - serializeDateTime: () => serializeDateTime, - serializeFloat: () => serializeFloat, - splitEvery: () => splitEvery, - splitHeader: () => splitHeader, - strictParseByte: () => strictParseByte, - strictParseDouble: () => strictParseDouble, - strictParseFloat: () => strictParseFloat, - strictParseFloat32: () => strictParseFloat32, - strictParseInt: () => strictParseInt, - strictParseInt32: () => strictParseInt32, - strictParseLong: () => strictParseLong, - strictParseShort: () => strictParseShort, - take: () => take, - throwDefaultError: () => throwDefaultError, - withBaseException: () => withBaseException - }); - module2.exports = __toCommonJS2(src_exports); - var import_middleware_stack = require_dist_cjs25(); - var _Client = class _Client { - constructor(config) { - this.config = config; - this.middlewareStack = (0, import_middleware_stack.constructStack)(); - } - send(command, optionsOrCb, cb) { - const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0; - const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; - const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true; - let handler2; - if (useHandlerCache) { - if (!this.handlers) { - this.handlers = /* @__PURE__ */ new WeakMap(); - } - const handlers = this.handlers; - if (handlers.has(command.constructor)) { - handler2 = handlers.get(command.constructor); - } else { - handler2 = command.resolveMiddleware(this.middlewareStack, this.config, options); - handlers.set(command.constructor, handler2); - } - } else { - delete this.handlers; - handler2 = command.resolveMiddleware(this.middlewareStack, this.config, options); - } - if (callback) { - handler2(command).then( - (result) => callback(null, result.output), - (err) => callback(err) - ).catch( - // prevent any errors thrown in the callback from triggering an - // unhandled promise rejection - () => { - } - ); - } else { - return handler2(command).then((result) => result.output); - } - } - destroy() { - var _a, _b, _c; - (_c = (_b = (_a = this.config) == null ? void 0 : _a.requestHandler) == null ? void 0 : _b.destroy) == null ? void 0 : _c.call(_b); - delete this.handlers; - } - }; - __name(_Client, "Client"); - var Client = _Client; - var import_util_stream = require_dist_cjs36(); - var collectBody2 = /* @__PURE__ */ __name(async (streamBody = new Uint8Array(), context) => { - if (streamBody instanceof Uint8Array) { - return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody); - } - if (!streamBody) { - return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); - } - const fromContext = context.streamCollector(streamBody); - return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext); - }, "collectBody"); - var import_types5 = require_dist_cjs(); - var _Command = class _Command { - constructor() { - this.middlewareStack = (0, import_middleware_stack.constructStack)(); - } - /** - * Factory for Command ClassBuilder. - * @internal - */ - static classBuilder() { - return new ClassBuilder(); - } - /** - * @internal - */ - resolveMiddlewareWithContext(clientStack, configuration, options, { - middlewareFn, - clientName, - commandName, - inputFilterSensitiveLog, - outputFilterSensitiveLog, - smithyContext, - additionalContext, - CommandCtor - }) { - for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { - this.middlewareStack.use(mw); - } - const stack = clientStack.concat(this.middlewareStack); - const { logger: logger2 } = configuration; - const handlerExecutionContext = { - logger: logger2, - clientName, - commandName, - inputFilterSensitiveLog, - outputFilterSensitiveLog, - [import_types5.SMITHY_CONTEXT_KEY]: { - commandInstance: this, - ...smithyContext - }, - ...additionalContext - }; - const { requestHandler } = configuration; - return stack.resolve( - (request2) => requestHandler.handle(request2.request, options || {}), - handlerExecutionContext - ); - } - }; - __name(_Command, "Command"); - var Command = _Command; - var _ClassBuilder = class _ClassBuilder { - constructor() { - this._init = () => { - }; - this._ep = {}; - this._middlewareFn = () => []; - this._commandName = ""; - this._clientName = ""; - this._additionalContext = {}; - this._smithyContext = {}; - this._inputFilterSensitiveLog = (_) => _; - this._outputFilterSensitiveLog = (_) => _; - this._serializer = null; - this._deserializer = null; - } - /** - * Optional init callback. - */ - init(cb) { - this._init = cb; - } - /** - * Set the endpoint parameter instructions. - */ - ep(endpointParameterInstructions) { - this._ep = endpointParameterInstructions; - return this; - } - /** - * Add any number of middleware. - */ - m(middlewareSupplier) { - this._middlewareFn = middlewareSupplier; - return this; - } - /** - * Set the initial handler execution context Smithy field. - */ - s(service, operation, smithyContext = {}) { - this._smithyContext = { - service, - operation, - ...smithyContext - }; - return this; - } - /** - * Set the initial handler execution context. - */ - c(additionalContext = {}) { - this._additionalContext = additionalContext; - return this; - } - /** - * Set constant string identifiers for the operation. - */ - n(clientName, commandName) { - this._clientName = clientName; - this._commandName = commandName; - return this; - } - /** - * Set the input and output sensistive log filters. - */ - f(inputFilter = (_) => _, outputFilter = (_) => _) { - this._inputFilterSensitiveLog = inputFilter; - this._outputFilterSensitiveLog = outputFilter; - return this; - } - /** - * Sets the serializer. - */ - ser(serializer) { - this._serializer = serializer; - return this; - } - /** - * Sets the deserializer. - */ - de(deserializer) { - this._deserializer = deserializer; - return this; - } - /** - * @returns a Command class with the classBuilder properties. - */ - build() { - var _a; - const closure = this; - let CommandRef; - return CommandRef = (_a = class extends Command { - /** - * @public - */ - constructor(...[input]) { - super(); - this.serialize = closure._serializer; - this.deserialize = closure._deserializer; - this.input = input ?? {}; - closure._init(this); - } - /** - * @public - */ - static getEndpointParameterInstructions() { - return closure._ep; - } - /** - * @internal - */ - resolveMiddleware(stack, configuration, options) { - return this.resolveMiddlewareWithContext(stack, configuration, options, { - CommandCtor: CommandRef, - middlewareFn: closure._middlewareFn, - clientName: closure._clientName, - commandName: closure._commandName, - inputFilterSensitiveLog: closure._inputFilterSensitiveLog, - outputFilterSensitiveLog: closure._outputFilterSensitiveLog, - smithyContext: closure._smithyContext, - additionalContext: closure._additionalContext - }); - } - }, __name(_a, "CommandRef"), _a); - } - }; - __name(_ClassBuilder, "ClassBuilder"); - var ClassBuilder = _ClassBuilder; - var SENSITIVE_STRING = "***SensitiveInformation***"; - var createAggregatedClient = /* @__PURE__ */ __name((commands, Client2) => { - for (const command of Object.keys(commands)) { - const CommandCtor = commands[command]; - const methodImpl = /* @__PURE__ */ __name(async function(args, optionsOrCb, cb) { - const command2 = new CommandCtor(args); - if (typeof optionsOrCb === "function") { - this.send(command2, optionsOrCb); - } else if (typeof cb === "function") { - if (typeof optionsOrCb !== "object") - throw new Error(`Expected http options but got ${typeof optionsOrCb}`); - this.send(command2, optionsOrCb || {}, cb); - } else { - return this.send(command2, optionsOrCb); - } - }, "methodImpl"); - const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); - Client2.prototype[methodName] = methodImpl; - } - }, "createAggregatedClient"); - var parseBoolean = /* @__PURE__ */ __name((value) => { - switch (value) { - case "true": - return true; - case "false": - return false; - default: - throw new Error(`Unable to parse boolean value "${value}"`); - } - }, "parseBoolean"); - var expectBoolean = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - if (typeof value === "number") { - if (value === 0 || value === 1) { - logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (value === 0) { - return false; - } - if (value === 1) { - return true; - } - } - if (typeof value === "string") { - const lower = value.toLowerCase(); - if (lower === "false" || lower === "true") { - logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (lower === "false") { - return false; - } - if (lower === "true") { - return true; - } - } - if (typeof value === "boolean") { - return value; - } - throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); - }, "expectBoolean"); - var expectNumber = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - if (typeof value === "string") { - const parsed = parseFloat(value); - if (!Number.isNaN(parsed)) { - if (String(parsed) !== String(value)) { - logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); - } - return parsed; - } - } - if (typeof value === "number") { - return value; - } - throw new TypeError(`Expected number, got ${typeof value}: ${value}`); - }, "expectNumber"); - var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); - var expectFloat32 = /* @__PURE__ */ __name((value) => { - const expected = expectNumber(value); - if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { - if (Math.abs(expected) > MAX_FLOAT) { - throw new TypeError(`Expected 32-bit float, got ${value}`); - } - } - return expected; - }, "expectFloat32"); - var expectLong = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - if (Number.isInteger(value) && !Number.isNaN(value)) { - return value; - } - throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); - }, "expectLong"); - var expectInt = expectLong; - var expectInt32 = /* @__PURE__ */ __name((value) => expectSizedInt(value, 32), "expectInt32"); - var expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), "expectShort"); - var expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), "expectByte"); - var expectSizedInt = /* @__PURE__ */ __name((value, size) => { - const expected = expectLong(value); - if (expected !== void 0 && castInt(expected, size) !== expected) { - throw new TypeError(`Expected ${size}-bit integer, got ${value}`); - } - return expected; - }, "expectSizedInt"); - var castInt = /* @__PURE__ */ __name((value, size) => { - switch (size) { - case 32: - return Int32Array.of(value)[0]; - case 16: - return Int16Array.of(value)[0]; - case 8: - return Int8Array.of(value)[0]; - } - }, "castInt"); - var expectNonNull = /* @__PURE__ */ __name((value, location) => { - if (value === null || value === void 0) { - if (location) { - throw new TypeError(`Expected a non-null value for ${location}`); - } - throw new TypeError("Expected a non-null value"); - } - return value; - }, "expectNonNull"); - var expectObject = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - if (typeof value === "object" && !Array.isArray(value)) { - return value; - } - const receivedType = Array.isArray(value) ? "array" : typeof value; - throw new TypeError(`Expected object, got ${receivedType}: ${value}`); - }, "expectObject"); - var expectString = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - if (typeof value === "string") { - return value; - } - if (["boolean", "number", "bigint"].includes(typeof value)) { - logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); - return String(value); - } - throw new TypeError(`Expected string, got ${typeof value}: ${value}`); - }, "expectString"); - var expectUnion2 = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - const asObject = expectObject(value); - const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k); - if (setKeys.length === 0) { - throw new TypeError(`Unions must have exactly one non-null member. None were found.`); - } - if (setKeys.length > 1) { - throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); - } - return asObject; - }, "expectUnion"); - var strictParseDouble = /* @__PURE__ */ __name((value) => { - if (typeof value == "string") { - return expectNumber(parseNumber(value)); - } - return expectNumber(value); - }, "strictParseDouble"); - var strictParseFloat = strictParseDouble; - var strictParseFloat32 = /* @__PURE__ */ __name((value) => { - if (typeof value == "string") { - return expectFloat32(parseNumber(value)); - } - return expectFloat32(value); - }, "strictParseFloat32"); - var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; - var parseNumber = /* @__PURE__ */ __name((value) => { - const matches = value.match(NUMBER_REGEX); - if (matches === null || matches[0].length !== value.length) { - throw new TypeError(`Expected real number, got implicit NaN`); - } - return parseFloat(value); - }, "parseNumber"); - var limitedParseDouble = /* @__PURE__ */ __name((value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return expectNumber(value); - }, "limitedParseDouble"); - var handleFloat = limitedParseDouble; - var limitedParseFloat = limitedParseDouble; - var limitedParseFloat32 = /* @__PURE__ */ __name((value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return expectFloat32(value); - }, "limitedParseFloat32"); - var parseFloatString = /* @__PURE__ */ __name((value) => { - switch (value) { - case "NaN": - return NaN; - case "Infinity": - return Infinity; - case "-Infinity": - return -Infinity; - default: - throw new Error(`Unable to parse float value: ${value}`); - } - }, "parseFloatString"); - var strictParseLong = /* @__PURE__ */ __name((value) => { - if (typeof value === "string") { - return expectLong(parseNumber(value)); - } - return expectLong(value); - }, "strictParseLong"); - var strictParseInt = strictParseLong; - var strictParseInt32 = /* @__PURE__ */ __name((value) => { - if (typeof value === "string") { - return expectInt32(parseNumber(value)); - } - return expectInt32(value); - }, "strictParseInt32"); - var strictParseShort = /* @__PURE__ */ __name((value) => { - if (typeof value === "string") { - return expectShort(parseNumber(value)); - } - return expectShort(value); - }, "strictParseShort"); - var strictParseByte = /* @__PURE__ */ __name((value) => { - if (typeof value === "string") { - return expectByte(parseNumber(value)); - } - return expectByte(value); - }, "strictParseByte"); - var stackTraceWarning = /* @__PURE__ */ __name((message) => { - return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n"); - }, "stackTraceWarning"); - var logger = { - warn: console.warn - }; - var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; - var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; - function dateToUtcString(date) { - const year = date.getUTCFullYear(); - const month = date.getUTCMonth(); - const dayOfWeek = date.getUTCDay(); - const dayOfMonthInt = date.getUTCDate(); - const hoursInt = date.getUTCHours(); - const minutesInt = date.getUTCMinutes(); - const secondsInt = date.getUTCSeconds(); - const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; - const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; - const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; - const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; - return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; - } - __name(dateToUtcString, "dateToUtcString"); - var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); - var parseRfc3339DateTime = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; - const year = strictParseShort(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); - }, "parseRfc3339DateTime"); - var RFC3339_WITH_OFFSET = new RegExp( - /^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/ - ); - var parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339_WITH_OFFSET.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; - const year = strictParseShort(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); - if (offsetStr.toUpperCase() != "Z") { - date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr)); - } - return date; - }, "parseRfc3339DateTimeWithOffset"); - var IMF_FIXDATE = new RegExp( - /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/ - ); - var RFC_850_DATE = new RegExp( - /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/ - ); - var ASC_TIME = new RegExp( - /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/ - ); - var parseRfc7231DateTime = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - if (typeof value !== "string") { - throw new TypeError("RFC-7231 date-times must be expressed as strings"); - } - let match = IMF_FIXDATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return buildDate( - strictParseShort(stripLeadingZeroes(yearStr)), - parseMonthByShortName(monthStr), - parseDateValue(dayStr, "day", 1, 31), - { hours, minutes, seconds, fractionalMilliseconds } - ); - } - match = RFC_850_DATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return adjustRfc850Year( - buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { - hours, - minutes, - seconds, - fractionalMilliseconds - }) - ); - } - match = ASC_TIME.exec(value); - if (match) { - const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; - return buildDate( - strictParseShort(stripLeadingZeroes(yearStr)), - parseMonthByShortName(monthStr), - parseDateValue(dayStr.trimLeft(), "day", 1, 31), - { hours, minutes, seconds, fractionalMilliseconds } - ); - } - throw new TypeError("Invalid RFC-7231 date-time value"); - }, "parseRfc7231DateTime"); - var parseEpochTimestamp = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return void 0; - } - let valueAsDouble; - if (typeof value === "number") { - valueAsDouble = value; - } else if (typeof value === "string") { - valueAsDouble = strictParseDouble(value); - } else if (typeof value === "object" && value.tag === 1) { - valueAsDouble = value.value; - } else { - throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); - } - if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { - throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); - } - return new Date(Math.round(valueAsDouble * 1e3)); - }, "parseEpochTimestamp"); - var buildDate = /* @__PURE__ */ __name((year, month, day, time) => { - const adjustedMonth = month - 1; - validateDayOfMonth(year, adjustedMonth, day); - return new Date( - Date.UTC( - year, - adjustedMonth, - day, - parseDateValue(time.hours, "hour", 0, 23), - parseDateValue(time.minutes, "minute", 0, 59), - // seconds can go up to 60 for leap seconds - parseDateValue(time.seconds, "seconds", 0, 60), - parseMilliseconds(time.fractionalMilliseconds) - ) - ); - }, "buildDate"); - var parseTwoDigitYear = /* @__PURE__ */ __name((value) => { - const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear(); - const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); - if (valueInThisCentury < thisYear) { - return valueInThisCentury + 100; - } - return valueInThisCentury; - }, "parseTwoDigitYear"); - var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3; - var adjustRfc850Year = /* @__PURE__ */ __name((input) => { - if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) { - return new Date( - Date.UTC( - input.getUTCFullYear() - 100, - input.getUTCMonth(), - input.getUTCDate(), - input.getUTCHours(), - input.getUTCMinutes(), - input.getUTCSeconds(), - input.getUTCMilliseconds() - ) - ); - } - return input; - }, "adjustRfc850Year"); - var parseMonthByShortName = /* @__PURE__ */ __name((value) => { - const monthIdx = MONTHS.indexOf(value); - if (monthIdx < 0) { - throw new TypeError(`Invalid month: ${value}`); - } - return monthIdx + 1; - }, "parseMonthByShortName"); - var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - var validateDayOfMonth = /* @__PURE__ */ __name((year, month, day) => { - let maxDays = DAYS_IN_MONTH[month]; - if (month === 1 && isLeapYear(year)) { - maxDays = 29; - } - if (day > maxDays) { - throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); - } - }, "validateDayOfMonth"); - var isLeapYear = /* @__PURE__ */ __name((year) => { - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); - }, "isLeapYear"); - var parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => { - const dateVal = strictParseByte(stripLeadingZeroes(value)); - if (dateVal < lower || dateVal > upper) { - throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); - } - return dateVal; - }, "parseDateValue"); - var parseMilliseconds = /* @__PURE__ */ __name((value) => { - if (value === null || value === void 0) { - return 0; - } - return strictParseFloat32("0." + value) * 1e3; - }, "parseMilliseconds"); - var parseOffsetToMilliseconds = /* @__PURE__ */ __name((value) => { - const directionStr = value[0]; - let direction = 1; - if (directionStr == "+") { - direction = 1; - } else if (directionStr == "-") { - direction = -1; - } else { - throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); - } - const hour = Number(value.substring(1, 3)); - const minute = Number(value.substring(4, 6)); - return direction * (hour * 60 + minute) * 60 * 1e3; - }, "parseOffsetToMilliseconds"); - var stripLeadingZeroes = /* @__PURE__ */ __name((value) => { - let idx = 0; - while (idx < value.length - 1 && value.charAt(idx) === "0") { - idx++; - } - if (idx === 0) { - return value; - } - return value.slice(idx); - }, "stripLeadingZeroes"); - var _ServiceException = class _ServiceException2 extends Error { - constructor(options) { - super(options.message); - Object.setPrototypeOf(this, _ServiceException2.prototype); - this.name = options.name; - this.$fault = options.$fault; - this.$metadata = options.$metadata; - } - }; - __name(_ServiceException, "ServiceException"); - var ServiceException = _ServiceException; - var decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => { - Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => { - if (exception[k] == void 0 || exception[k] === "") { - exception[k] = v; - } - }); - const message = exception.message || exception.Message || "UnknownError"; - exception.message = message; - delete exception.Message; - return exception; - }, "decorateServiceException"); - var throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => { - const $metadata = deserializeMetadata(output); - const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0; - const response = new exceptionCtor({ - name: (parsedBody == null ? void 0 : parsedBody.code) || (parsedBody == null ? void 0 : parsedBody.Code) || errorCode || statusCode || "UnknownError", - $fault: "client", - $metadata - }); - throw decorateServiceException(response, parsedBody); - }, "throwDefaultError"); - var withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => { - return ({ output, parsedBody, errorCode }) => { - throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); - }; - }, "withBaseException"); - var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ - httpStatusCode: output.statusCode, - requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], - extendedRequestId: output.headers["x-amz-id-2"], - cfId: output.headers["x-amz-cf-id"] - }), "deserializeMetadata"); - var loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => { - switch (mode) { - case "standard": - return { - retryMode: "standard", - connectionTimeout: 3100 - }; - case "in-region": - return { - retryMode: "standard", - connectionTimeout: 1100 - }; - case "cross-region": - return { - retryMode: "standard", - connectionTimeout: 3100 - }; - case "mobile": - return { - retryMode: "standard", - connectionTimeout: 3e4 - }; - default: - return {}; - } - }, "loadConfigsForDefaultMode"); - var warningEmitted2 = false; - var emitWarningIfUnsupportedVersion2 = /* @__PURE__ */ __name((version2) => { - if (version2 && !warningEmitted2 && parseInt(version2.substring(1, version2.indexOf("."))) < 16) { - warningEmitted2 = true; - } - }, "emitWarningIfUnsupportedVersion"); - function extendedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); - } - __name(extendedEncodeURIComponent, "extendedEncodeURIComponent"); - var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - const checksumAlgorithms = []; - for (const id in import_types5.AlgorithmId) { - const algorithmId = import_types5.AlgorithmId[id]; - if (runtimeConfig[algorithmId] === void 0) { - continue; - } - checksumAlgorithms.push({ - algorithmId: () => algorithmId, - checksumConstructor: () => runtimeConfig[algorithmId] - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - } - }; - }, "getChecksumConfiguration"); - var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; - }, "resolveChecksumRuntimeConfig"); - var getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - let _retryStrategy = runtimeConfig.retryStrategy; - return { - setRetryStrategy(retryStrategy) { - _retryStrategy = retryStrategy; - }, - retryStrategy() { - return _retryStrategy; - } - }; - }, "getRetryConfiguration"); - var resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => { - const runtimeConfig = {}; - runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); - return runtimeConfig; - }, "resolveRetryRuntimeConfig"); - var getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - return { - ...getChecksumConfiguration(runtimeConfig), - ...getRetryConfiguration(runtimeConfig) - }; - }, "getDefaultExtensionConfiguration"); - var getDefaultClientConfiguration = getDefaultExtensionConfiguration; - var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { - return { - ...resolveChecksumRuntimeConfig(config), - ...resolveRetryRuntimeConfig(config) - }; - }, "resolveDefaultRuntimeConfig"); - var getArrayIfSingleItem = /* @__PURE__ */ __name((mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray], "getArrayIfSingleItem"); - var getValueFromTextNode2 = /* @__PURE__ */ __name((obj) => { - const textNodeName = "#text"; - for (const key in obj) { - if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) { - obj[key] = obj[key][textNodeName]; - } else if (typeof obj[key] === "object" && obj[key] !== null) { - obj[key] = getValueFromTextNode2(obj[key]); + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; } - } - return obj; - }, "getValueFromTextNode"); - var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => { - return value != null; - }, "isSerializableHeaderValue"); - var StringWrapper = /* @__PURE__ */ __name(function() { - const Class = Object.getPrototypeOf(this).constructor; - const Constructor = Function.bind.apply(String, [null, ...arguments]); - const instance = new Constructor(); - Object.setPrototypeOf(instance, Class.prototype); - return instance; - }, "StringWrapper"); - StringWrapper.prototype = Object.create(String.prototype, { - constructor: { - value: StringWrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - Object.setPrototypeOf(StringWrapper, String); - var _LazyJsonString = class _LazyJsonString2 extends StringWrapper { - deserializeJSON() { - return JSON.parse(super.toString()); - } - toJSON() { - return super.toString(); - } - static fromObject(object) { - if (object instanceof _LazyJsonString2) { - return object; - } else if (object instanceof String || typeof object === "string") { - return new _LazyJsonString2(object); + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; + const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + (_c = logger == null ? void 0 : logger.warn) == null ? void 0 : _c.call( + logger, + `@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued. +See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html +or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.` + ); + return Date.now(); + } + } } - return new _LazyJsonString2(JSON.stringify(object)); - } - }; - __name(_LazyJsonString, "LazyJsonString"); - var LazyJsonString = _LazyJsonString; - var _NoOpLogger = class _NoOpLogger { - trace() { - } - debug() { - } - info() { - } - warn() { + return socketWarningTimestamp; } - error() { + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout ?? socketTimeout, + httpAgent: (() => { + if (httpAgent instanceof import_http2.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { + return httpAgent; + } + return new import_http2.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { + return httpsAgent; + } + return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })(), + logger: console + }; } - }; - __name(_NoOpLogger, "NoOpLogger"); - var NoOpLogger = _NoOpLogger; - function map(arg0, arg1, arg2) { - let target; - let filter; - let instructions; - if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { - target = {}; - instructions = arg0; - } else { - target = arg0; - if (typeof arg1 === "function") { - filter = arg1; - instructions = arg2; - return mapWithFilter(target, filter, instructions); - } else { - instructions = arg1; - } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); + (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); } - for (const key of Object.keys(instructions)) { - if (!Array.isArray(instructions[key])) { - target[key] = instructions[key]; - continue; + async handle(request2, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; } - applyInstruction(target, null, instructions, key); - } - return target; - } - __name(map, "map"); - var convertMap = /* @__PURE__ */ __name((target) => { - const output = {}; - for (const [k, v] of Object.entries(target || {})) { - output[k] = [, v]; - } - return output; - }, "convertMap"); - var take = /* @__PURE__ */ __name((source, instructions) => { - const out = {}; - for (const key in instructions) { - applyInstruction(out, source, instructions, key); - } - return out; - }, "take"); - var mapWithFilter = /* @__PURE__ */ __name((target, filter, instructions) => { - return map( - target, - Object.entries(instructions).reduce( - (_instructions, [key, value]) => { - if (Array.isArray(value)) { - _instructions[key] = value; + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + const timeouts = []; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(clearTimeout); + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(clearTimeout); + _reject(arg); + }, "reject"); + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request2.protocol === "https:"; + const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; + timeouts.push( + setTimeout( + () => { + this.socketWarningTimestamp = _NodeHttpHandler2.checkSocketUsage( + agent, + this.socketWarningTimestamp, + this.config.logger + ); + }, + this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3) + ) + ); + const queryString = (0, import_querystring_builder.buildQueryString)(request2.query || {}); + let auth = void 0; + if (request2.username != null || request2.password != null) { + const username = request2.username ?? ""; + const password = request2.password ?? ""; + auth = `${username}:${password}`; + } + let path = request2.path; + if (queryString) { + path += `?${queryString}`; + } + if (request2.fragment) { + path += `#${request2.fragment}`; + } + let hostname = request2.hostname ?? ""; + if (hostname[0] === "[" && hostname.endsWith("]")) { + hostname = request2.hostname.slice(1, -1); + } else { + hostname = request2.hostname; + } + const nodeHttpsOptions = { + headers: request2.headers, + host: hostname, + method: request2.method, + path, + port: request2.port, + agent, + auth + }; + const requestFunc = isSSL ? import_https.request : import_http2.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new import_protocol_http8.HttpResponse({ + statusCode: res.statusCode || -1, + reason: res.statusMessage, + headers: getTransformedHeaders(res.headers), + body: res + }); + resolve({ response: httpResponse }); + }); + req.on("error", (err) => { + if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { + reject(Object.assign(err, { name: "TimeoutError" })); } else { - if (typeof value === "function") { - _instructions[key] = [filter, value()]; - } else { - _instructions[key] = [filter, value]; - } + reject(err); + } + }); + if (abortSignal) { + const onAbort = /* @__PURE__ */ __name(() => { + req.destroy(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }, "onAbort"); + if (typeof abortSignal.addEventListener === "function") { + const signal = abortSignal; + signal.addEventListener("abort", onAbort, { once: true }); + req.once("close", () => signal.removeEventListener("abort", onAbort)); + } else { + abortSignal.onabort = onAbort; } - return _instructions; - }, - {} - ) - ); - }, "mapWithFilter"); - var applyInstruction = /* @__PURE__ */ __name((target, source, instructions, targetKey) => { - if (source !== null) { - let instruction = instructions[targetKey]; - if (typeof instruction === "function") { - instruction = [, instruction]; - } - const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; - if (typeof filter2 === "function" && filter2(source[sourceKey]) || typeof filter2 !== "function" && !!filter2) { - target[targetKey] = valueFn(source[sourceKey]); - } - return; + } + timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout)); + timeouts.push(setSocketTimeout(req, reject, this.config.requestTimeout)); + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + timeouts.push( + setSocketKeepAlive(req, { + // @ts-expect-error keepAlive is not public on httpAgent. + keepAlive: httpAgent.keepAlive, + // @ts-expect-error keepAliveMsecs is not public on httpAgent. + keepAliveMsecs: httpAgent.keepAliveMsecs + }) + ); + } + writeRequestBodyPromise = writeRequestBody(req, request2, this.config.requestTimeout).catch((e) => { + timeouts.forEach(clearTimeout); + return _reject(e); + }); + }); } - let [filter, value] = instructions[targetKey]; - if (typeof value === "function") { - let _value; - const defaultFilterPassed = filter === void 0 && (_value = value()) != null; - const customFilterPassed = typeof filter === "function" && !!filter(void 0) || typeof filter !== "function" && !!filter; - if (defaultFilterPassed) { - target[targetKey] = _value; - } else if (customFilterPassed) { - target[targetKey] = value(); - } - } else { - const defaultFilterPassed = filter === void 0 && value != null; - const customFilterPassed = typeof filter === "function" && !!filter(value) || typeof filter !== "function" && !!filter; - if (defaultFilterPassed || customFilterPassed) { - target[targetKey] = value; - } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); } - }, "applyInstruction"); - var nonNullish = /* @__PURE__ */ __name((_) => _ != null, "nonNullish"); - var pass = /* @__PURE__ */ __name((_) => _, "pass"); - function quoteHeader(part) { - if (part.includes(",") || part.includes('"')) { - part = `"${part.replace(/"/g, '\\"')}"`; + httpHandlerConfigs() { + return this.config ?? {}; } - return part; - } - __name(quoteHeader, "quoteHeader"); - var resolvedPath2 = /* @__PURE__ */ __name((resolvedPath22, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { - if (input != null && input[memberName] !== void 0) { - const labelValue = labelValueProvider(); - if (labelValue.length <= 0) { - throw new Error("Empty value provided for input HTTP label: " + memberName + "."); + }; + __name(_NodeHttpHandler, "NodeHttpHandler"); + var NodeHttpHandler = _NodeHttpHandler; + var import_http22 = require("http2"); + var import_http23 = __toESM2(require("http2")); + var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); } - resolvedPath22 = resolvedPath22.replace( - uriLabel, - isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue) - ); - } else { - throw new Error("No value provided for input HTTP label: " + memberName + "."); } - return resolvedPath22; - }, "resolvedPath"); - var serializeFloat = /* @__PURE__ */ __name((value) => { - if (value !== value) { - return "NaN"; + offerLast(session) { + this.sessions.push(session); } - switch (value) { - case Infinity: - return "Infinity"; - case -Infinity: - return "-Infinity"; - default: - return value; + contains(session) { + return this.sessions.includes(session); } - }, "serializeFloat"); - var serializeDateTime = /* @__PURE__ */ __name((date) => date.toISOString().replace(".000Z", "Z"), "serializeDateTime"); - var _json = /* @__PURE__ */ __name((obj) => { - if (obj == null) { - return {}; + remove(session) { + this.sessions = this.sessions.filter((s) => s !== session); } - if (Array.isArray(obj)) { - return obj.filter((_) => _ != null).map(_json); + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); } - if (typeof obj === "object") { - const target = {}; - for (const key of Object.keys(obj)) { - if (obj[key] == null) { - continue; + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); + } } - target[key] = _json(obj[key]); } - return target; - } - return obj; - }, "_json"); - function splitEvery(value, delimiter, numDelimiters) { - if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { - throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); - } - const segments = value.split(delimiter); - if (numDelimiters === 1) { - return segments; } - const compoundSegments = []; - let currentSegment = ""; - for (let i = 0; i < segments.length; i++) { - if (currentSegment === "") { - currentSegment = segments[i]; - } else { - currentSegment += delimiter + segments[i]; - } - if ((i + 1) % numDelimiters === 0) { - compoundSegments.push(currentSegment); - currentSegment = ""; + }; + __name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); + var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; + var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = /* @__PURE__ */ new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); } } - if (currentSegment !== "") { - compoundSegments.push(currentSegment); - } - return compoundSegments; - } - __name(splitEvery, "splitEvery"); - var splitHeader = /* @__PURE__ */ __name((value) => { - const z = value.length; - const values = []; - let withinQuotes = false; - let prevChar = void 0; - let anchor = 0; - for (let i = 0; i < z; ++i) { - const char = value[i]; - switch (char) { - case `"`: - if (prevChar !== "\\") { - withinQuotes = !withinQuotes; - } - break; - case ",": - if (!withinQuotes) { - values.push(value.slice(anchor, i)); - anchor = i + 1; + lease(requestContext, connectionConfiguration) { + const url2 = this.getUrlString(requestContext); + const existingPool = this.sessionCache.get(url2); + if (existingPool) { + const existingSession = existingPool.poll(); + if (existingSession && !this.config.disableConcurrency) { + return existingSession; + } + } + const session = import_http23.default.connect(url2); + if (this.config.maxConcurrency) { + session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => { + if (err) { + throw new Error( + "Fail to set maxConcurrentStreams to " + this.config.maxConcurrency + "when creating new session for " + requestContext.destination.toString() + ); } - break; - default: + }); } - prevChar = char; + session.unref(); + const destroySessionCb = /* @__PURE__ */ __name(() => { + session.destroy(); + this.deleteSession(url2, session); + }, "destroySessionCb"); + session.on("goaway", destroySessionCb); + session.on("error", destroySessionCb); + session.on("frameError", destroySessionCb); + session.on("close", () => this.deleteSession(url2, session)); + if (connectionConfiguration.requestTimeout) { + session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); + } + const connectionPool = this.sessionCache.get(url2) || new NodeHttp2ConnectionPool(); + connectionPool.offerLast(session); + this.sessionCache.set(url2, connectionPool); + return session; } - values.push(value.slice(anchor)); - return values.map((v) => { - v = v.trim(); - const z2 = v.length; - if (z2 < 2) { - return v; + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; } - if (v[0] === `"` && v[z2 - 1] === `"`) { - v = v.slice(1, z2 - 1); + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); } - return v.replace(/\\"/g, '"'); - }); - }, "splitHeader"); - } -}); - -// ../../../node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js -var require_isStreamingPayload = __commonJS({ - "../../../node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isStreamingPayload = void 0; - var stream_1 = require("stream"); - var isStreamingPayload = (request2) => (request2 === null || request2 === void 0 ? void 0 : request2.body) instanceof stream_1.Readable || typeof ReadableStream !== "undefined" && (request2 === null || request2 === void 0 ? void 0 : request2.body) instanceof ReadableStream; - exports2.isStreamingPayload = isStreamingPayload; - } -}); - -// ../../../node_modules/@smithy/middleware-retry/dist-cjs/index.js -var require_dist_cjs38 = __commonJS({ - "../../../node_modules/@smithy/middleware-retry/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - AdaptiveRetryStrategy: () => AdaptiveRetryStrategy, - CONFIG_MAX_ATTEMPTS: () => CONFIG_MAX_ATTEMPTS, - CONFIG_RETRY_MODE: () => CONFIG_RETRY_MODE, - ENV_MAX_ATTEMPTS: () => ENV_MAX_ATTEMPTS, - ENV_RETRY_MODE: () => ENV_RETRY_MODE, - NODE_MAX_ATTEMPT_CONFIG_OPTIONS: () => NODE_MAX_ATTEMPT_CONFIG_OPTIONS, - NODE_RETRY_MODE_CONFIG_OPTIONS: () => NODE_RETRY_MODE_CONFIG_OPTIONS, - StandardRetryStrategy: () => StandardRetryStrategy, - defaultDelayDecider: () => defaultDelayDecider, - defaultRetryDecider: () => defaultRetryDecider, - getOmitRetryHeadersPlugin: () => getOmitRetryHeadersPlugin, - getRetryAfterHint: () => getRetryAfterHint, - getRetryPlugin: () => getRetryPlugin, - omitRetryHeadersMiddleware: () => omitRetryHeadersMiddleware, - omitRetryHeadersMiddlewareOptions: () => omitRetryHeadersMiddlewareOptions, - resolveRetryConfig: () => resolveRetryConfig, - retryMiddleware: () => retryMiddleware, - retryMiddlewareOptions: () => retryMiddlewareOptions2 - }); - module2.exports = __toCommonJS2(src_exports); - var import_protocol_http8 = require_dist_cjs21(); - var import_uuid = (init_esm_node(), __toCommonJS(esm_node_exports)); - var import_util_retry = require_dist_cjs23(); - var getDefaultRetryQuota = /* @__PURE__ */ __name((initialRetryTokens, options) => { - const MAX_CAPACITY = initialRetryTokens; - const noRetryIncrement = (options == null ? void 0 : options.noRetryIncrement) ?? import_util_retry.NO_RETRY_INCREMENT; - const retryCost = (options == null ? void 0 : options.retryCost) ?? import_util_retry.RETRY_COST; - const timeoutRetryCost = (options == null ? void 0 : options.timeoutRetryCost) ?? import_util_retry.TIMEOUT_RETRY_COST; - let availableCapacity = initialRetryTokens; - const getCapacityAmount = /* @__PURE__ */ __name((error) => error.name === "TimeoutError" ? timeoutRetryCost : retryCost, "getCapacityAmount"); - const hasRetryTokens = /* @__PURE__ */ __name((error) => getCapacityAmount(error) <= availableCapacity, "hasRetryTokens"); - const retrieveRetryTokens = /* @__PURE__ */ __name((error) => { - if (!hasRetryTokens(error)) { - throw new Error("No retry token available"); + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); } - const capacityAmount = getCapacityAmount(error); - availableCapacity -= capacityAmount; - return capacityAmount; - }, "retrieveRetryTokens"); - const releaseRetryTokens = /* @__PURE__ */ __name((capacityReleaseAmount) => { - availableCapacity += capacityReleaseAmount ?? noRetryIncrement; - availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); - }, "releaseRetryTokens"); - return Object.freeze({ - hasRetryTokens, - retrieveRetryTokens, - releaseRetryTokens - }); - }, "getDefaultRetryQuota"); - var defaultDelayDecider = /* @__PURE__ */ __name((delayBase, attempts) => Math.floor(Math.min(import_util_retry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)), "defaultDelayDecider"); - var import_service_error_classification = require_dist_cjs22(); - var defaultRetryDecider = /* @__PURE__ */ __name((error) => { - if (!error) { - return false; + this.config.maxConcurrency = maxConcurrentStreams; } - return (0, import_service_error_classification.isRetryableByTrait)(error) || (0, import_service_error_classification.isClockSkewError)(error) || (0, import_service_error_classification.isThrottlingError)(error) || (0, import_service_error_classification.isTransientError)(error); - }, "defaultRetryDecider"); - var asSdkError = /* @__PURE__ */ __name((error) => { - if (error instanceof Error) - return error; - if (error instanceof Object) - return Object.assign(new Error(), error); - if (typeof error === "string") - return new Error(error); - return new Error(`AWS SDK error wrapper for ${error}`); - }, "asSdkError"); - var _StandardRetryStrategy = class _StandardRetryStrategy { - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - this.mode = import_util_retry.RETRY_MODES.STANDARD; - this.retryDecider = (options == null ? void 0 : options.retryDecider) ?? defaultRetryDecider; - this.delayDecider = (options == null ? void 0 : options.delayDecider) ?? defaultDelayDecider; - this.retryQuota = (options == null ? void 0 : options.retryQuota) ?? getDefaultRetryQuota(import_util_retry.INITIAL_RETRY_TOKENS); + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; } - shouldRetry(error, attempts, maxAttempts) { - return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); + getUrlString(request2) { + return request2.destination.toString(); } - async getMaxAttempts() { - let maxAttempts; - try { - maxAttempts = await this.maxAttemptsProvider(); - } catch (error) { - maxAttempts = import_util_retry.DEFAULT_MAX_ATTEMPTS; + }; + __name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); + var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; + var _NodeHttp2Handler = class _NodeHttp2Handler2 { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; } - return maxAttempts; + return new _NodeHttp2Handler2(instanceOrOptions); } - async retry(next, args, options) { - let retryTokenAmount; - let attempts = 0; - let totalDelay = 0; - const maxAttempts = await this.getMaxAttempts(); - const { request: request2 } = args; - if (import_protocol_http8.HttpRequest.isInstance(request2)) { - request2.headers[import_util_retry.INVOCATION_ID_HEADER] = (0, import_uuid.v4)(); + destroy() { + this.connectionManager.destroy(); + } + async handle(request2, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } } - while (true) { - try { - if (import_protocol_http8.HttpRequest.isInstance(request2)) { - request2.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - if (options == null ? void 0 : options.beforeRequest) { - await options.beforeRequest(); - } - const { response, output } = await next(args); - if (options == null ? void 0 : options.afterRequest) { - options.afterRequest(response); + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a; + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (abortSignal == null ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = request2; + let auth = ""; + if (request2.username != null || request2.password != null) { + const username = request2.username ?? ""; + const password = request2.password ?? ""; + auth = `${username}:${password}@`; + } + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: (_a = this.config) == null ? void 0 : _a.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = /* @__PURE__ */ __name((err) => { + if (disableConcurrentStreams) { + this.destroySession(session); } - this.retryQuota.releaseRetryTokens(retryTokenAmount); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalDelay; - return { response, output }; - } catch (e) { - const err = asSdkError(e); - attempts++; - if (this.shouldRetry(err, attempts, maxAttempts)) { - retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); - const delayFromDecider = this.delayDecider( - (0, import_service_error_classification.isThrottlingError)(err) ? import_util_retry.THROTTLING_RETRY_DELAY_BASE : import_util_retry.DEFAULT_RETRY_DELAY_BASE, - attempts - ); - const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); - const delay = Math.max(delayFromResponse || 0, delayFromDecider); - totalDelay += delay; - await new Promise((resolve) => setTimeout(resolve, delay)); - continue; + fulfilled = true; + reject(err); + }, "rejectWithDestroy"); + const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); + let path = request2.path; + if (queryString) { + path += `?${queryString}`; + } + if (request2.fragment) { + path += `#${request2.fragment}`; + } + const req = session.request({ + ...request2.headers, + [import_http22.constants.HTTP2_HEADER_PATH]: path, + [import_http22.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new import_protocol_http8.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); } - if (!err.$metadata) { - err.$metadata = {}; + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + const onAbort = /* @__PURE__ */ __name(() => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }, "onAbort"); + if (typeof abortSignal.addEventListener === "function") { + const signal = abortSignal; + signal.addEventListener("abort", onAbort, { once: true }); + req.once("close", () => signal.removeEventListener("abort", onAbort)); + } else { + abortSignal.onabort = onAbort; } - err.$metadata.attempts = attempts; - err.$metadata.totalRetryDelay = totalDelay; - throw err; } - } - } - }; - __name(_StandardRetryStrategy, "StandardRetryStrategy"); - var StandardRetryStrategy = _StandardRetryStrategy; - var getDelayFromRetryAfterHeader = /* @__PURE__ */ __name((response) => { - if (!import_protocol_http8.HttpResponse.isInstance(response)) - return; - const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); - if (!retryAfterHeaderName) - return; - const retryAfter = response.headers[retryAfterHeaderName]; - const retryAfterSeconds = Number(retryAfter); - if (!Number.isNaN(retryAfterSeconds)) - return retryAfterSeconds * 1e3; - const retryAfterDate = new Date(retryAfter); - return retryAfterDate.getTime() - Date.now(); - }, "getDelayFromRetryAfterHeader"); - var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy extends StandardRetryStrategy { - constructor(maxAttemptsProvider, options) { - const { rateLimiter, ...superOptions } = options ?? {}; - super(maxAttemptsProvider, superOptions); - this.rateLimiter = rateLimiter ?? new import_util_retry.DefaultRateLimiter(); - this.mode = import_util_retry.RETRY_MODES.ADAPTIVE; + req.on("frameError", (type, code, id) => { + rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); + }); + req.on("error", rejectWithDestroy); + req.on("aborted", () => { + rejectWithDestroy( + new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`) + ); + }); + req.on("close", () => { + session.unref(); + if (disableConcurrentStreams) { + session.destroy(); + } + if (!fulfilled) { + rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); + } + }); + writeRequestBodyPromise = writeRequestBody(req, request2, requestTimeout); + }); } - async retry(next, args) { - return super.retry(next, args, { - beforeRequest: async () => { - return this.rateLimiter.getSendToken(); - }, - afterRequest: (response) => { - this.rateLimiter.updateClientSendingRate(response); - } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; }); } - }; - __name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); - var AdaptiveRetryStrategy = _AdaptiveRetryStrategy; - var import_util_middleware3 = require_dist_cjs24(); - var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; - var CONFIG_MAX_ATTEMPTS = "max_attempts"; - var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - const value = env[ENV_MAX_ATTEMPTS]; - if (!value) - return void 0; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); - } - return maxAttempt; - }, - configFileSelector: (profile) => { - const value = profile[CONFIG_MAX_ATTEMPTS]; - if (!value) - return void 0; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); - } - return maxAttempt; - }, - default: import_util_retry.DEFAULT_MAX_ATTEMPTS - }; - var resolveRetryConfig = /* @__PURE__ */ __name((input) => { - const { retryStrategy } = input; - const maxAttempts = (0, import_util_middleware3.normalizeProvider)(input.maxAttempts ?? import_util_retry.DEFAULT_MAX_ATTEMPTS); - return { - ...input, - maxAttempts, - retryStrategy: async () => { - if (retryStrategy) { - return retryStrategy; - } - const retryMode = await (0, import_util_middleware3.normalizeProvider)(input.retryMode)(); - if (retryMode === import_util_retry.RETRY_MODES.ADAPTIVE) { - return new import_util_retry.AdaptiveRetryStrategy(maxAttempts); - } - return new import_util_retry.StandardRetryStrategy(maxAttempts); + httpHandlerConfigs() { + return this.config ?? {}; + } + /** + * Destroys a session. + * @param session The session to destroy. + */ + destroySession(session) { + if (!session.destroyed) { + session.destroy(); } - }; - }, "resolveRetryConfig"); - var ENV_RETRY_MODE = "AWS_RETRY_MODE"; - var CONFIG_RETRY_MODE = "retry_mode"; - var NODE_RETRY_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[ENV_RETRY_MODE], - configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], - default: import_util_retry.DEFAULT_RETRY_MODE + } }; - var omitRetryHeadersMiddleware = /* @__PURE__ */ __name(() => (next) => async (args) => { - const { request: request2 } = args; - if (import_protocol_http8.HttpRequest.isInstance(request2)) { - delete request2.headers[import_util_retry.INVOCATION_ID_HEADER]; - delete request2.headers[import_util_retry.REQUEST_HEADER]; + __name(_NodeHttp2Handler, "NodeHttp2Handler"); + var NodeHttp2Handler = _NodeHttp2Handler; + var _Collector = class _Collector extends import_stream.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); } - return next(args); - }, "omitRetryHeadersMiddleware"); - var omitRetryHeadersMiddlewareOptions = { - name: "omitRetryHeadersMiddleware", - tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], - relation: "before", - toMiddleware: "awsAuthMiddleware", - override: true }; - var getOmitRetryHeadersPlugin = /* @__PURE__ */ __name((options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); + __name(_Collector, "Collector"); + var Collector = _Collector; + var streamCollector = /* @__PURE__ */ __name((stream) => { + if (isReadableStreamInstance(stream)) { + return collectReadableStream(stream); } - }), "getOmitRetryHeadersPlugin"); - var import_smithy_client5 = require_dist_cjs37(); - var import_isStreamingPayload = require_isStreamingPayload(); - var retryMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => { - var _a; - let retryStrategy = await options.retryStrategy(); - const maxAttempts = await options.maxAttempts(); - if (isRetryStrategyV2(retryStrategy)) { - retryStrategy = retryStrategy; - let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); - let lastError = new Error(); - let attempts = 0; - let totalRetryDelay = 0; - const { request: request2 } = args; - const isRequest = import_protocol_http8.HttpRequest.isInstance(request2); - if (isRequest) { - request2.headers[import_util_retry.INVOCATION_ID_HEADER] = (0, import_uuid.v4)(); - } - while (true) { - try { - if (isRequest) { - request2.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - const { response, output } = await next(args); - retryStrategy.recordSuccess(retryToken); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalRetryDelay; - return { response, output }; - } catch (e) { - const retryErrorInfo = getRetryErrorInfo(e); - lastError = asSdkError(e); - if (isRequest && (0, import_isStreamingPayload.isStreamingPayload)(request2)) { - (_a = context.logger instanceof import_smithy_client5.NoOpLogger ? console : context.logger) == null ? void 0 : _a.warn( - "An error was encountered in a non-retryable streaming request." - ); - throw lastError; - } - try { - retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); - } catch (refreshError) { - if (!lastError.$metadata) { - lastError.$metadata = {}; - } - lastError.$metadata.attempts = attempts + 1; - lastError.$metadata.totalRetryDelay = totalRetryDelay; - throw lastError; - } - attempts = retryToken.getRetryCount(); - const delay = retryToken.getRetryDelay(); - totalRetryDelay += delay; - await new Promise((resolve) => setTimeout(resolve, delay)); - } + return new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); + }); + }, "streamCollector"); + var isReadableStreamInstance = /* @__PURE__ */ __name((stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream, "isReadableStreamInstance"); + async function collectReadableStream(stream) { + const chunks = []; + const reader = stream.getReader(); + let isDone = false; + let length = 0; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + chunks.push(value); + length += value.length; } - } else { - retryStrategy = retryStrategy; - if (retryStrategy == null ? void 0 : retryStrategy.mode) - context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; - return retryStrategy.retry(next, args); - } - }, "retryMiddleware"); - var isRetryStrategyV2 = /* @__PURE__ */ __name((retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined", "isRetryStrategyV2"); - var getRetryErrorInfo = /* @__PURE__ */ __name((error) => { - const errorInfo = { - error, - errorType: getRetryErrorType(error) - }; - const retryAfterHint = getRetryAfterHint(error.$response); - if (retryAfterHint) { - errorInfo.retryAfterHint = retryAfterHint; + isDone = done; } - return errorInfo; - }, "getRetryErrorInfo"); - var getRetryErrorType = /* @__PURE__ */ __name((error) => { - if ((0, import_service_error_classification.isThrottlingError)(error)) - return "THROTTLING"; - if ((0, import_service_error_classification.isTransientError)(error)) - return "TRANSIENT"; - if ((0, import_service_error_classification.isServerError)(error)) - return "SERVER_ERROR"; - return "CLIENT_ERROR"; - }, "getRetryErrorType"); - var retryMiddlewareOptions2 = { - name: "retryMiddleware", - tags: ["RETRY"], - step: "finalizeRequest", - priority: "high", - override: true - }; - var getRetryPlugin = /* @__PURE__ */ __name((options) => ({ - applyToStack: (clientStack) => { - clientStack.add(retryMiddleware(options), retryMiddlewareOptions2); + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; } - }), "getRetryPlugin"); - var getRetryAfterHint = /* @__PURE__ */ __name((response) => { - if (!import_protocol_http8.HttpResponse.isInstance(response)) - return; - const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); - if (!retryAfterHeaderName) - return; - const retryAfter = response.headers[retryAfterHeaderName]; - const retryAfterSeconds = Number(retryAfter); - if (!Number.isNaN(retryAfterSeconds)) - return new Date(retryAfterSeconds * 1e3); - const retryAfterDate = new Date(retryAfter); - return retryAfterDate; - }, "getRetryAfterHint"); + return collected; + } + __name(collectReadableStream, "collectReadableStream"); } }); -// ../../../node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js -var import_middleware_retry, httpSigningMiddlewareOptions, getHttpSigningPlugin; -var init_getHttpSigningMiddleware = __esm({ - "../../../node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js"() { - import_middleware_retry = __toESM(require_dist_cjs38()); - init_httpSigningMiddleware(); - httpSigningMiddlewareOptions = { - step: "finalizeRequest", - tags: ["HTTP_SIGNING"], - name: "httpSigningMiddleware", - aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], - override: true, - relation: "after", - toMiddleware: import_middleware_retry.retryMiddlewareOptions.name +// ../../../node_modules/@smithy/util-stream/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +var require_dist_cjs20 = __commonJS({ + "../../../node_modules/@smithy/util-stream/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); }; - getHttpSigningPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions); + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + FetchHttpHandler: () => FetchHttpHandler, + keepAliveSupport: () => keepAliveSupport, + streamCollector: () => streamCollector }); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/middleware-http-signing/index.js -var init_middleware_http_signing = __esm({ - "../../../node_modules/@smithy/core/dist-es/middleware-http-signing/index.js"() { - init_httpSigningMiddleware(); - init_getHttpSigningMiddleware(); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js -var DefaultIdentityProviderConfig; -var init_DefaultIdentityProviderConfig = __esm({ - "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js"() { - DefaultIdentityProviderConfig = class { - constructor(config) { - this.authSchemes = /* @__PURE__ */ new Map(); - for (const [key, value] of Object.entries(config)) { - if (value !== void 0) { - this.authSchemes.set(key, value); - } + module2.exports = __toCommonJS2(src_exports); + var import_protocol_http8 = require_dist_cjs2(); + var import_querystring_builder = require_dist_cjs18(); + function requestTimeout(timeoutInMs = 0) { + return new Promise((resolve, reject) => { + if (timeoutInMs) { + setTimeout(() => { + const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); + timeoutError.name = "TimeoutError"; + reject(timeoutError); + }, timeoutInMs); } - } - getIdentityProvider(schemeId) { - return this.authSchemes.get(schemeId); - } + }); + } + __name(requestTimeout, "requestTimeout"); + var keepAliveSupport = { + supported: void 0 }; - } -}); - -// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js -var import_protocol_http2, import_types3, HttpApiKeyAuthSigner; -var init_httpApiKeyAuth = __esm({ - "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() { - import_protocol_http2 = __toESM(require_dist_cjs20()); - import_types3 = __toESM(require_dist_cjs()); - HttpApiKeyAuthSigner = class { - async sign(httpRequest, identity, signingProperties) { - if (!signingProperties) { - throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"); - } - if (!signingProperties.name) { - throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing"); - } - if (!signingProperties.in) { - throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing"); - } - if (!identity.apiKey) { - throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined"); + var _FetchHttpHandler = class _FetchHttpHandler2 { + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; } - const clonedRequest = import_protocol_http2.HttpRequest.clone(httpRequest); - if (signingProperties.in === import_types3.HttpApiKeyAuthLocation.QUERY) { - clonedRequest.query[signingProperties.name] = identity.apiKey; - } else if (signingProperties.in === import_types3.HttpApiKeyAuthLocation.HEADER) { - clonedRequest.headers[signingProperties.name] = signingProperties.scheme ? `${signingProperties.scheme} ${identity.apiKey}` : identity.apiKey; + return new _FetchHttpHandler2(instanceOrOptions); + } + constructor(options) { + if (typeof options === "function") { + this.configProvider = options().then((opts) => opts || {}); } else { - throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `" + signingProperties.in + "`"); + this.config = options ?? {}; + this.configProvider = Promise.resolve(this.config); } - return clonedRequest; - } - }; - } -}); - -// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js -var import_protocol_http3, HttpBearerAuthSigner; -var init_httpBearerAuth = __esm({ - "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() { - import_protocol_http3 = __toESM(require_dist_cjs20()); - HttpBearerAuthSigner = class { - async sign(httpRequest, identity, signingProperties) { - const clonedRequest = import_protocol_http3.HttpRequest.clone(httpRequest); - if (!identity.token) { - throw new Error("request could not be signed with `token` since the `token` is not defined"); + if (keepAliveSupport.supported === void 0) { + keepAliveSupport.supported = Boolean( + typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]") + ); } - clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; - return clonedRequest; - } - }; - } -}); - -// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js -var NoAuthSigner; -var init_noAuth = __esm({ - "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js"() { - NoAuthSigner = class { - async sign(httpRequest, identity, signingProperties) { - return httpRequest; } - }; - } -}); - -// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js -var init_httpAuthSchemes = __esm({ - "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js"() { - init_httpApiKeyAuth(); - init_httpBearerAuth(); - init_noAuth(); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js -var createIsIdentityExpiredFunction, EXPIRATION_MS, isIdentityExpired, doesIdentityRequireRefresh, memoizeIdentityProvider; -var init_memoizeIdentityProvider = __esm({ - "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js"() { - createIsIdentityExpiredFunction = (expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs; - EXPIRATION_MS = 3e5; - isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); - doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0; - memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => { - if (provider === void 0) { - return void 0; + destroy() { } - const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider; - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = async (options) => { - if (!pending) { - pending = normalizedProvider(options); + async handle(request2, { abortSignal } = {}) { + var _a; + if (!this.config) { + this.config = await this.configProvider; + } + const requestTimeoutInMs = this.config.requestTimeout; + const keepAlive = this.config.keepAlive === true; + const credentials = this.config.credentials; + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return Promise.reject(abortError); } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } finally { - pending = void 0; + let path = request2.path; + const queryString = (0, import_querystring_builder.buildQueryString)(request2.query || {}); + if (queryString) { + path += `?${queryString}`; } - return resolved; - }; - if (isExpired === void 0) { - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(options); - } - return resolved; + if (request2.fragment) { + path += `#${request2.fragment}`; + } + let auth = ""; + if (request2.username != null || request2.password != null) { + const username = request2.username ?? ""; + const password = request2.password ?? ""; + auth = `${username}:${password}@`; + } + const { port, method } = request2; + const url2 = `${request2.protocol}//${auth}${request2.hostname}${port ? `:${port}` : ""}${path}`; + const body = method === "GET" || method === "HEAD" ? void 0 : request2.body; + const requestOptions = { + body, + headers: new Headers(request2.headers), + method, + credentials }; - } - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(options); + if ((_a = this.config) == null ? void 0 : _a.cache) { + requestOptions.cache = this.config.cache; } - if (isConstant) { - return resolved; + if (body) { + requestOptions.duplex = "half"; } - if (!requiresRefresh(resolved)) { - isConstant = true; - return resolved; + if (typeof AbortController !== "undefined") { + requestOptions.signal = abortSignal; } - if (isExpired(resolved)) { - await coalesceProvider(options); - return resolved; + if (keepAliveSupport.supported) { + requestOptions.keepalive = keepAlive; } - return resolved; - }; - }; - } -}); - -// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js -var init_util_identity_and_auth = __esm({ - "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js"() { - init_DefaultIdentityProviderConfig(); - init_httpAuthSchemes(); - init_memoizeIdentityProvider(); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/getSmithyContext.js -var import_types4, getSmithyContext3; -var init_getSmithyContext = __esm({ - "../../../node_modules/@smithy/core/dist-es/getSmithyContext.js"() { - import_types4 = __toESM(require_dist_cjs()); - getSmithyContext3 = (context) => context[import_types4.SMITHY_CONTEXT_KEY] || (context[import_types4.SMITHY_CONTEXT_KEY] = {}); - } -}); - -// ../../../node_modules/@smithy/core/dist-es/normalizeProvider.js -var normalizeProvider; -var init_normalizeProvider = __esm({ - "../../../node_modules/@smithy/core/dist-es/normalizeProvider.js"() { - normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; - }; - } -}); - -// ../../../node_modules/@smithy/core/dist-es/protocols/requestBuilder.js -function requestBuilder(input, context) { - return new RequestBuilder(input, context); -} -var import_protocol_http4, import_smithy_client, RequestBuilder; -var init_requestBuilder = __esm({ - "../../../node_modules/@smithy/core/dist-es/protocols/requestBuilder.js"() { - import_protocol_http4 = __toESM(require_dist_cjs20()); - import_smithy_client = __toESM(require_dist_cjs37()); - RequestBuilder = class { - constructor(input, context) { - this.input = input; - this.context = context; - this.query = {}; - this.method = ""; - this.headers = {}; - this.path = ""; - this.body = null; - this.hostname = ""; - this.resolvePathStack = []; - } - async build() { - const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint(); - this.path = basePath; - for (const resolvePath of this.resolvePathStack) { - resolvePath(this.path); + if (typeof this.config.requestInit === "function") { + Object.assign(requestOptions, this.config.requestInit(request2)); } - return new import_protocol_http4.HttpRequest({ - protocol, - hostname: this.hostname || hostname, - port, - method: this.method, - path: this.path, - query: this.query, - body: this.body, - headers: this.headers - }); - } - hn(hostname) { - this.hostname = hostname; - return this; - } - bp(uriLabel) { - this.resolvePathStack.push((basePath) => { - this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel; - }); - return this; + let removeSignalEventListener = /* @__PURE__ */ __name(() => { + }, "removeSignalEventListener"); + const fetchRequest = new Request(url2, requestOptions); + const raceOfPromises = [ + fetch(fetchRequest).then((response) => { + const fetchHeaders = response.headers; + const transformedHeaders = {}; + for (const pair of fetchHeaders.entries()) { + transformedHeaders[pair[0]] = pair[1]; + } + const hasReadableStream = response.body != void 0; + if (!hasReadableStream) { + return response.blob().then((body2) => ({ + response: new import_protocol_http8.HttpResponse({ + headers: transformedHeaders, + reason: response.statusText, + statusCode: response.status, + body: body2 + }) + })); + } + return { + response: new import_protocol_http8.HttpResponse({ + headers: transformedHeaders, + reason: response.statusText, + statusCode: response.status, + body: response.body + }) + }; + }), + requestTimeout(requestTimeoutInMs) + ]; + if (abortSignal) { + raceOfPromises.push( + new Promise((resolve, reject) => { + const onAbort = /* @__PURE__ */ __name(() => { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }, "onAbort"); + if (typeof abortSignal.addEventListener === "function") { + const signal = abortSignal; + signal.addEventListener("abort", onAbort, { once: true }); + removeSignalEventListener = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "removeSignalEventListener"); + } else { + abortSignal.onabort = onAbort; + } + }) + ); + } + return Promise.race(raceOfPromises).finally(removeSignalEventListener); } - p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { - this.resolvePathStack.push((path) => { - this.path = (0, import_smithy_client.resolvedPath)(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel); + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + config[key] = value; + return config; }); - return this; - } - h(headers) { - this.headers = headers; - return this; - } - q(query) { - this.query = query; - return this; - } - b(body) { - this.body = body; - return this; } - m(method) { - this.method = method; - return this; + httpHandlerConfigs() { + return this.config ?? {}; } }; - } -}); - -// ../../../node_modules/@smithy/core/dist-es/pagination/createPaginator.js -function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { - return async function* paginateOperation(config, input, ...additionalArguments) { - let token = config.startingToken || void 0; - let hasNext = true; - let page; - while (hasNext) { - input[inputTokenName] = token; - if (pageSizeTokenName) { - input[pageSizeTokenName] = input[pageSizeTokenName] ?? config.pageSize; - } - if (config.client instanceof ClientCtor) { - page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments); - } else { - throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); + __name(_FetchHttpHandler, "FetchHttpHandler"); + var FetchHttpHandler = _FetchHttpHandler; + var streamCollector = /* @__PURE__ */ __name(async (stream) => { + if (typeof Blob === "function" && stream instanceof Blob) { + return new Uint8Array(await stream.arrayBuffer()); } - yield page; - const prevToken = token; - token = get(page, outputTokenName); - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return void 0; - }; -} -var makePagedClientRequest, get; -var init_createPaginator = __esm({ - "../../../node_modules/@smithy/core/dist-es/pagination/createPaginator.js"() { - makePagedClientRequest = async (CommandCtor, client, input, ...args) => { - return await client.send(new CommandCtor(input), ...args); - }; - get = (fromObject, path) => { - let cursor = fromObject; - const pathComponents = path.split("."); - for (const step of pathComponents) { - if (!cursor || typeof cursor !== "object") { - return void 0; + return collectStream(stream); + }, "streamCollector"); + async function collectStream(stream) { + const chunks = []; + const reader = stream.getReader(); + let isDone = false; + let length = 0; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + chunks.push(value); + length += value.length; } - cursor = cursor[step]; + isDone = done; } - return cursor; - }; - } -}); - -// ../../../node_modules/@smithy/core/dist-es/index.js -var dist_es_exports = {}; -__export(dist_es_exports, { - DefaultIdentityProviderConfig: () => DefaultIdentityProviderConfig, - EXPIRATION_MS: () => EXPIRATION_MS, - HttpApiKeyAuthSigner: () => HttpApiKeyAuthSigner, - HttpBearerAuthSigner: () => HttpBearerAuthSigner, - NoAuthSigner: () => NoAuthSigner, - RequestBuilder: () => RequestBuilder, - createIsIdentityExpiredFunction: () => createIsIdentityExpiredFunction, - createPaginator: () => createPaginator, - doesIdentityRequireRefresh: () => doesIdentityRequireRefresh, - getHttpAuthSchemeEndpointRuleSetPlugin: () => getHttpAuthSchemeEndpointRuleSetPlugin, - getHttpAuthSchemePlugin: () => getHttpAuthSchemePlugin, - getHttpSigningPlugin: () => getHttpSigningPlugin, - getSmithyContext: () => getSmithyContext3, - httpAuthSchemeEndpointRuleSetMiddlewareOptions: () => httpAuthSchemeEndpointRuleSetMiddlewareOptions, - httpAuthSchemeMiddleware: () => httpAuthSchemeMiddleware, - httpAuthSchemeMiddlewareOptions: () => httpAuthSchemeMiddlewareOptions, - httpSigningMiddleware: () => httpSigningMiddleware, - httpSigningMiddlewareOptions: () => httpSigningMiddlewareOptions, - isIdentityExpired: () => isIdentityExpired, - memoizeIdentityProvider: () => memoizeIdentityProvider, - normalizeProvider: () => normalizeProvider, - requestBuilder: () => requestBuilder -}); -var init_dist_es = __esm({ - "../../../node_modules/@smithy/core/dist-es/index.js"() { - init_middleware_http_auth_scheme(); - init_middleware_http_signing(); - init_util_identity_and_auth(); - init_getSmithyContext(); - init_normalizeProvider(); - init_requestBuilder(); - init_createPaginator(); + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; + } + return collected; + } + __name(collectStream, "collectStream"); } }); -// ../../../node_modules/@smithy/middleware-content-length/dist-cjs/index.js -var require_dist_cjs39 = __commonJS({ - "../../../node_modules/@smithy/middleware-content-length/dist-cjs/index.js"(exports2, module2) { +// ../../../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js +var require_dist_cjs21 = __commonJS({ + "../../../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -9300,454 +4243,455 @@ var require_dist_cjs39 = __commonJS({ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - contentLengthMiddleware: () => contentLengthMiddleware, - contentLengthMiddlewareOptions: () => contentLengthMiddlewareOptions, - getContentLengthPlugin: () => getContentLengthPlugin + fromHex: () => fromHex, + toHex: () => toHex }); module2.exports = __toCommonJS2(src_exports); - var import_protocol_http8 = require_dist_cjs2(); - var CONTENT_LENGTH_HEADER = "content-length"; - function contentLengthMiddleware(bodyLengthChecker) { - return (next) => async (args) => { - const request2 = args.request; - if (import_protocol_http8.HttpRequest.isInstance(request2)) { - const { body, headers } = request2; - if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { - try { - const length = bodyLengthChecker(body); - request2.headers = { - ...request2.headers, - [CONTENT_LENGTH_HEADER]: String(length) - }; - } catch (error) { - } + var SHORT_TO_HEX = {}; + var HEX_TO_SHORT = {}; + for (let i = 0; i < 256; i++) { + let encodedByte = i.toString(16).toLowerCase(); + if (encodedByte.length === 1) { + encodedByte = `0${encodedByte}`; + } + SHORT_TO_HEX[i] = encodedByte; + HEX_TO_SHORT[encodedByte] = i; + } + function fromHex(encoded) { + if (encoded.length % 2 !== 0) { + throw new Error("Hex encoded strings must have an even number length"); + } + const out = new Uint8Array(encoded.length / 2); + for (let i = 0; i < encoded.length; i += 2) { + const encodedByte = encoded.slice(i, i + 2).toLowerCase(); + if (encodedByte in HEX_TO_SHORT) { + out[i / 2] = HEX_TO_SHORT[encodedByte]; + } else { + throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); + } + } + return out; + } + __name(fromHex, "fromHex"); + function toHex(bytes) { + let out = ""; + for (let i = 0; i < bytes.byteLength; i++) { + out += SHORT_TO_HEX[bytes[i]]; + } + return out; + } + __name(toHex, "toHex"); + } +}); + +// ../../../node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js +var require_stream_type_check = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isReadableStream = void 0; + var isReadableStream2 = (stream) => { + var _a; + return typeof ReadableStream === "function" && (((_a = stream === null || stream === void 0 ? void 0 : stream.constructor) === null || _a === void 0 ? void 0 : _a.name) === ReadableStream.name || stream instanceof ReadableStream); + }; + exports2.isReadableStream = isReadableStream2; + } +}); + +// ../../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js +var require_sdk_stream_mixin_browser = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sdkStreamMixin = void 0; + var fetch_http_handler_1 = require_dist_cjs20(); + var util_base64_1 = require_dist_cjs16(); + var util_hex_encoding_1 = require_dist_cjs21(); + var util_utf8_1 = require_dist_cjs15(); + var stream_type_check_1 = require_stream_type_check(); + var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; + var sdkStreamMixin2 = (stream) => { + var _a, _b; + if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) { + const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; + throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`); + } + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + transformed = true; + return await (0, fetch_http_handler_1.streamCollector)(stream); + }; + const blobToWebStream = (blob) => { + if (typeof blob.stream !== "function") { + throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body"); + } + return blob.stream(); + }; + return Object.assign(stream, { + transformToByteArray, + transformToString: async (encoding) => { + const buf = await transformToByteArray(); + if (encoding === "base64") { + return (0, util_base64_1.toBase64)(buf); + } else if (encoding === "hex") { + return (0, util_hex_encoding_1.toHex)(buf); + } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { + return (0, util_utf8_1.toUtf8)(buf); + } else if (typeof TextDecoder === "function") { + return new TextDecoder(encoding).decode(buf); + } else { + throw new Error("TextDecoder is not available, please make sure polyfill is provided."); + } + }, + transformToWebStream: () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + transformed = true; + if (isBlobInstance(stream)) { + return blobToWebStream(stream); + } else if ((0, stream_type_check_1.isReadableStream)(stream)) { + return stream; + } else { + throw new Error(`Cannot transform payload to web stream, got ${stream}`); } } - return next({ - ...args, - request: request2 - }); + }); + }; + exports2.sdkStreamMixin = sdkStreamMixin2; + var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob; + } +}); + +// ../../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js +var require_sdk_stream_mixin = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sdkStreamMixin = void 0; + var node_http_handler_1 = require_dist_cjs19(); + var util_buffer_from_1 = require_dist_cjs14(); + var stream_1 = require("stream"); + var util_1 = require("util"); + var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser(); + var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; + var sdkStreamMixin2 = (stream) => { + var _a, _b; + if (!(stream instanceof stream_1.Readable)) { + try { + return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream); + } catch (e) { + const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; + throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); + } + } + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + transformed = true; + return await (0, node_http_handler_1.streamCollector)(stream); }; - } - __name(contentLengthMiddleware, "contentLengthMiddleware"); - var contentLengthMiddlewareOptions = { - step: "build", - tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], - name: "contentLengthMiddleware", - override: true + return Object.assign(stream, { + transformToByteArray, + transformToString: async (encoding) => { + const buf = await transformToByteArray(); + if (encoding === void 0 || Buffer.isEncoding(encoding)) { + return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); + } else { + const decoder2 = new util_1.TextDecoder(encoding); + return decoder2.decode(buf); + } + }, + transformToWebStream: () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + if (stream.readableFlowing !== null) { + throw new Error("The stream has been consumed by other callbacks."); + } + if (typeof stream_1.Readable.toWeb !== "function") { + throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available."); + } + transformed = true; + return stream_1.Readable.toWeb(stream); + } + }); }; - var getContentLengthPlugin = /* @__PURE__ */ __name((options) => ({ - applyToStack: (clientStack) => { - clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); + exports2.sdkStreamMixin = sdkStreamMixin2; + } +}); + +// ../../../node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js +var require_splitStream_browser = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.splitStream = void 0; + async function splitStream2(stream) { + if (typeof stream.stream === "function") { + stream = stream.stream(); } - }), "getContentLengthPlugin"); + const readableStream = stream; + return readableStream.tee(); + } + exports2.splitStream = splitStream2; } }); -// ../../../node_modules/@smithy/property-provider/dist-cjs/index.js -var require_dist_cjs40 = __commonJS({ - "../../../node_modules/@smithy/property-provider/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); +// ../../../node_modules/@smithy/util-stream/dist-cjs/splitStream.js +var require_splitStream = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/splitStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.splitStream = void 0; + var stream_1 = require("stream"); + var splitStream_browser_1 = require_splitStream_browser(); + var stream_type_check_1 = require_stream_type_check(); + async function splitStream2(stream) { + if ((0, stream_type_check_1.isReadableStream)(stream)) { + return (0, splitStream_browser_1.splitStream)(stream); } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - CredentialsProviderError: () => CredentialsProviderError, - ProviderError: () => ProviderError2, - TokenProviderError: () => TokenProviderError, - chain: () => chain, - fromStatic: () => fromStatic, - memoize: () => memoize - }); - module2.exports = __toCommonJS2(src_exports); - var _ProviderError = class _ProviderError2 extends Error { - constructor(message, options = true) { - var _a; - let logger; - let tryNextLink = true; - if (typeof options === "boolean") { - logger = void 0; - tryNextLink = options; - } else if (options != null && typeof options === "object") { - logger = options.logger; - tryNextLink = options.tryNextLink ?? true; + const stream1 = new stream_1.PassThrough(); + const stream2 = new stream_1.PassThrough(); + stream.pipe(stream1); + stream.pipe(stream2); + return [stream1, stream2]; + } + exports2.splitStream = splitStream2; + } +}); + +// ../../../node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +var require_headStream_browser = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.headStream = void 0; + async function headStream2(stream, bytes) { + var _a; + let byteLengthCounter = 0; + const chunks = []; + const reader = stream.getReader(); + let isDone = false; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + chunks.push(value); + byteLengthCounter += (_a = value === null || value === void 0 ? void 0 : value.byteLength) !== null && _a !== void 0 ? _a : 0; } - super(message); - this.name = "ProviderError"; - this.tryNextLink = tryNextLink; - Object.setPrototypeOf(this, _ProviderError2.prototype); - (_a = logger == null ? void 0 : logger.debug) == null ? void 0 : _a.call(logger, `@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); - } - /** - * @deprecated use new operator. - */ - static from(error, options = true) { - return Object.assign(new this(error.message, options), error); + if (byteLengthCounter >= bytes) { + break; + } + isDone = done; } - }; - __name(_ProviderError, "ProviderError"); - var ProviderError2 = _ProviderError; - var _CredentialsProviderError = class _CredentialsProviderError2 extends ProviderError2 { - /** - * @override - */ - constructor(message, options = true) { - super(message, options); - this.name = "CredentialsProviderError"; - Object.setPrototypeOf(this, _CredentialsProviderError2.prototype); + reader.releaseLock(); + const collected = new Uint8Array(Math.min(bytes, byteLengthCounter)); + let offset = 0; + for (const chunk of chunks) { + if (chunk.byteLength > collected.byteLength - offset) { + collected.set(chunk.subarray(0, collected.byteLength - offset), offset); + break; + } else { + collected.set(chunk, offset); + } + offset += chunk.length; } - }; - __name(_CredentialsProviderError, "CredentialsProviderError"); - var CredentialsProviderError = _CredentialsProviderError; - var _TokenProviderError = class _TokenProviderError2 extends ProviderError2 { - /** - * @override - */ - constructor(message, options = true) { - super(message, options); - this.name = "TokenProviderError"; - Object.setPrototypeOf(this, _TokenProviderError2.prototype); + return collected; + } + exports2.headStream = headStream2; + } +}); + +// ../../../node_modules/@smithy/util-stream/dist-cjs/headStream.js +var require_headStream = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/headStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.headStream = void 0; + var stream_1 = require("stream"); + var headStream_browser_1 = require_headStream_browser(); + var stream_type_check_1 = require_stream_type_check(); + var headStream2 = (stream, bytes) => { + if ((0, stream_type_check_1.isReadableStream)(stream)) { + return (0, headStream_browser_1.headStream)(stream, bytes); } + return new Promise((resolve, reject) => { + const collector = new Collector(); + collector.limit = bytes; + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes2 = new Uint8Array(Buffer.concat(this.buffers)); + resolve(bytes2); + }); + }); }; - __name(_TokenProviderError, "TokenProviderError"); - var TokenProviderError = _TokenProviderError; - var chain = /* @__PURE__ */ __name((...providers) => async () => { - if (providers.length === 0) { - throw new ProviderError2("No providers in chain"); - } - let lastProviderError; - for (const provider of providers) { - try { - const credentials = await provider(); - return credentials; - } catch (err) { - lastProviderError = err; - if (err == null ? void 0 : err.tryNextLink) { - continue; - } - throw err; - } - } - throw lastProviderError; - }, "chain"); - var fromStatic = /* @__PURE__ */ __name((staticValue) => () => Promise.resolve(staticValue), "fromStatic"); - var memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = /* @__PURE__ */ __name(async () => { - if (!pending) { - pending = provider(); - } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } finally { - pending = void 0; - } - return resolved; - }, "coalesceProvider"); - if (isExpired === void 0) { - return async (options) => { - if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - return resolved; - }; + exports2.headStream = headStream2; + var Collector = class extends stream_1.Writable { + constructor() { + super(...arguments); + this.buffers = []; + this.limit = Infinity; + this.bytesBuffered = 0; } - return async (options) => { - if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - if (isConstant) { - return resolved; - } - if (requiresRefresh && !requiresRefresh(resolved)) { - isConstant = true; - return resolved; - } - if (isExpired(resolved)) { - await coalesceProvider(); - return resolved; + _write(chunk, encoding, callback) { + var _a; + this.buffers.push(chunk); + this.bytesBuffered += (_a = chunk.byteLength) !== null && _a !== void 0 ? _a : 0; + if (this.bytesBuffered >= this.limit) { + const excess = this.bytesBuffered - this.limit; + const tailBuffer = this.buffers[this.buffers.length - 1]; + this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess); + this.emit("finish"); } - return resolved; - }; - }, "memoize"); - } -}); - -// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js -var require_getHomeDir2 = __commonJS({ - "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getHomeDir = void 0; - var os_1 = require("os"); - var path_1 = require("path"); - var homeDirCache = {}; - var getHomeDirCacheKey = () => { - if (process && process.geteuid) { - return `${process.geteuid()}`; + callback(); } - return "DEFAULT"; - }; - var getHomeDir2 = () => { - const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; - if (HOME) - return HOME; - if (USERPROFILE) - return USERPROFILE; - if (HOMEPATH) - return `${HOMEDRIVE}${HOMEPATH}`; - const homeDirCacheKey = getHomeDirCacheKey(); - if (!homeDirCache[homeDirCacheKey]) - homeDirCache[homeDirCacheKey] = (0, os_1.homedir)(); - return homeDirCache[homeDirCacheKey]; }; - exports2.getHomeDir = getHomeDir2; } }); -// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js -var require_getSSOTokenFilepath2 = __commonJS({ - "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js"(exports2) { +// ../../../node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js +var require_ChecksumStream = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSSOTokenFilepath = void 0; - var crypto_1 = require("crypto"); - var path_1 = require("path"); - var getHomeDir_1 = require_getHomeDir2(); - var getSSOTokenFilepath2 = (id) => { - const hasher = (0, crypto_1.createHash)("sha1"); - const cacheName = hasher.update(id).digest("hex"); - return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); + exports2.ChecksumStream = void 0; + var util_base64_1 = require_dist_cjs16(); + var stream_1 = require("stream"); + var ChecksumStream2 = class extends stream_1.Duplex { + constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) { + var _a, _b; + super(); + if (typeof source.pipe === "function") { + this.source = source; + } else { + throw new Error(`@smithy/util-stream: unsupported source type ${(_b = (_a = source === null || source === void 0 ? void 0 : source.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : source} in ChecksumStream.`); + } + this.base64Encoder = base64Encoder !== null && base64Encoder !== void 0 ? base64Encoder : util_base64_1.toBase64; + this.expectedChecksum = expectedChecksum; + this.checksum = checksum; + this.checksumSourceLocation = checksumSourceLocation; + this.source.pipe(this); + } + _read(size) { + } + _write(chunk, encoding, callback) { + try { + this.checksum.update(chunk); + this.push(chunk); + } catch (e) { + return callback(e); + } + return callback(); + } + async _final(callback) { + try { + const digest = await this.checksum.digest(); + const received = this.base64Encoder(digest); + if (this.expectedChecksum !== received) { + return callback(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`)); + } + } catch (e) { + return callback(e); + } + this.push(null); + return callback(); + } }; - exports2.getSSOTokenFilepath = getSSOTokenFilepath2; + exports2.ChecksumStream = ChecksumStream2; } }); -// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js -var require_getSSOTokenFromFile2 = __commonJS({ - "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js"(exports2) { +// ../../../node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js +var require_ChecksumStream_browser = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSSOTokenFromFile = void 0; - var fs_1 = require("fs"); - var getSSOTokenFilepath_1 = require_getSSOTokenFilepath2(); - var { readFile } = fs_1.promises; - var getSSOTokenFromFile2 = async (id) => { - const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); - const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); + exports2.ChecksumStream = void 0; + var ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() { }; - exports2.getSSOTokenFromFile = getSSOTokenFromFile2; + var ChecksumStream2 = class extends ReadableStreamRef { + }; + exports2.ChecksumStream = ChecksumStream2; } }); -// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js -var require_slurpFile2 = __commonJS({ - "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js"(exports2) { +// ../../../node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js +var require_createChecksumStream_browser = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.slurpFile = void 0; - var fs_1 = require("fs"); - var { readFile } = fs_1.promises; - var filePromisesHash = {}; - var slurpFile = (path, options) => { - if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) { - filePromisesHash[path] = readFile(path, "utf8"); - } - return filePromisesHash[path]; - }; - exports2.slurpFile = slurpFile; - } -}); - -// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js -var require_dist_cjs41 = __commonJS({ - "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR, - DEFAULT_PROFILE: () => DEFAULT_PROFILE, - ENV_PROFILE: () => ENV_PROFILE, - getProfileName: () => getProfileName, - loadSharedConfigFiles: () => loadSharedConfigFiles, - loadSsoSessionData: () => loadSsoSessionData, - parseKnownFiles: () => parseKnownFiles - }); - module2.exports = __toCommonJS2(src_exports); - __reExport(src_exports, require_getHomeDir2(), module2.exports); - var ENV_PROFILE = "AWS_PROFILE"; - var DEFAULT_PROFILE = "default"; - var getProfileName = /* @__PURE__ */ __name((init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE, "getProfileName"); - __reExport(src_exports, require_getSSOTokenFilepath2(), module2.exports); - __reExport(src_exports, require_getSSOTokenFromFile2(), module2.exports); - var import_types5 = require_dist_cjs(); - var getConfigData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - if (indexOfSeparator === -1) { - return false; - } - return Object.values(import_types5.IniSectionType).includes(key.substring(0, indexOfSeparator)); - }).reduce( - (acc, [key, value]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - const updatedKey = key.substring(0, indexOfSeparator) === import_types5.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; - acc[updatedKey] = value; - return acc; - }, - { - // Populate default profile, if present. - ...data.default && { default: data.default } - } - ), "getConfigData"); - var import_path = require("path"); - var import_getHomeDir = require_getHomeDir2(); - var ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; - var getConfigFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CONFIG_PATH] || (0, import_path.join)((0, import_getHomeDir.getHomeDir)(), ".aws", "config"), "getConfigFilepath"); - var import_getHomeDir2 = require_getHomeDir2(); - var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; - var getCredentialsFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CREDENTIALS_PATH] || (0, import_path.join)((0, import_getHomeDir2.getHomeDir)(), ".aws", "credentials"), "getCredentialsFilepath"); - var import_getHomeDir3 = require_getHomeDir2(); - var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; - var profileNameBlockList = ["__proto__", "profile __proto__"]; - var parseIni = /* @__PURE__ */ __name((iniData) => { - const map = {}; - let currentSection; - let currentSubSection; - for (const iniLine of iniData.split(/\r?\n/)) { - const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); - const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; - if (isSection) { - currentSection = void 0; - currentSubSection = void 0; - const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); - const matches = prefixKeyRegex.exec(sectionName); - if (matches) { - const [, prefix, , name] = matches; - if (Object.values(import_types5.IniSectionType).includes(prefix)) { - currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR); - } - } else { - currentSection = sectionName; - } - if (profileNameBlockList.includes(sectionName)) { - throw new Error(`Found invalid profile name "${sectionName}"`); - } - } else if (currentSection) { - const indexOfEqualsSign = trimmedLine.indexOf("="); - if (![0, -1].includes(indexOfEqualsSign)) { - const [name, value] = [ - trimmedLine.substring(0, indexOfEqualsSign).trim(), - trimmedLine.substring(indexOfEqualsSign + 1).trim() - ]; - if (value === "") { - currentSubSection = name; - } else { - if (currentSubSection && iniLine.trimStart() === iniLine) { - currentSubSection = void 0; - } - map[currentSection] = map[currentSection] || {}; - const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; - map[currentSection][key] = value; - } - } - } - } - return map; - }, "parseIni"); - var import_slurpFile = require_slurpFile2(); - var swallowError = /* @__PURE__ */ __name(() => ({}), "swallowError"); - var CONFIG_PREFIX_SEPARATOR = "."; - var loadSharedConfigFiles = /* @__PURE__ */ __name(async (init = {}) => { - const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; - const homeDir = (0, import_getHomeDir3.getHomeDir)(); - const relativeHomeDirPrefix = "~/"; - let resolvedFilepath = filepath; - if (filepath.startsWith(relativeHomeDirPrefix)) { - resolvedFilepath = (0, import_path.join)(homeDir, filepath.slice(2)); + exports2.createChecksumStream = void 0; + var util_base64_1 = require_dist_cjs16(); + var stream_type_check_1 = require_stream_type_check(); + var ChecksumStream_browser_1 = require_ChecksumStream_browser(); + var createChecksumStream2 = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => { + var _a, _b; + if (!(0, stream_type_check_1.isReadableStream)(source)) { + throw new Error(`@smithy/util-stream: unsupported source type ${(_b = (_a = source === null || source === void 0 ? void 0 : source.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : source} in ChecksumStream.`); } - let resolvedConfigFilepath = configFilepath; - if (configFilepath.startsWith(relativeHomeDirPrefix)) { - resolvedConfigFilepath = (0, import_path.join)(homeDir, configFilepath.slice(2)); + const encoder = base64Encoder !== null && base64Encoder !== void 0 ? base64Encoder : util_base64_1.toBase64; + if (typeof TransformStream !== "function") { + throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream."); } - const parsedFiles = await Promise.all([ - (0, import_slurpFile.slurpFile)(resolvedConfigFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).then(getConfigData).catch(swallowError), - (0, import_slurpFile.slurpFile)(resolvedFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).catch(swallowError) - ]); - return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1] - }; - }, "loadSharedConfigFiles"); - var getSsoSessionData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => key.startsWith(import_types5.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}), "getSsoSessionData"); - var import_slurpFile2 = require_slurpFile2(); - var swallowError2 = /* @__PURE__ */ __name(() => ({}), "swallowError"); - var loadSsoSessionData = /* @__PURE__ */ __name(async (init = {}) => (0, import_slurpFile2.slurpFile)(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2), "loadSsoSessionData"); - var mergeConfigFiles = /* @__PURE__ */ __name((...files) => { - const merged = {}; - for (const file of files) { - for (const [key, values] of Object.entries(file)) { - if (merged[key] !== void 0) { - Object.assign(merged[key], values); + const transform = new TransformStream({ + start() { + }, + async transform(chunk, controller) { + checksum.update(chunk); + controller.enqueue(chunk); + }, + async flush(controller) { + const digest = await checksum.digest(); + const received = encoder(digest); + if (expectedChecksum !== received) { + const error = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`); + controller.error(error); } else { - merged[key] = values; + controller.terminate(); } } + }); + source.pipeThrough(transform); + const readable = transform.readable; + Object.setPrototypeOf(readable, ChecksumStream_browser_1.ChecksumStream.prototype); + return readable; + }; + exports2.createChecksumStream = createChecksumStream2; + } +}); + +// ../../../node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js +var require_createChecksumStream = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createChecksumStream = void 0; + var stream_type_check_1 = require_stream_type_check(); + var ChecksumStream_1 = require_ChecksumStream(); + var createChecksumStream_browser_1 = require_createChecksumStream_browser(); + function createChecksumStream2(init) { + if (typeof ReadableStream === "function" && (0, stream_type_check_1.isReadableStream)(init.source)) { + return (0, createChecksumStream_browser_1.createChecksumStream)(init); } - return merged; - }, "mergeConfigFiles"); - var parseKnownFiles = /* @__PURE__ */ __name(async (init) => { - const parsedFiles = await loadSharedConfigFiles(init); - return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); - }, "parseKnownFiles"); + return new ChecksumStream_1.ChecksumStream(init); + } + exports2.createChecksumStream = createChecksumStream2; } }); -// ../../../node_modules/@smithy/node-config-provider/dist-cjs/index.js -var require_dist_cjs42 = __commonJS({ - "../../../node_modules/@smithy/node-config-provider/dist-cjs/index.js"(exports2, module2) { +// ../../../node_modules/@smithy/util-stream/dist-cjs/index.js +var require_dist_cjs22 = __commonJS({ + "../../../node_modules/@smithy/util-stream/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -9765,317 +4709,437 @@ var require_dist_cjs42 = __commonJS({ } return to; }; + var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - loadConfig: () => loadConfig + Uint8ArrayBlobAdapter: () => Uint8ArrayBlobAdapter2 }); module2.exports = __toCommonJS2(src_exports); - var import_property_provider2 = require_dist_cjs40(); - function getSelectorName(functionString) { - try { - const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); - constants.delete("CONFIG"); - constants.delete("CONFIG_PREFIX_SEPARATOR"); - constants.delete("ENV"); - return [...constants].join(", "); - } catch (e) { - return functionString; + var import_util_base64 = require_dist_cjs16(); + var import_util_utf8 = require_dist_cjs15(); + function transformToString(payload, encoding = "utf-8") { + if (encoding === "base64") { + return (0, import_util_base64.toBase64)(payload); } + return (0, import_util_utf8.toUtf8)(payload); } - __name(getSelectorName, "getSelectorName"); - var fromEnv = /* @__PURE__ */ __name((envVarSelector, logger) => async () => { - try { - const config = envVarSelector(process.env); - if (config === void 0) { - throw new Error(); + __name(transformToString, "transformToString"); + function transformFromString(str, encoding) { + if (encoding === "base64") { + return Uint8ArrayBlobAdapter2.mutate((0, import_util_base64.fromBase64)(str)); + } + return Uint8ArrayBlobAdapter2.mutate((0, import_util_utf8.fromUtf8)(str)); + } + __name(transformFromString, "transformFromString"); + var _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter2 extends Uint8Array { + /** + * @param source - such as a string or Stream. + * @returns a new Uint8ArrayBlobAdapter extending Uint8Array. + */ + static fromString(source, encoding = "utf-8") { + switch (typeof source) { + case "string": + return transformFromString(source, encoding); + default: + throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); } - return config; - } catch (e) { - throw new import_property_provider2.CredentialsProviderError( - e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, - { logger } - ); } - }, "fromEnv"); - var import_shared_ini_file_loader = require_dist_cjs41(); - var fromSharedConfigFiles = /* @__PURE__ */ __name((configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = (0, import_shared_ini_file_loader.getProfileName)(init); - const { configFile, credentialsFile } = await (0, import_shared_ini_file_loader.loadSharedConfigFiles)(init); - const profileFromCredentials = credentialsFile[profile] || {}; - const profileFromConfig = configFile[profile] || {}; - const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials }; - try { - const cfgFile = preferredFile === "config" ? configFile : credentialsFile; - const configValue = configSelector(mergedProfile, cfgFile); - if (configValue === void 0) { - throw new Error(); + /** + * @param source - Uint8Array to be mutated. + * @returns the same Uint8Array but with prototype switched to Uint8ArrayBlobAdapter. + */ + static mutate(source) { + Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter2.prototype); + return source; + } + /** + * @param encoding - default 'utf-8'. + * @returns the blob as string. + */ + transformToString(encoding = "utf-8") { + return transformToString(this, encoding); + } + }; + __name(_Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter"); + var Uint8ArrayBlobAdapter2 = _Uint8ArrayBlobAdapter; + __reExport(src_exports, require_getAwsChunkedEncodingStream(), module2.exports); + __reExport(src_exports, require_sdk_stream_mixin(), module2.exports); + __reExport(src_exports, require_splitStream(), module2.exports); + __reExport(src_exports, require_headStream(), module2.exports); + __reExport(src_exports, require_stream_type_check(), module2.exports); + __reExport(src_exports, require_createChecksumStream(), module2.exports); + __reExport(src_exports, require_ChecksumStream(), module2.exports); + } +}); + +// ../../../node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js +var import_util_stream, collectBody2; +var init_collect_stream_body = __esm({ + "../../../node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() { + import_util_stream = __toESM(require_dist_cjs22()); + collectBody2 = async (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody); + } + if (!streamBody) { + return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); + } + const fromContext = context.streamCollector(streamBody); + return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext); + }; + } +}); + +// ../../../node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js +function extendedEncodeURIComponent2(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} +var init_extended_encode_uri_component = __esm({ + "../../../node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js"() { + } +}); + +// ../../../node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +function requestBuilder(input, context) { + return new RequestBuilder(input, context); +} +var import_protocol_http2, RequestBuilder; +var init_requestBuilder = __esm({ + "../../../node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js"() { + init_protocols(); + import_protocol_http2 = __toESM(require_dist_cjs2()); + RequestBuilder = class { + constructor(input, context) { + this.input = input; + this.context = context; + this.query = {}; + this.method = ""; + this.headers = {}; + this.path = ""; + this.body = null; + this.hostname = ""; + this.resolvePathStack = []; + } + async build() { + const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint(); + this.path = basePath; + for (const resolvePath of this.resolvePathStack) { + resolvePath(this.path); } - return configValue; - } catch (e) { - throw new import_property_provider2.CredentialsProviderError( - e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, - { logger: init.logger } - ); + return new import_protocol_http2.HttpRequest({ + protocol, + hostname: this.hostname || hostname, + port, + method: this.method, + path: this.path, + query: this.query, + body: this.body, + headers: this.headers + }); } - }, "fromSharedConfigFiles"); - var isFunction = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction"); - var fromStatic = /* @__PURE__ */ __name((defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, import_property_provider2.fromStatic)(defaultValue), "fromStatic"); - var loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, import_property_provider2.memoize)( - (0, import_property_provider2.chain)( - fromEnv(environmentVariableSelector), - fromSharedConfigFiles(configFileSelector, configuration), - fromStatic(defaultValue) - ) - ), "loadConfig"); + hn(hostname) { + this.hostname = hostname; + return this; + } + bp(uriLabel) { + this.resolvePathStack.push((basePath) => { + this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel; + }); + return this; + } + p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { + this.resolvePathStack.push((path) => { + this.path = resolvedPath2(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel); + }); + return this; + } + h(headers) { + this.headers = headers; + return this; + } + q(query) { + this.query = query; + return this; + } + b(body) { + this.body = body; + return this; + } + m(method) { + this.method = method; + return this; + } + }; } }); -// ../../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js -var require_getEndpointUrlConfig2 = __commonJS({ - "../../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getEndpointUrlConfig = void 0; - var shared_ini_file_loader_1 = require_dist_cjs41(); - var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; - var CONFIG_ENDPOINT_URL = "endpoint_url"; - var getEndpointUrlConfig = (serviceId) => ({ - environmentVariableSelector: (env) => { - const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); - const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; - if (serviceEndpointUrl) - return serviceEndpointUrl; - const endpointUrl = env[ENV_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return void 0; - }, - configFileSelector: (profile, config) => { - if (config && profile.services) { - const servicesSection = config[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (servicesSection) { - const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); - const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (endpointUrl2) - return endpointUrl2; +// ../../../node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js +var resolvedPath2; +var init_resolve_path = __esm({ + "../../../node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js"() { + init_extended_encode_uri_component(); + resolvedPath2 = (resolvedPath3, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { + if (input != null && input[memberName] !== void 0) { + const labelValue = labelValueProvider(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: " + memberName + "."); + } + resolvedPath3 = resolvedPath3.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent2(segment)).join("/") : extendedEncodeURIComponent2(labelValue)); + } else { + throw new Error("No value provided for input HTTP label: " + memberName + "."); + } + return resolvedPath3; + }; + } +}); + +// ../../../node_modules/@smithy/core/dist-es/submodules/protocols/index.js +var protocols_exports = {}; +__export(protocols_exports, { + RequestBuilder: () => RequestBuilder, + collectBody: () => collectBody2, + extendedEncodeURIComponent: () => extendedEncodeURIComponent2, + requestBuilder: () => requestBuilder, + resolvedPath: () => resolvedPath2 +}); +var init_protocols = __esm({ + "../../../node_modules/@smithy/core/dist-es/submodules/protocols/index.js"() { + init_collect_stream_body(); + init_extended_encode_uri_component(); + init_requestBuilder(); + init_resolve_path(); + } +}); + +// ../../../node_modules/@smithy/core/dist-es/protocols/requestBuilder.js +var init_requestBuilder2 = __esm({ + "../../../node_modules/@smithy/core/dist-es/protocols/requestBuilder.js"() { + init_protocols(); + } +}); + +// ../../../node_modules/@smithy/core/dist-es/setFeature.js +function setFeature(context, feature, value) { + if (!context.__smithy_context) { + context.__smithy_context = { + features: {} + }; + } else if (!context.__smithy_context.features) { + context.__smithy_context.features = {}; + } + context.__smithy_context.features[feature] = value; +} +var init_setFeature = __esm({ + "../../../node_modules/@smithy/core/dist-es/setFeature.js"() { + } +}); + +// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +var DefaultIdentityProviderConfig; +var init_DefaultIdentityProviderConfig = __esm({ + "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js"() { + DefaultIdentityProviderConfig = class { + constructor(config) { + this.authSchemes = /* @__PURE__ */ new Map(); + for (const [key, value] of Object.entries(config)) { + if (value !== void 0) { + this.authSchemes.set(key, value); } } - const endpointUrl = profile[CONFIG_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return void 0; - }, - default: void 0 - }); - exports2.getEndpointUrlConfig = getEndpointUrlConfig; + } + getIdentityProvider(schemeId) { + return this.authSchemes.get(schemeId); + } + }; } }); -// ../../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js -var require_getEndpointFromConfig2 = __commonJS({ - "../../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getEndpointFromConfig = void 0; - var node_config_provider_1 = require_dist_cjs42(); - var getEndpointUrlConfig_1 = require_getEndpointUrlConfig2(); - var getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId !== null && serviceId !== void 0 ? serviceId : ""))(); - exports2.getEndpointFromConfig = getEndpointFromConfig; +// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +var import_protocol_http3, import_types4, HttpApiKeyAuthSigner; +var init_httpApiKeyAuth = __esm({ + "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() { + import_protocol_http3 = __toESM(require_dist_cjs2()); + import_types4 = __toESM(require_dist_cjs()); + HttpApiKeyAuthSigner = class { + async sign(httpRequest, identity, signingProperties) { + if (!signingProperties) { + throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"); + } + if (!signingProperties.name) { + throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing"); + } + if (!signingProperties.in) { + throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing"); + } + if (!identity.apiKey) { + throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined"); + } + const clonedRequest = import_protocol_http3.HttpRequest.clone(httpRequest); + if (signingProperties.in === import_types4.HttpApiKeyAuthLocation.QUERY) { + clonedRequest.query[signingProperties.name] = identity.apiKey; + } else if (signingProperties.in === import_types4.HttpApiKeyAuthLocation.HEADER) { + clonedRequest.headers[signingProperties.name] = signingProperties.scheme ? `${signingProperties.scheme} ${identity.apiKey}` : identity.apiKey; + } else { + throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `" + signingProperties.in + "`"); + } + return clonedRequest; + } + }; } }); -// ../../../node_modules/@smithy/querystring-parser/dist-cjs/index.js -var require_dist_cjs43 = __commonJS({ - "../../../node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - parseQueryString: () => parseQueryString - }); - module2.exports = __toCommonJS2(src_exports); - function parseQueryString(querystring) { - const query = {}; - querystring = querystring.replace(/^\?/, ""); - if (querystring) { - for (const pair of querystring.split("&")) { - let [key, value = null] = pair.split("="); - key = decodeURIComponent(key); - if (value) { - value = decodeURIComponent(value); - } - if (!(key in query)) { - query[key] = value; - } else if (Array.isArray(query[key])) { - query[key].push(value); - } else { - query[key] = [query[key], value]; - } +// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +var import_protocol_http4, HttpBearerAuthSigner; +var init_httpBearerAuth = __esm({ + "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() { + import_protocol_http4 = __toESM(require_dist_cjs2()); + HttpBearerAuthSigner = class { + async sign(httpRequest, identity, signingProperties) { + const clonedRequest = import_protocol_http4.HttpRequest.clone(httpRequest); + if (!identity.token) { + throw new Error("request could not be signed with `token` since the `token` is not defined"); } + clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; + return clonedRequest; } - return query; - } - __name(parseQueryString, "parseQueryString"); + }; } }); -// ../../../node_modules/@smithy/url-parser/dist-cjs/index.js -var require_dist_cjs44 = __commonJS({ - "../../../node_modules/@smithy/url-parser/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); +// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js +var NoAuthSigner; +var init_noAuth = __esm({ + "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js"() { + NoAuthSigner = class { + async sign(httpRequest, identity, signingProperties) { + return httpRequest; } - return to; }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - parseUrl: () => parseUrl - }); - module2.exports = __toCommonJS2(src_exports); - var import_querystring_parser = require_dist_cjs43(); - var parseUrl = /* @__PURE__ */ __name((url2) => { - if (typeof url2 === "string") { - return parseUrl(new URL(url2)); - } - const { hostname, pathname, port, protocol, search } = url2; - let query; - if (search) { - query = (0, import_querystring_parser.parseQueryString)(search); - } - return { - hostname, - port: port ? parseInt(port) : void 0, - protocol, - path: pathname, - query - }; - }, "parseUrl"); } }); -// ../../../node_modules/@smithy/middleware-serde/dist-cjs/index.js -var require_dist_cjs45 = __commonJS({ - "../../../node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); +// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js +var init_httpAuthSchemes = __esm({ + "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js"() { + init_httpApiKeyAuth(); + init_httpBearerAuth(); + init_noAuth(); + } +}); + +// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js +var createIsIdentityExpiredFunction, EXPIRATION_MS, isIdentityExpired, doesIdentityRequireRefresh, memoizeIdentityProvider; +var init_memoizeIdentityProvider = __esm({ + "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js"() { + createIsIdentityExpiredFunction = (expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs; + EXPIRATION_MS = 3e5; + isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); + doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0; + memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => { + if (provider === void 0) { + return void 0; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - deserializerMiddleware: () => deserializerMiddleware, - deserializerMiddlewareOption: () => deserializerMiddlewareOption, - getSerdePlugin: () => getSerdePlugin, - serializerMiddleware: () => serializerMiddleware, - serializerMiddlewareOption: () => serializerMiddlewareOption2 - }); - module2.exports = __toCommonJS2(src_exports); - var deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (next) => async (args) => { - const { response } = await next(args); - try { - const parsed = await deserializer(response, options); - return { - response, - output: parsed - }; - } catch (error) { - Object.defineProperty(error, "$response", { - value: response - }); - if (!("$metadata" in error)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - error.message += "\n " + hint; - if (typeof error.$responseBodyText !== "undefined") { - if (error.$response) { - error.$response.body = error.$responseBodyText; - } - } + const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider; + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async (options) => { + if (!pending) { + pending = normalizedProvider(options); } - throw error; - } - }, "deserializerMiddleware"); - var serializerMiddleware = /* @__PURE__ */ __name((options, serializer) => (next, context) => async (args) => { - var _a; - const endpoint = ((_a = context.endpointV2) == null ? void 0 : _a.url) && options.urlParser ? async () => options.urlParser(context.endpointV2.url) : options.endpoint; - if (!endpoint) { - throw new Error("No valid endpoint provider available."); - } - const request2 = await serializer(args.input, { ...options, endpoint }); - return next({ - ...args, - request: request2 - }); - }, "serializerMiddleware"); - var deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true - }; - var serializerMiddlewareOption2 = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true - }; - function getSerdePlugin(config, serializer, deserializer) { - return { - applyToStack: (commandStack) => { - commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption); - commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption2); + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } finally { + pending = void 0; } + return resolved; }; - } - __name(getSerdePlugin, "getSerdePlugin"); + if (isExpired === void 0) { + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(options); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(options); + } + if (isConstant) { + return resolved; + } + if (!requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(options); + return resolved; + } + return resolved; + }; + }; } }); -// ../../../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js -var require_dist_cjs46 = __commonJS({ - "../../../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js"(exports2, module2) { +// ../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js +var init_util_identity_and_auth = __esm({ + "../../../node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js"() { + init_DefaultIdentityProviderConfig(); + init_httpAuthSchemes(); + init_memoizeIdentityProvider(); + } +}); + +// ../../../node_modules/@smithy/core/dist-es/index.js +var dist_es_exports = {}; +__export(dist_es_exports, { + DefaultIdentityProviderConfig: () => DefaultIdentityProviderConfig, + EXPIRATION_MS: () => EXPIRATION_MS, + HttpApiKeyAuthSigner: () => HttpApiKeyAuthSigner, + HttpBearerAuthSigner: () => HttpBearerAuthSigner, + NoAuthSigner: () => NoAuthSigner, + createIsIdentityExpiredFunction: () => createIsIdentityExpiredFunction, + createPaginator: () => createPaginator, + doesIdentityRequireRefresh: () => doesIdentityRequireRefresh, + getHttpAuthSchemeEndpointRuleSetPlugin: () => getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpAuthSchemePlugin: () => getHttpAuthSchemePlugin, + getHttpSigningPlugin: () => getHttpSigningPlugin, + getSmithyContext: () => getSmithyContext, + httpAuthSchemeEndpointRuleSetMiddlewareOptions: () => httpAuthSchemeEndpointRuleSetMiddlewareOptions, + httpAuthSchemeMiddleware: () => httpAuthSchemeMiddleware, + httpAuthSchemeMiddlewareOptions: () => httpAuthSchemeMiddlewareOptions, + httpSigningMiddleware: () => httpSigningMiddleware, + httpSigningMiddlewareOptions: () => httpSigningMiddlewareOptions, + isIdentityExpired: () => isIdentityExpired, + memoizeIdentityProvider: () => memoizeIdentityProvider, + normalizeProvider: () => normalizeProvider, + requestBuilder: () => requestBuilder, + setFeature: () => setFeature +}); +var init_dist_es = __esm({ + "../../../node_modules/@smithy/core/dist-es/index.js"() { + init_getSmithyContext(); + init_middleware_http_auth_scheme(); + init_middleware_http_signing(); + init_normalizeProvider(); + init_createPaginator(); + init_requestBuilder2(); + init_setFeature(); + init_util_identity_and_auth(); + } +}); + +// ../../../node_modules/@smithy/middleware-content-length/dist-cjs/index.js +var require_dist_cjs23 = __commonJS({ + "../../../node_modules/@smithy/middleware-content-length/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -10096,450 +5160,645 @@ var require_dist_cjs46 = __commonJS({ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - endpointMiddleware: () => endpointMiddleware, - endpointMiddlewareOptions: () => endpointMiddlewareOptions2, - getEndpointFromInstructions: () => getEndpointFromInstructions, - getEndpointPlugin: () => getEndpointPlugin, - resolveEndpointConfig: () => resolveEndpointConfig, - resolveParams: () => resolveParams, - toEndpointV1: () => toEndpointV1 + contentLengthMiddleware: () => contentLengthMiddleware, + contentLengthMiddlewareOptions: () => contentLengthMiddlewareOptions, + getContentLengthPlugin: () => getContentLengthPlugin }); module2.exports = __toCommonJS2(src_exports); - var resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => { - const bucket = (endpointParams == null ? void 0 : endpointParams.Bucket) || ""; - if (typeof endpointParams.Bucket === "string") { - endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); - } - if (isArnBucketName(bucket)) { - if (endpointParams.ForcePathStyle === true) { - throw new Error("Path-style addressing cannot be used with ARN buckets"); - } - } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) { - endpointParams.ForcePathStyle = true; - } - if (endpointParams.DisableMultiRegionAccessPoints) { - endpointParams.disableMultiRegionAccessPoints = true; - endpointParams.DisableMRAP = true; - } - return endpointParams; - }, "resolveParamsForS3"); - var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; - var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; - var DOTS_PATTERN = /\.\./; - var isDnsCompatibleBucketName = /* @__PURE__ */ __name((bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName), "isDnsCompatibleBucketName"); - var isArnBucketName = /* @__PURE__ */ __name((bucketName) => { - const [arn, partition, service, , , bucket] = bucketName.split(":"); - const isArn = arn === "arn" && bucketName.split(":").length >= 6; - const isValidArn = Boolean(isArn && partition && service && bucket); - if (isArn && !isValidArn) { - throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); - } - return isValidArn; - }, "isArnBucketName"); - var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config) => { - const configProvider = /* @__PURE__ */ __name(async () => { - const configValue = config[configKey] ?? config[canonicalEndpointParamKey]; - if (typeof configValue === "function") { - return configValue(); - } - return configValue; - }, "configProvider"); - if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { - return async () => { - const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; - const configValue = (credentials == null ? void 0 : credentials.credentialScope) ?? (credentials == null ? void 0 : credentials.CredentialScope); - return configValue; - }; - } - if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { - return async () => { - const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; - const configValue = (credentials == null ? void 0 : credentials.accountId) ?? (credentials == null ? void 0 : credentials.AccountId); - return configValue; - }; - } - if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { - return async () => { - const endpoint = await configProvider(); - if (endpoint && typeof endpoint === "object") { - if ("url" in endpoint) { - return endpoint.url.href; - } - if ("hostname" in endpoint) { - const { protocol, hostname, port, path } = endpoint; - return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; - } - } - return endpoint; - }; - } - return configProvider; - }, "createConfigValueProvider"); - var import_getEndpointFromConfig = require_getEndpointFromConfig2(); - var import_url_parser = require_dist_cjs44(); - var toEndpointV1 = /* @__PURE__ */ __name((endpoint) => { - if (typeof endpoint === "object") { - if ("url" in endpoint) { - return (0, import_url_parser.parseUrl)(endpoint.url); - } - return endpoint; - } - return (0, import_url_parser.parseUrl)(endpoint); - }, "toEndpointV1"); - var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context) => { - if (!clientConfig.endpoint) { - let endpointFromConfig; - if (clientConfig.serviceConfiguredEndpoint) { - endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); - } else { - endpointFromConfig = await (0, import_getEndpointFromConfig.getEndpointFromConfig)(clientConfig.serviceId); - } - if (endpointFromConfig) { - clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); - } - } - const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); - if (typeof clientConfig.endpointProvider !== "function") { - throw new Error("config.endpointProvider is not set."); - } - const endpoint = clientConfig.endpointProvider(endpointParams, context); - return endpoint; - }, "getEndpointFromInstructions"); - var resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => { - var _a; - const endpointParams = {}; - const instructions = ((_a = instructionsSupplier == null ? void 0 : instructionsSupplier.getEndpointParameterInstructions) == null ? void 0 : _a.call(instructionsSupplier)) || {}; - for (const [name, instruction] of Object.entries(instructions)) { - switch (instruction.type) { - case "staticContextParams": - endpointParams[name] = instruction.value; - break; - case "contextParams": - endpointParams[name] = commandInput[instruction.name]; - break; - case "clientContextParams": - case "builtInParams": - endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)(); - break; - default: - throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); - } - } - if (Object.keys(instructions).length === 0) { - Object.assign(endpointParams, clientConfig); - } - if (String(clientConfig.serviceId).toLowerCase() === "s3") { - await resolveParamsForS3(endpointParams); - } - return endpointParams; - }, "resolveParams"); - var import_util_middleware3 = require_dist_cjs10(); - var endpointMiddleware = /* @__PURE__ */ __name(({ - config, - instructions - }) => { - return (next, context) => async (args) => { - var _a, _b, _c; - const endpoint = await getEndpointFromInstructions( - args.input, - { - getEndpointParameterInstructions() { - return instructions; - } - }, - { ...config }, - context - ); - context.endpointV2 = endpoint; - context.authSchemes = (_a = endpoint.properties) == null ? void 0 : _a.authSchemes; - const authScheme = (_b = context.authSchemes) == null ? void 0 : _b[0]; - if (authScheme) { - context["signing_region"] = authScheme.signingRegion; - context["signing_service"] = authScheme.signingName; - const smithyContext = (0, import_util_middleware3.getSmithyContext)(context); - const httpAuthOption = (_c = smithyContext == null ? void 0 : smithyContext.selectedHttpAuthScheme) == null ? void 0 : _c.httpAuthOption; - if (httpAuthOption) { - httpAuthOption.signingProperties = Object.assign( - httpAuthOption.signingProperties || {}, - { - signing_region: authScheme.signingRegion, - signingRegion: authScheme.signingRegion, - signing_service: authScheme.signingName, - signingName: authScheme.signingName, - signingRegionSet: authScheme.signingRegionSet - }, - authScheme.properties - ); + var import_protocol_http8 = require_dist_cjs2(); + var CONTENT_LENGTH_HEADER = "content-length"; + function contentLengthMiddleware(bodyLengthChecker) { + return (next) => async (args) => { + const request2 = args.request; + if (import_protocol_http8.HttpRequest.isInstance(request2)) { + const { body, headers } = request2; + if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { + try { + const length = bodyLengthChecker(body); + request2.headers = { + ...request2.headers, + [CONTENT_LENGTH_HEADER]: String(length) + }; + } catch (error) { + } } } return next({ - ...args + ...args, + request: request2 }); }; - }, "endpointMiddleware"); - var import_middleware_serde2 = require_dist_cjs45(); - var endpointMiddlewareOptions2 = { - step: "serialize", - tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], - name: "endpointV2Middleware", - override: true, - relation: "before", - toMiddleware: import_middleware_serde2.serializerMiddlewareOption.name + } + __name(contentLengthMiddleware, "contentLengthMiddleware"); + var contentLengthMiddlewareOptions = { + step: "build", + tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], + name: "contentLengthMiddleware", + override: true }; - var getEndpointPlugin = /* @__PURE__ */ __name((config, instructions) => ({ + var getContentLengthPlugin = /* @__PURE__ */ __name((options) => ({ applyToStack: (clientStack) => { - clientStack.addRelativeTo( - endpointMiddleware({ - config, - instructions - }), - endpointMiddlewareOptions2 - ); + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); } - }), "getEndpointPlugin"); - var import_getEndpointFromConfig2 = require_getEndpointFromConfig2(); - var resolveEndpointConfig = /* @__PURE__ */ __name((input) => { - const tls = input.tls ?? true; - const { endpoint } = input; - const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await (0, import_util_middleware3.normalizeProvider)(endpoint)()) : void 0; - const isCustomEndpoint = !!endpoint; - const resolvedConfig = { - ...input, - endpoint: customEndpointProvider, - tls, - isCustomEndpoint, - useDualstackEndpoint: (0, import_util_middleware3.normalizeProvider)(input.useDualstackEndpoint ?? false), - useFipsEndpoint: (0, import_util_middleware3.normalizeProvider)(input.useFipsEndpoint ?? false) - }; - let configuredEndpointPromise = void 0; - resolvedConfig.serviceConfiguredEndpoint = async () => { - if (input.serviceId && !configuredEndpointPromise) { - configuredEndpointPromise = (0, import_getEndpointFromConfig2.getEndpointFromConfig)(input.serviceId); - } - return configuredEndpointPromise; - }; - return resolvedConfig; - }, "resolveEndpointConfig"); + }), "getContentLengthPlugin"); } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js -var warningEmitted, emitWarningIfUnsupportedVersion; -var init_emitWarningIfUnsupportedVersion = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() { - warningEmitted = false; - emitWarningIfUnsupportedVersion = (version2) => { - if (version2 && !warningEmitted && parseInt(version2.substring(1, version2.indexOf("."))) < 18) { - warningEmitted = true; - process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will -no longer support Node.js 16.x on January 6, 2025. - -To continue receiving updates to AWS services, bug fixes, and security -updates please upgrade to a supported Node.js LTS version. - -More information can be found at: https://a.co/74kJMmI`); +// ../../../node_modules/@smithy/property-provider/dist-cjs/index.js +var require_dist_cjs24 = __commonJS({ + "../../../node_modules/@smithy/property-provider/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } + return to; }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + CredentialsProviderError: () => CredentialsProviderError, + ProviderError: () => ProviderError2, + TokenProviderError: () => TokenProviderError, + chain: () => chain, + fromStatic: () => fromStatic, + memoize: () => memoize + }); + module2.exports = __toCommonJS2(src_exports); + var _ProviderError = class _ProviderError2 extends Error { + constructor(message, options = true) { + var _a; + let logger; + let tryNextLink = true; + if (typeof options === "boolean") { + logger = void 0; + tryNextLink = options; + } else if (options != null && typeof options === "object") { + logger = options.logger; + tryNextLink = options.tryNextLink ?? true; + } + super(message); + this.name = "ProviderError"; + this.tryNextLink = tryNextLink; + Object.setPrototypeOf(this, _ProviderError2.prototype); + (_a = logger == null ? void 0 : logger.debug) == null ? void 0 : _a.call(logger, `@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); + } + /** + * @deprecated use new operator. + */ + static from(error, options = true) { + return Object.assign(new this(error.message, options), error); + } + }; + __name(_ProviderError, "ProviderError"); + var ProviderError2 = _ProviderError; + var _CredentialsProviderError = class _CredentialsProviderError2 extends ProviderError2 { + /** + * @override + */ + constructor(message, options = true) { + super(message, options); + this.name = "CredentialsProviderError"; + Object.setPrototypeOf(this, _CredentialsProviderError2.prototype); + } + }; + __name(_CredentialsProviderError, "CredentialsProviderError"); + var CredentialsProviderError = _CredentialsProviderError; + var _TokenProviderError = class _TokenProviderError2 extends ProviderError2 { + /** + * @override + */ + constructor(message, options = true) { + super(message, options); + this.name = "TokenProviderError"; + Object.setPrototypeOf(this, _TokenProviderError2.prototype); + } + }; + __name(_TokenProviderError, "TokenProviderError"); + var TokenProviderError = _TokenProviderError; + var chain = /* @__PURE__ */ __name((...providers) => async () => { + if (providers.length === 0) { + throw new ProviderError2("No providers in chain"); + } + let lastProviderError; + for (const provider of providers) { + try { + const credentials = await provider(); + return credentials; + } catch (err) { + lastProviderError = err; + if (err == null ? void 0 : err.tryNextLink) { + continue; + } + throw err; + } + } + throw lastProviderError; + }, "chain"); + var fromStatic = /* @__PURE__ */ __name((staticValue) => () => Promise.resolve(staticValue), "fromStatic"); + var memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = /* @__PURE__ */ __name(async () => { + if (!pending) { + pending = provider(); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } finally { + pending = void 0; + } + return resolved; + }, "coalesceProvider"); + if (isExpired === void 0) { + return async (options) => { + if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(); + } + if (isConstant) { + return resolved; + } + if (requiresRefresh && !requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(); + return resolved; + } + return resolved; + }; + }, "memoize"); } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/client/index.js -var init_client = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() { - init_emitWarningIfUnsupportedVersion(); - } -}); - -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js -var import_protocol_http5, getDateHeader; -var init_getDateHeader = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() { - import_protocol_http5 = __toESM(require_dist_cjs2()); - getDateHeader = (response) => import_protocol_http5.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0; +// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js +var require_getHomeDir = __commonJS({ + "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getHomeDir = void 0; + var os_1 = require("os"); + var path_1 = require("path"); + var homeDirCache = {}; + var getHomeDirCacheKey = () => { + if (process && process.geteuid) { + return `${process.geteuid()}`; + } + return "DEFAULT"; + }; + var getHomeDir2 = () => { + const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; + if (HOME) + return HOME; + if (USERPROFILE) + return USERPROFILE; + if (HOMEPATH) + return `${HOMEDRIVE}${HOMEPATH}`; + const homeDirCacheKey = getHomeDirCacheKey(); + if (!homeDirCache[homeDirCacheKey]) + homeDirCache[homeDirCacheKey] = (0, os_1.homedir)(); + return homeDirCache[homeDirCacheKey]; + }; + exports2.getHomeDir = getHomeDir2; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js -var getSkewCorrectedDate; -var init_getSkewCorrectedDate = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js"() { - getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); +// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js +var require_getSSOTokenFilepath = __commonJS({ + "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getSSOTokenFilepath = void 0; + var crypto_1 = require("crypto"); + var path_1 = require("path"); + var getHomeDir_1 = require_getHomeDir(); + var getSSOTokenFilepath2 = (id) => { + const hasher = (0, crypto_1.createHash)("sha1"); + const cacheName = hasher.update(id).digest("hex"); + return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); + }; + exports2.getSSOTokenFilepath = getSSOTokenFilepath2; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js -var isClockSkewed; -var init_isClockSkewed = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js"() { - init_getSkewCorrectedDate(); - isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5; +// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js +var require_getSSOTokenFromFile = __commonJS({ + "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getSSOTokenFromFile = void 0; + var fs_1 = require("fs"); + var getSSOTokenFilepath_1 = require_getSSOTokenFilepath(); + var { readFile } = fs_1.promises; + var getSSOTokenFromFile2 = async (id) => { + const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); + const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); + return JSON.parse(ssoTokenText); + }; + exports2.getSSOTokenFromFile = getSSOTokenFromFile2; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js -var getUpdatedSystemClockOffset; -var init_getUpdatedSystemClockOffset = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js"() { - init_isClockSkewed(); - getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { - const clockTimeInMs = Date.parse(clockTime); - if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { - return clockTimeInMs - Date.now(); +// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js +var require_slurpFile = __commonJS({ + "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.slurpFile = void 0; + var fs_1 = require("fs"); + var { readFile } = fs_1.promises; + var filePromisesHash = {}; + var slurpFile = (path, options) => { + if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) { + filePromisesHash[path] = readFile(path, "utf8"); } - return currentSystemClockOffset; + return filePromisesHash[path]; }; + exports2.slurpFile = slurpFile; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js -var init_utils = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() { - init_getDateHeader(); - init_getSkewCorrectedDate(); - init_getUpdatedSystemClockOffset(); - } -}); - -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js -var import_protocol_http6, throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer, AWSSDKSigV4Signer; -var init_AwsSdkSigV4Signer = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() { - import_protocol_http6 = __toESM(require_dist_cjs2()); - init_utils(); - throwSigningPropertyError = (name, property) => { - if (!property) { - throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); - } - return property; +// ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +var require_dist_cjs25 = __commonJS({ + "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); }; - validateSigningProperties = async (signingProperties) => { - const context = throwSigningPropertyError("context", signingProperties.context); - const config = throwSigningPropertyError("config", signingProperties.config); - const authScheme = context.endpointV2?.properties?.authSchemes?.[0]; - const signerFunction = throwSigningPropertyError("signer", config.signer); - const signer = await signerFunction(authScheme); - const signingRegion = signingProperties?.signingRegion; - const signingRegionSet = signingProperties?.signingRegionSet; - const signingName = signingProperties?.signingName; - return { - config, - signer, - signingRegion, - signingRegionSet, - signingName - }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; }; - AwsSdkSigV4Signer = class { - async sign(httpRequest, identity, signingProperties) { - if (!import_protocol_http6.HttpRequest.isInstance(httpRequest)) { - throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); - } - const validatedProps = await validateSigningProperties(signingProperties); - const { config, signer } = validatedProps; - let { signingRegion, signingName } = validatedProps; - const handlerExecutionContext = signingProperties.context; - if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) { - const [first, second] = handlerExecutionContext.authSchemes; - if (first?.name === "sigv4a" && second?.name === "sigv4") { - signingRegion = second?.signingRegion ?? signingRegion; - signingName = second?.signingName ?? signingName; - } - } - const signedRequest = await signer.sign(httpRequest, { - signingDate: getSkewCorrectedDate(config.systemClockOffset), - signingRegion, - signingService: signingName - }); - return signedRequest; + var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR, + DEFAULT_PROFILE: () => DEFAULT_PROFILE, + ENV_PROFILE: () => ENV_PROFILE, + getProfileName: () => getProfileName, + loadSharedConfigFiles: () => loadSharedConfigFiles, + loadSsoSessionData: () => loadSsoSessionData, + parseKnownFiles: () => parseKnownFiles + }); + module2.exports = __toCommonJS2(src_exports); + __reExport(src_exports, require_getHomeDir(), module2.exports); + var ENV_PROFILE = "AWS_PROFILE"; + var DEFAULT_PROFILE = "default"; + var getProfileName = /* @__PURE__ */ __name((init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE, "getProfileName"); + __reExport(src_exports, require_getSSOTokenFilepath(), module2.exports); + __reExport(src_exports, require_getSSOTokenFromFile(), module2.exports); + var import_types5 = require_dist_cjs(); + var getConfigData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + if (indexOfSeparator === -1) { + return false; } - errorHandler(signingProperties) { - return (error) => { - const serverTime = error.ServerTime ?? getDateHeader(error.$response); - if (serverTime) { - const config = throwSigningPropertyError("config", signingProperties.config); - const initialSystemClockOffset = config.systemClockOffset; - config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); - const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; - if (clockSkewCorrected && error.$metadata) { - error.$metadata.clockSkewCorrected = true; + return Object.values(import_types5.IniSectionType).includes(key.substring(0, indexOfSeparator)); + }).reduce( + (acc, [key, value]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + const updatedKey = key.substring(0, indexOfSeparator) === import_types5.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; + acc[updatedKey] = value; + return acc; + }, + { + // Populate default profile, if present. + ...data.default && { default: data.default } + } + ), "getConfigData"); + var import_path = require("path"); + var import_getHomeDir = require_getHomeDir(); + var ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; + var getConfigFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CONFIG_PATH] || (0, import_path.join)((0, import_getHomeDir.getHomeDir)(), ".aws", "config"), "getConfigFilepath"); + var import_getHomeDir2 = require_getHomeDir(); + var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; + var getCredentialsFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CREDENTIALS_PATH] || (0, import_path.join)((0, import_getHomeDir2.getHomeDir)(), ".aws", "credentials"), "getCredentialsFilepath"); + var import_getHomeDir3 = require_getHomeDir(); + var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; + var profileNameBlockList = ["__proto__", "profile __proto__"]; + var parseIni = /* @__PURE__ */ __name((iniData) => { + const map = {}; + let currentSection; + let currentSubSection; + for (const iniLine of iniData.split(/\r?\n/)) { + const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); + const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; + if (isSection) { + currentSection = void 0; + currentSubSection = void 0; + const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); + const matches = prefixKeyRegex.exec(sectionName); + if (matches) { + const [, prefix, , name] = matches; + if (Object.values(import_types5.IniSectionType).includes(prefix)) { + currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR); } + } else { + currentSection = sectionName; } - throw error; - }; + if (profileNameBlockList.includes(sectionName)) { + throw new Error(`Found invalid profile name "${sectionName}"`); + } + } else if (currentSection) { + const indexOfEqualsSign = trimmedLine.indexOf("="); + if (![0, -1].includes(indexOfEqualsSign)) { + const [name, value] = [ + trimmedLine.substring(0, indexOfEqualsSign).trim(), + trimmedLine.substring(indexOfEqualsSign + 1).trim() + ]; + if (value === "") { + currentSubSection = name; + } else { + if (currentSubSection && iniLine.trimStart() === iniLine) { + currentSubSection = void 0; + } + map[currentSection] = map[currentSection] || {}; + const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; + map[currentSection][key] = value; + } + } + } + } + return map; + }, "parseIni"); + var import_slurpFile = require_slurpFile(); + var swallowError = /* @__PURE__ */ __name(() => ({}), "swallowError"); + var CONFIG_PREFIX_SEPARATOR = "."; + var loadSharedConfigFiles = /* @__PURE__ */ __name(async (init = {}) => { + const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; + const homeDir = (0, import_getHomeDir3.getHomeDir)(); + const relativeHomeDirPrefix = "~/"; + let resolvedFilepath = filepath; + if (filepath.startsWith(relativeHomeDirPrefix)) { + resolvedFilepath = (0, import_path.join)(homeDir, filepath.slice(2)); } - successHandler(httpResponse, signingProperties) { - const dateHeader = getDateHeader(httpResponse); - if (dateHeader) { - const config = throwSigningPropertyError("config", signingProperties.config); - config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); + let resolvedConfigFilepath = configFilepath; + if (configFilepath.startsWith(relativeHomeDirPrefix)) { + resolvedConfigFilepath = (0, import_path.join)(homeDir, configFilepath.slice(2)); + } + const parsedFiles = await Promise.all([ + (0, import_slurpFile.slurpFile)(resolvedConfigFilepath, { + ignoreCache: init.ignoreCache + }).then(parseIni).then(getConfigData).catch(swallowError), + (0, import_slurpFile.slurpFile)(resolvedFilepath, { + ignoreCache: init.ignoreCache + }).then(parseIni).catch(swallowError) + ]); + return { + configFile: parsedFiles[0], + credentialsFile: parsedFiles[1] + }; + }, "loadSharedConfigFiles"); + var getSsoSessionData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => key.startsWith(import_types5.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}), "getSsoSessionData"); + var import_slurpFile2 = require_slurpFile(); + var swallowError2 = /* @__PURE__ */ __name(() => ({}), "swallowError"); + var loadSsoSessionData = /* @__PURE__ */ __name(async (init = {}) => (0, import_slurpFile2.slurpFile)(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2), "loadSsoSessionData"); + var mergeConfigFiles = /* @__PURE__ */ __name((...files) => { + const merged = {}; + for (const file of files) { + for (const [key, values] of Object.entries(file)) { + if (merged[key] !== void 0) { + Object.assign(merged[key], values); + } else { + merged[key] = values; + } } } - }; - AWSSDKSigV4Signer = AwsSdkSigV4Signer; + return merged; + }, "mergeConfigFiles"); + var parseKnownFiles = /* @__PURE__ */ __name(async (init) => { + const parsedFiles = await loadSharedConfigFiles(init); + return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); + }, "parseKnownFiles"); } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js -var import_protocol_http7, AwsSdkSigV4ASigner; -var init_AwsSdkSigV4ASigner = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js"() { - import_protocol_http7 = __toESM(require_dist_cjs2()); - init_utils(); - init_AwsSdkSigV4Signer(); - AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer { - async sign(httpRequest, identity, signingProperties) { - if (!import_protocol_http7.HttpRequest.isInstance(httpRequest)) { - throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); - } - const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties); - const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.(); - const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(","); - const signedRequest = await signer.sign(httpRequest, { - signingDate: getSkewCorrectedDate(config.systemClockOffset), - signingRegion: multiRegionOverride, - signingService: signingName - }); - return signedRequest; +// ../../../node_modules/@smithy/node-config-provider/dist-cjs/index.js +var require_dist_cjs26 = __commonJS({ + "../../../node_modules/@smithy/node-config-provider/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } + return to; }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + loadConfig: () => loadConfig + }); + module2.exports = __toCommonJS2(src_exports); + var import_property_provider2 = require_dist_cjs24(); + function getSelectorName(functionString) { + try { + const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); + constants.delete("CONFIG"); + constants.delete("CONFIG_PREFIX_SEPARATOR"); + constants.delete("ENV"); + return [...constants].join(", "); + } catch (e) { + return functionString; + } + } + __name(getSelectorName, "getSelectorName"); + var fromEnv = /* @__PURE__ */ __name((envVarSelector, logger) => async () => { + try { + const config = envVarSelector(process.env); + if (config === void 0) { + throw new Error(); + } + return config; + } catch (e) { + throw new import_property_provider2.CredentialsProviderError( + e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, + { logger } + ); + } + }, "fromEnv"); + var import_shared_ini_file_loader = require_dist_cjs25(); + var fromSharedConfigFiles = /* @__PURE__ */ __name((configSelector, { preferredFile = "config", ...init } = {}) => async () => { + const profile = (0, import_shared_ini_file_loader.getProfileName)(init); + const { configFile, credentialsFile } = await (0, import_shared_ini_file_loader.loadSharedConfigFiles)(init); + const profileFromCredentials = credentialsFile[profile] || {}; + const profileFromConfig = configFile[profile] || {}; + const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials }; + try { + const cfgFile = preferredFile === "config" ? configFile : credentialsFile; + const configValue = configSelector(mergedProfile, cfgFile); + if (configValue === void 0) { + throw new Error(); + } + return configValue; + } catch (e) { + throw new import_property_provider2.CredentialsProviderError( + e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, + { logger: init.logger } + ); + } + }, "fromSharedConfigFiles"); + var isFunction = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction"); + var fromStatic = /* @__PURE__ */ __name((defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, import_property_provider2.fromStatic)(defaultValue), "fromStatic"); + var loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, import_property_provider2.memoize)( + (0, import_property_provider2.chain)( + fromEnv(environmentVariableSelector), + fromSharedConfigFiles(configFileSelector, configuration), + fromStatic(defaultValue) + ) + ), "loadConfig"); } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js -var import_property_provider, resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS; -var init_resolveAwsSdkSigV4AConfig = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() { - init_dist_es(); - import_property_provider = __toESM(require_dist_cjs40()); - resolveAwsSdkSigV4AConfig = (config) => { - config.sigv4aSigningRegionSet = normalizeProvider(config.sigv4aSigningRegionSet); - return config; - }; - NODE_SIGV4A_CONFIG_OPTIONS = { - environmentVariableSelector(env) { - if (env.AWS_SIGV4A_SIGNING_REGION_SET) { - return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim()); - } - throw new import_property_provider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", { - tryNextLink: true - }); +// ../../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js +var require_getEndpointUrlConfig = __commonJS({ + "../../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getEndpointUrlConfig = void 0; + var shared_ini_file_loader_1 = require_dist_cjs25(); + var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; + var CONFIG_ENDPOINT_URL = "endpoint_url"; + var getEndpointUrlConfig = (serviceId) => ({ + environmentVariableSelector: (env) => { + const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); + const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; + if (serviceEndpointUrl) + return serviceEndpointUrl; + const endpointUrl = env[ENV_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return void 0; }, - configFileSelector(profile) { - if (profile.sigv4a_signing_region_set) { - return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim()); + configFileSelector: (profile, config) => { + if (config && profile.services) { + const servicesSection = config[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; + if (servicesSection) { + const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); + const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; + if (endpointUrl2) + return endpointUrl2; + } } - throw new import_property_provider.ProviderError("sigv4a_signing_region_set not set in profile.", { - tryNextLink: true - }); + const endpointUrl = profile[CONFIG_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return void 0; }, default: void 0 + }); + exports2.getEndpointUrlConfig = getEndpointUrlConfig; + } +}); + +// ../../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +var require_getEndpointFromConfig = __commonJS({ + "../../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getEndpointFromConfig = void 0; + var node_config_provider_1 = require_dist_cjs26(); + var getEndpointUrlConfig_1 = require_getEndpointUrlConfig(); + var getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId !== null && serviceId !== void 0 ? serviceId : ""))(); + exports2.getEndpointFromConfig = getEndpointFromConfig; + } +}); + +// ../../../node_modules/@smithy/querystring-parser/dist-cjs/index.js +var require_dist_cjs27 = __commonJS({ + "../../../node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + parseQueryString: () => parseQueryString + }); + module2.exports = __toCommonJS2(src_exports); + function parseQueryString(querystring) { + const query = {}; + querystring = querystring.replace(/^\?/, ""); + if (querystring) { + for (const pair of querystring.split("&")) { + let [key, value = null] = pair.split("="); + key = decodeURIComponent(key); + if (value) { + value = decodeURIComponent(value); + } + if (!(key in query)) { + query[key] = value; + } else if (Array.isArray(query[key])) { + query[key].push(value); + } else { + query[key] = [query[key], value]; + } + } + } + return query; + } + __name(parseQueryString, "parseQueryString"); } }); -// ../../../node_modules/@smithy/signature-v4/dist-cjs/index.js -var require_dist_cjs47 = __commonJS({ - "../../../node_modules/@smithy/signature-v4/dist-cjs/index.js"(exports2, module2) { +// ../../../node_modules/@smithy/url-parser/dist-cjs/index.js +var require_dist_cjs28 = __commonJS({ + "../../../node_modules/@smithy/url-parser/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -10560,3263 +5819,3136 @@ var require_dist_cjs47 = __commonJS({ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - SignatureV4: () => SignatureV42, - clearCredentialCache: () => clearCredentialCache, - createScope: () => createScope, - getCanonicalHeaders: () => getCanonicalHeaders, - getCanonicalQuery: () => getCanonicalQuery, - getPayloadHash: () => getPayloadHash, - getSigningKey: () => getSigningKey, - moveHeadersToQuery: () => moveHeadersToQuery, - prepareRequest: () => prepareRequest + parseUrl: () => parseUrl }); module2.exports = __toCommonJS2(src_exports); - var import_util_middleware3 = require_dist_cjs10(); - var import_util_utf84 = require_dist_cjs28(); - var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; - var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; - var AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; - var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; - var EXPIRES_QUERY_PARAM = "X-Amz-Expires"; - var SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; - var TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; - var AUTH_HEADER = "authorization"; - var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); - var DATE_HEADER = "date"; - var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; - var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); - var SHA256_HEADER = "x-amz-content-sha256"; - var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); - var ALWAYS_UNSIGNABLE_HEADERS = { - authorization: true, - "cache-control": true, - connection: true, - expect: true, - from: true, - "keep-alive": true, - "max-forwards": true, - pragma: true, - referer: true, - te: true, - trailer: true, - "transfer-encoding": true, - upgrade: true, - "user-agent": true, - "x-amzn-trace-id": true - }; - var PROXY_HEADER_PATTERN = /^proxy-/; - var SEC_HEADER_PATTERN = /^sec-/; - var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; - var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; - var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; - var MAX_CACHE_SIZE = 50; - var KEY_TYPE_IDENTIFIER = "aws4_request"; - var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; - var import_util_hex_encoding = require_dist_cjs35(); - var import_util_utf8 = require_dist_cjs28(); - var signingKeyCache = {}; - var cacheQueue = []; - var createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope"); - var getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => { - const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); - const cacheKey = `${shortDate}:${region}:${service}:${(0, import_util_hex_encoding.toHex)(credsHash)}:${credentials.sessionToken}`; - if (cacheKey in signingKeyCache) { - return signingKeyCache[cacheKey]; - } - cacheQueue.push(cacheKey); - while (cacheQueue.length > MAX_CACHE_SIZE) { - delete signingKeyCache[cacheQueue.shift()]; - } - let key = `AWS4${credentials.secretAccessKey}`; - for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { - key = await hmac(sha256Constructor, key, signable); - } - return signingKeyCache[cacheKey] = key; - }, "getSigningKey"); - var clearCredentialCache = /* @__PURE__ */ __name(() => { - cacheQueue.length = 0; - Object.keys(signingKeyCache).forEach((cacheKey) => { - delete signingKeyCache[cacheKey]; - }); - }, "clearCredentialCache"); - var hmac = /* @__PURE__ */ __name((ctor, secret, data) => { - const hash = new ctor(secret); - hash.update((0, import_util_utf8.toUint8Array)(data)); - return hash.digest(); - }, "hmac"); - var getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => { - const canonical = {}; - for (const headerName of Object.keys(headers).sort()) { - if (headers[headerName] == void 0) { - continue; - } - const canonicalHeaderName = headerName.toLowerCase(); - if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || (unsignableHeaders == null ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) { - if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) { - continue; - } - } - canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); - } - return canonical; - }, "getCanonicalHeaders"); - var import_util_uri_escape = require_dist_cjs31(); - var getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => { - const keys = []; - const serialized = {}; - for (const key of Object.keys(query).sort()) { - if (key.toLowerCase() === SIGNATURE_HEADER) { - continue; - } - keys.push(key); - const value = query[key]; - if (typeof value === "string") { - serialized[key] = `${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value)}`; - } else if (Array.isArray(value)) { - serialized[key] = value.slice(0).reduce( - (encoded, value2) => encoded.concat([`${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value2)}`]), - [] - ).sort().join("&"); - } - } - return keys.map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); - }, "getCanonicalQuery"); - var import_is_array_buffer = require_dist_cjs26(); - var import_util_utf82 = require_dist_cjs28(); - var getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => { - for (const headerName of Object.keys(headers)) { - if (headerName.toLowerCase() === SHA256_HEADER) { - return headers[headerName]; - } - } - if (body == void 0) { - return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; - } else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, import_is_array_buffer.isArrayBuffer)(body)) { - const hashCtor = new hashConstructor(); - hashCtor.update((0, import_util_utf82.toUint8Array)(body)); - return (0, import_util_hex_encoding.toHex)(await hashCtor.digest()); - } - return UNSIGNED_PAYLOAD; - }, "getPayloadHash"); - var import_util_utf83 = require_dist_cjs28(); - var _HeaderFormatter = class _HeaderFormatter { - format(headers) { - const chunks = []; - for (const headerName of Object.keys(headers)) { - const bytes = (0, import_util_utf83.fromUtf8)(headerName); - chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); - } - const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); - let position = 0; - for (const chunk of chunks) { - out.set(chunk, position); - position += chunk.byteLength; - } - return out; - } - formatHeaderValue(header) { - switch (header.type) { - case "boolean": - return Uint8Array.from([ - header.value ? 0 : 1 - /* boolFalse */ - ]); - case "byte": - return Uint8Array.from([2, header.value]); - case "short": - const shortView = new DataView(new ArrayBuffer(3)); - shortView.setUint8( - 0, - 3 - /* short */ - ); - shortView.setInt16(1, header.value, false); - return new Uint8Array(shortView.buffer); - case "integer": - const intView = new DataView(new ArrayBuffer(5)); - intView.setUint8( - 0, - 4 - /* integer */ - ); - intView.setInt32(1, header.value, false); - return new Uint8Array(intView.buffer); - case "long": - const longBytes = new Uint8Array(9); - longBytes[0] = 5; - longBytes.set(header.value.bytes, 1); - return longBytes; - case "binary": - const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); - binView.setUint8( - 0, - 6 - /* byteArray */ - ); - binView.setUint16(1, header.value.byteLength, false); - const binBytes = new Uint8Array(binView.buffer); - binBytes.set(header.value, 3); - return binBytes; - case "string": - const utf8Bytes = (0, import_util_utf83.fromUtf8)(header.value); - const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); - strView.setUint8( - 0, - 7 - /* string */ - ); - strView.setUint16(1, utf8Bytes.byteLength, false); - const strBytes = new Uint8Array(strView.buffer); - strBytes.set(utf8Bytes, 3); - return strBytes; - case "timestamp": - const tsBytes = new Uint8Array(9); - tsBytes[0] = 8; - tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1); - return tsBytes; - case "uuid": - if (!UUID_PATTERN.test(header.value)) { - throw new Error(`Invalid UUID received: ${header.value}`); - } - const uuidBytes = new Uint8Array(17); - uuidBytes[0] = 9; - uuidBytes.set((0, import_util_hex_encoding.fromHex)(header.value.replace(/\-/g, "")), 1); - return uuidBytes; - } - } - }; - __name(_HeaderFormatter, "HeaderFormatter"); - var HeaderFormatter = _HeaderFormatter; - var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; - var _Int64 = class _Int642 { - constructor(bytes) { - this.bytes = bytes; - if (bytes.byteLength !== 8) { - throw new Error("Int64 buffers must be exactly 8 bytes"); - } - } - static fromNumber(number) { - if (number > 9223372036854776e3 || number < -9223372036854776e3) { - throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); - } - const bytes = new Uint8Array(8); - for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) { - bytes[i] = remaining; - } - if (number < 0) { - negate(bytes); - } - return new _Int642(bytes); - } - /** - * Called implicitly by infix arithmetic operators. - */ - valueOf() { - const bytes = this.bytes.slice(0); - const negative = bytes[0] & 128; - if (negative) { - negate(bytes); - } - return parseInt((0, import_util_hex_encoding.toHex)(bytes), 16) * (negative ? -1 : 1); + var import_querystring_parser = require_dist_cjs27(); + var parseUrl = /* @__PURE__ */ __name((url2) => { + if (typeof url2 === "string") { + return parseUrl(new URL(url2)); } - toString() { - return String(this.valueOf()); + const { hostname, pathname, port, protocol, search } = url2; + let query; + if (search) { + query = (0, import_querystring_parser.parseQueryString)(search); } + return { + hostname, + port: port ? parseInt(port) : void 0, + protocol, + path: pathname, + query + }; + }, "parseUrl"); + } +}); + +// ../../../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +var require_dist_cjs29 = __commonJS({ + "../../../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); }; - __name(_Int64, "Int64"); - var Int64 = _Int64; - function negate(bytes) { - for (let i = 0; i < 8; i++) { - bytes[i] ^= 255; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } - for (let i = 7; i > -1; i--) { - bytes[i]++; - if (bytes[i] !== 0) - break; + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + endpointMiddleware: () => endpointMiddleware, + endpointMiddlewareOptions: () => endpointMiddlewareOptions, + getEndpointFromInstructions: () => getEndpointFromInstructions, + getEndpointPlugin: () => getEndpointPlugin, + resolveEndpointConfig: () => resolveEndpointConfig, + resolveParams: () => resolveParams, + toEndpointV1: () => toEndpointV1 + }); + module2.exports = __toCommonJS2(src_exports); + var resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => { + const bucket = (endpointParams == null ? void 0 : endpointParams.Bucket) || ""; + if (typeof endpointParams.Bucket === "string") { + endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); } - } - __name(negate, "negate"); - var hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return true; + if (isArnBucketName(bucket)) { + if (endpointParams.ForcePathStyle === true) { + throw new Error("Path-style addressing cannot be used with ARN buckets"); } + } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) { + endpointParams.ForcePathStyle = true; } - return false; - }, "hasHeader"); - var import_protocol_http8 = require_dist_cjs2(); - var moveHeadersToQuery = /* @__PURE__ */ __name((request2, options = {}) => { - var _a; - const { headers, query = {} } = import_protocol_http8.HttpRequest.clone(request2); - for (const name of Object.keys(headers)) { - const lname = name.toLowerCase(); - if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) == null ? void 0 : _a.has(lname))) { - query[name] = headers[name]; - delete headers[name]; - } + if (endpointParams.DisableMultiRegionAccessPoints) { + endpointParams.disableMultiRegionAccessPoints = true; + endpointParams.DisableMRAP = true; } - return { - ...request2, - headers, - query - }; - }, "moveHeadersToQuery"); - var prepareRequest = /* @__PURE__ */ __name((request2) => { - request2 = import_protocol_http8.HttpRequest.clone(request2); - for (const headerName of Object.keys(request2.headers)) { - if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { - delete request2.headers[headerName]; + return endpointParams; + }, "resolveParamsForS3"); + var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; + var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; + var DOTS_PATTERN = /\.\./; + var isDnsCompatibleBucketName = /* @__PURE__ */ __name((bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName), "isDnsCompatibleBucketName"); + var isArnBucketName = /* @__PURE__ */ __name((bucketName) => { + const [arn, partition, service, , , bucket] = bucketName.split(":"); + const isArn = arn === "arn" && bucketName.split(":").length >= 6; + const isValidArn = Boolean(isArn && partition && service && bucket); + if (isArn && !isValidArn) { + throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); + } + return isValidArn; + }, "isArnBucketName"); + var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config) => { + const configProvider = /* @__PURE__ */ __name(async () => { + const configValue = config[configKey] ?? config[canonicalEndpointParamKey]; + if (typeof configValue === "function") { + return configValue(); } + return configValue; + }, "configProvider"); + if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { + return async () => { + const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; + const configValue = (credentials == null ? void 0 : credentials.credentialScope) ?? (credentials == null ? void 0 : credentials.CredentialScope); + return configValue; + }; } - return request2; - }, "prepareRequest"); - var iso8601 = /* @__PURE__ */ __name((time) => toDate(time).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601"); - var toDate = /* @__PURE__ */ __name((time) => { - if (typeof time === "number") { - return new Date(time * 1e3); + if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { + return async () => { + const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; + const configValue = (credentials == null ? void 0 : credentials.accountId) ?? (credentials == null ? void 0 : credentials.AccountId); + return configValue; + }; } - if (typeof time === "string") { - if (Number(time)) { - return new Date(Number(time) * 1e3); - } - return new Date(time); + if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { + return async () => { + const endpoint = await configProvider(); + if (endpoint && typeof endpoint === "object") { + if ("url" in endpoint) { + return endpoint.url.href; + } + if ("hostname" in endpoint) { + const { protocol, hostname, port, path } = endpoint; + return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; + } + } + return endpoint; + }; } - return time; - }, "toDate"); - var _SignatureV4 = class _SignatureV4 { - constructor({ - applyChecksum, - credentials, - region, - service, - sha256, - uriEscapePath = true - }) { - this.headerFormatter = new HeaderFormatter(); - this.service = service; - this.sha256 = sha256; - this.uriEscapePath = uriEscapePath; - this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; - this.regionProvider = (0, import_util_middleware3.normalizeProvider)(region); - this.credentialProvider = (0, import_util_middleware3.normalizeProvider)(credentials); + return configProvider; + }, "createConfigValueProvider"); + var import_getEndpointFromConfig = require_getEndpointFromConfig(); + var import_url_parser = require_dist_cjs28(); + var toEndpointV1 = /* @__PURE__ */ __name((endpoint) => { + if (typeof endpoint === "object") { + if ("url" in endpoint) { + return (0, import_url_parser.parseUrl)(endpoint.url); + } + return endpoint; } - async presign(originalRequest, options = {}) { - const { - signingDate = /* @__PURE__ */ new Date(), - expiresIn = 3600, - unsignableHeaders, - unhoistableHeaders, - signableHeaders, - signingRegion, - signingService - } = options; - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? await this.regionProvider(); - const { longDate, shortDate } = formatDate(signingDate); - if (expiresIn > MAX_PRESIGNED_TTL) { - return Promise.reject( - "Signature version 4 presigned URLs must have an expiration date less than one week in the future" - ); + return (0, import_url_parser.parseUrl)(endpoint); + }, "toEndpointV1"); + var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context) => { + if (!clientConfig.endpoint) { + let endpointFromConfig; + if (clientConfig.serviceConfiguredEndpoint) { + endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); + } else { + endpointFromConfig = await (0, import_getEndpointFromConfig.getEndpointFromConfig)(clientConfig.serviceId); } - const scope = createScope(shortDate, region, signingService ?? this.service); - const request2 = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders }); - if (credentials.sessionToken) { - request2.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; + if (endpointFromConfig) { + clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); } - request2.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; - request2.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; - request2.query[AMZ_DATE_QUERY_PARAM] = longDate; - request2.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); - const canonicalHeaders = getCanonicalHeaders(request2, unsignableHeaders, signableHeaders); - request2.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); - request2.query[SIGNATURE_QUERY_PARAM] = await this.getSignature( - longDate, - scope, - this.getSigningKey(credentials, region, shortDate, signingService), - this.createCanonicalRequest(request2, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256)) - ); - return request2; } - async sign(toSign, options) { - if (typeof toSign === "string") { - return this.signString(toSign, options); - } else if (toSign.headers && toSign.payload) { - return this.signEvent(toSign, options); - } else if (toSign.message) { - return this.signMessage(toSign, options); - } else { - return this.signRequest(toSign, options); + const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); + if (typeof clientConfig.endpointProvider !== "function") { + throw new Error("config.endpointProvider is not set."); + } + const endpoint = clientConfig.endpointProvider(endpointParams, context); + return endpoint; + }, "getEndpointFromInstructions"); + var resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => { + var _a; + const endpointParams = {}; + const instructions = ((_a = instructionsSupplier == null ? void 0 : instructionsSupplier.getEndpointParameterInstructions) == null ? void 0 : _a.call(instructionsSupplier)) || {}; + for (const [name, instruction] of Object.entries(instructions)) { + switch (instruction.type) { + case "staticContextParams": + endpointParams[name] = instruction.value; + break; + case "contextParams": + endpointParams[name] = commandInput[instruction.name]; + break; + case "clientContextParams": + case "builtInParams": + endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)(); + break; + default: + throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); } } - async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) { - const region = signingRegion ?? await this.regionProvider(); - const { shortDate, longDate } = formatDate(signingDate); - const scope = createScope(shortDate, region, signingService ?? this.service); - const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256); - const hash = new this.sha256(); - hash.update(headers); - const hashedHeaders = (0, import_util_hex_encoding.toHex)(await hash.digest()); - const stringToSign = [ - EVENT_ALGORITHM_IDENTIFIER, - longDate, - scope, - priorSignature, - hashedHeaders, - hashedPayload - ].join("\n"); - return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); + if (Object.keys(instructions).length === 0) { + Object.assign(endpointParams, clientConfig); } - async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) { - const promise = this.signEvent( + if (String(clientConfig.serviceId).toLowerCase() === "s3") { + await resolveParamsForS3(endpointParams); + } + return endpointParams; + }, "resolveParams"); + var import_core3 = (init_dist_es(), __toCommonJS(dist_es_exports)); + var import_util_middleware3 = require_dist_cjs10(); + var endpointMiddleware = /* @__PURE__ */ __name(({ + config, + instructions + }) => { + return (next, context) => async (args) => { + var _a, _b, _c; + if (config.endpoint) { + (0, import_core3.setFeature)(context, "ENDPOINT_OVERRIDE", "N"); + } + const endpoint = await getEndpointFromInstructions( + args.input, { - headers: this.headerFormatter.format(signableMessage.message.headers), - payload: signableMessage.message.body + getEndpointParameterInstructions() { + return instructions; + } }, - { - signingDate, - signingRegion, - signingService, - priorSignature: signableMessage.priorSignature - } + { ...config }, + context ); - return promise.then((signature) => { - return { message: signableMessage.message, signature }; - }); - } - async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? await this.regionProvider(); - const { shortDate } = formatDate(signingDate); - const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); - hash.update((0, import_util_utf84.toUint8Array)(stringToSign)); - return (0, import_util_hex_encoding.toHex)(await hash.digest()); - } - async signRequest(requestToSign, { - signingDate = /* @__PURE__ */ new Date(), - signableHeaders, - unsignableHeaders, - signingRegion, - signingService - } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? await this.regionProvider(); - const request2 = prepareRequest(requestToSign); - const { longDate, shortDate } = formatDate(signingDate); - const scope = createScope(shortDate, region, signingService ?? this.service); - request2.headers[AMZ_DATE_HEADER] = longDate; - if (credentials.sessionToken) { - request2.headers[TOKEN_HEADER] = credentials.sessionToken; - } - const payloadHash = await getPayloadHash(request2, this.sha256); - if (!hasHeader(SHA256_HEADER, request2.headers) && this.applyChecksum) { - request2.headers[SHA256_HEADER] = payloadHash; + context.endpointV2 = endpoint; + context.authSchemes = (_a = endpoint.properties) == null ? void 0 : _a.authSchemes; + const authScheme = (_b = context.authSchemes) == null ? void 0 : _b[0]; + if (authScheme) { + context["signing_region"] = authScheme.signingRegion; + context["signing_service"] = authScheme.signingName; + const smithyContext = (0, import_util_middleware3.getSmithyContext)(context); + const httpAuthOption = (_c = smithyContext == null ? void 0 : smithyContext.selectedHttpAuthScheme) == null ? void 0 : _c.httpAuthOption; + if (httpAuthOption) { + httpAuthOption.signingProperties = Object.assign( + httpAuthOption.signingProperties || {}, + { + signing_region: authScheme.signingRegion, + signingRegion: authScheme.signingRegion, + signing_service: authScheme.signingName, + signingName: authScheme.signingName, + signingRegionSet: authScheme.signingRegionSet + }, + authScheme.properties + ); + } } - const canonicalHeaders = getCanonicalHeaders(request2, unsignableHeaders, signableHeaders); - const signature = await this.getSignature( - longDate, - scope, - this.getSigningKey(credentials, region, shortDate, signingService), - this.createCanonicalRequest(request2, canonicalHeaders, payloadHash) + return next({ + ...args + }); + }; + }, "endpointMiddleware"); + var import_middleware_serde2 = require_dist_cjs12(); + var endpointMiddlewareOptions = { + step: "serialize", + tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], + name: "endpointV2Middleware", + override: true, + relation: "before", + toMiddleware: import_middleware_serde2.serializerMiddlewareOption.name + }; + var getEndpointPlugin = /* @__PURE__ */ __name((config, instructions) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo( + endpointMiddleware({ + config, + instructions + }), + endpointMiddlewareOptions ); - request2.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; - return request2; } - createCanonicalRequest(request2, canonicalHeaders, payloadHash) { - const sortedHeaders = Object.keys(canonicalHeaders).sort(); - return `${request2.method} -${this.getCanonicalPath(request2)} -${getCanonicalQuery(request2)} -${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} + }), "getEndpointPlugin"); + var import_getEndpointFromConfig2 = require_getEndpointFromConfig(); + var resolveEndpointConfig = /* @__PURE__ */ __name((input) => { + const tls = input.tls ?? true; + const { endpoint } = input; + const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await (0, import_util_middleware3.normalizeProvider)(endpoint)()) : void 0; + const isCustomEndpoint = !!endpoint; + const resolvedConfig = { + ...input, + endpoint: customEndpointProvider, + tls, + isCustomEndpoint, + useDualstackEndpoint: (0, import_util_middleware3.normalizeProvider)(input.useDualstackEndpoint ?? false), + useFipsEndpoint: (0, import_util_middleware3.normalizeProvider)(input.useFipsEndpoint ?? false) + }; + let configuredEndpointPromise = void 0; + resolvedConfig.serviceConfiguredEndpoint = async () => { + if (input.serviceId && !configuredEndpointPromise) { + configuredEndpointPromise = (0, import_getEndpointFromConfig2.getEndpointFromConfig)(input.serviceId); + } + return configuredEndpointPromise; + }; + return resolvedConfig; + }, "resolveEndpointConfig"); + } +}); + +// ../../../node_modules/uuid/dist/esm-node/rng.js +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + import_crypto.default.randomFillSync(rnds8Pool); + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} +var import_crypto, rnds8Pool, poolPtr; +var init_rng = __esm({ + "../../../node_modules/uuid/dist/esm-node/rng.js"() { + import_crypto = __toESM(require("crypto")); + rnds8Pool = new Uint8Array(256); + poolPtr = rnds8Pool.length; + } +}); + +// ../../../node_modules/uuid/dist/esm-node/regex.js +var regex_default; +var init_regex = __esm({ + "../../../node_modules/uuid/dist/esm-node/regex.js"() { + regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; + } +}); + +// ../../../node_modules/uuid/dist/esm-node/validate.js +function validate(uuid) { + return typeof uuid === "string" && regex_default.test(uuid); +} +var validate_default; +var init_validate = __esm({ + "../../../node_modules/uuid/dist/esm-node/validate.js"() { + init_regex(); + validate_default = validate; + } +}); + +// ../../../node_modules/uuid/dist/esm-node/stringify.js +function unsafeStringify(arr, offset = 0) { + return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; +} +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!validate_default(uuid)) { + throw TypeError("Stringified UUID is invalid"); + } + return uuid; +} +var byteToHex, stringify_default; +var init_stringify = __esm({ + "../../../node_modules/uuid/dist/esm-node/stringify.js"() { + init_validate(); + byteToHex = []; + for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 256).toString(16).slice(1)); + } + stringify_default = stringify; + } +}); + +// ../../../node_modules/uuid/dist/esm-node/v1.js +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq; + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || rng)(); + if (node == null) { + node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + if (clockseq == null) { + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; + } + } + let msecs = options.msecs !== void 0 ? options.msecs : Date.now(); + let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; + if (dt < 0 && options.clockseq === void 0) { + clockseq = clockseq + 1 & 16383; + } + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) { + nsecs = 0; + } + if (nsecs >= 1e4) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + msecs += 122192928e5; + const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; + b[i++] = tl >>> 24 & 255; + b[i++] = tl >>> 16 & 255; + b[i++] = tl >>> 8 & 255; + b[i++] = tl & 255; + const tmh = msecs / 4294967296 * 1e4 & 268435455; + b[i++] = tmh >>> 8 & 255; + b[i++] = tmh & 255; + b[i++] = tmh >>> 24 & 15 | 16; + b[i++] = tmh >>> 16 & 255; + b[i++] = clockseq >>> 8 | 128; + b[i++] = clockseq & 255; + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + return buf || unsafeStringify(b); +} +var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default; +var init_v1 = __esm({ + "../../../node_modules/uuid/dist/esm-node/v1.js"() { + init_rng(); + init_stringify(); + _lastMSecs = 0; + _lastNSecs = 0; + v1_default = v1; + } +}); -${sortedHeaders.join(";")} -${payloadHash}`; - } - async createStringToSign(longDate, credentialScope, canonicalRequest) { - const hash = new this.sha256(); - hash.update((0, import_util_utf84.toUint8Array)(canonicalRequest)); - const hashedRequest = await hash.digest(); - return `${ALGORITHM_IDENTIFIER} -${longDate} -${credentialScope} -${(0, import_util_hex_encoding.toHex)(hashedRequest)}`; - } - getCanonicalPath({ path }) { - if (this.uriEscapePath) { - const normalizedPathSegments = []; - for (const pathSegment of path.split("/")) { - if ((pathSegment == null ? void 0 : pathSegment.length) === 0) - continue; - if (pathSegment === ".") - continue; - if (pathSegment === "..") { - normalizedPathSegments.pop(); - } else { - normalizedPathSegments.push(pathSegment); - } - } - const normalizedPath = `${(path == null ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path == null ? void 0 : path.endsWith("/")) ? "/" : ""}`; - const doubleEncoded = (0, import_util_uri_escape.escapeUri)(normalizedPath); - return doubleEncoded.replace(/%2F/g, "/"); - } - return path; - } - async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { - const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); - const hash = new this.sha256(await keyPromise); - hash.update((0, import_util_utf84.toUint8Array)(stringToSign)); - return (0, import_util_hex_encoding.toHex)(await hash.digest()); - } - getSigningKey(credentials, region, shortDate, service) { - return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); - } - validateResolvedCredentials(credentials) { - if (typeof credentials !== "object" || // @ts-expect-error: Property 'accessKeyId' does not exist on type 'object'.ts(2339) - typeof credentials.accessKeyId !== "string" || // @ts-expect-error: Property 'secretAccessKey' does not exist on type 'object'.ts(2339) - typeof credentials.secretAccessKey !== "string") { - throw new Error("Resolved credential object is not valid"); - } - } - }; - __name(_SignatureV4, "SignatureV4"); - var SignatureV42 = _SignatureV4; - var formatDate = /* @__PURE__ */ __name((now) => { - const longDate = iso8601(now).replace(/[\-:]/g, ""); - return { - longDate, - shortDate: longDate.slice(0, 8) - }; - }, "formatDate"); - var getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(headers).sort().join(";"), "getCanonicalHeaderList"); +// ../../../node_modules/uuid/dist/esm-node/parse.js +function parse(uuid) { + if (!validate_default(uuid)) { + throw TypeError("Invalid UUID"); + } + let v; + const arr = new Uint8Array(16); + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 255; + arr[2] = v >>> 8 & 255; + arr[3] = v & 255; + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 255; + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 255; + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 255; + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255; + arr[11] = v / 4294967296 & 255; + arr[12] = v >>> 24 & 255; + arr[13] = v >>> 16 & 255; + arr[14] = v >>> 8 & 255; + arr[15] = v & 255; + return arr; +} +var parse_default; +var init_parse = __esm({ + "../../../node_modules/uuid/dist/esm-node/parse.js"() { + init_validate(); + parse_default = parse; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js -var import_signature_v4, resolveAwsSdkSigV4Config, resolveAWSSDKSigV4Config; -var init_resolveAwsSdkSigV4Config = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() { - init_dist_es(); - import_signature_v4 = __toESM(require_dist_cjs47()); - resolveAwsSdkSigV4Config = (config) => { - let normalizedCreds; - if (config.credentials) { - normalizedCreds = memoizeIdentityProvider(config.credentials, isIdentityExpired, doesIdentityRequireRefresh); - } - if (!normalizedCreds) { - if (config.credentialDefaultProvider) { - normalizedCreds = normalizeProvider(config.credentialDefaultProvider(Object.assign({}, config, { - parentClientConfig: config - }))); - } else { - normalizedCreds = async () => { - throw new Error("`credentials` is missing"); - }; - } - } - const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config; - let signer; - if (config.signer) { - signer = normalizeProvider(config.signer); - } else if (config.regionInfoProvider) { - signer = () => normalizeProvider(config.region)().then(async (region) => [ - await config.regionInfoProvider(region, { - useFipsEndpoint: await config.useFipsEndpoint(), - useDualstackEndpoint: await config.useDualstackEndpoint() - }) || {}, - region - ]).then(([regionInfo, region]) => { - const { signingRegion, signingService } = regionInfo; - config.signingRegion = config.signingRegion || signingRegion || region; - config.signingName = config.signingName || signingService || config.serviceId; - const params = { - ...config, - credentials: normalizedCreds, - region: config.signingRegion, - service: config.signingName, - sha256, - uriEscapePath: signingEscapePath - }; - const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; - return new SignerCtor(params); - }); - } else { - signer = async (authScheme) => { - authScheme = Object.assign({}, { - name: "sigv4", - signingName: config.signingName || config.defaultSigningName, - signingRegion: await normalizeProvider(config.region)(), - properties: {} - }, authScheme); - const signingRegion = authScheme.signingRegion; - const signingService = authScheme.signingName; - config.signingRegion = config.signingRegion || signingRegion; - config.signingName = config.signingName || signingService || config.serviceId; - const params = { - ...config, - credentials: normalizedCreds, - region: config.signingRegion, - service: config.signingName, - sha256, - uriEscapePath: signingEscapePath - }; - const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; - return new SignerCtor(params); - }; +// ../../../node_modules/uuid/dist/esm-node/v35.js +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = []; + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + return bytes; +} +function v35(name, version2, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + var _namespace; + if (typeof value === "string") { + value = stringToBytes(value); + } + if (typeof namespace === "string") { + namespace = parse_default(namespace); + } + if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { + throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); + } + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 15 | version2; + bytes[8] = bytes[8] & 63 | 128; + if (buf) { + offset = offset || 0; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; } - return { - ...config, - systemClockOffset, - signingEscapePath, - credentials: normalizedCreds, - signer - }; + return buf; + } + return unsafeStringify(bytes); + } + try { + generateUUID.name = name; + } catch (err) { + } + generateUUID.DNS = DNS; + generateUUID.URL = URL2; + return generateUUID; +} +var DNS, URL2; +var init_v35 = __esm({ + "../../../node_modules/uuid/dist/esm-node/v35.js"() { + init_stringify(); + init_parse(); + DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; + URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; + } +}); + +// ../../../node_modules/uuid/dist/esm-node/md5.js +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === "string") { + bytes = Buffer.from(bytes, "utf8"); + } + return import_crypto2.default.createHash("md5").update(bytes).digest(); +} +var import_crypto2, md5_default; +var init_md5 = __esm({ + "../../../node_modules/uuid/dist/esm-node/md5.js"() { + import_crypto2 = __toESM(require("crypto")); + md5_default = md5; + } +}); + +// ../../../node_modules/uuid/dist/esm-node/v3.js +var v3, v3_default; +var init_v3 = __esm({ + "../../../node_modules/uuid/dist/esm-node/v3.js"() { + init_v35(); + init_md5(); + v3 = v35("v3", 48, md5_default); + v3_default = v3; + } +}); + +// ../../../node_modules/uuid/dist/esm-node/native.js +var import_crypto3, native_default; +var init_native = __esm({ + "../../../node_modules/uuid/dist/esm-node/native.js"() { + import_crypto3 = __toESM(require("crypto")); + native_default = { + randomUUID: import_crypto3.default.randomUUID }; - resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js -var init_aws_sdk = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js"() { - init_AwsSdkSigV4Signer(); - init_AwsSdkSigV4ASigner(); - init_resolveAwsSdkSigV4AConfig(); - init_resolveAwsSdkSigV4Config(); +// ../../../node_modules/uuid/dist/esm-node/v4.js +function v4(options, buf, offset) { + if (native_default.randomUUID && !buf && !options) { + return native_default.randomUUID(); + } + options = options || {}; + const rnds = options.random || (options.rng || rng)(); + rnds[6] = rnds[6] & 15 | 64; + rnds[8] = rnds[8] & 63 | 128; + if (buf) { + offset = offset || 0; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +var v4_default; +var init_v4 = __esm({ + "../../../node_modules/uuid/dist/esm-node/v4.js"() { + init_native(); + init_rng(); + init_stringify(); + v4_default = v4; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js -var init_httpAuthSchemes2 = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() { - init_aws_sdk(); +// ../../../node_modules/uuid/dist/esm-node/sha1.js +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === "string") { + bytes = Buffer.from(bytes, "utf8"); + } + return import_crypto4.default.createHash("sha1").update(bytes).digest(); +} +var import_crypto4, sha1_default; +var init_sha1 = __esm({ + "../../../node_modules/uuid/dist/esm-node/sha1.js"() { + import_crypto4 = __toESM(require("crypto")); + sha1_default = sha1; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js -var _toStr, _toBool, _toNum; -var init_coercing_serializers = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() { - _toStr = (val2) => { - if (val2 == null) { - return val2; - } - if (typeof val2 === "number" || typeof val2 === "bigint") { - const warning = new Error(`Received number ${val2} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); - return String(val2); - } - if (typeof val2 === "boolean") { - const warning = new Error(`Received boolean ${val2} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); - return String(val2); - } - return val2; - }; - _toBool = (val2) => { - if (val2 == null) { - return val2; - } - if (typeof val2 === "number") { - } - if (typeof val2 === "string") { - const lowercase = val2.toLowerCase(); - if (val2 !== "" && lowercase !== "false" && lowercase !== "true") { - const warning = new Error(`Received string "${val2}" where a boolean was expected.`); - warning.name = "Warning"; - console.warn(warning); - } - return val2 !== "" && lowercase !== "false"; - } - return val2; - }; - _toNum = (val2) => { - if (val2 == null) { - return val2; - } - if (typeof val2 === "boolean") { - } - if (typeof val2 === "string") { - const num = Number(val2); - if (num.toString() !== val2) { - const warning = new Error(`Received string "${val2}" where a number was expected.`); - warning.name = "Warning"; - console.warn(warning); - return val2; - } - return num; - } - return val2; - }; +// ../../../node_modules/uuid/dist/esm-node/v5.js +var v5, v5_default; +var init_v5 = __esm({ + "../../../node_modules/uuid/dist/esm-node/v5.js"() { + init_v35(); + init_sha1(); + v5 = v35("v5", 80, sha1_default); + v5_default = v5; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js -var import_smithy_client2, awsExpectUnion; -var init_awsExpectUnion = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() { - import_smithy_client2 = __toESM(require_dist_cjs37()); - awsExpectUnion = (value) => { - if (value == null) { - return void 0; - } - if (typeof value === "object" && "__type" in value) { - delete value.__type; - } - return (0, import_smithy_client2.expectUnion)(value); - }; +// ../../../node_modules/uuid/dist/esm-node/nil.js +var nil_default; +var init_nil = __esm({ + "../../../node_modules/uuid/dist/esm-node/nil.js"() { + nil_default = "00000000-0000-0000-0000-000000000000"; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js -var import_smithy_client3, collectBodyString; -var init_common = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() { - import_smithy_client3 = __toESM(require_dist_cjs37()); - collectBodyString = (streamBody, context) => (0, import_smithy_client3.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); +// ../../../node_modules/uuid/dist/esm-node/version.js +function version(uuid) { + if (!validate_default(uuid)) { + throw TypeError("Invalid UUID"); + } + return parseInt(uuid.slice(14, 15), 16); +} +var version_default; +var init_version = __esm({ + "../../../node_modules/uuid/dist/esm-node/version.js"() { + init_validate(); + version_default = version; } }); -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js -var parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode; -var init_parseJsonBody = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() { - init_common(); - parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - try { - return JSON.parse(encoded); - } catch (e) { - if (e?.name === "SyntaxError") { - Object.defineProperty(e, "$responseBodyText", { - value: encoded - }); - } - throw e; - } - } - return {}; - }); - parseJsonErrorBody = async (errorBody, context) => { - const value = await parseJsonBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; - }; - loadRestJsonErrorCode = (output, data) => { - const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); - const sanitizeErrorCode = (rawValue) => { - let cleanValue = rawValue; - if (typeof cleanValue === "number") { - cleanValue = cleanValue.toString(); - } - if (cleanValue.indexOf(",") >= 0) { - cleanValue = cleanValue.split(",")[0]; - } - if (cleanValue.indexOf(":") >= 0) { - cleanValue = cleanValue.split(":")[0]; - } - if (cleanValue.indexOf("#") >= 0) { - cleanValue = cleanValue.split("#")[1]; - } - return cleanValue; - }; - const headerKey = findKey(output.headers, "x-amzn-errortype"); - if (headerKey !== void 0) { - return sanitizeErrorCode(output.headers[headerKey]); - } - if (data.code !== void 0) { - return sanitizeErrorCode(data.code); - } - if (data["__type"] !== void 0) { - return sanitizeErrorCode(data["__type"]); - } - }; +// ../../../node_modules/uuid/dist/esm-node/index.js +var esm_node_exports = {}; +__export(esm_node_exports, { + NIL: () => nil_default, + parse: () => parse_default, + stringify: () => stringify_default, + v1: () => v1_default, + v3: () => v3_default, + v4: () => v4_default, + v5: () => v5_default, + validate: () => validate_default, + version: () => version_default +}); +var init_esm_node = __esm({ + "../../../node_modules/uuid/dist/esm-node/index.js"() { + init_v1(); + init_v3(); + init_v4(); + init_v5(); + init_nil(); + init_version(); + init_validate(); + init_stringify(); + init_parse(); } }); -// ../../../node_modules/fast-xml-parser/src/util.js -var require_util = __commonJS({ - "../../../node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } - } +// ../../../node_modules/@smithy/service-error-classification/dist-cjs/index.js +var require_dist_cjs30 = __commonJS({ + "../../../node_modules/@smithy/service-error-classification/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } + return to; }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; - } -}); - -// ../../../node_modules/fast-xml-parser/src/validator.js -var require_validator = __commonJS({ - "../../../node_modules/fast-xml-parser/src/validator.js"(exports2) { - "use strict"; - var util = require_util(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + isClockSkewCorrectedError: () => isClockSkewCorrectedError, + isClockSkewError: () => isClockSkewError, + isRetryableByTrait: () => isRetryableByTrait, + isServerError: () => isServerError, + isThrottlingError: () => isThrottlingError, + isTransientError: () => isTransientError + }); + module2.exports = __toCommonJS2(src_exports); + var CLOCK_SKEW_ERROR_CODES = [ + "AuthFailure", + "InvalidSignatureException", + "RequestExpired", + "RequestInTheFuture", + "RequestTimeTooSkewed", + "SignatureDoesNotMatch" + ]; + var THROTTLING_ERROR_CODES = [ + "BandwidthLimitExceeded", + "EC2ThrottledException", + "LimitExceededException", + "PriorRequestNotComplete", + "ProvisionedThroughputExceededException", + "RequestLimitExceeded", + "RequestThrottled", + "RequestThrottledException", + "SlowDown", + "ThrottledException", + "Throttling", + "ThrottlingException", + "TooManyRequestsException", + "TransactionInProgressException" + // DynamoDB + ]; + var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; + var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; + var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; + var isRetryableByTrait = /* @__PURE__ */ __name((error) => error.$retryable !== void 0, "isRetryableByTrait"); + var isClockSkewError = /* @__PURE__ */ __name((error) => CLOCK_SKEW_ERROR_CODES.includes(error.name), "isClockSkewError"); + var isClockSkewCorrectedError = /* @__PURE__ */ __name((error) => { + var _a; + return (_a = error.$metadata) == null ? void 0 : _a.clockSkewCorrected; + }, "isClockSkewCorrectedError"); + var isThrottlingError = /* @__PURE__ */ __name((error) => { + var _a, _b; + return ((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) === 429 || THROTTLING_ERROR_CODES.includes(error.name) || ((_b = error.$retryable) == null ? void 0 : _b.throttling) == true; + }, "isThrottlingError"); + var isTransientError = /* @__PURE__ */ __name((error) => { + var _a; + return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0); + }, "isTransientError"); + var isServerError = /* @__PURE__ */ __name((error) => { + var _a; + if (((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) !== void 0) { + const statusCode = error.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) { + return true; } + return false; } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); + return false; + }, "isServerError"); + } +}); + +// ../../../node_modules/@smithy/util-retry/dist-cjs/index.js +var require_dist_cjs31 = __commonJS({ + "../../../node_modules/@smithy/util-retry/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } - return true; + return to; }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + AdaptiveRetryStrategy: () => AdaptiveRetryStrategy, + ConfiguredRetryStrategy: () => ConfiguredRetryStrategy, + DEFAULT_MAX_ATTEMPTS: () => DEFAULT_MAX_ATTEMPTS, + DEFAULT_RETRY_DELAY_BASE: () => DEFAULT_RETRY_DELAY_BASE, + DEFAULT_RETRY_MODE: () => DEFAULT_RETRY_MODE, + DefaultRateLimiter: () => DefaultRateLimiter, + INITIAL_RETRY_TOKENS: () => INITIAL_RETRY_TOKENS, + INVOCATION_ID_HEADER: () => INVOCATION_ID_HEADER, + MAXIMUM_RETRY_DELAY: () => MAXIMUM_RETRY_DELAY, + NO_RETRY_INCREMENT: () => NO_RETRY_INCREMENT, + REQUEST_HEADER: () => REQUEST_HEADER, + RETRY_COST: () => RETRY_COST, + RETRY_MODES: () => RETRY_MODES, + StandardRetryStrategy: () => StandardRetryStrategy, + THROTTLING_RETRY_DELAY_BASE: () => THROTTLING_RETRY_DELAY_BASE, + TIMEOUT_RETRY_COST: () => TIMEOUT_RETRY_COST + }); + module2.exports = __toCommonJS2(src_exports); + var RETRY_MODES = /* @__PURE__ */ ((RETRY_MODES2) => { + RETRY_MODES2["STANDARD"] = "standard"; + RETRY_MODES2["ADAPTIVE"] = "adaptive"; + return RETRY_MODES2; + })(RETRY_MODES || {}); + var DEFAULT_MAX_ATTEMPTS = 3; + var DEFAULT_RETRY_MODE = "standard"; + var import_service_error_classification = require_dist_cjs30(); + var _DefaultRateLimiter = class _DefaultRateLimiter { + constructor(options) { + this.currentCapacity = 0; + this.enabled = false; + this.lastMaxRate = 0; + this.measuredTxRate = 0; + this.requestCount = 0; + this.lastTimestamp = 0; + this.timeWindow = 0; + this.beta = (options == null ? void 0 : options.beta) ?? 0.7; + this.minCapacity = (options == null ? void 0 : options.minCapacity) ?? 1; + this.minFillRate = (options == null ? void 0 : options.minFillRate) ?? 0.5; + this.scaleConstant = (options == null ? void 0 : options.scaleConstant) ?? 0.4; + this.smooth = (options == null ? void 0 : options.smooth) ?? 0.8; + const currentTimeInSeconds = this.getCurrentTimeInSeconds(); + this.lastThrottleTime = currentTimeInSeconds; + this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); + this.fillRate = this.minFillRate; + this.maxCapacity = this.minCapacity; } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } + getCurrentTimeInSeconds() { + return Date.now() / 1e3; + } + async getSendToken() { + return this.acquireTokenBucket(1); + } + async acquireTokenBucket(amount) { + if (!this.enabled) { + return; } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } + this.refillTokenBucket(); + if (amount > this.currentCapacity) { + const delay = (amount - this.currentCapacity) / this.fillRate * 1e3; + await new Promise((resolve) => setTimeout(resolve, delay)); } + this.currentCapacity = this.currentCapacity - amount; } - return i; - } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } + refillTokenBucket() { + const timestamp = this.getCurrentTimeInSeconds(); + if (!this.lastTimestamp) { + this.lastTimestamp = timestamp; + return; } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; + const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; + this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); + this.lastTimestamp = timestamp; } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; + updateClientSendingRate(response) { + let calculatedRate; + this.updateMeasuredRate(); + if ((0, import_service_error_classification.isThrottlingError)(response)) { + const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); + this.lastMaxRate = rateToUse; + this.calculateTimeWindow(); + this.lastThrottleTime = this.getCurrentTimeInSeconds(); + calculatedRate = this.cubicThrottle(rateToUse); + this.enableTokenBucket(); } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); + this.calculateTimeWindow(); + calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); } + const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); + this.updateTokenBucketRate(newRate); } - return true; - } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; + calculateTimeWindow() { + this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; + cubicThrottle(rateToUse) { + return this.getPrecise(rateToUse * this.beta); } - return -1; - } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); + cubicSuccess(timestamp) { + return this.getPrecise( + this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate + ); + } + enableTokenBucket() { + this.enabled = true; + } + updateTokenBucketRate(newRate) { + this.refillTokenBucket(); + this.fillRate = Math.max(newRate, this.minFillRate); + this.maxCapacity = Math.max(newRate, this.minCapacity); + this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; + updateMeasuredRate() { + const t = this.getCurrentTimeInSeconds(); + const timeBucket = Math.floor(t * 2) / 2; + this.requestCount++; + if (timeBucket > this.lastTxRateBucket) { + const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); + this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); + this.requestCount = 0; + this.lastTxRateBucket = timeBucket; + } } - return i; - } - function getErrorObject(code, message, lineNumber) { + getPrecise(num) { + return parseFloat(num.toFixed(8)); + } + }; + __name(_DefaultRateLimiter, "DefaultRateLimiter"); + var DefaultRateLimiter = _DefaultRateLimiter; + var DEFAULT_RETRY_DELAY_BASE = 100; + var MAXIMUM_RETRY_DELAY = 20 * 1e3; + var THROTTLING_RETRY_DELAY_BASE = 500; + var INITIAL_RETRY_TOKENS = 500; + var RETRY_COST = 5; + var TIMEOUT_RETRY_COST = 10; + var NO_RETRY_INCREMENT = 1; + var INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; + var REQUEST_HEADER = "amz-sdk-request"; + var getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => { + let delayBase = DEFAULT_RETRY_DELAY_BASE; + const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => { + return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); + }, "computeNextBackoffDelay"); + const setDelayBase = /* @__PURE__ */ __name((delay) => { + delayBase = delay; + }, "setDelayBase"); return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col - } + computeNextBackoffDelay, + setDelayBase }; - } - function validateAttrName(attrName) { - return util.isName(attrName); - } - function validateTagName(tagname) { - return util.isName(tagname); - } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); + }, "getDefaultRetryBackoffStrategy"); + var createDefaultRetryToken = /* @__PURE__ */ __name(({ + retryDelay, + retryCount, + retryCost + }) => { + const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount"); + const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay"); + const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost"); return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 + getRetryCount, + getRetryDelay, + getRetryCost }; - } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// ../../../node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "../../../node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// ../../../node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "../../../node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; + }, "createDefaultRetryToken"); + var _StandardRetryStrategy = class _StandardRetryStrategy { + constructor(maxAttempts) { + this.maxAttempts = maxAttempts; + this.mode = "standard"; + this.capacity = INITIAL_RETRY_TOKENS; + this.retryBackoffStrategy = getDefaultRetryBackoffStrategy(); + this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + async acquireInitialRetryToken(retryTokenScope) { + return createDefaultRetryToken({ + retryDelay: DEFAULT_RETRY_DELAY_BASE, + retryCount: 0 + }); } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); + async refreshRetryTokenForRetry(token, errorInfo) { + const maxAttempts = await this.getMaxAttempts(); + if (this.shouldRetry(token, errorInfo, maxAttempts)) { + const errorType = errorInfo.errorType; + this.retryBackoffStrategy.setDelayBase( + errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE + ); + const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); + const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; + const capacityCost = this.getCapacityCost(errorType); + this.capacity -= capacityCost; + return createDefaultRetryToken({ + retryDelay, + retryCount: token.getRetryCount() + 1, + retryCost: capacityCost + }); } + throw new Error("No retry token available"); } - }; - module2.exports = XmlNode; - } -}); - -// ../../../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "../../../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } - } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); + recordSuccess(token) { + this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); + } + /** + * @returns the current available retry capacity. + * + * This number decreases when retries are executed and refills when requests or retries succeed. + */ + getCapacity() { + return this.capacity; + } + async getMaxAttempts() { + try { + return await this.maxAttemptsProvider(); + } catch (error) { + console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); + return DEFAULT_MAX_ATTEMPTS; } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); } - return { entities, i }; - } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; + shouldRetry(tokenToRenew, errorInfo, maxAttempts) { + const attempts = tokenToRenew.getRetryCount() + 1; + return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; + getCapacityCost(errorType) { + return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; + } + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; } - return [entityName2, val2, i]; - } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; - } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; - } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; - } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; - } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; - } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// ../../../node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "../../../node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ }; - function toNumber(str, options = {}) { - options = Object.assign({}, consider, options); - if (!str || typeof str !== "string") return str; - let trimmedStr = str.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str; - } else if (eNotation) { - if (options.eNotation) return num; - else return str; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str; - } + __name(_StandardRetryStrategy, "StandardRetryStrategy"); + var StandardRetryStrategy = _StandardRetryStrategy; + var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = "adaptive"; + const { rateLimiter } = options ?? {}; + this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); + this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); + } + async acquireInitialRetryToken(retryTokenScope) { + await this.rateLimiter.getSendToken(); + return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + this.rateLimiter.updateClientSendingRate(errorInfo); + return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + } + recordSuccess(token) { + this.rateLimiter.updateClientSendingRate({}); + this.standardRetryStrategy.recordSuccess(token); + } + }; + __name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); + var AdaptiveRetryStrategy = _AdaptiveRetryStrategy; + var _ConfiguredRetryStrategy = class _ConfiguredRetryStrategy extends StandardRetryStrategy { + /** + * @param maxAttempts - the maximum number of retry attempts allowed. + * e.g., if set to 3, then 4 total requests are possible. + * @param computeNextBackoffDelay - a millisecond delay for each retry or a function that takes the retry attempt + * and returns the delay. + * + * @example exponential backoff. + * ```js + * new Client({ + * retryStrategy: new ConfiguredRetryStrategy(3, (attempt) => attempt ** 2) + * }); + * ``` + * @example constant delay. + * ```js + * new Client({ + * retryStrategy: new ConfiguredRetryStrategy(3, 2000) + * }); + * ``` + */ + constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) { + super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); + if (typeof computeNextBackoffDelay === "number") { + this.computeNextBackoffDelay = () => computeNextBackoffDelay; } else { - return str; + this.computeNextBackoffDelay = computeNextBackoffDelay; } } - } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); + return token; } - return numStr; - } - module2.exports = toNumber; + }; + __name(_ConfiguredRetryStrategy, "ConfiguredRetryStrategy"); + var ConfiguredRetryStrategy = _ConfiguredRetryStrategy; } }); -// ../../../node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "../../../node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { - "use strict"; - var util = require_util(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; +// ../../../node_modules/@smithy/middleware-stack/dist-cjs/index.js +var require_dist_cjs32 = __commonJS({ + "../../../node_modules/@smithy/middleware-stack/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } + return to; }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + constructStack: () => constructStack + }); + module2.exports = __toCommonJS2(src_exports); + var getAllAliases = /* @__PURE__ */ __name((name, aliases) => { + const _aliases = []; + if (name) { + _aliases.push(name); } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); + if (aliases) { + for (const alias of aliases) { + _aliases.push(alias); } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; + } + return _aliases; + }, "getAllAliases"); + var getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name, aliases) => { + return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; + }, "getMiddlewareNameWithAliases"); + var constructStack = /* @__PURE__ */ __name(() => { + let absoluteEntries = []; + let relativeEntries = []; + let identifyOnResolve = false; + const entriesNameSet = /* @__PURE__ */ new Set(); + const sort = /* @__PURE__ */ __name((entries) => entries.sort( + (a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"] + ), "sort"); + const removeByName = /* @__PURE__ */ __name((toRemove) => { + let isRemoved = false; + const filterCb = /* @__PURE__ */ __name((entry) => { + const aliases = getAllAliases(entry.name, entry.aliases); + if (aliases.includes(toRemove)) { + isRemoved = true; + for (const alias of aliases) { + entriesNameSet.delete(alias); } + return false; } - } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (!this.options.ignoreAttributes && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); + return true; + }, "filterCb"); + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, "removeByName"); + const removeByReference = /* @__PURE__ */ __name((toRemove) => { + let isRemoved = false; + const filterCb = /* @__PURE__ */ __name((entry) => { + if (entry.middleware === toRemove) { + isRemoved = true; + for (const alias of getAllAliases(entry.name, entry.aliases)) { + entriesNameSet.delete(alias); } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); + return false; + } + return true; + }, "filterCb"); + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, "removeByReference"); + const cloneTo = /* @__PURE__ */ __name((toStack) => { + var _a; + absoluteEntries.forEach((entry) => { + toStack.add(entry.middleware, { ...entry }); + }); + relativeEntries.forEach((entry) => { + toStack.addRelativeTo(entry.middleware, { ...entry }); + }); + (_a = toStack.identifyOnResolve) == null ? void 0 : _a.call(toStack, stack.identifyOnResolve()); + return toStack; + }, "cloneTo"); + const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => { + const expandedMiddlewareList = []; + from.before.forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + expandedMiddlewareList.push(from); + from.after.reverse().forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + return expandedMiddlewareList; + }, "expandRelativeMiddlewareList"); + const getMiddlewareList = /* @__PURE__ */ __name((debug = false) => { + const normalizedAbsoluteEntries = []; + const normalizedRelativeEntries = []; + const normalizedEntriesNameMap = {}; + absoluteEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [] + }; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; + } + normalizedAbsoluteEntries.push(normalizedEntry); + }); + relativeEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [] + }; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; + } + normalizedRelativeEntries.push(normalizedEntry); + }); + normalizedRelativeEntries.forEach((entry) => { + if (entry.toMiddleware) { + const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; + if (toMiddleware === void 0) { + if (debug) { + return; } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; + throw new Error( + `${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}` + ); + } + if (entry.relation === "after") { + toMiddleware.after.push(entry); + } + if (entry.relation === "before") { + toMiddleware.before.push(entry); } } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); + }); + const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce( + (wholeList, expandedMiddlewareList) => { + wholeList.push(...expandedMiddlewareList); + return wholeList; + }, + [] + ); + return mainChain; + }, "getMiddlewareList"); + const stack = { + add: (middleware, options = {}) => { + const { name, override, aliases: _aliases } = options; + const entry = { + step: "initialize", + priority: "normal", + middleware, + ...options + }; + const aliases = getAllAliases(name, _aliases); + if (aliases.length > 0) { + if (aliases.some((alias) => entriesNameSet.has(alias))) { + if (!override) + throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + for (const alias of aliases) { + const toOverrideIndex = absoluteEntries.findIndex( + (entry2) => { + var _a; + return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias)); + } + ); + if (toOverrideIndex === -1) { + continue; + } + const toOverride = absoluteEntries[toOverrideIndex]; + if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) { + throw new Error( + `"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.` + ); + } + absoluteEntries.splice(toOverrideIndex, 1); } } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); + for (const alias of aliases) { + entriesNameSet.add(alias); } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); + } + absoluteEntries.push(entry); + }, + addRelativeTo: (middleware, options) => { + const { name, override, aliases: _aliases } = options; + const entry = { + middleware, + ...options + }; + const aliases = getAllAliases(name, _aliases); + if (aliases.length > 0) { + if (aliases.some((alias) => entriesNameSet.has(alias))) { + if (!override) + throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + for (const alias of aliases) { + const toOverrideIndex = relativeEntries.findIndex( + (entry2) => { + var _a; + return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias)); + } + ); + if (toOverrideIndex === -1) { + continue; + } + const toOverride = relativeEntries[toOverrideIndex]; + if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { + throw new Error( + `"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.` + ); + } + relativeEntries.splice(toOverrideIndex, 1); } - this.addChild(currentNode, childNode, jPath); } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); + for (const alias of aliases) { + entriesNameSet.add(alias); } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); + } + relativeEntries.push(entry); + }, + clone: () => cloneTo(constructStack()), + use: (plugin) => { + plugin.applyToStack(stack); + }, + remove: (toRemove) => { + if (typeof toRemove === "string") + return removeByName(toRemove); + else + return removeByReference(toRemove); + }, + removeByTag: (toRemove) => { + let isRemoved = false; + const filterCb = /* @__PURE__ */ __name((entry) => { + const { tags, name, aliases: _aliases } = entry; + if (tags && tags.includes(toRemove)) { + const aliases = getAllAliases(name, _aliases); + for (const alias of aliases) { + entriesNameSet.delete(alias); + } + isRemoved = true; + return false; } - i = closeIndex + 2; + return true; + }, "filterCb"); + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, + concat: (from) => { + var _a; + const cloned = cloneTo(constructStack()); + cloned.use(from); + cloned.identifyOnResolve( + identifyOnResolve || cloned.identifyOnResolve() || (((_a = from.identifyOnResolve) == null ? void 0 : _a.call(from)) ?? false) + ); + return cloned; + }, + applyToStack: cloneTo, + identify: () => { + return getMiddlewareList(true).map((mw) => { + const step = mw.step ?? mw.relation + " " + mw.toMiddleware; + return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; + }); + }, + identifyOnResolve(toggle) { + if (typeof toggle === "boolean") + identifyOnResolve = toggle; + return identifyOnResolve; + }, + resolve: (handler2, context) => { + for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) { + handler2 = middleware(handler2, context); + } + if (identifyOnResolve) { + console.log(stack.identify()); + } + return handler2; + } + }; + return stack; + }, "constructStack"); + var stepWeights = { + initialize: 5, + serialize: 4, + build: 3, + finalizeRequest: 2, + deserialize: 1 + }; + var priorityWeights = { + high: 3, + normal: 2, + low: 1 + }; + } +}); + +// ../../../node_modules/@smithy/smithy-client/dist-cjs/index.js +var require_dist_cjs33 = __commonJS({ + "../../../node_modules/@smithy/smithy-client/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + Client: () => Client, + Command: () => Command, + LazyJsonString: () => LazyJsonString, + NoOpLogger: () => NoOpLogger, + SENSITIVE_STRING: () => SENSITIVE_STRING, + ServiceException: () => ServiceException, + StringWrapper: () => StringWrapper, + _json: () => _json, + collectBody: () => import_protocols3.collectBody, + convertMap: () => convertMap, + createAggregatedClient: () => createAggregatedClient, + dateToUtcString: () => dateToUtcString, + decorateServiceException: () => decorateServiceException, + emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion2, + expectBoolean: () => expectBoolean, + expectByte: () => expectByte, + expectFloat32: () => expectFloat32, + expectInt: () => expectInt, + expectInt32: () => expectInt32, + expectLong: () => expectLong, + expectNonNull: () => expectNonNull, + expectNumber: () => expectNumber, + expectObject: () => expectObject, + expectShort: () => expectShort, + expectString: () => expectString, + expectUnion: () => expectUnion2, + extendedEncodeURIComponent: () => import_protocols3.extendedEncodeURIComponent, + getArrayIfSingleItem: () => getArrayIfSingleItem, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + getDefaultExtensionConfiguration: () => getDefaultExtensionConfiguration, + getValueFromTextNode: () => getValueFromTextNode2, + handleFloat: () => handleFloat, + isSerializableHeaderValue: () => isSerializableHeaderValue, + limitedParseDouble: () => limitedParseDouble, + limitedParseFloat: () => limitedParseFloat, + limitedParseFloat32: () => limitedParseFloat32, + loadConfigsForDefaultMode: () => loadConfigsForDefaultMode, + logger: () => logger, + map: () => map, + parseBoolean: () => parseBoolean, + parseEpochTimestamp: () => parseEpochTimestamp, + parseRfc3339DateTime: () => parseRfc3339DateTime, + parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime: () => parseRfc7231DateTime, + quoteHeader: () => quoteHeader, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig, + resolvedPath: () => import_protocols3.resolvedPath, + serializeDateTime: () => serializeDateTime, + serializeFloat: () => serializeFloat, + splitEvery: () => splitEvery, + splitHeader: () => splitHeader, + strictParseByte: () => strictParseByte, + strictParseDouble: () => strictParseDouble, + strictParseFloat: () => strictParseFloat, + strictParseFloat32: () => strictParseFloat32, + strictParseInt: () => strictParseInt, + strictParseInt32: () => strictParseInt32, + strictParseLong: () => strictParseLong, + strictParseShort: () => strictParseShort, + take: () => take, + throwDefaultError: () => throwDefaultError, + withBaseException: () => withBaseException + }); + module2.exports = __toCommonJS2(src_exports); + var import_middleware_stack = require_dist_cjs32(); + var _Client = class _Client { + constructor(config) { + this.config = config; + this.middlewareStack = (0, import_middleware_stack.constructStack)(); + } + send(command, optionsOrCb, cb) { + const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0; + const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; + const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true; + let handler2; + if (useHandlerCache) { + if (!this.handlers) { + this.handlers = /* @__PURE__ */ new WeakMap(); + } + const handlers = this.handlers; + if (handlers.has(command.constructor)) { + handler2 = handlers.get(command.constructor); } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } + handler2 = command.resolveMiddleware(this.middlewareStack, this.config, options); + handlers.set(command.constructor, handler2); } } else { - textData += xmlData[i]; + delete this.handlers; + handler2 = command.resolveMiddleware(this.middlewareStack, this.config, options); + } + if (callback) { + handler2(command).then( + (result) => callback(null, result.output), + (err) => callback(err) + ).catch( + // prevent any errors thrown in the callback from triggering an + // unhandled promise rejection + () => { + } + ); + } else { + return handler2(command).then((result) => result.output); } } - return xmlObj.child; + destroy() { + var _a, _b, _c; + (_c = (_b = (_a = this.config) == null ? void 0 : _a.requestHandler) == null ? void 0 : _b.destroy) == null ? void 0 : _c.call(_b); + delete this.handlers; + } }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); + __name(_Client, "Client"); + var Client = _Client; + var import_protocols3 = (init_protocols(), __toCommonJS(protocols_exports)); + var import_types5 = require_dist_cjs(); + var _Command = class _Command { + constructor() { + this.middlewareStack = (0, import_middleware_stack.constructStack)(); } - } - var replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } + /** + * Factory for Command ClassBuilder. + * @internal + */ + static classBuilder() { + return new ClassBuilder(); + } + /** + * @internal + */ + resolveMiddlewareWithContext(clientStack, configuration, options, { + middlewareFn, + clientName, + commandName, + inputFilterSensitiveLog, + outputFilterSensitiveLog, + smithyContext, + additionalContext, + CommandCtor + }) { + for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { + this.middlewareStack.use(mw); } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); + const stack = clientStack.concat(this.middlewareStack); + const { logger: logger2 } = configuration; + const handlerExecutionContext = { + logger: logger2, + clientName, + commandName, + inputFilterSensitiveLog, + outputFilterSensitiveLog, + [import_types5.SMITHY_CONTEXT_KEY]: { + commandInstance: this, + ...smithyContext + }, + ...additionalContext + }; + const { requestHandler } = configuration; + return stack.resolve( + (request2) => requestHandler.handle(request2.request, options || {}), + handlerExecutionContext + ); } - return val2; }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; + __name(_Command, "Command"); + var Command = _Command; + var _ClassBuilder = class _ClassBuilder { + constructor() { + this._init = () => { + }; + this._ep = {}; + this._middlewareFn = () => []; + this._commandName = ""; + this._clientName = ""; + this._additionalContext = {}; + this._smithyContext = {}; + this._inputFilterSensitiveLog = (_) => _; + this._outputFilterSensitiveLog = (_) => _; + this._serializer = null; + this._deserializer = null; + } + /** + * Optional init callback. + */ + init(cb) { + this._init = cb; + } + /** + * Set the endpoint parameter instructions. + */ + ep(endpointParameterInstructions) { + this._ep = endpointParameterInstructions; + return this; + } + /** + * Add any number of middleware. + */ + m(middlewareSupplier) { + this._middlewareFn = middlewareSupplier; + return this; + } + /** + * Set the initial handler execution context Smithy field. + */ + s(service, operation, smithyContext = {}) { + this._smithyContext = { + service, + operation, + ...smithyContext + }; + return this; } - return textData; - } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; + /** + * Set the initial handler execution context. + */ + c(additionalContext = {}) { + this._additionalContext = additionalContext; + return this; } - return false; - } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; + /** + * Set constant string identifiers for the operation. + */ + n(clientName, commandName) { + this._clientName = clientName; + this._commandName = commandName; + return this; } - } - function findClosingIndex(xmlData, str, i, errMsg) { - const closingIndex = xmlData.indexOf(str, i); - if (closingIndex === -1) { - throw new Error(errMsg); - } else { - return closingIndex + str.length - 1; + /** + * Set the input and output sensistive log filters. + */ + f(inputFilter = (_) => _, outputFilter = (_) => _) { + this._inputFilterSensitiveLog = inputFilter; + this._outputFilterSensitiveLog = outputFilter; + return this; } - } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); + /** + * Sets the serializer. + */ + ser(serializer) { + this._serializer = serializer; + return this; } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } + /** + * Sets the deserializer. + */ + de(deserializer) { + this._deserializer = deserializer; + return this; } - return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName - }; - } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } + /** + * @returns a Command class with the classBuilder properties. + */ + build() { + var _a; + const closure = this; + let CommandRef; + return CommandRef = (_a = class extends Command { + /** + * @public + */ + constructor(...[input]) { + super(); + this.serialize = closure._serializer; + this.deserialize = closure._deserializer; + this.input = input ?? {}; + closure._init(this); } - } - } - } - function parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } - } - } - module2.exports = OrderedObjParser; - } -}); - -// ../../../node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "../../../node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { - "use strict"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; + /** + * @public + */ + static getEndpointParameterInstructions() { + return closure._ep; } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; - } + /** + * @internal + */ + resolveMiddleware(stack, configuration, options) { + return this.resolveMiddlewareWithContext(stack, configuration, options, { + CommandCtor: CommandRef, + middlewareFn: closure._middlewareFn, + clientName: closure._clientName, + commandName: closure._commandName, + inputFilterSensitiveLog: closure._inputFilterSensitiveLog, + outputFilterSensitiveLog: closure._outputFilterSensitiveLog, + smithyContext: closure._smithyContext, + additionalContext: closure._additionalContext + }); + } + }, __name(_a, "CommandRef"), _a); + } + }; + __name(_ClassBuilder, "ClassBuilder"); + var ClassBuilder = _ClassBuilder; + var SENSITIVE_STRING = "***SensitiveInformation***"; + var createAggregatedClient = /* @__PURE__ */ __name((commands, Client2) => { + for (const command of Object.keys(commands)) { + const CommandCtor = commands[command]; + const methodImpl = /* @__PURE__ */ __name(async function(args, optionsOrCb, cb) { + const command2 = new CommandCtor(args); + if (typeof optionsOrCb === "function") { + this.send(command2, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expected http options but got ${typeof optionsOrCb}`); + this.send(command2, optionsOrCb || {}, cb); + } else { + return this.send(command2, optionsOrCb); } + }, "methodImpl"); + const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); + Client2.prototype[methodName] = methodImpl; + } + }, "createAggregatedClient"); + var parseBoolean = /* @__PURE__ */ __name((value) => { + switch (value) { + case "true": + return true; + case "false": + return false; + default: + throw new Error(`Unable to parse boolean value "${value}"`); + } + }, "parseBoolean"); + var expectBoolean = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "number") { + if (value === 0 || value === 1) { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (value === 0) { + return false; + } + if (value === 1) { + return true; } } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; + if (typeof value === "string") { + const lower = value.toLowerCase(); + if (lower === "false" || lower === "true") { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (lower === "false") { + return false; + } + if (lower === "true") { + return true; + } } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; + if (typeof value === "boolean") { + return value; + } + throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); + }, "expectBoolean"); + var expectNumber = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "string") { + const parsed = parseFloat(value); + if (!Number.isNaN(parsed)) { + if (String(parsed) !== String(value)) { + logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); } + return parsed; } } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; + if (typeof value === "number") { + return value; } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; + throw new TypeError(`Expected number, got ${typeof value}: ${value}`); + }, "expectNumber"); + var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); + var expectFloat32 = /* @__PURE__ */ __name((value) => { + const expected = expectNumber(value); + if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { + if (Math.abs(expected) > MAX_FLOAT) { + throw new TypeError(`Expected 32-bit float, got ${value}`); + } } - return false; - } - exports2.prettify = prettify; - } -}); - -// ../../../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "../../../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator(); - var XMLParser2 = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); + return expected; + }, "expectFloat32"); + var expectLong = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } + if (Number.isInteger(value) && !Number.isNaN(value)) { + return value; + } + throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); + }, "expectLong"); + var expectInt = expectLong; + var expectInt32 = /* @__PURE__ */ __name((value) => expectSizedInt(value, 32), "expectInt32"); + var expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), "expectShort"); + var expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), "expectByte"); + var expectSizedInt = /* @__PURE__ */ __name((value, size) => { + const expected = expectLong(value); + if (expected !== void 0 && castInt(expected, size) !== expected) { + throw new TypeError(`Expected ${size}-bit integer, got ${value}`); + } + return expected; + }, "expectSizedInt"); + var castInt = /* @__PURE__ */ __name((value, size) => { + switch (size) { + case 32: + return Int32Array.of(value)[0]; + case 16: + return Int16Array.of(value)[0]; + case 8: + return Int8Array.of(value)[0]; + } + }, "castInt"); + var expectNonNull = /* @__PURE__ */ __name((value, location) => { + if (value === null || value === void 0) { + if (location) { + throw new TypeError(`Expected a non-null value for ${location}`); } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); + throw new TypeError("Expected a non-null value"); + } + return value; + }, "expectNonNull"); + var expectObject = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "object" && !Array.isArray(value)) { + return value; + } + const receivedType = Array.isArray(value) ? "array" : typeof value; + throw new TypeError(`Expected object, got ${receivedType}: ${value}`); + }, "expectObject"); + var expectString = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "string") { + return value; + } + if (["boolean", "number", "bigint"].includes(typeof value)) { + logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); + return String(value); + } + throw new TypeError(`Expected string, got ${typeof value}: ${value}`); + }, "expectString"); + var expectUnion2 = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + const asObject = expectObject(value); + const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k); + if (setKeys.length === 0) { + throw new TypeError(`Unions must have exactly one non-null member. None were found.`); + } + if (setKeys.length > 1) { + throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); + } + return asObject; + }, "expectUnion"); + var strictParseDouble = /* @__PURE__ */ __name((value) => { + if (typeof value == "string") { + return expectNumber(parseNumber(value)); + } + return expectNumber(value); + }, "strictParseDouble"); + var strictParseFloat = strictParseDouble; + var strictParseFloat32 = /* @__PURE__ */ __name((value) => { + if (typeof value == "string") { + return expectFloat32(parseNumber(value)); + } + return expectFloat32(value); + }, "strictParseFloat32"); + var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; + var parseNumber = /* @__PURE__ */ __name((value) => { + const matches = value.match(NUMBER_REGEX); + if (matches === null || matches[0].length !== value.length) { + throw new TypeError(`Expected real number, got implicit NaN`); + } + return parseFloat(value); + }, "parseNumber"); + var limitedParseDouble = /* @__PURE__ */ __name((value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectNumber(value); + }, "limitedParseDouble"); + var handleFloat = limitedParseDouble; + var limitedParseFloat = limitedParseDouble; + var limitedParseFloat32 = /* @__PURE__ */ __name((value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectFloat32(value); + }, "limitedParseFloat32"); + var parseFloatString = /* @__PURE__ */ __name((value) => { + switch (value) { + case "NaN": + return NaN; + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + default: + throw new Error(`Unable to parse float value: ${value}`); } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } + }, "parseFloatString"); + var strictParseLong = /* @__PURE__ */ __name((value) => { + if (typeof value === "string") { + return expectLong(parseNumber(value)); } - }; - module2.exports = XMLParser2; - } -}); - -// ../../../node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "../../../node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; + return expectLong(value); + }, "strictParseLong"); + var strictParseInt = strictParseLong; + var strictParseInt32 = /* @__PURE__ */ __name((value) => { + if (typeof value === "string") { + return expectInt32(parseNumber(value)); } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; + return expectInt32(value); + }, "strictParseInt32"); + var strictParseShort = /* @__PURE__ */ __name((value) => { + if (typeof value === "string") { + return expectShort(parseNumber(value)); } - return xmlStr; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; + return expectShort(value); + }, "strictParseShort"); + var strictParseByte = /* @__PURE__ */ __name((value) => { + if (typeof value === "string") { + return expectByte(parseNumber(value)); } + return expectByte(value); + }, "strictParseByte"); + var stackTraceWarning = /* @__PURE__ */ __name((message) => { + return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n"); + }, "stackTraceWarning"); + var logger = { + warn: console.warn + }; + var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; + var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + function dateToUtcString(date) { + const year = date.getUTCFullYear(); + const month = date.getUTCMonth(); + const dayOfWeek = date.getUTCDay(); + const dayOfMonthInt = date.getUTCDate(); + const hoursInt = date.getUTCHours(); + const minutesInt = date.getUTCMinutes(); + const secondsInt = date.getUTCSeconds(); + const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; + const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; + const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; + const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; + return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } + __name(dateToUtcString, "dateToUtcString"); + var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); + var parseRfc3339DateTime = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; } - return attrStr; - } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); } - return false; - } - function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } + const match = RFC3339.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); } - return textValue; - } - module2.exports = toXml; - } -}); - -// ../../../node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "../../../node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { - "use strict"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; + const year = strictParseShort(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); + }, "parseRfc3339DateTime"); + var RFC3339_WITH_OFFSET = new RegExp( + /^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/ + ); + var parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; + const match = RFC3339_WITH_OFFSET.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0).val; + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; + const year = strictParseShort(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); + if (offsetStr.toUpperCase() != "Z") { + date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr)); } - }; - Builder.prototype.j2x = function(jObj, level) { - let attrStr = ""; - let val2 = ""; - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level); - } - } + return date; + }, "parseRfc3339DateTimeWithOffset"); + var IMF_FIXDATE = new RegExp( + /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/ + ); + var RFC_850_DATE = new RegExp( + /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/ + ); + var ASC_TIME = new RegExp( + /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/ + ); + var parseRfc7231DateTime = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level) { - const result = this.j2x(object, level + 1); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); + if (typeof value !== "string") { + throw new TypeError("RFC-7231 date-times must be expressed as strings"); } - } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; - } + let match = IMF_FIXDATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return buildDate( + strictParseShort(stripLeadingZeroes(yearStr)), + parseMonthByShortName(monthStr), + parseDateValue(dayStr, "day", 1, 31), + { hours, minutes, seconds, fractionalMilliseconds } + ); } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; + match = RFC_850_DATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return adjustRfc850Year( + buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { + hours, + minutes, + seconds, + fractionalMilliseconds + }) + ); + } + match = ASC_TIME.exec(value); + if (match) { + const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; + return buildDate( + strictParseShort(stripLeadingZeroes(yearStr)), + parseMonthByShortName(monthStr), + parseDateValue(dayStr.trimLeft(), "day", 1, 31), + { hours, minutes, seconds, fractionalMilliseconds } + ); + } + throw new TypeError("Invalid RFC-7231 date-time value"); + }, "parseRfc7231DateTime"); + var parseEpochTimestamp = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + let valueAsDouble; + if (typeof value === "number") { + valueAsDouble = value; + } else if (typeof value === "string") { + valueAsDouble = strictParseDouble(value); + } else if (typeof value === "object" && value.tag === 1) { + valueAsDouble = value.value; } else { - closeTag = `> { + const adjustedMonth = month - 1; + validateDayOfMonth(year, adjustedMonth, day); + return new Date( + Date.UTC( + year, + adjustedMonth, + day, + parseDateValue(time.hours, "hour", 0, 23), + parseDateValue(time.minutes, "minute", 0, 59), + // seconds can go up to 60 for leap seconds + parseDateValue(time.seconds, "seconds", 0, 60), + parseMilliseconds(time.fractionalMilliseconds) + ) + ); + }, "buildDate"); + var parseTwoDigitYear = /* @__PURE__ */ __name((value) => { + const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear(); + const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); + if (valueInThisCentury < thisYear) { + return valueInThisCentury + 100; + } + return valueInThisCentury; + }, "parseTwoDigitYear"); + var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3; + var adjustRfc850Year = /* @__PURE__ */ __name((input) => { + if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) { + return new Date( + Date.UTC( + input.getUTCFullYear() - 100, + input.getUTCMonth(), + input.getUTCDate(), + input.getUTCHours(), + input.getUTCMinutes(), + input.getUTCSeconds(), + input.getUTCMilliseconds() + ) + ); } - return closeTag; - }; - Builder.prototype.buildTextValNode = function(val2, key, attrStr, level) { - if (this.options.cdataPropName !== false && key === this.options.cdataPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " { + const monthIdx = MONTHS.indexOf(value); + if (monthIdx < 0) { + throw new TypeError(`Invalid month: ${value}`); } - }; - Builder.prototype.replaceEntitiesValue = function(textValue) { - if (textValue && textValue.length > 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } + return monthIdx + 1; + }, "parseMonthByShortName"); + var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + var validateDayOfMonth = /* @__PURE__ */ __name((year, month, day) => { + let maxDays = DAYS_IN_MONTH[month]; + if (month === 1 && isLeapYear(year)) { + maxDays = 29; } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); - } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; + if (day > maxDays) { + throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); } - } - module2.exports = Builder; - } -}); - -// ../../../node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "../../../node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { - "use strict"; - var validator = require_validator(); - var XMLParser2 = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser: XMLParser2, - XMLValidator: validator, - XMLBuilder - }; - } -}); - -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js -var import_smithy_client4, import_fast_xml_parser, parseXmlBody, parseXmlErrorBody, loadRestXmlErrorCode; -var init_parseXmlBody = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() { - import_smithy_client4 = __toESM(require_dist_cjs37()); - import_fast_xml_parser = __toESM(require_fxp()); - init_common(); - parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - const parser = new import_fast_xml_parser.XMLParser({ - attributeNamePrefix: "", - htmlEntities: true, - ignoreAttributes: false, - ignoreDeclaration: true, - parseTagValue: false, - trimValues: false, - tagValueProcessor: (_, val2) => val2.trim() === "" && val2.includes("\n") ? "" : void 0 - }); - parser.addEntity("#xD", "\r"); - parser.addEntity("#10", "\n"); - let parsedObj; - try { - parsedObj = parser.parse(encoded, true); - } catch (e) { - if (e && typeof e === "object") { - Object.defineProperty(e, "$responseBodyText", { - value: encoded - }); - } - throw e; - } - const textNodeName = "#text"; - const key = Object.keys(parsedObj)[0]; - const parsedObjToReturn = parsedObj[key]; - if (parsedObjToReturn[textNodeName]) { - parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; - delete parsedObjToReturn[textNodeName]; - } - return (0, import_smithy_client4.getValueFromTextNode)(parsedObjToReturn); + }, "validateDayOfMonth"); + var isLeapYear = /* @__PURE__ */ __name((year) => { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + }, "isLeapYear"); + var parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => { + const dateVal = strictParseByte(stripLeadingZeroes(value)); + if (dateVal < lower || dateVal > upper) { + throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); } - return {}; - }); - parseXmlErrorBody = async (errorBody, context) => { - const value = await parseXmlBody(errorBody, context); - if (value.Error) { - value.Error.message = value.Error.message ?? value.Error.Message; + return dateVal; + }, "parseDateValue"); + var parseMilliseconds = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return 0; } - return value; - }; - loadRestXmlErrorCode = (output, data) => { - if (data?.Error?.Code !== void 0) { - return data.Error.Code; + return strictParseFloat32("0." + value) * 1e3; + }, "parseMilliseconds"); + var parseOffsetToMilliseconds = /* @__PURE__ */ __name((value) => { + const directionStr = value[0]; + let direction = 1; + if (directionStr == "+") { + direction = 1; + } else if (directionStr == "-") { + direction = -1; + } else { + throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); } - if (data?.Code !== void 0) { - return data.Code; + const hour = Number(value.substring(1, 3)); + const minute = Number(value.substring(4, 6)); + return direction * (hour * 60 + minute) * 60 * 1e3; + }, "parseOffsetToMilliseconds"); + var stripLeadingZeroes = /* @__PURE__ */ __name((value) => { + let idx = 0; + while (idx < value.length - 1 && value.charAt(idx) === "0") { + idx++; } - if (output.statusCode == 404) { - return "NotFound"; + if (idx === 0) { + return value; + } + return value.slice(idx); + }, "stripLeadingZeroes"); + var _ServiceException = class _ServiceException2 extends Error { + constructor(options) { + super(options.message); + Object.setPrototypeOf(this, _ServiceException2.prototype); + this.name = options.name; + this.$fault = options.$fault; + this.$metadata = options.$metadata; } }; - } -}); - -// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js -var init_protocols = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() { - init_coercing_serializers(); - init_awsExpectUnion(); - init_parseJsonBody(); - init_parseXmlBody(); - } -}); - -// ../../../node_modules/@aws-sdk/core/dist-es/index.js -var dist_es_exports2 = {}; -__export(dist_es_exports2, { - AWSSDKSigV4Signer: () => AWSSDKSigV4Signer, - AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner, - AwsSdkSigV4Signer: () => AwsSdkSigV4Signer, - NODE_SIGV4A_CONFIG_OPTIONS: () => NODE_SIGV4A_CONFIG_OPTIONS, - _toBool: () => _toBool, - _toNum: () => _toNum, - _toStr: () => _toStr, - awsExpectUnion: () => awsExpectUnion, - emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion, - loadRestJsonErrorCode: () => loadRestJsonErrorCode, - loadRestXmlErrorCode: () => loadRestXmlErrorCode, - parseJsonBody: () => parseJsonBody, - parseJsonErrorBody: () => parseJsonErrorBody, - parseXmlBody: () => parseXmlBody, - parseXmlErrorBody: () => parseXmlErrorBody, - resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config, - resolveAwsSdkSigV4AConfig: () => resolveAwsSdkSigV4AConfig, - resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config, - validateSigningProperties: () => validateSigningProperties -}); -var init_dist_es2 = __esm({ - "../../../node_modules/@aws-sdk/core/dist-es/index.js"() { - init_client(); - init_httpAuthSchemes2(); - init_protocols(); - } -}); - -// ../../../node_modules/@aws-sdk/client-sfn/dist-cjs/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider = __commonJS({ - "../../../node_modules/@aws-sdk/client-sfn/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.resolveHttpAuthSchemeConfig = exports2.defaultSFNHttpAuthSchemeProvider = exports2.defaultSFNHttpAuthSchemeParametersProvider = void 0; - var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); - var util_middleware_1 = require_dist_cjs10(); - var defaultSFNHttpAuthSchemeParametersProvider = async (config, context, input) => { + __name(_ServiceException, "ServiceException"); + var ServiceException = _ServiceException; + var decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => { + Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => { + if (exception[k] == void 0 || exception[k] === "") { + exception[k] = v; + } + }); + const message = exception.message || exception.Message || "UnknownError"; + exception.message = message; + delete exception.Message; + return exception; + }, "decorateServiceException"); + var throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => { + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0; + const response = new exceptionCtor({ + name: (parsedBody == null ? void 0 : parsedBody.code) || (parsedBody == null ? void 0 : parsedBody.Code) || errorCode || statusCode || "UnknownError", + $fault: "client", + $metadata + }); + throw decorateServiceException(response, parsedBody); + }, "throwDefaultError"); + var withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => { + return ({ output, parsedBody, errorCode }) => { + throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); + }; + }, "withBaseException"); + var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] + }), "deserializeMetadata"); + var loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => { + switch (mode) { + case "standard": + return { + retryMode: "standard", + connectionTimeout: 3100 + }; + case "in-region": + return { + retryMode: "standard", + connectionTimeout: 1100 + }; + case "cross-region": + return { + retryMode: "standard", + connectionTimeout: 3100 + }; + case "mobile": + return { + retryMode: "standard", + connectionTimeout: 3e4 + }; + default: + return {}; + } + }, "loadConfigsForDefaultMode"); + var warningEmitted2 = false; + var emitWarningIfUnsupportedVersion2 = /* @__PURE__ */ __name((version2) => { + if (version2 && !warningEmitted2 && parseInt(version2.substring(1, version2.indexOf("."))) < 16) { + warningEmitted2 = true; + } + }, "emitWarningIfUnsupportedVersion"); + var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + for (const id in import_types5.AlgorithmId) { + const algorithmId = import_types5.AlgorithmId[id]; + if (runtimeConfig[algorithmId] === void 0) { + continue; + } + checksumAlgorithms.push({ + algorithmId: () => algorithmId, + checksumConstructor: () => runtimeConfig[algorithmId] + }); + } return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } }; - }; - exports2.defaultSFNHttpAuthSchemeParametersProvider = defaultSFNHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { + }, "getChecksumConfiguration"); + var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; + }, "resolveChecksumRuntimeConfig"); + var getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let _retryStrategy = runtimeConfig.retryStrategy; return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "states", - region: authParameters.region + setRetryStrategy(retryStrategy) { + _retryStrategy = retryStrategy; }, - propertiesExtractor: (config, context) => ({ - signingProperties: { - config, - context - } - }) - }; - } - var defaultSFNHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + retryStrategy() { + return _retryStrategy; } - } - return options; - }; - exports2.defaultSFNHttpAuthSchemeProvider = defaultSFNHttpAuthSchemeProvider; - var resolveHttpAuthSchemeConfig = (config) => { - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + }; + }, "getRetryConfiguration"); + var resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => { + const runtimeConfig = {}; + runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); + return runtimeConfig; + }, "resolveRetryRuntimeConfig"); + var getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { return { - ...config_0 + ...getChecksumConfiguration(runtimeConfig), + ...getRetryConfiguration(runtimeConfig) }; - }; - exports2.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; - } -}); - -// ../../../node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports = {}; -__export(tslib_es6_exports, { - __addDisposableResource: () => __addDisposableResource, - __assign: () => __assign, - __asyncDelegator: () => __asyncDelegator, - __asyncGenerator: () => __asyncGenerator, - __asyncValues: () => __asyncValues, - __await: () => __await, - __awaiter: () => __awaiter, - __classPrivateFieldGet: () => __classPrivateFieldGet, - __classPrivateFieldIn: () => __classPrivateFieldIn, - __classPrivateFieldSet: () => __classPrivateFieldSet, - __createBinding: () => __createBinding, - __decorate: () => __decorate, - __disposeResources: () => __disposeResources, - __esDecorate: () => __esDecorate, - __exportStar: () => __exportStar, - __extends: () => __extends, - __generator: () => __generator, - __importDefault: () => __importDefault, - __importStar: () => __importStar, - __makeTemplateObject: () => __makeTemplateObject, - __metadata: () => __metadata, - __param: () => __param, - __propKey: () => __propKey, - __read: () => __read, - __rest: () => __rest, - __runInitializers: () => __runInitializers, - __setFunctionName: () => __setFunctionName, - __spread: () => __spread, - __spreadArray: () => __spreadArray, - __spreadArrays: () => __spreadArrays, - __values: () => __values, - default: () => tslib_es6_default -}); -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} -function __param(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { - if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); - return f; - } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); - }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -} -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -} -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); + }, "getDefaultExtensionConfiguration"); + var getDefaultClientConfiguration = getDefaultExtensionConfiguration; + var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config), + ...resolveRetryRuntimeConfig(config) + }; + }, "resolveDefaultRuntimeConfig"); + var getArrayIfSingleItem = /* @__PURE__ */ __name((mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray], "getArrayIfSingleItem"); + var getValueFromTextNode2 = /* @__PURE__ */ __name((obj) => { + const textNodeName = "#text"; + for (const key in obj) { + if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) { + obj[key] = obj[key][textNodeName]; + } else if (typeof obj[key] === "object" && obj[key] !== null) { + obj[key] = getValueFromTextNode2(obj[key]); + } + } + return obj; + }, "getValueFromTextNode"); + var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => { + return value != null; + }, "isSerializableHeaderValue"); + var StringWrapper = /* @__PURE__ */ __name(function() { + const Class = Object.getPrototypeOf(this).constructor; + const Constructor = Function.bind.apply(String, [null, ...arguments]); + const instance = new Constructor(); + Object.setPrototypeOf(instance, Class.prototype); + return instance; + }, "StringWrapper"); + StringWrapper.prototype = Object.create(String.prototype, { + constructor: { + value: StringWrapper, + enumerable: false, + writable: true, + configurable: true + } }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + Object.setPrototypeOf(StringWrapper, String); + var _LazyJsonString = class _LazyJsonString2 extends StringWrapper { + deserializeJSON() { + return JSON.parse(super.toString()); } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + toJSON() { + return super.toString(); + } + static fromObject(object) { + if (object instanceof _LazyJsonString2) { + return object; + } else if (object instanceof String || typeof object === "string") { + return new _LazyJsonString2(object); + } + return new _LazyJsonString2(JSON.stringify(object)); } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { - if (t[0] & 1) throw t[1]; - return t[1]; - }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { - return this; - }), g; - function verb(n) { - return function(v) { - return step([n, v]); }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); + __name(_LazyJsonString, "LazyJsonString"); + var LazyJsonString = _LazyJsonString; + var _NoOpLogger = class _NoOpLogger { + trace() { + } + debug() { + } + info() { + } + warn() { + } + error() { + } + }; + __name(_NoOpLogger, "NoOpLogger"); + var NoOpLogger = _NoOpLogger; + function map(arg0, arg1, arg2) { + let target; + let filter; + let instructions; + if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { + target = {}; + instructions = arg0; + } else { + target = arg0; + if (typeof arg1 === "function") { + filter = arg1; + instructions = arg2; + return mapWithFilter(target, filter, instructions); + } else { + instructions = arg1; + } + } + for (const key of Object.keys(instructions)) { + if (!Array.isArray(instructions[key])) { + target[key] = instructions[key]; continue; + } + applyInstruction(target, null, instructions, key); + } + return target; + } + __name(map, "map"); + var convertMap = /* @__PURE__ */ __name((target) => { + const output = {}; + for (const [k, v] of Object.entries(target || {})) { + output[k] = [, v]; + } + return output; + }, "convertMap"); + var take = /* @__PURE__ */ __name((source, instructions) => { + const out = {}; + for (const key in instructions) { + applyInstruction(out, source, instructions, key); + } + return out; + }, "take"); + var mapWithFilter = /* @__PURE__ */ __name((target, filter, instructions) => { + return map( + target, + Object.entries(instructions).reduce( + (_instructions, [key, value]) => { + if (Array.isArray(value)) { + _instructions[key] = value; + } else { + if (typeof value === "function") { + _instructions[key] = [filter, value()]; + } else { + _instructions[key] = [filter, value]; + } + } + return _instructions; + }, + {} + ) + ); + }, "mapWithFilter"); + var applyInstruction = /* @__PURE__ */ __name((target, source, instructions, targetKey) => { + if (source !== null) { + let instruction = instructions[targetKey]; + if (typeof instruction === "function") { + instruction = [, instruction]; + } + const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; + if (typeof filter2 === "function" && filter2(source[sourceKey]) || typeof filter2 !== "function" && !!filter2) { + target[targetKey] = valueFn(source[sourceKey]); + } + return; + } + let [filter, value] = instructions[targetKey]; + if (typeof value === "function") { + let _value; + const defaultFilterPassed = filter === void 0 && (_value = value()) != null; + const customFilterPassed = typeof filter === "function" && !!filter(void 0) || typeof filter !== "function" && !!filter; + if (defaultFilterPassed) { + target[targetKey] = _value; + } else if (customFilterPassed) { + target[targetKey] = value(); + } + } else { + const defaultFilterPassed = filter === void 0 && value != null; + const customFilterPassed = typeof filter === "function" && !!filter(value) || typeof filter !== "function" && !!filter; + if (defaultFilterPassed || customFilterPassed) { + target[targetKey] = value; + } + } + }, "applyInstruction"); + var nonNullish = /* @__PURE__ */ __name((_) => _ != null, "nonNullish"); + var pass = /* @__PURE__ */ __name((_) => _, "pass"); + function quoteHeader(part) { + if (part.includes(",") || part.includes('"')) { + part = `"${part.replace(/"/g, '\\"')}"`; + } + return part; + } + __name(quoteHeader, "quoteHeader"); + var serializeFloat = /* @__PURE__ */ __name((value) => { + if (value !== value) { + return "NaN"; + } + switch (value) { + case Infinity: + return "Infinity"; + case -Infinity: + return "-Infinity"; default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; + return value; + } + }, "serializeFloat"); + var serializeDateTime = /* @__PURE__ */ __name((date) => date.toISOString().replace(".000Z", "Z"), "serializeDateTime"); + var _json = /* @__PURE__ */ __name((obj) => { + if (obj == null) { + return {}; + } + if (Array.isArray(obj)) { + return obj.filter((_) => _ != null).map(_json); + } + if (typeof obj === "object") { + const target = {}; + for (const key of Object.keys(obj)) { + if (obj[key] == null) { continue; } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; + target[key] = _json(obj[key]); + } + return target; + } + return obj; + }, "_json"); + function splitEvery(value, delimiter, numDelimiters) { + if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { + throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); + } + const segments = value.split(delimiter); + if (numDelimiters === 1) { + return segments; + } + const compoundSegments = []; + let currentSegment = ""; + for (let i = 0; i < segments.length; i++) { + if (currentSegment === "") { + currentSegment = segments[i]; + } else { + currentSegment += delimiter + segments[i]; + } + if ((i + 1) % numDelimiters === 0) { + compoundSegments.push(currentSegment); + currentSegment = ""; + } + } + if (currentSegment !== "") { + compoundSegments.push(currentSegment); + } + return compoundSegments; + } + __name(splitEvery, "splitEvery"); + var splitHeader = /* @__PURE__ */ __name((value) => { + const z = value.length; + const values = []; + let withinQuotes = false; + let prevChar = void 0; + let anchor = 0; + for (let i = 0; i < z; ++i) { + const char = value[i]; + switch (char) { + case `"`: + if (prevChar !== "\\") { + withinQuotes = !withinQuotes; + } break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); + case ",": + if (!withinQuotes) { + values.push(value.slice(anchor, i)); + anchor = i + 1; + } break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + default: + } + prevChar = char; } - op = body.call(thisArg, _); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; - } - if (op[0] & 5) throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } -} -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function() { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } catch (error) { - e = { error }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } + values.push(value.slice(anchor)); + return values.map((v) => { + v = v.trim(); + const z2 = v.length; + if (z2 < 2) { + return v; + } + if (v[0] === `"` && v[z2 - 1] === `"`) { + v = v.slice(1, z2 - 1); + } + return v.replace(/\\"/g, '"'); + }); + }, "splitHeader"); } - return ar; -} -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } +}); + +// ../../../node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js +var require_isStreamingPayload = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isStreamingPayload = void 0; + var stream_1 = require("stream"); + var isStreamingPayload = (request2) => (request2 === null || request2 === void 0 ? void 0 : request2.body) instanceof stream_1.Readable || typeof ReadableStream !== "undefined" && (request2 === null || request2 === void 0 ? void 0 : request2.body) instanceof ReadableStream; + exports2.isStreamingPayload = isStreamingPayload; } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function awaitReturn(f) { - return function(v) { - return Promise.resolve(v).then(f, reject); +}); + +// ../../../node_modules/@smithy/middleware-retry/dist-cjs/index.js +var require_dist_cjs34 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + AdaptiveRetryStrategy: () => AdaptiveRetryStrategy, + CONFIG_MAX_ATTEMPTS: () => CONFIG_MAX_ATTEMPTS, + CONFIG_RETRY_MODE: () => CONFIG_RETRY_MODE, + ENV_MAX_ATTEMPTS: () => ENV_MAX_ATTEMPTS, + ENV_RETRY_MODE: () => ENV_RETRY_MODE, + NODE_MAX_ATTEMPT_CONFIG_OPTIONS: () => NODE_MAX_ATTEMPT_CONFIG_OPTIONS, + NODE_RETRY_MODE_CONFIG_OPTIONS: () => NODE_RETRY_MODE_CONFIG_OPTIONS, + StandardRetryStrategy: () => StandardRetryStrategy, + defaultDelayDecider: () => defaultDelayDecider, + defaultRetryDecider: () => defaultRetryDecider, + getOmitRetryHeadersPlugin: () => getOmitRetryHeadersPlugin, + getRetryAfterHint: () => getRetryAfterHint, + getRetryPlugin: () => getRetryPlugin, + omitRetryHeadersMiddleware: () => omitRetryHeadersMiddleware, + omitRetryHeadersMiddlewareOptions: () => omitRetryHeadersMiddlewareOptions, + resolveRetryConfig: () => resolveRetryConfig, + retryMiddleware: () => retryMiddleware, + retryMiddlewareOptions: () => retryMiddlewareOptions + }); + module2.exports = __toCommonJS2(src_exports); + var import_protocol_http8 = require_dist_cjs2(); + var import_uuid = (init_esm_node(), __toCommonJS(esm_node_exports)); + var import_util_retry = require_dist_cjs31(); + var getDefaultRetryQuota = /* @__PURE__ */ __name((initialRetryTokens, options) => { + const MAX_CAPACITY = initialRetryTokens; + const noRetryIncrement = (options == null ? void 0 : options.noRetryIncrement) ?? import_util_retry.NO_RETRY_INCREMENT; + const retryCost = (options == null ? void 0 : options.retryCost) ?? import_util_retry.RETRY_COST; + const timeoutRetryCost = (options == null ? void 0 : options.timeoutRetryCost) ?? import_util_retry.TIMEOUT_RETRY_COST; + let availableCapacity = initialRetryTokens; + const getCapacityAmount = /* @__PURE__ */ __name((error) => error.name === "TimeoutError" ? timeoutRetryCost : retryCost, "getCapacityAmount"); + const hasRetryTokens = /* @__PURE__ */ __name((error) => getCapacityAmount(error) <= availableCapacity, "hasRetryTokens"); + const retrieveRetryTokens = /* @__PURE__ */ __name((error) => { + if (!hasRetryTokens(error)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(error); + availableCapacity -= capacityAmount; + return capacityAmount; + }, "retrieveRetryTokens"); + const releaseRetryTokens = /* @__PURE__ */ __name((capacityReleaseAmount) => { + availableCapacity += capacityReleaseAmount ?? noRetryIncrement; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }, "releaseRetryTokens"); + return Object.freeze({ + hasRetryTokens, + retrieveRetryTokens, + releaseRetryTokens + }); + }, "getDefaultRetryQuota"); + var defaultDelayDecider = /* @__PURE__ */ __name((delayBase, attempts) => Math.floor(Math.min(import_util_retry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)), "defaultDelayDecider"); + var import_service_error_classification = require_dist_cjs30(); + var defaultRetryDecider = /* @__PURE__ */ __name((error) => { + if (!error) { + return false; + } + return (0, import_service_error_classification.isRetryableByTrait)(error) || (0, import_service_error_classification.isClockSkewError)(error) || (0, import_service_error_classification.isThrottlingError)(error) || (0, import_service_error_classification.isTransientError)(error); + }, "defaultRetryDecider"); + var asSdkError = /* @__PURE__ */ __name((error) => { + if (error instanceof Error) + return error; + if (error instanceof Object) + return Object.assign(new Error(), error); + if (typeof error === "string") + return new Error(error); + return new Error(`AWS SDK error wrapper for ${error}`); + }, "asSdkError"); + var _StandardRetryStrategy = class _StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = import_util_retry.RETRY_MODES.STANDARD; + this.retryDecider = (options == null ? void 0 : options.retryDecider) ?? defaultRetryDecider; + this.delayDecider = (options == null ? void 0 : options.delayDecider) ?? defaultDelayDecider; + this.retryQuota = (options == null ? void 0 : options.retryQuota) ?? getDefaultRetryQuota(import_util_retry.INITIAL_RETRY_TOKENS); + } + shouldRetry(error, attempts, maxAttempts) { + return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); + } + async getMaxAttempts() { + let maxAttempts; + try { + maxAttempts = await this.maxAttemptsProvider(); + } catch (error) { + maxAttempts = import_util_retry.DEFAULT_MAX_ATTEMPTS; + } + return maxAttempts; + } + async retry(next, args, options) { + let retryTokenAmount; + let attempts = 0; + let totalDelay = 0; + const maxAttempts = await this.getMaxAttempts(); + const { request: request2 } = args; + if (import_protocol_http8.HttpRequest.isInstance(request2)) { + request2.headers[import_util_retry.INVOCATION_ID_HEADER] = (0, import_uuid.v4)(); + } + while (true) { + try { + if (import_protocol_http8.HttpRequest.isInstance(request2)) { + request2.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + if (options == null ? void 0 : options.beforeRequest) { + await options.beforeRequest(); + } + const { response, output } = await next(args); + if (options == null ? void 0 : options.afterRequest) { + options.afterRequest(response); + } + this.retryQuota.releaseRetryTokens(retryTokenAmount); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalDelay; + return { response, output }; + } catch (e) { + const err = asSdkError(e); + attempts++; + if (this.shouldRetry(err, attempts, maxAttempts)) { + retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); + const delayFromDecider = this.delayDecider( + (0, import_service_error_classification.isThrottlingError)(err) ? import_util_retry.THROTTLING_RETRY_DELAY_BASE : import_util_retry.DEFAULT_RETRY_DELAY_BASE, + attempts + ); + const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); + const delay = Math.max(delayFromResponse || 0, delayFromDecider); + totalDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + continue; + } + if (!err.$metadata) { + err.$metadata = {}; + } + err.$metadata.attempts = attempts; + err.$metadata.totalRetryDelay = totalDelay; + throw err; + } + } + } }; - } - function verb(n, f) { - if (g[n]) { - i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); + __name(_StandardRetryStrategy, "StandardRetryStrategy"); + var StandardRetryStrategy = _StandardRetryStrategy; + var getDelayFromRetryAfterHeader = /* @__PURE__ */ __name((response) => { + if (!import_protocol_http8.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return retryAfterSeconds * 1e3; + const retryAfterDate = new Date(retryAfter); + return retryAfterDate.getTime() - Date.now(); + }, "getDelayFromRetryAfterHeader"); + var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy extends StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + const { rateLimiter, ...superOptions } = options ?? {}; + super(maxAttemptsProvider, superOptions); + this.rateLimiter = rateLimiter ?? new import_util_retry.DefaultRateLimiter(); + this.mode = import_util_retry.RETRY_MODES.ADAPTIVE; + } + async retry(next, args) { + return super.retry(next, args, { + beforeRequest: async () => { + return this.rateLimiter.getSendToken(); + }, + afterRequest: (response) => { + this.rateLimiter.updateClientSendingRate(response); + } }); - }; - if (f) i[n] = f(i[n]); - } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); - } -} -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function(e) { - throw e; - }), verb("return"), i[Symbol.iterator] = function() { - return this; - }, i; - function verb(n, f) { - i[n] = o[n] ? function(v) { - return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function(v) { - return new Promise(function(resolve, reject) { - v = o[n](v), settle(resolve, reject, v.done, v.value); - }); - }; - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; -} -function __importDefault(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; -} -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); } }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { - fail(e); - return next(); - }); - } else s |= 1; - } catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "../../../node_modules/tslib/tslib.es6.mjs"() { - extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { - d2.__proto__ = b2; - } || function(d2, b2) { - for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p]; - }; - return extendStatics(d, b); + __name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); + var AdaptiveRetryStrategy = _AdaptiveRetryStrategy; + var import_util_middleware3 = require_dist_cjs10(); + var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; + var CONFIG_MAX_ATTEMPTS = "max_attempts"; + var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + const value = env[ENV_MAX_ATTEMPTS]; + if (!value) + return void 0; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + configFileSelector: (profile) => { + const value = profile[CONFIG_MAX_ATTEMPTS]; + if (!value) + return void 0; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + default: import_util_retry.DEFAULT_MAX_ATTEMPTS }; - __assign = function() { - __assign = Object.assign || function __assign2(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + var resolveRetryConfig = /* @__PURE__ */ __name((input) => { + const { retryStrategy } = input; + const maxAttempts = (0, import_util_middleware3.normalizeProvider)(input.maxAttempts ?? import_util_retry.DEFAULT_MAX_ATTEMPTS); + return { + ...input, + maxAttempts, + retryStrategy: async () => { + if (retryStrategy) { + return retryStrategy; + } + const retryMode = await (0, import_util_middleware3.normalizeProvider)(input.retryMode)(); + if (retryMode === import_util_retry.RETRY_MODES.ADAPTIVE) { + return new import_util_retry.AdaptiveRetryStrategy(maxAttempts); + } + return new import_util_retry.StandardRetryStrategy(maxAttempts); } - return t; }; - return __assign.apply(this, arguments); + }, "resolveRetryConfig"); + var ENV_RETRY_MODE = "AWS_RETRY_MODE"; + var CONFIG_RETRY_MODE = "retry_mode"; + var NODE_RETRY_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_RETRY_MODE], + configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], + default: import_util_retry.DEFAULT_RETRY_MODE }; - __createBinding = Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; + var omitRetryHeadersMiddleware = /* @__PURE__ */ __name(() => (next) => async (args) => { + const { request: request2 } = args; + if (import_protocol_http8.HttpRequest.isInstance(request2)) { + delete request2.headers[import_util_retry.INVOCATION_ID_HEADER]; + delete request2.headers[import_util_retry.REQUEST_HEADER]; } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }; - __setModuleDefault = Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources + return next(args); + }, "omitRetryHeadersMiddleware"); + var omitRetryHeadersMiddlewareOptions = { + name: "omitRetryHeadersMiddleware", + tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], + relation: "before", + toMiddleware: "awsAuthMiddleware", + override: true }; - } -}); - -// ../../../node_modules/@aws-sdk/client-sfn/package.json -var require_package = __commonJS({ - "../../../node_modules/@aws-sdk/client-sfn/package.json"(exports2, module2) { - module2.exports = { - name: "@aws-sdk/client-sfn", - description: "AWS SDK for JavaScript Sfn Client for Node.js, Browser and React Native", - version: "3.632.0", - scripts: { - build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", - "build:cjs": "node ../../scripts/compilation/inline client-sfn", - "build:es": "tsc -p tsconfig.es.json", - "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", - "build:types": "tsc -p tsconfig.types.json", - "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", - clean: "rimraf ./dist-* && rimraf *.tsbuildinfo", - "extract:docs": "api-extractor run --local", - "generate:client": "node ../../scripts/generate-clients/single-service --solo sfn" - }, - main: "./dist-cjs/index.js", - types: "./dist-types/index.d.ts", - module: "./dist-es/index.js", - sideEffects: false, - dependencies: { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.632.0", - "@aws-sdk/client-sts": "3.632.0", - "@aws-sdk/core": "3.629.0", - "@aws-sdk/credential-provider-node": "3.632.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.632.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.632.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.3.2", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.14", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.1.12", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.14", - "@smithy/util-defaults-mode-node": "^3.0.14", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - tslib: "^2.6.2", - uuid: "^9.0.1" - }, - devDependencies: { - "@tsconfig/node16": "16.1.3", - "@types/node": "^16.18.96", - "@types/uuid": "^9.0.4", - concurrently: "7.0.0", - "downlevel-dts": "0.10.1", - rimraf: "3.0.2", - typescript: "~4.9.5" - }, - engines: { - node: ">=16.0.0" - }, - typesVersions: { - "<4.0": { - "dist-types/*": [ - "dist-types/ts3.4/*" - ] + var getOmitRetryHeadersPlugin = /* @__PURE__ */ __name((options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); + } + }), "getOmitRetryHeadersPlugin"); + var import_smithy_client4 = require_dist_cjs33(); + var import_isStreamingPayload = require_isStreamingPayload(); + var retryMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => { + var _a; + let retryStrategy = await options.retryStrategy(); + const maxAttempts = await options.maxAttempts(); + if (isRetryStrategyV2(retryStrategy)) { + retryStrategy = retryStrategy; + let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); + let lastError = new Error(); + let attempts = 0; + let totalRetryDelay = 0; + const { request: request2 } = args; + const isRequest = import_protocol_http8.HttpRequest.isInstance(request2); + if (isRequest) { + request2.headers[import_util_retry.INVOCATION_ID_HEADER] = (0, import_uuid.v4)(); } - }, - files: [ - "dist-*/**" - ], - author: { - name: "AWS SDK for JavaScript Team", - url: "https://aws.amazon.com/javascript/" - }, - license: "Apache-2.0", - browser: { - "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" - }, - "react-native": { - "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" - }, - homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sfn", - repository: { - type: "git", - url: "https://github.com/aws/aws-sdk-js-v3.git", - directory: "clients/client-sfn" + while (true) { + try { + if (isRequest) { + request2.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + const { response, output } = await next(args); + retryStrategy.recordSuccess(retryToken); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalRetryDelay; + return { response, output }; + } catch (e) { + const retryErrorInfo = getRetryErrorInfo(e); + lastError = asSdkError(e); + if (isRequest && (0, import_isStreamingPayload.isStreamingPayload)(request2)) { + (_a = context.logger instanceof import_smithy_client4.NoOpLogger ? console : context.logger) == null ? void 0 : _a.warn( + "An error was encountered in a non-retryable streaming request." + ); + throw lastError; + } + try { + retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); + } catch (refreshError) { + if (!lastError.$metadata) { + lastError.$metadata = {}; + } + lastError.$metadata.attempts = attempts + 1; + lastError.$metadata.totalRetryDelay = totalRetryDelay; + throw lastError; + } + attempts = retryToken.getRetryCount(); + const delay = retryToken.getRetryDelay(); + totalRetryDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + } + } else { + retryStrategy = retryStrategy; + if (retryStrategy == null ? void 0 : retryStrategy.mode) + context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; + return retryStrategy.retry(next, args); + } + }, "retryMiddleware"); + var isRetryStrategyV2 = /* @__PURE__ */ __name((retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined", "isRetryStrategyV2"); + var getRetryErrorInfo = /* @__PURE__ */ __name((error) => { + const errorInfo = { + error, + errorType: getRetryErrorType(error) + }; + const retryAfterHint = getRetryAfterHint(error.$response); + if (retryAfterHint) { + errorInfo.retryAfterHint = retryAfterHint; + } + return errorInfo; + }, "getRetryErrorInfo"); + var getRetryErrorType = /* @__PURE__ */ __name((error) => { + if ((0, import_service_error_classification.isThrottlingError)(error)) + return "THROTTLING"; + if ((0, import_service_error_classification.isTransientError)(error)) + return "TRANSIENT"; + if ((0, import_service_error_classification.isServerError)(error)) + return "SERVER_ERROR"; + return "CLIENT_ERROR"; + }, "getRetryErrorType"); + var retryMiddlewareOptions = { + name: "retryMiddleware", + tags: ["RETRY"], + step: "finalizeRequest", + priority: "high", + override: true + }; + var getRetryPlugin = /* @__PURE__ */ __name((options) => ({ + applyToStack: (clientStack) => { + clientStack.add(retryMiddleware(options), retryMiddlewareOptions); + } + }), "getRetryPlugin"); + var getRetryAfterHint = /* @__PURE__ */ __name((response) => { + if (!import_protocol_http8.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return new Date(retryAfterSeconds * 1e3); + const retryAfterDate = new Date(retryAfter); + return retryAfterDate; + }, "getRetryAfterHint"); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js +var warningEmitted, emitWarningIfUnsupportedVersion; +var init_emitWarningIfUnsupportedVersion = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() { + warningEmitted = false; + emitWarningIfUnsupportedVersion = (version2) => { + if (version2 && !warningEmitted && parseInt(version2.substring(1, version2.indexOf("."))) < 18) { + warningEmitted = true; + process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will +no longer support Node.js 16.x on January 6, 2025. + +To continue receiving updates to AWS services, bug fixes, and security +updates please upgrade to a supported Node.js LTS version. + +More information can be found at: https://a.co/74kJMmI`); } }; } }); -// ../../../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js -var require_dist_cjs48 = __commonJS({ - "../../../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +var init_client = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() { + init_emitWarningIfUnsupportedVersion(); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +var import_protocol_http5, getDateHeader; +var init_getDateHeader = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() { + import_protocol_http5 = __toESM(require_dist_cjs2()); + getDateHeader = (response) => import_protocol_http5.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0; + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js +var getSkewCorrectedDate; +var init_getSkewCorrectedDate = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js"() { + getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js +var isClockSkewed; +var init_isClockSkewed = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js"() { + init_getSkewCorrectedDate(); + isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5; + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +var getUpdatedSystemClockOffset; +var init_getUpdatedSystemClockOffset = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js"() { + init_isClockSkewed(); + getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); + } + return currentSystemClockOffset; }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js +var init_utils = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() { + init_getDateHeader(); + init_getSkewCorrectedDate(); + init_getUpdatedSystemClockOffset(); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +var import_protocol_http6, throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer, AWSSDKSigV4Signer; +var init_AwsSdkSigV4Signer = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() { + import_protocol_http6 = __toESM(require_dist_cjs2()); + init_utils(); + throwSigningPropertyError = (name, property) => { + if (!property) { + throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); } - return to; + return property; }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID, - ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE, - ENV_EXPIRATION: () => ENV_EXPIRATION, - ENV_KEY: () => ENV_KEY, - ENV_SECRET: () => ENV_SECRET, - ENV_SESSION: () => ENV_SESSION, - fromEnv: () => fromEnv - }); - module2.exports = __toCommonJS2(src_exports); - var import_property_provider2 = require_dist_cjs40(); - var ENV_KEY = "AWS_ACCESS_KEY_ID"; - var ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; - var ENV_SESSION = "AWS_SESSION_TOKEN"; - var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; - var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; - var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID"; - var fromEnv = /* @__PURE__ */ __name((init) => async () => { - var _a; - (_a = init == null ? void 0 : init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-env - fromEnv"); - const accessKeyId = process.env[ENV_KEY]; - const secretAccessKey = process.env[ENV_SECRET]; - const sessionToken = process.env[ENV_SESSION]; - const expiry = process.env[ENV_EXPIRATION]; - const credentialScope = process.env[ENV_CREDENTIAL_SCOPE]; - const accountId = process.env[ENV_ACCOUNT_ID]; - if (accessKeyId && secretAccessKey) { - return { - accessKeyId, - secretAccessKey, - ...sessionToken && { sessionToken }, - ...expiry && { expiration: new Date(expiry) }, - ...credentialScope && { credentialScope }, - ...accountId && { accountId } + validateSigningProperties = async (signingProperties) => { + const context = throwSigningPropertyError("context", signingProperties.context); + const config = throwSigningPropertyError("config", signingProperties.config); + const authScheme = context.endpointV2?.properties?.authSchemes?.[0]; + const signerFunction = throwSigningPropertyError("signer", config.signer); + const signer = await signerFunction(authScheme); + const signingRegion = signingProperties?.signingRegion; + const signingRegionSet = signingProperties?.signingRegionSet; + const signingName = signingProperties?.signingName; + return { + config, + signer, + signingRegion, + signingRegionSet, + signingName + }; + }; + AwsSdkSigV4Signer = class { + async sign(httpRequest, identity, signingProperties) { + if (!import_protocol_http6.HttpRequest.isInstance(httpRequest)) { + throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); + } + const validatedProps = await validateSigningProperties(signingProperties); + const { config, signer } = validatedProps; + let { signingRegion, signingName } = validatedProps; + const handlerExecutionContext = signingProperties.context; + if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) { + const [first, second] = handlerExecutionContext.authSchemes; + if (first?.name === "sigv4a" && second?.name === "sigv4") { + signingRegion = second?.signingRegion ?? signingRegion; + signingName = second?.signingName ?? signingName; + } + } + const signedRequest = await signer.sign(httpRequest, { + signingDate: getSkewCorrectedDate(config.systemClockOffset), + signingRegion, + signingService: signingName + }); + return signedRequest; + } + errorHandler(signingProperties) { + return (error) => { + const serverTime = error.ServerTime ?? getDateHeader(error.$response); + if (serverTime) { + const config = throwSigningPropertyError("config", signingProperties.config); + const initialSystemClockOffset = config.systemClockOffset; + config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); + const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; + if (clockSkewCorrected && error.$metadata) { + error.$metadata.clockSkewCorrected = true; + } + } + throw error; }; } - throw new import_property_provider2.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init == null ? void 0 : init.logger }); - }, "fromEnv"); + successHandler(httpResponse, signingProperties) { + const dateHeader = getDateHeader(httpResponse); + if (dateHeader) { + const config = throwSigningPropertyError("config", signingProperties.config); + config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); + } + } + }; + AWSSDKSigV4Signer = AwsSdkSigV4Signer; + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +var import_protocol_http7, AwsSdkSigV4ASigner; +var init_AwsSdkSigV4ASigner = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js"() { + import_protocol_http7 = __toESM(require_dist_cjs2()); + init_utils(); + init_AwsSdkSigV4Signer(); + AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer { + async sign(httpRequest, identity, signingProperties) { + if (!import_protocol_http7.HttpRequest.isInstance(httpRequest)) { + throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); + } + const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties); + const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.(); + const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(","); + const signedRequest = await signer.sign(httpRequest, { + signingDate: getSkewCorrectedDate(config.systemClockOffset), + signingRegion: multiRegionOverride, + signingService: signingName + }); + return signedRequest; + } + }; } }); -// ../../../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js -var require_dist_cjs49 = __commonJS({ - "../../../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js"(exports2, module2) { +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js +var import_property_provider, resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS; +var init_resolveAwsSdkSigV4AConfig = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() { + init_dist_es(); + import_property_provider = __toESM(require_dist_cjs24()); + resolveAwsSdkSigV4AConfig = (config) => { + config.sigv4aSigningRegionSet = normalizeProvider(config.sigv4aSigningRegionSet); + return config; + }; + NODE_SIGV4A_CONFIG_OPTIONS = { + environmentVariableSelector(env) { + if (env.AWS_SIGV4A_SIGNING_REGION_SET) { + return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim()); + } + throw new import_property_provider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", { + tryNextLink: true + }); + }, + configFileSelector(profile) { + if (profile.sigv4a_signing_region_set) { + return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim()); + } + throw new import_property_provider.ProviderError("sigv4a_signing_region_set not set in profile.", { + tryNextLink: true + }); + }, + default: void 0 + }; + } +}); + +// ../../../node_modules/@smithy/signature-v4/dist-cjs/index.js +var require_dist_cjs35 = __commonJS({ + "../../../node_modules/@smithy/signature-v4/dist-cjs/index.js"(exports2, module2) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -13837,4140 +8969,4348 @@ var require_dist_cjs49 = __commonJS({ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); var src_exports = {}; __export2(src_exports, { - DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES, - DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT, - ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN, - ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI, - ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI, - Endpoint: () => Endpoint, - fromContainerMetadata: () => fromContainerMetadata, - fromInstanceMetadata: () => fromInstanceMetadata, - getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint, - httpRequest: () => httpRequest, - providerConfigFromInit: () => providerConfigFromInit + SignatureV4: () => SignatureV42, + clearCredentialCache: () => clearCredentialCache, + createScope: () => createScope, + getCanonicalHeaders: () => getCanonicalHeaders, + getCanonicalQuery: () => getCanonicalQuery, + getPayloadHash: () => getPayloadHash, + getSigningKey: () => getSigningKey, + moveHeadersToQuery: () => moveHeadersToQuery, + prepareRequest: () => prepareRequest }); module2.exports = __toCommonJS2(src_exports); - var import_url = require("url"); - var import_property_provider2 = require_dist_cjs40(); - var import_buffer = require("buffer"); - var import_http2 = require("http"); - function httpRequest(options) { - return new Promise((resolve, reject) => { - var _a; - const req = (0, import_http2.request)({ - method: "GET", - ...options, - // Node.js http module doesn't accept hostname with square brackets - // Refs: https://github.com/nodejs/node/issues/39738 - hostname: (_a = options.hostname) == null ? void 0 : _a.replace(/^\[(.+)\]$/, "$1") - }); - req.on("error", (err) => { - reject(Object.assign(new import_property_provider2.ProviderError("Unable to connect to instance metadata service"), err)); - req.destroy(); - }); - req.on("timeout", () => { - reject(new import_property_provider2.ProviderError("TimeoutError from instance metadata service")); - req.destroy(); - }); - req.on("response", (res) => { - const { statusCode = 400 } = res; - if (statusCode < 200 || 300 <= statusCode) { - reject( - Object.assign(new import_property_provider2.ProviderError("Error response received from instance metadata service"), { statusCode }) - ); - req.destroy(); - } - const chunks = []; - res.on("data", (chunk) => { - chunks.push(chunk); - }); - res.on("end", () => { - resolve(import_buffer.Buffer.concat(chunks)); - req.destroy(); - }); - }); - req.end(); - }); - } - __name(httpRequest, "httpRequest"); - var isImdsCredentials = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string", "isImdsCredentials"); - var fromImdsCredentials = /* @__PURE__ */ __name((creds) => ({ - accessKeyId: creds.AccessKeyId, - secretAccessKey: creds.SecretAccessKey, - sessionToken: creds.Token, - expiration: new Date(creds.Expiration), - ...creds.AccountId && { accountId: creds.AccountId } - }), "fromImdsCredentials"); - var DEFAULT_TIMEOUT = 1e3; - var DEFAULT_MAX_RETRIES = 0; - var providerConfigFromInit = /* @__PURE__ */ __name(({ - maxRetries = DEFAULT_MAX_RETRIES, - timeout = DEFAULT_TIMEOUT - }) => ({ maxRetries, timeout }), "providerConfigFromInit"); - var retry = /* @__PURE__ */ __name((toRetry, maxRetries) => { - let promise = toRetry(); - for (let i = 0; i < maxRetries; i++) { - promise = promise.catch(toRetry); + var import_util_middleware3 = require_dist_cjs10(); + var import_util_utf84 = require_dist_cjs15(); + var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; + var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; + var AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; + var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; + var EXPIRES_QUERY_PARAM = "X-Amz-Expires"; + var SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; + var TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; + var AUTH_HEADER = "authorization"; + var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); + var DATE_HEADER = "date"; + var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; + var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); + var SHA256_HEADER = "x-amz-content-sha256"; + var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); + var ALWAYS_UNSIGNABLE_HEADERS = { + authorization: true, + "cache-control": true, + connection: true, + expect: true, + from: true, + "keep-alive": true, + "max-forwards": true, + pragma: true, + referer: true, + te: true, + trailer: true, + "transfer-encoding": true, + upgrade: true, + "user-agent": true, + "x-amzn-trace-id": true + }; + var PROXY_HEADER_PATTERN = /^proxy-/; + var SEC_HEADER_PATTERN = /^sec-/; + var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; + var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; + var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; + var MAX_CACHE_SIZE = 50; + var KEY_TYPE_IDENTIFIER = "aws4_request"; + var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; + var import_util_hex_encoding = require_dist_cjs21(); + var import_util_utf8 = require_dist_cjs15(); + var signingKeyCache = {}; + var cacheQueue = []; + var createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope"); + var getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => { + const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); + const cacheKey = `${shortDate}:${region}:${service}:${(0, import_util_hex_encoding.toHex)(credsHash)}:${credentials.sessionToken}`; + if (cacheKey in signingKeyCache) { + return signingKeyCache[cacheKey]; } - return promise; - }, "retry"); - var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; - var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; - var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; - var fromContainerMetadata = /* @__PURE__ */ __name((init = {}) => { - const { timeout, maxRetries } = providerConfigFromInit(init); - return () => retry(async () => { - const requestOptions = await getCmdsUri({ logger: init.logger }); - const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); - if (!isImdsCredentials(credsResponse)) { - throw new import_property_provider2.CredentialsProviderError("Invalid response received from instance metadata service.", { - logger: init.logger - }); - } - return fromImdsCredentials(credsResponse); - }, maxRetries); - }, "fromContainerMetadata"); - var requestFromEcsImds = /* @__PURE__ */ __name(async (timeout, options) => { - if (process.env[ENV_CMDS_AUTH_TOKEN]) { - options.headers = { - ...options.headers, - Authorization: process.env[ENV_CMDS_AUTH_TOKEN] - }; + cacheQueue.push(cacheKey); + while (cacheQueue.length > MAX_CACHE_SIZE) { + delete signingKeyCache[cacheQueue.shift()]; } - const buffer = await httpRequest({ - ...options, - timeout + let key = `AWS4${credentials.secretAccessKey}`; + for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { + key = await hmac(sha256Constructor, key, signable); + } + return signingKeyCache[cacheKey] = key; + }, "getSigningKey"); + var clearCredentialCache = /* @__PURE__ */ __name(() => { + cacheQueue.length = 0; + Object.keys(signingKeyCache).forEach((cacheKey) => { + delete signingKeyCache[cacheKey]; }); - return buffer.toString(); - }, "requestFromEcsImds"); - var CMDS_IP = "169.254.170.2"; - var GREENGRASS_HOSTS = { - localhost: true, - "127.0.0.1": true - }; - var GREENGRASS_PROTOCOLS = { - "http:": true, - "https:": true - }; - var getCmdsUri = /* @__PURE__ */ __name(async ({ logger }) => { - if (process.env[ENV_CMDS_RELATIVE_URI]) { - return { - hostname: CMDS_IP, - path: process.env[ENV_CMDS_RELATIVE_URI] - }; + }, "clearCredentialCache"); + var hmac = /* @__PURE__ */ __name((ctor, secret, data) => { + const hash = new ctor(secret); + hash.update((0, import_util_utf8.toUint8Array)(data)); + return hash.digest(); + }, "hmac"); + var getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => { + const canonical = {}; + for (const headerName of Object.keys(headers).sort()) { + if (headers[headerName] == void 0) { + continue; + } + const canonicalHeaderName = headerName.toLowerCase(); + if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || (unsignableHeaders == null ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) { + if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) { + continue; + } + } + canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); } - if (process.env[ENV_CMDS_FULL_URI]) { - const parsed = (0, import_url.parse)(process.env[ENV_CMDS_FULL_URI]); - if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { - throw new import_property_provider2.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, { - tryNextLink: false, - logger - }); + return canonical; + }, "getCanonicalHeaders"); + var import_util_uri_escape = require_dist_cjs17(); + var getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query)) { + if (key.toLowerCase() === SIGNATURE_HEADER) { + continue; } - if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { - throw new import_property_provider2.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, { - tryNextLink: false, - logger - }); + const encodedKey = (0, import_util_uri_escape.escapeUri)(key); + keys.push(encodedKey); + const value = query[key]; + if (typeof value === "string") { + serialized[encodedKey] = `${encodedKey}=${(0, import_util_uri_escape.escapeUri)(value)}`; + } else if (Array.isArray(value)) { + serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${(0, import_util_uri_escape.escapeUri)(value2)}`]), []).sort().join("&"); } - return { - ...parsed, - port: parsed.port ? parseInt(parsed.port, 10) : void 0 - }; } - throw new import_property_provider2.CredentialsProviderError( - `The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, - { - tryNextLink: false, - logger + return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); + }, "getCanonicalQuery"); + var import_is_array_buffer = require_dist_cjs13(); + var import_util_utf82 = require_dist_cjs15(); + var getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => { + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase() === SHA256_HEADER) { + return headers[headerName]; } - ); - }, "getCmdsUri"); - var _InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError2 extends import_property_provider2.CredentialsProviderError { - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - this.name = "InstanceMetadataV1FallbackError"; - Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError2.prototype); } - }; - __name(_InstanceMetadataV1FallbackError, "InstanceMetadataV1FallbackError"); - var InstanceMetadataV1FallbackError = _InstanceMetadataV1FallbackError; - var import_node_config_provider = require_dist_cjs42(); - var import_url_parser = require_dist_cjs44(); - var Endpoint = /* @__PURE__ */ ((Endpoint2) => { - Endpoint2["IPv4"] = "http://169.254.169.254"; - Endpoint2["IPv6"] = "http://[fd00:ec2::254]"; - return Endpoint2; - })(Endpoint || {}); - var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; - var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; - var ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME], - configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], - default: void 0 - }; - var EndpointMode = /* @__PURE__ */ ((EndpointMode2) => { - EndpointMode2["IPv4"] = "IPv4"; - EndpointMode2["IPv6"] = "IPv6"; - return EndpointMode2; - })(EndpointMode || {}); - var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; - var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; - var ENDPOINT_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME], - configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], - default: "IPv4" - /* IPv4 */ - }; - var getInstanceMetadataEndpoint = /* @__PURE__ */ __name(async () => (0, import_url_parser.parseUrl)(await getFromEndpointConfig() || await getFromEndpointModeConfig()), "getInstanceMetadataEndpoint"); - var getFromEndpointConfig = /* @__PURE__ */ __name(async () => (0, import_node_config_provider.loadConfig)(ENDPOINT_CONFIG_OPTIONS)(), "getFromEndpointConfig"); - var getFromEndpointModeConfig = /* @__PURE__ */ __name(async () => { - const endpointMode = await (0, import_node_config_provider.loadConfig)(ENDPOINT_MODE_CONFIG_OPTIONS)(); - switch (endpointMode) { - case "IPv4": - return "http://169.254.169.254"; - case "IPv6": - return "http://[fd00:ec2::254]"; - default: - throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`); + if (body == void 0) { + return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + } else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, import_is_array_buffer.isArrayBuffer)(body)) { + const hashCtor = new hashConstructor(); + hashCtor.update((0, import_util_utf82.toUint8Array)(body)); + return (0, import_util_hex_encoding.toHex)(await hashCtor.digest()); } - }, "getFromEndpointModeConfig"); - var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; - var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; - var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; - var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger) => { - const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); - const newExpiration = new Date(Date.now() + refreshInterval * 1e3); - logger.warn( - `Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}. -For more information, please visit: ` + STATIC_STABILITY_DOC_URL - ); - const originalExpiration = credentials.originalExpiration ?? credentials.expiration; - return { - ...credentials, - ...originalExpiration ? { originalExpiration } : {}, - expiration: newExpiration - }; - }, "getExtendedInstanceMetadataCredentials"); - var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => { - const logger = (options == null ? void 0 : options.logger) || console; - let pastCredentials; - return async () => { - let credentials; - try { - credentials = await provider(); - if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { - credentials = getExtendedInstanceMetadataCredentials(credentials, logger); - } - } catch (e) { - if (pastCredentials) { - logger.warn("Credential renew failed: ", e); - credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger); - } else { - throw e; - } + return UNSIGNED_PAYLOAD; + }, "getPayloadHash"); + var import_util_utf83 = require_dist_cjs15(); + var _HeaderFormatter = class _HeaderFormatter { + format(headers) { + const chunks = []; + for (const headerName of Object.keys(headers)) { + const bytes = (0, import_util_utf83.fromUtf8)(headerName); + chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); } - pastCredentials = credentials; - return credentials; - }; - }, "staticStabilityProvider"); - var IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; - var IMDS_TOKEN_PATH = "/latest/api/token"; - var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; - var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; - var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; - var fromInstanceMetadata = /* @__PURE__ */ __name((init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }), "fromInstanceMetadata"); - var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => { - let disableFetchToken = false; - const { logger, profile } = init; - const { timeout, maxRetries } = providerConfigFromInit(init); - const getCredentials = /* @__PURE__ */ __name(async (maxRetries2, options) => { - var _a; - const isImdsV1Fallback = disableFetchToken || ((_a = options.headers) == null ? void 0 : _a[X_AWS_EC2_METADATA_TOKEN]) == null; - if (isImdsV1Fallback) { - let fallbackBlockedFromProfile = false; - let fallbackBlockedFromProcessEnv = false; - const configValue = await (0, import_node_config_provider.loadConfig)( - { - environmentVariableSelector: (env) => { - const envValue = env[AWS_EC2_METADATA_V1_DISABLED]; - fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; - if (envValue === void 0) { - throw new import_property_provider2.CredentialsProviderError( - `${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, - { logger: init.logger } - ); - } - return fallbackBlockedFromProcessEnv; - }, - configFileSelector: (profile2) => { - const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; - fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; - return fallbackBlockedFromProfile; - }, - default: false - }, - { - profile - } - )(); - if (init.ec2MetadataV1Disabled || configValue) { - const causes = []; - if (init.ec2MetadataV1Disabled) - causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); - if (fallbackBlockedFromProfile) - causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); - if (fallbackBlockedFromProcessEnv) - causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); - throw new InstanceMetadataV1FallbackError( - `AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join( - ", " - )}].` - ); - } + const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); + let position = 0; + for (const chunk of chunks) { + out.set(chunk, position); + position += chunk.byteLength; } - const imdsProfile = (await retry(async () => { - let profile2; - try { - profile2 = await getProfile(options); - } catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return profile2; - }, maxRetries2)).trim(); - return retry(async () => { - let creds; - try { - creds = await getCredentialsFromProfile(imdsProfile, options, init); - } catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return creds; - }, maxRetries2); - }, "getCredentials"); - return async () => { - const endpoint = await getInstanceMetadataEndpoint(); - if (disableFetchToken) { - logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); - return getCredentials(maxRetries, { ...endpoint, timeout }); - } else { - let token; - try { - token = (await getMetadataToken({ ...endpoint, timeout })).toString(); - } catch (error) { - if ((error == null ? void 0 : error.statusCode) === 400) { - throw Object.assign(error, { - message: "EC2 Metadata token request returned error" - }); - } else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { - disableFetchToken = true; + return out; + } + formatHeaderValue(header) { + switch (header.type) { + case "boolean": + return Uint8Array.from([ + header.value ? 0 : 1 + /* boolFalse */ + ]); + case "byte": + return Uint8Array.from([2, header.value]); + case "short": + const shortView = new DataView(new ArrayBuffer(3)); + shortView.setUint8( + 0, + 3 + /* short */ + ); + shortView.setInt16(1, header.value, false); + return new Uint8Array(shortView.buffer); + case "integer": + const intView = new DataView(new ArrayBuffer(5)); + intView.setUint8( + 0, + 4 + /* integer */ + ); + intView.setInt32(1, header.value, false); + return new Uint8Array(intView.buffer); + case "long": + const longBytes = new Uint8Array(9); + longBytes[0] = 5; + longBytes.set(header.value.bytes, 1); + return longBytes; + case "binary": + const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); + binView.setUint8( + 0, + 6 + /* byteArray */ + ); + binView.setUint16(1, header.value.byteLength, false); + const binBytes = new Uint8Array(binView.buffer); + binBytes.set(header.value, 3); + return binBytes; + case "string": + const utf8Bytes = (0, import_util_utf83.fromUtf8)(header.value); + const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); + strView.setUint8( + 0, + 7 + /* string */ + ); + strView.setUint16(1, utf8Bytes.byteLength, false); + const strBytes = new Uint8Array(strView.buffer); + strBytes.set(utf8Bytes, 3); + return strBytes; + case "timestamp": + const tsBytes = new Uint8Array(9); + tsBytes[0] = 8; + tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1); + return tsBytes; + case "uuid": + if (!UUID_PATTERN.test(header.value)) { + throw new Error(`Invalid UUID received: ${header.value}`); } - logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); - return getCredentials(maxRetries, { ...endpoint, timeout }); - } - return getCredentials(maxRetries, { - ...endpoint, - headers: { - [X_AWS_EC2_METADATA_TOKEN]: token - }, - timeout - }); + const uuidBytes = new Uint8Array(17); + uuidBytes[0] = 9; + uuidBytes.set((0, import_util_hex_encoding.fromHex)(header.value.replace(/\-/g, "")), 1); + return uuidBytes; } - }; - }, "getInstanceMetadataProvider"); - var getMetadataToken = /* @__PURE__ */ __name(async (options) => httpRequest({ - ...options, - path: IMDS_TOKEN_PATH, - method: "PUT", - headers: { - "x-aws-ec2-metadata-token-ttl-seconds": "21600" - } - }), "getMetadataToken"); - var getProfile = /* @__PURE__ */ __name(async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(), "getProfile"); - var getCredentialsFromProfile = /* @__PURE__ */ __name(async (profile, options, init) => { - const credentialsResponse = JSON.parse( - (await httpRequest({ - ...options, - path: IMDS_PATH + profile - })).toString() - ); - if (!isImdsCredentials(credentialsResponse)) { - throw new import_property_provider2.CredentialsProviderError("Invalid response received from instance metadata service.", { - logger: init.logger - }); - } - return fromImdsCredentials(credentialsResponse); - }, "getCredentialsFromProfile"); - } -}); - -// ../../../node_modules/@smithy/node-http-handler/node_modules/@smithy/querystring-builder/dist-cjs/index.js -var require_dist_cjs50 = __commonJS({ - "../../../node_modules/@smithy/node-http-handler/node_modules/@smithy/querystring-builder/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } - return to; }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - buildQueryString: () => buildQueryString - }); - module2.exports = __toCommonJS2(src_exports); - var import_util_uri_escape = require_dist_cjs31(); - function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, import_util_uri_escape.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); - } - } else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; - } - parts.push(qsEntry); + __name(_HeaderFormatter, "HeaderFormatter"); + var HeaderFormatter = _HeaderFormatter; + var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; + var _Int64 = class _Int642 { + constructor(bytes) { + this.bytes = bytes; + if (bytes.byteLength !== 8) { + throw new Error("Int64 buffers must be exactly 8 bytes"); } } - return parts.join("&"); - } - __name(buildQueryString, "buildQueryString"); - } -}); - -// ../../../node_modules/@smithy/node-http-handler/dist-cjs/index.js -var require_dist_cjs51 = __commonJS({ - "../../../node_modules/@smithy/node-http-handler/dist-cjs/index.js"(exports2, module2) { - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + static fromNumber(number) { + if (number > 9223372036854776e3 || number < -9223372036854776e3) { + throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); + } + const bytes = new Uint8Array(8); + for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) { + bytes[i] = remaining; + } + if (number < 0) { + negate(bytes); + } + return new _Int642(bytes); } - return to; - }; - var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, - mod - )); - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, - NodeHttp2Handler: () => NodeHttp2Handler, - NodeHttpHandler: () => NodeHttpHandler, - streamCollector: () => streamCollector - }); - module2.exports = __toCommonJS2(src_exports); - var import_protocol_http8 = require_dist_cjs2(); - var import_querystring_builder = require_dist_cjs50(); - var import_http2 = require("http"); - var import_https = require("https"); - var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { - const transformedHeaders = {}; - for (const name of Object.keys(headers)) { - const headerValues = headers[name]; - transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + /** + * Called implicitly by infix arithmetic operators. + */ + valueOf() { + const bytes = this.bytes.slice(0); + const negative = bytes[0] & 128; + if (negative) { + negate(bytes); + } + return parseInt((0, import_util_hex_encoding.toHex)(bytes), 16) * (negative ? -1 : 1); } - return transformedHeaders; - }, "getTransformedHeaders"); - var DEFER_EVENT_LISTENER_TIME = 1e3; - var setConnectionTimeout = /* @__PURE__ */ __name((request2, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return -1; + toString() { + return String(this.valueOf()); } - const registerTimeout = /* @__PURE__ */ __name((offset) => { - const timeoutId = setTimeout(() => { - request2.destroy(); - reject( - Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError" - }) - ); - }, timeoutInMs - offset); - const doWithSocket = /* @__PURE__ */ __name((socket) => { - if (socket == null ? void 0 : socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } else { - clearTimeout(timeoutId); - } - }, "doWithSocket"); - if (request2.socket) { - doWithSocket(request2.socket); - } else { - request2.on("socket", doWithSocket); - } - }, "registerTimeout"); - if (timeoutInMs < 2e3) { - registerTimeout(0); - return 0; + }; + __name(_Int64, "Int64"); + var Int64 = _Int64; + function negate(bytes) { + for (let i = 0; i < 8; i++) { + bytes[i] ^= 255; } - return setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); - }, "setConnectionTimeout"); - var DEFER_EVENT_LISTENER_TIME2 = 3e3; - var setSocketKeepAlive = /* @__PURE__ */ __name((request2, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => { - if (keepAlive !== true) { - return -1; + for (let i = 7; i > -1; i--) { + bytes[i]++; + if (bytes[i] !== 0) + break; } - const registerListener = /* @__PURE__ */ __name(() => { - if (request2.socket) { - request2.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - } else { - request2.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); + } + __name(negate, "negate"); + var hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; } - }, "registerListener"); - if (deferTimeMs === 0) { - registerListener(); - return 0; } - return setTimeout(registerListener, deferTimeMs); - }, "setSocketKeepAlive"); - var DEFER_EVENT_LISTENER_TIME3 = 3e3; - var setSocketTimeout = /* @__PURE__ */ __name((request2, reject, timeoutInMs = 0) => { - const registerTimeout = /* @__PURE__ */ __name((offset) => { - request2.setTimeout(timeoutInMs - offset, () => { - request2.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); - }, "registerTimeout"); - if (0 < timeoutInMs && timeoutInMs < 6e3) { - registerTimeout(0); - return 0; + return false; + }, "hasHeader"); + var import_protocol_http8 = require_dist_cjs2(); + var moveHeadersToQuery = /* @__PURE__ */ __name((request2, options = {}) => { + var _a, _b; + const { headers, query = {} } = import_protocol_http8.HttpRequest.clone(request2); + for (const name of Object.keys(headers)) { + const lname = name.toLowerCase(); + if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) == null ? void 0 : _a.has(lname)) || ((_b = options.hoistableHeaders) == null ? void 0 : _b.has(lname))) { + query[name] = headers[name]; + delete headers[name]; + } } - return setTimeout( - registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), - DEFER_EVENT_LISTENER_TIME3 - ); - }, "setSocketTimeout"); - var import_stream = require("stream"); - var MIN_WAIT_TIME = 1e3; - async function writeRequestBody(httpRequest, request2, maxContinueTimeoutMs = MIN_WAIT_TIME) { - const headers = request2.headers ?? {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }) - ]); + return { + ...request2, + headers, + query + }; + }, "moveHeadersToQuery"); + var prepareRequest = /* @__PURE__ */ __name((request2) => { + request2 = import_protocol_http8.HttpRequest.clone(request2); + for (const headerName of Object.keys(request2.headers)) { + if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { + delete request2.headers[headerName]; + } } - if (!hasError) { - writeBody(httpRequest, request2.body); + return request2; + }, "prepareRequest"); + var iso8601 = /* @__PURE__ */ __name((time) => toDate(time).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601"); + var toDate = /* @__PURE__ */ __name((time) => { + if (typeof time === "number") { + return new Date(time * 1e3); } - } - __name(writeRequestBody, "writeRequestBody"); - function writeBody(httpRequest, body) { - if (body instanceof import_stream.Readable) { - body.pipe(httpRequest); - return; + if (typeof time === "string") { + if (Number(time)) { + return new Date(Number(time) * 1e3); + } + return new Date(time); } - if (body) { - if (Buffer.isBuffer(body) || typeof body === "string") { - httpRequest.end(body); - return; + return time; + }, "toDate"); + var _SignatureV4 = class _SignatureV4 { + constructor({ + applyChecksum, + credentials, + region, + service, + sha256, + uriEscapePath = true + }) { + this.headerFormatter = new HeaderFormatter(); + this.service = service; + this.sha256 = sha256; + this.uriEscapePath = uriEscapePath; + this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; + this.regionProvider = (0, import_util_middleware3.normalizeProvider)(region); + this.credentialProvider = (0, import_util_middleware3.normalizeProvider)(credentials); + } + async presign(originalRequest, options = {}) { + const { + signingDate = /* @__PURE__ */ new Date(), + expiresIn = 3600, + unsignableHeaders, + unhoistableHeaders, + signableHeaders, + hoistableHeaders, + signingRegion, + signingService + } = options; + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const { longDate, shortDate } = formatDate(signingDate); + if (expiresIn > MAX_PRESIGNED_TTL) { + return Promise.reject( + "Signature version 4 presigned URLs must have an expiration date less than one week in the future" + ); } - const uint8 = body; - if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { - httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); - return; + const scope = createScope(shortDate, region, signingService ?? this.service); + const request2 = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); + if (credentials.sessionToken) { + request2.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; } - httpRequest.end(Buffer.from(body)); - return; + request2.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; + request2.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; + request2.query[AMZ_DATE_QUERY_PARAM] = longDate; + request2.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); + const canonicalHeaders = getCanonicalHeaders(request2, unsignableHeaders, signableHeaders); + request2.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); + request2.query[SIGNATURE_QUERY_PARAM] = await this.getSignature( + longDate, + scope, + this.getSigningKey(credentials, region, shortDate, signingService), + this.createCanonicalRequest(request2, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256)) + ); + return request2; } - httpRequest.end(); - } - __name(writeBody, "writeBody"); - var DEFAULT_REQUEST_TIMEOUT = 0; - var _NodeHttpHandler = class _NodeHttpHandler2 { - constructor(options) { - this.socketWarningTimestamp = 0; - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options().then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }).catch(reject); - } else { - resolve(this.resolveDefaultConfig(options)); + async sign(toSign, options) { + if (typeof toSign === "string") { + return this.signString(toSign, options); + } else if (toSign.headers && toSign.payload) { + return this.signEvent(toSign, options); + } else if (toSign.message) { + return this.signMessage(toSign, options); + } else { + return this.signRequest(toSign, options); + } + } + async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) { + const region = signingRegion ?? await this.regionProvider(); + const { shortDate, longDate } = formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256); + const hash = new this.sha256(); + hash.update(headers); + const hashedHeaders = (0, import_util_hex_encoding.toHex)(await hash.digest()); + const stringToSign = [ + EVENT_ALGORITHM_IDENTIFIER, + longDate, + scope, + priorSignature, + hashedHeaders, + hashedPayload + ].join("\n"); + return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); + } + async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) { + const promise = this.signEvent( + { + headers: this.headerFormatter.format(signableMessage.message.headers), + payload: signableMessage.message.body + }, + { + signingDate, + signingRegion, + signingService, + priorSignature: signableMessage.priorSignature } + ); + return promise.then((signature) => { + return { message: signableMessage.message, signature }; }); } - /** - * @returns the input if it is an HttpHandler of any class, - * or instantiates a new instance of this handler. - */ - static create(instanceOrOptions) { - if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new _NodeHttpHandler2(instanceOrOptions); + async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const { shortDate } = formatDate(signingDate); + const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); + hash.update((0, import_util_utf84.toUint8Array)(stringToSign)); + return (0, import_util_hex_encoding.toHex)(await hash.digest()); } - /** - * @internal - * - * @param agent - http(s) agent in use by the NodeHttpHandler instance. - * @param socketWarningTimestamp - last socket usage check timestamp. - * @param logger - channel for the warning. - * @returns timestamp of last emitted warning. - */ - static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { - var _a, _b, _c; - const { sockets, requests, maxSockets } = agent; - if (typeof maxSockets !== "number" || maxSockets === Infinity) { - return socketWarningTimestamp; + async signRequest(requestToSign, { + signingDate = /* @__PURE__ */ new Date(), + signableHeaders, + unsignableHeaders, + signingRegion, + signingService + } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const request2 = prepareRequest(requestToSign); + const { longDate, shortDate } = formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + request2.headers[AMZ_DATE_HEADER] = longDate; + if (credentials.sessionToken) { + request2.headers[TOKEN_HEADER] = credentials.sessionToken; } - const interval = 15e3; - if (Date.now() - interval < socketWarningTimestamp) { - return socketWarningTimestamp; + const payloadHash = await getPayloadHash(request2, this.sha256); + if (!hasHeader(SHA256_HEADER, request2.headers) && this.applyChecksum) { + request2.headers[SHA256_HEADER] = payloadHash; } - if (sockets && requests) { - for (const origin in sockets) { - const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; - const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; - if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { - (_c = logger == null ? void 0 : logger.warn) == null ? void 0 : _c.call( - logger, - `@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued. -See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html -or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.` - ); - return Date.now(); + const canonicalHeaders = getCanonicalHeaders(request2, unsignableHeaders, signableHeaders); + const signature = await this.getSignature( + longDate, + scope, + this.getSigningKey(credentials, region, shortDate, signingService), + this.createCanonicalRequest(request2, canonicalHeaders, payloadHash) + ); + request2.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; + return request2; + } + createCanonicalRequest(request2, canonicalHeaders, payloadHash) { + const sortedHeaders = Object.keys(canonicalHeaders).sort(); + return `${request2.method} +${this.getCanonicalPath(request2)} +${getCanonicalQuery(request2)} +${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} + +${sortedHeaders.join(";")} +${payloadHash}`; + } + async createStringToSign(longDate, credentialScope, canonicalRequest) { + const hash = new this.sha256(); + hash.update((0, import_util_utf84.toUint8Array)(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${ALGORITHM_IDENTIFIER} +${longDate} +${credentialScope} +${(0, import_util_hex_encoding.toHex)(hashedRequest)}`; + } + getCanonicalPath({ path }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path.split("/")) { + if ((pathSegment == null ? void 0 : pathSegment.length) === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); + } else { + normalizedPathSegments.push(pathSegment); } } + const normalizedPath = `${(path == null ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path == null ? void 0 : path.endsWith("/")) ? "/" : ""}`; + const doubleEncoded = (0, import_util_uri_escape.escapeUri)(normalizedPath); + return doubleEncoded.replace(/%2F/g, "/"); } - return socketWarningTimestamp; + return path; } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout ?? socketTimeout, - httpAgent: (() => { - if (httpAgent instanceof import_http2.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { - return httpAgent; - } - return new import_http2.Agent({ keepAlive, maxSockets, ...httpAgent }); - })(), - httpsAgent: (() => { - if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { - return httpsAgent; - } - return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); - })(), - logger: console - }; + async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { + const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); + const hash = new this.sha256(await keyPromise); + hash.update((0, import_util_utf84.toUint8Array)(stringToSign)); + return (0, import_util_hex_encoding.toHex)(await hash.digest()); } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); - (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); + getSigningKey(credentials, region, shortDate, service) { + return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); } - async handle(request2, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; + validateResolvedCredentials(credentials) { + if (typeof credentials !== "object" || // @ts-expect-error: Property 'accessKeyId' does not exist on type 'object'.ts(2339) + typeof credentials.accessKeyId !== "string" || // @ts-expect-error: Property 'secretAccessKey' does not exist on type 'object'.ts(2339) + typeof credentials.secretAccessKey !== "string") { + throw new Error("Resolved credential object is not valid"); } - return new Promise((_resolve, _reject) => { - let writeRequestBodyPromise = void 0; - const timeouts = []; - const resolve = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - timeouts.forEach(clearTimeout); - _resolve(arg); - }, "resolve"); - const reject = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - timeouts.forEach(clearTimeout); - _reject(arg); - }, "reject"); - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal == null ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request2.protocol === "https:"; - const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; - timeouts.push( - setTimeout( - () => { - this.socketWarningTimestamp = _NodeHttpHandler2.checkSocketUsage( - agent, - this.socketWarningTimestamp, - this.config.logger - ); - }, - this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3) - ) - ); - const queryString = (0, import_querystring_builder.buildQueryString)(request2.query || {}); - let auth = void 0; - if (request2.username != null || request2.password != null) { - const username = request2.username ?? ""; - const password = request2.password ?? ""; - auth = `${username}:${password}`; - } - let path = request2.path; - if (queryString) { - path += `?${queryString}`; - } - if (request2.fragment) { - path += `#${request2.fragment}`; - } - const nodeHttpsOptions = { - headers: request2.headers, - host: request2.hostname, - method: request2.method, - path, - port: request2.port, - agent, - auth + } + }; + __name(_SignatureV4, "SignatureV4"); + var SignatureV42 = _SignatureV4; + var formatDate = /* @__PURE__ */ __name((now) => { + const longDate = iso8601(now).replace(/[\-:]/g, ""); + return { + longDate, + shortDate: longDate.slice(0, 8) + }; + }, "formatDate"); + var getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(headers).sort().join(";"), "getCanonicalHeaderList"); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +var import_signature_v4, resolveAwsSdkSigV4Config, resolveAWSSDKSigV4Config; +var init_resolveAwsSdkSigV4Config = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() { + init_dist_es(); + import_signature_v4 = __toESM(require_dist_cjs35()); + resolveAwsSdkSigV4Config = (config) => { + let normalizedCreds; + if (config.credentials) { + normalizedCreds = memoizeIdentityProvider(config.credentials, isIdentityExpired, doesIdentityRequireRefresh); + } + if (!normalizedCreds) { + if (config.credentialDefaultProvider) { + normalizedCreds = normalizeProvider(config.credentialDefaultProvider(Object.assign({}, config, { + parentClientConfig: config + }))); + } else { + normalizedCreds = async () => { + throw new Error("`credentials` is missing"); }; - const requestFunc = isSSL ? import_https.request : import_http2.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new import_protocol_http8.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: getTransformedHeaders(res.headers), - body: res - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } else { - reject(err); - } - }); - if (abortSignal) { - const onAbort = /* @__PURE__ */ __name(() => { - req.destroy(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }, "onAbort"); - if (typeof abortSignal.addEventListener === "function") { - const signal = abortSignal; - signal.addEventListener("abort", onAbort, { once: true }); - req.once("close", () => signal.removeEventListener("abort", onAbort)); - } else { - abortSignal.onabort = onAbort; - } - } - timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout)); - timeouts.push(setSocketTimeout(req, reject, this.config.requestTimeout)); - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - timeouts.push( - setSocketKeepAlive(req, { - // @ts-expect-error keepAlive is not public on httpAgent. - keepAlive: httpAgent.keepAlive, - // @ts-expect-error keepAliveMsecs is not public on httpAgent. - keepAliveMsecs: httpAgent.keepAliveMsecs - }) - ); - } - writeRequestBodyPromise = writeRequestBody(req, request2, this.config.requestTimeout).catch((e) => { - timeouts.forEach(clearTimeout); - return _reject(e); - }); - }); + } } - updateHttpClientConfig(key, value) { - this.config = void 0; - this.configProvider = this.configProvider.then((config) => { - return { + const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config; + let signer; + if (config.signer) { + signer = normalizeProvider(config.signer); + } else if (config.regionInfoProvider) { + signer = () => normalizeProvider(config.region)().then(async (region) => [ + await config.regionInfoProvider(region, { + useFipsEndpoint: await config.useFipsEndpoint(), + useDualstackEndpoint: await config.useDualstackEndpoint() + }) || {}, + region + ]).then(([regionInfo, region]) => { + const { signingRegion, signingService } = regionInfo; + config.signingRegion = config.signingRegion || signingRegion || region; + config.signingName = config.signingName || signingService || config.serviceId; + const params = { ...config, - [key]: value + credentials: normalizedCreds, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath }; + const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; + return new SignerCtor(params); }); + } else { + signer = async (authScheme) => { + authScheme = Object.assign({}, { + name: "sigv4", + signingName: config.signingName || config.defaultSigningName, + signingRegion: await normalizeProvider(config.region)(), + properties: {} + }, authScheme); + const signingRegion = authScheme.signingRegion; + const signingService = authScheme.signingName; + config.signingRegion = config.signingRegion || signingRegion; + config.signingName = config.signingName || signingService || config.serviceId; + const params = { + ...config, + credentials: normalizedCreds, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath + }; + const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; + return new SignerCtor(params); + }; } - httpHandlerConfigs() { - return this.config ?? {}; - } + return { + ...config, + systemClockOffset, + signingEscapePath, + credentials: normalizedCreds, + signer + }; }; - __name(_NodeHttpHandler, "NodeHttpHandler"); - var NodeHttpHandler = _NodeHttpHandler; - var import_http22 = require("http2"); - var import_http23 = __toESM2(require("http2")); - var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions ?? []; - } - poll() { - if (this.sessions.length > 0) { - return this.sessions.shift(); - } + resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js +var init_aws_sdk = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js"() { + init_AwsSdkSigV4Signer(); + init_AwsSdkSigV4ASigner(); + init_resolveAwsSdkSigV4AConfig(); + init_resolveAwsSdkSigV4Config(); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js +var init_httpAuthSchemes2 = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() { + init_aws_sdk(); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js +var _toStr, _toBool, _toNum; +var init_coercing_serializers = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() { + _toStr = (val2) => { + if (val2 == null) { + return val2; } - offerLast(session) { - this.sessions.push(session); + if (typeof val2 === "number" || typeof val2 === "bigint") { + const warning = new Error(`Received number ${val2} where a string was expected.`); + warning.name = "Warning"; + console.warn(warning); + return String(val2); } - contains(session) { - return this.sessions.includes(session); + if (typeof val2 === "boolean") { + const warning = new Error(`Received boolean ${val2} where a string was expected.`); + warning.name = "Warning"; + console.warn(warning); + return String(val2); } - remove(session) { - this.sessions = this.sessions.filter((s) => s !== session); + return val2; + }; + _toBool = (val2) => { + if (val2 == null) { + return val2; } - [Symbol.iterator]() { - return this.sessions[Symbol.iterator](); + if (typeof val2 === "number") { } - destroy(connection) { - for (const session of this.sessions) { - if (session === connection) { - if (!session.destroyed) { - session.destroy(); - } - } + if (typeof val2 === "string") { + const lowercase = val2.toLowerCase(); + if (val2 !== "" && lowercase !== "false" && lowercase !== "true") { + const warning = new Error(`Received string "${val2}" where a boolean was expected.`); + warning.name = "Warning"; + console.warn(warning); } + return val2 !== "" && lowercase !== "false"; } + return val2; }; - __name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); - var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; - var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = /* @__PURE__ */ new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); + _toNum = (val2) => { + if (val2 == null) { + return val2; + } + if (typeof val2 === "boolean") { + } + if (typeof val2 === "string") { + const num = Number(val2); + if (num.toString() !== val2) { + const warning = new Error(`Received string "${val2}" where a number was expected.`); + warning.name = "Warning"; + console.warn(warning); + return val2; } + return num; } - lease(requestContext, connectionConfiguration) { - const url2 = this.getUrlString(requestContext); - const existingPool = this.sessionCache.get(url2); - if (existingPool) { - const existingSession = existingPool.poll(); - if (existingSession && !this.config.disableConcurrency) { - return existingSession; + return val2; + }; + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js +var import_smithy_client, awsExpectUnion; +var init_awsExpectUnion = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() { + import_smithy_client = __toESM(require_dist_cjs33()); + awsExpectUnion = (value) => { + if (value == null) { + return void 0; + } + if (typeof value === "object" && "__type" in value) { + delete value.__type; + } + return (0, import_smithy_client.expectUnion)(value); + }; + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js +var import_smithy_client2, collectBodyString; +var init_common = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() { + import_smithy_client2 = __toESM(require_dist_cjs33()); + collectBodyString = (streamBody, context) => (0, import_smithy_client2.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +var parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode; +var init_parseJsonBody = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() { + init_common(); + parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + try { + return JSON.parse(encoded); + } catch (e) { + if (e?.name === "SyntaxError") { + Object.defineProperty(e, "$responseBodyText", { + value: encoded + }); } + throw e; } - const session = import_http23.default.connect(url2); - if (this.config.maxConcurrency) { - session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => { - if (err) { - throw new Error( - "Fail to set maxConcurrentStreams to " + this.config.maxConcurrency + "when creating new session for " + requestContext.destination.toString() - ); - } - }); + } + return {}; + }); + parseJsonErrorBody = async (errorBody, context) => { + const value = await parseJsonBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; + }; + loadRestJsonErrorCode = (output, data) => { + const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); } - session.unref(); - const destroySessionCb = /* @__PURE__ */ __name(() => { - session.destroy(); - this.deleteSession(url2, session); - }, "destroySessionCb"); - session.on("goaway", destroySessionCb); - session.on("error", destroySessionCb); - session.on("frameError", destroySessionCb); - session.on("close", () => this.deleteSession(url2, session)); - if (connectionConfiguration.requestTimeout) { - session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; } - const connectionPool = this.sessionCache.get(url2) || new NodeHttp2ConnectionPool(); - connectionPool.offerLast(session); - this.sessionCache.set(url2, connectionPool); - return session; - } - /** - * Delete a session from the connection pool. - * @param authority The authority of the session to delete. - * @param session The session to delete. - */ - deleteSession(authority, session) { - const existingConnectionPool = this.sessionCache.get(authority); - if (!existingConnectionPool) { - return; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; } - if (!existingConnectionPool.contains(session)) { - return; + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; } - existingConnectionPool.remove(session); - this.sessionCache.set(authority, existingConnectionPool); + return cleanValue; + }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== void 0) { + return sanitizeErrorCode(output.headers[headerKey]); } - release(requestContext, session) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + if (data.code !== void 0) { + return sanitizeErrorCode(data.code); } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } + if (data["__type"] !== void 0) { + return sanitizeErrorCode(data["__type"]); } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); + }; + } +}); + +// ../../../node_modules/fast-xml-parser/src/util.js +var require_util = __commonJS({ + "../../../node_modules/fast-xml-parser/src/util.js"(exports2) { + "use strict"; + var nameStartChar = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; + var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; + var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; + var regexName = new RegExp("^" + nameRegexp + "$"); + var getAllMatches = function(string, regex) { + const matches = []; + let match = regex.exec(string); + while (match) { + const allmatches = []; + allmatches.startIndex = regex.lastIndex - match[0].length; + const len = match.length; + for (let index = 0; index < len; index++) { + allmatches.push(match[index]); } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request2) { - return request2.destination.toString(); + matches.push(allmatches); + match = regex.exec(string); } + return matches; }; - __name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); - var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; - var _NodeHttp2Handler = class _NodeHttp2Handler2 { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new NodeHttp2ConnectionManager({}); - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options().then((opts) => { - resolve(opts || {}); - }).catch(reject); + var isName = function(string) { + const match = regexName.exec(string); + return !(match === null || typeof match === "undefined"); + }; + exports2.isExist = function(v) { + return typeof v !== "undefined"; + }; + exports2.isEmptyObject = function(obj) { + return Object.keys(obj).length === 0; + }; + exports2.merge = function(target, a, arrayMode) { + if (a) { + const keys = Object.keys(a); + const len = keys.length; + for (let i = 0; i < len; i++) { + if (arrayMode === "strict") { + target[keys[i]] = [a[keys[i]]]; } else { - resolve(options || {}); + target[keys[i]] = a[keys[i]]; } - }); - } - /** - * @returns the input if it is an HttpHandler of any class, - * or instantiates a new instance of this handler. - */ - static create(instanceOrOptions) { - if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { - return instanceOrOptions; } - return new _NodeHttp2Handler2(instanceOrOptions); } - destroy() { - this.connectionManager.destroy(); + }; + exports2.getValue = function(v) { + if (exports2.isExist(v)) { + return v; + } else { + return ""; } - async handle(request2, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a; - let fulfilled = false; - let writeRequestBodyPromise = void 0; - const resolve = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }, "resolve"); - const reject = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }, "reject"); - if (abortSignal == null ? void 0 : abortSignal.aborted) { - fulfilled = true; - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const { hostname, method, port, protocol, query } = request2; - let auth = ""; - if (request2.username != null || request2.password != null) { - const username = request2.username ?? ""; - const password = request2.password ?? ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_a = this.config) == null ? void 0 : _a.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false - }); - const rejectWithDestroy = /* @__PURE__ */ __name((err) => { - if (disableConcurrentStreams) { - this.destroySession(session); + }; + exports2.isName = isName; + exports2.getAllMatches = getAllMatches; + exports2.nameRegexp = nameRegexp; + } +}); + +// ../../../node_modules/fast-xml-parser/src/validator.js +var require_validator = __commonJS({ + "../../../node_modules/fast-xml-parser/src/validator.js"(exports2) { + "use strict"; + var util = require_util(); + var defaultOptions = { + allowBooleanAttributes: false, + //A tag can have attributes without any value + unpairedTags: [] + }; + exports2.validate = function(xmlData, options) { + options = Object.assign({}, defaultOptions, options); + const tags = []; + let tagFound = false; + let reachedRoot = false; + if (xmlData[0] === "\uFEFF") { + xmlData = xmlData.substr(1); + } + for (let i = 0; i < xmlData.length; i++) { + if (xmlData[i] === "<" && xmlData[i + 1] === "?") { + i += 2; + i = readPI(xmlData, i); + if (i.err) return i; + } else if (xmlData[i] === "<") { + let tagStartPos = i; + i++; + if (xmlData[i] === "!") { + i = readCommentAndCDATA(xmlData, i); + continue; + } else { + let closingTag = false; + if (xmlData[i] === "/") { + closingTag = true; + i++; } - fulfilled = true; - reject(err); - }, "rejectWithDestroy"); - const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); - let path = request2.path; - if (queryString) { - path += `?${queryString}`; - } - if (request2.fragment) { - path += `#${request2.fragment}`; - } - const req = session.request({ - ...request2.headers, - [import_http22.constants.HTTP2_HEADER_PATH]: path, - [import_http22.constants.HTTP2_HEADER_METHOD]: method - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new import_protocol_http8.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: getTransformedHeaders(headers), - body: req - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); + let tagName = ""; + for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { + tagName += xmlData[i]; } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - const onAbort = /* @__PURE__ */ __name(() => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }, "onAbort"); - if (typeof abortSignal.addEventListener === "function") { - const signal = abortSignal; - signal.addEventListener("abort", onAbort, { once: true }); - req.once("close", () => signal.removeEventListener("abort", onAbort)); + tagName = tagName.trim(); + if (tagName[tagName.length - 1] === "/") { + tagName = tagName.substring(0, tagName.length - 1); + i--; + } + if (!validateTagName(tagName)) { + let msg; + if (tagName.trim().length === 0) { + msg = "Invalid space after '<'."; + } else { + msg = "Tag '" + tagName + "' is an invalid name."; + } + return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); + } + const result = readAttributeStr(xmlData, i); + if (result === false) { + return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); + } + let attrStr = result.value; + i = result.index; + if (attrStr[attrStr.length - 1] === "/") { + const attrStrStart = i - attrStr.length; + attrStr = attrStr.substring(0, attrStr.length - 1); + const isValid = validateAttributeString(attrStr, options); + if (isValid === true) { + tagFound = true; + } else { + return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); + } + } else if (closingTag) { + if (!result.tagClosed) { + return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); + } else if (attrStr.trim().length > 0) { + return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); + } else if (tags.length === 0) { + return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); + } else { + const otg = tags.pop(); + if (tagName !== otg.tagName) { + let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); + return getErrorObject( + "InvalidTag", + "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", + getLineNumberForPosition(xmlData, tagStartPos) + ); + } + if (tags.length == 0) { + reachedRoot = true; + } + } } else { - abortSignal.onabort = onAbort; + const isValid = validateAttributeString(attrStr, options); + if (isValid !== true) { + return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); + } + if (reachedRoot === true) { + return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); + } else if (options.unpairedTags.indexOf(tagName) !== -1) { + } else { + tags.push({ tagName, tagStartPos }); + } + tagFound = true; } - } - req.on("frameError", (type, code, id) => { - rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); - }); - req.on("error", rejectWithDestroy); - req.on("aborted", () => { - rejectWithDestroy( - new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`) - ); - }); - req.on("close", () => { - session.unref(); - if (disableConcurrentStreams) { - session.destroy(); + for (i++; i < xmlData.length; i++) { + if (xmlData[i] === "<") { + if (xmlData[i + 1] === "!") { + i++; + i = readCommentAndCDATA(xmlData, i); + continue; + } else if (xmlData[i + 1] === "?") { + i = readPI(xmlData, ++i); + if (i.err) return i; + } else { + break; + } + } else if (xmlData[i] === "&") { + const afterAmp = validateAmpersand(xmlData, i); + if (afterAmp == -1) + return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); + i = afterAmp; + } else { + if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { + return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); + } + } } - if (!fulfilled) { - rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); + if (xmlData[i] === "<") { + i--; } - }); - writeRequestBodyPromise = writeRequestBody(req, request2, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = void 0; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value - }; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - /** - * Destroys a session. - * @param session The session to destroy. - */ - destroySession(session) { - if (!session.destroyed) { - session.destroy(); + } + } else { + if (isWhiteSpace(xmlData[i])) { + continue; + } + return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); } } - }; - __name(_NodeHttp2Handler, "NodeHttp2Handler"); - var NodeHttp2Handler = _NodeHttp2Handler; - var _Collector = class _Collector extends import_stream.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); + if (!tagFound) { + return getErrorObject("InvalidXml", "Start tag expected.", 1); + } else if (tags.length == 1) { + return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); + } else if (tags.length > 0) { + return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); } + return true; }; - __name(_Collector, "Collector"); - var Collector = _Collector; - var streamCollector = /* @__PURE__ */ __name((stream) => { - if (isReadableStreamInstance(stream)) { - return collectReadableStream(stream); - } - return new Promise((resolve, reject) => { - const collector = new Collector(); - stream.pipe(collector); - stream.on("error", (err) => { - collector.end(); - reject(err); - }); - collector.on("error", reject); - collector.on("finish", function() { - const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); - resolve(bytes); - }); - }); - }, "streamCollector"); - var isReadableStreamInstance = /* @__PURE__ */ __name((stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream, "isReadableStreamInstance"); - async function collectReadableStream(stream) { - const chunks = []; - const reader = stream.getReader(); - let isDone = false; - let length = 0; - while (!isDone) { - const { done, value } = await reader.read(); - if (value) { - chunks.push(value); - length += value.length; + function isWhiteSpace(char) { + return char === " " || char === " " || char === "\n" || char === "\r"; + } + function readPI(xmlData, i) { + const start = i; + for (; i < xmlData.length; i++) { + if (xmlData[i] == "?" || xmlData[i] == " ") { + const tagname = xmlData.substr(start, i - start); + if (i > 5 && tagname === "xml") { + return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); + } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { + i++; + break; + } else { + continue; + } } - isDone = done; } - const collected = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - collected.set(chunk, offset); - offset += chunk.length; + return i; + } + function readCommentAndCDATA(xmlData, i) { + if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { + for (i += 3; i < xmlData.length; i++) { + if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { + i += 2; + break; + } + } + } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { + let angleBracketsCount = 1; + for (i += 8; i < xmlData.length; i++) { + if (xmlData[i] === "<") { + angleBracketsCount++; + } else if (xmlData[i] === ">") { + angleBracketsCount--; + if (angleBracketsCount === 0) { + break; + } + } + } + } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { + for (i += 8; i < xmlData.length; i++) { + if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { + i += 2; + break; + } + } } - return collected; + return i; } - __name(collectReadableStream, "collectReadableStream"); - } -}); - -// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js -var require_checkUrl = __commonJS({ - "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkUrl = void 0; - var property_provider_1 = require_dist_cjs40(); - var ECS_CONTAINER_HOST = "169.254.170.2"; - var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23"; - var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]"; - var checkUrl = (url2, logger) => { - if (url2.protocol === "https:") { - return; + var doubleQuote = '"'; + var singleQuote = "'"; + function readAttributeStr(xmlData, i) { + let attrStr = ""; + let startChar = ""; + let tagClosed = false; + for (; i < xmlData.length; i++) { + if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { + if (startChar === "") { + startChar = xmlData[i]; + } else if (startChar !== xmlData[i]) { + } else { + startChar = ""; + } + } else if (xmlData[i] === ">") { + if (startChar === "") { + tagClosed = true; + break; + } + } + attrStr += xmlData[i]; } - if (url2.hostname === ECS_CONTAINER_HOST || url2.hostname === EKS_CONTAINER_HOST_IPv4 || url2.hostname === EKS_CONTAINER_HOST_IPv6) { - return; + if (startChar !== "") { + return false; } - if (url2.hostname.includes("[")) { - if (url2.hostname === "[::1]" || url2.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") { - return; + return { + value: attrStr, + index: i, + tagClosed + }; + } + var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function validateAttributeString(attrStr, options) { + const matches = util.getAllMatches(attrStr, validAttrStrRegxp); + const attrNames = {}; + for (let i = 0; i < matches.length; i++) { + if (matches[i][1].length === 0) { + return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); + } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { + return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); + } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { + return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); } - } else { - if (url2.hostname === "localhost") { - return; + const attrName = matches[i][2]; + if (!validateAttrName(attrName)) { + return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); } - const ipComponents = url2.hostname.split("."); - const inRange = (component) => { - const num = parseInt(component, 10); - return 0 <= num && num <= 255; - }; - if (ipComponents[0] === "127" && inRange(ipComponents[1]) && inRange(ipComponents[2]) && inRange(ipComponents[3]) && ipComponents.length === 4) { - return; + if (!attrNames.hasOwnProperty(attrName)) { + attrNames[attrName] = 1; + } else { + return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); } } - throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following: - - loopback CIDR 127.0.0.0/8 or [::1/128] - - ECS container host 169.254.170.2 - - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger }); - }; - exports2.checkUrl = checkUrl; - } -}); - -// ../../../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js -var require_getAwsChunkedEncodingStream2 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getAwsChunkedEncodingStream = void 0; - var stream_1 = require("stream"); - var getAwsChunkedEncodingStream2 = (readableStream, options) => { - const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; - const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; - const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0; - const awsChunkedEncodingStream = new stream_1.Readable({ read: () => { - } }); - readableStream.on("data", (data) => { - const length = bodyLengthChecker(data) || 0; - awsChunkedEncodingStream.push(`${length.toString(16)}\r -`); - awsChunkedEncodingStream.push(data); - awsChunkedEncodingStream.push("\r\n"); - }); - readableStream.on("end", async () => { - awsChunkedEncodingStream.push(`0\r -`); - if (checksumRequired) { - const checksum = base64Encoder(await digest); - awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r -`); - awsChunkedEncodingStream.push(`\r -`); - } - awsChunkedEncodingStream.push(null); - }); - return awsChunkedEncodingStream; - }; - exports2.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream2; - } -}); - -// ../../../node_modules/@smithy/fetch-http-handler/node_modules/@smithy/querystring-builder/dist-cjs/index.js -var require_dist_cjs52 = __commonJS({ - "../../../node_modules/@smithy/fetch-http-handler/node_modules/@smithy/querystring-builder/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + return true; + } + function validateNumberAmpersand(xmlData, i) { + let re = /\d/; + if (xmlData[i] === "x") { + i++; + re = /[\da-fA-F]/; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - buildQueryString: () => buildQueryString - }); - module2.exports = __toCommonJS2(src_exports); - var import_util_uri_escape = require_dist_cjs31(); - function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, import_util_uri_escape.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); - } - } else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; - } - parts.push(qsEntry); - } + for (; i < xmlData.length; i++) { + if (xmlData[i] === ";") + return i; + if (!xmlData[i].match(re)) + break; } - return parts.join("&"); + return -1; } - __name(buildQueryString, "buildQueryString"); - } -}); - -// ../../../node_modules/@smithy/fetch-http-handler/dist-cjs/index.js -var require_dist_cjs53 = __commonJS({ - "../../../node_modules/@smithy/fetch-http-handler/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + function validateAmpersand(xmlData, i) { + i++; + if (xmlData[i] === ";") + return -1; + if (xmlData[i] === "#") { + i++; + return validateNumberAmpersand(xmlData, i); } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - FetchHttpHandler: () => FetchHttpHandler, - keepAliveSupport: () => keepAliveSupport, - streamCollector: () => streamCollector - }); - module2.exports = __toCommonJS2(src_exports); - var import_protocol_http8 = require_dist_cjs2(); - var import_querystring_builder = require_dist_cjs52(); - function requestTimeout(timeoutInMs = 0) { - return new Promise((resolve, reject) => { - if (timeoutInMs) { - setTimeout(() => { - const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); - timeoutError.name = "TimeoutError"; - reject(timeoutError); - }, timeoutInMs); + let count = 0; + for (; i < xmlData.length; i++, count++) { + if (xmlData[i].match(/\w/) && count < 20) + continue; + if (xmlData[i] === ";") + break; + return -1; + } + return i; + } + function getErrorObject(code, message, lineNumber) { + return { + err: { + code, + msg: message, + line: lineNumber.line || lineNumber, + col: lineNumber.col } - }); + }; } - __name(requestTimeout, "requestTimeout"); - var keepAliveSupport = { - supported: void 0 + function validateAttrName(attrName) { + return util.isName(attrName); + } + function validateTagName(tagname) { + return util.isName(tagname); + } + function getLineNumberForPosition(xmlData, index) { + const lines = xmlData.substring(0, index).split(/\r?\n/); + return { + line: lines.length, + // column number is last line's length + 1, because column numbering starts at 1: + col: lines[lines.length - 1].length + 1 + }; + } + function getPositionFromMatch(match) { + return match.startIndex + match[1].length; + } + } +}); + +// ../../../node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +var require_OptionsBuilder = __commonJS({ + "../../../node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { + var defaultOptions = { + preserveOrder: false, + attributeNamePrefix: "@_", + attributesGroupName: false, + textNodeName: "#text", + ignoreAttributes: true, + removeNSPrefix: false, + // remove NS from tag name or attribute name if true + allowBooleanAttributes: false, + //a tag can have attributes without any value + //ignoreRootElement : false, + parseTagValue: true, + parseAttributeValue: false, + trimValues: true, + //Trim string values of tag and attributes + cdataPropName: false, + numberParseOptions: { + hex: true, + leadingZeros: true, + eNotation: true + }, + tagValueProcessor: function(tagName, val2) { + return val2; + }, + attributeValueProcessor: function(attrName, val2) { + return val2; + }, + stopNodes: [], + //nested tags will not be parsed even for errors + alwaysCreateTextNode: false, + isArray: () => false, + commentPropName: false, + unpairedTags: [], + processEntities: true, + htmlEntities: false, + ignoreDeclaration: false, + ignorePiTags: false, + transformTagName: false, + transformAttributeName: false, + updateTag: function(tagName, jPath, attrs) { + return tagName; + } + // skipEmptyListItem: false }; - var _FetchHttpHandler = class _FetchHttpHandler2 { - /** - * @returns the input if it is an HttpHandler of any class, - * or instantiates a new instance of this handler. - */ - static create(instanceOrOptions) { - if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new _FetchHttpHandler2(instanceOrOptions); + var buildOptions = function(options) { + return Object.assign({}, defaultOptions, options); + }; + exports2.buildOptions = buildOptions; + exports2.defaultOptions = defaultOptions; + } +}); + +// ../../../node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +var require_xmlNode = __commonJS({ + "../../../node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { + "use strict"; + var XmlNode = class { + constructor(tagname) { + this.tagname = tagname; + this.child = []; + this[":@"] = {}; } - constructor(options) { - if (typeof options === "function") { - this.configProvider = options().then((opts) => opts || {}); + add(key, val2) { + if (key === "__proto__") key = "#__proto__"; + this.child.push({ [key]: val2 }); + } + addChild(node) { + if (node.tagname === "__proto__") node.tagname = "#__proto__"; + if (node[":@"] && Object.keys(node[":@"]).length > 0) { + this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); } else { - this.config = options ?? {}; - this.configProvider = Promise.resolve(this.config); - } - if (keepAliveSupport.supported === void 0) { - keepAliveSupport.supported = Boolean( - typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]") - ); + this.child.push({ [node.tagname]: node.child }); } } - destroy() { - } - async handle(request2, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - const requestTimeoutInMs = this.config.requestTimeout; - const keepAlive = this.config.keepAlive === true; - const credentials = this.config.credentials; - if (abortSignal == null ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - return Promise.reject(abortError); - } - let path = request2.path; - const queryString = (0, import_querystring_builder.buildQueryString)(request2.query || {}); - if (queryString) { - path += `?${queryString}`; - } - if (request2.fragment) { - path += `#${request2.fragment}`; - } - let auth = ""; - if (request2.username != null || request2.password != null) { - const username = request2.username ?? ""; - const password = request2.password ?? ""; - auth = `${username}:${password}@`; - } - const { port, method } = request2; - const url2 = `${request2.protocol}//${auth}${request2.hostname}${port ? `:${port}` : ""}${path}`; - const body = method === "GET" || method === "HEAD" ? void 0 : request2.body; - const requestOptions = { - body, - headers: new Headers(request2.headers), - method, - credentials - }; - if (body) { - requestOptions.duplex = "half"; - } - if (typeof AbortController !== "undefined") { - requestOptions.signal = abortSignal; - } - if (keepAliveSupport.supported) { - requestOptions.keepalive = keepAlive; - } - let removeSignalEventListener = /* @__PURE__ */ __name(() => { - }, "removeSignalEventListener"); - const fetchRequest = new Request(url2, requestOptions); - const raceOfPromises = [ - fetch(fetchRequest).then((response) => { - const fetchHeaders = response.headers; - const transformedHeaders = {}; - for (const pair of fetchHeaders.entries()) { - transformedHeaders[pair[0]] = pair[1]; + }; + module2.exports = XmlNode; + } +}); + +// ../../../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +var require_DocTypeReader = __commonJS({ + "../../../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { + var util = require_util(); + function readDocType(xmlData, i) { + const entities = {}; + if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { + i = i + 9; + let angleBracketsCount = 1; + let hasBody = false, comment = false; + let exp = ""; + for (; i < xmlData.length; i++) { + if (xmlData[i] === "<" && !comment) { + if (hasBody && isEntity(xmlData, i)) { + i += 7; + [entityName, val, i] = readEntityExp(xmlData, i + 1); + if (val.indexOf("&") === -1) + entities[validateEntityName(entityName)] = { + regx: RegExp(`&${entityName};`, "g"), + val + }; + } else if (hasBody && isElement(xmlData, i)) i += 8; + else if (hasBody && isAttlist(xmlData, i)) i += 8; + else if (hasBody && isNotation(xmlData, i)) i += 9; + else if (isComment) comment = true; + else throw new Error("Invalid DOCTYPE"); + angleBracketsCount++; + exp = ""; + } else if (xmlData[i] === ">") { + if (comment) { + if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { + comment = false; + angleBracketsCount--; + } + } else { + angleBracketsCount--; } - const hasReadableStream = response.body != void 0; - if (!hasReadableStream) { - return response.blob().then((body2) => ({ - response: new import_protocol_http8.HttpResponse({ - headers: transformedHeaders, - reason: response.statusText, - statusCode: response.status, - body: body2 - }) - })); + if (angleBracketsCount === 0) { + break; } - return { - response: new import_protocol_http8.HttpResponse({ - headers: transformedHeaders, - reason: response.statusText, - statusCode: response.status, - body: response.body - }) - }; - }), - requestTimeout(requestTimeoutInMs) - ]; - if (abortSignal) { - raceOfPromises.push( - new Promise((resolve, reject) => { - const onAbort = /* @__PURE__ */ __name(() => { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }, "onAbort"); - if (typeof abortSignal.addEventListener === "function") { - const signal = abortSignal; - signal.addEventListener("abort", onAbort, { once: true }); - removeSignalEventListener = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "removeSignalEventListener"); - } else { - abortSignal.onabort = onAbort; - } - }) - ); + } else if (xmlData[i] === "[") { + hasBody = true; + } else { + exp += xmlData[i]; + } } - return Promise.race(raceOfPromises).finally(removeSignalEventListener); - } - updateHttpClientConfig(key, value) { - this.config = void 0; - this.configProvider = this.configProvider.then((config) => { - config[key] = value; - return config; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - }; - __name(_FetchHttpHandler, "FetchHttpHandler"); - var FetchHttpHandler = _FetchHttpHandler; - var import_util_base64 = require_dist_cjs29(); - var streamCollector = /* @__PURE__ */ __name((stream) => { - if (typeof Blob === "function" && stream instanceof Blob) { - return collectBlob(stream); + if (angleBracketsCount !== 0) { + throw new Error(`Unclosed DOCTYPE`); + } + } else { + throw new Error(`Invalid Tag instead of DOCTYPE`); } - return collectStream(stream); - }, "streamCollector"); - async function collectBlob(blob) { - const base64 = await readToBase64(blob); - const arrayBuffer = (0, import_util_base64.fromBase64)(base64); - return new Uint8Array(arrayBuffer); + return { entities, i }; } - __name(collectBlob, "collectBlob"); - async function collectStream(stream) { - const chunks = []; - const reader = stream.getReader(); - let isDone = false; - let length = 0; - while (!isDone) { - const { done, value } = await reader.read(); - if (value) { - chunks.push(value); - length += value.length; - } - isDone = done; + function readEntityExp(xmlData, i) { + let entityName2 = ""; + for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { + entityName2 += xmlData[i]; } - const collected = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - collected.set(chunk, offset); - offset += chunk.length; + entityName2 = entityName2.trim(); + if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); + const startChar = xmlData[i++]; + let val2 = ""; + for (; i < xmlData.length && xmlData[i] !== startChar; i++) { + val2 += xmlData[i]; } - return collected; + return [entityName2, val2, i]; } - __name(collectStream, "collectStream"); - function readToBase64(blob) { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.onloadend = () => { - if (reader.readyState !== 2) { - return reject(new Error("Reader aborted too early")); - } - const result = reader.result ?? ""; - const commaIndex = result.indexOf(","); - const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; - resolve(result.substring(dataOffset)); - }; - reader.onabort = () => reject(new Error("Read aborted")); - reader.onerror = () => reject(reader.error); - reader.readAsDataURL(blob); - }); + function isComment(xmlData, i) { + if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; + return false; + } + function isEntity(xmlData, i) { + if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; + return false; + } + function isElement(xmlData, i) { + if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; + return false; + } + function isAttlist(xmlData, i) { + if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; + return false; + } + function isNotation(xmlData, i) { + if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; + return false; + } + function validateEntityName(name) { + if (util.isName(name)) + return name; + else + throw new Error(`Invalid entity name ${name}`); } - __name(readToBase64, "readToBase64"); + module2.exports = readDocType; } }); -// ../../../node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js -var require_stream_type_check2 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReadableStream = void 0; - var isReadableStream2 = (stream) => { - var _a; - return typeof ReadableStream === "function" && (((_a = stream === null || stream === void 0 ? void 0 : stream.constructor) === null || _a === void 0 ? void 0 : _a.name) === ReadableStream.name || stream instanceof ReadableStream); +// ../../../node_modules/strnum/strnum.js +var require_strnum = __commonJS({ + "../../../node_modules/strnum/strnum.js"(exports2, module2) { + var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; + var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; + if (!Number.parseInt && window.parseInt) { + Number.parseInt = window.parseInt; + } + if (!Number.parseFloat && window.parseFloat) { + Number.parseFloat = window.parseFloat; + } + var consider = { + hex: true, + leadingZeros: true, + decimalPoint: ".", + eNotation: true + //skipLike: /regex/ }; - exports2.isReadableStream = isReadableStream2; - } -}); - -// ../../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js -var require_sdk_stream_mixin_browser2 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sdkStreamMixin = void 0; - var fetch_http_handler_1 = require_dist_cjs53(); - var util_base64_1 = require_dist_cjs29(); - var util_hex_encoding_1 = require_dist_cjs35(); - var util_utf8_1 = require_dist_cjs28(); - var stream_type_check_1 = require_stream_type_check2(); - var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; - var sdkStreamMixin2 = (stream) => { - var _a, _b; - if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) { - const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; - throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`); - } - let transformed = false; - const transformToByteArray = async () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - return await (0, fetch_http_handler_1.streamCollector)(stream); - }; - const blobToWebStream = (blob) => { - if (typeof blob.stream !== "function") { - throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body"); - } - return blob.stream(); - }; - return Object.assign(stream, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === "base64") { - return (0, util_base64_1.toBase64)(buf); - } else if (encoding === "hex") { - return (0, util_hex_encoding_1.toHex)(buf); - } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { - return (0, util_utf8_1.toUtf8)(buf); - } else if (typeof TextDecoder === "function") { - return new TextDecoder(encoding).decode(buf); - } else { - throw new Error("TextDecoder is not available, please make sure polyfill is provided."); - } - }, - transformToWebStream: () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - if (isBlobInstance(stream)) { - return blobToWebStream(stream); - } else if ((0, stream_type_check_1.isReadableStream)(stream)) { - return stream; - } else { - throw new Error(`Cannot transform payload to web stream, got ${stream}`); + function toNumber(str, options = {}) { + options = Object.assign({}, consider, options); + if (!str || typeof str !== "string") return str; + let trimmedStr = str.trim(); + if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str; + else if (options.hex && hexRegex.test(trimmedStr)) { + return Number.parseInt(trimmedStr, 16); + } else { + const match = numRegex.exec(trimmedStr); + if (match) { + const sign = match[1]; + const leadingZeros = match[2]; + let numTrimmedByZeros = trimZeros(match[3]); + const eNotation = match[4] || match[6]; + if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; + else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; + else { + const num = Number(trimmedStr); + const numStr = "" + num; + if (numStr.search(/[eE]/) !== -1) { + if (options.eNotation) return num; + else return str; + } else if (eNotation) { + if (options.eNotation) return num; + else return str; + } else if (trimmedStr.indexOf(".") !== -1) { + if (numStr === "0" && numTrimmedByZeros === "") return num; + else if (numStr === numTrimmedByZeros) return num; + else if (sign && numStr === "-" + numTrimmedByZeros) return num; + else return str; + } + if (leadingZeros) { + if (numTrimmedByZeros === numStr) return num; + else if (sign + numTrimmedByZeros === numStr) return num; + else return str; + } + if (trimmedStr === numStr) return num; + else if (trimmedStr === sign + numStr) return num; + return str; } + } else { + return str; } - }); - }; - exports2.sdkStreamMixin = sdkStreamMixin2; - var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob; + } + } + function trimZeros(numStr) { + if (numStr && numStr.indexOf(".") !== -1) { + numStr = numStr.replace(/0+$/, ""); + if (numStr === ".") numStr = "0"; + else if (numStr[0] === ".") numStr = "0" + numStr; + else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); + return numStr; + } + return numStr; + } + module2.exports = toNumber; } }); -// ../../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js -var require_sdk_stream_mixin2 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js"(exports2) { +// ../../../node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +var require_OrderedObjParser = __commonJS({ + "../../../node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sdkStreamMixin = void 0; - var node_http_handler_1 = require_dist_cjs51(); - var util_buffer_from_1 = require_dist_cjs27(); - var stream_1 = require("stream"); - var util_1 = require("util"); - var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser2(); - var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; - var sdkStreamMixin2 = (stream) => { - var _a, _b; - if (!(stream instanceof stream_1.Readable)) { - try { - return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream); - } catch (e) { - const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; - throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); - } + var util = require_util(); + var xmlNode = require_xmlNode(); + var readDocType = require_DocTypeReader(); + var toNumber = require_strnum(); + var OrderedObjParser = class { + constructor(options) { + this.options = options; + this.currentNode = null; + this.tagsNodeStack = []; + this.docTypeEntities = {}; + this.lastEntities = { + "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, + "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, + "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, + "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } + }; + this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; + this.htmlEntities = { + "space": { regex: /&(nbsp|#160);/g, val: " " }, + // "lt" : { regex: /&(lt|#60);/g, val: "<" }, + // "gt" : { regex: /&(gt|#62);/g, val: ">" }, + // "amp" : { regex: /&(amp|#38);/g, val: "&" }, + // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, + // "apos" : { regex: /&(apos|#39);/g, val: "'" }, + "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, + "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, + "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, + "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, + "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, + "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, + "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, + "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 10)) }, + "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 16)) } + }; + this.addExternalEntities = addExternalEntities; + this.parseXml = parseXml; + this.parseTextData = parseTextData; + this.resolveNameSpace = resolveNameSpace; + this.buildAttributesMap = buildAttributesMap; + this.isItStopNode = isItStopNode; + this.replaceEntitiesValue = replaceEntitiesValue; + this.readStopNodeData = readStopNodeData; + this.saveTextToParentTag = saveTextToParentTag; + this.addChild = addChild; } - let transformed = false; - const transformToByteArray = async () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + }; + function addExternalEntities(externalEntities) { + const entKeys = Object.keys(externalEntities); + for (let i = 0; i < entKeys.length; i++) { + const ent = entKeys[i]; + this.lastEntities[ent] = { + regex: new RegExp("&" + ent + ";", "g"), + val: externalEntities[ent] + }; + } + } + function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { + if (val2 !== void 0) { + if (this.options.trimValues && !dontTrim) { + val2 = val2.trim(); } - transformed = true; - return await (0, node_http_handler_1.streamCollector)(stream); - }; - return Object.assign(stream, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === void 0 || Buffer.isEncoding(encoding)) { - return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); + if (val2.length > 0) { + if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); + const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); + if (newval === null || newval === void 0) { + return val2; + } else if (typeof newval !== typeof val2 || newval !== val2) { + return newval; + } else if (this.options.trimValues) { + return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); } else { - const decoder2 = new util_1.TextDecoder(encoding); - return decoder2.decode(buf); - } - }, - transformToWebStream: () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - if (stream.readableFlowing !== null) { - throw new Error("The stream has been consumed by other callbacks."); - } - if (typeof stream_1.Readable.toWeb !== "function") { - throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available."); + const trimmedVal = val2.trim(); + if (trimmedVal === val2) { + return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); + } else { + return val2; + } } - transformed = true; - return stream_1.Readable.toWeb(stream); } - }); - }; - exports2.sdkStreamMixin = sdkStreamMixin2; - } -}); - -// ../../../node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js -var require_splitStream_browser2 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.splitStream = void 0; - async function splitStream2(stream) { - if (typeof stream.stream === "function") { - stream = stream.stream(); } - const readableStream = stream; - return readableStream.tee(); } - exports2.splitStream = splitStream2; - } -}); - -// ../../../node_modules/@smithy/util-stream/dist-cjs/splitStream.js -var require_splitStream2 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/splitStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.splitStream = void 0; - var stream_1 = require("stream"); - var splitStream_browser_1 = require_splitStream_browser2(); - var stream_type_check_1 = require_stream_type_check2(); - async function splitStream2(stream) { - if ((0, stream_type_check_1.isReadableStream)(stream)) { - return (0, splitStream_browser_1.splitStream)(stream); + function resolveNameSpace(tagname) { + if (this.options.removeNSPrefix) { + const tags = tagname.split(":"); + const prefix = tagname.charAt(0) === "/" ? "/" : ""; + if (tags[0] === "xmlns") { + return ""; + } + if (tags.length === 2) { + tagname = prefix + tags[1]; + } } - const stream1 = new stream_1.PassThrough(); - const stream2 = new stream_1.PassThrough(); - stream.pipe(stream1); - stream.pipe(stream2); - return [stream1, stream2]; + return tagname; } - exports2.splitStream = splitStream2; - } -}); - -// ../../../node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js -var require_headStream_browser2 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.headStream = void 0; - async function headStream2(stream, bytes) { - var _a; - let byteLengthCounter = 0; - const chunks = []; - const reader = stream.getReader(); - let isDone = false; - while (!isDone) { - const { done, value } = await reader.read(); - if (value) { - chunks.push(value); - byteLengthCounter += (_a = value === null || value === void 0 ? void 0 : value.byteLength) !== null && _a !== void 0 ? _a : 0; + var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function buildAttributesMap(attrStr, jPath, tagName) { + if (!this.options.ignoreAttributes && typeof attrStr === "string") { + const matches = util.getAllMatches(attrStr, attrsRegx); + const len = matches.length; + const attrs = {}; + for (let i = 0; i < len; i++) { + const attrName = this.resolveNameSpace(matches[i][1]); + let oldVal = matches[i][4]; + let aName = this.options.attributeNamePrefix + attrName; + if (attrName.length) { + if (this.options.transformAttributeName) { + aName = this.options.transformAttributeName(aName); + } + if (aName === "__proto__") aName = "#__proto__"; + if (oldVal !== void 0) { + if (this.options.trimValues) { + oldVal = oldVal.trim(); + } + oldVal = this.replaceEntitiesValue(oldVal); + const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); + if (newVal === null || newVal === void 0) { + attrs[aName] = oldVal; + } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { + attrs[aName] = newVal; + } else { + attrs[aName] = parseValue( + oldVal, + this.options.parseAttributeValue, + this.options.numberParseOptions + ); + } + } else if (this.options.allowBooleanAttributes) { + attrs[aName] = true; + } + } } - if (byteLengthCounter >= bytes) { - break; + if (!Object.keys(attrs).length) { + return; } - isDone = done; + if (this.options.attributesGroupName) { + const attrCollection = {}; + attrCollection[this.options.attributesGroupName] = attrs; + return attrCollection; + } + return attrs; } - reader.releaseLock(); - const collected = new Uint8Array(Math.min(bytes, byteLengthCounter)); - let offset = 0; - for (const chunk of chunks) { - if (chunk.byteLength > collected.byteLength - offset) { - collected.set(chunk.subarray(0, collected.byteLength - offset), offset); - break; + } + var parseXml = function(xmlData) { + xmlData = xmlData.replace(/\r\n?/g, "\n"); + const xmlObj = new xmlNode("!xml"); + let currentNode = xmlObj; + let textData = ""; + let jPath = ""; + for (let i = 0; i < xmlData.length; i++) { + const ch = xmlData[i]; + if (ch === "<") { + if (xmlData[i + 1] === "/") { + const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); + let tagName = xmlData.substring(i + 2, closeIndex).trim(); + if (this.options.removeNSPrefix) { + const colonIndex = tagName.indexOf(":"); + if (colonIndex !== -1) { + tagName = tagName.substr(colonIndex + 1); + } + } + if (this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } + if (currentNode) { + textData = this.saveTextToParentTag(textData, currentNode, jPath); + } + const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); + if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { + throw new Error(`Unpaired tag can not be used as closing tag: `); + } + let propIndex = 0; + if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { + propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); + this.tagsNodeStack.pop(); + } else { + propIndex = jPath.lastIndexOf("."); + } + jPath = jPath.substring(0, propIndex); + currentNode = this.tagsNodeStack.pop(); + textData = ""; + i = closeIndex; + } else if (xmlData[i + 1] === "?") { + let tagData = readTagExp(xmlData, i, false, "?>"); + if (!tagData) throw new Error("Pi Tag is not closed."); + textData = this.saveTextToParentTag(textData, currentNode, jPath); + if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { + } else { + const childNode = new xmlNode(tagData.tagName); + childNode.add(this.options.textNodeName, ""); + if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { + childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); + } + this.addChild(currentNode, childNode, jPath); + } + i = tagData.closeIndex + 1; + } else if (xmlData.substr(i + 1, 3) === "!--") { + const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const comment = xmlData.substring(i + 4, endIndex - 2); + textData = this.saveTextToParentTag(textData, currentNode, jPath); + currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); + } + i = endIndex; + } else if (xmlData.substr(i + 1, 2) === "!D") { + const result = readDocType(xmlData, i); + this.docTypeEntities = result.entities; + i = result.i; + } else if (xmlData.substr(i + 1, 2) === "![") { + const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; + const tagExp = xmlData.substring(i + 9, closeIndex); + textData = this.saveTextToParentTag(textData, currentNode, jPath); + let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); + if (val2 == void 0) val2 = ""; + if (this.options.cdataPropName) { + currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); + } else { + currentNode.add(this.options.textNodeName, val2); + } + i = closeIndex + 2; + } else { + let result = readTagExp(xmlData, i, this.options.removeNSPrefix); + let tagName = result.tagName; + const rawTagName = result.rawTagName; + let tagExp = result.tagExp; + let attrExpPresent = result.attrExpPresent; + let closeIndex = result.closeIndex; + if (this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } + if (currentNode && textData) { + if (currentNode.tagname !== "!xml") { + textData = this.saveTextToParentTag(textData, currentNode, jPath, false); + } + } + const lastTag = currentNode; + if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { + currentNode = this.tagsNodeStack.pop(); + jPath = jPath.substring(0, jPath.lastIndexOf(".")); + } + if (tagName !== xmlObj.tagname) { + jPath += jPath ? "." + tagName : tagName; + } + if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { + let tagContent = ""; + if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { + if (tagName[tagName.length - 1] === "/") { + tagName = tagName.substr(0, tagName.length - 1); + jPath = jPath.substr(0, jPath.length - 1); + tagExp = tagName; + } else { + tagExp = tagExp.substr(0, tagExp.length - 1); + } + i = result.closeIndex; + } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { + i = result.closeIndex; + } else { + const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); + if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); + i = result2.i; + tagContent = result2.tagContent; + } + const childNode = new xmlNode(tagName); + if (tagName !== tagExp && attrExpPresent) { + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + if (tagContent) { + tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); + } + jPath = jPath.substr(0, jPath.lastIndexOf(".")); + childNode.add(this.options.textNodeName, tagContent); + this.addChild(currentNode, childNode, jPath); + } else { + if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { + if (tagName[tagName.length - 1] === "/") { + tagName = tagName.substr(0, tagName.length - 1); + jPath = jPath.substr(0, jPath.length - 1); + tagExp = tagName; + } else { + tagExp = tagExp.substr(0, tagExp.length - 1); + } + if (this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } + const childNode = new xmlNode(tagName); + if (tagName !== tagExp && attrExpPresent) { + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + this.addChild(currentNode, childNode, jPath); + jPath = jPath.substr(0, jPath.lastIndexOf(".")); + } else { + const childNode = new xmlNode(tagName); + this.tagsNodeStack.push(currentNode); + if (tagName !== tagExp && attrExpPresent) { + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + this.addChild(currentNode, childNode, jPath); + currentNode = childNode; + } + textData = ""; + i = closeIndex; + } + } } else { - collected.set(chunk, offset); - } - offset += chunk.length; - } - return collected; - } - exports2.headStream = headStream2; - } -}); - -// ../../../node_modules/@smithy/util-stream/dist-cjs/headStream.js -var require_headStream2 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/headStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.headStream = void 0; - var stream_1 = require("stream"); - var headStream_browser_1 = require_headStream_browser2(); - var stream_type_check_1 = require_stream_type_check2(); - var headStream2 = (stream, bytes) => { - if ((0, stream_type_check_1.isReadableStream)(stream)) { - return (0, headStream_browser_1.headStream)(stream, bytes); - } - return new Promise((resolve, reject) => { - const collector = new Collector(); - collector.limit = bytes; - stream.pipe(collector); - stream.on("error", (err) => { - collector.end(); - reject(err); - }); - collector.on("error", reject); - collector.on("finish", function() { - const bytes2 = new Uint8Array(Buffer.concat(this.buffers)); - resolve(bytes2); - }); - }); - }; - exports2.headStream = headStream2; - var Collector = class extends stream_1.Writable { - constructor() { - super(...arguments); - this.buffers = []; - this.limit = Infinity; - this.bytesBuffered = 0; - } - _write(chunk, encoding, callback) { - var _a; - this.buffers.push(chunk); - this.bytesBuffered += (_a = chunk.byteLength) !== null && _a !== void 0 ? _a : 0; - if (this.bytesBuffered >= this.limit) { - const excess = this.bytesBuffered - this.limit; - const tailBuffer = this.buffers[this.buffers.length - 1]; - this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess); - this.emit("finish"); + textData += xmlData[i]; } - callback(); - } - }; - } -}); - -// ../../../node_modules/@smithy/util-stream/dist-cjs/index.js -var require_dist_cjs54 = __commonJS({ - "../../../node_modules/@smithy/util-stream/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } - return to; + return xmlObj.child; }; - var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - Uint8ArrayBlobAdapter: () => Uint8ArrayBlobAdapter - }); - module2.exports = __toCommonJS2(src_exports); - var import_util_base64 = require_dist_cjs29(); - var import_util_utf8 = require_dist_cjs28(); - function transformToString(payload, encoding = "utf-8") { - if (encoding === "base64") { - return (0, import_util_base64.toBase64)(payload); - } - return (0, import_util_utf8.toUtf8)(payload); - } - __name(transformToString, "transformToString"); - function transformFromString(str, encoding) { - if (encoding === "base64") { - return Uint8ArrayBlobAdapter.mutate((0, import_util_base64.fromBase64)(str)); + function addChild(currentNode, childNode, jPath) { + const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); + if (result === false) { + } else if (typeof result === "string") { + childNode.tagname = result; + currentNode.addChild(childNode); + } else { + currentNode.addChild(childNode); } - return Uint8ArrayBlobAdapter.mutate((0, import_util_utf8.fromUtf8)(str)); } - __name(transformFromString, "transformFromString"); - var _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter2 extends Uint8Array { - /** - * @param source - such as a string or Stream. - * @returns a new Uint8ArrayBlobAdapter extending Uint8Array. - */ - static fromString(source, encoding = "utf-8") { - switch (typeof source) { - case "string": - return transformFromString(source, encoding); - default: - throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); + var replaceEntitiesValue = function(val2) { + if (this.options.processEntities) { + for (let entityName2 in this.docTypeEntities) { + const entity = this.docTypeEntities[entityName2]; + val2 = val2.replace(entity.regx, entity.val); } + for (let entityName2 in this.lastEntities) { + const entity = this.lastEntities[entityName2]; + val2 = val2.replace(entity.regex, entity.val); + } + if (this.options.htmlEntities) { + for (let entityName2 in this.htmlEntities) { + const entity = this.htmlEntities[entityName2]; + val2 = val2.replace(entity.regex, entity.val); + } + } + val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); } - /** - * @param source - Uint8Array to be mutated. - * @returns the same Uint8Array but with prototype switched to Uint8ArrayBlobAdapter. - */ - static mutate(source) { - Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter2.prototype); - return source; - } - /** - * @param encoding - default 'utf-8'. - * @returns the blob as string. - */ - transformToString(encoding = "utf-8") { - return transformToString(this, encoding); - } + return val2; }; - __name(_Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter"); - var Uint8ArrayBlobAdapter = _Uint8ArrayBlobAdapter; - __reExport(src_exports, require_getAwsChunkedEncodingStream2(), module2.exports); - __reExport(src_exports, require_sdk_stream_mixin2(), module2.exports); - __reExport(src_exports, require_splitStream2(), module2.exports); - __reExport(src_exports, require_headStream2(), module2.exports); - __reExport(src_exports, require_stream_type_check2(), module2.exports); - } -}); - -// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js -var require_requestHelpers = __commonJS({ - "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCredentials = exports2.createGetRequest = void 0; - var property_provider_1 = require_dist_cjs40(); - var protocol_http_1 = require_dist_cjs2(); - var smithy_client_1 = require_dist_cjs37(); - var util_stream_1 = require_dist_cjs54(); - function createGetRequest(url2) { - return new protocol_http_1.HttpRequest({ - protocol: url2.protocol, - hostname: url2.hostname, - port: Number(url2.port), - path: url2.pathname, - query: Array.from(url2.searchParams.entries()).reduce((acc, [k, v]) => { - acc[k] = v; - return acc; - }, {}), - fragment: url2.hash - }); - } - exports2.createGetRequest = createGetRequest; - async function getCredentials(response, logger) { - const stream = (0, util_stream_1.sdkStreamMixin)(response.body); - const str = await stream.transformToString(); - if (response.statusCode === 200) { - const parsed = JSON.parse(str); - if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") { - throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger }); - } - return { - accessKeyId: parsed.AccessKeyId, - secretAccessKey: parsed.SecretAccessKey, - sessionToken: parsed.Token, - expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration) - }; + function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { + if (textData) { + if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; + textData = this.parseTextData( + textData, + currentNode.tagname, + jPath, + false, + currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, + isLeafNode + ); + if (textData !== void 0 && textData !== "") + currentNode.add(this.options.textNodeName, textData); + textData = ""; } - if (response.statusCode >= 400 && response.statusCode < 500) { - let parsedBody = {}; - try { - parsedBody = JSON.parse(str); - } catch (e) { - } - throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }), { - Code: parsedBody.Code, - Message: parsedBody.Message - }); + return textData; + } + function isItStopNode(stopNodes, jPath, currentTagName) { + const allNodesExp = "*." + currentTagName; + for (const stopNodePath in stopNodes) { + const stopNodeExp = stopNodes[stopNodePath]; + if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; } - throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }); + return false; } - exports2.getCredentials = getCredentials; - } -}); - -// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js -var require_retry_wrapper = __commonJS({ - "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryWrapper = void 0; - var retryWrapper = (toRetry, maxRetries, delayMs) => { - return async () => { - for (let i = 0; i < maxRetries; ++i) { - try { - return await toRetry(); - } catch (e) { - await new Promise((resolve) => setTimeout(resolve, delayMs)); + function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { + let attrBoundary; + let tagExp = ""; + for (let index = i; index < xmlData.length; index++) { + let ch = xmlData[index]; + if (attrBoundary) { + if (ch === attrBoundary) attrBoundary = ""; + } else if (ch === '"' || ch === "'") { + attrBoundary = ch; + } else if (ch === closingChar[0]) { + if (closingChar[1]) { + if (xmlData[index + 1] === closingChar[1]) { + return { + data: tagExp, + index + }; + } + } else { + return { + data: tagExp, + index + }; } + } else if (ch === " ") { + ch = " "; } - return await toRetry(); - }; - }; - exports2.retryWrapper = retryWrapper; - } -}); - -// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js -var require_fromHttp = __commonJS({ - "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.fromHttp = void 0; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_http_handler_1 = require_dist_cjs51(); - var property_provider_1 = require_dist_cjs40(); - var promises_1 = tslib_1.__importDefault(require("fs/promises")); - var checkUrl_1 = require_checkUrl(); - var requestHelpers_1 = require_requestHelpers(); - var retry_wrapper_1 = require_retry_wrapper(); - var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; - var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2"; - var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; - var AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"; - var AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; - var fromHttp = (options = {}) => { - options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp"); - let host; - const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI]; - const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI]; - const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN]; - const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE]; - const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger ? console.warn : options.logger.warn; - if (relative && full) { - warn("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."); - warn("awsContainerCredentialsFullUri will take precedence."); - } - if (token && tokenFile) { - warn("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."); - warn("awsContainerAuthorizationToken will take precedence."); + tagExp += ch; } - if (full) { - host = full; - } else if (relative) { - host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`; + } + function findClosingIndex(xmlData, str, i, errMsg) { + const closingIndex = xmlData.indexOf(str, i); + if (closingIndex === -1) { + throw new Error(errMsg); } else { - throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided. -Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger }); + return closingIndex + str.length - 1; } - const url2 = new URL(host); - (0, checkUrl_1.checkUrl)(url2, options.logger); - const requestHandler = new node_http_handler_1.NodeHttpHandler({ - requestTimeout: options.timeout ?? 1e3, - connectionTimeout: options.timeout ?? 1e3 - }); - return (0, retry_wrapper_1.retryWrapper)(async () => { - const request2 = (0, requestHelpers_1.createGetRequest)(url2); - if (token) { - request2.headers.Authorization = token; - } else if (tokenFile) { - request2.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString(); - } - try { - const result = await requestHandler.handle(request2); - return (0, requestHelpers_1.getCredentials)(result.response); - } catch (e) { - throw new property_provider_1.CredentialsProviderError(String(e), { logger: options.logger }); - } - }, options.maxRetries ?? 3, options.timeout ?? 1e3); - }; - exports2.fromHttp = fromHttp; - } -}); - -// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js -var require_dist_cjs55 = __commonJS({ - "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.fromHttp = void 0; - var fromHttp_1 = require_fromHttp(); - Object.defineProperty(exports2, "fromHttp", { enumerable: true, get: function() { - return fromHttp_1.fromHttp; - } }); - } -}); - -// ../../../node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider2 = __commonJS({ - "../../../node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.resolveHttpAuthSchemeConfig = exports2.defaultSSOHttpAuthSchemeProvider = exports2.defaultSSOHttpAuthSchemeParametersProvider = void 0; - var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); - var util_middleware_1 = require_dist_cjs10(); - var defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports2.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "awsssoportal", - region: authParameters.region - }, - propertiesExtractor: (config, context) => ({ - signingProperties: { - config, - context - } - }) - }; } - function createSmithyApiNoAuthHttpAuthOption(authParameters) { + function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { + const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); + if (!result) return; + let tagExp = result.data; + const closeIndex = result.index; + const separatorIndex = tagExp.search(/\s/); + let tagName = tagExp; + let attrExpPresent = true; + if (separatorIndex !== -1) { + tagName = tagExp.substring(0, separatorIndex); + tagExp = tagExp.substring(separatorIndex + 1).trimStart(); + } + const rawTagName = tagName; + if (removeNSPrefix) { + const colonIndex = tagName.indexOf(":"); + if (colonIndex !== -1) { + tagName = tagName.substr(colonIndex + 1); + attrExpPresent = tagName !== result.data.substr(colonIndex + 1); + } + } return { - schemeId: "smithy.api#noAuth" + tagName, + tagExp, + closeIndex, + attrExpPresent, + rawTagName }; } - var defaultSSOHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - case "GetRoleCredentials": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "ListAccountRoles": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "ListAccounts": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "Logout": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + function readStopNodeData(xmlData, tagName, i) { + const startIndex = i; + let openTagCount = 1; + for (; i < xmlData.length; i++) { + if (xmlData[i] === "<") { + if (xmlData[i + 1] === "/") { + const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); + let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); + if (closeTagName === tagName) { + openTagCount--; + if (openTagCount === 0) { + return { + tagContent: xmlData.substring(startIndex, i), + i: closeIndex + }; + } + } + i = closeIndex; + } else if (xmlData[i + 1] === "?") { + const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); + i = closeIndex; + } else if (xmlData.substr(i + 1, 3) === "!--") { + const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); + i = closeIndex; + } else if (xmlData.substr(i + 1, 2) === "![") { + const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; + i = closeIndex; + } else { + const tagData = readTagExp(xmlData, i, ">"); + if (tagData) { + const openTagName = tagData && tagData.tagName; + if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { + openTagCount++; + } + i = tagData.closeIndex; + } + } } } - return options; - }; - exports2.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider; - var resolveHttpAuthSchemeConfig = (config) => { - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); - return { - ...config_0 - }; - }; - exports2.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; - } -}); - -// ../../../node_modules/@aws-sdk/client-sso/package.json -var require_package2 = __commonJS({ - "../../../node_modules/@aws-sdk/client-sso/package.json"(exports2, module2) { - module2.exports = { - name: "@aws-sdk/client-sso", - description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", - version: "3.632.0", - scripts: { - build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", - "build:cjs": "node ../../scripts/compilation/inline client-sso", - "build:es": "tsc -p tsconfig.es.json", - "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", - "build:types": "tsc -p tsconfig.types.json", - "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", - clean: "rimraf ./dist-* && rimraf *.tsbuildinfo", - "extract:docs": "api-extractor run --local", - "generate:client": "node ../../scripts/generate-clients/single-service --solo sso" - }, - main: "./dist-cjs/index.js", - types: "./dist-types/index.d.ts", - module: "./dist-es/index.js", - sideEffects: false, - dependencies: { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.629.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.632.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.632.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.3.2", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.14", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.1.12", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.14", - "@smithy/util-defaults-mode-node": "^3.0.14", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - tslib: "^2.6.2" - }, - devDependencies: { - "@tsconfig/node16": "16.1.3", - "@types/node": "^16.18.96", - concurrently: "7.0.0", - "downlevel-dts": "0.10.1", - rimraf: "3.0.2", - typescript: "~4.9.5" - }, - engines: { - node: ">=16.0.0" - }, - typesVersions: { - "<4.0": { - "dist-types/*": [ - "dist-types/ts3.4/*" - ] + } + function parseValue(val2, shouldParse, options) { + if (shouldParse && typeof val2 === "string") { + const newval = val2.trim(); + if (newval === "true") return true; + else if (newval === "false") return false; + else return toNumber(val2, options); + } else { + if (util.isExist(val2)) { + return val2; + } else { + return ""; } - }, - files: [ - "dist-*/**" - ], - author: { - name: "AWS SDK for JavaScript Team", - url: "https://aws.amazon.com/javascript/" - }, - license: "Apache-2.0", - browser: { - "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" - }, - "react-native": { - "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" - }, - homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso", - repository: { - type: "git", - url: "https://github.com/aws/aws-sdk-js-v3.git", - directory: "clients/client-sso" } - }; + } + module2.exports = OrderedObjParser; } }); -// ../../../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js -var require_dist_cjs56 = __commonJS({ - "../../../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js"(exports2, module2) { +// ../../../node_modules/fast-xml-parser/src/xmlparser/node2json.js +var require_node2json = __commonJS({ + "../../../node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + function prettify(node, options) { + return compress(node, options); + } + function compress(arr, options, jPath) { + let text; + const compressedObj = {}; + for (let i = 0; i < arr.length; i++) { + const tagObj = arr[i]; + const property = propName(tagObj); + let newJpath = ""; + if (jPath === void 0) newJpath = property; + else newJpath = jPath + "." + property; + if (property === options.textNodeName) { + if (text === void 0) text = tagObj[property]; + else text += "" + tagObj[property]; + } else if (property === void 0) { + continue; + } else if (tagObj[property]) { + let val2 = compress(tagObj[property], options, newJpath); + const isLeaf = isLeafTag(val2, options); + if (tagObj[":@"]) { + assignAttributes(val2, tagObj[":@"], newJpath, options); + } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { + val2 = val2[options.textNodeName]; + } else if (Object.keys(val2).length === 0) { + if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; + else val2 = ""; + } + if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { + if (!Array.isArray(compressedObj[property])) { + compressedObj[property] = [compressedObj[property]]; + } + compressedObj[property].push(val2); + } else { + if (options.isArray(property, newJpath, isLeaf)) { + compressedObj[property] = [val2]; + } else { + compressedObj[property] = val2; + } + } + } } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME, - UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME, - crtAvailability: () => crtAvailability, - defaultUserAgent: () => defaultUserAgent - }); - module2.exports = __toCommonJS2(src_exports); - var import_node_config_provider = require_dist_cjs42(); - var import_os = require("os"); - var import_process = require("process"); - var crtAvailability = { - isCrtAvailable: false - }; - var isCrtAvailable = /* @__PURE__ */ __name(() => { - if (crtAvailability.isCrtAvailable) { - return ["md/crt-avail"]; + if (typeof text === "string") { + if (text.length > 0) compressedObj[options.textNodeName] = text; + } else if (text !== void 0) compressedObj[options.textNodeName] = text; + return compressedObj; + } + function propName(obj) { + const keys = Object.keys(obj); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (key !== ":@") return key; } - return null; - }, "isCrtAvailable"); - var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; - var UA_APP_ID_INI_NAME = "sdk-ua-app-id"; - var defaultUserAgent = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => { - const sections = [ - // sdk-metadata - ["aws-sdk-js", clientVersion], - // ua-metadata - ["ua", "2.0"], - // os-metadata - [`os/${(0, import_os.platform)()}`, (0, import_os.release)()], - // language-metadata - // ECMAScript edition doesn't matter in JS, so no version needed. - ["lang/js"], - ["md/nodejs", `${import_process.versions.node}`] - ]; - const crtAvailable = isCrtAvailable(); - if (crtAvailable) { - sections.push(crtAvailable); + } + function assignAttributes(obj, attrMap, jpath, options) { + if (attrMap) { + const keys = Object.keys(attrMap); + const len = keys.length; + for (let i = 0; i < len; i++) { + const atrrName = keys[i]; + if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { + obj[atrrName] = [attrMap[atrrName]]; + } else { + obj[atrrName] = attrMap[atrrName]; + } + } } - if (serviceId) { - sections.push([`api/${serviceId}`, clientVersion]); + } + function isLeafTag(obj, options) { + const { textNodeName } = options; + const propCount = Object.keys(obj).length; + if (propCount === 0) { + return true; } - if (import_process.env.AWS_EXECUTION_ENV) { - sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]); + if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { + return true; } - const appIdPromise = (0, import_node_config_provider.loadConfig)({ - environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME], - configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME], - default: void 0 - })(); - let resolvedUserAgent = void 0; - return async () => { - if (!resolvedUserAgent) { - const appId = await appIdPromise; - resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; - } - return resolvedUserAgent; - }; - }, "defaultUserAgent"); + return false; + } + exports2.prettify = prettify; } }); -// ../../../node_modules/@smithy/hash-node/dist-cjs/index.js -var require_dist_cjs57 = __commonJS({ - "../../../node_modules/@smithy/hash-node/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - Hash: () => Hash - }); - module2.exports = __toCommonJS2(src_exports); - var import_util_buffer_from = require_dist_cjs27(); - var import_util_utf8 = require_dist_cjs28(); - var import_buffer = require("buffer"); - var import_crypto5 = require("crypto"); - var _Hash = class _Hash { - constructor(algorithmIdentifier, secret) { - this.algorithmIdentifier = algorithmIdentifier; - this.secret = secret; - this.reset(); - } - update(toHash, encoding) { - this.hash.update((0, import_util_utf8.toUint8Array)(castSourceData(toHash, encoding))); +// ../../../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +var require_XMLParser = __commonJS({ + "../../../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { + var { buildOptions } = require_OptionsBuilder(); + var OrderedObjParser = require_OrderedObjParser(); + var { prettify } = require_node2json(); + var validator = require_validator(); + var XMLParser2 = class { + constructor(options) { + this.externalEntities = {}; + this.options = buildOptions(options); } - digest() { - return Promise.resolve(this.hash.digest()); + /** + * Parse XML dats to JS object + * @param {string|Buffer} xmlData + * @param {boolean|Object} validationOption + */ + parse(xmlData, validationOption) { + if (typeof xmlData === "string") { + } else if (xmlData.toString) { + xmlData = xmlData.toString(); + } else { + throw new Error("XML data is accepted in String or Bytes[] form."); + } + if (validationOption) { + if (validationOption === true) validationOption = {}; + const result = validator.validate(xmlData, validationOption); + if (result !== true) { + throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); + } + } + const orderedObjParser = new OrderedObjParser(this.options); + orderedObjParser.addExternalEntities(this.externalEntities); + const orderedResult = orderedObjParser.parseXml(xmlData); + if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; + else return prettify(orderedResult, this.options); } - reset() { - this.hash = this.secret ? (0, import_crypto5.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) : (0, import_crypto5.createHash)(this.algorithmIdentifier); + /** + * Add Entity which is not by default supported by this library + * @param {string} key + * @param {string} value + */ + addEntity(key, value) { + if (value.indexOf("&") !== -1) { + throw new Error("Entity value can't have '&'"); + } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { + throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); + } else if (value === "&") { + throw new Error("An entity with value '&' is not permitted"); + } else { + this.externalEntities[key] = value; + } } }; - __name(_Hash, "Hash"); - var Hash = _Hash; - function castSourceData(toCast, encoding) { - if (import_buffer.Buffer.isBuffer(toCast)) { - return toCast; - } - if (typeof toCast === "string") { - return (0, import_util_buffer_from.fromString)(toCast, encoding); - } - if (ArrayBuffer.isView(toCast)) { - return (0, import_util_buffer_from.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength); - } - return (0, import_util_buffer_from.fromArrayBuffer)(toCast); - } - __name(castSourceData, "castSourceData"); + module2.exports = XMLParser2; } }); -// ../../../node_modules/@smithy/util-body-length-node/dist-cjs/index.js -var require_dist_cjs58 = __commonJS({ - "../../../node_modules/@smithy/util-body-length-node/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - calculateBodyLength: () => calculateBodyLength - }); - module2.exports = __toCommonJS2(src_exports); - var import_fs = require("fs"); - var calculateBodyLength = /* @__PURE__ */ __name((body) => { - if (!body) { - return 0; +// ../../../node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +var require_orderedJs2Xml = __commonJS({ + "../../../node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { + var EOL = "\n"; + function toXml(jArray, options) { + let indentation = ""; + if (options.format && options.indentBy.length > 0) { + indentation = EOL; } - if (typeof body === "string") { - return Buffer.byteLength(body); - } else if (typeof body.byteLength === "number") { - return body.byteLength; - } else if (typeof body.size === "number") { - return body.size; - } else if (typeof body.start === "number" && typeof body.end === "number") { - return body.end + 1 - body.start; - } else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { - return (0, import_fs.lstatSync)(body.path).size; - } else if (typeof body.fd === "number") { - return (0, import_fs.fstatSync)(body.fd).size; + return arrToStr(jArray, options, "", indentation); + } + function arrToStr(arr, options, jPath, indentation) { + let xmlStr = ""; + let isPreviousElementTag = false; + for (let i = 0; i < arr.length; i++) { + const tagObj = arr[i]; + const tagName = propName(tagObj); + if (tagName === void 0) continue; + let newJPath = ""; + if (jPath.length === 0) newJPath = tagName; + else newJPath = `${jPath}.${tagName}`; + if (tagName === options.textNodeName) { + let tagText = tagObj[tagName]; + if (!isStopNode(newJPath, options)) { + tagText = options.tagValueProcessor(tagName, tagText); + tagText = replaceEntitiesValue(tagText, options); + } + if (isPreviousElementTag) { + xmlStr += indentation; + } + xmlStr += tagText; + isPreviousElementTag = false; + continue; + } else if (tagName === options.cdataPropName) { + if (isPreviousElementTag) { + xmlStr += indentation; + } + xmlStr += ``; + isPreviousElementTag = false; + continue; + } else if (tagName === options.commentPropName) { + xmlStr += indentation + ``; + isPreviousElementTag = true; + continue; + } else if (tagName[0] === "?") { + const attStr2 = attr_to_str(tagObj[":@"], options); + const tempInd = tagName === "?xml" ? "" : indentation; + let piTextNodeName = tagObj[tagName][0][options.textNodeName]; + piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; + xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; + isPreviousElementTag = true; + continue; + } + let newIdentation = indentation; + if (newIdentation !== "") { + newIdentation += options.indentBy; + } + const attStr = attr_to_str(tagObj[":@"], options); + const tagStart = indentation + `<${tagName}${attStr}`; + const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); + if (options.unpairedTags.indexOf(tagName) !== -1) { + if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; + else xmlStr += tagStart + "/>"; + } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { + xmlStr += tagStart + "/>"; + } else if (tagValue && tagValue.endsWith(">")) { + xmlStr += tagStart + `>${tagValue}${indentation}`; + } else { + xmlStr += tagStart + ">"; + if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; + } + isPreviousElementTag = true; } - throw new Error(`Body Length computation failed for ${body}`); - }, "calculateBodyLength"); - } -}); - -// ../../../node_modules/@smithy/util-retry/node_modules/@smithy/service-error-classification/dist-cjs/index.js -var require_dist_cjs59 = __commonJS({ - "../../../node_modules/@smithy/util-retry/node_modules/@smithy/service-error-classification/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + return xmlStr; + } + function propName(obj) { + const keys = Object.keys(obj); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (!obj.hasOwnProperty(key)) continue; + if (key !== ":@") return key; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - isClockSkewCorrectedError: () => isClockSkewCorrectedError, - isClockSkewError: () => isClockSkewError, - isRetryableByTrait: () => isRetryableByTrait, - isServerError: () => isServerError, - isThrottlingError: () => isThrottlingError, - isTransientError: () => isTransientError - }); - module2.exports = __toCommonJS2(src_exports); - var CLOCK_SKEW_ERROR_CODES = [ - "AuthFailure", - "InvalidSignatureException", - "RequestExpired", - "RequestInTheFuture", - "RequestTimeTooSkewed", - "SignatureDoesNotMatch" - ]; - var THROTTLING_ERROR_CODES = [ - "BandwidthLimitExceeded", - "EC2ThrottledException", - "LimitExceededException", - "PriorRequestNotComplete", - "ProvisionedThroughputExceededException", - "RequestLimitExceeded", - "RequestThrottled", - "RequestThrottledException", - "SlowDown", - "ThrottledException", - "Throttling", - "ThrottlingException", - "TooManyRequestsException", - "TransactionInProgressException" - // DynamoDB - ]; - var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; - var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; - var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; - var isRetryableByTrait = /* @__PURE__ */ __name((error) => error.$retryable !== void 0, "isRetryableByTrait"); - var isClockSkewError = /* @__PURE__ */ __name((error) => CLOCK_SKEW_ERROR_CODES.includes(error.name), "isClockSkewError"); - var isClockSkewCorrectedError = /* @__PURE__ */ __name((error) => { - var _a; - return (_a = error.$metadata) == null ? void 0 : _a.clockSkewCorrected; - }, "isClockSkewCorrectedError"); - var isThrottlingError = /* @__PURE__ */ __name((error) => { - var _a, _b; - return ((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) === 429 || THROTTLING_ERROR_CODES.includes(error.name) || ((_b = error.$retryable) == null ? void 0 : _b.throttling) == true; - }, "isThrottlingError"); - var isTransientError = /* @__PURE__ */ __name((error) => { - var _a; - return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0); - }, "isTransientError"); - var isServerError = /* @__PURE__ */ __name((error) => { - var _a; - if (((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) !== void 0) { - const statusCode = error.$metadata.httpStatusCode; - if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) { - return true; + } + function attr_to_str(attrMap, options) { + let attrStr = ""; + if (attrMap && !options.ignoreAttributes) { + for (let attr in attrMap) { + if (!attrMap.hasOwnProperty(attr)) continue; + let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); + attrVal = replaceEntitiesValue(attrVal, options); + if (attrVal === true && options.suppressBooleanAttributes) { + attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; + } else { + attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; + } } - return false; + } + return attrStr; + } + function isStopNode(jPath, options) { + jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); + let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); + for (let index in options.stopNodes) { + if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; } return false; - }, "isServerError"); + } + function replaceEntitiesValue(textValue, options) { + if (textValue && textValue.length > 0 && options.processEntities) { + for (let i = 0; i < options.entities.length; i++) { + const entity = options.entities[i]; + textValue = textValue.replace(entity.regex, entity.val); + } + } + return textValue; + } + module2.exports = toXml; } }); -// ../../../node_modules/@smithy/util-retry/dist-cjs/index.js -var require_dist_cjs60 = __commonJS({ - "../../../node_modules/@smithy/util-retry/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; +// ../../../node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +var require_json2xml = __commonJS({ + "../../../node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { + "use strict"; + var buildFromOrderedJs = require_orderedJs2Xml(); + var defaultOptions = { + attributeNamePrefix: "@_", + attributesGroupName: false, + textNodeName: "#text", + ignoreAttributes: true, + cdataPropName: false, + format: false, + indentBy: " ", + suppressEmptyNode: false, + suppressUnpairedNode: true, + suppressBooleanAttributes: true, + tagValueProcessor: function(key, a) { + return a; + }, + attributeValueProcessor: function(attrName, a) { + return a; + }, + preserveOrder: false, + commentPropName: false, + unpairedTags: [], + entities: [ + { regex: new RegExp("&", "g"), val: "&" }, + //it must be on top + { regex: new RegExp(">", "g"), val: ">" }, + { regex: new RegExp("<", "g"), val: "<" }, + { regex: new RegExp("'", "g"), val: "'" }, + { regex: new RegExp('"', "g"), val: """ } + ], + processEntities: true, + stopNodes: [], + // transformTagName: false, + // transformAttributeName: false, + oneListGroup: false }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - AdaptiveRetryStrategy: () => AdaptiveRetryStrategy, - ConfiguredRetryStrategy: () => ConfiguredRetryStrategy, - DEFAULT_MAX_ATTEMPTS: () => DEFAULT_MAX_ATTEMPTS, - DEFAULT_RETRY_DELAY_BASE: () => DEFAULT_RETRY_DELAY_BASE, - DEFAULT_RETRY_MODE: () => DEFAULT_RETRY_MODE, - DefaultRateLimiter: () => DefaultRateLimiter, - INITIAL_RETRY_TOKENS: () => INITIAL_RETRY_TOKENS, - INVOCATION_ID_HEADER: () => INVOCATION_ID_HEADER, - MAXIMUM_RETRY_DELAY: () => MAXIMUM_RETRY_DELAY, - NO_RETRY_INCREMENT: () => NO_RETRY_INCREMENT, - REQUEST_HEADER: () => REQUEST_HEADER, - RETRY_COST: () => RETRY_COST, - RETRY_MODES: () => RETRY_MODES, - StandardRetryStrategy: () => StandardRetryStrategy, - THROTTLING_RETRY_DELAY_BASE: () => THROTTLING_RETRY_DELAY_BASE, - TIMEOUT_RETRY_COST: () => TIMEOUT_RETRY_COST - }); - module2.exports = __toCommonJS2(src_exports); - var RETRY_MODES = /* @__PURE__ */ ((RETRY_MODES2) => { - RETRY_MODES2["STANDARD"] = "standard"; - RETRY_MODES2["ADAPTIVE"] = "adaptive"; - return RETRY_MODES2; - })(RETRY_MODES || {}); - var DEFAULT_MAX_ATTEMPTS = 3; - var DEFAULT_RETRY_MODE = "standard"; - var import_service_error_classification = require_dist_cjs59(); - var _DefaultRateLimiter = class _DefaultRateLimiter { - constructor(options) { - this.currentCapacity = 0; - this.enabled = false; - this.lastMaxRate = 0; - this.measuredTxRate = 0; - this.requestCount = 0; - this.lastTimestamp = 0; - this.timeWindow = 0; - this.beta = (options == null ? void 0 : options.beta) ?? 0.7; - this.minCapacity = (options == null ? void 0 : options.minCapacity) ?? 1; - this.minFillRate = (options == null ? void 0 : options.minFillRate) ?? 0.5; - this.scaleConstant = (options == null ? void 0 : options.scaleConstant) ?? 0.4; - this.smooth = (options == null ? void 0 : options.smooth) ?? 0.8; - const currentTimeInSeconds = this.getCurrentTimeInSeconds(); - this.lastThrottleTime = currentTimeInSeconds; - this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); - this.fillRate = this.minFillRate; - this.maxCapacity = this.minCapacity; - } - getCurrentTimeInSeconds() { - return Date.now() / 1e3; - } - async getSendToken() { - return this.acquireTokenBucket(1); + function Builder(options) { + this.options = Object.assign({}, defaultOptions, options); + if (this.options.ignoreAttributes || this.options.attributesGroupName) { + this.isAttribute = function() { + return false; + }; + } else { + this.attrPrefixLen = this.options.attributeNamePrefix.length; + this.isAttribute = isAttribute; } - async acquireTokenBucket(amount) { - if (!this.enabled) { - return; - } - this.refillTokenBucket(); - if (amount > this.currentCapacity) { - const delay = (amount - this.currentCapacity) / this.fillRate * 1e3; - await new Promise((resolve) => setTimeout(resolve, delay)); - } - this.currentCapacity = this.currentCapacity - amount; + this.processTextOrObjNode = processTextOrObjNode; + if (this.options.format) { + this.indentate = indentate; + this.tagEndChar = ">\n"; + this.newLine = "\n"; + } else { + this.indentate = function() { + return ""; + }; + this.tagEndChar = ">"; + this.newLine = ""; } - refillTokenBucket() { - const timestamp = this.getCurrentTimeInSeconds(); - if (!this.lastTimestamp) { - this.lastTimestamp = timestamp; - return; + } + Builder.prototype.build = function(jObj) { + if (this.options.preserveOrder) { + return buildFromOrderedJs(jObj, this.options); + } else { + if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { + jObj = { + [this.options.arrayNodeName]: jObj + }; } - const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; - this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); - this.lastTimestamp = timestamp; + return this.j2x(jObj, 0).val; } - updateClientSendingRate(response) { - let calculatedRate; - this.updateMeasuredRate(); - if ((0, import_service_error_classification.isThrottlingError)(response)) { - const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); - this.lastMaxRate = rateToUse; - this.calculateTimeWindow(); - this.lastThrottleTime = this.getCurrentTimeInSeconds(); - calculatedRate = this.cubicThrottle(rateToUse); - this.enableTokenBucket(); + }; + Builder.prototype.j2x = function(jObj, level) { + let attrStr = ""; + let val2 = ""; + for (let key in jObj) { + if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; + if (typeof jObj[key] === "undefined") { + if (this.isAttribute(key)) { + val2 += ""; + } + } else if (jObj[key] === null) { + if (this.isAttribute(key)) { + val2 += ""; + } else if (key[0] === "?") { + val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; + } else { + val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; + } + } else if (jObj[key] instanceof Date) { + val2 += this.buildTextValNode(jObj[key], key, "", level); + } else if (typeof jObj[key] !== "object") { + const attr = this.isAttribute(key); + if (attr) { + attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); + } else { + if (key === this.options.textNodeName) { + let newval = this.options.tagValueProcessor(key, "" + jObj[key]); + val2 += this.replaceEntitiesValue(newval); + } else { + val2 += this.buildTextValNode(jObj[key], key, "", level); + } + } + } else if (Array.isArray(jObj[key])) { + const arrLen = jObj[key].length; + let listTagVal = ""; + let listTagAttr = ""; + for (let j = 0; j < arrLen; j++) { + const item = jObj[key][j]; + if (typeof item === "undefined") { + } else if (item === null) { + if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; + else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; + } else if (typeof item === "object") { + if (this.options.oneListGroup) { + const result = this.j2x(item, level + 1); + listTagVal += result.val; + if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { + listTagAttr += result.attrStr; + } + } else { + listTagVal += this.processTextOrObjNode(item, key, level); + } + } else { + if (this.options.oneListGroup) { + let textValue = this.options.tagValueProcessor(key, item); + textValue = this.replaceEntitiesValue(textValue); + listTagVal += textValue; + } else { + listTagVal += this.buildTextValNode(item, key, "", level); + } + } + } + if (this.options.oneListGroup) { + listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); + } + val2 += listTagVal; } else { - this.calculateTimeWindow(); - calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); - } - const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); - this.updateTokenBucketRate(newRate); - } - calculateTimeWindow() { - this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); - } - cubicThrottle(rateToUse) { - return this.getPrecise(rateToUse * this.beta); - } - cubicSuccess(timestamp) { - return this.getPrecise( - this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate - ); - } - enableTokenBucket() { - this.enabled = true; - } - updateTokenBucketRate(newRate) { - this.refillTokenBucket(); - this.fillRate = Math.max(newRate, this.minFillRate); - this.maxCapacity = Math.max(newRate, this.minCapacity); - this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); - } - updateMeasuredRate() { - const t = this.getCurrentTimeInSeconds(); - const timeBucket = Math.floor(t * 2) / 2; - this.requestCount++; - if (timeBucket > this.lastTxRateBucket) { - const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); - this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); - this.requestCount = 0; - this.lastTxRateBucket = timeBucket; + if (this.options.attributesGroupName && key === this.options.attributesGroupName) { + const Ks = Object.keys(jObj[key]); + const L = Ks.length; + for (let j = 0; j < L; j++) { + attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); + } + } else { + val2 += this.processTextOrObjNode(jObj[key], key, level); + } } } - getPrecise(num) { - return parseFloat(num.toFixed(8)); - } + return { attrStr, val: val2 }; }; - __name(_DefaultRateLimiter, "DefaultRateLimiter"); - var DefaultRateLimiter = _DefaultRateLimiter; - var DEFAULT_RETRY_DELAY_BASE = 100; - var MAXIMUM_RETRY_DELAY = 20 * 1e3; - var THROTTLING_RETRY_DELAY_BASE = 500; - var INITIAL_RETRY_TOKENS = 500; - var RETRY_COST = 5; - var TIMEOUT_RETRY_COST = 10; - var NO_RETRY_INCREMENT = 1; - var INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; - var REQUEST_HEADER = "amz-sdk-request"; - var getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => { - let delayBase = DEFAULT_RETRY_DELAY_BASE; - const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => { - return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); - }, "computeNextBackoffDelay"); - const setDelayBase = /* @__PURE__ */ __name((delay) => { - delayBase = delay; - }, "setDelayBase"); - return { - computeNextBackoffDelay, - setDelayBase - }; - }, "getDefaultRetryBackoffStrategy"); - var createDefaultRetryToken = /* @__PURE__ */ __name(({ - retryDelay, - retryCount, - retryCost - }) => { - const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount"); - const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay"); - const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost"); - return { - getRetryCount, - getRetryDelay, - getRetryCost - }; - }, "createDefaultRetryToken"); - var _StandardRetryStrategy = class _StandardRetryStrategy { - constructor(maxAttempts) { - this.maxAttempts = maxAttempts; - this.mode = "standard"; - this.capacity = INITIAL_RETRY_TOKENS; - this.retryBackoffStrategy = getDefaultRetryBackoffStrategy(); - this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - async acquireInitialRetryToken(retryTokenScope) { - return createDefaultRetryToken({ - retryDelay: DEFAULT_RETRY_DELAY_BASE, - retryCount: 0 - }); + Builder.prototype.buildAttrPairStr = function(attrName, val2) { + val2 = this.options.attributeValueProcessor(attrName, "" + val2); + val2 = this.replaceEntitiesValue(val2); + if (this.options.suppressBooleanAttributes && val2 === "true") { + return " " + attrName; + } else return " " + attrName + '="' + val2 + '"'; + }; + function processTextOrObjNode(object, key, level) { + const result = this.j2x(object, level + 1); + if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { + return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); + } else { + return this.buildObjectNode(result.val, key, result.attrStr, level); } - async refreshRetryTokenForRetry(token, errorInfo) { - const maxAttempts = await this.getMaxAttempts(); - if (this.shouldRetry(token, errorInfo, maxAttempts)) { - const errorType = errorInfo.errorType; - this.retryBackoffStrategy.setDelayBase( - errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE - ); - const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); - const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; - const capacityCost = this.getCapacityCost(errorType); - this.capacity -= capacityCost; - return createDefaultRetryToken({ - retryDelay, - retryCount: token.getRetryCount() + 1, - retryCost: capacityCost - }); + } + Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { + if (val2 === "") { + if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; + else { + return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; } - throw new Error("No retry token available"); - } - recordSuccess(token) { - this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); - } - /** - * @returns the current available retry capacity. - * - * This number decreases when retries are executed and refills when requests or retries succeed. - */ - getCapacity() { - return this.capacity; - } - async getMaxAttempts() { - try { - return await this.maxAttemptsProvider(); - } catch (error) { - console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); - return DEFAULT_MAX_ATTEMPTS; + } else { + let tagEndExp = "" + val2 + tagEndExp; + } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { + return this.indentate(level) + `` + this.newLine; + } else { + return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; } } - shouldRetry(tokenToRenew, errorInfo, maxAttempts) { - const attempts = tokenToRenew.getRetryCount() + 1; - return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); - } - getCapacityCost(errorType) { - return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; + }; + Builder.prototype.closeTag = function(key) { + let closeTag = ""; + if (this.options.unpairedTags.indexOf(key) !== -1) { + if (!this.options.suppressUnpairedNode) closeTag = "/"; + } else if (this.options.suppressEmptyNode) { + closeTag = "/"; + } else { + closeTag = `>` + this.newLine; + } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { + return this.indentate(level) + `` + this.newLine; + } else if (key[0] === "?") { + return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; + } else { + let textValue = this.options.tagValueProcessor(key, val2); + textValue = this.replaceEntitiesValue(textValue); + if (textValue === "") { + return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; + } else { + return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { + for (let i = 0; i < this.options.entities.length; i++) { + const entity = this.options.entities[i]; + textValue = textValue.replace(entity.regex, entity.val); + } } - async acquireInitialRetryToken(retryTokenScope) { - await this.rateLimiter.getSendToken(); - return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + return textValue; + }; + function indentate(level) { + return this.options.indentBy.repeat(level); + } + function isAttribute(name) { + if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { + return name.substr(this.attrPrefixLen); + } else { + return false; } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - this.rateLimiter.updateClientSendingRate(errorInfo); - return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + } + module2.exports = Builder; + } +}); + +// ../../../node_modules/fast-xml-parser/src/fxp.js +var require_fxp = __commonJS({ + "../../../node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { + "use strict"; + var validator = require_validator(); + var XMLParser2 = require_XMLParser(); + var XMLBuilder = require_json2xml(); + module2.exports = { + XMLParser: XMLParser2, + XMLValidator: validator, + XMLBuilder + }; + } +}); + +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js +var import_smithy_client3, import_fast_xml_parser, parseXmlBody, parseXmlErrorBody, loadRestXmlErrorCode; +var init_parseXmlBody = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() { + import_smithy_client3 = __toESM(require_dist_cjs33()); + import_fast_xml_parser = __toESM(require_fxp()); + init_common(); + parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + const parser = new import_fast_xml_parser.XMLParser({ + attributeNamePrefix: "", + htmlEntities: true, + ignoreAttributes: false, + ignoreDeclaration: true, + parseTagValue: false, + trimValues: false, + tagValueProcessor: (_, val2) => val2.trim() === "" && val2.includes("\n") ? "" : void 0 + }); + parser.addEntity("#xD", "\r"); + parser.addEntity("#10", "\n"); + let parsedObj; + try { + parsedObj = parser.parse(encoded, true); + } catch (e) { + if (e && typeof e === "object") { + Object.defineProperty(e, "$responseBodyText", { + value: encoded + }); + } + throw e; + } + const textNodeName = "#text"; + const key = Object.keys(parsedObj)[0]; + const parsedObjToReturn = parsedObj[key]; + if (parsedObjToReturn[textNodeName]) { + parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; + delete parsedObjToReturn[textNodeName]; + } + return (0, import_smithy_client3.getValueFromTextNode)(parsedObjToReturn); } - recordSuccess(token) { - this.rateLimiter.updateClientSendingRate({}); - this.standardRetryStrategy.recordSuccess(token); + return {}; + }); + parseXmlErrorBody = async (errorBody, context) => { + const value = await parseXmlBody(errorBody, context); + if (value.Error) { + value.Error.message = value.Error.message ?? value.Error.Message; } + return value; }; - __name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); - var AdaptiveRetryStrategy = _AdaptiveRetryStrategy; - var _ConfiguredRetryStrategy = class _ConfiguredRetryStrategy extends StandardRetryStrategy { - /** - * @param maxAttempts - the maximum number of retry attempts allowed. - * e.g., if set to 3, then 4 total requests are possible. - * @param computeNextBackoffDelay - a millisecond delay for each retry or a function that takes the retry attempt - * and returns the delay. - * - * @example exponential backoff. - * ```js - * new Client({ - * retryStrategy: new ConfiguredRetryStrategy(3, (attempt) => attempt ** 2) - * }); - * ``` - * @example constant delay. - * ```js - * new Client({ - * retryStrategy: new ConfiguredRetryStrategy(3, 2000) - * }); - * ``` - */ - constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) { - super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); - if (typeof computeNextBackoffDelay === "number") { - this.computeNextBackoffDelay = () => computeNextBackoffDelay; - } else { - this.computeNextBackoffDelay = computeNextBackoffDelay; - } + loadRestXmlErrorCode = (output, data) => { + if (data?.Error?.Code !== void 0) { + return data.Error.Code; } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); - return token; + if (data?.Code !== void 0) { + return data.Code; + } + if (output.statusCode == 404) { + return "NotFound"; } }; - __name(_ConfiguredRetryStrategy, "ConfiguredRetryStrategy"); - var ConfiguredRetryStrategy = _ConfiguredRetryStrategy; } }); -// ../../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js -var require_ruleset = __commonJS({ - "../../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ruleSet = void 0; - var u = "required"; - var v = "fn"; - var w = "argv"; - var x = "ref"; - var a = true; - var b = "isSet"; - var c = "booleanEquals"; - var d = "error"; - var e = "endpoint"; - var f = "tree"; - var g = "PartitionResult"; - var h = "getAttr"; - var i = { [u]: false, "type": "String" }; - var j = { [u]: true, "default": false, "type": "Boolean" }; - var k = { [x]: "Endpoint" }; - var l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }; - var m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }; - var n = {}; - var o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }; - var p = { [x]: g }; - var q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }; - var r = [l]; - var s = [m]; - var t = [{ [x]: "Region" }]; - var _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; - exports2.ruleSet = _data; +// ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +var init_protocols2 = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() { + init_coercing_serializers(); + init_awsExpectUnion(); + init_parseJsonBody(); + init_parseXmlBody(); } }); -// ../../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js -var require_endpointResolver = __commonJS({ - "../../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.defaultEndpointResolver = void 0; - var util_endpoints_1 = require_dist_cjs7(); - var util_endpoints_2 = require_dist_cjs6(); - var ruleset_1 = require_ruleset(); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - }); - }; - exports2.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; +// ../../../node_modules/@aws-sdk/core/dist-es/index.js +var dist_es_exports2 = {}; +__export(dist_es_exports2, { + AWSSDKSigV4Signer: () => AWSSDKSigV4Signer, + AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner, + AwsSdkSigV4Signer: () => AwsSdkSigV4Signer, + NODE_SIGV4A_CONFIG_OPTIONS: () => NODE_SIGV4A_CONFIG_OPTIONS, + _toBool: () => _toBool, + _toNum: () => _toNum, + _toStr: () => _toStr, + awsExpectUnion: () => awsExpectUnion, + emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion, + loadRestJsonErrorCode: () => loadRestJsonErrorCode, + loadRestXmlErrorCode: () => loadRestXmlErrorCode, + parseJsonBody: () => parseJsonBody, + parseJsonErrorBody: () => parseJsonErrorBody, + parseXmlBody: () => parseXmlBody, + parseXmlErrorBody: () => parseXmlErrorBody, + resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config, + resolveAwsSdkSigV4AConfig: () => resolveAwsSdkSigV4AConfig, + resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config, + validateSigningProperties: () => validateSigningProperties +}); +var init_dist_es2 = __esm({ + "../../../node_modules/@aws-sdk/core/dist-es/index.js"() { + init_client(); + init_httpAuthSchemes2(); + init_protocols2(); } }); -// ../../../node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js -var require_runtimeConfig_shared = __commonJS({ - "../../../node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js"(exports2) { +// ../../../node_modules/@aws-sdk/client-sfn/dist-cjs/auth/httpAuthSchemeProvider.js +var require_httpAuthSchemeProvider = __commonJS({ + "../../../node_modules/@aws-sdk/client-sfn/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeConfig = void 0; + exports2.resolveHttpAuthSchemeConfig = exports2.defaultSFNHttpAuthSchemeProvider = exports2.defaultSFNHttpAuthSchemeParametersProvider = void 0; var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); - var core_2 = (init_dist_es(), __toCommonJS(dist_es_exports)); - var smithy_client_1 = require_dist_cjs37(); - var url_parser_1 = require_dist_cjs44(); - var util_base64_1 = require_dist_cjs29(); - var util_utf8_1 = require_dist_cjs28(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider2(); - var endpointResolver_1 = require_endpointResolver(); - var getRuntimeConfig = (config) => { + var util_middleware_1 = require_dist_cjs10(); + var defaultSFNHttpAuthSchemeParametersProvider = async (config, context, input) => { return { - apiVersion: "2019-06-10", - base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config?.disableHostPrefix ?? false, - endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config?.extensions ?? [], - httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider, - httpAuthSchemes: config?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer() - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner() - } - ], - logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - serviceId: config?.serviceId ?? "SSO", - urlParser: config?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8 + operation: (0, util_middleware_1.getSmithyContext)(context).operation, + region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })() }; }; - exports2.getRuntimeConfig = getRuntimeConfig; - } -}); - -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/util-middleware/dist-cjs/index.js -var require_dist_cjs61 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + exports2.defaultSFNHttpAuthSchemeParametersProvider = defaultSFNHttpAuthSchemeParametersProvider; + function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "states", + region: authParameters.region + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context + } + }) + }; + } + var defaultSFNHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } } - return to; + return options; }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - getSmithyContext: () => getSmithyContext4, - normalizeProvider: () => normalizeProvider2 - }); - module2.exports = __toCommonJS2(src_exports); - var import_types5 = require_dist_cjs(); - var getSmithyContext4 = /* @__PURE__ */ __name((context) => context[import_types5.SMITHY_CONTEXT_KEY] || (context[import_types5.SMITHY_CONTEXT_KEY] = {}), "getSmithyContext"); - var normalizeProvider2 = /* @__PURE__ */ __name((input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; - }, "normalizeProvider"); + exports2.defaultSFNHttpAuthSchemeProvider = defaultSFNHttpAuthSchemeProvider; + var resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return { + ...config_0 + }; + }; + exports2.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; } }); -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/config-resolver/dist-cjs/index.js -var require_dist_cjs62 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/config-resolver/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; +// ../../../node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports = {}; +__export(tslib_es6_exports, { + __addDisposableResource: () => __addDisposableResource, + __assign: () => __assign, + __asyncDelegator: () => __asyncDelegator, + __asyncGenerator: () => __asyncGenerator, + __asyncValues: () => __asyncValues, + __await: () => __await, + __awaiter: () => __awaiter, + __classPrivateFieldGet: () => __classPrivateFieldGet, + __classPrivateFieldIn: () => __classPrivateFieldIn, + __classPrivateFieldSet: () => __classPrivateFieldSet, + __createBinding: () => __createBinding, + __decorate: () => __decorate, + __disposeResources: () => __disposeResources, + __esDecorate: () => __esDecorate, + __exportStar: () => __exportStar, + __extends: () => __extends, + __generator: () => __generator, + __importDefault: () => __importDefault, + __importStar: () => __importStar, + __makeTemplateObject: () => __makeTemplateObject, + __metadata: () => __metadata, + __param: () => __param, + __propKey: () => __propKey, + __read: () => __read, + __rest: () => __rest, + __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension, + __runInitializers: () => __runInitializers, + __setFunctionName: () => __setFunctionName, + __spread: () => __spread, + __spreadArray: () => __spreadArray, + __spreadArrays: () => __spreadArrays, + __values: () => __values, + default: () => tslib_es6_default +}); +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} +function __param(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { + if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); + return f; + } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function(f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - CONFIG_USE_DUALSTACK_ENDPOINT: () => CONFIG_USE_DUALSTACK_ENDPOINT, - CONFIG_USE_FIPS_ENDPOINT: () => CONFIG_USE_FIPS_ENDPOINT, - DEFAULT_USE_DUALSTACK_ENDPOINT: () => DEFAULT_USE_DUALSTACK_ENDPOINT, - DEFAULT_USE_FIPS_ENDPOINT: () => DEFAULT_USE_FIPS_ENDPOINT, - ENV_USE_DUALSTACK_ENDPOINT: () => ENV_USE_DUALSTACK_ENDPOINT, - ENV_USE_FIPS_ENDPOINT: () => ENV_USE_FIPS_ENDPOINT, - NODE_REGION_CONFIG_FILE_OPTIONS: () => NODE_REGION_CONFIG_FILE_OPTIONS, - NODE_REGION_CONFIG_OPTIONS: () => NODE_REGION_CONFIG_OPTIONS, - NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: () => NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, - NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: () => NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, - REGION_ENV_NAME: () => REGION_ENV_NAME, - REGION_INI_NAME: () => REGION_INI_NAME, - getRegionInfo: () => getRegionInfo, - resolveCustomEndpointsConfig: () => resolveCustomEndpointsConfig, - resolveEndpointsConfig: () => resolveEndpointsConfig, - resolveRegionConfig: () => resolveRegionConfig + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +} +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +} +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +} +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); }); - module2.exports = __toCommonJS2(src_exports); - var import_util_config_provider = require_dist_cjs9(); - var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; - var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; - var DEFAULT_USE_DUALSTACK_ENDPOINT = false; - var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, import_util_config_provider.booleanSelector)(env, ENV_USE_DUALSTACK_ENDPOINT, import_util_config_provider.SelectorType.ENV), - configFileSelector: (profile) => (0, import_util_config_provider.booleanSelector)(profile, CONFIG_USE_DUALSTACK_ENDPOINT, import_util_config_provider.SelectorType.CONFIG), - default: false - }; - var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; - var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; - var DEFAULT_USE_FIPS_ENDPOINT = false; - var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, import_util_config_provider.booleanSelector)(env, ENV_USE_FIPS_ENDPOINT, import_util_config_provider.SelectorType.ENV), - configFileSelector: (profile) => (0, import_util_config_provider.booleanSelector)(profile, CONFIG_USE_FIPS_ENDPOINT, import_util_config_provider.SelectorType.CONFIG), - default: false - }; - var import_util_middleware3 = require_dist_cjs61(); - var resolveCustomEndpointsConfig = /* @__PURE__ */ __name((input) => { - const { endpoint, urlParser } = input; - return { - ...input, - tls: input.tls ?? true, - endpoint: (0, import_util_middleware3.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), - isCustomEndpoint: true, - useDualstackEndpoint: (0, import_util_middleware3.normalizeProvider)(input.useDualstackEndpoint ?? false) - }; - }, "resolveCustomEndpointsConfig"); - var getEndpointFromRegion = /* @__PURE__ */ __name(async (input) => { - const { tls = true } = input; - const region = await input.region(); - const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); - if (!dnsHostRegex.test(region)) { - throw new Error("Invalid region in client config"); - } - const useDualstackEndpoint = await input.useDualstackEndpoint(); - const useFipsEndpoint = await input.useFipsEndpoint(); - const { hostname } = await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }) ?? {}; - if (!hostname) { - throw new Error("Cannot resolve hostname from client config"); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); - }, "getEndpointFromRegion"); - var resolveEndpointsConfig = /* @__PURE__ */ __name((input) => { - const useDualstackEndpoint = (0, import_util_middleware3.normalizeProvider)(input.useDualstackEndpoint ?? false); - const { endpoint, useFipsEndpoint, urlParser } = input; - return { - ...input, - tls: input.tls ?? true, - endpoint: endpoint ? (0, import_util_middleware3.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }), - isCustomEndpoint: !!endpoint, - useDualstackEndpoint - }; - }, "resolveEndpointsConfig"); - var REGION_ENV_NAME = "AWS_REGION"; - var REGION_INI_NAME = "region"; - var NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[REGION_ENV_NAME], - configFileSelector: (profile) => profile[REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); }; - var NODE_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials" - }; - var isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion"); - var getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion"); - var resolveRegionConfig = /* @__PURE__ */ __name((input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); - } - return { - ...input, - region: async () => { - if (typeof region === "string") { - return getRealRegion(region); + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; } - const providedRegion = await region(); - return getRealRegion(providedRegion); - }, - useFipsEndpoint: async () => { - const providedRegion = typeof region === "string" ? region : await region(); - if (isFipsRegion(providedRegion)) { - return true; + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; } - return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); - } - }; - }, "resolveRegionConfig"); - var getHostnameFromVariants = /* @__PURE__ */ __name((variants = [], { useFipsEndpoint, useDualstackEndpoint }) => { - var _a; - return (_a = variants.find( - ({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack") - )) == null ? void 0 : _a.hostname; - }, "getHostnameFromVariants"); - var getResolvedHostname = /* @__PURE__ */ __name((resolvedRegion, { regionHostname, partitionHostname }) => regionHostname ? regionHostname : partitionHostname ? partitionHostname.replace("{region}", resolvedRegion) : void 0, "getResolvedHostname"); - var getResolvedPartition = /* @__PURE__ */ __name((region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws", "getResolvedPartition"); - var getResolvedSigningRegion = /* @__PURE__ */ __name((hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { - if (signingRegion) { - return signingRegion; - } else if (useFipsEndpoint) { - const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); - const regionRegexmatchArray = hostname.match(regionRegexJs); - if (regionRegexmatchArray) { - return regionRegexmatchArray[0].slice(1, -1); - } - } - }, "getResolvedSigningRegion"); - var getRegionInfo = /* @__PURE__ */ __name((region, { - useFipsEndpoint = false, - useDualstackEndpoint = false, - signingService, - regionHash, - partitionHash - }) => { - var _a, _b, _c, _d, _e; - const partition = getResolvedPartition(region, { partitionHash }); - const resolvedRegion = region in regionHash ? region : ((_a = partitionHash[partition]) == null ? void 0 : _a.endpoint) ?? region; - const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; - const regionHostname = getHostnameFromVariants((_b = regionHash[resolvedRegion]) == null ? void 0 : _b.variants, hostnameOptions); - const partitionHostname = getHostnameFromVariants((_c = partitionHash[partition]) == null ? void 0 : _c.variants, hostnameOptions); - const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname }); - if (hostname === void 0) { - throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } - const signingRegion = getResolvedSigningRegion(hostname, { - signingRegion: (_d = regionHash[resolvedRegion]) == null ? void 0 : _d.signingRegion, - regionRegex: partitionHash[partition].regionRegex, - useFipsEndpoint - }); - return { - partition, - signingService, - hostname, - ...signingRegion && { signingRegion }, - ...((_e = regionHash[resolvedRegion]) == null ? void 0 : _e.signingService) && { - signingService: regionHash[resolvedRegion].signingService - } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function() { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } catch (error) { + e = { error }; + } finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } finally { + if (e) throw e.error; + } + } + return ar; +} +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function awaitReturn(f) { + return function(v) { + return Promise.resolve(v).then(f, reject); + }; + } + function verb(n, f) { + if (g[n]) { + i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); }; - }, "getRegionInfo"); + if (f) i[n] = f(i[n]); + } } -}); - -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/property-provider/dist-cjs/index.js -var require_dist_cjs63 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/property-provider/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); + } + } + function step(r) { + r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + } +} +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function(e) { + throw e; + }), verb("return"), i[Symbol.iterator] = function() { + return this; + }, i; + function verb(n, f) { + i[n] = o[n] ? function(v) { + return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; + } : f; + } +} +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i); + function verb(n) { + i[n] = o[n] && function(v) { + return new Promise(function(resolve, reject) { + v = o[n](v), settle(resolve, reject, v.done, v.value); + }); }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + function settle(resolve, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve({ value: v2, done: d }); + }, reject); + } +} +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; +} +function __importDefault(mod) { + return mod && mod.__esModule ? mod : { default: mod }; +} +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; +} +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { + try { + inner.call(this); + } catch (e) { + return Promise.reject(e); } - return to; }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - CredentialsProviderError: () => CredentialsProviderError, - ProviderError: () => ProviderError2, - TokenProviderError: () => TokenProviderError, - chain: () => chain, - fromStatic: () => fromStatic, - memoize: () => memoize - }); - module2.exports = __toCommonJS2(src_exports); - var _ProviderError = class _ProviderError2 extends Error { - constructor(message, options = true) { - var _a; - let logger; - let tryNextLink = true; - if (typeof options === "boolean") { - logger = void 0; - tryNextLink = options; - } else if (options != null && typeof options === "object") { - logger = options.logger; - tryNextLink = options.tryNextLink ?? true; - } - super(message); - this.name = "ProviderError"; - this.tryNextLink = tryNextLink; - Object.setPrototypeOf(this, _ProviderError2.prototype); - (_a = logger == null ? void 0 : logger.debug) == null ? void 0 : _a.call(logger, `@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); - } - /** - * @deprecated use new operator. - */ - static from(error, options = true) { - return Object.assign(new this(error.message, options), error); + env.stack.push({ value, dispose, async }); + } else if (async) { + env.stack.push({ async: true }); + } + return value; +} +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { + fail(e); + return next(); + }); + } else s |= 1; + } catch (e) { + fail(e); } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path; +} +var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; +var init_tslib_es6 = __esm({ + "../../../node_modules/tslib/tslib.es6.mjs"() { + extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { + d2.__proto__ = b2; + } || function(d2, b2) { + for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p]; + }; + return extendStatics(d, b); + }; + __assign = function() { + __assign = Object.assign || function __assign2(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; - __name(_ProviderError, "ProviderError"); - var ProviderError2 = _ProviderError; - var _CredentialsProviderError = class _CredentialsProviderError2 extends ProviderError2 { - /** - * @override - */ - constructor(message, options = true) { - super(message, options); - this.name = "CredentialsProviderError"; - Object.setPrototypeOf(this, _CredentialsProviderError2.prototype); + __createBinding = Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; }; - __name(_CredentialsProviderError, "CredentialsProviderError"); - var CredentialsProviderError = _CredentialsProviderError; - var _TokenProviderError = class _TokenProviderError2 extends ProviderError2 { - /** - * @override - */ - constructor(message, options = true) { - super(message, options); - this.name = "TokenProviderError"; - Object.setPrototypeOf(this, _TokenProviderError2.prototype); - } + __setModuleDefault = Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }; + _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + tslib_es6_default = { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension }; - __name(_TokenProviderError, "TokenProviderError"); - var TokenProviderError = _TokenProviderError; - var chain = /* @__PURE__ */ __name((...providers) => async () => { - if (providers.length === 0) { - throw new ProviderError2("No providers in chain"); - } - let lastProviderError; - for (const provider of providers) { - try { - const credentials = await provider(); - return credentials; - } catch (err) { - lastProviderError = err; - if (err == null ? void 0 : err.tryNextLink) { - continue; - } - throw err; - } - } - throw lastProviderError; - }, "chain"); - var fromStatic = /* @__PURE__ */ __name((staticValue) => () => Promise.resolve(staticValue), "fromStatic"); - var memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = /* @__PURE__ */ __name(async () => { - if (!pending) { - pending = provider(); - } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } finally { - pending = void 0; - } - return resolved; - }, "coalesceProvider"); - if (isExpired === void 0) { - return async (options) => { - if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - return resolved; - }; - } - return async (options) => { - if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - if (isConstant) { - return resolved; - } - if (requiresRefresh && !requiresRefresh(resolved)) { - isConstant = true; - return resolved; - } - if (isExpired(resolved)) { - await coalesceProvider(); - return resolved; - } - return resolved; - }; - }, "memoize"); } }); -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js -var require_getHomeDir3 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getHomeDir = void 0; - var os_1 = require("os"); - var path_1 = require("path"); - var homeDirCache = {}; - var getHomeDirCacheKey = () => { - if (process && process.geteuid) { - return `${process.geteuid()}`; - } - return "DEFAULT"; - }; - var getHomeDir2 = () => { - const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; - if (HOME) - return HOME; - if (USERPROFILE) - return USERPROFILE; - if (HOMEPATH) - return `${HOMEDRIVE}${HOMEPATH}`; - const homeDirCacheKey = getHomeDirCacheKey(); - if (!homeDirCache[homeDirCacheKey]) - homeDirCache[homeDirCacheKey] = (0, os_1.homedir)(); - return homeDirCache[homeDirCacheKey]; +// ../../../node_modules/@aws-sdk/client-sfn/package.json +var require_package = __commonJS({ + "../../../node_modules/@aws-sdk/client-sfn/package.json"(exports2, module2) { + module2.exports = { + name: "@aws-sdk/client-sfn", + description: "AWS SDK for JavaScript Sfn Client for Node.js, Browser and React Native", + version: "3.632.0", + scripts: { + build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "node ../../scripts/compilation/inline client-sfn", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + clean: "rimraf ./dist-* && rimraf *.tsbuildinfo", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo sfn" + }, + main: "./dist-cjs/index.js", + types: "./dist-types/index.d.ts", + module: "./dist-es/index.js", + sideEffects: false, + dependencies: { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.632.0", + "@aws-sdk/client-sts": "3.632.0", + "@aws-sdk/core": "3.629.0", + "@aws-sdk/credential-provider-node": "3.632.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.632.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.632.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.2", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.14", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.12", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.14", + "@smithy/util-defaults-mode-node": "^3.0.14", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + tslib: "^2.6.2", + uuid: "^9.0.1" + }, + devDependencies: { + "@tsconfig/node16": "16.1.3", + "@types/node": "^16.18.96", + "@types/uuid": "^9.0.4", + concurrently: "7.0.0", + "downlevel-dts": "0.10.1", + rimraf: "3.0.2", + typescript: "~4.9.5" + }, + engines: { + node: ">=16.0.0" + }, + typesVersions: { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + files: [ + "dist-*/**" + ], + author: { + name: "AWS SDK for JavaScript Team", + url: "https://aws.amazon.com/javascript/" + }, + license: "Apache-2.0", + browser: { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sfn", + repository: { + type: "git", + url: "https://github.com/aws/aws-sdk-js-v3.git", + directory: "clients/client-sfn" + } }; - exports2.getHomeDir = getHomeDir2; } }); -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js -var require_getSSOTokenFilepath3 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js"(exports2) { +// ../../../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +var require_dist_cjs36 = __commonJS({ + "../../../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSSOTokenFilepath = void 0; - var crypto_1 = require("crypto"); - var path_1 = require("path"); - var getHomeDir_1 = require_getHomeDir3(); - var getSSOTokenFilepath2 = (id) => { - const hasher = (0, crypto_1.createHash)("sha1"); - const cacheName = hasher.update(id).digest("hex"); - return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); }; - exports2.getSSOTokenFilepath = getSSOTokenFilepath2; - } -}); - -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js -var require_getSSOTokenFromFile3 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSSOTokenFromFile = void 0; - var fs_1 = require("fs"); - var getSSOTokenFilepath_1 = require_getSSOTokenFilepath3(); - var { readFile } = fs_1.promises; - var getSSOTokenFromFile2 = async (id) => { - const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); - const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; }; - exports2.getSSOTokenFromFile = getSSOTokenFromFile2; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID, + ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE, + ENV_EXPIRATION: () => ENV_EXPIRATION, + ENV_KEY: () => ENV_KEY, + ENV_SECRET: () => ENV_SECRET, + ENV_SESSION: () => ENV_SESSION, + fromEnv: () => fromEnv + }); + module2.exports = __toCommonJS2(src_exports); + var import_property_provider2 = require_dist_cjs24(); + var ENV_KEY = "AWS_ACCESS_KEY_ID"; + var ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; + var ENV_SESSION = "AWS_SESSION_TOKEN"; + var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; + var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; + var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID"; + var fromEnv = /* @__PURE__ */ __name((init) => async () => { + var _a; + (_a = init == null ? void 0 : init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-env - fromEnv"); + const accessKeyId = process.env[ENV_KEY]; + const secretAccessKey = process.env[ENV_SECRET]; + const sessionToken = process.env[ENV_SESSION]; + const expiry = process.env[ENV_EXPIRATION]; + const credentialScope = process.env[ENV_CREDENTIAL_SCOPE]; + const accountId = process.env[ENV_ACCOUNT_ID]; + if (accessKeyId && secretAccessKey) { + return { + accessKeyId, + secretAccessKey, + ...sessionToken && { sessionToken }, + ...expiry && { expiration: new Date(expiry) }, + ...credentialScope && { credentialScope }, + ...accountId && { accountId } + }; + } + throw new import_property_provider2.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init == null ? void 0 : init.logger }); + }, "fromEnv"); } }); -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js -var require_slurpFile3 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.slurpFile = void 0; - var fs_1 = require("fs"); - var { readFile } = fs_1.promises; - var filePromisesHash = {}; - var slurpFile = (path, options) => { - if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) { - filePromisesHash[path] = readFile(path, "utf8"); +// ../../../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +var require_dist_cjs37 = __commonJS({ + "../../../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES, + DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT, + ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN, + ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI, + ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI, + Endpoint: () => Endpoint, + fromContainerMetadata: () => fromContainerMetadata, + fromInstanceMetadata: () => fromInstanceMetadata, + getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint, + httpRequest: () => httpRequest, + providerConfigFromInit: () => providerConfigFromInit + }); + module2.exports = __toCommonJS2(src_exports); + var import_url = require("url"); + var import_property_provider2 = require_dist_cjs24(); + var import_buffer = require("buffer"); + var import_http2 = require("http"); + function httpRequest(options) { + return new Promise((resolve, reject) => { + var _a; + const req = (0, import_http2.request)({ + method: "GET", + ...options, + // Node.js http module doesn't accept hostname with square brackets + // Refs: https://github.com/nodejs/node/issues/39738 + hostname: (_a = options.hostname) == null ? void 0 : _a.replace(/^\[(.+)\]$/, "$1") + }); + req.on("error", (err) => { + reject(Object.assign(new import_property_provider2.ProviderError("Unable to connect to instance metadata service"), err)); + req.destroy(); + }); + req.on("timeout", () => { + reject(new import_property_provider2.ProviderError("TimeoutError from instance metadata service")); + req.destroy(); + }); + req.on("response", (res) => { + const { statusCode = 400 } = res; + if (statusCode < 200 || 300 <= statusCode) { + reject( + Object.assign(new import_property_provider2.ProviderError("Error response received from instance metadata service"), { statusCode }) + ); + req.destroy(); + } + const chunks = []; + res.on("data", (chunk) => { + chunks.push(chunk); + }); + res.on("end", () => { + resolve(import_buffer.Buffer.concat(chunks)); + req.destroy(); + }); + }); + req.end(); + }); + } + __name(httpRequest, "httpRequest"); + var isImdsCredentials = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string", "isImdsCredentials"); + var fromImdsCredentials = /* @__PURE__ */ __name((creds) => ({ + accessKeyId: creds.AccessKeyId, + secretAccessKey: creds.SecretAccessKey, + sessionToken: creds.Token, + expiration: new Date(creds.Expiration), + ...creds.AccountId && { accountId: creds.AccountId } + }), "fromImdsCredentials"); + var DEFAULT_TIMEOUT = 1e3; + var DEFAULT_MAX_RETRIES = 0; + var providerConfigFromInit = /* @__PURE__ */ __name(({ + maxRetries = DEFAULT_MAX_RETRIES, + timeout = DEFAULT_TIMEOUT + }) => ({ maxRetries, timeout }), "providerConfigFromInit"); + var retry = /* @__PURE__ */ __name((toRetry, maxRetries) => { + let promise = toRetry(); + for (let i = 0; i < maxRetries; i++) { + promise = promise.catch(toRetry); + } + return promise; + }, "retry"); + var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; + var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; + var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; + var fromContainerMetadata = /* @__PURE__ */ __name((init = {}) => { + const { timeout, maxRetries } = providerConfigFromInit(init); + return () => retry(async () => { + const requestOptions = await getCmdsUri({ logger: init.logger }); + const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); + if (!isImdsCredentials(credsResponse)) { + throw new import_property_provider2.CredentialsProviderError("Invalid response received from instance metadata service.", { + logger: init.logger + }); + } + return fromImdsCredentials(credsResponse); + }, maxRetries); + }, "fromContainerMetadata"); + var requestFromEcsImds = /* @__PURE__ */ __name(async (timeout, options) => { + if (process.env[ENV_CMDS_AUTH_TOKEN]) { + options.headers = { + ...options.headers, + Authorization: process.env[ENV_CMDS_AUTH_TOKEN] + }; + } + const buffer = await httpRequest({ + ...options, + timeout + }); + return buffer.toString(); + }, "requestFromEcsImds"); + var CMDS_IP = "169.254.170.2"; + var GREENGRASS_HOSTS = { + localhost: true, + "127.0.0.1": true + }; + var GREENGRASS_PROTOCOLS = { + "http:": true, + "https:": true + }; + var getCmdsUri = /* @__PURE__ */ __name(async ({ logger }) => { + if (process.env[ENV_CMDS_RELATIVE_URI]) { + return { + hostname: CMDS_IP, + path: process.env[ENV_CMDS_RELATIVE_URI] + }; + } + if (process.env[ENV_CMDS_FULL_URI]) { + const parsed = (0, import_url.parse)(process.env[ENV_CMDS_FULL_URI]); + if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { + throw new import_property_provider2.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, { + tryNextLink: false, + logger + }); + } + if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { + throw new import_property_provider2.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, { + tryNextLink: false, + logger + }); + } + return { + ...parsed, + port: parsed.port ? parseInt(parsed.port, 10) : void 0 + }; + } + throw new import_property_provider2.CredentialsProviderError( + `The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, + { + tryNextLink: false, + logger + } + ); + }, "getCmdsUri"); + var _InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError2 extends import_property_provider2.CredentialsProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "InstanceMetadataV1FallbackError"; + Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError2.prototype); } - return filePromisesHash[path]; }; - exports2.slurpFile = slurpFile; - } -}); - -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js -var require_dist_cjs64 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); + __name(_InstanceMetadataV1FallbackError, "InstanceMetadataV1FallbackError"); + var InstanceMetadataV1FallbackError = _InstanceMetadataV1FallbackError; + var import_node_config_provider = require_dist_cjs26(); + var import_url_parser = require_dist_cjs28(); + var Endpoint = /* @__PURE__ */ ((Endpoint2) => { + Endpoint2["IPv4"] = "http://169.254.169.254"; + Endpoint2["IPv6"] = "http://[fd00:ec2::254]"; + return Endpoint2; + })(Endpoint || {}); + var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; + var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; + var ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME], + configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], + default: void 0 }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; + var EndpointMode = /* @__PURE__ */ ((EndpointMode2) => { + EndpointMode2["IPv4"] = "IPv4"; + EndpointMode2["IPv6"] = "IPv6"; + return EndpointMode2; + })(EndpointMode || {}); + var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; + var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; + var ENDPOINT_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME], + configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], + default: "IPv4" + /* IPv4 */ }; - var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")); - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR, - DEFAULT_PROFILE: () => DEFAULT_PROFILE, - ENV_PROFILE: () => ENV_PROFILE, - getProfileName: () => getProfileName, - loadSharedConfigFiles: () => loadSharedConfigFiles, - loadSsoSessionData: () => loadSsoSessionData, - parseKnownFiles: () => parseKnownFiles - }); - module2.exports = __toCommonJS2(src_exports); - __reExport(src_exports, require_getHomeDir3(), module2.exports); - var ENV_PROFILE = "AWS_PROFILE"; - var DEFAULT_PROFILE = "default"; - var getProfileName = /* @__PURE__ */ __name((init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE, "getProfileName"); - __reExport(src_exports, require_getSSOTokenFilepath3(), module2.exports); - __reExport(src_exports, require_getSSOTokenFromFile3(), module2.exports); - var import_types5 = require_dist_cjs(); - var getConfigData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - if (indexOfSeparator === -1) { - return false; - } - return Object.values(import_types5.IniSectionType).includes(key.substring(0, indexOfSeparator)); - }).reduce( - (acc, [key, value]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - const updatedKey = key.substring(0, indexOfSeparator) === import_types5.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; - acc[updatedKey] = value; - return acc; - }, - { - // Populate default profile, if present. - ...data.default && { default: data.default } + var getInstanceMetadataEndpoint = /* @__PURE__ */ __name(async () => (0, import_url_parser.parseUrl)(await getFromEndpointConfig() || await getFromEndpointModeConfig()), "getInstanceMetadataEndpoint"); + var getFromEndpointConfig = /* @__PURE__ */ __name(async () => (0, import_node_config_provider.loadConfig)(ENDPOINT_CONFIG_OPTIONS)(), "getFromEndpointConfig"); + var getFromEndpointModeConfig = /* @__PURE__ */ __name(async () => { + const endpointMode = await (0, import_node_config_provider.loadConfig)(ENDPOINT_MODE_CONFIG_OPTIONS)(); + switch (endpointMode) { + case "IPv4": + return "http://169.254.169.254"; + case "IPv6": + return "http://[fd00:ec2::254]"; + default: + throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`); } - ), "getConfigData"); - var import_path = require("path"); - var import_getHomeDir = require_getHomeDir3(); - var ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; - var getConfigFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CONFIG_PATH] || (0, import_path.join)((0, import_getHomeDir.getHomeDir)(), ".aws", "config"), "getConfigFilepath"); - var import_getHomeDir2 = require_getHomeDir3(); - var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; - var getCredentialsFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CREDENTIALS_PATH] || (0, import_path.join)((0, import_getHomeDir2.getHomeDir)(), ".aws", "credentials"), "getCredentialsFilepath"); - var import_getHomeDir3 = require_getHomeDir3(); - var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; - var profileNameBlockList = ["__proto__", "profile __proto__"]; - var parseIni = /* @__PURE__ */ __name((iniData) => { - const map = {}; - let currentSection; - let currentSubSection; - for (const iniLine of iniData.split(/\r?\n/)) { - const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); - const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; - if (isSection) { - currentSection = void 0; - currentSubSection = void 0; - const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); - const matches = prefixKeyRegex.exec(sectionName); - if (matches) { - const [, prefix, , name] = matches; - if (Object.values(import_types5.IniSectionType).includes(prefix)) { - currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR); - } + }, "getFromEndpointModeConfig"); + var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; + var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; + var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; + var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger) => { + const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); + const newExpiration = new Date(Date.now() + refreshInterval * 1e3); + logger.warn( + `Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}. +For more information, please visit: ` + STATIC_STABILITY_DOC_URL + ); + const originalExpiration = credentials.originalExpiration ?? credentials.expiration; + return { + ...credentials, + ...originalExpiration ? { originalExpiration } : {}, + expiration: newExpiration + }; + }, "getExtendedInstanceMetadataCredentials"); + var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => { + const logger = (options == null ? void 0 : options.logger) || console; + let pastCredentials; + return async () => { + let credentials; + try { + credentials = await provider(); + if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { + credentials = getExtendedInstanceMetadataCredentials(credentials, logger); + } + } catch (e) { + if (pastCredentials) { + logger.warn("Credential renew failed: ", e); + credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger); } else { - currentSection = sectionName; + throw e; } - if (profileNameBlockList.includes(sectionName)) { - throw new Error(`Found invalid profile name "${sectionName}"`); + } + pastCredentials = credentials; + return credentials; + }; + }, "staticStabilityProvider"); + var IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; + var IMDS_TOKEN_PATH = "/latest/api/token"; + var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; + var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; + var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; + var fromInstanceMetadata = /* @__PURE__ */ __name((init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }), "fromInstanceMetadata"); + var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => { + let disableFetchToken = false; + const { logger, profile } = init; + const { timeout, maxRetries } = providerConfigFromInit(init); + const getCredentials = /* @__PURE__ */ __name(async (maxRetries2, options) => { + var _a; + const isImdsV1Fallback = disableFetchToken || ((_a = options.headers) == null ? void 0 : _a[X_AWS_EC2_METADATA_TOKEN]) == null; + if (isImdsV1Fallback) { + let fallbackBlockedFromProfile = false; + let fallbackBlockedFromProcessEnv = false; + const configValue = await (0, import_node_config_provider.loadConfig)( + { + environmentVariableSelector: (env) => { + const envValue = env[AWS_EC2_METADATA_V1_DISABLED]; + fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; + if (envValue === void 0) { + throw new import_property_provider2.CredentialsProviderError( + `${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, + { logger: init.logger } + ); + } + return fallbackBlockedFromProcessEnv; + }, + configFileSelector: (profile2) => { + const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; + fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; + return fallbackBlockedFromProfile; + }, + default: false + }, + { + profile + } + )(); + if (init.ec2MetadataV1Disabled || configValue) { + const causes = []; + if (init.ec2MetadataV1Disabled) + causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); + if (fallbackBlockedFromProfile) + causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); + if (fallbackBlockedFromProcessEnv) + causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); + throw new InstanceMetadataV1FallbackError( + `AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join( + ", " + )}].` + ); } - } else if (currentSection) { - const indexOfEqualsSign = trimmedLine.indexOf("="); - if (![0, -1].includes(indexOfEqualsSign)) { - const [name, value] = [ - trimmedLine.substring(0, indexOfEqualsSign).trim(), - trimmedLine.substring(indexOfEqualsSign + 1).trim() - ]; - if (value === "") { - currentSubSection = name; - } else { - if (currentSubSection && iniLine.trimStart() === iniLine) { - currentSubSection = void 0; - } - map[currentSection] = map[currentSection] || {}; - const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; - map[currentSection][key] = value; + } + const imdsProfile = (await retry(async () => { + let profile2; + try { + profile2 = await getProfile(options); + } catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return profile2; + }, maxRetries2)).trim(); + return retry(async () => { + let creds; + try { + creds = await getCredentialsFromProfile(imdsProfile, options, init); + } catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; } + throw err; } - } - } - return map; - }, "parseIni"); - var import_slurpFile = require_slurpFile3(); - var swallowError = /* @__PURE__ */ __name(() => ({}), "swallowError"); - var CONFIG_PREFIX_SEPARATOR = "."; - var loadSharedConfigFiles = /* @__PURE__ */ __name(async (init = {}) => { - const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; - const homeDir = (0, import_getHomeDir3.getHomeDir)(); - const relativeHomeDirPrefix = "~/"; - let resolvedFilepath = filepath; - if (filepath.startsWith(relativeHomeDirPrefix)) { - resolvedFilepath = (0, import_path.join)(homeDir, filepath.slice(2)); - } - let resolvedConfigFilepath = configFilepath; - if (configFilepath.startsWith(relativeHomeDirPrefix)) { - resolvedConfigFilepath = (0, import_path.join)(homeDir, configFilepath.slice(2)); - } - const parsedFiles = await Promise.all([ - (0, import_slurpFile.slurpFile)(resolvedConfigFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).then(getConfigData).catch(swallowError), - (0, import_slurpFile.slurpFile)(resolvedFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).catch(swallowError) - ]); - return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1] - }; - }, "loadSharedConfigFiles"); - var getSsoSessionData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => key.startsWith(import_types5.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}), "getSsoSessionData"); - var import_slurpFile2 = require_slurpFile3(); - var swallowError2 = /* @__PURE__ */ __name(() => ({}), "swallowError"); - var loadSsoSessionData = /* @__PURE__ */ __name(async (init = {}) => (0, import_slurpFile2.slurpFile)(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2), "loadSsoSessionData"); - var mergeConfigFiles = /* @__PURE__ */ __name((...files) => { - const merged = {}; - for (const file of files) { - for (const [key, values] of Object.entries(file)) { - if (merged[key] !== void 0) { - Object.assign(merged[key], values); - } else { - merged[key] = values; + return creds; + }, maxRetries2); + }, "getCredentials"); + return async () => { + const endpoint = await getInstanceMetadataEndpoint(); + if (disableFetchToken) { + logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); + return getCredentials(maxRetries, { ...endpoint, timeout }); + } else { + let token; + try { + token = (await getMetadataToken({ ...endpoint, timeout })).toString(); + } catch (error) { + if ((error == null ? void 0 : error.statusCode) === 400) { + throw Object.assign(error, { + message: "EC2 Metadata token request returned error" + }); + } else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { + disableFetchToken = true; + } + logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); + return getCredentials(maxRetries, { ...endpoint, timeout }); } + return getCredentials(maxRetries, { + ...endpoint, + headers: { + [X_AWS_EC2_METADATA_TOKEN]: token + }, + timeout + }); } + }; + }, "getInstanceMetadataProvider"); + var getMetadataToken = /* @__PURE__ */ __name(async (options) => httpRequest({ + ...options, + path: IMDS_TOKEN_PATH, + method: "PUT", + headers: { + "x-aws-ec2-metadata-token-ttl-seconds": "21600" } - return merged; - }, "mergeConfigFiles"); - var parseKnownFiles = /* @__PURE__ */ __name(async (init) => { - const parsedFiles = await loadSharedConfigFiles(init); - return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); - }, "parseKnownFiles"); + }), "getMetadataToken"); + var getProfile = /* @__PURE__ */ __name(async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(), "getProfile"); + var getCredentialsFromProfile = /* @__PURE__ */ __name(async (profile, options, init) => { + const credentialsResponse = JSON.parse( + (await httpRequest({ + ...options, + path: IMDS_PATH + profile + })).toString() + ); + if (!isImdsCredentials(credentialsResponse)) { + throw new import_property_provider2.CredentialsProviderError("Invalid response received from instance metadata service.", { + logger: init.logger + }); + } + return fromImdsCredentials(credentialsResponse); + }, "getCredentialsFromProfile"); } }); -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/node-config-provider/dist-cjs/index.js -var require_dist_cjs65 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/node-config-provider/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); +// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +var require_checkUrl = __commonJS({ + "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.checkUrl = void 0; + var property_provider_1 = require_dist_cjs24(); + var ECS_CONTAINER_HOST = "169.254.170.2"; + var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23"; + var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]"; + var checkUrl = (url2, logger) => { + if (url2.protocol === "https:") { + return; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - loadConfig: () => loadConfig - }); - module2.exports = __toCommonJS2(src_exports); - var import_property_provider2 = require_dist_cjs63(); - function getSelectorName(functionString) { - try { - const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); - constants.delete("CONFIG"); - constants.delete("CONFIG_PREFIX_SEPARATOR"); - constants.delete("ENV"); - return [...constants].join(", "); - } catch (e) { - return functionString; + if (url2.hostname === ECS_CONTAINER_HOST || url2.hostname === EKS_CONTAINER_HOST_IPv4 || url2.hostname === EKS_CONTAINER_HOST_IPv6) { + return; } - } - __name(getSelectorName, "getSelectorName"); - var fromEnv = /* @__PURE__ */ __name((envVarSelector, logger) => async () => { - try { - const config = envVarSelector(process.env); - if (config === void 0) { - throw new Error(); + if (url2.hostname.includes("[")) { + if (url2.hostname === "[::1]" || url2.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") { + return; } - return config; - } catch (e) { - throw new import_property_provider2.CredentialsProviderError( - e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, - { logger } - ); - } - }, "fromEnv"); - var import_shared_ini_file_loader = require_dist_cjs64(); - var fromSharedConfigFiles = /* @__PURE__ */ __name((configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = (0, import_shared_ini_file_loader.getProfileName)(init); - const { configFile, credentialsFile } = await (0, import_shared_ini_file_loader.loadSharedConfigFiles)(init); - const profileFromCredentials = credentialsFile[profile] || {}; - const profileFromConfig = configFile[profile] || {}; - const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials }; - try { - const cfgFile = preferredFile === "config" ? configFile : credentialsFile; - const configValue = configSelector(mergedProfile, cfgFile); - if (configValue === void 0) { - throw new Error(); + } else { + if (url2.hostname === "localhost") { + return; } - return configValue; - } catch (e) { - throw new import_property_provider2.CredentialsProviderError( - e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, - { logger: init.logger } - ); - } - }, "fromSharedConfigFiles"); - var isFunction = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction"); - var fromStatic = /* @__PURE__ */ __name((defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, import_property_provider2.fromStatic)(defaultValue), "fromStatic"); - var loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, import_property_provider2.memoize)( - (0, import_property_provider2.chain)( - fromEnv(environmentVariableSelector), - fromSharedConfigFiles(configFileSelector, configuration), - fromStatic(defaultValue) - ) - ), "loadConfig"); - } -}); - -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/querystring-parser/dist-cjs/index.js -var require_dist_cjs66 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - parseQueryString: () => parseQueryString - }); - module2.exports = __toCommonJS2(src_exports); - function parseQueryString(querystring) { - const query = {}; - querystring = querystring.replace(/^\?/, ""); - if (querystring) { - for (const pair of querystring.split("&")) { - let [key, value = null] = pair.split("="); - key = decodeURIComponent(key); - if (value) { - value = decodeURIComponent(value); - } - if (!(key in query)) { - query[key] = value; - } else if (Array.isArray(query[key])) { - query[key].push(value); - } else { - query[key] = [query[key], value]; - } + const ipComponents = url2.hostname.split("."); + const inRange = (component) => { + const num = parseInt(component, 10); + return 0 <= num && num <= 255; + }; + if (ipComponents[0] === "127" && inRange(ipComponents[1]) && inRange(ipComponents[2]) && inRange(ipComponents[3]) && ipComponents.length === 4) { + return; } } - return query; - } - __name(parseQueryString, "parseQueryString"); + throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following: + - loopback CIDR 127.0.0.0/8 or [::1/128] + - ECS container host 169.254.170.2 + - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger }); + }; + exports2.checkUrl = checkUrl; } }); -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/url-parser/dist-cjs/index.js -var require_dist_cjs67 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/url-parser/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - parseUrl: () => parseUrl - }); - module2.exports = __toCommonJS2(src_exports); - var import_querystring_parser = require_dist_cjs66(); - var parseUrl = /* @__PURE__ */ __name((url2) => { - if (typeof url2 === "string") { - return parseUrl(new URL(url2)); +// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +var require_requestHelpers = __commonJS({ + "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getCredentials = exports2.createGetRequest = void 0; + var property_provider_1 = require_dist_cjs24(); + var protocol_http_1 = require_dist_cjs2(); + var smithy_client_1 = require_dist_cjs33(); + var util_stream_1 = require_dist_cjs22(); + function createGetRequest(url2) { + return new protocol_http_1.HttpRequest({ + protocol: url2.protocol, + hostname: url2.hostname, + port: Number(url2.port), + path: url2.pathname, + query: Array.from(url2.searchParams.entries()).reduce((acc, [k, v]) => { + acc[k] = v; + return acc; + }, {}), + fragment: url2.hash + }); + } + exports2.createGetRequest = createGetRequest; + async function getCredentials(response, logger) { + const stream = (0, util_stream_1.sdkStreamMixin)(response.body); + const str = await stream.transformToString(); + if (response.statusCode === 200) { + const parsed = JSON.parse(str); + if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") { + throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger }); + } + return { + accessKeyId: parsed.AccessKeyId, + secretAccessKey: parsed.SecretAccessKey, + sessionToken: parsed.Token, + expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration) + }; } - const { hostname, pathname, port, protocol, search } = url2; - let query; - if (search) { - query = (0, import_querystring_parser.parseQueryString)(search); + if (response.statusCode >= 400 && response.statusCode < 500) { + let parsedBody = {}; + try { + parsedBody = JSON.parse(str); + } catch (e) { + } + throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }), { + Code: parsedBody.Code, + Message: parsedBody.Message + }); } - return { - hostname, - port: port ? parseInt(port) : void 0, - protocol, - path: pathname, - query - }; - }, "parseUrl"); + throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }); + } + exports2.getCredentials = getCredentials; } }); -// ../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js -var require_dist_cjs68 = __commonJS({ - "../../../node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js"(exports2, module2) { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export2(src_exports, { - DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES, - DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT, - ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN, - ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI, - ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI, - Endpoint: () => Endpoint, - fromContainerMetadata: () => fromContainerMetadata, - fromInstanceMetadata: () => fromInstanceMetadata, - getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint, - httpRequest: () => httpRequest, - providerConfigFromInit: () => providerConfigFromInit - }); - module2.exports = __toCommonJS2(src_exports); - var import_url = require("url"); - var import_property_provider2 = require_dist_cjs63(); - var import_buffer = require("buffer"); - var import_http2 = require("http"); - function httpRequest(options) { - return new Promise((resolve, reject) => { - var _a; - const req = (0, import_http2.request)({ - method: "GET", - ...options, - // Node.js http module doesn't accept hostname with square brackets - // Refs: https://github.com/nodejs/node/issues/39738 - hostname: (_a = options.hostname) == null ? void 0 : _a.replace(/^\[(.+)\]$/, "$1") - }); - req.on("error", (err) => { - reject(Object.assign(new import_property_provider2.ProviderError("Unable to connect to instance metadata service"), err)); - req.destroy(); - }); - req.on("timeout", () => { - reject(new import_property_provider2.ProviderError("TimeoutError from instance metadata service")); - req.destroy(); - }); - req.on("response", (res) => { - const { statusCode = 400 } = res; - if (statusCode < 200 || 300 <= statusCode) { - reject( - Object.assign(new import_property_provider2.ProviderError("Error response received from instance metadata service"), { statusCode }) - ); - req.destroy(); +// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +var require_retry_wrapper = __commonJS({ + "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.retryWrapper = void 0; + var retryWrapper = (toRetry, maxRetries, delayMs) => { + return async () => { + for (let i = 0; i < maxRetries; ++i) { + try { + return await toRetry(); + } catch (e) { + await new Promise((resolve) => setTimeout(resolve, delayMs)); } - const chunks = []; - res.on("data", (chunk) => { - chunks.push(chunk); - }); - res.on("end", () => { - resolve(import_buffer.Buffer.concat(chunks)); - req.destroy(); - }); - }); - req.end(); - }); - } - __name(httpRequest, "httpRequest"); - var isImdsCredentials = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string", "isImdsCredentials"); - var fromImdsCredentials = /* @__PURE__ */ __name((creds) => ({ - accessKeyId: creds.AccessKeyId, - secretAccessKey: creds.SecretAccessKey, - sessionToken: creds.Token, - expiration: new Date(creds.Expiration), - ...creds.AccountId && { accountId: creds.AccountId } - }), "fromImdsCredentials"); - var DEFAULT_TIMEOUT = 1e3; - var DEFAULT_MAX_RETRIES = 0; - var providerConfigFromInit = /* @__PURE__ */ __name(({ - maxRetries = DEFAULT_MAX_RETRIES, - timeout = DEFAULT_TIMEOUT - }) => ({ maxRetries, timeout }), "providerConfigFromInit"); - var retry = /* @__PURE__ */ __name((toRetry, maxRetries) => { - let promise = toRetry(); - for (let i = 0; i < maxRetries; i++) { - promise = promise.catch(toRetry); - } - return promise; - }, "retry"); - var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; - var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; - var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; - var fromContainerMetadata = /* @__PURE__ */ __name((init = {}) => { - const { timeout, maxRetries } = providerConfigFromInit(init); - return () => retry(async () => { - const requestOptions = await getCmdsUri({ logger: init.logger }); - const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); - if (!isImdsCredentials(credsResponse)) { - throw new import_property_provider2.CredentialsProviderError("Invalid response received from instance metadata service.", { - logger: init.logger - }); } - return fromImdsCredentials(credsResponse); - }, maxRetries); - }, "fromContainerMetadata"); - var requestFromEcsImds = /* @__PURE__ */ __name(async (timeout, options) => { - if (process.env[ENV_CMDS_AUTH_TOKEN]) { - options.headers = { - ...options.headers, - Authorization: process.env[ENV_CMDS_AUTH_TOKEN] - }; + return await toRetry(); + }; + }; + exports2.retryWrapper = retryWrapper; + } +}); + +// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +var require_fromHttp = __commonJS({ + "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fromHttp = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var node_http_handler_1 = require_dist_cjs19(); + var property_provider_1 = require_dist_cjs24(); + var promises_1 = tslib_1.__importDefault(require("fs/promises")); + var checkUrl_1 = require_checkUrl(); + var requestHelpers_1 = require_requestHelpers(); + var retry_wrapper_1 = require_retry_wrapper(); + var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; + var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2"; + var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; + var AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"; + var AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; + var fromHttp = (options = {}) => { + options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp"); + let host; + const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI]; + const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI]; + const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN]; + const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE]; + const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger ? console.warn : options.logger.warn; + if (relative && full) { + warn("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."); + warn("awsContainerCredentialsFullUri will take precedence."); } - const buffer = await httpRequest({ - ...options, - timeout + if (token && tokenFile) { + warn("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."); + warn("awsContainerAuthorizationToken will take precedence."); + } + if (full) { + host = full; + } else if (relative) { + host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`; + } else { + throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided. +Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger }); + } + const url2 = new URL(host); + (0, checkUrl_1.checkUrl)(url2, options.logger); + const requestHandler = new node_http_handler_1.NodeHttpHandler({ + requestTimeout: options.timeout ?? 1e3, + connectionTimeout: options.timeout ?? 1e3 }); - return buffer.toString(); - }, "requestFromEcsImds"); - var CMDS_IP = "169.254.170.2"; - var GREENGRASS_HOSTS = { - localhost: true, - "127.0.0.1": true + return (0, retry_wrapper_1.retryWrapper)(async () => { + const request2 = (0, requestHelpers_1.createGetRequest)(url2); + if (token) { + request2.headers.Authorization = token; + } else if (tokenFile) { + request2.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString(); + } + try { + const result = await requestHandler.handle(request2); + return (0, requestHelpers_1.getCredentials)(result.response); + } catch (e) { + throw new property_provider_1.CredentialsProviderError(String(e), { logger: options.logger }); + } + }, options.maxRetries ?? 3, options.timeout ?? 1e3); }; - var GREENGRASS_PROTOCOLS = { - "http:": true, - "https:": true + exports2.fromHttp = fromHttp; + } +}); + +// ../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +var require_dist_cjs38 = __commonJS({ + "../../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fromHttp = void 0; + var fromHttp_1 = require_fromHttp(); + Object.defineProperty(exports2, "fromHttp", { enumerable: true, get: function() { + return fromHttp_1.fromHttp; + } }); + } +}); + +// ../../../node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js +var require_httpAuthSchemeProvider2 = __commonJS({ + "../../../node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.resolveHttpAuthSchemeConfig = exports2.defaultSSOHttpAuthSchemeProvider = exports2.defaultSSOHttpAuthSchemeParametersProvider = void 0; + var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var util_middleware_1 = require_dist_cjs10(); + var defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => { + return { + operation: (0, util_middleware_1.getSmithyContext)(context).operation, + region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })() + }; }; - var getCmdsUri = /* @__PURE__ */ __name(async ({ logger }) => { - if (process.env[ENV_CMDS_RELATIVE_URI]) { - return { - hostname: CMDS_IP, - path: process.env[ENV_CMDS_RELATIVE_URI] - }; - } - if (process.env[ENV_CMDS_FULL_URI]) { - const parsed = (0, import_url.parse)(process.env[ENV_CMDS_FULL_URI]); - if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { - throw new import_property_provider2.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, { - tryNextLink: false, - logger - }); + exports2.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider; + function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "awsssoportal", + region: authParameters.region + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context + } + }) + }; + } + function createSmithyApiNoAuthHttpAuthOption(authParameters) { + return { + schemeId: "smithy.api#noAuth" + }; + } + var defaultSSOHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "GetRoleCredentials": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; } - if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { - throw new import_property_provider2.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, { - tryNextLink: false, - logger - }); + case "ListAccountRoles": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + case "ListAccounts": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + case "Logout": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); } - return { - ...parsed, - port: parsed.port ? parseInt(parsed.port, 10) : void 0 - }; } - throw new import_property_provider2.CredentialsProviderError( - `The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, - { - tryNextLink: false, - logger + return options; + }; + exports2.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider; + var resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return { + ...config_0 + }; + }; + exports2.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; + } +}); + +// ../../../node_modules/@aws-sdk/client-sso/package.json +var require_package2 = __commonJS({ + "../../../node_modules/@aws-sdk/client-sso/package.json"(exports2, module2) { + module2.exports = { + name: "@aws-sdk/client-sso", + description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", + version: "3.632.0", + scripts: { + build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "node ../../scripts/compilation/inline client-sso", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + clean: "rimraf ./dist-* && rimraf *.tsbuildinfo", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo sso" + }, + main: "./dist-cjs/index.js", + types: "./dist-types/index.d.ts", + module: "./dist-es/index.js", + sideEffects: false, + dependencies: { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.629.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.632.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.632.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.2", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.14", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.12", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.14", + "@smithy/util-defaults-mode-node": "^3.0.14", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + tslib: "^2.6.2" + }, + devDependencies: { + "@tsconfig/node16": "16.1.3", + "@types/node": "^16.18.96", + concurrently: "7.0.0", + "downlevel-dts": "0.10.1", + rimraf: "3.0.2", + typescript: "~4.9.5" + }, + engines: { + node: ">=16.0.0" + }, + typesVersions: { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] } - ); - }, "getCmdsUri"); - var _InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError2 extends import_property_provider2.CredentialsProviderError { - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - this.name = "InstanceMetadataV1FallbackError"; - Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError2.prototype); + }, + files: [ + "dist-*/**" + ], + author: { + name: "AWS SDK for JavaScript Team", + url: "https://aws.amazon.com/javascript/" + }, + license: "Apache-2.0", + browser: { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso", + repository: { + type: "git", + url: "https://github.com/aws/aws-sdk-js-v3.git", + directory: "clients/client-sso" } }; - __name(_InstanceMetadataV1FallbackError, "InstanceMetadataV1FallbackError"); - var InstanceMetadataV1FallbackError = _InstanceMetadataV1FallbackError; - var import_node_config_provider = require_dist_cjs65(); - var import_url_parser = require_dist_cjs67(); - var Endpoint = /* @__PURE__ */ ((Endpoint2) => { - Endpoint2["IPv4"] = "http://169.254.169.254"; - Endpoint2["IPv6"] = "http://[fd00:ec2::254]"; - return Endpoint2; - })(Endpoint || {}); - var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; - var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; - var ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME], - configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], - default: void 0 + } +}); + +// ../../../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +var require_dist_cjs39 = __commonJS({ + "../../../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js"(exports2, module2) { + "use strict"; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); }; - var EndpointMode = /* @__PURE__ */ ((EndpointMode2) => { - EndpointMode2["IPv4"] = "IPv4"; - EndpointMode2["IPv6"] = "IPv6"; - return EndpointMode2; - })(EndpointMode || {}); - var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; - var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; - var ENDPOINT_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME], - configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], - default: "IPv4" - /* IPv4 */ + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; }; - var getInstanceMetadataEndpoint = /* @__PURE__ */ __name(async () => (0, import_url_parser.parseUrl)(await getFromEndpointConfig() || await getFromEndpointModeConfig()), "getInstanceMetadataEndpoint"); - var getFromEndpointConfig = /* @__PURE__ */ __name(async () => (0, import_node_config_provider.loadConfig)(ENDPOINT_CONFIG_OPTIONS)(), "getFromEndpointConfig"); - var getFromEndpointModeConfig = /* @__PURE__ */ __name(async () => { - const endpointMode = await (0, import_node_config_provider.loadConfig)(ENDPOINT_MODE_CONFIG_OPTIONS)(); - switch (endpointMode) { - case "IPv4": - return "http://169.254.169.254"; - case "IPv6": - return "http://[fd00:ec2::254]"; - default: - throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`); + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME, + UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME, + crtAvailability: () => crtAvailability, + defaultUserAgent: () => defaultUserAgent + }); + module2.exports = __toCommonJS2(src_exports); + var import_node_config_provider = require_dist_cjs26(); + var import_os = require("os"); + var import_process = require("process"); + var crtAvailability = { + isCrtAvailable: false + }; + var isCrtAvailable = /* @__PURE__ */ __name(() => { + if (crtAvailability.isCrtAvailable) { + return ["md/crt-avail"]; } - }, "getFromEndpointModeConfig"); - var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; - var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; - var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; - var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger) => { - const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); - const newExpiration = new Date(Date.now() + refreshInterval * 1e3); - logger.warn( - `Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}. -For more information, please visit: ` + STATIC_STABILITY_DOC_URL - ); - const originalExpiration = credentials.originalExpiration ?? credentials.expiration; - return { - ...credentials, - ...originalExpiration ? { originalExpiration } : {}, - expiration: newExpiration - }; - }, "getExtendedInstanceMetadataCredentials"); - var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => { - const logger = (options == null ? void 0 : options.logger) || console; - let pastCredentials; - return async () => { - let credentials; - try { - credentials = await provider(); - if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { - credentials = getExtendedInstanceMetadataCredentials(credentials, logger); - } - } catch (e) { - if (pastCredentials) { - logger.warn("Credential renew failed: ", e); - credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger); - } else { - throw e; - } - } - pastCredentials = credentials; - return credentials; - }; - }, "staticStabilityProvider"); - var IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; - var IMDS_TOKEN_PATH = "/latest/api/token"; - var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; - var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; - var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; - var fromInstanceMetadata = /* @__PURE__ */ __name((init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }), "fromInstanceMetadata"); - var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => { - let disableFetchToken = false; - const { logger, profile } = init; - const { timeout, maxRetries } = providerConfigFromInit(init); - const getCredentials = /* @__PURE__ */ __name(async (maxRetries2, options) => { - var _a; - const isImdsV1Fallback = disableFetchToken || ((_a = options.headers) == null ? void 0 : _a[X_AWS_EC2_METADATA_TOKEN]) == null; - if (isImdsV1Fallback) { - let fallbackBlockedFromProfile = false; - let fallbackBlockedFromProcessEnv = false; - const configValue = await (0, import_node_config_provider.loadConfig)( - { - environmentVariableSelector: (env) => { - const envValue = env[AWS_EC2_METADATA_V1_DISABLED]; - fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; - if (envValue === void 0) { - throw new import_property_provider2.CredentialsProviderError( - `${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, - { logger: init.logger } - ); - } - return fallbackBlockedFromProcessEnv; - }, - configFileSelector: (profile2) => { - const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; - fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; - return fallbackBlockedFromProfile; - }, - default: false - }, - { - profile - } - )(); - if (init.ec2MetadataV1Disabled || configValue) { - const causes = []; - if (init.ec2MetadataV1Disabled) - causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); - if (fallbackBlockedFromProfile) - causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); - if (fallbackBlockedFromProcessEnv) - causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); - throw new InstanceMetadataV1FallbackError( - `AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join( - ", " - )}].` - ); - } - } - const imdsProfile = (await retry(async () => { - let profile2; - try { - profile2 = await getProfile(options); - } catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return profile2; - }, maxRetries2)).trim(); - return retry(async () => { - let creds; - try { - creds = await getCredentialsFromProfile(imdsProfile, options, init); - } catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return creds; - }, maxRetries2); - }, "getCredentials"); - return async () => { - const endpoint = await getInstanceMetadataEndpoint(); - if (disableFetchToken) { - logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); - return getCredentials(maxRetries, { ...endpoint, timeout }); - } else { - let token; - try { - token = (await getMetadataToken({ ...endpoint, timeout })).toString(); - } catch (error) { - if ((error == null ? void 0 : error.statusCode) === 400) { - throw Object.assign(error, { - message: "EC2 Metadata token request returned error" - }); - } else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { - disableFetchToken = true; - } - logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); - return getCredentials(maxRetries, { ...endpoint, timeout }); - } - return getCredentials(maxRetries, { - ...endpoint, - headers: { - [X_AWS_EC2_METADATA_TOKEN]: token - }, - timeout - }); + return null; + }, "isCrtAvailable"); + var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; + var UA_APP_ID_INI_NAME = "sdk-ua-app-id"; + var defaultUserAgent = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => { + const sections = [ + // sdk-metadata + ["aws-sdk-js", clientVersion], + // ua-metadata + ["ua", "2.0"], + // os-metadata + [`os/${(0, import_os.platform)()}`, (0, import_os.release)()], + // language-metadata + // ECMAScript edition doesn't matter in JS, so no version needed. + ["lang/js"], + ["md/nodejs", `${import_process.versions.node}`] + ]; + const crtAvailable = isCrtAvailable(); + if (crtAvailable) { + sections.push(crtAvailable); + } + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + if (import_process.env.AWS_EXECUTION_ENV) { + sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]); + } + const appIdPromise = (0, import_node_config_provider.loadConfig)({ + environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME], + default: void 0 + })(); + let resolvedUserAgent = void 0; + return async () => { + if (!resolvedUserAgent) { + const appId = await appIdPromise; + resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; } + return resolvedUserAgent; }; - }, "getInstanceMetadataProvider"); - var getMetadataToken = /* @__PURE__ */ __name(async (options) => httpRequest({ - ...options, - path: IMDS_TOKEN_PATH, - method: "PUT", - headers: { - "x-aws-ec2-metadata-token-ttl-seconds": "21600" + }, "defaultUserAgent"); + } +}); + +// ../../../node_modules/@smithy/hash-node/dist-cjs/index.js +var require_dist_cjs40 = __commonJS({ + "../../../node_modules/@smithy/hash-node/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } - }), "getMetadataToken"); - var getProfile = /* @__PURE__ */ __name(async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(), "getProfile"); - var getCredentialsFromProfile = /* @__PURE__ */ __name(async (profile, options, init) => { - const credentialsResponse = JSON.parse( - (await httpRequest({ - ...options, - path: IMDS_PATH + profile - })).toString() - ); - if (!isImdsCredentials(credentialsResponse)) { - throw new import_property_provider2.CredentialsProviderError("Invalid response received from instance metadata service.", { - logger: init.logger - }); + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + Hash: () => Hash + }); + module2.exports = __toCommonJS2(src_exports); + var import_util_buffer_from = require_dist_cjs14(); + var import_util_utf8 = require_dist_cjs15(); + var import_buffer = require("buffer"); + var import_crypto5 = require("crypto"); + var _Hash = class _Hash { + constructor(algorithmIdentifier, secret) { + this.algorithmIdentifier = algorithmIdentifier; + this.secret = secret; + this.reset(); } - return fromImdsCredentials(credentialsResponse); - }, "getCredentialsFromProfile"); + update(toHash, encoding) { + this.hash.update((0, import_util_utf8.toUint8Array)(castSourceData(toHash, encoding))); + } + digest() { + return Promise.resolve(this.hash.digest()); + } + reset() { + this.hash = this.secret ? (0, import_crypto5.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) : (0, import_crypto5.createHash)(this.algorithmIdentifier); + } + }; + __name(_Hash, "Hash"); + var Hash = _Hash; + function castSourceData(toCast, encoding) { + if (import_buffer.Buffer.isBuffer(toCast)) { + return toCast; + } + if (typeof toCast === "string") { + return (0, import_util_buffer_from.fromString)(toCast, encoding); + } + if (ArrayBuffer.isView(toCast)) { + return (0, import_util_buffer_from.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength); + } + return (0, import_util_buffer_from.fromArrayBuffer)(toCast); + } + __name(castSourceData, "castSourceData"); + } +}); + +// ../../../node_modules/@smithy/util-body-length-node/dist-cjs/index.js +var require_dist_cjs41 = __commonJS({ + "../../../node_modules/@smithy/util-body-length-node/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + calculateBodyLength: () => calculateBodyLength + }); + module2.exports = __toCommonJS2(src_exports); + var import_fs = require("fs"); + var calculateBodyLength = /* @__PURE__ */ __name((body) => { + if (!body) { + return 0; + } + if (typeof body === "string") { + return Buffer.byteLength(body); + } else if (typeof body.byteLength === "number") { + return body.byteLength; + } else if (typeof body.size === "number") { + return body.size; + } else if (typeof body.start === "number" && typeof body.end === "number") { + return body.end + 1 - body.start; + } else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { + return (0, import_fs.lstatSync)(body.path).size; + } else if (typeof body.fd === "number") { + return (0, import_fs.fstatSync)(body.fd).size; + } + throw new Error(`Body Length computation failed for ${body}`); + }, "calculateBodyLength"); + } +}); + +// ../../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js +var require_ruleset = __commonJS({ + "../../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ruleSet = void 0; + var u = "required"; + var v = "fn"; + var w = "argv"; + var x = "ref"; + var a = true; + var b = "isSet"; + var c = "booleanEquals"; + var d = "error"; + var e = "endpoint"; + var f = "tree"; + var g = "PartitionResult"; + var h = "getAttr"; + var i = { [u]: false, "type": "String" }; + var j = { [u]: true, "default": false, "type": "Boolean" }; + var k = { [x]: "Endpoint" }; + var l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }; + var m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }; + var n = {}; + var o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }; + var p = { [x]: g }; + var q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }; + var r = [l]; + var s = [m]; + var t = [{ [x]: "Region" }]; + var _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; + exports2.ruleSet = _data; + } +}); + +// ../../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js +var require_endpointResolver = __commonJS({ + "../../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.defaultEndpointResolver = void 0; + var util_endpoints_1 = require_dist_cjs7(); + var util_endpoints_2 = require_dist_cjs6(); + var ruleset_1 = require_ruleset(); + var defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams, + logger: context.logger + }); + }; + exports2.defaultEndpointResolver = defaultEndpointResolver; + util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; + } +}); + +// ../../../node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js +var require_runtimeConfig_shared = __commonJS({ + "../../../node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getRuntimeConfig = void 0; + var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var core_2 = (init_dist_es(), __toCommonJS(dist_es_exports)); + var smithy_client_1 = require_dist_cjs33(); + var url_parser_1 = require_dist_cjs28(); + var util_base64_1 = require_dist_cjs16(); + var util_utf8_1 = require_dist_cjs15(); + var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider2(); + var endpointResolver_1 = require_endpointResolver(); + var getRuntimeConfig = (config) => { + return { + apiVersion: "2019-06-10", + base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, + base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new core_1.AwsSdkSigV4Signer() + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new core_2.NoAuthSigner() + } + ], + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + serviceId: config?.serviceId ?? "SSO", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8 + }; + }; + exports2.getRuntimeConfig = getRuntimeConfig; } }); // ../../../node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js -var require_dist_cjs69 = __commonJS({ +var require_dist_cjs42 = __commonJS({ "../../../node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js"(exports2, module2) { var __create2 = Object.create; var __defProp2 = Object.defineProperty; @@ -18005,9 +13345,9 @@ var require_dist_cjs69 = __commonJS({ resolveDefaultsModeConfig: () => resolveDefaultsModeConfig }); module2.exports = __toCommonJS2(src_exports); - var import_config_resolver = require_dist_cjs62(); - var import_node_config_provider = require_dist_cjs65(); - var import_property_provider2 = require_dist_cjs63(); + var import_config_resolver = require_dist_cjs11(); + var import_node_config_provider = require_dist_cjs26(); + var import_property_provider2 = require_dist_cjs24(); var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; var AWS_REGION_ENV = "AWS_REGION"; var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; @@ -18068,7 +13408,7 @@ var require_dist_cjs69 = __commonJS({ } if (!process.env[ENV_IMDS_DISABLED]) { try { - const { getInstanceMetadataEndpoint, httpRequest } = await Promise.resolve().then(() => __toESM2(require_dist_cjs68())); + const { getInstanceMetadataEndpoint, httpRequest } = await Promise.resolve().then(() => __toESM2(require_dist_cjs37())); const endpoint = await getInstanceMetadataEndpoint(); return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString(); } catch (e) { @@ -18087,18 +13427,18 @@ var require_runtimeConfig = __commonJS({ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package2()); var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); - var util_user_agent_node_1 = require_dist_cjs56(); + var util_user_agent_node_1 = require_dist_cjs39(); var config_resolver_1 = require_dist_cjs11(); - var hash_node_1 = require_dist_cjs57(); - var middleware_retry_1 = require_dist_cjs38(); - var node_config_provider_1 = require_dist_cjs42(); - var node_http_handler_1 = require_dist_cjs51(); - var util_body_length_node_1 = require_dist_cjs58(); - var util_retry_1 = require_dist_cjs60(); + var hash_node_1 = require_dist_cjs40(); + var middleware_retry_1 = require_dist_cjs34(); + var node_config_provider_1 = require_dist_cjs26(); + var node_http_handler_1 = require_dist_cjs19(); + var util_body_length_node_1 = require_dist_cjs41(); + var util_retry_1 = require_dist_cjs31(); var runtimeConfig_shared_1 = require_runtimeConfig_shared(); - var smithy_client_1 = require_dist_cjs37(); - var util_defaults_mode_node_1 = require_dist_cjs69(); - var smithy_client_2 = require_dist_cjs37(); + var smithy_client_1 = require_dist_cjs33(); + var util_defaults_mode_node_1 = require_dist_cjs42(); + var smithy_client_2 = require_dist_cjs33(); var getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -18130,7 +13470,7 @@ var require_runtimeConfig = __commonJS({ }); // ../../../node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js -var require_dist_cjs70 = __commonJS({ +var require_dist_cjs43 = __commonJS({ "../../../node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js"(exports2, module2) { "use strict"; var __defProp2 = Object.defineProperty; @@ -18228,7 +13568,7 @@ var require_dist_cjs70 = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sso/dist-cjs/index.js -var require_dist_cjs71 = __commonJS({ +var require_dist_cjs44 = __commonJS({ "../../../node_modules/@aws-sdk/client-sso/dist-cjs/index.js"(exports2, module2) { "use strict"; var __defProp2 = Object.defineProperty; @@ -18268,7 +13608,7 @@ var require_dist_cjs71 = __commonJS({ SSOServiceException: () => SSOServiceException, TooManyRequestsException: () => TooManyRequestsException, UnauthorizedException: () => UnauthorizedException, - __Client: () => import_smithy_client5.Client, + __Client: () => import_smithy_client4.Client, paginateListAccountRoles: () => paginateListAccountRoles, paginateListAccounts: () => paginateListAccounts }); @@ -18279,9 +13619,9 @@ var require_dist_cjs71 = __commonJS({ var import_middleware_user_agent = require_dist_cjs8(); var import_config_resolver = require_dist_cjs11(); var import_core3 = (init_dist_es(), __toCommonJS(dist_es_exports)); - var import_middleware_content_length = require_dist_cjs39(); - var import_middleware_endpoint2 = require_dist_cjs46(); - var import_middleware_retry2 = require_dist_cjs38(); + var import_middleware_content_length = require_dist_cjs23(); + var import_middleware_endpoint = require_dist_cjs29(); + var import_middleware_retry = require_dist_cjs34(); var import_httpAuthSchemeProvider = require_httpAuthSchemeProvider2(); var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => { return { @@ -18298,9 +13638,9 @@ var require_dist_cjs71 = __commonJS({ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; var import_runtimeConfig = require_runtimeConfig(); - var import_region_config_resolver = require_dist_cjs70(); + var import_region_config_resolver = require_dist_cjs43(); var import_protocol_http8 = require_dist_cjs2(); - var import_smithy_client5 = require_dist_cjs37(); + var import_smithy_client4 = require_dist_cjs33(); var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; @@ -18342,7 +13682,7 @@ var require_dist_cjs71 = __commonJS({ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { const extensionConfiguration = { ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, import_smithy_client5.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_smithy_client4.getDefaultExtensionConfiguration)(runtimeConfig)), ...asPartial((0, import_protocol_http8.getHttpHandlerExtensionConfiguration)(runtimeConfig)), ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)) }; @@ -18350,26 +13690,26 @@ var require_dist_cjs71 = __commonJS({ return { ...runtimeConfig, ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), - ...(0, import_smithy_client5.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, import_smithy_client4.resolveDefaultRuntimeConfig)(extensionConfiguration), ...(0, import_protocol_http8.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), ...resolveHttpAuthRuntimeConfig(extensionConfiguration) }; }, "resolveRuntimeExtensions"); - var _SSOClient = class _SSOClient extends import_smithy_client5.Client { + var _SSOClient = class _SSOClient extends import_smithy_client4.Client { constructor(...[configuration]) { const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {}); const _config_1 = resolveClientEndpointParameters(_config_0); const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1); - const _config_3 = (0, import_middleware_retry2.resolveRetryConfig)(_config_2); + const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2); const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3); const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, import_middleware_endpoint2.resolveEndpointConfig)(_config_5); + const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5); const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6); const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []); super(_config_8); this.config = _config_8; this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); - this.middlewareStack.use((0, import_middleware_retry2.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); @@ -18395,8 +13735,8 @@ var require_dist_cjs71 = __commonJS({ }; __name(_SSOClient, "SSOClient"); var SSOClient = _SSOClient; - var import_middleware_serde2 = require_dist_cjs45(); - var _SSOServiceException = class _SSOServiceException2 extends import_smithy_client5.ServiceException { + var import_middleware_serde2 = require_dist_cjs12(); + var _SSOServiceException = class _SSOServiceException2 extends import_smithy_client4.ServiceException { /** * @internal */ @@ -18477,12 +13817,12 @@ var require_dist_cjs71 = __commonJS({ var UnauthorizedException = _UnauthorizedException; var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.accessToken && { accessToken: import_smithy_client5.SENSITIVE_STRING } + ...obj.accessToken && { accessToken: import_smithy_client4.SENSITIVE_STRING } }), "GetRoleCredentialsRequestFilterSensitiveLog"); var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.secretAccessKey && { secretAccessKey: import_smithy_client5.SENSITIVE_STRING }, - ...obj.sessionToken && { sessionToken: import_smithy_client5.SENSITIVE_STRING } + ...obj.secretAccessKey && { secretAccessKey: import_smithy_client4.SENSITIVE_STRING }, + ...obj.sessionToken && { sessionToken: import_smithy_client4.SENSITIVE_STRING } }), "RoleCredentialsFilterSensitiveLog"); var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, @@ -18490,26 +13830,26 @@ var require_dist_cjs71 = __commonJS({ }), "GetRoleCredentialsResponseFilterSensitiveLog"); var ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.accessToken && { accessToken: import_smithy_client5.SENSITIVE_STRING } + ...obj.accessToken && { accessToken: import_smithy_client4.SENSITIVE_STRING } }), "ListAccountRolesRequestFilterSensitiveLog"); var ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.accessToken && { accessToken: import_smithy_client5.SENSITIVE_STRING } + ...obj.accessToken && { accessToken: import_smithy_client4.SENSITIVE_STRING } }), "ListAccountsRequestFilterSensitiveLog"); var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.accessToken && { accessToken: import_smithy_client5.SENSITIVE_STRING } + ...obj.accessToken && { accessToken: import_smithy_client4.SENSITIVE_STRING } }), "LogoutRequestFilterSensitiveLog"); var import_core22 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => { const b = (0, import_core3.requestBuilder)(input, context); - const headers = (0, import_smithy_client5.map)({}, isSerializableHeaderValue, { + const headers = (0, import_smithy_client4.map)({}, isSerializableHeaderValue, { [_xasbt]: input[_aT] }); b.bp("/federation/credentials"); - const query = (0, import_smithy_client5.map)({ - [_rn]: [, (0, import_smithy_client5.expectNonNull)(input[_rN], `roleName`)], - [_ai]: [, (0, import_smithy_client5.expectNonNull)(input[_aI], `accountId`)] + const query = (0, import_smithy_client4.map)({ + [_rn]: [, (0, import_smithy_client4.expectNonNull)(input[_rN], `roleName`)], + [_ai]: [, (0, import_smithy_client4.expectNonNull)(input[_aI], `accountId`)] }); let body; b.m("GET").h(headers).q(query).b(body); @@ -18517,14 +13857,14 @@ var require_dist_cjs71 = __commonJS({ }, "se_GetRoleCredentialsCommand"); var se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context) => { const b = (0, import_core3.requestBuilder)(input, context); - const headers = (0, import_smithy_client5.map)({}, isSerializableHeaderValue, { + const headers = (0, import_smithy_client4.map)({}, isSerializableHeaderValue, { [_xasbt]: input[_aT] }); b.bp("/assignment/roles"); - const query = (0, import_smithy_client5.map)({ + const query = (0, import_smithy_client4.map)({ [_nt]: [, input[_nT]], [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()], - [_ai]: [, (0, import_smithy_client5.expectNonNull)(input[_aI], `accountId`)] + [_ai]: [, (0, import_smithy_client4.expectNonNull)(input[_aI], `accountId`)] }); let body; b.m("GET").h(headers).q(query).b(body); @@ -18532,11 +13872,11 @@ var require_dist_cjs71 = __commonJS({ }, "se_ListAccountRolesCommand"); var se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context) => { const b = (0, import_core3.requestBuilder)(input, context); - const headers = (0, import_smithy_client5.map)({}, isSerializableHeaderValue, { + const headers = (0, import_smithy_client4.map)({}, isSerializableHeaderValue, { [_xasbt]: input[_aT] }); b.bp("/assignment/accounts"); - const query = (0, import_smithy_client5.map)({ + const query = (0, import_smithy_client4.map)({ [_nt]: [, input[_nT]], [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()] }); @@ -18546,7 +13886,7 @@ var require_dist_cjs71 = __commonJS({ }, "se_ListAccountsCommand"); var se_LogoutCommand = /* @__PURE__ */ __name(async (input, context) => { const b = (0, import_core3.requestBuilder)(input, context); - const headers = (0, import_smithy_client5.map)({}, isSerializableHeaderValue, { + const headers = (0, import_smithy_client4.map)({}, isSerializableHeaderValue, { [_xasbt]: input[_aT] }); b.bp("/logout"); @@ -18558,12 +13898,12 @@ var require_dist_cjs71 = __commonJS({ if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } - const contents = (0, import_smithy_client5.map)({ + const contents = (0, import_smithy_client4.map)({ $metadata: deserializeMetadata(output) }); - const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); - const doc = (0, import_smithy_client5.take)(data, { - roleCredentials: import_smithy_client5._json + const data = (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); + const doc = (0, import_smithy_client4.take)(data, { + roleCredentials: import_smithy_client4._json }); Object.assign(contents, doc); return contents; @@ -18572,13 +13912,13 @@ var require_dist_cjs71 = __commonJS({ if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } - const contents = (0, import_smithy_client5.map)({ + const contents = (0, import_smithy_client4.map)({ $metadata: deserializeMetadata(output) }); - const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); - const doc = (0, import_smithy_client5.take)(data, { - nextToken: import_smithy_client5.expectString, - roleList: import_smithy_client5._json + const data = (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); + const doc = (0, import_smithy_client4.take)(data, { + nextToken: import_smithy_client4.expectString, + roleList: import_smithy_client4._json }); Object.assign(contents, doc); return contents; @@ -18587,13 +13927,13 @@ var require_dist_cjs71 = __commonJS({ if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } - const contents = (0, import_smithy_client5.map)({ + const contents = (0, import_smithy_client4.map)({ $metadata: deserializeMetadata(output) }); - const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); - const doc = (0, import_smithy_client5.take)(data, { - accountList: import_smithy_client5._json, - nextToken: import_smithy_client5.expectString + const data = (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); + const doc = (0, import_smithy_client4.take)(data, { + accountList: import_smithy_client4._json, + nextToken: import_smithy_client4.expectString }); Object.assign(contents, doc); return contents; @@ -18602,10 +13942,10 @@ var require_dist_cjs71 = __commonJS({ if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } - const contents = (0, import_smithy_client5.map)({ + const contents = (0, import_smithy_client4.map)({ $metadata: deserializeMetadata(output) }); - await (0, import_smithy_client5.collectBody)(output.body, context); + await (0, import_smithy_client4.collectBody)(output.body, context); return contents; }, "de_LogoutCommand"); var de_CommandError = /* @__PURE__ */ __name(async (output, context) => { @@ -18636,58 +13976,58 @@ var require_dist_cjs71 = __commonJS({ }); } }, "de_CommandError"); - var throwDefaultError = (0, import_smithy_client5.withBaseException)(SSOServiceException); + var throwDefaultError = (0, import_smithy_client4.withBaseException)(SSOServiceException); var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - message: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + message: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InvalidRequestException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InvalidRequestExceptionRes"); var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - message: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + message: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new ResourceNotFoundException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_ResourceNotFoundExceptionRes"); var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - message: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + message: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new TooManyRequestsException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_TooManyRequestsExceptionRes"); var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - message: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + message: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new UnauthorizedException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_UnauthorizedExceptionRes"); var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ httpStatusCode: output.statusCode, @@ -18706,45 +14046,45 @@ var require_dist_cjs71 = __commonJS({ var _rN = "roleName"; var _rn = "role_name"; var _xasbt = "x-amz-sso_bearer_token"; - var _GetRoleCredentialsCommand = class _GetRoleCredentialsCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _GetRoleCredentialsCommand = class _GetRoleCredentialsCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() { }; __name(_GetRoleCredentialsCommand, "GetRoleCredentialsCommand"); var GetRoleCredentialsCommand = _GetRoleCredentialsCommand; - var _ListAccountRolesCommand = class _ListAccountRolesCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListAccountRolesCommand = class _ListAccountRolesCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").f(ListAccountRolesRequestFilterSensitiveLog, void 0).ser(se_ListAccountRolesCommand).de(de_ListAccountRolesCommand).build() { }; __name(_ListAccountRolesCommand, "ListAccountRolesCommand"); var ListAccountRolesCommand = _ListAccountRolesCommand; - var _ListAccountsCommand = class _ListAccountsCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListAccountsCommand = class _ListAccountsCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").f(ListAccountsRequestFilterSensitiveLog, void 0).ser(se_ListAccountsCommand).de(de_ListAccountsCommand).build() { }; __name(_ListAccountsCommand, "ListAccountsCommand"); var ListAccountsCommand = _ListAccountsCommand; - var _LogoutCommand = class _LogoutCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _LogoutCommand = class _LogoutCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").f(LogoutRequestFilterSensitiveLog, void 0).ser(se_LogoutCommand).de(de_LogoutCommand).build() { }; @@ -18760,7 +14100,7 @@ var require_dist_cjs71 = __commonJS({ }; __name(_SSO, "SSO"); var SSO = _SSO; - (0, import_smithy_client5.createAggregatedClient)(commands, SSO); + (0, import_smithy_client4.createAggregatedClient)(commands, SSO); var paginateListAccountRoles = (0, import_core3.createPaginator)(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults"); var paginateListAccounts = (0, import_core3.createPaginator)(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults"); } @@ -19006,10 +14346,10 @@ var require_runtimeConfig_shared2 = __commonJS({ exports2.getRuntimeConfig = void 0; var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); var core_2 = (init_dist_es(), __toCommonJS(dist_es_exports)); - var smithy_client_1 = require_dist_cjs37(); - var url_parser_1 = require_dist_cjs44(); - var util_base64_1 = require_dist_cjs29(); - var util_utf8_1 = require_dist_cjs28(); + var smithy_client_1 = require_dist_cjs33(); + var url_parser_1 = require_dist_cjs28(); + var util_base64_1 = require_dist_cjs16(); + var util_utf8_1 = require_dist_cjs15(); var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider3(); var endpointResolver_1 = require_endpointResolver2(); var getRuntimeConfig = (config) => { @@ -19053,19 +14393,19 @@ var require_runtimeConfig2 = __commonJS({ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package3()); var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); - var credential_provider_node_1 = require_dist_cjs79(); - var util_user_agent_node_1 = require_dist_cjs56(); + var credential_provider_node_1 = require_dist_cjs52(); + var util_user_agent_node_1 = require_dist_cjs39(); var config_resolver_1 = require_dist_cjs11(); - var hash_node_1 = require_dist_cjs57(); - var middleware_retry_1 = require_dist_cjs38(); - var node_config_provider_1 = require_dist_cjs42(); - var node_http_handler_1 = require_dist_cjs51(); - var util_body_length_node_1 = require_dist_cjs58(); - var util_retry_1 = require_dist_cjs60(); + var hash_node_1 = require_dist_cjs40(); + var middleware_retry_1 = require_dist_cjs34(); + var node_config_provider_1 = require_dist_cjs26(); + var node_http_handler_1 = require_dist_cjs19(); + var util_body_length_node_1 = require_dist_cjs41(); + var util_retry_1 = require_dist_cjs31(); var runtimeConfig_shared_1 = require_runtimeConfig_shared2(); - var smithy_client_1 = require_dist_cjs37(); - var util_defaults_mode_node_1 = require_dist_cjs69(); - var smithy_client_2 = require_dist_cjs37(); + var smithy_client_1 = require_dist_cjs33(); + var util_defaults_mode_node_1 = require_dist_cjs42(); + var smithy_client_2 = require_dist_cjs33(); var getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -19098,7 +14438,7 @@ var require_runtimeConfig2 = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js -var require_dist_cjs72 = __commonJS({ +var require_dist_cjs45 = __commonJS({ "../../../node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js"(exports2, module2) { "use strict"; var __defProp2 = Object.defineProperty; @@ -19148,7 +14488,7 @@ var require_dist_cjs72 = __commonJS({ StartDeviceAuthorizationRequestFilterSensitiveLog: () => StartDeviceAuthorizationRequestFilterSensitiveLog, UnauthorizedClientException: () => UnauthorizedClientException, UnsupportedGrantTypeException: () => UnsupportedGrantTypeException, - __Client: () => import_smithy_client5.Client + __Client: () => import_smithy_client4.Client }); module2.exports = __toCommonJS2(src_exports); var import_middleware_host_header = require_dist_cjs3(); @@ -19157,9 +14497,9 @@ var require_dist_cjs72 = __commonJS({ var import_middleware_user_agent = require_dist_cjs8(); var import_config_resolver = require_dist_cjs11(); var import_core3 = (init_dist_es(), __toCommonJS(dist_es_exports)); - var import_middleware_content_length = require_dist_cjs39(); - var import_middleware_endpoint2 = require_dist_cjs46(); - var import_middleware_retry2 = require_dist_cjs38(); + var import_middleware_content_length = require_dist_cjs23(); + var import_middleware_endpoint = require_dist_cjs29(); + var import_middleware_retry = require_dist_cjs34(); var import_httpAuthSchemeProvider = require_httpAuthSchemeProvider3(); var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => { return { @@ -19176,9 +14516,9 @@ var require_dist_cjs72 = __commonJS({ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; var import_runtimeConfig = require_runtimeConfig2(); - var import_region_config_resolver = require_dist_cjs70(); + var import_region_config_resolver = require_dist_cjs43(); var import_protocol_http8 = require_dist_cjs2(); - var import_smithy_client5 = require_dist_cjs37(); + var import_smithy_client4 = require_dist_cjs33(); var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; @@ -19220,7 +14560,7 @@ var require_dist_cjs72 = __commonJS({ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { const extensionConfiguration = { ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, import_smithy_client5.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_smithy_client4.getDefaultExtensionConfiguration)(runtimeConfig)), ...asPartial((0, import_protocol_http8.getHttpHandlerExtensionConfiguration)(runtimeConfig)), ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)) }; @@ -19228,26 +14568,26 @@ var require_dist_cjs72 = __commonJS({ return { ...runtimeConfig, ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), - ...(0, import_smithy_client5.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, import_smithy_client4.resolveDefaultRuntimeConfig)(extensionConfiguration), ...(0, import_protocol_http8.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), ...resolveHttpAuthRuntimeConfig(extensionConfiguration) }; }, "resolveRuntimeExtensions"); - var _SSOOIDCClient = class _SSOOIDCClient extends import_smithy_client5.Client { + var _SSOOIDCClient = class _SSOOIDCClient extends import_smithy_client4.Client { constructor(...[configuration]) { const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {}); const _config_1 = resolveClientEndpointParameters(_config_0); const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1); - const _config_3 = (0, import_middleware_retry2.resolveRetryConfig)(_config_2); + const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2); const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3); const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, import_middleware_endpoint2.resolveEndpointConfig)(_config_5); + const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5); const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6); const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []); super(_config_8); this.config = _config_8; this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); - this.middlewareStack.use((0, import_middleware_retry2.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); @@ -19273,8 +14613,8 @@ var require_dist_cjs72 = __commonJS({ }; __name(_SSOOIDCClient, "SSOOIDCClient"); var SSOOIDCClient = _SSOOIDCClient; - var import_middleware_serde2 = require_dist_cjs45(); - var _SSOOIDCServiceException = class _SSOOIDCServiceException2 extends import_smithy_client5.ServiceException { + var import_middleware_serde2 = require_dist_cjs12(); + var _SSOOIDCServiceException = class _SSOOIDCServiceException2 extends import_smithy_client4.ServiceException { /** * @internal */ @@ -19555,36 +14895,36 @@ var require_dist_cjs72 = __commonJS({ var InvalidRedirectUriException = _InvalidRedirectUriException; var CreateTokenRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.clientSecret && { clientSecret: import_smithy_client5.SENSITIVE_STRING }, - ...obj.refreshToken && { refreshToken: import_smithy_client5.SENSITIVE_STRING }, - ...obj.codeVerifier && { codeVerifier: import_smithy_client5.SENSITIVE_STRING } + ...obj.clientSecret && { clientSecret: import_smithy_client4.SENSITIVE_STRING }, + ...obj.refreshToken && { refreshToken: import_smithy_client4.SENSITIVE_STRING }, + ...obj.codeVerifier && { codeVerifier: import_smithy_client4.SENSITIVE_STRING } }), "CreateTokenRequestFilterSensitiveLog"); var CreateTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.accessToken && { accessToken: import_smithy_client5.SENSITIVE_STRING }, - ...obj.refreshToken && { refreshToken: import_smithy_client5.SENSITIVE_STRING }, - ...obj.idToken && { idToken: import_smithy_client5.SENSITIVE_STRING } + ...obj.accessToken && { accessToken: import_smithy_client4.SENSITIVE_STRING }, + ...obj.refreshToken && { refreshToken: import_smithy_client4.SENSITIVE_STRING }, + ...obj.idToken && { idToken: import_smithy_client4.SENSITIVE_STRING } }), "CreateTokenResponseFilterSensitiveLog"); var CreateTokenWithIAMRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.refreshToken && { refreshToken: import_smithy_client5.SENSITIVE_STRING }, - ...obj.assertion && { assertion: import_smithy_client5.SENSITIVE_STRING }, - ...obj.subjectToken && { subjectToken: import_smithy_client5.SENSITIVE_STRING }, - ...obj.codeVerifier && { codeVerifier: import_smithy_client5.SENSITIVE_STRING } + ...obj.refreshToken && { refreshToken: import_smithy_client4.SENSITIVE_STRING }, + ...obj.assertion && { assertion: import_smithy_client4.SENSITIVE_STRING }, + ...obj.subjectToken && { subjectToken: import_smithy_client4.SENSITIVE_STRING }, + ...obj.codeVerifier && { codeVerifier: import_smithy_client4.SENSITIVE_STRING } }), "CreateTokenWithIAMRequestFilterSensitiveLog"); var CreateTokenWithIAMResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.accessToken && { accessToken: import_smithy_client5.SENSITIVE_STRING }, - ...obj.refreshToken && { refreshToken: import_smithy_client5.SENSITIVE_STRING }, - ...obj.idToken && { idToken: import_smithy_client5.SENSITIVE_STRING } + ...obj.accessToken && { accessToken: import_smithy_client4.SENSITIVE_STRING }, + ...obj.refreshToken && { refreshToken: import_smithy_client4.SENSITIVE_STRING }, + ...obj.idToken && { idToken: import_smithy_client4.SENSITIVE_STRING } }), "CreateTokenWithIAMResponseFilterSensitiveLog"); var RegisterClientResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.clientSecret && { clientSecret: import_smithy_client5.SENSITIVE_STRING } + ...obj.clientSecret && { clientSecret: import_smithy_client4.SENSITIVE_STRING } }), "RegisterClientResponseFilterSensitiveLog"); var StartDeviceAuthorizationRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.clientSecret && { clientSecret: import_smithy_client5.SENSITIVE_STRING } + ...obj.clientSecret && { clientSecret: import_smithy_client4.SENSITIVE_STRING } }), "StartDeviceAuthorizationRequestFilterSensitiveLog"); var import_core22 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); var se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context) => { @@ -19595,7 +14935,7 @@ var require_dist_cjs72 = __commonJS({ b.bp("/token"); let body; body = JSON.stringify( - (0, import_smithy_client5.take)(input, { + (0, import_smithy_client4.take)(input, { clientId: [], clientSecret: [], code: [], @@ -19604,7 +14944,7 @@ var require_dist_cjs72 = __commonJS({ grantType: [], redirectUri: [], refreshToken: [], - scope: (_) => (0, import_smithy_client5._json)(_) + scope: (_) => (0, import_smithy_client4._json)(_) }) ); b.m("POST").h(headers).b(body); @@ -19616,12 +14956,12 @@ var require_dist_cjs72 = __commonJS({ "content-type": "application/json" }; b.bp("/token"); - const query = (0, import_smithy_client5.map)({ + const query = (0, import_smithy_client4.map)({ [_ai]: [, "t"] }); let body; body = JSON.stringify( - (0, import_smithy_client5.take)(input, { + (0, import_smithy_client4.take)(input, { assertion: [], clientId: [], code: [], @@ -19630,7 +14970,7 @@ var require_dist_cjs72 = __commonJS({ redirectUri: [], refreshToken: [], requestedTokenType: [], - scope: (_) => (0, import_smithy_client5._json)(_), + scope: (_) => (0, import_smithy_client4._json)(_), subjectToken: [], subjectTokenType: [] }) @@ -19646,14 +14986,14 @@ var require_dist_cjs72 = __commonJS({ b.bp("/client/register"); let body; body = JSON.stringify( - (0, import_smithy_client5.take)(input, { + (0, import_smithy_client4.take)(input, { clientName: [], clientType: [], entitledApplicationArn: [], - grantTypes: (_) => (0, import_smithy_client5._json)(_), + grantTypes: (_) => (0, import_smithy_client4._json)(_), issuerUrl: [], - redirectUris: (_) => (0, import_smithy_client5._json)(_), - scopes: (_) => (0, import_smithy_client5._json)(_) + redirectUris: (_) => (0, import_smithy_client4._json)(_), + scopes: (_) => (0, import_smithy_client4._json)(_) }) ); b.m("POST").h(headers).b(body); @@ -19667,7 +15007,7 @@ var require_dist_cjs72 = __commonJS({ b.bp("/device_authorization"); let body; body = JSON.stringify( - (0, import_smithy_client5.take)(input, { + (0, import_smithy_client4.take)(input, { clientId: [], clientSecret: [], startUrl: [] @@ -19680,16 +15020,16 @@ var require_dist_cjs72 = __commonJS({ if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } - const contents = (0, import_smithy_client5.map)({ + const contents = (0, import_smithy_client4.map)({ $metadata: deserializeMetadata(output) }); - const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); - const doc = (0, import_smithy_client5.take)(data, { - accessToken: import_smithy_client5.expectString, - expiresIn: import_smithy_client5.expectInt32, - idToken: import_smithy_client5.expectString, - refreshToken: import_smithy_client5.expectString, - tokenType: import_smithy_client5.expectString + const data = (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); + const doc = (0, import_smithy_client4.take)(data, { + accessToken: import_smithy_client4.expectString, + expiresIn: import_smithy_client4.expectInt32, + idToken: import_smithy_client4.expectString, + refreshToken: import_smithy_client4.expectString, + tokenType: import_smithy_client4.expectString }); Object.assign(contents, doc); return contents; @@ -19698,18 +15038,18 @@ var require_dist_cjs72 = __commonJS({ if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } - const contents = (0, import_smithy_client5.map)({ + const contents = (0, import_smithy_client4.map)({ $metadata: deserializeMetadata(output) }); - const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); - const doc = (0, import_smithy_client5.take)(data, { - accessToken: import_smithy_client5.expectString, - expiresIn: import_smithy_client5.expectInt32, - idToken: import_smithy_client5.expectString, - issuedTokenType: import_smithy_client5.expectString, - refreshToken: import_smithy_client5.expectString, - scope: import_smithy_client5._json, - tokenType: import_smithy_client5.expectString + const data = (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); + const doc = (0, import_smithy_client4.take)(data, { + accessToken: import_smithy_client4.expectString, + expiresIn: import_smithy_client4.expectInt32, + idToken: import_smithy_client4.expectString, + issuedTokenType: import_smithy_client4.expectString, + refreshToken: import_smithy_client4.expectString, + scope: import_smithy_client4._json, + tokenType: import_smithy_client4.expectString }); Object.assign(contents, doc); return contents; @@ -19718,17 +15058,17 @@ var require_dist_cjs72 = __commonJS({ if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } - const contents = (0, import_smithy_client5.map)({ + const contents = (0, import_smithy_client4.map)({ $metadata: deserializeMetadata(output) }); - const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); - const doc = (0, import_smithy_client5.take)(data, { - authorizationEndpoint: import_smithy_client5.expectString, - clientId: import_smithy_client5.expectString, - clientIdIssuedAt: import_smithy_client5.expectLong, - clientSecret: import_smithy_client5.expectString, - clientSecretExpiresAt: import_smithy_client5.expectLong, - tokenEndpoint: import_smithy_client5.expectString + const data = (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); + const doc = (0, import_smithy_client4.take)(data, { + authorizationEndpoint: import_smithy_client4.expectString, + clientId: import_smithy_client4.expectString, + clientIdIssuedAt: import_smithy_client4.expectLong, + clientSecret: import_smithy_client4.expectString, + clientSecretExpiresAt: import_smithy_client4.expectLong, + tokenEndpoint: import_smithy_client4.expectString }); Object.assign(contents, doc); return contents; @@ -19737,17 +15077,17 @@ var require_dist_cjs72 = __commonJS({ if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } - const contents = (0, import_smithy_client5.map)({ + const contents = (0, import_smithy_client4.map)({ $metadata: deserializeMetadata(output) }); - const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); - const doc = (0, import_smithy_client5.take)(data, { - deviceCode: import_smithy_client5.expectString, - expiresIn: import_smithy_client5.expectInt32, - interval: import_smithy_client5.expectInt32, - userCode: import_smithy_client5.expectString, - verificationUri: import_smithy_client5.expectString, - verificationUriComplete: import_smithy_client5.expectString + const data = (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.expectObject)(await (0, import_core22.parseJsonBody)(output.body, context)), "body"); + const doc = (0, import_smithy_client4.take)(data, { + deviceCode: import_smithy_client4.expectString, + expiresIn: import_smithy_client4.expectInt32, + interval: import_smithy_client4.expectInt32, + userCode: import_smithy_client4.expectString, + verificationUri: import_smithy_client4.expectString, + verificationUriComplete: import_smithy_client4.expectString }); Object.assign(contents, doc); return contents; @@ -19810,204 +15150,204 @@ var require_dist_cjs72 = __commonJS({ }); } }, "de_CommandError"); - var throwDefaultError = (0, import_smithy_client5.withBaseException)(SSOOIDCServiceException); + var throwDefaultError = (0, import_smithy_client4.withBaseException)(SSOOIDCServiceException); var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new AccessDeniedException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_AccessDeniedExceptionRes"); var de_AuthorizationPendingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new AuthorizationPendingException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_AuthorizationPendingExceptionRes"); var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new ExpiredTokenException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_ExpiredTokenExceptionRes"); var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InternalServerException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InternalServerExceptionRes"); var de_InvalidClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InvalidClientException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InvalidClientExceptionRes"); var de_InvalidClientMetadataExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InvalidClientMetadataException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InvalidClientMetadataExceptionRes"); var de_InvalidGrantExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InvalidGrantException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InvalidGrantExceptionRes"); var de_InvalidRedirectUriExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InvalidRedirectUriException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InvalidRedirectUriExceptionRes"); var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InvalidRequestException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InvalidRequestExceptionRes"); var de_InvalidRequestRegionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - endpoint: import_smithy_client5.expectString, - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString, - region: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + endpoint: import_smithy_client4.expectString, + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString, + region: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InvalidRequestRegionException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InvalidRequestRegionExceptionRes"); var de_InvalidScopeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new InvalidScopeException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_InvalidScopeExceptionRes"); var de_SlowDownExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new SlowDownException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_SlowDownExceptionRes"); var de_UnauthorizedClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new UnauthorizedClientException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_UnauthorizedClientExceptionRes"); var de_UnsupportedGrantTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const contents = (0, import_smithy_client5.map)({}); + const contents = (0, import_smithy_client4.map)({}); const data = parsedOutput.body; - const doc = (0, import_smithy_client5.take)(data, { - error: import_smithy_client5.expectString, - error_description: import_smithy_client5.expectString + const doc = (0, import_smithy_client4.take)(data, { + error: import_smithy_client4.expectString, + error_description: import_smithy_client4.expectString }); Object.assign(contents, doc); const exception = new UnsupportedGrantTypeException({ $metadata: deserializeMetadata(parsedOutput), ...contents }); - return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body); + return (0, import_smithy_client4.decorateServiceException)(exception, parsedOutput.body); }, "de_UnsupportedGrantTypeExceptionRes"); var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ httpStatusCode: output.statusCode, @@ -20016,45 +15356,45 @@ var require_dist_cjs72 = __commonJS({ cfId: output.headers["x-amz-cf-id"] }), "deserializeMetadata"); var _ai = "aws_iam"; - var _CreateTokenCommand = class _CreateTokenCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _CreateTokenCommand = class _CreateTokenCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build() { }; __name(_CreateTokenCommand, "CreateTokenCommand"); var CreateTokenCommand = _CreateTokenCommand; - var _CreateTokenWithIAMCommand = class _CreateTokenWithIAMCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _CreateTokenWithIAMCommand = class _CreateTokenWithIAMCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSSOOIDCService", "CreateTokenWithIAM", {}).n("SSOOIDCClient", "CreateTokenWithIAMCommand").f(CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog).ser(se_CreateTokenWithIAMCommand).de(de_CreateTokenWithIAMCommand).build() { }; __name(_CreateTokenWithIAMCommand, "CreateTokenWithIAMCommand"); var CreateTokenWithIAMCommand = _CreateTokenWithIAMCommand; - var _RegisterClientCommand = class _RegisterClientCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _RegisterClientCommand = class _RegisterClientCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSSOOIDCService", "RegisterClient", {}).n("SSOOIDCClient", "RegisterClientCommand").f(void 0, RegisterClientResponseFilterSensitiveLog).ser(se_RegisterClientCommand).de(de_RegisterClientCommand).build() { }; __name(_RegisterClientCommand, "RegisterClientCommand"); var RegisterClientCommand = _RegisterClientCommand; - var _StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSSOOIDCService", "StartDeviceAuthorization", {}).n("SSOOIDCClient", "StartDeviceAuthorizationCommand").f(StartDeviceAuthorizationRequestFilterSensitiveLog, void 0).ser(se_StartDeviceAuthorizationCommand).de(de_StartDeviceAuthorizationCommand).build() { }; @@ -20070,12 +15410,12 @@ var require_dist_cjs72 = __commonJS({ }; __name(_SSOOIDC, "SSOOIDC"); var SSOOIDC = _SSOOIDC; - (0, import_smithy_client5.createAggregatedClient)(commands, SSOOIDC); + (0, import_smithy_client4.createAggregatedClient)(commands, SSOOIDC); } }); // ../../../node_modules/@aws-sdk/token-providers/dist-cjs/index.js -var require_dist_cjs73 = __commonJS({ +var require_dist_cjs46 = __commonJS({ "../../../node_modules/@aws-sdk/token-providers/dist-cjs/index.js"(exports2, module2) { "use strict"; var __create2 = Object.create; @@ -20117,7 +15457,7 @@ var require_dist_cjs73 = __commonJS({ var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; var ssoOidcClientsHash = {}; var getSsoOidcClient = /* @__PURE__ */ __name(async (ssoRegion) => { - const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM2(require_dist_cjs72())); + const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM2(require_dist_cjs45())); if (ssoOidcClientsHash[ssoRegion]) { return ssoOidcClientsHash[ssoRegion]; } @@ -20126,7 +15466,7 @@ var require_dist_cjs73 = __commonJS({ return ssoOidcClient; }, "getSsoOidcClient"); var getNewSsoOidcToken = /* @__PURE__ */ __name(async (ssoToken, ssoRegion) => { - const { CreateTokenCommand } = await Promise.resolve().then(() => __toESM2(require_dist_cjs72())); + const { CreateTokenCommand } = await Promise.resolve().then(() => __toESM2(require_dist_cjs45())); const ssoOidcClient = await getSsoOidcClient(ssoRegion); return ssoOidcClient.send( new CreateTokenCommand({ @@ -20137,7 +15477,7 @@ var require_dist_cjs73 = __commonJS({ }) ); }, "getNewSsoOidcToken"); - var import_property_provider2 = require_dist_cjs40(); + var import_property_provider2 = require_dist_cjs24(); var validateTokenExpiry = /* @__PURE__ */ __name((token) => { if (token.expiration && token.expiration.getTime() < Date.now()) { throw new import_property_provider2.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false); @@ -20151,7 +15491,7 @@ var require_dist_cjs73 = __commonJS({ ); } }, "validateTokenKey"); - var import_shared_ini_file_loader = require_dist_cjs41(); + var import_shared_ini_file_loader = require_dist_cjs25(); var import_fs = require("fs"); var { writeFile } = import_fs.promises; var writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => { @@ -20255,7 +15595,7 @@ var require_dist_cjs73 = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js -var require_dist_cjs74 = __commonJS({ +var require_dist_cjs47 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js"(exports2, module2) { "use strict"; var __defProp2 = Object.defineProperty; @@ -20288,7 +15628,7 @@ var require_dist_cjs74 = __commonJS({ var init_loadSso = __esm2({ "src/loadSso.ts"() { "use strict"; - import_client_sso = require_dist_cjs71(); + import_client_sso = require_dist_cjs44(); } }); var src_exports = {}; @@ -20299,9 +15639,9 @@ var require_dist_cjs74 = __commonJS({ }); module2.exports = __toCommonJS2(src_exports); var isSsoProfile = /* @__PURE__ */ __name((arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"), "isSsoProfile"); - var import_token_providers = require_dist_cjs73(); - var import_property_provider2 = require_dist_cjs40(); - var import_shared_ini_file_loader = require_dist_cjs41(); + var import_token_providers = require_dist_cjs46(); + var import_property_provider2 = require_dist_cjs24(); + var import_shared_ini_file_loader = require_dist_cjs25(); var SHOULD_FAIL_CREDENTIAL_CHAIN = false; var resolveSSOCredentials = /* @__PURE__ */ __name(async ({ ssoStartUrl, @@ -20750,10 +16090,10 @@ var require_runtimeConfig_shared3 = __commonJS({ exports2.getRuntimeConfig = void 0; var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); var core_2 = (init_dist_es(), __toCommonJS(dist_es_exports)); - var smithy_client_1 = require_dist_cjs37(); - var url_parser_1 = require_dist_cjs44(); - var util_base64_1 = require_dist_cjs29(); - var util_utf8_1 = require_dist_cjs28(); + var smithy_client_1 = require_dist_cjs33(); + var url_parser_1 = require_dist_cjs28(); + var util_base64_1 = require_dist_cjs16(); + var util_utf8_1 = require_dist_cjs15(); var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider4(); var endpointResolver_1 = require_endpointResolver3(); var getRuntimeConfig = (config) => { @@ -20797,20 +16137,20 @@ var require_runtimeConfig3 = __commonJS({ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package4()); var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); - var credential_provider_node_1 = require_dist_cjs79(); - var util_user_agent_node_1 = require_dist_cjs56(); + var credential_provider_node_1 = require_dist_cjs52(); + var util_user_agent_node_1 = require_dist_cjs39(); var config_resolver_1 = require_dist_cjs11(); var core_2 = (init_dist_es(), __toCommonJS(dist_es_exports)); - var hash_node_1 = require_dist_cjs57(); - var middleware_retry_1 = require_dist_cjs38(); - var node_config_provider_1 = require_dist_cjs42(); - var node_http_handler_1 = require_dist_cjs51(); - var util_body_length_node_1 = require_dist_cjs58(); - var util_retry_1 = require_dist_cjs60(); + var hash_node_1 = require_dist_cjs40(); + var middleware_retry_1 = require_dist_cjs34(); + var node_config_provider_1 = require_dist_cjs26(); + var node_http_handler_1 = require_dist_cjs19(); + var util_body_length_node_1 = require_dist_cjs41(); + var util_retry_1 = require_dist_cjs31(); var runtimeConfig_shared_1 = require_runtimeConfig_shared3(); - var smithy_client_1 = require_dist_cjs37(); - var util_defaults_mode_node_1 = require_dist_cjs69(); - var smithy_client_2 = require_dist_cjs37(); + var smithy_client_1 = require_dist_cjs33(); + var util_defaults_mode_node_1 = require_dist_cjs42(); + var smithy_client_2 = require_dist_cjs33(); var getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -20908,9 +16248,9 @@ var require_runtimeExtensions = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.resolveRuntimeExtensions = void 0; - var region_config_resolver_1 = require_dist_cjs70(); + var region_config_resolver_1 = require_dist_cjs43(); var protocol_http_1 = require_dist_cjs2(); - var smithy_client_1 = require_dist_cjs37(); + var smithy_client_1 = require_dist_cjs33(); var httpAuthExtensionConfiguration_1 = require_httpAuthExtensionConfiguration(); var asPartial = (t) => t; var resolveRuntimeExtensions = (runtimeConfig, extensions) => { @@ -20945,10 +16285,10 @@ var require_STSClient = __commonJS({ var middleware_user_agent_1 = require_dist_cjs8(); var config_resolver_1 = require_dist_cjs11(); var core_1 = (init_dist_es(), __toCommonJS(dist_es_exports)); - var middleware_content_length_1 = require_dist_cjs39(); - var middleware_endpoint_1 = require_dist_cjs46(); - var middleware_retry_1 = require_dist_cjs38(); - var smithy_client_1 = require_dist_cjs37(); + var middleware_content_length_1 = require_dist_cjs23(); + var middleware_endpoint_1 = require_dist_cjs29(); + var middleware_retry_1 = require_dist_cjs34(); + var smithy_client_1 = require_dist_cjs33(); Object.defineProperty(exports2, "__Client", { enumerable: true, get: function() { return smithy_client_1.Client; } }); @@ -20992,7 +16332,7 @@ var require_STSClient = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sts/dist-cjs/index.js -var require_dist_cjs75 = __commonJS({ +var require_dist_cjs48 = __commonJS({ "../../../node_modules/@aws-sdk/client-sts/dist-cjs/index.js"(exports2, module2) { "use strict"; var __defProp2 = Object.defineProperty; @@ -21049,11 +16389,11 @@ var require_dist_cjs75 = __commonJS({ }); module2.exports = __toCommonJS2(src_exports); __reExport(src_exports, require_STSClient(), module2.exports); - var import_middleware_endpoint2 = require_dist_cjs46(); - var import_middleware_serde2 = require_dist_cjs45(); + var import_middleware_endpoint = require_dist_cjs29(); + var import_middleware_serde2 = require_dist_cjs12(); var import_EndpointParameters = require_EndpointParameters(); - var import_smithy_client5 = require_dist_cjs37(); - var _STSServiceException = class _STSServiceException2 extends import_smithy_client5.ServiceException { + var import_smithy_client4 = require_dist_cjs33(); + var _STSServiceException = class _STSServiceException2 extends import_smithy_client4.ServiceException { /** * @internal */ @@ -21202,7 +16542,7 @@ var require_dist_cjs75 = __commonJS({ var InvalidAuthorizationMessageException = _InvalidAuthorizationMessageException; var CredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.SecretAccessKey && { SecretAccessKey: import_smithy_client5.SENSITIVE_STRING } + ...obj.SecretAccessKey && { SecretAccessKey: import_smithy_client4.SENSITIVE_STRING } }), "CredentialsFilterSensitiveLog"); var AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, @@ -21210,7 +16550,7 @@ var require_dist_cjs75 = __commonJS({ }), "AssumeRoleResponseFilterSensitiveLog"); var AssumeRoleWithSAMLRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.SAMLAssertion && { SAMLAssertion: import_smithy_client5.SENSITIVE_STRING } + ...obj.SAMLAssertion && { SAMLAssertion: import_smithy_client4.SENSITIVE_STRING } }), "AssumeRoleWithSAMLRequestFilterSensitiveLog"); var AssumeRoleWithSAMLResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, @@ -21218,7 +16558,7 @@ var require_dist_cjs75 = __commonJS({ }), "AssumeRoleWithSAMLResponseFilterSensitiveLog"); var AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.WebIdentityToken && { WebIdentityToken: import_smithy_client5.SENSITIVE_STRING } + ...obj.WebIdentityToken && { WebIdentityToken: import_smithy_client4.SENSITIVE_STRING } }), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog"); var AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, @@ -21465,7 +16805,7 @@ var require_dist_cjs75 = __commonJS({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ExpiredTokenExceptionRes"); var de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; @@ -21474,7 +16814,7 @@ var require_dist_cjs75 = __commonJS({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_IDPCommunicationErrorExceptionRes"); var de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; @@ -21483,7 +16823,7 @@ var require_dist_cjs75 = __commonJS({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_IDPRejectedClaimExceptionRes"); var de_InvalidAuthorizationMessageExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; @@ -21492,7 +16832,7 @@ var require_dist_cjs75 = __commonJS({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidAuthorizationMessageExceptionRes"); var de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; @@ -21501,7 +16841,7 @@ var require_dist_cjs75 = __commonJS({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidIdentityTokenExceptionRes"); var de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; @@ -21510,7 +16850,7 @@ var require_dist_cjs75 = __commonJS({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_MalformedPolicyDocumentExceptionRes"); var de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; @@ -21519,7 +16859,7 @@ var require_dist_cjs75 = __commonJS({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_PackedPolicyTooLargeExceptionRes"); var de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; @@ -21528,7 +16868,7 @@ var require_dist_cjs75 = __commonJS({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_RegionDisabledExceptionRes"); var se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context) => { var _a2, _b, _c, _d; @@ -21814,10 +17154,10 @@ var require_dist_cjs75 = __commonJS({ var de_AssumedRoleUser = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_ARI] != null) { - contents[_ARI] = (0, import_smithy_client5.expectString)(output[_ARI]); + contents[_ARI] = (0, import_smithy_client4.expectString)(output[_ARI]); } if (output[_Ar] != null) { - contents[_Ar] = (0, import_smithy_client5.expectString)(output[_Ar]); + contents[_Ar] = (0, import_smithy_client4.expectString)(output[_Ar]); } return contents; }, "de_AssumedRoleUser"); @@ -21830,10 +17170,10 @@ var require_dist_cjs75 = __commonJS({ contents[_ARU] = de_AssumedRoleUser(output[_ARU], context); } if (output[_PPS] != null) { - contents[_PPS] = (0, import_smithy_client5.strictParseInt32)(output[_PPS]); + contents[_PPS] = (0, import_smithy_client4.strictParseInt32)(output[_PPS]); } if (output[_SI] != null) { - contents[_SI] = (0, import_smithy_client5.expectString)(output[_SI]); + contents[_SI] = (0, import_smithy_client4.expectString)(output[_SI]); } return contents; }, "de_AssumeRoleResponse"); @@ -21846,25 +17186,25 @@ var require_dist_cjs75 = __commonJS({ contents[_ARU] = de_AssumedRoleUser(output[_ARU], context); } if (output[_PPS] != null) { - contents[_PPS] = (0, import_smithy_client5.strictParseInt32)(output[_PPS]); + contents[_PPS] = (0, import_smithy_client4.strictParseInt32)(output[_PPS]); } if (output[_S] != null) { - contents[_S] = (0, import_smithy_client5.expectString)(output[_S]); + contents[_S] = (0, import_smithy_client4.expectString)(output[_S]); } if (output[_ST] != null) { - contents[_ST] = (0, import_smithy_client5.expectString)(output[_ST]); + contents[_ST] = (0, import_smithy_client4.expectString)(output[_ST]); } if (output[_I] != null) { - contents[_I] = (0, import_smithy_client5.expectString)(output[_I]); + contents[_I] = (0, import_smithy_client4.expectString)(output[_I]); } if (output[_Au] != null) { - contents[_Au] = (0, import_smithy_client5.expectString)(output[_Au]); + contents[_Au] = (0, import_smithy_client4.expectString)(output[_Au]); } if (output[_NQ] != null) { - contents[_NQ] = (0, import_smithy_client5.expectString)(output[_NQ]); + contents[_NQ] = (0, import_smithy_client4.expectString)(output[_NQ]); } if (output[_SI] != null) { - contents[_SI] = (0, import_smithy_client5.expectString)(output[_SI]); + contents[_SI] = (0, import_smithy_client4.expectString)(output[_SI]); } return contents; }, "de_AssumeRoleWithSAMLResponse"); @@ -21874,82 +17214,82 @@ var require_dist_cjs75 = __commonJS({ contents[_C] = de_Credentials(output[_C], context); } if (output[_SFWIT] != null) { - contents[_SFWIT] = (0, import_smithy_client5.expectString)(output[_SFWIT]); + contents[_SFWIT] = (0, import_smithy_client4.expectString)(output[_SFWIT]); } if (output[_ARU] != null) { contents[_ARU] = de_AssumedRoleUser(output[_ARU], context); } if (output[_PPS] != null) { - contents[_PPS] = (0, import_smithy_client5.strictParseInt32)(output[_PPS]); + contents[_PPS] = (0, import_smithy_client4.strictParseInt32)(output[_PPS]); } if (output[_Pr] != null) { - contents[_Pr] = (0, import_smithy_client5.expectString)(output[_Pr]); + contents[_Pr] = (0, import_smithy_client4.expectString)(output[_Pr]); } if (output[_Au] != null) { - contents[_Au] = (0, import_smithy_client5.expectString)(output[_Au]); + contents[_Au] = (0, import_smithy_client4.expectString)(output[_Au]); } if (output[_SI] != null) { - contents[_SI] = (0, import_smithy_client5.expectString)(output[_SI]); + contents[_SI] = (0, import_smithy_client4.expectString)(output[_SI]); } return contents; }, "de_AssumeRoleWithWebIdentityResponse"); var de_Credentials = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_AKI] != null) { - contents[_AKI] = (0, import_smithy_client5.expectString)(output[_AKI]); + contents[_AKI] = (0, import_smithy_client4.expectString)(output[_AKI]); } if (output[_SAK] != null) { - contents[_SAK] = (0, import_smithy_client5.expectString)(output[_SAK]); + contents[_SAK] = (0, import_smithy_client4.expectString)(output[_SAK]); } if (output[_STe] != null) { - contents[_STe] = (0, import_smithy_client5.expectString)(output[_STe]); + contents[_STe] = (0, import_smithy_client4.expectString)(output[_STe]); } if (output[_E] != null) { - contents[_E] = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseRfc3339DateTimeWithOffset)(output[_E])); + contents[_E] = (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseRfc3339DateTimeWithOffset)(output[_E])); } return contents; }, "de_Credentials"); var de_DecodeAuthorizationMessageResponse = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_DM] != null) { - contents[_DM] = (0, import_smithy_client5.expectString)(output[_DM]); + contents[_DM] = (0, import_smithy_client4.expectString)(output[_DM]); } return contents; }, "de_DecodeAuthorizationMessageResponse"); var de_ExpiredTokenException = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_m] != null) { - contents[_m] = (0, import_smithy_client5.expectString)(output[_m]); + contents[_m] = (0, import_smithy_client4.expectString)(output[_m]); } return contents; }, "de_ExpiredTokenException"); var de_FederatedUser = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_FUI] != null) { - contents[_FUI] = (0, import_smithy_client5.expectString)(output[_FUI]); + contents[_FUI] = (0, import_smithy_client4.expectString)(output[_FUI]); } if (output[_Ar] != null) { - contents[_Ar] = (0, import_smithy_client5.expectString)(output[_Ar]); + contents[_Ar] = (0, import_smithy_client4.expectString)(output[_Ar]); } return contents; }, "de_FederatedUser"); var de_GetAccessKeyInfoResponse = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_Ac] != null) { - contents[_Ac] = (0, import_smithy_client5.expectString)(output[_Ac]); + contents[_Ac] = (0, import_smithy_client4.expectString)(output[_Ac]); } return contents; }, "de_GetAccessKeyInfoResponse"); var de_GetCallerIdentityResponse = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_UI] != null) { - contents[_UI] = (0, import_smithy_client5.expectString)(output[_UI]); + contents[_UI] = (0, import_smithy_client4.expectString)(output[_UI]); } if (output[_Ac] != null) { - contents[_Ac] = (0, import_smithy_client5.expectString)(output[_Ac]); + contents[_Ac] = (0, import_smithy_client4.expectString)(output[_Ac]); } if (output[_Ar] != null) { - contents[_Ar] = (0, import_smithy_client5.expectString)(output[_Ar]); + contents[_Ar] = (0, import_smithy_client4.expectString)(output[_Ar]); } return contents; }, "de_GetCallerIdentityResponse"); @@ -21962,7 +17302,7 @@ var require_dist_cjs75 = __commonJS({ contents[_FU] = de_FederatedUser(output[_FU], context); } if (output[_PPS] != null) { - contents[_PPS] = (0, import_smithy_client5.strictParseInt32)(output[_PPS]); + contents[_PPS] = (0, import_smithy_client4.strictParseInt32)(output[_PPS]); } return contents; }, "de_GetFederationTokenResponse"); @@ -21976,49 +17316,49 @@ var require_dist_cjs75 = __commonJS({ var de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_m] != null) { - contents[_m] = (0, import_smithy_client5.expectString)(output[_m]); + contents[_m] = (0, import_smithy_client4.expectString)(output[_m]); } return contents; }, "de_IDPCommunicationErrorException"); var de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_m] != null) { - contents[_m] = (0, import_smithy_client5.expectString)(output[_m]); + contents[_m] = (0, import_smithy_client4.expectString)(output[_m]); } return contents; }, "de_IDPRejectedClaimException"); var de_InvalidAuthorizationMessageException = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_m] != null) { - contents[_m] = (0, import_smithy_client5.expectString)(output[_m]); + contents[_m] = (0, import_smithy_client4.expectString)(output[_m]); } return contents; }, "de_InvalidAuthorizationMessageException"); var de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_m] != null) { - contents[_m] = (0, import_smithy_client5.expectString)(output[_m]); + contents[_m] = (0, import_smithy_client4.expectString)(output[_m]); } return contents; }, "de_InvalidIdentityTokenException"); var de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_m] != null) { - contents[_m] = (0, import_smithy_client5.expectString)(output[_m]); + contents[_m] = (0, import_smithy_client4.expectString)(output[_m]); } return contents; }, "de_MalformedPolicyDocumentException"); var de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_m] != null) { - contents[_m] = (0, import_smithy_client5.expectString)(output[_m]); + contents[_m] = (0, import_smithy_client4.expectString)(output[_m]); } return contents; }, "de_PackedPolicyTooLargeException"); var de_RegionDisabledException = /* @__PURE__ */ __name((output, context) => { const contents = {}; if (output[_m] != null) { - contents[_m] = (0, import_smithy_client5.expectString)(output[_m]); + contents[_m] = (0, import_smithy_client4.expectString)(output[_m]); } return contents; }, "de_RegionDisabledException"); @@ -22028,7 +17368,7 @@ var require_dist_cjs75 = __commonJS({ extendedRequestId: output.headers["x-amz-id-2"], cfId: output.headers["x-amz-cf-id"] }), "deserializeMetadata"); - var throwDefaultError = (0, import_smithy_client5.withBaseException)(STSServiceException); + var throwDefaultError = (0, import_smithy_client4.withBaseException)(STSServiceException); var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => { const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); const contents = { @@ -22106,7 +17446,7 @@ var require_dist_cjs75 = __commonJS({ var _WIT = "WebIdentityToken"; var _a = "arn"; var _m = "message"; - var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client5.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client5.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString"); + var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client4.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client4.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString"); var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => { var _a2; if (((_a2 = data.Error) == null ? void 0 : _a2.Code) !== void 0) { @@ -22116,96 +17456,96 @@ var require_dist_cjs75 = __commonJS({ return "NotFound"; } }, "loadQueryErrorCode"); - var _AssumeRoleCommand = class _AssumeRoleCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _AssumeRoleCommand = class _AssumeRoleCommand extends import_smithy_client4.Command.classBuilder().ep({ ...import_EndpointParameters.commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() { }; __name(_AssumeRoleCommand, "AssumeRoleCommand"); var AssumeRoleCommand = _AssumeRoleCommand; var import_EndpointParameters2 = require_EndpointParameters(); - var _AssumeRoleWithSAMLCommand = class _AssumeRoleWithSAMLCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _AssumeRoleWithSAMLCommand = class _AssumeRoleWithSAMLCommand extends import_smithy_client4.Command.classBuilder().ep({ ...import_EndpointParameters2.commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").f(AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog).ser(se_AssumeRoleWithSAMLCommand).de(de_AssumeRoleWithSAMLCommand).build() { }; __name(_AssumeRoleWithSAMLCommand, "AssumeRoleWithSAMLCommand"); var AssumeRoleWithSAMLCommand = _AssumeRoleWithSAMLCommand; var import_EndpointParameters3 = require_EndpointParameters(); - var _AssumeRoleWithWebIdentityCommand = class _AssumeRoleWithWebIdentityCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _AssumeRoleWithWebIdentityCommand = class _AssumeRoleWithWebIdentityCommand extends import_smithy_client4.Command.classBuilder().ep({ ...import_EndpointParameters3.commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog).ser(se_AssumeRoleWithWebIdentityCommand).de(de_AssumeRoleWithWebIdentityCommand).build() { }; __name(_AssumeRoleWithWebIdentityCommand, "AssumeRoleWithWebIdentityCommand"); var AssumeRoleWithWebIdentityCommand = _AssumeRoleWithWebIdentityCommand; var import_EndpointParameters4 = require_EndpointParameters(); - var _DecodeAuthorizationMessageCommand = class _DecodeAuthorizationMessageCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DecodeAuthorizationMessageCommand = class _DecodeAuthorizationMessageCommand extends import_smithy_client4.Command.classBuilder().ep({ ...import_EndpointParameters4.commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").f(void 0, void 0).ser(se_DecodeAuthorizationMessageCommand).de(de_DecodeAuthorizationMessageCommand).build() { }; __name(_DecodeAuthorizationMessageCommand, "DecodeAuthorizationMessageCommand"); var DecodeAuthorizationMessageCommand = _DecodeAuthorizationMessageCommand; var import_EndpointParameters5 = require_EndpointParameters(); - var _GetAccessKeyInfoCommand = class _GetAccessKeyInfoCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _GetAccessKeyInfoCommand = class _GetAccessKeyInfoCommand extends import_smithy_client4.Command.classBuilder().ep({ ...import_EndpointParameters5.commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").f(void 0, void 0).ser(se_GetAccessKeyInfoCommand).de(de_GetAccessKeyInfoCommand).build() { }; __name(_GetAccessKeyInfoCommand, "GetAccessKeyInfoCommand"); var GetAccessKeyInfoCommand = _GetAccessKeyInfoCommand; var import_EndpointParameters6 = require_EndpointParameters(); - var _GetCallerIdentityCommand = class _GetCallerIdentityCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _GetCallerIdentityCommand = class _GetCallerIdentityCommand extends import_smithy_client4.Command.classBuilder().ep({ ...import_EndpointParameters6.commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").f(void 0, void 0).ser(se_GetCallerIdentityCommand).de(de_GetCallerIdentityCommand).build() { }; __name(_GetCallerIdentityCommand, "GetCallerIdentityCommand"); var GetCallerIdentityCommand = _GetCallerIdentityCommand; var import_EndpointParameters7 = require_EndpointParameters(); - var _GetFederationTokenCommand = class _GetFederationTokenCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _GetFederationTokenCommand = class _GetFederationTokenCommand extends import_smithy_client4.Command.classBuilder().ep({ ...import_EndpointParameters7.commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").f(void 0, GetFederationTokenResponseFilterSensitiveLog).ser(se_GetFederationTokenCommand).de(de_GetFederationTokenCommand).build() { }; __name(_GetFederationTokenCommand, "GetFederationTokenCommand"); var GetFederationTokenCommand = _GetFederationTokenCommand; var import_EndpointParameters8 = require_EndpointParameters(); - var _GetSessionTokenCommand = class _GetSessionTokenCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _GetSessionTokenCommand = class _GetSessionTokenCommand extends import_smithy_client4.Command.classBuilder().ep({ ...import_EndpointParameters8.commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").f(void 0, GetSessionTokenResponseFilterSensitiveLog).ser(se_GetSessionTokenCommand).de(de_GetSessionTokenCommand).build() { }; @@ -22226,7 +17566,7 @@ var require_dist_cjs75 = __commonJS({ }; __name(_STS, "STS"); var STS = _STS; - (0, import_smithy_client5.createAggregatedClient)(commands, STS); + (0, import_smithy_client4.createAggregatedClient)(commands, STS); var import_EndpointParameters9 = require_EndpointParameters(); var ASSUME_ROLE_DEFAULT_REGION = "us-east-1"; var getAccountIdFromAssumedRoleUser = /* @__PURE__ */ __name((assumedRoleUser) => { @@ -22364,7 +17704,7 @@ var require_dist_cjs75 = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js -var require_dist_cjs76 = __commonJS({ +var require_dist_cjs49 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js"(exports2, module2) { "use strict"; var __defProp2 = Object.defineProperty; @@ -22390,8 +17730,8 @@ var require_dist_cjs76 = __commonJS({ fromProcess: () => fromProcess }); module2.exports = __toCommonJS2(src_exports); - var import_shared_ini_file_loader = require_dist_cjs41(); - var import_property_provider2 = require_dist_cjs40(); + var import_shared_ini_file_loader = require_dist_cjs25(); + var import_property_provider2 = require_dist_cjs24(); var import_child_process = require("child_process"); var import_util = require("util"); var getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data, profiles) => { @@ -22496,7 +17836,7 @@ var require_fromWebToken = __commonJS({ const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init; let { roleAssumerWithWebIdentity } = init; if (!roleAssumerWithWebIdentity) { - const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() => __importStar2(require_dist_cjs75())); + const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() => __importStar2(require_dist_cjs48())); roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({ ...init.clientConfig, credentialProviderLogger: init.logger, @@ -22523,7 +17863,7 @@ var require_fromTokenFile = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.fromTokenFile = void 0; - var property_provider_1 = require_dist_cjs40(); + var property_provider_1 = require_dist_cjs24(); var fs_1 = require("fs"); var fromWebToken_1 = require_fromWebToken(); var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; @@ -22551,7 +17891,7 @@ var require_fromTokenFile = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js -var require_dist_cjs77 = __commonJS({ +var require_dist_cjs50 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js"(exports2, module2) { "use strict"; var __defProp2 = Object.defineProperty; @@ -22576,7 +17916,7 @@ var require_dist_cjs77 = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js -var require_dist_cjs78 = __commonJS({ +var require_dist_cjs51 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js"(exports2, module2) { "use strict"; var __create2 = Object.create; @@ -22612,24 +17952,24 @@ var require_dist_cjs78 = __commonJS({ fromIni: () => fromIni }); module2.exports = __toCommonJS2(src_exports); - var import_shared_ini_file_loader = require_dist_cjs41(); - var import_property_provider2 = require_dist_cjs40(); + var import_shared_ini_file_loader = require_dist_cjs25(); + var import_property_provider2 = require_dist_cjs24(); var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName, logger) => { const sourceProvidersMap = { EcsContainer: async (options) => { - const { fromHttp } = await Promise.resolve().then(() => __toESM2(require_dist_cjs55())); - const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM2(require_dist_cjs49())); + const { fromHttp } = await Promise.resolve().then(() => __toESM2(require_dist_cjs38())); + const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM2(require_dist_cjs37())); logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"); return (0, import_property_provider2.chain)(fromHttp(options ?? {}), fromContainerMetadata(options)); }, Ec2InstanceMetadata: async (options) => { logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata"); - const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM2(require_dist_cjs49())); + const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM2(require_dist_cjs37())); return fromInstanceMetadata(options); }, Environment: async (options) => { logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is Environment"); - const { fromEnv } = await Promise.resolve().then(() => __toESM2(require_dist_cjs48())); + const { fromEnv } = await Promise.resolve().then(() => __toESM2(require_dist_cjs36())); return fromEnv(options); } }; @@ -22666,7 +18006,7 @@ var require_dist_cjs78 = __commonJS({ (_a = options.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)"); const data = profiles[profileName]; if (!options.roleAssumer) { - const { getDefaultRoleAssumer } = await Promise.resolve().then(() => __toESM2(require_dist_cjs75())); + const { getDefaultRoleAssumer } = await Promise.resolve().then(() => __toESM2(require_dist_cjs48())); options.roleAssumer = getDefaultRoleAssumer( { ...options.clientConfig, @@ -22725,14 +18065,14 @@ var require_dist_cjs78 = __commonJS({ return options.roleAssumer(sourceCreds, params); }, "resolveAssumeRoleCredentials"); var isProcessProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string", "isProcessProfile"); - var resolveProcessCredentials = /* @__PURE__ */ __name(async (options, profile) => Promise.resolve().then(() => __toESM2(require_dist_cjs76())).then( + var resolveProcessCredentials = /* @__PURE__ */ __name(async (options, profile) => Promise.resolve().then(() => __toESM2(require_dist_cjs49())).then( ({ fromProcess }) => fromProcess({ ...options, profile })() ), "resolveProcessCredentials"); var resolveSsoCredentials = /* @__PURE__ */ __name(async (profile, options = {}) => { - const { fromSSO } = await Promise.resolve().then(() => __toESM2(require_dist_cjs74())); + const { fromSSO } = await Promise.resolve().then(() => __toESM2(require_dist_cjs47())); return fromSSO({ profile, logger: options.logger @@ -22752,7 +18092,7 @@ var require_dist_cjs78 = __commonJS({ }); }, "resolveStaticCredentials"); var isWebIdentityProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1, "isWebIdentityProfile"); - var resolveWebIdentityCredentials = /* @__PURE__ */ __name(async (profile, options) => Promise.resolve().then(() => __toESM2(require_dist_cjs77())).then( + var resolveWebIdentityCredentials = /* @__PURE__ */ __name(async (profile, options) => Promise.resolve().then(() => __toESM2(require_dist_cjs50())).then( ({ fromTokenFile: fromTokenFile2 }) => fromTokenFile2({ webIdentityTokenFile: profile.web_identity_token_file, roleArn: profile.role_arn, @@ -22797,7 +18137,7 @@ var require_dist_cjs78 = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js -var require_dist_cjs79 = __commonJS({ +var require_dist_cjs52 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js"(exports2, module2) { "use strict"; var __create2 = Object.create; @@ -22835,16 +18175,16 @@ var require_dist_cjs79 = __commonJS({ defaultProvider: () => defaultProvider }); module2.exports = __toCommonJS2(src_exports); - var import_credential_provider_env = require_dist_cjs48(); - var import_shared_ini_file_loader = require_dist_cjs41(); - var import_property_provider2 = require_dist_cjs40(); + var import_credential_provider_env = require_dist_cjs36(); + var import_shared_ini_file_loader = require_dist_cjs25(); + var import_property_provider2 = require_dist_cjs24(); var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; var remoteProvider = /* @__PURE__ */ __name(async (init) => { var _a, _b; - const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await Promise.resolve().then(() => __toESM2(require_dist_cjs49())); + const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await Promise.resolve().then(() => __toESM2(require_dist_cjs37())); if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) { (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata"); - const { fromHttp } = await Promise.resolve().then(() => __toESM2(require_dist_cjs55())); + const { fromHttp } = await Promise.resolve().then(() => __toESM2(require_dist_cjs38())); return (0, import_property_provider2.chain)(fromHttp(init), fromContainerMetadata(init)); } if (process.env[ENV_IMDS_DISABLED]) { @@ -22898,25 +18238,25 @@ var require_dist_cjs79 = __commonJS({ { logger: init.logger } ); } - const { fromSSO } = await Promise.resolve().then(() => __toESM2(require_dist_cjs74())); + const { fromSSO } = await Promise.resolve().then(() => __toESM2(require_dist_cjs47())); return fromSSO(init)(); }, async () => { var _a; (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni"); - const { fromIni } = await Promise.resolve().then(() => __toESM2(require_dist_cjs78())); + const { fromIni } = await Promise.resolve().then(() => __toESM2(require_dist_cjs51())); return fromIni(init)(); }, async () => { var _a; (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess"); - const { fromProcess } = await Promise.resolve().then(() => __toESM2(require_dist_cjs76())); + const { fromProcess } = await Promise.resolve().then(() => __toESM2(require_dist_cjs49())); return fromProcess(init)(); }, async () => { var _a; (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile"); - const { fromTokenFile: fromTokenFile2 } = await Promise.resolve().then(() => __toESM2(require_dist_cjs77())); + const { fromTokenFile: fromTokenFile2 } = await Promise.resolve().then(() => __toESM2(require_dist_cjs50())); return fromTokenFile2(init)(); }, async () => { @@ -23000,10 +18340,10 @@ var require_runtimeConfig_shared4 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeConfig = void 0; var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); - var smithy_client_1 = require_dist_cjs37(); - var url_parser_1 = require_dist_cjs44(); - var util_base64_1 = require_dist_cjs29(); - var util_utf8_1 = require_dist_cjs28(); + var smithy_client_1 = require_dist_cjs33(); + var url_parser_1 = require_dist_cjs28(); + var util_base64_1 = require_dist_cjs16(); + var util_utf8_1 = require_dist_cjs15(); var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider(); var endpointResolver_1 = require_endpointResolver4(); var getRuntimeConfig = (config) => { @@ -23042,19 +18382,19 @@ var require_runtimeConfig4 = __commonJS({ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package()); var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); - var credential_provider_node_1 = require_dist_cjs79(); - var util_user_agent_node_1 = require_dist_cjs56(); + var credential_provider_node_1 = require_dist_cjs52(); + var util_user_agent_node_1 = require_dist_cjs39(); var config_resolver_1 = require_dist_cjs11(); - var hash_node_1 = require_dist_cjs57(); - var middleware_retry_1 = require_dist_cjs38(); - var node_config_provider_1 = require_dist_cjs42(); - var node_http_handler_1 = require_dist_cjs51(); - var util_body_length_node_1 = require_dist_cjs58(); - var util_retry_1 = require_dist_cjs60(); + var hash_node_1 = require_dist_cjs40(); + var middleware_retry_1 = require_dist_cjs34(); + var node_config_provider_1 = require_dist_cjs26(); + var node_http_handler_1 = require_dist_cjs19(); + var util_body_length_node_1 = require_dist_cjs41(); + var util_retry_1 = require_dist_cjs31(); var runtimeConfig_shared_1 = require_runtimeConfig_shared4(); - var smithy_client_1 = require_dist_cjs37(); - var util_defaults_mode_node_1 = require_dist_cjs69(); - var smithy_client_2 = require_dist_cjs37(); + var smithy_client_1 = require_dist_cjs33(); + var util_defaults_mode_node_1 = require_dist_cjs42(); + var smithy_client_2 = require_dist_cjs33(); var getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -23087,7 +18427,7 @@ var require_runtimeConfig4 = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sfn/dist-cjs/index.js -var require_dist_cjs80 = __commonJS({ +var require_dist_cjs53 = __commonJS({ "../../../node_modules/@aws-sdk/client-sfn/dist-cjs/index.js"(exports2, module2) { "use strict"; var __defProp2 = Object.defineProperty; @@ -23248,7 +18588,7 @@ var require_dist_cjs80 = __commonJS({ ValidateStateMachineDefinitionSeverity: () => ValidateStateMachineDefinitionSeverity, ValidationException: () => ValidationException, ValidationExceptionReason: () => ValidationExceptionReason, - __Client: () => import_smithy_client5.Client, + __Client: () => import_smithy_client4.Client, paginateGetExecutionHistory: () => paginateGetExecutionHistory, paginateListActivities: () => paginateListActivities, paginateListExecutions: () => paginateListExecutions, @@ -23262,9 +18602,9 @@ var require_dist_cjs80 = __commonJS({ var import_middleware_user_agent = require_dist_cjs8(); var import_config_resolver = require_dist_cjs11(); var import_core3 = (init_dist_es(), __toCommonJS(dist_es_exports)); - var import_middleware_content_length = require_dist_cjs39(); - var import_middleware_endpoint2 = require_dist_cjs46(); - var import_middleware_retry2 = require_dist_cjs38(); + var import_middleware_content_length = require_dist_cjs23(); + var import_middleware_endpoint = require_dist_cjs29(); + var import_middleware_retry = require_dist_cjs34(); var import_httpAuthSchemeProvider = require_httpAuthSchemeProvider(); var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => { return { @@ -23281,9 +18621,9 @@ var require_dist_cjs80 = __commonJS({ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; var import_runtimeConfig = require_runtimeConfig4(); - var import_region_config_resolver = require_dist_cjs70(); + var import_region_config_resolver = require_dist_cjs43(); var import_protocol_http8 = require_dist_cjs2(); - var import_smithy_client5 = require_dist_cjs37(); + var import_smithy_client4 = require_dist_cjs33(); var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; @@ -23325,7 +18665,7 @@ var require_dist_cjs80 = __commonJS({ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { const extensionConfiguration = { ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, import_smithy_client5.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_smithy_client4.getDefaultExtensionConfiguration)(runtimeConfig)), ...asPartial((0, import_protocol_http8.getHttpHandlerExtensionConfiguration)(runtimeConfig)), ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)) }; @@ -23333,26 +18673,26 @@ var require_dist_cjs80 = __commonJS({ return { ...runtimeConfig, ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), - ...(0, import_smithy_client5.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, import_smithy_client4.resolveDefaultRuntimeConfig)(extensionConfiguration), ...(0, import_protocol_http8.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), ...resolveHttpAuthRuntimeConfig(extensionConfiguration) }; }, "resolveRuntimeExtensions"); - var _SFNClient = class _SFNClient extends import_smithy_client5.Client { + var _SFNClient = class _SFNClient extends import_smithy_client4.Client { constructor(...[configuration]) { const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {}); const _config_1 = resolveClientEndpointParameters(_config_0); const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1); - const _config_3 = (0, import_middleware_retry2.resolveRetryConfig)(_config_2); + const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2); const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3); const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, import_middleware_endpoint2.resolveEndpointConfig)(_config_5); + const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5); const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6); const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []); super(_config_8); this.config = _config_8; this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); - this.middlewareStack.use((0, import_middleware_retry2.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); @@ -23378,10 +18718,10 @@ var require_dist_cjs80 = __commonJS({ }; __name(_SFNClient, "SFNClient"); var SFNClient = _SFNClient; - var import_middleware_serde2 = require_dist_cjs45(); + var import_middleware_serde2 = require_dist_cjs12(); var import_core22 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); var import_uuid = (init_esm_node(), __toCommonJS(esm_node_exports)); - var _SFNServiceException = class _SFNServiceException2 extends import_smithy_client5.ServiceException { + var _SFNServiceException = class _SFNServiceException2 extends import_smithy_client4.ServiceException { /** * @internal */ @@ -24103,156 +19443,156 @@ var require_dist_cjs80 = __commonJS({ }; var ActivityFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "ActivityFailedEventDetailsFilterSensitiveLog"); var ActivityScheduledEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING } }), "ActivityScheduledEventDetailsFilterSensitiveLog"); var ActivityScheduleFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "ActivityScheduleFailedEventDetailsFilterSensitiveLog"); var ActivitySucceededEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING } + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING } }), "ActivitySucceededEventDetailsFilterSensitiveLog"); var ActivityTimedOutEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "ActivityTimedOutEventDetailsFilterSensitiveLog"); var CreateStateMachineInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.definition && { definition: import_smithy_client5.SENSITIVE_STRING }, - ...obj.versionDescription && { versionDescription: import_smithy_client5.SENSITIVE_STRING } + ...obj.definition && { definition: import_smithy_client4.SENSITIVE_STRING }, + ...obj.versionDescription && { versionDescription: import_smithy_client4.SENSITIVE_STRING } }), "CreateStateMachineInputFilterSensitiveLog"); var CreateStateMachineAliasInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.description && { description: import_smithy_client5.SENSITIVE_STRING } + ...obj.description && { description: import_smithy_client4.SENSITIVE_STRING } }), "CreateStateMachineAliasInputFilterSensitiveLog"); var DescribeExecutionOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING }, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING }, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING }, - ...obj.redriveStatusReason && { redriveStatusReason: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING }, + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING }, + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING }, + ...obj.redriveStatusReason && { redriveStatusReason: import_smithy_client4.SENSITIVE_STRING } }), "DescribeExecutionOutputFilterSensitiveLog"); var DescribeStateMachineOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.definition && { definition: import_smithy_client5.SENSITIVE_STRING }, - ...obj.description && { description: import_smithy_client5.SENSITIVE_STRING } + ...obj.definition && { definition: import_smithy_client4.SENSITIVE_STRING }, + ...obj.description && { description: import_smithy_client4.SENSITIVE_STRING } }), "DescribeStateMachineOutputFilterSensitiveLog"); var DescribeStateMachineAliasOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.description && { description: import_smithy_client5.SENSITIVE_STRING } + ...obj.description && { description: import_smithy_client4.SENSITIVE_STRING } }), "DescribeStateMachineAliasOutputFilterSensitiveLog"); var DescribeStateMachineForExecutionOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.definition && { definition: import_smithy_client5.SENSITIVE_STRING } + ...obj.definition && { definition: import_smithy_client4.SENSITIVE_STRING } }), "DescribeStateMachineForExecutionOutputFilterSensitiveLog"); var GetActivityTaskOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING } }), "GetActivityTaskOutputFilterSensitiveLog"); var ExecutionAbortedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "ExecutionAbortedEventDetailsFilterSensitiveLog"); var ExecutionFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "ExecutionFailedEventDetailsFilterSensitiveLog"); var ExecutionStartedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING } }), "ExecutionStartedEventDetailsFilterSensitiveLog"); var ExecutionSucceededEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING } + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING } }), "ExecutionSucceededEventDetailsFilterSensitiveLog"); var ExecutionTimedOutEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "ExecutionTimedOutEventDetailsFilterSensitiveLog"); var LambdaFunctionFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "LambdaFunctionFailedEventDetailsFilterSensitiveLog"); var LambdaFunctionScheduledEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING } }), "LambdaFunctionScheduledEventDetailsFilterSensitiveLog"); var LambdaFunctionScheduleFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "LambdaFunctionScheduleFailedEventDetailsFilterSensitiveLog"); var LambdaFunctionStartFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "LambdaFunctionStartFailedEventDetailsFilterSensitiveLog"); var LambdaFunctionSucceededEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING } + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING } }), "LambdaFunctionSucceededEventDetailsFilterSensitiveLog"); var LambdaFunctionTimedOutEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "LambdaFunctionTimedOutEventDetailsFilterSensitiveLog"); var MapRunFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "MapRunFailedEventDetailsFilterSensitiveLog"); var StateEnteredEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING } }), "StateEnteredEventDetailsFilterSensitiveLog"); var StateExitedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING } + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING } }), "StateExitedEventDetailsFilterSensitiveLog"); var TaskFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "TaskFailedEventDetailsFilterSensitiveLog"); var TaskScheduledEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.parameters && { parameters: import_smithy_client5.SENSITIVE_STRING } + ...obj.parameters && { parameters: import_smithy_client4.SENSITIVE_STRING } }), "TaskScheduledEventDetailsFilterSensitiveLog"); var TaskStartFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "TaskStartFailedEventDetailsFilterSensitiveLog"); var TaskSubmitFailedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "TaskSubmitFailedEventDetailsFilterSensitiveLog"); var TaskSubmittedEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING } + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING } }), "TaskSubmittedEventDetailsFilterSensitiveLog"); var TaskSucceededEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING } + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING } }), "TaskSucceededEventDetailsFilterSensitiveLog"); var TaskTimedOutEventDetailsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "TaskTimedOutEventDetailsFilterSensitiveLog"); var HistoryEventFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, @@ -24357,207 +19697,207 @@ var require_dist_cjs80 = __commonJS({ }), "GetExecutionHistoryOutputFilterSensitiveLog"); var PublishStateMachineVersionInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.description && { description: import_smithy_client5.SENSITIVE_STRING } + ...obj.description && { description: import_smithy_client4.SENSITIVE_STRING } }), "PublishStateMachineVersionInputFilterSensitiveLog"); var SendTaskFailureInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "SendTaskFailureInputFilterSensitiveLog"); var SendTaskSuccessInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING } + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING } }), "SendTaskSuccessInputFilterSensitiveLog"); var StartExecutionInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING } }), "StartExecutionInputFilterSensitiveLog"); var StartSyncExecutionInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING } }), "StartSyncExecutionInputFilterSensitiveLog"); var StartSyncExecutionOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING }, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING }, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING }, + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING }, + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING } }), "StartSyncExecutionOutputFilterSensitiveLog"); var StopExecutionInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING } + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING } }), "StopExecutionInputFilterSensitiveLog"); var TestStateInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.definition && { definition: import_smithy_client5.SENSITIVE_STRING }, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING } + ...obj.definition && { definition: import_smithy_client4.SENSITIVE_STRING }, + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING } }), "TestStateInputFilterSensitiveLog"); var InspectionDataFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.input && { input: import_smithy_client5.SENSITIVE_STRING }, - ...obj.afterInputPath && { afterInputPath: import_smithy_client5.SENSITIVE_STRING }, - ...obj.afterParameters && { afterParameters: import_smithy_client5.SENSITIVE_STRING }, - ...obj.result && { result: import_smithy_client5.SENSITIVE_STRING }, - ...obj.afterResultSelector && { afterResultSelector: import_smithy_client5.SENSITIVE_STRING }, - ...obj.afterResultPath && { afterResultPath: import_smithy_client5.SENSITIVE_STRING } + ...obj.input && { input: import_smithy_client4.SENSITIVE_STRING }, + ...obj.afterInputPath && { afterInputPath: import_smithy_client4.SENSITIVE_STRING }, + ...obj.afterParameters && { afterParameters: import_smithy_client4.SENSITIVE_STRING }, + ...obj.result && { result: import_smithy_client4.SENSITIVE_STRING }, + ...obj.afterResultSelector && { afterResultSelector: import_smithy_client4.SENSITIVE_STRING }, + ...obj.afterResultPath && { afterResultPath: import_smithy_client4.SENSITIVE_STRING } }), "InspectionDataFilterSensitiveLog"); var TestStateOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.output && { output: import_smithy_client5.SENSITIVE_STRING }, - ...obj.error && { error: import_smithy_client5.SENSITIVE_STRING }, - ...obj.cause && { cause: import_smithy_client5.SENSITIVE_STRING }, - ...obj.inspectionData && { inspectionData: import_smithy_client5.SENSITIVE_STRING } + ...obj.output && { output: import_smithy_client4.SENSITIVE_STRING }, + ...obj.error && { error: import_smithy_client4.SENSITIVE_STRING }, + ...obj.cause && { cause: import_smithy_client4.SENSITIVE_STRING }, + ...obj.inspectionData && { inspectionData: import_smithy_client4.SENSITIVE_STRING } }), "TestStateOutputFilterSensitiveLog"); var UpdateStateMachineInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.definition && { definition: import_smithy_client5.SENSITIVE_STRING }, - ...obj.versionDescription && { versionDescription: import_smithy_client5.SENSITIVE_STRING } + ...obj.definition && { definition: import_smithy_client4.SENSITIVE_STRING }, + ...obj.versionDescription && { versionDescription: import_smithy_client4.SENSITIVE_STRING } }), "UpdateStateMachineInputFilterSensitiveLog"); var UpdateStateMachineAliasInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.description && { description: import_smithy_client5.SENSITIVE_STRING } + ...obj.description && { description: import_smithy_client4.SENSITIVE_STRING } }), "UpdateStateMachineAliasInputFilterSensitiveLog"); var ValidateStateMachineDefinitionInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, - ...obj.definition && { definition: import_smithy_client5.SENSITIVE_STRING } + ...obj.definition && { definition: import_smithy_client4.SENSITIVE_STRING } }), "ValidateStateMachineDefinitionInputFilterSensitiveLog"); var se_CreateActivityCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("CreateActivity"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_CreateActivityCommand"); var se_CreateStateMachineCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("CreateStateMachine"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_CreateStateMachineCommand"); var se_CreateStateMachineAliasCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("CreateStateMachineAlias"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_CreateStateMachineAliasCommand"); var se_DeleteActivityCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DeleteActivity"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DeleteActivityCommand"); var se_DeleteStateMachineCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DeleteStateMachine"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DeleteStateMachineCommand"); var se_DeleteStateMachineAliasCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DeleteStateMachineAlias"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DeleteStateMachineAliasCommand"); var se_DeleteStateMachineVersionCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DeleteStateMachineVersion"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DeleteStateMachineVersionCommand"); var se_DescribeActivityCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DescribeActivity"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DescribeActivityCommand"); var se_DescribeExecutionCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DescribeExecution"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DescribeExecutionCommand"); var se_DescribeMapRunCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DescribeMapRun"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DescribeMapRunCommand"); var se_DescribeStateMachineCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DescribeStateMachine"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DescribeStateMachineCommand"); var se_DescribeStateMachineAliasCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DescribeStateMachineAlias"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DescribeStateMachineAliasCommand"); var se_DescribeStateMachineForExecutionCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("DescribeStateMachineForExecution"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_DescribeStateMachineForExecutionCommand"); var se_GetActivityTaskCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("GetActivityTask"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_GetActivityTaskCommand"); var se_GetExecutionHistoryCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("GetExecutionHistory"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_GetExecutionHistoryCommand"); var se_ListActivitiesCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ListActivities"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ListActivitiesCommand"); var se_ListExecutionsCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ListExecutions"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ListExecutionsCommand"); var se_ListMapRunsCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ListMapRuns"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ListMapRunsCommand"); var se_ListStateMachineAliasesCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ListStateMachineAliases"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ListStateMachineAliasesCommand"); var se_ListStateMachinesCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ListStateMachines"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ListStateMachinesCommand"); var se_ListStateMachineVersionsCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ListStateMachineVersions"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ListStateMachineVersionsCommand"); var se_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ListTagsForResource"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ListTagsForResourceCommand"); var se_PublishStateMachineVersionCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("PublishStateMachineVersion"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_PublishStateMachineVersionCommand"); var se_RedriveExecutionCommand = /* @__PURE__ */ __name(async (input, context) => { @@ -24569,31 +19909,31 @@ var require_dist_cjs80 = __commonJS({ var se_SendTaskFailureCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("SendTaskFailure"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_SendTaskFailureCommand"); var se_SendTaskHeartbeatCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("SendTaskHeartbeat"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_SendTaskHeartbeatCommand"); var se_SendTaskSuccessCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("SendTaskSuccess"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_SendTaskSuccessCommand"); var se_StartExecutionCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("StartExecution"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_StartExecutionCommand"); var se_StartSyncExecutionCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("StartSyncExecution"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { resolvedHostname = "sync-" + resolvedHostname; @@ -24606,19 +19946,19 @@ var require_dist_cjs80 = __commonJS({ var se_StopExecutionCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("StopExecution"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_StopExecutionCommand"); var se_TagResourceCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("TagResource"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_TagResourceCommand"); var se_TestStateCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("TestState"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { resolvedHostname = "sync-" + resolvedHostname; @@ -24631,7 +19971,7 @@ var require_dist_cjs80 = __commonJS({ var se_UntagResourceCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("UntagResource"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_UntagResourceCommand"); var se_UpdateMapRunCommand = /* @__PURE__ */ __name(async (input, context) => { @@ -24643,19 +19983,19 @@ var require_dist_cjs80 = __commonJS({ var se_UpdateStateMachineCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("UpdateStateMachine"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_UpdateStateMachineCommand"); var se_UpdateStateMachineAliasCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("UpdateStateMachineAlias"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_UpdateStateMachineAliasCommand"); var se_ValidateStateMachineDefinitionCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ValidateStateMachineDefinition"); let body; - body = JSON.stringify((0, import_smithy_client5._json)(input)); + body = JSON.stringify((0, import_smithy_client4._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ValidateStateMachineDefinitionCommand"); var de_CreateActivityCommand = /* @__PURE__ */ __name(async (output, context) => { @@ -24703,7 +20043,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -24716,7 +20056,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -24729,7 +20069,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -24742,7 +20082,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -24833,7 +20173,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -24937,7 +20277,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -24976,7 +20316,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -24989,7 +20329,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -25002,7 +20342,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -25054,7 +20394,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -25067,7 +20407,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -25080,7 +20420,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -25093,7 +20433,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -25132,7 +20472,7 @@ var require_dist_cjs80 = __commonJS({ } const data = await (0, import_core22.parseJsonBody)(output.body, context); let contents = {}; - contents = (0, import_smithy_client5._json)(data); + contents = (0, import_smithy_client4._json)(data); const response = { $metadata: deserializeMetadata(output), ...contents @@ -25256,313 +20596,313 @@ var require_dist_cjs80 = __commonJS({ }, "de_CommandError"); var de_ActivityAlreadyExistsRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ActivityAlreadyExists({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ActivityAlreadyExistsRes"); var de_ActivityDoesNotExistRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ActivityDoesNotExist({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ActivityDoesNotExistRes"); var de_ActivityLimitExceededRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ActivityLimitExceeded({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ActivityLimitExceededRes"); var de_ActivityWorkerLimitExceededRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ActivityWorkerLimitExceeded({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ActivityWorkerLimitExceededRes"); var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ConflictException({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ConflictExceptionRes"); var de_ExecutionAlreadyExistsRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ExecutionAlreadyExists({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ExecutionAlreadyExistsRes"); var de_ExecutionDoesNotExistRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ExecutionDoesNotExist({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ExecutionDoesNotExistRes"); var de_ExecutionLimitExceededRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ExecutionLimitExceeded({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ExecutionLimitExceededRes"); var de_ExecutionNotRedrivableRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ExecutionNotRedrivable({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ExecutionNotRedrivableRes"); var de_InvalidArnRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidArn({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidArnRes"); var de_InvalidDefinitionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidDefinition({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidDefinitionRes"); var de_InvalidEncryptionConfigurationRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidEncryptionConfiguration({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidEncryptionConfigurationRes"); var de_InvalidExecutionInputRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidExecutionInput({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidExecutionInputRes"); var de_InvalidLoggingConfigurationRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidLoggingConfiguration({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidLoggingConfigurationRes"); var de_InvalidNameRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidName({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidNameRes"); var de_InvalidOutputRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidOutput({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidOutputRes"); var de_InvalidTokenRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidToken({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidTokenRes"); var de_InvalidTracingConfigurationRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new InvalidTracingConfiguration({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_InvalidTracingConfigurationRes"); var de_KmsAccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new KmsAccessDeniedException({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_KmsAccessDeniedExceptionRes"); var de_KmsInvalidStateExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new KmsInvalidStateException({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_KmsInvalidStateExceptionRes"); var de_KmsThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new KmsThrottlingException({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_KmsThrottlingExceptionRes"); var de_MissingRequiredParameterRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new MissingRequiredParameter({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_MissingRequiredParameterRes"); var de_ResourceNotFoundRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ResourceNotFound({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ResourceNotFoundRes"); var de_ServiceQuotaExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ServiceQuotaExceededException({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ServiceQuotaExceededExceptionRes"); var de_StateMachineAlreadyExistsRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new StateMachineAlreadyExists({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_StateMachineAlreadyExistsRes"); var de_StateMachineDeletingRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new StateMachineDeleting({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_StateMachineDeletingRes"); var de_StateMachineDoesNotExistRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new StateMachineDoesNotExist({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_StateMachineDoesNotExistRes"); var de_StateMachineLimitExceededRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new StateMachineLimitExceeded({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_StateMachineLimitExceededRes"); var de_StateMachineTypeNotSupportedRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new StateMachineTypeNotSupported({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_StateMachineTypeNotSupportedRes"); var de_TaskDoesNotExistRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new TaskDoesNotExist({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_TaskDoesNotExistRes"); var de_TaskTimedOutRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new TaskTimedOut({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_TaskTimedOutRes"); var de_TooManyTagsRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new TooManyTags({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_TooManyTagsRes"); var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; - const deserialized = (0, import_smithy_client5._json)(body); + const deserialized = (0, import_smithy_client4._json)(body); const exception = new ValidationException({ $metadata: deserializeMetadata(parsedOutput), ...deserialized }); - return (0, import_smithy_client5.decorateServiceException)(exception, body); + return (0, import_smithy_client4.decorateServiceException)(exception, body); }, "de_ValidationExceptionRes"); var se_RedriveExecutionInput = /* @__PURE__ */ __name((input, context) => { - return (0, import_smithy_client5.take)(input, { + return (0, import_smithy_client4.take)(input, { clientToken: [true, (_) => _ ?? (0, import_uuid.v4)()], executionArn: [] }); }, "se_RedriveExecutionInput"); var se_UpdateMapRunInput = /* @__PURE__ */ __name((input, context) => { - return (0, import_smithy_client5.take)(input, { + return (0, import_smithy_client4.take)(input, { mapRunArn: [], maxConcurrency: [], toleratedFailureCount: [], - toleratedFailurePercentage: import_smithy_client5.serializeFloat + toleratedFailurePercentage: import_smithy_client4.serializeFloat }); }, "se_UpdateMapRunInput"); var de_ActivityList = /* @__PURE__ */ __name((output, context) => { @@ -25572,119 +20912,119 @@ var require_dist_cjs80 = __commonJS({ return retVal; }, "de_ActivityList"); var de_ActivityListItem = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - activityArn: import_smithy_client5.expectString, - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - name: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + activityArn: import_smithy_client4.expectString, + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + name: import_smithy_client4.expectString }); }, "de_ActivityListItem"); var de_CreateActivityOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - activityArn: import_smithy_client5.expectString, - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + activityArn: import_smithy_client4.expectString, + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_CreateActivityOutput"); var de_CreateStateMachineAliasOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineAliasArn: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineAliasArn: import_smithy_client4.expectString }); }, "de_CreateStateMachineAliasOutput"); var de_CreateStateMachineOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineArn: import_smithy_client5.expectString, - stateMachineVersionArn: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineArn: import_smithy_client4.expectString, + stateMachineVersionArn: import_smithy_client4.expectString }); }, "de_CreateStateMachineOutput"); var de_DescribeActivityOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - activityArn: import_smithy_client5.expectString, - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - encryptionConfiguration: import_smithy_client5._json, - name: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + activityArn: import_smithy_client4.expectString, + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + encryptionConfiguration: import_smithy_client4._json, + name: import_smithy_client4.expectString }); }, "de_DescribeActivityOutput"); var de_DescribeExecutionOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - cause: import_smithy_client5.expectString, - error: import_smithy_client5.expectString, - executionArn: import_smithy_client5.expectString, - input: import_smithy_client5.expectString, - inputDetails: import_smithy_client5._json, - mapRunArn: import_smithy_client5.expectString, - name: import_smithy_client5.expectString, - output: import_smithy_client5.expectString, - outputDetails: import_smithy_client5._json, - redriveCount: import_smithy_client5.expectInt32, - redriveDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - redriveStatus: import_smithy_client5.expectString, - redriveStatusReason: import_smithy_client5.expectString, - startDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineAliasArn: import_smithy_client5.expectString, - stateMachineArn: import_smithy_client5.expectString, - stateMachineVersionArn: import_smithy_client5.expectString, - status: import_smithy_client5.expectString, - stopDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - traceHeader: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + cause: import_smithy_client4.expectString, + error: import_smithy_client4.expectString, + executionArn: import_smithy_client4.expectString, + input: import_smithy_client4.expectString, + inputDetails: import_smithy_client4._json, + mapRunArn: import_smithy_client4.expectString, + name: import_smithy_client4.expectString, + output: import_smithy_client4.expectString, + outputDetails: import_smithy_client4._json, + redriveCount: import_smithy_client4.expectInt32, + redriveDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + redriveStatus: import_smithy_client4.expectString, + redriveStatusReason: import_smithy_client4.expectString, + startDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineAliasArn: import_smithy_client4.expectString, + stateMachineArn: import_smithy_client4.expectString, + stateMachineVersionArn: import_smithy_client4.expectString, + status: import_smithy_client4.expectString, + stopDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + traceHeader: import_smithy_client4.expectString }); }, "de_DescribeExecutionOutput"); var de_DescribeMapRunOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - executionArn: import_smithy_client5.expectString, - executionCounts: import_smithy_client5._json, - itemCounts: import_smithy_client5._json, - mapRunArn: import_smithy_client5.expectString, - maxConcurrency: import_smithy_client5.expectInt32, - redriveCount: import_smithy_client5.expectInt32, - redriveDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - startDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - status: import_smithy_client5.expectString, - stopDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - toleratedFailureCount: import_smithy_client5.expectLong, - toleratedFailurePercentage: import_smithy_client5.limitedParseFloat32 + return (0, import_smithy_client4.take)(output, { + executionArn: import_smithy_client4.expectString, + executionCounts: import_smithy_client4._json, + itemCounts: import_smithy_client4._json, + mapRunArn: import_smithy_client4.expectString, + maxConcurrency: import_smithy_client4.expectInt32, + redriveCount: import_smithy_client4.expectInt32, + redriveDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + startDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + status: import_smithy_client4.expectString, + stopDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + toleratedFailureCount: import_smithy_client4.expectLong, + toleratedFailurePercentage: import_smithy_client4.limitedParseFloat32 }); }, "de_DescribeMapRunOutput"); var de_DescribeStateMachineAliasOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - description: import_smithy_client5.expectString, - name: import_smithy_client5.expectString, - routingConfiguration: import_smithy_client5._json, - stateMachineAliasArn: import_smithy_client5.expectString, - updateDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + description: import_smithy_client4.expectString, + name: import_smithy_client4.expectString, + routingConfiguration: import_smithy_client4._json, + stateMachineAliasArn: import_smithy_client4.expectString, + updateDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_DescribeStateMachineAliasOutput"); var de_DescribeStateMachineForExecutionOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - definition: import_smithy_client5.expectString, - encryptionConfiguration: import_smithy_client5._json, - label: import_smithy_client5.expectString, - loggingConfiguration: import_smithy_client5._json, - mapRunArn: import_smithy_client5.expectString, - name: import_smithy_client5.expectString, - revisionId: import_smithy_client5.expectString, - roleArn: import_smithy_client5.expectString, - stateMachineArn: import_smithy_client5.expectString, - tracingConfiguration: import_smithy_client5._json, - updateDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + definition: import_smithy_client4.expectString, + encryptionConfiguration: import_smithy_client4._json, + label: import_smithy_client4.expectString, + loggingConfiguration: import_smithy_client4._json, + mapRunArn: import_smithy_client4.expectString, + name: import_smithy_client4.expectString, + revisionId: import_smithy_client4.expectString, + roleArn: import_smithy_client4.expectString, + stateMachineArn: import_smithy_client4.expectString, + tracingConfiguration: import_smithy_client4._json, + updateDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_DescribeStateMachineForExecutionOutput"); var de_DescribeStateMachineOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - definition: import_smithy_client5.expectString, - description: import_smithy_client5.expectString, - encryptionConfiguration: import_smithy_client5._json, - label: import_smithy_client5.expectString, - loggingConfiguration: import_smithy_client5._json, - name: import_smithy_client5.expectString, - revisionId: import_smithy_client5.expectString, - roleArn: import_smithy_client5.expectString, - stateMachineArn: import_smithy_client5.expectString, - status: import_smithy_client5.expectString, - tracingConfiguration: import_smithy_client5._json, - type: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + definition: import_smithy_client4.expectString, + description: import_smithy_client4.expectString, + encryptionConfiguration: import_smithy_client4._json, + label: import_smithy_client4.expectString, + loggingConfiguration: import_smithy_client4._json, + name: import_smithy_client4.expectString, + revisionId: import_smithy_client4.expectString, + roleArn: import_smithy_client4.expectString, + stateMachineArn: import_smithy_client4.expectString, + status: import_smithy_client4.expectString, + tracingConfiguration: import_smithy_client4._json, + type: import_smithy_client4.expectString }); }, "de_DescribeStateMachineOutput"); var de_ExecutionList = /* @__PURE__ */ __name((output, context) => { @@ -25694,69 +21034,69 @@ var require_dist_cjs80 = __commonJS({ return retVal; }, "de_ExecutionList"); var de_ExecutionListItem = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - executionArn: import_smithy_client5.expectString, - itemCount: import_smithy_client5.expectInt32, - mapRunArn: import_smithy_client5.expectString, - name: import_smithy_client5.expectString, - redriveCount: import_smithy_client5.expectInt32, - redriveDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - startDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineAliasArn: import_smithy_client5.expectString, - stateMachineArn: import_smithy_client5.expectString, - stateMachineVersionArn: import_smithy_client5.expectString, - status: import_smithy_client5.expectString, - stopDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + executionArn: import_smithy_client4.expectString, + itemCount: import_smithy_client4.expectInt32, + mapRunArn: import_smithy_client4.expectString, + name: import_smithy_client4.expectString, + redriveCount: import_smithy_client4.expectInt32, + redriveDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + startDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineAliasArn: import_smithy_client4.expectString, + stateMachineArn: import_smithy_client4.expectString, + stateMachineVersionArn: import_smithy_client4.expectString, + status: import_smithy_client4.expectString, + stopDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_ExecutionListItem"); var de_GetExecutionHistoryOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { + return (0, import_smithy_client4.take)(output, { events: (_) => de_HistoryEventList(_, context), - nextToken: import_smithy_client5.expectString + nextToken: import_smithy_client4.expectString }); }, "de_GetExecutionHistoryOutput"); var de_HistoryEvent = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - activityFailedEventDetails: import_smithy_client5._json, - activityScheduleFailedEventDetails: import_smithy_client5._json, - activityScheduledEventDetails: import_smithy_client5._json, - activityStartedEventDetails: import_smithy_client5._json, - activitySucceededEventDetails: import_smithy_client5._json, - activityTimedOutEventDetails: import_smithy_client5._json, - executionAbortedEventDetails: import_smithy_client5._json, - executionFailedEventDetails: import_smithy_client5._json, - executionRedrivenEventDetails: import_smithy_client5._json, - executionStartedEventDetails: import_smithy_client5._json, - executionSucceededEventDetails: import_smithy_client5._json, - executionTimedOutEventDetails: import_smithy_client5._json, - id: import_smithy_client5.expectLong, - lambdaFunctionFailedEventDetails: import_smithy_client5._json, - lambdaFunctionScheduleFailedEventDetails: import_smithy_client5._json, - lambdaFunctionScheduledEventDetails: import_smithy_client5._json, - lambdaFunctionStartFailedEventDetails: import_smithy_client5._json, - lambdaFunctionSucceededEventDetails: import_smithy_client5._json, - lambdaFunctionTimedOutEventDetails: import_smithy_client5._json, - mapIterationAbortedEventDetails: import_smithy_client5._json, - mapIterationFailedEventDetails: import_smithy_client5._json, - mapIterationStartedEventDetails: import_smithy_client5._json, - mapIterationSucceededEventDetails: import_smithy_client5._json, - mapRunFailedEventDetails: import_smithy_client5._json, - mapRunRedrivenEventDetails: import_smithy_client5._json, - mapRunStartedEventDetails: import_smithy_client5._json, - mapStateStartedEventDetails: import_smithy_client5._json, - previousEventId: import_smithy_client5.expectLong, - stateEnteredEventDetails: import_smithy_client5._json, - stateExitedEventDetails: import_smithy_client5._json, - taskFailedEventDetails: import_smithy_client5._json, - taskScheduledEventDetails: import_smithy_client5._json, - taskStartFailedEventDetails: import_smithy_client5._json, - taskStartedEventDetails: import_smithy_client5._json, - taskSubmitFailedEventDetails: import_smithy_client5._json, - taskSubmittedEventDetails: import_smithy_client5._json, - taskSucceededEventDetails: import_smithy_client5._json, - taskTimedOutEventDetails: import_smithy_client5._json, - timestamp: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - type: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + activityFailedEventDetails: import_smithy_client4._json, + activityScheduleFailedEventDetails: import_smithy_client4._json, + activityScheduledEventDetails: import_smithy_client4._json, + activityStartedEventDetails: import_smithy_client4._json, + activitySucceededEventDetails: import_smithy_client4._json, + activityTimedOutEventDetails: import_smithy_client4._json, + executionAbortedEventDetails: import_smithy_client4._json, + executionFailedEventDetails: import_smithy_client4._json, + executionRedrivenEventDetails: import_smithy_client4._json, + executionStartedEventDetails: import_smithy_client4._json, + executionSucceededEventDetails: import_smithy_client4._json, + executionTimedOutEventDetails: import_smithy_client4._json, + id: import_smithy_client4.expectLong, + lambdaFunctionFailedEventDetails: import_smithy_client4._json, + lambdaFunctionScheduleFailedEventDetails: import_smithy_client4._json, + lambdaFunctionScheduledEventDetails: import_smithy_client4._json, + lambdaFunctionStartFailedEventDetails: import_smithy_client4._json, + lambdaFunctionSucceededEventDetails: import_smithy_client4._json, + lambdaFunctionTimedOutEventDetails: import_smithy_client4._json, + mapIterationAbortedEventDetails: import_smithy_client4._json, + mapIterationFailedEventDetails: import_smithy_client4._json, + mapIterationStartedEventDetails: import_smithy_client4._json, + mapIterationSucceededEventDetails: import_smithy_client4._json, + mapRunFailedEventDetails: import_smithy_client4._json, + mapRunRedrivenEventDetails: import_smithy_client4._json, + mapRunStartedEventDetails: import_smithy_client4._json, + mapStateStartedEventDetails: import_smithy_client4._json, + previousEventId: import_smithy_client4.expectLong, + stateEnteredEventDetails: import_smithy_client4._json, + stateExitedEventDetails: import_smithy_client4._json, + taskFailedEventDetails: import_smithy_client4._json, + taskScheduledEventDetails: import_smithy_client4._json, + taskStartFailedEventDetails: import_smithy_client4._json, + taskStartedEventDetails: import_smithy_client4._json, + taskSubmitFailedEventDetails: import_smithy_client4._json, + taskSubmittedEventDetails: import_smithy_client4._json, + taskSucceededEventDetails: import_smithy_client4._json, + taskTimedOutEventDetails: import_smithy_client4._json, + timestamp: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + type: import_smithy_client4.expectString }); }, "de_HistoryEvent"); var de_HistoryEventList = /* @__PURE__ */ __name((output, context) => { @@ -25766,38 +21106,38 @@ var require_dist_cjs80 = __commonJS({ return retVal; }, "de_HistoryEventList"); var de_ListActivitiesOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { + return (0, import_smithy_client4.take)(output, { activities: (_) => de_ActivityList(_, context), - nextToken: import_smithy_client5.expectString + nextToken: import_smithy_client4.expectString }); }, "de_ListActivitiesOutput"); var de_ListExecutionsOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { + return (0, import_smithy_client4.take)(output, { executions: (_) => de_ExecutionList(_, context), - nextToken: import_smithy_client5.expectString + nextToken: import_smithy_client4.expectString }); }, "de_ListExecutionsOutput"); var de_ListMapRunsOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { + return (0, import_smithy_client4.take)(output, { mapRuns: (_) => de_MapRunList(_, context), - nextToken: import_smithy_client5.expectString + nextToken: import_smithy_client4.expectString }); }, "de_ListMapRunsOutput"); var de_ListStateMachineAliasesOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - nextToken: import_smithy_client5.expectString, + return (0, import_smithy_client4.take)(output, { + nextToken: import_smithy_client4.expectString, stateMachineAliases: (_) => de_StateMachineAliasList(_, context) }); }, "de_ListStateMachineAliasesOutput"); var de_ListStateMachinesOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - nextToken: import_smithy_client5.expectString, + return (0, import_smithy_client4.take)(output, { + nextToken: import_smithy_client4.expectString, stateMachines: (_) => de_StateMachineList(_, context) }); }, "de_ListStateMachinesOutput"); var de_ListStateMachineVersionsOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - nextToken: import_smithy_client5.expectString, + return (0, import_smithy_client4.take)(output, { + nextToken: import_smithy_client4.expectString, stateMachineVersions: (_) => de_StateMachineVersionList(_, context) }); }, "de_ListStateMachineVersionsOutput"); @@ -25808,47 +21148,47 @@ var require_dist_cjs80 = __commonJS({ return retVal; }, "de_MapRunList"); var de_MapRunListItem = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - executionArn: import_smithy_client5.expectString, - mapRunArn: import_smithy_client5.expectString, - startDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineArn: import_smithy_client5.expectString, - stopDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + executionArn: import_smithy_client4.expectString, + mapRunArn: import_smithy_client4.expectString, + startDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineArn: import_smithy_client4.expectString, + stopDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_MapRunListItem"); var de_PublishStateMachineVersionOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineVersionArn: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineVersionArn: import_smithy_client4.expectString }); }, "de_PublishStateMachineVersionOutput"); var de_RedriveExecutionOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - redriveDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + redriveDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_RedriveExecutionOutput"); var de_StartExecutionOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - executionArn: import_smithy_client5.expectString, - startDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + executionArn: import_smithy_client4.expectString, + startDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_StartExecutionOutput"); var de_StartSyncExecutionOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - billingDetails: import_smithy_client5._json, - cause: import_smithy_client5.expectString, - error: import_smithy_client5.expectString, - executionArn: import_smithy_client5.expectString, - input: import_smithy_client5.expectString, - inputDetails: import_smithy_client5._json, - name: import_smithy_client5.expectString, - output: import_smithy_client5.expectString, - outputDetails: import_smithy_client5._json, - startDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineArn: import_smithy_client5.expectString, - status: import_smithy_client5.expectString, - stopDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - traceHeader: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + billingDetails: import_smithy_client4._json, + cause: import_smithy_client4.expectString, + error: import_smithy_client4.expectString, + executionArn: import_smithy_client4.expectString, + input: import_smithy_client4.expectString, + inputDetails: import_smithy_client4._json, + name: import_smithy_client4.expectString, + output: import_smithy_client4.expectString, + outputDetails: import_smithy_client4._json, + startDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineArn: import_smithy_client4.expectString, + status: import_smithy_client4.expectString, + stopDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + traceHeader: import_smithy_client4.expectString }); }, "de_StartSyncExecutionOutput"); var de_StateMachineAliasList = /* @__PURE__ */ __name((output, context) => { @@ -25858,9 +21198,9 @@ var require_dist_cjs80 = __commonJS({ return retVal; }, "de_StateMachineAliasList"); var de_StateMachineAliasListItem = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineAliasArn: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineAliasArn: import_smithy_client4.expectString }); }, "de_StateMachineAliasListItem"); var de_StateMachineList = /* @__PURE__ */ __name((output, context) => { @@ -25870,11 +21210,11 @@ var require_dist_cjs80 = __commonJS({ return retVal; }, "de_StateMachineList"); var de_StateMachineListItem = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - name: import_smithy_client5.expectString, - stateMachineArn: import_smithy_client5.expectString, - type: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + name: import_smithy_client4.expectString, + stateMachineArn: import_smithy_client4.expectString, + type: import_smithy_client4.expectString }); }, "de_StateMachineListItem"); var de_StateMachineVersionList = /* @__PURE__ */ __name((output, context) => { @@ -25884,26 +21224,26 @@ var require_dist_cjs80 = __commonJS({ return retVal; }, "de_StateMachineVersionList"); var de_StateMachineVersionListItem = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - creationDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))), - stateMachineVersionArn: import_smithy_client5.expectString + return (0, import_smithy_client4.take)(output, { + creationDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))), + stateMachineVersionArn: import_smithy_client4.expectString }); }, "de_StateMachineVersionListItem"); var de_StopExecutionOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - stopDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + stopDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_StopExecutionOutput"); var de_UpdateStateMachineAliasOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - updateDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + updateDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_UpdateStateMachineAliasOutput"); var de_UpdateStateMachineOutput = /* @__PURE__ */ __name((output, context) => { - return (0, import_smithy_client5.take)(output, { - revisionId: import_smithy_client5.expectString, - stateMachineVersionArn: import_smithy_client5.expectString, - updateDate: (_) => (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.parseEpochTimestamp)((0, import_smithy_client5.expectNumber)(_))) + return (0, import_smithy_client4.take)(output, { + revisionId: import_smithy_client4.expectString, + stateMachineVersionArn: import_smithy_client4.expectString, + updateDate: (_) => (0, import_smithy_client4.expectNonNull)((0, import_smithy_client4.parseEpochTimestamp)((0, import_smithy_client4.expectNumber)(_))) }); }, "de_UpdateStateMachineOutput"); var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ @@ -25912,7 +21252,7 @@ var require_dist_cjs80 = __commonJS({ extendedRequestId: output.headers["x-amz-id-2"], cfId: output.headers["x-amz-cf-id"] }), "deserializeMetadata"); - var throwDefaultError = (0, import_smithy_client5.withBaseException)(SFNServiceException); + var throwDefaultError = (0, import_smithy_client4.withBaseException)(SFNServiceException); var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => { const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); const contents = { @@ -25938,408 +21278,408 @@ var require_dist_cjs80 = __commonJS({ }; } __name(sharedHeaders, "sharedHeaders"); - var _CreateActivityCommand = class _CreateActivityCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _CreateActivityCommand = class _CreateActivityCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "CreateActivity", {}).n("SFNClient", "CreateActivityCommand").f(void 0, void 0).ser(se_CreateActivityCommand).de(de_CreateActivityCommand).build() { }; __name(_CreateActivityCommand, "CreateActivityCommand"); var CreateActivityCommand = _CreateActivityCommand; - var _CreateStateMachineAliasCommand = class _CreateStateMachineAliasCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _CreateStateMachineAliasCommand = class _CreateStateMachineAliasCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "CreateStateMachineAlias", {}).n("SFNClient", "CreateStateMachineAliasCommand").f(CreateStateMachineAliasInputFilterSensitiveLog, void 0).ser(se_CreateStateMachineAliasCommand).de(de_CreateStateMachineAliasCommand).build() { }; __name(_CreateStateMachineAliasCommand, "CreateStateMachineAliasCommand"); var CreateStateMachineAliasCommand = _CreateStateMachineAliasCommand; - var _CreateStateMachineCommand = class _CreateStateMachineCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _CreateStateMachineCommand = class _CreateStateMachineCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "CreateStateMachine", {}).n("SFNClient", "CreateStateMachineCommand").f(CreateStateMachineInputFilterSensitiveLog, void 0).ser(se_CreateStateMachineCommand).de(de_CreateStateMachineCommand).build() { }; __name(_CreateStateMachineCommand, "CreateStateMachineCommand"); var CreateStateMachineCommand = _CreateStateMachineCommand; - var _DeleteActivityCommand = class _DeleteActivityCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DeleteActivityCommand = class _DeleteActivityCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DeleteActivity", {}).n("SFNClient", "DeleteActivityCommand").f(void 0, void 0).ser(se_DeleteActivityCommand).de(de_DeleteActivityCommand).build() { }; __name(_DeleteActivityCommand, "DeleteActivityCommand"); var DeleteActivityCommand = _DeleteActivityCommand; - var _DeleteStateMachineAliasCommand = class _DeleteStateMachineAliasCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DeleteStateMachineAliasCommand = class _DeleteStateMachineAliasCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DeleteStateMachineAlias", {}).n("SFNClient", "DeleteStateMachineAliasCommand").f(void 0, void 0).ser(se_DeleteStateMachineAliasCommand).de(de_DeleteStateMachineAliasCommand).build() { }; __name(_DeleteStateMachineAliasCommand, "DeleteStateMachineAliasCommand"); var DeleteStateMachineAliasCommand = _DeleteStateMachineAliasCommand; - var _DeleteStateMachineCommand = class _DeleteStateMachineCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DeleteStateMachineCommand = class _DeleteStateMachineCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DeleteStateMachine", {}).n("SFNClient", "DeleteStateMachineCommand").f(void 0, void 0).ser(se_DeleteStateMachineCommand).de(de_DeleteStateMachineCommand).build() { }; __name(_DeleteStateMachineCommand, "DeleteStateMachineCommand"); var DeleteStateMachineCommand = _DeleteStateMachineCommand; - var _DeleteStateMachineVersionCommand = class _DeleteStateMachineVersionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DeleteStateMachineVersionCommand = class _DeleteStateMachineVersionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DeleteStateMachineVersion", {}).n("SFNClient", "DeleteStateMachineVersionCommand").f(void 0, void 0).ser(se_DeleteStateMachineVersionCommand).de(de_DeleteStateMachineVersionCommand).build() { }; __name(_DeleteStateMachineVersionCommand, "DeleteStateMachineVersionCommand"); var DeleteStateMachineVersionCommand = _DeleteStateMachineVersionCommand; - var _DescribeActivityCommand = class _DescribeActivityCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DescribeActivityCommand = class _DescribeActivityCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DescribeActivity", {}).n("SFNClient", "DescribeActivityCommand").f(void 0, void 0).ser(se_DescribeActivityCommand).de(de_DescribeActivityCommand).build() { }; __name(_DescribeActivityCommand, "DescribeActivityCommand"); var DescribeActivityCommand = _DescribeActivityCommand; - var _DescribeExecutionCommand = class _DescribeExecutionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DescribeExecutionCommand = class _DescribeExecutionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DescribeExecution", {}).n("SFNClient", "DescribeExecutionCommand").f(void 0, DescribeExecutionOutputFilterSensitiveLog).ser(se_DescribeExecutionCommand).de(de_DescribeExecutionCommand).build() { }; __name(_DescribeExecutionCommand, "DescribeExecutionCommand"); var DescribeExecutionCommand = _DescribeExecutionCommand; - var _DescribeMapRunCommand = class _DescribeMapRunCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DescribeMapRunCommand = class _DescribeMapRunCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DescribeMapRun", {}).n("SFNClient", "DescribeMapRunCommand").f(void 0, void 0).ser(se_DescribeMapRunCommand).de(de_DescribeMapRunCommand).build() { }; __name(_DescribeMapRunCommand, "DescribeMapRunCommand"); var DescribeMapRunCommand = _DescribeMapRunCommand; - var _DescribeStateMachineAliasCommand = class _DescribeStateMachineAliasCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DescribeStateMachineAliasCommand = class _DescribeStateMachineAliasCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DescribeStateMachineAlias", {}).n("SFNClient", "DescribeStateMachineAliasCommand").f(void 0, DescribeStateMachineAliasOutputFilterSensitiveLog).ser(se_DescribeStateMachineAliasCommand).de(de_DescribeStateMachineAliasCommand).build() { }; __name(_DescribeStateMachineAliasCommand, "DescribeStateMachineAliasCommand"); var DescribeStateMachineAliasCommand = _DescribeStateMachineAliasCommand; - var _DescribeStateMachineCommand = class _DescribeStateMachineCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DescribeStateMachineCommand = class _DescribeStateMachineCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DescribeStateMachine", {}).n("SFNClient", "DescribeStateMachineCommand").f(void 0, DescribeStateMachineOutputFilterSensitiveLog).ser(se_DescribeStateMachineCommand).de(de_DescribeStateMachineCommand).build() { }; __name(_DescribeStateMachineCommand, "DescribeStateMachineCommand"); var DescribeStateMachineCommand = _DescribeStateMachineCommand; - var _DescribeStateMachineForExecutionCommand = class _DescribeStateMachineForExecutionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _DescribeStateMachineForExecutionCommand = class _DescribeStateMachineForExecutionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "DescribeStateMachineForExecution", {}).n("SFNClient", "DescribeStateMachineForExecutionCommand").f(void 0, DescribeStateMachineForExecutionOutputFilterSensitiveLog).ser(se_DescribeStateMachineForExecutionCommand).de(de_DescribeStateMachineForExecutionCommand).build() { }; __name(_DescribeStateMachineForExecutionCommand, "DescribeStateMachineForExecutionCommand"); var DescribeStateMachineForExecutionCommand = _DescribeStateMachineForExecutionCommand; - var _GetActivityTaskCommand = class _GetActivityTaskCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _GetActivityTaskCommand = class _GetActivityTaskCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "GetActivityTask", {}).n("SFNClient", "GetActivityTaskCommand").f(void 0, GetActivityTaskOutputFilterSensitiveLog).ser(se_GetActivityTaskCommand).de(de_GetActivityTaskCommand).build() { }; __name(_GetActivityTaskCommand, "GetActivityTaskCommand"); var GetActivityTaskCommand = _GetActivityTaskCommand; - var _GetExecutionHistoryCommand = class _GetExecutionHistoryCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _GetExecutionHistoryCommand = class _GetExecutionHistoryCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "GetExecutionHistory", {}).n("SFNClient", "GetExecutionHistoryCommand").f(void 0, GetExecutionHistoryOutputFilterSensitiveLog).ser(se_GetExecutionHistoryCommand).de(de_GetExecutionHistoryCommand).build() { }; __name(_GetExecutionHistoryCommand, "GetExecutionHistoryCommand"); var GetExecutionHistoryCommand = _GetExecutionHistoryCommand; - var _ListActivitiesCommand = class _ListActivitiesCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListActivitiesCommand = class _ListActivitiesCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "ListActivities", {}).n("SFNClient", "ListActivitiesCommand").f(void 0, void 0).ser(se_ListActivitiesCommand).de(de_ListActivitiesCommand).build() { }; __name(_ListActivitiesCommand, "ListActivitiesCommand"); var ListActivitiesCommand = _ListActivitiesCommand; - var _ListExecutionsCommand = class _ListExecutionsCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListExecutionsCommand = class _ListExecutionsCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "ListExecutions", {}).n("SFNClient", "ListExecutionsCommand").f(void 0, void 0).ser(se_ListExecutionsCommand).de(de_ListExecutionsCommand).build() { }; __name(_ListExecutionsCommand, "ListExecutionsCommand"); var ListExecutionsCommand = _ListExecutionsCommand; - var _ListMapRunsCommand = class _ListMapRunsCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListMapRunsCommand = class _ListMapRunsCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "ListMapRuns", {}).n("SFNClient", "ListMapRunsCommand").f(void 0, void 0).ser(se_ListMapRunsCommand).de(de_ListMapRunsCommand).build() { }; __name(_ListMapRunsCommand, "ListMapRunsCommand"); var ListMapRunsCommand = _ListMapRunsCommand; - var _ListStateMachineAliasesCommand = class _ListStateMachineAliasesCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListStateMachineAliasesCommand = class _ListStateMachineAliasesCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "ListStateMachineAliases", {}).n("SFNClient", "ListStateMachineAliasesCommand").f(void 0, void 0).ser(se_ListStateMachineAliasesCommand).de(de_ListStateMachineAliasesCommand).build() { }; __name(_ListStateMachineAliasesCommand, "ListStateMachineAliasesCommand"); var ListStateMachineAliasesCommand = _ListStateMachineAliasesCommand; - var _ListStateMachinesCommand = class _ListStateMachinesCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListStateMachinesCommand = class _ListStateMachinesCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "ListStateMachines", {}).n("SFNClient", "ListStateMachinesCommand").f(void 0, void 0).ser(se_ListStateMachinesCommand).de(de_ListStateMachinesCommand).build() { }; __name(_ListStateMachinesCommand, "ListStateMachinesCommand"); var ListStateMachinesCommand = _ListStateMachinesCommand; - var _ListStateMachineVersionsCommand = class _ListStateMachineVersionsCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListStateMachineVersionsCommand = class _ListStateMachineVersionsCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "ListStateMachineVersions", {}).n("SFNClient", "ListStateMachineVersionsCommand").f(void 0, void 0).ser(se_ListStateMachineVersionsCommand).de(de_ListStateMachineVersionsCommand).build() { }; __name(_ListStateMachineVersionsCommand, "ListStateMachineVersionsCommand"); var ListStateMachineVersionsCommand = _ListStateMachineVersionsCommand; - var _ListTagsForResourceCommand = class _ListTagsForResourceCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ListTagsForResourceCommand = class _ListTagsForResourceCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "ListTagsForResource", {}).n("SFNClient", "ListTagsForResourceCommand").f(void 0, void 0).ser(se_ListTagsForResourceCommand).de(de_ListTagsForResourceCommand).build() { }; __name(_ListTagsForResourceCommand, "ListTagsForResourceCommand"); var ListTagsForResourceCommand = _ListTagsForResourceCommand; - var _PublishStateMachineVersionCommand = class _PublishStateMachineVersionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _PublishStateMachineVersionCommand = class _PublishStateMachineVersionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "PublishStateMachineVersion", {}).n("SFNClient", "PublishStateMachineVersionCommand").f(PublishStateMachineVersionInputFilterSensitiveLog, void 0).ser(se_PublishStateMachineVersionCommand).de(de_PublishStateMachineVersionCommand).build() { }; __name(_PublishStateMachineVersionCommand, "PublishStateMachineVersionCommand"); var PublishStateMachineVersionCommand = _PublishStateMachineVersionCommand; - var _RedriveExecutionCommand = class _RedriveExecutionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _RedriveExecutionCommand = class _RedriveExecutionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "RedriveExecution", {}).n("SFNClient", "RedriveExecutionCommand").f(void 0, void 0).ser(se_RedriveExecutionCommand).de(de_RedriveExecutionCommand).build() { }; __name(_RedriveExecutionCommand, "RedriveExecutionCommand"); var RedriveExecutionCommand = _RedriveExecutionCommand; - var _SendTaskFailureCommand = class _SendTaskFailureCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _SendTaskFailureCommand = class _SendTaskFailureCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "SendTaskFailure", {}).n("SFNClient", "SendTaskFailureCommand").f(SendTaskFailureInputFilterSensitiveLog, void 0).ser(se_SendTaskFailureCommand).de(de_SendTaskFailureCommand).build() { }; __name(_SendTaskFailureCommand, "SendTaskFailureCommand"); var SendTaskFailureCommand = _SendTaskFailureCommand; - var _SendTaskHeartbeatCommand = class _SendTaskHeartbeatCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _SendTaskHeartbeatCommand = class _SendTaskHeartbeatCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "SendTaskHeartbeat", {}).n("SFNClient", "SendTaskHeartbeatCommand").f(void 0, void 0).ser(se_SendTaskHeartbeatCommand).de(de_SendTaskHeartbeatCommand).build() { }; __name(_SendTaskHeartbeatCommand, "SendTaskHeartbeatCommand"); var SendTaskHeartbeatCommand = _SendTaskHeartbeatCommand; - var _SendTaskSuccessCommand = class _SendTaskSuccessCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _SendTaskSuccessCommand = class _SendTaskSuccessCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "SendTaskSuccess", {}).n("SFNClient", "SendTaskSuccessCommand").f(SendTaskSuccessInputFilterSensitiveLog, void 0).ser(se_SendTaskSuccessCommand).de(de_SendTaskSuccessCommand).build() { }; __name(_SendTaskSuccessCommand, "SendTaskSuccessCommand"); var SendTaskSuccessCommand = _SendTaskSuccessCommand; - var _StartExecutionCommand = class _StartExecutionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _StartExecutionCommand = class _StartExecutionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "StartExecution", {}).n("SFNClient", "StartExecutionCommand").f(StartExecutionInputFilterSensitiveLog, void 0).ser(se_StartExecutionCommand).de(de_StartExecutionCommand).build() { }; __name(_StartExecutionCommand, "StartExecutionCommand"); var StartExecutionCommand = _StartExecutionCommand; - var _StartSyncExecutionCommand = class _StartSyncExecutionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _StartSyncExecutionCommand = class _StartSyncExecutionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "StartSyncExecution", {}).n("SFNClient", "StartSyncExecutionCommand").f(StartSyncExecutionInputFilterSensitiveLog, StartSyncExecutionOutputFilterSensitiveLog).ser(se_StartSyncExecutionCommand).de(de_StartSyncExecutionCommand).build() { }; __name(_StartSyncExecutionCommand, "StartSyncExecutionCommand"); var StartSyncExecutionCommand = _StartSyncExecutionCommand; - var _StopExecutionCommand = class _StopExecutionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _StopExecutionCommand = class _StopExecutionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "StopExecution", {}).n("SFNClient", "StopExecutionCommand").f(StopExecutionInputFilterSensitiveLog, void 0).ser(se_StopExecutionCommand).de(de_StopExecutionCommand).build() { }; __name(_StopExecutionCommand, "StopExecutionCommand"); var StopExecutionCommand = _StopExecutionCommand; - var _TagResourceCommand = class _TagResourceCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _TagResourceCommand = class _TagResourceCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "TagResource", {}).n("SFNClient", "TagResourceCommand").f(void 0, void 0).ser(se_TagResourceCommand).de(de_TagResourceCommand).build() { }; __name(_TagResourceCommand, "TagResourceCommand"); var TagResourceCommand = _TagResourceCommand; - var _TestStateCommand = class _TestStateCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _TestStateCommand = class _TestStateCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "TestState", {}).n("SFNClient", "TestStateCommand").f(TestStateInputFilterSensitiveLog, TestStateOutputFilterSensitiveLog).ser(se_TestStateCommand).de(de_TestStateCommand).build() { }; __name(_TestStateCommand, "TestStateCommand"); var TestStateCommand = _TestStateCommand; - var _UntagResourceCommand = class _UntagResourceCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _UntagResourceCommand = class _UntagResourceCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "UntagResource", {}).n("SFNClient", "UntagResourceCommand").f(void 0, void 0).ser(se_UntagResourceCommand).de(de_UntagResourceCommand).build() { }; __name(_UntagResourceCommand, "UntagResourceCommand"); var UntagResourceCommand = _UntagResourceCommand; - var _UpdateMapRunCommand = class _UpdateMapRunCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _UpdateMapRunCommand = class _UpdateMapRunCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "UpdateMapRun", {}).n("SFNClient", "UpdateMapRunCommand").f(void 0, void 0).ser(se_UpdateMapRunCommand).de(de_UpdateMapRunCommand).build() { }; __name(_UpdateMapRunCommand, "UpdateMapRunCommand"); var UpdateMapRunCommand = _UpdateMapRunCommand; - var _UpdateStateMachineAliasCommand = class _UpdateStateMachineAliasCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _UpdateStateMachineAliasCommand = class _UpdateStateMachineAliasCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "UpdateStateMachineAlias", {}).n("SFNClient", "UpdateStateMachineAliasCommand").f(UpdateStateMachineAliasInputFilterSensitiveLog, void 0).ser(se_UpdateStateMachineAliasCommand).de(de_UpdateStateMachineAliasCommand).build() { }; __name(_UpdateStateMachineAliasCommand, "UpdateStateMachineAliasCommand"); var UpdateStateMachineAliasCommand = _UpdateStateMachineAliasCommand; - var _UpdateStateMachineCommand = class _UpdateStateMachineCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _UpdateStateMachineCommand = class _UpdateStateMachineCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "UpdateStateMachine", {}).n("SFNClient", "UpdateStateMachineCommand").f(UpdateStateMachineInputFilterSensitiveLog, void 0).ser(se_UpdateStateMachineCommand).de(de_UpdateStateMachineCommand).build() { }; __name(_UpdateStateMachineCommand, "UpdateStateMachineCommand"); var UpdateStateMachineCommand = _UpdateStateMachineCommand; - var _ValidateStateMachineDefinitionCommand = class _ValidateStateMachineDefinitionCommand extends import_smithy_client5.Command.classBuilder().ep({ + var _ValidateStateMachineDefinitionCommand = class _ValidateStateMachineDefinitionCommand extends import_smithy_client4.Command.classBuilder().ep({ ...commonParams }).m(function(Command, cs, config, o) { return [ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize), - (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) ]; }).s("AWSStepFunctions", "ValidateStateMachineDefinition", {}).n("SFNClient", "ValidateStateMachineDefinitionCommand").f(ValidateStateMachineDefinitionInputFilterSensitiveLog, void 0).ser(se_ValidateStateMachineDefinitionCommand).de(de_ValidateStateMachineDefinitionCommand).build() { }; @@ -26388,7 +21728,7 @@ var require_dist_cjs80 = __commonJS({ }; __name(_SFN, "SFN"); var SFN2 = _SFN; - (0, import_smithy_client5.createAggregatedClient)(commands, SFN2); + (0, import_smithy_client4.createAggregatedClient)(commands, SFN2); var paginateGetExecutionHistory = (0, import_core3.createPaginator)(SFNClient, GetExecutionHistoryCommand, "nextToken", "nextToken", "maxResults"); var paginateListActivities = (0, import_core3.createPaginator)(SFNClient, ListActivitiesCommand, "nextToken", "nextToken", "maxResults"); var paginateListExecutions = (0, import_core3.createPaginator)(SFNClient, ListExecutionsCommand, "nextToken", "nextToken", "maxResults"); @@ -34732,7 +30072,7 @@ var import_helpers_internal = __toESM(require_helpers_internal()); // lib/assertions/providers/lambda-handler/base.ts var https = __toESM(require("https")); var url = __toESM(require("url")); -var import_client_sfn = __toESM(require_dist_cjs80()); +var import_client_sfn = __toESM(require_dist_cjs53()); var CustomResourceHandler = class { constructor(event, context) { this.event = event; diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/aws-cdk-scheduler-targets-firehose-put-record.assets.json b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/aws-cdk-scheduler-targets-firehose-put-record.assets.json index 71805a8864d7b..afc674925e5a9 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/aws-cdk-scheduler-targets-firehose-put-record.assets.json +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/aws-cdk-scheduler-targets-firehose-put-record.assets.json @@ -14,7 +14,7 @@ } } }, - "b294e83eca6f470c39e7c0370b0118ec835f0f4c29ef07c651c402f89dee2f55": { + "f569395a4a44f508c8621208274341ea9bb959b3d5c2e827800776ba34832173": { "source": { "path": "aws-cdk-scheduler-targets-firehose-put-record.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b294e83eca6f470c39e7c0370b0118ec835f0f4c29ef07c651c402f89dee2f55.json", + "objectKey": "f569395a4a44f508c8621208274341ea9bb959b3d5c2e827800776ba34832173.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/aws-cdk-scheduler-targets-firehose-put-record.template.json b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/aws-cdk-scheduler-targets-firehose-put-record.template.json index 3596ac3e751bd..e7f0c59070e65 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/aws-cdk-scheduler-targets-firehose-put-record.template.json +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/aws-cdk-scheduler-targets-firehose-put-record.template.json @@ -208,6 +208,19 @@ ] } ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "MyFirehoseStreamLogGroup5DE95CF8", + "Arn" + ] + } } ], "Version": "2012-10-17" @@ -220,10 +233,29 @@ ] } }, - "MyFirehose": { + "MyFirehoseStreamLogGroup5DE95CF8": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 731 + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "MyFirehoseStreamLogGroupS3DestinationB2F1AD1D": { + "Type": "AWS::Logs::LogStream", + "Properties": { + "LogGroupName": { + "Ref": "MyFirehoseStreamLogGroup5DE95CF8" + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "MyFirehoseStream2282904B": { "Type": "AWS::KinesisFirehose::DeliveryStream", "Properties": { - "S3DestinationConfiguration": { + "DeliveryStreamType": "DirectPut", + "ExtendedS3DestinationConfiguration": { "BucketARN": { "Fn::GetAtt": [ "DestinationBucket4BECDB47", @@ -231,7 +263,17 @@ ] }, "BufferingHints": { - "IntervalInSeconds": 60 + "IntervalInSeconds": 60, + "SizeInMBs": 5 + }, + "CloudWatchLoggingOptions": { + "Enabled": true, + "LogGroupName": { + "Ref": "MyFirehoseStreamLogGroup5DE95CF8" + }, + "LogStreamName": { + "Ref": "MyFirehoseStreamLogGroupS3DestinationB2F1AD1D" + } }, "RoleARN": { "Fn::GetAtt": [ @@ -240,7 +282,10 @@ ] } } - } + }, + "DependsOn": [ + "deliveryStreamRoleDefaultPolicyC9208632" + ] }, "Schedule83A77FD1": { "Type": "AWS::Scheduler::Schedule", @@ -254,7 +299,7 @@ "Target": { "Arn": { "Fn::GetAtt": [ - "MyFirehose", + "MyFirehoseStream2282904B", "Arn" ] }, @@ -265,14 +310,14 @@ }, "RoleArn": { "Fn::GetAtt": [ - "SchedulerRoleForTarget380bba149146B2", + "SchedulerRoleForTarget5bddb4D77D7575", "Arn" ] } } } }, - "SchedulerRoleForTarget380bba149146B2": { + "SchedulerRoleForTarget5bddb4D77D7575": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -316,7 +361,7 @@ } } }, - "SchedulerRoleForTarget380bbaDefaultPolicy076E1FE7": { + "SchedulerRoleForTarget5bddb4DefaultPolicy95F55636": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyDocument": { @@ -326,7 +371,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "MyFirehose", + "MyFirehoseStream2282904B", "Arn" ] } @@ -334,10 +379,10 @@ ], "Version": "2012-10-17" }, - "PolicyName": "SchedulerRoleForTarget380bbaDefaultPolicy076E1FE7", + "PolicyName": "SchedulerRoleForTarget5bddb4DefaultPolicy95F55636", "Roles": [ { - "Ref": "SchedulerRoleForTarget380bba149146B2" + "Ref": "SchedulerRoleForTarget5bddb4D77D7575" } ] } @@ -465,6 +510,107 @@ "us-west-2": { "value": "nodejs20.x" } + }, + "awscdkawskinesisfirehoseCidrBlocks": { + "af-south-1": { + "FirehoseCidrBlock": "13.244.121.224/27" + }, + "ap-east-1": { + "FirehoseCidrBlock": "18.162.221.32/27" + }, + "ap-northeast-1": { + "FirehoseCidrBlock": "13.113.196.224/27" + }, + "ap-northeast-2": { + "FirehoseCidrBlock": "13.209.1.64/27" + }, + "ap-northeast-3": { + "FirehoseCidrBlock": "13.208.177.192/27" + }, + "ap-south-1": { + "FirehoseCidrBlock": "13.232.67.32/27" + }, + "ap-south-2": { + "FirehoseCidrBlock": "18.60.192.128/27" + }, + "ap-southeast-1": { + "FirehoseCidrBlock": "13.228.64.192/27" + }, + "ap-southeast-2": { + "FirehoseCidrBlock": "13.210.67.224/27" + }, + "ap-southeast-3": { + "FirehoseCidrBlock": "108.136.221.64/27" + }, + "ap-southeast-4": { + "FirehoseCidrBlock": "16.50.161.128/27" + }, + "ca-central-1": { + "FirehoseCidrBlock": "35.183.92.128/27" + }, + "ca-west-1": { + "FirehoseCidrBlock": "40.176.98.192/27" + }, + "cn-north-1": { + "FirehoseCidrBlock": "52.81.151.32/27" + }, + "cn-northwest-1": { + "FirehoseCidrBlock": "161.189.23.64/27" + }, + "eu-central-1": { + "FirehoseCidrBlock": "35.158.127.160/27" + }, + "eu-central-2": { + "FirehoseCidrBlock": "16.62.183.32/27" + }, + "eu-north-1": { + "FirehoseCidrBlock": "13.53.63.224/27" + }, + "eu-south-1": { + "FirehoseCidrBlock": "15.161.135.128/27" + }, + "eu-south-2": { + "FirehoseCidrBlock": "18.100.71.96/27" + }, + "eu-west-1": { + "FirehoseCidrBlock": "52.19.239.192/27" + }, + "eu-west-2": { + "FirehoseCidrBlock": "18.130.1.96/27" + }, + "eu-west-3": { + "FirehoseCidrBlock": "35.180.1.96/27" + }, + "il-central-1": { + "FirehoseCidrBlock": "51.16.102.0/27" + }, + "me-central-1": { + "FirehoseCidrBlock": "3.28.159.32/27" + }, + "me-south-1": { + "FirehoseCidrBlock": "15.185.91.0/27" + }, + "sa-east-1": { + "FirehoseCidrBlock": "18.228.1.128/27" + }, + "us-east-1": { + "FirehoseCidrBlock": "52.70.63.192/27" + }, + "us-east-2": { + "FirehoseCidrBlock": "13.58.135.96/27" + }, + "us-gov-east-1": { + "FirehoseCidrBlock": "18.253.138.96/27" + }, + "us-gov-west-1": { + "FirehoseCidrBlock": "52.61.204.160/27" + }, + "us-west-1": { + "FirehoseCidrBlock": "13.57.135.192/27" + }, + "us-west-2": { + "FirehoseCidrBlock": "52.89.255.224/27" + } } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.assets.json b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.assets.json index fce900ed5cea4..5746f6887ed8f 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.assets.json +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.assets.json @@ -1,20 +1,20 @@ { "version": "38.0.1", "files": { - "d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418": { + "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b": { "source": { - "path": "asset.d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.bundle", + "path": "asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.zip", + "objectKey": "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "3cacb68a454cfdf8b21666d7e59e470a9a13e93759e0e90f539d234089157703": { + "69760e9fa48394a0f609dd69735f45547567fb59eaebdffe3589b5a20f226520": { "source": { "path": "integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3cacb68a454cfdf8b21666d7e59e470a9a13e93759e0e90f539d234089157703.json", + "objectKey": "69760e9fa48394a0f609dd69735f45547567fb59eaebdffe3589b5a20f226520.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.template.json b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.template.json index 1d77b7c725cd5..42e7210323df5 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.template.json +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/integrationtestfirehoseputrecordDefaultTestDeployAssert781A189E.template.json @@ -31,7 +31,7 @@ "MaxKeys": "1" }, "flattenResponse": "false", - "salt": "1730405309461" + "salt": "1731665442449" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -219,7 +219,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.zip" + "S3Key": "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -298,7 +298,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.zip" + "S3Key": "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.zip" }, "Timeout": 120, "Handler": "index.isComplete", @@ -348,7 +348,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "d1a40db4788714a346364a87b7de0ff15b732e7367f085acf14f4a680c57c418.zip" + "S3Key": "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.zip" }, "Timeout": 120, "Handler": "index.onTimeout", diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/manifest.json b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/manifest.json index e5f9d964c04aa..390a7b40ea24b 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/manifest.json @@ -19,7 +19,7 @@ "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b294e83eca6f470c39e7c0370b0118ec835f0f4c29ef07c651c402f89dee2f55.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f569395a4a44f508c8621208274341ea9bb959b3d5c2e827800776ba34832173.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -89,10 +89,28 @@ "data": "deliveryStreamRoleDefaultPolicyC9208632" } ], - "/aws-cdk-scheduler-targets-firehose-put-record/MyFirehose": [ + "/aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream/LogGroup/Resource": [ { "type": "aws:cdk:logicalId", - "data": "MyFirehose" + "data": "MyFirehoseStreamLogGroup5DE95CF8" + } + ], + "/aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream/LogGroup/S3Destination/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyFirehoseStreamLogGroupS3DestinationB2F1AD1D" + } + ], + "/aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyFirehoseStream2282904B" + } + ], + "/aws-cdk-scheduler-targets-firehose-put-record/@aws-cdk--aws-kinesisfirehose.CidrBlocks": [ + { + "type": "aws:cdk:logicalId", + "data": "awscdkawskinesisfirehoseCidrBlocks" } ], "/aws-cdk-scheduler-targets-firehose-put-record/Schedule/Resource": [ @@ -101,16 +119,16 @@ "data": "Schedule83A77FD1" } ], - "/aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-380bba/Resource": [ + "/aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-5bddb4/Resource": [ { "type": "aws:cdk:logicalId", - "data": "SchedulerRoleForTarget380bba149146B2" + "data": "SchedulerRoleForTarget5bddb4D77D7575" } ], - "/aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-380bba/DefaultPolicy/Resource": [ + "/aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-5bddb4/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "SchedulerRoleForTarget380bbaDefaultPolicy076E1FE7" + "data": "SchedulerRoleForTarget5bddb4DefaultPolicy95F55636" } ], "/aws-cdk-scheduler-targets-firehose-put-record/Exports/Output{\"Ref\":\"DestinationBucket4BECDB47\"}": [ @@ -130,6 +148,33 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "MyFirehose": [ + { + "type": "aws:cdk:logicalId", + "data": "MyFirehose", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "SchedulerRoleForTarget380bba149146B2": [ + { + "type": "aws:cdk:logicalId", + "data": "SchedulerRoleForTarget380bba149146B2", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "SchedulerRoleForTarget380bbaDefaultPolicy076E1FE7": [ + { + "type": "aws:cdk:logicalId", + "data": "SchedulerRoleForTarget380bbaDefaultPolicy076E1FE7", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "aws-cdk-scheduler-targets-firehose-put-record" @@ -152,7 +197,7 @@ "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3cacb68a454cfdf8b21666d7e59e470a9a13e93759e0e90f539d234089157703.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/69760e9fa48394a0f609dd69735f45547567fb59eaebdffe3589b5a20f226520.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/tree.json b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/tree.json index 00aa620699e71..dcc601ad79553 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.js.snapshot/tree.json @@ -252,6 +252,19 @@ ] } ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "MyFirehoseStreamLogGroup5DE95CF8", + "Arn" + ] + } } ], "Version": "2012-10-17" @@ -281,33 +294,112 @@ "version": "0.0.0" } }, - "MyFirehose": { - "id": "MyFirehose", - "path": "aws-cdk-scheduler-targets-firehose-put-record/MyFirehose", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::KinesisFirehose::DeliveryStream", - "aws:cdk:cloudformation:props": { - "s3DestinationConfiguration": { - "bucketArn": { - "Fn::GetAtt": [ - "DestinationBucket4BECDB47", - "Arn" - ] - }, - "roleArn": { - "Fn::GetAtt": [ - "deliveryStreamRoleB4288E26", - "Arn" - ] + "MyFirehoseStream": { + "id": "MyFirehoseStream", + "path": "aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream", + "children": { + "LogGroup": { + "id": "LogGroup", + "path": "aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream/LogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream/LogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "retentionInDays": 731 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "0.0.0" + } }, - "bufferingHints": { - "intervalInSeconds": 60 + "S3Destination": { + "id": "S3Destination", + "path": "aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream/LogGroup/S3Destination", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream/LogGroup/S3Destination/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogStream", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Ref": "MyFirehoseStreamLogGroup5DE95CF8" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogStream", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogStream", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-scheduler-targets-firehose-put-record/MyFirehoseStream/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::KinesisFirehose::DeliveryStream", + "aws:cdk:cloudformation:props": { + "deliveryStreamType": "DirectPut", + "extendedS3DestinationConfiguration": { + "cloudWatchLoggingOptions": { + "enabled": true, + "logGroupName": { + "Ref": "MyFirehoseStreamLogGroup5DE95CF8" + }, + "logStreamName": { + "Ref": "MyFirehoseStreamLogGroupS3DestinationB2F1AD1D" + } + }, + "roleArn": { + "Fn::GetAtt": [ + "deliveryStreamRoleB4288E26", + "Arn" + ] + }, + "bufferingHints": { + "intervalInSeconds": 60, + "sizeInMBs": 5 + }, + "bucketArn": { + "Fn::GetAtt": [ + "DestinationBucket4BECDB47", + "Arn" + ] + } + } } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_kinesisfirehose.CfnDeliveryStream", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_kinesisfirehose.CfnDeliveryStream", + "fqn": "@aws-cdk/aws-kinesisfirehose-alpha.DeliveryStream", + "version": "0.0.0" + } + }, + "@aws-cdk--aws-kinesisfirehose.CidrBlocks": { + "id": "@aws-cdk--aws-kinesisfirehose.CidrBlocks", + "path": "aws-cdk-scheduler-targets-firehose-put-record/@aws-cdk--aws-kinesisfirehose.CidrBlocks", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnMapping", "version": "0.0.0" } }, @@ -330,13 +422,13 @@ "target": { "arn": { "Fn::GetAtt": [ - "MyFirehose", + "MyFirehoseStream2282904B", "Arn" ] }, "roleArn": { "Fn::GetAtt": [ - "SchedulerRoleForTarget380bba149146B2", + "SchedulerRoleForTarget5bddb4D77D7575", "Arn" ] }, @@ -355,17 +447,17 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-scheduler-alpha.Schedule", "version": "0.0.0" } }, - "SchedulerRoleForTarget-380bba": { - "id": "SchedulerRoleForTarget-380bba", - "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-380bba", + "SchedulerRoleForTarget-5bddb4": { + "id": "SchedulerRoleForTarget-5bddb4", + "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-5bddb4", "children": { - "ImportSchedulerRoleForTarget-380bba": { - "id": "ImportSchedulerRoleForTarget-380bba", - "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-380bba/ImportSchedulerRoleForTarget-380bba", + "ImportSchedulerRoleForTarget-5bddb4": { + "id": "ImportSchedulerRoleForTarget-5bddb4", + "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-5bddb4/ImportSchedulerRoleForTarget-5bddb4", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -373,7 +465,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-380bba/Resource", + "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-5bddb4/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -425,11 +517,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-380bba/DefaultPolicy", + "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-5bddb4/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-380bba/DefaultPolicy/Resource", + "path": "aws-cdk-scheduler-targets-firehose-put-record/SchedulerRoleForTarget-5bddb4/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -440,7 +532,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "MyFirehose", + "MyFirehoseStream2282904B", "Arn" ] } @@ -448,10 +540,10 @@ ], "Version": "2012-10-17" }, - "policyName": "SchedulerRoleForTarget380bbaDefaultPolicy076E1FE7", + "policyName": "SchedulerRoleForTarget5bddb4DefaultPolicy95F55636", "roles": [ { - "Ref": "SchedulerRoleForTarget380bba149146B2" + "Ref": "SchedulerRoleForTarget5bddb4D77D7575" } ] } @@ -488,7 +580,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "BootstrapVersion": { @@ -526,7 +618,7 @@ "path": "integrationtest-firehose-put-record/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "DeployAssert": { @@ -546,7 +638,7 @@ "path": "integrationtest-firehose-put-record/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV282e20e13f84521e63643504ea8e737e5/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } } }, @@ -586,7 +678,7 @@ "path": "integrationtest-firehose-put-record/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV282e20e13f84521e63643504ea8e737e5/WaitFor/IsCompleteProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "Invoke": { @@ -612,7 +704,7 @@ "path": "integrationtest-firehose-put-record/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV282e20e13f84521e63643504ea8e737e5/WaitFor/TimeoutProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "Invoke": { @@ -696,7 +788,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "LatestNodeRuntimeMap": { @@ -738,7 +830,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41a": { @@ -772,7 +864,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "BootstrapVersion": { @@ -814,7 +906,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } } }, diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.ts b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.ts index bf8400a5bf004..47160ad3f52fe 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.ts +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.kinesis-data-firehose-put-record.ts @@ -1,7 +1,8 @@ +import * as firehose from '@aws-cdk/aws-kinesisfirehose-alpha'; +import * as destinations from '@aws-cdk/aws-kinesisfirehose-destinations-alpha'; import * as scheduler from '@aws-cdk/aws-scheduler-alpha'; import { AwsApiCall, ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha'; import * as cdk from 'aws-cdk-lib'; -import { CfnDeliveryStream } from 'aws-cdk-lib/aws-kinesisfirehose'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { KinesisDataFirehosePutRecord } from '../lib'; @@ -29,19 +30,16 @@ const deliveryStreamRole = new cdk.aws_iam.Role(stack, 'deliveryStreamRole', { destinationBucket.grantReadWrite(deliveryStreamRole); -const firehose = new CfnDeliveryStream(stack, 'MyFirehose', { - s3DestinationConfiguration: { - bucketArn: destinationBucket.bucketArn, - roleArn: deliveryStreamRole.roleArn, - bufferingHints: { - intervalInSeconds: 60, - }, - }, +const firehoseStream = new firehose.DeliveryStream(stack, 'MyFirehoseStream', { + destination: new destinations.S3Bucket(destinationBucket, { + role: deliveryStreamRole, + bufferingInterval: cdk.Duration.minutes(1), + }), }); new scheduler.Schedule(stack, 'Schedule', { schedule: scheduler.ScheduleExpression.rate(cdk.Duration.minutes(1)), - target: new KinesisDataFirehosePutRecord(firehose, { + target: new KinesisDataFirehosePutRecord(firehoseStream, { input: scheduler.ScheduleTargetInput.fromObject(payload), }), }); diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/kinesis-data-firehose-put-record.test.ts b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/kinesis-data-firehose-put-record.test.ts index 03b55ad0993f8..092193c80268c 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/kinesis-data-firehose-put-record.test.ts +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/kinesis-data-firehose-put-record.test.ts @@ -1,26 +1,53 @@ +import * as firehose from '@aws-cdk/aws-kinesisfirehose-alpha'; import { ScheduleExpression, Schedule, Group } from '@aws-cdk/aws-scheduler-alpha'; -import { App, Duration, Stack } from 'aws-cdk-lib'; +import { App, CfnResource, Duration, Stack } from 'aws-cdk-lib'; import { Template } from 'aws-cdk-lib/assertions'; import { AccountRootPrincipal, Role } from 'aws-cdk-lib/aws-iam'; -import { CfnDeliveryStream } from 'aws-cdk-lib/aws-kinesisfirehose'; import * as sqs from 'aws-cdk-lib/aws-sqs'; +import { Construct } from 'constructs'; import { KinesisDataFirehosePutRecord } from '../lib'; describe('schedule target', () => { let app: App; let stack: Stack; - let firehose: CfnDeliveryStream; + let firehoseStream: firehose.DeliveryStream; + let dependable: Construct; + let mockS3Destination: firehose.IDestination; + + const bucketArn = 'arn:aws:s3:::my-bucket'; + const roleArn = 'arn:aws:iam::111122223333:role/my-role'; + const expr = ScheduleExpression.at(new Date(Date.UTC(1969, 10, 20, 0, 0, 0))); - const roleId = 'SchedulerRoleForTarget380bba149146B2'; + const firehoseStreamId = 'MyFirehoseFCA2F9D3'; + const roleId = 'SchedulerRoleForTarget047201570CF076'; beforeEach(() => { app = new App({ context: { '@aws-cdk/aws-iam:minimizePolicies': true } }); stack = new Stack(app, 'Stack', { env: { region: 'us-east-1', account: '123456789012' } }); - firehose = new CfnDeliveryStream(stack, 'MyFirehose'); + mockS3Destination = { + bind(scope: Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { + dependable = new class extends Construct { + constructor(depScope: Construct, id: string) { + super(depScope, id); + new CfnResource(this, 'Resource', { type: 'CDK::Dummy' }); + } + }(scope, 'Dummy Dep'); + return { + extendedS3DestinationConfiguration: { + bucketArn: bucketArn, + roleArn: roleArn, + }, + dependables: [dependable], + }; + }, + }; + firehoseStream = new firehose.DeliveryStream(stack, 'MyFirehose', { + destination: mockS3Destination, + }); }); test('creates IAM role and IAM policy for kinesis data firehose target in the same account', () => { - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose); + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream); new Schedule(stack, 'MyScheduleDummy', { schedule: expr, @@ -31,7 +58,7 @@ describe('schedule target', () => { Properties: { Target: { Arn: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, RoleArn: { 'Fn::GetAtt': [roleId, 'Arn'] }, RetryPolicy: {}, @@ -46,7 +73,7 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, }, ], @@ -92,7 +119,7 @@ describe('schedule target', () => { assumedBy: new AccountRootPrincipal(), }); - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose, { + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream, { role: targetExecutionRole, }); @@ -105,7 +132,7 @@ describe('schedule target', () => { Properties: { Target: { Arn: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, RoleArn: { 'Fn::GetAtt': ['ProvidedTargetRole8CFDD54A', 'Arn'] }, RetryPolicy: {}, @@ -120,7 +147,7 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, }, ], @@ -130,7 +157,7 @@ describe('schedule target', () => { }); test('reuses IAM role and IAM policy for two schedules with the same target from the same account', () => { - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose); + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream); new Schedule(stack, 'MyScheduleDummy1', { schedule: expr, @@ -181,7 +208,7 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, }, ], @@ -191,7 +218,7 @@ describe('schedule target', () => { }); test('creates IAM role and IAM policy for two schedules with the same target but different groups', () => { - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose); + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream); const group = new Group(stack, 'Group', { groupName: 'mygroup', }); @@ -264,7 +291,7 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, }, ], @@ -273,14 +300,16 @@ describe('schedule target', () => { }, 1); }); - test('creates IAM policy for firehose in the another stack with the same account', () => { + test('creates IAM policy for firehose in another stack with the same account', () => { const stack2 = new Stack(app, 'Stack2', { env: { region: 'us-east-1', account: '123456789012', }, }); - const anotherFirehose = new CfnDeliveryStream(stack2, 'AnotherFirehose'); + const anotherFirehose = new firehose.DeliveryStream(stack2, 'AnotherFirehose', { + destination: mockS3Destination, + }); const firehoseTarget = new KinesisDataFirehosePutRecord(anotherFirehose); @@ -293,9 +322,9 @@ describe('schedule target', () => { Properties: { Target: { Arn: { - 'Fn::ImportValue': 'Stack2:ExportsOutputFnGetAttAnotherFirehoseArn24CBF54A', + 'Fn::ImportValue': 'Stack2:ExportsOutputFnGetAttAnotherFirehose028A8805Arn2409390E', }, - RoleArn: { 'Fn::GetAtt': ['SchedulerRoleForTarget4b70ebDC2428DE', 'Arn'] }, + RoleArn: { 'Fn::GetAtt': ['SchedulerRoleForTargetd57ce0DB208927', 'Arn'] }, RetryPolicy: {}, }, }, @@ -308,19 +337,19 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::ImportValue': 'Stack2:ExportsOutputFnGetAttAnotherFirehoseArn24CBF54A', + 'Fn::ImportValue': 'Stack2:ExportsOutputFnGetAttAnotherFirehose028A8805Arn2409390E', }, }, ], }, - Roles: [{ Ref: 'SchedulerRoleForTarget4b70ebDC2428DE' }], + Roles: [{ Ref: 'SchedulerRoleForTargetd57ce0DB208927' }], }); }); test('creates IAM policy for imported role for firehose in the same account', () => { const importedRole = Role.fromRoleArn(stack, 'ImportedRole', 'arn:aws:iam::123456789012:role/someRole'); - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose, { + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream, { role: importedRole, }); @@ -333,7 +362,7 @@ describe('schedule target', () => { Properties: { Target: { Arn: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, RoleArn: 'arn:aws:iam::123456789012:role/someRole', RetryPolicy: {}, @@ -348,7 +377,7 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, }, ], @@ -357,14 +386,16 @@ describe('schedule target', () => { }); }); - test('creates IAM policy for firehose in the another stack with imported IAM role in the same account', () => { + test('creates IAM policy for firehose in another stack with imported IAM role in the same account', () => { const stack2 = new Stack(app, 'Stack2', { env: { region: 'us-east-1', account: '123456789012', }, }); - const anotherFirehose = new CfnDeliveryStream(stack2, 'AnotherFirehose'); + const anotherFirehose = new firehose.DeliveryStream(stack2, 'AnotherFirehose', { + destination: mockS3Destination, + }); const importedRole = Role.fromRoleArn(stack, 'ImportedRole', 'arn:aws:iam::123456789012:role/someRole'); const firehoseTarget = new KinesisDataFirehosePutRecord(anotherFirehose, { @@ -380,7 +411,7 @@ describe('schedule target', () => { Properties: { Target: { Arn: { - 'Fn::ImportValue': 'Stack2:ExportsOutputFnGetAttAnotherFirehoseArn24CBF54A', + 'Fn::ImportValue': 'Stack2:ExportsOutputFnGetAttAnotherFirehose028A8805Arn2409390E', }, RoleArn: 'arn:aws:iam::123456789012:role/someRole', RetryPolicy: {}, @@ -395,7 +426,7 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::ImportValue': 'Stack2:ExportsOutputFnGetAttAnotherFirehoseArn24CBF54A', + 'Fn::ImportValue': 'Stack2:ExportsOutputFnGetAttAnotherFirehose028A8805Arn2409390E', }, }, ], @@ -407,7 +438,7 @@ describe('schedule target', () => { test('adds permissions to execution role for sending messages to DLQ', () => { const dlq = new sqs.Queue(stack, 'DummyDeadLetterQueue'); - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose, { + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream, { deadLetterQueue: dlq, }); @@ -423,7 +454,7 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, }, { @@ -442,7 +473,7 @@ describe('schedule target', () => { test('adds permission to execution role when imported DLQ is in same account', () => { const importedQueue = sqs.Queue.fromQueueArn(stack, 'ImportedQueue', 'arn:aws:sqs:us-east-1:123456789012:queue1'); - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose, { + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream, { deadLetterQueue: importedQueue, }); @@ -458,7 +489,7 @@ describe('schedule target', () => { Action: 'firehose:PutRecord', Effect: 'Allow', Resource: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, }, { @@ -473,7 +504,7 @@ describe('schedule target', () => { }); test('renders expected retry policy', () => { - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose, { + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream, { retryAttempts: 5, maxEventAge: Duration.hours(3), }); @@ -487,7 +518,7 @@ describe('schedule target', () => { Properties: { Target: { Arn: { - 'Fn::GetAtt': ['MyFirehose', 'Arn'], + 'Fn::GetAtt': [firehoseStreamId, 'Arn'], }, RoleArn: { 'Fn::GetAtt': [roleId, 'Arn'] }, RetryPolicy: { @@ -500,7 +531,7 @@ describe('schedule target', () => { }); test('throws when retry policy max age is more than 1 day', () => { - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose, { + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream, { maxEventAge: Duration.days(3), }); @@ -512,7 +543,7 @@ describe('schedule target', () => { }); test('throws when retry policy max age is less than 15 minutes', () => { - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose, { + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream, { maxEventAge: Duration.minutes(5), }); @@ -524,7 +555,7 @@ describe('schedule target', () => { }); test('throws when retry policy max retry attempts is out of the allowed limits', () => { - const firehoseTarget = new KinesisDataFirehosePutRecord(firehose, { + const firehoseTarget = new KinesisDataFirehosePutRecord(firehoseStream, { retryAttempts: 200, }); From b70ad5225f18da3158641bbe4fb80094325d83b5 Mon Sep 17 00:00:00 2001 From: Kazuho Cryer-Shinozuka Date: Mon, 18 Nov 2024 08:48:10 +0900 Subject: [PATCH 5/5] chore(rds): support postgresql 17 engine version (#32143) ### Issue # (if applicable) None ### Reason for this change [AWS RDS now supports for Postgresql 17](https://aws.amazon.com/jp/about-aws/whats-new/2024/11/amazon-rds-postgresql-supports-version-17/). ### Description of changes Add below versions - 17.1 - 16.5 - 15.9 - 14.14 - 13.17 - 12.21 ### Description of how you validated changes None ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cdk-lib/aws-rds/lib/instance-engine.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts b/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts index f6a02c6e4b23c..18c0155fcce62 100644 --- a/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts +++ b/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts @@ -1545,6 +1545,8 @@ export class PostgresEngineVersion { public static readonly VER_12_19 = PostgresEngineVersion.of('12.19', '12', { s3Import: true, s3Export: true }); /** Version "12.20". */ public static readonly VER_12_20 = PostgresEngineVersion.of('12.20', '12', { s3Import: true, s3Export: true }); + /** Version "12.21". */ + public static readonly VER_12_21 = PostgresEngineVersion.of('12.21', '12', { s3Import: true, s3Export: true }); /** Version "13" (only a major version, without a specific minor version). */ public static readonly VER_13 = PostgresEngineVersion.of('13', '13', { s3Import: true, s3Export: true }); @@ -1610,6 +1612,8 @@ export class PostgresEngineVersion { public static readonly VER_13_15 = PostgresEngineVersion.of('13.15', '13', { s3Import: true, s3Export: true }); /** Version "13.16". */ public static readonly VER_13_16 = PostgresEngineVersion.of('13.16', '13', { s3Import: true, s3Export: true }); + /** Version "13.17". */ + public static readonly VER_13_17 = PostgresEngineVersion.of('13.17', '13', { s3Import: true, s3Export: true }); /** Version "14" (only a major version, without a specific minor version). */ public static readonly VER_14 = PostgresEngineVersion.of('14', '14', { s3Import: true, s3Export: true }); @@ -1663,6 +1667,8 @@ export class PostgresEngineVersion { public static readonly VER_14_12 = PostgresEngineVersion.of('14.12', '14', { s3Import: true, s3Export: true }); /** Version "14.13". */ public static readonly VER_14_13 = PostgresEngineVersion.of('14.13', '14', { s3Import: true, s3Export: true }); + /** Version "14.14". */ + public static readonly VER_14_14 = PostgresEngineVersion.of('14.14', '14', { s3Import: true, s3Export: true }); /** Version "15" (only a major version, without a specific minor version). */ public static readonly VER_15 = PostgresEngineVersion.of('15', '15', { s3Import: true, s3Export: true }); @@ -1686,6 +1692,8 @@ export class PostgresEngineVersion { public static readonly VER_15_7 = PostgresEngineVersion.of('15.7', '15', { s3Import: true, s3Export: true }); /** Version "15.8". */ public static readonly VER_15_8 = PostgresEngineVersion.of('15.8', '15', { s3Import: true, s3Export: true }); + /** Version "15.9". */ + public static readonly VER_15_9 = PostgresEngineVersion.of('15.9', '15', { s3Import: true, s3Export: true }); /** Version "16" (only a major version, without a specific minor version). */ public static readonly VER_16 = PostgresEngineVersion.of('16', '16', { s3Import: true, s3Export: true }); @@ -1697,6 +1705,13 @@ export class PostgresEngineVersion { public static readonly VER_16_3 = PostgresEngineVersion.of('16.3', '16', { s3Import: true, s3Export: true }); /** Version "16.4". */ public static readonly VER_16_4 = PostgresEngineVersion.of('16.4', '16', { s3Import: true, s3Export: true }); + /** Version "16.5". */ + public static readonly VER_16_5 = PostgresEngineVersion.of('16.5', '16', { s3Import: true, s3Export: true }); + + /** Version "17" (only a major version, without a specific minor version). */ + public static readonly VER_17 = PostgresEngineVersion.of('17', '17', { s3Import: true, s3Export: true }); + /** Version "17.1". */ + public static readonly VER_17_1 = PostgresEngineVersion.of('17.1', '17', { s3Import: true, s3Export: true }); /** * Create a new PostgresEngineVersion with an arbitrary version.