From 05767ed1913303fe8767ad666f89204a0fd1feb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 23:10:25 +0000 Subject: [PATCH 1/2] Bump fast-xml-parser and @aws-sdk/client-cloudformation Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) to 5.4.1 and updates ancestor dependency [@aws-sdk/client-cloudformation](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-cloudformation). These dependencies need to be updated together. Updates `fast-xml-parser` from 5.2.5 to 5.4.1 - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.2.5...v5.4.1) Updates `@aws-sdk/client-cloudformation` from 3.935.0 to 3.1003.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-cloudformation/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.1003.0/clients/client-cloudformation) --- updated-dependencies: - dependency-name: fast-xml-parser dependency-version: 5.4.1 dependency-type: indirect - dependency-name: "@aws-sdk/client-cloudformation" dependency-version: 3.1003.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- package-lock.json | 1118 +++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 584 insertions(+), 536 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7c504aa..98e2dad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@actions/core": "2.0.2", - "@aws-sdk/client-cloudformation": "3.935.0", + "@aws-sdk/client-cloudformation": "3.1003.0", "@smithy/node-http-handler": "4.4.5", "https-proxy-agent": "7.0.6", "js-yaml": "^4.1.1", @@ -202,99 +202,66 @@ } }, "node_modules/@aws-sdk/client-cloudformation": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-cloudformation/-/client-cloudformation-3.935.0.tgz", - "integrity": "sha512-6mfYqbIb0hiuX2omcqcntF1obVTKmqb4ONDiAHaOY27azrzgQOUHvqYoru3GkZk2qPXmxcyTWjoyWovSo6xv2A==", + "version": "3.1003.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cloudformation/-/client-cloudformation-3.1003.0.tgz", + "integrity": "sha512-jXg2K4FfFse54Ywrjn9I2EdINu8j/UbQ3e9S90lYKGM2+07AvTv85irTolRbZCznjy8xfFmEjvo6V4WZJgEOAg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.935.0", - "@aws-sdk/credential-provider-node": "3.935.0", - "@aws-sdk/middleware-host-header": "3.930.0", - "@aws-sdk/middleware-logger": "3.930.0", - "@aws-sdk/middleware-recursion-detection": "3.933.0", - "@aws-sdk/middleware-user-agent": "3.935.0", - "@aws-sdk/region-config-resolver": "3.930.0", - "@aws-sdk/types": "3.930.0", - "@aws-sdk/util-endpoints": "3.930.0", - "@aws-sdk/util-user-agent-browser": "3.930.0", - "@aws-sdk/util-user-agent-node": "3.935.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.5", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.12", - "@smithy/middleware-retry": "^4.4.12", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.11", - "@smithy/util-defaults-mode-node": "^4.2.14", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", - "@smithy/util-waiter": "^4.2.5", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/credential-provider-node": "^3.972.17", + "@aws-sdk/middleware-host-header": "^3.972.7", + "@aws-sdk/middleware-logger": "^3.972.7", + "@aws-sdk/middleware-recursion-detection": "^3.972.7", + "@aws-sdk/middleware-user-agent": "^3.972.18", + "@aws-sdk/region-config-resolver": "^3.972.7", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-endpoints": "^3.996.4", + "@aws-sdk/util-user-agent-browser": "^3.972.7", + "@aws-sdk/util-user-agent-node": "^3.973.3", + "@smithy/config-resolver": "^4.4.10", + "@smithy/core": "^3.23.8", + "@smithy/fetch-http-handler": "^5.3.13", + "@smithy/hash-node": "^4.2.11", + "@smithy/invalid-dependency": "^4.2.11", + "@smithy/middleware-content-length": "^4.2.11", + "@smithy/middleware-endpoint": "^4.4.22", + "@smithy/middleware-retry": "^4.4.39", + "@smithy/middleware-serde": "^4.2.12", + "@smithy/middleware-stack": "^4.2.11", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/node-http-handler": "^4.4.14", + "@smithy/protocol-http": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-body-length-browser": "^4.2.2", + "@smithy/util-body-length-node": "^4.2.3", + "@smithy/util-defaults-mode-browser": "^4.3.38", + "@smithy/util-defaults-mode-node": "^4.2.41", + "@smithy/util-endpoints": "^3.3.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-retry": "^4.2.11", + "@smithy/util-utf8": "^4.2.2", + "@smithy/util-waiter": "^4.2.11", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/client-sso": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.935.0.tgz", - "integrity": "sha512-wnwy1NkH1XqdPKljqZdUxn4Ec2nKq6xhwtKZd6xs/JxKqljtMudcew9UwFrnozSWOrPQcZO7x+neZYfrMif4yg==", + "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/node-http-handler": { + "version": "4.4.14", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.14.tgz", + "integrity": "sha512-DamSqaU8nuk0xTJDrYnRzZndHwwRnyj/n/+RqGGCcBKB4qrQem0mSDiWdupaNWdwxzyMU91qxDmHOCazfhtO3A==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.935.0", - "@aws-sdk/middleware-host-header": "3.930.0", - "@aws-sdk/middleware-logger": "3.930.0", - "@aws-sdk/middleware-recursion-detection": "3.933.0", - "@aws-sdk/middleware-user-agent": "3.935.0", - "@aws-sdk/region-config-resolver": "3.930.0", - "@aws-sdk/types": "3.930.0", - "@aws-sdk/util-endpoints": "3.930.0", - "@aws-sdk/util-user-agent-browser": "3.930.0", - "@aws-sdk/util-user-agent-node": "3.935.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.5", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.12", - "@smithy/middleware-retry": "^4.4.12", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.11", - "@smithy/util-defaults-mode-node": "^4.2.14", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", + "@smithy/abort-controller": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/querystring-builder": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -302,60 +269,76 @@ } }, "node_modules/@aws-sdk/core": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.935.0.tgz", - "integrity": "sha512-5R5mTeV3DX91y7eA0J5nvG2c9ukjL9m0diQE9HmMuiZqtEIJJs2sHSX/wlkrosABux/NSVxuv8ndAYu5c5aeoA==", + "version": "3.973.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.973.18.tgz", + "integrity": "sha512-GUIlegfcK2LO1J2Y98sCJy63rQSiLiDOgVw7HiHPRqfI2vb3XozTVqemwO0VSGXp54ngCnAQz0Lf0YPCBINNxA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.930.0", - "@aws-sdk/xml-builder": "3.930.0", - "@smithy/core": "^3.18.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/xml-builder": "^3.972.10", + "@smithy/core": "^3.23.8", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/signature-v4": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.935.0.tgz", - "integrity": "sha512-zHmfNEM2SPimwarSWtWhmjeqDZYFy6Fsktj/sJ60RxphHrVbcolTUmH7v0kdM5TCaScHqQHxhqBEsHY2KJDlPQ==", + "version": "3.972.16", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.16.tgz", + "integrity": "sha512-HrdtnadvTGAQUr18sPzGlE5El3ICphnH6SU7UQOMOWFgRKbTRNN8msTxM4emzguUso9CzaHU2xy5ctSrmK5YNA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/types": "^4.9.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.935.0.tgz", - "integrity": "sha512-7Ndb5A6lI94VrF2KLmWWZKJS2WK4SNGvK/hi9eDDF0qEUBdtPwDKylPjKH820DfRkkCi3L4LpfxU28ndEXQXAQ==", + "version": "3.972.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.18.tgz", + "integrity": "sha512-NyB6smuZAixND5jZumkpkunQ0voc4Mwgkd+SZ6cvAzIB7gK8HV8Zd4rS8Kn5MmoGgusyNfVGG+RLoYc4yFiw+A==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/util-stream": "^4.5.6", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/fetch-http-handler": "^5.3.13", + "@smithy/node-http-handler": "^4.4.14", + "@smithy/property-provider": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-stream": "^4.5.17", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler": { + "version": "4.4.14", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.14.tgz", + "integrity": "sha512-DamSqaU8nuk0xTJDrYnRzZndHwwRnyj/n/+RqGGCcBKB4qrQem0mSDiWdupaNWdwxzyMU91qxDmHOCazfhtO3A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/querystring-builder": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -363,212 +346,248 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.935.0.tgz", - "integrity": "sha512-AfX3vjYZmtkw6HXFiVOJFvV0Ew9MHp+KrCT58tV4kzL8AnmzU/OZ2lzp/nhbEmaVoBgJMEvqXxOPKyA8T1V2dw==", + "version": "3.972.16", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.972.16.tgz", + "integrity": "sha512-hzAnzNXKV0A4knFRWGu2NCt72P4WWxpEGnOc6H3DptUjC4oX3hGw846oN76M1rTHAOwDdbhjU0GAOWR4OUfTZg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.935.0", - "@aws-sdk/credential-provider-env": "3.935.0", - "@aws-sdk/credential-provider-http": "3.935.0", - "@aws-sdk/credential-provider-process": "3.935.0", - "@aws-sdk/credential-provider-sso": "3.935.0", - "@aws-sdk/credential-provider-web-identity": "3.935.0", - "@aws-sdk/nested-clients": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/credential-provider-env": "^3.972.16", + "@aws-sdk/credential-provider-http": "^3.972.18", + "@aws-sdk/credential-provider-login": "^3.972.16", + "@aws-sdk/credential-provider-process": "^3.972.16", + "@aws-sdk/credential-provider-sso": "^3.972.16", + "@aws-sdk/credential-provider-web-identity": "^3.972.16", + "@aws-sdk/nested-clients": "^3.996.6", + "@aws-sdk/types": "^3.973.5", + "@smithy/credential-provider-imds": "^4.2.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-login": { + "version": "3.972.16", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.16.tgz", + "integrity": "sha512-VI0kXTlr0o1FTay+Jvx6AKqx5ECBgp7X4VevGBEbuXdCXnNp7SPU0KvjsOLVhIz3OoPK4/lTXphk43t0IVk65w==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/nested-clients": "^3.996.6", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.935.0.tgz", - "integrity": "sha512-M7lD8e8/QHivrqiAp8aJpWFEo4MSPN8v9WGf940VcggM+lTFsF2JipvVBBBZ5w4AAU1PO9jCHdH5erx+rUTGZQ==", + "version": "3.972.17", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.17.tgz", + "integrity": "sha512-98MAcQ2Dk7zkvgwZ5f6fLX2lTyptC3gTSDx4EpvTdJWET8qs9lBPYggoYx7GmKp/5uk0OwVl0hxIDZsDNS/Y9g==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.935.0", - "@aws-sdk/credential-provider-http": "3.935.0", - "@aws-sdk/credential-provider-ini": "3.935.0", - "@aws-sdk/credential-provider-process": "3.935.0", - "@aws-sdk/credential-provider-sso": "3.935.0", - "@aws-sdk/credential-provider-web-identity": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/credential-provider-env": "^3.972.16", + "@aws-sdk/credential-provider-http": "^3.972.18", + "@aws-sdk/credential-provider-ini": "^3.972.16", + "@aws-sdk/credential-provider-process": "^3.972.16", + "@aws-sdk/credential-provider-sso": "^3.972.16", + "@aws-sdk/credential-provider-web-identity": "^3.972.16", + "@aws-sdk/types": "^3.973.5", + "@smithy/credential-provider-imds": "^4.2.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.935.0.tgz", - "integrity": "sha512-hEzKOuywiifJuob6sCPD+FVSytGO0ShlPs0tQXcQwIKjfd9o4UJX6UG0fpNfZfPIEcPsqlKM2EkMRSQJTycULA==", + "version": "3.972.16", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.16.tgz", + "integrity": "sha512-n89ibATwnLEg0ZdZmUds5bq8AfBAdoYEDpqP3uzPLaRuGelsKlIvCYSNNvfgGLi8NaHPNNhs1HjJZYbqkW9b+g==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.935.0.tgz", - "integrity": "sha512-uWHuq+Hwp1uJfjGF3+p6HELte8v/uEfj/oHJ3+1gfprUil3eZR1eRUM6wJfCRhjVzquvAhKv0sVKeejGw5/25w==", + "version": "3.972.16", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.972.16.tgz", + "integrity": "sha512-b9of7tQgERxgcEcwAFWvRe84ivw+Kw6b3jVuz/6LQzonkomiY5UoWfprkbjc8FSCQ2VjDqKTvIRA9F0KSQ025w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.935.0", - "@aws-sdk/core": "3.935.0", - "@aws-sdk/token-providers": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/nested-clients": "^3.996.6", + "@aws-sdk/token-providers": "3.1003.0", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.935.0.tgz", - "integrity": "sha512-Rzw4BxPBEyw5XyXy0NYy2yzgPDnvEaPe5IIq+xNRqMpcwI1Wxnb9eNJQTz2YhULLy/nAD1Xs/6hEMwZl1x/GLQ==", + "version": "3.972.16", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.16.tgz", + "integrity": "sha512-PaOH5jFoPQX4WkqpKzKh9cM7rieKtbgEGqrZ+ybGmotJhcvhI/xl69yCwMbHGnpQJJmHZIX9q2zaPB7HTBn/4w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.935.0", - "@aws-sdk/nested-clients": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/nested-clients": "^3.996.6", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.930.0.tgz", - "integrity": "sha512-x30jmm3TLu7b/b+67nMyoV0NlbnCVT5DI57yDrhXAPCtdgM1KtdLWt45UcHpKOm1JsaIkmYRh2WYu7Anx4MG0g==", + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.972.7.tgz", + "integrity": "sha512-aHQZgztBFEpDU1BB00VWCIIm85JjGjQW1OG9+98BdmaOpguJvzmXBGbnAiYcciCd+IS4e9BEq664lhzGnWJHgQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.930.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", + "@aws-sdk/types": "^3.973.5", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/middleware-logger": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.930.0.tgz", - "integrity": "sha512-vh4JBWzMCBW8wREvAwoSqB2geKsZwSHTa0nSt0OMOLp2PdTYIZDi0ZiVMmpfnjcx9XbS6aSluLv9sKx4RrG46A==", + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.972.7.tgz", + "integrity": "sha512-LXhiWlWb26txCU1vcI9PneESSeRp/RYY/McuM4SpdrimQR5NgwaPb4VJCadVeuGWgh6QmqZ6rAKSoL1ob16W6w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.930.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/types": "^3.973.5", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.933.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.933.0.tgz", - "integrity": "sha512-qgrMlkVKzTCAdNw2A05DC2sPBo0KRQ7wk+lbYSRJnWVzcrceJhnmhoZVV5PFv7JtchK7sHVcfm9lcpiyd+XaCA==", + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.972.7.tgz", + "integrity": "sha512-l2VQdcBcYLzIzykCHtXlbpiVCZ94/xniLIkAj0jpnpjY4xlgZx7f56Ypn+uV1y3gG0tNVytJqo3K9bfMFee7SQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.930.0", - "@aws/lambda-invoke-store": "^0.2.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", + "@aws-sdk/types": "^3.973.5", + "@aws/lambda-invoke-store": "^0.2.2", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.935.0.tgz", - "integrity": "sha512-d1hFok5kfODRLJ0cxdmyX6QO4LB/dOCrI6r/5lJ7xk8FNxV7dBttuIhPJmvNXQIKZ9uxyKl2Kh/OPax414nv9A==", + "version": "3.972.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.972.18.tgz", + "integrity": "sha512-KcqQDs/7WtoEnp52+879f8/i1XAJkgka5i4arOtOCPR10o4wWo3VRecDI9Gxoh6oghmLCnIiOSKyRcXI/50E+w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@aws-sdk/util-endpoints": "3.930.0", - "@smithy/core": "^3.18.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-endpoints": "^3.996.4", + "@smithy/core": "^3.23.8", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/nested-clients": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.935.0.tgz", - "integrity": "sha512-4PjV6W4ZAjD+4CWoh5iol0MKNPCe7DkcDFkNtzirbNOEv1zbYcVtAzw7Oxry4LbYos2fkQkTHcirHgI6gAdbfQ==", + "version": "3.996.6", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.996.6.tgz", + "integrity": "sha512-blNJ3ugn4gCQ9ZSZi/firzKCvVl5LvPFVxv24LprENeWI4R8UApG006UQkF4SkmLygKq2BQXRad2/anQ13Te4Q==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.935.0", - "@aws-sdk/middleware-host-header": "3.930.0", - "@aws-sdk/middleware-logger": "3.930.0", - "@aws-sdk/middleware-recursion-detection": "3.933.0", - "@aws-sdk/middleware-user-agent": "3.935.0", - "@aws-sdk/region-config-resolver": "3.930.0", - "@aws-sdk/types": "3.930.0", - "@aws-sdk/util-endpoints": "3.930.0", - "@aws-sdk/util-user-agent-browser": "3.930.0", - "@aws-sdk/util-user-agent-node": "3.935.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.5", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.12", - "@smithy/middleware-retry": "^4.4.12", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.11", - "@smithy/util-defaults-mode-node": "^4.2.14", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/middleware-host-header": "^3.972.7", + "@aws-sdk/middleware-logger": "^3.972.7", + "@aws-sdk/middleware-recursion-detection": "^3.972.7", + "@aws-sdk/middleware-user-agent": "^3.972.18", + "@aws-sdk/region-config-resolver": "^3.972.7", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-endpoints": "^3.996.4", + "@aws-sdk/util-user-agent-browser": "^3.972.7", + "@aws-sdk/util-user-agent-node": "^3.973.3", + "@smithy/config-resolver": "^4.4.10", + "@smithy/core": "^3.23.8", + "@smithy/fetch-http-handler": "^5.3.13", + "@smithy/hash-node": "^4.2.11", + "@smithy/invalid-dependency": "^4.2.11", + "@smithy/middleware-content-length": "^4.2.11", + "@smithy/middleware-endpoint": "^4.4.22", + "@smithy/middleware-retry": "^4.4.39", + "@smithy/middleware-serde": "^4.2.12", + "@smithy/middleware-stack": "^4.2.11", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/node-http-handler": "^4.4.14", + "@smithy/protocol-http": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-body-length-browser": "^4.2.2", + "@smithy/util-body-length-node": "^4.2.3", + "@smithy/util-defaults-mode-browser": "^4.3.38", + "@smithy/util-defaults-mode-node": "^4.2.41", + "@smithy/util-endpoints": "^3.3.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-retry": "^4.2.11", + "@smithy/util-utf8": "^4.2.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler": { + "version": "4.4.14", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.14.tgz", + "integrity": "sha512-DamSqaU8nuk0xTJDrYnRzZndHwwRnyj/n/+RqGGCcBKB4qrQem0mSDiWdupaNWdwxzyMU91qxDmHOCazfhtO3A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/querystring-builder": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -576,106 +595,106 @@ } }, "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.930.0.tgz", - "integrity": "sha512-KL2JZqH6aYeQssu1g1KuWsReupdfOoxD6f1as2VC+rdwYFUu4LfzMsFfXnBvvQWWqQ7rZHWOw1T+o5gJmg7Dzw==", + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.972.7.tgz", + "integrity": "sha512-/Ev/6AI8bvt4HAAptzSjThGUMjcWaX3GX8oERkB0F0F9x2dLSBdgFDiyrRz3i0u0ZFZFQ1b28is4QhyqXTUsVA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.930.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", + "@aws-sdk/types": "^3.973.5", + "@smithy/config-resolver": "^4.4.10", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.935.0.tgz", - "integrity": "sha512-3faev6XMzO/rxGtouFBdl/Dxi9e2TCvkhTwD/5W8oN5Flwk9nZm5GIPUeA7AAD5sgt2Kf6TWSOQplVgq1jmCJA==", + "version": "3.1003.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1003.0.tgz", + "integrity": "sha512-SOyyWNdT7njKRwtZ1JhwHlH1csv6Pkgf305X96/OIfnhq1pU/EjmT6W6por57rVrjrKuHBuEIXgpWv8OgoMHpg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.935.0", - "@aws-sdk/nested-clients": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/nested-clients": "^3.996.6", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/types": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.930.0.tgz", - "integrity": "sha512-we/vaAgwlEFW7IeftmCLlLMw+6hFs3DzZPJw7lVHbj/5HJ0bz9gndxEsS2lQoeJ1zhiiLqAqvXxmM43s0MBg0A==", + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/util-endpoints": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.930.0.tgz", - "integrity": "sha512-M2oEKBzzNAYr136RRc6uqw3aWlwCxqTP1Lawps9E1d2abRPvl1p1ztQmmXp1Ak4rv8eByIZ+yQyKQ3zPdRG5dw==", + "version": "3.996.4", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.996.4.tgz", + "integrity": "sha512-Hek90FBmd4joCFj+Vc98KLJh73Zqj3s2W56gjAcTkrNLMDI5nIFkG9YpfcJiVI1YlE2Ne1uOQNe+IgQ/Vz2XRA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.930.0", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-endpoints": "^3.2.5", + "@aws-sdk/types": "^3.973.5", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", + "@smithy/util-endpoints": "^3.3.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/util-locate-window": { - "version": "3.893.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.893.0.tgz", - "integrity": "sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg==", + "version": "3.965.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.965.5.tgz", + "integrity": "sha512-WhlJNNINQB+9qtLtZJcpQdgZw3SCDCpXdUJP7cToGwHbCWCnRckGlc6Bx/OhWwIYFNAn+FIydY8SZ0QmVu3xTQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.930.0.tgz", - "integrity": "sha512-q6lCRm6UAe+e1LguM5E4EqM9brQlDem4XDcQ87NzEvlTW6GzmNCO0w1jS0XgCFXQHjDxjdlNFX+5sRbHijwklg==", + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.972.7.tgz", + "integrity": "sha512-7SJVuvhKhMF/BkNS1n0QAJYgvEwYbK2QLKBrzDiwQGiTRU6Yf1f3nehTzm/l21xdAOtWSfp2uWSddPnP2ZtsVw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.930.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/types": "^3.973.5", + "@smithy/types": "^4.13.0", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.935.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.935.0.tgz", - "integrity": "sha512-KXr3pGQz/BhGMUrXARs081SXVTwJ50ShA22AYwxI02BZsazY8wmkJCNgJGwRdMKfdmMPEe8xpQNawDKPYxvo9A==", + "version": "3.973.3", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.973.3.tgz", + "integrity": "sha512-8s2cQmTUOwcBlIJyI9PAZNnnnF+cGtdhHc1yzMMsSD/GR/Hxj7m0IGUE92CslXXb8/p5Q76iqOCjN1GFwyf+1A==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/middleware-user-agent": "3.935.0", - "@aws-sdk/types": "3.930.0", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", + "@aws-sdk/middleware-user-agent": "^3.972.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "peerDependencies": { "aws-crt": ">=1.0.0" @@ -687,23 +706,23 @@ } }, "node_modules/@aws-sdk/xml-builder": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.930.0.tgz", - "integrity": "sha512-YIfkD17GocxdmlUVc3ia52QhcWuRIUJonbF8A2CYfcWNV3HzvAqpcPeC0bYUhkK+8e8YO1ARnLKZQE0TlwzorA==", + "version": "3.972.10", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.10.tgz", + "integrity": "sha512-OnejAIVD+CxzyAUrVic7lG+3QRltyja9LoNqCE/1YVs8ichoTbJlVSaZ9iSMcnHLyzrSNtvaOGjSDRP+d/ouFA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", - "fast-xml-parser": "5.2.5", + "@smithy/types": "^4.13.0", + "fast-xml-parser": "5.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aws/lambda-invoke-store": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.2.0.tgz", - "integrity": "sha512-D1jAmAZQYMoPiacfgNf7AWhg3DFN3Wq/vQv3WINt9znwjzHp2x+WzdJFxxj7xZL7V1U79As6G8f7PorMYWBKsQ==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.2.3.tgz", + "integrity": "sha512-oLvsaPMTBejkkmHhjf09xTgk71mOqyr/409NKhRIL08If7AhVfUsJhVsx386uJaqNd42v9kWamQ9lFbkoC2dYw==", "license": "Apache-2.0", "engines": { "node": ">=18.0.0" @@ -2175,12 +2194,12 @@ "license": "(Unlicense OR Apache-2.0)" }, "node_modules/@smithy/abort-controller": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.5.tgz", - "integrity": "sha512-j7HwVkBw68YW8UmFRcjZOmssE77Rvk0GWAIN1oFBhsaovQmZWYCIcGa9/pwRB0ExI8Sk9MWNALTjftjHZea7VA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.11.tgz", + "integrity": "sha512-Hj4WoYWMJnSpM6/kchsm4bUNTL9XiSyhvoMb2KIq4VJzyDt7JpGHUZHkVNPZVC7YE1tf8tPeVauxpFBKGW4/KQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2188,16 +2207,16 @@ } }, "node_modules/@smithy/config-resolver": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.3.tgz", - "integrity": "sha512-ezHLe1tKLUxDJo2LHtDuEDyWXolw8WGOR92qb4bQdWq/zKenO5BvctZGrVJBK08zjezSk7bmbKFOXIVyChvDLw==", + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.10.tgz", + "integrity": "sha512-IRTkd6ps0ru+lTWnfnsbXzW80A8Od8p3pYiZnW98K2Hb20rqfsX7VTlfUwhrcOeSSy68Gn9WBofwPuw3e5CCsg==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-config-provider": "^4.2.0", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-config-provider": "^4.2.2", + "@smithy/util-endpoints": "^3.3.2", + "@smithy/util-middleware": "^4.2.11", "tslib": "^2.6.2" }, "engines": { @@ -2205,20 +2224,20 @@ } }, "node_modules/@smithy/core": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.18.5.tgz", - "integrity": "sha512-6gnIz3h+PEPQGDj8MnRSjDvKBah042jEoPgjFGJ4iJLBE78L4lY/n98x14XyPF4u3lN179Ub/ZKFY5za9GeLQw==", + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.23.8.tgz", + "integrity": "sha512-f7uPeBi7ehmLT4YF2u9j3qx6lSnurG1DLXOsTtJrIRNDF7VXio4BGHQ+SQteN/BrUVudbkuL4v7oOsRCzq4BqA==", "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-serde": "^4.2.6", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-stream": "^4.5.6", - "@smithy/util-utf8": "^4.2.0", - "@smithy/uuid": "^1.1.0", + "@smithy/middleware-serde": "^4.2.12", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-body-length-browser": "^4.2.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-stream": "^4.5.17", + "@smithy/util-utf8": "^4.2.2", + "@smithy/uuid": "^1.1.2", "tslib": "^2.6.2" }, "engines": { @@ -2226,15 +2245,15 @@ } }, "node_modules/@smithy/credential-provider-imds": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.5.tgz", - "integrity": "sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.11.tgz", + "integrity": "sha512-lBXrS6ku0kTj3xLmsJW0WwqWbGQ6ueooYyp/1L9lkyT0M02C+DWwYwc5aTyXFbRaK38ojALxNixg+LxKSHZc0g==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", "tslib": "^2.6.2" }, "engines": { @@ -2242,15 +2261,15 @@ } }, "node_modules/@smithy/fetch-http-handler": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.6.tgz", - "integrity": "sha512-3+RG3EA6BBJ/ofZUeTFJA7mHfSYrZtQIrDP9dI8Lf7X6Jbos2jptuLrAAteDiFVrmbEmLSuRG/bUKzfAXk7dhg==", + "version": "5.3.13", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.13.tgz", + "integrity": "sha512-U2Hcfl2s3XaYjikN9cT4mPu8ybDbImV3baXR0PkVlC0TTx808bRP3FaPGAzPtB8OByI+JqJ1kyS+7GEgae7+qQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/querystring-builder": "^4.2.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", + "@smithy/protocol-http": "^5.3.11", + "@smithy/querystring-builder": "^4.2.11", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", "tslib": "^2.6.2" }, "engines": { @@ -2258,14 +2277,14 @@ } }, "node_modules/@smithy/hash-node": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.5.tgz", - "integrity": "sha512-DpYX914YOfA3UDT9CN1BM787PcHfWRBB43fFGCYrZFUH0Jv+5t8yYl+Pd5PW4+QzoGEDvn5d5QIO4j2HyYZQSA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.11.tgz", + "integrity": "sha512-T+p1pNynRkydpdL015ruIoyPSRw9e/SQOWmSAMmmprfswMrd5Ow5igOWNVlvyVFZlxXqGmyH3NQwfwy8r5Jx0A==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", + "@smithy/types": "^4.13.0", + "@smithy/util-buffer-from": "^4.2.2", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2273,12 +2292,12 @@ } }, "node_modules/@smithy/invalid-dependency": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.5.tgz", - "integrity": "sha512-2L2erASEro1WC5nV+plwIMxrTXpvpfzl4e+Nre6vBVRR2HKeGGcvpJyyL3/PpiSg+cJG2KpTmZmq934Olb6e5A==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.11.tgz", + "integrity": "sha512-cGNMrgykRmddrNhYy1yBdrp5GwIgEkniS7k9O1VLB38yxQtlvrxpZtUVvo6T4cKpeZsriukBuuxfJcdZQc/f/g==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2286,9 +2305,9 @@ } }, "node_modules/@smithy/is-array-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz", - "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.2.tgz", + "integrity": "sha512-n6rQ4N8Jj4YTQO3YFrlgZuwKodf4zUFs7EJIWH86pSCWBaAtAGBFfCM7Wx6D2bBJ2xqFNxGBSrUWswT3M0VJow==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2298,13 +2317,13 @@ } }, "node_modules/@smithy/middleware-content-length": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.5.tgz", - "integrity": "sha512-Y/RabVa5vbl5FuHYV2vUCwvh/dqzrEY/K2yWPSqvhFUwIY0atLqO4TienjBXakoy4zrKAMCZwg+YEqmH7jaN7A==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.11.tgz", + "integrity": "sha512-UvIfKYAKhCzr4p6jFevPlKhQwyQwlJ6IeKLDhmV1PlYfcW3RL4ROjNEDtSik4NYMi9kDkH7eSwyTP3vNJ/u/Dw==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2312,18 +2331,18 @@ } }, "node_modules/@smithy/middleware-endpoint": { - "version": "4.3.12", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.3.12.tgz", - "integrity": "sha512-9pAX/H+VQPzNbouhDhkW723igBMLgrI8OtX+++M7iKJgg/zY/Ig3i1e6seCcx22FWhE6Q/S61BRdi2wXBORT+A==", + "version": "4.4.22", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.4.22.tgz", + "integrity": "sha512-sc81w1o4Jy+/MAQlY3sQ8C7CmSpcvIi3TAzXblUv2hjG11BBSJi/Cw8vDx5BxMxapuH2I+Gc+45vWsgU07WZRQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.18.5", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-middleware": "^4.2.5", + "@smithy/core": "^3.23.8", + "@smithy/middleware-serde": "^4.2.12", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", + "@smithy/util-middleware": "^4.2.11", "tslib": "^2.6.2" }, "engines": { @@ -2331,19 +2350,19 @@ } }, "node_modules/@smithy/middleware-retry": { - "version": "4.4.12", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.12.tgz", - "integrity": "sha512-S4kWNKFowYd0lID7/DBqWHOQxmxlsf0jBaos9chQZUWTVOjSW1Ogyh8/ib5tM+agFDJ/TCxuCTvrnlc+9cIBcQ==", + "version": "4.4.39", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.39.tgz", + "integrity": "sha512-MCVCxaCzuZgiHtHGV2Ke44nh6t4+8/tO+rTYOzrr2+G4nMLU/qbzNCWKBX54lyEaVcGQrfOJiG2f8imtiw+nIQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/service-error-classification": "^4.2.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/uuid": "^1.1.0", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/service-error-classification": "^4.2.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-retry": "^4.2.11", + "@smithy/uuid": "^1.1.2", "tslib": "^2.6.2" }, "engines": { @@ -2351,13 +2370,13 @@ } }, "node_modules/@smithy/middleware-serde": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.6.tgz", - "integrity": "sha512-VkLoE/z7e2g8pirwisLz8XJWedUSY8my/qrp81VmAdyrhi94T+riBfwP+AOEEFR9rFTSonC/5D2eWNmFabHyGQ==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.12.tgz", + "integrity": "sha512-W9g1bOLui7Xn5FABRVS0o3rXL0gfN37d/8I/W7i0N7oxjx9QecUmXEMSUMADTODwdtka9cN43t5BI2CodLJpng==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2365,12 +2384,12 @@ } }, "node_modules/@smithy/middleware-stack": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.5.tgz", - "integrity": "sha512-bYrutc+neOyWxtZdbB2USbQttZN0mXaOyYLIsaTbJhFsfpXyGWUxJpEuO1rJ8IIJm2qH4+xJT0mxUSsEDTYwdQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.11.tgz", + "integrity": "sha512-s+eenEPW6RgliDk2IhjD2hWOxIx1NKrOHxEwNUaUXxYBxIyCcDfNULZ2Mu15E3kwcJWBedTET/kEASPV1A1Akg==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2378,14 +2397,14 @@ } }, "node_modules/@smithy/node-config-provider": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.5.tgz", - "integrity": "sha512-UTurh1C4qkVCtqggI36DGbLB2Kv8UlcFdMXDcWMbqVY2uRg0XmT9Pb4Vj6oSQ34eizO1fvR0RnFV4Axw4IrrAg==", + "version": "4.3.11", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.11.tgz", + "integrity": "sha512-xD17eE7kaLgBBGf5CZQ58hh2YmwK1Z0O8YhffwB/De2jsL0U3JklmhVYJ9Uf37OtUDLF2gsW40Xwwag9U869Gg==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2409,12 +2428,12 @@ } }, "node_modules/@smithy/property-provider": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.5.tgz", - "integrity": "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.11.tgz", + "integrity": "sha512-14T1V64o6/ndyrnl1ze1ZhyLzIeYNN47oF/QU6P5m82AEtyOkMJTb0gO1dPubYjyyKuPD6OSVMPDKe+zioOnCg==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2422,12 +2441,12 @@ } }, "node_modules/@smithy/protocol-http": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.5.tgz", - "integrity": "sha512-RlaL+sA0LNMp03bf7XPbFmT5gN+w3besXSWMkA8rcmxLSVfiEXElQi4O2IWwPfxzcHkxqrwBFMbngB8yx/RvaQ==", + "version": "5.3.11", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.11.tgz", + "integrity": "sha512-hI+barOVDJBkNt4y0L2mu3Ugc0w7+BpJ2CZuLwXtSltGAAwCb3IvnalGlbDV/UCS6a9ZuT3+exd1WxNdLb5IlQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2435,13 +2454,13 @@ } }, "node_modules/@smithy/querystring-builder": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.5.tgz", - "integrity": "sha512-y98otMI1saoajeik2kLfGyRp11e5U/iJYH/wLCh3aTV/XutbGT9nziKGkgCaMD1ghK7p6htHMm6b6scl9JRUWg==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.11.tgz", + "integrity": "sha512-7spdikrYiljpket6u0up2Ck2mxhy7dZ0+TDd+S53Dg2DHd6wg+YNJrTCHiLdgZmEXZKI7LJZcwL3721ZRDFiqA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", - "@smithy/util-uri-escape": "^4.2.0", + "@smithy/types": "^4.13.0", + "@smithy/util-uri-escape": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2449,12 +2468,12 @@ } }, "node_modules/@smithy/querystring-parser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.5.tgz", - "integrity": "sha512-031WCTdPYgiQRYNPXznHXof2YM0GwL6SeaSyTH/P72M1Vz73TvCNH2Nq8Iu2IEPq9QP2yx0/nrw5YmSeAi/AjQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.11.tgz", + "integrity": "sha512-nE3IRNjDltvGcoThD2abTozI1dkSy8aX+a2N1Rs55en5UsdyyIXgGEmevUL3okZFoJC77JgRGe99xYohhsjivQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2462,24 +2481,24 @@ } }, "node_modules/@smithy/service-error-classification": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.5.tgz", - "integrity": "sha512-8fEvK+WPE3wUAcDvqDQG1Vk3ANLR8Px979te96m84CbKAjBVf25rPYSzb4xU4hlTyho7VhOGnh5i62D/JVF0JQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.11.tgz", + "integrity": "sha512-HkMFJZJUhzU3HvND1+Yw/kYWXp4RPDLBWLcK1n+Vqw8xn4y2YiBhdww8IxhkQjP/QlZun5bwm3vcHc8AqIU3zw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0" + "@smithy/types": "^4.13.0" }, "engines": { "node": ">=18.0.0" } }, "node_modules/@smithy/shared-ini-file-loader": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.0.tgz", - "integrity": "sha512-5WmZ5+kJgJDjwXXIzr1vDTG+RhF9wzSODQBfkrQ2VVkYALKGvZX1lgVSxEkgicSAFnFhPj5rudJV0zoinqS0bA==", + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.6.tgz", + "integrity": "sha512-IB/M5I8G0EeXZTHsAxpx51tMQ5R719F3aq+fjEB6VtNcCHDc0ajFDIGDZw+FW9GxtEkgTduiPpjveJdA/CX7sw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2487,18 +2506,18 @@ } }, "node_modules/@smithy/signature-v4": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.5.tgz", - "integrity": "sha512-xSUfMu1FT7ccfSXkoLl/QRQBi2rOvi3tiBZU2Tdy3I6cgvZ6SEi9QNey+lqps/sJRnogIS+lq+B1gxxbra2a/w==", + "version": "5.3.11", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.11.tgz", + "integrity": "sha512-V1L6N9aKOBAN4wEHLyqjLBnAz13mtILU0SeDrjOaIZEeN6IFa6DxwRt1NNpOdmSpQUfkBj0qeD3m6P77uzMhgQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^4.2.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-hex-encoding": "^4.2.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-uri-escape": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", + "@smithy/is-array-buffer": "^4.2.2", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-hex-encoding": "^4.2.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-uri-escape": "^4.2.2", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2506,17 +2525,17 @@ } }, "node_modules/@smithy/smithy-client": { - "version": "4.9.8", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.9.8.tgz", - "integrity": "sha512-8xgq3LgKDEFoIrLWBho/oYKyWByw9/corz7vuh1upv7ZBm0ZMjGYBhbn6v643WoIqA9UTcx5A5htEp/YatUwMA==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.12.2.tgz", + "integrity": "sha512-HezY3UuG0k4T+4xhFKctLXCA5N2oN+Rtv+mmL8Gt7YmsUY2yhmcLyW75qrSzldfj75IsCW/4UhY3s20KcFnZqA==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.18.5", - "@smithy/middleware-endpoint": "^4.3.12", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-stream": "^4.5.6", + "@smithy/core": "^3.23.8", + "@smithy/middleware-endpoint": "^4.4.22", + "@smithy/middleware-stack": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-stream": "^4.5.17", "tslib": "^2.6.2" }, "engines": { @@ -2524,9 +2543,9 @@ } }, "node_modules/@smithy/types": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.9.0.tgz", - "integrity": "sha512-MvUbdnXDTwykR8cB1WZvNNwqoWVaTRA0RLlLmf/cIFNMM2cKWz01X4Ly6SMC4Kks30r8tT3Cty0jmeWfiuyHTA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.13.0.tgz", + "integrity": "sha512-COuLsZILbbQsdrwKQpkkpyep7lCsByxwj7m0Mg5v66/ZTyenlfBc40/QFQ5chO0YN/PNEH1Bi3fGtfXPnYNeDw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2536,13 +2555,13 @@ } }, "node_modules/@smithy/url-parser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.5.tgz", - "integrity": "sha512-VaxMGsilqFnK1CeBX+LXnSuaMx4sTL/6znSZh2829txWieazdVxr54HmiyTsIbpOTLcf5nYpq9lpzmwRdxj6rQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.11.tgz", + "integrity": "sha512-oTAGGHo8ZYc5VZsBREzuf5lf2pAurJQsccMusVZ85wDkX66ojEc/XauiGjzCj50A61ObFTPe6d7Pyt6UBYaing==", "license": "Apache-2.0", "dependencies": { - "@smithy/querystring-parser": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/querystring-parser": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2550,13 +2569,13 @@ } }, "node_modules/@smithy/util-base64": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.0.tgz", - "integrity": "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.2.tgz", + "integrity": "sha512-XRH6b0H/5A3SgblmMa5ErXQ2XKhfbQB+Fm/oyLZ2O2kCUrwgg55bU0RekmzAhuwOjA9qdN5VU2BprOvGGUkOOQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", + "@smithy/util-buffer-from": "^4.2.2", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2564,9 +2583,9 @@ } }, "node_modules/@smithy/util-body-length-browser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz", - "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.2.tgz", + "integrity": "sha512-JKCrLNOup3OOgmzeaKQwi4ZCTWlYR5H4Gm1r2uTMVBXoemo1UEghk5vtMi1xSu2ymgKVGW631e2fp9/R610ZjQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2576,9 +2595,9 @@ } }, "node_modules/@smithy/util-body-length-node": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.1.tgz", - "integrity": "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.3.tgz", + "integrity": "sha512-ZkJGvqBzMHVHE7r/hcuCxlTY8pQr1kMtdsVPs7ex4mMU+EAbcXppfo5NmyxMYi2XU49eqaz56j2gsk4dHHPG/g==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2588,12 +2607,12 @@ } }, "node_modules/@smithy/util-buffer-from": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz", - "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.2.tgz", + "integrity": "sha512-FDXD7cvUoFWwN6vtQfEta540Y/YBe5JneK3SoZg9bThSoOAC/eGeYEua6RkBgKjGa/sz6Y+DuBZj3+YEY21y4Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^4.2.0", + "@smithy/is-array-buffer": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2601,9 +2620,9 @@ } }, "node_modules/@smithy/util-config-provider": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz", - "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.2.tgz", + "integrity": "sha512-dWU03V3XUprJwaUIFVv4iOnS1FC9HnMHDfUrlNDSh4315v0cWyaIErP8KiqGVbf5z+JupoVpNM7ZB3jFiTejvQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2613,14 +2632,14 @@ } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.3.11", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.11.tgz", - "integrity": "sha512-yHv+r6wSQXEXTPVCIQTNmXVWs7ekBTpMVErjqZoWkYN75HIFN5y9+/+sYOejfAuvxWGvgzgxbTHa/oz61YTbKw==", + "version": "4.3.38", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.38.tgz", + "integrity": "sha512-c8P1mFLNxcsdAMabB8/VUQUbWzFmgujWi4bAXSggcqLYPc8V4U5abqFqOyn+dK4YT+q8UyCVkTO8807t4t2syA==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.2.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", + "@smithy/property-provider": "^4.2.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2628,17 +2647,17 @@ } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "4.2.14", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.14.tgz", - "integrity": "sha512-ljZN3iRvaJUgulfvobIuG97q1iUuCMrvXAlkZ4msY+ZuVHQHDIqn7FKZCEj+bx8omz6kF5yQXms/xhzjIO5XiA==", + "version": "4.2.41", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.41.tgz", + "integrity": "sha512-/UG+9MT3UZAR0fLzOtMJMfWGcjjHvgggq924x/CRy8vRbL+yFf3Z6vETlvq8vDH92+31P/1gSOFoo7303wN8WQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/config-resolver": "^4.4.3", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", + "@smithy/config-resolver": "^4.4.10", + "@smithy/credential-provider-imds": "^4.2.11", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2646,13 +2665,13 @@ } }, "node_modules/@smithy/util-endpoints": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.5.tgz", - "integrity": "sha512-3O63AAWu2cSNQZp+ayl9I3NapW1p1rR5mlVHcF6hAB1dPZUQFfRPYtplWX/3xrzWthPGj5FqB12taJJCfH6s8A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.3.2.tgz", + "integrity": "sha512-+4HFLpE5u29AbFlTdlKIT7jfOzZ8PDYZKTb3e+AgLz986OYwqTourQ5H+jg79/66DB69Un1+qKecLnkZdAsYcA==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2660,9 +2679,9 @@ } }, "node_modules/@smithy/util-hex-encoding": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz", - "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.2.tgz", + "integrity": "sha512-Qcz3W5vuHK4sLQdyT93k/rfrUwdJ8/HZ+nMUOyGdpeGA1Wxt65zYwi3oEl9kOM+RswvYq90fzkNDahPS8K0OIg==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2672,12 +2691,12 @@ } }, "node_modules/@smithy/util-middleware": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.5.tgz", - "integrity": "sha512-6Y3+rvBF7+PZOc40ybeZMcGln6xJGVeY60E7jy9Mv5iKpMJpHgRE6dKy9ScsVxvfAYuEX4Q9a65DQX90KaQ3bA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.11.tgz", + "integrity": "sha512-r3dtF9F+TpSZUxpOVVtPfk09Rlo4lT6ORBqEvX3IBT6SkQAdDSVKR5GcfmZbtl7WKhKnmb3wbDTQ6ibR2XHClw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2685,13 +2704,13 @@ } }, "node_modules/@smithy/util-retry": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.5.tgz", - "integrity": "sha512-GBj3+EZBbN4NAqJ/7pAhsXdfzdlznOh8PydUijy6FpNIMnHPSMO2/rP4HKu+UFeikJxShERk528oy7GT79YiJg==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.11.tgz", + "integrity": "sha512-XSZULmL5x6aCTTii59wJqKsY1l3eMIAomRAccW7Tzh9r8s7T/7rdo03oektuH5jeYRlJMPcNP92EuRDvk9aXbw==", "license": "Apache-2.0", "dependencies": { - "@smithy/service-error-classification": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/service-error-classification": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2699,18 +2718,34 @@ } }, "node_modules/@smithy/util-stream": { - "version": "4.5.6", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.6.tgz", - "integrity": "sha512-qWw/UM59TiaFrPevefOZ8CNBKbYEP6wBAIlLqxn3VAIo9rgnTNc4ASbVrqDmhuwI87usnjhdQrxodzAGFFzbRQ==", + "version": "4.5.17", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.17.tgz", + "integrity": "sha512-793BYZ4h2JAQkNHcEnyFxDTcZbm9bVybD0UV/LEWmZ5bkTms7JqjfrLMi2Qy0E5WFcCzLwCAPgcvcvxoeALbAQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-hex-encoding": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", + "@smithy/fetch-http-handler": "^5.3.13", + "@smithy/node-http-handler": "^4.4.14", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-buffer-from": "^4.2.2", + "@smithy/util-hex-encoding": "^4.2.2", + "@smithy/util-utf8": "^4.2.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-stream/node_modules/@smithy/node-http-handler": { + "version": "4.4.14", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.14.tgz", + "integrity": "sha512-DamSqaU8nuk0xTJDrYnRzZndHwwRnyj/n/+RqGGCcBKB4qrQem0mSDiWdupaNWdwxzyMU91qxDmHOCazfhtO3A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/querystring-builder": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2718,9 +2753,9 @@ } }, "node_modules/@smithy/util-uri-escape": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz", - "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.2.tgz", + "integrity": "sha512-2kAStBlvq+lTXHyAZYfJRb/DfS3rsinLiwb+69SstC9Vb0s9vNWkRwpnj918Pfi85mzi42sOqdV72OLxWAISnw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2730,12 +2765,12 @@ } }, "node_modules/@smithy/util-utf8": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz", - "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.2.tgz", + "integrity": "sha512-75MeYpjdWRe8M5E3AW0O4Cx3UadweS+cwdXjwYGBW5h/gxxnbeZ877sLPX/ZJA9GVTlL/qG0dXP29JWFCD1Ayw==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-buffer-from": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2743,13 +2778,13 @@ } }, "node_modules/@smithy/util-waiter": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.2.5.tgz", - "integrity": "sha512-Dbun99A3InifQdIrsXZ+QLcC0PGBPAdrl4cj1mTgJvyc9N2zf7QSxg8TBkzsCmGJdE3TLbO9ycwpY0EkWahQ/g==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.2.11.tgz", + "integrity": "sha512-x7Rh2azQPs3XxbvCzcttRErKKvLnbZfqRf/gOjw2pb+ZscX88e5UkRPCB67bVnsFHxayvMvmePfKTqsRb+is1A==", "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/abort-controller": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2757,9 +2792,9 @@ } }, "node_modules/@smithy/uuid": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz", - "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.2.tgz", + "integrity": "sha512-O/IEdcCUKkubz60tFbGA7ceITTAJsty+lBjNoorP4Z6XRqaFb/OjQjZODophEcuq68nKm6/0r+6/lLQ+XVpk8g==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -4028,9 +4063,9 @@ } }, "node_modules/bowser": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.12.1.tgz", - "integrity": "sha512-z4rE2Gxh7tvshQ4hluIT7XcFrgLIQaw9X3A+kTTRdovCz5PMukm/0QC/BKSYPj3omF5Qfypn9O/c5kgpmvYUCw==", + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.14.1.tgz", + "integrity": "sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==", "license": "MIT" }, "node_modules/brace-expansion": { @@ -5553,10 +5588,22 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "node_modules/fast-xml-builder": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.0.0.tgz", + "integrity": "sha512-fpZuDogrAgnyt9oDDz+5DBz0zgPdPZz6D4IR7iESxRXElrlGTRkHJ9eEt+SACRJwT0FNFrt71DFQIUFBJfX/uQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, "node_modules/fast-xml-parser": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", - "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.4.1.tgz", + "integrity": "sha512-BQ30U1mKkvXQXXkAGcuyUA/GA26oEB7NzOtsxCDtyu62sjGw5QraKFhx2Em3WQNjPw9PG6MQ9yuIIgkSDfGu5A==", "funding": [ { "type": "github", @@ -5565,7 +5612,8 @@ ], "license": "MIT", "dependencies": { - "strnum": "^2.1.0" + "fast-xml-builder": "^1.0.0", + "strnum": "^2.1.2" }, "bin": { "fxparser": "src/cli/cli.js" @@ -9230,9 +9278,9 @@ } }, "node_modules/strnum": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", - "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.2.0.tgz", + "integrity": "sha512-Y7Bj8XyJxnPAORMZj/xltsfo55uOiyHcU2tnAVzHUnSJR/KsEX+9RoDeXEnsXtl/CX4fAcrt64gZ13aGaWPeBg==", "funding": [ { "type": "github", diff --git a/package.json b/package.json index 521d643..308311b 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "homepage": "https://github.com/aws-actions/aws-cloudformation-github-deploy#readme", "dependencies": { "@actions/core": "2.0.2", - "@aws-sdk/client-cloudformation": "3.935.0", + "@aws-sdk/client-cloudformation": "3.1003.0", "@smithy/node-http-handler": "4.4.5", "https-proxy-agent": "7.0.6", "js-yaml": "^4.1.1", From 85f537c97fdc7995347e74590ee7000dd2808fde Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 5 Mar 2026 23:18:46 +0000 Subject: [PATCH 2/2] (chore) updating dist --- dist/136.index.js | 846 +- dist/272.index.js | 773 + dist/360.index.js | 6 +- dist/443.index.js | 670 +- dist/579.index.js | 9 +- dist/605.index.js | 763 +- dist/762.index.js | 750 + dist/869.index.js | 352 +- dist/956.index.js | 870 +- dist/998.index.js | 2290 ++- dist/index.js | 38400 +++++++++++++++++++++++--------------------- 11 files changed, 25303 insertions(+), 20426 deletions(-) create mode 100644 dist/272.index.js create mode 100644 dist/762.index.js diff --git a/dist/136.index.js b/dist/136.index.js index d50e461..87d17c0 100644 --- a/dist/136.index.js +++ b/dist/136.index.js @@ -241,8 +241,146 @@ util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunct Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ruleSet = void 0; const F = "required", G = "type", H = "fn", I = "argv", J = "ref"; -const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "string" }, n = { [F]: true, "default": false, [G]: "boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], "assign": "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e, "signingName": f, "signingRegion": g }] }, "headers": {} }, v = {}, w = { "conditions": [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y]; -const _data = { version: "1.0", parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H]: "not", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G]: h }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: "Invalid Configuration: Missing Region", [G]: k }] }; +const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "string" }, n = { [F]: true, default: false, [G]: "boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], assign: "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { + url: "https://sts.amazonaws.com", + properties: { authSchemes: [{ name: e, signingName: f, signingRegion: g }] }, + headers: {}, +}, v = {}, w = { conditions: [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y]; +const _data = { + version: "1.0", + parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, + rules: [ + { + conditions: [ + { [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, + { [H]: "not", [I]: C }, + p, + r, + { [H]: c, [I]: [s, a] }, + { [H]: c, [I]: [t, a] }, + ], + rules: [ + { conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, + w, + { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, + { + endpoint: { + url: i, + properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, + headers: v, + }, + [G]: h, + }, + ], + [G]: j, + }, + { + conditions: C, + rules: [ + { conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, + { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, + { endpoint: { url: o, properties: v, headers: v }, [G]: h }, + ], + [G]: j, + }, + { + conditions: [p], + rules: [ + { + conditions: [r], + rules: [ + { + conditions: [x, y], + rules: [ + { + conditions: [{ [H]: c, [I]: [b, z] }, B], + rules: [ + { + endpoint: { + url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + properties: v, + headers: v, + }, + [G]: h, + }, + ], + [G]: j, + }, + { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }, + ], + [G]: j, + }, + { + conditions: D, + rules: [ + { + conditions: [{ [H]: c, [I]: [z, b] }], + rules: [ + { + conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], + endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, + [G]: h, + }, + { + endpoint: { + url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", + properties: v, + headers: v, + }, + [G]: h, + }, + ], + [G]: j, + }, + { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }, + ], + [G]: j, + }, + { + conditions: E, + rules: [ + { + conditions: [B], + rules: [ + { + endpoint: { + url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", + properties: v, + headers: v, + }, + [G]: h, + }, + ], + [G]: j, + }, + { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }, + ], + [G]: j, + }, + w, + { endpoint: { url: i, properties: v, headers: v }, [G]: h }, + ], + [G]: j, + }, + ], + [G]: j, + }, + { error: "Invalid Configuration: Missing Region", [G]: k }, + ], +}; exports.ruleSet = _data; @@ -257,312 +395,11 @@ var STSClient = __webpack_require__(3723); var smithyClient = __webpack_require__(1411); var middlewareEndpoint = __webpack_require__(99); var EndpointParameters = __webpack_require__(6811); -var schema = __webpack_require__(6890); +var schemas_0 = __webpack_require__(1684); +var errors = __webpack_require__(1688); var client = __webpack_require__(5152); var regionConfigResolver = __webpack_require__(6463); - -let STSServiceException$1 = class STSServiceException extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, STSServiceException.prototype); - } -}; - -let ExpiredTokenException$1 = class ExpiredTokenException extends STSServiceException$1 { - name = "ExpiredTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ExpiredTokenException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ExpiredTokenException.prototype); - } -}; -let MalformedPolicyDocumentException$1 = class MalformedPolicyDocumentException extends STSServiceException$1 { - name = "MalformedPolicyDocumentException"; - $fault = "client"; - constructor(opts) { - super({ - name: "MalformedPolicyDocumentException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); - } -}; -let PackedPolicyTooLargeException$1 = class PackedPolicyTooLargeException extends STSServiceException$1 { - name = "PackedPolicyTooLargeException"; - $fault = "client"; - constructor(opts) { - super({ - name: "PackedPolicyTooLargeException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); - } -}; -let RegionDisabledException$1 = class RegionDisabledException extends STSServiceException$1 { - name = "RegionDisabledException"; - $fault = "client"; - constructor(opts) { - super({ - name: "RegionDisabledException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, RegionDisabledException.prototype); - } -}; -let IDPRejectedClaimException$1 = class IDPRejectedClaimException extends STSServiceException$1 { - name = "IDPRejectedClaimException"; - $fault = "client"; - constructor(opts) { - super({ - name: "IDPRejectedClaimException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); - } -}; -let InvalidIdentityTokenException$1 = class InvalidIdentityTokenException extends STSServiceException$1 { - name = "InvalidIdentityTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidIdentityTokenException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); - } -}; -let IDPCommunicationErrorException$1 = class IDPCommunicationErrorException extends STSServiceException$1 { - name = "IDPCommunicationErrorException"; - $fault = "client"; - constructor(opts) { - super({ - name: "IDPCommunicationErrorException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); - } -}; - -const _A = "Arn"; -const _AKI = "AccessKeyId"; -const _AR = "AssumeRole"; -const _ARI = "AssumedRoleId"; -const _ARR = "AssumeRoleRequest"; -const _ARRs = "AssumeRoleResponse"; -const _ARU = "AssumedRoleUser"; -const _ARWWI = "AssumeRoleWithWebIdentity"; -const _ARWWIR = "AssumeRoleWithWebIdentityRequest"; -const _ARWWIRs = "AssumeRoleWithWebIdentityResponse"; -const _Au = "Audience"; -const _C = "Credentials"; -const _CA = "ContextAssertion"; -const _DS = "DurationSeconds"; -const _E = "Expiration"; -const _EI = "ExternalId"; -const _ETE = "ExpiredTokenException"; -const _IDPCEE = "IDPCommunicationErrorException"; -const _IDPRCE = "IDPRejectedClaimException"; -const _IITE = "InvalidIdentityTokenException"; -const _K = "Key"; -const _MPDE = "MalformedPolicyDocumentException"; -const _P = "Policy"; -const _PA = "PolicyArns"; -const _PAr = "ProviderArn"; -const _PC = "ProvidedContexts"; -const _PCLT = "ProvidedContextsListType"; -const _PCr = "ProvidedContext"; -const _PDT = "PolicyDescriptorType"; -const _PI = "ProviderId"; -const _PPS = "PackedPolicySize"; -const _PPTLE = "PackedPolicyTooLargeException"; -const _Pr = "Provider"; -const _RA = "RoleArn"; -const _RDE = "RegionDisabledException"; -const _RSN = "RoleSessionName"; -const _SAK = "SecretAccessKey"; -const _SFWIT = "SubjectFromWebIdentityToken"; -const _SI = "SourceIdentity"; -const _SN = "SerialNumber"; -const _ST = "SessionToken"; -const _T = "Tags"; -const _TC = "TokenCode"; -const _TTK = "TransitiveTagKeys"; -const _Ta = "Tag"; -const _V = "Value"; -const _WIT = "WebIdentityToken"; -const _a = "arn"; -const _aKST = "accessKeySecretType"; -const _aQE = "awsQueryError"; -const _c = "client"; -const _cTT = "clientTokenType"; -const _e = "error"; -const _hE = "httpError"; -const _m = "message"; -const _pDLT = "policyDescriptorListType"; -const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; -const _tLT = "tagListType"; -const n0 = "com.amazonaws.sts"; -var accessKeySecretType = [0, n0, _aKST, 8, 0]; -var clientTokenType = [0, n0, _cTT, 8, 0]; -var AssumedRoleUser = [3, n0, _ARU, 0, [_ARI, _A], [0, 0]]; -var AssumeRoleRequest = [ - 3, - n0, - _ARR, - 0, - [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC], - [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType], -]; -var AssumeRoleResponse = [ - 3, - n0, - _ARRs, - 0, - [_C, _ARU, _PPS, _SI], - [[() => Credentials, 0], () => AssumedRoleUser, 1, 0], -]; -var AssumeRoleWithWebIdentityRequest = [ - 3, - n0, - _ARWWIR, - 0, - [_RA, _RSN, _WIT, _PI, _PA, _P, _DS], - [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1], -]; -var AssumeRoleWithWebIdentityResponse = [ - 3, - n0, - _ARWWIRs, - 0, - [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI], - [[() => Credentials, 0], 0, () => AssumedRoleUser, 1, 0, 0, 0], -]; -var Credentials = [ - 3, - n0, - _C, - 0, - [_AKI, _SAK, _ST, _E], - [0, [() => accessKeySecretType, 0], 0, 4], -]; -var ExpiredTokenException = [ - -3, - n0, - _ETE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ExpiredTokenException`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1); -var IDPCommunicationErrorException = [ - -3, - n0, - _IDPCEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`IDPCommunicationError`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(IDPCommunicationErrorException, IDPCommunicationErrorException$1); -var IDPRejectedClaimException = [ - -3, - n0, - _IDPRCE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`IDPRejectedClaim`, 403], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(IDPRejectedClaimException, IDPRejectedClaimException$1); -var InvalidIdentityTokenException = [ - -3, - n0, - _IITE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InvalidIdentityToken`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidIdentityTokenException, InvalidIdentityTokenException$1); -var MalformedPolicyDocumentException = [ - -3, - n0, - _MPDE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`MalformedPolicyDocument`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(MalformedPolicyDocumentException, MalformedPolicyDocumentException$1); -var PackedPolicyTooLargeException = [ - -3, - n0, - _PPTLE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`PackedPolicyTooLarge`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(PackedPolicyTooLargeException, PackedPolicyTooLargeException$1); -var PolicyDescriptorType = [3, n0, _PDT, 0, [_a], [0]]; -var ProvidedContext = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]]; -var RegionDisabledException = [ - -3, - n0, - _RDE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`RegionDisabledException`, 403], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(RegionDisabledException, RegionDisabledException$1); -var Tag = [3, n0, _Ta, 0, [_K, _V], [0, 0]]; -var STSServiceException = [-3, _s, "STSServiceException", 0, [], []]; -schema.TypeRegistry.for(_s).registerError(STSServiceException, STSServiceException$1); -var policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType]; -var ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext]; -var tagListType = [1, n0, _tLT, 0, () => Tag]; -var AssumeRole = [9, n0, _AR, 0, () => AssumeRoleRequest, () => AssumeRoleResponse]; -var AssumeRoleWithWebIdentity = [ - 9, - n0, - _ARWWI, - 0, - () => AssumeRoleWithWebIdentityRequest, - () => AssumeRoleWithWebIdentityResponse, -]; +var STSServiceException = __webpack_require__(7171); class AssumeRoleCommand extends smithyClient.Command .classBuilder() @@ -572,7 +409,7 @@ class AssumeRoleCommand extends smithyClient.Command }) .s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}) .n("STSClient", "AssumeRoleCommand") - .sc(AssumeRole) + .sc(schemas_0.AssumeRole$) .build() { } @@ -584,7 +421,7 @@ class AssumeRoleWithWebIdentityCommand extends smithyClient.Command }) .s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}) .n("STSClient", "AssumeRoleWithWebIdentityCommand") - .sc(AssumeRoleWithWebIdentity) + .sc(schemas_0.AssumeRoleWithWebIdentity$) .build() { } @@ -608,9 +445,10 @@ const getAccountIdFromAssumedRoleUser = (assumedRoleUser) => { const resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => { const region = typeof _region === "function" ? await _region() : _region; const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; - const stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)(); + let stsDefaultRegion = ""; + const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)()); credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`); - return region ?? parentRegion ?? stsDefaultRegion; + return resolvedRegion; }; const getDefaultRoleAssumer$1 = (stsOptions, STSClient) => { let stsClient; @@ -715,32 +553,167 @@ const decorateDefaultCredentialProvider = (provider) => (input) => provider({ ...input, }); -Object.defineProperty(exports, "$Command", ({ - enumerable: true, - get: function () { return smithyClient.Command; } -})); +exports.$Command = smithyClient.Command; +exports.STSServiceException = STSServiceException.STSServiceException; exports.AssumeRoleCommand = AssumeRoleCommand; exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand; -exports.ExpiredTokenException = ExpiredTokenException$1; -exports.IDPCommunicationErrorException = IDPCommunicationErrorException$1; -exports.IDPRejectedClaimException = IDPRejectedClaimException$1; -exports.InvalidIdentityTokenException = InvalidIdentityTokenException$1; -exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException$1; -exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException$1; -exports.RegionDisabledException = RegionDisabledException$1; exports.STS = STS; -exports.STSServiceException = STSServiceException$1; exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; exports.getDefaultRoleAssumer = getDefaultRoleAssumer; exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; +Object.prototype.hasOwnProperty.call(STSClient, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: STSClient['__proto__'] + }); + Object.keys(STSClient).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = STSClient[k]; +}); +Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: schemas_0['__proto__'] + }); + +Object.keys(schemas_0).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k]; +}); +Object.prototype.hasOwnProperty.call(errors, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { enumerable: true, - get: function () { return STSClient[k]; } + value: errors['__proto__'] }); + +Object.keys(errors).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k]; }); +/***/ }), + +/***/ 7171: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.STSServiceException = exports.__ServiceException = void 0; +const smithy_client_1 = __webpack_require__(1411); +Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); +class STSServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, STSServiceException.prototype); + } +} +exports.STSServiceException = STSServiceException; + + +/***/ }), + +/***/ 1688: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IDPCommunicationErrorException = exports.InvalidIdentityTokenException = exports.IDPRejectedClaimException = exports.RegionDisabledException = exports.PackedPolicyTooLargeException = exports.MalformedPolicyDocumentException = exports.ExpiredTokenException = void 0; +const STSServiceException_1 = __webpack_require__(7171); +class ExpiredTokenException extends STSServiceException_1.STSServiceException { + name = "ExpiredTokenException"; + $fault = "client"; + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ExpiredTokenException.prototype); + } +} +exports.ExpiredTokenException = ExpiredTokenException; +class MalformedPolicyDocumentException extends STSServiceException_1.STSServiceException { + name = "MalformedPolicyDocumentException"; + $fault = "client"; + constructor(opts) { + super({ + name: "MalformedPolicyDocumentException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); + } +} +exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException; +class PackedPolicyTooLargeException extends STSServiceException_1.STSServiceException { + name = "PackedPolicyTooLargeException"; + $fault = "client"; + constructor(opts) { + super({ + name: "PackedPolicyTooLargeException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); + } +} +exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException; +class RegionDisabledException extends STSServiceException_1.STSServiceException { + name = "RegionDisabledException"; + $fault = "client"; + constructor(opts) { + super({ + name: "RegionDisabledException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, RegionDisabledException.prototype); + } +} +exports.RegionDisabledException = RegionDisabledException; +class IDPRejectedClaimException extends STSServiceException_1.STSServiceException { + name = "IDPRejectedClaimException"; + $fault = "client"; + constructor(opts) { + super({ + name: "IDPRejectedClaimException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); + } +} +exports.IDPRejectedClaimException = IDPRejectedClaimException; +class InvalidIdentityTokenException extends STSServiceException_1.STSServiceException { + name = "InvalidIdentityTokenException"; + $fault = "client"; + constructor(opts) { + super({ + name: "InvalidIdentityTokenException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); + } +} +exports.InvalidIdentityTokenException = InvalidIdentityTokenException; +class IDPCommunicationErrorException extends STSServiceException_1.STSServiceException { + name = "IDPCommunicationErrorException"; + $fault = "client"; + constructor(opts) { + super({ + name: "IDPCommunicationErrorException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); + } +} +exports.IDPCommunicationErrorException = IDPCommunicationErrorException; + + /***/ }), /***/ 6578: @@ -758,15 +731,14 @@ const core_2 = __webpack_require__(402); const hash_node_1 = __webpack_require__(2711); const middleware_retry_1 = __webpack_require__(9618); const node_config_provider_1 = __webpack_require__(5704); -const node_http_handler_1 = __webpack_require__(1279); +const node_http_handler_1 = __webpack_require__(2764); +const smithy_client_1 = __webpack_require__(1411); const util_body_length_node_1 = __webpack_require__(3638); +const util_defaults_mode_node_1 = __webpack_require__(5435); const util_retry_1 = __webpack_require__(5518); const runtimeConfig_shared_1 = __webpack_require__(4443); -const smithy_client_1 = __webpack_require__(1411); -const util_defaults_mode_node_1 = __webpack_require__(5435); -const smithy_client_2 = __webpack_require__(1411); const getRuntimeConfig = (config) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); + (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); @@ -833,6 +805,7 @@ const util_base64_1 = __webpack_require__(8385); const util_utf8_1 = __webpack_require__(1577); const httpAuthSchemeProvider_1 = __webpack_require__(7851); const endpointResolver_1 = __webpack_require__(9765); +const schemas_0_1 = __webpack_require__(1684); const getRuntimeConfig = (config) => { return { apiVersion: "2011-06-15", @@ -855,12 +828,14 @@ const getRuntimeConfig = (config) => { }, ], logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - protocol: config?.protocol ?? - new protocols_1.AwsQueryProtocol({ - defaultNamespace: "com.amazonaws.sts", - xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", - version: "2011-06-15", - }), + protocol: config?.protocol ?? protocols_1.AwsQueryProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.sts", + errorTypeRegistries: schemas_0_1.errorTypeRegistries, + xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", + version: "2011-06-15", + serviceTarget: "AWSSecurityTokenServiceV20110615", + }, serviceId: config?.serviceId ?? "STS", urlParser: config?.urlParser ?? url_parser_1.parseUrl, utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, @@ -892,10 +867,205 @@ exports.resolveRuntimeExtensions = resolveRuntimeExtensions; /***/ }), -/***/ 9955: -/***/ ((module) => { +/***/ 1684: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AssumeRoleWithWebIdentity$ = exports.AssumeRole$ = exports.Tag$ = exports.ProvidedContext$ = exports.PolicyDescriptorType$ = exports.Credentials$ = exports.AssumeRoleWithWebIdentityResponse$ = exports.AssumeRoleWithWebIdentityRequest$ = exports.AssumeRoleResponse$ = exports.AssumeRoleRequest$ = exports.AssumedRoleUser$ = exports.errorTypeRegistries = exports.RegionDisabledException$ = exports.PackedPolicyTooLargeException$ = exports.MalformedPolicyDocumentException$ = exports.InvalidIdentityTokenException$ = exports.IDPRejectedClaimException$ = exports.IDPCommunicationErrorException$ = exports.ExpiredTokenException$ = exports.STSServiceException$ = void 0; +const _A = "Arn"; +const _AKI = "AccessKeyId"; +const _AR = "AssumeRole"; +const _ARI = "AssumedRoleId"; +const _ARR = "AssumeRoleRequest"; +const _ARRs = "AssumeRoleResponse"; +const _ARU = "AssumedRoleUser"; +const _ARWWI = "AssumeRoleWithWebIdentity"; +const _ARWWIR = "AssumeRoleWithWebIdentityRequest"; +const _ARWWIRs = "AssumeRoleWithWebIdentityResponse"; +const _Au = "Audience"; +const _C = "Credentials"; +const _CA = "ContextAssertion"; +const _DS = "DurationSeconds"; +const _E = "Expiration"; +const _EI = "ExternalId"; +const _ETE = "ExpiredTokenException"; +const _IDPCEE = "IDPCommunicationErrorException"; +const _IDPRCE = "IDPRejectedClaimException"; +const _IITE = "InvalidIdentityTokenException"; +const _K = "Key"; +const _MPDE = "MalformedPolicyDocumentException"; +const _P = "Policy"; +const _PA = "PolicyArns"; +const _PAr = "ProviderArn"; +const _PC = "ProvidedContexts"; +const _PCLT = "ProvidedContextsListType"; +const _PCr = "ProvidedContext"; +const _PDT = "PolicyDescriptorType"; +const _PI = "ProviderId"; +const _PPS = "PackedPolicySize"; +const _PPTLE = "PackedPolicyTooLargeException"; +const _Pr = "Provider"; +const _RA = "RoleArn"; +const _RDE = "RegionDisabledException"; +const _RSN = "RoleSessionName"; +const _SAK = "SecretAccessKey"; +const _SFWIT = "SubjectFromWebIdentityToken"; +const _SI = "SourceIdentity"; +const _SN = "SerialNumber"; +const _ST = "SessionToken"; +const _T = "Tags"; +const _TC = "TokenCode"; +const _TTK = "TransitiveTagKeys"; +const _Ta = "Tag"; +const _V = "Value"; +const _WIT = "WebIdentityToken"; +const _a = "arn"; +const _aKST = "accessKeySecretType"; +const _aQE = "awsQueryError"; +const _c = "client"; +const _cTT = "clientTokenType"; +const _e = "error"; +const _hE = "httpError"; +const _m = "message"; +const _pDLT = "policyDescriptorListType"; +const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; +const _tLT = "tagListType"; +const n0 = "com.amazonaws.sts"; +const schema_1 = __webpack_require__(6890); +const errors_1 = __webpack_require__(1688); +const STSServiceException_1 = __webpack_require__(7171); +const _s_registry = schema_1.TypeRegistry.for(_s); +exports.STSServiceException$ = [-3, _s, "STSServiceException", 0, [], []]; +_s_registry.registerError(exports.STSServiceException$, STSServiceException_1.STSServiceException); +const n0_registry = schema_1.TypeRegistry.for(n0); +exports.ExpiredTokenException$ = [ + -3, + n0, + _ETE, + { [_aQE]: [`ExpiredTokenException`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.ExpiredTokenException$, errors_1.ExpiredTokenException); +exports.IDPCommunicationErrorException$ = [ + -3, + n0, + _IDPCEE, + { [_aQE]: [`IDPCommunicationError`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.IDPCommunicationErrorException$, errors_1.IDPCommunicationErrorException); +exports.IDPRejectedClaimException$ = [ + -3, + n0, + _IDPRCE, + { [_aQE]: [`IDPRejectedClaim`, 403], [_e]: _c, [_hE]: 403 }, + [_m], + [0], +]; +n0_registry.registerError(exports.IDPRejectedClaimException$, errors_1.IDPRejectedClaimException); +exports.InvalidIdentityTokenException$ = [ + -3, + n0, + _IITE, + { [_aQE]: [`InvalidIdentityToken`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.InvalidIdentityTokenException$, errors_1.InvalidIdentityTokenException); +exports.MalformedPolicyDocumentException$ = [ + -3, + n0, + _MPDE, + { [_aQE]: [`MalformedPolicyDocument`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.MalformedPolicyDocumentException$, errors_1.MalformedPolicyDocumentException); +exports.PackedPolicyTooLargeException$ = [ + -3, + n0, + _PPTLE, + { [_aQE]: [`PackedPolicyTooLarge`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.PackedPolicyTooLargeException$, errors_1.PackedPolicyTooLargeException); +exports.RegionDisabledException$ = [ + -3, + n0, + _RDE, + { [_aQE]: [`RegionDisabledException`, 403], [_e]: _c, [_hE]: 403 }, + [_m], + [0], +]; +n0_registry.registerError(exports.RegionDisabledException$, errors_1.RegionDisabledException); +exports.errorTypeRegistries = [_s_registry, n0_registry]; +var accessKeySecretType = [0, n0, _aKST, 8, 0]; +var clientTokenType = [0, n0, _cTT, 8, 0]; +exports.AssumedRoleUser$ = [3, n0, _ARU, 0, [_ARI, _A], [0, 0], 2]; +exports.AssumeRoleRequest$ = [ + 3, + n0, + _ARR, + 0, + [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC], + [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType], + 2, +]; +exports.AssumeRoleResponse$ = [ + 3, + n0, + _ARRs, + 0, + [_C, _ARU, _PPS, _SI], + [[() => exports.Credentials$, 0], () => exports.AssumedRoleUser$, 1, 0], +]; +exports.AssumeRoleWithWebIdentityRequest$ = [ + 3, + n0, + _ARWWIR, + 0, + [_RA, _RSN, _WIT, _PI, _PA, _P, _DS], + [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1], + 3, +]; +exports.AssumeRoleWithWebIdentityResponse$ = [ + 3, + n0, + _ARWWIRs, + 0, + [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI], + [[() => exports.Credentials$, 0], 0, () => exports.AssumedRoleUser$, 1, 0, 0, 0], +]; +exports.Credentials$ = [ + 3, + n0, + _C, + 0, + [_AKI, _SAK, _ST, _E], + [0, [() => accessKeySecretType, 0], 0, 4], + 4, +]; +exports.PolicyDescriptorType$ = [3, n0, _PDT, 0, [_a], [0]]; +exports.ProvidedContext$ = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]]; +exports.Tag$ = [3, n0, _Ta, 0, [_K, _V], [0, 0], 2]; +var policyDescriptorListType = [1, n0, _pDLT, 0, () => exports.PolicyDescriptorType$]; +var ProvidedContextsListType = [1, n0, _PCLT, 0, () => exports.ProvidedContext$]; +var tagKeyListType = (/* unused pure expression or super */ null && (64 | 0)); +var tagListType = [1, n0, _tLT, 0, () => exports.Tag$]; +exports.AssumeRole$ = [9, n0, _AR, 0, () => exports.AssumeRoleRequest$, () => exports.AssumeRoleResponse$]; +exports.AssumeRoleWithWebIdentity$ = [ + 9, + n0, + _ARWWI, + 0, + () => exports.AssumeRoleWithWebIdentityRequest$, + () => exports.AssumeRoleWithWebIdentityResponse$, +]; -module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/nested-clients","version":"3.935.0","description":"Nested clients for AWS SDK packages.","main":"./dist-cjs/index.js","module":"./dist-es/index.js","types":"./dist-types/index.d.ts","scripts":{"build":"yarn lint && concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline nested-clients","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","lint":"node ../../scripts/validation/submodules-linter.js --pkg nested-clients","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"engines":{"node":">=18.0.0"},"sideEffects":false,"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.935.0","@aws-sdk/middleware-host-header":"3.930.0","@aws-sdk/middleware-logger":"3.930.0","@aws-sdk/middleware-recursion-detection":"3.933.0","@aws-sdk/middleware-user-agent":"3.935.0","@aws-sdk/region-config-resolver":"3.930.0","@aws-sdk/types":"3.930.0","@aws-sdk/util-endpoints":"3.930.0","@aws-sdk/util-user-agent-browser":"3.930.0","@aws-sdk/util-user-agent-node":"3.935.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0","tslib":"^2.6.2"},"devDependencies":{"concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["./sso-oidc.d.ts","./sso-oidc.js","./sts.d.ts","./sts.js","dist-*/**"],"browser":{"./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"packages/nested-clients"},"exports":{"./sso-oidc":{"types":"./dist-types/submodules/sso-oidc/index.d.ts","module":"./dist-es/submodules/sso-oidc/index.js","node":"./dist-cjs/submodules/sso-oidc/index.js","import":"./dist-es/submodules/sso-oidc/index.js","require":"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{"types":"./dist-types/submodules/sts/index.d.ts","module":"./dist-es/submodules/sts/index.js","node":"./dist-cjs/submodules/sts/index.js","import":"./dist-es/submodules/sts/index.js","require":"./dist-cjs/submodules/sts/index.js"}}}'); /***/ }) diff --git a/dist/272.index.js b/dist/272.index.js new file mode 100644 index 0000000..4c4ace7 --- /dev/null +++ b/dist/272.index.js @@ -0,0 +1,773 @@ +"use strict"; +exports.id = 272; +exports.ids = [272]; +exports.modules = { + +/***/ 2764: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +var protocolHttp = __webpack_require__(2356); +var querystringBuilder = __webpack_require__(8256); +var http = __webpack_require__(8611); +var https = __webpack_require__(5692); +var stream = __webpack_require__(2203); +var http2 = __webpack_require__(5675); + +function buildAbortError(abortSignal) { + const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal + ? abortSignal.reason + : undefined; + if (reason) { + if (reason instanceof Error) { + return reason; + } + const abortError = new Error(String(reason)); + abortError.name = "AbortError"; + return abortError; + } + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return abortError; +} + +const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +const getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}; + +const timing = { + setTimeout: (cb, ms) => setTimeout(cb, ms), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), +}; + +const DEFER_EVENT_LISTENER_TIME$2 = 1000; +const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return -1; + } + const registerTimeout = (offset) => { + const timeoutId = timing.setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { + name: "TimeoutError", + })); + }, timeoutInMs - offset); + const doWithSocket = (socket) => { + if (socket?.connecting) { + socket.on("connect", () => { + timing.clearTimeout(timeoutId); + }); + } + else { + timing.clearTimeout(timeoutId); + } + }; + if (request.socket) { + doWithSocket(request.socket); + } + else { + request.on("socket", doWithSocket); + } + }; + if (timeoutInMs < 2000) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2); +}; + +const setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => { + if (timeoutInMs) { + return timing.setTimeout(() => { + let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; + if (throwOnRequestTimeout) { + const error = Object.assign(new Error(msg), { + name: "TimeoutError", + code: "ETIMEDOUT", + }); + req.destroy(error); + reject(error); + } + else { + msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; + logger?.warn?.(msg); + } + }, timeoutInMs); + } + return -1; +}; + +const DEFER_EVENT_LISTENER_TIME$1 = 3000; +const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => { + if (keepAlive !== true) { + return -1; + } + const registerListener = () => { + if (request.socket) { + request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + } + else { + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); + } + }; + if (deferTimeMs === 0) { + registerListener(); + return 0; + } + return timing.setTimeout(registerListener, deferTimeMs); +}; + +const DEFER_EVENT_LISTENER_TIME = 3000; +const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + const registerTimeout = (offset) => { + const timeout = timeoutInMs - offset; + const onTimeout = () => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); + }; + if (request.socket) { + request.socket.setTimeout(timeout, onTimeout); + request.on("close", () => request.socket?.removeListener("timeout", onTimeout)); + } + else { + request.setTimeout(timeout, onTimeout); + } + }; + if (0 < timeoutInMs && timeoutInMs < 6000) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); +}; + +const MIN_WAIT_TIME = 6_000; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { + const headers = request.headers ?? {}; + const expect = headers.Expect || headers.expect; + let timeoutId = -1; + let sendBody = true; + if (!externalAgent && expect === "100-continue") { + sendBody = await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + timing.clearTimeout(timeoutId); + resolve(true); + }); + httpRequest.on("response", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + httpRequest.on("error", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + }), + ]); + } + if (sendBody) { + writeBody(httpRequest, request.body); + } +} +function writeBody(httpRequest, body) { + if (body instanceof stream.Readable) { + body.pipe(httpRequest); + return; + } + if (body) { + const isBuffer = Buffer.isBuffer(body); + const isString = typeof body === "string"; + if (isBuffer || isString) { + if (isBuffer && body.byteLength === 0) { + httpRequest.end(); + } + else { + 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(); +} + +const DEFAULT_REQUEST_TIMEOUT = 0; +class NodeHttpHandler { + config; + configProvider; + socketWarningTimestamp = 0; + externalAgent = false; + metadata = { handlerProtocol: "http/1.1" }; + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new NodeHttpHandler(instanceOrOptions); + } + static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15_000; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = sockets[origin]?.length ?? 0; + const requestsEnqueued = requests[origin]?.length ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + logger?.warn?.(`@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; + } + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }) + .catch(reject); + } + else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout, + socketTimeout, + socketAcquisitionWarningTimeout, + throwOnRequestTimeout, + httpAgent: (() => { + if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") { + this.externalAgent = true; + return httpAgent; + } + return new http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") { + this.externalAgent = true; + return httpsAgent; + } + return new https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })(), + logger, + }; + } + destroy() { + this.config?.httpAgent?.destroy(); + this.config?.httpsAgent?.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + return new Promise((_resolve, _reject) => { + const config = this.config; + let writeRequestBodyPromise = undefined; + const timeouts = []; + const resolve = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _reject(arg); + }; + if (abortSignal?.aborted) { + const abortError = buildAbortError(abortSignal); + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const headers = request.headers ?? {}; + const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; + let agent = isSSL ? config.httpsAgent : config.httpAgent; + if (expectContinue && !this.externalAgent) { + agent = new (isSSL ? https.Agent : http.Agent)({ + keepAlive: false, + maxSockets: Infinity, + }); + } + timeouts.push(timing.setTimeout(() => { + this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); + }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2000) + (config.connectionTimeout ?? 1000))); + const queryString = querystringBuilder.buildQueryString(request.query || {}); + let auth = undefined; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}`; + } + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + let hostname = request.hostname ?? ""; + if (hostname[0] === "[" && hostname.endsWith("]")) { + hostname = request.hostname.slice(1, -1); + } + else { + hostname = request.hostname; + } + const nodeHttpsOptions = { + headers: request.headers, + host: hostname, + method: request.method, + path, + port: request.port, + agent, + auth, + }; + const requestFunc = isSSL ? https.request : http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocolHttp.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 = () => { + req.destroy(); + const abortError = buildAbortError(abortSignal); + reject(abortError); + }; + 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; + } + } + const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; + timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout)); + timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); + timeouts.push(setSocketTimeout(req, reject, config.socketTimeout)); + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + timeouts.push(setSocketKeepAlive(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs, + })); + } + writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e) => { + timeouts.forEach(timing.clearTimeout); + return _reject(e); + }); + }); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } +} + +class NodeHttp2ConnectionPool { + sessions = []; + constructor(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(); + } + } + } + } +} + +class NodeHttp2ConnectionManager { + constructor(config) { + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + config; + sessionCache = new Map(); + lease(requestContext, connectionConfiguration) { + const url = this.getUrlString(requestContext); + const existingPool = this.sessionCache.get(url); + if (existingPool) { + const existingSession = existingPool.poll(); + if (existingSession && !this.config.disableConcurrency) { + return existingSession; + } + } + const session = http2.connect(url); + 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 = () => { + session.destroy(); + this.deleteSession(url, session); + }; + session.on("goaway", destroySessionCb); + session.on("error", destroySessionCb); + session.on("frameError", destroySessionCb); + session.on("close", () => this.deleteSession(url, session)); + if (connectionConfiguration.requestTimeout) { + session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); + } + const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool(); + connectionPool.offerLast(session); + this.sessionCache.set(url, connectionPool); + return session; + } + 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) { + const cacheKey = this.getUrlString(requestContext); + this.sessionCache.get(cacheKey)?.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 (maxConcurrentStreams && maxConcurrentStreams <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } +} + +class NodeHttp2Handler { + config; + configProvider; + metadata = { handlerProtocol: "h2" }; + connectionManager = new NodeHttp2ConnectionManager({}); + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new NodeHttp2Handler(instanceOrOptions); + } + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((opts) => { + resolve(opts || {}); + }) + .catch(reject); + } + else { + resolve(options || {}); + } + }); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + 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: configRequestTimeout, disableConcurrentStreams } = this.config; + const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; + return new Promise((_resolve, _reject) => { + let fulfilled = false; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal?.aborted) { + fulfilled = true; + const abortError = buildAbortError(abortSignal); + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = request; + let auth = ""; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}@`; + } + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: this.config?.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false, + }); + const rejectWithDestroy = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }; + const queryString = querystringBuilder.buildQueryString(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [http2.constants.HTTP2_HEADER_PATH]: path, + [http2.constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocolHttp.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 (effectiveRequestTimeout) { + req.setTimeout(effectiveRequestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + const onAbort = () => { + req.close(); + const abortError = buildAbortError(abortSignal); + rejectWithDestroy(abortError); + }; + 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, request, effectiveRequestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } +} + +class Collector extends stream.Writable { + bufferedBytes = []; + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +} + +const streamCollector = (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); + }); + }); +}; +const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream; +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; +} + +exports.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; +exports.NodeHttp2Handler = NodeHttp2Handler; +exports.NodeHttpHandler = NodeHttpHandler; +exports.streamCollector = streamCollector; + + +/***/ }), + +/***/ 9955: +/***/ ((module) => { + +module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/nested-clients","version":"3.996.6","description":"Nested clients for AWS SDK packages.","main":"./dist-cjs/index.js","module":"./dist-es/index.js","types":"./dist-types/index.d.ts","scripts":{"build":"yarn lint && concurrently \'yarn:build:types\' \'yarn:build:es\' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":"yarn g:turbo run build -F=\\"$npm_package_name\\"","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","lint":"node ../../scripts/validation/submodules-linter.js --pkg nested-clients","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"engines":{"node":">=20.0.0"},"sideEffects":false,"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.973.18","@aws-sdk/middleware-host-header":"^3.972.7","@aws-sdk/middleware-logger":"^3.972.7","@aws-sdk/middleware-recursion-detection":"^3.972.7","@aws-sdk/middleware-user-agent":"^3.972.18","@aws-sdk/region-config-resolver":"^3.972.7","@aws-sdk/types":"^3.973.5","@aws-sdk/util-endpoints":"^3.996.4","@aws-sdk/util-user-agent-browser":"^3.972.7","@aws-sdk/util-user-agent-node":"^3.973.3","@smithy/config-resolver":"^4.4.10","@smithy/core":"^3.23.8","@smithy/fetch-http-handler":"^5.3.13","@smithy/hash-node":"^4.2.11","@smithy/invalid-dependency":"^4.2.11","@smithy/middleware-content-length":"^4.2.11","@smithy/middleware-endpoint":"^4.4.22","@smithy/middleware-retry":"^4.4.39","@smithy/middleware-serde":"^4.2.12","@smithy/middleware-stack":"^4.2.11","@smithy/node-config-provider":"^4.3.11","@smithy/node-http-handler":"^4.4.14","@smithy/protocol-http":"^5.3.11","@smithy/smithy-client":"^4.12.2","@smithy/types":"^4.13.0","@smithy/url-parser":"^4.2.11","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.38","@smithy/util-defaults-mode-node":"^4.2.41","@smithy/util-endpoints":"^3.3.2","@smithy/util-middleware":"^4.2.11","@smithy/util-retry":"^4.2.11","@smithy/util-utf8":"^4.2.2","tslib":"^2.6.2"},"devDependencies":{"concurrently":"7.0.0","downlevel-dts":"0.10.1","premove":"4.0.0","typescript":"~5.8.3"},"typesVersions":{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],"browser":{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"packages/nested-clients"},"exports":{"./package.json":"./package.json","./sso-oidc":{"types":"./dist-types/submodules/sso-oidc/index.d.ts","module":"./dist-es/submodules/sso-oidc/index.js","node":"./dist-cjs/submodules/sso-oidc/index.js","import":"./dist-es/submodules/sso-oidc/index.js","require":"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{"types":"./dist-types/submodules/sts/index.d.ts","module":"./dist-es/submodules/sts/index.js","node":"./dist-cjs/submodules/sts/index.js","import":"./dist-es/submodules/sts/index.js","require":"./dist-cjs/submodules/sts/index.js"},"./signin":{"types":"./dist-types/submodules/signin/index.d.ts","module":"./dist-es/submodules/signin/index.js","node":"./dist-cjs/submodules/signin/index.js","import":"./dist-es/submodules/signin/index.js","require":"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{"types":"./dist-types/submodules/cognito-identity/index.d.ts","module":"./dist-es/submodules/cognito-identity/index.js","node":"./dist-cjs/submodules/cognito-identity/index.js","import":"./dist-es/submodules/cognito-identity/index.js","require":"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{"types":"./dist-types/submodules/sso/index.d.ts","module":"./dist-es/submodules/sso/index.js","node":"./dist-cjs/submodules/sso/index.js","import":"./dist-es/submodules/sso/index.js","require":"./dist-cjs/submodules/sso/index.js"}}}'); + +/***/ }) + +}; +; \ No newline at end of file diff --git a/dist/360.index.js b/dist/360.index.js index 728715f..48b09ba 100644 --- a/dist/360.index.js +++ b/dist/360.index.js @@ -10,8 +10,8 @@ exports.modules = { var sharedIniFileLoader = __webpack_require__(4964); var propertyProvider = __webpack_require__(8857); -var child_process = __webpack_require__(5317); -var util = __webpack_require__(9023); +var node_child_process = __webpack_require__(1421); +var node_util = __webpack_require__(7975); var client = __webpack_require__(5152); const getValidatedProcessCredentials = (profileName, data, profiles) => { @@ -49,7 +49,7 @@ const resolveProcessCredentials = async (profileName, profiles, logger) => { if (profiles[profileName]) { const credentialProcess = profile["credential_process"]; if (credentialProcess !== undefined) { - const execPromise = util.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? child_process.exec); + const execPromise = node_util.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? node_child_process.exec); try { const { stdout } = await execPromise(credentialProcess); let data; diff --git a/dist/443.index.js b/dist/443.index.js index b422576..6e4de7b 100644 --- a/dist/443.index.js +++ b/dist/443.index.js @@ -98,8 +98,107 @@ util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunct Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ruleSet = void 0; const u = "required", v = "fn", w = "argv", x = "ref"; -const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, "type": "string" }, j = { [u]: true, "default": false, "type": "boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }]; -const _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://oidc-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://oidc.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://oidc-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://oidc.{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://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; +const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, type: "string" }, j = { [u]: true, default: false, type: "boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }]; +const _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://oidc-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://oidc.{Region}.amazonaws.com", properties: n, headers: n }, + type: e, + }, + { + endpoint: { + url: "https://oidc-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://oidc.{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://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, + type: e, + }, + ], + type: f, + }, + ], + type: f, + }, + { error: "Invalid Configuration: Missing Region", type: d }, + ], +}; exports.ruleSet = _data; @@ -108,7 +207,6 @@ exports.ruleSet = _data; /***/ 9443: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -var __webpack_unused_export__; var middlewareHostHeader = __webpack_require__(2590); @@ -126,6 +224,9 @@ var httpAuthSchemeProvider = __webpack_require__(8396); var runtimeConfig = __webpack_require__(6901); var regionConfigResolver = __webpack_require__(6463); var protocolHttp = __webpack_require__(2356); +var schemas_0 = __webpack_require__(7143); +var errors = __webpack_require__(5843); +var SSOOIDCServiceException = __webpack_require__(3952); const resolveClientEndpointParameters = (options) => { return Object.assign(options, { @@ -221,14 +322,94 @@ class SSOOIDCClient extends smithyClient.Client { } } -let SSOOIDCServiceException$1 = class SSOOIDCServiceException extends smithyClient.ServiceException { +class CreateTokenCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("AWSSSOOIDCService", "CreateToken", {}) + .n("SSOOIDCClient", "CreateTokenCommand") + .sc(schemas_0.CreateToken$) + .build() { +} + +const commands = { + CreateTokenCommand, +}; +class SSOOIDC extends SSOOIDCClient { +} +smithyClient.createAggregatedClient(commands, SSOOIDC); + +const AccessDeniedExceptionReason = { + KMS_ACCESS_DENIED: "KMS_AccessDeniedException", +}; +const InvalidRequestExceptionReason = { + KMS_DISABLED_KEY: "KMS_DisabledException", + KMS_INVALID_KEY_USAGE: "KMS_InvalidKeyUsageException", + KMS_INVALID_STATE: "KMS_InvalidStateException", + KMS_KEY_NOT_FOUND: "KMS_NotFoundException", +}; + +exports.$Command = smithyClient.Command; +exports.__Client = smithyClient.Client; +exports.SSOOIDCServiceException = SSOOIDCServiceException.SSOOIDCServiceException; +exports.AccessDeniedExceptionReason = AccessDeniedExceptionReason; +exports.CreateTokenCommand = CreateTokenCommand; +exports.InvalidRequestExceptionReason = InvalidRequestExceptionReason; +exports.SSOOIDC = SSOOIDC; +exports.SSOOIDCClient = SSOOIDCClient; +Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: schemas_0['__proto__'] + }); + +Object.keys(schemas_0).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k]; +}); +Object.prototype.hasOwnProperty.call(errors, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: errors['__proto__'] + }); + +Object.keys(errors).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k]; +}); + + +/***/ }), + +/***/ 3952: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SSOOIDCServiceException = exports.__ServiceException = void 0; +const smithy_client_1 = __webpack_require__(1411); +Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); +class SSOOIDCServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, SSOOIDCServiceException.prototype); } -}; +} +exports.SSOOIDCServiceException = SSOOIDCServiceException; + + +/***/ }), -let AccessDeniedException$1 = class AccessDeniedException extends SSOOIDCServiceException$1 { +/***/ 5843: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UnsupportedGrantTypeException = exports.UnauthorizedClientException = exports.SlowDownException = exports.InvalidScopeException = exports.InvalidRequestException = exports.InvalidGrantException = exports.InvalidClientException = exports.InternalServerException = exports.ExpiredTokenException = exports.AuthorizationPendingException = exports.AccessDeniedException = void 0; +const SSOOIDCServiceException_1 = __webpack_require__(3952); +class AccessDeniedException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "AccessDeniedException"; $fault = "client"; error; @@ -245,8 +426,9 @@ let AccessDeniedException$1 = class AccessDeniedException extends SSOOIDCService this.reason = opts.reason; this.error_description = opts.error_description; } -}; -let AuthorizationPendingException$1 = class AuthorizationPendingException extends SSOOIDCServiceException$1 { +} +exports.AccessDeniedException = AccessDeniedException; +class AuthorizationPendingException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "AuthorizationPendingException"; $fault = "client"; error; @@ -261,8 +443,9 @@ let AuthorizationPendingException$1 = class AuthorizationPendingException extend this.error = opts.error; this.error_description = opts.error_description; } -}; -let ExpiredTokenException$1 = class ExpiredTokenException extends SSOOIDCServiceException$1 { +} +exports.AuthorizationPendingException = AuthorizationPendingException; +class ExpiredTokenException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "ExpiredTokenException"; $fault = "client"; error; @@ -277,8 +460,9 @@ let ExpiredTokenException$1 = class ExpiredTokenException extends SSOOIDCService this.error = opts.error; this.error_description = opts.error_description; } -}; -let InternalServerException$1 = class InternalServerException extends SSOOIDCServiceException$1 { +} +exports.ExpiredTokenException = ExpiredTokenException; +class InternalServerException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "InternalServerException"; $fault = "server"; error; @@ -293,8 +477,9 @@ let InternalServerException$1 = class InternalServerException extends SSOOIDCSer this.error = opts.error; this.error_description = opts.error_description; } -}; -let InvalidClientException$1 = class InvalidClientException extends SSOOIDCServiceException$1 { +} +exports.InternalServerException = InternalServerException; +class InvalidClientException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "InvalidClientException"; $fault = "client"; error; @@ -309,8 +494,9 @@ let InvalidClientException$1 = class InvalidClientException extends SSOOIDCServi this.error = opts.error; this.error_description = opts.error_description; } -}; -let InvalidGrantException$1 = class InvalidGrantException extends SSOOIDCServiceException$1 { +} +exports.InvalidClientException = InvalidClientException; +class InvalidGrantException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "InvalidGrantException"; $fault = "client"; error; @@ -325,8 +511,9 @@ let InvalidGrantException$1 = class InvalidGrantException extends SSOOIDCService this.error = opts.error; this.error_description = opts.error_description; } -}; -let InvalidRequestException$1 = class InvalidRequestException extends SSOOIDCServiceException$1 { +} +exports.InvalidGrantException = InvalidGrantException; +class InvalidRequestException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "InvalidRequestException"; $fault = "client"; error; @@ -343,8 +530,9 @@ let InvalidRequestException$1 = class InvalidRequestException extends SSOOIDCSer this.reason = opts.reason; this.error_description = opts.error_description; } -}; -let InvalidScopeException$1 = class InvalidScopeException extends SSOOIDCServiceException$1 { +} +exports.InvalidRequestException = InvalidRequestException; +class InvalidScopeException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "InvalidScopeException"; $fault = "client"; error; @@ -359,8 +547,9 @@ let InvalidScopeException$1 = class InvalidScopeException extends SSOOIDCService this.error = opts.error; this.error_description = opts.error_description; } -}; -let SlowDownException$1 = class SlowDownException extends SSOOIDCServiceException$1 { +} +exports.InvalidScopeException = InvalidScopeException; +class SlowDownException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "SlowDownException"; $fault = "client"; error; @@ -375,8 +564,9 @@ let SlowDownException$1 = class SlowDownException extends SSOOIDCServiceExceptio this.error = opts.error; this.error_description = opts.error_description; } -}; -let UnauthorizedClientException$1 = class UnauthorizedClientException extends SSOOIDCServiceException$1 { +} +exports.SlowDownException = SlowDownException; +class UnauthorizedClientException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "UnauthorizedClientException"; $fault = "client"; error; @@ -391,8 +581,9 @@ let UnauthorizedClientException$1 = class UnauthorizedClientException extends SS this.error = opts.error; this.error_description = opts.error_description; } -}; -let UnsupportedGrantTypeException$1 = class UnsupportedGrantTypeException extends SSOOIDCServiceException$1 { +} +exports.UnauthorizedClientException = UnauthorizedClientException; +class UnsupportedGrantTypeException extends SSOOIDCServiceException_1.SSOOIDCServiceException { name = "UnsupportedGrantTypeException"; $fault = "client"; error; @@ -407,269 +598,8 @@ let UnsupportedGrantTypeException$1 = class UnsupportedGrantTypeException extend this.error = opts.error; this.error_description = opts.error_description; } -}; - -const _ADE = "AccessDeniedException"; -const _APE = "AuthorizationPendingException"; -const _AT = "AccessToken"; -const _CS = "ClientSecret"; -const _CT = "CreateToken"; -const _CTR = "CreateTokenRequest"; -const _CTRr = "CreateTokenResponse"; -const _CV = "CodeVerifier"; -const _ETE = "ExpiredTokenException"; -const _ICE = "InvalidClientException"; -const _IGE = "InvalidGrantException"; -const _IRE = "InvalidRequestException"; -const _ISE = "InternalServerException"; -const _ISEn = "InvalidScopeException"; -const _IT = "IdToken"; -const _RT = "RefreshToken"; -const _SDE = "SlowDownException"; -const _UCE = "UnauthorizedClientException"; -const _UGTE = "UnsupportedGrantTypeException"; -const _aT = "accessToken"; -const _c = "client"; -const _cI = "clientId"; -const _cS = "clientSecret"; -const _cV = "codeVerifier"; -const _co = "code"; -const _dC = "deviceCode"; -const _e = "error"; -const _eI = "expiresIn"; -const _ed = "error_description"; -const _gT = "grantType"; -const _h = "http"; -const _hE = "httpError"; -const _iT = "idToken"; -const _r = "reason"; -const _rT = "refreshToken"; -const _rU = "redirectUri"; -const _s = "scope"; -const _se = "server"; -const _sm = "smithy.ts.sdk.synthetic.com.amazonaws.ssooidc"; -const _tT = "tokenType"; -const n0 = "com.amazonaws.ssooidc"; -var AccessToken = [0, n0, _AT, 8, 0]; -var ClientSecret = [0, n0, _CS, 8, 0]; -var CodeVerifier = [0, n0, _CV, 8, 0]; -var IdToken = [0, n0, _IT, 8, 0]; -var RefreshToken = [0, n0, _RT, 8, 0]; -var AccessDeniedException = [ - -3, - n0, - _ADE, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _r, _ed], - [0, 0, 0], -]; -schema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1); -var AuthorizationPendingException = [ - -3, - n0, - _APE, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(AuthorizationPendingException, AuthorizationPendingException$1); -var CreateTokenRequest = [ - 3, - n0, - _CTR, - 0, - [_cI, _cS, _gT, _dC, _co, _rT, _s, _rU, _cV], - [0, [() => ClientSecret, 0], 0, 0, 0, [() => RefreshToken, 0], 64 | 0, 0, [() => CodeVerifier, 0]], -]; -var CreateTokenResponse = [ - 3, - n0, - _CTRr, - 0, - [_aT, _tT, _eI, _rT, _iT], - [[() => AccessToken, 0], 0, 1, [() => RefreshToken, 0], [() => IdToken, 0]], -]; -var ExpiredTokenException = [ - -3, - n0, - _ETE, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1); -var InternalServerException = [ - -3, - n0, - _ISE, - { - [_e]: _se, - [_hE]: 500, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1); -var InvalidClientException = [ - -3, - n0, - _ICE, - { - [_e]: _c, - [_hE]: 401, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidClientException, InvalidClientException$1); -var InvalidGrantException = [ - -3, - n0, - _IGE, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidGrantException, InvalidGrantException$1); -var InvalidRequestException = [ - -3, - n0, - _IRE, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _r, _ed], - [0, 0, 0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidRequestException, InvalidRequestException$1); -var InvalidScopeException = [ - -3, - n0, - _ISEn, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidScopeException, InvalidScopeException$1); -var SlowDownException = [ - -3, - n0, - _SDE, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(SlowDownException, SlowDownException$1); -var UnauthorizedClientException = [ - -3, - n0, - _UCE, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(UnauthorizedClientException, UnauthorizedClientException$1); -var UnsupportedGrantTypeException = [ - -3, - n0, - _UGTE, - { - [_e]: _c, - [_hE]: 400, - }, - [_e, _ed], - [0, 0], -]; -schema.TypeRegistry.for(n0).registerError(UnsupportedGrantTypeException, UnsupportedGrantTypeException$1); -var SSOOIDCServiceException = [-3, _sm, "SSOOIDCServiceException", 0, [], []]; -schema.TypeRegistry.for(_sm).registerError(SSOOIDCServiceException, SSOOIDCServiceException$1); -var CreateToken = [ - 9, - n0, - _CT, - { - [_h]: ["POST", "/token", 200], - }, - () => CreateTokenRequest, - () => CreateTokenResponse, -]; - -class CreateTokenCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("AWSSSOOIDCService", "CreateToken", {}) - .n("SSOOIDCClient", "CreateTokenCommand") - .sc(CreateToken) - .build() { } - -const commands = { - CreateTokenCommand, -}; -class SSOOIDC extends SSOOIDCClient { -} -smithyClient.createAggregatedClient(commands, SSOOIDC); - -const AccessDeniedExceptionReason = { - KMS_ACCESS_DENIED: "KMS_AccessDeniedException", -}; -const InvalidRequestExceptionReason = { - KMS_DISABLED_KEY: "KMS_DisabledException", - KMS_INVALID_KEY_USAGE: "KMS_InvalidKeyUsageException", - KMS_INVALID_STATE: "KMS_InvalidStateException", - KMS_KEY_NOT_FOUND: "KMS_NotFoundException", -}; - -__webpack_unused_export__ = ({ - enumerable: true, - get: function () { return smithyClient.Command; } -}); -__webpack_unused_export__ = ({ - enumerable: true, - get: function () { return smithyClient.Client; } -}); -__webpack_unused_export__ = AccessDeniedException$1; -__webpack_unused_export__ = AccessDeniedExceptionReason; -__webpack_unused_export__ = AuthorizationPendingException$1; -exports.CreateTokenCommand = CreateTokenCommand; -__webpack_unused_export__ = ExpiredTokenException$1; -__webpack_unused_export__ = InternalServerException$1; -__webpack_unused_export__ = InvalidClientException$1; -__webpack_unused_export__ = InvalidGrantException$1; -__webpack_unused_export__ = InvalidRequestException$1; -__webpack_unused_export__ = InvalidRequestExceptionReason; -__webpack_unused_export__ = InvalidScopeException$1; -__webpack_unused_export__ = SSOOIDC; -exports.SSOOIDCClient = SSOOIDCClient; -__webpack_unused_export__ = SSOOIDCServiceException$1; -__webpack_unused_export__ = SlowDownException$1; -__webpack_unused_export__ = UnauthorizedClientException$1; -__webpack_unused_export__ = UnsupportedGrantTypeException$1; +exports.UnsupportedGrantTypeException = UnsupportedGrantTypeException; /***/ }), @@ -688,15 +618,14 @@ const config_resolver_1 = __webpack_require__(9316); const hash_node_1 = __webpack_require__(2711); const middleware_retry_1 = __webpack_require__(9618); const node_config_provider_1 = __webpack_require__(5704); -const node_http_handler_1 = __webpack_require__(1279); +const node_http_handler_1 = __webpack_require__(2764); +const smithy_client_1 = __webpack_require__(1411); const util_body_length_node_1 = __webpack_require__(3638); +const util_defaults_mode_node_1 = __webpack_require__(5435); const util_retry_1 = __webpack_require__(5518); const runtimeConfig_shared_1 = __webpack_require__(1546); -const smithy_client_1 = __webpack_require__(1411); -const util_defaults_mode_node_1 = __webpack_require__(5435); -const smithy_client_2 = __webpack_require__(1411); const getRuntimeConfig = (config) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); + (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); @@ -750,6 +679,7 @@ const util_base64_1 = __webpack_require__(8385); const util_utf8_1 = __webpack_require__(1577); const httpAuthSchemeProvider_1 = __webpack_require__(8396); const endpointResolver_1 = __webpack_require__(546); +const schemas_0_1 = __webpack_require__(7143); const getRuntimeConfig = (config) => { return { apiVersion: "2019-06-10", @@ -772,7 +702,13 @@ const getRuntimeConfig = (config) => { }, ], logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.ssooidc" }), + protocol: config?.protocol ?? protocols_1.AwsRestJsonProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.ssooidc", + errorTypeRegistries: schemas_0_1.errorTypeRegistries, + version: "2019-06-10", + serviceTarget: "AWSSSOOIDCService", + }, serviceId: config?.serviceId ?? "SSO OIDC", urlParser: config?.urlParser ?? url_parser_1.parseUrl, utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, @@ -784,10 +720,150 @@ exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 9955: -/***/ ((module) => { +/***/ 7143: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CreateToken$ = exports.CreateTokenResponse$ = exports.CreateTokenRequest$ = exports.errorTypeRegistries = exports.UnsupportedGrantTypeException$ = exports.UnauthorizedClientException$ = exports.SlowDownException$ = exports.InvalidScopeException$ = exports.InvalidRequestException$ = exports.InvalidGrantException$ = exports.InvalidClientException$ = exports.InternalServerException$ = exports.ExpiredTokenException$ = exports.AuthorizationPendingException$ = exports.AccessDeniedException$ = exports.SSOOIDCServiceException$ = void 0; +const _ADE = "AccessDeniedException"; +const _APE = "AuthorizationPendingException"; +const _AT = "AccessToken"; +const _CS = "ClientSecret"; +const _CT = "CreateToken"; +const _CTR = "CreateTokenRequest"; +const _CTRr = "CreateTokenResponse"; +const _CV = "CodeVerifier"; +const _ETE = "ExpiredTokenException"; +const _ICE = "InvalidClientException"; +const _IGE = "InvalidGrantException"; +const _IRE = "InvalidRequestException"; +const _ISE = "InternalServerException"; +const _ISEn = "InvalidScopeException"; +const _IT = "IdToken"; +const _RT = "RefreshToken"; +const _SDE = "SlowDownException"; +const _UCE = "UnauthorizedClientException"; +const _UGTE = "UnsupportedGrantTypeException"; +const _aT = "accessToken"; +const _c = "client"; +const _cI = "clientId"; +const _cS = "clientSecret"; +const _cV = "codeVerifier"; +const _co = "code"; +const _dC = "deviceCode"; +const _e = "error"; +const _eI = "expiresIn"; +const _ed = "error_description"; +const _gT = "grantType"; +const _h = "http"; +const _hE = "httpError"; +const _iT = "idToken"; +const _r = "reason"; +const _rT = "refreshToken"; +const _rU = "redirectUri"; +const _s = "smithy.ts.sdk.synthetic.com.amazonaws.ssooidc"; +const _sc = "scope"; +const _se = "server"; +const _tT = "tokenType"; +const n0 = "com.amazonaws.ssooidc"; +const schema_1 = __webpack_require__(6890); +const errors_1 = __webpack_require__(5843); +const SSOOIDCServiceException_1 = __webpack_require__(3952); +const _s_registry = schema_1.TypeRegistry.for(_s); +exports.SSOOIDCServiceException$ = [-3, _s, "SSOOIDCServiceException", 0, [], []]; +_s_registry.registerError(exports.SSOOIDCServiceException$, SSOOIDCServiceException_1.SSOOIDCServiceException); +const n0_registry = schema_1.TypeRegistry.for(n0); +exports.AccessDeniedException$ = [ + -3, + n0, + _ADE, + { [_e]: _c, [_hE]: 400 }, + [_e, _r, _ed], + [0, 0, 0], +]; +n0_registry.registerError(exports.AccessDeniedException$, errors_1.AccessDeniedException); +exports.AuthorizationPendingException$ = [ + -3, + n0, + _APE, + { [_e]: _c, [_hE]: 400 }, + [_e, _ed], + [0, 0], +]; +n0_registry.registerError(exports.AuthorizationPendingException$, errors_1.AuthorizationPendingException); +exports.ExpiredTokenException$ = [-3, n0, _ETE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; +n0_registry.registerError(exports.ExpiredTokenException$, errors_1.ExpiredTokenException); +exports.InternalServerException$ = [-3, n0, _ISE, { [_e]: _se, [_hE]: 500 }, [_e, _ed], [0, 0]]; +n0_registry.registerError(exports.InternalServerException$, errors_1.InternalServerException); +exports.InvalidClientException$ = [-3, n0, _ICE, { [_e]: _c, [_hE]: 401 }, [_e, _ed], [0, 0]]; +n0_registry.registerError(exports.InvalidClientException$, errors_1.InvalidClientException); +exports.InvalidGrantException$ = [-3, n0, _IGE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; +n0_registry.registerError(exports.InvalidGrantException$, errors_1.InvalidGrantException); +exports.InvalidRequestException$ = [ + -3, + n0, + _IRE, + { [_e]: _c, [_hE]: 400 }, + [_e, _r, _ed], + [0, 0, 0], +]; +n0_registry.registerError(exports.InvalidRequestException$, errors_1.InvalidRequestException); +exports.InvalidScopeException$ = [-3, n0, _ISEn, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; +n0_registry.registerError(exports.InvalidScopeException$, errors_1.InvalidScopeException); +exports.SlowDownException$ = [-3, n0, _SDE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; +n0_registry.registerError(exports.SlowDownException$, errors_1.SlowDownException); +exports.UnauthorizedClientException$ = [ + -3, + n0, + _UCE, + { [_e]: _c, [_hE]: 400 }, + [_e, _ed], + [0, 0], +]; +n0_registry.registerError(exports.UnauthorizedClientException$, errors_1.UnauthorizedClientException); +exports.UnsupportedGrantTypeException$ = [ + -3, + n0, + _UGTE, + { [_e]: _c, [_hE]: 400 }, + [_e, _ed], + [0, 0], +]; +n0_registry.registerError(exports.UnsupportedGrantTypeException$, errors_1.UnsupportedGrantTypeException); +exports.errorTypeRegistries = [_s_registry, n0_registry]; +var AccessToken = [0, n0, _AT, 8, 0]; +var ClientSecret = [0, n0, _CS, 8, 0]; +var CodeVerifier = [0, n0, _CV, 8, 0]; +var IdToken = [0, n0, _IT, 8, 0]; +var RefreshToken = [0, n0, _RT, 8, 0]; +exports.CreateTokenRequest$ = [ + 3, + n0, + _CTR, + 0, + [_cI, _cS, _gT, _dC, _co, _rT, _sc, _rU, _cV], + [0, [() => ClientSecret, 0], 0, 0, 0, [() => RefreshToken, 0], 64 | 0, 0, [() => CodeVerifier, 0]], + 3, +]; +exports.CreateTokenResponse$ = [ + 3, + n0, + _CTRr, + 0, + [_aT, _tT, _eI, _rT, _iT], + [[() => AccessToken, 0], 0, 1, [() => RefreshToken, 0], [() => IdToken, 0]], +]; +var Scopes = (/* unused pure expression or super */ null && (64 | 0)); +exports.CreateToken$ = [ + 9, + n0, + _CT, + { [_h]: ["POST", "/token", 200] }, + () => exports.CreateTokenRequest$, + () => exports.CreateTokenResponse$, +]; -module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/nested-clients","version":"3.935.0","description":"Nested clients for AWS SDK packages.","main":"./dist-cjs/index.js","module":"./dist-es/index.js","types":"./dist-types/index.d.ts","scripts":{"build":"yarn lint && concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline nested-clients","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","lint":"node ../../scripts/validation/submodules-linter.js --pkg nested-clients","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"engines":{"node":">=18.0.0"},"sideEffects":false,"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.935.0","@aws-sdk/middleware-host-header":"3.930.0","@aws-sdk/middleware-logger":"3.930.0","@aws-sdk/middleware-recursion-detection":"3.933.0","@aws-sdk/middleware-user-agent":"3.935.0","@aws-sdk/region-config-resolver":"3.930.0","@aws-sdk/types":"3.930.0","@aws-sdk/util-endpoints":"3.930.0","@aws-sdk/util-user-agent-browser":"3.930.0","@aws-sdk/util-user-agent-node":"3.935.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0","tslib":"^2.6.2"},"devDependencies":{"concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["./sso-oidc.d.ts","./sso-oidc.js","./sts.d.ts","./sts.js","dist-*/**"],"browser":{"./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"packages/nested-clients"},"exports":{"./sso-oidc":{"types":"./dist-types/submodules/sso-oidc/index.d.ts","module":"./dist-es/submodules/sso-oidc/index.js","node":"./dist-cjs/submodules/sso-oidc/index.js","import":"./dist-es/submodules/sso-oidc/index.js","require":"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{"types":"./dist-types/submodules/sts/index.d.ts","module":"./dist-es/submodules/sts/index.js","node":"./dist-cjs/submodules/sts/index.js","import":"./dist-es/submodules/sts/index.js","require":"./dist-cjs/submodules/sts/index.js"}}}'); /***/ }) diff --git a/dist/579.index.js b/dist/579.index.js index ef7e63d..bcdedb5 100644 --- a/dist/579.index.js +++ b/dist/579.index.js @@ -134,6 +134,11 @@ class EventStreamSerde { [unionMember]: out, }; } + if (body.byteLength === 0) { + return { + [unionMember]: {}, + }; + } } return { [unionMember]: await this.deserializer.read(eventStreamSchema, body), @@ -195,7 +200,6 @@ class EventStreamSerde { const { eventHeader, eventPayload } = memberSchema.getMergedTraits(); if (eventPayload) { explicitPayloadMember = memberName; - break; } else if (eventHeader) { const value = event[unionMember][memberName]; @@ -240,6 +244,9 @@ class EventStreamSerde { serializer.write(eventSchema, event[unionMember]); } } + else if (eventSchema.isUnitSchema()) { + serializer.write(eventSchema, {}); + } else { throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union."); } diff --git a/dist/605.index.js b/dist/605.index.js index 0ff2fce..e31a90a 100644 --- a/dist/605.index.js +++ b/dist/605.index.js @@ -64,9 +64,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fromHttp = void 0; const tslib_1 = __webpack_require__(1860); const client_1 = __webpack_require__(5152); -const node_http_handler_1 = __webpack_require__(1279); +const node_http_handler_1 = __webpack_require__(2402); const property_provider_1 = __webpack_require__(8857); -const promises_1 = tslib_1.__importDefault(__webpack_require__(1943)); +const promises_1 = tslib_1.__importDefault(__webpack_require__(1455)); const checkUrl_1 = __webpack_require__(1509); const requestHelpers_1 = __webpack_require__(8914); const retry_wrapper_1 = __webpack_require__(1122); @@ -228,6 +228,765 @@ var fromHttp_1 = __webpack_require__(8712); Object.defineProperty(exports, "fromHttp", ({ enumerable: true, get: function () { return fromHttp_1.fromHttp; } })); +/***/ }), + +/***/ 2402: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +var protocolHttp = __webpack_require__(2356); +var querystringBuilder = __webpack_require__(8256); +var http = __webpack_require__(8611); +var https = __webpack_require__(5692); +var stream = __webpack_require__(2203); +var http2 = __webpack_require__(5675); + +function buildAbortError(abortSignal) { + const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal + ? abortSignal.reason + : undefined; + if (reason) { + if (reason instanceof Error) { + return reason; + } + const abortError = new Error(String(reason)); + abortError.name = "AbortError"; + return abortError; + } + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return abortError; +} + +const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +const getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}; + +const timing = { + setTimeout: (cb, ms) => setTimeout(cb, ms), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), +}; + +const DEFER_EVENT_LISTENER_TIME$2 = 1000; +const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return -1; + } + const registerTimeout = (offset) => { + const timeoutId = timing.setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { + name: "TimeoutError", + })); + }, timeoutInMs - offset); + const doWithSocket = (socket) => { + if (socket?.connecting) { + socket.on("connect", () => { + timing.clearTimeout(timeoutId); + }); + } + else { + timing.clearTimeout(timeoutId); + } + }; + if (request.socket) { + doWithSocket(request.socket); + } + else { + request.on("socket", doWithSocket); + } + }; + if (timeoutInMs < 2000) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2); +}; + +const setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => { + if (timeoutInMs) { + return timing.setTimeout(() => { + let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; + if (throwOnRequestTimeout) { + const error = Object.assign(new Error(msg), { + name: "TimeoutError", + code: "ETIMEDOUT", + }); + req.destroy(error); + reject(error); + } + else { + msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; + logger?.warn?.(msg); + } + }, timeoutInMs); + } + return -1; +}; + +const DEFER_EVENT_LISTENER_TIME$1 = 3000; +const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => { + if (keepAlive !== true) { + return -1; + } + const registerListener = () => { + if (request.socket) { + request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + } + else { + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); + } + }; + if (deferTimeMs === 0) { + registerListener(); + return 0; + } + return timing.setTimeout(registerListener, deferTimeMs); +}; + +const DEFER_EVENT_LISTENER_TIME = 3000; +const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + const registerTimeout = (offset) => { + const timeout = timeoutInMs - offset; + const onTimeout = () => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); + }; + if (request.socket) { + request.socket.setTimeout(timeout, onTimeout); + request.on("close", () => request.socket?.removeListener("timeout", onTimeout)); + } + else { + request.setTimeout(timeout, onTimeout); + } + }; + if (0 < timeoutInMs && timeoutInMs < 6000) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); +}; + +const MIN_WAIT_TIME = 6_000; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { + const headers = request.headers ?? {}; + const expect = headers.Expect || headers.expect; + let timeoutId = -1; + let sendBody = true; + if (!externalAgent && expect === "100-continue") { + sendBody = await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + timing.clearTimeout(timeoutId); + resolve(true); + }); + httpRequest.on("response", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + httpRequest.on("error", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + }), + ]); + } + if (sendBody) { + writeBody(httpRequest, request.body); + } +} +function writeBody(httpRequest, body) { + if (body instanceof stream.Readable) { + body.pipe(httpRequest); + return; + } + if (body) { + const isBuffer = Buffer.isBuffer(body); + const isString = typeof body === "string"; + if (isBuffer || isString) { + if (isBuffer && body.byteLength === 0) { + httpRequest.end(); + } + else { + 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(); +} + +const DEFAULT_REQUEST_TIMEOUT = 0; +class NodeHttpHandler { + config; + configProvider; + socketWarningTimestamp = 0; + externalAgent = false; + metadata = { handlerProtocol: "http/1.1" }; + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new NodeHttpHandler(instanceOrOptions); + } + static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15_000; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = sockets[origin]?.length ?? 0; + const requestsEnqueued = requests[origin]?.length ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + logger?.warn?.(`@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; + } + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }) + .catch(reject); + } + else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout, + socketTimeout, + socketAcquisitionWarningTimeout, + throwOnRequestTimeout, + httpAgent: (() => { + if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") { + this.externalAgent = true; + return httpAgent; + } + return new http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") { + this.externalAgent = true; + return httpsAgent; + } + return new https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })(), + logger, + }; + } + destroy() { + this.config?.httpAgent?.destroy(); + this.config?.httpsAgent?.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + return new Promise((_resolve, _reject) => { + const config = this.config; + let writeRequestBodyPromise = undefined; + const timeouts = []; + const resolve = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _reject(arg); + }; + if (abortSignal?.aborted) { + const abortError = buildAbortError(abortSignal); + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const headers = request.headers ?? {}; + const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; + let agent = isSSL ? config.httpsAgent : config.httpAgent; + if (expectContinue && !this.externalAgent) { + agent = new (isSSL ? https.Agent : http.Agent)({ + keepAlive: false, + maxSockets: Infinity, + }); + } + timeouts.push(timing.setTimeout(() => { + this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); + }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2000) + (config.connectionTimeout ?? 1000))); + const queryString = querystringBuilder.buildQueryString(request.query || {}); + let auth = undefined; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}`; + } + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + let hostname = request.hostname ?? ""; + if (hostname[0] === "[" && hostname.endsWith("]")) { + hostname = request.hostname.slice(1, -1); + } + else { + hostname = request.hostname; + } + const nodeHttpsOptions = { + headers: request.headers, + host: hostname, + method: request.method, + path, + port: request.port, + agent, + auth, + }; + const requestFunc = isSSL ? https.request : http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocolHttp.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 = () => { + req.destroy(); + const abortError = buildAbortError(abortSignal); + reject(abortError); + }; + 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; + } + } + const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; + timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout)); + timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); + timeouts.push(setSocketTimeout(req, reject, config.socketTimeout)); + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + timeouts.push(setSocketKeepAlive(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs, + })); + } + writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e) => { + timeouts.forEach(timing.clearTimeout); + return _reject(e); + }); + }); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } +} + +class NodeHttp2ConnectionPool { + sessions = []; + constructor(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(); + } + } + } + } +} + +class NodeHttp2ConnectionManager { + constructor(config) { + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + config; + sessionCache = new Map(); + lease(requestContext, connectionConfiguration) { + const url = this.getUrlString(requestContext); + const existingPool = this.sessionCache.get(url); + if (existingPool) { + const existingSession = existingPool.poll(); + if (existingSession && !this.config.disableConcurrency) { + return existingSession; + } + } + const session = http2.connect(url); + 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 = () => { + session.destroy(); + this.deleteSession(url, session); + }; + session.on("goaway", destroySessionCb); + session.on("error", destroySessionCb); + session.on("frameError", destroySessionCb); + session.on("close", () => this.deleteSession(url, session)); + if (connectionConfiguration.requestTimeout) { + session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); + } + const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool(); + connectionPool.offerLast(session); + this.sessionCache.set(url, connectionPool); + return session; + } + 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) { + const cacheKey = this.getUrlString(requestContext); + this.sessionCache.get(cacheKey)?.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 (maxConcurrentStreams && maxConcurrentStreams <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } +} + +class NodeHttp2Handler { + config; + configProvider; + metadata = { handlerProtocol: "h2" }; + connectionManager = new NodeHttp2ConnectionManager({}); + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new NodeHttp2Handler(instanceOrOptions); + } + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((opts) => { + resolve(opts || {}); + }) + .catch(reject); + } + else { + resolve(options || {}); + } + }); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + 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: configRequestTimeout, disableConcurrentStreams } = this.config; + const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; + return new Promise((_resolve, _reject) => { + let fulfilled = false; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal?.aborted) { + fulfilled = true; + const abortError = buildAbortError(abortSignal); + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = request; + let auth = ""; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}@`; + } + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: this.config?.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false, + }); + const rejectWithDestroy = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }; + const queryString = querystringBuilder.buildQueryString(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [http2.constants.HTTP2_HEADER_PATH]: path, + [http2.constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocolHttp.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 (effectiveRequestTimeout) { + req.setTimeout(effectiveRequestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + const onAbort = () => { + req.close(); + const abortError = buildAbortError(abortSignal); + rejectWithDestroy(abortError); + }; + 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, request, effectiveRequestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } +} + +class Collector extends stream.Writable { + bufferedBytes = []; + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +} + +const streamCollector = (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); + }); + }); +}; +const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream; +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; +} + +exports.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; +exports.NodeHttp2Handler = NodeHttp2Handler; +exports.NodeHttpHandler = NodeHttpHandler; +exports.streamCollector = streamCollector; + + /***/ }) }; diff --git a/dist/762.index.js b/dist/762.index.js new file mode 100644 index 0000000..a4a3e59 --- /dev/null +++ b/dist/762.index.js @@ -0,0 +1,750 @@ +"use strict"; +exports.id = 762; +exports.ids = [762]; +exports.modules = { + +/***/ 7709: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveHttpAuthSchemeConfig = exports.defaultSigninHttpAuthSchemeProvider = exports.defaultSigninHttpAuthSchemeParametersProvider = void 0; +const core_1 = __webpack_require__(8704); +const util_middleware_1 = __webpack_require__(6324); +const defaultSigninHttpAuthSchemeParametersProvider = 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`"); + })(), + }; +}; +exports.defaultSigninHttpAuthSchemeParametersProvider = defaultSigninHttpAuthSchemeParametersProvider; +function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "signin", + region: authParameters.region, + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context, + }, + }), + }; +} +function createSmithyApiNoAuthHttpAuthOption(authParameters) { + return { + schemeId: "smithy.api#noAuth", + }; +} +const defaultSigninHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "CreateOAuth2Token": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; +exports.defaultSigninHttpAuthSchemeProvider = defaultSigninHttpAuthSchemeProvider; +const resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return Object.assign(config_0, { + authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), + }); +}; +exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; + + +/***/ }), + +/***/ 2547: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = __webpack_require__(3068); +const util_endpoints_2 = __webpack_require__(9674); +const ruleset_1 = __webpack_require__(6904); +const cache = new util_endpoints_2.EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"], +}); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + })); +}; +exports.defaultEndpointResolver = defaultEndpointResolver; +util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; + + +/***/ }), + +/***/ 6904: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ruleSet = void 0; +const u = "required", v = "fn", w = "argv", x = "ref"; +const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "stringEquals", i = { [u]: true, default: false, type: "boolean" }, j = { [u]: false, type: "string" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: "getAttr", [w]: [{ [x]: g }, "name"] }, p = { [v]: c, [w]: [{ [x]: "UseFIPS" }, false] }, q = { [v]: c, [w]: [{ [x]: "UseDualStack" }, false] }, r = { [v]: "getAttr", [w]: [{ [x]: g }, "supportsFIPS"] }, s = { [v]: c, [w]: [true, { [v]: "getAttr", [w]: [{ [x]: g }, "supportsDualStack"] }] }, t = [{ [x]: "Region" }]; +const _data = { + version: "1.0", + parameters: { UseDualStack: i, UseFIPS: i, Endpoint: j, Region: j }, + rules: [ + { + conditions: [{ [v]: b, [w]: [k] }], + rules: [ + { conditions: [l], error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, + { + rules: [ + { + conditions: [m], + error: "Invalid Configuration: Dualstack and custom endpoint are not supported", + type: d, + }, + { endpoint: { url: k, properties: n, headers: n }, type: e }, + ], + type: f, + }, + ], + type: f, + }, + { + rules: [ + { + conditions: [{ [v]: b, [w]: t }], + rules: [ + { + conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], + rules: [ + { + conditions: [{ [v]: h, [w]: [o, "aws"] }, p, q], + endpoint: { url: "https://{Region}.signin.aws.amazon.com", properties: n, headers: n }, + type: e, + }, + { + conditions: [{ [v]: h, [w]: [o, "aws-cn"] }, p, q], + endpoint: { url: "https://{Region}.signin.amazonaws.cn", properties: n, headers: n }, + type: e, + }, + { + conditions: [{ [v]: h, [w]: [o, "aws-us-gov"] }, p, q], + endpoint: { url: "https://{Region}.signin.amazonaws-us-gov.com", properties: n, headers: n }, + type: e, + }, + { + conditions: [l, m], + rules: [ + { + conditions: [{ [v]: c, [w]: [a, r] }, s], + rules: [ + { + endpoint: { + url: "https://signin-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: [l, q], + rules: [ + { + conditions: [{ [v]: c, [w]: [r, a] }], + rules: [ + { + endpoint: { + url: "https://signin-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: [p, m], + rules: [ + { + conditions: [s], + rules: [ + { + endpoint: { + url: "https://signin.{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://signin.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, + type: e, + }, + ], + type: f, + }, + ], + type: f, + }, + { error: "Invalid Configuration: Missing Region", type: d }, + ], + type: f, + }, + ], +}; +exports.ruleSet = _data; + + +/***/ }), + +/***/ 9762: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +var middlewareHostHeader = __webpack_require__(2590); +var middlewareLogger = __webpack_require__(5242); +var middlewareRecursionDetection = __webpack_require__(1568); +var middlewareUserAgent = __webpack_require__(2959); +var configResolver = __webpack_require__(9316); +var core = __webpack_require__(402); +var schema = __webpack_require__(6890); +var middlewareContentLength = __webpack_require__(7212); +var middlewareEndpoint = __webpack_require__(99); +var middlewareRetry = __webpack_require__(9618); +var smithyClient = __webpack_require__(1411); +var httpAuthSchemeProvider = __webpack_require__(7709); +var runtimeConfig = __webpack_require__(2836); +var regionConfigResolver = __webpack_require__(6463); +var protocolHttp = __webpack_require__(2356); +var schemas_0 = __webpack_require__(890); +var errors = __webpack_require__(7214); +var SigninServiceException = __webpack_require__(2831); + +const resolveClientEndpointParameters = (options) => { + return Object.assign(options, { + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "signin", + }); +}; +const commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, +}; + +const getHttpAuthExtensionConfiguration = (runtimeConfig) => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme) { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } + else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes() { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider) { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider() { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; + }, + }; +}; +const resolveHttpAuthRuntimeConfig = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; + +const resolveRuntimeExtensions = (runtimeConfig, extensions) => { + const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); +}; + +class SigninClient extends smithyClient.Client { + config; + constructor(...[configuration]) { + const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); + super(_config_0); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); + const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); + const _config_4 = configResolver.resolveRegionConfig(_config_3); + const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); + const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); + const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + this.config = _config_8; + this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); + this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); + this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); + this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); + this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); + this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSigninHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + })); + this.middlewareStack.use(core.getHttpSigningPlugin(this.config)); + } + destroy() { + super.destroy(); + } +} + +class CreateOAuth2TokenCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("Signin", "CreateOAuth2Token", {}) + .n("SigninClient", "CreateOAuth2TokenCommand") + .sc(schemas_0.CreateOAuth2Token$) + .build() { +} + +const commands = { + CreateOAuth2TokenCommand, +}; +class Signin extends SigninClient { +} +smithyClient.createAggregatedClient(commands, Signin); + +const OAuth2ErrorCode = { + AUTHCODE_EXPIRED: "AUTHCODE_EXPIRED", + INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS", + INVALID_REQUEST: "INVALID_REQUEST", + SERVER_ERROR: "server_error", + TOKEN_EXPIRED: "TOKEN_EXPIRED", + USER_CREDENTIALS_CHANGED: "USER_CREDENTIALS_CHANGED", +}; + +exports.$Command = smithyClient.Command; +exports.__Client = smithyClient.Client; +exports.SigninServiceException = SigninServiceException.SigninServiceException; +exports.CreateOAuth2TokenCommand = CreateOAuth2TokenCommand; +exports.OAuth2ErrorCode = OAuth2ErrorCode; +exports.Signin = Signin; +exports.SigninClient = SigninClient; +Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: schemas_0['__proto__'] + }); + +Object.keys(schemas_0).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k]; +}); +Object.prototype.hasOwnProperty.call(errors, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: errors['__proto__'] + }); + +Object.keys(errors).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k]; +}); + + +/***/ }), + +/***/ 2831: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SigninServiceException = exports.__ServiceException = void 0; +const smithy_client_1 = __webpack_require__(1411); +Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); +class SigninServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, SigninServiceException.prototype); + } +} +exports.SigninServiceException = SigninServiceException; + + +/***/ }), + +/***/ 7214: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ValidationException = exports.TooManyRequestsError = exports.InternalServerException = exports.AccessDeniedException = void 0; +const SigninServiceException_1 = __webpack_require__(2831); +class AccessDeniedException extends SigninServiceException_1.SigninServiceException { + name = "AccessDeniedException"; + $fault = "client"; + error; + constructor(opts) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, AccessDeniedException.prototype); + this.error = opts.error; + } +} +exports.AccessDeniedException = AccessDeniedException; +class InternalServerException extends SigninServiceException_1.SigninServiceException { + name = "InternalServerException"; + $fault = "server"; + error; + constructor(opts) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServerException.prototype); + this.error = opts.error; + } +} +exports.InternalServerException = InternalServerException; +class TooManyRequestsError extends SigninServiceException_1.SigninServiceException { + name = "TooManyRequestsError"; + $fault = "client"; + error; + constructor(opts) { + super({ + name: "TooManyRequestsError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, TooManyRequestsError.prototype); + this.error = opts.error; + } +} +exports.TooManyRequestsError = TooManyRequestsError; +class ValidationException extends SigninServiceException_1.SigninServiceException { + name = "ValidationException"; + $fault = "client"; + error; + constructor(opts) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + this.error = opts.error; + } +} +exports.ValidationException = ValidationException; + + +/***/ }), + +/***/ 2836: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRuntimeConfig = void 0; +const tslib_1 = __webpack_require__(1860); +const package_json_1 = tslib_1.__importDefault(__webpack_require__(9955)); +const core_1 = __webpack_require__(8704); +const util_user_agent_node_1 = __webpack_require__(1656); +const config_resolver_1 = __webpack_require__(9316); +const hash_node_1 = __webpack_require__(2711); +const middleware_retry_1 = __webpack_require__(9618); +const node_config_provider_1 = __webpack_require__(5704); +const node_http_handler_1 = __webpack_require__(2764); +const smithy_client_1 = __webpack_require__(1411); +const util_body_length_node_1 = __webpack_require__(3638); +const util_defaults_mode_node_1 = __webpack_require__(5435); +const util_retry_1 = __webpack_require__(5518); +const runtimeConfig_shared_1 = __webpack_require__(357); +const getRuntimeConfig = (config) => { + (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + (0, core_1.emitWarningIfUnsupportedVersion)(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: config?.region ?? + (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? + (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, + }, config), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; + + +/***/ }), + +/***/ 357: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRuntimeConfig = void 0; +const core_1 = __webpack_require__(8704); +const protocols_1 = __webpack_require__(7288); +const core_2 = __webpack_require__(402); +const smithy_client_1 = __webpack_require__(1411); +const url_parser_1 = __webpack_require__(4494); +const util_base64_1 = __webpack_require__(8385); +const util_utf8_1 = __webpack_require__(1577); +const httpAuthSchemeProvider_1 = __webpack_require__(7709); +const endpointResolver_1 = __webpack_require__(2547); +const schemas_0_1 = __webpack_require__(890); +const getRuntimeConfig = (config) => { + return { + apiVersion: "2023-01-01", + 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.defaultSigninHttpAuthSchemeProvider, + 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(), + protocol: config?.protocol ?? protocols_1.AwsRestJsonProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.signin", + errorTypeRegistries: schemas_0_1.errorTypeRegistries, + version: "2023-01-01", + serviceTarget: "Signin", + }, + serviceId: config?.serviceId ?? "Signin", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; + + +/***/ }), + +/***/ 890: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CreateOAuth2Token$ = exports.CreateOAuth2TokenResponseBody$ = exports.CreateOAuth2TokenResponse$ = exports.CreateOAuth2TokenRequestBody$ = exports.CreateOAuth2TokenRequest$ = exports.AccessToken$ = exports.errorTypeRegistries = exports.ValidationException$ = exports.TooManyRequestsError$ = exports.InternalServerException$ = exports.AccessDeniedException$ = exports.SigninServiceException$ = void 0; +const _ADE = "AccessDeniedException"; +const _AT = "AccessToken"; +const _COAT = "CreateOAuth2Token"; +const _COATR = "CreateOAuth2TokenRequest"; +const _COATRB = "CreateOAuth2TokenRequestBody"; +const _COATRBr = "CreateOAuth2TokenResponseBody"; +const _COATRr = "CreateOAuth2TokenResponse"; +const _ISE = "InternalServerException"; +const _RT = "RefreshToken"; +const _TMRE = "TooManyRequestsError"; +const _VE = "ValidationException"; +const _aKI = "accessKeyId"; +const _aT = "accessToken"; +const _c = "client"; +const _cI = "clientId"; +const _cV = "codeVerifier"; +const _co = "code"; +const _e = "error"; +const _eI = "expiresIn"; +const _gT = "grantType"; +const _h = "http"; +const _hE = "httpError"; +const _iT = "idToken"; +const _jN = "jsonName"; +const _m = "message"; +const _rT = "refreshToken"; +const _rU = "redirectUri"; +const _s = "smithy.ts.sdk.synthetic.com.amazonaws.signin"; +const _sAK = "secretAccessKey"; +const _sT = "sessionToken"; +const _se = "server"; +const _tI = "tokenInput"; +const _tO = "tokenOutput"; +const _tT = "tokenType"; +const n0 = "com.amazonaws.signin"; +const schema_1 = __webpack_require__(6890); +const errors_1 = __webpack_require__(7214); +const SigninServiceException_1 = __webpack_require__(2831); +const _s_registry = schema_1.TypeRegistry.for(_s); +exports.SigninServiceException$ = [-3, _s, "SigninServiceException", 0, [], []]; +_s_registry.registerError(exports.SigninServiceException$, SigninServiceException_1.SigninServiceException); +const n0_registry = schema_1.TypeRegistry.for(n0); +exports.AccessDeniedException$ = [-3, n0, _ADE, { [_e]: _c }, [_e, _m], [0, 0], 2]; +n0_registry.registerError(exports.AccessDeniedException$, errors_1.AccessDeniedException); +exports.InternalServerException$ = [-3, n0, _ISE, { [_e]: _se, [_hE]: 500 }, [_e, _m], [0, 0], 2]; +n0_registry.registerError(exports.InternalServerException$, errors_1.InternalServerException); +exports.TooManyRequestsError$ = [-3, n0, _TMRE, { [_e]: _c, [_hE]: 429 }, [_e, _m], [0, 0], 2]; +n0_registry.registerError(exports.TooManyRequestsError$, errors_1.TooManyRequestsError); +exports.ValidationException$ = [-3, n0, _VE, { [_e]: _c, [_hE]: 400 }, [_e, _m], [0, 0], 2]; +n0_registry.registerError(exports.ValidationException$, errors_1.ValidationException); +exports.errorTypeRegistries = [_s_registry, n0_registry]; +var RefreshToken = [0, n0, _RT, 8, 0]; +exports.AccessToken$ = [ + 3, + n0, + _AT, + 8, + [_aKI, _sAK, _sT], + [ + [0, { [_jN]: _aKI }], + [0, { [_jN]: _sAK }], + [0, { [_jN]: _sT }], + ], + 3, +]; +exports.CreateOAuth2TokenRequest$ = [ + 3, + n0, + _COATR, + 0, + [_tI], + [[() => exports.CreateOAuth2TokenRequestBody$, 16]], + 1, +]; +exports.CreateOAuth2TokenRequestBody$ = [ + 3, + n0, + _COATRB, + 0, + [_cI, _gT, _co, _rU, _cV, _rT], + [ + [0, { [_jN]: _cI }], + [0, { [_jN]: _gT }], + 0, + [0, { [_jN]: _rU }], + [0, { [_jN]: _cV }], + [() => RefreshToken, { [_jN]: _rT }], + ], + 2, +]; +exports.CreateOAuth2TokenResponse$ = [ + 3, + n0, + _COATRr, + 0, + [_tO], + [[() => exports.CreateOAuth2TokenResponseBody$, 16]], + 1, +]; +exports.CreateOAuth2TokenResponseBody$ = [ + 3, + n0, + _COATRBr, + 0, + [_aT, _tT, _eI, _rT, _iT], + [ + [() => exports.AccessToken$, { [_jN]: _aT }], + [0, { [_jN]: _tT }], + [1, { [_jN]: _eI }], + [() => RefreshToken, { [_jN]: _rT }], + [0, { [_jN]: _iT }], + ], + 4, +]; +exports.CreateOAuth2Token$ = [ + 9, + n0, + _COAT, + { [_h]: ["POST", "/v1/token", 200] }, + () => exports.CreateOAuth2TokenRequest$, + () => exports.CreateOAuth2TokenResponse$, +]; + + +/***/ }) + +}; +; \ No newline at end of file diff --git a/dist/869.index.js b/dist/869.index.js index 8680c7f..56dae07 100644 --- a/dist/869.index.js +++ b/dist/869.index.js @@ -11,6 +11,7 @@ exports.modules = { var sharedIniFileLoader = __webpack_require__(4964); var propertyProvider = __webpack_require__(8857); var client = __webpack_require__(5152); +var credentialProviderLogin = __webpack_require__(4072); const resolveCredentialSource = (credentialSource, profileName, logger) => { const sourceProvidersMap = { @@ -64,18 +65,19 @@ const isCredentialSourceProfile = (arg, { profile, logger }) => { } return withProviderProfile; }; -const resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}, resolveProfileData) => { +const resolveAssumeRoleCredentials = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, resolveProfileData) => { options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)"); const profileData = profiles[profileName]; const { source_profile, region } = profileData; if (!options.roleAssumer) { - const { getDefaultRoleAssumer } = await __webpack_require__.e(/* import() */ 136).then(__webpack_require__.t.bind(__webpack_require__, 1136, 23)); + const { getDefaultRoleAssumer } = await Promise.all(/* import() */[__webpack_require__.e(272), __webpack_require__.e(136)]).then(__webpack_require__.t.bind(__webpack_require__, 1136, 23)); options.roleAssumer = getDefaultRoleAssumer({ ...options.clientConfig, credentialProviderLogger: options.logger, parentClientConfig: { + ...callerClientConfig, ...options?.parentClientConfig, - region: region ?? options?.parentClientConfig?.region, + region: region ?? options?.parentClientConfig?.region ?? callerClientConfig?.region, }, }, options.clientPlugins); } @@ -86,7 +88,7 @@ const resolveAssumeRoleCredentials = async (profileName, profiles, options, visi } options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`); const sourceCredsProvider = source_profile - ? resolveProfileData(source_profile, profiles, options, { + ? resolveProfileData(source_profile, profiles, options, callerClientConfig, { ...visitedProfiles, [source_profile]: true, }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) @@ -117,20 +119,33 @@ const isCredentialSourceWithoutRoleArn = (section) => { return !section.role_arn && !!section.credential_source; }; +const isLoginProfile = (data) => { + return Boolean(data && data.login_session); +}; +const resolveLoginCredentials = async (profileName, options, callerClientConfig) => { + const credentials = await credentialProviderLogin.fromLoginCredentials({ + ...options, + profile: profileName, + })({ callerClientConfig }); + return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE_LOGIN", "AC"); +}; + const isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; const resolveProcessCredentials = async (options, profile) => __webpack_require__.e(/* import() */ 360).then(__webpack_require__.t.bind(__webpack_require__, 5360, 19)).then(({ fromProcess }) => fromProcess({ ...options, profile, })().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))); -const resolveSsoCredentials = async (profile, profileData, options = {}) => { - const { fromSSO } = await __webpack_require__.e(/* import() */ 998).then(__webpack_require__.t.bind(__webpack_require__, 998, 19)); +const resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => { + const { fromSSO } = await Promise.all(/* import() */[__webpack_require__.e(272), __webpack_require__.e(998)]).then(__webpack_require__.t.bind(__webpack_require__, 998, 19)); return fromSSO({ profile, logger: options.logger, parentClientConfig: options.parentClientConfig, clientConfig: options.clientConfig, - })().then((creds) => { + })({ + callerClientConfig, + }).then((creds) => { if (profileData.sso_session) { return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r"); } @@ -169,56 +184,347 @@ const isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; -const resolveWebIdentityCredentials = async (profile, options) => __webpack_require__.e(/* import() */ 956).then(__webpack_require__.t.bind(__webpack_require__, 9956, 23)).then(({ fromTokenFile }) => fromTokenFile({ +const resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => Promise.all(/* import() */[__webpack_require__.e(272), __webpack_require__.e(956)]).then(__webpack_require__.t.bind(__webpack_require__, 9956, 23)).then(({ fromTokenFile }) => fromTokenFile({ webIdentityTokenFile: profile.web_identity_token_file, roleArn: profile.role_arn, roleSessionName: profile.role_session_name, roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, logger: options.logger, parentClientConfig: options.parentClientConfig, -})().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))); +})({ + callerClientConfig, +}).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))); -const resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => { +const resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => { const data = profiles[profileName]; if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) { return resolveStaticCredentials(data, options); } if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) { - return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles, resolveProfileData); + return resolveAssumeRoleCredentials(profileName, profiles, options, callerClientConfig, visitedProfiles, resolveProfileData); } if (isStaticCredsProfile(data)) { return resolveStaticCredentials(data, options); } if (isWebIdentityProfile(data)) { - return resolveWebIdentityCredentials(data, options); + return resolveWebIdentityCredentials(data, options, callerClientConfig); } if (isProcessProfile(data)) { return resolveProcessCredentials(options, profileName); } if (isSsoProfile(data)) { - return await resolveSsoCredentials(profileName, data, options); + return await resolveSsoCredentials(profileName, data, options, callerClientConfig); + } + if (isLoginProfile(data)) { + return resolveLoginCredentials(profileName, options, callerClientConfig); } throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger }); }; -const fromIni = (_init = {}) => async ({ callerClientConfig } = {}) => { - const init = { - ..._init, - parentClientConfig: { - ...callerClientConfig, - ..._init.parentClientConfig, - }, - }; +const fromIni = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni"); const profiles = await sharedIniFileLoader.parseKnownFiles(init); return resolveProfileData(sharedIniFileLoader.getProfileName({ - profile: _init.profile ?? callerClientConfig?.profile, - }), profiles, init); + profile: init.profile ?? callerClientConfig?.profile, + }), profiles, init, callerClientConfig); }; exports.fromIni = fromIni; +/***/ }), + +/***/ 4072: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +var client = __webpack_require__(5152); +var propertyProvider = __webpack_require__(8857); +var sharedIniFileLoader = __webpack_require__(4964); +var protocolHttp = __webpack_require__(2356); +var node_crypto = __webpack_require__(7598); +var node_fs = __webpack_require__(3024); +var node_os = __webpack_require__(8161); +var node_path = __webpack_require__(6760); + +class LoginCredentialsFetcher { + profileData; + init; + callerClientConfig; + static REFRESH_THRESHOLD = 5 * 60 * 1000; + constructor(profileData, init, callerClientConfig) { + this.profileData = profileData; + this.init = init; + this.callerClientConfig = callerClientConfig; + } + async loadCredentials() { + const token = await this.loadToken(); + if (!token) { + throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger }); + } + const accessToken = token.accessToken; + const now = Date.now(); + const expiryTime = new Date(accessToken.expiresAt).getTime(); + const timeUntilExpiry = expiryTime - now; + if (timeUntilExpiry <= LoginCredentialsFetcher.REFRESH_THRESHOLD) { + return this.refresh(token); + } + return { + accessKeyId: accessToken.accessKeyId, + secretAccessKey: accessToken.secretAccessKey, + sessionToken: accessToken.sessionToken, + accountId: accessToken.accountId, + expiration: new Date(accessToken.expiresAt), + }; + } + get logger() { + return this.init?.logger; + } + get loginSession() { + return this.profileData.login_session; + } + async refresh(token) { + const { SigninClient, CreateOAuth2TokenCommand } = await Promise.all(/* import() */[__webpack_require__.e(272), __webpack_require__.e(762)]).then(__webpack_require__.t.bind(__webpack_require__, 9762, 23)); + const { logger, userAgentAppId } = this.callerClientConfig ?? {}; + const isH2 = (requestHandler) => { + return requestHandler?.metadata?.handlerProtocol === "h2"; + }; + const requestHandler = isH2(this.callerClientConfig?.requestHandler) + ? undefined + : this.callerClientConfig?.requestHandler; + const region = this.profileData.region ?? (await this.callerClientConfig?.region?.()) ?? process.env.AWS_REGION; + const client = new SigninClient({ + credentials: { + accessKeyId: "", + secretAccessKey: "", + }, + region, + requestHandler, + logger, + userAgentAppId, + ...this.init?.clientConfig, + }); + this.createDPoPInterceptor(client.middlewareStack); + const commandInput = { + tokenInput: { + clientId: token.clientId, + refreshToken: token.refreshToken, + grantType: "refresh_token", + }, + }; + try { + const response = await client.send(new CreateOAuth2TokenCommand(commandInput)); + const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {}; + const { refreshToken, expiresIn } = response.tokenOutput ?? {}; + if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) { + throw new propertyProvider.CredentialsProviderError("Token refresh response missing required fields", { + logger: this.logger, + tryNextLink: false, + }); + } + const expiresInMs = (expiresIn ?? 900) * 1000; + const expiration = new Date(Date.now() + expiresInMs); + const updatedToken = { + ...token, + accessToken: { + ...token.accessToken, + accessKeyId: accessKeyId, + secretAccessKey: secretAccessKey, + sessionToken: sessionToken, + expiresAt: expiration.toISOString(), + }, + refreshToken: refreshToken, + }; + await this.saveToken(updatedToken); + const newAccessToken = updatedToken.accessToken; + return { + accessKeyId: newAccessToken.accessKeyId, + secretAccessKey: newAccessToken.secretAccessKey, + sessionToken: newAccessToken.sessionToken, + accountId: newAccessToken.accountId, + expiration, + }; + } + catch (error) { + if (error.name === "AccessDeniedException") { + const errorType = error.error; + let message; + switch (errorType) { + case "TOKEN_EXPIRED": + message = "Your session has expired. Please reauthenticate."; + break; + case "USER_CREDENTIALS_CHANGED": + message = + "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password."; + break; + case "INSUFFICIENT_PERMISSIONS": + message = + "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action."; + break; + default: + message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \`aws login\``; + } + throw new propertyProvider.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false }); + } + throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger }); + } + } + async loadToken() { + const tokenFilePath = this.getTokenFilePath(); + try { + let tokenData; + try { + tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache }); + } + catch { + tokenData = await node_fs.promises.readFile(tokenFilePath, "utf8"); + } + const token = JSON.parse(tokenData); + const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k) => !token[k]); + if (!token.accessToken?.accountId) { + missingFields.push("accountId"); + } + if (missingFields.length > 0) { + throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, { + logger: this.logger, + tryNextLink: false, + }); + } + return token; + } + catch (error) { + throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, { + logger: this.logger, + tryNextLink: false, + }); + } + } + async saveToken(token) { + const tokenFilePath = this.getTokenFilePath(); + const directory = node_path.dirname(tokenFilePath); + try { + await node_fs.promises.mkdir(directory, { recursive: true }); + } + catch (error) { + } + await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8"); + } + getTokenFilePath() { + const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), ".aws", "login", "cache"); + const loginSessionBytes = Buffer.from(this.loginSession, "utf8"); + const loginSessionSha256 = node_crypto.createHash("sha256").update(loginSessionBytes).digest("hex"); + return node_path.join(directory, `${loginSessionSha256}.json`); + } + derToRawSignature(derSignature) { + let offset = 2; + if (derSignature[offset] !== 0x02) { + throw new Error("Invalid DER signature"); + } + offset++; + const rLength = derSignature[offset++]; + let r = derSignature.subarray(offset, offset + rLength); + offset += rLength; + if (derSignature[offset] !== 0x02) { + throw new Error("Invalid DER signature"); + } + offset++; + const sLength = derSignature[offset++]; + let s = derSignature.subarray(offset, offset + sLength); + r = r[0] === 0x00 ? r.subarray(1) : r; + s = s[0] === 0x00 ? s.subarray(1) : s; + const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]); + const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]); + return Buffer.concat([rPadded, sPadded]); + } + createDPoPInterceptor(middlewareStack) { + middlewareStack.add((next) => async (args) => { + if (protocolHttp.HttpRequest.isInstance(args.request)) { + const request = args.request; + const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`; + const dpop = await this.generateDpop(request.method, actualEndpoint); + request.headers = { + ...request.headers, + DPoP: dpop, + }; + } + return next(args); + }, { + step: "finalizeRequest", + name: "dpopInterceptor", + override: true, + }); + } + async generateDpop(method = "POST", endpoint) { + const token = await this.loadToken(); + try { + const privateKey = node_crypto.createPrivateKey({ + key: token.dpopKey, + format: "pem", + type: "sec1", + }); + const publicKey = node_crypto.createPublicKey(privateKey); + const publicDer = publicKey.export({ format: "der", type: "spki" }); + let pointStart = -1; + for (let i = 0; i < publicDer.length; i++) { + if (publicDer[i] === 0x04) { + pointStart = i; + break; + } + } + const x = publicDer.slice(pointStart + 1, pointStart + 33); + const y = publicDer.slice(pointStart + 33, pointStart + 65); + const header = { + alg: "ES256", + typ: "dpop+jwt", + jwk: { + kty: "EC", + crv: "P-256", + x: x.toString("base64url"), + y: y.toString("base64url"), + }, + }; + const payload = { + jti: crypto.randomUUID(), + htm: method, + htu: endpoint, + iat: Math.floor(Date.now() / 1000), + }; + const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url"); + const payloadB64 = Buffer.from(JSON.stringify(payload)).toString("base64url"); + const message = `${headerB64}.${payloadB64}`; + const asn1Signature = node_crypto.sign("sha256", Buffer.from(message), privateKey); + const rawSignature = this.derToRawSignature(asn1Signature); + const signatureB64 = rawSignature.toString("base64url"); + return `${message}.${signatureB64}`; + } + catch (error) { + throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, { logger: this.logger, tryNextLink: false }); + } + } +} + +const fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => { + init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials"); + const profiles = await sharedIniFileLoader.parseKnownFiles(init || {}); + const profileName = sharedIniFileLoader.getProfileName({ + profile: init?.profile ?? callerClientConfig?.profile, + }); + const profile = profiles[profileName]; + if (!profile?.login_session) { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, { + tryNextLink: true, + logger: init?.logger, + }); + } + const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig); + const credentials = await fetcher.loadCredentials(); + return client.setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD"); +}; + +exports.fromLoginCredentials = fromLoginCredentials; + + /***/ }) }; diff --git a/dist/956.index.js b/dist/956.index.js index b2ce7d4..86e3645 100644 --- a/dist/956.index.js +++ b/dist/956.index.js @@ -12,7 +12,7 @@ exports.fromTokenFile = void 0; const client_1 = __webpack_require__(5152); const property_provider_1 = __webpack_require__(8857); const shared_ini_file_loader_1 = __webpack_require__(4964); -const fs_1 = __webpack_require__(9896); +const node_fs_1 = __webpack_require__(3024); const fromWebToken_1 = __webpack_require__(4453); const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; const ENV_ROLE_ARN = "AWS_ROLE_ARN"; @@ -30,7 +30,7 @@ const fromTokenFile = (init = {}) => async (awsIdentityProperties) => { const credentials = await (0, fromWebToken_1.fromWebToken)({ ...init, webIdentityToken: shared_ini_file_loader_1.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? - (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), + (0, node_fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), roleArn, roleSessionName, })(awsIdentityProperties); @@ -123,17 +123,25 @@ var fromWebToken = __webpack_require__(4453); -Object.keys(fromTokenFile).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { +Object.prototype.hasOwnProperty.call(fromTokenFile, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { enumerable: true, - get: function () { return fromTokenFile[k]; } + value: fromTokenFile['__proto__'] }); + +Object.keys(fromTokenFile).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = fromTokenFile[k]; }); -Object.keys(fromWebToken).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { +Object.prototype.hasOwnProperty.call(fromWebToken, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { enumerable: true, - get: function () { return fromWebToken[k]; } + value: fromWebToken['__proto__'] }); + +Object.keys(fromWebToken).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = fromWebToken[k]; }); @@ -377,8 +385,146 @@ util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunct Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ruleSet = void 0; const F = "required", G = "type", H = "fn", I = "argv", J = "ref"; -const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "string" }, n = { [F]: true, "default": false, [G]: "boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], "assign": "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e, "signingName": f, "signingRegion": g }] }, "headers": {} }, v = {}, w = { "conditions": [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y]; -const _data = { version: "1.0", parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H]: "not", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G]: h }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: "Invalid Configuration: Missing Region", [G]: k }] }; +const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "string" }, n = { [F]: true, default: false, [G]: "boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], assign: "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { + url: "https://sts.amazonaws.com", + properties: { authSchemes: [{ name: e, signingName: f, signingRegion: g }] }, + headers: {}, +}, v = {}, w = { conditions: [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y]; +const _data = { + version: "1.0", + parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, + rules: [ + { + conditions: [ + { [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, + { [H]: "not", [I]: C }, + p, + r, + { [H]: c, [I]: [s, a] }, + { [H]: c, [I]: [t, a] }, + ], + rules: [ + { conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, + w, + { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, + { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, + { + endpoint: { + url: i, + properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, + headers: v, + }, + [G]: h, + }, + ], + [G]: j, + }, + { + conditions: C, + rules: [ + { conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, + { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, + { endpoint: { url: o, properties: v, headers: v }, [G]: h }, + ], + [G]: j, + }, + { + conditions: [p], + rules: [ + { + conditions: [r], + rules: [ + { + conditions: [x, y], + rules: [ + { + conditions: [{ [H]: c, [I]: [b, z] }, B], + rules: [ + { + endpoint: { + url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + properties: v, + headers: v, + }, + [G]: h, + }, + ], + [G]: j, + }, + { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }, + ], + [G]: j, + }, + { + conditions: D, + rules: [ + { + conditions: [{ [H]: c, [I]: [z, b] }], + rules: [ + { + conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], + endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, + [G]: h, + }, + { + endpoint: { + url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", + properties: v, + headers: v, + }, + [G]: h, + }, + ], + [G]: j, + }, + { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }, + ], + [G]: j, + }, + { + conditions: E, + rules: [ + { + conditions: [B], + rules: [ + { + endpoint: { + url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", + properties: v, + headers: v, + }, + [G]: h, + }, + ], + [G]: j, + }, + { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }, + ], + [G]: j, + }, + w, + { endpoint: { url: i, properties: v, headers: v }, [G]: h }, + ], + [G]: j, + }, + ], + [G]: j, + }, + { error: "Invalid Configuration: Missing Region", [G]: k }, + ], +}; exports.ruleSet = _data; @@ -393,312 +539,11 @@ var STSClient = __webpack_require__(3723); var smithyClient = __webpack_require__(1411); var middlewareEndpoint = __webpack_require__(99); var EndpointParameters = __webpack_require__(6811); -var schema = __webpack_require__(6890); +var schemas_0 = __webpack_require__(1684); +var errors = __webpack_require__(1688); var client = __webpack_require__(5152); var regionConfigResolver = __webpack_require__(6463); - -let STSServiceException$1 = class STSServiceException extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, STSServiceException.prototype); - } -}; - -let ExpiredTokenException$1 = class ExpiredTokenException extends STSServiceException$1 { - name = "ExpiredTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ExpiredTokenException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ExpiredTokenException.prototype); - } -}; -let MalformedPolicyDocumentException$1 = class MalformedPolicyDocumentException extends STSServiceException$1 { - name = "MalformedPolicyDocumentException"; - $fault = "client"; - constructor(opts) { - super({ - name: "MalformedPolicyDocumentException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); - } -}; -let PackedPolicyTooLargeException$1 = class PackedPolicyTooLargeException extends STSServiceException$1 { - name = "PackedPolicyTooLargeException"; - $fault = "client"; - constructor(opts) { - super({ - name: "PackedPolicyTooLargeException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); - } -}; -let RegionDisabledException$1 = class RegionDisabledException extends STSServiceException$1 { - name = "RegionDisabledException"; - $fault = "client"; - constructor(opts) { - super({ - name: "RegionDisabledException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, RegionDisabledException.prototype); - } -}; -let IDPRejectedClaimException$1 = class IDPRejectedClaimException extends STSServiceException$1 { - name = "IDPRejectedClaimException"; - $fault = "client"; - constructor(opts) { - super({ - name: "IDPRejectedClaimException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); - } -}; -let InvalidIdentityTokenException$1 = class InvalidIdentityTokenException extends STSServiceException$1 { - name = "InvalidIdentityTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidIdentityTokenException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); - } -}; -let IDPCommunicationErrorException$1 = class IDPCommunicationErrorException extends STSServiceException$1 { - name = "IDPCommunicationErrorException"; - $fault = "client"; - constructor(opts) { - super({ - name: "IDPCommunicationErrorException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); - } -}; - -const _A = "Arn"; -const _AKI = "AccessKeyId"; -const _AR = "AssumeRole"; -const _ARI = "AssumedRoleId"; -const _ARR = "AssumeRoleRequest"; -const _ARRs = "AssumeRoleResponse"; -const _ARU = "AssumedRoleUser"; -const _ARWWI = "AssumeRoleWithWebIdentity"; -const _ARWWIR = "AssumeRoleWithWebIdentityRequest"; -const _ARWWIRs = "AssumeRoleWithWebIdentityResponse"; -const _Au = "Audience"; -const _C = "Credentials"; -const _CA = "ContextAssertion"; -const _DS = "DurationSeconds"; -const _E = "Expiration"; -const _EI = "ExternalId"; -const _ETE = "ExpiredTokenException"; -const _IDPCEE = "IDPCommunicationErrorException"; -const _IDPRCE = "IDPRejectedClaimException"; -const _IITE = "InvalidIdentityTokenException"; -const _K = "Key"; -const _MPDE = "MalformedPolicyDocumentException"; -const _P = "Policy"; -const _PA = "PolicyArns"; -const _PAr = "ProviderArn"; -const _PC = "ProvidedContexts"; -const _PCLT = "ProvidedContextsListType"; -const _PCr = "ProvidedContext"; -const _PDT = "PolicyDescriptorType"; -const _PI = "ProviderId"; -const _PPS = "PackedPolicySize"; -const _PPTLE = "PackedPolicyTooLargeException"; -const _Pr = "Provider"; -const _RA = "RoleArn"; -const _RDE = "RegionDisabledException"; -const _RSN = "RoleSessionName"; -const _SAK = "SecretAccessKey"; -const _SFWIT = "SubjectFromWebIdentityToken"; -const _SI = "SourceIdentity"; -const _SN = "SerialNumber"; -const _ST = "SessionToken"; -const _T = "Tags"; -const _TC = "TokenCode"; -const _TTK = "TransitiveTagKeys"; -const _Ta = "Tag"; -const _V = "Value"; -const _WIT = "WebIdentityToken"; -const _a = "arn"; -const _aKST = "accessKeySecretType"; -const _aQE = "awsQueryError"; -const _c = "client"; -const _cTT = "clientTokenType"; -const _e = "error"; -const _hE = "httpError"; -const _m = "message"; -const _pDLT = "policyDescriptorListType"; -const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; -const _tLT = "tagListType"; -const n0 = "com.amazonaws.sts"; -var accessKeySecretType = [0, n0, _aKST, 8, 0]; -var clientTokenType = [0, n0, _cTT, 8, 0]; -var AssumedRoleUser = [3, n0, _ARU, 0, [_ARI, _A], [0, 0]]; -var AssumeRoleRequest = [ - 3, - n0, - _ARR, - 0, - [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC], - [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType], -]; -var AssumeRoleResponse = [ - 3, - n0, - _ARRs, - 0, - [_C, _ARU, _PPS, _SI], - [[() => Credentials, 0], () => AssumedRoleUser, 1, 0], -]; -var AssumeRoleWithWebIdentityRequest = [ - 3, - n0, - _ARWWIR, - 0, - [_RA, _RSN, _WIT, _PI, _PA, _P, _DS], - [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1], -]; -var AssumeRoleWithWebIdentityResponse = [ - 3, - n0, - _ARWWIRs, - 0, - [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI], - [[() => Credentials, 0], 0, () => AssumedRoleUser, 1, 0, 0, 0], -]; -var Credentials = [ - 3, - n0, - _C, - 0, - [_AKI, _SAK, _ST, _E], - [0, [() => accessKeySecretType, 0], 0, 4], -]; -var ExpiredTokenException = [ - -3, - n0, - _ETE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ExpiredTokenException`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1); -var IDPCommunicationErrorException = [ - -3, - n0, - _IDPCEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`IDPCommunicationError`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(IDPCommunicationErrorException, IDPCommunicationErrorException$1); -var IDPRejectedClaimException = [ - -3, - n0, - _IDPRCE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`IDPRejectedClaim`, 403], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(IDPRejectedClaimException, IDPRejectedClaimException$1); -var InvalidIdentityTokenException = [ - -3, - n0, - _IITE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InvalidIdentityToken`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidIdentityTokenException, InvalidIdentityTokenException$1); -var MalformedPolicyDocumentException = [ - -3, - n0, - _MPDE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`MalformedPolicyDocument`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(MalformedPolicyDocumentException, MalformedPolicyDocumentException$1); -var PackedPolicyTooLargeException = [ - -3, - n0, - _PPTLE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`PackedPolicyTooLarge`, 400], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(PackedPolicyTooLargeException, PackedPolicyTooLargeException$1); -var PolicyDescriptorType = [3, n0, _PDT, 0, [_a], [0]]; -var ProvidedContext = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]]; -var RegionDisabledException = [ - -3, - n0, - _RDE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`RegionDisabledException`, 403], - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(RegionDisabledException, RegionDisabledException$1); -var Tag = [3, n0, _Ta, 0, [_K, _V], [0, 0]]; -var STSServiceException = [-3, _s, "STSServiceException", 0, [], []]; -schema.TypeRegistry.for(_s).registerError(STSServiceException, STSServiceException$1); -var policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType]; -var ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext]; -var tagListType = [1, n0, _tLT, 0, () => Tag]; -var AssumeRole = [9, n0, _AR, 0, () => AssumeRoleRequest, () => AssumeRoleResponse]; -var AssumeRoleWithWebIdentity = [ - 9, - n0, - _ARWWI, - 0, - () => AssumeRoleWithWebIdentityRequest, - () => AssumeRoleWithWebIdentityResponse, -]; +var STSServiceException = __webpack_require__(7171); class AssumeRoleCommand extends smithyClient.Command .classBuilder() @@ -708,7 +553,7 @@ class AssumeRoleCommand extends smithyClient.Command }) .s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}) .n("STSClient", "AssumeRoleCommand") - .sc(AssumeRole) + .sc(schemas_0.AssumeRole$) .build() { } @@ -720,7 +565,7 @@ class AssumeRoleWithWebIdentityCommand extends smithyClient.Command }) .s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}) .n("STSClient", "AssumeRoleWithWebIdentityCommand") - .sc(AssumeRoleWithWebIdentity) + .sc(schemas_0.AssumeRoleWithWebIdentity$) .build() { } @@ -744,9 +589,10 @@ const getAccountIdFromAssumedRoleUser = (assumedRoleUser) => { const resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => { const region = typeof _region === "function" ? await _region() : _region; const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; - const stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)(); + let stsDefaultRegion = ""; + const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)()); credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`); - return region ?? parentRegion ?? stsDefaultRegion; + return resolvedRegion; }; const getDefaultRoleAssumer$1 = (stsOptions, STSClient) => { let stsClient; @@ -851,30 +697,165 @@ const decorateDefaultCredentialProvider = (provider) => (input) => provider({ ...input, }); -Object.defineProperty(exports, "$Command", ({ - enumerable: true, - get: function () { return smithyClient.Command; } -})); +exports.$Command = smithyClient.Command; +exports.STSServiceException = STSServiceException.STSServiceException; exports.AssumeRoleCommand = AssumeRoleCommand; exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand; -exports.ExpiredTokenException = ExpiredTokenException$1; -exports.IDPCommunicationErrorException = IDPCommunicationErrorException$1; -exports.IDPRejectedClaimException = IDPRejectedClaimException$1; -exports.InvalidIdentityTokenException = InvalidIdentityTokenException$1; -exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException$1; -exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException$1; -exports.RegionDisabledException = RegionDisabledException$1; exports.STS = STS; -exports.STSServiceException = STSServiceException$1; exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; exports.getDefaultRoleAssumer = getDefaultRoleAssumer; exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; +Object.prototype.hasOwnProperty.call(STSClient, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: STSClient['__proto__'] + }); + Object.keys(STSClient).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = STSClient[k]; +}); +Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { enumerable: true, - get: function () { return STSClient[k]; } + value: schemas_0['__proto__'] }); + +Object.keys(schemas_0).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k]; }); +Object.prototype.hasOwnProperty.call(errors, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: errors['__proto__'] + }); + +Object.keys(errors).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k]; +}); + + +/***/ }), + +/***/ 7171: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.STSServiceException = exports.__ServiceException = void 0; +const smithy_client_1 = __webpack_require__(1411); +Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); +class STSServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, STSServiceException.prototype); + } +} +exports.STSServiceException = STSServiceException; + + +/***/ }), + +/***/ 1688: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IDPCommunicationErrorException = exports.InvalidIdentityTokenException = exports.IDPRejectedClaimException = exports.RegionDisabledException = exports.PackedPolicyTooLargeException = exports.MalformedPolicyDocumentException = exports.ExpiredTokenException = void 0; +const STSServiceException_1 = __webpack_require__(7171); +class ExpiredTokenException extends STSServiceException_1.STSServiceException { + name = "ExpiredTokenException"; + $fault = "client"; + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ExpiredTokenException.prototype); + } +} +exports.ExpiredTokenException = ExpiredTokenException; +class MalformedPolicyDocumentException extends STSServiceException_1.STSServiceException { + name = "MalformedPolicyDocumentException"; + $fault = "client"; + constructor(opts) { + super({ + name: "MalformedPolicyDocumentException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); + } +} +exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException; +class PackedPolicyTooLargeException extends STSServiceException_1.STSServiceException { + name = "PackedPolicyTooLargeException"; + $fault = "client"; + constructor(opts) { + super({ + name: "PackedPolicyTooLargeException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); + } +} +exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException; +class RegionDisabledException extends STSServiceException_1.STSServiceException { + name = "RegionDisabledException"; + $fault = "client"; + constructor(opts) { + super({ + name: "RegionDisabledException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, RegionDisabledException.prototype); + } +} +exports.RegionDisabledException = RegionDisabledException; +class IDPRejectedClaimException extends STSServiceException_1.STSServiceException { + name = "IDPRejectedClaimException"; + $fault = "client"; + constructor(opts) { + super({ + name: "IDPRejectedClaimException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); + } +} +exports.IDPRejectedClaimException = IDPRejectedClaimException; +class InvalidIdentityTokenException extends STSServiceException_1.STSServiceException { + name = "InvalidIdentityTokenException"; + $fault = "client"; + constructor(opts) { + super({ + name: "InvalidIdentityTokenException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); + } +} +exports.InvalidIdentityTokenException = InvalidIdentityTokenException; +class IDPCommunicationErrorException extends STSServiceException_1.STSServiceException { + name = "IDPCommunicationErrorException"; + $fault = "client"; + constructor(opts) { + super({ + name: "IDPCommunicationErrorException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); + } +} +exports.IDPCommunicationErrorException = IDPCommunicationErrorException; /***/ }), @@ -894,15 +875,14 @@ const core_2 = __webpack_require__(402); const hash_node_1 = __webpack_require__(2711); const middleware_retry_1 = __webpack_require__(9618); const node_config_provider_1 = __webpack_require__(5704); -const node_http_handler_1 = __webpack_require__(1279); +const node_http_handler_1 = __webpack_require__(2764); +const smithy_client_1 = __webpack_require__(1411); const util_body_length_node_1 = __webpack_require__(3638); +const util_defaults_mode_node_1 = __webpack_require__(5435); const util_retry_1 = __webpack_require__(5518); const runtimeConfig_shared_1 = __webpack_require__(4443); -const smithy_client_1 = __webpack_require__(1411); -const util_defaults_mode_node_1 = __webpack_require__(5435); -const smithy_client_2 = __webpack_require__(1411); const getRuntimeConfig = (config) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); + (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); @@ -969,6 +949,7 @@ const util_base64_1 = __webpack_require__(8385); const util_utf8_1 = __webpack_require__(1577); const httpAuthSchemeProvider_1 = __webpack_require__(7851); const endpointResolver_1 = __webpack_require__(9765); +const schemas_0_1 = __webpack_require__(1684); const getRuntimeConfig = (config) => { return { apiVersion: "2011-06-15", @@ -991,12 +972,14 @@ const getRuntimeConfig = (config) => { }, ], logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - protocol: config?.protocol ?? - new protocols_1.AwsQueryProtocol({ - defaultNamespace: "com.amazonaws.sts", - xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", - version: "2011-06-15", - }), + protocol: config?.protocol ?? protocols_1.AwsQueryProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.sts", + errorTypeRegistries: schemas_0_1.errorTypeRegistries, + xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", + version: "2011-06-15", + serviceTarget: "AWSSecurityTokenServiceV20110615", + }, serviceId: config?.serviceId ?? "STS", urlParser: config?.urlParser ?? url_parser_1.parseUrl, utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, @@ -1028,10 +1011,205 @@ exports.resolveRuntimeExtensions = resolveRuntimeExtensions; /***/ }), -/***/ 9955: -/***/ ((module) => { +/***/ 1684: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AssumeRoleWithWebIdentity$ = exports.AssumeRole$ = exports.Tag$ = exports.ProvidedContext$ = exports.PolicyDescriptorType$ = exports.Credentials$ = exports.AssumeRoleWithWebIdentityResponse$ = exports.AssumeRoleWithWebIdentityRequest$ = exports.AssumeRoleResponse$ = exports.AssumeRoleRequest$ = exports.AssumedRoleUser$ = exports.errorTypeRegistries = exports.RegionDisabledException$ = exports.PackedPolicyTooLargeException$ = exports.MalformedPolicyDocumentException$ = exports.InvalidIdentityTokenException$ = exports.IDPRejectedClaimException$ = exports.IDPCommunicationErrorException$ = exports.ExpiredTokenException$ = exports.STSServiceException$ = void 0; +const _A = "Arn"; +const _AKI = "AccessKeyId"; +const _AR = "AssumeRole"; +const _ARI = "AssumedRoleId"; +const _ARR = "AssumeRoleRequest"; +const _ARRs = "AssumeRoleResponse"; +const _ARU = "AssumedRoleUser"; +const _ARWWI = "AssumeRoleWithWebIdentity"; +const _ARWWIR = "AssumeRoleWithWebIdentityRequest"; +const _ARWWIRs = "AssumeRoleWithWebIdentityResponse"; +const _Au = "Audience"; +const _C = "Credentials"; +const _CA = "ContextAssertion"; +const _DS = "DurationSeconds"; +const _E = "Expiration"; +const _EI = "ExternalId"; +const _ETE = "ExpiredTokenException"; +const _IDPCEE = "IDPCommunicationErrorException"; +const _IDPRCE = "IDPRejectedClaimException"; +const _IITE = "InvalidIdentityTokenException"; +const _K = "Key"; +const _MPDE = "MalformedPolicyDocumentException"; +const _P = "Policy"; +const _PA = "PolicyArns"; +const _PAr = "ProviderArn"; +const _PC = "ProvidedContexts"; +const _PCLT = "ProvidedContextsListType"; +const _PCr = "ProvidedContext"; +const _PDT = "PolicyDescriptorType"; +const _PI = "ProviderId"; +const _PPS = "PackedPolicySize"; +const _PPTLE = "PackedPolicyTooLargeException"; +const _Pr = "Provider"; +const _RA = "RoleArn"; +const _RDE = "RegionDisabledException"; +const _RSN = "RoleSessionName"; +const _SAK = "SecretAccessKey"; +const _SFWIT = "SubjectFromWebIdentityToken"; +const _SI = "SourceIdentity"; +const _SN = "SerialNumber"; +const _ST = "SessionToken"; +const _T = "Tags"; +const _TC = "TokenCode"; +const _TTK = "TransitiveTagKeys"; +const _Ta = "Tag"; +const _V = "Value"; +const _WIT = "WebIdentityToken"; +const _a = "arn"; +const _aKST = "accessKeySecretType"; +const _aQE = "awsQueryError"; +const _c = "client"; +const _cTT = "clientTokenType"; +const _e = "error"; +const _hE = "httpError"; +const _m = "message"; +const _pDLT = "policyDescriptorListType"; +const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; +const _tLT = "tagListType"; +const n0 = "com.amazonaws.sts"; +const schema_1 = __webpack_require__(6890); +const errors_1 = __webpack_require__(1688); +const STSServiceException_1 = __webpack_require__(7171); +const _s_registry = schema_1.TypeRegistry.for(_s); +exports.STSServiceException$ = [-3, _s, "STSServiceException", 0, [], []]; +_s_registry.registerError(exports.STSServiceException$, STSServiceException_1.STSServiceException); +const n0_registry = schema_1.TypeRegistry.for(n0); +exports.ExpiredTokenException$ = [ + -3, + n0, + _ETE, + { [_aQE]: [`ExpiredTokenException`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.ExpiredTokenException$, errors_1.ExpiredTokenException); +exports.IDPCommunicationErrorException$ = [ + -3, + n0, + _IDPCEE, + { [_aQE]: [`IDPCommunicationError`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.IDPCommunicationErrorException$, errors_1.IDPCommunicationErrorException); +exports.IDPRejectedClaimException$ = [ + -3, + n0, + _IDPRCE, + { [_aQE]: [`IDPRejectedClaim`, 403], [_e]: _c, [_hE]: 403 }, + [_m], + [0], +]; +n0_registry.registerError(exports.IDPRejectedClaimException$, errors_1.IDPRejectedClaimException); +exports.InvalidIdentityTokenException$ = [ + -3, + n0, + _IITE, + { [_aQE]: [`InvalidIdentityToken`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.InvalidIdentityTokenException$, errors_1.InvalidIdentityTokenException); +exports.MalformedPolicyDocumentException$ = [ + -3, + n0, + _MPDE, + { [_aQE]: [`MalformedPolicyDocument`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.MalformedPolicyDocumentException$, errors_1.MalformedPolicyDocumentException); +exports.PackedPolicyTooLargeException$ = [ + -3, + n0, + _PPTLE, + { [_aQE]: [`PackedPolicyTooLarge`, 400], [_e]: _c, [_hE]: 400 }, + [_m], + [0], +]; +n0_registry.registerError(exports.PackedPolicyTooLargeException$, errors_1.PackedPolicyTooLargeException); +exports.RegionDisabledException$ = [ + -3, + n0, + _RDE, + { [_aQE]: [`RegionDisabledException`, 403], [_e]: _c, [_hE]: 403 }, + [_m], + [0], +]; +n0_registry.registerError(exports.RegionDisabledException$, errors_1.RegionDisabledException); +exports.errorTypeRegistries = [_s_registry, n0_registry]; +var accessKeySecretType = [0, n0, _aKST, 8, 0]; +var clientTokenType = [0, n0, _cTT, 8, 0]; +exports.AssumedRoleUser$ = [3, n0, _ARU, 0, [_ARI, _A], [0, 0], 2]; +exports.AssumeRoleRequest$ = [ + 3, + n0, + _ARR, + 0, + [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC], + [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType], + 2, +]; +exports.AssumeRoleResponse$ = [ + 3, + n0, + _ARRs, + 0, + [_C, _ARU, _PPS, _SI], + [[() => exports.Credentials$, 0], () => exports.AssumedRoleUser$, 1, 0], +]; +exports.AssumeRoleWithWebIdentityRequest$ = [ + 3, + n0, + _ARWWIR, + 0, + [_RA, _RSN, _WIT, _PI, _PA, _P, _DS], + [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1], + 3, +]; +exports.AssumeRoleWithWebIdentityResponse$ = [ + 3, + n0, + _ARWWIRs, + 0, + [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI], + [[() => exports.Credentials$, 0], 0, () => exports.AssumedRoleUser$, 1, 0, 0, 0], +]; +exports.Credentials$ = [ + 3, + n0, + _C, + 0, + [_AKI, _SAK, _ST, _E], + [0, [() => accessKeySecretType, 0], 0, 4], + 4, +]; +exports.PolicyDescriptorType$ = [3, n0, _PDT, 0, [_a], [0]]; +exports.ProvidedContext$ = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]]; +exports.Tag$ = [3, n0, _Ta, 0, [_K, _V], [0, 0], 2]; +var policyDescriptorListType = [1, n0, _pDLT, 0, () => exports.PolicyDescriptorType$]; +var ProvidedContextsListType = [1, n0, _PCLT, 0, () => exports.ProvidedContext$]; +var tagKeyListType = (/* unused pure expression or super */ null && (64 | 0)); +var tagListType = [1, n0, _tLT, 0, () => exports.Tag$]; +exports.AssumeRole$ = [9, n0, _AR, 0, () => exports.AssumeRoleRequest$, () => exports.AssumeRoleResponse$]; +exports.AssumeRoleWithWebIdentity$ = [ + 9, + n0, + _ARWWI, + 0, + () => exports.AssumeRoleWithWebIdentityRequest$, + () => exports.AssumeRoleWithWebIdentityResponse$, +]; -module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/nested-clients","version":"3.935.0","description":"Nested clients for AWS SDK packages.","main":"./dist-cjs/index.js","module":"./dist-es/index.js","types":"./dist-types/index.d.ts","scripts":{"build":"yarn lint && concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline nested-clients","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","lint":"node ../../scripts/validation/submodules-linter.js --pkg nested-clients","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"engines":{"node":">=18.0.0"},"sideEffects":false,"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.935.0","@aws-sdk/middleware-host-header":"3.930.0","@aws-sdk/middleware-logger":"3.930.0","@aws-sdk/middleware-recursion-detection":"3.933.0","@aws-sdk/middleware-user-agent":"3.935.0","@aws-sdk/region-config-resolver":"3.930.0","@aws-sdk/types":"3.930.0","@aws-sdk/util-endpoints":"3.930.0","@aws-sdk/util-user-agent-browser":"3.930.0","@aws-sdk/util-user-agent-node":"3.935.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0","tslib":"^2.6.2"},"devDependencies":{"concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["./sso-oidc.d.ts","./sso-oidc.js","./sts.d.ts","./sts.js","dist-*/**"],"browser":{"./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"packages/nested-clients"},"exports":{"./sso-oidc":{"types":"./dist-types/submodules/sso-oidc/index.d.ts","module":"./dist-es/submodules/sso-oidc/index.js","node":"./dist-cjs/submodules/sso-oidc/index.js","import":"./dist-es/submodules/sso-oidc/index.js","require":"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{"types":"./dist-types/submodules/sts/index.d.ts","module":"./dist-es/submodules/sts/index.js","node":"./dist-cjs/submodules/sts/index.js","import":"./dist-es/submodules/sts/index.js","require":"./dist-cjs/submodules/sts/index.js"}}}'); /***/ }) diff --git a/dist/998.index.js b/dist/998.index.js index 2e16556..ae3617e 100644 --- a/dist/998.index.js +++ b/dist/998.index.js @@ -3,1272 +3,1194 @@ exports.id = 998; exports.ids = [998]; exports.modules = { -/***/ 2041: +/***/ 7523: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0; -const core_1 = __webpack_require__(8704); -const util_middleware_1 = __webpack_require__(6324); -const 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 protocolHttp = __webpack_require__(2356); +var core = __webpack_require__(402); +var propertyProvider = __webpack_require__(8857); +var client = __webpack_require__(5152); +var signatureV4 = __webpack_require__(5118); + +const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined; + +const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); + +const isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000; + +const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); + } + return currentSystemClockOffset; }; -exports.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) { + +const throwSigningPropertyError = (name, property) => { + if (!property) { + throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); + } + return property; +}; +const 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 { - schemeId: "smithy.api#noAuth", + config, + signer, + signingRegion, + signingRegionSet, + signingName, }; -} -const 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; +}; +class AwsSdkSigV4Signer { + async sign(httpRequest, identity, signingProperties) { + if (!protocolHttp.HttpRequest.isInstance(httpRequest)) { + throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); } - case "Logout": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; + 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; + } } - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + const signedRequest = await signer.sign(httpRequest, { + signingDate: getSkewCorrectedDate(config.systemClockOffset), + signingRegion: 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; + }; + } + successHandler(httpResponse, signingProperties) { + const dateHeader = getDateHeader(httpResponse); + if (dateHeader) { + const config = throwSigningPropertyError("config", signingProperties.config); + config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); } } - return options; -}; -exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider; -const resolveHttpAuthSchemeConfig = (config) => { - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); -}; -exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; - +} +const AWSSDKSigV4Signer = AwsSdkSigV4Signer; -/***/ }), +class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer { + async sign(httpRequest, identity, signingProperties) { + if (!protocolHttp.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; + } +} -/***/ 3903: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +const getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; +const getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultEndpointResolver = void 0; -const util_endpoints_1 = __webpack_require__(3068); -const util_endpoints_2 = __webpack_require__(9674); -const ruleset_1 = __webpack_require__(1308); -const cache = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"], -}); -const defaultEndpointResolver = (endpointParams, context = {}) => { - return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams: endpointParams, - logger: context.logger, - })); +const NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; +const NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; +const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { + environmentVariableSelector: (env, options) => { + if (options?.signingName) { + const bearerTokenKey = getBearerTokenEnvKey(options.signingName); + if (bearerTokenKey in env) + return ["httpBearerAuth"]; + } + if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) + return undefined; + return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); + }, + configFileSelector: (profile) => { + if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) + return undefined; + return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); + }, + default: [], }; -exports.defaultEndpointResolver = defaultEndpointResolver; -util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; - - -/***/ }), - -/***/ 1308: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ruleSet = void 0; -const u = "required", v = "fn", w = "argv", x = "ref"; -const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, "type": "string" }, j = { [u]: true, "default": false, "type": "boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }]; -const _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 }] }; -exports.ruleSet = _data; - - -/***/ }), - -/***/ 2054: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -var middlewareHostHeader = __webpack_require__(2590); -var middlewareLogger = __webpack_require__(5242); -var middlewareRecursionDetection = __webpack_require__(1568); -var middlewareUserAgent = __webpack_require__(2959); -var configResolver = __webpack_require__(9316); -var core = __webpack_require__(402); -var schema = __webpack_require__(6890); -var middlewareContentLength = __webpack_require__(7212); -var middlewareEndpoint = __webpack_require__(99); -var middlewareRetry = __webpack_require__(9618); -var smithyClient = __webpack_require__(1411); -var httpAuthSchemeProvider = __webpack_require__(2041); -var runtimeConfig = __webpack_require__(2696); -var regionConfigResolver = __webpack_require__(6463); -var protocolHttp = __webpack_require__(2356); -const resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "awsssoportal", - }); -}; -const commonParams = { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, +const resolveAwsSdkSigV4AConfig = (config) => { + config.sigv4aSigningRegionSet = core.normalizeProvider(config.sigv4aSigningRegionSet); + return config; }; - -const getHttpAuthExtensionConfiguration = (runtimeConfig) => { - const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; - let _credentials = runtimeConfig.credentials; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } +const 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 propertyProvider.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 propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", { + tryNextLink: true, + }); + }, + default: undefined, +}; + +const resolveAwsSdkSigV4Config = (config) => { + let inputCredentials = config.credentials; + let isUserSupplied = !!config.credentials; + let resolvedCredentials = undefined; + Object.defineProperty(config, "credentials", { + set(credentials) { + if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { + isUserSupplied = true; + } + inputCredentials = credentials; + const memoizedProvider = normalizeCredentialProvider(config, { + credentials: inputCredentials, + credentialDefaultProvider: config.credentialDefaultProvider, + }); + const boundProvider = bindCallerConfig(config, memoizedProvider); + if (isUserSupplied && !boundProvider.attributed) { + const isCredentialObject = typeof inputCredentials === "object" && inputCredentials !== null; + resolvedCredentials = async (options) => { + const creds = await boundProvider(options); + const attributedCreds = creds; + if (isCredentialObject && (!attributedCreds.$source || Object.keys(attributedCreds.$source).length === 0)) { + return client.setCredentialFeature(attributedCreds, "CREDENTIALS_CODE", "e"); + } + return attributedCreds; + }; + resolvedCredentials.memoized = boundProvider.memoized; + resolvedCredentials.configBound = boundProvider.configBound; + resolvedCredentials.attributed = true; + } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); + resolvedCredentials = boundProvider; } }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider) { - _httpAuthSchemeProvider = httpAuthSchemeProvider; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; + get() { + return resolvedCredentials; }, - }; -}; -const resolveHttpAuthRuntimeConfig = (config) => { - return { - httpAuthSchemes: config.httpAuthSchemes(), - httpAuthSchemeProvider: config.httpAuthSchemeProvider(), - credentials: config.credentials(), - }; -}; - -const resolveRuntimeExtensions = (runtimeConfig, extensions) => { - const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); -}; - -class SSOClient extends smithyClient.Client { - config; - constructor(...[configuration]) { - const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); - const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); - const _config_4 = configResolver.resolveRegionConfig(_config_3); - const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); - const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); - const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); - const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); - this.config = _config_8; - this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); - this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); - this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); - this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); - this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); - this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); - this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); - this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config.credentials, - }), - })); - this.middlewareStack.use(core.getHttpSigningPlugin(this.config)); - } - destroy() { - super.destroy(); - } -} - -let SSOServiceException$1 = class SSOServiceException extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, SSOServiceException.prototype); + enumerable: true, + configurable: true, + }); + config.credentials = inputCredentials; + const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config; + let signer; + if (config.signer) { + signer = core.normalizeProvider(config.signer); } -}; - -let InvalidRequestException$1 = class InvalidRequestException extends SSOServiceException$1 { - name = "InvalidRequestException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidRequestException", - $fault: "client", - ...opts, + else if (config.regionInfoProvider) { + signer = () => core.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: config.credentials, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = config.signerConstructor || signatureV4.SignatureV4; + return new SignerCtor(params); }); - Object.setPrototypeOf(this, InvalidRequestException.prototype); } -}; -let ResourceNotFoundException$1 = class ResourceNotFoundException extends SSOServiceException$1 { - name = "ResourceNotFoundException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ResourceNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + else { + signer = async (authScheme) => { + authScheme = Object.assign({}, { + name: "sigv4", + signingName: config.signingName || config.defaultSigningName, + signingRegion: await core.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: config.credentials, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = config.signerConstructor || signatureV4.SignatureV4; + return new SignerCtor(params); + }; } + const resolvedConfig = Object.assign(config, { + systemClockOffset, + signingEscapePath, + signer, + }); + return resolvedConfig; }; -let TooManyRequestsException$1 = class TooManyRequestsException extends SSOServiceException$1 { - name = "TooManyRequestsException"; - $fault = "client"; - constructor(opts) { - super({ - name: "TooManyRequestsException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, TooManyRequestsException.prototype); +const resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; +function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider, }) { + let credentialsProvider; + if (credentials) { + if (!credentials?.memoized) { + credentialsProvider = core.memoizeIdentityProvider(credentials, core.isIdentityExpired, core.doesIdentityRequireRefresh); + } + else { + credentialsProvider = credentials; + } } -}; -let UnauthorizedException$1 = class UnauthorizedException extends SSOServiceException$1 { - name = "UnauthorizedException"; - $fault = "client"; - constructor(opts) { - super({ - name: "UnauthorizedException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, UnauthorizedException.prototype); + else { + if (credentialDefaultProvider) { + credentialsProvider = core.normalizeProvider(credentialDefaultProvider(Object.assign({}, config, { + parentClientConfig: config, + }))); + } + else { + credentialsProvider = async () => { + throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured."); + }; + } } -}; + credentialsProvider.memoized = true; + return credentialsProvider; +} +function bindCallerConfig(config, credentialsProvider) { + if (credentialsProvider.configBound) { + return credentialsProvider; + } + const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config }); + fn.memoized = credentialsProvider.memoized; + fn.configBound = true; + return fn; +} -const _AI = "AccountInfo"; -const _ALT = "AccountListType"; -const _ATT = "AccessTokenType"; -const _GRC = "GetRoleCredentials"; -const _GRCR = "GetRoleCredentialsRequest"; -const _GRCRe = "GetRoleCredentialsResponse"; -const _IRE = "InvalidRequestException"; -const _L = "Logout"; -const _LA = "ListAccounts"; -const _LAR = "ListAccountsRequest"; -const _LARR = "ListAccountRolesRequest"; -const _LARRi = "ListAccountRolesResponse"; -const _LARi = "ListAccountsResponse"; -const _LARis = "ListAccountRoles"; -const _LR = "LogoutRequest"; -const _RC = "RoleCredentials"; -const _RI = "RoleInfo"; -const _RLT = "RoleListType"; -const _RNFE = "ResourceNotFoundException"; -const _SAKT = "SecretAccessKeyType"; -const _STT = "SessionTokenType"; -const _TMRE = "TooManyRequestsException"; -const _UE = "UnauthorizedException"; -const _aI = "accountId"; -const _aKI = "accessKeyId"; -const _aL = "accountList"; -const _aN = "accountName"; -const _aT = "accessToken"; -const _ai = "account_id"; -const _c = "client"; -const _e = "error"; -const _eA = "emailAddress"; -const _ex = "expiration"; -const _h = "http"; -const _hE = "httpError"; -const _hH = "httpHeader"; -const _hQ = "httpQuery"; -const _m = "message"; -const _mR = "maxResults"; -const _mr = "max_result"; -const _nT = "nextToken"; -const _nt = "next_token"; -const _rC = "roleCredentials"; -const _rL = "roleList"; -const _rN = "roleName"; -const _rn = "role_name"; -const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sso"; -const _sAK = "secretAccessKey"; -const _sT = "sessionToken"; -const _xasbt = "x-amz-sso_bearer_token"; -const n0 = "com.amazonaws.sso"; -var AccessTokenType = [0, n0, _ATT, 8, 0]; -var SecretAccessKeyType = [0, n0, _SAKT, 8, 0]; -var SessionTokenType = [0, n0, _STT, 8, 0]; -var AccountInfo = [3, n0, _AI, 0, [_aI, _aN, _eA], [0, 0, 0]]; -var GetRoleCredentialsRequest = [ - 3, - n0, - _GRCR, - 0, - [_rN, _aI, _aT], - [ - [ - 0, - { - [_hQ]: _rn, - }, - ], - [ - 0, - { - [_hQ]: _ai, - }, - ], - [ - () => AccessTokenType, - { - [_hH]: _xasbt, - }, - ], - ], -]; -var GetRoleCredentialsResponse = [3, n0, _GRCRe, 0, [_rC], [[() => RoleCredentials, 0]]]; -var InvalidRequestException = [ - -3, - n0, - _IRE, - { - [_e]: _c, - [_hE]: 400, - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidRequestException, InvalidRequestException$1); -var ListAccountRolesRequest = [ - 3, - n0, - _LARR, - 0, - [_nT, _mR, _aT, _aI], - [ - [ - 0, - { - [_hQ]: _nt, - }, - ], - [ - 1, - { - [_hQ]: _mr, - }, - ], - [ - () => AccessTokenType, - { - [_hH]: _xasbt, - }, - ], - [ - 0, - { - [_hQ]: _ai, - }, - ], - ], -]; -var ListAccountRolesResponse = [3, n0, _LARRi, 0, [_nT, _rL], [0, () => RoleListType]]; -var ListAccountsRequest = [ - 3, - n0, - _LAR, - 0, - [_nT, _mR, _aT], - [ - [ - 0, - { - [_hQ]: _nt, - }, - ], - [ - 1, - { - [_hQ]: _mr, - }, - ], - [ - () => AccessTokenType, - { - [_hH]: _xasbt, - }, - ], - ], -]; -var ListAccountsResponse = [3, n0, _LARi, 0, [_nT, _aL], [0, () => AccountListType]]; -var LogoutRequest = [ - 3, - n0, - _LR, - 0, - [_aT], - [ - [ - () => AccessTokenType, - { - [_hH]: _xasbt, - }, - ], - ], -]; -var ResourceNotFoundException = [ - -3, - n0, - _RNFE, - { - [_e]: _c, - [_hE]: 404, - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1); -var RoleCredentials = [ - 3, - n0, - _RC, - 0, - [_aKI, _sAK, _sT, _ex], - [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1], -]; -var RoleInfo = [3, n0, _RI, 0, [_rN, _aI], [0, 0]]; -var TooManyRequestsException = [ - -3, - n0, - _TMRE, - { - [_e]: _c, - [_hE]: 429, - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(TooManyRequestsException, TooManyRequestsException$1); -var UnauthorizedException = [ - -3, - n0, - _UE, - { - [_e]: _c, - [_hE]: 401, - }, - [_m], - [0], -]; -schema.TypeRegistry.for(n0).registerError(UnauthorizedException, UnauthorizedException$1); -var __Unit = "unit"; -var SSOServiceException = [-3, _s, "SSOServiceException", 0, [], []]; -schema.TypeRegistry.for(_s).registerError(SSOServiceException, SSOServiceException$1); -var AccountListType = [1, n0, _ALT, 0, () => AccountInfo]; -var RoleListType = [1, n0, _RLT, 0, () => RoleInfo]; -var GetRoleCredentials = [ - 9, - n0, - _GRC, - { - [_h]: ["GET", "/federation/credentials", 200], - }, - () => GetRoleCredentialsRequest, - () => GetRoleCredentialsResponse, -]; -var ListAccountRoles = [ - 9, - n0, - _LARis, - { - [_h]: ["GET", "/assignment/roles", 200], - }, - () => ListAccountRolesRequest, - () => ListAccountRolesResponse, -]; -var ListAccounts = [ - 9, - n0, - _LA, - { - [_h]: ["GET", "/assignment/accounts", 200], - }, - () => ListAccountsRequest, - () => ListAccountsResponse, -]; -var Logout = [ - 9, - n0, - _L, - { - [_h]: ["POST", "/logout", 200], - }, - () => LogoutRequest, - () => __Unit, -]; - -class GetRoleCredentialsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("SWBPortalService", "GetRoleCredentials", {}) - .n("SSOClient", "GetRoleCredentialsCommand") - .sc(GetRoleCredentials) - .build() { -} - -class ListAccountRolesCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("SWBPortalService", "ListAccountRoles", {}) - .n("SSOClient", "ListAccountRolesCommand") - .sc(ListAccountRoles) - .build() { -} - -class ListAccountsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("SWBPortalService", "ListAccounts", {}) - .n("SSOClient", "ListAccountsCommand") - .sc(ListAccounts) - .build() { -} - -class LogoutCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("SWBPortalService", "Logout", {}) - .n("SSOClient", "LogoutCommand") - .sc(Logout) - .build() { -} - -const commands = { - GetRoleCredentialsCommand, - ListAccountRolesCommand, - ListAccountsCommand, - LogoutCommand, -}; -class SSO extends SSOClient { -} -smithyClient.createAggregatedClient(commands, SSO); - -const paginateListAccountRoles = core.createPaginator(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults"); - -const paginateListAccounts = core.createPaginator(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults"); - -Object.defineProperty(exports, "$Command", ({ - enumerable: true, - get: function () { return smithyClient.Command; } -})); -Object.defineProperty(exports, "__Client", ({ - enumerable: true, - get: function () { return smithyClient.Client; } -})); -exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand; -exports.InvalidRequestException = InvalidRequestException$1; -exports.ListAccountRolesCommand = ListAccountRolesCommand; -exports.ListAccountsCommand = ListAccountsCommand; -exports.LogoutCommand = LogoutCommand; -exports.ResourceNotFoundException = ResourceNotFoundException$1; -exports.SSO = SSO; -exports.SSOClient = SSOClient; -exports.SSOServiceException = SSOServiceException$1; -exports.TooManyRequestsException = TooManyRequestsException$1; -exports.UnauthorizedException = UnauthorizedException$1; -exports.paginateListAccountRoles = paginateListAccountRoles; -exports.paginateListAccounts = paginateListAccounts; +exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer; +exports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner; +exports.AwsSdkSigV4Signer = AwsSdkSigV4Signer; +exports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS; +exports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS; +exports.getBearerTokenEnvKey = getBearerTokenEnvKey; +exports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config; +exports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig; +exports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config; +exports.validateSigningProperties = validateSigningProperties; /***/ }), -/***/ 2696: +/***/ 998: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { +var __webpack_unused_export__; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const tslib_1 = __webpack_require__(1860); -const package_json_1 = tslib_1.__importDefault(__webpack_require__(2807)); -const core_1 = __webpack_require__(8704); -const util_user_agent_node_1 = __webpack_require__(1656); -const config_resolver_1 = __webpack_require__(9316); -const hash_node_1 = __webpack_require__(2711); -const middleware_retry_1 = __webpack_require__(9618); -const node_config_provider_1 = __webpack_require__(5704); -const node_http_handler_1 = __webpack_require__(1279); -const util_body_length_node_1 = __webpack_require__(3638); -const util_retry_1 = __webpack_require__(5518); -const runtimeConfig_shared_1 = __webpack_require__(8073); -const smithy_client_1 = __webpack_require__(1411); -const util_defaults_mode_node_1 = __webpack_require__(5435); -const smithy_client_2 = __webpack_require__(1411); -const getRuntimeConfig = (config) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config?.profile, - logger: clientSharedValues.logger, - }; - return { - ...clientSharedValues, - ...config, - runtime: "node", - defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - defaultUserAgentProvider: config?.defaultUserAgentProvider ?? - (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), - region: config?.region ?? - (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), - retryMode: config?.retryMode ?? - (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, - }, config), - sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), - }; -}; -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), -/***/ 8073: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +var propertyProvider = __webpack_require__(8857); +var sharedIniFileLoader = __webpack_require__(4964); +var client = __webpack_require__(5152); +var tokenProviders = __webpack_require__(5433); +const isSsoProfile = (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"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const core_1 = __webpack_require__(8704); -const protocols_1 = __webpack_require__(7288); -const core_2 = __webpack_require__(402); -const smithy_client_1 = __webpack_require__(1411); -const url_parser_1 = __webpack_require__(4494); -const util_base64_1 = __webpack_require__(8385); -const util_utf8_1 = __webpack_require__(1577); -const httpAuthSchemeProvider_1 = __webpack_require__(2041); -const endpointResolver_1 = __webpack_require__(3903); -const 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(), - protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.sso" }), - 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, +const SHOULD_FAIL_CREDENTIAL_CHAIN = false; +const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger, }) => { + let token; + const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; + if (ssoSession) { + try { + const _token = await tokenProviders.fromSso({ + profile, + filepath, + configFilepath, + ignoreCache, + })(); + token = { + accessToken: _token.token, + expiresAt: new Date(_token.expiration).toISOString(), + }; + } + catch (e) { + throw new propertyProvider.CredentialsProviderError(e.message, { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger, + }); + } + } + else { + try { + token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl); + } + catch (e) { + throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger, + }); + } + } + if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { + throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger, + }); + } + const { accessToken } = token; + const { SSOClient, GetRoleCredentialsCommand } = await Promise.resolve().then(function () { return __webpack_require__(1853); }); + const sso = ssoClient || + new SSOClient(Object.assign({}, clientConfig ?? {}, { + logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger, + region: clientConfig?.region ?? ssoRegion, + userAgentAppId: clientConfig?.userAgentAppId ?? callerClientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId, + })); + let ssoResp; + try { + ssoResp = await sso.send(new GetRoleCredentialsCommand({ + accountId: ssoAccountId, + roleName: ssoRoleName, + accessToken, + })); + } + catch (e) { + throw new propertyProvider.CredentialsProviderError(e, { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger, + }); + } + const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}, } = ssoResp; + if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { + throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger, + }); + } + const credentials = { + accessKeyId, + secretAccessKey, + sessionToken, + expiration: new Date(expiration), + ...(credentialScope && { credentialScope }), + ...(accountId && { accountId }), }; + if (ssoSession) { + client.setCredentialFeature(credentials, "CREDENTIALS_SSO", "s"); + } + else { + client.setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u"); + } + return credentials; }; -exports.getRuntimeConfig = getRuntimeConfig; + +const validateSsoProfile = (profile, logger) => { + const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; + if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { + throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` + + `"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger }); + } + return profile; +}; + +const fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => { + init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO"); + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; + const { ssoClient } = init; + const profileName = sharedIniFileLoader.getProfileName({ + profile: init.profile ?? callerClientConfig?.profile, + }); + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + const profiles = await sharedIniFileLoader.parseKnownFiles(init); + const profile = profiles[profileName]; + if (!profile) { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger }); + } + if (!isSsoProfile(profile)) { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, { + logger: init.logger, + }); + } + if (profile?.sso_session) { + const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init); + const session = ssoSessions[profile.sso_session]; + const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; + if (ssoRegion && ssoRegion !== session.sso_region) { + throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, { + tryNextLink: false, + logger: init.logger, + }); + } + if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { + throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, { + tryNextLink: false, + logger: init.logger, + }); + } + profile.sso_region = session.sso_region; + profile.sso_start_url = session.sso_start_url; + } + const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger); + return resolveSSOCredentials({ + ssoStartUrl: sso_start_url, + ssoSession: sso_session, + ssoAccountId: sso_account_id, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + ssoClient: ssoClient, + clientConfig: init.clientConfig, + parentClientConfig: init.parentClientConfig, + callerClientConfig: init.callerClientConfig, + profile: profileName, + filepath: init.filepath, + configFilepath: init.configFilepath, + ignoreCache: init.ignoreCache, + logger: init.logger, + }); + } + else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { + throw new propertyProvider.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + + '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger }); + } + else { + return resolveSSOCredentials({ + ssoStartUrl, + ssoSession, + ssoAccountId, + ssoRegion, + ssoRoleName, + ssoClient, + clientConfig: init.clientConfig, + parentClientConfig: init.parentClientConfig, + callerClientConfig: init.callerClientConfig, + profile: profileName, + filepath: init.filepath, + configFilepath: init.configFilepath, + ignoreCache: init.ignoreCache, + logger: init.logger, + }); + } +}; + +exports.fromSSO = fromSSO; +__webpack_unused_export__ = isSsoProfile; +__webpack_unused_export__ = validateSsoProfile; /***/ }), -/***/ 7523: +/***/ 1853: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -var protocolHttp = __webpack_require__(2356); -var core = __webpack_require__(402); -var propertyProvider = __webpack_require__(8857); -var client = __webpack_require__(5152); -var signatureV4 = __webpack_require__(5118); +var sso = __webpack_require__(2579); -const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined; -const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); -const isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000; +exports.GetRoleCredentialsCommand = sso.GetRoleCredentialsCommand; +exports.SSOClient = sso.SSOClient; -const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { - const clockTimeInMs = Date.parse(clockTime); - if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { - return clockTimeInMs - Date.now(); - } - return currentSystemClockOffset; -}; -const throwSigningPropertyError = (name, property) => { - if (!property) { - throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); - } - return property; -}; -const 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; +/***/ }), + +/***/ 7452: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0; +const core_1 = __webpack_require__(8704); +const util_middleware_1 = __webpack_require__(6324); +const defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => { return { - config, - signer, - signingRegion, - signingRegionSet, - signingName, + 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`"); + })(), }; }; -class AwsSdkSigV4Signer { - async sign(httpRequest, identity, signingProperties) { - if (!protocolHttp.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; - } +exports.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", + }; +} +const defaultSSOHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "GetRoleCredentials": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; } - const signedRequest = await signer.sign(httpRequest, { - signingDate: getSkewCorrectedDate(config.systemClockOffset), - signingRegion: 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; - }; - } - successHandler(httpResponse, signingProperties) { - const dateHeader = getDateHeader(httpResponse); - if (dateHeader) { - const config = throwSigningPropertyError("config", signingProperties.config); - config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); } } -} -const AWSSDKSigV4Signer = AwsSdkSigV4Signer; + return options; +}; +exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider; +const resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return Object.assign(config_0, { + authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), + }); +}; +exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; -class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer { - async sign(httpRequest, identity, signingProperties) { - if (!protocolHttp.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; - } -} -const getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; +/***/ }), -const getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; +/***/ 5074: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { -const NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; -const NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; -const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { - environmentVariableSelector: (env, options) => { - if (options?.signingName) { - const bearerTokenKey = getBearerTokenEnvKey(options.signingName); - if (bearerTokenKey in env) - return ["httpBearerAuth"]; - } - if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) - return undefined; - return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); - }, - configFileSelector: (profile) => { - if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) - return undefined; - return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); - }, - default: [], + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = __webpack_require__(3068); +const util_endpoints_2 = __webpack_require__(9674); +const ruleset_1 = __webpack_require__(203); +const cache = new util_endpoints_2.EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"], +}); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + })); }; +exports.defaultEndpointResolver = defaultEndpointResolver; +util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -const resolveAwsSdkSigV4AConfig = (config) => { - config.sigv4aSigningRegionSet = core.normalizeProvider(config.sigv4aSigningRegionSet); - return config; + +/***/ }), + +/***/ 203: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ruleSet = void 0; +const u = "required", v = "fn", w = "argv", x = "ref"; +const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, type: "string" }, j = { [u]: true, default: false, type: "boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }]; +const _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 }, + ], }; -const 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 propertyProvider.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 propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", { - tryNextLink: true, - }); - }, - default: undefined, +exports.ruleSet = _data; + + +/***/ }), + +/***/ 2579: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +var middlewareHostHeader = __webpack_require__(2590); +var middlewareLogger = __webpack_require__(5242); +var middlewareRecursionDetection = __webpack_require__(1568); +var middlewareUserAgent = __webpack_require__(2959); +var configResolver = __webpack_require__(9316); +var core = __webpack_require__(402); +var schema = __webpack_require__(6890); +var middlewareContentLength = __webpack_require__(7212); +var middlewareEndpoint = __webpack_require__(99); +var middlewareRetry = __webpack_require__(9618); +var smithyClient = __webpack_require__(1411); +var httpAuthSchemeProvider = __webpack_require__(7452); +var runtimeConfig = __webpack_require__(5541); +var regionConfigResolver = __webpack_require__(6463); +var protocolHttp = __webpack_require__(2356); +var schemas_0 = __webpack_require__(2167); +var errors = __webpack_require__(4483); +var SSOServiceException = __webpack_require__(9849); + +const resolveClientEndpointParameters = (options) => { + return Object.assign(options, { + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "awsssoportal", + }); +}; +const commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, }; -const resolveAwsSdkSigV4Config = (config) => { - let inputCredentials = config.credentials; - let isUserSupplied = !!config.credentials; - let resolvedCredentials = undefined; - Object.defineProperty(config, "credentials", { - set(credentials) { - if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { - isUserSupplied = true; - } - inputCredentials = credentials; - const memoizedProvider = normalizeCredentialProvider(config, { - credentials: inputCredentials, - credentialDefaultProvider: config.credentialDefaultProvider, - }); - const boundProvider = bindCallerConfig(config, memoizedProvider); - if (isUserSupplied && !boundProvider.attributed) { - resolvedCredentials = async (options) => boundProvider(options).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_CODE", "e")); - resolvedCredentials.memoized = boundProvider.memoized; - resolvedCredentials.configBound = boundProvider.configBound; - resolvedCredentials.attributed = true; +const getHttpAuthExtensionConfiguration = (runtimeConfig) => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme) { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); } else { - resolvedCredentials = boundProvider; + _httpAuthSchemes.splice(index, 1, httpAuthScheme); } }, - get() { - return resolvedCredentials; + httpAuthSchemes() { + return _httpAuthSchemes; }, - enumerable: true, - configurable: true, - }); - config.credentials = inputCredentials; - const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config; - let signer; - if (config.signer) { - signer = core.normalizeProvider(config.signer); - } - else if (config.regionInfoProvider) { - signer = () => core.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: config.credentials, - region: config.signingRegion, - service: config.signingName, - sha256, - uriEscapePath: signingEscapePath, - }; - const SignerCtor = config.signerConstructor || signatureV4.SignatureV4; - return new SignerCtor(params); - }); - } - else { - signer = async (authScheme) => { - authScheme = Object.assign({}, { - name: "sigv4", - signingName: config.signingName || config.defaultSigningName, - signingRegion: await core.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: config.credentials, - region: config.signingRegion, - service: config.signingName, - sha256, - uriEscapePath: signingEscapePath, - }; - const SignerCtor = config.signerConstructor || signatureV4.SignatureV4; - return new SignerCtor(params); - }; - } - const resolvedConfig = Object.assign(config, { - systemClockOffset, - signingEscapePath, - signer, - }); - return resolvedConfig; + setHttpAuthSchemeProvider(httpAuthSchemeProvider) { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider() { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; + }, + }; +}; +const resolveHttpAuthRuntimeConfig = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; }; -const resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; -function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider, }) { - let credentialsProvider; - if (credentials) { - if (!credentials?.memoized) { - credentialsProvider = core.memoizeIdentityProvider(credentials, core.isIdentityExpired, core.doesIdentityRequireRefresh); - } - else { - credentialsProvider = credentials; - } - } - else { - if (credentialDefaultProvider) { - credentialsProvider = core.normalizeProvider(credentialDefaultProvider(Object.assign({}, config, { - parentClientConfig: config, - }))); - } - else { - credentialsProvider = async () => { - throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured."); - }; - } - } - credentialsProvider.memoized = true; - return credentialsProvider; -} -function bindCallerConfig(config, credentialsProvider) { - if (credentialsProvider.configBound) { - return credentialsProvider; - } - const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config }); - fn.memoized = credentialsProvider.memoized; - fn.configBound = true; - return fn; -} - -exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer; -exports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner; -exports.AwsSdkSigV4Signer = AwsSdkSigV4Signer; -exports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS; -exports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS; -exports.getBearerTokenEnvKey = getBearerTokenEnvKey; -exports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config; -exports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig; -exports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config; -exports.validateSigningProperties = validateSigningProperties; - - -/***/ }), - -/***/ 998: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -var __webpack_unused_export__; - - -var propertyProvider = __webpack_require__(8857); -var sharedIniFileLoader = __webpack_require__(4964); -var client = __webpack_require__(5152); -var tokenProviders = __webpack_require__(5433); -const isSsoProfile = (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"); +const resolveRuntimeExtensions = (runtimeConfig, extensions) => { + const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); +}; -const SHOULD_FAIL_CREDENTIAL_CHAIN = false; -const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger, }) => { - let token; - const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; - if (ssoSession) { - try { - const _token = await tokenProviders.fromSso({ - profile, - filepath, - configFilepath, - ignoreCache, - })(); - token = { - accessToken: _token.token, - expiresAt: new Date(_token.expiration).toISOString(), - }; - } - catch (e) { - throw new propertyProvider.CredentialsProviderError(e.message, { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger, - }); - } - } - else { - try { - token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl); - } - catch (e) { - throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger, - }); - } - } - if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { - throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger, - }); - } - const { accessToken } = token; - const { SSOClient, GetRoleCredentialsCommand } = await Promise.resolve().then(function () { return __webpack_require__(6553); }); - const sso = ssoClient || - new SSOClient(Object.assign({}, clientConfig ?? {}, { - logger: clientConfig?.logger ?? parentClientConfig?.logger, - region: clientConfig?.region ?? ssoRegion, - userAgentAppId: clientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId, - })); - let ssoResp; - try { - ssoResp = await sso.send(new GetRoleCredentialsCommand({ - accountId: ssoAccountId, - roleName: ssoRoleName, - accessToken, +class SSOClient extends smithyClient.Client { + config; + constructor(...[configuration]) { + const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); + super(_config_0); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); + const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); + const _config_4 = configResolver.resolveRegionConfig(_config_3); + const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); + const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); + const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + this.config = _config_8; + this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); + this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); + this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); + this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); + this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); + this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), })); + this.middlewareStack.use(core.getHttpSigningPlugin(this.config)); } - catch (e) { - throw new propertyProvider.CredentialsProviderError(e, { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger, - }); - } - const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}, } = ssoResp; - if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { - throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger, - }); - } - const credentials = { - accessKeyId, - secretAccessKey, - sessionToken, - expiration: new Date(expiration), - ...(credentialScope && { credentialScope }), - ...(accountId && { accountId }), - }; - if (ssoSession) { - client.setCredentialFeature(credentials, "CREDENTIALS_SSO", "s"); - } - else { - client.setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u"); + destroy() { + super.destroy(); } - return credentials; -}; +} -const validateSsoProfile = (profile, logger) => { - const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; - if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { - throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` + - `"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger }); - } - return profile; -}; +class GetRoleCredentialsCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("SWBPortalService", "GetRoleCredentials", {}) + .n("SSOClient", "GetRoleCredentialsCommand") + .sc(schemas_0.GetRoleCredentials$) + .build() { +} -const fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => { - init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO"); - const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; - const { ssoClient } = init; - const profileName = sharedIniFileLoader.getProfileName({ - profile: init.profile ?? callerClientConfig?.profile, - }); - if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { - const profiles = await sharedIniFileLoader.parseKnownFiles(init); - const profile = profiles[profileName]; - if (!profile) { - throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger }); - } - if (!isSsoProfile(profile)) { - throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, { - logger: init.logger, - }); - } - if (profile?.sso_session) { - const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init); - const session = ssoSessions[profile.sso_session]; - const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; - if (ssoRegion && ssoRegion !== session.sso_region) { - throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, { - tryNextLink: false, - logger: init.logger, - }); - } - if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { - throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, { - tryNextLink: false, - logger: init.logger, - }); - } - profile.sso_region = session.sso_region; - profile.sso_start_url = session.sso_start_url; - } - const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger); - return resolveSSOCredentials({ - ssoStartUrl: sso_start_url, - ssoSession: sso_session, - ssoAccountId: sso_account_id, - ssoRegion: sso_region, - ssoRoleName: sso_role_name, - ssoClient: ssoClient, - clientConfig: init.clientConfig, - parentClientConfig: init.parentClientConfig, - profile: profileName, - filepath: init.filepath, - configFilepath: init.configFilepath, - ignoreCache: init.ignoreCache, - logger: init.logger, +const commands = { + GetRoleCredentialsCommand, +}; +class SSO extends SSOClient { +} +smithyClient.createAggregatedClient(commands, SSO); + +exports.$Command = smithyClient.Command; +exports.__Client = smithyClient.Client; +exports.SSOServiceException = SSOServiceException.SSOServiceException; +exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand; +exports.SSO = SSO; +exports.SSOClient = SSOClient; +Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: schemas_0['__proto__'] + }); + +Object.keys(schemas_0).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k]; +}); +Object.prototype.hasOwnProperty.call(errors, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: errors['__proto__'] + }); + +Object.keys(errors).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k]; +}); + + +/***/ }), + +/***/ 9849: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SSOServiceException = exports.__ServiceException = void 0; +const smithy_client_1 = __webpack_require__(1411); +Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); +class SSOServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, SSOServiceException.prototype); + } +} +exports.SSOServiceException = SSOServiceException; + + +/***/ }), + +/***/ 4483: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UnauthorizedException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.InvalidRequestException = void 0; +const SSOServiceException_1 = __webpack_require__(9849); +class InvalidRequestException extends SSOServiceException_1.SSOServiceException { + name = "InvalidRequestException"; + $fault = "client"; + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts, }); + Object.setPrototypeOf(this, InvalidRequestException.prototype); } - else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { - throw new propertyProvider.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + - '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger }); +} +exports.InvalidRequestException = InvalidRequestException; +class ResourceNotFoundException extends SSOServiceException_1.SSOServiceException { + name = "ResourceNotFoundException"; + $fault = "client"; + constructor(opts) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); } - else { - return resolveSSOCredentials({ - ssoStartUrl, - ssoSession, - ssoAccountId, - ssoRegion, - ssoRoleName, - ssoClient, - clientConfig: init.clientConfig, - parentClientConfig: init.parentClientConfig, - profile: profileName, - filepath: init.filepath, - configFilepath: init.configFilepath, - ignoreCache: init.ignoreCache, - logger: init.logger, +} +exports.ResourceNotFoundException = ResourceNotFoundException; +class TooManyRequestsException extends SSOServiceException_1.SSOServiceException { + name = "TooManyRequestsException"; + $fault = "client"; + constructor(opts) { + super({ + name: "TooManyRequestsException", + $fault: "client", + ...opts, }); + Object.setPrototypeOf(this, TooManyRequestsException.prototype); } -}; +} +exports.TooManyRequestsException = TooManyRequestsException; +class UnauthorizedException extends SSOServiceException_1.SSOServiceException { + name = "UnauthorizedException"; + $fault = "client"; + constructor(opts) { + super({ + name: "UnauthorizedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, UnauthorizedException.prototype); + } +} +exports.UnauthorizedException = UnauthorizedException; -exports.fromSSO = fromSSO; -__webpack_unused_export__ = isSsoProfile; -__webpack_unused_export__ = validateSsoProfile; + +/***/ }), + +/***/ 5541: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRuntimeConfig = void 0; +const tslib_1 = __webpack_require__(1860); +const package_json_1 = tslib_1.__importDefault(__webpack_require__(9955)); +const core_1 = __webpack_require__(8704); +const util_user_agent_node_1 = __webpack_require__(1656); +const config_resolver_1 = __webpack_require__(9316); +const hash_node_1 = __webpack_require__(2711); +const middleware_retry_1 = __webpack_require__(9618); +const node_config_provider_1 = __webpack_require__(5704); +const node_http_handler_1 = __webpack_require__(2764); +const smithy_client_1 = __webpack_require__(1411); +const util_body_length_node_1 = __webpack_require__(3638); +const util_defaults_mode_node_1 = __webpack_require__(5435); +const util_retry_1 = __webpack_require__(5518); +const runtimeConfig_shared_1 = __webpack_require__(3082); +const getRuntimeConfig = (config) => { + (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + (0, core_1.emitWarningIfUnsupportedVersion)(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: config?.region ?? + (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? + (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, + }, config), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 6553: +/***/ 3082: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRuntimeConfig = void 0; +const core_1 = __webpack_require__(8704); +const protocols_1 = __webpack_require__(7288); +const core_2 = __webpack_require__(402); +const smithy_client_1 = __webpack_require__(1411); +const url_parser_1 = __webpack_require__(4494); +const util_base64_1 = __webpack_require__(8385); +const util_utf8_1 = __webpack_require__(1577); +const httpAuthSchemeProvider_1 = __webpack_require__(7452); +const endpointResolver_1 = __webpack_require__(5074); +const schemas_0_1 = __webpack_require__(2167); +const 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(), + protocol: config?.protocol ?? protocols_1.AwsRestJsonProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.sso", + errorTypeRegistries: schemas_0_1.errorTypeRegistries, + version: "2019-06-10", + serviceTarget: "SWBPortalService", + }, + 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, + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; + -var clientSso = __webpack_require__(2054); +/***/ }), +/***/ 2167: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { -Object.defineProperty(exports, "GetRoleCredentialsCommand", ({ - enumerable: true, - get: function () { return clientSso.GetRoleCredentialsCommand; } -})); -Object.defineProperty(exports, "SSOClient", ({ - enumerable: true, - get: function () { return clientSso.SSOClient; } -})); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.GetRoleCredentials$ = exports.RoleCredentials$ = exports.GetRoleCredentialsResponse$ = exports.GetRoleCredentialsRequest$ = exports.errorTypeRegistries = exports.UnauthorizedException$ = exports.TooManyRequestsException$ = exports.ResourceNotFoundException$ = exports.InvalidRequestException$ = exports.SSOServiceException$ = void 0; +const _ATT = "AccessTokenType"; +const _GRC = "GetRoleCredentials"; +const _GRCR = "GetRoleCredentialsRequest"; +const _GRCRe = "GetRoleCredentialsResponse"; +const _IRE = "InvalidRequestException"; +const _RC = "RoleCredentials"; +const _RNFE = "ResourceNotFoundException"; +const _SAKT = "SecretAccessKeyType"; +const _STT = "SessionTokenType"; +const _TMRE = "TooManyRequestsException"; +const _UE = "UnauthorizedException"; +const _aI = "accountId"; +const _aKI = "accessKeyId"; +const _aT = "accessToken"; +const _ai = "account_id"; +const _c = "client"; +const _e = "error"; +const _ex = "expiration"; +const _h = "http"; +const _hE = "httpError"; +const _hH = "httpHeader"; +const _hQ = "httpQuery"; +const _m = "message"; +const _rC = "roleCredentials"; +const _rN = "roleName"; +const _rn = "role_name"; +const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sso"; +const _sAK = "secretAccessKey"; +const _sT = "sessionToken"; +const _xasbt = "x-amz-sso_bearer_token"; +const n0 = "com.amazonaws.sso"; +const schema_1 = __webpack_require__(6890); +const errors_1 = __webpack_require__(4483); +const SSOServiceException_1 = __webpack_require__(9849); +const _s_registry = schema_1.TypeRegistry.for(_s); +exports.SSOServiceException$ = [-3, _s, "SSOServiceException", 0, [], []]; +_s_registry.registerError(exports.SSOServiceException$, SSOServiceException_1.SSOServiceException); +const n0_registry = schema_1.TypeRegistry.for(n0); +exports.InvalidRequestException$ = [-3, n0, _IRE, { [_e]: _c, [_hE]: 400 }, [_m], [0]]; +n0_registry.registerError(exports.InvalidRequestException$, errors_1.InvalidRequestException); +exports.ResourceNotFoundException$ = [-3, n0, _RNFE, { [_e]: _c, [_hE]: 404 }, [_m], [0]]; +n0_registry.registerError(exports.ResourceNotFoundException$, errors_1.ResourceNotFoundException); +exports.TooManyRequestsException$ = [-3, n0, _TMRE, { [_e]: _c, [_hE]: 429 }, [_m], [0]]; +n0_registry.registerError(exports.TooManyRequestsException$, errors_1.TooManyRequestsException); +exports.UnauthorizedException$ = [-3, n0, _UE, { [_e]: _c, [_hE]: 401 }, [_m], [0]]; +n0_registry.registerError(exports.UnauthorizedException$, errors_1.UnauthorizedException); +exports.errorTypeRegistries = [_s_registry, n0_registry]; +var AccessTokenType = [0, n0, _ATT, 8, 0]; +var SecretAccessKeyType = [0, n0, _SAKT, 8, 0]; +var SessionTokenType = [0, n0, _STT, 8, 0]; +exports.GetRoleCredentialsRequest$ = [ + 3, + n0, + _GRCR, + 0, + [_rN, _aI, _aT], + [ + [0, { [_hQ]: _rn }], + [0, { [_hQ]: _ai }], + [() => AccessTokenType, { [_hH]: _xasbt }], + ], + 3, +]; +exports.GetRoleCredentialsResponse$ = [ + 3, + n0, + _GRCRe, + 0, + [_rC], + [[() => exports.RoleCredentials$, 0]], +]; +exports.RoleCredentials$ = [ + 3, + n0, + _RC, + 0, + [_aKI, _sAK, _sT, _ex], + [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1], +]; +exports.GetRoleCredentials$ = [ + 9, + n0, + _GRC, + { [_h]: ["GET", "/federation/credentials", 200] }, + () => exports.GetRoleCredentialsRequest$, + () => exports.GetRoleCredentialsResponse$, +]; /***/ }), @@ -1282,7 +1204,7 @@ var client = __webpack_require__(5152); var httpAuthSchemes = __webpack_require__(7523); var propertyProvider = __webpack_require__(8857); var sharedIniFileLoader = __webpack_require__(4964); -var fs = __webpack_require__(9896); +var node_fs = __webpack_require__(3024); const fromEnvSigningName = ({ logger, signingName } = {}) => async () => { logger?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"); @@ -1301,9 +1223,9 @@ const fromEnvSigningName = ({ logger, signingName } = {}) => async () => { const EXPIRE_WINDOW_MS = 5 * 60 * 1000; const REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; -const getSsoOidcClient = async (ssoRegion, init = {}) => { - const { SSOOIDCClient } = await __webpack_require__.e(/* import() */ 443).then(__webpack_require__.t.bind(__webpack_require__, 9443, 19)); - const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop]; +const getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => { + const { SSOOIDCClient } = await __webpack_require__.e(/* import() */ 443).then(__webpack_require__.t.bind(__webpack_require__, 9443, 23)); + const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop]; const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, { region: ssoRegion ?? init.clientConfig?.region, logger: coalesce("logger"), @@ -1312,9 +1234,9 @@ const getSsoOidcClient = async (ssoRegion, init = {}) => { return ssoOidcClient; }; -const getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}) => { - const { CreateTokenCommand } = await __webpack_require__.e(/* import() */ 443).then(__webpack_require__.t.bind(__webpack_require__, 9443, 19)); - const ssoOidcClient = await getSsoOidcClient(ssoRegion, init); +const getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => { + const { CreateTokenCommand } = await __webpack_require__.e(/* import() */ 443).then(__webpack_require__.t.bind(__webpack_require__, 9443, 23)); + const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig); return ssoOidcClient.send(new CreateTokenCommand({ clientId: ssoToken.clientId, clientSecret: ssoToken.clientSecret, @@ -1335,7 +1257,7 @@ const validateTokenKey = (key, value, forRefresh = false) => { } }; -const { writeFile } = fs.promises; +const { writeFile } = node_fs.promises; const writeSSOTokenToFile = (id, ssoToken) => { const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id); const tokenString = JSON.stringify(ssoToken, null, 2); @@ -1343,14 +1265,7 @@ const writeSSOTokenToFile = (id, ssoToken) => { }; const lastRefreshAttemptTime = new Date(0); -const fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => { - const init = { - ..._init, - parentClientConfig: { - ...callerClientConfig, - ..._init.parentClientConfig, - }, - }; +const fromSso = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/token-providers - fromSso"); const profiles = await sharedIniFileLoader.parseKnownFiles(init); const profileName = sharedIniFileLoader.getProfileName({ @@ -1399,7 +1314,7 @@ const fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => { validateTokenKey("refreshToken", ssoToken.refreshToken, true); try { lastRefreshAttemptTime.setTime(Date.now()); - const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init); + const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig); validateTokenKey("accessToken", newSsoOidcToken.accessToken); validateTokenKey("expiresIn", newSsoOidcToken.expiresIn); const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000); @@ -1442,13 +1357,6 @@ exports.fromStatic = fromStatic; exports.nodeProvider = nodeProvider; -/***/ }), - -/***/ 2807: -/***/ ((module) => { - -module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-sso","description":"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native","version":"3.935.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.935.0","@aws-sdk/middleware-host-header":"3.930.0","@aws-sdk/middleware-logger":"3.930.0","@aws-sdk/middleware-recursion-detection":"3.933.0","@aws-sdk/middleware-user-agent":"3.935.0","@aws-sdk/region-config-resolver":"3.930.0","@aws-sdk/types":"3.930.0","@aws-sdk/util-endpoints":"3.930.0","@aws-sdk/util-user-agent-browser":"3.930.0","@aws-sdk/util-user-agent-node":"3.935.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0","tslib":"^2.6.2"},"devDependencies":{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"engines":{"node":">=18.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-sso","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sso"}}'); - /***/ }) }; diff --git a/dist/index.js b/dist/index.js index e69f67d..d80a060 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3459,10 +3459,9 @@ const util_middleware_1 = __nccwpck_require__(6324); const defaultCloudFormationHttpAuthSchemeParametersProvider = 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`"); - })(), + region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), }; }; exports.defaultCloudFormationHttpAuthSchemeParametersProvider = defaultCloudFormationHttpAuthSchemeParametersProvider; @@ -3564,7 +3563,10 @@ var httpAuthSchemeProvider = __nccwpck_require__(398); var runtimeConfig = __nccwpck_require__(7079); var regionConfigResolver = __nccwpck_require__(6463); var protocolHttp = __nccwpck_require__(2356); +var schemas_0 = __nccwpck_require__(3389); var utilWaiter = __nccwpck_require__(5290); +var errors = __nccwpck_require__(4689); +var CloudFormationServiceException = __nccwpck_require__(22); const resolveClientEndpointParameters = (options) => { return Object.assign(options, { @@ -3660,6615 +3662,9246 @@ class CloudFormationClient extends smithyClient.Client { } } -let CloudFormationServiceException$1 = class CloudFormationServiceException extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, CloudFormationServiceException.prototype); - } -}; +class ActivateOrganizationsAccessCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "ActivateOrganizationsAccess", {}) + .n("CloudFormationClient", "ActivateOrganizationsAccessCommand") + .sc(schemas_0.ActivateOrganizationsAccess$) + .build() { +} -let InvalidOperationException$1 = class InvalidOperationException extends CloudFormationServiceException$1 { - name = "InvalidOperationException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "InvalidOperationException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidOperationException.prototype); - this.Message = opts.Message; - } -}; -let OperationNotFoundException$1 = class OperationNotFoundException extends CloudFormationServiceException$1 { - name = "OperationNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "OperationNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, OperationNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let CFNRegistryException$1 = class CFNRegistryException extends CloudFormationServiceException$1 { - name = "CFNRegistryException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "CFNRegistryException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, CFNRegistryException.prototype); - this.Message = opts.Message; - } -}; -let TypeNotFoundException$1 = class TypeNotFoundException extends CloudFormationServiceException$1 { - name = "TypeNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "TypeNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, TypeNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let AlreadyExistsException$1 = class AlreadyExistsException extends CloudFormationServiceException$1 { - name = "AlreadyExistsException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "AlreadyExistsException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, AlreadyExistsException.prototype); - this.Message = opts.Message; - } -}; -let TypeConfigurationNotFoundException$1 = class TypeConfigurationNotFoundException extends CloudFormationServiceException$1 { - name = "TypeConfigurationNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "TypeConfigurationNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, TypeConfigurationNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let TokenAlreadyExistsException$1 = class TokenAlreadyExistsException extends CloudFormationServiceException$1 { - name = "TokenAlreadyExistsException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "TokenAlreadyExistsException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, TokenAlreadyExistsException.prototype); - this.Message = opts.Message; - } -}; -let ChangeSetNotFoundException$1 = class ChangeSetNotFoundException extends CloudFormationServiceException$1 { - name = "ChangeSetNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "ChangeSetNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ChangeSetNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let InsufficientCapabilitiesException$1 = class InsufficientCapabilitiesException extends CloudFormationServiceException$1 { - name = "InsufficientCapabilitiesException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "InsufficientCapabilitiesException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InsufficientCapabilitiesException.prototype); - this.Message = opts.Message; - } -}; -let LimitExceededException$1 = class LimitExceededException extends CloudFormationServiceException$1 { - name = "LimitExceededException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "LimitExceededException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, LimitExceededException.prototype); - this.Message = opts.Message; - } -}; -let ConcurrentResourcesLimitExceededException$1 = class ConcurrentResourcesLimitExceededException extends CloudFormationServiceException$1 { - name = "ConcurrentResourcesLimitExceededException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "ConcurrentResourcesLimitExceededException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ConcurrentResourcesLimitExceededException.prototype); - this.Message = opts.Message; - } -}; -let OperationIdAlreadyExistsException$1 = class OperationIdAlreadyExistsException extends CloudFormationServiceException$1 { - name = "OperationIdAlreadyExistsException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "OperationIdAlreadyExistsException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, OperationIdAlreadyExistsException.prototype); - this.Message = opts.Message; - } -}; -let OperationInProgressException$1 = class OperationInProgressException extends CloudFormationServiceException$1 { - name = "OperationInProgressException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "OperationInProgressException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, OperationInProgressException.prototype); - this.Message = opts.Message; - } -}; -let StackSetNotFoundException$1 = class StackSetNotFoundException extends CloudFormationServiceException$1 { - name = "StackSetNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "StackSetNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, StackSetNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let StaleRequestException$1 = class StaleRequestException extends CloudFormationServiceException$1 { - name = "StaleRequestException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "StaleRequestException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, StaleRequestException.prototype); - this.Message = opts.Message; - } -}; -let CreatedButModifiedException$1 = class CreatedButModifiedException extends CloudFormationServiceException$1 { - name = "CreatedButModifiedException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "CreatedButModifiedException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, CreatedButModifiedException.prototype); - this.Message = opts.Message; - } -}; -let NameAlreadyExistsException$1 = class NameAlreadyExistsException extends CloudFormationServiceException$1 { - name = "NameAlreadyExistsException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "NameAlreadyExistsException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, NameAlreadyExistsException.prototype); - this.Message = opts.Message; - } -}; -let InvalidChangeSetStatusException$1 = class InvalidChangeSetStatusException extends CloudFormationServiceException$1 { - name = "InvalidChangeSetStatusException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "InvalidChangeSetStatusException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidChangeSetStatusException.prototype); - this.Message = opts.Message; - } -}; -let GeneratedTemplateNotFoundException$1 = class GeneratedTemplateNotFoundException extends CloudFormationServiceException$1 { - name = "GeneratedTemplateNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "GeneratedTemplateNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, GeneratedTemplateNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let StackSetNotEmptyException$1 = class StackSetNotEmptyException extends CloudFormationServiceException$1 { - name = "StackSetNotEmptyException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "StackSetNotEmptyException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, StackSetNotEmptyException.prototype); - this.Message = opts.Message; - } -}; -let ResourceScanNotFoundException$1 = class ResourceScanNotFoundException extends CloudFormationServiceException$1 { - name = "ResourceScanNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "ResourceScanNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ResourceScanNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let StackInstanceNotFoundException$1 = class StackInstanceNotFoundException extends CloudFormationServiceException$1 { - name = "StackInstanceNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "StackInstanceNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, StackInstanceNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let StackRefactorNotFoundException$1 = class StackRefactorNotFoundException extends CloudFormationServiceException$1 { - name = "StackRefactorNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "StackRefactorNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, StackRefactorNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let HookResultNotFoundException$1 = class HookResultNotFoundException extends CloudFormationServiceException$1 { - name = "HookResultNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "HookResultNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, HookResultNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let StackNotFoundException$1 = class StackNotFoundException extends CloudFormationServiceException$1 { - name = "StackNotFoundException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "StackNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, StackNotFoundException.prototype); - this.Message = opts.Message; - } -}; -let ResourceScanInProgressException$1 = class ResourceScanInProgressException extends CloudFormationServiceException$1 { - name = "ResourceScanInProgressException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "ResourceScanInProgressException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ResourceScanInProgressException.prototype); - this.Message = opts.Message; - } -}; -let InvalidStateTransitionException$1 = class InvalidStateTransitionException extends CloudFormationServiceException$1 { - name = "InvalidStateTransitionException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "InvalidStateTransitionException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidStateTransitionException.prototype); - this.Message = opts.Message; - } -}; -let OperationStatusCheckFailedException$1 = class OperationStatusCheckFailedException extends CloudFormationServiceException$1 { - name = "OperationStatusCheckFailedException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "OperationStatusCheckFailedException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, OperationStatusCheckFailedException.prototype); - this.Message = opts.Message; - } -}; -let ResourceScanLimitExceededException$1 = class ResourceScanLimitExceededException extends CloudFormationServiceException$1 { - name = "ResourceScanLimitExceededException"; - $fault = "client"; - Message; - constructor(opts) { - super({ - name: "ResourceScanLimitExceededException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ResourceScanLimitExceededException.prototype); - this.Message = opts.Message; - } -}; +class ActivateTypeCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "ActivateType", {}) + .n("CloudFormationClient", "ActivateTypeCommand") + .sc(schemas_0.ActivateType$) + .build() { +} -const _A = "Arn"; -const _AC = "AfterContext"; -const _ACT = "AttributeChangeType"; -const _AD = "AutoDeployment"; -const _AEE = "AlreadyExistsException"; -const _AFT = "AccountFilterType"; -const _AGR = "AccountGateResult"; -const _AL = "AccountLimit"; -const _ALL = "AccountLimitList"; -const _ALc = "AccountLimits"; -const _ALn = "AnnotationList"; -const _AN = "AnnotationName"; -const _AOA = "ActivateOrganizationsAccess"; -const _AOAI = "ActivateOrganizationsAccessInput"; -const _AOAO = "ActivateOrganizationsAccessOutput"; -const _AP = "ActualProperties"; -const _AR = "AddResources"; -const _ARARN = "AdministrationRoleARN"; -const _AT = "ActivateType"; -const _ATAC = "AcceptTermsAndConditions"; -const _ATI = "ActivateTypeInput"; -const _ATO = "ActivateTypeOutput"; -const _AU = "AutoUpdate"; -const _AUc = "AccountsUrl"; -const _AV = "ActualValue"; -const _AVF = "AfterValueFrom"; -const _AVf = "AfterValue"; -const _AVl = "AllowedValues"; -const _Ac = "Accounts"; -const _Acc = "Account"; -const _Act = "Action"; -const _Acti = "Active"; -const _Al = "Alias"; -const _An = "Annotation"; -const _Ann = "Annotations"; -const _At = "Attribute"; -const _BC = "BeforeContext"; -const _BDTC = "BatchDescribeTypeConfigurations"; -const _BDTCE = "BatchDescribeTypeConfigurationsError"; -const _BDTCEa = "BatchDescribeTypeConfigurationsErrors"; -const _BDTCI = "BatchDescribeTypeConfigurationsInput"; -const _BDTCO = "BatchDescribeTypeConfigurationsOutput"; -const _BT = "BearerToken"; -const _BV = "BeforeValue"; -const _BVF = "BeforeValueFrom"; -const _C = "Change"; -const _CA = "CallAs"; -const _CAo = "ConnectionArn"; -const _CAon = "ConfigurationAlias"; -const _CAonf = "ConfigurationArn"; -const _CBME = "CreatedButModifiedException"; -const _CCS = "CreateChangeSet"; -const _CCSI = "CreateChangeSetInput"; -const _CCSO = "CreateChangeSetOutput"; -const _CE = "CausingEntity"; -const _CFNRE = "CFNRegistryException"; -const _CGT = "CreateGeneratedTemplate"; -const _CGTI = "CreateGeneratedTemplateInput"; -const _CGTO = "CreateGeneratedTemplateOutput"; -const _CM = "ConcurrencyMode"; -const _COS = "CurrentOperationStatus"; -const _CR = "CapabilitiesReason"; -const _CRLEE = "ConcurrentResourcesLimitExceededException"; -const _CRT = "ClientRequestToken"; -const _CS = "ConfigurationSchema"; -const _CSH = "ChangeSetHook"; -const _CSHRTD = "ChangeSetHookResourceTargetDetails"; -const _CSHTD = "ChangeSetHookTargetDetails"; -const _CSHh = "ChangeSetHooks"; -const _CSI = "ChangeSetId"; -const _CSII = "CreateStackInstancesInput"; -const _CSIO = "CreateStackInstancesOutput"; -const _CSIr = "CreateStackInput"; -const _CSIre = "CreateStackInstances"; -const _CSN = "ChangeSetName"; -const _CSNFE = "ChangeSetNotFoundException"; -const _CSO = "CreateStackOutput"; -const _CSR = "CreateStackRefactor"; -const _CSRI = "CreateStackRefactorInput"; -const _CSRO = "CreateStackRefactorOutput"; -const _CSS = "ChangeSetSummary"; -const _CSSI = "CreateStackSetInput"; -const _CSSO = "CreateStackSetOutput"; -const _CSSh = "ChangeSetSummaries"; -const _CSSr = "CreateStackSet"; -const _CST = "ChangeSetType"; -const _CSh = "ChangeSource"; -const _CSr = "CreateStack"; -const _CT = "CreationTime"; -const _CTl = "ClientToken"; -const _CTr = "CreationTimestamp"; -const _CUR = "ContinueUpdateRollback"; -const _CURI = "ContinueUpdateRollbackInput"; -const _CURO = "ContinueUpdateRollbackOutput"; -const _CUS = "CancelUpdateStack"; -const _CUSI = "CancelUpdateStackInput"; -const _Ca = "Capabilities"; -const _Cat = "Category"; -const _Ch = "Changes"; -const _Co = "Configuration"; -const _D = "Description"; -const _DAL = "DescribeAccountLimits"; -const _DALI = "DescribeAccountLimitsInput"; -const _DALO = "DescribeAccountLimitsOutput"; -const _DCS = "DeleteChangeSet"; -const _DCSH = "DescribeChangeSetHooks"; -const _DCSHI = "DescribeChangeSetHooksInput"; -const _DCSHO = "DescribeChangeSetHooksOutput"; -const _DCSI = "DeleteChangeSetInput"; -const _DCSIe = "DescribeChangeSetInput"; -const _DCSO = "DeleteChangeSetOutput"; -const _DCSOe = "DescribeChangeSetOutput"; -const _DCSe = "DescribeChangeSet"; -const _DDS = "DriftDetectionStatus"; -const _DDT = "DriftDetectionTimestamp"; -const _DE = "DescribeEvents"; -const _DEI = "DescribeEventsInput"; -const _DEO = "DescribeEventsOutput"; -const _DGT = "DeleteGeneratedTemplate"; -const _DGTI = "DeleteGeneratedTemplateInput"; -const _DGTIe = "DescribeGeneratedTemplateInput"; -const _DGTO = "DescribeGeneratedTemplateOutput"; -const _DGTe = "DescribeGeneratedTemplate"; -const _DI = "DriftInformation"; -const _DM = "DeploymentMode"; -const _DMe = "DeletionMode"; -const _DOA = "DeactivateOrganizationsAccess"; -const _DOAI = "DeactivateOrganizationsAccessInput"; -const _DOAIe = "DescribeOrganizationsAccessInput"; -const _DOAO = "DeactivateOrganizationsAccessOutput"; -const _DOAOe = "DescribeOrganizationsAccessOutput"; -const _DOAe = "DescribeOrganizationsAccess"; -const _DP = "DeletionPolicy"; -const _DPI = "DescribePublisherInput"; -const _DPO = "DescribePublisherOutput"; -const _DPe = "DescribePublisher"; -const _DR = "DisableRollback"; -const _DRS = "DescribeResourceScan"; -const _DRSI = "DescribeResourceScanInput"; -const _DRSO = "DescribeResourceScanOutput"; -const _DRe = "DetectionReason"; -const _DS = "DetectionStatus"; -const _DSD = "DetectStackDrift"; -const _DSDDS = "DescribeStackDriftDetectionStatus"; -const _DSDDSI = "DescribeStackDriftDetectionStatusInput"; -const _DSDDSO = "DescribeStackDriftDetectionStatusOutput"; -const _DSDI = "DetectStackDriftInput"; -const _DSDO = "DetectStackDriftOutput"; -const _DSE = "DescribeStackEvents"; -const _DSEI = "DescribeStackEventsInput"; -const _DSEO = "DescribeStackEventsOutput"; -const _DSI = "DeleteStackInput"; -const _DSIC = "DriftedStackInstancesCount"; -const _DSII = "DeleteStackInstancesInput"; -const _DSIIe = "DescribeStackInstanceInput"; -const _DSIO = "DeleteStackInstancesOutput"; -const _DSIOe = "DescribeStackInstanceOutput"; -const _DSIe = "DescribeStacksInput"; -const _DSIel = "DeleteStackInstances"; -const _DSIes = "DescribeStackInstance"; -const _DSO = "DescribeStacksOutput"; -const _DSR = "DetectionStatusReason"; -const _DSRC = "DriftedStackResourceCount"; -const _DSRD = "DescribeStackResourceDrifts"; -const _DSRDI = "DescribeStackResourceDriftsInput"; -const _DSRDIe = "DetectStackResourceDriftInput"; -const _DSRDO = "DescribeStackResourceDriftsOutput"; -const _DSRDOe = "DetectStackResourceDriftOutput"; -const _DSRDe = "DetectStackResourceDrift"; -const _DSRI = "DescribeStackRefactorInput"; -const _DSRIe = "DescribeStackResourceInput"; -const _DSRIes = "DescribeStackResourcesInput"; -const _DSRO = "DescribeStackRefactorOutput"; -const _DSROe = "DescribeStackResourceOutput"; -const _DSROes = "DescribeStackResourcesOutput"; -const _DSRe = "DescribeStackRefactor"; -const _DSRes = "DescribeStackResource"; -const _DSResc = "DescribeStackResources"; -const _DSRr = "DriftStatusReason"; -const _DSS = "DeleteStackSet"; -const _DSSD = "DetectStackSetDrift"; -const _DSSDI = "DetectStackSetDriftInput"; -const _DSSDO = "DetectStackSetDriftOutput"; -const _DSSI = "DeleteStackSetInput"; -const _DSSIe = "DescribeStackSetInput"; -const _DSSO = "DeleteStackSetOutput"; -const _DSSOI = "DescribeStackSetOperationInput"; -const _DSSOO = "DescribeStackSetOperationOutput"; -const _DSSOe = "DescribeStackSetOutput"; -const _DSSOes = "DescribeStackSetOperation"; -const _DSSe = "DescribeStackSet"; -const _DSe = "DeprecatedStatus"; -const _DSel = "DeleteStack"; -const _DSes = "DescribeStacks"; -const _DSet = "DetailedStatus"; -const _DSr = "DriftStatus"; -const _DT = "DeploymentTargets"; -const _DTI = "DeactivateTypeInput"; -const _DTIe = "DeregisterTypeInput"; -const _DTIes = "DescribeTypeInput"; -const _DTO = "DeactivateTypeOutput"; -const _DTOe = "DeregisterTypeOutput"; -const _DTOes = "DescribeTypeOutput"; -const _DTR = "DescribeTypeRegistration"; -const _DTRI = "DescribeTypeRegistrationInput"; -const _DTRO = "DescribeTypeRegistrationOutput"; -const _DTe = "DeclaredTransforms"; -const _DTea = "DeactivateType"; -const _DTel = "DeletionTime"; -const _DTer = "DeregisterType"; -const _DTes = "DescribeType"; -const _DTi = "DifferenceType"; -const _DU = "DocumentationUrl"; -const _DV = "DefaultValue"; -const _DVI = "DefaultVersionId"; -const _De = "Details"; -const _Des = "Destination"; -const _Det = "Detection"; -const _Dr = "Drift"; -const _E = "Enabled"; -const _EC = "ErrorCode"; -const _ECS = "ExecuteChangeSet"; -const _ECSI = "ExecuteChangeSetInput"; -const _ECSO = "ExecuteChangeSetOutput"; -const _EF = "EventFilter"; -const _EI = "EventId"; -const _EM = "ErrorMessage"; -const _EN = "ExportName"; -const _EP = "ExpectedProperties"; -const _ERA = "ExecutionRoleArn"; -const _ERN = "ExecutionRoleName"; -const _ES = "ExecutionStatus"; -const _ESC = "EnableStackCreation"; -const _ESF = "ExecutionStatusFilter"; -const _ESI = "ExportingStackId"; -const _ESR = "ExecutionStatusReason"; -const _ESRI = "ExecuteStackRefactorInput"; -const _ESRx = "ExecuteStackRefactor"; -const _ET = "EndTime"; -const _ETC = "EstimateTemplateCost"; -const _ETCI = "EstimateTemplateCostInput"; -const _ETCO = "EstimateTemplateCostOutput"; -const _ETP = "EnableTerminationProtection"; -const _ETn = "EndTimestamp"; -const _ETv = "EventType"; -const _EV = "ExpectedValue"; -const _En = "Entity"; -const _Er = "Errors"; -const _Ev = "Evaluation"; -const _Ex = "Export"; -const _Exp = "Exports"; -const _F = "Filters"; -const _FE = "FailedEvents"; -const _FM = "FailureMode"; -const _FSIC = "FailedStackInstancesCount"; -const _FTC = "FailureToleranceCount"; -const _FTP = "FailureTolerancePercentage"; -const _Fo = "Format"; -const _GGT = "GetGeneratedTemplate"; -const _GGTI = "GetGeneratedTemplateInput"; -const _GGTO = "GetGeneratedTemplateOutput"; -const _GHR = "GetHookResult"; -const _GHRI = "GetHookResultInput"; -const _GHRO = "GetHookResultOutput"; -const _GSP = "GetStackPolicy"; -const _GSPI = "GetStackPolicyInput"; -const _GSPO = "GetStackPolicyOutput"; -const _GT = "GetTemplate"; -const _GTI = "GeneratedTemplateId"; -const _GTIe = "GetTemplateInput"; -const _GTN = "GeneratedTemplateName"; -const _GTNFE = "GeneratedTemplateNotFoundException"; -const _GTO = "GetTemplateOutput"; -const _GTS = "GetTemplateSummary"; -const _GTSI = "GetTemplateSummaryInput"; -const _GTSO = "GetTemplateSummaryOutput"; -const _H = "Hooks"; -const _HET = "HookExecutionTarget"; -const _HFM = "HookFailureMode"; -const _HIC = "HookInvocationCount"; -const _HII = "HookInvocationId"; -const _HIP = "HookInvocationPoint"; -const _HR = "HookResults"; -const _HRI = "HookResultId"; -const _HRNFE = "HookResultNotFoundException"; -const _HRS = "HookResultSummary"; -const _HRSo = "HookResultSummaries"; -const _HS = "HookStatus"; -const _HSR = "HookStatusReason"; -const _HT = "HookTarget"; -const _HTo = "HookType"; -const _I = "Id"; -const _IA = "IsActivated"; -const _IAn = "InvokedAt"; -const _ICE = "InsufficientCapabilitiesException"; -const _ICSSE = "InvalidChangeSetStatusException"; -const _IDC = "IsDefaultConfiguration"; -const _IDV = "IsDefaultVersion"; -const _IER = "ImportExistingResources"; -const _INS = "IncludeNestedStacks"; -const _IOE = "InvalidOperationException"; -const _IP = "InvocationPoint"; -const _IPSIC = "InProgressStackInstancesCount"; -const _IPV = "IncludePropertyValues"; -const _IPd = "IdentityProvider"; -const _ISSIC = "InSyncStackInstancesCount"; -const _ISTE = "InvalidStateTransitionException"; -const _ISTSS = "ImportStacksToStackSet"; -const _ISTSSI = "ImportStacksToStackSetInput"; -const _ISTSSO = "ImportStacksToStackSetOutput"; -const _Im = "Imports"; -const _K = "Key"; -const _LC = "LoggingConfig"; -const _LCS = "ListChangeSets"; -const _LCSI = "ListChangeSetsInput"; -const _LCSO = "ListChangeSetsOutput"; -const _LCT = "LastCheckTimestamp"; -const _LDB = "LogDeliveryBucket"; -const _LDCT = "LastDriftCheckTimestamp"; -const _LE = "ListExports"; -const _LEE = "LimitExceededException"; -const _LEI = "ListExportsInput"; -const _LEO = "ListExportsOutput"; -const _LGN = "LogGroupName"; -const _LGT = "ListGeneratedTemplates"; -const _LGTI = "ListGeneratedTemplatesInput"; -const _LGTO = "ListGeneratedTemplatesOutput"; -const _LHR = "ListHookResults"; -const _LHRI = "ListHookResultsInput"; -const _LHRO = "ListHookResultsOutput"; -const _LI = "ListImports"; -const _LIH = "LogicalIdHierarchy"; -const _LII = "ListImportsInput"; -const _LIO = "ListImportsOutput"; -const _LO = "LastOperations"; -const _LOI = "LastOperationId"; -const _LPV = "LatestPublicVersion"; -const _LRA = "LogRoleArn"; -const _LRD = "LiveResourceDrift"; -const _LRI = "LogicalResourceId"; -const _LRIo = "LogicalResourceIds"; -const _LRS = "ListResourceScans"; -const _LRSI = "ListResourceScansInput"; -const _LRSO = "ListResourceScansOutput"; -const _LRSR = "ListResourceScanResources"; -const _LRSRI = "ListResourceScanResourcesInput"; -const _LRSRO = "ListResourceScanResourcesOutput"; -const _LRSRR = "ListResourceScanRelatedResources"; -const _LRSRRI = "ListResourceScanRelatedResourcesInput"; -const _LRSRRO = "ListResourceScanRelatedResourcesOutput"; -const _LS = "ListStacks"; -const _LSI = "ListStacksInput"; -const _LSII = "ListStackInstancesInput"; -const _LSIO = "ListStackInstancesOutput"; -const _LSIRD = "ListStackInstanceResourceDrifts"; -const _LSIRDI = "ListStackInstanceResourceDriftsInput"; -const _LSIRDO = "ListStackInstanceResourceDriftsOutput"; -const _LSIi = "ListStackInstances"; -const _LSO = "ListStacksOutput"; -const _LSR = "ListStackRefactors"; -const _LSRA = "ListStackRefactorActions"; -const _LSRAI = "ListStackRefactorActionsInput"; -const _LSRAO = "ListStackRefactorActionsOutput"; -const _LSRI = "ListStackRefactorsInput"; -const _LSRIi = "ListStackResourcesInput"; -const _LSRO = "ListStackRefactorsOutput"; -const _LSROi = "ListStackResourcesOutput"; -const _LSRi = "ListStackResources"; -const _LSS = "ListStackSets"; -const _LSSADT = "ListStackSetAutoDeploymentTargets"; -const _LSSADTI = "ListStackSetAutoDeploymentTargetsInput"; -const _LSSADTO = "ListStackSetAutoDeploymentTargetsOutput"; -const _LSSI = "ListStackSetsInput"; -const _LSSO = "ListStackSetsOutput"; -const _LSSOI = "ListStackSetOperationsInput"; -const _LSSOO = "ListStackSetOperationsOutput"; -const _LSSOR = "ListStackSetOperationResults"; -const _LSSORI = "ListStackSetOperationResultsInput"; -const _LSSORO = "ListStackSetOperationResultsOutput"; -const _LSSOi = "ListStackSetOperations"; -const _LT = "ListTypes"; -const _LTI = "ListTypesInput"; -const _LTO = "ListTypesOutput"; -const _LTR = "ListTypeRegistrations"; -const _LTRI = "ListTypeRegistrationsInput"; -const _LTRO = "ListTypeRegistrationsOutput"; -const _LTV = "ListTypeVersions"; -const _LTVI = "ListTypeVersionsInput"; -const _LTVO = "ListTypeVersionsOutput"; -const _LU = "LastUpdated"; -const _LUT = "LastUpdatedTime"; -const _LUTa = "LastUpdatedTimestamp"; -const _M = "Message"; -const _MBS = "ManagedByStack"; -const _MCC = "MaxConcurrentCount"; -const _MCP = "MaxConcurrentPercentage"; -const _ME = "ManagedExecution"; -const _MI = "ModuleInfo"; -const _MR = "MaxResults"; -const _MTIM = "MonitoringTimeInMinutes"; -const _MV = "MajorVersion"; -const _Me = "Metadata"; -const _N = "Name"; -const _NAEE = "NameAlreadyExistsException"; -const _NARN = "NotificationARNs"; -const _NE = "NoEcho"; -const _NGTN = "NewGeneratedTemplateName"; -const _NOR = "NumberOfResources"; -const _NT = "NextToken"; -const _O = "Output"; -const _OE = "OperationEvents"; -const _OEp = "OperationEntry"; -const _OEpe = "OperationEvent"; -const _OF = "OnFailure"; -const _OI = "OperationId"; -const _OIAEE = "OperationIdAlreadyExistsException"; -const _OIPE = "OperationInProgressException"; -const _OK = "OutputKey"; -const _ONFE = "OperationNotFoundException"; -const _OP = "OperationPreferences"; -const _ORF = "OperationResultFilter"; -const _ORFp = "OperationResultFilters"; -const _OS = "OperationStatus"; -const _OSCFE = "OperationStatusCheckFailedException"; -const _OSF = "OnStackFailure"; -const _OT = "OperationType"; -const _OTA = "OriginalTypeArn"; -const _OTN = "OriginalTypeName"; -const _OUI = "OrganizationalUnitIds"; -const _OUIr = "OrganizationalUnitId"; -const _OV = "OutputValue"; -const _Ou = "Outputs"; -const _P = "Parameters"; -const _PA = "PolicyAction"; -const _PC = "PercentageCompleted"; -const _PCSI = "ParentChangeSetId"; -const _PCa = "ParameterConstraints"; -const _PD = "ParameterDeclaration"; -const _PDC = "PreviousDeploymentContext"; -const _PDa = "ParameterDeclarations"; -const _PDr = "PropertyDifference"; -const _PDro = "PropertyDifferences"; -const _PI = "PublisherId"; -const _PIa = "ParentId"; -const _PIu = "PublisherIdentity"; -const _PK = "ParameterKey"; -const _PM = "PermissionModel"; -const _PN = "PublisherName"; -const _PO = "ParameterOverrides"; -const _PP = "PublisherProfile"; -const _PPr = "PropertyPath"; -const _PRI = "PhysicalResourceId"; -const _PRIC = "PhysicalResourceIdContext"; -const _PRICKVP = "PhysicalResourceIdContextKeyValuePair"; -const _PS = "PublisherStatus"; -const _PSr = "ProgressStatus"; -const _PT = "ProvisioningType"; -const _PTA = "PublicTypeArn"; -const _PTI = "PublishTypeInput"; -const _PTO = "PublishTypeOutput"; -const _PTa = "ParameterType"; -const _PTu = "PublishType"; -const _PV = "PreviousValue"; -const _PVN = "PublicVersionNumber"; -const _PVa = "ParameterValue"; -const _Pa = "Parameter"; -const _Pat = "Path"; -const _Pr = "Progress"; -const _Pro = "Properties"; -const _R = "Resources"; -const _RA = "ResourceAction"; -const _RAR = "RefreshAllResources"; -const _RARN = "RoleARN"; -const _RAT = "RequiredActivatedTypes"; -const _RATe = "RequiredActivatedType"; -const _RC = "ResourceChange"; -const _RCD = "ResourceChangeDetail"; -const _RCDe = "ResourceChangeDetails"; -const _RCSI = "RootChangeSetId"; -const _RCT = "RegionConcurrencyType"; -const _RCo = "RollbackConfiguration"; -const _RD = "ResourceDefinition"; -const _RDIA = "ResourceDriftIgnoredAttributes"; -const _RDIAe = "ResourceDriftIgnoredAttribute"; -const _RDS = "ResourceDriftStatus"; -const _RDe = "ResourceDetail"; -const _RDes = "ResourceDefinitions"; -const _RDeso = "ResourceDetails"; -const _REOC = "RetainExceptOnCreate"; -const _RF = "ResourcesFailed"; -const _RHP = "RecordHandlerProgress"; -const _RHPI = "RecordHandlerProgressInput"; -const _RHPO = "RecordHandlerProgressOutput"; -const _RI = "ResourceIdentifier"; -const _RIS = "ResourceIdentifierSummaries"; -const _RISe = "ResourceIdentifierSummary"; -const _RIe = "ResourceIdentifiers"; -const _RIo = "RootId"; -const _RL = "RemediationLink"; -const _RLe = "ResourceLocation"; -const _RM = "RemediationMessage"; -const _RMe = "ResourceMappings"; -const _RMes = "ResourceModel"; -const _RMeso = "ResourceMapping"; -const _RO = "RegionOrder"; -const _RP = "ResourceProperties"; -const _RPI = "RegisterPublisherInput"; -const _RPO = "RegisterPublisherOutput"; -const _RPe = "ResourcesProcessing"; -const _RPeg = "RegisterPublisher"; -const _RPes = "ResourcesPending"; -const _RR = "RetainResources"; -const _RRe = "ResourcesRead"; -const _RRel = "RelatedResources"; -const _RRem = "RemoveResources"; -const _RReq = "RequiresRecreation"; -const _RS = "RetainStacks"; -const _RSF = "RegistrationStatusFilter"; -const _RSI = "ResourceScanId"; -const _RSIPE = "ResourceScanInProgressException"; -const _RSIo = "RollbackStackInput"; -const _RSLEE = "ResourceScanLimitExceededException"; -const _RSNFE = "ResourceScanNotFoundException"; -const _RSO = "RollbackStackOutput"; -const _RSOAR = "RetainStacksOnAccountRemoval"; -const _RSR = "ResourceStatusReason"; -const _RSS = "ResourceScanSummaries"; -const _RSSe = "ResourceScanSummary"; -const _RSe = "ResourcesScanned"; -const _RSes = "ResourceStatus"; -const _RSeso = "ResourcesSucceeded"; -const _RSo = "RollbackStack"; -const _RT = "ResourceType"; -const _RTD = "ResourceTargetDetails"; -const _RTDe = "ResourceTargetDefinition"; -const _RTI = "ResourcesToImport"; -const _RTIe = "RegisterTypeInput"; -const _RTIes = "ResourceToImport"; -const _RTL = "RegistrationTokenList"; -const _RTO = "RegisterTypeOutput"; -const _RTP = "ResourceTypePrefix"; -const _RTS = "ResourcesToSkip"; -const _RTe = "ResourceTypes"; -const _RTeg = "RegistrationToken"; -const _RTegi = "RegisterType"; -const _RTo = "RollbackTriggers"; -const _RTol = "RollbackTrigger"; -const _RV = "ResolvedValue"; -const _Re = "Regions"; -const _Rea = "Reason"; -const _Reg = "Region"; -const _Rep = "Replacement"; -const _Req = "Required"; -const _S = "Status"; -const _SA = "StagesAvailable"; -const _SD = "StackDefinitions"; -const _SDDI = "StackDriftDetectionId"; -const _SDI = "StackDriftInformation"; -const _SDIS = "StackDriftInformationSummary"; -const _SDS = "StackDriftStatus"; -const _SDt = "StackDefinition"; -const _SDta = "StatusDetails"; -const _SE = "StackEvents"; -const _SEt = "StackEvent"; -const _SF = "ScanFilters"; -const _SFc = "ScanFilter"; -const _SHP = "SchemaHandlerPackage"; -const _SI = "StackId"; -const _SIA = "StackInstanceAccount"; -const _SICS = "StackInstanceComprehensiveStatus"; -const _SIF = "StackInstanceFilter"; -const _SIFt = "StackInstanceFilters"; -const _SINFE = "StackInstanceNotFoundException"; -const _SIR = "StackInstanceRegion"; -const _SIRDS = "StackInstanceResourceDriftStatuses"; -const _SIRDSt = "StackInstanceResourceDriftsSummary"; -const _SIRDSta = "StackInstanceResourceDriftsSummaries"; -const _SIS = "StackInstanceStatus"; -const _SISt = "StackInstanceSummary"; -const _SISta = "StackInstanceSummaries"; -const _SIU = "StackIdsUrl"; -const _SIt = "StackInstance"; -const _SIta = "StackIds"; -const _SL = "SeverityLevel"; -const _SM = "StatusMessage"; -const _SMV = "SupportedMajorVersions"; -const _SN = "StackName"; -const _SNFE = "StackNotFoundException"; -const _SPB = "StackPolicyBody"; -const _SPDUB = "StackPolicyDuringUpdateBody"; -const _SPDUURL = "StackPolicyDuringUpdateURL"; -const _SPURL = "StackPolicyURL"; -const _SR = "StatusReason"; -const _SRA = "StackRefactorActions"; -const _SRAt = "StackRefactorAction"; -const _SRD = "StackResourceDrifts"; -const _SRDI = "StackResourceDriftInformation"; -const _SRDIS = "StackResourceDriftInformationSummary"; -const _SRDS = "StackResourceDriftStatus"; -const _SRDSF = "StackResourceDriftStatusFilters"; -const _SRDt = "StackResourceDetail"; -const _SRDta = "StackResourceDrift"; -const _SRE = "StaleRequestException"; -const _SRI = "StackRefactorId"; -const _SRIc = "ScannedResourceIdentifier"; -const _SRIca = "ScannedResourceIdentifiers"; -const _SRIi = "SignalResourceInput"; -const _SRNFE = "StackRefactorNotFoundException"; -const _SRS = "StackRefactorSummaries"; -const _SRSI = "StartResourceScanInput"; -const _SRSO = "StartResourceScanOutput"; -const _SRSt = "StackResourceSummaries"; -const _SRSta = "StackRefactorSummary"; -const _SRStac = "StackResourceSummary"; -const _SRStar = "StartResourceScan"; -const _SRTR = "StackRefactorTagResources"; -const _SRc = "ScannedResource"; -const _SRca = "ScannedResources"; -const _SRi = "SignalResource"; -const _SRt = "StackResources"; -const _SRta = "StackResource"; -const _SS = "StackSet"; -const _SSADTS = "StackSetAutoDeploymentTargetSummary"; -const _SSADTSt = "StackSetAutoDeploymentTargetSummaries"; -const _SSARN = "StackSetARN"; -const _SSDDD = "StackSetDriftDetectionDetails"; -const _SSF = "StackStatusFilter"; -const _SSI = "StackSetId"; -const _SSN = "StackSetName"; -const _SSNEE = "StackSetNotEmptyException"; -const _SSNFE = "StackSetNotFoundException"; -const _SSO = "StackSetOperation"; -const _SSOP = "StackSetOperationPreferences"; -const _SSORS = "StackSetOperationResultSummary"; -const _SSORSt = "StackSetOperationResultSummaries"; -const _SSOS = "StackSetOperationSummary"; -const _SSOSD = "StackSetOperationStatusDetails"; -const _SSOSt = "StackSetOperationSummaries"; -const _SSP = "SetStackPolicy"; -const _SSPI = "SetStackPolicyInput"; -const _SSR = "StackStatusReason"; -const _SSS = "StackSetSummary"; -const _SSSO = "StopStackSetOperation"; -const _SSSOI = "StopStackSetOperationInput"; -const _SSSOO = "StopStackSetOperationOutput"; -const _SSSt = "StackSetSummaries"; -const _SSt = "StackSummaries"; -const _SSta = "StackStatus"; -const _SStac = "StackSummary"; -const _ST = "StartTime"; -const _STC = "SetTypeConfiguration"; -const _STCI = "SetTypeConfigurationInput"; -const _STCO = "SetTypeConfigurationOutput"; -const _STDV = "SetTypeDefaultVersion"; -const _STDVI = "SetTypeDefaultVersionInput"; -const _STDVO = "SetTypeDefaultVersionOutput"; -const _STF = "ScanTypeFilter"; -const _STc = "ScanType"; -const _SU = "SourceUrl"; -const _Sc = "Schema"; -const _Sco = "Scope"; -const _So = "Source"; -const _St = "Stacks"; -const _Sta = "Stack"; -const _Su = "Summaries"; -const _T = "Type"; -const _TA = "TypeArn"; -const _TAEE = "TokenAlreadyExistsException"; -const _TB = "TemplateBody"; -const _TC = "TypeConfigurations"; -const _TCA = "TypeConfigurationAlias"; -const _TCAy = "TypeConfigurationArn"; -const _TCD = "TypeConfigurationDetails"; -const _TCDL = "TypeConfigurationDetailsList"; -const _TCI = "TypeConfigurationIdentifier"; -const _TCIy = "TypeConfigurationIdentifiers"; -const _TCNFE = "TypeConfigurationNotFoundException"; -const _TCVI = "TypeConfigurationVersionId"; -const _TCe = "TemplateConfiguration"; -const _TCi = "TimeCreated"; -const _TD = "TargetDetails"; -const _TDe = "TemplateDescription"; -const _TF = "TypeFilters"; -const _TH = "TypeHierarchy"; -const _TI = "TargetId"; -const _TIM = "TimeoutInMinutes"; -const _TK = "TagKey"; -const _TN = "TypeName"; -const _TNA = "TypeNameAlias"; -const _TNFE = "TypeNotFoundException"; -const _TNP = "TypeNamePrefix"; -const _TP = "TemplateParameter"; -const _TPe = "TemplateProgress"; -const _TPem = "TemplateParameters"; -const _TR = "TagResources"; -const _TS = "TemplateStage"; -const _TSC = "TemplateSummaryConfig"; -const _TSIC = "TotalStackInstancesCount"; -const _TSe = "TemplateSummary"; -const _TSem = "TemplateSummaries"; -const _TSy = "TypeSummaries"; -const _TSyp = "TypeSummary"; -const _TT = "TargetType"; -const _TTI = "TestTypeInput"; -const _TTN = "TargetTypeName"; -const _TTO = "TestTypeOutput"; -const _TTS = "TypeTestsStatus"; -const _TTSD = "TypeTestsStatusDescription"; -const _TTe = "TestType"; -const _TURL = "TemplateURL"; -const _TURTAW = "TreatUnrecognizedResourceTypesAsWarnings"; -const _TV = "TagValue"; -const _TVA = "TypeVersionArn"; -const _TVI = "TypeVersionId"; -const _TVS = "TypeVersionSummaries"; -const _TVSy = "TypeVersionSummary"; -const _TW = "TotalWarnings"; -const _Ta = "Tags"; -const _Tag = "Tag"; -const _Tar = "Target"; -const _Ti = "Timestamp"; -const _Ty = "Types"; -const _U = "Url"; -const _UGT = "UpdateGeneratedTemplate"; -const _UGTI = "UpdateGeneratedTemplateInput"; -const _UGTO = "UpdateGeneratedTemplateOutput"; -const _UI = "UniqueId"; -const _UPT = "UsePreviousTemplate"; -const _UPV = "UsePreviousValue"; -const _UR = "UntagResources"; -const _URP = "UpdateReplacePolicy"; -const _URT = "UnrecognizedResourceTypes"; -const _US = "UpdateStack"; -const _USI = "UpdateStackInput"; -const _USII = "UpdateStackInstancesInput"; -const _USIO = "UpdateStackInstancesOutput"; -const _USIp = "UpdateStackInstances"; -const _USO = "UpdateStackOutput"; -const _USS = "UpdateStackSet"; -const _USSI = "UpdateStackSetInput"; -const _USSO = "UpdateStackSetOutput"; -const _UTC = "UnprocessedTypeConfigurations"; -const _UTP = "UpdateTerminationProtection"; -const _UTPI = "UpdateTerminationProtectionInput"; -const _UTPO = "UpdateTerminationProtectionOutput"; -const _V = "Value"; -const _VB = "VersionBump"; -const _VFM = "ValidationFailureMode"; -const _VI = "VersionId"; -const _VN = "ValidationName"; -const _VP = "ValidationPath"; -const _VS = "ValidationStatus"; -const _VSR = "ValidationStatusReason"; -const _VT = "ValidateTemplate"; -const _VTI = "ValidateTemplateInput"; -const _VTO = "ValidateTemplateOutput"; -const _Va = "Values"; -const _Ve = "Version"; -const _Vi = "Visibility"; -const _W = "Warnings"; -const _WD = "WarningDetail"; -const _WDa = "WarningDetails"; -const _WP = "WarningProperty"; -const _WPa = "WarningProperties"; -const _aQE = "awsQueryError"; -const _c = "client"; -const _e = "error"; -const _hE = "httpError"; -const _s = "smithy.ts.sdk.synthetic.com.amazonaws.cloudformation"; -const n0 = "com.amazonaws.cloudformation"; -var AccountGateResult = [3, n0, _AGR, 0, [_S, _SR], [0, 0]]; -var AccountLimit = [3, n0, _AL, 0, [_N, _V], [0, 1]]; -var ActivateOrganizationsAccessInput = [3, n0, _AOAI, 0, [], []]; -var ActivateOrganizationsAccessOutput = [3, n0, _AOAO, 0, [], []]; -var ActivateTypeInput = [ - 3, - n0, - _ATI, - 0, - [_T, _PTA, _PI, _TN, _TNA, _AU, _LC, _ERA, _VB, _MV], - [0, 0, 0, 0, 0, 2, () => LoggingConfig, 0, 0, 1], -]; -var ActivateTypeOutput = [3, n0, _ATO, 0, [_A], [0]]; -var AlreadyExistsException = [ - -3, - n0, - _AEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`AlreadyExistsException`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(AlreadyExistsException, AlreadyExistsException$1); -var Annotation = [3, n0, _An, 0, [_AN, _S, _SM, _RM, _RL, _SL], [0, 0, 0, 0, 0, 0]]; -var AutoDeployment = [3, n0, _AD, 0, [_E, _RSOAR], [2, 2]]; -var BatchDescribeTypeConfigurationsError = [ - 3, - n0, - _BDTCE, - 0, - [_EC, _EM, _TCI], - [0, 0, () => TypeConfigurationIdentifier], -]; -var BatchDescribeTypeConfigurationsInput = [ - 3, - n0, - _BDTCI, - 0, - [_TCIy], - [() => TypeConfigurationIdentifiers], -]; -var BatchDescribeTypeConfigurationsOutput = [ - 3, - n0, - _BDTCO, - 0, - [_Er, _UTC, _TC], - [ - () => BatchDescribeTypeConfigurationsErrors, - () => UnprocessedTypeConfigurations, - () => TypeConfigurationDetailsList, - ], -]; -var CancelUpdateStackInput = [3, n0, _CUSI, 0, [_SN, _CRT], [0, 0]]; -var CFNRegistryException = [ - -3, - n0, - _CFNRE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`CFNRegistryException`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(CFNRegistryException, CFNRegistryException$1); -var Change = [3, n0, _C, 0, [_T, _HIC, _RC], [0, 1, () => ResourceChange]]; -var ChangeSetHook = [ - 3, - n0, - _CSH, - 0, - [_IP, _FM, _TN, _TVI, _TCVI, _TD], - [0, 0, 0, 0, 0, () => ChangeSetHookTargetDetails], -]; -var ChangeSetHookResourceTargetDetails = [3, n0, _CSHRTD, 0, [_LRI, _RT, _RA], [0, 0, 0]]; -var ChangeSetHookTargetDetails = [ - 3, - n0, - _CSHTD, - 0, - [_TT, _RTD], - [0, () => ChangeSetHookResourceTargetDetails], -]; -var ChangeSetNotFoundException = [ - -3, - n0, - _CSNFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`ChangeSetNotFound`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(ChangeSetNotFoundException, ChangeSetNotFoundException$1); -var ChangeSetSummary = [ - 3, - n0, - _CSS, - 0, - [_SI, _SN, _CSI, _CSN, _ES, _S, _SR, _CT, _D, _INS, _PCSI, _RCSI, _IER], - [0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 2], -]; -var ConcurrentResourcesLimitExceededException = [ - -3, - n0, - _CRLEE, - { - [_e]: _c, - [_hE]: 429, - [_aQE]: [`ConcurrentResourcesLimitExceeded`, 429], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(ConcurrentResourcesLimitExceededException, ConcurrentResourcesLimitExceededException$1); -var ContinueUpdateRollbackInput = [ - 3, - n0, - _CURI, - 0, - [_SN, _RARN, _RTS, _CRT], - [0, 0, 64 | 0, 0], -]; -var ContinueUpdateRollbackOutput = [3, n0, _CURO, 0, [], []]; -var CreateChangeSetInput = [ - 3, - n0, - _CCSI, - 0, - [_SN, _TB, _TURL, _UPT, _P, _Ca, _RTe, _RARN, _RCo, _NARN, _Ta, _CSN, _CTl, _D, _CST, _RTI, _INS, _OSF, _IER, _DM], - [ - 0, - 0, - 0, - 2, - () => _Parameters, - 64 | 0, - 64 | 0, - 0, - () => RollbackConfiguration, - 64 | 0, - () => Tags, - 0, - 0, - 0, - 0, - () => ResourcesToImport, - 2, - 0, - 2, - 0, - ], -]; -var CreateChangeSetOutput = [3, n0, _CCSO, 0, [_I, _SI], [0, 0]]; -var CreatedButModifiedException = [ - -3, - n0, - _CBME, - { - [_e]: _c, - [_hE]: 409, - [_aQE]: [`CreatedButModifiedException`, 409], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(CreatedButModifiedException, CreatedButModifiedException$1); -var CreateGeneratedTemplateInput = [ - 3, - n0, - _CGTI, - 0, - [_R, _GTN, _SN, _TCe], - [() => ResourceDefinitions, 0, 0, () => TemplateConfiguration], -]; -var CreateGeneratedTemplateOutput = [3, n0, _CGTO, 0, [_GTI], [0]]; -var CreateStackInput = [ - 3, - n0, - _CSIr, - 0, - [_SN, _TB, _TURL, _P, _DR, _RCo, _TIM, _NARN, _Ca, _RTe, _RARN, _OF, _SPB, _SPURL, _Ta, _CRT, _ETP, _REOC], - [ - 0, - 0, - 0, - () => _Parameters, - 2, - () => RollbackConfiguration, - 1, - 64 | 0, - 64 | 0, - 64 | 0, - 0, - 0, - 0, - 0, - () => Tags, - 0, - 2, - 2, - ], -]; -var CreateStackInstancesInput = [ - 3, - n0, - _CSII, - 0, - [_SSN, _Ac, _DT, _Re, _PO, _OP, _OI, _CA], - [0, 64 | 0, () => DeploymentTargets, 64 | 0, () => _Parameters, () => StackSetOperationPreferences, [0, 4], 0], -]; -var CreateStackInstancesOutput = [3, n0, _CSIO, 0, [_OI], [0]]; -var CreateStackOutput = [3, n0, _CSO, 0, [_SI, _OI], [0, 0]]; -var CreateStackRefactorInput = [ - 3, - n0, - _CSRI, - 0, - [_D, _ESC, _RMe, _SD], - [0, 2, () => ResourceMappings, () => StackDefinitions], -]; -var CreateStackRefactorOutput = [3, n0, _CSRO, 0, [_SRI], [0]]; -var CreateStackSetInput = [ - 3, - n0, - _CSSI, - 0, - [_SSN, _D, _TB, _TURL, _SI, _P, _Ca, _Ta, _ARARN, _ERN, _PM, _AD, _CA, _CRT, _ME], - [ - 0, - 0, - 0, - 0, - 0, - () => _Parameters, - 64 | 0, - () => Tags, - 0, - 0, - 0, - () => AutoDeployment, - 0, - [0, 4], - () => ManagedExecution, - ], -]; -var CreateStackSetOutput = [3, n0, _CSSO, 0, [_SSI], [0]]; -var DeactivateOrganizationsAccessInput = [3, n0, _DOAI, 0, [], []]; -var DeactivateOrganizationsAccessOutput = [3, n0, _DOAO, 0, [], []]; -var DeactivateTypeInput = [3, n0, _DTI, 0, [_TN, _T, _A], [0, 0, 0]]; -var DeactivateTypeOutput = [3, n0, _DTO, 0, [], []]; -var DeleteChangeSetInput = [3, n0, _DCSI, 0, [_CSN, _SN], [0, 0]]; -var DeleteChangeSetOutput = [3, n0, _DCSO, 0, [], []]; -var DeleteGeneratedTemplateInput = [3, n0, _DGTI, 0, [_GTN], [0]]; -var DeleteStackInput = [ - 3, - n0, - _DSI, - 0, - [_SN, _RR, _RARN, _CRT, _DMe], - [0, 64 | 0, 0, 0, 0], -]; -var DeleteStackInstancesInput = [ - 3, - n0, - _DSII, - 0, - [_SSN, _Ac, _DT, _Re, _OP, _RS, _OI, _CA], - [0, 64 | 0, () => DeploymentTargets, 64 | 0, () => StackSetOperationPreferences, 2, [0, 4], 0], -]; -var DeleteStackInstancesOutput = [3, n0, _DSIO, 0, [_OI], [0]]; -var DeleteStackSetInput = [3, n0, _DSSI, 0, [_SSN, _CA], [0, 0]]; -var DeleteStackSetOutput = [3, n0, _DSSO, 0, [], []]; -var DeploymentTargets = [3, n0, _DT, 0, [_Ac, _AUc, _OUI, _AFT], [64 | 0, 0, 64 | 0, 0]]; -var DeregisterTypeInput = [3, n0, _DTIe, 0, [_A, _T, _TN, _VI], [0, 0, 0, 0]]; -var DeregisterTypeOutput = [3, n0, _DTOe, 0, [], []]; -var DescribeAccountLimitsInput = [3, n0, _DALI, 0, [_NT], [0]]; -var DescribeAccountLimitsOutput = [ - 3, - n0, - _DALO, - 0, - [_ALc, _NT], - [() => AccountLimitList, 0], -]; -var DescribeChangeSetHooksInput = [ - 3, - n0, - _DCSHI, - 0, - [_CSN, _SN, _NT, _LRI], - [0, 0, 0, 0], -]; -var DescribeChangeSetHooksOutput = [ - 3, - n0, - _DCSHO, - 0, - [_CSI, _CSN, _H, _S, _NT, _SI, _SN], - [0, 0, () => ChangeSetHooks, 0, 0, 0, 0], -]; -var DescribeChangeSetInput = [3, n0, _DCSIe, 0, [_CSN, _SN, _NT, _IPV], [0, 0, 0, 2]]; -var DescribeChangeSetOutput = [ - 3, - n0, - _DCSOe, - 0, - [ - _CSN, - _CSI, - _SI, - _SN, - _D, - _P, - _CT, - _ES, - _S, - _SR, - _SDS, - _NARN, - _RCo, - _Ca, - _Ta, - _Ch, - _NT, - _INS, - _PCSI, - _RCSI, - _OSF, - _IER, - _DM, - ], - [ - 0, - 0, - 0, - 0, - 0, - () => _Parameters, - 4, - 0, - 0, - 0, - 0, - 64 | 0, - () => RollbackConfiguration, - 64 | 0, - () => Tags, - () => Changes, - 0, - 2, - 0, - 0, - 0, - 2, - 0, - ], -]; -var DescribeEventsInput = [ - 3, - n0, - _DEI, - 0, - [_SN, _CSN, _OI, _F, _NT], - [0, 0, 0, () => EventFilter, 0], -]; -var DescribeEventsOutput = [3, n0, _DEO, 0, [_OE, _NT], [() => OperationEvents, 0]]; -var DescribeGeneratedTemplateInput = [3, n0, _DGTIe, 0, [_GTN], [0]]; -var DescribeGeneratedTemplateOutput = [ - 3, - n0, - _DGTO, - 0, - [_GTI, _GTN, _R, _S, _SR, _CT, _LUT, _Pr, _SI, _TCe, _TW], - [0, 0, () => ResourceDetails, 0, 0, 4, 4, () => TemplateProgress, 0, () => TemplateConfiguration, 1], -]; -var DescribeOrganizationsAccessInput = [3, n0, _DOAIe, 0, [_CA], [0]]; -var DescribeOrganizationsAccessOutput = [3, n0, _DOAOe, 0, [_S], [0]]; -var DescribePublisherInput = [3, n0, _DPI, 0, [_PI], [0]]; -var DescribePublisherOutput = [3, n0, _DPO, 0, [_PI, _PS, _IPd, _PP], [0, 0, 0, 0]]; -var DescribeResourceScanInput = [3, n0, _DRSI, 0, [_RSI], [0]]; -var DescribeResourceScanOutput = [ - 3, - n0, - _DRSO, - 0, - [_RSI, _S, _SR, _ST, _ET, _PC, _RTe, _RSe, _RRe, _SF], - [0, 0, 0, 4, 4, 1, 64 | 0, 1, 1, () => ScanFilters], -]; -var DescribeStackDriftDetectionStatusInput = [3, n0, _DSDDSI, 0, [_SDDI], [0]]; -var DescribeStackDriftDetectionStatusOutput = [ - 3, - n0, - _DSDDSO, - 0, - [_SI, _SDDI, _SDS, _DS, _DSR, _DSRC, _Ti], - [0, 0, 0, 0, 0, 1, 4], -]; -var DescribeStackEventsInput = [3, n0, _DSEI, 0, [_SN, _NT], [0, 0]]; -var DescribeStackEventsOutput = [3, n0, _DSEO, 0, [_SE, _NT], [() => StackEvents, 0]]; -var DescribeStackInstanceInput = [ - 3, - n0, - _DSIIe, - 0, - [_SSN, _SIA, _SIR, _CA], - [0, 0, 0, 0], -]; -var DescribeStackInstanceOutput = [3, n0, _DSIOe, 0, [_SIt], [() => StackInstance]]; -var DescribeStackRefactorInput = [3, n0, _DSRI, 0, [_SRI], [0]]; -var DescribeStackRefactorOutput = [ - 3, - n0, - _DSRO, - 0, - [_D, _SRI, _SIta, _ES, _ESR, _S, _SR], - [0, 0, 64 | 0, 0, 0, 0, 0], -]; -var DescribeStackResourceDriftsInput = [ - 3, - n0, - _DSRDI, - 0, - [_SN, _SRDSF, _NT, _MR], - [0, 64 | 0, 0, 1], -]; -var DescribeStackResourceDriftsOutput = [ - 3, - n0, - _DSRDO, - 0, - [_SRD, _NT], - [() => StackResourceDrifts, 0], -]; -var DescribeStackResourceInput = [3, n0, _DSRIe, 0, [_SN, _LRI], [0, 0]]; -var DescribeStackResourceOutput = [ - 3, - n0, - _DSROe, - 0, - [_SRDt], - [() => StackResourceDetail], -]; -var DescribeStackResourcesInput = [3, n0, _DSRIes, 0, [_SN, _LRI, _PRI], [0, 0, 0]]; -var DescribeStackResourcesOutput = [3, n0, _DSROes, 0, [_SRt], [() => StackResources]]; -var DescribeStackSetInput = [3, n0, _DSSIe, 0, [_SSN, _CA], [0, 0]]; -var DescribeStackSetOperationInput = [3, n0, _DSSOI, 0, [_SSN, _OI, _CA], [0, 0, 0]]; -var DescribeStackSetOperationOutput = [ - 3, - n0, - _DSSOO, - 0, - [_SSO], - [() => StackSetOperation], -]; -var DescribeStackSetOutput = [3, n0, _DSSOe, 0, [_SS], [() => StackSet]]; -var DescribeStacksInput = [3, n0, _DSIe, 0, [_SN, _NT], [0, 0]]; -var DescribeStacksOutput = [3, n0, _DSO, 0, [_St, _NT], [() => Stacks, 0]]; -var DescribeTypeInput = [ - 3, - n0, - _DTIes, - 0, - [_T, _TN, _A, _VI, _PI, _PVN], - [0, 0, 0, 0, 0, 0], -]; -var DescribeTypeOutput = [ - 3, - n0, - _DTOes, - 0, - [ - _A, - _T, - _TN, - _DVI, - _IDV, - _TTS, - _TTSD, - _D, - _Sc, - _PT, - _DSe, - _LC, - _RAT, - _ERA, - _Vi, - _SU, - _DU, - _LU, - _TCi, - _CS, - _PI, - _OTN, - _OTA, - _PVN, - _LPV, - _IA, - _AU, - ], - [ - 0, - 0, - 0, - 0, - 2, - 0, - 0, - 0, - 0, - 0, - 0, - () => LoggingConfig, - () => RequiredActivatedTypes, - 0, - 0, - 0, - 0, - 4, - 4, - 0, - 0, - 0, - 0, - 0, - 0, - 2, - 2, - ], -]; -var DescribeTypeRegistrationInput = [3, n0, _DTRI, 0, [_RTeg], [0]]; -var DescribeTypeRegistrationOutput = [ - 3, - n0, - _DTRO, - 0, - [_PSr, _D, _TA, _TVA], - [0, 0, 0, 0], -]; -var DetectStackDriftInput = [3, n0, _DSDI, 0, [_SN, _LRIo], [0, 64 | 0]]; -var DetectStackDriftOutput = [3, n0, _DSDO, 0, [_SDDI], [0]]; -var DetectStackResourceDriftInput = [3, n0, _DSRDIe, 0, [_SN, _LRI], [0, 0]]; -var DetectStackResourceDriftOutput = [ - 3, - n0, - _DSRDOe, - 0, - [_SRDta], - [() => StackResourceDrift], -]; -var DetectStackSetDriftInput = [ - 3, - n0, - _DSSDI, - 0, - [_SSN, _OP, _OI, _CA], - [0, () => StackSetOperationPreferences, [0, 4], 0], -]; -var DetectStackSetDriftOutput = [3, n0, _DSSDO, 0, [_OI], [0]]; -var EstimateTemplateCostInput = [ - 3, - n0, - _ETCI, - 0, - [_TB, _TURL, _P], - [0, 0, () => _Parameters], -]; -var EstimateTemplateCostOutput = [3, n0, _ETCO, 0, [_U], [0]]; -var EventFilter = [3, n0, _EF, 0, [_FE], [2]]; -var ExecuteChangeSetInput = [ - 3, - n0, - _ECSI, - 0, - [_CSN, _SN, _CRT, _DR, _REOC], - [0, 0, 0, 2, 2], -]; -var ExecuteChangeSetOutput = [3, n0, _ECSO, 0, [], []]; -var ExecuteStackRefactorInput = [3, n0, _ESRI, 0, [_SRI], [0]]; -var Export = [3, n0, _Ex, 0, [_ESI, _N, _V], [0, 0, 0]]; -var GeneratedTemplateNotFoundException = [ - -3, - n0, - _GTNFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`GeneratedTemplateNotFound`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(GeneratedTemplateNotFoundException, GeneratedTemplateNotFoundException$1); -var GetGeneratedTemplateInput = [3, n0, _GGTI, 0, [_Fo, _GTN], [0, 0]]; -var GetGeneratedTemplateOutput = [3, n0, _GGTO, 0, [_S, _TB], [0, 0]]; -var GetHookResultInput = [3, n0, _GHRI, 0, [_HRI], [0]]; -var GetHookResultOutput = [ - 3, - n0, - _GHRO, - 0, - [_HRI, _IP, _FM, _TN, _OTN, _TVI, _TCVI, _TA, _S, _HSR, _IAn, _Tar, _Ann], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, () => HookTarget, () => AnnotationList], -]; -var GetStackPolicyInput = [3, n0, _GSPI, 0, [_SN], [0]]; -var GetStackPolicyOutput = [3, n0, _GSPO, 0, [_SPB], [0]]; -var GetTemplateInput = [3, n0, _GTIe, 0, [_SN, _CSN, _TS], [0, 0, 0]]; -var GetTemplateOutput = [3, n0, _GTO, 0, [_TB, _SA], [0, 64 | 0]]; -var GetTemplateSummaryInput = [ - 3, - n0, - _GTSI, - 0, - [_TB, _TURL, _SN, _SSN, _CA, _TSC], - [0, 0, 0, 0, 0, () => TemplateSummaryConfig], -]; -var GetTemplateSummaryOutput = [ - 3, - n0, - _GTSO, - 0, - [_P, _D, _Ca, _CR, _RTe, _Ve, _Me, _DTe, _RIS, _W], - [() => ParameterDeclarations, 0, 64 | 0, 0, 64 | 0, 0, 0, 64 | 0, () => ResourceIdentifierSummaries, () => Warnings], -]; -var HookResultNotFoundException = [ - -3, - n0, - _HRNFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`HookResultNotFound`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(HookResultNotFoundException, HookResultNotFoundException$1); -var HookResultSummary = [ - 3, - n0, - _HRS, - 0, - [_HRI, _IP, _FM, _TN, _TVI, _TCVI, _S, _HSR, _IAn, _TT, _TI, _TA, _HET], - [0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0], -]; -var HookTarget = [3, n0, _HT, 0, [_TT, _TTN, _TI, _Act], [0, 0, 0, 0]]; -var ImportStacksToStackSetInput = [ - 3, - n0, - _ISTSSI, - 0, - [_SSN, _SIta, _SIU, _OUI, _OP, _OI, _CA], - [0, 64 | 0, 0, 64 | 0, () => StackSetOperationPreferences, [0, 4], 0], -]; -var ImportStacksToStackSetOutput = [3, n0, _ISTSSO, 0, [_OI], [0]]; -var InsufficientCapabilitiesException = [ - -3, - n0, - _ICE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InsufficientCapabilitiesException`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(InsufficientCapabilitiesException, InsufficientCapabilitiesException$1); -var InvalidChangeSetStatusException = [ - -3, - n0, - _ICSSE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InvalidChangeSetStatus`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidChangeSetStatusException, InvalidChangeSetStatusException$1); -var InvalidOperationException = [ - -3, - n0, - _IOE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InvalidOperationException`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidOperationException, InvalidOperationException$1); -var InvalidStateTransitionException = [ - -3, - n0, - _ISTE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InvalidStateTransition`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(InvalidStateTransitionException, InvalidStateTransitionException$1); -var LimitExceededException = [ - -3, - n0, - _LEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`LimitExceededException`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(LimitExceededException, LimitExceededException$1); -var ListChangeSetsInput = [3, n0, _LCSI, 0, [_SN, _NT], [0, 0]]; -var ListChangeSetsOutput = [3, n0, _LCSO, 0, [_Su, _NT], [() => ChangeSetSummaries, 0]]; -var ListExportsInput = [3, n0, _LEI, 0, [_NT], [0]]; -var ListExportsOutput = [3, n0, _LEO, 0, [_Exp, _NT], [() => Exports, 0]]; -var ListGeneratedTemplatesInput = [3, n0, _LGTI, 0, [_NT, _MR], [0, 1]]; -var ListGeneratedTemplatesOutput = [ - 3, - n0, - _LGTO, - 0, - [_Su, _NT], - [() => TemplateSummaries, 0], -]; -var ListHookResultsInput = [3, n0, _LHRI, 0, [_TT, _TI, _TA, _S, _NT], [0, 0, 0, 0, 0]]; -var ListHookResultsOutput = [ - 3, - n0, - _LHRO, - 0, - [_TT, _TI, _HR, _NT], - [0, 0, () => HookResultSummaries, 0], -]; -var ListImportsInput = [3, n0, _LII, 0, [_EN, _NT], [0, 0]]; -var ListImportsOutput = [3, n0, _LIO, 0, [_Im, _NT], [64 | 0, 0]]; -var ListResourceScanRelatedResourcesInput = [ - 3, - n0, - _LRSRRI, - 0, - [_RSI, _R, _NT, _MR], - [0, () => ScannedResourceIdentifiers, 0, 1], -]; -var ListResourceScanRelatedResourcesOutput = [ - 3, - n0, - _LRSRRO, - 0, - [_RRel, _NT], - [() => RelatedResources, 0], -]; -var ListResourceScanResourcesInput = [ - 3, - n0, - _LRSRI, - 0, - [_RSI, _RI, _RTP, _TK, _TV, _NT, _MR], - [0, 0, 0, 0, 0, 0, 1], -]; -var ListResourceScanResourcesOutput = [ - 3, - n0, - _LRSRO, - 0, - [_R, _NT], - [() => ScannedResources, 0], -]; -var ListResourceScansInput = [3, n0, _LRSI, 0, [_NT, _MR, _STF], [0, 1, 0]]; -var ListResourceScansOutput = [ - 3, - n0, - _LRSO, - 0, - [_RSS, _NT], - [() => ResourceScanSummaries, 0], -]; -var ListStackInstanceResourceDriftsInput = [ - 3, - n0, - _LSIRDI, - 0, - [_SSN, _NT, _MR, _SIRDS, _SIA, _SIR, _OI, _CA], - [0, 0, 1, 64 | 0, 0, 0, 0, 0], -]; -var ListStackInstanceResourceDriftsOutput = [ - 3, - n0, - _LSIRDO, - 0, - [_Su, _NT], - [() => StackInstanceResourceDriftsSummaries, 0], -]; -var ListStackInstancesInput = [ - 3, - n0, - _LSII, - 0, - [_SSN, _NT, _MR, _F, _SIA, _SIR, _CA], - [0, 0, 1, () => StackInstanceFilters, 0, 0, 0], -]; -var ListStackInstancesOutput = [ - 3, - n0, - _LSIO, - 0, - [_Su, _NT], - [() => StackInstanceSummaries, 0], -]; -var ListStackRefactorActionsInput = [3, n0, _LSRAI, 0, [_SRI, _NT, _MR], [0, 0, 1]]; -var ListStackRefactorActionsOutput = [ - 3, - n0, - _LSRAO, - 0, - [_SRA, _NT], - [() => StackRefactorActions, 0], -]; -var ListStackRefactorsInput = [3, n0, _LSRI, 0, [_ESF, _NT, _MR], [64 | 0, 0, 1]]; -var ListStackRefactorsOutput = [ - 3, - n0, - _LSRO, - 0, - [_SRS, _NT], - [() => StackRefactorSummaries, 0], -]; -var ListStackResourcesInput = [3, n0, _LSRIi, 0, [_SN, _NT], [0, 0]]; -var ListStackResourcesOutput = [ - 3, - n0, - _LSROi, - 0, - [_SRSt, _NT], - [() => StackResourceSummaries, 0], -]; -var ListStackSetAutoDeploymentTargetsInput = [ - 3, - n0, - _LSSADTI, - 0, - [_SSN, _NT, _MR, _CA], - [0, 0, 1, 0], -]; -var ListStackSetAutoDeploymentTargetsOutput = [ - 3, - n0, - _LSSADTO, - 0, - [_Su, _NT], - [() => StackSetAutoDeploymentTargetSummaries, 0], -]; -var ListStackSetOperationResultsInput = [ - 3, - n0, - _LSSORI, - 0, - [_SSN, _OI, _NT, _MR, _CA, _F], - [0, 0, 0, 1, 0, () => OperationResultFilters], -]; -var ListStackSetOperationResultsOutput = [ - 3, - n0, - _LSSORO, - 0, - [_Su, _NT], - [() => StackSetOperationResultSummaries, 0], -]; -var ListStackSetOperationsInput = [3, n0, _LSSOI, 0, [_SSN, _NT, _MR, _CA], [0, 0, 1, 0]]; -var ListStackSetOperationsOutput = [ - 3, - n0, - _LSSOO, - 0, - [_Su, _NT], - [() => StackSetOperationSummaries, 0], -]; -var ListStackSetsInput = [3, n0, _LSSI, 0, [_NT, _MR, _S, _CA], [0, 1, 0, 0]]; -var ListStackSetsOutput = [3, n0, _LSSO, 0, [_Su, _NT], [() => StackSetSummaries, 0]]; -var ListStacksInput = [3, n0, _LSI, 0, [_NT, _SSF], [0, 64 | 0]]; -var ListStacksOutput = [3, n0, _LSO, 0, [_SSt, _NT], [() => StackSummaries, 0]]; -var ListTypeRegistrationsInput = [ - 3, - n0, - _LTRI, - 0, - [_T, _TN, _TA, _RSF, _MR, _NT], - [0, 0, 0, 0, 1, 0], -]; -var ListTypeRegistrationsOutput = [3, n0, _LTRO, 0, [_RTL, _NT], [64 | 0, 0]]; -var ListTypesInput = [ - 3, - n0, - _LTI, - 0, - [_Vi, _PT, _DSe, _T, _F, _MR, _NT], - [0, 0, 0, 0, () => TypeFilters, 1, 0], -]; -var ListTypesOutput = [3, n0, _LTO, 0, [_TSy, _NT], [() => TypeSummaries, 0]]; -var ListTypeVersionsInput = [ - 3, - n0, - _LTVI, - 0, - [_T, _TN, _A, _MR, _NT, _DSe, _PI], - [0, 0, 0, 1, 0, 0, 0], -]; -var ListTypeVersionsOutput = [ - 3, - n0, - _LTVO, - 0, - [_TVS, _NT], - [() => TypeVersionSummaries, 0], -]; -var LiveResourceDrift = [3, n0, _LRD, 0, [_PV, _AV, _DDT], [0, 0, 4]]; -var LoggingConfig = [3, n0, _LC, 0, [_LRA, _LGN], [0, 0]]; -var ManagedExecution = [3, n0, _ME, 0, [_Acti], [2]]; -var ModuleInfo = [3, n0, _MI, 0, [_TH, _LIH], [0, 0]]; -var NameAlreadyExistsException = [ - -3, - n0, - _NAEE, - { - [_e]: _c, - [_hE]: 409, - [_aQE]: [`NameAlreadyExistsException`, 409], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(NameAlreadyExistsException, NameAlreadyExistsException$1); -var OperationEntry = [3, n0, _OEp, 0, [_OT, _OI], [0, 0]]; -var OperationEvent = [ - 3, - n0, - _OEpe, - 0, - [ - _EI, - _SI, - _OI, - _OT, - _OS, - _ETv, - _LRI, - _PRI, - _RT, - _Ti, - _ST, - _ET, - _RSes, - _RSR, - _RP, - _CRT, - _HTo, - _HS, - _HSR, - _HIP, - _HFM, - _DSet, - _VFM, - _VN, - _VS, - _VSR, - _VP, - ], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], -]; -var OperationIdAlreadyExistsException = [ - -3, - n0, - _OIAEE, - { - [_e]: _c, - [_hE]: 409, - [_aQE]: [`OperationIdAlreadyExistsException`, 409], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(OperationIdAlreadyExistsException, OperationIdAlreadyExistsException$1); -var OperationInProgressException = [ - -3, - n0, - _OIPE, - { - [_e]: _c, - [_hE]: 409, - [_aQE]: [`OperationInProgressException`, 409], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(OperationInProgressException, OperationInProgressException$1); -var OperationNotFoundException = [ - -3, - n0, - _ONFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`OperationNotFoundException`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(OperationNotFoundException, OperationNotFoundException$1); -var OperationResultFilter = [3, n0, _ORF, 0, [_N, _Va], [0, 0]]; -var OperationStatusCheckFailedException = [ - -3, - n0, - _OSCFE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ConditionalCheckFailed`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(OperationStatusCheckFailedException, OperationStatusCheckFailedException$1); -var Output = [3, n0, _O, 0, [_OK, _OV, _D, _EN], [0, 0, 0, 0]]; -var Parameter = [3, n0, _Pa, 0, [_PK, _PVa, _UPV, _RV], [0, 0, 2, 0]]; -var ParameterConstraints = [3, n0, _PCa, 0, [_AVl], [64 | 0]]; -var ParameterDeclaration = [ - 3, - n0, - _PD, - 0, - [_PK, _DV, _PTa, _NE, _D, _PCa], - [0, 0, 0, 2, 0, () => ParameterConstraints], -]; -var PhysicalResourceIdContextKeyValuePair = [3, n0, _PRICKVP, 0, [_K, _V], [0, 0]]; -var PropertyDifference = [3, n0, _PDr, 0, [_PPr, _EV, _AV, _DTi], [0, 0, 0, 0]]; -var PublishTypeInput = [3, n0, _PTI, 0, [_T, _A, _TN, _PVN], [0, 0, 0, 0]]; -var PublishTypeOutput = [3, n0, _PTO, 0, [_PTA], [0]]; -var RecordHandlerProgressInput = [ - 3, - n0, - _RHPI, - 0, - [_BT, _OS, _COS, _SM, _EC, _RMes, _CRT], - [0, 0, 0, 0, 0, 0, 0], -]; -var RecordHandlerProgressOutput = [3, n0, _RHPO, 0, [], []]; -var RegisterPublisherInput = [3, n0, _RPI, 0, [_ATAC, _CAo], [2, 0]]; -var RegisterPublisherOutput = [3, n0, _RPO, 0, [_PI], [0]]; -var RegisterTypeInput = [ - 3, - n0, - _RTIe, - 0, - [_T, _TN, _SHP, _LC, _ERA, _CRT], - [0, 0, 0, () => LoggingConfig, 0, 0], -]; -var RegisterTypeOutput = [3, n0, _RTO, 0, [_RTeg], [0]]; -var RequiredActivatedType = [3, n0, _RATe, 0, [_TNA, _OTN, _PI, _SMV], [0, 0, 0, 64 | 1]]; -var ResourceChange = [ - 3, - n0, - _RC, - 0, - [_PA, _Act, _LRI, _PRI, _RT, _Rep, _Sco, _RDS, _RDIA, _De, _CSI, _MI, _BC, _AC, _PDC], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 64 | 0, - 0, - () => ResourceDriftIgnoredAttributes, - () => ResourceChangeDetails, - 0, - () => ModuleInfo, - 0, - 0, - 0, - ], -]; -var ResourceChangeDetail = [ - 3, - n0, - _RCD, - 0, - [_Tar, _Ev, _CSh, _CE], - [() => ResourceTargetDefinition, 0, 0, 0], -]; -var ResourceDefinition = [3, n0, _RD, 0, [_RT, _LRI, _RI], [0, 0, 128 | 0]]; -var ResourceDetail = [ - 3, - n0, - _RDe, - 0, - [_RT, _LRI, _RI, _RSes, _RSR, _W], - [0, 0, 128 | 0, 0, 0, () => WarningDetails], -]; -var ResourceDriftIgnoredAttribute = [3, n0, _RDIAe, 0, [_Pat, _Rea], [0, 0]]; -var ResourceIdentifierSummary = [ - 3, - n0, - _RISe, - 0, - [_RT, _LRIo, _RIe], - [0, 64 | 0, 64 | 0], -]; -var ResourceLocation = [3, n0, _RLe, 0, [_SN, _LRI], [0, 0]]; -var ResourceMapping = [ - 3, - n0, - _RMeso, - 0, - [_So, _Des], - [() => ResourceLocation, () => ResourceLocation], -]; -var ResourceScanInProgressException = [ - -3, - n0, - _RSIPE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ResourceScanInProgress`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(ResourceScanInProgressException, ResourceScanInProgressException$1); -var ResourceScanLimitExceededException = [ - -3, - n0, - _RSLEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ResourceScanLimitExceeded`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(ResourceScanLimitExceededException, ResourceScanLimitExceededException$1); -var ResourceScanNotFoundException = [ - -3, - n0, - _RSNFE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ResourceScanNotFound`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(ResourceScanNotFoundException, ResourceScanNotFoundException$1); -var ResourceScanSummary = [ - 3, - n0, - _RSSe, - 0, - [_RSI, _S, _SR, _ST, _ET, _PC, _STc], - [0, 0, 0, 4, 4, 1, 0], -]; -var ResourceTargetDefinition = [ - 3, - n0, - _RTDe, - 0, - [_At, _N, _RReq, _Pat, _BV, _AVf, _BVF, _AVF, _Dr, _ACT], - [0, 0, 0, 0, 0, 0, 0, 0, () => LiveResourceDrift, 0], -]; -var ResourceToImport = [3, n0, _RTIes, 0, [_RT, _LRI, _RI], [0, 0, 128 | 0]]; -var RollbackConfiguration = [3, n0, _RCo, 0, [_RTo, _MTIM], [() => RollbackTriggers, 1]]; -var RollbackStackInput = [3, n0, _RSIo, 0, [_SN, _RARN, _CRT, _REOC], [0, 0, 0, 2]]; -var RollbackStackOutput = [3, n0, _RSO, 0, [_SI, _OI], [0, 0]]; -var RollbackTrigger = [3, n0, _RTol, 0, [_A, _T], [0, 0]]; -var ScanFilter = [3, n0, _SFc, 0, [_Ty], [64 | 0]]; -var ScannedResource = [3, n0, _SRc, 0, [_RT, _RI, _MBS], [0, 128 | 0, 2]]; -var ScannedResourceIdentifier = [3, n0, _SRIc, 0, [_RT, _RI], [0, 128 | 0]]; -var SetStackPolicyInput = [3, n0, _SSPI, 0, [_SN, _SPB, _SPURL], [0, 0, 0]]; -var SetTypeConfigurationInput = [ - 3, - n0, - _STCI, - 0, - [_TA, _Co, _CAon, _TN, _T], - [0, 0, 0, 0, 0], -]; -var SetTypeConfigurationOutput = [3, n0, _STCO, 0, [_CAonf], [0]]; -var SetTypeDefaultVersionInput = [3, n0, _STDVI, 0, [_A, _T, _TN, _VI], [0, 0, 0, 0]]; -var SetTypeDefaultVersionOutput = [3, n0, _STDVO, 0, [], []]; -var SignalResourceInput = [3, n0, _SRIi, 0, [_SN, _LRI, _UI, _S], [0, 0, 0, 0]]; -var Stack = [ - 3, - n0, - _Sta, - 0, - [ - _SI, - _SN, - _CSI, - _D, - _P, - _CT, - _DTel, - _LUT, - _RCo, - _SSta, - _SSR, - _DR, - _NARN, - _TIM, - _Ca, - _Ou, - _RARN, - _Ta, - _ETP, - _PIa, - _RIo, - _DI, - _REOC, - _DMe, - _DSet, - _LO, - ], - [ - 0, - 0, - 0, - 0, - () => _Parameters, - 4, - 4, - 4, - () => RollbackConfiguration, - 0, - 0, - 2, - 64 | 0, - 1, - 64 | 0, - () => Outputs, - 0, - () => Tags, - 2, - 0, - 0, - () => StackDriftInformation, - 2, - 0, - 0, - () => LastOperations, - ], -]; -var StackDefinition = [3, n0, _SDt, 0, [_SN, _TB, _TURL], [0, 0, 0]]; -var StackDriftInformation = [3, n0, _SDI, 0, [_SDS, _LCT], [0, 4]]; -var StackDriftInformationSummary = [3, n0, _SDIS, 0, [_SDS, _LCT], [0, 4]]; -var StackEvent = [ - 3, - n0, - _SEt, - 0, - [_SI, _EI, _SN, _OI, _LRI, _PRI, _RT, _Ti, _RSes, _RSR, _RP, _CRT, _HTo, _HS, _HSR, _HIP, _HII, _HFM, _DSet], - [0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], -]; -var StackInstance = [ - 3, - n0, - _SIt, - 0, - [_SSI, _Reg, _Acc, _SI, _PO, _S, _SIS, _SR, _OUIr, _DSr, _LDCT, _LOI], - [0, 0, 0, 0, () => _Parameters, 0, () => StackInstanceComprehensiveStatus, 0, 0, 0, 4, 0], -]; -var StackInstanceComprehensiveStatus = [3, n0, _SICS, 0, [_DSet], [0]]; -var StackInstanceFilter = [3, n0, _SIF, 0, [_N, _Va], [0, 0]]; -var StackInstanceNotFoundException = [ - -3, - n0, - _SINFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`StackInstanceNotFoundException`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(StackInstanceNotFoundException, StackInstanceNotFoundException$1); -var StackInstanceResourceDriftsSummary = [ - 3, - n0, - _SIRDSt, - 0, - [_SI, _LRI, _PRI, _PRIC, _RT, _PDro, _SRDS, _Ti], - [0, 0, 0, () => PhysicalResourceIdContext, 0, () => PropertyDifferences, 0, 4], -]; -var StackInstanceSummary = [ - 3, - n0, - _SISt, - 0, - [_SSI, _Reg, _Acc, _SI, _S, _SR, _SIS, _OUIr, _DSr, _LDCT, _LOI], - [0, 0, 0, 0, 0, 0, () => StackInstanceComprehensiveStatus, 0, 0, 4, 0], -]; -var StackNotFoundException = [ - -3, - n0, - _SNFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`StackNotFoundException`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(StackNotFoundException, StackNotFoundException$1); -var StackRefactorAction = [ - 3, - n0, - _SRAt, - 0, - [_Act, _En, _PRI, _RI, _D, _Det, _DRe, _TR, _UR, _RMeso], - [0, 0, 0, 0, 0, 0, 0, () => StackRefactorTagResources, 64 | 0, () => ResourceMapping], -]; -var StackRefactorNotFoundException = [ - -3, - n0, - _SRNFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`StackRefactorNotFoundException`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(StackRefactorNotFoundException, StackRefactorNotFoundException$1); -var StackRefactorSummary = [ - 3, - n0, - _SRSta, - 0, - [_SRI, _D, _ES, _ESR, _S, _SR], - [0, 0, 0, 0, 0, 0], -]; -var StackResource = [ - 3, - n0, - _SRta, - 0, - [_SN, _SI, _LRI, _PRI, _RT, _Ti, _RSes, _RSR, _D, _DI, _MI], - [0, 0, 0, 0, 0, 4, 0, 0, 0, () => StackResourceDriftInformation, () => ModuleInfo], -]; -var StackResourceDetail = [ - 3, - n0, - _SRDt, - 0, - [_SN, _SI, _LRI, _PRI, _RT, _LUTa, _RSes, _RSR, _D, _Me, _DI, _MI], - [0, 0, 0, 0, 0, 4, 0, 0, 0, 0, () => StackResourceDriftInformation, () => ModuleInfo], -]; -var StackResourceDrift = [ - 3, - n0, - _SRDta, - 0, - [_SI, _LRI, _PRI, _PRIC, _RT, _EP, _AP, _PDro, _SRDS, _Ti, _MI, _DSRr], - [0, 0, 0, () => PhysicalResourceIdContext, 0, 0, 0, () => PropertyDifferences, 0, 4, () => ModuleInfo, 0], -]; -var StackResourceDriftInformation = [3, n0, _SRDI, 0, [_SRDS, _LCT], [0, 4]]; -var StackResourceDriftInformationSummary = [3, n0, _SRDIS, 0, [_SRDS, _LCT], [0, 4]]; -var StackResourceSummary = [ - 3, - n0, - _SRStac, - 0, - [_LRI, _PRI, _RT, _LUTa, _RSes, _RSR, _DI, _MI], - [0, 0, 0, 4, 0, 0, () => StackResourceDriftInformationSummary, () => ModuleInfo], -]; -var StackSet = [ - 3, - n0, - _SS, - 0, - [_SSN, _SSI, _D, _S, _TB, _P, _Ca, _Ta, _SSARN, _ARARN, _ERN, _SSDDD, _AD, _PM, _OUI, _ME, _Re], - [ - 0, - 0, - 0, - 0, - 0, - () => _Parameters, - 64 | 0, - () => Tags, - 0, - 0, - 0, - () => StackSetDriftDetectionDetails, - () => AutoDeployment, - 0, - 64 | 0, - () => ManagedExecution, - 64 | 0, - ], -]; -var StackSetAutoDeploymentTargetSummary = [3, n0, _SSADTS, 0, [_OUIr, _Re], [0, 64 | 0]]; -var StackSetDriftDetectionDetails = [ - 3, - n0, - _SSDDD, - 0, - [_DSr, _DDS, _LDCT, _TSIC, _DSIC, _ISSIC, _IPSIC, _FSIC], - [0, 0, 4, 1, 1, 1, 1, 1], -]; -var StackSetNotEmptyException = [ - -3, - n0, - _SSNEE, - { - [_e]: _c, - [_hE]: 409, - [_aQE]: [`StackSetNotEmptyException`, 409], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(StackSetNotEmptyException, StackSetNotEmptyException$1); -var StackSetNotFoundException = [ - -3, - n0, - _SSNFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`StackSetNotFoundException`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(StackSetNotFoundException, StackSetNotFoundException$1); -var StackSetOperation = [ - 3, - n0, - _SSO, - 0, - [_OI, _SSI, _Act, _S, _OP, _RS, _ARARN, _ERN, _CTr, _ETn, _DT, _SSDDD, _SR, _SDta], - [ - 0, - 0, - 0, - 0, - () => StackSetOperationPreferences, - 2, - 0, - 0, - 4, - 4, - () => DeploymentTargets, - () => StackSetDriftDetectionDetails, - 0, - () => StackSetOperationStatusDetails, - ], -]; -var StackSetOperationPreferences = [ - 3, - n0, - _SSOP, - 0, - [_RCT, _RO, _FTC, _FTP, _MCC, _MCP, _CM], - [0, 64 | 0, 1, 1, 1, 1, 0], -]; -var StackSetOperationResultSummary = [ - 3, - n0, - _SSORS, - 0, - [_Acc, _Reg, _S, _SR, _AGR, _OUIr], - [0, 0, 0, 0, () => AccountGateResult, 0], -]; -var StackSetOperationStatusDetails = [3, n0, _SSOSD, 0, [_FSIC], [1]]; -var StackSetOperationSummary = [ - 3, - n0, - _SSOS, - 0, - [_OI, _Act, _S, _CTr, _ETn, _SR, _SDta, _OP], - [0, 0, 0, 4, 4, 0, () => StackSetOperationStatusDetails, () => StackSetOperationPreferences], -]; -var StackSetSummary = [ - 3, - n0, - _SSS, - 0, - [_SSN, _SSI, _D, _S, _AD, _PM, _DSr, _LDCT, _ME], - [0, 0, 0, 0, () => AutoDeployment, 0, 0, 4, () => ManagedExecution], -]; -var StackSummary = [ - 3, - n0, - _SStac, - 0, - [_SI, _SN, _TDe, _CT, _LUT, _DTel, _SSta, _SSR, _PIa, _RIo, _DI, _LO], - [0, 0, 0, 4, 4, 4, 0, 0, 0, 0, () => StackDriftInformationSummary, () => LastOperations], -]; -var StaleRequestException = [ - -3, - n0, - _SRE, - { - [_e]: _c, - [_hE]: 409, - [_aQE]: [`StaleRequestException`, 409], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(StaleRequestException, StaleRequestException$1); -var StartResourceScanInput = [3, n0, _SRSI, 0, [_CRT, _SF], [0, () => ScanFilters]]; -var StartResourceScanOutput = [3, n0, _SRSO, 0, [_RSI], [0]]; -var StopStackSetOperationInput = [3, n0, _SSSOI, 0, [_SSN, _OI, _CA], [0, 0, 0]]; -var StopStackSetOperationOutput = [3, n0, _SSSOO, 0, [], []]; -var Tag = [3, n0, _Tag, 0, [_K, _V], [0, 0]]; -var TemplateConfiguration = [3, n0, _TCe, 0, [_DP, _URP], [0, 0]]; -var TemplateParameter = [3, n0, _TP, 0, [_PK, _DV, _NE, _D], [0, 0, 2, 0]]; -var TemplateProgress = [3, n0, _TPe, 0, [_RSeso, _RF, _RPe, _RPes], [1, 1, 1, 1]]; -var TemplateSummary = [ - 3, - n0, - _TSe, - 0, - [_GTI, _GTN, _S, _SR, _CT, _LUT, _NOR], - [0, 0, 0, 0, 4, 4, 1], -]; -var TemplateSummaryConfig = [3, n0, _TSC, 0, [_TURTAW], [2]]; -var TestTypeInput = [3, n0, _TTI, 0, [_A, _T, _TN, _VI, _LDB], [0, 0, 0, 0, 0]]; -var TestTypeOutput = [3, n0, _TTO, 0, [_TVA], [0]]; -var TokenAlreadyExistsException = [ - -3, - n0, - _TAEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`TokenAlreadyExistsException`, 400], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(TokenAlreadyExistsException, TokenAlreadyExistsException$1); -var TypeConfigurationDetails = [ - 3, - n0, - _TCD, - 0, - [_A, _Al, _Co, _LU, _TA, _TN, _IDC], - [0, 0, 0, 4, 0, 0, 2], -]; -var TypeConfigurationIdentifier = [ - 3, - n0, - _TCI, - 0, - [_TA, _TCA, _TCAy, _T, _TN], - [0, 0, 0, 0, 0], -]; -var TypeConfigurationNotFoundException = [ - -3, - n0, - _TCNFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`TypeConfigurationNotFoundException`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(TypeConfigurationNotFoundException, TypeConfigurationNotFoundException$1); -var TypeFilters = [3, n0, _TF, 0, [_Cat, _PI, _TNP], [0, 0, 0]]; -var TypeNotFoundException = [ - -3, - n0, - _TNFE, - { - [_e]: _c, - [_hE]: 404, - [_aQE]: [`TypeNotFoundException`, 404], - }, - [_M], - [0], -]; -schema.TypeRegistry.for(n0).registerError(TypeNotFoundException, TypeNotFoundException$1); -var TypeSummary = [ - 3, - n0, - _TSyp, - 0, - [_T, _TN, _DVI, _TA, _LU, _D, _PI, _OTN, _PVN, _LPV, _PIu, _PN, _IA], - [0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2], -]; -var TypeVersionSummary = [ - 3, - n0, - _TVSy, - 0, - [_T, _TN, _VI, _IDV, _A, _TCi, _D, _PVN], - [0, 0, 0, 2, 0, 4, 0, 0], -]; -var UpdateGeneratedTemplateInput = [ - 3, - n0, - _UGTI, - 0, - [_GTN, _NGTN, _AR, _RRem, _RAR, _TCe], - [0, 0, () => ResourceDefinitions, 64 | 0, 2, () => TemplateConfiguration], -]; -var UpdateGeneratedTemplateOutput = [3, n0, _UGTO, 0, [_GTI], [0]]; -var UpdateStackInput = [ - 3, - n0, - _USI, - 0, - [_SN, _TB, _TURL, _UPT, _SPDUB, _SPDUURL, _P, _Ca, _RTe, _RARN, _RCo, _SPB, _SPURL, _NARN, _Ta, _DR, _CRT, _REOC], - [ - 0, - 0, - 0, - 2, - 0, - 0, - () => _Parameters, - 64 | 0, - 64 | 0, - 0, - () => RollbackConfiguration, - 0, - 0, - 64 | 0, - () => Tags, - 2, - 0, - 2, - ], -]; -var UpdateStackInstancesInput = [ - 3, - n0, - _USII, - 0, - [_SSN, _Ac, _DT, _Re, _PO, _OP, _OI, _CA], - [0, 64 | 0, () => DeploymentTargets, 64 | 0, () => _Parameters, () => StackSetOperationPreferences, [0, 4], 0], -]; -var UpdateStackInstancesOutput = [3, n0, _USIO, 0, [_OI], [0]]; -var UpdateStackOutput = [3, n0, _USO, 0, [_SI, _OI], [0, 0]]; -var UpdateStackSetInput = [ - 3, - n0, - _USSI, - 0, - [_SSN, _D, _TB, _TURL, _UPT, _P, _Ca, _Ta, _OP, _ARARN, _ERN, _DT, _PM, _AD, _OI, _Ac, _Re, _CA, _ME], - [ - 0, - 0, - 0, - 0, - 2, - () => _Parameters, - 64 | 0, - () => Tags, - () => StackSetOperationPreferences, - 0, - 0, - () => DeploymentTargets, - 0, - () => AutoDeployment, - [0, 4], - 64 | 0, - 64 | 0, - 0, - () => ManagedExecution, - ], -]; -var UpdateStackSetOutput = [3, n0, _USSO, 0, [_OI], [0]]; -var UpdateTerminationProtectionInput = [3, n0, _UTPI, 0, [_ETP, _SN], [2, 0]]; -var UpdateTerminationProtectionOutput = [3, n0, _UTPO, 0, [_SI], [0]]; -var ValidateTemplateInput = [3, n0, _VTI, 0, [_TB, _TURL], [0, 0]]; -var ValidateTemplateOutput = [ - 3, - n0, - _VTO, - 0, - [_P, _D, _Ca, _CR, _DTe], - [() => TemplateParameters, 0, 64 | 0, 0, 64 | 0], -]; -var WarningDetail = [3, n0, _WD, 0, [_T, _Pro], [0, () => WarningProperties]]; -var WarningProperty = [3, n0, _WP, 0, [_PPr, _Req, _D], [0, 2, 0]]; -var Warnings = [3, n0, _W, 0, [_URT], [64 | 0]]; -var __Unit = "unit"; -var CloudFormationServiceException = [-3, _s, "CloudFormationServiceException", 0, [], []]; -schema.TypeRegistry.for(_s).registerError(CloudFormationServiceException, CloudFormationServiceException$1); -var AccountLimitList = [1, n0, _ALL, 0, () => AccountLimit]; -var AnnotationList = [1, n0, _ALn, 0, () => Annotation]; -var BatchDescribeTypeConfigurationsErrors = [ - 1, - n0, - _BDTCEa, - 0, - () => BatchDescribeTypeConfigurationsError, -]; -var Changes = [1, n0, _Ch, 0, () => Change]; -var ChangeSetHooks = [1, n0, _CSHh, 0, () => ChangeSetHook]; -var ChangeSetSummaries = [1, n0, _CSSh, 0, () => ChangeSetSummary]; -var Exports = [1, n0, _Exp, 0, () => Export]; -var HookResultSummaries = [1, n0, _HRSo, 0, () => HookResultSummary]; -var LastOperations = [1, n0, _LO, 0, () => OperationEntry]; -var OperationEvents = [1, n0, _OE, 0, () => OperationEvent]; -var OperationResultFilters = [1, n0, _ORFp, 0, () => OperationResultFilter]; -var Outputs = [1, n0, _Ou, 0, () => Output]; -var ParameterDeclarations = [1, n0, _PDa, 0, () => ParameterDeclaration]; -var _Parameters = [1, n0, _P, 0, () => Parameter]; -var PhysicalResourceIdContext = [1, n0, _PRIC, 0, () => PhysicalResourceIdContextKeyValuePair]; -var PropertyDifferences = [1, n0, _PDro, 0, () => PropertyDifference]; -var RelatedResources = [1, n0, _RRel, 0, () => ScannedResource]; -var RequiredActivatedTypes = [1, n0, _RAT, 0, () => RequiredActivatedType]; -var ResourceChangeDetails = [1, n0, _RCDe, 0, () => ResourceChangeDetail]; -var ResourceDefinitions = [1, n0, _RDes, 0, () => ResourceDefinition]; -var ResourceDetails = [1, n0, _RDeso, 0, () => ResourceDetail]; -var ResourceDriftIgnoredAttributes = [1, n0, _RDIA, 0, () => ResourceDriftIgnoredAttribute]; -var ResourceIdentifierSummaries = [1, n0, _RIS, 0, () => ResourceIdentifierSummary]; -var ResourceMappings = [1, n0, _RMe, 0, () => ResourceMapping]; -var ResourceScanSummaries = [1, n0, _RSS, 0, () => ResourceScanSummary]; -var ResourcesToImport = [1, n0, _RTI, 0, () => ResourceToImport]; -var RollbackTriggers = [1, n0, _RTo, 0, () => RollbackTrigger]; -var ScanFilters = [1, n0, _SF, 0, () => ScanFilter]; -var ScannedResourceIdentifiers = [1, n0, _SRIca, 0, () => ScannedResourceIdentifier]; -var ScannedResources = [1, n0, _SRca, 0, () => ScannedResource]; -var StackDefinitions = [1, n0, _SD, 0, () => StackDefinition]; -var StackEvents = [1, n0, _SE, 0, () => StackEvent]; -var StackInstanceFilters = [1, n0, _SIFt, 0, () => StackInstanceFilter]; -var StackInstanceResourceDriftsSummaries = [ - 1, - n0, - _SIRDSta, - 0, - () => StackInstanceResourceDriftsSummary, -]; -var StackInstanceSummaries = [1, n0, _SISta, 0, () => StackInstanceSummary]; -var StackRefactorActions = [1, n0, _SRA, 0, () => StackRefactorAction]; -var StackRefactorSummaries = [1, n0, _SRS, 0, () => StackRefactorSummary]; -var StackRefactorTagResources = [1, n0, _SRTR, 0, () => Tag]; -var StackResourceDrifts = [1, n0, _SRD, 0, () => StackResourceDrift]; -var StackResources = [1, n0, _SRt, 0, () => StackResource]; -var StackResourceSummaries = [1, n0, _SRSt, 0, () => StackResourceSummary]; -var Stacks = [1, n0, _St, 0, () => Stack]; -var StackSetAutoDeploymentTargetSummaries = [ - 1, - n0, - _SSADTSt, - 0, - () => StackSetAutoDeploymentTargetSummary, -]; -var StackSetOperationResultSummaries = [ - 1, - n0, - _SSORSt, - 0, - () => StackSetOperationResultSummary, -]; -var StackSetOperationSummaries = [1, n0, _SSOSt, 0, () => StackSetOperationSummary]; -var StackSetSummaries = [1, n0, _SSSt, 0, () => StackSetSummary]; -var StackSummaries = [1, n0, _SSt, 0, () => StackSummary]; -var Tags = [1, n0, _Ta, 0, () => Tag]; -var TemplateParameters = [1, n0, _TPem, 0, () => TemplateParameter]; -var TemplateSummaries = [1, n0, _TSem, 0, () => TemplateSummary]; -var TypeConfigurationDetailsList = [1, n0, _TCDL, 0, () => TypeConfigurationDetails]; -var TypeConfigurationIdentifiers = [1, n0, _TCIy, 0, () => TypeConfigurationIdentifier]; -var TypeSummaries = [1, n0, _TSy, 0, () => TypeSummary]; -var TypeVersionSummaries = [1, n0, _TVS, 0, () => TypeVersionSummary]; -var UnprocessedTypeConfigurations = [1, n0, _UTC, 0, () => TypeConfigurationIdentifier]; -var WarningDetails = [1, n0, _WDa, 0, () => WarningDetail]; -var WarningProperties = [1, n0, _WPa, 0, () => WarningProperty]; -var ActivateOrganizationsAccess = [ - 9, - n0, - _AOA, - 0, - () => ActivateOrganizationsAccessInput, - () => ActivateOrganizationsAccessOutput, -]; -var ActivateType = [9, n0, _AT, 2, () => ActivateTypeInput, () => ActivateTypeOutput]; -var BatchDescribeTypeConfigurations = [ - 9, - n0, - _BDTC, - 0, - () => BatchDescribeTypeConfigurationsInput, - () => BatchDescribeTypeConfigurationsOutput, -]; -var CancelUpdateStack = [9, n0, _CUS, 0, () => CancelUpdateStackInput, () => __Unit]; -var ContinueUpdateRollback = [ - 9, - n0, - _CUR, - 0, - () => ContinueUpdateRollbackInput, - () => ContinueUpdateRollbackOutput, -]; -var CreateChangeSet = [ - 9, - n0, - _CCS, - 0, - () => CreateChangeSetInput, - () => CreateChangeSetOutput, -]; -var CreateGeneratedTemplate = [ - 9, - n0, - _CGT, - 0, - () => CreateGeneratedTemplateInput, - () => CreateGeneratedTemplateOutput, -]; -var CreateStack = [9, n0, _CSr, 0, () => CreateStackInput, () => CreateStackOutput]; -var CreateStackInstances = [ - 9, - n0, - _CSIre, - 0, - () => CreateStackInstancesInput, - () => CreateStackInstancesOutput, -]; -var CreateStackRefactor = [ - 9, - n0, - _CSR, - 0, - () => CreateStackRefactorInput, - () => CreateStackRefactorOutput, -]; -var CreateStackSet = [ - 9, - n0, - _CSSr, - 0, - () => CreateStackSetInput, - () => CreateStackSetOutput, -]; -var DeactivateOrganizationsAccess = [ - 9, - n0, - _DOA, - 0, - () => DeactivateOrganizationsAccessInput, - () => DeactivateOrganizationsAccessOutput, -]; -var DeactivateType = [ - 9, - n0, - _DTea, - 2, - () => DeactivateTypeInput, - () => DeactivateTypeOutput, -]; -var DeleteChangeSet = [ - 9, - n0, - _DCS, - 0, - () => DeleteChangeSetInput, - () => DeleteChangeSetOutput, -]; -var DeleteGeneratedTemplate = [ - 9, - n0, - _DGT, - 0, - () => DeleteGeneratedTemplateInput, - () => __Unit, -]; -var DeleteStack = [9, n0, _DSel, 0, () => DeleteStackInput, () => __Unit]; -var DeleteStackInstances = [ - 9, - n0, - _DSIel, - 0, - () => DeleteStackInstancesInput, - () => DeleteStackInstancesOutput, -]; -var DeleteStackSet = [ - 9, - n0, - _DSS, - 0, - () => DeleteStackSetInput, - () => DeleteStackSetOutput, -]; -var DeregisterType = [ - 9, - n0, - _DTer, - 2, - () => DeregisterTypeInput, - () => DeregisterTypeOutput, -]; -var DescribeAccountLimits = [ - 9, - n0, - _DAL, - 0, - () => DescribeAccountLimitsInput, - () => DescribeAccountLimitsOutput, -]; -var DescribeChangeSet = [ - 9, - n0, - _DCSe, - 0, - () => DescribeChangeSetInput, - () => DescribeChangeSetOutput, -]; -var DescribeChangeSetHooks = [ - 9, - n0, - _DCSH, - 0, - () => DescribeChangeSetHooksInput, - () => DescribeChangeSetHooksOutput, -]; -var DescribeEvents = [ - 9, - n0, - _DE, - 0, - () => DescribeEventsInput, - () => DescribeEventsOutput, -]; -var DescribeGeneratedTemplate = [ - 9, - n0, - _DGTe, - 0, - () => DescribeGeneratedTemplateInput, - () => DescribeGeneratedTemplateOutput, -]; -var DescribeOrganizationsAccess = [ - 9, - n0, - _DOAe, - 0, - () => DescribeOrganizationsAccessInput, - () => DescribeOrganizationsAccessOutput, -]; -var DescribePublisher = [ - 9, - n0, - _DPe, - 2, - () => DescribePublisherInput, - () => DescribePublisherOutput, -]; -var DescribeResourceScan = [ - 9, - n0, - _DRS, - 0, - () => DescribeResourceScanInput, - () => DescribeResourceScanOutput, -]; -var DescribeStackDriftDetectionStatus = [ - 9, - n0, - _DSDDS, - 0, - () => DescribeStackDriftDetectionStatusInput, - () => DescribeStackDriftDetectionStatusOutput, -]; -var DescribeStackEvents = [ - 9, - n0, - _DSE, - 0, - () => DescribeStackEventsInput, - () => DescribeStackEventsOutput, -]; -var DescribeStackInstance = [ - 9, - n0, - _DSIes, - 0, - () => DescribeStackInstanceInput, - () => DescribeStackInstanceOutput, -]; -var DescribeStackRefactor = [ - 9, - n0, - _DSRe, - 0, - () => DescribeStackRefactorInput, - () => DescribeStackRefactorOutput, -]; -var DescribeStackResource = [ - 9, - n0, - _DSRes, - 0, - () => DescribeStackResourceInput, - () => DescribeStackResourceOutput, -]; -var DescribeStackResourceDrifts = [ - 9, - n0, - _DSRD, - 0, - () => DescribeStackResourceDriftsInput, - () => DescribeStackResourceDriftsOutput, -]; -var DescribeStackResources = [ - 9, - n0, - _DSResc, - 0, - () => DescribeStackResourcesInput, - () => DescribeStackResourcesOutput, -]; -var DescribeStacks = [ - 9, - n0, - _DSes, - 0, - () => DescribeStacksInput, - () => DescribeStacksOutput, -]; -var DescribeStackSet = [ - 9, - n0, - _DSSe, - 0, - () => DescribeStackSetInput, - () => DescribeStackSetOutput, -]; -var DescribeStackSetOperation = [ - 9, - n0, - _DSSOes, - 0, - () => DescribeStackSetOperationInput, - () => DescribeStackSetOperationOutput, -]; -var DescribeType = [9, n0, _DTes, 2, () => DescribeTypeInput, () => DescribeTypeOutput]; -var DescribeTypeRegistration = [ - 9, - n0, - _DTR, - 2, - () => DescribeTypeRegistrationInput, - () => DescribeTypeRegistrationOutput, -]; -var DetectStackDrift = [ - 9, - n0, - _DSD, - 0, - () => DetectStackDriftInput, - () => DetectStackDriftOutput, -]; -var DetectStackResourceDrift = [ - 9, - n0, - _DSRDe, - 0, - () => DetectStackResourceDriftInput, - () => DetectStackResourceDriftOutput, -]; -var DetectStackSetDrift = [ - 9, - n0, - _DSSD, - 0, - () => DetectStackSetDriftInput, - () => DetectStackSetDriftOutput, -]; -var EstimateTemplateCost = [ - 9, - n0, - _ETC, - 0, - () => EstimateTemplateCostInput, - () => EstimateTemplateCostOutput, -]; -var ExecuteChangeSet = [ - 9, - n0, - _ECS, - 0, - () => ExecuteChangeSetInput, - () => ExecuteChangeSetOutput, -]; -var ExecuteStackRefactor = [ - 9, - n0, - _ESRx, - 0, - () => ExecuteStackRefactorInput, - () => __Unit, -]; -var GetGeneratedTemplate = [ - 9, - n0, - _GGT, - 0, - () => GetGeneratedTemplateInput, - () => GetGeneratedTemplateOutput, -]; -var GetHookResult = [9, n0, _GHR, 0, () => GetHookResultInput, () => GetHookResultOutput]; -var GetStackPolicy = [ - 9, - n0, - _GSP, - 0, - () => GetStackPolicyInput, - () => GetStackPolicyOutput, -]; -var GetTemplate = [9, n0, _GT, 0, () => GetTemplateInput, () => GetTemplateOutput]; -var GetTemplateSummary = [ - 9, - n0, - _GTS, - 0, - () => GetTemplateSummaryInput, - () => GetTemplateSummaryOutput, -]; -var ImportStacksToStackSet = [ - 9, - n0, - _ISTSS, - 0, - () => ImportStacksToStackSetInput, - () => ImportStacksToStackSetOutput, -]; -var ListChangeSets = [ - 9, - n0, - _LCS, - 0, - () => ListChangeSetsInput, - () => ListChangeSetsOutput, -]; -var ListExports = [9, n0, _LE, 0, () => ListExportsInput, () => ListExportsOutput]; -var ListGeneratedTemplates = [ - 9, - n0, - _LGT, - 0, - () => ListGeneratedTemplatesInput, - () => ListGeneratedTemplatesOutput, -]; -var ListHookResults = [ - 9, - n0, - _LHR, - 0, - () => ListHookResultsInput, - () => ListHookResultsOutput, -]; -var ListImports = [9, n0, _LI, 0, () => ListImportsInput, () => ListImportsOutput]; -var ListResourceScanRelatedResources = [ - 9, - n0, - _LRSRR, - 0, - () => ListResourceScanRelatedResourcesInput, - () => ListResourceScanRelatedResourcesOutput, -]; -var ListResourceScanResources = [ - 9, - n0, - _LRSR, - 0, - () => ListResourceScanResourcesInput, - () => ListResourceScanResourcesOutput, -]; -var ListResourceScans = [ - 9, - n0, - _LRS, - 0, - () => ListResourceScansInput, - () => ListResourceScansOutput, -]; -var ListStackInstanceResourceDrifts = [ - 9, - n0, - _LSIRD, - 0, - () => ListStackInstanceResourceDriftsInput, - () => ListStackInstanceResourceDriftsOutput, -]; -var ListStackInstances = [ - 9, - n0, - _LSIi, - 0, - () => ListStackInstancesInput, - () => ListStackInstancesOutput, -]; -var ListStackRefactorActions = [ - 9, - n0, - _LSRA, - 0, - () => ListStackRefactorActionsInput, - () => ListStackRefactorActionsOutput, -]; -var ListStackRefactors = [ - 9, - n0, - _LSR, - 0, - () => ListStackRefactorsInput, - () => ListStackRefactorsOutput, -]; -var ListStackResources = [ - 9, - n0, - _LSRi, - 0, - () => ListStackResourcesInput, - () => ListStackResourcesOutput, -]; -var ListStacks = [9, n0, _LS, 0, () => ListStacksInput, () => ListStacksOutput]; -var ListStackSetAutoDeploymentTargets = [ - 9, - n0, - _LSSADT, - 0, - () => ListStackSetAutoDeploymentTargetsInput, - () => ListStackSetAutoDeploymentTargetsOutput, -]; -var ListStackSetOperationResults = [ - 9, - n0, - _LSSOR, - 0, - () => ListStackSetOperationResultsInput, - () => ListStackSetOperationResultsOutput, -]; -var ListStackSetOperations = [ - 9, - n0, - _LSSOi, - 0, - () => ListStackSetOperationsInput, - () => ListStackSetOperationsOutput, -]; -var ListStackSets = [9, n0, _LSS, 0, () => ListStackSetsInput, () => ListStackSetsOutput]; -var ListTypeRegistrations = [ - 9, - n0, - _LTR, - 2, - () => ListTypeRegistrationsInput, - () => ListTypeRegistrationsOutput, -]; -var ListTypes = [9, n0, _LT, 2, () => ListTypesInput, () => ListTypesOutput]; -var ListTypeVersions = [ - 9, - n0, - _LTV, - 2, - () => ListTypeVersionsInput, - () => ListTypeVersionsOutput, -]; -var PublishType = [9, n0, _PTu, 2, () => PublishTypeInput, () => PublishTypeOutput]; -var RecordHandlerProgress = [ - 9, - n0, - _RHP, - 2, - () => RecordHandlerProgressInput, - () => RecordHandlerProgressOutput, -]; -var RegisterPublisher = [ - 9, - n0, - _RPeg, - 2, - () => RegisterPublisherInput, - () => RegisterPublisherOutput, -]; -var RegisterType = [9, n0, _RTegi, 2, () => RegisterTypeInput, () => RegisterTypeOutput]; -var RollbackStack = [9, n0, _RSo, 0, () => RollbackStackInput, () => RollbackStackOutput]; -var SetStackPolicy = [9, n0, _SSP, 0, () => SetStackPolicyInput, () => __Unit]; -var SetTypeConfiguration = [ - 9, - n0, - _STC, - 0, - () => SetTypeConfigurationInput, - () => SetTypeConfigurationOutput, -]; -var SetTypeDefaultVersion = [ - 9, - n0, - _STDV, - 2, - () => SetTypeDefaultVersionInput, - () => SetTypeDefaultVersionOutput, -]; -var SignalResource = [9, n0, _SRi, 0, () => SignalResourceInput, () => __Unit]; -var StartResourceScan = [ - 9, - n0, - _SRStar, - 0, - () => StartResourceScanInput, - () => StartResourceScanOutput, -]; -var StopStackSetOperation = [ - 9, - n0, - _SSSO, - 0, - () => StopStackSetOperationInput, - () => StopStackSetOperationOutput, -]; -var TestType = [9, n0, _TTe, 2, () => TestTypeInput, () => TestTypeOutput]; -var UpdateGeneratedTemplate = [ - 9, - n0, - _UGT, - 0, - () => UpdateGeneratedTemplateInput, - () => UpdateGeneratedTemplateOutput, -]; -var UpdateStack = [9, n0, _US, 0, () => UpdateStackInput, () => UpdateStackOutput]; -var UpdateStackInstances = [ - 9, - n0, - _USIp, - 0, - () => UpdateStackInstancesInput, - () => UpdateStackInstancesOutput, -]; -var UpdateStackSet = [ - 9, - n0, - _USS, - 0, - () => UpdateStackSetInput, - () => UpdateStackSetOutput, -]; -var UpdateTerminationProtection = [ - 9, - n0, - _UTP, - 0, - () => UpdateTerminationProtectionInput, - () => UpdateTerminationProtectionOutput, -]; -var ValidateTemplate = [ - 9, - n0, - _VT, - 0, - () => ValidateTemplateInput, - () => ValidateTemplateOutput, -]; +class BatchDescribeTypeConfigurationsCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "BatchDescribeTypeConfigurations", {}) + .n("CloudFormationClient", "BatchDescribeTypeConfigurationsCommand") + .sc(schemas_0.BatchDescribeTypeConfigurations$) + .build() { +} + +class CancelUpdateStackCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "CancelUpdateStack", {}) + .n("CloudFormationClient", "CancelUpdateStackCommand") + .sc(schemas_0.CancelUpdateStack$) + .build() { +} + +class ContinueUpdateRollbackCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "ContinueUpdateRollback", {}) + .n("CloudFormationClient", "ContinueUpdateRollbackCommand") + .sc(schemas_0.ContinueUpdateRollback$) + .build() { +} + +class CreateChangeSetCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "CreateChangeSet", {}) + .n("CloudFormationClient", "CreateChangeSetCommand") + .sc(schemas_0.CreateChangeSet$) + .build() { +} + +class CreateGeneratedTemplateCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "CreateGeneratedTemplate", {}) + .n("CloudFormationClient", "CreateGeneratedTemplateCommand") + .sc(schemas_0.CreateGeneratedTemplate$) + .build() { +} + +class CreateStackCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "CreateStack", {}) + .n("CloudFormationClient", "CreateStackCommand") + .sc(schemas_0.CreateStack$) + .build() { +} + +class CreateStackInstancesCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "CreateStackInstances", {}) + .n("CloudFormationClient", "CreateStackInstancesCommand") + .sc(schemas_0.CreateStackInstances$) + .build() { +} + +class CreateStackRefactorCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "CreateStackRefactor", {}) + .n("CloudFormationClient", "CreateStackRefactorCommand") + .sc(schemas_0.CreateStackRefactor$) + .build() { +} + +class CreateStackSetCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "CreateStackSet", {}) + .n("CloudFormationClient", "CreateStackSetCommand") + .sc(schemas_0.CreateStackSet$) + .build() { +} + +class DeactivateOrganizationsAccessCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DeactivateOrganizationsAccess", {}) + .n("CloudFormationClient", "DeactivateOrganizationsAccessCommand") + .sc(schemas_0.DeactivateOrganizationsAccess$) + .build() { +} + +class DeactivateTypeCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DeactivateType", {}) + .n("CloudFormationClient", "DeactivateTypeCommand") + .sc(schemas_0.DeactivateType$) + .build() { +} + +class DeleteChangeSetCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DeleteChangeSet", {}) + .n("CloudFormationClient", "DeleteChangeSetCommand") + .sc(schemas_0.DeleteChangeSet$) + .build() { +} + +class DeleteGeneratedTemplateCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DeleteGeneratedTemplate", {}) + .n("CloudFormationClient", "DeleteGeneratedTemplateCommand") + .sc(schemas_0.DeleteGeneratedTemplate$) + .build() { +} + +class DeleteStackCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DeleteStack", {}) + .n("CloudFormationClient", "DeleteStackCommand") + .sc(schemas_0.DeleteStack$) + .build() { +} + +class DeleteStackInstancesCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DeleteStackInstances", {}) + .n("CloudFormationClient", "DeleteStackInstancesCommand") + .sc(schemas_0.DeleteStackInstances$) + .build() { +} + +class DeleteStackSetCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DeleteStackSet", {}) + .n("CloudFormationClient", "DeleteStackSetCommand") + .sc(schemas_0.DeleteStackSet$) + .build() { +} + +class DeregisterTypeCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DeregisterType", {}) + .n("CloudFormationClient", "DeregisterTypeCommand") + .sc(schemas_0.DeregisterType$) + .build() { +} + +class DescribeAccountLimitsCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeAccountLimits", {}) + .n("CloudFormationClient", "DescribeAccountLimitsCommand") + .sc(schemas_0.DescribeAccountLimits$) + .build() { +} + +class DescribeChangeSetCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeChangeSet", {}) + .n("CloudFormationClient", "DescribeChangeSetCommand") + .sc(schemas_0.DescribeChangeSet$) + .build() { +} + +class DescribeChangeSetHooksCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeChangeSetHooks", {}) + .n("CloudFormationClient", "DescribeChangeSetHooksCommand") + .sc(schemas_0.DescribeChangeSetHooks$) + .build() { +} + +class DescribeEventsCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeEvents", {}) + .n("CloudFormationClient", "DescribeEventsCommand") + .sc(schemas_0.DescribeEvents$) + .build() { +} + +class DescribeGeneratedTemplateCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeGeneratedTemplate", {}) + .n("CloudFormationClient", "DescribeGeneratedTemplateCommand") + .sc(schemas_0.DescribeGeneratedTemplate$) + .build() { +} + +class DescribeOrganizationsAccessCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeOrganizationsAccess", {}) + .n("CloudFormationClient", "DescribeOrganizationsAccessCommand") + .sc(schemas_0.DescribeOrganizationsAccess$) + .build() { +} + +class DescribePublisherCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribePublisher", {}) + .n("CloudFormationClient", "DescribePublisherCommand") + .sc(schemas_0.DescribePublisher$) + .build() { +} + +class DescribeResourceScanCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeResourceScan", {}) + .n("CloudFormationClient", "DescribeResourceScanCommand") + .sc(schemas_0.DescribeResourceScan$) + .build() { +} + +class DescribeStackDriftDetectionStatusCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackDriftDetectionStatus", {}) + .n("CloudFormationClient", "DescribeStackDriftDetectionStatusCommand") + .sc(schemas_0.DescribeStackDriftDetectionStatus$) + .build() { +} + +class DescribeStackEventsCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackEvents", {}) + .n("CloudFormationClient", "DescribeStackEventsCommand") + .sc(schemas_0.DescribeStackEvents$) + .build() { +} + +class DescribeStackInstanceCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackInstance", {}) + .n("CloudFormationClient", "DescribeStackInstanceCommand") + .sc(schemas_0.DescribeStackInstance$) + .build() { +} + +class DescribeStackRefactorCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackRefactor", {}) + .n("CloudFormationClient", "DescribeStackRefactorCommand") + .sc(schemas_0.DescribeStackRefactor$) + .build() { +} + +class DescribeStackResourceCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackResource", {}) + .n("CloudFormationClient", "DescribeStackResourceCommand") + .sc(schemas_0.DescribeStackResource$) + .build() { +} + +class DescribeStackResourceDriftsCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackResourceDrifts", {}) + .n("CloudFormationClient", "DescribeStackResourceDriftsCommand") + .sc(schemas_0.DescribeStackResourceDrifts$) + .build() { +} + +class DescribeStackResourcesCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackResources", {}) + .n("CloudFormationClient", "DescribeStackResourcesCommand") + .sc(schemas_0.DescribeStackResources$) + .build() { +} + +class DescribeStacksCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStacks", {}) + .n("CloudFormationClient", "DescribeStacksCommand") + .sc(schemas_0.DescribeStacks$) + .build() { +} + +class DescribeStackSetCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackSet", {}) + .n("CloudFormationClient", "DescribeStackSetCommand") + .sc(schemas_0.DescribeStackSet$) + .build() { +} + +class DescribeStackSetOperationCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeStackSetOperation", {}) + .n("CloudFormationClient", "DescribeStackSetOperationCommand") + .sc(schemas_0.DescribeStackSetOperation$) + .build() { +} + +class DescribeTypeCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeType", {}) + .n("CloudFormationClient", "DescribeTypeCommand") + .sc(schemas_0.DescribeType$) + .build() { +} + +class DescribeTypeRegistrationCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DescribeTypeRegistration", {}) + .n("CloudFormationClient", "DescribeTypeRegistrationCommand") + .sc(schemas_0.DescribeTypeRegistration$) + .build() { +} + +class DetectStackDriftCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DetectStackDrift", {}) + .n("CloudFormationClient", "DetectStackDriftCommand") + .sc(schemas_0.DetectStackDrift$) + .build() { +} + +class DetectStackResourceDriftCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DetectStackResourceDrift", {}) + .n("CloudFormationClient", "DetectStackResourceDriftCommand") + .sc(schemas_0.DetectStackResourceDrift$) + .build() { +} + +class DetectStackSetDriftCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "DetectStackSetDrift", {}) + .n("CloudFormationClient", "DetectStackSetDriftCommand") + .sc(schemas_0.DetectStackSetDrift$) + .build() { +} + +class EstimateTemplateCostCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "EstimateTemplateCost", {}) + .n("CloudFormationClient", "EstimateTemplateCostCommand") + .sc(schemas_0.EstimateTemplateCost$) + .build() { +} -class ActivateOrganizationsAccessCommand extends smithyClient.Command +class ExecuteChangeSetCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "ActivateOrganizationsAccess", {}) - .n("CloudFormationClient", "ActivateOrganizationsAccessCommand") - .sc(ActivateOrganizationsAccess) + .s("CloudFormation", "ExecuteChangeSet", {}) + .n("CloudFormationClient", "ExecuteChangeSetCommand") + .sc(schemas_0.ExecuteChangeSet$) .build() { } -class ActivateTypeCommand extends smithyClient.Command +class ExecuteStackRefactorCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "ActivateType", {}) - .n("CloudFormationClient", "ActivateTypeCommand") - .sc(ActivateType) + .s("CloudFormation", "ExecuteStackRefactor", {}) + .n("CloudFormationClient", "ExecuteStackRefactorCommand") + .sc(schemas_0.ExecuteStackRefactor$) .build() { } -class BatchDescribeTypeConfigurationsCommand extends smithyClient.Command +class GetGeneratedTemplateCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "BatchDescribeTypeConfigurations", {}) - .n("CloudFormationClient", "BatchDescribeTypeConfigurationsCommand") - .sc(BatchDescribeTypeConfigurations) + .s("CloudFormation", "GetGeneratedTemplate", {}) + .n("CloudFormationClient", "GetGeneratedTemplateCommand") + .sc(schemas_0.GetGeneratedTemplate$) .build() { } -class CancelUpdateStackCommand extends smithyClient.Command +class GetHookResultCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "CancelUpdateStack", {}) - .n("CloudFormationClient", "CancelUpdateStackCommand") - .sc(CancelUpdateStack) + .s("CloudFormation", "GetHookResult", {}) + .n("CloudFormationClient", "GetHookResultCommand") + .sc(schemas_0.GetHookResult$) .build() { } -class ContinueUpdateRollbackCommand extends smithyClient.Command +class GetStackPolicyCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "ContinueUpdateRollback", {}) - .n("CloudFormationClient", "ContinueUpdateRollbackCommand") - .sc(ContinueUpdateRollback) + .s("CloudFormation", "GetStackPolicy", {}) + .n("CloudFormationClient", "GetStackPolicyCommand") + .sc(schemas_0.GetStackPolicy$) .build() { } -class CreateChangeSetCommand extends smithyClient.Command +class GetTemplateCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "CreateChangeSet", {}) - .n("CloudFormationClient", "CreateChangeSetCommand") - .sc(CreateChangeSet) + .s("CloudFormation", "GetTemplate", {}) + .n("CloudFormationClient", "GetTemplateCommand") + .sc(schemas_0.GetTemplate$) .build() { } -class CreateGeneratedTemplateCommand extends smithyClient.Command +class GetTemplateSummaryCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "CreateGeneratedTemplate", {}) - .n("CloudFormationClient", "CreateGeneratedTemplateCommand") - .sc(CreateGeneratedTemplate) + .s("CloudFormation", "GetTemplateSummary", {}) + .n("CloudFormationClient", "GetTemplateSummaryCommand") + .sc(schemas_0.GetTemplateSummary$) .build() { } -class CreateStackCommand extends smithyClient.Command +class ImportStacksToStackSetCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "CreateStack", {}) - .n("CloudFormationClient", "CreateStackCommand") - .sc(CreateStack) + .s("CloudFormation", "ImportStacksToStackSet", {}) + .n("CloudFormationClient", "ImportStacksToStackSetCommand") + .sc(schemas_0.ImportStacksToStackSet$) .build() { } -class CreateStackInstancesCommand extends smithyClient.Command +class ListChangeSetsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "CreateStackInstances", {}) - .n("CloudFormationClient", "CreateStackInstancesCommand") - .sc(CreateStackInstances) + .s("CloudFormation", "ListChangeSets", {}) + .n("CloudFormationClient", "ListChangeSetsCommand") + .sc(schemas_0.ListChangeSets$) .build() { } -class CreateStackRefactorCommand extends smithyClient.Command +class ListExportsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "CreateStackRefactor", {}) - .n("CloudFormationClient", "CreateStackRefactorCommand") - .sc(CreateStackRefactor) + .s("CloudFormation", "ListExports", {}) + .n("CloudFormationClient", "ListExportsCommand") + .sc(schemas_0.ListExports$) .build() { } -class CreateStackSetCommand extends smithyClient.Command +class ListGeneratedTemplatesCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "CreateStackSet", {}) - .n("CloudFormationClient", "CreateStackSetCommand") - .sc(CreateStackSet) + .s("CloudFormation", "ListGeneratedTemplates", {}) + .n("CloudFormationClient", "ListGeneratedTemplatesCommand") + .sc(schemas_0.ListGeneratedTemplates$) .build() { } -class DeactivateOrganizationsAccessCommand extends smithyClient.Command +class ListHookResultsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DeactivateOrganizationsAccess", {}) - .n("CloudFormationClient", "DeactivateOrganizationsAccessCommand") - .sc(DeactivateOrganizationsAccess) + .s("CloudFormation", "ListHookResults", {}) + .n("CloudFormationClient", "ListHookResultsCommand") + .sc(schemas_0.ListHookResults$) .build() { } -class DeactivateTypeCommand extends smithyClient.Command +class ListImportsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DeactivateType", {}) - .n("CloudFormationClient", "DeactivateTypeCommand") - .sc(DeactivateType) + .s("CloudFormation", "ListImports", {}) + .n("CloudFormationClient", "ListImportsCommand") + .sc(schemas_0.ListImports$) .build() { } -class DeleteChangeSetCommand extends smithyClient.Command +class ListResourceScanRelatedResourcesCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DeleteChangeSet", {}) - .n("CloudFormationClient", "DeleteChangeSetCommand") - .sc(DeleteChangeSet) + .s("CloudFormation", "ListResourceScanRelatedResources", {}) + .n("CloudFormationClient", "ListResourceScanRelatedResourcesCommand") + .sc(schemas_0.ListResourceScanRelatedResources$) .build() { } -class DeleteGeneratedTemplateCommand extends smithyClient.Command +class ListResourceScanResourcesCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DeleteGeneratedTemplate", {}) - .n("CloudFormationClient", "DeleteGeneratedTemplateCommand") - .sc(DeleteGeneratedTemplate) + .s("CloudFormation", "ListResourceScanResources", {}) + .n("CloudFormationClient", "ListResourceScanResourcesCommand") + .sc(schemas_0.ListResourceScanResources$) .build() { } -class DeleteStackCommand extends smithyClient.Command +class ListResourceScansCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DeleteStack", {}) - .n("CloudFormationClient", "DeleteStackCommand") - .sc(DeleteStack) + .s("CloudFormation", "ListResourceScans", {}) + .n("CloudFormationClient", "ListResourceScansCommand") + .sc(schemas_0.ListResourceScans$) .build() { } -class DeleteStackInstancesCommand extends smithyClient.Command +class ListStackInstanceResourceDriftsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DeleteStackInstances", {}) - .n("CloudFormationClient", "DeleteStackInstancesCommand") - .sc(DeleteStackInstances) + .s("CloudFormation", "ListStackInstanceResourceDrifts", {}) + .n("CloudFormationClient", "ListStackInstanceResourceDriftsCommand") + .sc(schemas_0.ListStackInstanceResourceDrifts$) .build() { } -class DeleteStackSetCommand extends smithyClient.Command +class ListStackInstancesCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DeleteStackSet", {}) - .n("CloudFormationClient", "DeleteStackSetCommand") - .sc(DeleteStackSet) + .s("CloudFormation", "ListStackInstances", {}) + .n("CloudFormationClient", "ListStackInstancesCommand") + .sc(schemas_0.ListStackInstances$) .build() { } -class DeregisterTypeCommand extends smithyClient.Command +class ListStackRefactorActionsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DeregisterType", {}) - .n("CloudFormationClient", "DeregisterTypeCommand") - .sc(DeregisterType) + .s("CloudFormation", "ListStackRefactorActions", {}) + .n("CloudFormationClient", "ListStackRefactorActionsCommand") + .sc(schemas_0.ListStackRefactorActions$) .build() { } -class DescribeAccountLimitsCommand extends smithyClient.Command +class ListStackRefactorsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeAccountLimits", {}) - .n("CloudFormationClient", "DescribeAccountLimitsCommand") - .sc(DescribeAccountLimits) + .s("CloudFormation", "ListStackRefactors", {}) + .n("CloudFormationClient", "ListStackRefactorsCommand") + .sc(schemas_0.ListStackRefactors$) .build() { } -class DescribeChangeSetCommand extends smithyClient.Command +class ListStackResourcesCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeChangeSet", {}) - .n("CloudFormationClient", "DescribeChangeSetCommand") - .sc(DescribeChangeSet) + .s("CloudFormation", "ListStackResources", {}) + .n("CloudFormationClient", "ListStackResourcesCommand") + .sc(schemas_0.ListStackResources$) .build() { } -class DescribeChangeSetHooksCommand extends smithyClient.Command +class ListStacksCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeChangeSetHooks", {}) - .n("CloudFormationClient", "DescribeChangeSetHooksCommand") - .sc(DescribeChangeSetHooks) + .s("CloudFormation", "ListStacks", {}) + .n("CloudFormationClient", "ListStacksCommand") + .sc(schemas_0.ListStacks$) .build() { } -class DescribeEventsCommand extends smithyClient.Command +class ListStackSetAutoDeploymentTargetsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeEvents", {}) - .n("CloudFormationClient", "DescribeEventsCommand") - .sc(DescribeEvents) + .s("CloudFormation", "ListStackSetAutoDeploymentTargets", {}) + .n("CloudFormationClient", "ListStackSetAutoDeploymentTargetsCommand") + .sc(schemas_0.ListStackSetAutoDeploymentTargets$) .build() { } -class DescribeGeneratedTemplateCommand extends smithyClient.Command +class ListStackSetOperationResultsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeGeneratedTemplate", {}) - .n("CloudFormationClient", "DescribeGeneratedTemplateCommand") - .sc(DescribeGeneratedTemplate) + .s("CloudFormation", "ListStackSetOperationResults", {}) + .n("CloudFormationClient", "ListStackSetOperationResultsCommand") + .sc(schemas_0.ListStackSetOperationResults$) .build() { } -class DescribeOrganizationsAccessCommand extends smithyClient.Command +class ListStackSetOperationsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeOrganizationsAccess", {}) - .n("CloudFormationClient", "DescribeOrganizationsAccessCommand") - .sc(DescribeOrganizationsAccess) + .s("CloudFormation", "ListStackSetOperations", {}) + .n("CloudFormationClient", "ListStackSetOperationsCommand") + .sc(schemas_0.ListStackSetOperations$) .build() { } -class DescribePublisherCommand extends smithyClient.Command +class ListStackSetsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribePublisher", {}) - .n("CloudFormationClient", "DescribePublisherCommand") - .sc(DescribePublisher) + .s("CloudFormation", "ListStackSets", {}) + .n("CloudFormationClient", "ListStackSetsCommand") + .sc(schemas_0.ListStackSets$) .build() { } -class DescribeResourceScanCommand extends smithyClient.Command +class ListTypeRegistrationsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeResourceScan", {}) - .n("CloudFormationClient", "DescribeResourceScanCommand") - .sc(DescribeResourceScan) + .s("CloudFormation", "ListTypeRegistrations", {}) + .n("CloudFormationClient", "ListTypeRegistrationsCommand") + .sc(schemas_0.ListTypeRegistrations$) .build() { } -class DescribeStackDriftDetectionStatusCommand extends smithyClient.Command +class ListTypesCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackDriftDetectionStatus", {}) - .n("CloudFormationClient", "DescribeStackDriftDetectionStatusCommand") - .sc(DescribeStackDriftDetectionStatus) + .s("CloudFormation", "ListTypes", {}) + .n("CloudFormationClient", "ListTypesCommand") + .sc(schemas_0.ListTypes$) .build() { } -class DescribeStackEventsCommand extends smithyClient.Command +class ListTypeVersionsCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackEvents", {}) - .n("CloudFormationClient", "DescribeStackEventsCommand") - .sc(DescribeStackEvents) + .s("CloudFormation", "ListTypeVersions", {}) + .n("CloudFormationClient", "ListTypeVersionsCommand") + .sc(schemas_0.ListTypeVersions$) .build() { } -class DescribeStackInstanceCommand extends smithyClient.Command +class PublishTypeCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackInstance", {}) - .n("CloudFormationClient", "DescribeStackInstanceCommand") - .sc(DescribeStackInstance) + .s("CloudFormation", "PublishType", {}) + .n("CloudFormationClient", "PublishTypeCommand") + .sc(schemas_0.PublishType$) .build() { } -class DescribeStackRefactorCommand extends smithyClient.Command +class RecordHandlerProgressCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackRefactor", {}) - .n("CloudFormationClient", "DescribeStackRefactorCommand") - .sc(DescribeStackRefactor) + .s("CloudFormation", "RecordHandlerProgress", {}) + .n("CloudFormationClient", "RecordHandlerProgressCommand") + .sc(schemas_0.RecordHandlerProgress$) .build() { } -class DescribeStackResourceCommand extends smithyClient.Command +class RegisterPublisherCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackResource", {}) - .n("CloudFormationClient", "DescribeStackResourceCommand") - .sc(DescribeStackResource) + .s("CloudFormation", "RegisterPublisher", {}) + .n("CloudFormationClient", "RegisterPublisherCommand") + .sc(schemas_0.RegisterPublisher$) .build() { } -class DescribeStackResourceDriftsCommand extends smithyClient.Command +class RegisterTypeCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackResourceDrifts", {}) - .n("CloudFormationClient", "DescribeStackResourceDriftsCommand") - .sc(DescribeStackResourceDrifts) + .s("CloudFormation", "RegisterType", {}) + .n("CloudFormationClient", "RegisterTypeCommand") + .sc(schemas_0.RegisterType$) .build() { } -class DescribeStackResourcesCommand extends smithyClient.Command +class RollbackStackCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackResources", {}) - .n("CloudFormationClient", "DescribeStackResourcesCommand") - .sc(DescribeStackResources) + .s("CloudFormation", "RollbackStack", {}) + .n("CloudFormationClient", "RollbackStackCommand") + .sc(schemas_0.RollbackStack$) .build() { } -class DescribeStacksCommand extends smithyClient.Command +class SetStackPolicyCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStacks", {}) - .n("CloudFormationClient", "DescribeStacksCommand") - .sc(DescribeStacks) + .s("CloudFormation", "SetStackPolicy", {}) + .n("CloudFormationClient", "SetStackPolicyCommand") + .sc(schemas_0.SetStackPolicy$) .build() { } -class DescribeStackSetCommand extends smithyClient.Command +class SetTypeConfigurationCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackSet", {}) - .n("CloudFormationClient", "DescribeStackSetCommand") - .sc(DescribeStackSet) + .s("CloudFormation", "SetTypeConfiguration", {}) + .n("CloudFormationClient", "SetTypeConfigurationCommand") + .sc(schemas_0.SetTypeConfiguration$) .build() { } -class DescribeStackSetOperationCommand extends smithyClient.Command +class SetTypeDefaultVersionCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeStackSetOperation", {}) - .n("CloudFormationClient", "DescribeStackSetOperationCommand") - .sc(DescribeStackSetOperation) + .s("CloudFormation", "SetTypeDefaultVersion", {}) + .n("CloudFormationClient", "SetTypeDefaultVersionCommand") + .sc(schemas_0.SetTypeDefaultVersion$) .build() { } -class DescribeTypeCommand extends smithyClient.Command +class SignalResourceCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeType", {}) - .n("CloudFormationClient", "DescribeTypeCommand") - .sc(DescribeType) + .s("CloudFormation", "SignalResource", {}) + .n("CloudFormationClient", "SignalResourceCommand") + .sc(schemas_0.SignalResource$) .build() { } -class DescribeTypeRegistrationCommand extends smithyClient.Command +class StartResourceScanCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DescribeTypeRegistration", {}) - .n("CloudFormationClient", "DescribeTypeRegistrationCommand") - .sc(DescribeTypeRegistration) + .s("CloudFormation", "StartResourceScan", {}) + .n("CloudFormationClient", "StartResourceScanCommand") + .sc(schemas_0.StartResourceScan$) .build() { } -class DetectStackDriftCommand extends smithyClient.Command +class StopStackSetOperationCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DetectStackDrift", {}) - .n("CloudFormationClient", "DetectStackDriftCommand") - .sc(DetectStackDrift) + .s("CloudFormation", "StopStackSetOperation", {}) + .n("CloudFormationClient", "StopStackSetOperationCommand") + .sc(schemas_0.StopStackSetOperation$) .build() { } -class DetectStackResourceDriftCommand extends smithyClient.Command +class TestTypeCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DetectStackResourceDrift", {}) - .n("CloudFormationClient", "DetectStackResourceDriftCommand") - .sc(DetectStackResourceDrift) + .s("CloudFormation", "TestType", {}) + .n("CloudFormationClient", "TestTypeCommand") + .sc(schemas_0.TestType$) .build() { } -class DetectStackSetDriftCommand extends smithyClient.Command +class UpdateGeneratedTemplateCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "DetectStackSetDrift", {}) - .n("CloudFormationClient", "DetectStackSetDriftCommand") - .sc(DetectStackSetDrift) + .s("CloudFormation", "UpdateGeneratedTemplate", {}) + .n("CloudFormationClient", "UpdateGeneratedTemplateCommand") + .sc(schemas_0.UpdateGeneratedTemplate$) .build() { } -class EstimateTemplateCostCommand extends smithyClient.Command +class UpdateStackCommand extends smithyClient.Command .classBuilder() .ep(commonParams) .m(function (Command, cs, config, o) { return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; }) - .s("CloudFormation", "EstimateTemplateCost", {}) - .n("CloudFormationClient", "EstimateTemplateCostCommand") - .sc(EstimateTemplateCost) + .s("CloudFormation", "UpdateStack", {}) + .n("CloudFormationClient", "UpdateStackCommand") + .sc(schemas_0.UpdateStack$) + .build() { +} + +class UpdateStackInstancesCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "UpdateStackInstances", {}) + .n("CloudFormationClient", "UpdateStackInstancesCommand") + .sc(schemas_0.UpdateStackInstances$) + .build() { +} + +class UpdateStackSetCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "UpdateStackSet", {}) + .n("CloudFormationClient", "UpdateStackSetCommand") + .sc(schemas_0.UpdateStackSet$) + .build() { +} + +class UpdateTerminationProtectionCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "UpdateTerminationProtection", {}) + .n("CloudFormationClient", "UpdateTerminationProtectionCommand") + .sc(schemas_0.UpdateTerminationProtection$) + .build() { +} + +class ValidateTemplateCommand extends smithyClient.Command + .classBuilder() + .ep(commonParams) + .m(function (Command, cs, config, o) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; +}) + .s("CloudFormation", "ValidateTemplate", {}) + .n("CloudFormationClient", "ValidateTemplateCommand") + .sc(schemas_0.ValidateTemplate$) .build() { } -class ExecuteChangeSetCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ExecuteChangeSet", {}) - .n("CloudFormationClient", "ExecuteChangeSetCommand") - .sc(ExecuteChangeSet) - .build() { -} +const paginateDescribeAccountLimits = core.createPaginator(CloudFormationClient, DescribeAccountLimitsCommand, "NextToken", "NextToken", ""); + +const paginateDescribeChangeSet = core.createPaginator(CloudFormationClient, DescribeChangeSetCommand, "NextToken", "NextToken", ""); + +const paginateDescribeEvents = core.createPaginator(CloudFormationClient, DescribeEventsCommand, "NextToken", "NextToken", ""); + +const paginateDescribeStackEvents = core.createPaginator(CloudFormationClient, DescribeStackEventsCommand, "NextToken", "NextToken", ""); + +const paginateDescribeStackResourceDrifts = core.createPaginator(CloudFormationClient, DescribeStackResourceDriftsCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateDescribeStacks = core.createPaginator(CloudFormationClient, DescribeStacksCommand, "NextToken", "NextToken", ""); + +const paginateListChangeSets = core.createPaginator(CloudFormationClient, ListChangeSetsCommand, "NextToken", "NextToken", ""); + +const paginateListExports = core.createPaginator(CloudFormationClient, ListExportsCommand, "NextToken", "NextToken", ""); + +const paginateListGeneratedTemplates = core.createPaginator(CloudFormationClient, ListGeneratedTemplatesCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListImports = core.createPaginator(CloudFormationClient, ListImportsCommand, "NextToken", "NextToken", ""); + +const paginateListResourceScanRelatedResources = core.createPaginator(CloudFormationClient, ListResourceScanRelatedResourcesCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListResourceScanResources = core.createPaginator(CloudFormationClient, ListResourceScanResourcesCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListResourceScans = core.createPaginator(CloudFormationClient, ListResourceScansCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListStackInstances = core.createPaginator(CloudFormationClient, ListStackInstancesCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListStackRefactorActions = core.createPaginator(CloudFormationClient, ListStackRefactorActionsCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListStackRefactors = core.createPaginator(CloudFormationClient, ListStackRefactorsCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListStackResources = core.createPaginator(CloudFormationClient, ListStackResourcesCommand, "NextToken", "NextToken", ""); + +const paginateListStackSetOperationResults = core.createPaginator(CloudFormationClient, ListStackSetOperationResultsCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListStackSetOperations = core.createPaginator(CloudFormationClient, ListStackSetOperationsCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListStackSets = core.createPaginator(CloudFormationClient, ListStackSetsCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListStacks = core.createPaginator(CloudFormationClient, ListStacksCommand, "NextToken", "NextToken", ""); + +const paginateListTypeRegistrations = core.createPaginator(CloudFormationClient, ListTypeRegistrationsCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListTypes = core.createPaginator(CloudFormationClient, ListTypesCommand, "NextToken", "NextToken", "MaxResults"); + +const paginateListTypeVersions = core.createPaginator(CloudFormationClient, ListTypeVersionsCommand, "NextToken", "NextToken", "MaxResults"); + +const checkState$9 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeChangeSetCommand(input)); + reason = result; + try { + const returnComparator = () => { + return result.Status; + }; + if (returnComparator() === "CREATE_COMPLETE") { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + return result.Status; + }; + if (returnComparator() === "FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForChangeSetCreateComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$9); +}; +const waitUntilChangeSetCreateComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$9); + return utilWaiter.checkExceptions(result); +}; + +const checkState$8 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeStacksCommand(input)); + reason = result; + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "CREATE_COMPLETE"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_COMPLETE"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_IN_PROGRESS"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_FAILED"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_ROLLBACK_IN_PROGRESS"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_ROLLBACK_FAILED"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_ROLLBACK_COMPLETE"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "CREATE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "DELETE_COMPLETE") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "DELETE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "ROLLBACK_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "ROLLBACK_COMPLETE") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForStackCreateComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$8); +}; +const waitUntilStackCreateComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$8); + return utilWaiter.checkExceptions(result); +}; + +const checkState$7 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeStacksCommand(input)); + reason = result; + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "DELETE_COMPLETE"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "DELETE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "CREATE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "ROLLBACK_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_ROLLBACK_IN_PROGRESS") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_ROLLBACK_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_ROLLBACK_COMPLETE") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_COMPLETE") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForStackDeleteComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$7); +}; +const waitUntilStackDeleteComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$7); + return utilWaiter.checkExceptions(result); +}; -class ExecuteStackRefactorCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ExecuteStackRefactor", {}) - .n("CloudFormationClient", "ExecuteStackRefactorCommand") - .sc(ExecuteStackRefactor) - .build() { -} +const checkState$6 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeStacksCommand(input)); + reason = result; + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.RETRY, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForStackExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$6); +}; +const waitUntilStackExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$6); + return utilWaiter.checkExceptions(result); +}; -class GetGeneratedTemplateCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "GetGeneratedTemplate", {}) - .n("CloudFormationClient", "GetGeneratedTemplateCommand") - .sc(GetGeneratedTemplate) - .build() { -} +const checkState$5 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeStacksCommand(input)); + reason = result; + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "IMPORT_COMPLETE"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "ROLLBACK_COMPLETE") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "ROLLBACK_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "IMPORT_ROLLBACK_IN_PROGRESS") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "IMPORT_ROLLBACK_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "IMPORT_ROLLBACK_COMPLETE") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForStackImportComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$5); +}; +const waitUntilStackImportComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$5); + return utilWaiter.checkExceptions(result); +}; -class GetHookResultCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "GetHookResult", {}) - .n("CloudFormationClient", "GetHookResultCommand") - .sc(GetHookResult) - .build() { -} +const checkState$4 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeStackRefactorCommand(input)); + reason = result; + try { + const returnComparator = () => { + return result.Status; + }; + if (returnComparator() === "CREATE_COMPLETE") { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + return result.Status; + }; + if (returnComparator() === "CREATE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForStackRefactorCreateComplete = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$4); +}; +const waitUntilStackRefactorCreateComplete = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$4); + return utilWaiter.checkExceptions(result); +}; -class GetStackPolicyCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "GetStackPolicy", {}) - .n("CloudFormationClient", "GetStackPolicyCommand") - .sc(GetStackPolicy) - .build() { -} +const checkState$3 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeStackRefactorCommand(input)); + reason = result; + try { + const returnComparator = () => { + return result.ExecutionStatus; + }; + if (returnComparator() === "EXECUTE_COMPLETE") { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + return result.ExecutionStatus; + }; + if (returnComparator() === "EXECUTE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + return result.ExecutionStatus; + }; + if (returnComparator() === "ROLLBACK_COMPLETE") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForStackRefactorExecuteComplete = async (params, input) => { + const serviceDefaults = { minDelay: 15, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$3); +}; +const waitUntilStackRefactorExecuteComplete = async (params, input) => { + const serviceDefaults = { minDelay: 15, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$3); + return utilWaiter.checkExceptions(result); +}; -class GetTemplateCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "GetTemplate", {}) - .n("CloudFormationClient", "GetTemplateCommand") - .sc(GetTemplate) - .build() { -} +const checkState$2 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeStacksCommand(input)); + reason = result; + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_ROLLBACK_COMPLETE"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_ROLLBACK_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "DELETE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForStackRollbackComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$2); +}; +const waitUntilStackRollbackComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$2); + return utilWaiter.checkExceptions(result); +}; -class GetTemplateSummaryCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "GetTemplateSummary", {}) - .n("CloudFormationClient", "GetTemplateSummaryCommand") - .sc(GetTemplateSummary) - .build() { -} +const checkState$1 = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeStacksCommand(input)); + reason = result; + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + let allStringEq_5 = (returnComparator().length > 0); + for (let element_4 of returnComparator()) { + allStringEq_5 = allStringEq_5 && (element_4 == "UPDATE_COMPLETE"); + } + if (allStringEq_5) { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_ROLLBACK_FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + try { + const returnComparator = () => { + let flat_1 = [].concat(...result.Stacks); + let projection_3 = flat_1.map((element_2) => { + return element_2.StackStatus; + }); + return projection_3; + }; + for (let anyStringEq_4 of returnComparator()) { + if (anyStringEq_4 == "UPDATE_ROLLBACK_COMPLETE") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + if (exception.name && exception.name == "ValidationError") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForStackUpdateComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$1); +}; +const waitUntilStackUpdateComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$1); + return utilWaiter.checkExceptions(result); +}; -class ImportStacksToStackSetCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ImportStacksToStackSet", {}) - .n("CloudFormationClient", "ImportStacksToStackSetCommand") - .sc(ImportStacksToStackSet) - .build() { -} +const checkState = async (client, input) => { + let reason; + try { + let result = await client.send(new DescribeTypeRegistrationCommand(input)); + reason = result; + try { + const returnComparator = () => { + return result.ProgressStatus; + }; + if (returnComparator() === "COMPLETE") { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + catch (e) { } + try { + const returnComparator = () => { + return result.ProgressStatus; + }; + if (returnComparator() === "FAILED") { + return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + } + catch (e) { } + } + catch (exception) { + reason = exception; + } + return { state: utilWaiter.WaiterState.RETRY, reason }; +}; +const waitForTypeRegistrationComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState); +}; +const waitUntilTypeRegistrationComplete = async (params, input) => { + const serviceDefaults = { minDelay: 30, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState); + return utilWaiter.checkExceptions(result); +}; -class ListChangeSetsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListChangeSets", {}) - .n("CloudFormationClient", "ListChangeSetsCommand") - .sc(ListChangeSets) - .build() { +const commands = { + ActivateOrganizationsAccessCommand, + ActivateTypeCommand, + BatchDescribeTypeConfigurationsCommand, + CancelUpdateStackCommand, + ContinueUpdateRollbackCommand, + CreateChangeSetCommand, + CreateGeneratedTemplateCommand, + CreateStackCommand, + CreateStackInstancesCommand, + CreateStackRefactorCommand, + CreateStackSetCommand, + DeactivateOrganizationsAccessCommand, + DeactivateTypeCommand, + DeleteChangeSetCommand, + DeleteGeneratedTemplateCommand, + DeleteStackCommand, + DeleteStackInstancesCommand, + DeleteStackSetCommand, + DeregisterTypeCommand, + DescribeAccountLimitsCommand, + DescribeChangeSetCommand, + DescribeChangeSetHooksCommand, + DescribeEventsCommand, + DescribeGeneratedTemplateCommand, + DescribeOrganizationsAccessCommand, + DescribePublisherCommand, + DescribeResourceScanCommand, + DescribeStackDriftDetectionStatusCommand, + DescribeStackEventsCommand, + DescribeStackInstanceCommand, + DescribeStackRefactorCommand, + DescribeStackResourceCommand, + DescribeStackResourceDriftsCommand, + DescribeStackResourcesCommand, + DescribeStacksCommand, + DescribeStackSetCommand, + DescribeStackSetOperationCommand, + DescribeTypeCommand, + DescribeTypeRegistrationCommand, + DetectStackDriftCommand, + DetectStackResourceDriftCommand, + DetectStackSetDriftCommand, + EstimateTemplateCostCommand, + ExecuteChangeSetCommand, + ExecuteStackRefactorCommand, + GetGeneratedTemplateCommand, + GetHookResultCommand, + GetStackPolicyCommand, + GetTemplateCommand, + GetTemplateSummaryCommand, + ImportStacksToStackSetCommand, + ListChangeSetsCommand, + ListExportsCommand, + ListGeneratedTemplatesCommand, + ListHookResultsCommand, + ListImportsCommand, + ListResourceScanRelatedResourcesCommand, + ListResourceScanResourcesCommand, + ListResourceScansCommand, + ListStackInstanceResourceDriftsCommand, + ListStackInstancesCommand, + ListStackRefactorActionsCommand, + ListStackRefactorsCommand, + ListStackResourcesCommand, + ListStacksCommand, + ListStackSetAutoDeploymentTargetsCommand, + ListStackSetOperationResultsCommand, + ListStackSetOperationsCommand, + ListStackSetsCommand, + ListTypeRegistrationsCommand, + ListTypesCommand, + ListTypeVersionsCommand, + PublishTypeCommand, + RecordHandlerProgressCommand, + RegisterPublisherCommand, + RegisterTypeCommand, + RollbackStackCommand, + SetStackPolicyCommand, + SetTypeConfigurationCommand, + SetTypeDefaultVersionCommand, + SignalResourceCommand, + StartResourceScanCommand, + StopStackSetOperationCommand, + TestTypeCommand, + UpdateGeneratedTemplateCommand, + UpdateStackCommand, + UpdateStackInstancesCommand, + UpdateStackSetCommand, + UpdateTerminationProtectionCommand, + ValidateTemplateCommand, +}; +const paginators = { + paginateDescribeAccountLimits, + paginateDescribeChangeSet, + paginateDescribeEvents, + paginateDescribeStackEvents, + paginateDescribeStackResourceDrifts, + paginateDescribeStacks, + paginateListChangeSets, + paginateListExports, + paginateListGeneratedTemplates, + paginateListImports, + paginateListResourceScanRelatedResources, + paginateListResourceScanResources, + paginateListResourceScans, + paginateListStackInstances, + paginateListStackRefactorActions, + paginateListStackRefactors, + paginateListStackResources, + paginateListStacks, + paginateListStackSetOperationResults, + paginateListStackSetOperations, + paginateListStackSets, + paginateListTypeRegistrations, + paginateListTypes, + paginateListTypeVersions, +}; +const waiters = { + waitUntilChangeSetCreateComplete, + waitUntilStackRefactorCreateComplete, + waitUntilStackRefactorExecuteComplete, + waitUntilStackCreateComplete, + waitUntilStackDeleteComplete, + waitUntilStackExists, + waitUntilStackImportComplete, + waitUntilStackRollbackComplete, + waitUntilStackUpdateComplete, + waitUntilTypeRegistrationComplete, +}; +class CloudFormation extends CloudFormationClient { } +smithyClient.createAggregatedClient(commands, CloudFormation, { paginators, waiters }); -class ListExportsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListExports", {}) - .n("CloudFormationClient", "ListExportsCommand") - .sc(ListExports) - .build() { -} +const AccountFilterType = { + DIFFERENCE: "DIFFERENCE", + INTERSECTION: "INTERSECTION", + NONE: "NONE", + UNION: "UNION", +}; +const AccountGateStatus = { + FAILED: "FAILED", + SKIPPED: "SKIPPED", + SUCCEEDED: "SUCCEEDED", +}; +const ThirdPartyType = { + HOOK: "HOOK", + MODULE: "MODULE", + RESOURCE: "RESOURCE", +}; +const VersionBump = { + MAJOR: "MAJOR", + MINOR: "MINOR", +}; +const AfterValueFrom = { + TEMPLATE: "TEMPLATE", +}; +const AnnotationSeverityLevel = { + CRITICAL: "CRITICAL", + HIGH: "HIGH", + INFORMATIONAL: "INFORMATIONAL", + LOW: "LOW", + MEDIUM: "MEDIUM", +}; +const AnnotationStatus = { + FAILED: "FAILED", + PASSED: "PASSED", + SKIPPED: "SKIPPED", +}; +const AttributeChangeType = { + Add: "Add", + Modify: "Modify", + Remove: "Remove", + SyncWithActual: "SyncWithActual", +}; +const BeaconStackOperationStatus = { + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", + SUCCEEDED: "SUCCEEDED", +}; +const BeforeValueFrom = { + ACTUAL_STATE: "ACTUAL_STATE", + PREVIOUS_DEPLOYMENT_STATE: "PREVIOUS_DEPLOYMENT_STATE", +}; +const CallAs = { + DELEGATED_ADMIN: "DELEGATED_ADMIN", + SELF: "SELF", +}; +const Capability = { + CAPABILITY_AUTO_EXPAND: "CAPABILITY_AUTO_EXPAND", + CAPABILITY_IAM: "CAPABILITY_IAM", + CAPABILITY_NAMED_IAM: "CAPABILITY_NAMED_IAM", +}; +const Category = { + ACTIVATED: "ACTIVATED", + AWS_TYPES: "AWS_TYPES", + REGISTERED: "REGISTERED", + THIRD_PARTY: "THIRD_PARTY", +}; +const ChangeAction = { + Add: "Add", + Dynamic: "Dynamic", + Import: "Import", + Modify: "Modify", + Remove: "Remove", + SyncWithActual: "SyncWithActual", +}; +const ChangeSource = { + Automatic: "Automatic", + DirectModification: "DirectModification", + NoModification: "NoModification", + ParameterReference: "ParameterReference", + ResourceAttribute: "ResourceAttribute", + ResourceReference: "ResourceReference", +}; +const EvaluationType = { + Dynamic: "Dynamic", + Static: "Static", +}; +const ResourceAttribute = { + CreationPolicy: "CreationPolicy", + DeletionPolicy: "DeletionPolicy", + Metadata: "Metadata", + Properties: "Properties", + Tags: "Tags", + UpdatePolicy: "UpdatePolicy", + UpdateReplacePolicy: "UpdateReplacePolicy", +}; +const RequiresRecreation = { + Always: "Always", + Conditionally: "Conditionally", + Never: "Never", +}; +const PolicyAction = { + Delete: "Delete", + ReplaceAndDelete: "ReplaceAndDelete", + ReplaceAndRetain: "ReplaceAndRetain", + ReplaceAndSnapshot: "ReplaceAndSnapshot", + Retain: "Retain", + Snapshot: "Snapshot", +}; +const Replacement = { + Conditional: "Conditional", + False: "False", + True: "True", +}; +const DriftIgnoredReason = { + MANAGED_BY_AWS: "MANAGED_BY_AWS", + WRITE_ONLY_PROPERTY: "WRITE_ONLY_PROPERTY", +}; +const StackResourceDriftStatus = { + DELETED: "DELETED", + IN_SYNC: "IN_SYNC", + MODIFIED: "MODIFIED", + NOT_CHECKED: "NOT_CHECKED", + UNKNOWN: "UNKNOWN", + UNSUPPORTED: "UNSUPPORTED", +}; +const ChangeType = { + Resource: "Resource", +}; +const HookFailureMode = { + FAIL: "FAIL", + WARN: "WARN", +}; +const HookInvocationPoint = { + PRE_PROVISION: "PRE_PROVISION", +}; +const HookTargetType = { + RESOURCE: "RESOURCE", +}; +const ChangeSetHooksStatus = { + PLANNED: "PLANNED", + PLANNING: "PLANNING", + UNAVAILABLE: "UNAVAILABLE", +}; +const ChangeSetStatus = { + CREATE_COMPLETE: "CREATE_COMPLETE", + CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", + CREATE_PENDING: "CREATE_PENDING", + DELETE_COMPLETE: "DELETE_COMPLETE", + DELETE_FAILED: "DELETE_FAILED", + DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", + DELETE_PENDING: "DELETE_PENDING", + FAILED: "FAILED", +}; +const ExecutionStatus = { + AVAILABLE: "AVAILABLE", + EXECUTE_COMPLETE: "EXECUTE_COMPLETE", + EXECUTE_FAILED: "EXECUTE_FAILED", + EXECUTE_IN_PROGRESS: "EXECUTE_IN_PROGRESS", + OBSOLETE: "OBSOLETE", + UNAVAILABLE: "UNAVAILABLE", +}; +const ChangeSetType = { + CREATE: "CREATE", + IMPORT: "IMPORT", + UPDATE: "UPDATE", +}; +const DeploymentMode = { + REVERT_DRIFT: "REVERT_DRIFT", +}; +const OnStackFailure = { + DELETE: "DELETE", + DO_NOTHING: "DO_NOTHING", + ROLLBACK: "ROLLBACK", +}; +const GeneratedTemplateDeletionPolicy = { + DELETE: "DELETE", + RETAIN: "RETAIN", +}; +const GeneratedTemplateUpdateReplacePolicy = { + DELETE: "DELETE", + RETAIN: "RETAIN", +}; +const OnFailure = { + DELETE: "DELETE", + DO_NOTHING: "DO_NOTHING", + ROLLBACK: "ROLLBACK", +}; +const ConcurrencyMode = { + SOFT_FAILURE_TOLERANCE: "SOFT_FAILURE_TOLERANCE", + STRICT_FAILURE_TOLERANCE: "STRICT_FAILURE_TOLERANCE", +}; +const RegionConcurrencyType = { + PARALLEL: "PARALLEL", + SEQUENTIAL: "SEQUENTIAL", +}; +const PermissionModels = { + SELF_MANAGED: "SELF_MANAGED", + SERVICE_MANAGED: "SERVICE_MANAGED", +}; +const DeletionMode = { + FORCE_DELETE_STACK: "FORCE_DELETE_STACK", + STANDARD: "STANDARD", +}; +const RegistryType = { + HOOK: "HOOK", + MODULE: "MODULE", + RESOURCE: "RESOURCE", +}; +const StackDriftStatus = { + DRIFTED: "DRIFTED", + IN_SYNC: "IN_SYNC", + NOT_CHECKED: "NOT_CHECKED", + UNKNOWN: "UNKNOWN", +}; +const DetailedStatus = { + CONFIGURATION_COMPLETE: "CONFIGURATION_COMPLETE", + VALIDATION_FAILED: "VALIDATION_FAILED", +}; +const EventType = { + HOOK_INVOCATION_ERROR: "HOOK_INVOCATION_ERROR", + PROGRESS_EVENT: "PROGRESS_EVENT", + PROVISIONING_ERROR: "PROVISIONING_ERROR", + STACK_EVENT: "STACK_EVENT", + VALIDATION_ERROR: "VALIDATION_ERROR", +}; +const HookStatus = { + HOOK_COMPLETE_FAILED: "HOOK_COMPLETE_FAILED", + HOOK_COMPLETE_SUCCEEDED: "HOOK_COMPLETE_SUCCEEDED", + HOOK_FAILED: "HOOK_FAILED", + HOOK_IN_PROGRESS: "HOOK_IN_PROGRESS", +}; +const OperationType = { + CONTINUE_ROLLBACK: "CONTINUE_ROLLBACK", + CREATE_CHANGESET: "CREATE_CHANGESET", + CREATE_STACK: "CREATE_STACK", + DELETE_STACK: "DELETE_STACK", + ROLLBACK: "ROLLBACK", + UPDATE_STACK: "UPDATE_STACK", +}; +const ResourceStatus = { + CREATE_COMPLETE: "CREATE_COMPLETE", + CREATE_FAILED: "CREATE_FAILED", + CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", + DELETE_COMPLETE: "DELETE_COMPLETE", + DELETE_FAILED: "DELETE_FAILED", + DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", + DELETE_SKIPPED: "DELETE_SKIPPED", + EXPORT_COMPLETE: "EXPORT_COMPLETE", + EXPORT_FAILED: "EXPORT_FAILED", + EXPORT_IN_PROGRESS: "EXPORT_IN_PROGRESS", + EXPORT_ROLLBACK_COMPLETE: "EXPORT_ROLLBACK_COMPLETE", + EXPORT_ROLLBACK_FAILED: "EXPORT_ROLLBACK_FAILED", + EXPORT_ROLLBACK_IN_PROGRESS: "EXPORT_ROLLBACK_IN_PROGRESS", + IMPORT_COMPLETE: "IMPORT_COMPLETE", + IMPORT_FAILED: "IMPORT_FAILED", + IMPORT_IN_PROGRESS: "IMPORT_IN_PROGRESS", + IMPORT_ROLLBACK_COMPLETE: "IMPORT_ROLLBACK_COMPLETE", + IMPORT_ROLLBACK_FAILED: "IMPORT_ROLLBACK_FAILED", + IMPORT_ROLLBACK_IN_PROGRESS: "IMPORT_ROLLBACK_IN_PROGRESS", + ROLLBACK_COMPLETE: "ROLLBACK_COMPLETE", + ROLLBACK_FAILED: "ROLLBACK_FAILED", + ROLLBACK_IN_PROGRESS: "ROLLBACK_IN_PROGRESS", + UPDATE_COMPLETE: "UPDATE_COMPLETE", + UPDATE_FAILED: "UPDATE_FAILED", + UPDATE_IN_PROGRESS: "UPDATE_IN_PROGRESS", + UPDATE_ROLLBACK_COMPLETE: "UPDATE_ROLLBACK_COMPLETE", + UPDATE_ROLLBACK_FAILED: "UPDATE_ROLLBACK_FAILED", + UPDATE_ROLLBACK_IN_PROGRESS: "UPDATE_ROLLBACK_IN_PROGRESS", +}; +const ValidationStatus = { + FAILED: "FAILED", + SKIPPED: "SKIPPED", +}; +const GeneratedTemplateResourceStatus = { + COMPLETE: "COMPLETE", + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", + PENDING: "PENDING", +}; +const WarningType = { + EXCLUDED_PROPERTIES: "EXCLUDED_PROPERTIES", + EXCLUDED_RESOURCES: "EXCLUDED_RESOURCES", + MUTUALLY_EXCLUSIVE_PROPERTIES: "MUTUALLY_EXCLUSIVE_PROPERTIES", + MUTUALLY_EXCLUSIVE_TYPES: "MUTUALLY_EXCLUSIVE_TYPES", + UNSUPPORTED_PROPERTIES: "UNSUPPORTED_PROPERTIES", +}; +const GeneratedTemplateStatus = { + COMPLETE: "COMPLETE", + CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", + CREATE_PENDING: "CREATE_PENDING", + DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", + DELETE_PENDING: "DELETE_PENDING", + FAILED: "FAILED", + UPDATE_IN_PROGRESS: "UPDATE_IN_PROGRESS", + UPDATE_PENDING: "UPDATE_PENDING", +}; +const OrganizationStatus = { + DISABLED: "DISABLED", + DISABLED_PERMANENTLY: "DISABLED_PERMANENTLY", + ENABLED: "ENABLED", +}; +const IdentityProvider = { + AWS_Marketplace: "AWS_Marketplace", + Bitbucket: "Bitbucket", + GitHub: "GitHub", +}; +const PublisherStatus = { + UNVERIFIED: "UNVERIFIED", + VERIFIED: "VERIFIED", +}; +const ResourceScanStatus = { + COMPLETE: "COMPLETE", + EXPIRED: "EXPIRED", + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", +}; +const StackDriftDetectionStatus = { + DETECTION_COMPLETE: "DETECTION_COMPLETE", + DETECTION_FAILED: "DETECTION_FAILED", + DETECTION_IN_PROGRESS: "DETECTION_IN_PROGRESS", +}; +const StackInstanceDetailedStatus = { + CANCELLED: "CANCELLED", + FAILED: "FAILED", + FAILED_IMPORT: "FAILED_IMPORT", + INOPERABLE: "INOPERABLE", + PENDING: "PENDING", + RUNNING: "RUNNING", + SKIPPED_SUSPENDED_ACCOUNT: "SKIPPED_SUSPENDED_ACCOUNT", + SUCCEEDED: "SUCCEEDED", +}; +const StackInstanceStatus = { + CURRENT: "CURRENT", + INOPERABLE: "INOPERABLE", + OUTDATED: "OUTDATED", +}; +const StackRefactorExecutionStatus = { + AVAILABLE: "AVAILABLE", + EXECUTE_COMPLETE: "EXECUTE_COMPLETE", + EXECUTE_FAILED: "EXECUTE_FAILED", + EXECUTE_IN_PROGRESS: "EXECUTE_IN_PROGRESS", + OBSOLETE: "OBSOLETE", + ROLLBACK_COMPLETE: "ROLLBACK_COMPLETE", + ROLLBACK_FAILED: "ROLLBACK_FAILED", + ROLLBACK_IN_PROGRESS: "ROLLBACK_IN_PROGRESS", + UNAVAILABLE: "UNAVAILABLE", +}; +const StackRefactorStatus = { + CREATE_COMPLETE: "CREATE_COMPLETE", + CREATE_FAILED: "CREATE_FAILED", + CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", + DELETE_COMPLETE: "DELETE_COMPLETE", + DELETE_FAILED: "DELETE_FAILED", + DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", +}; +const DifferenceType = { + ADD: "ADD", + NOT_EQUAL: "NOT_EQUAL", + REMOVE: "REMOVE", +}; +const StackStatus = { + CREATE_COMPLETE: "CREATE_COMPLETE", + CREATE_FAILED: "CREATE_FAILED", + CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", + DELETE_COMPLETE: "DELETE_COMPLETE", + DELETE_FAILED: "DELETE_FAILED", + DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", + IMPORT_COMPLETE: "IMPORT_COMPLETE", + IMPORT_IN_PROGRESS: "IMPORT_IN_PROGRESS", + IMPORT_ROLLBACK_COMPLETE: "IMPORT_ROLLBACK_COMPLETE", + IMPORT_ROLLBACK_FAILED: "IMPORT_ROLLBACK_FAILED", + IMPORT_ROLLBACK_IN_PROGRESS: "IMPORT_ROLLBACK_IN_PROGRESS", + REVIEW_IN_PROGRESS: "REVIEW_IN_PROGRESS", + ROLLBACK_COMPLETE: "ROLLBACK_COMPLETE", + ROLLBACK_FAILED: "ROLLBACK_FAILED", + ROLLBACK_IN_PROGRESS: "ROLLBACK_IN_PROGRESS", + UPDATE_COMPLETE: "UPDATE_COMPLETE", + UPDATE_COMPLETE_CLEANUP_IN_PROGRESS: "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS", + UPDATE_FAILED: "UPDATE_FAILED", + UPDATE_IN_PROGRESS: "UPDATE_IN_PROGRESS", + UPDATE_ROLLBACK_COMPLETE: "UPDATE_ROLLBACK_COMPLETE", + UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS: "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS", + UPDATE_ROLLBACK_FAILED: "UPDATE_ROLLBACK_FAILED", + UPDATE_ROLLBACK_IN_PROGRESS: "UPDATE_ROLLBACK_IN_PROGRESS", +}; +const StackSetDriftDetectionStatus = { + COMPLETED: "COMPLETED", + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", + PARTIAL_SUCCESS: "PARTIAL_SUCCESS", + STOPPED: "STOPPED", +}; +const StackSetDriftStatus = { + DRIFTED: "DRIFTED", + IN_SYNC: "IN_SYNC", + NOT_CHECKED: "NOT_CHECKED", +}; +const StackSetStatus = { + ACTIVE: "ACTIVE", + DELETED: "DELETED", +}; +const StackSetOperationAction = { + CREATE: "CREATE", + DELETE: "DELETE", + DETECT_DRIFT: "DETECT_DRIFT", + UPDATE: "UPDATE", +}; +const StackSetOperationStatus = { + FAILED: "FAILED", + QUEUED: "QUEUED", + RUNNING: "RUNNING", + STOPPED: "STOPPED", + STOPPING: "STOPPING", + SUCCEEDED: "SUCCEEDED", +}; +const DeprecatedStatus = { + DEPRECATED: "DEPRECATED", + LIVE: "LIVE", +}; +const ProvisioningType = { + FULLY_MUTABLE: "FULLY_MUTABLE", + IMMUTABLE: "IMMUTABLE", + NON_PROVISIONABLE: "NON_PROVISIONABLE", +}; +const TypeTestsStatus = { + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", + NOT_TESTED: "NOT_TESTED", + PASSED: "PASSED", +}; +const Visibility = { + PRIVATE: "PRIVATE", + PUBLIC: "PUBLIC", +}; +const RegistrationStatus = { + COMPLETE: "COMPLETE", + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", +}; +const TemplateFormat = { + JSON: "JSON", + YAML: "YAML", +}; +const HookTargetAction = { + CREATE: "CREATE", + DELETE: "DELETE", + IMPORT: "IMPORT", + UPDATE: "UPDATE", +}; +const TemplateStage = { + Original: "Original", + Processed: "Processed", +}; +const ListHookResultsTargetType = { + CHANGE_SET: "CHANGE_SET", + CLOUD_CONTROL: "CLOUD_CONTROL", + RESOURCE: "RESOURCE", + STACK: "STACK", +}; +const ScanType = { + FULL: "FULL", + PARTIAL: "PARTIAL", +}; +const StackInstanceFilterName = { + DETAILED_STATUS: "DETAILED_STATUS", + DRIFT_STATUS: "DRIFT_STATUS", + LAST_OPERATION_ID: "LAST_OPERATION_ID", +}; +const StackRefactorActionType = { + CREATE: "CREATE", + MOVE: "MOVE", +}; +const StackRefactorDetection = { + AUTO: "AUTO", + MANUAL: "MANUAL", +}; +const StackRefactorActionEntity = { + RESOURCE: "RESOURCE", + STACK: "STACK", +}; +const OperationResultFilterName = { + OPERATION_RESULT_STATUS: "OPERATION_RESULT_STATUS", +}; +const StackSetOperationResultStatus = { + CANCELLED: "CANCELLED", + FAILED: "FAILED", + PENDING: "PENDING", + RUNNING: "RUNNING", + SUCCEEDED: "SUCCEEDED", +}; +const OperationStatus = { + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", + PENDING: "PENDING", + SUCCESS: "SUCCESS", +}; +const HandlerErrorCode = { + AccessDenied: "AccessDenied", + AlreadyExists: "AlreadyExists", + GeneralServiceException: "GeneralServiceException", + HandlerInternalFailure: "HandlerInternalFailure", + InternalFailure: "InternalFailure", + InvalidCredentials: "InvalidCredentials", + InvalidRequest: "InvalidRequest", + InvalidTypeConfiguration: "InvalidTypeConfiguration", + NetworkFailure: "NetworkFailure", + NonCompliant: "NonCompliant", + NotFound: "NotFound", + NotUpdatable: "NotUpdatable", + ResourceConflict: "ResourceConflict", + ServiceInternalError: "ServiceInternalError", + ServiceLimitExceeded: "ServiceLimitExceeded", + ServiceTimeout: "NotStabilized", + Throttling: "Throttling", + Unknown: "Unknown", + UnsupportedTarget: "UnsupportedTarget", +}; +const ResourceSignalStatus = { + FAILURE: "FAILURE", + SUCCESS: "SUCCESS", +}; -class ListGeneratedTemplatesCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListGeneratedTemplates", {}) - .n("CloudFormationClient", "ListGeneratedTemplatesCommand") - .sc(ListGeneratedTemplates) - .build() { -} +exports.$Command = smithyClient.Command; +exports.__Client = smithyClient.Client; +exports.CloudFormationServiceException = CloudFormationServiceException.CloudFormationServiceException; +exports.AccountFilterType = AccountFilterType; +exports.AccountGateStatus = AccountGateStatus; +exports.ActivateOrganizationsAccessCommand = ActivateOrganizationsAccessCommand; +exports.ActivateTypeCommand = ActivateTypeCommand; +exports.AfterValueFrom = AfterValueFrom; +exports.AnnotationSeverityLevel = AnnotationSeverityLevel; +exports.AnnotationStatus = AnnotationStatus; +exports.AttributeChangeType = AttributeChangeType; +exports.BatchDescribeTypeConfigurationsCommand = BatchDescribeTypeConfigurationsCommand; +exports.BeaconStackOperationStatus = BeaconStackOperationStatus; +exports.BeforeValueFrom = BeforeValueFrom; +exports.CallAs = CallAs; +exports.CancelUpdateStackCommand = CancelUpdateStackCommand; +exports.Capability = Capability; +exports.Category = Category; +exports.ChangeAction = ChangeAction; +exports.ChangeSetHooksStatus = ChangeSetHooksStatus; +exports.ChangeSetStatus = ChangeSetStatus; +exports.ChangeSetType = ChangeSetType; +exports.ChangeSource = ChangeSource; +exports.ChangeType = ChangeType; +exports.CloudFormation = CloudFormation; +exports.CloudFormationClient = CloudFormationClient; +exports.ConcurrencyMode = ConcurrencyMode; +exports.ContinueUpdateRollbackCommand = ContinueUpdateRollbackCommand; +exports.CreateChangeSetCommand = CreateChangeSetCommand; +exports.CreateGeneratedTemplateCommand = CreateGeneratedTemplateCommand; +exports.CreateStackCommand = CreateStackCommand; +exports.CreateStackInstancesCommand = CreateStackInstancesCommand; +exports.CreateStackRefactorCommand = CreateStackRefactorCommand; +exports.CreateStackSetCommand = CreateStackSetCommand; +exports.DeactivateOrganizationsAccessCommand = DeactivateOrganizationsAccessCommand; +exports.DeactivateTypeCommand = DeactivateTypeCommand; +exports.DeleteChangeSetCommand = DeleteChangeSetCommand; +exports.DeleteGeneratedTemplateCommand = DeleteGeneratedTemplateCommand; +exports.DeleteStackCommand = DeleteStackCommand; +exports.DeleteStackInstancesCommand = DeleteStackInstancesCommand; +exports.DeleteStackSetCommand = DeleteStackSetCommand; +exports.DeletionMode = DeletionMode; +exports.DeploymentMode = DeploymentMode; +exports.DeprecatedStatus = DeprecatedStatus; +exports.DeregisterTypeCommand = DeregisterTypeCommand; +exports.DescribeAccountLimitsCommand = DescribeAccountLimitsCommand; +exports.DescribeChangeSetCommand = DescribeChangeSetCommand; +exports.DescribeChangeSetHooksCommand = DescribeChangeSetHooksCommand; +exports.DescribeEventsCommand = DescribeEventsCommand; +exports.DescribeGeneratedTemplateCommand = DescribeGeneratedTemplateCommand; +exports.DescribeOrganizationsAccessCommand = DescribeOrganizationsAccessCommand; +exports.DescribePublisherCommand = DescribePublisherCommand; +exports.DescribeResourceScanCommand = DescribeResourceScanCommand; +exports.DescribeStackDriftDetectionStatusCommand = DescribeStackDriftDetectionStatusCommand; +exports.DescribeStackEventsCommand = DescribeStackEventsCommand; +exports.DescribeStackInstanceCommand = DescribeStackInstanceCommand; +exports.DescribeStackRefactorCommand = DescribeStackRefactorCommand; +exports.DescribeStackResourceCommand = DescribeStackResourceCommand; +exports.DescribeStackResourceDriftsCommand = DescribeStackResourceDriftsCommand; +exports.DescribeStackResourcesCommand = DescribeStackResourcesCommand; +exports.DescribeStackSetCommand = DescribeStackSetCommand; +exports.DescribeStackSetOperationCommand = DescribeStackSetOperationCommand; +exports.DescribeStacksCommand = DescribeStacksCommand; +exports.DescribeTypeCommand = DescribeTypeCommand; +exports.DescribeTypeRegistrationCommand = DescribeTypeRegistrationCommand; +exports.DetailedStatus = DetailedStatus; +exports.DetectStackDriftCommand = DetectStackDriftCommand; +exports.DetectStackResourceDriftCommand = DetectStackResourceDriftCommand; +exports.DetectStackSetDriftCommand = DetectStackSetDriftCommand; +exports.DifferenceType = DifferenceType; +exports.DriftIgnoredReason = DriftIgnoredReason; +exports.EstimateTemplateCostCommand = EstimateTemplateCostCommand; +exports.EvaluationType = EvaluationType; +exports.EventType = EventType; +exports.ExecuteChangeSetCommand = ExecuteChangeSetCommand; +exports.ExecuteStackRefactorCommand = ExecuteStackRefactorCommand; +exports.ExecutionStatus = ExecutionStatus; +exports.GeneratedTemplateDeletionPolicy = GeneratedTemplateDeletionPolicy; +exports.GeneratedTemplateResourceStatus = GeneratedTemplateResourceStatus; +exports.GeneratedTemplateStatus = GeneratedTemplateStatus; +exports.GeneratedTemplateUpdateReplacePolicy = GeneratedTemplateUpdateReplacePolicy; +exports.GetGeneratedTemplateCommand = GetGeneratedTemplateCommand; +exports.GetHookResultCommand = GetHookResultCommand; +exports.GetStackPolicyCommand = GetStackPolicyCommand; +exports.GetTemplateCommand = GetTemplateCommand; +exports.GetTemplateSummaryCommand = GetTemplateSummaryCommand; +exports.HandlerErrorCode = HandlerErrorCode; +exports.HookFailureMode = HookFailureMode; +exports.HookInvocationPoint = HookInvocationPoint; +exports.HookStatus = HookStatus; +exports.HookTargetAction = HookTargetAction; +exports.HookTargetType = HookTargetType; +exports.IdentityProvider = IdentityProvider; +exports.ImportStacksToStackSetCommand = ImportStacksToStackSetCommand; +exports.ListChangeSetsCommand = ListChangeSetsCommand; +exports.ListExportsCommand = ListExportsCommand; +exports.ListGeneratedTemplatesCommand = ListGeneratedTemplatesCommand; +exports.ListHookResultsCommand = ListHookResultsCommand; +exports.ListHookResultsTargetType = ListHookResultsTargetType; +exports.ListImportsCommand = ListImportsCommand; +exports.ListResourceScanRelatedResourcesCommand = ListResourceScanRelatedResourcesCommand; +exports.ListResourceScanResourcesCommand = ListResourceScanResourcesCommand; +exports.ListResourceScansCommand = ListResourceScansCommand; +exports.ListStackInstanceResourceDriftsCommand = ListStackInstanceResourceDriftsCommand; +exports.ListStackInstancesCommand = ListStackInstancesCommand; +exports.ListStackRefactorActionsCommand = ListStackRefactorActionsCommand; +exports.ListStackRefactorsCommand = ListStackRefactorsCommand; +exports.ListStackResourcesCommand = ListStackResourcesCommand; +exports.ListStackSetAutoDeploymentTargetsCommand = ListStackSetAutoDeploymentTargetsCommand; +exports.ListStackSetOperationResultsCommand = ListStackSetOperationResultsCommand; +exports.ListStackSetOperationsCommand = ListStackSetOperationsCommand; +exports.ListStackSetsCommand = ListStackSetsCommand; +exports.ListStacksCommand = ListStacksCommand; +exports.ListTypeRegistrationsCommand = ListTypeRegistrationsCommand; +exports.ListTypeVersionsCommand = ListTypeVersionsCommand; +exports.ListTypesCommand = ListTypesCommand; +exports.OnFailure = OnFailure; +exports.OnStackFailure = OnStackFailure; +exports.OperationResultFilterName = OperationResultFilterName; +exports.OperationStatus = OperationStatus; +exports.OperationType = OperationType; +exports.OrganizationStatus = OrganizationStatus; +exports.PermissionModels = PermissionModels; +exports.PolicyAction = PolicyAction; +exports.ProvisioningType = ProvisioningType; +exports.PublishTypeCommand = PublishTypeCommand; +exports.PublisherStatus = PublisherStatus; +exports.RecordHandlerProgressCommand = RecordHandlerProgressCommand; +exports.RegionConcurrencyType = RegionConcurrencyType; +exports.RegisterPublisherCommand = RegisterPublisherCommand; +exports.RegisterTypeCommand = RegisterTypeCommand; +exports.RegistrationStatus = RegistrationStatus; +exports.RegistryType = RegistryType; +exports.Replacement = Replacement; +exports.RequiresRecreation = RequiresRecreation; +exports.ResourceAttribute = ResourceAttribute; +exports.ResourceScanStatus = ResourceScanStatus; +exports.ResourceSignalStatus = ResourceSignalStatus; +exports.ResourceStatus = ResourceStatus; +exports.RollbackStackCommand = RollbackStackCommand; +exports.ScanType = ScanType; +exports.SetStackPolicyCommand = SetStackPolicyCommand; +exports.SetTypeConfigurationCommand = SetTypeConfigurationCommand; +exports.SetTypeDefaultVersionCommand = SetTypeDefaultVersionCommand; +exports.SignalResourceCommand = SignalResourceCommand; +exports.StackDriftDetectionStatus = StackDriftDetectionStatus; +exports.StackDriftStatus = StackDriftStatus; +exports.StackInstanceDetailedStatus = StackInstanceDetailedStatus; +exports.StackInstanceFilterName = StackInstanceFilterName; +exports.StackInstanceStatus = StackInstanceStatus; +exports.StackRefactorActionEntity = StackRefactorActionEntity; +exports.StackRefactorActionType = StackRefactorActionType; +exports.StackRefactorDetection = StackRefactorDetection; +exports.StackRefactorExecutionStatus = StackRefactorExecutionStatus; +exports.StackRefactorStatus = StackRefactorStatus; +exports.StackResourceDriftStatus = StackResourceDriftStatus; +exports.StackSetDriftDetectionStatus = StackSetDriftDetectionStatus; +exports.StackSetDriftStatus = StackSetDriftStatus; +exports.StackSetOperationAction = StackSetOperationAction; +exports.StackSetOperationResultStatus = StackSetOperationResultStatus; +exports.StackSetOperationStatus = StackSetOperationStatus; +exports.StackSetStatus = StackSetStatus; +exports.StackStatus = StackStatus; +exports.StartResourceScanCommand = StartResourceScanCommand; +exports.StopStackSetOperationCommand = StopStackSetOperationCommand; +exports.TemplateFormat = TemplateFormat; +exports.TemplateStage = TemplateStage; +exports.TestTypeCommand = TestTypeCommand; +exports.ThirdPartyType = ThirdPartyType; +exports.TypeTestsStatus = TypeTestsStatus; +exports.UpdateGeneratedTemplateCommand = UpdateGeneratedTemplateCommand; +exports.UpdateStackCommand = UpdateStackCommand; +exports.UpdateStackInstancesCommand = UpdateStackInstancesCommand; +exports.UpdateStackSetCommand = UpdateStackSetCommand; +exports.UpdateTerminationProtectionCommand = UpdateTerminationProtectionCommand; +exports.ValidateTemplateCommand = ValidateTemplateCommand; +exports.ValidationStatus = ValidationStatus; +exports.VersionBump = VersionBump; +exports.Visibility = Visibility; +exports.WarningType = WarningType; +exports.paginateDescribeAccountLimits = paginateDescribeAccountLimits; +exports.paginateDescribeChangeSet = paginateDescribeChangeSet; +exports.paginateDescribeEvents = paginateDescribeEvents; +exports.paginateDescribeStackEvents = paginateDescribeStackEvents; +exports.paginateDescribeStackResourceDrifts = paginateDescribeStackResourceDrifts; +exports.paginateDescribeStacks = paginateDescribeStacks; +exports.paginateListChangeSets = paginateListChangeSets; +exports.paginateListExports = paginateListExports; +exports.paginateListGeneratedTemplates = paginateListGeneratedTemplates; +exports.paginateListImports = paginateListImports; +exports.paginateListResourceScanRelatedResources = paginateListResourceScanRelatedResources; +exports.paginateListResourceScanResources = paginateListResourceScanResources; +exports.paginateListResourceScans = paginateListResourceScans; +exports.paginateListStackInstances = paginateListStackInstances; +exports.paginateListStackRefactorActions = paginateListStackRefactorActions; +exports.paginateListStackRefactors = paginateListStackRefactors; +exports.paginateListStackResources = paginateListStackResources; +exports.paginateListStackSetOperationResults = paginateListStackSetOperationResults; +exports.paginateListStackSetOperations = paginateListStackSetOperations; +exports.paginateListStackSets = paginateListStackSets; +exports.paginateListStacks = paginateListStacks; +exports.paginateListTypeRegistrations = paginateListTypeRegistrations; +exports.paginateListTypeVersions = paginateListTypeVersions; +exports.paginateListTypes = paginateListTypes; +exports.waitForChangeSetCreateComplete = waitForChangeSetCreateComplete; +exports.waitForStackCreateComplete = waitForStackCreateComplete; +exports.waitForStackDeleteComplete = waitForStackDeleteComplete; +exports.waitForStackExists = waitForStackExists; +exports.waitForStackImportComplete = waitForStackImportComplete; +exports.waitForStackRefactorCreateComplete = waitForStackRefactorCreateComplete; +exports.waitForStackRefactorExecuteComplete = waitForStackRefactorExecuteComplete; +exports.waitForStackRollbackComplete = waitForStackRollbackComplete; +exports.waitForStackUpdateComplete = waitForStackUpdateComplete; +exports.waitForTypeRegistrationComplete = waitForTypeRegistrationComplete; +exports.waitUntilChangeSetCreateComplete = waitUntilChangeSetCreateComplete; +exports.waitUntilStackCreateComplete = waitUntilStackCreateComplete; +exports.waitUntilStackDeleteComplete = waitUntilStackDeleteComplete; +exports.waitUntilStackExists = waitUntilStackExists; +exports.waitUntilStackImportComplete = waitUntilStackImportComplete; +exports.waitUntilStackRefactorCreateComplete = waitUntilStackRefactorCreateComplete; +exports.waitUntilStackRefactorExecuteComplete = waitUntilStackRefactorExecuteComplete; +exports.waitUntilStackRollbackComplete = waitUntilStackRollbackComplete; +exports.waitUntilStackUpdateComplete = waitUntilStackUpdateComplete; +exports.waitUntilTypeRegistrationComplete = waitUntilTypeRegistrationComplete; +Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: schemas_0['__proto__'] + }); -class ListHookResultsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListHookResults", {}) - .n("CloudFormationClient", "ListHookResultsCommand") - .sc(ListHookResults) - .build() { -} +Object.keys(schemas_0).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k]; +}); +Object.prototype.hasOwnProperty.call(errors, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: errors['__proto__'] + }); -class ListImportsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListImports", {}) - .n("CloudFormationClient", "ListImportsCommand") - .sc(ListImports) - .build() { -} +Object.keys(errors).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k]; +}); -class ListResourceScanRelatedResourcesCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListResourceScanRelatedResources", {}) - .n("CloudFormationClient", "ListResourceScanRelatedResourcesCommand") - .sc(ListResourceScanRelatedResources) - .build() { -} -class ListResourceScanResourcesCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListResourceScanResources", {}) - .n("CloudFormationClient", "ListResourceScanResourcesCommand") - .sc(ListResourceScanResources) - .build() { -} +/***/ }), -class ListResourceScansCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListResourceScans", {}) - .n("CloudFormationClient", "ListResourceScansCommand") - .sc(ListResourceScans) - .build() { -} +/***/ 22: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -class ListStackInstanceResourceDriftsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackInstanceResourceDrifts", {}) - .n("CloudFormationClient", "ListStackInstanceResourceDriftsCommand") - .sc(ListStackInstanceResourceDrifts) - .build() { -} +"use strict"; -class ListStackInstancesCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackInstances", {}) - .n("CloudFormationClient", "ListStackInstancesCommand") - .sc(ListStackInstances) - .build() { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CloudFormationServiceException = exports.__ServiceException = void 0; +const smithy_client_1 = __nccwpck_require__(1411); +Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); +class CloudFormationServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, CloudFormationServiceException.prototype); + } } +exports.CloudFormationServiceException = CloudFormationServiceException; -class ListStackRefactorActionsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackRefactorActions", {}) - .n("CloudFormationClient", "ListStackRefactorActionsCommand") - .sc(ListStackRefactorActions) - .build() { -} -class ListStackRefactorsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackRefactors", {}) - .n("CloudFormationClient", "ListStackRefactorsCommand") - .sc(ListStackRefactors) - .build() { -} +/***/ }), -class ListStackResourcesCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackResources", {}) - .n("CloudFormationClient", "ListStackResourcesCommand") - .sc(ListStackResources) - .build() { -} +/***/ 4689: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -class ListStacksCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStacks", {}) - .n("CloudFormationClient", "ListStacksCommand") - .sc(ListStacks) - .build() { -} +"use strict"; -class ListStackSetAutoDeploymentTargetsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackSetAutoDeploymentTargets", {}) - .n("CloudFormationClient", "ListStackSetAutoDeploymentTargetsCommand") - .sc(ListStackSetAutoDeploymentTargets) - .build() { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ResourceScanLimitExceededException = exports.OperationStatusCheckFailedException = exports.InvalidStateTransitionException = exports.ResourceScanInProgressException = exports.StackNotFoundException = exports.HookResultNotFoundException = exports.StackRefactorNotFoundException = exports.StackInstanceNotFoundException = exports.ResourceScanNotFoundException = exports.StackSetNotEmptyException = exports.GeneratedTemplateNotFoundException = exports.InvalidChangeSetStatusException = exports.NameAlreadyExistsException = exports.CreatedButModifiedException = exports.StaleRequestException = exports.StackSetNotFoundException = exports.OperationInProgressException = exports.OperationIdAlreadyExistsException = exports.ConcurrentResourcesLimitExceededException = exports.LimitExceededException = exports.InsufficientCapabilitiesException = exports.ChangeSetNotFoundException = exports.TokenAlreadyExistsException = exports.TypeConfigurationNotFoundException = exports.AlreadyExistsException = exports.TypeNotFoundException = exports.CFNRegistryException = exports.OperationNotFoundException = exports.InvalidOperationException = void 0; +const CloudFormationServiceException_1 = __nccwpck_require__(22); +class InvalidOperationException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "InvalidOperationException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "InvalidOperationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidOperationException.prototype); + this.Message = opts.Message; + } } - -class ListStackSetOperationResultsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackSetOperationResults", {}) - .n("CloudFormationClient", "ListStackSetOperationResultsCommand") - .sc(ListStackSetOperationResults) - .build() { +exports.InvalidOperationException = InvalidOperationException; +class OperationNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "OperationNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "OperationNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, OperationNotFoundException.prototype); + this.Message = opts.Message; + } } - -class ListStackSetOperationsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackSetOperations", {}) - .n("CloudFormationClient", "ListStackSetOperationsCommand") - .sc(ListStackSetOperations) - .build() { +exports.OperationNotFoundException = OperationNotFoundException; +class CFNRegistryException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "CFNRegistryException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "CFNRegistryException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, CFNRegistryException.prototype); + this.Message = opts.Message; + } } - -class ListStackSetsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListStackSets", {}) - .n("CloudFormationClient", "ListStackSetsCommand") - .sc(ListStackSets) - .build() { +exports.CFNRegistryException = CFNRegistryException; +class TypeNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "TypeNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "TypeNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, TypeNotFoundException.prototype); + this.Message = opts.Message; + } } - -class ListTypeRegistrationsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListTypeRegistrations", {}) - .n("CloudFormationClient", "ListTypeRegistrationsCommand") - .sc(ListTypeRegistrations) - .build() { +exports.TypeNotFoundException = TypeNotFoundException; +class AlreadyExistsException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "AlreadyExistsException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "AlreadyExistsException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, AlreadyExistsException.prototype); + this.Message = opts.Message; + } } - -class ListTypesCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListTypes", {}) - .n("CloudFormationClient", "ListTypesCommand") - .sc(ListTypes) - .build() { +exports.AlreadyExistsException = AlreadyExistsException; +class TypeConfigurationNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "TypeConfigurationNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "TypeConfigurationNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, TypeConfigurationNotFoundException.prototype); + this.Message = opts.Message; + } } - -class ListTypeVersionsCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ListTypeVersions", {}) - .n("CloudFormationClient", "ListTypeVersionsCommand") - .sc(ListTypeVersions) - .build() { +exports.TypeConfigurationNotFoundException = TypeConfigurationNotFoundException; +class TokenAlreadyExistsException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "TokenAlreadyExistsException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "TokenAlreadyExistsException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, TokenAlreadyExistsException.prototype); + this.Message = opts.Message; + } } - -class PublishTypeCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "PublishType", {}) - .n("CloudFormationClient", "PublishTypeCommand") - .sc(PublishType) - .build() { +exports.TokenAlreadyExistsException = TokenAlreadyExistsException; +class ChangeSetNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "ChangeSetNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "ChangeSetNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ChangeSetNotFoundException.prototype); + this.Message = opts.Message; + } } - -class RecordHandlerProgressCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "RecordHandlerProgress", {}) - .n("CloudFormationClient", "RecordHandlerProgressCommand") - .sc(RecordHandlerProgress) - .build() { +exports.ChangeSetNotFoundException = ChangeSetNotFoundException; +class InsufficientCapabilitiesException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "InsufficientCapabilitiesException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "InsufficientCapabilitiesException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InsufficientCapabilitiesException.prototype); + this.Message = opts.Message; + } } - -class RegisterPublisherCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "RegisterPublisher", {}) - .n("CloudFormationClient", "RegisterPublisherCommand") - .sc(RegisterPublisher) - .build() { +exports.InsufficientCapabilitiesException = InsufficientCapabilitiesException; +class LimitExceededException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "LimitExceededException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "LimitExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, LimitExceededException.prototype); + this.Message = opts.Message; + } } - -class RegisterTypeCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "RegisterType", {}) - .n("CloudFormationClient", "RegisterTypeCommand") - .sc(RegisterType) - .build() { +exports.LimitExceededException = LimitExceededException; +class ConcurrentResourcesLimitExceededException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "ConcurrentResourcesLimitExceededException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "ConcurrentResourcesLimitExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ConcurrentResourcesLimitExceededException.prototype); + this.Message = opts.Message; + } } - -class RollbackStackCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "RollbackStack", {}) - .n("CloudFormationClient", "RollbackStackCommand") - .sc(RollbackStack) - .build() { +exports.ConcurrentResourcesLimitExceededException = ConcurrentResourcesLimitExceededException; +class OperationIdAlreadyExistsException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "OperationIdAlreadyExistsException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "OperationIdAlreadyExistsException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, OperationIdAlreadyExistsException.prototype); + this.Message = opts.Message; + } } - -class SetStackPolicyCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "SetStackPolicy", {}) - .n("CloudFormationClient", "SetStackPolicyCommand") - .sc(SetStackPolicy) - .build() { +exports.OperationIdAlreadyExistsException = OperationIdAlreadyExistsException; +class OperationInProgressException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "OperationInProgressException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "OperationInProgressException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, OperationInProgressException.prototype); + this.Message = opts.Message; + } } - -class SetTypeConfigurationCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "SetTypeConfiguration", {}) - .n("CloudFormationClient", "SetTypeConfigurationCommand") - .sc(SetTypeConfiguration) - .build() { +exports.OperationInProgressException = OperationInProgressException; +class StackSetNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "StackSetNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "StackSetNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, StackSetNotFoundException.prototype); + this.Message = opts.Message; + } } - -class SetTypeDefaultVersionCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "SetTypeDefaultVersion", {}) - .n("CloudFormationClient", "SetTypeDefaultVersionCommand") - .sc(SetTypeDefaultVersion) - .build() { +exports.StackSetNotFoundException = StackSetNotFoundException; +class StaleRequestException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "StaleRequestException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "StaleRequestException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, StaleRequestException.prototype); + this.Message = opts.Message; + } } - -class SignalResourceCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "SignalResource", {}) - .n("CloudFormationClient", "SignalResourceCommand") - .sc(SignalResource) - .build() { +exports.StaleRequestException = StaleRequestException; +class CreatedButModifiedException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "CreatedButModifiedException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "CreatedButModifiedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, CreatedButModifiedException.prototype); + this.Message = opts.Message; + } } - -class StartResourceScanCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "StartResourceScan", {}) - .n("CloudFormationClient", "StartResourceScanCommand") - .sc(StartResourceScan) - .build() { +exports.CreatedButModifiedException = CreatedButModifiedException; +class NameAlreadyExistsException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "NameAlreadyExistsException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "NameAlreadyExistsException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, NameAlreadyExistsException.prototype); + this.Message = opts.Message; + } +} +exports.NameAlreadyExistsException = NameAlreadyExistsException; +class InvalidChangeSetStatusException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "InvalidChangeSetStatusException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "InvalidChangeSetStatusException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidChangeSetStatusException.prototype); + this.Message = opts.Message; + } +} +exports.InvalidChangeSetStatusException = InvalidChangeSetStatusException; +class GeneratedTemplateNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "GeneratedTemplateNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "GeneratedTemplateNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, GeneratedTemplateNotFoundException.prototype); + this.Message = opts.Message; + } } - -class StopStackSetOperationCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "StopStackSetOperation", {}) - .n("CloudFormationClient", "StopStackSetOperationCommand") - .sc(StopStackSetOperation) - .build() { +exports.GeneratedTemplateNotFoundException = GeneratedTemplateNotFoundException; +class StackSetNotEmptyException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "StackSetNotEmptyException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "StackSetNotEmptyException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, StackSetNotEmptyException.prototype); + this.Message = opts.Message; + } } - -class TestTypeCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "TestType", {}) - .n("CloudFormationClient", "TestTypeCommand") - .sc(TestType) - .build() { +exports.StackSetNotEmptyException = StackSetNotEmptyException; +class ResourceScanNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "ResourceScanNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "ResourceScanNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceScanNotFoundException.prototype); + this.Message = opts.Message; + } } - -class UpdateGeneratedTemplateCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "UpdateGeneratedTemplate", {}) - .n("CloudFormationClient", "UpdateGeneratedTemplateCommand") - .sc(UpdateGeneratedTemplate) - .build() { +exports.ResourceScanNotFoundException = ResourceScanNotFoundException; +class StackInstanceNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "StackInstanceNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "StackInstanceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, StackInstanceNotFoundException.prototype); + this.Message = opts.Message; + } } - -class UpdateStackCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "UpdateStack", {}) - .n("CloudFormationClient", "UpdateStackCommand") - .sc(UpdateStack) - .build() { +exports.StackInstanceNotFoundException = StackInstanceNotFoundException; +class StackRefactorNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "StackRefactorNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "StackRefactorNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, StackRefactorNotFoundException.prototype); + this.Message = opts.Message; + } } - -class UpdateStackInstancesCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "UpdateStackInstances", {}) - .n("CloudFormationClient", "UpdateStackInstancesCommand") - .sc(UpdateStackInstances) - .build() { +exports.StackRefactorNotFoundException = StackRefactorNotFoundException; +class HookResultNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "HookResultNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "HookResultNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, HookResultNotFoundException.prototype); + this.Message = opts.Message; + } } - -class UpdateStackSetCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "UpdateStackSet", {}) - .n("CloudFormationClient", "UpdateStackSetCommand") - .sc(UpdateStackSet) - .build() { +exports.HookResultNotFoundException = HookResultNotFoundException; +class StackNotFoundException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "StackNotFoundException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "StackNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, StackNotFoundException.prototype); + this.Message = opts.Message; + } } - -class UpdateTerminationProtectionCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "UpdateTerminationProtection", {}) - .n("CloudFormationClient", "UpdateTerminationProtectionCommand") - .sc(UpdateTerminationProtection) - .build() { +exports.StackNotFoundException = StackNotFoundException; +class ResourceScanInProgressException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "ResourceScanInProgressException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "ResourceScanInProgressException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceScanInProgressException.prototype); + this.Message = opts.Message; + } } - -class ValidateTemplateCommand extends smithyClient.Command - .classBuilder() - .ep(commonParams) - .m(function (Command, cs, config, o) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; -}) - .s("CloudFormation", "ValidateTemplate", {}) - .n("CloudFormationClient", "ValidateTemplateCommand") - .sc(ValidateTemplate) - .build() { +exports.ResourceScanInProgressException = ResourceScanInProgressException; +class InvalidStateTransitionException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "InvalidStateTransitionException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "InvalidStateTransitionException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidStateTransitionException.prototype); + this.Message = opts.Message; + } } - -const commands = { - ActivateOrganizationsAccessCommand, - ActivateTypeCommand, - BatchDescribeTypeConfigurationsCommand, - CancelUpdateStackCommand, - ContinueUpdateRollbackCommand, - CreateChangeSetCommand, - CreateGeneratedTemplateCommand, - CreateStackCommand, - CreateStackInstancesCommand, - CreateStackRefactorCommand, - CreateStackSetCommand, - DeactivateOrganizationsAccessCommand, - DeactivateTypeCommand, - DeleteChangeSetCommand, - DeleteGeneratedTemplateCommand, - DeleteStackCommand, - DeleteStackInstancesCommand, - DeleteStackSetCommand, - DeregisterTypeCommand, - DescribeAccountLimitsCommand, - DescribeChangeSetCommand, - DescribeChangeSetHooksCommand, - DescribeEventsCommand, - DescribeGeneratedTemplateCommand, - DescribeOrganizationsAccessCommand, - DescribePublisherCommand, - DescribeResourceScanCommand, - DescribeStackDriftDetectionStatusCommand, - DescribeStackEventsCommand, - DescribeStackInstanceCommand, - DescribeStackRefactorCommand, - DescribeStackResourceCommand, - DescribeStackResourceDriftsCommand, - DescribeStackResourcesCommand, - DescribeStacksCommand, - DescribeStackSetCommand, - DescribeStackSetOperationCommand, - DescribeTypeCommand, - DescribeTypeRegistrationCommand, - DetectStackDriftCommand, - DetectStackResourceDriftCommand, - DetectStackSetDriftCommand, - EstimateTemplateCostCommand, - ExecuteChangeSetCommand, - ExecuteStackRefactorCommand, - GetGeneratedTemplateCommand, - GetHookResultCommand, - GetStackPolicyCommand, - GetTemplateCommand, - GetTemplateSummaryCommand, - ImportStacksToStackSetCommand, - ListChangeSetsCommand, - ListExportsCommand, - ListGeneratedTemplatesCommand, - ListHookResultsCommand, - ListImportsCommand, - ListResourceScanRelatedResourcesCommand, - ListResourceScanResourcesCommand, - ListResourceScansCommand, - ListStackInstanceResourceDriftsCommand, - ListStackInstancesCommand, - ListStackRefactorActionsCommand, - ListStackRefactorsCommand, - ListStackResourcesCommand, - ListStacksCommand, - ListStackSetAutoDeploymentTargetsCommand, - ListStackSetOperationResultsCommand, - ListStackSetOperationsCommand, - ListStackSetsCommand, - ListTypeRegistrationsCommand, - ListTypesCommand, - ListTypeVersionsCommand, - PublishTypeCommand, - RecordHandlerProgressCommand, - RegisterPublisherCommand, - RegisterTypeCommand, - RollbackStackCommand, - SetStackPolicyCommand, - SetTypeConfigurationCommand, - SetTypeDefaultVersionCommand, - SignalResourceCommand, - StartResourceScanCommand, - StopStackSetOperationCommand, - TestTypeCommand, - UpdateGeneratedTemplateCommand, - UpdateStackCommand, - UpdateStackInstancesCommand, - UpdateStackSetCommand, - UpdateTerminationProtectionCommand, - ValidateTemplateCommand, -}; -class CloudFormation extends CloudFormationClient { +exports.InvalidStateTransitionException = InvalidStateTransitionException; +class OperationStatusCheckFailedException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "OperationStatusCheckFailedException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "OperationStatusCheckFailedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, OperationStatusCheckFailedException.prototype); + this.Message = opts.Message; + } } -smithyClient.createAggregatedClient(commands, CloudFormation); - -const paginateDescribeAccountLimits = core.createPaginator(CloudFormationClient, DescribeAccountLimitsCommand, "NextToken", "NextToken", ""); - -const paginateDescribeChangeSet = core.createPaginator(CloudFormationClient, DescribeChangeSetCommand, "NextToken", "NextToken", ""); - -const paginateDescribeEvents = core.createPaginator(CloudFormationClient, DescribeEventsCommand, "NextToken", "NextToken", ""); - -const paginateDescribeStackEvents = core.createPaginator(CloudFormationClient, DescribeStackEventsCommand, "NextToken", "NextToken", ""); +exports.OperationStatusCheckFailedException = OperationStatusCheckFailedException; +class ResourceScanLimitExceededException extends CloudFormationServiceException_1.CloudFormationServiceException { + name = "ResourceScanLimitExceededException"; + $fault = "client"; + Message; + constructor(opts) { + super({ + name: "ResourceScanLimitExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceScanLimitExceededException.prototype); + this.Message = opts.Message; + } +} +exports.ResourceScanLimitExceededException = ResourceScanLimitExceededException; -const paginateDescribeStackResourceDrifts = core.createPaginator(CloudFormationClient, DescribeStackResourceDriftsCommand, "NextToken", "NextToken", "MaxResults"); -const paginateDescribeStacks = core.createPaginator(CloudFormationClient, DescribeStacksCommand, "NextToken", "NextToken", ""); +/***/ }), -const paginateListChangeSets = core.createPaginator(CloudFormationClient, ListChangeSetsCommand, "NextToken", "NextToken", ""); +/***/ 7079: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const paginateListExports = core.createPaginator(CloudFormationClient, ListExportsCommand, "NextToken", "NextToken", ""); +"use strict"; -const paginateListGeneratedTemplates = core.createPaginator(CloudFormationClient, ListGeneratedTemplatesCommand, "NextToken", "NextToken", "MaxResults"); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRuntimeConfig = void 0; +const tslib_1 = __nccwpck_require__(1860); +const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(9027)); +const core_1 = __nccwpck_require__(8704); +const credential_provider_node_1 = __nccwpck_require__(5861); +const util_user_agent_node_1 = __nccwpck_require__(1656); +const config_resolver_1 = __nccwpck_require__(9316); +const hash_node_1 = __nccwpck_require__(2711); +const middleware_retry_1 = __nccwpck_require__(9618); +const node_config_provider_1 = __nccwpck_require__(5704); +const node_http_handler_1 = __nccwpck_require__(5522); +const smithy_client_1 = __nccwpck_require__(1411); +const util_body_length_node_1 = __nccwpck_require__(3638); +const util_defaults_mode_node_1 = __nccwpck_require__(5435); +const util_retry_1 = __nccwpck_require__(5518); +const runtimeConfig_shared_1 = __nccwpck_require__(6036); +const getRuntimeConfig = (config) => { + (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + (0, core_1.emitWarningIfUnsupportedVersion)(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? + (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, + }, config), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; -const paginateListImports = core.createPaginator(CloudFormationClient, ListImportsCommand, "NextToken", "NextToken", ""); -const paginateListResourceScanRelatedResources = core.createPaginator(CloudFormationClient, ListResourceScanRelatedResourcesCommand, "NextToken", "NextToken", "MaxResults"); +/***/ }), -const paginateListResourceScanResources = core.createPaginator(CloudFormationClient, ListResourceScanResourcesCommand, "NextToken", "NextToken", "MaxResults"); +/***/ 6036: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const paginateListResourceScans = core.createPaginator(CloudFormationClient, ListResourceScansCommand, "NextToken", "NextToken", "MaxResults"); +"use strict"; -const paginateListStackInstances = core.createPaginator(CloudFormationClient, ListStackInstancesCommand, "NextToken", "NextToken", "MaxResults"); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRuntimeConfig = void 0; +const core_1 = __nccwpck_require__(8704); +const protocols_1 = __nccwpck_require__(7288); +const smithy_client_1 = __nccwpck_require__(1411); +const url_parser_1 = __nccwpck_require__(4494); +const util_base64_1 = __nccwpck_require__(8385); +const util_utf8_1 = __nccwpck_require__(1577); +const httpAuthSchemeProvider_1 = __nccwpck_require__(398); +const endpointResolver_1 = __nccwpck_require__(2840); +const schemas_0_1 = __nccwpck_require__(3389); +const getRuntimeConfig = (config) => { + return { + apiVersion: "2010-05-15", + 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.defaultCloudFormationHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new core_1.AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + protocol: config?.protocol ?? protocols_1.AwsQueryProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.cloudformation", + errorTypeRegistries: schemas_0_1.errorTypeRegistries, + xmlNamespace: "http://cloudformation.amazonaws.com/doc/2010-05-15/", + version: "2010-05-15", + serviceTarget: "CloudFormation", + }, + serviceId: config?.serviceId ?? "CloudFormation", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; -const paginateListStackRefactorActions = core.createPaginator(CloudFormationClient, ListStackRefactorActionsCommand, "NextToken", "NextToken", "MaxResults"); -const paginateListStackRefactors = core.createPaginator(CloudFormationClient, ListStackRefactorsCommand, "NextToken", "NextToken", "MaxResults"); +/***/ }), -const paginateListStackResources = core.createPaginator(CloudFormationClient, ListStackResourcesCommand, "NextToken", "NextToken", ""); +/***/ 3389: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const paginateListStackSetOperationResults = core.createPaginator(CloudFormationClient, ListStackSetOperationResultsCommand, "NextToken", "NextToken", "MaxResults"); +"use strict"; -const paginateListStackSetOperations = core.createPaginator(CloudFormationClient, ListStackSetOperationsCommand, "NextToken", "NextToken", "MaxResults"); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ContinueUpdateRollbackOutput$ = exports.ContinueUpdateRollbackInput$ = exports.ChangeSetSummary$ = exports.ChangeSetHookTargetDetails$ = exports.ChangeSetHookResourceTargetDetails$ = exports.ChangeSetHook$ = exports.Change$ = exports.CancelUpdateStackInput$ = exports.BatchDescribeTypeConfigurationsOutput$ = exports.BatchDescribeTypeConfigurationsInput$ = exports.BatchDescribeTypeConfigurationsError$ = exports.AutoDeployment$ = exports.Annotation$ = exports.ActivateTypeOutput$ = exports.ActivateTypeInput$ = exports.ActivateOrganizationsAccessOutput$ = exports.ActivateOrganizationsAccessInput$ = exports.AccountLimit$ = exports.AccountGateResult$ = exports.errorTypeRegistries = exports.TypeNotFoundException$ = exports.TypeConfigurationNotFoundException$ = exports.TokenAlreadyExistsException$ = exports.StaleRequestException$ = exports.StackSetNotFoundException$ = exports.StackSetNotEmptyException$ = exports.StackRefactorNotFoundException$ = exports.StackNotFoundException$ = exports.StackInstanceNotFoundException$ = exports.ResourceScanNotFoundException$ = exports.ResourceScanLimitExceededException$ = exports.ResourceScanInProgressException$ = exports.OperationStatusCheckFailedException$ = exports.OperationNotFoundException$ = exports.OperationInProgressException$ = exports.OperationIdAlreadyExistsException$ = exports.NameAlreadyExistsException$ = exports.LimitExceededException$ = exports.InvalidStateTransitionException$ = exports.InvalidOperationException$ = exports.InvalidChangeSetStatusException$ = exports.InsufficientCapabilitiesException$ = exports.HookResultNotFoundException$ = exports.GeneratedTemplateNotFoundException$ = exports.CreatedButModifiedException$ = exports.ConcurrentResourcesLimitExceededException$ = exports.ChangeSetNotFoundException$ = exports.CFNRegistryException$ = exports.AlreadyExistsException$ = exports.CloudFormationServiceException$ = void 0; +exports.DescribeStackRefactorInput$ = exports.DescribeStackInstanceOutput$ = exports.DescribeStackInstanceInput$ = exports.DescribeStackEventsOutput$ = exports.DescribeStackEventsInput$ = exports.DescribeStackDriftDetectionStatusOutput$ = exports.DescribeStackDriftDetectionStatusInput$ = exports.DescribeResourceScanOutput$ = exports.DescribeResourceScanInput$ = exports.DescribePublisherOutput$ = exports.DescribePublisherInput$ = exports.DescribeOrganizationsAccessOutput$ = exports.DescribeOrganizationsAccessInput$ = exports.DescribeGeneratedTemplateOutput$ = exports.DescribeGeneratedTemplateInput$ = exports.DescribeEventsOutput$ = exports.DescribeEventsInput$ = exports.DescribeChangeSetOutput$ = exports.DescribeChangeSetInput$ = exports.DescribeChangeSetHooksOutput$ = exports.DescribeChangeSetHooksInput$ = exports.DescribeAccountLimitsOutput$ = exports.DescribeAccountLimitsInput$ = exports.DeregisterTypeOutput$ = exports.DeregisterTypeInput$ = exports.DeploymentTargets$ = exports.DeleteStackSetOutput$ = exports.DeleteStackSetInput$ = exports.DeleteStackInstancesOutput$ = exports.DeleteStackInstancesInput$ = exports.DeleteStackInput$ = exports.DeleteGeneratedTemplateInput$ = exports.DeleteChangeSetOutput$ = exports.DeleteChangeSetInput$ = exports.DeactivateTypeOutput$ = exports.DeactivateTypeInput$ = exports.DeactivateOrganizationsAccessOutput$ = exports.DeactivateOrganizationsAccessInput$ = exports.CreateStackSetOutput$ = exports.CreateStackSetInput$ = exports.CreateStackRefactorOutput$ = exports.CreateStackRefactorInput$ = exports.CreateStackOutput$ = exports.CreateStackInstancesOutput$ = exports.CreateStackInstancesInput$ = exports.CreateStackInput$ = exports.CreateGeneratedTemplateOutput$ = exports.CreateGeneratedTemplateInput$ = exports.CreateChangeSetOutput$ = exports.CreateChangeSetInput$ = void 0; +exports.ListGeneratedTemplatesOutput$ = exports.ListGeneratedTemplatesInput$ = exports.ListExportsOutput$ = exports.ListExportsInput$ = exports.ListChangeSetsOutput$ = exports.ListChangeSetsInput$ = exports.ImportStacksToStackSetOutput$ = exports.ImportStacksToStackSetInput$ = exports.HookTarget$ = exports.HookResultSummary$ = exports.GetTemplateSummaryOutput$ = exports.GetTemplateSummaryInput$ = exports.GetTemplateOutput$ = exports.GetTemplateInput$ = exports.GetStackPolicyOutput$ = exports.GetStackPolicyInput$ = exports.GetHookResultOutput$ = exports.GetHookResultInput$ = exports.GetGeneratedTemplateOutput$ = exports.GetGeneratedTemplateInput$ = exports.Export$ = exports.ExecuteStackRefactorInput$ = exports.ExecuteChangeSetOutput$ = exports.ExecuteChangeSetInput$ = exports.EventFilter$ = exports.EstimateTemplateCostOutput$ = exports.EstimateTemplateCostInput$ = exports.DetectStackSetDriftOutput$ = exports.DetectStackSetDriftInput$ = exports.DetectStackResourceDriftOutput$ = exports.DetectStackResourceDriftInput$ = exports.DetectStackDriftOutput$ = exports.DetectStackDriftInput$ = exports.DescribeTypeRegistrationOutput$ = exports.DescribeTypeRegistrationInput$ = exports.DescribeTypeOutput$ = exports.DescribeTypeInput$ = exports.DescribeStacksOutput$ = exports.DescribeStacksInput$ = exports.DescribeStackSetOutput$ = exports.DescribeStackSetOperationOutput$ = exports.DescribeStackSetOperationInput$ = exports.DescribeStackSetInput$ = exports.DescribeStackResourcesOutput$ = exports.DescribeStackResourcesInput$ = exports.DescribeStackResourceOutput$ = exports.DescribeStackResourceInput$ = exports.DescribeStackResourceDriftsOutput$ = exports.DescribeStackResourceDriftsInput$ = exports.DescribeStackRefactorOutput$ = void 0; +exports.PublishTypeInput$ = exports.PropertyDifference$ = exports.PhysicalResourceIdContextKeyValuePair$ = exports.ParameterDeclaration$ = exports.ParameterConstraints$ = exports.Parameter$ = exports.Output$ = exports.OperationResultFilter$ = exports.OperationEvent$ = exports.OperationEntry$ = exports.ModuleInfo$ = exports.ManagedExecution$ = exports.LoggingConfig$ = exports.LiveResourceDrift$ = exports.ListTypeVersionsOutput$ = exports.ListTypeVersionsInput$ = exports.ListTypesOutput$ = exports.ListTypesInput$ = exports.ListTypeRegistrationsOutput$ = exports.ListTypeRegistrationsInput$ = exports.ListStacksOutput$ = exports.ListStacksInput$ = exports.ListStackSetsOutput$ = exports.ListStackSetsInput$ = exports.ListStackSetOperationsOutput$ = exports.ListStackSetOperationsInput$ = exports.ListStackSetOperationResultsOutput$ = exports.ListStackSetOperationResultsInput$ = exports.ListStackSetAutoDeploymentTargetsOutput$ = exports.ListStackSetAutoDeploymentTargetsInput$ = exports.ListStackResourcesOutput$ = exports.ListStackResourcesInput$ = exports.ListStackRefactorsOutput$ = exports.ListStackRefactorsInput$ = exports.ListStackRefactorActionsOutput$ = exports.ListStackRefactorActionsInput$ = exports.ListStackInstancesOutput$ = exports.ListStackInstancesInput$ = exports.ListStackInstanceResourceDriftsOutput$ = exports.ListStackInstanceResourceDriftsInput$ = exports.ListResourceScansOutput$ = exports.ListResourceScansInput$ = exports.ListResourceScanResourcesOutput$ = exports.ListResourceScanResourcesInput$ = exports.ListResourceScanRelatedResourcesOutput$ = exports.ListResourceScanRelatedResourcesInput$ = exports.ListImportsOutput$ = exports.ListImportsInput$ = exports.ListHookResultsOutput$ = exports.ListHookResultsInput$ = void 0; +exports.StackResourceSummary$ = exports.StackResourceDriftInformationSummary$ = exports.StackResourceDriftInformation$ = exports.StackResourceDrift$ = exports.StackResourceDetail$ = exports.StackResource$ = exports.StackRefactorSummary$ = exports.StackRefactorAction$ = exports.StackInstanceSummary$ = exports.StackInstanceResourceDriftsSummary$ = exports.StackInstanceFilter$ = exports.StackInstanceComprehensiveStatus$ = exports.StackInstance$ = exports.StackEvent$ = exports.StackDriftInformationSummary$ = exports.StackDriftInformation$ = exports.StackDefinition$ = exports.Stack$ = exports.SignalResourceInput$ = exports.SetTypeDefaultVersionOutput$ = exports.SetTypeDefaultVersionInput$ = exports.SetTypeConfigurationOutput$ = exports.SetTypeConfigurationInput$ = exports.SetStackPolicyInput$ = exports.ScannedResourceIdentifier$ = exports.ScannedResource$ = exports.ScanFilter$ = exports.RollbackTrigger$ = exports.RollbackStackOutput$ = exports.RollbackStackInput$ = exports.RollbackConfiguration$ = exports.ResourceToImport$ = exports.ResourceTargetDefinition$ = exports.ResourceScanSummary$ = exports.ResourceMapping$ = exports.ResourceLocation$ = exports.ResourceIdentifierSummary$ = exports.ResourceDriftIgnoredAttribute$ = exports.ResourceDetail$ = exports.ResourceDefinition$ = exports.ResourceChangeDetail$ = exports.ResourceChange$ = exports.RequiredActivatedType$ = exports.RegisterTypeOutput$ = exports.RegisterTypeInput$ = exports.RegisterPublisherOutput$ = exports.RegisterPublisherInput$ = exports.RecordHandlerProgressOutput$ = exports.RecordHandlerProgressInput$ = exports.PublishTypeOutput$ = void 0; +exports.CreateStack$ = exports.CreateGeneratedTemplate$ = exports.CreateChangeSet$ = exports.ContinueUpdateRollback$ = exports.CancelUpdateStack$ = exports.BatchDescribeTypeConfigurations$ = exports.ActivateType$ = exports.ActivateOrganizationsAccess$ = exports.Warnings$ = exports.WarningProperty$ = exports.WarningDetail$ = exports.ValidateTemplateOutput$ = exports.ValidateTemplateInput$ = exports.UpdateTerminationProtectionOutput$ = exports.UpdateTerminationProtectionInput$ = exports.UpdateStackSetOutput$ = exports.UpdateStackSetInput$ = exports.UpdateStackOutput$ = exports.UpdateStackInstancesOutput$ = exports.UpdateStackInstancesInput$ = exports.UpdateStackInput$ = exports.UpdateGeneratedTemplateOutput$ = exports.UpdateGeneratedTemplateInput$ = exports.TypeVersionSummary$ = exports.TypeSummary$ = exports.TypeFilters$ = exports.TypeConfigurationIdentifier$ = exports.TypeConfigurationDetails$ = exports.TestTypeOutput$ = exports.TestTypeInput$ = exports.TemplateSummaryConfig$ = exports.TemplateSummary$ = exports.TemplateProgress$ = exports.TemplateParameter$ = exports.TemplateConfiguration$ = exports.Tag$ = exports.StopStackSetOperationOutput$ = exports.StopStackSetOperationInput$ = exports.StartResourceScanOutput$ = exports.StartResourceScanInput$ = exports.StackSummary$ = exports.StackSetSummary$ = exports.StackSetOperationSummary$ = exports.StackSetOperationStatusDetails$ = exports.StackSetOperationResultSummary$ = exports.StackSetOperationPreferences$ = exports.StackSetOperation$ = exports.StackSetDriftDetectionDetails$ = exports.StackSetAutoDeploymentTargetSummary$ = exports.StackSet$ = void 0; +exports.ListResourceScanResources$ = exports.ListResourceScanRelatedResources$ = exports.ListImports$ = exports.ListHookResults$ = exports.ListGeneratedTemplates$ = exports.ListExports$ = exports.ListChangeSets$ = exports.ImportStacksToStackSet$ = exports.GetTemplateSummary$ = exports.GetTemplate$ = exports.GetStackPolicy$ = exports.GetHookResult$ = exports.GetGeneratedTemplate$ = exports.ExecuteStackRefactor$ = exports.ExecuteChangeSet$ = exports.EstimateTemplateCost$ = exports.DetectStackSetDrift$ = exports.DetectStackResourceDrift$ = exports.DetectStackDrift$ = exports.DescribeTypeRegistration$ = exports.DescribeType$ = exports.DescribeStackSetOperation$ = exports.DescribeStackSet$ = exports.DescribeStacks$ = exports.DescribeStackResources$ = exports.DescribeStackResourceDrifts$ = exports.DescribeStackResource$ = exports.DescribeStackRefactor$ = exports.DescribeStackInstance$ = exports.DescribeStackEvents$ = exports.DescribeStackDriftDetectionStatus$ = exports.DescribeResourceScan$ = exports.DescribePublisher$ = exports.DescribeOrganizationsAccess$ = exports.DescribeGeneratedTemplate$ = exports.DescribeEvents$ = exports.DescribeChangeSetHooks$ = exports.DescribeChangeSet$ = exports.DescribeAccountLimits$ = exports.DeregisterType$ = exports.DeleteStackSet$ = exports.DeleteStackInstances$ = exports.DeleteStack$ = exports.DeleteGeneratedTemplate$ = exports.DeleteChangeSet$ = exports.DeactivateType$ = exports.DeactivateOrganizationsAccess$ = exports.CreateStackSet$ = exports.CreateStackRefactor$ = exports.CreateStackInstances$ = void 0; +exports.ValidateTemplate$ = exports.UpdateTerminationProtection$ = exports.UpdateStackSet$ = exports.UpdateStackInstances$ = exports.UpdateStack$ = exports.UpdateGeneratedTemplate$ = exports.TestType$ = exports.StopStackSetOperation$ = exports.StartResourceScan$ = exports.SignalResource$ = exports.SetTypeDefaultVersion$ = exports.SetTypeConfiguration$ = exports.SetStackPolicy$ = exports.RollbackStack$ = exports.RegisterType$ = exports.RegisterPublisher$ = exports.RecordHandlerProgress$ = exports.PublishType$ = exports.ListTypeVersions$ = exports.ListTypes$ = exports.ListTypeRegistrations$ = exports.ListStackSets$ = exports.ListStackSetOperations$ = exports.ListStackSetOperationResults$ = exports.ListStackSetAutoDeploymentTargets$ = exports.ListStacks$ = exports.ListStackResources$ = exports.ListStackRefactors$ = exports.ListStackRefactorActions$ = exports.ListStackInstances$ = exports.ListStackInstanceResourceDrifts$ = exports.ListResourceScans$ = void 0; +const _A = "Arn"; +const _AC = "AfterContext"; +const _ACT = "AttributeChangeType"; +const _AD = "AutoDeployment"; +const _AEE = "AlreadyExistsException"; +const _AFT = "AccountFilterType"; +const _AGR = "AccountGateResult"; +const _AL = "AccountLimit"; +const _ALL = "AccountLimitList"; +const _ALc = "AccountLimits"; +const _ALn = "AnnotationList"; +const _AN = "AnnotationName"; +const _AOA = "ActivateOrganizationsAccess"; +const _AOAI = "ActivateOrganizationsAccessInput"; +const _AOAO = "ActivateOrganizationsAccessOutput"; +const _AP = "ActualProperties"; +const _AR = "AddResources"; +const _ARARN = "AdministrationRoleARN"; +const _AT = "ActivateType"; +const _ATAC = "AcceptTermsAndConditions"; +const _ATI = "ActivateTypeInput"; +const _ATO = "ActivateTypeOutput"; +const _AU = "AutoUpdate"; +const _AUc = "AccountsUrl"; +const _AV = "ActualValue"; +const _AVF = "AfterValueFrom"; +const _AVf = "AfterValue"; +const _AVl = "AllowedValues"; +const _Ac = "Accounts"; +const _Acc = "Account"; +const _Act = "Action"; +const _Acti = "Active"; +const _Al = "Alias"; +const _An = "Annotation"; +const _Ann = "Annotations"; +const _At = "Attribute"; +const _BC = "BeforeContext"; +const _BDTC = "BatchDescribeTypeConfigurations"; +const _BDTCE = "BatchDescribeTypeConfigurationsError"; +const _BDTCEa = "BatchDescribeTypeConfigurationsErrors"; +const _BDTCI = "BatchDescribeTypeConfigurationsInput"; +const _BDTCO = "BatchDescribeTypeConfigurationsOutput"; +const _BT = "BearerToken"; +const _BV = "BeforeValue"; +const _BVF = "BeforeValueFrom"; +const _C = "Change"; +const _CA = "CallAs"; +const _CAo = "ConnectionArn"; +const _CAon = "ConfigurationAlias"; +const _CAonf = "ConfigurationArn"; +const _CBME = "CreatedButModifiedException"; +const _CCS = "CreateChangeSet"; +const _CCSI = "CreateChangeSetInput"; +const _CCSO = "CreateChangeSetOutput"; +const _CE = "CausingEntity"; +const _CFNRE = "CFNRegistryException"; +const _CGT = "CreateGeneratedTemplate"; +const _CGTI = "CreateGeneratedTemplateInput"; +const _CGTO = "CreateGeneratedTemplateOutput"; +const _CM = "ConcurrencyMode"; +const _COS = "CurrentOperationStatus"; +const _CR = "CapabilitiesReason"; +const _CRLEE = "ConcurrentResourcesLimitExceededException"; +const _CRT = "ClientRequestToken"; +const _CS = "ConfigurationSchema"; +const _CSH = "ChangeSetHook"; +const _CSHRTD = "ChangeSetHookResourceTargetDetails"; +const _CSHTD = "ChangeSetHookTargetDetails"; +const _CSHh = "ChangeSetHooks"; +const _CSI = "ChangeSetId"; +const _CSII = "CreateStackInstancesInput"; +const _CSIO = "CreateStackInstancesOutput"; +const _CSIr = "CreateStackInput"; +const _CSIre = "CreateStackInstances"; +const _CSN = "ChangeSetName"; +const _CSNFE = "ChangeSetNotFoundException"; +const _CSO = "CreateStackOutput"; +const _CSR = "CreateStackRefactor"; +const _CSRI = "CreateStackRefactorInput"; +const _CSRO = "CreateStackRefactorOutput"; +const _CSS = "ChangeSetSummary"; +const _CSSI = "CreateStackSetInput"; +const _CSSO = "CreateStackSetOutput"; +const _CSSh = "ChangeSetSummaries"; +const _CSSr = "CreateStackSet"; +const _CST = "ChangeSetType"; +const _CSh = "ChangeSource"; +const _CSr = "CreateStack"; +const _CT = "CreationTime"; +const _CTl = "ClientToken"; +const _CTr = "CreationTimestamp"; +const _CUR = "ContinueUpdateRollback"; +const _CURI = "ContinueUpdateRollbackInput"; +const _CURO = "ContinueUpdateRollbackOutput"; +const _CUS = "CancelUpdateStack"; +const _CUSI = "CancelUpdateStackInput"; +const _Ca = "Capabilities"; +const _Cat = "Category"; +const _Ch = "Changes"; +const _Co = "Configuration"; +const _D = "Description"; +const _DAL = "DescribeAccountLimits"; +const _DALI = "DescribeAccountLimitsInput"; +const _DALO = "DescribeAccountLimitsOutput"; +const _DCS = "DeleteChangeSet"; +const _DCSH = "DescribeChangeSetHooks"; +const _DCSHI = "DescribeChangeSetHooksInput"; +const _DCSHO = "DescribeChangeSetHooksOutput"; +const _DCSI = "DeleteChangeSetInput"; +const _DCSIe = "DescribeChangeSetInput"; +const _DCSO = "DeleteChangeSetOutput"; +const _DCSOe = "DescribeChangeSetOutput"; +const _DCSe = "DescribeChangeSet"; +const _DDS = "DriftDetectionStatus"; +const _DDT = "DriftDetectionTimestamp"; +const _DE = "DescribeEvents"; +const _DEI = "DescribeEventsInput"; +const _DEO = "DescribeEventsOutput"; +const _DGT = "DeleteGeneratedTemplate"; +const _DGTI = "DeleteGeneratedTemplateInput"; +const _DGTIe = "DescribeGeneratedTemplateInput"; +const _DGTO = "DescribeGeneratedTemplateOutput"; +const _DGTe = "DescribeGeneratedTemplate"; +const _DI = "DriftInformation"; +const _DM = "DeploymentMode"; +const _DMe = "DeletionMode"; +const _DO = "DependsOn"; +const _DOA = "DeactivateOrganizationsAccess"; +const _DOAI = "DeactivateOrganizationsAccessInput"; +const _DOAIe = "DescribeOrganizationsAccessInput"; +const _DOAO = "DeactivateOrganizationsAccessOutput"; +const _DOAOe = "DescribeOrganizationsAccessOutput"; +const _DOAe = "DescribeOrganizationsAccess"; +const _DP = "DeletionPolicy"; +const _DPI = "DescribePublisherInput"; +const _DPO = "DescribePublisherOutput"; +const _DPe = "DescribePublisher"; +const _DR = "DisableRollback"; +const _DRS = "DescribeResourceScan"; +const _DRSI = "DescribeResourceScanInput"; +const _DRSO = "DescribeResourceScanOutput"; +const _DRe = "DetectionReason"; +const _DS = "DetectionStatus"; +const _DSD = "DetectStackDrift"; +const _DSDDS = "DescribeStackDriftDetectionStatus"; +const _DSDDSI = "DescribeStackDriftDetectionStatusInput"; +const _DSDDSO = "DescribeStackDriftDetectionStatusOutput"; +const _DSDI = "DetectStackDriftInput"; +const _DSDO = "DetectStackDriftOutput"; +const _DSE = "DescribeStackEvents"; +const _DSEI = "DescribeStackEventsInput"; +const _DSEO = "DescribeStackEventsOutput"; +const _DSI = "DeleteStackInput"; +const _DSIC = "DriftedStackInstancesCount"; +const _DSII = "DeleteStackInstancesInput"; +const _DSIIe = "DescribeStackInstanceInput"; +const _DSIO = "DeleteStackInstancesOutput"; +const _DSIOe = "DescribeStackInstanceOutput"; +const _DSIe = "DescribeStacksInput"; +const _DSIel = "DeleteStackInstances"; +const _DSIes = "DescribeStackInstance"; +const _DSO = "DescribeStacksOutput"; +const _DSR = "DetectionStatusReason"; +const _DSRC = "DriftedStackResourceCount"; +const _DSRD = "DescribeStackResourceDrifts"; +const _DSRDI = "DescribeStackResourceDriftsInput"; +const _DSRDIe = "DetectStackResourceDriftInput"; +const _DSRDO = "DescribeStackResourceDriftsOutput"; +const _DSRDOe = "DetectStackResourceDriftOutput"; +const _DSRDe = "DetectStackResourceDrift"; +const _DSRI = "DescribeStackRefactorInput"; +const _DSRIe = "DescribeStackResourceInput"; +const _DSRIes = "DescribeStackResourcesInput"; +const _DSRO = "DescribeStackRefactorOutput"; +const _DSROe = "DescribeStackResourceOutput"; +const _DSROes = "DescribeStackResourcesOutput"; +const _DSRe = "DescribeStackRefactor"; +const _DSRes = "DescribeStackResource"; +const _DSResc = "DescribeStackResources"; +const _DSRr = "DriftStatusReason"; +const _DSS = "DeleteStackSet"; +const _DSSD = "DetectStackSetDrift"; +const _DSSDI = "DetectStackSetDriftInput"; +const _DSSDO = "DetectStackSetDriftOutput"; +const _DSSI = "DeleteStackSetInput"; +const _DSSIe = "DescribeStackSetInput"; +const _DSSO = "DeleteStackSetOutput"; +const _DSSOI = "DescribeStackSetOperationInput"; +const _DSSOO = "DescribeStackSetOperationOutput"; +const _DSSOe = "DescribeStackSetOutput"; +const _DSSOes = "DescribeStackSetOperation"; +const _DSSe = "DescribeStackSet"; +const _DSe = "DeprecatedStatus"; +const _DSel = "DeleteStack"; +const _DSes = "DescribeStacks"; +const _DSet = "DetailedStatus"; +const _DSr = "DriftStatus"; +const _DT = "DeploymentTargets"; +const _DTI = "DeactivateTypeInput"; +const _DTIe = "DeregisterTypeInput"; +const _DTIes = "DescribeTypeInput"; +const _DTO = "DeactivateTypeOutput"; +const _DTOe = "DeregisterTypeOutput"; +const _DTOes = "DescribeTypeOutput"; +const _DTR = "DescribeTypeRegistration"; +const _DTRI = "DescribeTypeRegistrationInput"; +const _DTRO = "DescribeTypeRegistrationOutput"; +const _DTe = "DeclaredTransforms"; +const _DTea = "DeactivateType"; +const _DTel = "DeletionTime"; +const _DTer = "DeregisterType"; +const _DTes = "DescribeType"; +const _DTi = "DifferenceType"; +const _DU = "DocumentationUrl"; +const _DV = "DefaultValue"; +const _DVI = "DefaultVersionId"; +const _De = "Details"; +const _Des = "Destination"; +const _Det = "Detection"; +const _Dr = "Drift"; +const _E = "Enabled"; +const _EC = "ErrorCode"; +const _ECS = "ExecuteChangeSet"; +const _ECSI = "ExecuteChangeSetInput"; +const _ECSO = "ExecuteChangeSetOutput"; +const _EF = "EventFilter"; +const _EI = "EventId"; +const _EM = "ErrorMessage"; +const _EN = "ExportName"; +const _EP = "ExpectedProperties"; +const _ERA = "ExecutionRoleArn"; +const _ERN = "ExecutionRoleName"; +const _ES = "ExecutionStatus"; +const _ESC = "EnableStackCreation"; +const _ESF = "ExecutionStatusFilter"; +const _ESI = "ExportingStackId"; +const _ESR = "ExecutionStatusReason"; +const _ESRI = "ExecuteStackRefactorInput"; +const _ESRx = "ExecuteStackRefactor"; +const _ET = "EndTime"; +const _ETC = "EstimateTemplateCost"; +const _ETCI = "EstimateTemplateCostInput"; +const _ETCO = "EstimateTemplateCostOutput"; +const _ETP = "EnableTerminationProtection"; +const _ETn = "EndTimestamp"; +const _ETv = "EventType"; +const _EV = "ExpectedValue"; +const _En = "Entity"; +const _Er = "Errors"; +const _Ev = "Evaluation"; +const _Ex = "Export"; +const _Exp = "Exports"; +const _F = "Filters"; +const _FE = "FailedEvents"; +const _FM = "FailureMode"; +const _FSIC = "FailedStackInstancesCount"; +const _FTC = "FailureToleranceCount"; +const _FTP = "FailureTolerancePercentage"; +const _Fo = "Format"; +const _GGT = "GetGeneratedTemplate"; +const _GGTI = "GetGeneratedTemplateInput"; +const _GGTO = "GetGeneratedTemplateOutput"; +const _GHR = "GetHookResult"; +const _GHRI = "GetHookResultInput"; +const _GHRO = "GetHookResultOutput"; +const _GSP = "GetStackPolicy"; +const _GSPI = "GetStackPolicyInput"; +const _GSPO = "GetStackPolicyOutput"; +const _GT = "GetTemplate"; +const _GTI = "GeneratedTemplateId"; +const _GTIe = "GetTemplateInput"; +const _GTN = "GeneratedTemplateName"; +const _GTNFE = "GeneratedTemplateNotFoundException"; +const _GTO = "GetTemplateOutput"; +const _GTS = "GetTemplateSummary"; +const _GTSI = "GetTemplateSummaryInput"; +const _GTSO = "GetTemplateSummaryOutput"; +const _H = "Hooks"; +const _HET = "HookExecutionTarget"; +const _HFM = "HookFailureMode"; +const _HIC = "HookInvocationCount"; +const _HII = "HookInvocationId"; +const _HIP = "HookInvocationPoint"; +const _HR = "HookResults"; +const _HRI = "HookResultId"; +const _HRNFE = "HookResultNotFoundException"; +const _HRS = "HookResultSummary"; +const _HRSo = "HookResultSummaries"; +const _HS = "HookStatus"; +const _HSR = "HookStatusReason"; +const _HT = "HookTarget"; +const _HTo = "HookType"; +const _I = "Id"; +const _IA = "IsActivated"; +const _IAn = "InvokedAt"; +const _ICE = "InsufficientCapabilitiesException"; +const _ICSSE = "InvalidChangeSetStatusException"; +const _IDC = "IsDefaultConfiguration"; +const _IDV = "IsDefaultVersion"; +const _IER = "ImportExistingResources"; +const _INS = "IncludeNestedStacks"; +const _IOE = "InvalidOperationException"; +const _IP = "InvocationPoint"; +const _IPSIC = "InProgressStackInstancesCount"; +const _IPV = "IncludePropertyValues"; +const _IPd = "IdentityProvider"; +const _ISSIC = "InSyncStackInstancesCount"; +const _ISTE = "InvalidStateTransitionException"; +const _ISTSS = "ImportStacksToStackSet"; +const _ISTSSI = "ImportStacksToStackSetInput"; +const _ISTSSO = "ImportStacksToStackSetOutput"; +const _Im = "Imports"; +const _K = "Key"; +const _LC = "LoggingConfig"; +const _LCS = "ListChangeSets"; +const _LCSI = "ListChangeSetsInput"; +const _LCSO = "ListChangeSetsOutput"; +const _LCT = "LastCheckTimestamp"; +const _LDB = "LogDeliveryBucket"; +const _LDCT = "LastDriftCheckTimestamp"; +const _LE = "ListExports"; +const _LEE = "LimitExceededException"; +const _LEI = "ListExportsInput"; +const _LEO = "ListExportsOutput"; +const _LGN = "LogGroupName"; +const _LGT = "ListGeneratedTemplates"; +const _LGTI = "ListGeneratedTemplatesInput"; +const _LGTO = "ListGeneratedTemplatesOutput"; +const _LHR = "ListHookResults"; +const _LHRI = "ListHookResultsInput"; +const _LHRO = "ListHookResultsOutput"; +const _LI = "ListImports"; +const _LIH = "LogicalIdHierarchy"; +const _LII = "ListImportsInput"; +const _LIO = "ListImportsOutput"; +const _LO = "LastOperations"; +const _LOI = "LastOperationId"; +const _LPV = "LatestPublicVersion"; +const _LRA = "LogRoleArn"; +const _LRD = "LiveResourceDrift"; +const _LRI = "LogicalResourceId"; +const _LRIo = "LogicalResourceIds"; +const _LRS = "ListResourceScans"; +const _LRSI = "ListResourceScansInput"; +const _LRSO = "ListResourceScansOutput"; +const _LRSR = "ListResourceScanResources"; +const _LRSRI = "ListResourceScanResourcesInput"; +const _LRSRO = "ListResourceScanResourcesOutput"; +const _LRSRR = "ListResourceScanRelatedResources"; +const _LRSRRI = "ListResourceScanRelatedResourcesInput"; +const _LRSRRO = "ListResourceScanRelatedResourcesOutput"; +const _LS = "ListStacks"; +const _LSI = "ListStacksInput"; +const _LSII = "ListStackInstancesInput"; +const _LSIO = "ListStackInstancesOutput"; +const _LSIRD = "ListStackInstanceResourceDrifts"; +const _LSIRDI = "ListStackInstanceResourceDriftsInput"; +const _LSIRDO = "ListStackInstanceResourceDriftsOutput"; +const _LSIi = "ListStackInstances"; +const _LSO = "ListStacksOutput"; +const _LSR = "ListStackRefactors"; +const _LSRA = "ListStackRefactorActions"; +const _LSRAI = "ListStackRefactorActionsInput"; +const _LSRAO = "ListStackRefactorActionsOutput"; +const _LSRI = "ListStackRefactorsInput"; +const _LSRIi = "ListStackResourcesInput"; +const _LSRO = "ListStackRefactorsOutput"; +const _LSROi = "ListStackResourcesOutput"; +const _LSRi = "ListStackResources"; +const _LSS = "ListStackSets"; +const _LSSADT = "ListStackSetAutoDeploymentTargets"; +const _LSSADTI = "ListStackSetAutoDeploymentTargetsInput"; +const _LSSADTO = "ListStackSetAutoDeploymentTargetsOutput"; +const _LSSI = "ListStackSetsInput"; +const _LSSO = "ListStackSetsOutput"; +const _LSSOI = "ListStackSetOperationsInput"; +const _LSSOO = "ListStackSetOperationsOutput"; +const _LSSOR = "ListStackSetOperationResults"; +const _LSSORI = "ListStackSetOperationResultsInput"; +const _LSSORO = "ListStackSetOperationResultsOutput"; +const _LSSOi = "ListStackSetOperations"; +const _LT = "ListTypes"; +const _LTI = "ListTypesInput"; +const _LTO = "ListTypesOutput"; +const _LTR = "ListTypeRegistrations"; +const _LTRI = "ListTypeRegistrationsInput"; +const _LTRO = "ListTypeRegistrationsOutput"; +const _LTV = "ListTypeVersions"; +const _LTVI = "ListTypeVersionsInput"; +const _LTVO = "ListTypeVersionsOutput"; +const _LU = "LastUpdated"; +const _LUT = "LastUpdatedTime"; +const _LUTa = "LastUpdatedTimestamp"; +const _M = "Message"; +const _MBS = "ManagedByStack"; +const _MCC = "MaxConcurrentCount"; +const _MCP = "MaxConcurrentPercentage"; +const _ME = "ManagedExecution"; +const _MI = "ModuleInfo"; +const _MR = "MaxResults"; +const _MTIM = "MonitoringTimeInMinutes"; +const _MV = "MajorVersion"; +const _Me = "Metadata"; +const _N = "Name"; +const _NAEE = "NameAlreadyExistsException"; +const _NARN = "NotificationARNs"; +const _NE = "NoEcho"; +const _NGTN = "NewGeneratedTemplateName"; +const _NOR = "NumberOfResources"; +const _NT = "NextToken"; +const _O = "Output"; +const _OE = "OperationEvents"; +const _OEp = "OperationEntry"; +const _OEpe = "OperationEvent"; +const _OF = "OnFailure"; +const _OI = "OperationId"; +const _OIAEE = "OperationIdAlreadyExistsException"; +const _OIPE = "OperationInProgressException"; +const _OK = "OutputKey"; +const _ONFE = "OperationNotFoundException"; +const _OP = "OperationPreferences"; +const _ORF = "OperationResultFilter"; +const _ORFp = "OperationResultFilters"; +const _OS = "OperationStatus"; +const _OSCFE = "OperationStatusCheckFailedException"; +const _OSF = "OnStackFailure"; +const _OT = "OperationType"; +const _OTA = "OriginalTypeArn"; +const _OTN = "OriginalTypeName"; +const _OUI = "OrganizationalUnitIds"; +const _OUIr = "OrganizationalUnitId"; +const _OV = "OutputValue"; +const _Ou = "Outputs"; +const _P = "Parameters"; +const _PA = "PolicyAction"; +const _PC = "PercentageCompleted"; +const _PCSI = "ParentChangeSetId"; +const _PCa = "ParameterConstraints"; +const _PD = "ParameterDeclaration"; +const _PDC = "PreviousDeploymentContext"; +const _PDa = "ParameterDeclarations"; +const _PDr = "PropertyDifference"; +const _PDro = "PropertyDifferences"; +const _PI = "PublisherId"; +const _PIa = "ParentId"; +const _PIu = "PublisherIdentity"; +const _PK = "ParameterKey"; +const _PM = "PermissionModel"; +const _PN = "PublisherName"; +const _PO = "ParameterOverrides"; +const _PP = "PublisherProfile"; +const _PPr = "PropertyPath"; +const _PRI = "PhysicalResourceId"; +const _PRIC = "PhysicalResourceIdContext"; +const _PRICKVP = "PhysicalResourceIdContextKeyValuePair"; +const _PS = "PublisherStatus"; +const _PSr = "ProgressStatus"; +const _PT = "ProvisioningType"; +const _PTA = "PublicTypeArn"; +const _PTI = "PublishTypeInput"; +const _PTO = "PublishTypeOutput"; +const _PTa = "ParameterType"; +const _PTu = "PublishType"; +const _PV = "PreviousValue"; +const _PVN = "PublicVersionNumber"; +const _PVa = "ParameterValue"; +const _Pa = "Parameter"; +const _Pat = "Path"; +const _Pr = "Progress"; +const _Pro = "Properties"; +const _R = "Resources"; +const _RA = "ResourceAction"; +const _RAR = "RefreshAllResources"; +const _RARN = "RoleARN"; +const _RAT = "RequiredActivatedTypes"; +const _RATe = "RequiredActivatedType"; +const _RC = "ResourceChange"; +const _RCD = "ResourceChangeDetail"; +const _RCDe = "ResourceChangeDetails"; +const _RCSI = "RootChangeSetId"; +const _RCT = "RegionConcurrencyType"; +const _RCo = "RollbackConfiguration"; +const _RD = "ResourceDefinition"; +const _RDIA = "ResourceDriftIgnoredAttributes"; +const _RDIAe = "ResourceDriftIgnoredAttribute"; +const _RDS = "ResourceDriftStatus"; +const _RDe = "ResourceDetail"; +const _RDes = "ResourceDefinitions"; +const _RDeso = "ResourceDetails"; +const _REOC = "RetainExceptOnCreate"; +const _RF = "ResourcesFailed"; +const _RHP = "RecordHandlerProgress"; +const _RHPI = "RecordHandlerProgressInput"; +const _RHPO = "RecordHandlerProgressOutput"; +const _RI = "ResourceIdentifier"; +const _RIS = "ResourceIdentifierSummaries"; +const _RISe = "ResourceIdentifierSummary"; +const _RIe = "ResourceIdentifiers"; +const _RIo = "RootId"; +const _RL = "RemediationLink"; +const _RLe = "ResourceLocation"; +const _RM = "RemediationMessage"; +const _RMe = "ResourceMappings"; +const _RMes = "ResourceModel"; +const _RMeso = "ResourceMapping"; +const _RO = "RegionOrder"; +const _RP = "ResourceProperties"; +const _RPI = "RegisterPublisherInput"; +const _RPO = "RegisterPublisherOutput"; +const _RPe = "ResourcesProcessing"; +const _RPeg = "RegisterPublisher"; +const _RPes = "ResourcesPending"; +const _RR = "RetainResources"; +const _RRe = "ResourcesRead"; +const _RRel = "RelatedResources"; +const _RRem = "RemoveResources"; +const _RReq = "RequiresRecreation"; +const _RS = "RetainStacks"; +const _RSF = "RegistrationStatusFilter"; +const _RSI = "ResourceScanId"; +const _RSIPE = "ResourceScanInProgressException"; +const _RSIo = "RollbackStackInput"; +const _RSLEE = "ResourceScanLimitExceededException"; +const _RSNFE = "ResourceScanNotFoundException"; +const _RSO = "RollbackStackOutput"; +const _RSOAR = "RetainStacksOnAccountRemoval"; +const _RSR = "ResourceStatusReason"; +const _RSS = "ResourceScanSummaries"; +const _RSSe = "ResourceScanSummary"; +const _RSe = "ResourcesScanned"; +const _RSes = "ResourceStatus"; +const _RSeso = "ResourcesSucceeded"; +const _RSo = "RollbackStack"; +const _RT = "ResourceType"; +const _RTD = "ResourceTargetDetails"; +const _RTDe = "ResourceTargetDefinition"; +const _RTI = "ResourcesToImport"; +const _RTIe = "RegisterTypeInput"; +const _RTIes = "ResourceToImport"; +const _RTL = "RegistrationTokenList"; +const _RTO = "RegisterTypeOutput"; +const _RTP = "ResourceTypePrefix"; +const _RTS = "ResourcesToSkip"; +const _RTe = "ResourceTypes"; +const _RTeg = "RegistrationToken"; +const _RTegi = "RegisterType"; +const _RTo = "RollbackTriggers"; +const _RTol = "RollbackTrigger"; +const _RV = "ResolvedValue"; +const _Re = "Regions"; +const _Rea = "Reason"; +const _Reg = "Region"; +const _Rep = "Replacement"; +const _Req = "Required"; +const _S = "Status"; +const _SA = "StagesAvailable"; +const _SD = "StackDefinitions"; +const _SDDI = "StackDriftDetectionId"; +const _SDI = "StackDriftInformation"; +const _SDIS = "StackDriftInformationSummary"; +const _SDS = "StackDriftStatus"; +const _SDt = "StackDefinition"; +const _SDta = "StatusDetails"; +const _SE = "StackEvents"; +const _SEt = "StackEvent"; +const _SF = "ScanFilters"; +const _SFc = "ScanFilter"; +const _SHP = "SchemaHandlerPackage"; +const _SI = "StackId"; +const _SIA = "StackInstanceAccount"; +const _SICS = "StackInstanceComprehensiveStatus"; +const _SIF = "StackInstanceFilter"; +const _SIFt = "StackInstanceFilters"; +const _SINFE = "StackInstanceNotFoundException"; +const _SIR = "StackInstanceRegion"; +const _SIRDS = "StackInstanceResourceDriftStatuses"; +const _SIRDSt = "StackInstanceResourceDriftsSummary"; +const _SIRDSta = "StackInstanceResourceDriftsSummaries"; +const _SIS = "StackInstanceStatus"; +const _SISt = "StackInstanceSummary"; +const _SISta = "StackInstanceSummaries"; +const _SIU = "StackIdsUrl"; +const _SIt = "StackInstance"; +const _SIta = "StackIds"; +const _SL = "SeverityLevel"; +const _SM = "StatusMessage"; +const _SMV = "SupportedMajorVersions"; +const _SN = "StackName"; +const _SNFE = "StackNotFoundException"; +const _SPB = "StackPolicyBody"; +const _SPDUB = "StackPolicyDuringUpdateBody"; +const _SPDUURL = "StackPolicyDuringUpdateURL"; +const _SPURL = "StackPolicyURL"; +const _SR = "StatusReason"; +const _SRA = "StackRefactorActions"; +const _SRAt = "StackRefactorAction"; +const _SRD = "StackResourceDrifts"; +const _SRDI = "StackResourceDriftInformation"; +const _SRDIS = "StackResourceDriftInformationSummary"; +const _SRDS = "StackResourceDriftStatus"; +const _SRDSF = "StackResourceDriftStatusFilters"; +const _SRDt = "StackResourceDetail"; +const _SRDta = "StackResourceDrift"; +const _SRE = "StaleRequestException"; +const _SRI = "StackRefactorId"; +const _SRIc = "ScannedResourceIdentifier"; +const _SRIca = "ScannedResourceIdentifiers"; +const _SRIi = "SignalResourceInput"; +const _SRNFE = "StackRefactorNotFoundException"; +const _SRS = "StackRefactorSummaries"; +const _SRSI = "StartResourceScanInput"; +const _SRSO = "StartResourceScanOutput"; +const _SRSt = "StackResourceSummaries"; +const _SRSta = "StackRefactorSummary"; +const _SRStac = "StackResourceSummary"; +const _SRStar = "StartResourceScan"; +const _SRTR = "StackRefactorTagResources"; +const _SRc = "ScannedResource"; +const _SRca = "ScannedResources"; +const _SRi = "SignalResource"; +const _SRt = "StackResources"; +const _SRta = "StackResource"; +const _SS = "StackSet"; +const _SSADTS = "StackSetAutoDeploymentTargetSummary"; +const _SSADTSt = "StackSetAutoDeploymentTargetSummaries"; +const _SSARN = "StackSetARN"; +const _SSDDD = "StackSetDriftDetectionDetails"; +const _SSF = "StackStatusFilter"; +const _SSI = "StackSetId"; +const _SSN = "StackSetName"; +const _SSNEE = "StackSetNotEmptyException"; +const _SSNFE = "StackSetNotFoundException"; +const _SSO = "StackSetOperation"; +const _SSOP = "StackSetOperationPreferences"; +const _SSORS = "StackSetOperationResultSummary"; +const _SSORSt = "StackSetOperationResultSummaries"; +const _SSOS = "StackSetOperationSummary"; +const _SSOSD = "StackSetOperationStatusDetails"; +const _SSOSt = "StackSetOperationSummaries"; +const _SSP = "SetStackPolicy"; +const _SSPI = "SetStackPolicyInput"; +const _SSR = "StackStatusReason"; +const _SSS = "StackSetSummary"; +const _SSSO = "StopStackSetOperation"; +const _SSSOI = "StopStackSetOperationInput"; +const _SSSOO = "StopStackSetOperationOutput"; +const _SSSt = "StackSetSummaries"; +const _SSt = "StackSummaries"; +const _SSta = "StackStatus"; +const _SStac = "StackSummary"; +const _ST = "StartTime"; +const _STC = "SetTypeConfiguration"; +const _STCI = "SetTypeConfigurationInput"; +const _STCO = "SetTypeConfigurationOutput"; +const _STDV = "SetTypeDefaultVersion"; +const _STDVI = "SetTypeDefaultVersionInput"; +const _STDVO = "SetTypeDefaultVersionOutput"; +const _STF = "ScanTypeFilter"; +const _STc = "ScanType"; +const _SU = "SourceUrl"; +const _Sc = "Schema"; +const _Sco = "Scope"; +const _So = "Source"; +const _St = "Stacks"; +const _Sta = "Stack"; +const _Su = "Summaries"; +const _T = "Type"; +const _TA = "TypeArn"; +const _TAEE = "TokenAlreadyExistsException"; +const _TB = "TemplateBody"; +const _TC = "TypeConfigurations"; +const _TCA = "TypeConfigurationAlias"; +const _TCAy = "TypeConfigurationArn"; +const _TCD = "TypeConfigurationDetails"; +const _TCDL = "TypeConfigurationDetailsList"; +const _TCI = "TypeConfigurationIdentifier"; +const _TCIy = "TypeConfigurationIdentifiers"; +const _TCNFE = "TypeConfigurationNotFoundException"; +const _TCVI = "TypeConfigurationVersionId"; +const _TCe = "TemplateConfiguration"; +const _TCi = "TimeCreated"; +const _TD = "TargetDetails"; +const _TDe = "TemplateDescription"; +const _TF = "TypeFilters"; +const _TH = "TypeHierarchy"; +const _TI = "TargetId"; +const _TIM = "TimeoutInMinutes"; +const _TK = "TagKey"; +const _TN = "TypeName"; +const _TNA = "TypeNameAlias"; +const _TNFE = "TypeNotFoundException"; +const _TNP = "TypeNamePrefix"; +const _TP = "TemplateParameter"; +const _TPe = "TemplateProgress"; +const _TPem = "TemplateParameters"; +const _TR = "TagResources"; +const _TS = "TemplateStage"; +const _TSC = "TemplateSummaryConfig"; +const _TSIC = "TotalStackInstancesCount"; +const _TSe = "TemplateSummary"; +const _TSem = "TemplateSummaries"; +const _TSy = "TypeSummaries"; +const _TSyp = "TypeSummary"; +const _TT = "TargetType"; +const _TTI = "TestTypeInput"; +const _TTN = "TargetTypeName"; +const _TTO = "TestTypeOutput"; +const _TTS = "TypeTestsStatus"; +const _TTSD = "TypeTestsStatusDescription"; +const _TTe = "TestType"; +const _TURL = "TemplateURL"; +const _TURTAW = "TreatUnrecognizedResourceTypesAsWarnings"; +const _TV = "TagValue"; +const _TVA = "TypeVersionArn"; +const _TVI = "TypeVersionId"; +const _TVS = "TypeVersionSummaries"; +const _TVSy = "TypeVersionSummary"; +const _TW = "TotalWarnings"; +const _Ta = "Tags"; +const _Tag = "Tag"; +const _Tar = "Target"; +const _Ti = "Timestamp"; +const _Ty = "Types"; +const _U = "Url"; +const _UGT = "UpdateGeneratedTemplate"; +const _UGTI = "UpdateGeneratedTemplateInput"; +const _UGTO = "UpdateGeneratedTemplateOutput"; +const _UI = "UniqueId"; +const _UPT = "UsePreviousTemplate"; +const _UPV = "UsePreviousValue"; +const _UR = "UntagResources"; +const _URP = "UpdateReplacePolicy"; +const _URT = "UnrecognizedResourceTypes"; +const _US = "UpdateStack"; +const _USI = "UpdateStackInput"; +const _USII = "UpdateStackInstancesInput"; +const _USIO = "UpdateStackInstancesOutput"; +const _USIp = "UpdateStackInstances"; +const _USO = "UpdateStackOutput"; +const _USS = "UpdateStackSet"; +const _USSI = "UpdateStackSetInput"; +const _USSO = "UpdateStackSetOutput"; +const _UTC = "UnprocessedTypeConfigurations"; +const _UTP = "UpdateTerminationProtection"; +const _UTPI = "UpdateTerminationProtectionInput"; +const _UTPO = "UpdateTerminationProtectionOutput"; +const _V = "Value"; +const _VB = "VersionBump"; +const _VFM = "ValidationFailureMode"; +const _VI = "VersionId"; +const _VN = "ValidationName"; +const _VP = "ValidationPath"; +const _VS = "ValidationStatus"; +const _VSR = "ValidationStatusReason"; +const _VT = "ValidateTemplate"; +const _VTI = "ValidateTemplateInput"; +const _VTO = "ValidateTemplateOutput"; +const _Va = "Values"; +const _Ve = "Version"; +const _Vi = "Visibility"; +const _W = "Warnings"; +const _WD = "WarningDetail"; +const _WDa = "WarningDetails"; +const _WP = "WarningProperty"; +const _WPa = "WarningProperties"; +const _aQE = "awsQueryError"; +const _c = "client"; +const _e = "error"; +const _hE = "httpError"; +const _s = "smithy.ts.sdk.synthetic.com.amazonaws.cloudformation"; +const n0 = "com.amazonaws.cloudformation"; +const schema_1 = __nccwpck_require__(6890); +const CloudFormationServiceException_1 = __nccwpck_require__(22); +const errors_1 = __nccwpck_require__(4689); +const _s_registry = schema_1.TypeRegistry.for(_s); +exports.CloudFormationServiceException$ = [-3, _s, "CloudFormationServiceException", 0, [], []]; +_s_registry.registerError(exports.CloudFormationServiceException$, CloudFormationServiceException_1.CloudFormationServiceException); +const n0_registry = schema_1.TypeRegistry.for(n0); +exports.AlreadyExistsException$ = [-3, n0, _AEE, + { [_aQE]: [`AlreadyExistsException`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.AlreadyExistsException$, errors_1.AlreadyExistsException); +exports.CFNRegistryException$ = [-3, n0, _CFNRE, + { [_aQE]: [`CFNRegistryException`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.CFNRegistryException$, errors_1.CFNRegistryException); +exports.ChangeSetNotFoundException$ = [-3, n0, _CSNFE, + { [_aQE]: [`ChangeSetNotFound`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.ChangeSetNotFoundException$, errors_1.ChangeSetNotFoundException); +exports.ConcurrentResourcesLimitExceededException$ = [-3, n0, _CRLEE, + { [_aQE]: [`ConcurrentResourcesLimitExceeded`, 429], [_e]: _c, [_hE]: 429 }, + [_M], + [0] +]; +n0_registry.registerError(exports.ConcurrentResourcesLimitExceededException$, errors_1.ConcurrentResourcesLimitExceededException); +exports.CreatedButModifiedException$ = [-3, n0, _CBME, + { [_aQE]: [`CreatedButModifiedException`, 409], [_e]: _c, [_hE]: 409 }, + [_M], + [0] +]; +n0_registry.registerError(exports.CreatedButModifiedException$, errors_1.CreatedButModifiedException); +exports.GeneratedTemplateNotFoundException$ = [-3, n0, _GTNFE, + { [_aQE]: [`GeneratedTemplateNotFound`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.GeneratedTemplateNotFoundException$, errors_1.GeneratedTemplateNotFoundException); +exports.HookResultNotFoundException$ = [-3, n0, _HRNFE, + { [_aQE]: [`HookResultNotFound`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.HookResultNotFoundException$, errors_1.HookResultNotFoundException); +exports.InsufficientCapabilitiesException$ = [-3, n0, _ICE, + { [_aQE]: [`InsufficientCapabilitiesException`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.InsufficientCapabilitiesException$, errors_1.InsufficientCapabilitiesException); +exports.InvalidChangeSetStatusException$ = [-3, n0, _ICSSE, + { [_aQE]: [`InvalidChangeSetStatus`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.InvalidChangeSetStatusException$, errors_1.InvalidChangeSetStatusException); +exports.InvalidOperationException$ = [-3, n0, _IOE, + { [_aQE]: [`InvalidOperationException`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.InvalidOperationException$, errors_1.InvalidOperationException); +exports.InvalidStateTransitionException$ = [-3, n0, _ISTE, + { [_aQE]: [`InvalidStateTransition`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.InvalidStateTransitionException$, errors_1.InvalidStateTransitionException); +exports.LimitExceededException$ = [-3, n0, _LEE, + { [_aQE]: [`LimitExceededException`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.LimitExceededException$, errors_1.LimitExceededException); +exports.NameAlreadyExistsException$ = [-3, n0, _NAEE, + { [_aQE]: [`NameAlreadyExistsException`, 409], [_e]: _c, [_hE]: 409 }, + [_M], + [0] +]; +n0_registry.registerError(exports.NameAlreadyExistsException$, errors_1.NameAlreadyExistsException); +exports.OperationIdAlreadyExistsException$ = [-3, n0, _OIAEE, + { [_aQE]: [`OperationIdAlreadyExistsException`, 409], [_e]: _c, [_hE]: 409 }, + [_M], + [0] +]; +n0_registry.registerError(exports.OperationIdAlreadyExistsException$, errors_1.OperationIdAlreadyExistsException); +exports.OperationInProgressException$ = [-3, n0, _OIPE, + { [_aQE]: [`OperationInProgressException`, 409], [_e]: _c, [_hE]: 409 }, + [_M], + [0] +]; +n0_registry.registerError(exports.OperationInProgressException$, errors_1.OperationInProgressException); +exports.OperationNotFoundException$ = [-3, n0, _ONFE, + { [_aQE]: [`OperationNotFoundException`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.OperationNotFoundException$, errors_1.OperationNotFoundException); +exports.OperationStatusCheckFailedException$ = [-3, n0, _OSCFE, + { [_aQE]: [`ConditionalCheckFailed`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.OperationStatusCheckFailedException$, errors_1.OperationStatusCheckFailedException); +exports.ResourceScanInProgressException$ = [-3, n0, _RSIPE, + { [_aQE]: [`ResourceScanInProgress`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.ResourceScanInProgressException$, errors_1.ResourceScanInProgressException); +exports.ResourceScanLimitExceededException$ = [-3, n0, _RSLEE, + { [_aQE]: [`ResourceScanLimitExceeded`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.ResourceScanLimitExceededException$, errors_1.ResourceScanLimitExceededException); +exports.ResourceScanNotFoundException$ = [-3, n0, _RSNFE, + { [_aQE]: [`ResourceScanNotFound`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.ResourceScanNotFoundException$, errors_1.ResourceScanNotFoundException); +exports.StackInstanceNotFoundException$ = [-3, n0, _SINFE, + { [_aQE]: [`StackInstanceNotFoundException`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.StackInstanceNotFoundException$, errors_1.StackInstanceNotFoundException); +exports.StackNotFoundException$ = [-3, n0, _SNFE, + { [_aQE]: [`StackNotFoundException`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.StackNotFoundException$, errors_1.StackNotFoundException); +exports.StackRefactorNotFoundException$ = [-3, n0, _SRNFE, + { [_aQE]: [`StackRefactorNotFoundException`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.StackRefactorNotFoundException$, errors_1.StackRefactorNotFoundException); +exports.StackSetNotEmptyException$ = [-3, n0, _SSNEE, + { [_aQE]: [`StackSetNotEmptyException`, 409], [_e]: _c, [_hE]: 409 }, + [_M], + [0] +]; +n0_registry.registerError(exports.StackSetNotEmptyException$, errors_1.StackSetNotEmptyException); +exports.StackSetNotFoundException$ = [-3, n0, _SSNFE, + { [_aQE]: [`StackSetNotFoundException`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.StackSetNotFoundException$, errors_1.StackSetNotFoundException); +exports.StaleRequestException$ = [-3, n0, _SRE, + { [_aQE]: [`StaleRequestException`, 409], [_e]: _c, [_hE]: 409 }, + [_M], + [0] +]; +n0_registry.registerError(exports.StaleRequestException$, errors_1.StaleRequestException); +exports.TokenAlreadyExistsException$ = [-3, n0, _TAEE, + { [_aQE]: [`TokenAlreadyExistsException`, 400], [_e]: _c, [_hE]: 400 }, + [_M], + [0] +]; +n0_registry.registerError(exports.TokenAlreadyExistsException$, errors_1.TokenAlreadyExistsException); +exports.TypeConfigurationNotFoundException$ = [-3, n0, _TCNFE, + { [_aQE]: [`TypeConfigurationNotFoundException`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.TypeConfigurationNotFoundException$, errors_1.TypeConfigurationNotFoundException); +exports.TypeNotFoundException$ = [-3, n0, _TNFE, + { [_aQE]: [`TypeNotFoundException`, 404], [_e]: _c, [_hE]: 404 }, + [_M], + [0] +]; +n0_registry.registerError(exports.TypeNotFoundException$, errors_1.TypeNotFoundException); +exports.errorTypeRegistries = [ + _s_registry, + n0_registry, +]; +exports.AccountGateResult$ = [3, n0, _AGR, + 0, + [_S, _SR], + [0, 0] +]; +exports.AccountLimit$ = [3, n0, _AL, + 0, + [_N, _V], + [0, 1] +]; +exports.ActivateOrganizationsAccessInput$ = [3, n0, _AOAI, + 0, + [], + [] +]; +exports.ActivateOrganizationsAccessOutput$ = [3, n0, _AOAO, + 0, + [], + [] +]; +exports.ActivateTypeInput$ = [3, n0, _ATI, + 0, + [_T, _PTA, _PI, _TN, _TNA, _AU, _LC, _ERA, _VB, _MV], + [0, 0, 0, 0, 0, 2, () => exports.LoggingConfig$, 0, 0, 1] +]; +exports.ActivateTypeOutput$ = [3, n0, _ATO, + 0, + [_A], + [0] +]; +exports.Annotation$ = [3, n0, _An, + 0, + [_AN, _S, _SM, _RM, _RL, _SL], + [0, 0, 0, 0, 0, 0] +]; +exports.AutoDeployment$ = [3, n0, _AD, + 0, + [_E, _RSOAR, _DO], + [2, 2, 64 | 0] +]; +exports.BatchDescribeTypeConfigurationsError$ = [3, n0, _BDTCE, + 0, + [_EC, _EM, _TCI], + [0, 0, () => exports.TypeConfigurationIdentifier$] +]; +exports.BatchDescribeTypeConfigurationsInput$ = [3, n0, _BDTCI, + 0, + [_TCIy], + [() => TypeConfigurationIdentifiers], 1 +]; +exports.BatchDescribeTypeConfigurationsOutput$ = [3, n0, _BDTCO, + 0, + [_Er, _UTC, _TC], + [() => BatchDescribeTypeConfigurationsErrors, () => UnprocessedTypeConfigurations, () => TypeConfigurationDetailsList] +]; +exports.CancelUpdateStackInput$ = [3, n0, _CUSI, + 0, + [_SN, _CRT], + [0, 0], 1 +]; +exports.Change$ = [3, n0, _C, + 0, + [_T, _HIC, _RC], + [0, 1, () => exports.ResourceChange$] +]; +exports.ChangeSetHook$ = [3, n0, _CSH, + 0, + [_IP, _FM, _TN, _TVI, _TCVI, _TD], + [0, 0, 0, 0, 0, () => exports.ChangeSetHookTargetDetails$] +]; +exports.ChangeSetHookResourceTargetDetails$ = [3, n0, _CSHRTD, + 0, + [_LRI, _RT, _RA], + [0, 0, 0] +]; +exports.ChangeSetHookTargetDetails$ = [3, n0, _CSHTD, + 0, + [_TT, _RTD], + [0, () => exports.ChangeSetHookResourceTargetDetails$] +]; +exports.ChangeSetSummary$ = [3, n0, _CSS, + 0, + [_SI, _SN, _CSI, _CSN, _ES, _S, _SR, _CT, _D, _INS, _PCSI, _RCSI, _IER], + [0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 2] +]; +exports.ContinueUpdateRollbackInput$ = [3, n0, _CURI, + 0, + [_SN, _RARN, _RTS, _CRT], + [0, 0, 64 | 0, 0], 1 +]; +exports.ContinueUpdateRollbackOutput$ = [3, n0, _CURO, + 0, + [], + [] +]; +exports.CreateChangeSetInput$ = [3, n0, _CCSI, + 0, + [_SN, _CSN, _TB, _TURL, _UPT, _P, _Ca, _RTe, _RARN, _RCo, _NARN, _Ta, _CTl, _D, _CST, _RTI, _INS, _OSF, _IER, _DM], + [0, 0, 0, 0, 2, () => _Parameters, 64 | 0, 64 | 0, 0, () => exports.RollbackConfiguration$, 64 | 0, () => Tags, 0, 0, 0, () => ResourcesToImport, 2, 0, 2, 0], 2 +]; +exports.CreateChangeSetOutput$ = [3, n0, _CCSO, + 0, + [_I, _SI], + [0, 0] +]; +exports.CreateGeneratedTemplateInput$ = [3, n0, _CGTI, + 0, + [_GTN, _R, _SN, _TCe], + [0, () => ResourceDefinitions, 0, () => exports.TemplateConfiguration$], 1 +]; +exports.CreateGeneratedTemplateOutput$ = [3, n0, _CGTO, + 0, + [_GTI], + [0] +]; +exports.CreateStackInput$ = [3, n0, _CSIr, + 0, + [_SN, _TB, _TURL, _P, _DR, _RCo, _TIM, _NARN, _Ca, _RTe, _RARN, _OF, _SPB, _SPURL, _Ta, _CRT, _ETP, _REOC], + [0, 0, 0, () => _Parameters, 2, () => exports.RollbackConfiguration$, 1, 64 | 0, 64 | 0, 64 | 0, 0, 0, 0, 0, () => Tags, 0, 2, 2], 1 +]; +exports.CreateStackInstancesInput$ = [3, n0, _CSII, + 0, + [_SSN, _Re, _Ac, _DT, _PO, _OP, _OI, _CA], + [0, 64 | 0, 64 | 0, () => exports.DeploymentTargets$, () => _Parameters, () => exports.StackSetOperationPreferences$, [0, 4], 0], 2 +]; +exports.CreateStackInstancesOutput$ = [3, n0, _CSIO, + 0, + [_OI], + [0] +]; +exports.CreateStackOutput$ = [3, n0, _CSO, + 0, + [_SI, _OI], + [0, 0] +]; +exports.CreateStackRefactorInput$ = [3, n0, _CSRI, + 0, + [_SD, _D, _ESC, _RMe], + [() => StackDefinitions, 0, 2, () => ResourceMappings], 1 +]; +exports.CreateStackRefactorOutput$ = [3, n0, _CSRO, + 0, + [_SRI], + [0], 1 +]; +exports.CreateStackSetInput$ = [3, n0, _CSSI, + 0, + [_SSN, _D, _TB, _TURL, _SI, _P, _Ca, _Ta, _ARARN, _ERN, _PM, _AD, _CA, _CRT, _ME], + [0, 0, 0, 0, 0, () => _Parameters, 64 | 0, () => Tags, 0, 0, 0, () => exports.AutoDeployment$, 0, [0, 4], () => exports.ManagedExecution$], 1 +]; +exports.CreateStackSetOutput$ = [3, n0, _CSSO, + 0, + [_SSI], + [0] +]; +exports.DeactivateOrganizationsAccessInput$ = [3, n0, _DOAI, + 0, + [], + [] +]; +exports.DeactivateOrganizationsAccessOutput$ = [3, n0, _DOAO, + 0, + [], + [] +]; +exports.DeactivateTypeInput$ = [3, n0, _DTI, + 0, + [_TN, _T, _A], + [0, 0, 0] +]; +exports.DeactivateTypeOutput$ = [3, n0, _DTO, + 0, + [], + [] +]; +exports.DeleteChangeSetInput$ = [3, n0, _DCSI, + 0, + [_CSN, _SN], + [0, 0], 1 +]; +exports.DeleteChangeSetOutput$ = [3, n0, _DCSO, + 0, + [], + [] +]; +exports.DeleteGeneratedTemplateInput$ = [3, n0, _DGTI, + 0, + [_GTN], + [0], 1 +]; +exports.DeleteStackInput$ = [3, n0, _DSI, + 0, + [_SN, _RR, _RARN, _CRT, _DMe], + [0, 64 | 0, 0, 0, 0], 1 +]; +exports.DeleteStackInstancesInput$ = [3, n0, _DSII, + 0, + [_SSN, _Re, _RS, _Ac, _DT, _OP, _OI, _CA], + [0, 64 | 0, 2, 64 | 0, () => exports.DeploymentTargets$, () => exports.StackSetOperationPreferences$, [0, 4], 0], 3 +]; +exports.DeleteStackInstancesOutput$ = [3, n0, _DSIO, + 0, + [_OI], + [0] +]; +exports.DeleteStackSetInput$ = [3, n0, _DSSI, + 0, + [_SSN, _CA], + [0, 0], 1 +]; +exports.DeleteStackSetOutput$ = [3, n0, _DSSO, + 0, + [], + [] +]; +exports.DeploymentTargets$ = [3, n0, _DT, + 0, + [_Ac, _AUc, _OUI, _AFT], + [64 | 0, 0, 64 | 0, 0] +]; +exports.DeregisterTypeInput$ = [3, n0, _DTIe, + 0, + [_A, _T, _TN, _VI], + [0, 0, 0, 0] +]; +exports.DeregisterTypeOutput$ = [3, n0, _DTOe, + 0, + [], + [] +]; +exports.DescribeAccountLimitsInput$ = [3, n0, _DALI, + 0, + [_NT], + [0] +]; +exports.DescribeAccountLimitsOutput$ = [3, n0, _DALO, + 0, + [_ALc, _NT], + [() => AccountLimitList, 0] +]; +exports.DescribeChangeSetHooksInput$ = [3, n0, _DCSHI, + 0, + [_CSN, _SN, _NT, _LRI], + [0, 0, 0, 0], 1 +]; +exports.DescribeChangeSetHooksOutput$ = [3, n0, _DCSHO, + 0, + [_CSI, _CSN, _H, _S, _NT, _SI, _SN], + [0, 0, () => ChangeSetHooks, 0, 0, 0, 0] +]; +exports.DescribeChangeSetInput$ = [3, n0, _DCSIe, + 0, + [_CSN, _SN, _NT, _IPV], + [0, 0, 0, 2], 1 +]; +exports.DescribeChangeSetOutput$ = [3, n0, _DCSOe, + 0, + [_CSN, _CSI, _SI, _SN, _D, _P, _CT, _ES, _S, _SR, _SDS, _NARN, _RCo, _Ca, _Ta, _Ch, _NT, _INS, _PCSI, _RCSI, _OSF, _IER, _DM], + [0, 0, 0, 0, 0, () => _Parameters, 4, 0, 0, 0, 0, 64 | 0, () => exports.RollbackConfiguration$, 64 | 0, () => Tags, () => Changes, 0, 2, 0, 0, 0, 2, 0] +]; +exports.DescribeEventsInput$ = [3, n0, _DEI, + 0, + [_SN, _CSN, _OI, _F, _NT], + [0, 0, 0, () => exports.EventFilter$, 0] +]; +exports.DescribeEventsOutput$ = [3, n0, _DEO, + 0, + [_OE, _NT], + [() => OperationEvents, 0] +]; +exports.DescribeGeneratedTemplateInput$ = [3, n0, _DGTIe, + 0, + [_GTN], + [0], 1 +]; +exports.DescribeGeneratedTemplateOutput$ = [3, n0, _DGTO, + 0, + [_GTI, _GTN, _R, _S, _SR, _CT, _LUT, _Pr, _SI, _TCe, _TW], + [0, 0, () => ResourceDetails, 0, 0, 4, 4, () => exports.TemplateProgress$, 0, () => exports.TemplateConfiguration$, 1] +]; +exports.DescribeOrganizationsAccessInput$ = [3, n0, _DOAIe, + 0, + [_CA], + [0] +]; +exports.DescribeOrganizationsAccessOutput$ = [3, n0, _DOAOe, + 0, + [_S], + [0] +]; +exports.DescribePublisherInput$ = [3, n0, _DPI, + 0, + [_PI], + [0] +]; +exports.DescribePublisherOutput$ = [3, n0, _DPO, + 0, + [_PI, _PS, _IPd, _PP], + [0, 0, 0, 0] +]; +exports.DescribeResourceScanInput$ = [3, n0, _DRSI, + 0, + [_RSI], + [0], 1 +]; +exports.DescribeResourceScanOutput$ = [3, n0, _DRSO, + 0, + [_RSI, _S, _SR, _ST, _ET, _PC, _RTe, _RSe, _RRe, _SF], + [0, 0, 0, 4, 4, 1, 64 | 0, 1, 1, () => ScanFilters] +]; +exports.DescribeStackDriftDetectionStatusInput$ = [3, n0, _DSDDSI, + 0, + [_SDDI], + [0], 1 +]; +exports.DescribeStackDriftDetectionStatusOutput$ = [3, n0, _DSDDSO, + 0, + [_SI, _SDDI, _DS, _Ti, _SDS, _DSR, _DSRC], + [0, 0, 0, 4, 0, 0, 1], 4 +]; +exports.DescribeStackEventsInput$ = [3, n0, _DSEI, + 0, + [_SN, _NT], + [0, 0], 1 +]; +exports.DescribeStackEventsOutput$ = [3, n0, _DSEO, + 0, + [_SE, _NT], + [() => StackEvents, 0] +]; +exports.DescribeStackInstanceInput$ = [3, n0, _DSIIe, + 0, + [_SSN, _SIA, _SIR, _CA], + [0, 0, 0, 0], 3 +]; +exports.DescribeStackInstanceOutput$ = [3, n0, _DSIOe, + 0, + [_SIt], + [() => exports.StackInstance$] +]; +exports.DescribeStackRefactorInput$ = [3, n0, _DSRI, + 0, + [_SRI], + [0], 1 +]; +exports.DescribeStackRefactorOutput$ = [3, n0, _DSRO, + 0, + [_D, _SRI, _SIta, _ES, _ESR, _S, _SR], + [0, 0, 64 | 0, 0, 0, 0, 0] +]; +exports.DescribeStackResourceDriftsInput$ = [3, n0, _DSRDI, + 0, + [_SN, _SRDSF, _NT, _MR], + [0, 64 | 0, 0, 1], 1 +]; +exports.DescribeStackResourceDriftsOutput$ = [3, n0, _DSRDO, + 0, + [_SRD, _NT], + [() => StackResourceDrifts, 0], 1 +]; +exports.DescribeStackResourceInput$ = [3, n0, _DSRIe, + 0, + [_SN, _LRI], + [0, 0], 2 +]; +exports.DescribeStackResourceOutput$ = [3, n0, _DSROe, + 0, + [_SRDt], + [() => exports.StackResourceDetail$] +]; +exports.DescribeStackResourcesInput$ = [3, n0, _DSRIes, + 0, + [_SN, _LRI, _PRI], + [0, 0, 0] +]; +exports.DescribeStackResourcesOutput$ = [3, n0, _DSROes, + 0, + [_SRt], + [() => StackResources] +]; +exports.DescribeStackSetInput$ = [3, n0, _DSSIe, + 0, + [_SSN, _CA], + [0, 0], 1 +]; +exports.DescribeStackSetOperationInput$ = [3, n0, _DSSOI, + 0, + [_SSN, _OI, _CA], + [0, 0, 0], 2 +]; +exports.DescribeStackSetOperationOutput$ = [3, n0, _DSSOO, + 0, + [_SSO], + [() => exports.StackSetOperation$] +]; +exports.DescribeStackSetOutput$ = [3, n0, _DSSOe, + 0, + [_SS], + [() => exports.StackSet$] +]; +exports.DescribeStacksInput$ = [3, n0, _DSIe, + 0, + [_SN, _NT], + [0, 0] +]; +exports.DescribeStacksOutput$ = [3, n0, _DSO, + 0, + [_St, _NT], + [() => Stacks, 0] +]; +exports.DescribeTypeInput$ = [3, n0, _DTIes, + 0, + [_T, _TN, _A, _VI, _PI, _PVN], + [0, 0, 0, 0, 0, 0] +]; +exports.DescribeTypeOutput$ = [3, n0, _DTOes, + 0, + [_A, _T, _TN, _DVI, _IDV, _TTS, _TTSD, _D, _Sc, _PT, _DSe, _LC, _RAT, _ERA, _Vi, _SU, _DU, _LU, _TCi, _CS, _PI, _OTN, _OTA, _PVN, _LPV, _IA, _AU], + [0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, () => exports.LoggingConfig$, () => RequiredActivatedTypes, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 2, 2] +]; +exports.DescribeTypeRegistrationInput$ = [3, n0, _DTRI, + 0, + [_RTeg], + [0], 1 +]; +exports.DescribeTypeRegistrationOutput$ = [3, n0, _DTRO, + 0, + [_PSr, _D, _TA, _TVA], + [0, 0, 0, 0] +]; +exports.DetectStackDriftInput$ = [3, n0, _DSDI, + 0, + [_SN, _LRIo], + [0, 64 | 0], 1 +]; +exports.DetectStackDriftOutput$ = [3, n0, _DSDO, + 0, + [_SDDI], + [0], 1 +]; +exports.DetectStackResourceDriftInput$ = [3, n0, _DSRDIe, + 0, + [_SN, _LRI], + [0, 0], 2 +]; +exports.DetectStackResourceDriftOutput$ = [3, n0, _DSRDOe, + 0, + [_SRDta], + [() => exports.StackResourceDrift$], 1 +]; +exports.DetectStackSetDriftInput$ = [3, n0, _DSSDI, + 0, + [_SSN, _OP, _OI, _CA], + [0, () => exports.StackSetOperationPreferences$, [0, 4], 0], 1 +]; +exports.DetectStackSetDriftOutput$ = [3, n0, _DSSDO, + 0, + [_OI], + [0] +]; +exports.EstimateTemplateCostInput$ = [3, n0, _ETCI, + 0, + [_TB, _TURL, _P], + [0, 0, () => _Parameters] +]; +exports.EstimateTemplateCostOutput$ = [3, n0, _ETCO, + 0, + [_U], + [0] +]; +exports.EventFilter$ = [3, n0, _EF, + 0, + [_FE], + [2] +]; +exports.ExecuteChangeSetInput$ = [3, n0, _ECSI, + 0, + [_CSN, _SN, _CRT, _DR, _REOC], + [0, 0, 0, 2, 2], 1 +]; +exports.ExecuteChangeSetOutput$ = [3, n0, _ECSO, + 0, + [], + [] +]; +exports.ExecuteStackRefactorInput$ = [3, n0, _ESRI, + 0, + [_SRI], + [0], 1 +]; +exports.Export$ = [3, n0, _Ex, + 0, + [_ESI, _N, _V], + [0, 0, 0] +]; +exports.GetGeneratedTemplateInput$ = [3, n0, _GGTI, + 0, + [_GTN, _Fo], + [0, 0], 1 +]; +exports.GetGeneratedTemplateOutput$ = [3, n0, _GGTO, + 0, + [_S, _TB], + [0, 0] +]; +exports.GetHookResultInput$ = [3, n0, _GHRI, + 0, + [_HRI], + [0] +]; +exports.GetHookResultOutput$ = [3, n0, _GHRO, + 0, + [_HRI, _IP, _FM, _TN, _OTN, _TVI, _TCVI, _TA, _S, _HSR, _IAn, _Tar, _Ann], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, () => exports.HookTarget$, () => AnnotationList] +]; +exports.GetStackPolicyInput$ = [3, n0, _GSPI, + 0, + [_SN], + [0], 1 +]; +exports.GetStackPolicyOutput$ = [3, n0, _GSPO, + 0, + [_SPB], + [0] +]; +exports.GetTemplateInput$ = [3, n0, _GTIe, + 0, + [_SN, _CSN, _TS], + [0, 0, 0] +]; +exports.GetTemplateOutput$ = [3, n0, _GTO, + 0, + [_TB, _SA], + [0, 64 | 0] +]; +exports.GetTemplateSummaryInput$ = [3, n0, _GTSI, + 0, + [_TB, _TURL, _SN, _SSN, _CA, _TSC], + [0, 0, 0, 0, 0, () => exports.TemplateSummaryConfig$] +]; +exports.GetTemplateSummaryOutput$ = [3, n0, _GTSO, + 0, + [_P, _D, _Ca, _CR, _RTe, _Ve, _Me, _DTe, _RIS, _W], + [() => ParameterDeclarations, 0, 64 | 0, 0, 64 | 0, 0, 0, 64 | 0, () => ResourceIdentifierSummaries, () => exports.Warnings$] +]; +exports.HookResultSummary$ = [3, n0, _HRS, + 0, + [_HRI, _IP, _FM, _TN, _TVI, _TCVI, _S, _HSR, _IAn, _TT, _TI, _TA, _HET], + [0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0] +]; +exports.HookTarget$ = [3, n0, _HT, + 0, + [_TT, _TTN, _TI, _Act], + [0, 0, 0, 0], 4 +]; +exports.ImportStacksToStackSetInput$ = [3, n0, _ISTSSI, + 0, + [_SSN, _SIta, _SIU, _OUI, _OP, _OI, _CA], + [0, 64 | 0, 0, 64 | 0, () => exports.StackSetOperationPreferences$, [0, 4], 0], 1 +]; +exports.ImportStacksToStackSetOutput$ = [3, n0, _ISTSSO, + 0, + [_OI], + [0] +]; +exports.ListChangeSetsInput$ = [3, n0, _LCSI, + 0, + [_SN, _NT], + [0, 0], 1 +]; +exports.ListChangeSetsOutput$ = [3, n0, _LCSO, + 0, + [_Su, _NT], + [() => ChangeSetSummaries, 0] +]; +exports.ListExportsInput$ = [3, n0, _LEI, + 0, + [_NT], + [0] +]; +exports.ListExportsOutput$ = [3, n0, _LEO, + 0, + [_Exp, _NT], + [() => Exports, 0] +]; +exports.ListGeneratedTemplatesInput$ = [3, n0, _LGTI, + 0, + [_NT, _MR], + [0, 1] +]; +exports.ListGeneratedTemplatesOutput$ = [3, n0, _LGTO, + 0, + [_Su, _NT], + [() => TemplateSummaries, 0] +]; +exports.ListHookResultsInput$ = [3, n0, _LHRI, + 0, + [_TT, _TI, _TA, _S, _NT], + [0, 0, 0, 0, 0] +]; +exports.ListHookResultsOutput$ = [3, n0, _LHRO, + 0, + [_TT, _TI, _HR, _NT], + [0, 0, () => HookResultSummaries, 0] +]; +exports.ListImportsInput$ = [3, n0, _LII, + 0, + [_EN, _NT], + [0, 0], 1 +]; +exports.ListImportsOutput$ = [3, n0, _LIO, + 0, + [_Im, _NT], + [64 | 0, 0] +]; +exports.ListResourceScanRelatedResourcesInput$ = [3, n0, _LRSRRI, + 0, + [_RSI, _R, _NT, _MR], + [0, () => ScannedResourceIdentifiers, 0, 1], 2 +]; +exports.ListResourceScanRelatedResourcesOutput$ = [3, n0, _LRSRRO, + 0, + [_RRel, _NT], + [() => RelatedResources, 0] +]; +exports.ListResourceScanResourcesInput$ = [3, n0, _LRSRI, + 0, + [_RSI, _RI, _RTP, _TK, _TV, _NT, _MR], + [0, 0, 0, 0, 0, 0, 1], 1 +]; +exports.ListResourceScanResourcesOutput$ = [3, n0, _LRSRO, + 0, + [_R, _NT], + [() => ScannedResources, 0] +]; +exports.ListResourceScansInput$ = [3, n0, _LRSI, + 0, + [_NT, _MR, _STF], + [0, 1, 0] +]; +exports.ListResourceScansOutput$ = [3, n0, _LRSO, + 0, + [_RSS, _NT], + [() => ResourceScanSummaries, 0] +]; +exports.ListStackInstanceResourceDriftsInput$ = [3, n0, _LSIRDI, + 0, + [_SSN, _SIA, _SIR, _OI, _NT, _MR, _SIRDS, _CA], + [0, 0, 0, 0, 0, 1, 64 | 0, 0], 4 +]; +exports.ListStackInstanceResourceDriftsOutput$ = [3, n0, _LSIRDO, + 0, + [_Su, _NT], + [() => StackInstanceResourceDriftsSummaries, 0] +]; +exports.ListStackInstancesInput$ = [3, n0, _LSII, + 0, + [_SSN, _NT, _MR, _F, _SIA, _SIR, _CA], + [0, 0, 1, () => StackInstanceFilters, 0, 0, 0], 1 +]; +exports.ListStackInstancesOutput$ = [3, n0, _LSIO, + 0, + [_Su, _NT], + [() => StackInstanceSummaries, 0] +]; +exports.ListStackRefactorActionsInput$ = [3, n0, _LSRAI, + 0, + [_SRI, _NT, _MR], + [0, 0, 1], 1 +]; +exports.ListStackRefactorActionsOutput$ = [3, n0, _LSRAO, + 0, + [_SRA, _NT], + [() => StackRefactorActions, 0], 1 +]; +exports.ListStackRefactorsInput$ = [3, n0, _LSRI, + 0, + [_ESF, _NT, _MR], + [64 | 0, 0, 1] +]; +exports.ListStackRefactorsOutput$ = [3, n0, _LSRO, + 0, + [_SRS, _NT], + [() => StackRefactorSummaries, 0], 1 +]; +exports.ListStackResourcesInput$ = [3, n0, _LSRIi, + 0, + [_SN, _NT], + [0, 0], 1 +]; +exports.ListStackResourcesOutput$ = [3, n0, _LSROi, + 0, + [_SRSt, _NT], + [() => StackResourceSummaries, 0] +]; +exports.ListStackSetAutoDeploymentTargetsInput$ = [3, n0, _LSSADTI, + 0, + [_SSN, _NT, _MR, _CA], + [0, 0, 1, 0], 1 +]; +exports.ListStackSetAutoDeploymentTargetsOutput$ = [3, n0, _LSSADTO, + 0, + [_Su, _NT], + [() => StackSetAutoDeploymentTargetSummaries, 0] +]; +exports.ListStackSetOperationResultsInput$ = [3, n0, _LSSORI, + 0, + [_SSN, _OI, _NT, _MR, _CA, _F], + [0, 0, 0, 1, 0, () => OperationResultFilters], 2 +]; +exports.ListStackSetOperationResultsOutput$ = [3, n0, _LSSORO, + 0, + [_Su, _NT], + [() => StackSetOperationResultSummaries, 0] +]; +exports.ListStackSetOperationsInput$ = [3, n0, _LSSOI, + 0, + [_SSN, _NT, _MR, _CA], + [0, 0, 1, 0], 1 +]; +exports.ListStackSetOperationsOutput$ = [3, n0, _LSSOO, + 0, + [_Su, _NT], + [() => StackSetOperationSummaries, 0] +]; +exports.ListStackSetsInput$ = [3, n0, _LSSI, + 0, + [_NT, _MR, _S, _CA], + [0, 1, 0, 0] +]; +exports.ListStackSetsOutput$ = [3, n0, _LSSO, + 0, + [_Su, _NT], + [() => StackSetSummaries, 0] +]; +exports.ListStacksInput$ = [3, n0, _LSI, + 0, + [_NT, _SSF], + [0, 64 | 0] +]; +exports.ListStacksOutput$ = [3, n0, _LSO, + 0, + [_SSt, _NT], + [() => StackSummaries, 0] +]; +exports.ListTypeRegistrationsInput$ = [3, n0, _LTRI, + 0, + [_T, _TN, _TA, _RSF, _MR, _NT], + [0, 0, 0, 0, 1, 0] +]; +exports.ListTypeRegistrationsOutput$ = [3, n0, _LTRO, + 0, + [_RTL, _NT], + [64 | 0, 0] +]; +exports.ListTypesInput$ = [3, n0, _LTI, + 0, + [_Vi, _PT, _DSe, _T, _F, _MR, _NT], + [0, 0, 0, 0, () => exports.TypeFilters$, 1, 0] +]; +exports.ListTypesOutput$ = [3, n0, _LTO, + 0, + [_TSy, _NT], + [() => TypeSummaries, 0] +]; +exports.ListTypeVersionsInput$ = [3, n0, _LTVI, + 0, + [_T, _TN, _A, _MR, _NT, _DSe, _PI], + [0, 0, 0, 1, 0, 0, 0] +]; +exports.ListTypeVersionsOutput$ = [3, n0, _LTVO, + 0, + [_TVS, _NT], + [() => TypeVersionSummaries, 0] +]; +exports.LiveResourceDrift$ = [3, n0, _LRD, + 0, + [_PV, _AV, _DDT], + [0, 0, 4] +]; +exports.LoggingConfig$ = [3, n0, _LC, + 0, + [_LRA, _LGN], + [0, 0], 2 +]; +exports.ManagedExecution$ = [3, n0, _ME, + 0, + [_Acti], + [2] +]; +exports.ModuleInfo$ = [3, n0, _MI, + 0, + [_TH, _LIH], + [0, 0] +]; +exports.OperationEntry$ = [3, n0, _OEp, + 0, + [_OT, _OI], + [0, 0] +]; +exports.OperationEvent$ = [3, n0, _OEpe, + 0, + [_EI, _SI, _OI, _OT, _OS, _ETv, _LRI, _PRI, _RT, _Ti, _ST, _ET, _RSes, _RSR, _RP, _CRT, _HTo, _HS, _HSR, _HIP, _HFM, _DSet, _VFM, _VN, _VS, _VSR, _VP], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +]; +exports.OperationResultFilter$ = [3, n0, _ORF, + 0, + [_N, _Va], + [0, 0] +]; +exports.Output$ = [3, n0, _O, + 0, + [_OK, _OV, _D, _EN], + [0, 0, 0, 0] +]; +exports.Parameter$ = [3, n0, _Pa, + 0, + [_PK, _PVa, _UPV, _RV], + [0, 0, 2, 0] +]; +exports.ParameterConstraints$ = [3, n0, _PCa, + 0, + [_AVl], + [64 | 0] +]; +exports.ParameterDeclaration$ = [3, n0, _PD, + 0, + [_PK, _DV, _PTa, _NE, _D, _PCa], + [0, 0, 0, 2, 0, () => exports.ParameterConstraints$] +]; +exports.PhysicalResourceIdContextKeyValuePair$ = [3, n0, _PRICKVP, + 0, + [_K, _V], + [0, 0], 2 +]; +exports.PropertyDifference$ = [3, n0, _PDr, + 0, + [_PPr, _EV, _AV, _DTi], + [0, 0, 0, 0], 4 +]; +exports.PublishTypeInput$ = [3, n0, _PTI, + 0, + [_T, _A, _TN, _PVN], + [0, 0, 0, 0] +]; +exports.PublishTypeOutput$ = [3, n0, _PTO, + 0, + [_PTA], + [0] +]; +exports.RecordHandlerProgressInput$ = [3, n0, _RHPI, + 0, + [_BT, _OS, _COS, _SM, _EC, _RMes, _CRT], + [0, 0, 0, 0, 0, 0, 0], 2 +]; +exports.RecordHandlerProgressOutput$ = [3, n0, _RHPO, + 0, + [], + [] +]; +exports.RegisterPublisherInput$ = [3, n0, _RPI, + 0, + [_ATAC, _CAo], + [2, 0] +]; +exports.RegisterPublisherOutput$ = [3, n0, _RPO, + 0, + [_PI], + [0] +]; +exports.RegisterTypeInput$ = [3, n0, _RTIe, + 0, + [_TN, _SHP, _T, _LC, _ERA, _CRT], + [0, 0, 0, () => exports.LoggingConfig$, 0, 0], 2 +]; +exports.RegisterTypeOutput$ = [3, n0, _RTO, + 0, + [_RTeg], + [0] +]; +exports.RequiredActivatedType$ = [3, n0, _RATe, + 0, + [_TNA, _OTN, _PI, _SMV], + [0, 0, 0, 64 | 1] +]; +exports.ResourceChange$ = [3, n0, _RC, + 0, + [_PA, _Act, _LRI, _PRI, _RT, _Rep, _Sco, _RDS, _RDIA, _De, _CSI, _MI, _BC, _AC, _PDC], + [0, 0, 0, 0, 0, 0, 64 | 0, 0, () => ResourceDriftIgnoredAttributes, () => ResourceChangeDetails, 0, () => exports.ModuleInfo$, 0, 0, 0] +]; +exports.ResourceChangeDetail$ = [3, n0, _RCD, + 0, + [_Tar, _Ev, _CSh, _CE], + [() => exports.ResourceTargetDefinition$, 0, 0, 0] +]; +exports.ResourceDefinition$ = [3, n0, _RD, + 0, + [_RT, _RI, _LRI], + [0, 128 | 0, 0], 2 +]; +exports.ResourceDetail$ = [3, n0, _RDe, + 0, + [_RT, _LRI, _RI, _RSes, _RSR, _W], + [0, 0, 128 | 0, 0, 0, () => WarningDetails] +]; +exports.ResourceDriftIgnoredAttribute$ = [3, n0, _RDIAe, + 0, + [_Pat, _Rea], + [0, 0] +]; +exports.ResourceIdentifierSummary$ = [3, n0, _RISe, + 0, + [_RT, _LRIo, _RIe], + [0, 64 | 0, 64 | 0] +]; +exports.ResourceLocation$ = [3, n0, _RLe, + 0, + [_SN, _LRI], + [0, 0], 2 +]; +exports.ResourceMapping$ = [3, n0, _RMeso, + 0, + [_So, _Des], + [() => exports.ResourceLocation$, () => exports.ResourceLocation$], 2 +]; +exports.ResourceScanSummary$ = [3, n0, _RSSe, + 0, + [_RSI, _S, _SR, _ST, _ET, _PC, _STc], + [0, 0, 0, 4, 4, 1, 0] +]; +exports.ResourceTargetDefinition$ = [3, n0, _RTDe, + 0, + [_At, _N, _RReq, _Pat, _BV, _AVf, _BVF, _AVF, _Dr, _ACT], + [0, 0, 0, 0, 0, 0, 0, 0, () => exports.LiveResourceDrift$, 0] +]; +exports.ResourceToImport$ = [3, n0, _RTIes, + 0, + [_RT, _LRI, _RI], + [0, 0, 128 | 0], 3 +]; +exports.RollbackConfiguration$ = [3, n0, _RCo, + 0, + [_RTo, _MTIM], + [() => RollbackTriggers, 1] +]; +exports.RollbackStackInput$ = [3, n0, _RSIo, + 0, + [_SN, _RARN, _CRT, _REOC], + [0, 0, 0, 2], 1 +]; +exports.RollbackStackOutput$ = [3, n0, _RSO, + 0, + [_SI, _OI], + [0, 0] +]; +exports.RollbackTrigger$ = [3, n0, _RTol, + 0, + [_A, _T], + [0, 0], 2 +]; +exports.ScanFilter$ = [3, n0, _SFc, + 0, + [_Ty], + [64 | 0] +]; +exports.ScannedResource$ = [3, n0, _SRc, + 0, + [_RT, _RI, _MBS], + [0, 128 | 0, 2] +]; +exports.ScannedResourceIdentifier$ = [3, n0, _SRIc, + 0, + [_RT, _RI], + [0, 128 | 0], 2 +]; +exports.SetStackPolicyInput$ = [3, n0, _SSPI, + 0, + [_SN, _SPB, _SPURL], + [0, 0, 0], 1 +]; +exports.SetTypeConfigurationInput$ = [3, n0, _STCI, + 0, + [_Co, _TA, _CAon, _TN, _T], + [0, 0, 0, 0, 0], 1 +]; +exports.SetTypeConfigurationOutput$ = [3, n0, _STCO, + 0, + [_CAonf], + [0] +]; +exports.SetTypeDefaultVersionInput$ = [3, n0, _STDVI, + 0, + [_A, _T, _TN, _VI], + [0, 0, 0, 0] +]; +exports.SetTypeDefaultVersionOutput$ = [3, n0, _STDVO, + 0, + [], + [] +]; +exports.SignalResourceInput$ = [3, n0, _SRIi, + 0, + [_SN, _LRI, _UI, _S], + [0, 0, 0, 0], 4 +]; +exports.Stack$ = [3, n0, _Sta, + 0, + [_SN, _CT, _SSta, _SI, _CSI, _D, _P, _DTel, _LUT, _RCo, _SSR, _DR, _NARN, _TIM, _Ca, _Ou, _RARN, _Ta, _ETP, _PIa, _RIo, _DI, _REOC, _DMe, _DSet, _LO], + [0, 4, 0, 0, 0, 0, () => _Parameters, 4, 4, () => exports.RollbackConfiguration$, 0, 2, 64 | 0, 1, 64 | 0, () => Outputs, 0, () => Tags, 2, 0, 0, () => exports.StackDriftInformation$, 2, 0, 0, () => LastOperations], 3 +]; +exports.StackDefinition$ = [3, n0, _SDt, + 0, + [_SN, _TB, _TURL], + [0, 0, 0] +]; +exports.StackDriftInformation$ = [3, n0, _SDI, + 0, + [_SDS, _LCT], + [0, 4], 1 +]; +exports.StackDriftInformationSummary$ = [3, n0, _SDIS, + 0, + [_SDS, _LCT], + [0, 4], 1 +]; +exports.StackEvent$ = [3, n0, _SEt, + 0, + [_SI, _EI, _SN, _Ti, _OI, _LRI, _PRI, _RT, _RSes, _RSR, _RP, _CRT, _HTo, _HS, _HSR, _HIP, _HII, _HFM, _DSet], + [0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 4 +]; +exports.StackInstance$ = [3, n0, _SIt, + 0, + [_SSI, _Reg, _Acc, _SI, _PO, _S, _SIS, _SR, _OUIr, _DSr, _LDCT, _LOI], + [0, 0, 0, 0, () => _Parameters, 0, () => exports.StackInstanceComprehensiveStatus$, 0, 0, 0, 4, 0] +]; +exports.StackInstanceComprehensiveStatus$ = [3, n0, _SICS, + 0, + [_DSet], + [0] +]; +exports.StackInstanceFilter$ = [3, n0, _SIF, + 0, + [_N, _Va], + [0, 0] +]; +exports.StackInstanceResourceDriftsSummary$ = [3, n0, _SIRDSt, + 0, + [_SI, _LRI, _RT, _SRDS, _Ti, _PRI, _PRIC, _PDro], + [0, 0, 0, 0, 4, 0, () => PhysicalResourceIdContext, () => PropertyDifferences], 5 +]; +exports.StackInstanceSummary$ = [3, n0, _SISt, + 0, + [_SSI, _Reg, _Acc, _SI, _S, _SR, _SIS, _OUIr, _DSr, _LDCT, _LOI], + [0, 0, 0, 0, 0, 0, () => exports.StackInstanceComprehensiveStatus$, 0, 0, 4, 0] +]; +exports.StackRefactorAction$ = [3, n0, _SRAt, + 0, + [_Act, _En, _PRI, _RI, _D, _Det, _DRe, _TR, _UR, _RMeso], + [0, 0, 0, 0, 0, 0, 0, () => StackRefactorTagResources, 64 | 0, () => exports.ResourceMapping$] +]; +exports.StackRefactorSummary$ = [3, n0, _SRSta, + 0, + [_SRI, _D, _ES, _ESR, _S, _SR], + [0, 0, 0, 0, 0, 0] +]; +exports.StackResource$ = [3, n0, _SRta, + 0, + [_LRI, _RT, _Ti, _RSes, _SN, _SI, _PRI, _RSR, _D, _DI, _MI], + [0, 0, 4, 0, 0, 0, 0, 0, 0, () => exports.StackResourceDriftInformation$, () => exports.ModuleInfo$], 4 +]; +exports.StackResourceDetail$ = [3, n0, _SRDt, + 0, + [_LRI, _RT, _LUTa, _RSes, _SN, _SI, _PRI, _RSR, _D, _Me, _DI, _MI], + [0, 0, 4, 0, 0, 0, 0, 0, 0, 0, () => exports.StackResourceDriftInformation$, () => exports.ModuleInfo$], 4 +]; +exports.StackResourceDrift$ = [3, n0, _SRDta, + 0, + [_SI, _LRI, _RT, _SRDS, _Ti, _PRI, _PRIC, _EP, _AP, _PDro, _MI, _DSRr], + [0, 0, 0, 0, 4, 0, () => PhysicalResourceIdContext, 0, 0, () => PropertyDifferences, () => exports.ModuleInfo$, 0], 5 +]; +exports.StackResourceDriftInformation$ = [3, n0, _SRDI, + 0, + [_SRDS, _LCT], + [0, 4], 1 +]; +exports.StackResourceDriftInformationSummary$ = [3, n0, _SRDIS, + 0, + [_SRDS, _LCT], + [0, 4], 1 +]; +exports.StackResourceSummary$ = [3, n0, _SRStac, + 0, + [_LRI, _RT, _LUTa, _RSes, _PRI, _RSR, _DI, _MI], + [0, 0, 4, 0, 0, 0, () => exports.StackResourceDriftInformationSummary$, () => exports.ModuleInfo$], 4 +]; +exports.StackSet$ = [3, n0, _SS, + 0, + [_SSN, _SSI, _D, _S, _TB, _P, _Ca, _Ta, _SSARN, _ARARN, _ERN, _SSDDD, _AD, _PM, _OUI, _ME, _Re], + [0, 0, 0, 0, 0, () => _Parameters, 64 | 0, () => Tags, 0, 0, 0, () => exports.StackSetDriftDetectionDetails$, () => exports.AutoDeployment$, 0, 64 | 0, () => exports.ManagedExecution$, 64 | 0] +]; +exports.StackSetAutoDeploymentTargetSummary$ = [3, n0, _SSADTS, + 0, + [_OUIr, _Re], + [0, 64 | 0] +]; +exports.StackSetDriftDetectionDetails$ = [3, n0, _SSDDD, + 0, + [_DSr, _DDS, _LDCT, _TSIC, _DSIC, _ISSIC, _IPSIC, _FSIC], + [0, 0, 4, 1, 1, 1, 1, 1] +]; +exports.StackSetOperation$ = [3, n0, _SSO, + 0, + [_OI, _SSI, _Act, _S, _OP, _RS, _ARARN, _ERN, _CTr, _ETn, _DT, _SSDDD, _SR, _SDta], + [0, 0, 0, 0, () => exports.StackSetOperationPreferences$, 2, 0, 0, 4, 4, () => exports.DeploymentTargets$, () => exports.StackSetDriftDetectionDetails$, 0, () => exports.StackSetOperationStatusDetails$] +]; +exports.StackSetOperationPreferences$ = [3, n0, _SSOP, + 0, + [_RCT, _RO, _FTC, _FTP, _MCC, _MCP, _CM], + [0, 64 | 0, 1, 1, 1, 1, 0] +]; +exports.StackSetOperationResultSummary$ = [3, n0, _SSORS, + 0, + [_Acc, _Reg, _S, _SR, _AGR, _OUIr], + [0, 0, 0, 0, () => exports.AccountGateResult$, 0] +]; +exports.StackSetOperationStatusDetails$ = [3, n0, _SSOSD, + 0, + [_FSIC], + [1] +]; +exports.StackSetOperationSummary$ = [3, n0, _SSOS, + 0, + [_OI, _Act, _S, _CTr, _ETn, _SR, _SDta, _OP], + [0, 0, 0, 4, 4, 0, () => exports.StackSetOperationStatusDetails$, () => exports.StackSetOperationPreferences$] +]; +exports.StackSetSummary$ = [3, n0, _SSS, + 0, + [_SSN, _SSI, _D, _S, _AD, _PM, _DSr, _LDCT, _ME], + [0, 0, 0, 0, () => exports.AutoDeployment$, 0, 0, 4, () => exports.ManagedExecution$] +]; +exports.StackSummary$ = [3, n0, _SStac, + 0, + [_SN, _CT, _SSta, _SI, _TDe, _LUT, _DTel, _SSR, _PIa, _RIo, _DI, _LO], + [0, 4, 0, 0, 0, 4, 4, 0, 0, 0, () => exports.StackDriftInformationSummary$, () => LastOperations], 3 +]; +exports.StartResourceScanInput$ = [3, n0, _SRSI, + 0, + [_CRT, _SF], + [0, () => ScanFilters] +]; +exports.StartResourceScanOutput$ = [3, n0, _SRSO, + 0, + [_RSI], + [0] +]; +exports.StopStackSetOperationInput$ = [3, n0, _SSSOI, + 0, + [_SSN, _OI, _CA], + [0, 0, 0], 2 +]; +exports.StopStackSetOperationOutput$ = [3, n0, _SSSOO, + 0, + [], + [] +]; +exports.Tag$ = [3, n0, _Tag, + 0, + [_K, _V], + [0, 0], 2 +]; +exports.TemplateConfiguration$ = [3, n0, _TCe, + 0, + [_DP, _URP], + [0, 0] +]; +exports.TemplateParameter$ = [3, n0, _TP, + 0, + [_PK, _DV, _NE, _D], + [0, 0, 2, 0] +]; +exports.TemplateProgress$ = [3, n0, _TPe, + 0, + [_RSeso, _RF, _RPe, _RPes], + [1, 1, 1, 1] +]; +exports.TemplateSummary$ = [3, n0, _TSe, + 0, + [_GTI, _GTN, _S, _SR, _CT, _LUT, _NOR], + [0, 0, 0, 0, 4, 4, 1] +]; +exports.TemplateSummaryConfig$ = [3, n0, _TSC, + 0, + [_TURTAW], + [2] +]; +exports.TestTypeInput$ = [3, n0, _TTI, + 0, + [_A, _T, _TN, _VI, _LDB], + [0, 0, 0, 0, 0] +]; +exports.TestTypeOutput$ = [3, n0, _TTO, + 0, + [_TVA], + [0] +]; +exports.TypeConfigurationDetails$ = [3, n0, _TCD, + 0, + [_A, _Al, _Co, _LU, _TA, _TN, _IDC], + [0, 0, 0, 4, 0, 0, 2] +]; +exports.TypeConfigurationIdentifier$ = [3, n0, _TCI, + 0, + [_TA, _TCA, _TCAy, _T, _TN], + [0, 0, 0, 0, 0] +]; +exports.TypeFilters$ = [3, n0, _TF, + 0, + [_Cat, _PI, _TNP], + [0, 0, 0] +]; +exports.TypeSummary$ = [3, n0, _TSyp, + 0, + [_T, _TN, _DVI, _TA, _LU, _D, _PI, _OTN, _PVN, _LPV, _PIu, _PN, _IA], + [0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2] +]; +exports.TypeVersionSummary$ = [3, n0, _TVSy, + 0, + [_T, _TN, _VI, _IDV, _A, _TCi, _D, _PVN], + [0, 0, 0, 2, 0, 4, 0, 0] +]; +exports.UpdateGeneratedTemplateInput$ = [3, n0, _UGTI, + 0, + [_GTN, _NGTN, _AR, _RRem, _RAR, _TCe], + [0, 0, () => ResourceDefinitions, 64 | 0, 2, () => exports.TemplateConfiguration$], 1 +]; +exports.UpdateGeneratedTemplateOutput$ = [3, n0, _UGTO, + 0, + [_GTI], + [0] +]; +exports.UpdateStackInput$ = [3, n0, _USI, + 0, + [_SN, _TB, _TURL, _UPT, _SPDUB, _SPDUURL, _P, _Ca, _RTe, _RARN, _RCo, _SPB, _SPURL, _NARN, _Ta, _DR, _CRT, _REOC], + [0, 0, 0, 2, 0, 0, () => _Parameters, 64 | 0, 64 | 0, 0, () => exports.RollbackConfiguration$, 0, 0, 64 | 0, () => Tags, 2, 0, 2], 1 +]; +exports.UpdateStackInstancesInput$ = [3, n0, _USII, + 0, + [_SSN, _Re, _Ac, _DT, _PO, _OP, _OI, _CA], + [0, 64 | 0, 64 | 0, () => exports.DeploymentTargets$, () => _Parameters, () => exports.StackSetOperationPreferences$, [0, 4], 0], 2 +]; +exports.UpdateStackInstancesOutput$ = [3, n0, _USIO, + 0, + [_OI], + [0] +]; +exports.UpdateStackOutput$ = [3, n0, _USO, + 0, + [_SI, _OI], + [0, 0] +]; +exports.UpdateStackSetInput$ = [3, n0, _USSI, + 0, + [_SSN, _D, _TB, _TURL, _UPT, _P, _Ca, _Ta, _OP, _ARARN, _ERN, _DT, _PM, _AD, _OI, _Ac, _Re, _CA, _ME], + [0, 0, 0, 0, 2, () => _Parameters, 64 | 0, () => Tags, () => exports.StackSetOperationPreferences$, 0, 0, () => exports.DeploymentTargets$, 0, () => exports.AutoDeployment$, [0, 4], 64 | 0, 64 | 0, 0, () => exports.ManagedExecution$], 1 +]; +exports.UpdateStackSetOutput$ = [3, n0, _USSO, + 0, + [_OI], + [0] +]; +exports.UpdateTerminationProtectionInput$ = [3, n0, _UTPI, + 0, + [_ETP, _SN], + [2, 0], 2 +]; +exports.UpdateTerminationProtectionOutput$ = [3, n0, _UTPO, + 0, + [_SI], + [0] +]; +exports.ValidateTemplateInput$ = [3, n0, _VTI, + 0, + [_TB, _TURL], + [0, 0] +]; +exports.ValidateTemplateOutput$ = [3, n0, _VTO, + 0, + [_P, _D, _Ca, _CR, _DTe], + [() => TemplateParameters, 0, 64 | 0, 0, 64 | 0] +]; +exports.WarningDetail$ = [3, n0, _WD, + 0, + [_T, _Pro], + [0, () => WarningProperties] +]; +exports.WarningProperty$ = [3, n0, _WP, + 0, + [_PPr, _Req, _D], + [0, 2, 0] +]; +exports.Warnings$ = [3, n0, _W, + 0, + [_URT], + [64 | 0] +]; +var __Unit = "unit"; +var AccountLimitList = [1, n0, _ALL, + 0, () => exports.AccountLimit$ +]; +var AccountList = (/* unused pure expression or super */ null && (64 | 0)); +var AllowedValues = (/* unused pure expression or super */ null && (64 | 0)); +var AnnotationList = [1, n0, _ALn, + 0, () => exports.Annotation$ +]; +var BatchDescribeTypeConfigurationsErrors = [1, n0, _BDTCEa, + 0, () => exports.BatchDescribeTypeConfigurationsError$ +]; +var Capabilities = (/* unused pure expression or super */ null && (64 | 0)); +var Changes = [1, n0, _Ch, + 0, () => exports.Change$ +]; +var ChangeSetHooks = [1, n0, _CSHh, + 0, () => exports.ChangeSetHook$ +]; +var ChangeSetSummaries = [1, n0, _CSSh, + 0, () => exports.ChangeSetSummary$ +]; +var Exports = [1, n0, _Exp, + 0, () => exports.Export$ +]; +var HookResultSummaries = [1, n0, _HRSo, + 0, () => exports.HookResultSummary$ +]; +var Imports = (/* unused pure expression or super */ null && (64 | 0)); +var JazzLogicalResourceIds = (/* unused pure expression or super */ null && (64 | 0)); +var LastOperations = [1, n0, _LO, + 0, () => exports.OperationEntry$ +]; +var LogicalResourceIds = (/* unused pure expression or super */ null && (64 | 0)); +var NotificationARNs = (/* unused pure expression or super */ null && (64 | 0)); +var OperationEvents = [1, n0, _OE, + 0, () => exports.OperationEvent$ +]; +var OperationResultFilters = [1, n0, _ORFp, + 0, () => exports.OperationResultFilter$ +]; +var OrganizationalUnitIdList = (/* unused pure expression or super */ null && (64 | 0)); +var Outputs = [1, n0, _Ou, + 0, () => exports.Output$ +]; +var ParameterDeclarations = [1, n0, _PDa, + 0, () => exports.ParameterDeclaration$ +]; +var _Parameters = [1, n0, _P, + 0, () => exports.Parameter$ +]; +var PhysicalResourceIdContext = [1, n0, _PRIC, + 0, () => exports.PhysicalResourceIdContextKeyValuePair$ +]; +var PropertyDifferences = [1, n0, _PDro, + 0, () => exports.PropertyDifference$ +]; +var RegionList = (/* unused pure expression or super */ null && (64 | 0)); +var RegistrationTokenList = (/* unused pure expression or super */ null && (64 | 0)); +var RelatedResources = [1, n0, _RRel, + 0, () => exports.ScannedResource$ +]; +var RequiredActivatedTypes = [1, n0, _RAT, + 0, () => exports.RequiredActivatedType$ +]; +var ResourceChangeDetails = [1, n0, _RCDe, + 0, () => exports.ResourceChangeDetail$ +]; +var ResourceDefinitions = [1, n0, _RDes, + 0, () => exports.ResourceDefinition$ +]; +var ResourceDetails = [1, n0, _RDeso, + 0, () => exports.ResourceDetail$ +]; +var ResourceDriftIgnoredAttributes = [1, n0, _RDIA, + 0, () => exports.ResourceDriftIgnoredAttribute$ +]; +var ResourceIdentifiers = (/* unused pure expression or super */ null && (64 | 0)); +var ResourceIdentifierSummaries = [1, n0, _RIS, + 0, () => exports.ResourceIdentifierSummary$ +]; +var ResourceMappings = [1, n0, _RMe, + 0, () => exports.ResourceMapping$ +]; +var ResourceScanSummaries = [1, n0, _RSS, + 0, () => exports.ResourceScanSummary$ +]; +var ResourcesToImport = [1, n0, _RTI, + 0, () => exports.ResourceToImport$ +]; +var ResourcesToSkip = (/* unused pure expression or super */ null && (64 | 0)); +var ResourceTypeFilters = (/* unused pure expression or super */ null && (64 | 0)); +var ResourceTypes = (/* unused pure expression or super */ null && (64 | 0)); +var RetainResources = (/* unused pure expression or super */ null && (64 | 0)); +var RollbackTriggers = [1, n0, _RTo, + 0, () => exports.RollbackTrigger$ +]; +var ScanFilters = [1, n0, _SF, + 0, () => exports.ScanFilter$ +]; +var ScannedResourceIdentifiers = [1, n0, _SRIca, + 0, () => exports.ScannedResourceIdentifier$ +]; +var ScannedResources = [1, n0, _SRca, + 0, () => exports.ScannedResource$ +]; +var Scope = (/* unused pure expression or super */ null && (64 | 0)); +var StackDefinitions = [1, n0, _SD, + 0, () => exports.StackDefinition$ +]; +var StackEvents = [1, n0, _SE, + 0, () => exports.StackEvent$ +]; +var StackIdList = (/* unused pure expression or super */ null && (64 | 0)); +var StackIds = (/* unused pure expression or super */ null && (64 | 0)); +var StackInstanceFilters = [1, n0, _SIFt, + 0, () => exports.StackInstanceFilter$ +]; +var StackInstanceResourceDriftsSummaries = [1, n0, _SIRDSta, + 0, () => exports.StackInstanceResourceDriftsSummary$ +]; +var StackInstanceSummaries = [1, n0, _SISta, + 0, () => exports.StackInstanceSummary$ +]; +var StackRefactorActions = [1, n0, _SRA, + 0, () => exports.StackRefactorAction$ +]; +var StackRefactorExecutionStatusFilter = (/* unused pure expression or super */ null && (64 | 0)); +var StackRefactorSummaries = [1, n0, _SRS, + 0, () => exports.StackRefactorSummary$ +]; +var StackRefactorTagResources = [1, n0, _SRTR, + 0, () => exports.Tag$ +]; +var StackRefactorUntagResources = (/* unused pure expression or super */ null && (64 | 0)); +var StackResourceDrifts = [1, n0, _SRD, + 0, () => exports.StackResourceDrift$ +]; +var StackResourceDriftStatusFilters = (/* unused pure expression or super */ null && (64 | 0)); +var StackResources = [1, n0, _SRt, + 0, () => exports.StackResource$ +]; +var StackResourceSummaries = [1, n0, _SRSt, + 0, () => exports.StackResourceSummary$ +]; +var Stacks = [1, n0, _St, + 0, () => exports.Stack$ +]; +var StackSetARNList = (/* unused pure expression or super */ null && (64 | 0)); +var StackSetAutoDeploymentTargetSummaries = [1, n0, _SSADTSt, + 0, () => exports.StackSetAutoDeploymentTargetSummary$ +]; +var StackSetOperationResultSummaries = [1, n0, _SSORSt, + 0, () => exports.StackSetOperationResultSummary$ +]; +var StackSetOperationSummaries = [1, n0, _SSOSt, + 0, () => exports.StackSetOperationSummary$ +]; +var StackSetSummaries = [1, n0, _SSSt, + 0, () => exports.StackSetSummary$ +]; +var StackStatusFilter = (/* unused pure expression or super */ null && (64 | 0)); +var StackSummaries = [1, n0, _SSt, + 0, () => exports.StackSummary$ +]; +var StageList = (/* unused pure expression or super */ null && (64 | 0)); +var SupportedMajorVersions = (/* unused pure expression or super */ null && (64 | 1)); +var Tags = [1, n0, _Ta, + 0, () => exports.Tag$ +]; +var TemplateParameters = [1, n0, _TPem, + 0, () => exports.TemplateParameter$ +]; +var TemplateSummaries = [1, n0, _TSem, + 0, () => exports.TemplateSummary$ +]; +var TransformsList = (/* unused pure expression or super */ null && (64 | 0)); +var TypeConfigurationDetailsList = [1, n0, _TCDL, + 0, () => exports.TypeConfigurationDetails$ +]; +var TypeConfigurationIdentifiers = [1, n0, _TCIy, + 0, () => exports.TypeConfigurationIdentifier$ +]; +var TypeSummaries = [1, n0, _TSy, + 0, () => exports.TypeSummary$ +]; +var TypeVersionSummaries = [1, n0, _TVS, + 0, () => exports.TypeVersionSummary$ +]; +var UnprocessedTypeConfigurations = [1, n0, _UTC, + 0, () => exports.TypeConfigurationIdentifier$ +]; +var WarningDetails = [1, n0, _WDa, + 0, () => exports.WarningDetail$ +]; +var WarningProperties = [1, n0, _WPa, + 0, () => exports.WarningProperty$ +]; +var JazzResourceIdentifierProperties = (/* unused pure expression or super */ null && (128 | 0)); +var ResourceIdentifierProperties = (/* unused pure expression or super */ null && (128 | 0)); +exports.ActivateOrganizationsAccess$ = [9, n0, _AOA, + 0, () => exports.ActivateOrganizationsAccessInput$, () => exports.ActivateOrganizationsAccessOutput$ +]; +exports.ActivateType$ = [9, n0, _AT, + 2, () => exports.ActivateTypeInput$, () => exports.ActivateTypeOutput$ +]; +exports.BatchDescribeTypeConfigurations$ = [9, n0, _BDTC, + 0, () => exports.BatchDescribeTypeConfigurationsInput$, () => exports.BatchDescribeTypeConfigurationsOutput$ +]; +exports.CancelUpdateStack$ = [9, n0, _CUS, + 0, () => exports.CancelUpdateStackInput$, () => __Unit +]; +exports.ContinueUpdateRollback$ = [9, n0, _CUR, + 0, () => exports.ContinueUpdateRollbackInput$, () => exports.ContinueUpdateRollbackOutput$ +]; +exports.CreateChangeSet$ = [9, n0, _CCS, + 0, () => exports.CreateChangeSetInput$, () => exports.CreateChangeSetOutput$ +]; +exports.CreateGeneratedTemplate$ = [9, n0, _CGT, + 0, () => exports.CreateGeneratedTemplateInput$, () => exports.CreateGeneratedTemplateOutput$ +]; +exports.CreateStack$ = [9, n0, _CSr, + 0, () => exports.CreateStackInput$, () => exports.CreateStackOutput$ +]; +exports.CreateStackInstances$ = [9, n0, _CSIre, + 0, () => exports.CreateStackInstancesInput$, () => exports.CreateStackInstancesOutput$ +]; +exports.CreateStackRefactor$ = [9, n0, _CSR, + 0, () => exports.CreateStackRefactorInput$, () => exports.CreateStackRefactorOutput$ +]; +exports.CreateStackSet$ = [9, n0, _CSSr, + 0, () => exports.CreateStackSetInput$, () => exports.CreateStackSetOutput$ +]; +exports.DeactivateOrganizationsAccess$ = [9, n0, _DOA, + 0, () => exports.DeactivateOrganizationsAccessInput$, () => exports.DeactivateOrganizationsAccessOutput$ +]; +exports.DeactivateType$ = [9, n0, _DTea, + 2, () => exports.DeactivateTypeInput$, () => exports.DeactivateTypeOutput$ +]; +exports.DeleteChangeSet$ = [9, n0, _DCS, + 0, () => exports.DeleteChangeSetInput$, () => exports.DeleteChangeSetOutput$ +]; +exports.DeleteGeneratedTemplate$ = [9, n0, _DGT, + 0, () => exports.DeleteGeneratedTemplateInput$, () => __Unit +]; +exports.DeleteStack$ = [9, n0, _DSel, + 0, () => exports.DeleteStackInput$, () => __Unit +]; +exports.DeleteStackInstances$ = [9, n0, _DSIel, + 0, () => exports.DeleteStackInstancesInput$, () => exports.DeleteStackInstancesOutput$ +]; +exports.DeleteStackSet$ = [9, n0, _DSS, + 0, () => exports.DeleteStackSetInput$, () => exports.DeleteStackSetOutput$ +]; +exports.DeregisterType$ = [9, n0, _DTer, + 2, () => exports.DeregisterTypeInput$, () => exports.DeregisterTypeOutput$ +]; +exports.DescribeAccountLimits$ = [9, n0, _DAL, + 0, () => exports.DescribeAccountLimitsInput$, () => exports.DescribeAccountLimitsOutput$ +]; +exports.DescribeChangeSet$ = [9, n0, _DCSe, + 0, () => exports.DescribeChangeSetInput$, () => exports.DescribeChangeSetOutput$ +]; +exports.DescribeChangeSetHooks$ = [9, n0, _DCSH, + 0, () => exports.DescribeChangeSetHooksInput$, () => exports.DescribeChangeSetHooksOutput$ +]; +exports.DescribeEvents$ = [9, n0, _DE, + 0, () => exports.DescribeEventsInput$, () => exports.DescribeEventsOutput$ +]; +exports.DescribeGeneratedTemplate$ = [9, n0, _DGTe, + 0, () => exports.DescribeGeneratedTemplateInput$, () => exports.DescribeGeneratedTemplateOutput$ +]; +exports.DescribeOrganizationsAccess$ = [9, n0, _DOAe, + 0, () => exports.DescribeOrganizationsAccessInput$, () => exports.DescribeOrganizationsAccessOutput$ +]; +exports.DescribePublisher$ = [9, n0, _DPe, + 2, () => exports.DescribePublisherInput$, () => exports.DescribePublisherOutput$ +]; +exports.DescribeResourceScan$ = [9, n0, _DRS, + 0, () => exports.DescribeResourceScanInput$, () => exports.DescribeResourceScanOutput$ +]; +exports.DescribeStackDriftDetectionStatus$ = [9, n0, _DSDDS, + 0, () => exports.DescribeStackDriftDetectionStatusInput$, () => exports.DescribeStackDriftDetectionStatusOutput$ +]; +exports.DescribeStackEvents$ = [9, n0, _DSE, + 0, () => exports.DescribeStackEventsInput$, () => exports.DescribeStackEventsOutput$ +]; +exports.DescribeStackInstance$ = [9, n0, _DSIes, + 0, () => exports.DescribeStackInstanceInput$, () => exports.DescribeStackInstanceOutput$ +]; +exports.DescribeStackRefactor$ = [9, n0, _DSRe, + 0, () => exports.DescribeStackRefactorInput$, () => exports.DescribeStackRefactorOutput$ +]; +exports.DescribeStackResource$ = [9, n0, _DSRes, + 0, () => exports.DescribeStackResourceInput$, () => exports.DescribeStackResourceOutput$ +]; +exports.DescribeStackResourceDrifts$ = [9, n0, _DSRD, + 0, () => exports.DescribeStackResourceDriftsInput$, () => exports.DescribeStackResourceDriftsOutput$ +]; +exports.DescribeStackResources$ = [9, n0, _DSResc, + 0, () => exports.DescribeStackResourcesInput$, () => exports.DescribeStackResourcesOutput$ +]; +exports.DescribeStacks$ = [9, n0, _DSes, + 0, () => exports.DescribeStacksInput$, () => exports.DescribeStacksOutput$ +]; +exports.DescribeStackSet$ = [9, n0, _DSSe, + 0, () => exports.DescribeStackSetInput$, () => exports.DescribeStackSetOutput$ +]; +exports.DescribeStackSetOperation$ = [9, n0, _DSSOes, + 0, () => exports.DescribeStackSetOperationInput$, () => exports.DescribeStackSetOperationOutput$ +]; +exports.DescribeType$ = [9, n0, _DTes, + 2, () => exports.DescribeTypeInput$, () => exports.DescribeTypeOutput$ +]; +exports.DescribeTypeRegistration$ = [9, n0, _DTR, + 2, () => exports.DescribeTypeRegistrationInput$, () => exports.DescribeTypeRegistrationOutput$ +]; +exports.DetectStackDrift$ = [9, n0, _DSD, + 0, () => exports.DetectStackDriftInput$, () => exports.DetectStackDriftOutput$ +]; +exports.DetectStackResourceDrift$ = [9, n0, _DSRDe, + 0, () => exports.DetectStackResourceDriftInput$, () => exports.DetectStackResourceDriftOutput$ +]; +exports.DetectStackSetDrift$ = [9, n0, _DSSD, + 0, () => exports.DetectStackSetDriftInput$, () => exports.DetectStackSetDriftOutput$ +]; +exports.EstimateTemplateCost$ = [9, n0, _ETC, + 0, () => exports.EstimateTemplateCostInput$, () => exports.EstimateTemplateCostOutput$ +]; +exports.ExecuteChangeSet$ = [9, n0, _ECS, + 0, () => exports.ExecuteChangeSetInput$, () => exports.ExecuteChangeSetOutput$ +]; +exports.ExecuteStackRefactor$ = [9, n0, _ESRx, + 0, () => exports.ExecuteStackRefactorInput$, () => __Unit +]; +exports.GetGeneratedTemplate$ = [9, n0, _GGT, + 0, () => exports.GetGeneratedTemplateInput$, () => exports.GetGeneratedTemplateOutput$ +]; +exports.GetHookResult$ = [9, n0, _GHR, + 0, () => exports.GetHookResultInput$, () => exports.GetHookResultOutput$ +]; +exports.GetStackPolicy$ = [9, n0, _GSP, + 0, () => exports.GetStackPolicyInput$, () => exports.GetStackPolicyOutput$ +]; +exports.GetTemplate$ = [9, n0, _GT, + 0, () => exports.GetTemplateInput$, () => exports.GetTemplateOutput$ +]; +exports.GetTemplateSummary$ = [9, n0, _GTS, + 0, () => exports.GetTemplateSummaryInput$, () => exports.GetTemplateSummaryOutput$ +]; +exports.ImportStacksToStackSet$ = [9, n0, _ISTSS, + 0, () => exports.ImportStacksToStackSetInput$, () => exports.ImportStacksToStackSetOutput$ +]; +exports.ListChangeSets$ = [9, n0, _LCS, + 0, () => exports.ListChangeSetsInput$, () => exports.ListChangeSetsOutput$ +]; +exports.ListExports$ = [9, n0, _LE, + 0, () => exports.ListExportsInput$, () => exports.ListExportsOutput$ +]; +exports.ListGeneratedTemplates$ = [9, n0, _LGT, + 0, () => exports.ListGeneratedTemplatesInput$, () => exports.ListGeneratedTemplatesOutput$ +]; +exports.ListHookResults$ = [9, n0, _LHR, + 0, () => exports.ListHookResultsInput$, () => exports.ListHookResultsOutput$ +]; +exports.ListImports$ = [9, n0, _LI, + 0, () => exports.ListImportsInput$, () => exports.ListImportsOutput$ +]; +exports.ListResourceScanRelatedResources$ = [9, n0, _LRSRR, + 0, () => exports.ListResourceScanRelatedResourcesInput$, () => exports.ListResourceScanRelatedResourcesOutput$ +]; +exports.ListResourceScanResources$ = [9, n0, _LRSR, + 0, () => exports.ListResourceScanResourcesInput$, () => exports.ListResourceScanResourcesOutput$ +]; +exports.ListResourceScans$ = [9, n0, _LRS, + 0, () => exports.ListResourceScansInput$, () => exports.ListResourceScansOutput$ +]; +exports.ListStackInstanceResourceDrifts$ = [9, n0, _LSIRD, + 0, () => exports.ListStackInstanceResourceDriftsInput$, () => exports.ListStackInstanceResourceDriftsOutput$ +]; +exports.ListStackInstances$ = [9, n0, _LSIi, + 0, () => exports.ListStackInstancesInput$, () => exports.ListStackInstancesOutput$ +]; +exports.ListStackRefactorActions$ = [9, n0, _LSRA, + 0, () => exports.ListStackRefactorActionsInput$, () => exports.ListStackRefactorActionsOutput$ +]; +exports.ListStackRefactors$ = [9, n0, _LSR, + 0, () => exports.ListStackRefactorsInput$, () => exports.ListStackRefactorsOutput$ +]; +exports.ListStackResources$ = [9, n0, _LSRi, + 0, () => exports.ListStackResourcesInput$, () => exports.ListStackResourcesOutput$ +]; +exports.ListStacks$ = [9, n0, _LS, + 0, () => exports.ListStacksInput$, () => exports.ListStacksOutput$ +]; +exports.ListStackSetAutoDeploymentTargets$ = [9, n0, _LSSADT, + 0, () => exports.ListStackSetAutoDeploymentTargetsInput$, () => exports.ListStackSetAutoDeploymentTargetsOutput$ +]; +exports.ListStackSetOperationResults$ = [9, n0, _LSSOR, + 0, () => exports.ListStackSetOperationResultsInput$, () => exports.ListStackSetOperationResultsOutput$ +]; +exports.ListStackSetOperations$ = [9, n0, _LSSOi, + 0, () => exports.ListStackSetOperationsInput$, () => exports.ListStackSetOperationsOutput$ +]; +exports.ListStackSets$ = [9, n0, _LSS, + 0, () => exports.ListStackSetsInput$, () => exports.ListStackSetsOutput$ +]; +exports.ListTypeRegistrations$ = [9, n0, _LTR, + 2, () => exports.ListTypeRegistrationsInput$, () => exports.ListTypeRegistrationsOutput$ +]; +exports.ListTypes$ = [9, n0, _LT, + 2, () => exports.ListTypesInput$, () => exports.ListTypesOutput$ +]; +exports.ListTypeVersions$ = [9, n0, _LTV, + 2, () => exports.ListTypeVersionsInput$, () => exports.ListTypeVersionsOutput$ +]; +exports.PublishType$ = [9, n0, _PTu, + 2, () => exports.PublishTypeInput$, () => exports.PublishTypeOutput$ +]; +exports.RecordHandlerProgress$ = [9, n0, _RHP, + 2, () => exports.RecordHandlerProgressInput$, () => exports.RecordHandlerProgressOutput$ +]; +exports.RegisterPublisher$ = [9, n0, _RPeg, + 2, () => exports.RegisterPublisherInput$, () => exports.RegisterPublisherOutput$ +]; +exports.RegisterType$ = [9, n0, _RTegi, + 2, () => exports.RegisterTypeInput$, () => exports.RegisterTypeOutput$ +]; +exports.RollbackStack$ = [9, n0, _RSo, + 0, () => exports.RollbackStackInput$, () => exports.RollbackStackOutput$ +]; +exports.SetStackPolicy$ = [9, n0, _SSP, + 0, () => exports.SetStackPolicyInput$, () => __Unit +]; +exports.SetTypeConfiguration$ = [9, n0, _STC, + 0, () => exports.SetTypeConfigurationInput$, () => exports.SetTypeConfigurationOutput$ +]; +exports.SetTypeDefaultVersion$ = [9, n0, _STDV, + 2, () => exports.SetTypeDefaultVersionInput$, () => exports.SetTypeDefaultVersionOutput$ +]; +exports.SignalResource$ = [9, n0, _SRi, + 0, () => exports.SignalResourceInput$, () => __Unit +]; +exports.StartResourceScan$ = [9, n0, _SRStar, + 0, () => exports.StartResourceScanInput$, () => exports.StartResourceScanOutput$ +]; +exports.StopStackSetOperation$ = [9, n0, _SSSO, + 0, () => exports.StopStackSetOperationInput$, () => exports.StopStackSetOperationOutput$ +]; +exports.TestType$ = [9, n0, _TTe, + 2, () => exports.TestTypeInput$, () => exports.TestTypeOutput$ +]; +exports.UpdateGeneratedTemplate$ = [9, n0, _UGT, + 0, () => exports.UpdateGeneratedTemplateInput$, () => exports.UpdateGeneratedTemplateOutput$ +]; +exports.UpdateStack$ = [9, n0, _US, + 0, () => exports.UpdateStackInput$, () => exports.UpdateStackOutput$ +]; +exports.UpdateStackInstances$ = [9, n0, _USIp, + 0, () => exports.UpdateStackInstancesInput$, () => exports.UpdateStackInstancesOutput$ +]; +exports.UpdateStackSet$ = [9, n0, _USS, + 0, () => exports.UpdateStackSetInput$, () => exports.UpdateStackSetOutput$ +]; +exports.UpdateTerminationProtection$ = [9, n0, _UTP, + 0, () => exports.UpdateTerminationProtectionInput$, () => exports.UpdateTerminationProtectionOutput$ +]; +exports.ValidateTemplate$ = [9, n0, _VT, + 0, () => exports.ValidateTemplateInput$, () => exports.ValidateTemplateOutput$ +]; -const paginateListStackSets = core.createPaginator(CloudFormationClient, ListStackSetsCommand, "NextToken", "NextToken", "MaxResults"); -const paginateListStacks = core.createPaginator(CloudFormationClient, ListStacksCommand, "NextToken", "NextToken", ""); +/***/ }), -const paginateListTypeRegistrations = core.createPaginator(CloudFormationClient, ListTypeRegistrationsCommand, "NextToken", "NextToken", "MaxResults"); +/***/ 5522: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const paginateListTypeVersions = core.createPaginator(CloudFormationClient, ListTypeVersionsCommand, "NextToken", "NextToken", "MaxResults"); +"use strict"; -const paginateListTypes = core.createPaginator(CloudFormationClient, ListTypesCommand, "NextToken", "NextToken", "MaxResults"); -const checkState$9 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeChangeSetCommand(input)); - reason = result; - try { - const returnComparator = () => { - return result.Status; - }; - if (returnComparator() === "CREATE_COMPLETE") { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - return result.Status; - }; - if (returnComparator() === "FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - catch (e) { } - } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForChangeSetCreateComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$9); -}; -const waitUntilChangeSetCreateComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$9); - return utilWaiter.checkExceptions(result); -}; +var protocolHttp = __nccwpck_require__(2356); +var querystringBuilder = __nccwpck_require__(8256); +var http = __nccwpck_require__(8611); +var https = __nccwpck_require__(5692); +var stream = __nccwpck_require__(2203); +var http2 = __nccwpck_require__(5675); -const checkState$8 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeStacksCommand(input)); - reason = result; - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "CREATE_COMPLETE"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_COMPLETE"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_IN_PROGRESS"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_FAILED"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_ROLLBACK_IN_PROGRESS"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_ROLLBACK_FAILED"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_ROLLBACK_COMPLETE"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "CREATE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "DELETE_COMPLETE") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "DELETE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "ROLLBACK_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "ROLLBACK_COMPLETE") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } +function buildAbortError(abortSignal) { + const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal + ? abortSignal.reason + : undefined; + if (reason) { + if (reason instanceof Error) { + return reason; } - catch (e) { } + const abortError = new Error(String(reason)); + abortError.name = "AbortError"; + return abortError; } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return abortError; +} + +const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +const getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForStackCreateComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$8); + return transformedHeaders; }; -const waitUntilStackCreateComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$8); - return utilWaiter.checkExceptions(result); + +const timing = { + setTimeout: (cb, ms) => setTimeout(cb, ms), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), }; -const checkState$7 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeStacksCommand(input)); - reason = result; - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "DELETE_COMPLETE"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "DELETE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "CREATE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; +const DEFER_EVENT_LISTENER_TIME$2 = 1000; +const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return -1; + } + const registerTimeout = (offset) => { + const timeoutId = timing.setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { + name: "TimeoutError", + })); + }, timeoutInMs - offset); + const doWithSocket = (socket) => { + if (socket?.connecting) { + socket.on("connect", () => { + timing.clearTimeout(timeoutId); }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "ROLLBACK_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_ROLLBACK_IN_PROGRESS") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + else { + timing.clearTimeout(timeoutId); } + }; + if (request.socket) { + doWithSocket(request.socket); } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_ROLLBACK_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } + else { + request.on("socket", doWithSocket); } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; + }; + if (timeoutInMs < 2000) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2); +}; + +const setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => { + if (timeoutInMs) { + return timing.setTimeout(() => { + let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; + if (throwOnRequestTimeout) { + const error = Object.assign(new Error(msg), { + name: "TimeoutError", + code: "ETIMEDOUT", }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_ROLLBACK_COMPLETE") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + req.destroy(error); + reject(error); } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_COMPLETE") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + else { + msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; + logger?.warn?.(msg); } - } - catch (e) { } - } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } + }, timeoutInMs); } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForStackDeleteComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$7); -}; -const waitUntilStackDeleteComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$7); - return utilWaiter.checkExceptions(result); + return -1; }; -const checkState$6 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeStacksCommand(input)); - reason = result; - return { state: utilWaiter.WaiterState.SUCCESS, reason }; +const DEFER_EVENT_LISTENER_TIME$1 = 3000; +const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => { + if (keepAlive !== true) { + return -1; } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.RETRY, reason }; + const registerListener = () => { + if (request.socket) { + request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + } + else { + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); } + }; + if (deferTimeMs === 0) { + registerListener(); + return 0; } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForStackExists = async (params, input) => { - const serviceDefaults = { minDelay: 5, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$6); -}; -const waitUntilStackExists = async (params, input) => { - const serviceDefaults = { minDelay: 5, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$6); - return utilWaiter.checkExceptions(result); + return timing.setTimeout(registerListener, deferTimeMs); }; -const checkState$5 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeStacksCommand(input)); - reason = result; - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "IMPORT_COMPLETE"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "ROLLBACK_COMPLETE") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "ROLLBACK_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } +const DEFER_EVENT_LISTENER_TIME = 3000; +const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + const registerTimeout = (offset) => { + const timeout = timeoutInMs - offset; + const onTimeout = () => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); + }; + if (request.socket) { + request.socket.setTimeout(timeout, onTimeout); + request.on("close", () => request.socket?.removeListener("timeout", onTimeout)); } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "IMPORT_ROLLBACK_IN_PROGRESS") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } + else { + request.setTimeout(timeout, onTimeout); } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; + }; + if (0 < timeoutInMs && timeoutInMs < 6000) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); +}; + +const MIN_WAIT_TIME = 6_000; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { + const headers = request.headers ?? {}; + const expect = headers.Expect || headers.expect; + let timeoutId = -1; + let sendBody = true; + if (!externalAgent && expect === "100-continue") { + sendBody = await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + timing.clearTimeout(timeoutId); + resolve(true); }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "IMPORT_ROLLBACK_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; + httpRequest.on("response", () => { + timing.clearTimeout(timeoutId); + resolve(false); }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "IMPORT_ROLLBACK_COMPLETE") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } - } - } - catch (e) { } + httpRequest.on("error", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + }), + ]); } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + if (sendBody) { + writeBody(httpRequest, request.body); } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForStackImportComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$5); -}; -const waitUntilStackImportComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$5); - return utilWaiter.checkExceptions(result); -}; - -const checkState$4 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeStackRefactorCommand(input)); - reason = result; - try { - const returnComparator = () => { - return result.Status; - }; - if (returnComparator() === "CREATE_COMPLETE") { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; +} +function writeBody(httpRequest, body) { + if (body instanceof stream.Readable) { + body.pipe(httpRequest); + return; + } + if (body) { + const isBuffer = Buffer.isBuffer(body); + const isString = typeof body === "string"; + if (isBuffer || isString) { + if (isBuffer && body.byteLength === 0) { + httpRequest.end(); } - } - catch (e) { } - try { - const returnComparator = () => { - return result.Status; - }; - if (returnComparator() === "CREATE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + else { + httpRequest.end(body); } + return; } - catch (e) { } - } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + 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; } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForStackRefactorCreateComplete = async (params, input) => { - const serviceDefaults = { minDelay: 5, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$4); -}; -const waitUntilStackRefactorCreateComplete = async (params, input) => { - const serviceDefaults = { minDelay: 5, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$4); - return utilWaiter.checkExceptions(result); -}; + httpRequest.end(); +} -const checkState$3 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeStackRefactorCommand(input)); - reason = result; - try { - const returnComparator = () => { - return result.ExecutionStatus; - }; - if (returnComparator() === "EXECUTE_COMPLETE") { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } +const DEFAULT_REQUEST_TIMEOUT = 0; +class NodeHttpHandler { + config; + configProvider; + socketWarningTimestamp = 0; + externalAgent = false; + metadata = { handlerProtocol: "http/1.1" }; + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; } - catch (e) { } - try { - const returnComparator = () => { - return result.ExecutionStatus; - }; - if (returnComparator() === "EXECUTE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + return new NodeHttpHandler(instanceOrOptions); + } + static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; } - catch (e) { } - try { - const returnComparator = () => { - return result.ExecutionStatus; - }; - if (returnComparator() === "ROLLBACK_COMPLETE") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + const interval = 15_000; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; } - catch (e) { } - } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = sockets[origin]?.length ?? 0; + const requestsEnqueued = requests[origin]?.length ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + logger?.warn?.(`@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; } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForStackRefactorExecuteComplete = async (params, input) => { - const serviceDefaults = { minDelay: 15, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$3); -}; -const waitUntilStackRefactorExecuteComplete = async (params, input) => { - const serviceDefaults = { minDelay: 15, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$3); - return utilWaiter.checkExceptions(result); -}; - -const checkState$2 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeStacksCommand(input)); - reason = result; - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_ROLLBACK_COMPLETE"; + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }) + .catch(reject); } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; + else { + resolve(this.resolveDefaultConfig(options)); } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + }); + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout, + socketTimeout, + socketAcquisitionWarningTimeout, + throwOnRequestTimeout, + httpAgent: (() => { + if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") { + this.externalAgent = true; + return httpAgent; } - } + return new http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") { + this.externalAgent = true; + return httpsAgent; + } + return new https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })(), + logger, + }; + } + destroy() { + this.config?.httpAgent?.destroy(); + this.config?.httpsAgent?.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + if (!this.config) { + this.config = await this.configProvider; } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; + return new Promise((_resolve, _reject) => { + const config = this.config; + let writeRequestBodyPromise = undefined; + const timeouts = []; + const resolve = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _resolve(arg); }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_ROLLBACK_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + const reject = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _reject(arg); + }; + if (abortSignal?.aborted) { + const abortError = buildAbortError(abortSignal); + reject(abortError); + return; } - } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; + const isSSL = request.protocol === "https:"; + const headers = request.headers ?? {}; + const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; + let agent = isSSL ? config.httpsAgent : config.httpAgent; + if (expectContinue && !this.externalAgent) { + agent = new (isSSL ? https.Agent : http.Agent)({ + keepAlive: false, + maxSockets: Infinity, }); - return projection_3; + } + timeouts.push(timing.setTimeout(() => { + this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); + }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2000) + (config.connectionTimeout ?? 1000))); + const queryString = querystringBuilder.buildQueryString(request.query || {}); + let auth = undefined; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}`; + } + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + let hostname = request.hostname ?? ""; + if (hostname[0] === "[" && hostname.endsWith("]")) { + hostname = request.hostname.slice(1, -1); + } + else { + hostname = request.hostname; + } + const nodeHttpsOptions = { + headers: request.headers, + host: hostname, + method: request.method, + path, + port: request.port, + agent, + auth, }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "DELETE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + const requestFunc = isSSL ? https.request : http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocolHttp.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 = () => { + req.destroy(); + const abortError = buildAbortError(abortSignal); + reject(abortError); + }; + 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; } } - } - catch (e) { } + const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; + timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout)); + timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); + timeouts.push(setSocketTimeout(req, reject, config.socketTimeout)); + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + timeouts.push(setSocketKeepAlive(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs, + })); + } + writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e) => { + timeouts.forEach(timing.clearTimeout); + return _reject(e); + }); + }); } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForStackRollbackComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$2); -}; -const waitUntilStackRollbackComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$2); - return utilWaiter.checkExceptions(result); -}; + httpHandlerConfigs() { + return this.config ?? {}; + } +} -const checkState$1 = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeStacksCommand(input)); - reason = result; - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - let allStringEq_5 = returnComparator().length > 0; - for (const element_4 of returnComparator()) { - allStringEq_5 = allStringEq_5 && element_4 == "UPDATE_COMPLETE"; - } - if (allStringEq_5) { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } +class NodeHttp2ConnectionPool { + sessions = []; + constructor(sessions) { + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + } + 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(); } } } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_ROLLBACK_FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; - } + } +} + +class NodeHttp2ConnectionManager { + constructor(config) { + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + config; + sessionCache = new Map(); + lease(requestContext, connectionConfiguration) { + const url = this.getUrlString(requestContext); + const existingPool = this.sessionCache.get(url); + if (existingPool) { + const existingSession = existingPool.poll(); + if (existingSession && !this.config.disableConcurrency) { + return existingSession; } } - catch (e) { } - try { - const returnComparator = () => { - const flat_1 = [].concat(...result.Stacks); - const projection_3 = flat_1.map((element_2) => { - return element_2.StackStatus; - }); - return projection_3; - }; - for (const anyStringEq_4 of returnComparator()) { - if (anyStringEq_4 == "UPDATE_ROLLBACK_COMPLETE") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + const session = http2.connect(url); + 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()); } - } + }); } - catch (e) { } - } - catch (exception) { - reason = exception; - if (exception.name && exception.name == "ValidationError") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + session.unref(); + const destroySessionCb = () => { + session.destroy(); + this.deleteSession(url, session); + }; + session.on("goaway", destroySessionCb); + session.on("error", destroySessionCb); + session.on("frameError", destroySessionCb); + session.on("close", () => this.deleteSession(url, session)); + if (connectionConfiguration.requestTimeout) { + session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); } + const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool(); + connectionPool.offerLast(session); + this.sessionCache.set(url, connectionPool); + return session; } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForStackUpdateComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$1); -}; -const waitUntilStackUpdateComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$1); - return utilWaiter.checkExceptions(result); -}; - -const checkState = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeTypeRegistrationCommand(input)); - reason = result; - try { - const returnComparator = () => { - return result.ProgressStatus; - }; - if (returnComparator() === "COMPLETE") { - return { state: utilWaiter.WaiterState.SUCCESS, reason }; - } + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; } - catch (e) { } - try { - const returnComparator = () => { - return result.ProgressStatus; - }; - if (returnComparator() === "FAILED") { - return { state: utilWaiter.WaiterState.FAILURE, reason }; + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + const cacheKey = this.getUrlString(requestContext); + this.sessionCache.get(cacheKey)?.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); } - catch (e) { } } - catch (exception) { - reason = exception; + setMaxConcurrentStreams(maxConcurrentStreams) { + if (maxConcurrentStreams && maxConcurrentStreams <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; } - return { state: utilWaiter.WaiterState.RETRY, reason }; -}; -const waitForTypeRegistrationComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState); -}; -const waitUntilTypeRegistrationComplete = async (params, input) => { - const serviceDefaults = { minDelay: 30, maxDelay: 120 }; - const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState); - return utilWaiter.checkExceptions(result); -}; + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } +} -const AccountFilterType = { - DIFFERENCE: "DIFFERENCE", - INTERSECTION: "INTERSECTION", - NONE: "NONE", - UNION: "UNION", -}; -const AccountGateStatus = { - FAILED: "FAILED", - SKIPPED: "SKIPPED", - SUCCEEDED: "SUCCEEDED", -}; -const ThirdPartyType = { - HOOK: "HOOK", - MODULE: "MODULE", - RESOURCE: "RESOURCE", -}; -const VersionBump = { - MAJOR: "MAJOR", - MINOR: "MINOR", -}; -const AfterValueFrom = { - TEMPLATE: "TEMPLATE", -}; -const AnnotationSeverityLevel = { - CRITICAL: "CRITICAL", - HIGH: "HIGH", - INFORMATIONAL: "INFORMATIONAL", - LOW: "LOW", - MEDIUM: "MEDIUM", -}; -const AnnotationStatus = { - FAILED: "FAILED", - PASSED: "PASSED", - SKIPPED: "SKIPPED", -}; -const AttributeChangeType = { - Add: "Add", - Modify: "Modify", - Remove: "Remove", - SyncWithActual: "SyncWithActual", -}; -const BeaconStackOperationStatus = { - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", - SUCCEEDED: "SUCCEEDED", -}; -const BeforeValueFrom = { - ACTUAL_STATE: "ACTUAL_STATE", - PREVIOUS_DEPLOYMENT_STATE: "PREVIOUS_DEPLOYMENT_STATE", -}; -const CallAs = { - DELEGATED_ADMIN: "DELEGATED_ADMIN", - SELF: "SELF", -}; -const Capability = { - CAPABILITY_AUTO_EXPAND: "CAPABILITY_AUTO_EXPAND", - CAPABILITY_IAM: "CAPABILITY_IAM", - CAPABILITY_NAMED_IAM: "CAPABILITY_NAMED_IAM", -}; -const Category = { - ACTIVATED: "ACTIVATED", - AWS_TYPES: "AWS_TYPES", - REGISTERED: "REGISTERED", - THIRD_PARTY: "THIRD_PARTY", -}; -const ChangeAction = { - Add: "Add", - Dynamic: "Dynamic", - Import: "Import", - Modify: "Modify", - Remove: "Remove", - SyncWithActual: "SyncWithActual", -}; -const ChangeSource = { - Automatic: "Automatic", - DirectModification: "DirectModification", - NoModification: "NoModification", - ParameterReference: "ParameterReference", - ResourceAttribute: "ResourceAttribute", - ResourceReference: "ResourceReference", -}; -const EvaluationType = { - Dynamic: "Dynamic", - Static: "Static", -}; -const ResourceAttribute = { - CreationPolicy: "CreationPolicy", - DeletionPolicy: "DeletionPolicy", - Metadata: "Metadata", - Properties: "Properties", - Tags: "Tags", - UpdatePolicy: "UpdatePolicy", - UpdateReplacePolicy: "UpdateReplacePolicy", -}; -const RequiresRecreation = { - Always: "Always", - Conditionally: "Conditionally", - Never: "Never", -}; -const PolicyAction = { - Delete: "Delete", - ReplaceAndDelete: "ReplaceAndDelete", - ReplaceAndRetain: "ReplaceAndRetain", - ReplaceAndSnapshot: "ReplaceAndSnapshot", - Retain: "Retain", - Snapshot: "Snapshot", -}; -const Replacement = { - Conditional: "Conditional", - False: "False", - True: "True", -}; -const DriftIgnoredReason = { - MANAGED_BY_AWS: "MANAGED_BY_AWS", - WRITE_ONLY_PROPERTY: "WRITE_ONLY_PROPERTY", -}; -const StackResourceDriftStatus = { - DELETED: "DELETED", - IN_SYNC: "IN_SYNC", - MODIFIED: "MODIFIED", - NOT_CHECKED: "NOT_CHECKED", - UNKNOWN: "UNKNOWN", - UNSUPPORTED: "UNSUPPORTED", -}; -const ChangeType = { - Resource: "Resource", -}; -const HookFailureMode = { - FAIL: "FAIL", - WARN: "WARN", -}; -const HookInvocationPoint = { - PRE_PROVISION: "PRE_PROVISION", -}; -const HookTargetType = { - RESOURCE: "RESOURCE", -}; -const ChangeSetHooksStatus = { - PLANNED: "PLANNED", - PLANNING: "PLANNING", - UNAVAILABLE: "UNAVAILABLE", -}; -const ChangeSetStatus = { - CREATE_COMPLETE: "CREATE_COMPLETE", - CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", - CREATE_PENDING: "CREATE_PENDING", - DELETE_COMPLETE: "DELETE_COMPLETE", - DELETE_FAILED: "DELETE_FAILED", - DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", - DELETE_PENDING: "DELETE_PENDING", - FAILED: "FAILED", -}; -const ExecutionStatus = { - AVAILABLE: "AVAILABLE", - EXECUTE_COMPLETE: "EXECUTE_COMPLETE", - EXECUTE_FAILED: "EXECUTE_FAILED", - EXECUTE_IN_PROGRESS: "EXECUTE_IN_PROGRESS", - OBSOLETE: "OBSOLETE", - UNAVAILABLE: "UNAVAILABLE", -}; -const ChangeSetType = { - CREATE: "CREATE", - IMPORT: "IMPORT", - UPDATE: "UPDATE", -}; -const DeploymentMode = { - REVERT_DRIFT: "REVERT_DRIFT", -}; -const OnStackFailure = { - DELETE: "DELETE", - DO_NOTHING: "DO_NOTHING", - ROLLBACK: "ROLLBACK", -}; -const GeneratedTemplateDeletionPolicy = { - DELETE: "DELETE", - RETAIN: "RETAIN", -}; -const GeneratedTemplateUpdateReplacePolicy = { - DELETE: "DELETE", - RETAIN: "RETAIN", -}; -const OnFailure = { - DELETE: "DELETE", - DO_NOTHING: "DO_NOTHING", - ROLLBACK: "ROLLBACK", -}; -const ConcurrencyMode = { - SOFT_FAILURE_TOLERANCE: "SOFT_FAILURE_TOLERANCE", - STRICT_FAILURE_TOLERANCE: "STRICT_FAILURE_TOLERANCE", -}; -const RegionConcurrencyType = { - PARALLEL: "PARALLEL", - SEQUENTIAL: "SEQUENTIAL", -}; -const PermissionModels = { - SELF_MANAGED: "SELF_MANAGED", - SERVICE_MANAGED: "SERVICE_MANAGED", -}; -const DeletionMode = { - FORCE_DELETE_STACK: "FORCE_DELETE_STACK", - STANDARD: "STANDARD", -}; -const RegistryType = { - HOOK: "HOOK", - MODULE: "MODULE", - RESOURCE: "RESOURCE", -}; -const StackDriftStatus = { - DRIFTED: "DRIFTED", - IN_SYNC: "IN_SYNC", - NOT_CHECKED: "NOT_CHECKED", - UNKNOWN: "UNKNOWN", -}; -const DetailedStatus = { - CONFIGURATION_COMPLETE: "CONFIGURATION_COMPLETE", - VALIDATION_FAILED: "VALIDATION_FAILED", -}; -const EventType = { - HOOK_INVOCATION_ERROR: "HOOK_INVOCATION_ERROR", - PROGRESS_EVENT: "PROGRESS_EVENT", - PROVISIONING_ERROR: "PROVISIONING_ERROR", - STACK_EVENT: "STACK_EVENT", - VALIDATION_ERROR: "VALIDATION_ERROR", -}; -const HookStatus = { - HOOK_COMPLETE_FAILED: "HOOK_COMPLETE_FAILED", - HOOK_COMPLETE_SUCCEEDED: "HOOK_COMPLETE_SUCCEEDED", - HOOK_FAILED: "HOOK_FAILED", - HOOK_IN_PROGRESS: "HOOK_IN_PROGRESS", -}; -const OperationType = { - CONTINUE_ROLLBACK: "CONTINUE_ROLLBACK", - CREATE_CHANGESET: "CREATE_CHANGESET", - CREATE_STACK: "CREATE_STACK", - DELETE_STACK: "DELETE_STACK", - ROLLBACK: "ROLLBACK", - UPDATE_STACK: "UPDATE_STACK", -}; -const ResourceStatus = { - CREATE_COMPLETE: "CREATE_COMPLETE", - CREATE_FAILED: "CREATE_FAILED", - CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", - DELETE_COMPLETE: "DELETE_COMPLETE", - DELETE_FAILED: "DELETE_FAILED", - DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", - DELETE_SKIPPED: "DELETE_SKIPPED", - EXPORT_COMPLETE: "EXPORT_COMPLETE", - EXPORT_FAILED: "EXPORT_FAILED", - EXPORT_IN_PROGRESS: "EXPORT_IN_PROGRESS", - EXPORT_ROLLBACK_COMPLETE: "EXPORT_ROLLBACK_COMPLETE", - EXPORT_ROLLBACK_FAILED: "EXPORT_ROLLBACK_FAILED", - EXPORT_ROLLBACK_IN_PROGRESS: "EXPORT_ROLLBACK_IN_PROGRESS", - IMPORT_COMPLETE: "IMPORT_COMPLETE", - IMPORT_FAILED: "IMPORT_FAILED", - IMPORT_IN_PROGRESS: "IMPORT_IN_PROGRESS", - IMPORT_ROLLBACK_COMPLETE: "IMPORT_ROLLBACK_COMPLETE", - IMPORT_ROLLBACK_FAILED: "IMPORT_ROLLBACK_FAILED", - IMPORT_ROLLBACK_IN_PROGRESS: "IMPORT_ROLLBACK_IN_PROGRESS", - ROLLBACK_COMPLETE: "ROLLBACK_COMPLETE", - ROLLBACK_FAILED: "ROLLBACK_FAILED", - ROLLBACK_IN_PROGRESS: "ROLLBACK_IN_PROGRESS", - UPDATE_COMPLETE: "UPDATE_COMPLETE", - UPDATE_FAILED: "UPDATE_FAILED", - UPDATE_IN_PROGRESS: "UPDATE_IN_PROGRESS", - UPDATE_ROLLBACK_COMPLETE: "UPDATE_ROLLBACK_COMPLETE", - UPDATE_ROLLBACK_FAILED: "UPDATE_ROLLBACK_FAILED", - UPDATE_ROLLBACK_IN_PROGRESS: "UPDATE_ROLLBACK_IN_PROGRESS", -}; -const ValidationStatus = { - FAILED: "FAILED", - SKIPPED: "SKIPPED", -}; -const GeneratedTemplateResourceStatus = { - COMPLETE: "COMPLETE", - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", - PENDING: "PENDING", -}; -const WarningType = { - EXCLUDED_PROPERTIES: "EXCLUDED_PROPERTIES", - EXCLUDED_RESOURCES: "EXCLUDED_RESOURCES", - MUTUALLY_EXCLUSIVE_PROPERTIES: "MUTUALLY_EXCLUSIVE_PROPERTIES", - MUTUALLY_EXCLUSIVE_TYPES: "MUTUALLY_EXCLUSIVE_TYPES", - UNSUPPORTED_PROPERTIES: "UNSUPPORTED_PROPERTIES", -}; -const GeneratedTemplateStatus = { - COMPLETE: "COMPLETE", - CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", - CREATE_PENDING: "CREATE_PENDING", - DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", - DELETE_PENDING: "DELETE_PENDING", - FAILED: "FAILED", - UPDATE_IN_PROGRESS: "UPDATE_IN_PROGRESS", - UPDATE_PENDING: "UPDATE_PENDING", -}; -const OrganizationStatus = { - DISABLED: "DISABLED", - DISABLED_PERMANENTLY: "DISABLED_PERMANENTLY", - ENABLED: "ENABLED", -}; -const IdentityProvider = { - AWS_Marketplace: "AWS_Marketplace", - Bitbucket: "Bitbucket", - GitHub: "GitHub", -}; -const PublisherStatus = { - UNVERIFIED: "UNVERIFIED", - VERIFIED: "VERIFIED", -}; -const ResourceScanStatus = { - COMPLETE: "COMPLETE", - EXPIRED: "EXPIRED", - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", -}; -const StackDriftDetectionStatus = { - DETECTION_COMPLETE: "DETECTION_COMPLETE", - DETECTION_FAILED: "DETECTION_FAILED", - DETECTION_IN_PROGRESS: "DETECTION_IN_PROGRESS", -}; -const StackInstanceDetailedStatus = { - CANCELLED: "CANCELLED", - FAILED: "FAILED", - FAILED_IMPORT: "FAILED_IMPORT", - INOPERABLE: "INOPERABLE", - PENDING: "PENDING", - RUNNING: "RUNNING", - SKIPPED_SUSPENDED_ACCOUNT: "SKIPPED_SUSPENDED_ACCOUNT", - SUCCEEDED: "SUCCEEDED", -}; -const StackInstanceStatus = { - CURRENT: "CURRENT", - INOPERABLE: "INOPERABLE", - OUTDATED: "OUTDATED", -}; -const StackRefactorExecutionStatus = { - AVAILABLE: "AVAILABLE", - EXECUTE_COMPLETE: "EXECUTE_COMPLETE", - EXECUTE_FAILED: "EXECUTE_FAILED", - EXECUTE_IN_PROGRESS: "EXECUTE_IN_PROGRESS", - OBSOLETE: "OBSOLETE", - ROLLBACK_COMPLETE: "ROLLBACK_COMPLETE", - ROLLBACK_FAILED: "ROLLBACK_FAILED", - ROLLBACK_IN_PROGRESS: "ROLLBACK_IN_PROGRESS", - UNAVAILABLE: "UNAVAILABLE", -}; -const StackRefactorStatus = { - CREATE_COMPLETE: "CREATE_COMPLETE", - CREATE_FAILED: "CREATE_FAILED", - CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", - DELETE_COMPLETE: "DELETE_COMPLETE", - DELETE_FAILED: "DELETE_FAILED", - DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", -}; -const DifferenceType = { - ADD: "ADD", - NOT_EQUAL: "NOT_EQUAL", - REMOVE: "REMOVE", -}; -const StackStatus = { - CREATE_COMPLETE: "CREATE_COMPLETE", - CREATE_FAILED: "CREATE_FAILED", - CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", - DELETE_COMPLETE: "DELETE_COMPLETE", - DELETE_FAILED: "DELETE_FAILED", - DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", - IMPORT_COMPLETE: "IMPORT_COMPLETE", - IMPORT_IN_PROGRESS: "IMPORT_IN_PROGRESS", - IMPORT_ROLLBACK_COMPLETE: "IMPORT_ROLLBACK_COMPLETE", - IMPORT_ROLLBACK_FAILED: "IMPORT_ROLLBACK_FAILED", - IMPORT_ROLLBACK_IN_PROGRESS: "IMPORT_ROLLBACK_IN_PROGRESS", - REVIEW_IN_PROGRESS: "REVIEW_IN_PROGRESS", - ROLLBACK_COMPLETE: "ROLLBACK_COMPLETE", - ROLLBACK_FAILED: "ROLLBACK_FAILED", - ROLLBACK_IN_PROGRESS: "ROLLBACK_IN_PROGRESS", - UPDATE_COMPLETE: "UPDATE_COMPLETE", - UPDATE_COMPLETE_CLEANUP_IN_PROGRESS: "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS", - UPDATE_FAILED: "UPDATE_FAILED", - UPDATE_IN_PROGRESS: "UPDATE_IN_PROGRESS", - UPDATE_ROLLBACK_COMPLETE: "UPDATE_ROLLBACK_COMPLETE", - UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS: "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS", - UPDATE_ROLLBACK_FAILED: "UPDATE_ROLLBACK_FAILED", - UPDATE_ROLLBACK_IN_PROGRESS: "UPDATE_ROLLBACK_IN_PROGRESS", -}; -const StackSetDriftDetectionStatus = { - COMPLETED: "COMPLETED", - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", - PARTIAL_SUCCESS: "PARTIAL_SUCCESS", - STOPPED: "STOPPED", -}; -const StackSetDriftStatus = { - DRIFTED: "DRIFTED", - IN_SYNC: "IN_SYNC", - NOT_CHECKED: "NOT_CHECKED", -}; -const StackSetStatus = { - ACTIVE: "ACTIVE", - DELETED: "DELETED", -}; -const StackSetOperationAction = { - CREATE: "CREATE", - DELETE: "DELETE", - DETECT_DRIFT: "DETECT_DRIFT", - UPDATE: "UPDATE", -}; -const StackSetOperationStatus = { - FAILED: "FAILED", - QUEUED: "QUEUED", - RUNNING: "RUNNING", - STOPPED: "STOPPED", - STOPPING: "STOPPING", - SUCCEEDED: "SUCCEEDED", -}; -const DeprecatedStatus = { - DEPRECATED: "DEPRECATED", - LIVE: "LIVE", -}; -const ProvisioningType = { - FULLY_MUTABLE: "FULLY_MUTABLE", - IMMUTABLE: "IMMUTABLE", - NON_PROVISIONABLE: "NON_PROVISIONABLE", -}; -const TypeTestsStatus = { - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", - NOT_TESTED: "NOT_TESTED", - PASSED: "PASSED", -}; -const Visibility = { - PRIVATE: "PRIVATE", - PUBLIC: "PUBLIC", -}; -const RegistrationStatus = { - COMPLETE: "COMPLETE", - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", +class NodeHttp2Handler { + config; + configProvider; + metadata = { handlerProtocol: "h2" }; + connectionManager = new NodeHttp2ConnectionManager({}); + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new NodeHttp2Handler(instanceOrOptions); + } + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((opts) => { + resolve(opts || {}); + }) + .catch(reject); + } + else { + resolve(options || {}); + } + }); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + 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: configRequestTimeout, disableConcurrentStreams } = this.config; + const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; + return new Promise((_resolve, _reject) => { + let fulfilled = false; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal?.aborted) { + fulfilled = true; + const abortError = buildAbortError(abortSignal); + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = request; + let auth = ""; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}@`; + } + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: this.config?.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false, + }); + const rejectWithDestroy = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }; + const queryString = querystringBuilder.buildQueryString(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [http2.constants.HTTP2_HEADER_PATH]: path, + [http2.constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocolHttp.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 (effectiveRequestTimeout) { + req.setTimeout(effectiveRequestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + const onAbort = () => { + req.close(); + const abortError = buildAbortError(abortSignal); + rejectWithDestroy(abortError); + }; + 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, request, effectiveRequestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } +} + +class Collector extends stream.Writable { + bufferedBytes = []; + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +} + +const streamCollector = (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); + }); + }); }; -const TemplateFormat = { - JSON: "JSON", - YAML: "YAML", +const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream; +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; +} + +exports.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; +exports.NodeHttp2Handler = NodeHttp2Handler; +exports.NodeHttpHandler = NodeHttpHandler; +exports.streamCollector = streamCollector; + + +/***/ }), + +/***/ 8704: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var protocolHttp = __nccwpck_require__(2356); +var core = __nccwpck_require__(402); +var propertyProvider = __nccwpck_require__(8857); +var client = __nccwpck_require__(5152); +var signatureV4 = __nccwpck_require__(5118); +var cbor = __nccwpck_require__(4645); +var schema = __nccwpck_require__(6890); +var smithyClient = __nccwpck_require__(1411); +var protocols = __nccwpck_require__(3422); +var serde = __nccwpck_require__(2430); +var utilBase64 = __nccwpck_require__(8385); +var utilUtf8 = __nccwpck_require__(1577); +var xmlBuilder = __nccwpck_require__(4274); + +const state = { + warningEmitted: false, }; -const HookTargetAction = { - CREATE: "CREATE", - DELETE: "DELETE", - IMPORT: "IMPORT", - UPDATE: "UPDATE", +const emitWarningIfUnsupportedVersion = (version) => { + if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) { + state.warningEmitted = true; + process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will +no longer support Node.js ${version} in January 2026. + +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/c895JFp`); + } }; -const TemplateStage = { - Original: "Original", - Processed: "Processed", + +function setCredentialFeature(credentials, feature, value) { + if (!credentials.$source) { + credentials.$source = {}; + } + credentials.$source[feature] = value; + return credentials; +} + +function setFeature(context, feature, value) { + if (!context.__aws_sdk_context) { + context.__aws_sdk_context = { + features: {}, + }; + } + else if (!context.__aws_sdk_context.features) { + context.__aws_sdk_context.features = {}; + } + context.__aws_sdk_context.features[feature] = value; +} + +function setTokenFeature(token, feature, value) { + if (!token.$source) { + token.$source = {}; + } + token.$source[feature] = value; + return token; +} + +const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined; + +const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); + +const isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000; + +const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); + } + return currentSystemClockOffset; }; -const ListHookResultsTargetType = { - CHANGE_SET: "CHANGE_SET", - CLOUD_CONTROL: "CLOUD_CONTROL", - RESOURCE: "RESOURCE", - STACK: "STACK", + +const throwSigningPropertyError = (name, property) => { + if (!property) { + throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); + } + return property; }; -const ScanType = { - FULL: "FULL", - PARTIAL: "PARTIAL", +const 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, + }; }; -const StackInstanceFilterName = { - DETAILED_STATUS: "DETAILED_STATUS", - DRIFT_STATUS: "DRIFT_STATUS", - LAST_OPERATION_ID: "LAST_OPERATION_ID", +class AwsSdkSigV4Signer { + async sign(httpRequest, identity, signingProperties) { + if (!protocolHttp.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: 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; + }; + } + successHandler(httpResponse, signingProperties) { + const dateHeader = getDateHeader(httpResponse); + if (dateHeader) { + const config = throwSigningPropertyError("config", signingProperties.config); + config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); + } + } +} +const AWSSDKSigV4Signer = AwsSdkSigV4Signer; + +class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer { + async sign(httpRequest, identity, signingProperties) { + if (!protocolHttp.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; + } +} + +const getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; + +const getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; + +const NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; +const NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; +const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { + environmentVariableSelector: (env, options) => { + if (options?.signingName) { + const bearerTokenKey = getBearerTokenEnvKey(options.signingName); + if (bearerTokenKey in env) + return ["httpBearerAuth"]; + } + if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) + return undefined; + return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); + }, + configFileSelector: (profile) => { + if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) + return undefined; + return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); + }, + default: [], }; -const StackRefactorActionType = { - CREATE: "CREATE", - MOVE: "MOVE", + +const resolveAwsSdkSigV4AConfig = (config) => { + config.sigv4aSigningRegionSet = core.normalizeProvider(config.sigv4aSigningRegionSet); + return config; }; -const StackRefactorDetection = { - AUTO: "AUTO", - MANUAL: "MANUAL", +const 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 propertyProvider.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 propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", { + tryNextLink: true, + }); + }, + default: undefined, }; -const StackRefactorActionEntity = { - RESOURCE: "RESOURCE", - STACK: "STACK", + +const resolveAwsSdkSigV4Config = (config) => { + let inputCredentials = config.credentials; + let isUserSupplied = !!config.credentials; + let resolvedCredentials = undefined; + Object.defineProperty(config, "credentials", { + set(credentials) { + if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { + isUserSupplied = true; + } + inputCredentials = credentials; + const memoizedProvider = normalizeCredentialProvider(config, { + credentials: inputCredentials, + credentialDefaultProvider: config.credentialDefaultProvider, + }); + const boundProvider = bindCallerConfig(config, memoizedProvider); + if (isUserSupplied && !boundProvider.attributed) { + const isCredentialObject = typeof inputCredentials === "object" && inputCredentials !== null; + resolvedCredentials = async (options) => { + const creds = await boundProvider(options); + const attributedCreds = creds; + if (isCredentialObject && (!attributedCreds.$source || Object.keys(attributedCreds.$source).length === 0)) { + return client.setCredentialFeature(attributedCreds, "CREDENTIALS_CODE", "e"); + } + return attributedCreds; + }; + resolvedCredentials.memoized = boundProvider.memoized; + resolvedCredentials.configBound = boundProvider.configBound; + resolvedCredentials.attributed = true; + } + else { + resolvedCredentials = boundProvider; + } + }, + get() { + return resolvedCredentials; + }, + enumerable: true, + configurable: true, + }); + config.credentials = inputCredentials; + const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config; + let signer; + if (config.signer) { + signer = core.normalizeProvider(config.signer); + } + else if (config.regionInfoProvider) { + signer = () => core.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: config.credentials, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = config.signerConstructor || signatureV4.SignatureV4; + return new SignerCtor(params); + }); + } + else { + signer = async (authScheme) => { + authScheme = Object.assign({}, { + name: "sigv4", + signingName: config.signingName || config.defaultSigningName, + signingRegion: await core.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: config.credentials, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = config.signerConstructor || signatureV4.SignatureV4; + return new SignerCtor(params); + }; + } + const resolvedConfig = Object.assign(config, { + systemClockOffset, + signingEscapePath, + signer, + }); + return resolvedConfig; }; -const OperationResultFilterName = { - OPERATION_RESULT_STATUS: "OPERATION_RESULT_STATUS", +const resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; +function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider, }) { + let credentialsProvider; + if (credentials) { + if (!credentials?.memoized) { + credentialsProvider = core.memoizeIdentityProvider(credentials, core.isIdentityExpired, core.doesIdentityRequireRefresh); + } + else { + credentialsProvider = credentials; + } + } + else { + if (credentialDefaultProvider) { + credentialsProvider = core.normalizeProvider(credentialDefaultProvider(Object.assign({}, config, { + parentClientConfig: config, + }))); + } + else { + credentialsProvider = async () => { + throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured."); + }; + } + } + credentialsProvider.memoized = true; + return credentialsProvider; +} +function bindCallerConfig(config, credentialsProvider) { + if (credentialsProvider.configBound) { + return credentialsProvider; + } + const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config }); + fn.memoized = credentialsProvider.memoized; + fn.configBound = true; + return fn; +} + +class ProtocolLib { + queryCompat; + constructor(queryCompat = false) { + this.queryCompat = queryCompat; + } + resolveRestContentType(defaultContentType, inputSchema) { + const members = inputSchema.getMemberSchemas(); + const httpPayloadMember = Object.values(members).find((m) => { + return !!m.getMergedTraits().httpPayload; + }); + if (httpPayloadMember) { + const mediaType = httpPayloadMember.getMergedTraits().mediaType; + if (mediaType) { + return mediaType; + } + else if (httpPayloadMember.isStringSchema()) { + return "text/plain"; + } + else if (httpPayloadMember.isBlobSchema()) { + return "application/octet-stream"; + } + else { + return defaultContentType; + } + } + else if (!inputSchema.isUnitSchema()) { + const hasBody = Object.values(members).find((m) => { + const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m.getMergedTraits(); + const noPrefixHeaders = httpPrefixHeaders === void 0; + return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders; + }); + if (hasBody) { + return defaultContentType; + } + } + } + async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) { + let namespace = defaultNamespace; + let errorName = errorIdentifier; + if (errorIdentifier.includes("#")) { + [namespace, errorName] = errorIdentifier.split("#"); + } + const errorMetadata = { + $metadata: metadata, + $fault: response.statusCode < 500 ? "client" : "server", + }; + const registry = schema.TypeRegistry.for(namespace); + try { + const errorSchema = getErrorSchema?.(registry, errorName) ?? registry.getSchema(errorIdentifier); + return { errorSchema, errorMetadata }; + } + catch (e) { + dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError"; + const synthetic = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); + const baseExceptionSchema = synthetic.getBaseException(); + if (baseExceptionSchema) { + const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error; + throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject); + } + throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject); + } + } + decorateServiceException(exception, additions = {}) { + if (this.queryCompat) { + const msg = exception.Message ?? additions.Message; + const error = smithyClient.decorateServiceException(exception, additions); + if (msg) { + error.message = msg; + } + error.Error = { + ...error.Error, + Type: error.Error?.Type, + Code: error.Error?.Code, + Message: error.Error?.message ?? error.Error?.Message ?? msg, + }; + const reqId = error.$metadata.requestId; + if (reqId) { + error.RequestId = reqId; + } + return error; + } + return smithyClient.decorateServiceException(exception, additions); + } + setQueryCompatError(output, response) { + const queryErrorHeader = response.headers?.["x-amzn-query-error"]; + if (output !== undefined && queryErrorHeader != null) { + const [Code, Type] = queryErrorHeader.split(";"); + const entries = Object.entries(output); + const Error = { + Code, + Type, + }; + Object.assign(output, Error); + for (const [k, v] of entries) { + Error[k === "message" ? "Message" : k] = v; + } + delete Error.__type; + output.Error = Error; + } + } + queryCompatOutput(queryCompatErrorData, errorData) { + if (queryCompatErrorData.Error) { + errorData.Error = queryCompatErrorData.Error; + } + if (queryCompatErrorData.Type) { + errorData.Type = queryCompatErrorData.Type; + } + if (queryCompatErrorData.Code) { + errorData.Code = queryCompatErrorData.Code; + } + } + findQueryCompatibleError(registry, errorName) { + try { + return registry.getSchema(errorName); + } + catch (e) { + return registry.find((schema$1) => schema.NormalizedSchema.of(schema$1).getMergedTraits().awsQueryError?.[0] === errorName); + } + } +} + +class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol { + awsQueryCompatible; + mixin; + constructor({ defaultNamespace, awsQueryCompatible, }) { + super({ defaultNamespace }); + this.awsQueryCompatible = !!awsQueryCompatible; + this.mixin = new ProtocolLib(this.awsQueryCompatible); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + if (this.awsQueryCompatible) { + request.headers["x-amzn-query-mode"] = "true"; + } + return request; + } + async handleError(operationSchema, context, response, dataObject, metadata) { + if (this.awsQueryCompatible) { + this.mixin.setQueryCompatError(dataObject, response); + } + const errorName = (() => { + const compatHeader = response.headers["x-amzn-query-error"]; + if (compatHeader && this.awsQueryCompatible) { + return compatHeader.split(";")[0]; + } + return cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; + })(); + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined); + const ns = schema.NormalizedSchema.of(errorSchema); + const message = dataObject.message ?? dataObject.Message ?? "Unknown"; + const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message); + const output = {}; + for (const [name, member] of ns.structIterator()) { + if (dataObject[name] != null) { + output[name] = this.deserializer.readValue(member, dataObject[name]); + } + } + if (this.awsQueryCompatible) { + this.mixin.queryCompatOutput(dataObject, output); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message, + }, output), dataObject); + } +} + +const _toStr = (val) => { + if (val == null) { + return val; + } + if (typeof val === "number" || typeof val === "bigint") { + const warning = new Error(`Received number ${val} where a string was expected.`); + warning.name = "Warning"; + console.warn(warning); + return String(val); + } + if (typeof val === "boolean") { + const warning = new Error(`Received boolean ${val} where a string was expected.`); + warning.name = "Warning"; + console.warn(warning); + return String(val); + } + return val; }; -const StackSetOperationResultStatus = { - CANCELLED: "CANCELLED", - FAILED: "FAILED", - PENDING: "PENDING", - RUNNING: "RUNNING", - SUCCEEDED: "SUCCEEDED", +const _toBool = (val) => { + if (val == null) { + return val; + } + if (typeof val === "string") { + const lowercase = val.toLowerCase(); + if (val !== "" && lowercase !== "false" && lowercase !== "true") { + const warning = new Error(`Received string "${val}" where a boolean was expected.`); + warning.name = "Warning"; + console.warn(warning); + } + return val !== "" && lowercase !== "false"; + } + return val; }; -const OperationStatus = { - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", - PENDING: "PENDING", - SUCCESS: "SUCCESS", +const _toNum = (val) => { + if (val == null) { + return val; + } + if (typeof val === "string") { + const num = Number(val); + if (num.toString() !== val) { + const warning = new Error(`Received string "${val}" where a number was expected.`); + warning.name = "Warning"; + console.warn(warning); + return val; + } + return num; + } + return val; }; -const HandlerErrorCode = { - AccessDenied: "AccessDenied", - AlreadyExists: "AlreadyExists", - GeneralServiceException: "GeneralServiceException", - HandlerInternalFailure: "HandlerInternalFailure", - InternalFailure: "InternalFailure", - InvalidCredentials: "InvalidCredentials", - InvalidRequest: "InvalidRequest", - InvalidTypeConfiguration: "InvalidTypeConfiguration", - NetworkFailure: "NetworkFailure", - NonCompliant: "NonCompliant", - NotFound: "NotFound", - NotUpdatable: "NotUpdatable", - ResourceConflict: "ResourceConflict", - ServiceInternalError: "ServiceInternalError", - ServiceLimitExceeded: "ServiceLimitExceeded", - ServiceTimeout: "NotStabilized", - Throttling: "Throttling", - Unknown: "Unknown", - UnsupportedTarget: "UnsupportedTarget", + +class SerdeContextConfig { + serdeContext; + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + } +} + +class UnionSerde { + from; + to; + keys; + constructor(from, to) { + this.from = from; + this.to = to; + this.keys = new Set(Object.keys(this.from).filter((k) => k !== "__type")); + } + mark(key) { + this.keys.delete(key); + } + hasUnknown() { + return this.keys.size === 1 && Object.keys(this.to).length === 0; + } + writeUnknown() { + if (this.hasUnknown()) { + const k = this.keys.values().next().value; + const v = this.from[k]; + this.to.$unknown = [k, v]; + } + } +} + +function jsonReviver(key, value, context) { + if (context?.source) { + const numericString = context.source; + if (typeof value === "number") { + if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) { + const isFractional = numericString.includes("."); + if (isFractional) { + return new serde.NumericValue(numericString, "bigDecimal"); + } + else { + return BigInt(numericString); + } + } + } + } + return value; +} + +const collectBodyString = (streamBody, context) => smithyClient.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? utilUtf8.toUtf8)(body)); + +const 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 {}; +}); +const parseJsonErrorBody = async (errorBody, context) => { + const value = await parseJsonBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; }; -const ResourceSignalStatus = { - FAILURE: "FAILURE", - SUCCESS: "SUCCESS", +const 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 !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data && typeof data === "object") { + const codeKey = findKey(data, "code"); + if (codeKey && data[codeKey] !== undefined) { + return sanitizeErrorCode(data[codeKey]); + } + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + } }; -Object.defineProperty(exports, "$Command", ({ - enumerable: true, - get: function () { return smithyClient.Command; } -})); -Object.defineProperty(exports, "__Client", ({ - enumerable: true, - get: function () { return smithyClient.Client; } -})); -exports.AccountFilterType = AccountFilterType; -exports.AccountGateStatus = AccountGateStatus; -exports.ActivateOrganizationsAccessCommand = ActivateOrganizationsAccessCommand; -exports.ActivateTypeCommand = ActivateTypeCommand; -exports.AfterValueFrom = AfterValueFrom; -exports.AlreadyExistsException = AlreadyExistsException$1; -exports.AnnotationSeverityLevel = AnnotationSeverityLevel; -exports.AnnotationStatus = AnnotationStatus; -exports.AttributeChangeType = AttributeChangeType; -exports.BatchDescribeTypeConfigurationsCommand = BatchDescribeTypeConfigurationsCommand; -exports.BeaconStackOperationStatus = BeaconStackOperationStatus; -exports.BeforeValueFrom = BeforeValueFrom; -exports.CFNRegistryException = CFNRegistryException$1; -exports.CallAs = CallAs; -exports.CancelUpdateStackCommand = CancelUpdateStackCommand; -exports.Capability = Capability; -exports.Category = Category; -exports.ChangeAction = ChangeAction; -exports.ChangeSetHooksStatus = ChangeSetHooksStatus; -exports.ChangeSetNotFoundException = ChangeSetNotFoundException$1; -exports.ChangeSetStatus = ChangeSetStatus; -exports.ChangeSetType = ChangeSetType; -exports.ChangeSource = ChangeSource; -exports.ChangeType = ChangeType; -exports.CloudFormation = CloudFormation; -exports.CloudFormationClient = CloudFormationClient; -exports.CloudFormationServiceException = CloudFormationServiceException$1; -exports.ConcurrencyMode = ConcurrencyMode; -exports.ConcurrentResourcesLimitExceededException = ConcurrentResourcesLimitExceededException$1; -exports.ContinueUpdateRollbackCommand = ContinueUpdateRollbackCommand; -exports.CreateChangeSetCommand = CreateChangeSetCommand; -exports.CreateGeneratedTemplateCommand = CreateGeneratedTemplateCommand; -exports.CreateStackCommand = CreateStackCommand; -exports.CreateStackInstancesCommand = CreateStackInstancesCommand; -exports.CreateStackRefactorCommand = CreateStackRefactorCommand; -exports.CreateStackSetCommand = CreateStackSetCommand; -exports.CreatedButModifiedException = CreatedButModifiedException$1; -exports.DeactivateOrganizationsAccessCommand = DeactivateOrganizationsAccessCommand; -exports.DeactivateTypeCommand = DeactivateTypeCommand; -exports.DeleteChangeSetCommand = DeleteChangeSetCommand; -exports.DeleteGeneratedTemplateCommand = DeleteGeneratedTemplateCommand; -exports.DeleteStackCommand = DeleteStackCommand; -exports.DeleteStackInstancesCommand = DeleteStackInstancesCommand; -exports.DeleteStackSetCommand = DeleteStackSetCommand; -exports.DeletionMode = DeletionMode; -exports.DeploymentMode = DeploymentMode; -exports.DeprecatedStatus = DeprecatedStatus; -exports.DeregisterTypeCommand = DeregisterTypeCommand; -exports.DescribeAccountLimitsCommand = DescribeAccountLimitsCommand; -exports.DescribeChangeSetCommand = DescribeChangeSetCommand; -exports.DescribeChangeSetHooksCommand = DescribeChangeSetHooksCommand; -exports.DescribeEventsCommand = DescribeEventsCommand; -exports.DescribeGeneratedTemplateCommand = DescribeGeneratedTemplateCommand; -exports.DescribeOrganizationsAccessCommand = DescribeOrganizationsAccessCommand; -exports.DescribePublisherCommand = DescribePublisherCommand; -exports.DescribeResourceScanCommand = DescribeResourceScanCommand; -exports.DescribeStackDriftDetectionStatusCommand = DescribeStackDriftDetectionStatusCommand; -exports.DescribeStackEventsCommand = DescribeStackEventsCommand; -exports.DescribeStackInstanceCommand = DescribeStackInstanceCommand; -exports.DescribeStackRefactorCommand = DescribeStackRefactorCommand; -exports.DescribeStackResourceCommand = DescribeStackResourceCommand; -exports.DescribeStackResourceDriftsCommand = DescribeStackResourceDriftsCommand; -exports.DescribeStackResourcesCommand = DescribeStackResourcesCommand; -exports.DescribeStackSetCommand = DescribeStackSetCommand; -exports.DescribeStackSetOperationCommand = DescribeStackSetOperationCommand; -exports.DescribeStacksCommand = DescribeStacksCommand; -exports.DescribeTypeCommand = DescribeTypeCommand; -exports.DescribeTypeRegistrationCommand = DescribeTypeRegistrationCommand; -exports.DetailedStatus = DetailedStatus; -exports.DetectStackDriftCommand = DetectStackDriftCommand; -exports.DetectStackResourceDriftCommand = DetectStackResourceDriftCommand; -exports.DetectStackSetDriftCommand = DetectStackSetDriftCommand; -exports.DifferenceType = DifferenceType; -exports.DriftIgnoredReason = DriftIgnoredReason; -exports.EstimateTemplateCostCommand = EstimateTemplateCostCommand; -exports.EvaluationType = EvaluationType; -exports.EventType = EventType; -exports.ExecuteChangeSetCommand = ExecuteChangeSetCommand; -exports.ExecuteStackRefactorCommand = ExecuteStackRefactorCommand; -exports.ExecutionStatus = ExecutionStatus; -exports.GeneratedTemplateDeletionPolicy = GeneratedTemplateDeletionPolicy; -exports.GeneratedTemplateNotFoundException = GeneratedTemplateNotFoundException$1; -exports.GeneratedTemplateResourceStatus = GeneratedTemplateResourceStatus; -exports.GeneratedTemplateStatus = GeneratedTemplateStatus; -exports.GeneratedTemplateUpdateReplacePolicy = GeneratedTemplateUpdateReplacePolicy; -exports.GetGeneratedTemplateCommand = GetGeneratedTemplateCommand; -exports.GetHookResultCommand = GetHookResultCommand; -exports.GetStackPolicyCommand = GetStackPolicyCommand; -exports.GetTemplateCommand = GetTemplateCommand; -exports.GetTemplateSummaryCommand = GetTemplateSummaryCommand; -exports.HandlerErrorCode = HandlerErrorCode; -exports.HookFailureMode = HookFailureMode; -exports.HookInvocationPoint = HookInvocationPoint; -exports.HookResultNotFoundException = HookResultNotFoundException$1; -exports.HookStatus = HookStatus; -exports.HookTargetAction = HookTargetAction; -exports.HookTargetType = HookTargetType; -exports.IdentityProvider = IdentityProvider; -exports.ImportStacksToStackSetCommand = ImportStacksToStackSetCommand; -exports.InsufficientCapabilitiesException = InsufficientCapabilitiesException$1; -exports.InvalidChangeSetStatusException = InvalidChangeSetStatusException$1; -exports.InvalidOperationException = InvalidOperationException$1; -exports.InvalidStateTransitionException = InvalidStateTransitionException$1; -exports.LimitExceededException = LimitExceededException$1; -exports.ListChangeSetsCommand = ListChangeSetsCommand; -exports.ListExportsCommand = ListExportsCommand; -exports.ListGeneratedTemplatesCommand = ListGeneratedTemplatesCommand; -exports.ListHookResultsCommand = ListHookResultsCommand; -exports.ListHookResultsTargetType = ListHookResultsTargetType; -exports.ListImportsCommand = ListImportsCommand; -exports.ListResourceScanRelatedResourcesCommand = ListResourceScanRelatedResourcesCommand; -exports.ListResourceScanResourcesCommand = ListResourceScanResourcesCommand; -exports.ListResourceScansCommand = ListResourceScansCommand; -exports.ListStackInstanceResourceDriftsCommand = ListStackInstanceResourceDriftsCommand; -exports.ListStackInstancesCommand = ListStackInstancesCommand; -exports.ListStackRefactorActionsCommand = ListStackRefactorActionsCommand; -exports.ListStackRefactorsCommand = ListStackRefactorsCommand; -exports.ListStackResourcesCommand = ListStackResourcesCommand; -exports.ListStackSetAutoDeploymentTargetsCommand = ListStackSetAutoDeploymentTargetsCommand; -exports.ListStackSetOperationResultsCommand = ListStackSetOperationResultsCommand; -exports.ListStackSetOperationsCommand = ListStackSetOperationsCommand; -exports.ListStackSetsCommand = ListStackSetsCommand; -exports.ListStacksCommand = ListStacksCommand; -exports.ListTypeRegistrationsCommand = ListTypeRegistrationsCommand; -exports.ListTypeVersionsCommand = ListTypeVersionsCommand; -exports.ListTypesCommand = ListTypesCommand; -exports.NameAlreadyExistsException = NameAlreadyExistsException$1; -exports.OnFailure = OnFailure; -exports.OnStackFailure = OnStackFailure; -exports.OperationIdAlreadyExistsException = OperationIdAlreadyExistsException$1; -exports.OperationInProgressException = OperationInProgressException$1; -exports.OperationNotFoundException = OperationNotFoundException$1; -exports.OperationResultFilterName = OperationResultFilterName; -exports.OperationStatus = OperationStatus; -exports.OperationStatusCheckFailedException = OperationStatusCheckFailedException$1; -exports.OperationType = OperationType; -exports.OrganizationStatus = OrganizationStatus; -exports.PermissionModels = PermissionModels; -exports.PolicyAction = PolicyAction; -exports.ProvisioningType = ProvisioningType; -exports.PublishTypeCommand = PublishTypeCommand; -exports.PublisherStatus = PublisherStatus; -exports.RecordHandlerProgressCommand = RecordHandlerProgressCommand; -exports.RegionConcurrencyType = RegionConcurrencyType; -exports.RegisterPublisherCommand = RegisterPublisherCommand; -exports.RegisterTypeCommand = RegisterTypeCommand; -exports.RegistrationStatus = RegistrationStatus; -exports.RegistryType = RegistryType; -exports.Replacement = Replacement; -exports.RequiresRecreation = RequiresRecreation; -exports.ResourceAttribute = ResourceAttribute; -exports.ResourceScanInProgressException = ResourceScanInProgressException$1; -exports.ResourceScanLimitExceededException = ResourceScanLimitExceededException$1; -exports.ResourceScanNotFoundException = ResourceScanNotFoundException$1; -exports.ResourceScanStatus = ResourceScanStatus; -exports.ResourceSignalStatus = ResourceSignalStatus; -exports.ResourceStatus = ResourceStatus; -exports.RollbackStackCommand = RollbackStackCommand; -exports.ScanType = ScanType; -exports.SetStackPolicyCommand = SetStackPolicyCommand; -exports.SetTypeConfigurationCommand = SetTypeConfigurationCommand; -exports.SetTypeDefaultVersionCommand = SetTypeDefaultVersionCommand; -exports.SignalResourceCommand = SignalResourceCommand; -exports.StackDriftDetectionStatus = StackDriftDetectionStatus; -exports.StackDriftStatus = StackDriftStatus; -exports.StackInstanceDetailedStatus = StackInstanceDetailedStatus; -exports.StackInstanceFilterName = StackInstanceFilterName; -exports.StackInstanceNotFoundException = StackInstanceNotFoundException$1; -exports.StackInstanceStatus = StackInstanceStatus; -exports.StackNotFoundException = StackNotFoundException$1; -exports.StackRefactorActionEntity = StackRefactorActionEntity; -exports.StackRefactorActionType = StackRefactorActionType; -exports.StackRefactorDetection = StackRefactorDetection; -exports.StackRefactorExecutionStatus = StackRefactorExecutionStatus; -exports.StackRefactorNotFoundException = StackRefactorNotFoundException$1; -exports.StackRefactorStatus = StackRefactorStatus; -exports.StackResourceDriftStatus = StackResourceDriftStatus; -exports.StackSetDriftDetectionStatus = StackSetDriftDetectionStatus; -exports.StackSetDriftStatus = StackSetDriftStatus; -exports.StackSetNotEmptyException = StackSetNotEmptyException$1; -exports.StackSetNotFoundException = StackSetNotFoundException$1; -exports.StackSetOperationAction = StackSetOperationAction; -exports.StackSetOperationResultStatus = StackSetOperationResultStatus; -exports.StackSetOperationStatus = StackSetOperationStatus; -exports.StackSetStatus = StackSetStatus; -exports.StackStatus = StackStatus; -exports.StaleRequestException = StaleRequestException$1; -exports.StartResourceScanCommand = StartResourceScanCommand; -exports.StopStackSetOperationCommand = StopStackSetOperationCommand; -exports.TemplateFormat = TemplateFormat; -exports.TemplateStage = TemplateStage; -exports.TestTypeCommand = TestTypeCommand; -exports.ThirdPartyType = ThirdPartyType; -exports.TokenAlreadyExistsException = TokenAlreadyExistsException$1; -exports.TypeConfigurationNotFoundException = TypeConfigurationNotFoundException$1; -exports.TypeNotFoundException = TypeNotFoundException$1; -exports.TypeTestsStatus = TypeTestsStatus; -exports.UpdateGeneratedTemplateCommand = UpdateGeneratedTemplateCommand; -exports.UpdateStackCommand = UpdateStackCommand; -exports.UpdateStackInstancesCommand = UpdateStackInstancesCommand; -exports.UpdateStackSetCommand = UpdateStackSetCommand; -exports.UpdateTerminationProtectionCommand = UpdateTerminationProtectionCommand; -exports.ValidateTemplateCommand = ValidateTemplateCommand; -exports.ValidationStatus = ValidationStatus; -exports.VersionBump = VersionBump; -exports.Visibility = Visibility; -exports.WarningType = WarningType; -exports.paginateDescribeAccountLimits = paginateDescribeAccountLimits; -exports.paginateDescribeChangeSet = paginateDescribeChangeSet; -exports.paginateDescribeEvents = paginateDescribeEvents; -exports.paginateDescribeStackEvents = paginateDescribeStackEvents; -exports.paginateDescribeStackResourceDrifts = paginateDescribeStackResourceDrifts; -exports.paginateDescribeStacks = paginateDescribeStacks; -exports.paginateListChangeSets = paginateListChangeSets; -exports.paginateListExports = paginateListExports; -exports.paginateListGeneratedTemplates = paginateListGeneratedTemplates; -exports.paginateListImports = paginateListImports; -exports.paginateListResourceScanRelatedResources = paginateListResourceScanRelatedResources; -exports.paginateListResourceScanResources = paginateListResourceScanResources; -exports.paginateListResourceScans = paginateListResourceScans; -exports.paginateListStackInstances = paginateListStackInstances; -exports.paginateListStackRefactorActions = paginateListStackRefactorActions; -exports.paginateListStackRefactors = paginateListStackRefactors; -exports.paginateListStackResources = paginateListStackResources; -exports.paginateListStackSetOperationResults = paginateListStackSetOperationResults; -exports.paginateListStackSetOperations = paginateListStackSetOperations; -exports.paginateListStackSets = paginateListStackSets; -exports.paginateListStacks = paginateListStacks; -exports.paginateListTypeRegistrations = paginateListTypeRegistrations; -exports.paginateListTypeVersions = paginateListTypeVersions; -exports.paginateListTypes = paginateListTypes; -exports.waitForChangeSetCreateComplete = waitForChangeSetCreateComplete; -exports.waitForStackCreateComplete = waitForStackCreateComplete; -exports.waitForStackDeleteComplete = waitForStackDeleteComplete; -exports.waitForStackExists = waitForStackExists; -exports.waitForStackImportComplete = waitForStackImportComplete; -exports.waitForStackRefactorCreateComplete = waitForStackRefactorCreateComplete; -exports.waitForStackRefactorExecuteComplete = waitForStackRefactorExecuteComplete; -exports.waitForStackRollbackComplete = waitForStackRollbackComplete; -exports.waitForStackUpdateComplete = waitForStackUpdateComplete; -exports.waitForTypeRegistrationComplete = waitForTypeRegistrationComplete; -exports.waitUntilChangeSetCreateComplete = waitUntilChangeSetCreateComplete; -exports.waitUntilStackCreateComplete = waitUntilStackCreateComplete; -exports.waitUntilStackDeleteComplete = waitUntilStackDeleteComplete; -exports.waitUntilStackExists = waitUntilStackExists; -exports.waitUntilStackImportComplete = waitUntilStackImportComplete; -exports.waitUntilStackRefactorCreateComplete = waitUntilStackRefactorCreateComplete; -exports.waitUntilStackRefactorExecuteComplete = waitUntilStackRefactorExecuteComplete; -exports.waitUntilStackRollbackComplete = waitUntilStackRollbackComplete; -exports.waitUntilStackUpdateComplete = waitUntilStackUpdateComplete; -exports.waitUntilTypeRegistrationComplete = waitUntilTypeRegistrationComplete; +class JsonShapeDeserializer extends SerdeContextConfig { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + async read(schema, data) { + return this._read(schema, typeof data === "string" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext)); + } + readObject(schema, data) { + return this._read(schema, data); + } + _read(schema$1, value) { + const isObject = value !== null && typeof value === "object"; + const ns = schema.NormalizedSchema.of(schema$1); + if (isObject) { + if (ns.isStructSchema()) { + const record = value; + const union = ns.isUnionSchema(); + const out = {}; + let nameMap = void 0; + const { jsonName } = this.settings; + if (jsonName) { + nameMap = {}; + } + let unionSerde; + if (union) { + unionSerde = new UnionSerde(record, out); + } + for (const [memberName, memberSchema] of ns.structIterator()) { + let fromKey = memberName; + if (jsonName) { + fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey; + nameMap[fromKey] = memberName; + } + if (union) { + unionSerde.mark(fromKey); + } + if (record[fromKey] != null) { + out[memberName] = this._read(memberSchema, record[fromKey]); + } + } + if (union) { + unionSerde.writeUnknown(); + } + else if (typeof record.__type === "string") { + for (const [k, v] of Object.entries(record)) { + const t = jsonName ? nameMap[k] ?? k : k; + if (!(t in out)) { + out[t] = v; + } + } + } + return out; + } + if (Array.isArray(value) && ns.isListSchema()) { + const listMember = ns.getValueSchema(); + const out = []; + for (const item of value) { + out.push(this._read(listMember, item)); + } + return out; + } + if (ns.isMapSchema()) { + const mapMember = ns.getValueSchema(); + const out = {}; + for (const [_k, _v] of Object.entries(value)) { + out[_k] = this._read(mapMember, _v); + } + return out; + } + } + if (ns.isBlobSchema() && typeof value === "string") { + return utilBase64.fromBase64(value); + } + const mediaType = ns.getMergedTraits().mediaType; + if (ns.isStringSchema() && typeof value === "string" && mediaType) { + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + return serde.LazyJsonString.from(value); + } + return value; + } + if (ns.isTimestampSchema() && value != null) { + const format = protocols.determineTimestampFormat(ns, this.settings); + switch (format) { + case 5: + return serde.parseRfc3339DateTimeWithOffset(value); + case 6: + return serde.parseRfc7231DateTime(value); + case 7: + return serde.parseEpochTimestamp(value); + default: + console.warn("Missing timestamp format, parsing value with Date constructor:", value); + return new Date(value); + } + } + if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) { + return BigInt(value); + } + if (ns.isBigDecimalSchema() && value != undefined) { + if (value instanceof serde.NumericValue) { + return value; + } + const untyped = value; + if (untyped.type === "bigDecimal" && "string" in untyped) { + return new serde.NumericValue(untyped.string, untyped.type); + } + return new serde.NumericValue(String(value), "bigDecimal"); + } + if (ns.isNumericSchema() && typeof value === "string") { + switch (value) { + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + case "NaN": + return NaN; + } + return value; + } + if (ns.isDocumentSchema()) { + if (isObject) { + const out = Array.isArray(value) ? [] : {}; + for (const [k, v] of Object.entries(value)) { + if (v instanceof serde.NumericValue) { + out[k] = v; + } + else { + out[k] = this._read(ns, v); + } + } + return out; + } + else { + return structuredClone(value); + } + } + return value; + } +} + +const NUMERIC_CONTROL_CHAR = String.fromCharCode(925); +class JsonReplacer { + values = new Map(); + counter = 0; + stage = 0; + createReplacer() { + if (this.stage === 1) { + throw new Error("@aws-sdk/core/protocols - JsonReplacer already created."); + } + if (this.stage === 2) { + throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted."); + } + this.stage = 1; + return (key, value) => { + if (value instanceof serde.NumericValue) { + const v = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string; + this.values.set(`"${v}"`, value.string); + return v; + } + if (typeof value === "bigint") { + const s = value.toString(); + const v = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s; + this.values.set(`"${v}"`, s); + return v; + } + return value; + }; + } + replaceInJson(json) { + if (this.stage === 0) { + throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet."); + } + if (this.stage === 2) { + throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted."); + } + this.stage = 2; + if (this.counter === 0) { + return json; + } + for (const [key, value] of this.values) { + json = json.replace(key, value); + } + return json; + } +} + +class JsonShapeSerializer extends SerdeContextConfig { + settings; + buffer; + useReplacer = false; + rootSchema; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema$1, value) { + this.rootSchema = schema.NormalizedSchema.of(schema$1); + this.buffer = this._write(this.rootSchema, value); + } + writeDiscriminatedDocument(schema$1, value) { + this.write(schema$1, value); + if (typeof this.buffer === "object") { + this.buffer.__type = schema.NormalizedSchema.of(schema$1).getName(true); + } + } + flush() { + const { rootSchema, useReplacer } = this; + this.rootSchema = undefined; + this.useReplacer = false; + if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) { + if (!useReplacer) { + return JSON.stringify(this.buffer); + } + const replacer = new JsonReplacer(); + return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0)); + } + return this.buffer; + } + _write(schema$1, value, container) { + const isObject = value !== null && typeof value === "object"; + const ns = schema.NormalizedSchema.of(schema$1); + if (isObject) { + if (ns.isStructSchema()) { + const record = value; + const out = {}; + const { jsonName } = this.settings; + let nameMap = void 0; + if (jsonName) { + nameMap = {}; + } + for (const [memberName, memberSchema] of ns.structIterator()) { + const serializableValue = this._write(memberSchema, record[memberName], ns); + if (serializableValue !== undefined) { + let targetKey = memberName; + if (jsonName) { + targetKey = memberSchema.getMergedTraits().jsonName ?? memberName; + nameMap[memberName] = targetKey; + } + out[targetKey] = serializableValue; + } + } + if (ns.isUnionSchema() && Object.keys(out).length === 0) { + const { $unknown } = record; + if (Array.isArray($unknown)) { + const [k, v] = $unknown; + out[k] = this._write(15, v); + } + } + else if (typeof record.__type === "string") { + for (const [k, v] of Object.entries(record)) { + const targetKey = jsonName ? nameMap[k] ?? k : k; + if (!(targetKey in out)) { + out[targetKey] = this._write(15, v); + } + } + } + return out; + } + if (Array.isArray(value) && ns.isListSchema()) { + const listMember = ns.getValueSchema(); + const out = []; + const sparse = !!ns.getMergedTraits().sparse; + for (const item of value) { + if (sparse || item != null) { + out.push(this._write(listMember, item)); + } + } + return out; + } + if (ns.isMapSchema()) { + const mapMember = ns.getValueSchema(); + const out = {}; + const sparse = !!ns.getMergedTraits().sparse; + for (const [_k, _v] of Object.entries(value)) { + if (sparse || _v != null) { + out[_k] = this._write(mapMember, _v); + } + } + return out; + } + if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) { + if (ns === this.rootSchema) { + return value; + } + return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); + } + if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) { + const format = protocols.determineTimestampFormat(ns, this.settings); + switch (format) { + case 5: + return value.toISOString().replace(".000Z", "Z"); + case 6: + return serde.dateToUtcString(value); + case 7: + return value.getTime() / 1000; + default: + console.warn("Missing timestamp format, using epoch seconds", value); + return value.getTime() / 1000; + } + } + if (value instanceof serde.NumericValue) { + this.useReplacer = true; + } + } + if (value === null && container?.isStructSchema()) { + return void 0; + } + if (ns.isStringSchema()) { + if (typeof value === "undefined" && ns.isIdempotencyToken()) { + return serde.generateIdempotencyToken(); + } + const mediaType = ns.getMergedTraits().mediaType; + if (value != null && mediaType) { + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + return serde.LazyJsonString.from(value); + } + } + return value; + } + if (typeof value === "number" && ns.isNumericSchema()) { + if (Math.abs(value) === Infinity || isNaN(value)) { + return String(value); + } + return value; + } + if (typeof value === "string" && ns.isBlobSchema()) { + if (ns === this.rootSchema) { + return value; + } + return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); + } + if (typeof value === "bigint") { + this.useReplacer = true; + } + if (ns.isDocumentSchema()) { + if (isObject) { + const out = Array.isArray(value) ? [] : {}; + for (const [k, v] of Object.entries(value)) { + if (v instanceof serde.NumericValue) { + this.useReplacer = true; + out[k] = v; + } + else { + out[k] = this._write(ns, v); + } + } + return out; + } + else { + return structuredClone(value); + } + } + return value; + } +} + +class JsonCodec extends SerdeContextConfig { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + createSerializer() { + const serializer = new JsonShapeSerializer(this.settings); + serializer.setSerdeContext(this.serdeContext); + return serializer; + } + createDeserializer() { + const deserializer = new JsonShapeDeserializer(this.settings); + deserializer.setSerdeContext(this.serdeContext); + return deserializer; + } +} + +class AwsJsonRpcProtocol extends protocols.RpcProtocol { + serializer; + deserializer; + serviceTarget; + codec; + mixin; + awsQueryCompatible; + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) { + super({ + defaultNamespace, + }); + this.serviceTarget = serviceTarget; + this.codec = + jsonCodec ?? + new JsonCodec({ + timestampFormat: { + useTrait: true, + default: 7, + }, + jsonName: false, + }); + this.serializer = this.codec.createSerializer(); + this.deserializer = this.codec.createDeserializer(); + this.awsQueryCompatible = !!awsQueryCompatible; + this.mixin = new ProtocolLib(this.awsQueryCompatible); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + if (!request.path.endsWith("/")) { + request.path += "/"; + } + Object.assign(request.headers, { + "content-type": `application/x-amz-json-${this.getJsonRpcVersion()}`, + "x-amz-target": `${this.serviceTarget}.${operationSchema.name}`, + }); + if (this.awsQueryCompatible) { + request.headers["x-amzn-query-mode"] = "true"; + } + if (schema.deref(operationSchema.input) === "unit" || !request.body) { + request.body = "{}"; + } + return request; + } + getPayloadCodec() { + return this.codec; + } + async handleError(operationSchema, context, response, dataObject, metadata) { + if (this.awsQueryCompatible) { + this.mixin.setQueryCompatError(dataObject, response); + } + const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined); + const ns = schema.NormalizedSchema.of(errorSchema); + const message = dataObject.message ?? dataObject.Message ?? "Unknown"; + const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message); + const output = {}; + for (const [name, member] of ns.structIterator()) { + if (dataObject[name] != null) { + output[name] = this.codec.createDeserializer().readObject(member, dataObject[name]); + } + } + if (this.awsQueryCompatible) { + this.mixin.queryCompatOutput(dataObject, output); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message, + }, output), dataObject); + } +} + +class AwsJson1_0Protocol extends AwsJsonRpcProtocol { + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) { + super({ + defaultNamespace, + serviceTarget, + awsQueryCompatible, + jsonCodec, + }); + } + getShapeId() { + return "aws.protocols#awsJson1_0"; + } + getJsonRpcVersion() { + return "1.0"; + } + getDefaultContentType() { + return "application/x-amz-json-1.0"; + } +} + +class AwsJson1_1Protocol extends AwsJsonRpcProtocol { + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) { + super({ + defaultNamespace, + serviceTarget, + awsQueryCompatible, + jsonCodec, + }); + } + getShapeId() { + return "aws.protocols#awsJson1_1"; + } + getJsonRpcVersion() { + return "1.1"; + } + getDefaultContentType() { + return "application/x-amz-json-1.1"; + } +} +class AwsRestJsonProtocol extends protocols.HttpBindingProtocol { + serializer; + deserializer; + codec; + mixin = new ProtocolLib(); + constructor({ defaultNamespace }) { + super({ + defaultNamespace, + }); + const settings = { + timestampFormat: { + useTrait: true, + default: 7, + }, + httpBindings: true, + jsonName: true, + }; + this.codec = new JsonCodec(settings); + this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); + this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); + } + getShapeId() { + return "aws.protocols#restJson1"; + } + getPayloadCodec() { + return this.codec; + } + setSerdeContext(serdeContext) { + this.codec.setSerdeContext(serdeContext); + super.setSerdeContext(serdeContext); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + const inputSchema = schema.NormalizedSchema.of(operationSchema.input); + if (!request.headers["content-type"]) { + const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); + if (contentType) { + request.headers["content-type"] = contentType; + } + } + if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) { + request.body = "{}"; + } + return request; + } + async deserializeResponse(operationSchema, context, response) { + const output = await super.deserializeResponse(operationSchema, context, response); + const outputSchema = schema.NormalizedSchema.of(operationSchema.output); + for (const [name, member] of outputSchema.structIterator()) { + if (member.getMemberTraits().httpPayload && !(name in output)) { + output[name] = null; + } + } + return output; + } + async handleError(operationSchema, context, response, dataObject, metadata) { + const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); + const ns = schema.NormalizedSchema.of(errorSchema); + const message = dataObject.message ?? dataObject.Message ?? "Unknown"; + const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message); + await this.deserializeHttpMessage(errorSchema, context, response, dataObject); + const output = {}; + for (const [name, member] of ns.structIterator()) { + const target = member.getMergedTraits().jsonName ?? name; + output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message, + }, output), dataObject); + } + getDefaultContentType() { + return "application/json"; + } +} -/***/ }), +const awsExpectUnion = (value) => { + if (value == null) { + return undefined; + } + if (typeof value === "object" && "__type" in value) { + delete value.__type; + } + return smithyClient.expectUnion(value); +}; -/***/ 7079: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +class XmlShapeDeserializer extends SerdeContextConfig { + settings; + stringDeserializer; + constructor(settings) { + super(); + this.settings = settings; + this.stringDeserializer = new protocols.FromStringShapeDeserializer(settings); + } + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + this.stringDeserializer.setSerdeContext(serdeContext); + } + read(schema$1, bytes, key) { + const ns = schema.NormalizedSchema.of(schema$1); + const memberSchemas = ns.getMemberSchemas(); + const isEventPayload = ns.isStructSchema() && + ns.isMemberSchema() && + !!Object.values(memberSchemas).find((memberNs) => { + return !!memberNs.getMemberTraits().eventPayload; + }); + if (isEventPayload) { + const output = {}; + const memberName = Object.keys(memberSchemas)[0]; + const eventMemberSchema = memberSchemas[memberName]; + if (eventMemberSchema.isBlobSchema()) { + output[memberName] = bytes; + } + else { + output[memberName] = this.read(memberSchemas[memberName], bytes); + } + return output; + } + const xmlString = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(bytes); + const parsedObject = this.parseXml(xmlString); + return this.readSchema(schema$1, key ? parsedObject[key] : parsedObject); + } + readSchema(_schema, value) { + const ns = schema.NormalizedSchema.of(_schema); + if (ns.isUnitSchema()) { + return; + } + const traits = ns.getMergedTraits(); + if (ns.isListSchema() && !Array.isArray(value)) { + return this.readSchema(ns, [value]); + } + if (value == null) { + return value; + } + if (typeof value === "object") { + const flat = !!traits.xmlFlattened; + if (ns.isListSchema()) { + const listValue = ns.getValueSchema(); + const buffer = []; + const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; + const source = flat ? value : (value[0] ?? value)[sourceKey]; + if (source == null) { + return buffer; + } + const sourceArray = Array.isArray(source) ? source : [source]; + for (const v of sourceArray) { + buffer.push(this.readSchema(listValue, v)); + } + return buffer; + } + const buffer = {}; + if (ns.isMapSchema()) { + const keyNs = ns.getKeySchema(); + const memberNs = ns.getValueSchema(); + let entries; + if (flat) { + entries = Array.isArray(value) ? value : [value]; + } + else { + entries = Array.isArray(value.entry) ? value.entry : [value.entry]; + } + const keyProperty = keyNs.getMergedTraits().xmlName ?? "key"; + const valueProperty = memberNs.getMergedTraits().xmlName ?? "value"; + for (const entry of entries) { + const key = entry[keyProperty]; + const value = entry[valueProperty]; + buffer[key] = this.readSchema(memberNs, value); + } + return buffer; + } + if (ns.isStructSchema()) { + const union = ns.isUnionSchema(); + let unionSerde; + if (union) { + unionSerde = new UnionSerde(value, buffer); + } + for (const [memberName, memberSchema] of ns.structIterator()) { + const memberTraits = memberSchema.getMergedTraits(); + const xmlObjectKey = !memberTraits.httpPayload + ? memberSchema.getMemberTraits().xmlName ?? memberName + : memberTraits.xmlName ?? memberSchema.getName(); + if (union) { + unionSerde.mark(xmlObjectKey); + } + if (value[xmlObjectKey] != null) { + buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); + } + } + if (union) { + unionSerde.writeUnknown(); + } + return buffer; + } + if (ns.isDocumentSchema()) { + return value; + } + throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`); + } + if (ns.isListSchema()) { + return []; + } + if (ns.isMapSchema() || ns.isStructSchema()) { + return {}; + } + return this.stringDeserializer.read(ns, value); + } + parseXml(xml) { + if (xml.length) { + let parsedObj; + try { + parsedObj = xmlBuilder.parseXML(xml); + } + catch (e) { + if (e && typeof e === "object") { + Object.defineProperty(e, "$responseBodyText", { + value: xml, + }); + } + 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 smithyClient.getValueFromTextNode(parsedObjToReturn); + } + return {}; + } +} -"use strict"; +class QueryShapeSerializer extends SerdeContextConfig { + settings; + buffer; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema$1, value, prefix = "") { + if (this.buffer === undefined) { + this.buffer = ""; + } + const ns = schema.NormalizedSchema.of(schema$1); + if (prefix && !prefix.endsWith(".")) { + prefix += "."; + } + if (ns.isBlobSchema()) { + if (typeof value === "string" || value instanceof Uint8Array) { + this.writeKey(prefix); + this.writeValue((this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value)); + } + } + else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) { + if (value != null) { + this.writeKey(prefix); + this.writeValue(String(value)); + } + else if (ns.isIdempotencyToken()) { + this.writeKey(prefix); + this.writeValue(serde.generateIdempotencyToken()); + } + } + else if (ns.isBigIntegerSchema()) { + if (value != null) { + this.writeKey(prefix); + this.writeValue(String(value)); + } + } + else if (ns.isBigDecimalSchema()) { + if (value != null) { + this.writeKey(prefix); + this.writeValue(value instanceof serde.NumericValue ? value.string : String(value)); + } + } + else if (ns.isTimestampSchema()) { + if (value instanceof Date) { + this.writeKey(prefix); + const format = protocols.determineTimestampFormat(ns, this.settings); + switch (format) { + case 5: + this.writeValue(value.toISOString().replace(".000Z", "Z")); + break; + case 6: + this.writeValue(smithyClient.dateToUtcString(value)); + break; + case 7: + this.writeValue(String(value.getTime() / 1000)); + break; + } + } + } + else if (ns.isDocumentSchema()) { + if (Array.isArray(value)) { + this.write(64 | 15, value, prefix); + } + else if (value instanceof Date) { + this.write(4, value, prefix); + } + else if (value instanceof Uint8Array) { + this.write(21, value, prefix); + } + else if (value && typeof value === "object") { + this.write(128 | 15, value, prefix); + } + else { + this.writeKey(prefix); + this.writeValue(String(value)); + } + } + else if (ns.isListSchema()) { + if (Array.isArray(value)) { + if (value.length === 0) { + if (this.settings.serializeEmptyLists) { + this.writeKey(prefix); + this.writeValue(""); + } + } + else { + const member = ns.getValueSchema(); + const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened; + let i = 1; + for (const item of value) { + if (item == null) { + continue; + } + const traits = member.getMergedTraits(); + const suffix = this.getKey("member", traits.xmlName, traits.ec2QueryName); + const key = flat ? `${prefix}${i}` : `${prefix}${suffix}.${i}`; + this.write(member, item, key); + ++i; + } + } + } + } + else if (ns.isMapSchema()) { + if (value && typeof value === "object") { + const keySchema = ns.getKeySchema(); + const memberSchema = ns.getValueSchema(); + const flat = ns.getMergedTraits().xmlFlattened; + let i = 1; + for (const [k, v] of Object.entries(value)) { + if (v == null) { + continue; + } + const keyTraits = keySchema.getMergedTraits(); + const keySuffix = this.getKey("key", keyTraits.xmlName, keyTraits.ec2QueryName); + const key = flat ? `${prefix}${i}.${keySuffix}` : `${prefix}entry.${i}.${keySuffix}`; + const valTraits = memberSchema.getMergedTraits(); + const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName); + const valueKey = flat ? `${prefix}${i}.${valueSuffix}` : `${prefix}entry.${i}.${valueSuffix}`; + this.write(keySchema, k, key); + this.write(memberSchema, v, valueKey); + ++i; + } + } + } + else if (ns.isStructSchema()) { + if (value && typeof value === "object") { + let didWriteMember = false; + for (const [memberName, member] of ns.structIterator()) { + if (value[memberName] == null && !member.isIdempotencyToken()) { + continue; + } + const traits = member.getMergedTraits(); + const suffix = this.getKey(memberName, traits.xmlName, traits.ec2QueryName, "struct"); + const key = `${prefix}${suffix}`; + this.write(member, value[memberName], key); + didWriteMember = true; + } + if (!didWriteMember && ns.isUnionSchema()) { + const { $unknown } = value; + if (Array.isArray($unknown)) { + const [k, v] = $unknown; + const key = `${prefix}${k}`; + this.write(15, v, key); + } + } + } + } + else if (ns.isUnitSchema()) ; + else { + throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`); + } + } + flush() { + if (this.buffer === undefined) { + throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer."); + } + const str = this.buffer; + delete this.buffer; + return str; + } + getKey(memberName, xmlName, ec2QueryName, keySource) { + const { ec2, capitalizeKeys } = this.settings; + if (ec2 && ec2QueryName) { + return ec2QueryName; + } + const key = xmlName ?? memberName; + if (capitalizeKeys && keySource === "struct") { + return key[0].toUpperCase() + key.slice(1); + } + return key; + } + writeKey(key) { + if (key.endsWith(".")) { + key = key.slice(0, key.length - 1); + } + this.buffer += `&${protocols.extendedEncodeURIComponent(key)}=`; + } + writeValue(value) { + this.buffer += protocols.extendedEncodeURIComponent(value); + } +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const tslib_1 = __nccwpck_require__(1860); -const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(9027)); -const core_1 = __nccwpck_require__(8704); -const credential_provider_node_1 = __nccwpck_require__(5861); -const util_user_agent_node_1 = __nccwpck_require__(1656); -const config_resolver_1 = __nccwpck_require__(9316); -const hash_node_1 = __nccwpck_require__(2711); -const middleware_retry_1 = __nccwpck_require__(9618); -const node_config_provider_1 = __nccwpck_require__(5704); -const node_http_handler_1 = __nccwpck_require__(1279); -const util_body_length_node_1 = __nccwpck_require__(3638); -const util_retry_1 = __nccwpck_require__(5518); -const runtimeConfig_shared_1 = __nccwpck_require__(6036); -const smithy_client_1 = __nccwpck_require__(1411); -const util_defaults_mode_node_1 = __nccwpck_require__(5435); -const smithy_client_2 = __nccwpck_require__(1411); -const getRuntimeConfig = (config) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config?.profile, - logger: clientSharedValues.logger, - }; - return { - ...clientSharedValues, - ...config, - runtime: "node", - defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, - defaultUserAgentProvider: config?.defaultUserAgentProvider ?? - (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), - region: config?.region ?? - (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), - retryMode: config?.retryMode ?? - (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, - }, config), - sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), - }; -}; -exports.getRuntimeConfig = getRuntimeConfig; +class AwsQueryProtocol extends protocols.RpcProtocol { + options; + serializer; + deserializer; + mixin = new ProtocolLib(); + constructor(options) { + super({ + defaultNamespace: options.defaultNamespace, + }); + this.options = options; + const settings = { + timestampFormat: { + useTrait: true, + default: 5, + }, + httpBindings: false, + xmlNamespace: options.xmlNamespace, + serviceNamespace: options.defaultNamespace, + serializeEmptyLists: true, + }; + this.serializer = new QueryShapeSerializer(settings); + this.deserializer = new XmlShapeDeserializer(settings); + } + getShapeId() { + return "aws.protocols#awsQuery"; + } + setSerdeContext(serdeContext) { + this.serializer.setSerdeContext(serdeContext); + this.deserializer.setSerdeContext(serdeContext); + } + getPayloadCodec() { + throw new Error("AWSQuery protocol has no payload codec."); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + if (!request.path.endsWith("/")) { + request.path += "/"; + } + Object.assign(request.headers, { + "content-type": `application/x-www-form-urlencoded`, + }); + if (schema.deref(operationSchema.input) === "unit" || !request.body) { + request.body = ""; + } + const action = operationSchema.name.split("#")[1] ?? operationSchema.name; + request.body = `Action=${action}&Version=${this.options.version}` + request.body; + if (request.body.endsWith("&")) { + request.body = request.body.slice(-1); + } + return request; + } + async deserializeResponse(operationSchema, context, response) { + const deserializer = this.deserializer; + const ns = schema.NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes = await protocols.collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes)); + } + await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); + } + for (const header in response.headers) { + const value = response.headers[header]; + delete response.headers[header]; + response.headers[header.toLowerCase()] = value; + } + const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name; + const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : undefined; + const bytes = await protocols.collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey)); + } + const output = { + $metadata: this.deserializeMetadata(response), + ...dataObject, + }; + return output; + } + useNestedResult() { + return true; + } + async handleError(operationSchema, context, response, dataObject, metadata) { + const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown"; + const errorData = this.loadQueryError(dataObject) ?? {}; + const message = this.loadQueryErrorMessage(dataObject); + errorData.message = message; + errorData.Error = { + Type: errorData.Type, + Code: errorData.Code, + Message: message, + }; + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError); + const ns = schema.NormalizedSchema.of(errorSchema); + const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message); + const output = { + Type: errorData.Error.Type, + Code: errorData.Error.Code, + Error: errorData.Error, + }; + for (const [name, member] of ns.structIterator()) { + const target = member.getMergedTraits().xmlName ?? name; + const value = errorData[target] ?? dataObject[target]; + output[name] = this.deserializer.readSchema(member, value); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message, + }, output), dataObject); + } + loadQueryErrorCode(output, data) { + const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code; + if (code !== undefined) { + return code; + } + if (output.statusCode == 404) { + return "NotFound"; + } + } + loadQueryError(data) { + return data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error; + } + loadQueryErrorMessage(data) { + const errorData = this.loadQueryError(data); + return errorData?.message ?? errorData?.Message ?? data.message ?? data.Message ?? "Unknown"; + } + getDefaultContentType() { + return "application/x-www-form-urlencoded"; + } +} +class AwsEc2QueryProtocol extends AwsQueryProtocol { + options; + constructor(options) { + super(options); + this.options = options; + const ec2Settings = { + capitalizeKeys: true, + flattenLists: true, + serializeEmptyLists: false, + ec2: true, + }; + Object.assign(this.serializer.settings, ec2Settings); + } + useNestedResult() { + return false; + } +} -/***/ }), +const parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + let parsedObj; + try { + parsedObj = xmlBuilder.parseXML(encoded); + } + 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 smithyClient.getValueFromTextNode(parsedObjToReturn); + } + return {}; +}); +const parseXmlErrorBody = async (errorBody, context) => { + const value = await parseXmlBody(errorBody, context); + if (value.Error) { + value.Error.message = value.Error.message ?? value.Error.Message; + } + return value; +}; +const loadRestXmlErrorCode = (output, data) => { + if (data?.Error?.Code !== undefined) { + return data.Error.Code; + } + if (data?.Code !== undefined) { + return data.Code; + } + if (output.statusCode == 404) { + return "NotFound"; + } +}; -/***/ 6036: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +class XmlShapeSerializer extends SerdeContextConfig { + settings; + stringBuffer; + byteBuffer; + buffer; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema$1, value) { + const ns = schema.NormalizedSchema.of(schema$1); + if (ns.isStringSchema() && typeof value === "string") { + this.stringBuffer = value; + } + else if (ns.isBlobSchema()) { + this.byteBuffer = + "byteLength" in value + ? value + : (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value); + } + else { + this.buffer = this.writeStruct(ns, value, undefined); + const traits = ns.getMergedTraits(); + if (traits.httpPayload && !traits.xmlName) { + this.buffer.withName(ns.getName()); + } + } + } + flush() { + if (this.byteBuffer !== undefined) { + const bytes = this.byteBuffer; + delete this.byteBuffer; + return bytes; + } + if (this.stringBuffer !== undefined) { + const str = this.stringBuffer; + delete this.stringBuffer; + return str; + } + const buffer = this.buffer; + if (this.settings.xmlNamespace) { + if (!buffer?.attributes?.["xmlns"]) { + buffer.addAttribute("xmlns", this.settings.xmlNamespace); + } + } + delete this.buffer; + return buffer.toString(); + } + writeStruct(ns, value, parentXmlns) { + const traits = ns.getMergedTraits(); + const name = ns.isMemberSchema() && !traits.httpPayload + ? ns.getMemberTraits().xmlName ?? ns.getMemberName() + : traits.xmlName ?? ns.getName(); + if (!name || !ns.isStructSchema()) { + throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`); + } + const structXmlNode = xmlBuilder.XmlNode.of(name); + const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); + for (const [memberName, memberSchema] of ns.structIterator()) { + const val = value[memberName]; + if (val != null || memberSchema.isIdempotencyToken()) { + if (memberSchema.getMergedTraits().xmlAttribute) { + structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val)); + continue; + } + if (memberSchema.isListSchema()) { + this.writeList(memberSchema, val, structXmlNode, xmlns); + } + else if (memberSchema.isMapSchema()) { + this.writeMap(memberSchema, val, structXmlNode, xmlns); + } + else if (memberSchema.isStructSchema()) { + structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns)); + } + else { + const memberNode = xmlBuilder.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName()); + this.writeSimpleInto(memberSchema, val, memberNode, xmlns); + structXmlNode.addChildNode(memberNode); + } + } + } + const { $unknown } = value; + if ($unknown && ns.isUnionSchema() && Array.isArray($unknown) && Object.keys(value).length === 1) { + const [k, v] = $unknown; + const node = xmlBuilder.XmlNode.of(k); + if (typeof v !== "string") { + if (value instanceof xmlBuilder.XmlNode || value instanceof xmlBuilder.XmlText) { + structXmlNode.addChildNode(value); + } + else { + throw new Error(`@aws-sdk - $unknown union member in XML requires ` + + `value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`); + } + } + this.writeSimpleInto(0, v, node, xmlns); + structXmlNode.addChildNode(node); + } + if (xmlns) { + structXmlNode.addAttribute(xmlnsAttr, xmlns); + } + return structXmlNode; + } + writeList(listMember, array, container, parentXmlns) { + if (!listMember.isMemberSchema()) { + throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`); + } + const listTraits = listMember.getMergedTraits(); + const listValueSchema = listMember.getValueSchema(); + const listValueTraits = listValueSchema.getMergedTraits(); + const sparse = !!listValueTraits.sparse; + const flat = !!listTraits.xmlFlattened; + const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns); + const writeItem = (container, value) => { + if (listValueSchema.isListSchema()) { + this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container, xmlns); + } + else if (listValueSchema.isMapSchema()) { + this.writeMap(listValueSchema, value, container, xmlns); + } + else if (listValueSchema.isStructSchema()) { + const struct = this.writeStruct(listValueSchema, value, xmlns); + container.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member")); + } + else { + const listItemNode = xmlBuilder.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"); + this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns); + container.addChildNode(listItemNode); + } + }; + if (flat) { + for (const value of array) { + if (sparse || value != null) { + writeItem(container, value); + } + } + } + else { + const listNode = xmlBuilder.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName()); + if (xmlns) { + listNode.addAttribute(xmlnsAttr, xmlns); + } + for (const value of array) { + if (sparse || value != null) { + writeItem(listNode, value); + } + } + container.addChildNode(listNode); + } + } + writeMap(mapMember, map, container, parentXmlns, containerIsMap = false) { + if (!mapMember.isMemberSchema()) { + throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`); + } + const mapTraits = mapMember.getMergedTraits(); + const mapKeySchema = mapMember.getKeySchema(); + const mapKeyTraits = mapKeySchema.getMergedTraits(); + const keyTag = mapKeyTraits.xmlName ?? "key"; + const mapValueSchema = mapMember.getValueSchema(); + const mapValueTraits = mapValueSchema.getMergedTraits(); + const valueTag = mapValueTraits.xmlName ?? "value"; + const sparse = !!mapValueTraits.sparse; + const flat = !!mapTraits.xmlFlattened; + const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns); + const addKeyValue = (entry, key, val) => { + const keyNode = xmlBuilder.XmlNode.of(keyTag, key); + const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns); + if (keyXmlns) { + keyNode.addAttribute(keyXmlnsAttr, keyXmlns); + } + entry.addChildNode(keyNode); + let valueNode = xmlBuilder.XmlNode.of(valueTag); + if (mapValueSchema.isListSchema()) { + this.writeList(mapValueSchema, val, valueNode, xmlns); + } + else if (mapValueSchema.isMapSchema()) { + this.writeMap(mapValueSchema, val, valueNode, xmlns, true); + } + else if (mapValueSchema.isStructSchema()) { + valueNode = this.writeStruct(mapValueSchema, val, xmlns); + } + else { + this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns); + } + entry.addChildNode(valueNode); + }; + if (flat) { + for (const [key, val] of Object.entries(map)) { + if (sparse || val != null) { + const entry = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); + addKeyValue(entry, key, val); + container.addChildNode(entry); + } + } + } + else { + let mapNode; + if (!containerIsMap) { + mapNode = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); + if (xmlns) { + mapNode.addAttribute(xmlnsAttr, xmlns); + } + container.addChildNode(mapNode); + } + for (const [key, val] of Object.entries(map)) { + if (sparse || val != null) { + const entry = xmlBuilder.XmlNode.of("entry"); + addKeyValue(entry, key, val); + (containerIsMap ? container : mapNode).addChildNode(entry); + } + } + } + } + writeSimple(_schema, value) { + if (null === value) { + throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value."); + } + const ns = schema.NormalizedSchema.of(_schema); + let nodeContents = null; + if (value && typeof value === "object") { + if (ns.isBlobSchema()) { + nodeContents = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); + } + else if (ns.isTimestampSchema() && value instanceof Date) { + const format = protocols.determineTimestampFormat(ns, this.settings); + switch (format) { + case 5: + nodeContents = value.toISOString().replace(".000Z", "Z"); + break; + case 6: + nodeContents = smithyClient.dateToUtcString(value); + break; + case 7: + nodeContents = String(value.getTime() / 1000); + break; + default: + console.warn("Missing timestamp format, using http date", value); + nodeContents = smithyClient.dateToUtcString(value); + break; + } + } + else if (ns.isBigDecimalSchema() && value) { + if (value instanceof serde.NumericValue) { + return value.string; + } + return String(value); + } + else if (ns.isMapSchema() || ns.isListSchema()) { + throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."); + } + else { + throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`); + } + } + if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) { + nodeContents = String(value); + } + if (ns.isStringSchema()) { + if (value === undefined && ns.isIdempotencyToken()) { + nodeContents = serde.generateIdempotencyToken(); + } + else { + nodeContents = String(value); + } + } + if (nodeContents === null) { + throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`); + } + return nodeContents; + } + writeSimpleInto(_schema, value, into, parentXmlns) { + const nodeContents = this.writeSimple(_schema, value); + const ns = schema.NormalizedSchema.of(_schema); + const content = new xmlBuilder.XmlText(nodeContents); + const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); + if (xmlns) { + into.addAttribute(xmlnsAttr, xmlns); + } + into.addChildNode(content); + } + getXmlnsAttribute(ns, parentXmlns) { + const traits = ns.getMergedTraits(); + const [prefix, xmlns] = traits.xmlNamespace ?? []; + if (xmlns && xmlns !== parentXmlns) { + return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns]; + } + return [void 0, void 0]; + } +} -"use strict"; +class XmlCodec extends SerdeContextConfig { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + createSerializer() { + const serializer = new XmlShapeSerializer(this.settings); + serializer.setSerdeContext(this.serdeContext); + return serializer; + } + createDeserializer() { + const deserializer = new XmlShapeDeserializer(this.settings); + deserializer.setSerdeContext(this.serdeContext); + return deserializer; + } +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const core_1 = __nccwpck_require__(8704); -const protocols_1 = __nccwpck_require__(7288); -const smithy_client_1 = __nccwpck_require__(1411); -const url_parser_1 = __nccwpck_require__(4494); -const util_base64_1 = __nccwpck_require__(8385); -const util_utf8_1 = __nccwpck_require__(1577); -const httpAuthSchemeProvider_1 = __nccwpck_require__(398); -const endpointResolver_1 = __nccwpck_require__(2840); -const getRuntimeConfig = (config) => { - return { - apiVersion: "2010-05-15", - 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.defaultCloudFormationHttpAuthSchemeProvider, - httpAuthSchemes: config?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer(), +class AwsRestXmlProtocol extends protocols.HttpBindingProtocol { + codec; + serializer; + deserializer; + mixin = new ProtocolLib(); + constructor(options) { + super(options); + const settings = { + timestampFormat: { + useTrait: true, + default: 5, }, - ], - logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - protocol: config?.protocol ?? - new protocols_1.AwsQueryProtocol({ - defaultNamespace: "com.amazonaws.cloudformation", - xmlNamespace: "http://cloudformation.amazonaws.com/doc/2010-05-15/", - version: "2010-05-15", - }), - serviceId: config?.serviceId ?? "CloudFormation", - urlParser: config?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, - }; -}; -exports.getRuntimeConfig = getRuntimeConfig; + httpBindings: true, + xmlNamespace: options.xmlNamespace, + serviceNamespace: options.defaultNamespace, + }; + this.codec = new XmlCodec(settings); + this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); + this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); + } + getPayloadCodec() { + return this.codec; + } + getShapeId() { + return "aws.protocols#restXml"; + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + const inputSchema = schema.NormalizedSchema.of(operationSchema.input); + if (!request.headers["content-type"]) { + const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); + if (contentType) { + request.headers["content-type"] = contentType; + } + } + if (typeof request.body === "string" && + request.headers["content-type"] === this.getDefaultContentType() && + !request.body.startsWith("' + request.body; + } + return request; + } + async deserializeResponse(operationSchema, context, response) { + return super.deserializeResponse(operationSchema, context, response); + } + async handleError(operationSchema, context, response, dataObject, metadata) { + const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; + if (dataObject.Error && typeof dataObject.Error === "object") { + for (const key of Object.keys(dataObject.Error)) { + dataObject[key] = dataObject.Error[key]; + if (key.toLowerCase() === "message") { + dataObject.message = dataObject.Error[key]; + } + } + } + if (dataObject.RequestId && !metadata.requestId) { + metadata.requestId = dataObject.RequestId; + } + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); + const ns = schema.NormalizedSchema.of(errorSchema); + const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; + const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message); + await this.deserializeHttpMessage(errorSchema, context, response, dataObject); + const output = {}; + for (const [name, member] of ns.structIterator()) { + const target = member.getMergedTraits().xmlName ?? name; + const value = dataObject.Error?.[target] ?? dataObject[target]; + output[name] = this.codec.createDeserializer().readSchema(member, value); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message, + }, output), dataObject); + } + getDefaultContentType() { + return "application/xml"; + } + hasUnstructuredPayloadBinding(ns) { + for (const [, member] of ns.structIterator()) { + if (member.getMergedTraits().httpPayload) { + return !(member.isStructSchema() || member.isMapSchema() || member.isListSchema()); + } + } + return false; + } +} + +exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer; +exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol; +exports.AwsJson1_0Protocol = AwsJson1_0Protocol; +exports.AwsJson1_1Protocol = AwsJson1_1Protocol; +exports.AwsJsonRpcProtocol = AwsJsonRpcProtocol; +exports.AwsQueryProtocol = AwsQueryProtocol; +exports.AwsRestJsonProtocol = AwsRestJsonProtocol; +exports.AwsRestXmlProtocol = AwsRestXmlProtocol; +exports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner; +exports.AwsSdkSigV4Signer = AwsSdkSigV4Signer; +exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol; +exports.JsonCodec = JsonCodec; +exports.JsonShapeDeserializer = JsonShapeDeserializer; +exports.JsonShapeSerializer = JsonShapeSerializer; +exports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS; +exports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS; +exports.XmlCodec = XmlCodec; +exports.XmlShapeDeserializer = XmlShapeDeserializer; +exports.XmlShapeSerializer = XmlShapeSerializer; +exports._toBool = _toBool; +exports._toNum = _toNum; +exports._toStr = _toStr; +exports.awsExpectUnion = awsExpectUnion; +exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; +exports.getBearerTokenEnvKey = getBearerTokenEnvKey; +exports.loadRestJsonErrorCode = loadRestJsonErrorCode; +exports.loadRestXmlErrorCode = loadRestXmlErrorCode; +exports.parseJsonBody = parseJsonBody; +exports.parseJsonErrorBody = parseJsonErrorBody; +exports.parseXmlBody = parseXmlBody; +exports.parseXmlErrorBody = parseXmlErrorBody; +exports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config; +exports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig; +exports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config; +exports.setCredentialFeature = setCredentialFeature; +exports.setFeature = setFeature; +exports.setTokenFeature = setTokenFeature; +exports.state = state; +exports.validateSigningProperties = validateSigningProperties; /***/ }), -/***/ 8704: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 5152: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var protocolHttp = __nccwpck_require__(2356); -var core = __nccwpck_require__(402); -var propertyProvider = __nccwpck_require__(8857); -var client = __nccwpck_require__(5152); -var signatureV4 = __nccwpck_require__(5118); -var cbor = __nccwpck_require__(4645); -var schema = __nccwpck_require__(6890); -var smithyClient = __nccwpck_require__(1411); -var protocols = __nccwpck_require__(3422); -var serde = __nccwpck_require__(2430); -var utilBase64 = __nccwpck_require__(8385); -var utilUtf8 = __nccwpck_require__(1577); -var xmlBuilder = __nccwpck_require__(4274); - const state = { warningEmitted: false, }; const emitWarningIfUnsupportedVersion = (version) => { - if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) { + if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) { state.warningEmitted = true; process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will -no longer support Node.js 16.x on January 6, 2025. +no longer support Node.js ${version} in January 2026. 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`); +More information can be found at: https://a.co/c895JFp`); } }; @@ -10300,286 +12933,29 @@ function setTokenFeature(token, feature, value) { return token; } -const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined; - -const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); - -const isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000; - -const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { - const clockTimeInMs = Date.parse(clockTime); - if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { - return clockTimeInMs - Date.now(); - } - return currentSystemClockOffset; -}; - -const throwSigningPropertyError = (name, property) => { - if (!property) { - throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); - } - return property; -}; -const 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, - }; -}; -class AwsSdkSigV4Signer { - async sign(httpRequest, identity, signingProperties) { - if (!protocolHttp.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: 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; - }; - } - successHandler(httpResponse, signingProperties) { - const dateHeader = getDateHeader(httpResponse); - if (dateHeader) { - const config = throwSigningPropertyError("config", signingProperties.config); - config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); - } - } -} -const AWSSDKSigV4Signer = AwsSdkSigV4Signer; +exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; +exports.setCredentialFeature = setCredentialFeature; +exports.setFeature = setFeature; +exports.setTokenFeature = setTokenFeature; +exports.state = state; -class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer { - async sign(httpRequest, identity, signingProperties) { - if (!protocolHttp.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; - } -} -const getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; +/***/ }), -const getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; +/***/ 7288: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; -const NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; -const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { - environmentVariableSelector: (env, options) => { - if (options?.signingName) { - const bearerTokenKey = getBearerTokenEnvKey(options.signingName); - if (bearerTokenKey in env) - return ["httpBearerAuth"]; - } - if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) - return undefined; - return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); - }, - configFileSelector: (profile) => { - if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) - return undefined; - return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); - }, - default: [], -}; +"use strict"; -const resolveAwsSdkSigV4AConfig = (config) => { - config.sigv4aSigningRegionSet = core.normalizeProvider(config.sigv4aSigningRegionSet); - return config; -}; -const 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 propertyProvider.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 propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", { - tryNextLink: true, - }); - }, - default: undefined, -}; -const resolveAwsSdkSigV4Config = (config) => { - let inputCredentials = config.credentials; - let isUserSupplied = !!config.credentials; - let resolvedCredentials = undefined; - Object.defineProperty(config, "credentials", { - set(credentials) { - if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { - isUserSupplied = true; - } - inputCredentials = credentials; - const memoizedProvider = normalizeCredentialProvider(config, { - credentials: inputCredentials, - credentialDefaultProvider: config.credentialDefaultProvider, - }); - const boundProvider = bindCallerConfig(config, memoizedProvider); - if (isUserSupplied && !boundProvider.attributed) { - resolvedCredentials = async (options) => boundProvider(options).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_CODE", "e")); - resolvedCredentials.memoized = boundProvider.memoized; - resolvedCredentials.configBound = boundProvider.configBound; - resolvedCredentials.attributed = true; - } - else { - resolvedCredentials = boundProvider; - } - }, - get() { - return resolvedCredentials; - }, - enumerable: true, - configurable: true, - }); - config.credentials = inputCredentials; - const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config; - let signer; - if (config.signer) { - signer = core.normalizeProvider(config.signer); - } - else if (config.regionInfoProvider) { - signer = () => core.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: config.credentials, - region: config.signingRegion, - service: config.signingName, - sha256, - uriEscapePath: signingEscapePath, - }; - const SignerCtor = config.signerConstructor || signatureV4.SignatureV4; - return new SignerCtor(params); - }); - } - else { - signer = async (authScheme) => { - authScheme = Object.assign({}, { - name: "sigv4", - signingName: config.signingName || config.defaultSigningName, - signingRegion: await core.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: config.credentials, - region: config.signingRegion, - service: config.signingName, - sha256, - uriEscapePath: signingEscapePath, - }; - const SignerCtor = config.signerConstructor || signatureV4.SignatureV4; - return new SignerCtor(params); - }; - } - const resolvedConfig = Object.assign(config, { - systemClockOffset, - signingEscapePath, - signer, - }); - return resolvedConfig; -}; -const resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; -function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider, }) { - let credentialsProvider; - if (credentials) { - if (!credentials?.memoized) { - credentialsProvider = core.memoizeIdentityProvider(credentials, core.isIdentityExpired, core.doesIdentityRequireRefresh); - } - else { - credentialsProvider = credentials; - } - } - else { - if (credentialDefaultProvider) { - credentialsProvider = core.normalizeProvider(credentialDefaultProvider(Object.assign({}, config, { - parentClientConfig: config, - }))); - } - else { - credentialsProvider = async () => { - throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured."); - }; - } - } - credentialsProvider.memoized = true; - return credentialsProvider; -} -function bindCallerConfig(config, credentialsProvider) { - if (credentialsProvider.configBound) { - return credentialsProvider; - } - const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config }); - fn.memoized = credentialsProvider.memoized; - fn.configBound = true; - return fn; -} +var cbor = __nccwpck_require__(4645); +var schema = __nccwpck_require__(6890); +var smithyClient = __nccwpck_require__(1411); +var protocols = __nccwpck_require__(3422); +var serde = __nccwpck_require__(2430); +var utilBase64 = __nccwpck_require__(8385); +var utilUtf8 = __nccwpck_require__(1577); +var xmlBuilder = __nccwpck_require__(4274); class ProtocolLib { queryCompat; @@ -10648,9 +13024,18 @@ class ProtocolLib { const msg = exception.Message ?? additions.Message; const error = smithyClient.decorateServiceException(exception, additions); if (msg) { - error.Message = msg; error.message = msg; } + error.Error = { + ...error.Error, + Type: error.Error?.Type, + Code: error.Error?.Code, + Message: error.Error?.message ?? error.Error?.Message ?? msg, + }; + const reqId = error.$metadata.requestId; + if (reqId) { + error.RequestId = reqId; + } return error; } return smithyClient.decorateServiceException(exception, additions); @@ -10666,7 +13051,7 @@ class ProtocolLib { }; Object.assign(output, Error); for (const [k, v] of entries) { - Error[k] = v; + Error[k === "message" ? "Message" : k] = v; } delete Error.__type; output.Error = Error; @@ -10683,6 +13068,14 @@ class ProtocolLib { errorData.Code = queryCompatErrorData.Code; } } + findQueryCompatibleError(registry, errorName) { + try { + return registry.getSchema(errorName); + } + catch (e) { + return registry.find((schema$1) => schema.NormalizedSchema.of(schema$1).getMergedTraits().awsQueryError?.[0] === errorName); + } + } } class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol { @@ -10704,15 +13097,23 @@ class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol { if (this.awsQueryCompatible) { this.mixin.setQueryCompatError(dataObject, response); } - const errorName = cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata); + const errorName = (() => { + const compatHeader = response.headers["x-amzn-query-error"]; + if (compatHeader && this.awsQueryCompatible) { + return compatHeader.split(";")[0]; + } + return cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; + })(); + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined); const ns = schema.NormalizedSchema.of(errorSchema); const message = dataObject.message ?? dataObject.Message ?? "Unknown"; const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); const output = {}; for (const [name, member] of ns.structIterator()) { - output[name] = this.deserializer.readValue(member, dataObject[name]); + if (dataObject[name] != null) { + output[name] = this.deserializer.readValue(member, dataObject[name]); + } } if (this.awsQueryCompatible) { this.mixin.queryCompatOutput(dataObject, output); @@ -10781,6 +13182,30 @@ class SerdeContextConfig { } } +class UnionSerde { + from; + to; + keys; + constructor(from, to) { + this.from = from; + this.to = to; + this.keys = new Set(Object.keys(this.from).filter((k) => k !== "__type")); + } + mark(key) { + this.keys.delete(key); + } + hasUnknown() { + return this.keys.size === 1 && Object.keys(this.to).length === 0; + } + writeUnknown() { + if (this.hasUnknown()) { + const k = this.keys.values().next().value; + const v = this.from[k]; + this.to.$unknown = [k, v]; + } + } +} + function jsonReviver(key, value, context) { if (context?.source) { const numericString = context.source; @@ -10870,38 +13295,62 @@ class JsonShapeDeserializer extends SerdeContextConfig { _read(schema$1, value) { const isObject = value !== null && typeof value === "object"; const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isListSchema() && Array.isArray(value)) { - const listMember = ns.getValueSchema(); - const out = []; - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._read(listMember, item)); + if (isObject) { + if (ns.isStructSchema()) { + const record = value; + const union = ns.isUnionSchema(); + const out = {}; + let nameMap = void 0; + const { jsonName } = this.settings; + if (jsonName) { + nameMap = {}; + } + let unionSerde; + if (union) { + unionSerde = new UnionSerde(record, out); + } + for (const [memberName, memberSchema] of ns.structIterator()) { + let fromKey = memberName; + if (jsonName) { + fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey; + nameMap[fromKey] = memberName; + } + if (union) { + unionSerde.mark(fromKey); + } + if (record[fromKey] != null) { + out[memberName] = this._read(memberSchema, record[fromKey]); + } + } + if (union) { + unionSerde.writeUnknown(); + } + else if (typeof record.__type === "string") { + for (const [k, v] of Object.entries(record)) { + const t = jsonName ? nameMap[k] ?? k : k; + if (!(t in out)) { + out[t] = v; + } + } } + return out; } - return out; - } - else if (ns.isMapSchema() && isObject) { - const mapMember = ns.getValueSchema(); - const out = {}; - const sparse = !!ns.getMergedTraits().sparse; - for (const [_k, _v] of Object.entries(value)) { - if (sparse || _v != null) { - out[_k] = this._read(mapMember, _v); + if (Array.isArray(value) && ns.isListSchema()) { + const listMember = ns.getValueSchema(); + const out = []; + for (const item of value) { + out.push(this._read(listMember, item)); } + return out; } - return out; - } - else if (ns.isStructSchema() && isObject) { - const out = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - const fromKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName; - const deserializedValue = this._read(memberSchema, value[fromKey]); - if (deserializedValue != null) { - out[memberName] = deserializedValue; + if (ns.isMapSchema()) { + const mapMember = ns.getValueSchema(); + const out = {}; + for (const [_k, _v] of Object.entries(value)) { + out[_k] = this._read(mapMember, _v); } + return out; } - return out; } if (ns.isBlobSchema() && typeof value === "string") { return utilBase64.fromBase64(value); @@ -10912,6 +13361,7 @@ class JsonShapeDeserializer extends SerdeContextConfig { if (isJson) { return serde.LazyJsonString.from(value); } + return value; } if (ns.isTimestampSchema() && value != null) { const format = protocols.determineTimestampFormat(ns, this.settings); @@ -10949,6 +13399,7 @@ class JsonShapeDeserializer extends SerdeContextConfig { case "NaN": return NaN; } + return value; } if (ns.isDocumentSchema()) { if (isObject) { @@ -11020,6 +13471,7 @@ class JsonReplacer { class JsonShapeSerializer extends SerdeContextConfig { settings; buffer; + useReplacer = false; rootSchema; constructor(settings) { super(); @@ -11036,9 +13488,13 @@ class JsonShapeSerializer extends SerdeContextConfig { } } flush() { - const { rootSchema } = this; + const { rootSchema, useReplacer } = this; this.rootSchema = undefined; + this.useReplacer = false; if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) { + if (!useReplacer) { + return JSON.stringify(this.buffer); + } const replacer = new JsonReplacer(); return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0)); } @@ -11047,68 +13503,92 @@ class JsonShapeSerializer extends SerdeContextConfig { _write(schema$1, value, container) { const isObject = value !== null && typeof value === "object"; const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isListSchema() && Array.isArray(value)) { - const listMember = ns.getValueSchema(); - const out = []; - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._write(listMember, item)); + if (isObject) { + if (ns.isStructSchema()) { + const record = value; + const out = {}; + const { jsonName } = this.settings; + let nameMap = void 0; + if (jsonName) { + nameMap = {}; + } + for (const [memberName, memberSchema] of ns.structIterator()) { + const serializableValue = this._write(memberSchema, record[memberName], ns); + if (serializableValue !== undefined) { + let targetKey = memberName; + if (jsonName) { + targetKey = memberSchema.getMergedTraits().jsonName ?? memberName; + nameMap[memberName] = targetKey; + } + out[targetKey] = serializableValue; + } } + if (ns.isUnionSchema() && Object.keys(out).length === 0) { + const { $unknown } = record; + if (Array.isArray($unknown)) { + const [k, v] = $unknown; + out[k] = this._write(15, v); + } + } + else if (typeof record.__type === "string") { + for (const [k, v] of Object.entries(record)) { + const targetKey = jsonName ? nameMap[k] ?? k : k; + if (!(targetKey in out)) { + out[targetKey] = this._write(15, v); + } + } + } + return out; } - return out; - } - else if (ns.isMapSchema() && isObject) { - const mapMember = ns.getValueSchema(); - const out = {}; - const sparse = !!ns.getMergedTraits().sparse; - for (const [_k, _v] of Object.entries(value)) { - if (sparse || _v != null) { - out[_k] = this._write(mapMember, _v); + if (Array.isArray(value) && ns.isListSchema()) { + const listMember = ns.getValueSchema(); + const out = []; + const sparse = !!ns.getMergedTraits().sparse; + for (const item of value) { + if (sparse || item != null) { + out.push(this._write(listMember, item)); + } } + return out; } - return out; - } - else if (ns.isStructSchema() && isObject) { - const out = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName; - const serializableValue = this._write(memberSchema, value[memberName], ns); - if (serializableValue !== undefined) { - out[targetKey] = serializableValue; + if (ns.isMapSchema()) { + const mapMember = ns.getValueSchema(); + const out = {}; + const sparse = !!ns.getMergedTraits().sparse; + for (const [_k, _v] of Object.entries(value)) { + if (sparse || _v != null) { + out[_k] = this._write(mapMember, _v); + } } + return out; } - return out; - } - if (value === null && container?.isStructSchema()) { - return void 0; - } - if ((ns.isBlobSchema() && (value instanceof Uint8Array || typeof value === "string")) || - (ns.isDocumentSchema() && value instanceof Uint8Array)) { - if (ns === this.rootSchema) { - return value; + if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) { + if (ns === this.rootSchema) { + return value; + } + return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); } - return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - } - if ((ns.isTimestampSchema() || ns.isDocumentSchema()) && value instanceof Date) { - const format = protocols.determineTimestampFormat(ns, this.settings); - switch (format) { - case 5: - return value.toISOString().replace(".000Z", "Z"); - case 6: - return serde.dateToUtcString(value); - case 7: - return value.getTime() / 1000; - default: - console.warn("Missing timestamp format, using epoch seconds", value); - return value.getTime() / 1000; + if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) { + const format = protocols.determineTimestampFormat(ns, this.settings); + switch (format) { + case 5: + return value.toISOString().replace(".000Z", "Z"); + case 6: + return serde.dateToUtcString(value); + case 7: + return value.getTime() / 1000; + default: + console.warn("Missing timestamp format, using epoch seconds", value); + return value.getTime() / 1000; + } } - } - if (ns.isNumericSchema() && typeof value === "number") { - if (Math.abs(value) === Infinity || isNaN(value)) { - return String(value); + if (value instanceof serde.NumericValue) { + this.useReplacer = true; } } + if (value === null && container?.isStructSchema()) { + return void 0; + } if (ns.isStringSchema()) { if (typeof value === "undefined" && ns.isIdempotencyToken()) { return serde.generateIdempotencyToken(); @@ -11120,12 +13600,29 @@ class JsonShapeSerializer extends SerdeContextConfig { return serde.LazyJsonString.from(value); } } + return value; + } + if (typeof value === "number" && ns.isNumericSchema()) { + if (Math.abs(value) === Infinity || isNaN(value)) { + return String(value); + } + return value; + } + if (typeof value === "string" && ns.isBlobSchema()) { + if (ns === this.rootSchema) { + return value; + } + return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); + } + if (typeof value === "bigint") { + this.useReplacer = true; } if (ns.isDocumentSchema()) { if (isObject) { const out = Array.isArray(value) ? [] : {}; for (const [k, v] of Object.entries(value)) { if (v instanceof serde.NumericValue) { + this.useReplacer = true; out[k] = v; } else { @@ -11167,18 +13664,20 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol { codec; mixin; awsQueryCompatible; - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) { + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) { super({ defaultNamespace, }); this.serviceTarget = serviceTarget; - this.codec = new JsonCodec({ - timestampFormat: { - useTrait: true, - default: 7, - }, - jsonName: false, - }); + this.codec = + jsonCodec ?? + new JsonCodec({ + timestampFormat: { + useTrait: true, + default: 7, + }, + jsonName: false, + }); this.serializer = this.codec.createSerializer(); this.deserializer = this.codec.createDeserializer(); this.awsQueryCompatible = !!awsQueryCompatible; @@ -11209,15 +13708,16 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol { this.mixin.setQueryCompatError(dataObject, response); } const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined); const ns = schema.NormalizedSchema.of(errorSchema); const message = dataObject.message ?? dataObject.Message ?? "Unknown"; const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); const output = {}; for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().jsonName ?? name; - output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]); + if (dataObject[name] != null) { + output[name] = this.codec.createDeserializer().readObject(member, dataObject[name]); + } } if (this.awsQueryCompatible) { this.mixin.queryCompatOutput(dataObject, output); @@ -11230,11 +13730,12 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol { } class AwsJson1_0Protocol extends AwsJsonRpcProtocol { - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) { + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) { super({ defaultNamespace, serviceTarget, awsQueryCompatible, + jsonCodec, }); } getShapeId() { @@ -11249,11 +13750,12 @@ class AwsJson1_0Protocol extends AwsJsonRpcProtocol { } class AwsJson1_1Protocol extends AwsJsonRpcProtocol { - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) { + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) { super({ defaultNamespace, serviceTarget, awsQueryCompatible, + jsonCodec, }); } getShapeId() { @@ -11404,18 +13906,18 @@ class XmlShapeDeserializer extends SerdeContextConfig { return value; } if (typeof value === "object") { - const sparse = !!traits.sparse; const flat = !!traits.xmlFlattened; if (ns.isListSchema()) { const listValue = ns.getValueSchema(); const buffer = []; const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; const source = flat ? value : (value[0] ?? value)[sourceKey]; + if (source == null) { + return buffer; + } const sourceArray = Array.isArray(source) ? source : [source]; for (const v of sourceArray) { - if (v != null || sparse) { - buffer.push(this.readSchema(listValue, v)); - } + buffer.push(this.readSchema(listValue, v)); } return buffer; } @@ -11435,22 +13937,31 @@ class XmlShapeDeserializer extends SerdeContextConfig { for (const entry of entries) { const key = entry[keyProperty]; const value = entry[valueProperty]; - if (value != null || sparse) { - buffer[key] = this.readSchema(memberNs, value); - } + buffer[key] = this.readSchema(memberNs, value); } return buffer; } if (ns.isStructSchema()) { + const union = ns.isUnionSchema(); + let unionSerde; + if (union) { + unionSerde = new UnionSerde(value, buffer); + } for (const [memberName, memberSchema] of ns.structIterator()) { const memberTraits = memberSchema.getMergedTraits(); const xmlObjectKey = !memberTraits.httpPayload ? memberSchema.getMemberTraits().xmlName ?? memberName : memberTraits.xmlName ?? memberSchema.getName(); + if (union) { + unionSerde.mark(xmlObjectKey); + } if (value[xmlObjectKey] != null) { buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); } } + if (union) { + unionSerde.writeUnknown(); + } return buffer; } if (ns.isDocumentSchema()) { @@ -11554,7 +14065,22 @@ class QueryShapeSerializer extends SerdeContextConfig { } } else if (ns.isDocumentSchema()) { - throw new Error(`@aws-sdk/core/protocols - QuerySerializer unsupported document type ${ns.getName(true)}`); + if (Array.isArray(value)) { + this.write(64 | 15, value, prefix); + } + else if (value instanceof Date) { + this.write(4, value, prefix); + } + else if (value instanceof Uint8Array) { + this.write(21, value, prefix); + } + else if (value && typeof value === "object") { + this.write(128 | 15, value, prefix); + } + else { + this.writeKey(prefix); + this.writeValue(String(value)); + } } else if (ns.isListSchema()) { if (Array.isArray(value)) { @@ -11572,7 +14098,8 @@ class QueryShapeSerializer extends SerdeContextConfig { if (item == null) { continue; } - const suffix = this.getKey("member", member.getMergedTraits().xmlName); + const traits = member.getMergedTraits(); + const suffix = this.getKey("member", traits.xmlName, traits.ec2QueryName); const key = flat ? `${prefix}${i}` : `${prefix}${suffix}.${i}`; this.write(member, item, key); ++i; @@ -11590,9 +14117,11 @@ class QueryShapeSerializer extends SerdeContextConfig { if (v == null) { continue; } - const keySuffix = this.getKey("key", keySchema.getMergedTraits().xmlName); + const keyTraits = keySchema.getMergedTraits(); + const keySuffix = this.getKey("key", keyTraits.xmlName, keyTraits.ec2QueryName); const key = flat ? `${prefix}${i}.${keySuffix}` : `${prefix}entry.${i}.${keySuffix}`; - const valueSuffix = this.getKey("value", memberSchema.getMergedTraits().xmlName); + const valTraits = memberSchema.getMergedTraits(); + const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName); const valueKey = flat ? `${prefix}${i}.${valueSuffix}` : `${prefix}entry.${i}.${valueSuffix}`; this.write(keySchema, k, key); this.write(memberSchema, v, valueKey); @@ -11602,13 +14131,24 @@ class QueryShapeSerializer extends SerdeContextConfig { } else if (ns.isStructSchema()) { if (value && typeof value === "object") { + let didWriteMember = false; for (const [memberName, member] of ns.structIterator()) { if (value[memberName] == null && !member.isIdempotencyToken()) { continue; } - const suffix = this.getKey(memberName, member.getMergedTraits().xmlName); + const traits = member.getMergedTraits(); + const suffix = this.getKey(memberName, traits.xmlName, traits.ec2QueryName, "struct"); const key = `${prefix}${suffix}`; this.write(member, value[memberName], key); + didWriteMember = true; + } + if (!didWriteMember && ns.isUnionSchema()) { + const { $unknown } = value; + if (Array.isArray($unknown)) { + const [k, v] = $unknown; + const key = `${prefix}${k}`; + this.write(15, v, key); + } } } } @@ -11625,9 +14165,13 @@ class QueryShapeSerializer extends SerdeContextConfig { delete this.buffer; return str; } - getKey(memberName, xmlName) { + getKey(memberName, xmlName, ec2QueryName, keySource) { + const { ec2, capitalizeKeys } = this.settings; + if (ec2 && ec2QueryName) { + return ec2QueryName; + } const key = xmlName ?? memberName; - if (this.settings.capitalizeKeys) { + if (capitalizeKeys && keySource === "struct") { return key[0].toUpperCase() + key.slice(1); } return key; @@ -11727,7 +14271,7 @@ class AwsQueryProtocol extends protocols.RpcProtocol { } async handleError(operationSchema, context, response, dataObject, metadata) { const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown"; - const errorData = this.loadQueryError(dataObject); + const errorData = this.loadQueryError(dataObject) ?? {}; const message = this.loadQueryErrorMessage(dataObject); errorData.message = message; errorData.Error = { @@ -11735,18 +14279,13 @@ class AwsQueryProtocol extends protocols.RpcProtocol { Code: errorData.Code, Message: message, }; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, (registry, errorName) => { - try { - return registry.getSchema(errorName); - } - catch (e) { - return registry.find((schema$1) => schema.NormalizedSchema.of(schema$1).getMergedTraits().awsQueryError?.[0] === errorName); - } - }); + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError); const ns = schema.NormalizedSchema.of(errorSchema); const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); const output = { + Type: errorData.Error.Type, + Code: errorData.Error.Code, Error: errorData.Error, }; for (const [name, member] of ns.structIterator()) { @@ -11789,6 +14328,7 @@ class AwsEc2QueryProtocol extends AwsQueryProtocol { capitalizeKeys: true, flattenLists: true, serializeEmptyLists: false, + ec2: true, }; Object.assign(this.serializer.settings, ec2Settings); } @@ -11922,6 +14462,22 @@ class XmlShapeSerializer extends SerdeContextConfig { } } } + const { $unknown } = value; + if ($unknown && ns.isUnionSchema() && Array.isArray($unknown) && Object.keys(value).length === 1) { + const [k, v] = $unknown; + const node = xmlBuilder.XmlNode.of(k); + if (typeof v !== "string") { + if (value instanceof xmlBuilder.XmlNode || value instanceof xmlBuilder.XmlText) { + structXmlNode.addChildNode(value); + } + else { + throw new Error(`@aws-sdk - $unknown union member in XML requires ` + + `value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`); + } + } + this.writeSimpleInto(0, v, node, xmlns); + structXmlNode.addChildNode(node); + } if (xmlns) { structXmlNode.addAttribute(xmlnsAttr, xmlns); } @@ -12152,7240 +14708,7744 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol { this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); } - getPayloadCodec() { - return this.codec; - } - getShapeId() { - return "aws.protocols#restXml"; - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - const inputSchema = schema.NormalizedSchema.of(operationSchema.input); - if (!request.headers["content-type"]) { - const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); - if (contentType) { - request.headers["content-type"] = contentType; - } - } - if (request.headers["content-type"] === this.getDefaultContentType()) { - if (typeof request.body === "string") { - request.body = '' + request.body; - } - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - return super.deserializeResponse(operationSchema, context, response); - } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - await this.deserializeHttpMessage(errorSchema, context, response, dataObject); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().xmlName ?? name; - const value = dataObject.Error?.[target] ?? dataObject[target]; - output[name] = this.codec.createDeserializer().readSchema(member, value); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message, - }, output), dataObject); - } - getDefaultContentType() { - return "application/xml"; - } -} - -exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer; -exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol; -exports.AwsJson1_0Protocol = AwsJson1_0Protocol; -exports.AwsJson1_1Protocol = AwsJson1_1Protocol; -exports.AwsJsonRpcProtocol = AwsJsonRpcProtocol; -exports.AwsQueryProtocol = AwsQueryProtocol; -exports.AwsRestJsonProtocol = AwsRestJsonProtocol; -exports.AwsRestXmlProtocol = AwsRestXmlProtocol; -exports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner; -exports.AwsSdkSigV4Signer = AwsSdkSigV4Signer; -exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol; -exports.JsonCodec = JsonCodec; -exports.JsonShapeDeserializer = JsonShapeDeserializer; -exports.JsonShapeSerializer = JsonShapeSerializer; -exports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS; -exports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS; -exports.XmlCodec = XmlCodec; -exports.XmlShapeDeserializer = XmlShapeDeserializer; -exports.XmlShapeSerializer = XmlShapeSerializer; -exports._toBool = _toBool; -exports._toNum = _toNum; -exports._toStr = _toStr; -exports.awsExpectUnion = awsExpectUnion; -exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; -exports.getBearerTokenEnvKey = getBearerTokenEnvKey; -exports.loadRestJsonErrorCode = loadRestJsonErrorCode; -exports.loadRestXmlErrorCode = loadRestXmlErrorCode; -exports.parseJsonBody = parseJsonBody; -exports.parseJsonErrorBody = parseJsonErrorBody; -exports.parseXmlBody = parseXmlBody; -exports.parseXmlErrorBody = parseXmlErrorBody; -exports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config; -exports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig; -exports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config; -exports.setCredentialFeature = setCredentialFeature; -exports.setFeature = setFeature; -exports.setTokenFeature = setTokenFeature; -exports.state = state; -exports.validateSigningProperties = validateSigningProperties; - - -/***/ }), - -/***/ 5152: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -const state = { - warningEmitted: false, -}; -const emitWarningIfUnsupportedVersion = (version) => { - if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) { - state.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`); - } -}; - -function setCredentialFeature(credentials, feature, value) { - if (!credentials.$source) { - credentials.$source = {}; - } - credentials.$source[feature] = value; - return credentials; -} - -function setFeature(context, feature, value) { - if (!context.__aws_sdk_context) { - context.__aws_sdk_context = { - features: {}, - }; - } - else if (!context.__aws_sdk_context.features) { - context.__aws_sdk_context.features = {}; - } - context.__aws_sdk_context.features[feature] = value; -} - -function setTokenFeature(token, feature, value) { - if (!token.$source) { - token.$source = {}; - } - token.$source[feature] = value; - return token; -} - -exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; -exports.setCredentialFeature = setCredentialFeature; -exports.setFeature = setFeature; -exports.setTokenFeature = setTokenFeature; -exports.state = state; - - -/***/ }), - -/***/ 7288: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var cbor = __nccwpck_require__(4645); -var schema = __nccwpck_require__(6890); -var smithyClient = __nccwpck_require__(1411); -var protocols = __nccwpck_require__(3422); -var serde = __nccwpck_require__(2430); -var utilBase64 = __nccwpck_require__(8385); -var utilUtf8 = __nccwpck_require__(1577); -var xmlBuilder = __nccwpck_require__(4274); - -class ProtocolLib { - queryCompat; - constructor(queryCompat = false) { - this.queryCompat = queryCompat; - } - resolveRestContentType(defaultContentType, inputSchema) { - const members = inputSchema.getMemberSchemas(); - const httpPayloadMember = Object.values(members).find((m) => { - return !!m.getMergedTraits().httpPayload; - }); - if (httpPayloadMember) { - const mediaType = httpPayloadMember.getMergedTraits().mediaType; - if (mediaType) { - return mediaType; - } - else if (httpPayloadMember.isStringSchema()) { - return "text/plain"; - } - else if (httpPayloadMember.isBlobSchema()) { - return "application/octet-stream"; - } - else { - return defaultContentType; - } - } - else if (!inputSchema.isUnitSchema()) { - const hasBody = Object.values(members).find((m) => { - const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m.getMergedTraits(); - const noPrefixHeaders = httpPrefixHeaders === void 0; - return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders; - }); - if (hasBody) { - return defaultContentType; - } - } - } - async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) { - let namespace = defaultNamespace; - let errorName = errorIdentifier; - if (errorIdentifier.includes("#")) { - [namespace, errorName] = errorIdentifier.split("#"); - } - const errorMetadata = { - $metadata: metadata, - $fault: response.statusCode < 500 ? "client" : "server", - }; - const registry = schema.TypeRegistry.for(namespace); - try { - const errorSchema = getErrorSchema?.(registry, errorName) ?? registry.getSchema(errorIdentifier); - return { errorSchema, errorMetadata }; - } - catch (e) { - dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError"; - const synthetic = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); - const baseExceptionSchema = synthetic.getBaseException(); - if (baseExceptionSchema) { - const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error; - throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject); - } - throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject); - } - } - decorateServiceException(exception, additions = {}) { - if (this.queryCompat) { - const msg = exception.Message ?? additions.Message; - const error = smithyClient.decorateServiceException(exception, additions); - if (msg) { - error.Message = msg; - error.message = msg; - } - return error; - } - return smithyClient.decorateServiceException(exception, additions); - } - setQueryCompatError(output, response) { - const queryErrorHeader = response.headers?.["x-amzn-query-error"]; - if (output !== undefined && queryErrorHeader != null) { - const [Code, Type] = queryErrorHeader.split(";"); - const entries = Object.entries(output); - const Error = { - Code, - Type, - }; - Object.assign(output, Error); - for (const [k, v] of entries) { - Error[k] = v; - } - delete Error.__type; - output.Error = Error; - } - } - queryCompatOutput(queryCompatErrorData, errorData) { - if (queryCompatErrorData.Error) { - errorData.Error = queryCompatErrorData.Error; - } - if (queryCompatErrorData.Type) { - errorData.Type = queryCompatErrorData.Type; - } - if (queryCompatErrorData.Code) { - errorData.Code = queryCompatErrorData.Code; - } - } -} - -class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol { - awsQueryCompatible; - mixin; - constructor({ defaultNamespace, awsQueryCompatible, }) { - super({ defaultNamespace }); - this.awsQueryCompatible = !!awsQueryCompatible; - this.mixin = new ProtocolLib(this.awsQueryCompatible); + getPayloadCodec() { + return this.codec; + } + getShapeId() { + return "aws.protocols#restXml"; } async serializeRequest(operationSchema, input, context) { const request = await super.serializeRequest(operationSchema, input, context); - if (this.awsQueryCompatible) { - request.headers["x-amzn-query-mode"] = "true"; + const inputSchema = schema.NormalizedSchema.of(operationSchema.input); + if (!request.headers["content-type"]) { + const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); + if (contentType) { + request.headers["content-type"] = contentType; + } + } + if (typeof request.body === "string" && + request.headers["content-type"] === this.getDefaultContentType() && + !request.body.startsWith("' + request.body; } return request; } + async deserializeResponse(operationSchema, context, response) { + return super.deserializeResponse(operationSchema, context, response); + } async handleError(operationSchema, context, response, dataObject, metadata) { - if (this.awsQueryCompatible) { - this.mixin.setQueryCompatError(dataObject, response); + const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; + if (dataObject.Error && typeof dataObject.Error === "object") { + for (const key of Object.keys(dataObject.Error)) { + dataObject[key] = dataObject.Error[key]; + if (key.toLowerCase() === "message") { + dataObject.message = dataObject.Error[key]; + } + } } - const errorName = cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata); + if (dataObject.RequestId && !metadata.requestId) { + metadata.requestId = dataObject.RequestId; + } + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; + const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); + await this.deserializeHttpMessage(errorSchema, context, response, dataObject); const output = {}; for (const [name, member] of ns.structIterator()) { - output[name] = this.deserializer.readValue(member, dataObject[name]); - } - if (this.awsQueryCompatible) { - this.mixin.queryCompatOutput(dataObject, output); + const target = member.getMergedTraits().xmlName ?? name; + const value = dataObject.Error?.[target] ?? dataObject[target]; + output[name] = this.codec.createDeserializer().readSchema(member, value); } throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { $fault: ns.getMergedTraits().error, message, }, output), dataObject); } -} - -const _toStr = (val) => { - if (val == null) { - return val; - } - if (typeof val === "number" || typeof val === "bigint") { - const warning = new Error(`Received number ${val} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); - return String(val); - } - if (typeof val === "boolean") { - const warning = new Error(`Received boolean ${val} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); - return String(val); - } - return val; -}; -const _toBool = (val) => { - if (val == null) { - return val; + getDefaultContentType() { + return "application/xml"; } - if (typeof val === "string") { - const lowercase = val.toLowerCase(); - if (val !== "" && lowercase !== "false" && lowercase !== "true") { - const warning = new Error(`Received string "${val}" where a boolean was expected.`); - warning.name = "Warning"; - console.warn(warning); + hasUnstructuredPayloadBinding(ns) { + for (const [, member] of ns.structIterator()) { + if (member.getMergedTraits().httpPayload) { + return !(member.isStructSchema() || member.isMapSchema() || member.isListSchema()); + } } - return val !== "" && lowercase !== "false"; - } - return val; -}; -const _toNum = (val) => { - if (val == null) { - return val; + return false; } - if (typeof val === "string") { - const num = Number(val); - if (num.toString() !== val) { - const warning = new Error(`Received string "${val}" where a number was expected.`); - warning.name = "Warning"; - console.warn(warning); - return val; - } - return num; +} + +exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol; +exports.AwsJson1_0Protocol = AwsJson1_0Protocol; +exports.AwsJson1_1Protocol = AwsJson1_1Protocol; +exports.AwsJsonRpcProtocol = AwsJsonRpcProtocol; +exports.AwsQueryProtocol = AwsQueryProtocol; +exports.AwsRestJsonProtocol = AwsRestJsonProtocol; +exports.AwsRestXmlProtocol = AwsRestXmlProtocol; +exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol; +exports.JsonCodec = JsonCodec; +exports.JsonShapeDeserializer = JsonShapeDeserializer; +exports.JsonShapeSerializer = JsonShapeSerializer; +exports.XmlCodec = XmlCodec; +exports.XmlShapeDeserializer = XmlShapeDeserializer; +exports.XmlShapeSerializer = XmlShapeSerializer; +exports._toBool = _toBool; +exports._toNum = _toNum; +exports._toStr = _toStr; +exports.awsExpectUnion = awsExpectUnion; +exports.loadRestJsonErrorCode = loadRestJsonErrorCode; +exports.loadRestXmlErrorCode = loadRestXmlErrorCode; +exports.parseJsonBody = parseJsonBody; +exports.parseJsonErrorBody = parseJsonErrorBody; +exports.parseXmlBody = parseXmlBody; +exports.parseXmlErrorBody = parseXmlErrorBody; + + +/***/ }), + +/***/ 5606: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var client = __nccwpck_require__(5152); +var propertyProvider = __nccwpck_require__(8857); + +const ENV_KEY = "AWS_ACCESS_KEY_ID"; +const ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; +const ENV_SESSION = "AWS_SESSION_TOKEN"; +const ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; +const ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; +const ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID"; +const fromEnv = (init) => async () => { + init?.logger?.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) { + const credentials = { + accessKeyId, + secretAccessKey, + ...(sessionToken && { sessionToken }), + ...(expiry && { expiration: new Date(expiry) }), + ...(credentialScope && { credentialScope }), + ...(accountId && { accountId }), + }; + client.setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g"); + return credentials; } - return val; + throw new propertyProvider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger }); }; -class SerdeContextConfig { - serdeContext; - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; +exports.ENV_ACCOUNT_ID = ENV_ACCOUNT_ID; +exports.ENV_CREDENTIAL_SCOPE = ENV_CREDENTIAL_SCOPE; +exports.ENV_EXPIRATION = ENV_EXPIRATION; +exports.ENV_KEY = ENV_KEY; +exports.ENV_SECRET = ENV_SECRET; +exports.ENV_SESSION = ENV_SESSION; +exports.fromEnv = fromEnv; + + +/***/ }), + +/***/ 5861: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var credentialProviderEnv = __nccwpck_require__(5606); +var propertyProvider = __nccwpck_require__(8857); +var sharedIniFileLoader = __nccwpck_require__(4964); + +const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +const remoteProvider = async (init) => { + const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await __nccwpck_require__.e(/* import() */ 566).then(__nccwpck_require__.t.bind(__nccwpck_require__, 566, 19)); + if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) { + init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata"); + const { fromHttp } = await __nccwpck_require__.e(/* import() */ 605).then(__nccwpck_require__.bind(__nccwpck_require__, 8605)); + return propertyProvider.chain(fromHttp(init), fromContainerMetadata(init)); } -} + if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") { + return async () => { + throw new propertyProvider.CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger }); + }; + } + init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"); + return fromInstanceMetadata(init); +}; -function jsonReviver(key, value, context) { - if (context?.source) { - const numericString = context.source; - if (typeof value === "number") { - if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) { - const isFractional = numericString.includes("."); - if (isFractional) { - return new serde.NumericValue(numericString, "bigDecimal"); - } - else { - return BigInt(numericString); +function memoizeChain(providers, treatAsExpired) { + const chain = internalCreateChain(providers); + let activeLock; + let passiveLock; + let credentials; + const provider = async (options) => { + if (options?.forceRefresh) { + return await chain(options); + } + if (credentials?.expiration) { + if (credentials?.expiration?.getTime() < Date.now()) { + credentials = undefined; + } + } + if (activeLock) { + await activeLock; + } + else if (!credentials || treatAsExpired?.(credentials)) { + if (credentials) { + if (!passiveLock) { + passiveLock = chain(options) + .then((c) => { + credentials = c; + }) + .finally(() => { + passiveLock = undefined; + }); } } + else { + activeLock = chain(options) + .then((c) => { + credentials = c; + }) + .finally(() => { + activeLock = undefined; + }); + return provider(options); + } } - } - return value; + return credentials; + }; + return provider; } - -const collectBodyString = (streamBody, context) => smithyClient.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? utilUtf8.toUtf8)(body)); - -const parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { +const internalCreateChain = (providers) => async (awsIdentityProperties) => { + let lastProviderError; + for (const provider of providers) { try { - return JSON.parse(encoded); + return await provider(awsIdentityProperties); } - catch (e) { - if (e?.name === "SyntaxError") { - Object.defineProperty(e, "$responseBodyText", { - value: encoded, - }); + catch (err) { + lastProviderError = err; + if (err?.tryNextLink) { + continue; } - throw e; + throw err; } } - return {}; -}); -const parseJsonErrorBody = async (errorBody, context) => { - const value = await parseJsonBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; + throw lastProviderError; }; -const 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]; + +let multipleCredentialSourceWarningEmitted = false; +const defaultProvider = (init = {}) => memoizeChain([ + async () => { + const profile = init.profile ?? process.env[sharedIniFileLoader.ENV_PROFILE]; + if (profile) { + const envStaticCredentialsAreSet = process.env[credentialProviderEnv.ENV_KEY] && process.env[credentialProviderEnv.ENV_SECRET]; + if (envStaticCredentialsAreSet) { + if (!multipleCredentialSourceWarningEmitted) { + const warnFn = init.logger?.warn && init.logger?.constructor?.name !== "NoOpLogger" + ? init.logger.warn.bind(init.logger) + : console.warn; + warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING: + Multiple credential sources detected: + Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set. + This SDK will proceed with the AWS_PROFILE value. + + However, a future version may change this behavior to prefer the ENV static credentials. + Please ensure that your environment only sets either the AWS_PROFILE or the + AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair. +`); + multipleCredentialSourceWarningEmitted = true; + } + } + throw new propertyProvider.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", { + logger: init.logger, + tryNextLink: true, + }); } - if (cleanValue.indexOf("#") >= 0) { - cleanValue = cleanValue.split("#")[1]; + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"); + return credentialProviderEnv.fromEnv(init)(); + }, + async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO"); + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + throw new propertyProvider.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger }); } - return cleanValue; - }; - const headerKey = findKey(output.headers, "x-amzn-errortype"); - if (headerKey !== undefined) { - return sanitizeErrorCode(output.headers[headerKey]); + const { fromSSO } = await Promise.all(/* import() */[__nccwpck_require__.e(272), __nccwpck_require__.e(998)]).then(__nccwpck_require__.t.bind(__nccwpck_require__, 998, 19)); + return fromSSO(init)(awsIdentityProperties); + }, + async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni"); + const { fromIni } = await __nccwpck_require__.e(/* import() */ 869).then(__nccwpck_require__.t.bind(__nccwpck_require__, 5869, 19)); + return fromIni(init)(awsIdentityProperties); + }, + async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess"); + const { fromProcess } = await __nccwpck_require__.e(/* import() */ 360).then(__nccwpck_require__.t.bind(__nccwpck_require__, 5360, 19)); + return fromProcess(init)(awsIdentityProperties); + }, + async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile"); + const { fromTokenFile } = await Promise.all(/* import() */[__nccwpck_require__.e(272), __nccwpck_require__.e(956)]).then(__nccwpck_require__.t.bind(__nccwpck_require__, 9956, 23)); + return fromTokenFile(init)(awsIdentityProperties); + }, + async () => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"); + return (await remoteProvider(init))(); + }, + async () => { + throw new propertyProvider.CredentialsProviderError("Could not load credentials from any providers", { + tryNextLink: false, + logger: init.logger, + }); + }, +], credentialsTreatedAsExpired); +const credentialsWillNeedRefresh = (credentials) => credentials?.expiration !== undefined; +const credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000; + +exports.credentialsTreatedAsExpired = credentialsTreatedAsExpired; +exports.credentialsWillNeedRefresh = credentialsWillNeedRefresh; +exports.defaultProvider = defaultProvider; + + +/***/ }), + +/***/ 2590: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var protocolHttp = __nccwpck_require__(2356); + +function resolveHostHeaderConfig(input) { + return input; +} +const hostHeaderMiddleware = (options) => (next) => async (args) => { + if (!protocolHttp.HttpRequest.isInstance(args.request)) + return next(args); + const { request } = args; + const { handlerProtocol = "" } = options.requestHandler.metadata || {}; + if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { + delete request.headers["host"]; + request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : ""); + } + else if (!request.headers["host"]) { + let host = request.hostname; + if (request.port != null) + host += `:${request.port}`; + request.headers["host"] = host; + } + return next(args); +}; +const hostHeaderMiddlewareOptions = { + name: "hostHeaderMiddleware", + step: "build", + priority: "low", + tags: ["HOST"], + override: true, +}; +const getHostHeaderPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); + }, +}); + +exports.getHostHeaderPlugin = getHostHeaderPlugin; +exports.hostHeaderMiddleware = hostHeaderMiddleware; +exports.hostHeaderMiddlewareOptions = hostHeaderMiddlewareOptions; +exports.resolveHostHeaderConfig = resolveHostHeaderConfig; + + +/***/ }), + +/***/ 5242: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +const loggerMiddleware = () => (next, context) => async (args) => { + try { + const response = await next(args); + const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; + const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; + const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog; + const { $metadata, ...outputWithoutMetadata } = response.output; + logger?.info?.({ + clientName, + commandName, + input: inputFilterSensitiveLog(args.input), + output: outputFilterSensitiveLog(outputWithoutMetadata), + metadata: $metadata, + }); + return response; + } + catch (error) { + const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; + const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; + logger?.error?.({ + clientName, + commandName, + input: inputFilterSensitiveLog(args.input), + error, + metadata: error.$metadata, + }); + throw error; + } +}; +const loggerMiddlewareOptions = { + name: "loggerMiddleware", + tags: ["LOGGER"], + step: "initialize", + override: true, +}; +const getLoggerPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); + }, +}); + +exports.getLoggerPlugin = getLoggerPlugin; +exports.loggerMiddleware = loggerMiddleware; +exports.loggerMiddlewareOptions = loggerMiddlewareOptions; + + +/***/ }), + +/***/ 1568: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var recursionDetectionMiddleware = __nccwpck_require__(2521); + +const recursionDetectionMiddlewareOptions = { + step: "build", + tags: ["RECURSION_DETECTION"], + name: "recursionDetectionMiddleware", + override: true, + priority: "low", +}; + +const getRecursionDetectionPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(recursionDetectionMiddleware.recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions); + }, +}); + +exports.getRecursionDetectionPlugin = getRecursionDetectionPlugin; +Object.prototype.hasOwnProperty.call(recursionDetectionMiddleware, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: recursionDetectionMiddleware['__proto__'] + }); + +Object.keys(recursionDetectionMiddleware).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = recursionDetectionMiddleware[k]; +}); + + +/***/ }), + +/***/ 2521: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.recursionDetectionMiddleware = void 0; +const lambda_invoke_store_1 = __nccwpck_require__(9320); +const protocol_http_1 = __nccwpck_require__(2356); +const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; +const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; +const ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; +const recursionDetectionMiddleware = () => (next) => async (args) => { + const { request } = args; + if (!protocol_http_1.HttpRequest.isInstance(request)) { + return next(args); + } + const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? + TRACE_ID_HEADER_NAME; + if (request.headers.hasOwnProperty(traceIdHeader)) { + return next(args); } - if (data && typeof data === "object") { - const codeKey = findKey(data, "code"); - if (codeKey && data[codeKey] !== undefined) { - return sanitizeErrorCode(data[codeKey]); - } - if (data["__type"] !== undefined) { - return sanitizeErrorCode(data["__type"]); - } + const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + const traceIdFromEnv = process.env[ENV_TRACE_ID]; + const invokeStore = await lambda_invoke_store_1.InvokeStore.getInstanceAsync(); + const traceIdFromInvokeStore = invokeStore?.getXRayTraceId(); + const traceId = traceIdFromInvokeStore ?? traceIdFromEnv; + const nonEmptyString = (str) => typeof str === "string" && str.length > 0; + if (nonEmptyString(functionName) && nonEmptyString(traceId)) { + request.headers[TRACE_ID_HEADER_NAME] = traceId; } + return next({ + ...args, + request, + }); }; +exports.recursionDetectionMiddleware = recursionDetectionMiddleware; -class JsonShapeDeserializer extends SerdeContextConfig { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - async read(schema, data) { - return this._read(schema, typeof data === "string" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext)); - } - readObject(schema, data) { - return this._read(schema, data); + +/***/ }), + +/***/ 2959: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var core = __nccwpck_require__(402); +var utilEndpoints = __nccwpck_require__(3068); +var protocolHttp = __nccwpck_require__(2356); +var core$1 = __nccwpck_require__(8704); + +const DEFAULT_UA_APP_ID = undefined; +function isValidUserAgentAppId(appId) { + if (appId === undefined) { + return true; } - _read(schema$1, value) { - const isObject = value !== null && typeof value === "object"; - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isListSchema() && Array.isArray(value)) { - const listMember = ns.getValueSchema(); - const out = []; - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._read(listMember, item)); - } - } - return out; - } - else if (ns.isMapSchema() && isObject) { - const mapMember = ns.getValueSchema(); - const out = {}; - const sparse = !!ns.getMergedTraits().sparse; - for (const [_k, _v] of Object.entries(value)) { - if (sparse || _v != null) { - out[_k] = this._read(mapMember, _v); + return typeof appId === "string" && appId.length <= 50; +} +function resolveUserAgentConfig(input) { + const normalizedAppIdProvider = core.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID); + const { customUserAgent } = input; + return Object.assign(input, { + customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, + userAgentAppId: async () => { + const appId = await normalizedAppIdProvider(); + if (!isValidUserAgentAppId(appId)) { + const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; + if (typeof appId !== "string") { + logger?.warn("userAgentAppId must be a string or undefined."); } - } - return out; - } - else if (ns.isStructSchema() && isObject) { - const out = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - const fromKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName; - const deserializedValue = this._read(memberSchema, value[fromKey]); - if (deserializedValue != null) { - out[memberName] = deserializedValue; + else if (appId.length > 50) { + logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); } } - return out; - } - if (ns.isBlobSchema() && typeof value === "string") { - return utilBase64.fromBase64(value); - } - const mediaType = ns.getMergedTraits().mediaType; - if (ns.isStringSchema() && typeof value === "string" && mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - return serde.LazyJsonString.from(value); - } - } - if (ns.isTimestampSchema() && value != null) { - const format = protocols.determineTimestampFormat(ns, this.settings); - switch (format) { - case 5: - return serde.parseRfc3339DateTimeWithOffset(value); - case 6: - return serde.parseRfc7231DateTime(value); - case 7: - return serde.parseEpochTimestamp(value); - default: - console.warn("Missing timestamp format, parsing value with Date constructor:", value); - return new Date(value); - } - } - if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) { - return BigInt(value); - } - if (ns.isBigDecimalSchema() && value != undefined) { - if (value instanceof serde.NumericValue) { - return value; - } - const untyped = value; - if (untyped.type === "bigDecimal" && "string" in untyped) { - return new serde.NumericValue(untyped.string, untyped.type); - } - return new serde.NumericValue(String(value), "bigDecimal"); - } - if (ns.isNumericSchema() && typeof value === "string") { - switch (value) { - case "Infinity": - return Infinity; - case "-Infinity": - return -Infinity; - case "NaN": - return NaN; - } - } - if (ns.isDocumentSchema()) { - if (isObject) { - const out = Array.isArray(value) ? [] : {}; - for (const [k, v] of Object.entries(value)) { - if (v instanceof serde.NumericValue) { - out[k] = v; - } - else { - out[k] = this._read(ns, v); - } - } - return out; + return appId; + }, + }); +} + +const ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; +async function checkFeatures(context, config, args) { + const request = args.request; + if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { + core$1.setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M"); + } + if (typeof config.retryStrategy === "function") { + const retryStrategy = await config.retryStrategy(); + if (typeof retryStrategy.acquireInitialRetryToken === "function") { + if (retryStrategy.constructor?.name?.includes("Adaptive")) { + core$1.setFeature(context, "RETRY_MODE_ADAPTIVE", "F"); } else { - return structuredClone(value); + core$1.setFeature(context, "RETRY_MODE_STANDARD", "E"); } } - return value; - } -} - -const NUMERIC_CONTROL_CHAR = String.fromCharCode(925); -class JsonReplacer { - values = new Map(); - counter = 0; - stage = 0; - createReplacer() { - if (this.stage === 1) { - throw new Error("@aws-sdk/core/protocols - JsonReplacer already created."); - } - if (this.stage === 2) { - throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted."); + else { + core$1.setFeature(context, "RETRY_MODE_LEGACY", "D"); } - this.stage = 1; - return (key, value) => { - if (value instanceof serde.NumericValue) { - const v = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string; - this.values.set(`"${v}"`, value.string); - return v; - } - if (typeof value === "bigint") { - const s = value.toString(); - const v = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s; - this.values.set(`"${v}"`, s); - return v; - } - return value; - }; } - replaceInJson(json) { - if (this.stage === 0) { - throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet."); + if (typeof config.accountIdEndpointMode === "function") { + const endpointV2 = context.endpointV2; + if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { + core$1.setFeature(context, "ACCOUNT_ID_ENDPOINT", "O"); } - if (this.stage === 2) { - throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted."); + switch (await config.accountIdEndpointMode?.()) { + case "disabled": + core$1.setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q"); + break; + case "preferred": + core$1.setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P"); + break; + case "required": + core$1.setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R"); + break; } - this.stage = 2; - if (this.counter === 0) { - return json; + } + const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity; + if (identity?.$source) { + const credentials = identity; + if (credentials.accountId) { + core$1.setFeature(context, "RESOLVED_ACCOUNT_ID", "T"); } - for (const [key, value] of this.values) { - json = json.replace(key, value); + for (const [key, value] of Object.entries(credentials.$source ?? {})) { + core$1.setFeature(context, key, value); } - return json; } } -class JsonShapeSerializer extends SerdeContextConfig { - settings; - buffer; - rootSchema; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema$1, value) { - this.rootSchema = schema.NormalizedSchema.of(schema$1); - this.buffer = this._write(this.rootSchema, value); - } - writeDiscriminatedDocument(schema$1, value) { - this.write(schema$1, value); - if (typeof this.buffer === "object") { - this.buffer.__type = schema.NormalizedSchema.of(schema$1).getName(true); - } - } - flush() { - const { rootSchema } = this; - this.rootSchema = undefined; - if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) { - const replacer = new JsonReplacer(); - return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0)); - } - return this.buffer; - } - _write(schema$1, value, container) { - const isObject = value !== null && typeof value === "object"; - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isListSchema() && Array.isArray(value)) { - const listMember = ns.getValueSchema(); - const out = []; - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._write(listMember, item)); - } - } - return out; - } - else if (ns.isMapSchema() && isObject) { - const mapMember = ns.getValueSchema(); - const out = {}; - const sparse = !!ns.getMergedTraits().sparse; - for (const [_k, _v] of Object.entries(value)) { - if (sparse || _v != null) { - out[_k] = this._write(mapMember, _v); - } - } - return out; - } - else if (ns.isStructSchema() && isObject) { - const out = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName; - const serializableValue = this._write(memberSchema, value[memberName], ns); - if (serializableValue !== undefined) { - out[targetKey] = serializableValue; - } - } - return out; - } - if (value === null && container?.isStructSchema()) { - return void 0; - } - if ((ns.isBlobSchema() && (value instanceof Uint8Array || typeof value === "string")) || - (ns.isDocumentSchema() && value instanceof Uint8Array)) { - if (ns === this.rootSchema) { - return value; - } - return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - } - if ((ns.isTimestampSchema() || ns.isDocumentSchema()) && value instanceof Date) { - const format = protocols.determineTimestampFormat(ns, this.settings); - switch (format) { - case 5: - return value.toISOString().replace(".000Z", "Z"); - case 6: - return serde.dateToUtcString(value); - case 7: - return value.getTime() / 1000; - default: - console.warn("Missing timestamp format, using epoch seconds", value); - return value.getTime() / 1000; - } - } - if (ns.isNumericSchema() && typeof value === "number") { - if (Math.abs(value) === Infinity || isNaN(value)) { - return String(value); - } - } - if (ns.isStringSchema()) { - if (typeof value === "undefined" && ns.isIdempotencyToken()) { - return serde.generateIdempotencyToken(); - } - const mediaType = ns.getMergedTraits().mediaType; - if (value != null && mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - return serde.LazyJsonString.from(value); - } - } - } - if (ns.isDocumentSchema()) { - if (isObject) { - const out = Array.isArray(value) ? [] : {}; - for (const [k, v] of Object.entries(value)) { - if (v instanceof serde.NumericValue) { - out[k] = v; - } - else { - out[k] = this._write(ns, v); - } - } - return out; +const USER_AGENT = "user-agent"; +const X_AMZ_USER_AGENT = "x-amz-user-agent"; +const SPACE = " "; +const UA_NAME_SEPARATOR = "/"; +const UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g; +const UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g; +const UA_ESCAPE_CHAR = "-"; + +const BYTE_LIMIT = 1024; +function encodeFeatures(features) { + let buffer = ""; + for (const key in features) { + const val = features[key]; + if (buffer.length + val.length + 1 <= BYTE_LIMIT) { + if (buffer.length) { + buffer += "," + val; } else { - return structuredClone(value); + buffer += val; } + continue; } - return value; + break; } + return buffer; } -class JsonCodec extends SerdeContextConfig { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - createSerializer() { - const serializer = new JsonShapeSerializer(this.settings); - serializer.setSerdeContext(this.serdeContext); - return serializer; - } - createDeserializer() { - const deserializer = new JsonShapeDeserializer(this.settings); - deserializer.setSerdeContext(this.serdeContext); - return deserializer; +const userAgentMiddleware = (options) => (next, context) => async (args) => { + const { request } = args; + if (!protocolHttp.HttpRequest.isInstance(request)) { + return next(args); } -} - -class AwsJsonRpcProtocol extends protocols.RpcProtocol { - serializer; - deserializer; - serviceTarget; - codec; - mixin; - awsQueryCompatible; - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) { - super({ - defaultNamespace, - }); - this.serviceTarget = serviceTarget; - this.codec = new JsonCodec({ - timestampFormat: { - useTrait: true, - default: 7, - }, - jsonName: false, - }); - this.serializer = this.codec.createSerializer(); - this.deserializer = this.codec.createDeserializer(); - this.awsQueryCompatible = !!awsQueryCompatible; - this.mixin = new ProtocolLib(this.awsQueryCompatible); + const { headers } = request; + const userAgent = context?.userAgent?.map(escapeUserAgent) || []; + const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); + await checkFeatures(context, options, args); + const awsContext = context; + defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`); + const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; + const appId = await options.userAgentAppId(); + if (appId) { + defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`])); } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - if (!request.path.endsWith("/")) { - request.path += "/"; - } - Object.assign(request.headers, { - "content-type": `application/x-amz-json-${this.getJsonRpcVersion()}`, - "x-amz-target": `${this.serviceTarget}.${operationSchema.name}`, - }); - if (this.awsQueryCompatible) { - request.headers["x-amzn-query-mode"] = "true"; - } - if (schema.deref(operationSchema.input) === "unit" || !request.body) { - request.body = "{}"; + const prefix = utilEndpoints.getUserAgentPrefix(); + const sdkUserAgentValue = (prefix ? [prefix] : []) + .concat([...defaultUserAgent, ...userAgent, ...customUserAgent]) + .join(SPACE); + const normalUAValue = [ + ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), + ...customUserAgent, + ].join(SPACE); + if (options.runtime !== "browser") { + if (normalUAValue) { + headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] + ? `${headers[USER_AGENT]} ${normalUAValue}` + : normalUAValue; } - return request; + headers[USER_AGENT] = sdkUserAgentValue; } - getPayloadCodec() { - return this.codec; + else { + headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; } - async handleError(operationSchema, context, response, dataObject, metadata) { - if (this.awsQueryCompatible) { - this.mixin.setQueryCompatError(dataObject, response); - } - const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().jsonName ?? name; - output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]); - } - if (this.awsQueryCompatible) { - this.mixin.queryCompatOutput(dataObject, output); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message, - }, output), dataObject); + return next({ + ...args, + request, + }); +}; +const escapeUserAgent = (userAgentPair) => { + const name = userAgentPair[0] + .split(UA_NAME_SEPARATOR) + .map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)) + .join(UA_NAME_SEPARATOR); + const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); + const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR); + const prefix = name.substring(0, prefixSeparatorIndex); + let uaName = name.substring(prefixSeparatorIndex + 1); + if (prefix === "api") { + uaName = uaName.toLowerCase(); } -} + return [prefix, uaName, version] + .filter((item) => item && item.length > 0) + .reduce((acc, item, index) => { + switch (index) { + case 0: + return item; + case 1: + return `${acc}/${item}`; + default: + return `${acc}#${item}`; + } + }, ""); +}; +const getUserAgentMiddlewareOptions = { + name: "getUserAgentMiddleware", + step: "build", + priority: "low", + tags: ["SET_USER_AGENT", "USER_AGENT"], + override: true, +}; +const getUserAgentPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); + }, +}); + +exports.DEFAULT_UA_APP_ID = DEFAULT_UA_APP_ID; +exports.getUserAgentMiddlewareOptions = getUserAgentMiddlewareOptions; +exports.getUserAgentPlugin = getUserAgentPlugin; +exports.resolveUserAgentConfig = resolveUserAgentConfig; +exports.userAgentMiddleware = userAgentMiddleware; + + +/***/ }), + +/***/ 6463: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var stsRegionDefaultResolver = __nccwpck_require__(5779); +var configResolver = __nccwpck_require__(9316); + +const getAwsRegionExtensionConfiguration = (runtimeConfig) => { + return { + setRegion(region) { + runtimeConfig.region = region; + }, + region() { + return runtimeConfig.region; + }, + }; +}; +const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => { + return { + region: awsRegionExtensionConfiguration.region(), + }; +}; + +exports.NODE_REGION_CONFIG_FILE_OPTIONS = configResolver.NODE_REGION_CONFIG_FILE_OPTIONS; +exports.NODE_REGION_CONFIG_OPTIONS = configResolver.NODE_REGION_CONFIG_OPTIONS; +exports.REGION_ENV_NAME = configResolver.REGION_ENV_NAME; +exports.REGION_INI_NAME = configResolver.REGION_INI_NAME; +exports.resolveRegionConfig = configResolver.resolveRegionConfig; +exports.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration; +exports.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration; +Object.prototype.hasOwnProperty.call(stsRegionDefaultResolver, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: stsRegionDefaultResolver['__proto__'] + }); -class AwsJson1_0Protocol extends AwsJsonRpcProtocol { - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) { - super({ - defaultNamespace, - serviceTarget, - awsQueryCompatible, - }); - } - getShapeId() { - return "aws.protocols#awsJson1_0"; - } - getJsonRpcVersion() { - return "1.0"; - } - getDefaultContentType() { - return "application/x-amz-json-1.0"; - } -} +Object.keys(stsRegionDefaultResolver).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = stsRegionDefaultResolver[k]; +}); -class AwsJson1_1Protocol extends AwsJsonRpcProtocol { - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) { - super({ - defaultNamespace, - serviceTarget, - awsQueryCompatible, - }); - } - getShapeId() { - return "aws.protocols#awsJson1_1"; - } - getJsonRpcVersion() { - return "1.1"; - } - getDefaultContentType() { - return "application/x-amz-json-1.1"; - } -} -class AwsRestJsonProtocol extends protocols.HttpBindingProtocol { - serializer; - deserializer; - codec; - mixin = new ProtocolLib(); - constructor({ defaultNamespace }) { - super({ - defaultNamespace, - }); - const settings = { - timestampFormat: { - useTrait: true, - default: 7, - }, - httpBindings: true, - jsonName: true, - }; - this.codec = new JsonCodec(settings); - this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); - this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); - } - getShapeId() { - return "aws.protocols#restJson1"; - } - getPayloadCodec() { - return this.codec; - } - setSerdeContext(serdeContext) { - this.codec.setSerdeContext(serdeContext); - super.setSerdeContext(serdeContext); - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - const inputSchema = schema.NormalizedSchema.of(operationSchema.input); - if (!request.headers["content-type"]) { - const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); - if (contentType) { - request.headers["content-type"] = contentType; +/***/ }), + +/***/ 5779: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.warning = void 0; +exports.stsRegionDefaultResolver = stsRegionDefaultResolver; +const config_resolver_1 = __nccwpck_require__(9316); +const node_config_provider_1 = __nccwpck_require__(5704); +function stsRegionDefaultResolver(loaderConfig = {}) { + return (0, node_config_provider_1.loadConfig)({ + ...config_resolver_1.NODE_REGION_CONFIG_OPTIONS, + async default() { + if (!exports.warning.silence) { + console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."); } - } - if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) { - request.body = "{}"; - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - const output = await super.deserializeResponse(operationSchema, context, response); - const outputSchema = schema.NormalizedSchema.of(operationSchema.output); - for (const [name, member] of outputSchema.structIterator()) { - if (member.getMemberTraits().httpPayload && !(name in output)) { - output[name] = null; + return "us-east-1"; + }, + }, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }); +} +exports.warning = { + silence: false, +}; + + +/***/ }), + +/***/ 3068: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var utilEndpoints = __nccwpck_require__(9674); +var urlParser = __nccwpck_require__(4494); + +const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!isVirtualHostableS3Bucket(label)) { + return false; } } - return output; + return true; } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - await this.deserializeHttpMessage(errorSchema, context, response, dataObject); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().jsonName ?? name; - output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message, - }, output), dataObject); + if (!utilEndpoints.isValidHostLabel(value)) { + return false; } - getDefaultContentType() { - return "application/json"; + if (value.length < 3 || value.length > 63) { + return false; } -} - -const awsExpectUnion = (value) => { - if (value == null) { - return undefined; + if (value !== value.toLowerCase()) { + return false; } - if (typeof value === "object" && "__type" in value) { - delete value.__type; + if (utilEndpoints.isIpAddress(value)) { + return false; } - return smithyClient.expectUnion(value); + return true; }; -class XmlShapeDeserializer extends SerdeContextConfig { - settings; - stringDeserializer; - constructor(settings) { - super(); - this.settings = settings; - this.stringDeserializer = new protocols.FromStringShapeDeserializer(settings); - } - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - this.stringDeserializer.setSerdeContext(serdeContext); - } - read(schema$1, bytes, key) { - const ns = schema.NormalizedSchema.of(schema$1); - const memberSchemas = ns.getMemberSchemas(); - const isEventPayload = ns.isStructSchema() && - ns.isMemberSchema() && - !!Object.values(memberSchemas).find((memberNs) => { - return !!memberNs.getMemberTraits().eventPayload; - }); - if (isEventPayload) { - const output = {}; - const memberName = Object.keys(memberSchemas)[0]; - const eventMemberSchema = memberSchemas[memberName]; - if (eventMemberSchema.isBlobSchema()) { - output[memberName] = bytes; - } - else { - output[memberName] = this.read(memberSchemas[memberName], bytes); - } - return output; - } - const xmlString = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(bytes); - const parsedObject = this.parseXml(xmlString); - return this.readSchema(schema$1, key ? parsedObject[key] : parsedObject); - } - readSchema(_schema, value) { - const ns = schema.NormalizedSchema.of(_schema); - if (ns.isUnitSchema()) { - return; - } - const traits = ns.getMergedTraits(); - if (ns.isListSchema() && !Array.isArray(value)) { - return this.readSchema(ns, [value]); - } - if (value == null) { - return value; - } - if (typeof value === "object") { - const sparse = !!traits.sparse; - const flat = !!traits.xmlFlattened; - if (ns.isListSchema()) { - const listValue = ns.getValueSchema(); - const buffer = []; - const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; - const source = flat ? value : (value[0] ?? value)[sourceKey]; - const sourceArray = Array.isArray(source) ? source : [source]; - for (const v of sourceArray) { - if (v != null || sparse) { - buffer.push(this.readSchema(listValue, v)); - } - } - return buffer; - } - const buffer = {}; - if (ns.isMapSchema()) { - const keyNs = ns.getKeySchema(); - const memberNs = ns.getValueSchema(); - let entries; - if (flat) { - entries = Array.isArray(value) ? value : [value]; - } - else { - entries = Array.isArray(value.entry) ? value.entry : [value.entry]; - } - const keyProperty = keyNs.getMergedTraits().xmlName ?? "key"; - const valueProperty = memberNs.getMergedTraits().xmlName ?? "value"; - for (const entry of entries) { - const key = entry[keyProperty]; - const value = entry[valueProperty]; - if (value != null || sparse) { - buffer[key] = this.readSchema(memberNs, value); - } - } - return buffer; - } - if (ns.isStructSchema()) { - for (const [memberName, memberSchema] of ns.structIterator()) { - const memberTraits = memberSchema.getMergedTraits(); - const xmlObjectKey = !memberTraits.httpPayload - ? memberSchema.getMemberTraits().xmlName ?? memberName - : memberTraits.xmlName ?? memberSchema.getName(); - if (value[xmlObjectKey] != null) { - buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); - } - } - return buffer; - } - if (ns.isDocumentSchema()) { - return value; +const ARN_DELIMITER = ":"; +const RESOURCE_DELIMITER = "/"; +const parseArn = (value) => { + const segments = value.split(ARN_DELIMITER); + if (segments.length < 6) + return null; + const [arn, partition, service, region, accountId, ...resourcePath] = segments; + if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") + return null; + const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); + return { + partition, + service, + region, + accountId, + resourceId, + }; +}; + +var partitions = [ + { + id: "aws", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-east-1", + name: "aws", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", + regions: { + "af-south-1": { + description: "Africa (Cape Town)" + }, + "ap-east-1": { + description: "Asia Pacific (Hong Kong)" + }, + "ap-east-2": { + description: "Asia Pacific (Taipei)" + }, + "ap-northeast-1": { + description: "Asia Pacific (Tokyo)" + }, + "ap-northeast-2": { + description: "Asia Pacific (Seoul)" + }, + "ap-northeast-3": { + description: "Asia Pacific (Osaka)" + }, + "ap-south-1": { + description: "Asia Pacific (Mumbai)" + }, + "ap-south-2": { + description: "Asia Pacific (Hyderabad)" + }, + "ap-southeast-1": { + description: "Asia Pacific (Singapore)" + }, + "ap-southeast-2": { + description: "Asia Pacific (Sydney)" + }, + "ap-southeast-3": { + description: "Asia Pacific (Jakarta)" + }, + "ap-southeast-4": { + description: "Asia Pacific (Melbourne)" + }, + "ap-southeast-5": { + description: "Asia Pacific (Malaysia)" + }, + "ap-southeast-6": { + description: "Asia Pacific (New Zealand)" + }, + "ap-southeast-7": { + description: "Asia Pacific (Thailand)" + }, + "aws-global": { + description: "aws global region" + }, + "ca-central-1": { + description: "Canada (Central)" + }, + "ca-west-1": { + description: "Canada West (Calgary)" + }, + "eu-central-1": { + description: "Europe (Frankfurt)" + }, + "eu-central-2": { + description: "Europe (Zurich)" + }, + "eu-north-1": { + description: "Europe (Stockholm)" + }, + "eu-south-1": { + description: "Europe (Milan)" + }, + "eu-south-2": { + description: "Europe (Spain)" + }, + "eu-west-1": { + description: "Europe (Ireland)" + }, + "eu-west-2": { + description: "Europe (London)" + }, + "eu-west-3": { + description: "Europe (Paris)" + }, + "il-central-1": { + description: "Israel (Tel Aviv)" + }, + "me-central-1": { + description: "Middle East (UAE)" + }, + "me-south-1": { + description: "Middle East (Bahrain)" + }, + "mx-central-1": { + description: "Mexico (Central)" + }, + "sa-east-1": { + description: "South America (Sao Paulo)" + }, + "us-east-1": { + description: "US East (N. Virginia)" + }, + "us-east-2": { + description: "US East (Ohio)" + }, + "us-west-1": { + description: "US West (N. California)" + }, + "us-west-2": { + description: "US West (Oregon)" + } + } + }, + { + id: "aws-cn", + outputs: { + dnsSuffix: "amazonaws.com.cn", + dualStackDnsSuffix: "api.amazonwebservices.com.cn", + implicitGlobalRegion: "cn-northwest-1", + name: "aws-cn", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^cn\\-\\w+\\-\\d+$", + regions: { + "aws-cn-global": { + description: "aws-cn global region" + }, + "cn-north-1": { + description: "China (Beijing)" + }, + "cn-northwest-1": { + description: "China (Ningxia)" + } + } + }, + { + id: "aws-eusc", + outputs: { + dnsSuffix: "amazonaws.eu", + dualStackDnsSuffix: "api.amazonwebservices.eu", + implicitGlobalRegion: "eusc-de-east-1", + name: "aws-eusc", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", + regions: { + "eusc-de-east-1": { + description: "AWS European Sovereign Cloud (Germany)" + } + } + }, + { + id: "aws-iso", + outputs: { + dnsSuffix: "c2s.ic.gov", + dualStackDnsSuffix: "api.aws.ic.gov", + implicitGlobalRegion: "us-iso-east-1", + name: "aws-iso", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", + regions: { + "aws-iso-global": { + description: "aws-iso global region" + }, + "us-iso-east-1": { + description: "US ISO East" + }, + "us-iso-west-1": { + description: "US ISO WEST" + } + } + }, + { + id: "aws-iso-b", + outputs: { + dnsSuffix: "sc2s.sgov.gov", + dualStackDnsSuffix: "api.aws.scloud", + implicitGlobalRegion: "us-isob-east-1", + name: "aws-iso-b", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", + regions: { + "aws-iso-b-global": { + description: "aws-iso-b global region" + }, + "us-isob-east-1": { + description: "US ISOB East (Ohio)" + }, + "us-isob-west-1": { + description: "US ISOB West" + } + } + }, + { + id: "aws-iso-e", + outputs: { + dnsSuffix: "cloud.adc-e.uk", + dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", + implicitGlobalRegion: "eu-isoe-west-1", + name: "aws-iso-e", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + regions: { + "aws-iso-e-global": { + description: "aws-iso-e global region" + }, + "eu-isoe-west-1": { + description: "EU ISOE West" + } + } + }, + { + id: "aws-iso-f", + outputs: { + dnsSuffix: "csp.hci.ic.gov", + dualStackDnsSuffix: "api.aws.hci.ic.gov", + implicitGlobalRegion: "us-isof-south-1", + name: "aws-iso-f", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + regions: { + "aws-iso-f-global": { + description: "aws-iso-f global region" + }, + "us-isof-east-1": { + description: "US ISOF EAST" + }, + "us-isof-south-1": { + description: "US ISOF SOUTH" + } + } + }, + { + id: "aws-us-gov", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-gov-west-1", + name: "aws-us-gov", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", + regions: { + "aws-us-gov-global": { + description: "aws-us-gov global region" + }, + "us-gov-east-1": { + description: "AWS GovCloud (US-East)" + }, + "us-gov-west-1": { + description: "AWS GovCloud (US-West)" + } + } + } +]; +var version = "1.1"; +var partitionsInfo = { + partitions: partitions, + version: version +}; + +let selectedPartitionsInfo = partitionsInfo; +let selectedUserAgentPrefix = ""; +const partition = (value) => { + const { partitions } = selectedPartitionsInfo; + for (const partition of partitions) { + const { regions, outputs } = partition; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData, + }; } - throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`); - } - if (ns.isListSchema()) { - return []; } - if (ns.isMapSchema() || ns.isStructSchema()) { - return {}; - } - return this.stringDeserializer.read(ns, value); } - parseXml(xml) { - if (xml.length) { - let parsedObj; - try { - parsedObj = xmlBuilder.parseXML(xml); - } - catch (e) { - if (e && typeof e === "object") { - Object.defineProperty(e, "$responseBodyText", { - value: xml, - }); - } - 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 smithyClient.getValueFromTextNode(parsedObjToReturn); + for (const partition of partitions) { + const { regionRegex, outputs } = partition; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs, + }; } - return {}; - } -} - -class QueryShapeSerializer extends SerdeContextConfig { - settings; - buffer; - constructor(settings) { - super(); - this.settings = settings; } - write(schema$1, value, prefix = "") { - if (this.buffer === undefined) { - this.buffer = ""; - } - const ns = schema.NormalizedSchema.of(schema$1); - if (prefix && !prefix.endsWith(".")) { - prefix += "."; - } - if (ns.isBlobSchema()) { - if (typeof value === "string" || value instanceof Uint8Array) { - this.writeKey(prefix); - this.writeValue((this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value)); - } - } - else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(String(value)); - } - else if (ns.isIdempotencyToken()) { - this.writeKey(prefix); - this.writeValue(serde.generateIdempotencyToken()); - } - } - else if (ns.isBigIntegerSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(String(value)); - } - } - else if (ns.isBigDecimalSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(value instanceof serde.NumericValue ? value.string : String(value)); - } - } - else if (ns.isTimestampSchema()) { - if (value instanceof Date) { - this.writeKey(prefix); - const format = protocols.determineTimestampFormat(ns, this.settings); - switch (format) { - case 5: - this.writeValue(value.toISOString().replace(".000Z", "Z")); - break; - case 6: - this.writeValue(smithyClient.dateToUtcString(value)); - break; - case 7: - this.writeValue(String(value.getTime() / 1000)); - break; - } - } - } - else if (ns.isDocumentSchema()) { - throw new Error(`@aws-sdk/core/protocols - QuerySerializer unsupported document type ${ns.getName(true)}`); - } - else if (ns.isListSchema()) { - if (Array.isArray(value)) { - if (value.length === 0) { - if (this.settings.serializeEmptyLists) { - this.writeKey(prefix); - this.writeValue(""); - } - } - else { - const member = ns.getValueSchema(); - const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened; - let i = 1; - for (const item of value) { - if (item == null) { - continue; - } - const suffix = this.getKey("member", member.getMergedTraits().xmlName); - const key = flat ? `${prefix}${i}` : `${prefix}${suffix}.${i}`; - this.write(member, item, key); - ++i; - } - } - } - } - else if (ns.isMapSchema()) { - if (value && typeof value === "object") { - const keySchema = ns.getKeySchema(); - const memberSchema = ns.getValueSchema(); - const flat = ns.getMergedTraits().xmlFlattened; - let i = 1; - for (const [k, v] of Object.entries(value)) { - if (v == null) { - continue; - } - const keySuffix = this.getKey("key", keySchema.getMergedTraits().xmlName); - const key = flat ? `${prefix}${i}.${keySuffix}` : `${prefix}entry.${i}.${keySuffix}`; - const valueSuffix = this.getKey("value", memberSchema.getMergedTraits().xmlName); - const valueKey = flat ? `${prefix}${i}.${valueSuffix}` : `${prefix}entry.${i}.${valueSuffix}`; - this.write(keySchema, k, key); - this.write(memberSchema, v, valueKey); - ++i; - } - } - } - else if (ns.isStructSchema()) { - if (value && typeof value === "object") { - for (const [memberName, member] of ns.structIterator()) { - if (value[memberName] == null && !member.isIdempotencyToken()) { - continue; - } - const suffix = this.getKey(memberName, member.getMergedTraits().xmlName); - const key = `${prefix}${suffix}`; - this.write(member, value[memberName], key); - } - } - } - else if (ns.isUnitSchema()) ; - else { - throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`); - } + const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws"); + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex," + + " and default partition with id 'aws' doesn't exist."); } - flush() { - if (this.buffer === undefined) { - throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer."); - } - const str = this.buffer; - delete this.buffer; - return str; + return { + ...DEFAULT_PARTITION.outputs, + }; +}; +const setPartitionInfo = (partitionsInfo, userAgentPrefix = "") => { + selectedPartitionsInfo = partitionsInfo; + selectedUserAgentPrefix = userAgentPrefix; +}; +const useDefaultPartitionInfo = () => { + setPartitionInfo(partitionsInfo, ""); +}; +const getUserAgentPrefix = () => selectedUserAgentPrefix; + +const awsEndpointFunctions = { + isVirtualHostableS3Bucket: isVirtualHostableS3Bucket, + parseArn: parseArn, + partition: partition, +}; +utilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions; + +const resolveDefaultAwsRegionalEndpointsConfig = (input) => { + if (typeof input.endpointProvider !== "function") { + throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client."); } - getKey(memberName, xmlName) { - const key = xmlName ?? memberName; - if (this.settings.capitalizeKeys) { - return key[0].toUpperCase() + key.slice(1); - } - return key; + const { endpoint } = input; + if (endpoint === undefined) { + input.endpoint = async () => { + return toEndpointV1(input.endpointProvider({ + Region: typeof input.region === "function" ? await input.region() : input.region, + UseDualStack: typeof input.useDualstackEndpoint === "function" + ? await input.useDualstackEndpoint() + : input.useDualstackEndpoint, + UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint, + Endpoint: undefined, + }, { logger: input.logger })); + }; } - writeKey(key) { - if (key.endsWith(".")) { - key = key.slice(0, key.length - 1); + return input; +}; +const toEndpointV1 = (endpoint) => urlParser.parseUrl(endpoint.url); + +exports.EndpointError = utilEndpoints.EndpointError; +exports.isIpAddress = utilEndpoints.isIpAddress; +exports.resolveEndpoint = utilEndpoints.resolveEndpoint; +exports.awsEndpointFunctions = awsEndpointFunctions; +exports.getUserAgentPrefix = getUserAgentPrefix; +exports.partition = partition; +exports.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig; +exports.setPartitionInfo = setPartitionInfo; +exports.toEndpointV1 = toEndpointV1; +exports.useDefaultPartitionInfo = useDefaultPartitionInfo; + + +/***/ }), + +/***/ 1656: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var node_os = __nccwpck_require__(8161); +var node_process = __nccwpck_require__(1708); +var promises = __nccwpck_require__(1455); +var node_path = __nccwpck_require__(6760); +var middlewareUserAgent = __nccwpck_require__(2959); + +const getRuntimeUserAgentPair = () => { + const runtimesToCheck = ["deno", "bun", "llrt"]; + for (const runtime of runtimesToCheck) { + if (node_process.versions[runtime]) { + return [`md/${runtime}`, node_process.versions[runtime]]; } - this.buffer += `&${protocols.extendedEncodeURIComponent(key)}=`; - } - writeValue(value) { - this.buffer += protocols.extendedEncodeURIComponent(value); } -} + return ["md/nodejs", node_process.versions.node]; +}; -class AwsQueryProtocol extends protocols.RpcProtocol { - options; - serializer; - deserializer; - mixin = new ProtocolLib(); - constructor(options) { - super({ - defaultNamespace: options.defaultNamespace, - }); - this.options = options; - const settings = { - timestampFormat: { - useTrait: true, - default: 5, - }, - httpBindings: false, - xmlNamespace: options.xmlNamespace, - serviceNamespace: options.defaultNamespace, - serializeEmptyLists: true, - }; - this.serializer = new QueryShapeSerializer(settings); - this.deserializer = new XmlShapeDeserializer(settings); +const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/; +const getSanitizedTypeScriptVersion = (version = "") => { + const match = version.match(SEMVER_REGEX); + if (!match) { + return undefined; } - getShapeId() { - return "aws.protocols#awsQuery"; + const [major, minor, patch, prerelease] = [match[1], match[2], match[3], match[4]]; + return prerelease ? `${major}.${minor}.${patch}-${prerelease}` : `${major}.${minor}.${patch}`; +}; + +const typescriptPackageJsonPath = node_path.join("node_modules", "typescript", "package.json"); +const getTypeScriptPackageJsonPaths = (dirname) => { + const cwdPath = node_path.join(process.cwd(), typescriptPackageJsonPath); + if (!dirname) { + return [cwdPath]; } - setSerdeContext(serdeContext) { - this.serializer.setSerdeContext(serdeContext); - this.deserializer.setSerdeContext(serdeContext); + const normalizedPath = node_path.normalize(dirname); + const parts = normalizedPath.split(node_path.sep); + const nodeModulesIndex = parts.indexOf("node_modules"); + const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(node_path.sep) : dirname; + const parentDirPath = node_path.join(parentDir, typescriptPackageJsonPath); + if (cwdPath === parentDirPath) { + return [cwdPath]; } - getPayloadCodec() { - throw new Error("AWSQuery protocol has no payload codec."); + return [parentDirPath, cwdPath]; +}; + +let tscVersion; +const getTypeScriptUserAgentPair = async () => { + if (tscVersion === null) { + return undefined; } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - if (!request.path.endsWith("/")) { - request.path += "/"; - } - Object.assign(request.headers, { - "content-type": `application/x-www-form-urlencoded`, - }); - if (schema.deref(operationSchema.input) === "unit" || !request.body) { - request.body = ""; - } - const action = operationSchema.name.split("#")[1] ?? operationSchema.name; - request.body = `Action=${action}&Version=${this.options.version}` + request.body; - if (request.body.endsWith("&")) { - request.body = request.body.slice(-1); - } - return request; + else if (typeof tscVersion === "string") { + return ["md/tsc", tscVersion]; } - async deserializeResponse(operationSchema, context, response) { - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes = await protocols.collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes)); + const dirname = typeof __dirname !== "undefined" ? __dirname : undefined; + for (const typescriptPackageJsonPath of getTypeScriptPackageJsonPaths(dirname)) { + try { + const packageJson = await promises.readFile(typescriptPackageJsonPath, "utf-8"); + const { version } = JSON.parse(packageJson); + const sanitizedVersion = getSanitizedTypeScriptVersion(version); + if (typeof sanitizedVersion !== "string") { + continue; } - await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); - } - for (const header in response.headers) { - const value = response.headers[header]; - delete response.headers[header]; - response.headers[header.toLowerCase()] = value; + tscVersion = sanitizedVersion; + return ["md/tsc", tscVersion]; } - const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name; - const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : undefined; - const bytes = await protocols.collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey)); + catch { } - const output = { - $metadata: this.deserializeMetadata(response), - ...dataObject, - }; - return output; } - useNestedResult() { - return true; + tscVersion = null; + return undefined; +}; + +const crtAvailability = { + isCrtAvailable: false, +}; + +const isCrtAvailable = () => { + if (crtAvailability.isCrtAvailable) { + return ["md/crt-avail"]; } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown"; - const errorData = this.loadQueryError(dataObject); - const message = this.loadQueryErrorMessage(dataObject); - errorData.message = message; - errorData.Error = { - Type: errorData.Type, - Code: errorData.Code, - Message: message, - }; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, (registry, errorName) => { - try { - return registry.getSchema(errorName); - } - catch (e) { - return registry.find((schema$1) => schema.NormalizedSchema.of(schema$1).getMergedTraits().awsQueryError?.[0] === errorName); - } - }); - const ns = schema.NormalizedSchema.of(errorSchema); - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - const output = { - Error: errorData.Error, - }; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().xmlName ?? name; - const value = errorData[target] ?? dataObject[target]; - output[name] = this.deserializer.readSchema(member, value); + return null; +}; + +const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => { + const runtimeUserAgentPair = getRuntimeUserAgentPair(); + return async (config) => { + const sections = [ + ["aws-sdk-js", clientVersion], + ["ua", "2.1"], + [`os/${node_os.platform()}`, node_os.release()], + ["lang/js"], + runtimeUserAgentPair, + ]; + const typescriptUserAgentPair = await getTypeScriptUserAgentPair(); + if (typescriptUserAgentPair) { + sections.push(typescriptUserAgentPair); } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message, - }, output), dataObject); - } - loadQueryErrorCode(output, data) { - const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code; - if (code !== undefined) { - return code; + const crtAvailable = isCrtAvailable(); + if (crtAvailable) { + sections.push(crtAvailable); } - if (output.statusCode == 404) { - return "NotFound"; + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); } - } - loadQueryError(data) { - return data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error; - } - loadQueryErrorMessage(data) { - const errorData = this.loadQueryError(data); - return errorData?.message ?? errorData?.Message ?? data.message ?? data.Message ?? "Unknown"; - } - getDefaultContentType() { - return "application/x-www-form-urlencoded"; - } + if (node_process.env.AWS_EXECUTION_ENV) { + sections.push([`exec-env/${node_process.env.AWS_EXECUTION_ENV}`]); + } + const appId = await config?.userAgentAppId?.(); + const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; + return resolvedUserAgent; + }; +}; +const defaultUserAgent = createDefaultUserAgentProvider; + +const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; +const UA_APP_ID_INI_NAME = "sdk_ua_app_id"; +const UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id"; +const NODE_APP_ID_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], + default: middlewareUserAgent.DEFAULT_UA_APP_ID, +}; + +exports.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS; +exports.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME; +exports.UA_APP_ID_INI_NAME = UA_APP_ID_INI_NAME; +exports.createDefaultUserAgentProvider = createDefaultUserAgentProvider; +exports.crtAvailability = crtAvailability; +exports.defaultUserAgent = defaultUserAgent; + + +/***/ }), + +/***/ 4274: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var xmlParser = __nccwpck_require__(3343); + +function escapeAttribute(value) { + return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); } -class AwsEc2QueryProtocol extends AwsQueryProtocol { - options; - constructor(options) { - super(options); - this.options = options; - const ec2Settings = { - capitalizeKeys: true, - flattenLists: true, - serializeEmptyLists: false, - }; - Object.assign(this.serializer.settings, ec2Settings); +function escapeElement(value) { + return value + .replace(/&/g, "&") + .replace(/"/g, """) + .replace(/'/g, "'") + .replace(//g, ">") + .replace(/\r/g, " ") + .replace(/\n/g, " ") + .replace(/\u0085/g, "…") + .replace(/\u2028/, "
"); +} + +class XmlText { + value; + constructor(value) { + this.value = value; } - useNestedResult() { - return false; + toString() { + return escapeElement("" + this.value); } } -const parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - let parsedObj; - try { - parsedObj = xmlBuilder.parseXML(encoded); - } - catch (e) { - if (e && typeof e === "object") { - Object.defineProperty(e, "$responseBodyText", { - value: encoded, - }); - } - throw e; +class XmlNode { + name; + children; + attributes = {}; + static of(name, childText, withName) { + const node = new XmlNode(name); + if (childText !== undefined) { + node.addChildNode(new XmlText(childText)); } - const textNodeName = "#text"; - const key = Object.keys(parsedObj)[0]; - const parsedObjToReturn = parsedObj[key]; - if (parsedObjToReturn[textNodeName]) { - parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; - delete parsedObjToReturn[textNodeName]; + if (withName !== undefined) { + node.withName(withName); } - return smithyClient.getValueFromTextNode(parsedObjToReturn); + return node; } - return {}; -}); -const parseXmlErrorBody = async (errorBody, context) => { - const value = await parseXmlBody(errorBody, context); - if (value.Error) { - value.Error.message = value.Error.message ?? value.Error.Message; + constructor(name, children = []) { + this.name = name; + this.children = children; } - return value; -}; -const loadRestXmlErrorCode = (output, data) => { - if (data?.Error?.Code !== undefined) { - return data.Error.Code; + withName(name) { + this.name = name; + return this; } - if (data?.Code !== undefined) { - return data.Code; + addAttribute(name, value) { + this.attributes[name] = value; + return this; } - if (output.statusCode == 404) { - return "NotFound"; + addChildNode(child) { + this.children.push(child); + return this; } -}; - -class XmlShapeSerializer extends SerdeContextConfig { - settings; - stringBuffer; - byteBuffer; - buffer; - constructor(settings) { - super(); - this.settings = settings; + removeAttribute(name) { + delete this.attributes[name]; + return this; } - write(schema$1, value) { - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isStringSchema() && typeof value === "string") { - this.stringBuffer = value; - } - else if (ns.isBlobSchema()) { - this.byteBuffer = - "byteLength" in value - ? value - : (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value); - } - else { - this.buffer = this.writeStruct(ns, value, undefined); - const traits = ns.getMergedTraits(); - if (traits.httpPayload && !traits.xmlName) { - this.buffer.withName(ns.getName()); - } - } + n(name) { + this.name = name; + return this; } - flush() { - if (this.byteBuffer !== undefined) { - const bytes = this.byteBuffer; - delete this.byteBuffer; - return bytes; - } - if (this.stringBuffer !== undefined) { - const str = this.stringBuffer; - delete this.stringBuffer; - return str; - } - const buffer = this.buffer; - if (this.settings.xmlNamespace) { - if (!buffer?.attributes?.["xmlns"]) { - buffer.addAttribute("xmlns", this.settings.xmlNamespace); - } - } - delete this.buffer; - return buffer.toString(); + c(child) { + this.children.push(child); + return this; } - writeStruct(ns, value, parentXmlns) { - const traits = ns.getMergedTraits(); - const name = ns.isMemberSchema() && !traits.httpPayload - ? ns.getMemberTraits().xmlName ?? ns.getMemberName() - : traits.xmlName ?? ns.getName(); - if (!name || !ns.isStructSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`); - } - const structXmlNode = xmlBuilder.XmlNode.of(name); - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); - for (const [memberName, memberSchema] of ns.structIterator()) { - const val = value[memberName]; - if (val != null || memberSchema.isIdempotencyToken()) { - if (memberSchema.getMergedTraits().xmlAttribute) { - structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val)); - continue; - } - if (memberSchema.isListSchema()) { - this.writeList(memberSchema, val, structXmlNode, xmlns); - } - else if (memberSchema.isMapSchema()) { - this.writeMap(memberSchema, val, structXmlNode, xmlns); - } - else if (memberSchema.isStructSchema()) { - structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns)); - } - else { - const memberNode = xmlBuilder.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName()); - this.writeSimpleInto(memberSchema, val, memberNode, xmlns); - structXmlNode.addChildNode(memberNode); - } - } - } - if (xmlns) { - structXmlNode.addAttribute(xmlnsAttr, xmlns); + a(name, value) { + if (value != null) { + this.attributes[name] = value; } - return structXmlNode; + return this; } - writeList(listMember, array, container, parentXmlns) { - if (!listMember.isMemberSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`); - } - const listTraits = listMember.getMergedTraits(); - const listValueSchema = listMember.getValueSchema(); - const listValueTraits = listValueSchema.getMergedTraits(); - const sparse = !!listValueTraits.sparse; - const flat = !!listTraits.xmlFlattened; - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns); - const writeItem = (container, value) => { - if (listValueSchema.isListSchema()) { - this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container, xmlns); - } - else if (listValueSchema.isMapSchema()) { - this.writeMap(listValueSchema, value, container, xmlns); - } - else if (listValueSchema.isStructSchema()) { - const struct = this.writeStruct(listValueSchema, value, xmlns); - container.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member")); - } - else { - const listItemNode = xmlBuilder.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"); - this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns); - container.addChildNode(listItemNode); - } - }; - if (flat) { - for (const value of array) { - if (sparse || value != null) { - writeItem(container, value); - } - } - } - else { - const listNode = xmlBuilder.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName()); - if (xmlns) { - listNode.addAttribute(xmlnsAttr, xmlns); - } - for (const value of array) { - if (sparse || value != null) { - writeItem(listNode, value); - } - } - container.addChildNode(listNode); + cc(input, field, withName = field) { + if (input[field] != null) { + const node = XmlNode.of(field, input[field]).withName(withName); + this.c(node); } } - writeMap(mapMember, map, container, parentXmlns, containerIsMap = false) { - if (!mapMember.isMemberSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`); - } - const mapTraits = mapMember.getMergedTraits(); - const mapKeySchema = mapMember.getKeySchema(); - const mapKeyTraits = mapKeySchema.getMergedTraits(); - const keyTag = mapKeyTraits.xmlName ?? "key"; - const mapValueSchema = mapMember.getValueSchema(); - const mapValueTraits = mapValueSchema.getMergedTraits(); - const valueTag = mapValueTraits.xmlName ?? "value"; - const sparse = !!mapValueTraits.sparse; - const flat = !!mapTraits.xmlFlattened; - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns); - const addKeyValue = (entry, key, val) => { - const keyNode = xmlBuilder.XmlNode.of(keyTag, key); - const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns); - if (keyXmlns) { - keyNode.addAttribute(keyXmlnsAttr, keyXmlns); - } - entry.addChildNode(keyNode); - let valueNode = xmlBuilder.XmlNode.of(valueTag); - if (mapValueSchema.isListSchema()) { - this.writeList(mapValueSchema, val, valueNode, xmlns); - } - else if (mapValueSchema.isMapSchema()) { - this.writeMap(mapValueSchema, val, valueNode, xmlns, true); - } - else if (mapValueSchema.isStructSchema()) { - valueNode = this.writeStruct(mapValueSchema, val, xmlns); - } - else { - this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns); - } - entry.addChildNode(valueNode); - }; - if (flat) { - for (const [key, val] of Object.entries(map)) { - if (sparse || val != null) { - const entry = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); - addKeyValue(entry, key, val); - container.addChildNode(entry); - } - } - } - else { - let mapNode; - if (!containerIsMap) { - mapNode = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); - if (xmlns) { - mapNode.addAttribute(xmlnsAttr, xmlns); - } - container.addChildNode(mapNode); - } - for (const [key, val] of Object.entries(map)) { - if (sparse || val != null) { - const entry = xmlBuilder.XmlNode.of("entry"); - addKeyValue(entry, key, val); - (containerIsMap ? container : mapNode).addChildNode(entry); - } - } + l(input, listName, memberName, valueProvider) { + if (input[listName] != null) { + const nodes = valueProvider(); + nodes.map((node) => { + node.withName(memberName); + this.c(node); + }); } } - writeSimple(_schema, value) { - if (null === value) { - throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value."); - } - const ns = schema.NormalizedSchema.of(_schema); - let nodeContents = null; - if (value && typeof value === "object") { - if (ns.isBlobSchema()) { - nodeContents = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - } - else if (ns.isTimestampSchema() && value instanceof Date) { - const format = protocols.determineTimestampFormat(ns, this.settings); - switch (format) { - case 5: - nodeContents = value.toISOString().replace(".000Z", "Z"); - break; - case 6: - nodeContents = smithyClient.dateToUtcString(value); - break; - case 7: - nodeContents = String(value.getTime() / 1000); - break; - default: - console.warn("Missing timestamp format, using http date", value); - nodeContents = smithyClient.dateToUtcString(value); - break; - } - } - else if (ns.isBigDecimalSchema() && value) { - if (value instanceof serde.NumericValue) { - return value.string; - } - return String(value); - } - else if (ns.isMapSchema() || ns.isListSchema()) { - throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."); - } - else { - throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`); - } - } - if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) { - nodeContents = String(value); + lc(input, listName, memberName, valueProvider) { + if (input[listName] != null) { + const nodes = valueProvider(); + const containerNode = new XmlNode(memberName); + nodes.map((node) => { + containerNode.c(node); + }); + this.c(containerNode); } - if (ns.isStringSchema()) { - if (value === undefined && ns.isIdempotencyToken()) { - nodeContents = serde.generateIdempotencyToken(); - } - else { - nodeContents = String(value); + } + toString() { + const hasChildren = Boolean(this.children.length); + let xmlText = `<${this.name}`; + const attributes = this.attributes; + for (const attributeName of Object.keys(attributes)) { + const attribute = attributes[attributeName]; + if (attribute != null) { + xmlText += ` ${attributeName}="${escapeAttribute("" + attribute)}"`; } } - if (nodeContents === null) { - throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`); - } - return nodeContents; + return (xmlText += !hasChildren ? "/>" : `>${this.children.map((c) => c.toString()).join("")}`); } - writeSimpleInto(_schema, value, into, parentXmlns) { - const nodeContents = this.writeSimple(_schema, value); - const ns = schema.NormalizedSchema.of(_schema); - const content = new xmlBuilder.XmlText(nodeContents); - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); - if (xmlns) { - into.addAttribute(xmlnsAttr, xmlns); - } - into.addChildNode(content); +} + +exports.parseXML = xmlParser.parseXML; +exports.XmlNode = XmlNode; +exports.XmlText = XmlText; + + +/***/ }), + +/***/ 3343: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseXML = parseXML; +const fast_xml_parser_1 = __nccwpck_require__(591); +const parser = new fast_xml_parser_1.XMLParser({ + attributeNamePrefix: "", + htmlEntities: true, + ignoreAttributes: false, + ignoreDeclaration: true, + parseTagValue: false, + trimValues: false, + tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + maxNestedTags: 1024, +}); +parser.addEntity("#xD", "\r"); +parser.addEntity("#10", "\n"); +function parseXML(xmlString) { + return parser.parse(xmlString, true); +} + + +/***/ }), + +/***/ 9320: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +const PROTECTED_KEYS = { + REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"), + X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"), + TENANT_ID: Symbol.for("_AWS_LAMBDA_TENANT_ID"), +}; +const NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? ""); +if (!NO_GLOBAL_AWS_LAMBDA) { + globalThis.awslambda = globalThis.awslambda || {}; +} +class InvokeStoreBase { + static PROTECTED_KEYS = PROTECTED_KEYS; + isProtectedKey(key) { + return Object.values(PROTECTED_KEYS).includes(key); } - getXmlnsAttribute(ns, parentXmlns) { - const traits = ns.getMergedTraits(); - const [prefix, xmlns] = traits.xmlNamespace ?? []; - if (xmlns && xmlns !== parentXmlns) { - return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns]; - } - return [void 0, void 0]; + getRequestId() { + return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-"; + } + getXRayTraceId() { + return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID); + } + getTenantId() { + return this.get(PROTECTED_KEYS.TENANT_ID); } } - -class XmlCodec extends SerdeContextConfig { - settings; - constructor(settings) { - super(); - this.settings = settings; +class InvokeStoreSingle extends InvokeStoreBase { + currentContext; + getContext() { + return this.currentContext; } - createSerializer() { - const serializer = new XmlShapeSerializer(this.settings); - serializer.setSerdeContext(this.serdeContext); - return serializer; + hasContext() { + return this.currentContext !== undefined; } - createDeserializer() { - const deserializer = new XmlShapeDeserializer(this.settings); - deserializer.setSerdeContext(this.serdeContext); - return deserializer; + get(key) { + return this.currentContext?.[key]; + } + set(key, value) { + if (this.isProtectedKey(key)) { + throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); + } + this.currentContext = this.currentContext || {}; + this.currentContext[key] = value; + } + run(context, fn) { + this.currentContext = context; + return fn(); } } - -class AwsRestXmlProtocol extends protocols.HttpBindingProtocol { - codec; - serializer; - deserializer; - mixin = new ProtocolLib(); - constructor(options) { - super(options); - const settings = { - timestampFormat: { - useTrait: true, - default: 5, - }, - httpBindings: true, - xmlNamespace: options.xmlNamespace, - serviceNamespace: options.defaultNamespace, - }; - this.codec = new XmlCodec(settings); - this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); - this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); +class InvokeStoreMulti extends InvokeStoreBase { + als; + static async create() { + const instance = new InvokeStoreMulti(); + const asyncHooks = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6698, 23)); + instance.als = new asyncHooks.AsyncLocalStorage(); + return instance; } - getPayloadCodec() { - return this.codec; + getContext() { + return this.als.getStore(); } - getShapeId() { - return "aws.protocols#restXml"; + hasContext() { + return this.als.getStore() !== undefined; } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - const inputSchema = schema.NormalizedSchema.of(operationSchema.input); - if (!request.headers["content-type"]) { - const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); - if (contentType) { - request.headers["content-type"] = contentType; - } + get(key) { + return this.als.getStore()?.[key]; + } + set(key, value) { + if (this.isProtectedKey(key)) { + throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); } - if (request.headers["content-type"] === this.getDefaultContentType()) { - if (typeof request.body === "string") { - request.body = '' + request.body; - } + const store = this.als.getStore(); + if (!store) { + throw new Error("No context available"); } - return request; + store[key] = value; } - async deserializeResponse(operationSchema, context, response) { - return super.deserializeResponse(operationSchema, context, response); + run(context, fn) { + return this.als.run(context, fn); } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - await this.deserializeHttpMessage(errorSchema, context, response, dataObject); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().xmlName ?? name; - const value = dataObject.Error?.[target] ?? dataObject[target]; - output[name] = this.codec.createDeserializer().readSchema(member, value); +} +exports.InvokeStore = void 0; +(function (InvokeStore) { + let instance = null; + async function getInstanceAsync() { + if (!instance) { + instance = (async () => { + const isMulti = "AWS_LAMBDA_MAX_CONCURRENCY" in process.env; + const newInstance = isMulti + ? await InvokeStoreMulti.create() + : new InvokeStoreSingle(); + if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) { + return globalThis.awslambda.InvokeStore; + } + else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) { + globalThis.awslambda.InvokeStore = newInstance; + return newInstance; + } + else { + return newInstance; + } + })(); } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message, - }, output), dataObject); - } - getDefaultContentType() { - return "application/xml"; + return instance; } -} + InvokeStore.getInstanceAsync = getInstanceAsync; + InvokeStore._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" + ? { + reset: () => { + instance = null; + if (globalThis.awslambda?.InvokeStore) { + delete globalThis.awslambda.InvokeStore; + } + globalThis.awslambda = { InvokeStore: undefined }; + }, + } + : undefined; +})(exports.InvokeStore || (exports.InvokeStore = {})); -exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol; -exports.AwsJson1_0Protocol = AwsJson1_0Protocol; -exports.AwsJson1_1Protocol = AwsJson1_1Protocol; -exports.AwsJsonRpcProtocol = AwsJsonRpcProtocol; -exports.AwsQueryProtocol = AwsQueryProtocol; -exports.AwsRestJsonProtocol = AwsRestJsonProtocol; -exports.AwsRestXmlProtocol = AwsRestXmlProtocol; -exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol; -exports.JsonCodec = JsonCodec; -exports.JsonShapeDeserializer = JsonShapeDeserializer; -exports.JsonShapeSerializer = JsonShapeSerializer; -exports.XmlCodec = XmlCodec; -exports.XmlShapeDeserializer = XmlShapeDeserializer; -exports.XmlShapeSerializer = XmlShapeSerializer; -exports._toBool = _toBool; -exports._toNum = _toNum; -exports._toStr = _toStr; -exports.awsExpectUnion = awsExpectUnion; -exports.loadRestJsonErrorCode = loadRestJsonErrorCode; -exports.loadRestXmlErrorCode = loadRestXmlErrorCode; -exports.parseJsonBody = parseJsonBody; -exports.parseJsonErrorBody = parseJsonErrorBody; -exports.parseXmlBody = parseXmlBody; -exports.parseXmlErrorBody = parseXmlErrorBody; +exports.InvokeStoreBase = InvokeStoreBase; /***/ }), -/***/ 5606: +/***/ 9316: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var client = __nccwpck_require__(5152); -var propertyProvider = __nccwpck_require__(8857); +var utilConfigProvider = __nccwpck_require__(6716); +var utilMiddleware = __nccwpck_require__(6324); +var utilEndpoints = __nccwpck_require__(9674); -const ENV_KEY = "AWS_ACCESS_KEY_ID"; -const ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; -const ENV_SESSION = "AWS_SESSION_TOKEN"; -const ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; -const ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; -const ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID"; -const fromEnv = (init) => async () => { - init?.logger?.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) { - const credentials = { - accessKeyId, - secretAccessKey, - ...(sessionToken && { sessionToken }), - ...(expiry && { expiration: new Date(expiry) }), - ...(credentialScope && { credentialScope }), - ...(accountId && { accountId }), - }; - client.setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g"); - return credentials; - } - throw new propertyProvider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger }); +const ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; +const CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; +const DEFAULT_USE_DUALSTACK_ENDPOINT = false; +const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.ENV), + configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), + default: false, }; -exports.ENV_ACCOUNT_ID = ENV_ACCOUNT_ID; -exports.ENV_CREDENTIAL_SCOPE = ENV_CREDENTIAL_SCOPE; -exports.ENV_EXPIRATION = ENV_EXPIRATION; -exports.ENV_KEY = ENV_KEY; -exports.ENV_SECRET = ENV_SECRET; -exports.ENV_SESSION = ENV_SESSION; -exports.fromEnv = fromEnv; - - -/***/ }), +const ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; +const CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; +const DEFAULT_USE_FIPS_ENDPOINT = false; +const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.ENV), + configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), + default: false, +}; -/***/ 5861: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +const resolveCustomEndpointsConfig = (input) => { + const { tls, endpoint, urlParser, useDualstackEndpoint } = input; + return Object.assign(input, { + tls: tls ?? true, + endpoint: utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), + isCustomEndpoint: true, + useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false), + }); +}; -"use strict"; +const getEndpointFromRegion = 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 input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); +}; +const resolveEndpointsConfig = (input) => { + const useDualstackEndpoint = utilMiddleware.normalizeProvider(input.useDualstackEndpoint ?? false); + const { endpoint, useFipsEndpoint, urlParser, tls } = input; + return Object.assign(input, { + tls: tls ?? true, + endpoint: endpoint + ? utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) + : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }), + isCustomEndpoint: !!endpoint, + useDualstackEndpoint, + }); +}; -var credentialProviderEnv = __nccwpck_require__(5606); -var propertyProvider = __nccwpck_require__(8857); -var sharedIniFileLoader = __nccwpck_require__(4964); +const REGION_ENV_NAME = "AWS_REGION"; +const REGION_INI_NAME = "region"; +const NODE_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[REGION_ENV_NAME], + configFileSelector: (profile) => profile[REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + }, +}; +const NODE_REGION_CONFIG_FILE_OPTIONS = { + preferredFile: "credentials", +}; -const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; -const remoteProvider = async (init) => { - const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await __nccwpck_require__.e(/* import() */ 566).then(__nccwpck_require__.t.bind(__nccwpck_require__, 566, 19)); - if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) { - init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata"); - const { fromHttp } = await __nccwpck_require__.e(/* import() */ 605).then(__nccwpck_require__.bind(__nccwpck_require__, 8605)); - return propertyProvider.chain(fromHttp(init), fromContainerMetadata(init)); +const validRegions = new Set(); +const checkRegion = (region, check = utilEndpoints.isValidHostLabel) => { + if (!validRegions.has(region) && !check(region)) { + if (region === "*") { + console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`); + } + else { + throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`); + } } - if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") { - return async () => { - throw new propertyProvider.CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger }); - }; + else { + validRegions.add(region); } - init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"); - return fromInstanceMetadata(init); }; -function memoizeChain(providers, treatAsExpired) { - const chain = internalCreateChain(providers); - let activeLock; - let passiveLock; - let credentials; - const provider = async (options) => { - if (options?.forceRefresh) { - return await chain(options); - } - if (credentials?.expiration) { - if (credentials?.expiration?.getTime() < Date.now()) { - credentials = undefined; - } - } - if (activeLock) { - await activeLock; - } - else if (!credentials || treatAsExpired?.(credentials)) { - if (credentials) { - if (!passiveLock) { - passiveLock = chain(options).then((c) => { - credentials = c; - passiveLock = undefined; - }); - } - } - else { - activeLock = chain(options).then((c) => { - credentials = c; - activeLock = undefined; - }); - return provider(options); - } - } - return credentials; - }; - return provider; -} -const internalCreateChain = (providers) => async (awsIdentityProperties) => { - let lastProviderError; - for (const provider of providers) { - try { - return await provider(awsIdentityProperties); - } - catch (err) { - lastProviderError = err; - if (err?.tryNextLink) { - continue; +const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); + +const getRealRegion = (region) => isFipsRegion(region) + ? ["fips-aws-global", "aws-fips"].includes(region) + ? "us-east-1" + : region.replace(/fips-(dkr-|prod-)?|-fips/, "") + : region; + +const resolveRegionConfig = (input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); + } + return Object.assign(input, { + region: async () => { + const providedRegion = typeof region === "function" ? await region() : region; + const realRegion = getRealRegion(providedRegion); + checkRegion(realRegion); + return realRegion; + }, + useFipsEndpoint: async () => { + const providedRegion = typeof region === "string" ? region : await region(); + if (isFipsRegion(providedRegion)) { + return true; } - throw err; + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + }, + }); +}; + +const getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))?.hostname; + +const getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname + ? regionHostname + : partitionHostname + ? partitionHostname.replace("{region}", resolvedRegion) + : undefined; + +const getResolvedPartition = (region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws"; + +const getResolvedSigningRegion = (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); } } - throw lastProviderError; }; -let multipleCredentialSourceWarningEmitted = false; -const defaultProvider = (init = {}) => memoizeChain([ - async () => { - const profile = init.profile ?? process.env[sharedIniFileLoader.ENV_PROFILE]; - if (profile) { - const envStaticCredentialsAreSet = process.env[credentialProviderEnv.ENV_KEY] && process.env[credentialProviderEnv.ENV_SECRET]; - if (envStaticCredentialsAreSet) { - if (!multipleCredentialSourceWarningEmitted) { - const warnFn = init.logger?.warn && init.logger?.constructor?.name !== "NoOpLogger" - ? init.logger.warn.bind(init.logger) - : console.warn; - warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING: - Multiple credential sources detected: - Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set. - This SDK will proceed with the AWS_PROFILE value. - - However, a future version may change this behavior to prefer the ENV static credentials. - Please ensure that your environment only sets either the AWS_PROFILE or the - AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair. -`); - multipleCredentialSourceWarningEmitted = true; - } - } - throw new propertyProvider.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", { - logger: init.logger, - tryNextLink: true, - }); - } - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"); - return credentialProviderEnv.fromEnv(init)(); - }, - async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO"); - const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; - if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { - throw new propertyProvider.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger }); - } - const { fromSSO } = await __nccwpck_require__.e(/* import() */ 998).then(__nccwpck_require__.t.bind(__nccwpck_require__, 998, 19)); - return fromSSO(init)(awsIdentityProperties); - }, - async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni"); - const { fromIni } = await __nccwpck_require__.e(/* import() */ 869).then(__nccwpck_require__.t.bind(__nccwpck_require__, 5869, 19)); - return fromIni(init)(awsIdentityProperties); - }, - async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess"); - const { fromProcess } = await __nccwpck_require__.e(/* import() */ 360).then(__nccwpck_require__.t.bind(__nccwpck_require__, 5360, 19)); - return fromProcess(init)(awsIdentityProperties); - }, - async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile"); - const { fromTokenFile } = await __nccwpck_require__.e(/* import() */ 956).then(__nccwpck_require__.t.bind(__nccwpck_require__, 9956, 23)); - return fromTokenFile(init)(awsIdentityProperties); - }, - async () => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"); - return (await remoteProvider(init))(); - }, - async () => { - throw new propertyProvider.CredentialsProviderError("Could not load credentials from any providers", { - tryNextLink: false, - logger: init.logger, - }); - }, -], credentialsTreatedAsExpired); -const credentialsWillNeedRefresh = (credentials) => credentials?.expiration !== undefined; -const credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000; +const getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => { + const partition = getResolvedPartition(region, { partitionHash }); + const resolvedRegion = region in regionHash ? region : partitionHash[partition]?.endpoint ?? region; + const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; + const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions); + const partitionHostname = getHostnameFromVariants(partitionHash[partition]?.variants, hostnameOptions); + const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname }); + if (hostname === undefined) { + throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); + } + const signingRegion = getResolvedSigningRegion(hostname, { + signingRegion: regionHash[resolvedRegion]?.signingRegion, + regionRegex: partitionHash[partition].regionRegex, + useFipsEndpoint, + }); + return { + partition, + signingService, + hostname, + ...(signingRegion && { signingRegion }), + ...(regionHash[resolvedRegion]?.signingService && { + signingService: regionHash[resolvedRegion].signingService, + }), + }; +}; -exports.credentialsTreatedAsExpired = credentialsTreatedAsExpired; -exports.credentialsWillNeedRefresh = credentialsWillNeedRefresh; -exports.defaultProvider = defaultProvider; +exports.CONFIG_USE_DUALSTACK_ENDPOINT = CONFIG_USE_DUALSTACK_ENDPOINT; +exports.CONFIG_USE_FIPS_ENDPOINT = CONFIG_USE_FIPS_ENDPOINT; +exports.DEFAULT_USE_DUALSTACK_ENDPOINT = DEFAULT_USE_DUALSTACK_ENDPOINT; +exports.DEFAULT_USE_FIPS_ENDPOINT = DEFAULT_USE_FIPS_ENDPOINT; +exports.ENV_USE_DUALSTACK_ENDPOINT = ENV_USE_DUALSTACK_ENDPOINT; +exports.ENV_USE_FIPS_ENDPOINT = ENV_USE_FIPS_ENDPOINT; +exports.NODE_REGION_CONFIG_FILE_OPTIONS = NODE_REGION_CONFIG_FILE_OPTIONS; +exports.NODE_REGION_CONFIG_OPTIONS = NODE_REGION_CONFIG_OPTIONS; +exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS; +exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS; +exports.REGION_ENV_NAME = REGION_ENV_NAME; +exports.REGION_INI_NAME = REGION_INI_NAME; +exports.getRegionInfo = getRegionInfo; +exports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; +exports.resolveEndpointsConfig = resolveEndpointsConfig; +exports.resolveRegionConfig = resolveRegionConfig; /***/ }), -/***/ 2590: +/***/ 402: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +var types = __nccwpck_require__(690); +var utilMiddleware = __nccwpck_require__(6324); +var middlewareSerde = __nccwpck_require__(3255); var protocolHttp = __nccwpck_require__(2356); +var protocols = __nccwpck_require__(3422); -function resolveHostHeaderConfig(input) { - return input; +const getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {}); + +const resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => { + if (!authSchemePreference || authSchemePreference.length === 0) { + return candidateAuthOptions; + } + const preferredAuthOptions = []; + for (const preferredSchemeName of authSchemePreference) { + for (const candidateAuthOption of candidateAuthOptions) { + const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; + if (candidateAuthSchemeName === preferredSchemeName) { + preferredAuthOptions.push(candidateAuthOption); + } + } + } + for (const candidateAuthOption of candidateAuthOptions) { + if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { + preferredAuthOptions.push(candidateAuthOption); + } + } + return preferredAuthOptions; +}; + +function convertHttpAuthSchemesToMap(httpAuthSchemes) { + const map = new Map(); + for (const scheme of httpAuthSchemes) { + map.set(scheme.schemeId, scheme); + } + return map; } -const hostHeaderMiddleware = (options) => (next) => async (args) => { - if (!protocolHttp.HttpRequest.isInstance(args.request)) - return next(args); - const { request } = args; - const { handlerProtocol = "" } = options.requestHandler.metadata || {}; - if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { - delete request.headers["host"]; - request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : ""); +const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => { + const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input)); + const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : []; + const resolvedOptions = resolveAuthOptions(options, authSchemePreference); + const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); + const smithyContext = utilMiddleware.getSmithyContext(context); + const failureReasons = []; + for (const option of resolvedOptions) { + const scheme = authSchemes.get(option.schemeId); + if (!scheme) { + failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); + continue; + } + const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config)); + if (!identityProvider) { + failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); + continue; + } + const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {}; + option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties); + option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties); + smithyContext.selectedHttpAuthScheme = { + httpAuthOption: option, + identity: await identityProvider(option.identityProperties), + signer: scheme.signer, + }; + break; } - else if (!request.headers["host"]) { - let host = request.hostname; - if (request.port != null) - host += `:${request.port}`; - request.headers["host"] = host; + if (!smithyContext.selectedHttpAuthScheme) { + throw new Error(failureReasons.join("\n")); } return next(args); }; -const hostHeaderMiddlewareOptions = { - name: "hostHeaderMiddleware", - step: "build", - priority: "low", - tags: ["HOST"], + +const httpAuthSchemeEndpointRuleSetMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", override: true, + relation: "before", + toMiddleware: "endpointV2Middleware", }; -const getHostHeaderPlugin = (options) => ({ +const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({ applyToStack: (clientStack) => { - clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); + clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider, + }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); }, }); -exports.getHostHeaderPlugin = getHostHeaderPlugin; -exports.hostHeaderMiddleware = hostHeaderMiddleware; -exports.hostHeaderMiddlewareOptions = hostHeaderMiddlewareOptions; -exports.resolveHostHeaderConfig = resolveHostHeaderConfig; - - -/***/ }), - -/***/ 5242: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -const loggerMiddleware = () => (next, context) => async (args) => { - try { - const response = await next(args); - const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; - const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; - const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog; - const { $metadata, ...outputWithoutMetadata } = response.output; - logger?.info?.({ - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - output: outputFilterSensitiveLog(outputWithoutMetadata), - metadata: $metadata, - }); - return response; - } - catch (error) { - const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; - const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; - logger?.error?.({ - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - error, - metadata: error.$metadata, - }); - throw error; - } -}; -const loggerMiddlewareOptions = { - name: "loggerMiddleware", - tags: ["LOGGER"], - step: "initialize", +const httpAuthSchemeMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", override: true, + relation: "before", + toMiddleware: middlewareSerde.serializerMiddlewareOption.name, }; -const getLoggerPlugin = (options) => ({ +const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({ applyToStack: (clientStack) => { - clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); + clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider, + }), httpAuthSchemeMiddlewareOptions); }, }); -exports.getLoggerPlugin = getLoggerPlugin; -exports.loggerMiddleware = loggerMiddleware; -exports.loggerMiddlewareOptions = loggerMiddlewareOptions; - - -/***/ }), - -/***/ 1568: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var recursionDetectionMiddleware = __nccwpck_require__(2521); +const defaultErrorHandler = (signingProperties) => (error) => { + throw error; +}; +const defaultSuccessHandler = (httpResponse, signingProperties) => { }; +const httpSigningMiddleware = (config) => (next, context) => async (args) => { + if (!protocolHttp.HttpRequest.isInstance(args.request)) { + return next(args); + } + const smithyContext = utilMiddleware.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; +}; -const recursionDetectionMiddlewareOptions = { - step: "build", - tags: ["RECURSION_DETECTION"], - name: "recursionDetectionMiddleware", +const httpSigningMiddlewareOptions = { + step: "finalizeRequest", + tags: ["HTTP_SIGNING"], + name: "httpSigningMiddleware", + aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], override: true, - priority: "low", + relation: "after", + toMiddleware: "retryMiddleware", }; - -const getRecursionDetectionPlugin = (options) => ({ +const getHttpSigningPlugin = (config) => ({ applyToStack: (clientStack) => { - clientStack.add(recursionDetectionMiddleware.recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions); + clientStack.addRelativeTo(httpSigningMiddleware(), httpSigningMiddlewareOptions); }, }); -exports.getRecursionDetectionPlugin = getRecursionDetectionPlugin; -Object.keys(recursionDetectionMiddleware).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return recursionDetectionMiddleware[k]; } - }); -}); +const normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; +}; +const makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => { + let command = new CommandCtor(input); + command = withCommand(command) ?? command; + return await client.send(command, ...args); +}; +function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { + return async function* paginateOperation(config, input, ...additionalArguments) { + const _input = input; + let token = config.startingToken ?? _input[inputTokenName]; + 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, config.withCommand, ...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 undefined; + }; +} +const get = (fromObject, path) => { + let cursor = fromObject; + const pathComponents = path.split("."); + for (const step of pathComponents) { + if (!cursor || typeof cursor !== "object") { + return undefined; + } + cursor = cursor[step]; + } + return cursor; +}; -/***/ }), +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; +} -/***/ 2521: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +class DefaultIdentityProviderConfig { + authSchemes = new Map(); + constructor(config) { + for (const [key, value] of Object.entries(config)) { + if (value !== undefined) { + this.authSchemes.set(key, value); + } + } + } + getIdentityProvider(schemeId) { + return this.authSchemes.get(schemeId); + } +} -"use strict"; +class HttpApiKeyAuthSigner { + 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 = protocolHttp.HttpRequest.clone(httpRequest); + if (signingProperties.in === types.HttpApiKeyAuthLocation.QUERY) { + clonedRequest.query[signingProperties.name] = identity.apiKey; + } + else if (signingProperties.in === types.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; + } +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.recursionDetectionMiddleware = void 0; -const lambda_invoke_store_1 = __nccwpck_require__(9320); -const protocol_http_1 = __nccwpck_require__(2356); -const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; -const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; -const ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; -const recursionDetectionMiddleware = () => (next) => async (args) => { - const { request } = args; - if (!protocol_http_1.HttpRequest.isInstance(request)) { - return next(args); +class HttpBearerAuthSigner { + async sign(httpRequest, identity, signingProperties) { + const clonedRequest = protocolHttp.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; } - const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? - TRACE_ID_HEADER_NAME; - if (request.headers.hasOwnProperty(traceIdHeader)) { - return next(args); +} + +class NoAuthSigner { + async sign(httpRequest, identity, signingProperties) { + return httpRequest; } - const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; - const traceIdFromEnv = process.env[ENV_TRACE_ID]; - const invokeStore = await lambda_invoke_store_1.InvokeStore.getInstanceAsync(); - const traceIdFromInvokeStore = invokeStore?.getXRayTraceId(); - const traceId = traceIdFromInvokeStore ?? traceIdFromEnv; - const nonEmptyString = (str) => typeof str === "string" && str.length > 0; - if (nonEmptyString(functionName) && nonEmptyString(traceId)) { - request.headers[TRACE_ID_HEADER_NAME] = traceId; +} + +const createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired(identity) { + return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs; +}; +const EXPIRATION_MS = 300_000; +const isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); +const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined; +const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => { + if (provider === undefined) { + return undefined; } - return next({ - ...args, - request, - }); + 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); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } + finally { + pending = undefined; + } + return resolved; + }; + if (isExpired === undefined) { + 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; + }; }; -exports.recursionDetectionMiddleware = recursionDetectionMiddleware; + +exports.requestBuilder = protocols.requestBuilder; +exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig; +exports.EXPIRATION_MS = EXPIRATION_MS; +exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner; +exports.HttpBearerAuthSigner = HttpBearerAuthSigner; +exports.NoAuthSigner = NoAuthSigner; +exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction; +exports.createPaginator = createPaginator; +exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh; +exports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin; +exports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin; +exports.getHttpSigningPlugin = getHttpSigningPlugin; +exports.getSmithyContext = getSmithyContext; +exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = httpAuthSchemeEndpointRuleSetMiddlewareOptions; +exports.httpAuthSchemeMiddleware = httpAuthSchemeMiddleware; +exports.httpAuthSchemeMiddlewareOptions = httpAuthSchemeMiddlewareOptions; +exports.httpSigningMiddleware = httpSigningMiddleware; +exports.httpSigningMiddlewareOptions = httpSigningMiddlewareOptions; +exports.isIdentityExpired = isIdentityExpired; +exports.memoizeIdentityProvider = memoizeIdentityProvider; +exports.normalizeProvider = normalizeProvider; +exports.setFeature = setFeature; /***/ }), -/***/ 2959: +/***/ 4645: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var core = __nccwpck_require__(402); -var utilEndpoints = __nccwpck_require__(3068); +var serde = __nccwpck_require__(2430); +var utilUtf8 = __nccwpck_require__(1577); +var protocols = __nccwpck_require__(3422); var protocolHttp = __nccwpck_require__(2356); -var core$1 = __nccwpck_require__(8704); +var utilBodyLengthBrowser = __nccwpck_require__(2098); +var schema = __nccwpck_require__(6890); +var utilMiddleware = __nccwpck_require__(6324); +var utilBase64 = __nccwpck_require__(8385); -const DEFAULT_UA_APP_ID = undefined; -function isValidUserAgentAppId(appId) { - if (appId === undefined) { - return true; - } - return typeof appId === "string" && appId.length <= 50; +const majorUint64 = 0; +const majorNegativeInt64 = 1; +const majorUnstructuredByteString = 2; +const majorUtf8String = 3; +const majorList = 4; +const majorMap = 5; +const majorTag = 6; +const majorSpecial = 7; +const specialFalse = 20; +const specialTrue = 21; +const specialNull = 22; +const specialUndefined = 23; +const extendedOneByte = 24; +const extendedFloat16 = 25; +const extendedFloat32 = 26; +const extendedFloat64 = 27; +const minorIndefinite = 31; +function alloc(size) { + return typeof Buffer !== "undefined" ? Buffer.alloc(size) : new Uint8Array(size); } -function resolveUserAgentConfig(input) { - const normalizedAppIdProvider = core.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID); - const { customUserAgent } = input; - return Object.assign(input, { - customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, - userAgentAppId: async () => { - const appId = await normalizedAppIdProvider(); - if (!isValidUserAgentAppId(appId)) { - const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; - if (typeof appId !== "string") { - logger?.warn("userAgentAppId must be a string or undefined."); +const tagSymbol = Symbol("@smithy/core/cbor::tagSymbol"); +function tag(data) { + data[tagSymbol] = true; + return data; +} + +const USE_TEXT_DECODER = typeof TextDecoder !== "undefined"; +const USE_BUFFER$1 = typeof Buffer !== "undefined"; +let payload = alloc(0); +let dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); +const textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null; +let _offset = 0; +function setPayload(bytes) { + payload = bytes; + dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); +} +function decode(at, to) { + if (at >= to) { + throw new Error("unexpected end of (decode) payload."); + } + const major = (payload[at] & 0b1110_0000) >> 5; + const minor = payload[at] & 0b0001_1111; + switch (major) { + case majorUint64: + case majorNegativeInt64: + case majorTag: + let unsignedInt; + let offset; + if (minor < 24) { + unsignedInt = minor; + offset = 1; + } + else { + switch (minor) { + case extendedOneByte: + case extendedFloat16: + case extendedFloat32: + case extendedFloat64: + const countLength = minorValueToArgumentLength[minor]; + const countOffset = (countLength + 1); + offset = countOffset; + if (to - at < countOffset) { + throw new Error(`countLength ${countLength} greater than remaining buf len.`); + } + const countIndex = at + 1; + if (countLength === 1) { + unsignedInt = payload[countIndex]; + } + else if (countLength === 2) { + unsignedInt = dataView$1.getUint16(countIndex); + } + else if (countLength === 4) { + unsignedInt = dataView$1.getUint32(countIndex); + } + else { + unsignedInt = dataView$1.getBigUint64(countIndex); + } + break; + default: + throw new Error(`unexpected minor value ${minor}.`); + } + } + if (major === majorUint64) { + _offset = offset; + return castBigInt(unsignedInt); + } + else if (major === majorNegativeInt64) { + let negativeInt; + if (typeof unsignedInt === "bigint") { + negativeInt = BigInt(-1) - unsignedInt; + } + else { + negativeInt = -1 - unsignedInt; + } + _offset = offset; + return castBigInt(negativeInt); + } + else { + if (minor === 2 || minor === 3) { + const length = decodeCount(at + offset, to); + let b = BigInt(0); + const start = at + offset + _offset; + for (let i = start; i < start + length; ++i) { + b = (b << BigInt(8)) | BigInt(payload[i]); + } + _offset = offset + _offset + length; + return minor === 3 ? -b - BigInt(1) : b; + } + else if (minor === 4) { + const decimalFraction = decode(at + offset, to); + const [exponent, mantissa] = decimalFraction; + const normalizer = mantissa < 0 ? -1 : 1; + const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa)); + let numericString; + const sign = mantissa < 0 ? "-" : ""; + numericString = + exponent === 0 + ? mantissaStr + : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent); + numericString = numericString.replace(/^0+/g, ""); + if (numericString === "") { + numericString = "0"; + } + if (numericString[0] === ".") { + numericString = "0" + numericString; + } + numericString = sign + numericString; + _offset = offset + _offset; + return serde.nv(numericString); } - else if (appId.length > 50) { - logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); + else { + const value = decode(at + offset, to); + const valueOffset = _offset; + _offset = offset + valueOffset; + return tag({ tag: castBigInt(unsignedInt), value }); } } - return appId; - }, - }); -} - -const ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; -async function checkFeatures(context, config, args) { - const request = args.request; - if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { - core$1.setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M"); - } - if (typeof config.retryStrategy === "function") { - const retryStrategy = await config.retryStrategy(); - if (typeof retryStrategy.acquireInitialRetryToken === "function") { - if (retryStrategy.constructor?.name?.includes("Adaptive")) { - core$1.setFeature(context, "RETRY_MODE_ADAPTIVE", "F"); + case majorUtf8String: + case majorMap: + case majorList: + case majorUnstructuredByteString: + if (minor === minorIndefinite) { + switch (major) { + case majorUtf8String: + return decodeUtf8StringIndefinite(at, to); + case majorMap: + return decodeMapIndefinite(at, to); + case majorList: + return decodeListIndefinite(at, to); + case majorUnstructuredByteString: + return decodeUnstructuredByteStringIndefinite(at, to); + } } else { - core$1.setFeature(context, "RETRY_MODE_STANDARD", "E"); + switch (major) { + case majorUtf8String: + return decodeUtf8String(at, to); + case majorMap: + return decodeMap(at, to); + case majorList: + return decodeList(at, to); + case majorUnstructuredByteString: + return decodeUnstructuredByteString(at, to); + } } + default: + return decodeSpecial(at, to); + } +} +function bytesToUtf8(bytes, at, to) { + if (USE_BUFFER$1 && bytes.constructor?.name === "Buffer") { + return bytes.toString("utf-8", at, to); + } + if (textDecoder) { + return textDecoder.decode(bytes.subarray(at, to)); + } + return utilUtf8.toUtf8(bytes.subarray(at, to)); +} +function demote(bigInteger) { + const num = Number(bigInteger); + if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) { + console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`)); + } + return num; +} +const minorValueToArgumentLength = { + [extendedOneByte]: 1, + [extendedFloat16]: 2, + [extendedFloat32]: 4, + [extendedFloat64]: 8, +}; +function bytesToFloat16(a, b) { + const sign = a >> 7; + const exponent = (a & 0b0111_1100) >> 2; + const fraction = ((a & 0b0000_0011) << 8) | b; + const scalar = sign === 0 ? 1 : -1; + let exponentComponent; + let summation; + if (exponent === 0b00000) { + if (fraction === 0b00000_00000) { + return 0; } else { - core$1.setFeature(context, "RETRY_MODE_LEGACY", "D"); + exponentComponent = Math.pow(2, 1 - 15); + summation = 0; } } - if (typeof config.accountIdEndpointMode === "function") { - const endpointV2 = context.endpointV2; - if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { - core$1.setFeature(context, "ACCOUNT_ID_ENDPOINT", "O"); + else if (exponent === 0b11111) { + if (fraction === 0b00000_00000) { + return scalar * Infinity; } - switch (await config.accountIdEndpointMode?.()) { - case "disabled": - core$1.setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q"); - break; - case "preferred": - core$1.setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P"); - break; - case "required": - core$1.setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R"); - break; + else { + return NaN; } } - const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity; - if (identity?.$source) { - const credentials = identity; - if (credentials.accountId) { - core$1.setFeature(context, "RESOLVED_ACCOUNT_ID", "T"); + else { + exponentComponent = Math.pow(2, exponent - 15); + summation = 1; + } + summation += fraction / 1024; + return scalar * (exponentComponent * summation); +} +function decodeCount(at, to) { + const minor = payload[at] & 0b0001_1111; + if (minor < 24) { + _offset = 1; + return minor; + } + if (minor === extendedOneByte || + minor === extendedFloat16 || + minor === extendedFloat32 || + minor === extendedFloat64) { + const countLength = minorValueToArgumentLength[minor]; + _offset = (countLength + 1); + if (to - at < _offset) { + throw new Error(`countLength ${countLength} greater than remaining buf len.`); } - for (const [key, value] of Object.entries(credentials.$source ?? {})) { - core$1.setFeature(context, key, value); + const countIndex = at + 1; + if (countLength === 1) { + return payload[countIndex]; + } + else if (countLength === 2) { + return dataView$1.getUint16(countIndex); + } + else if (countLength === 4) { + return dataView$1.getUint32(countIndex); } + return demote(dataView$1.getBigUint64(countIndex)); } + throw new Error(`unexpected minor value ${minor}.`); } - -const USER_AGENT = "user-agent"; -const X_AMZ_USER_AGENT = "x-amz-user-agent"; -const SPACE = " "; -const UA_NAME_SEPARATOR = "/"; -const UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g; -const UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g; -const UA_ESCAPE_CHAR = "-"; - -const BYTE_LIMIT = 1024; -function encodeFeatures(features) { - let buffer = ""; - for (const key in features) { - const val = features[key]; - if (buffer.length + val.length + 1 <= BYTE_LIMIT) { - if (buffer.length) { - buffer += "," + val; - } - else { - buffer += val; - } - continue; - } - break; +function decodeUtf8String(at, to) { + const length = decodeCount(at, to); + const offset = _offset; + at += offset; + if (to - at < length) { + throw new Error(`string len ${length} greater than remaining buf len.`); } - return buffer; + const value = bytesToUtf8(payload, at, at + length); + _offset = offset + length; + return value; } - -const userAgentMiddleware = (options) => (next, context) => async (args) => { - const { request } = args; - if (!protocolHttp.HttpRequest.isInstance(request)) { - return next(args); +function decodeUtf8StringIndefinite(at, to) { + at += 1; + const vector = []; + for (const base = at; at < to;) { + if (payload[at] === 0b1111_1111) { + const data = alloc(vector.length); + data.set(vector, 0); + _offset = at - base + 2; + return bytesToUtf8(data, 0, data.length); + } + const major = (payload[at] & 0b1110_0000) >> 5; + const minor = payload[at] & 0b0001_1111; + if (major !== majorUtf8String) { + throw new Error(`unexpected major type ${major} in indefinite string.`); + } + if (minor === minorIndefinite) { + throw new Error("nested indefinite string."); + } + const bytes = decodeUnstructuredByteString(at, to); + const length = _offset; + at += length; + for (let i = 0; i < bytes.length; ++i) { + vector.push(bytes[i]); + } } - const { headers } = request; - const userAgent = context?.userAgent?.map(escapeUserAgent) || []; - const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); - await checkFeatures(context, options, args); - const awsContext = context; - defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`); - const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; - const appId = await options.userAgentAppId(); - if (appId) { - defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`])); + throw new Error("expected break marker."); +} +function decodeUnstructuredByteString(at, to) { + const length = decodeCount(at, to); + const offset = _offset; + at += offset; + if (to - at < length) { + throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`); } - const prefix = utilEndpoints.getUserAgentPrefix(); - const sdkUserAgentValue = (prefix ? [prefix] : []) - .concat([...defaultUserAgent, ...userAgent, ...customUserAgent]) - .join(SPACE); - const normalUAValue = [ - ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), - ...customUserAgent, - ].join(SPACE); - if (options.runtime !== "browser") { - if (normalUAValue) { - headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] - ? `${headers[USER_AGENT]} ${normalUAValue}` - : normalUAValue; + const value = payload.subarray(at, at + length); + _offset = offset + length; + return value; +} +function decodeUnstructuredByteStringIndefinite(at, to) { + at += 1; + const vector = []; + for (const base = at; at < to;) { + if (payload[at] === 0b1111_1111) { + const data = alloc(vector.length); + data.set(vector, 0); + _offset = at - base + 2; + return data; + } + const major = (payload[at] & 0b1110_0000) >> 5; + const minor = payload[at] & 0b0001_1111; + if (major !== majorUnstructuredByteString) { + throw new Error(`unexpected major type ${major} in indefinite string.`); + } + if (minor === minorIndefinite) { + throw new Error("nested indefinite string."); + } + const bytes = decodeUnstructuredByteString(at, to); + const length = _offset; + at += length; + for (let i = 0; i < bytes.length; ++i) { + vector.push(bytes[i]); } - headers[USER_AGENT] = sdkUserAgentValue; } - else { - headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; + throw new Error("expected break marker."); +} +function decodeList(at, to) { + const listDataLength = decodeCount(at, to); + const offset = _offset; + at += offset; + const base = at; + const list = Array(listDataLength); + for (let i = 0; i < listDataLength; ++i) { + const item = decode(at, to); + const itemOffset = _offset; + list[i] = item; + at += itemOffset; } - return next({ - ...args, - request, - }); -}; -const escapeUserAgent = (userAgentPair) => { - const name = userAgentPair[0] - .split(UA_NAME_SEPARATOR) - .map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)) - .join(UA_NAME_SEPARATOR); - const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); - const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR); - const prefix = name.substring(0, prefixSeparatorIndex); - let uaName = name.substring(prefixSeparatorIndex + 1); - if (prefix === "api") { - uaName = uaName.toLowerCase(); + _offset = offset + (at - base); + return list; +} +function decodeListIndefinite(at, to) { + at += 1; + const list = []; + for (const base = at; at < to;) { + if (payload[at] === 0b1111_1111) { + _offset = at - base + 2; + return list; + } + const item = decode(at, to); + const n = _offset; + at += n; + list.push(item); } - return [prefix, uaName, version] - .filter((item) => item && item.length > 0) - .reduce((acc, item, index) => { - switch (index) { - case 0: - return item; - case 1: - return `${acc}/${item}`; - default: - return `${acc}#${item}`; + throw new Error("expected break marker."); +} +function decodeMap(at, to) { + const mapDataLength = decodeCount(at, to); + const offset = _offset; + at += offset; + const base = at; + const map = {}; + for (let i = 0; i < mapDataLength; ++i) { + if (at >= to) { + throw new Error("unexpected end of map payload."); } - }, ""); -}; -const getUserAgentMiddlewareOptions = { - name: "getUserAgentMiddleware", - step: "build", - priority: "low", - tags: ["SET_USER_AGENT", "USER_AGENT"], - override: true, -}; -const getUserAgentPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); - }, -}); - -exports.DEFAULT_UA_APP_ID = DEFAULT_UA_APP_ID; -exports.getUserAgentMiddlewareOptions = getUserAgentMiddlewareOptions; -exports.getUserAgentPlugin = getUserAgentPlugin; -exports.resolveUserAgentConfig = resolveUserAgentConfig; -exports.userAgentMiddleware = userAgentMiddleware; - - -/***/ }), - -/***/ 6463: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var configResolver = __nccwpck_require__(9316); -var stsRegionDefaultResolver = __nccwpck_require__(5779); - -const getAwsRegionExtensionConfiguration = (runtimeConfig) => { - return { - setRegion(region) { - runtimeConfig.region = region; - }, - region() { - return runtimeConfig.region; - }, - }; -}; -const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => { - return { - region: awsRegionExtensionConfiguration.region(), - }; -}; - -Object.defineProperty(exports, "NODE_REGION_CONFIG_FILE_OPTIONS", ({ - enumerable: true, - get: function () { return configResolver.NODE_REGION_CONFIG_FILE_OPTIONS; } -})); -Object.defineProperty(exports, "NODE_REGION_CONFIG_OPTIONS", ({ - enumerable: true, - get: function () { return configResolver.NODE_REGION_CONFIG_OPTIONS; } -})); -Object.defineProperty(exports, "REGION_ENV_NAME", ({ - enumerable: true, - get: function () { return configResolver.REGION_ENV_NAME; } -})); -Object.defineProperty(exports, "REGION_INI_NAME", ({ - enumerable: true, - get: function () { return configResolver.REGION_INI_NAME; } -})); -Object.defineProperty(exports, "resolveRegionConfig", ({ - enumerable: true, - get: function () { return configResolver.resolveRegionConfig; } -})); -exports.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration; -exports.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration; -Object.keys(stsRegionDefaultResolver).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return stsRegionDefaultResolver[k]; } - }); -}); - - -/***/ }), - -/***/ 5779: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.warning = void 0; -exports.stsRegionDefaultResolver = stsRegionDefaultResolver; -const config_resolver_1 = __nccwpck_require__(9316); -const node_config_provider_1 = __nccwpck_require__(5704); -function stsRegionDefaultResolver(loaderConfig = {}) { - return (0, node_config_provider_1.loadConfig)({ - ...config_resolver_1.NODE_REGION_CONFIG_OPTIONS, - async default() { - if (!exports.warning.silence) { - console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."); + const major = (payload[at] & 0b1110_0000) >> 5; + if (major !== majorUtf8String) { + throw new Error(`unexpected major type ${major} for map key at index ${at}.`); + } + const key = decode(at, to); + at += _offset; + const value = decode(at, to); + at += _offset; + map[key] = value; + } + _offset = offset + (at - base); + return map; +} +function decodeMapIndefinite(at, to) { + at += 1; + const base = at; + const map = {}; + for (; at < to;) { + if (at >= to) { + throw new Error("unexpected end of map payload."); + } + if (payload[at] === 0b1111_1111) { + _offset = at - base + 2; + return map; + } + const major = (payload[at] & 0b1110_0000) >> 5; + if (major !== majorUtf8String) { + throw new Error(`unexpected major type ${major} for map key.`); + } + const key = decode(at, to); + at += _offset; + const value = decode(at, to); + at += _offset; + map[key] = value; + } + throw new Error("expected break marker."); +} +function decodeSpecial(at, to) { + const minor = payload[at] & 0b0001_1111; + switch (minor) { + case specialTrue: + case specialFalse: + _offset = 1; + return minor === specialTrue; + case specialNull: + _offset = 1; + return null; + case specialUndefined: + _offset = 1; + return null; + case extendedFloat16: + if (to - at < 3) { + throw new Error("incomplete float16 at end of buf."); } - return "us-east-1"; - }, - }, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }); + _offset = 3; + return bytesToFloat16(payload[at + 1], payload[at + 2]); + case extendedFloat32: + if (to - at < 5) { + throw new Error("incomplete float32 at end of buf."); + } + _offset = 5; + return dataView$1.getFloat32(at + 1); + case extendedFloat64: + if (to - at < 9) { + throw new Error("incomplete float64 at end of buf."); + } + _offset = 9; + return dataView$1.getFloat64(at + 1); + default: + throw new Error(`unexpected minor value ${minor}.`); + } +} +function castBigInt(bigInt) { + if (typeof bigInt === "number") { + return bigInt; + } + const num = Number(bigInt); + if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) { + return num; + } + return bigInt; } -exports.warning = { - silence: false, -}; - - -/***/ }), - -/***/ 3068: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var utilEndpoints = __nccwpck_require__(9674); -var urlParser = __nccwpck_require__(4494); -const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { - if (allowSubDomains) { - for (const label of value.split(".")) { - if (!isVirtualHostableS3Bucket(label)) { - return false; - } +const USE_BUFFER = typeof Buffer !== "undefined"; +const initialSize = 2048; +let data = alloc(initialSize); +let dataView = new DataView(data.buffer, data.byteOffset, data.byteLength); +let cursor = 0; +function ensureSpace(bytes) { + const remaining = data.byteLength - cursor; + if (remaining < bytes) { + if (cursor < 16_000_000) { + resize(Math.max(data.byteLength * 4, data.byteLength + bytes)); + } + else { + resize(data.byteLength + bytes + 16_000_000); } - return true; } - if (!utilEndpoints.isValidHostLabel(value)) { - return false; +} +function toUint8Array() { + const out = alloc(cursor); + out.set(data.subarray(0, cursor), 0); + cursor = 0; + return out; +} +function resize(size) { + const old = data; + data = alloc(size); + if (old) { + if (old.copy) { + old.copy(data, 0, 0, old.byteLength); + } + else { + data.set(old, 0); + } } - if (value.length < 3 || value.length > 63) { - return false; + dataView = new DataView(data.buffer, data.byteOffset, data.byteLength); +} +function encodeHeader(major, value) { + if (value < 24) { + data[cursor++] = (major << 5) | value; } - if (value !== value.toLowerCase()) { - return false; + else if (value < 1 << 8) { + data[cursor++] = (major << 5) | 24; + data[cursor++] = value; } - if (utilEndpoints.isIpAddress(value)) { - return false; + else if (value < 1 << 16) { + data[cursor++] = (major << 5) | extendedFloat16; + dataView.setUint16(cursor, value); + cursor += 2; } - return true; -}; - -const ARN_DELIMITER = ":"; -const RESOURCE_DELIMITER = "/"; -const parseArn = (value) => { - const segments = value.split(ARN_DELIMITER); - if (segments.length < 6) - return null; - const [arn, partition, service, region, accountId, ...resourcePath] = segments; - if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") - return null; - const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); - return { - partition, - service, - region, - accountId, - resourceId, - }; -}; - -var partitions = [ - { - id: "aws", - outputs: { - dnsSuffix: "amazonaws.com", - dualStackDnsSuffix: "api.aws", - implicitGlobalRegion: "us-east-1", - name: "aws", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", - regions: { - "af-south-1": { - description: "Africa (Cape Town)" - }, - "ap-east-1": { - description: "Asia Pacific (Hong Kong)" - }, - "ap-east-2": { - description: "Asia Pacific (Taipei)" - }, - "ap-northeast-1": { - description: "Asia Pacific (Tokyo)" - }, - "ap-northeast-2": { - description: "Asia Pacific (Seoul)" - }, - "ap-northeast-3": { - description: "Asia Pacific (Osaka)" - }, - "ap-south-1": { - description: "Asia Pacific (Mumbai)" - }, - "ap-south-2": { - description: "Asia Pacific (Hyderabad)" - }, - "ap-southeast-1": { - description: "Asia Pacific (Singapore)" - }, - "ap-southeast-2": { - description: "Asia Pacific (Sydney)" - }, - "ap-southeast-3": { - description: "Asia Pacific (Jakarta)" - }, - "ap-southeast-4": { - description: "Asia Pacific (Melbourne)" - }, - "ap-southeast-5": { - description: "Asia Pacific (Malaysia)" - }, - "ap-southeast-6": { - description: "Asia Pacific (New Zealand)" - }, - "ap-southeast-7": { - description: "Asia Pacific (Thailand)" - }, - "aws-global": { - description: "aws global region" - }, - "ca-central-1": { - description: "Canada (Central)" - }, - "ca-west-1": { - description: "Canada West (Calgary)" - }, - "eu-central-1": { - description: "Europe (Frankfurt)" - }, - "eu-central-2": { - description: "Europe (Zurich)" - }, - "eu-north-1": { - description: "Europe (Stockholm)" - }, - "eu-south-1": { - description: "Europe (Milan)" - }, - "eu-south-2": { - description: "Europe (Spain)" - }, - "eu-west-1": { - description: "Europe (Ireland)" - }, - "eu-west-2": { - description: "Europe (London)" - }, - "eu-west-3": { - description: "Europe (Paris)" - }, - "il-central-1": { - description: "Israel (Tel Aviv)" - }, - "me-central-1": { - description: "Middle East (UAE)" - }, - "me-south-1": { - description: "Middle East (Bahrain)" - }, - "mx-central-1": { - description: "Mexico (Central)" - }, - "sa-east-1": { - description: "South America (Sao Paulo)" - }, - "us-east-1": { - description: "US East (N. Virginia)" - }, - "us-east-2": { - description: "US East (Ohio)" - }, - "us-west-1": { - description: "US West (N. California)" - }, - "us-west-2": { - description: "US West (Oregon)" - } - } - }, - { - id: "aws-cn", - outputs: { - dnsSuffix: "amazonaws.com.cn", - dualStackDnsSuffix: "api.amazonwebservices.com.cn", - implicitGlobalRegion: "cn-northwest-1", - name: "aws-cn", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^cn\\-\\w+\\-\\d+$", - regions: { - "aws-cn-global": { - description: "aws-cn global region" - }, - "cn-north-1": { - description: "China (Beijing)" - }, - "cn-northwest-1": { - description: "China (Ningxia)" - } - } - }, - { - id: "aws-eusc", - outputs: { - dnsSuffix: "amazonaws.eu", - dualStackDnsSuffix: "api.amazonwebservices.eu", - implicitGlobalRegion: "eusc-de-east-1", - name: "aws-eusc", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", - regions: { - "eusc-de-east-1": { - description: "EU (Germany)" - } - } - }, - { - id: "aws-iso", - outputs: { - dnsSuffix: "c2s.ic.gov", - dualStackDnsSuffix: "api.aws.ic.gov", - implicitGlobalRegion: "us-iso-east-1", - name: "aws-iso", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", - regions: { - "aws-iso-global": { - description: "aws-iso global region" - }, - "us-iso-east-1": { - description: "US ISO East" - }, - "us-iso-west-1": { - description: "US ISO WEST" - } - } - }, - { - id: "aws-iso-b", - outputs: { - dnsSuffix: "sc2s.sgov.gov", - dualStackDnsSuffix: "api.aws.scloud", - implicitGlobalRegion: "us-isob-east-1", - name: "aws-iso-b", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", - regions: { - "aws-iso-b-global": { - description: "aws-iso-b global region" - }, - "us-isob-east-1": { - description: "US ISOB East (Ohio)" - }, - "us-isob-west-1": { - description: "US ISOB West" - } - } - }, - { - id: "aws-iso-e", - outputs: { - dnsSuffix: "cloud.adc-e.uk", - dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", - implicitGlobalRegion: "eu-isoe-west-1", - name: "aws-iso-e", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", - regions: { - "aws-iso-e-global": { - description: "aws-iso-e global region" - }, - "eu-isoe-west-1": { - description: "EU ISOE West" - } - } - }, - { - id: "aws-iso-f", - outputs: { - dnsSuffix: "csp.hci.ic.gov", - dualStackDnsSuffix: "api.aws.hci.ic.gov", - implicitGlobalRegion: "us-isof-south-1", - name: "aws-iso-f", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", - regions: { - "aws-iso-f-global": { - description: "aws-iso-f global region" - }, - "us-isof-east-1": { - description: "US ISOF EAST" - }, - "us-isof-south-1": { - description: "US ISOF SOUTH" - } - } - }, - { - id: "aws-us-gov", - outputs: { - dnsSuffix: "amazonaws.com", - dualStackDnsSuffix: "api.aws", - implicitGlobalRegion: "us-gov-west-1", - name: "aws-us-gov", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", - regions: { - "aws-us-gov-global": { - description: "aws-us-gov global region" - }, - "us-gov-east-1": { - description: "AWS GovCloud (US-East)" - }, - "us-gov-west-1": { - description: "AWS GovCloud (US-West)" - } - } - } -]; -var version = "1.1"; -var partitionsInfo = { - partitions: partitions, - version: version -}; - -let selectedPartitionsInfo = partitionsInfo; -let selectedUserAgentPrefix = ""; -const partition = (value) => { - const { partitions } = selectedPartitionsInfo; - for (const partition of partitions) { - const { regions, outputs } = partition; - for (const [region, regionData] of Object.entries(regions)) { - if (region === value) { - return { - ...outputs, - ...regionData, - }; + else if (value < 2 ** 32) { + data[cursor++] = (major << 5) | extendedFloat32; + dataView.setUint32(cursor, value); + cursor += 4; + } + else { + data[cursor++] = (major << 5) | extendedFloat64; + dataView.setBigUint64(cursor, typeof value === "bigint" ? value : BigInt(value)); + cursor += 8; + } +} +function encode(_input) { + const encodeStack = [_input]; + while (encodeStack.length) { + const input = encodeStack.pop(); + ensureSpace(typeof input === "string" ? input.length * 4 : 64); + if (typeof input === "string") { + if (USE_BUFFER) { + encodeHeader(majorUtf8String, Buffer.byteLength(input)); + cursor += data.write(input, cursor); + } + else { + const bytes = utilUtf8.fromUtf8(input); + encodeHeader(majorUtf8String, bytes.byteLength); + data.set(bytes, cursor); + cursor += bytes.byteLength; + } + continue; + } + else if (typeof input === "number") { + if (Number.isInteger(input)) { + const nonNegative = input >= 0; + const major = nonNegative ? majorUint64 : majorNegativeInt64; + const value = nonNegative ? input : -input - 1; + if (value < 24) { + data[cursor++] = (major << 5) | value; + } + else if (value < 256) { + data[cursor++] = (major << 5) | 24; + data[cursor++] = value; + } + else if (value < 65536) { + data[cursor++] = (major << 5) | extendedFloat16; + data[cursor++] = value >> 8; + data[cursor++] = value; + } + else if (value < 4294967296) { + data[cursor++] = (major << 5) | extendedFloat32; + dataView.setUint32(cursor, value); + cursor += 4; + } + else { + data[cursor++] = (major << 5) | extendedFloat64; + dataView.setBigUint64(cursor, BigInt(value)); + cursor += 8; + } + continue; + } + data[cursor++] = (majorSpecial << 5) | extendedFloat64; + dataView.setFloat64(cursor, input); + cursor += 8; + continue; + } + else if (typeof input === "bigint") { + const nonNegative = input >= 0; + const major = nonNegative ? majorUint64 : majorNegativeInt64; + const value = nonNegative ? input : -input - BigInt(1); + const n = Number(value); + if (n < 24) { + data[cursor++] = (major << 5) | n; + } + else if (n < 256) { + data[cursor++] = (major << 5) | 24; + data[cursor++] = n; + } + else if (n < 65536) { + data[cursor++] = (major << 5) | extendedFloat16; + data[cursor++] = n >> 8; + data[cursor++] = n & 0b1111_1111; + } + else if (n < 4294967296) { + data[cursor++] = (major << 5) | extendedFloat32; + dataView.setUint32(cursor, n); + cursor += 4; + } + else if (value < BigInt("18446744073709551616")) { + data[cursor++] = (major << 5) | extendedFloat64; + dataView.setBigUint64(cursor, value); + cursor += 8; + } + else { + const binaryBigInt = value.toString(2); + const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8)); + let b = value; + let i = 0; + while (bigIntBytes.byteLength - ++i >= 0) { + bigIntBytes[bigIntBytes.byteLength - i] = Number(b & BigInt(255)); + b >>= BigInt(8); + } + ensureSpace(bigIntBytes.byteLength * 2); + data[cursor++] = nonNegative ? 0b110_00010 : 0b110_00011; + if (USE_BUFFER) { + encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes)); + } + else { + encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength); + } + data.set(bigIntBytes, cursor); + cursor += bigIntBytes.byteLength; + } + continue; + } + else if (input === null) { + data[cursor++] = (majorSpecial << 5) | specialNull; + continue; + } + else if (typeof input === "boolean") { + data[cursor++] = (majorSpecial << 5) | (input ? specialTrue : specialFalse); + continue; + } + else if (typeof input === "undefined") { + throw new Error("@smithy/core/cbor: client may not serialize undefined value."); + } + else if (Array.isArray(input)) { + for (let i = input.length - 1; i >= 0; --i) { + encodeStack.push(input[i]); } + encodeHeader(majorList, input.length); + continue; } - } - for (const partition of partitions) { - const { regionRegex, outputs } = partition; - if (new RegExp(regionRegex).test(value)) { - return { - ...outputs, - }; + else if (typeof input.byteLength === "number") { + ensureSpace(input.length * 2); + encodeHeader(majorUnstructuredByteString, input.length); + data.set(input, cursor); + cursor += input.byteLength; + continue; } + else if (typeof input === "object") { + if (input instanceof serde.NumericValue) { + const decimalIndex = input.string.indexOf("."); + const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1; + const mantissa = BigInt(input.string.replace(".", "")); + data[cursor++] = 0b110_00100; + encodeStack.push(mantissa); + encodeStack.push(exponent); + encodeHeader(majorList, 2); + continue; + } + if (input[tagSymbol]) { + if ("tag" in input && "value" in input) { + encodeStack.push(input.value); + encodeHeader(majorTag, input.tag); + continue; + } + else { + throw new Error("tag encountered with missing fields, need 'tag' and 'value', found: " + JSON.stringify(input)); + } + } + const keys = Object.keys(input); + for (let i = keys.length - 1; i >= 0; --i) { + const key = keys[i]; + encodeStack.push(input[key]); + encodeStack.push(key); + } + encodeHeader(majorMap, keys.length); + continue; + } + throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`); } - const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws"); - if (!DEFAULT_PARTITION) { - throw new Error("Provided region was not found in the partition array or regex," + - " and default partition with id 'aws' doesn't exist."); - } - return { - ...DEFAULT_PARTITION.outputs, - }; -}; -const setPartitionInfo = (partitionsInfo, userAgentPrefix = "") => { - selectedPartitionsInfo = partitionsInfo; - selectedUserAgentPrefix = userAgentPrefix; -}; -const useDefaultPartitionInfo = () => { - setPartitionInfo(partitionsInfo, ""); -}; -const getUserAgentPrefix = () => selectedUserAgentPrefix; +} -const awsEndpointFunctions = { - isVirtualHostableS3Bucket: isVirtualHostableS3Bucket, - parseArn: parseArn, - partition: partition, +const cbor = { + deserialize(payload) { + setPayload(payload); + return decode(0, payload.length); + }, + serialize(input) { + try { + encode(input); + return toUint8Array(); + } + catch (e) { + toUint8Array(); + throw e; + } + }, + resizeEncodingBuffer(size) { + resize(size); + }, }; -utilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions; -const resolveDefaultAwsRegionalEndpointsConfig = (input) => { - if (typeof input.endpointProvider !== "function") { - throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client."); - } - const { endpoint } = input; - if (endpoint === undefined) { - input.endpoint = async () => { - return toEndpointV1(input.endpointProvider({ - Region: typeof input.region === "function" ? await input.region() : input.region, - UseDualStack: typeof input.useDualstackEndpoint === "function" - ? await input.useDualstackEndpoint() - : input.useDualstackEndpoint, - UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint, - Endpoint: undefined, - }, { logger: input.logger })); - }; - } - return input; +const parseCborBody = (streamBody, context) => { + return protocols.collectBody(streamBody, context).then(async (bytes) => { + if (bytes.length) { + try { + return cbor.deserialize(bytes); + } + catch (e) { + Object.defineProperty(e, "$responseBodyText", { + value: context.utf8Encoder(bytes), + }); + throw e; + } + } + return {}; + }); }; -const toEndpointV1 = (endpoint) => urlParser.parseUrl(endpoint.url); - -Object.defineProperty(exports, "EndpointError", ({ - enumerable: true, - get: function () { return utilEndpoints.EndpointError; } -})); -Object.defineProperty(exports, "isIpAddress", ({ - enumerable: true, - get: function () { return utilEndpoints.isIpAddress; } -})); -Object.defineProperty(exports, "resolveEndpoint", ({ - enumerable: true, - get: function () { return utilEndpoints.resolveEndpoint; } -})); -exports.awsEndpointFunctions = awsEndpointFunctions; -exports.getUserAgentPrefix = getUserAgentPrefix; -exports.partition = partition; -exports.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig; -exports.setPartitionInfo = setPartitionInfo; -exports.toEndpointV1 = toEndpointV1; -exports.useDefaultPartitionInfo = useDefaultPartitionInfo; - - -/***/ }), - -/***/ 1656: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var os = __nccwpck_require__(857); -var process = __nccwpck_require__(932); -var middlewareUserAgent = __nccwpck_require__(2959); - -const crtAvailability = { - isCrtAvailable: false, +const dateToTag = (date) => { + return tag({ + tag: 1, + value: date.getTime() / 1000, + }); }; - -const isCrtAvailable = () => { - if (crtAvailability.isCrtAvailable) { - return ["md/crt-avail"]; - } - return null; +const parseCborErrorBody = async (errorBody, context) => { + const value = await parseCborBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; }; - -const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => { - return async (config) => { - const sections = [ - ["aws-sdk-js", clientVersion], - ["ua", "2.1"], - [`os/${os.platform()}`, os.release()], - ["lang/js"], - ["md/nodejs", `${process.versions.node}`], - ]; - const crtAvailable = isCrtAvailable(); - if (crtAvailable) { - sections.push(crtAvailable); +const loadSmithyRpcV2CborErrorCode = (output, data) => { + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); } - if (serviceId) { - sections.push([`api/${serviceId}`, clientVersion]); + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; } - if (process.env.AWS_EXECUTION_ENV) { - sections.push([`exec-env/${process.env.AWS_EXECUTION_ENV}`]); + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; } - const appId = await config?.userAgentAppId?.(); - const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; - return resolvedUserAgent; + return cleanValue; }; + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + const codeKey = Object.keys(data).find((key) => key.toLowerCase() === "code"); + if (codeKey && data[codeKey] !== undefined) { + return sanitizeErrorCode(data[codeKey]); + } }; -const defaultUserAgent = createDefaultUserAgentProvider; - -const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; -const UA_APP_ID_INI_NAME = "sdk_ua_app_id"; -const UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id"; -const NODE_APP_ID_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME], - configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], - default: middlewareUserAgent.DEFAULT_UA_APP_ID, +const checkCborResponse = (response) => { + if (String(response.headers["smithy-protocol"]).toLowerCase() !== "rpc-v2-cbor") { + throw new Error("Malformed RPCv2 CBOR response, status: " + response.statusCode); + } +}; +const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers: { + ...headers, + }, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + try { + contents.headers["content-length"] = String(utilBodyLengthBrowser.calculateBodyLength(body)); + } + catch (e) { } + } + return new protocolHttp.HttpRequest(contents); }; -exports.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS; -exports.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME; -exports.UA_APP_ID_INI_NAME = UA_APP_ID_INI_NAME; -exports.createDefaultUserAgentProvider = createDefaultUserAgentProvider; -exports.crtAvailability = crtAvailability; -exports.defaultUserAgent = defaultUserAgent; - - -/***/ }), - -/***/ 4274: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var xmlParser = __nccwpck_require__(3343); - -function escapeAttribute(value) { - return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); -} - -function escapeElement(value) { - return value - .replace(/&/g, "&") - .replace(/"/g, """) - .replace(/'/g, "'") - .replace(//g, ">") - .replace(/\r/g, " ") - .replace(/\n/g, " ") - .replace(/\u0085/g, "…") - .replace(/\u2028/, "
"); -} - -class XmlText { - value; - constructor(value) { - this.value = value; +class CborCodec extends protocols.SerdeContext { + createSerializer() { + const serializer = new CborShapeSerializer(); + serializer.setSerdeContext(this.serdeContext); + return serializer; } - toString() { - return escapeElement("" + this.value); + createDeserializer() { + const deserializer = new CborShapeDeserializer(); + deserializer.setSerdeContext(this.serdeContext); + return deserializer; } } - -class XmlNode { - name; - children; - attributes = {}; - static of(name, childText, withName) { - const node = new XmlNode(name); - if (childText !== undefined) { - node.addChildNode(new XmlText(childText)); +class CborShapeSerializer extends protocols.SerdeContext { + value; + write(schema, value) { + this.value = this.serialize(schema, value); + } + serialize(schema$1, source) { + const ns = schema.NormalizedSchema.of(schema$1); + if (source == null) { + if (ns.isIdempotencyToken()) { + return serde.generateIdempotencyToken(); + } + return source; } - if (withName !== undefined) { - node.withName(withName); + if (ns.isBlobSchema()) { + if (typeof source === "string") { + return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(source); + } + return source; } - return node; - } - constructor(name, children = []) { - this.name = name; - this.children = children; + if (ns.isTimestampSchema()) { + if (typeof source === "number" || typeof source === "bigint") { + return dateToTag(new Date((Number(source) / 1000) | 0)); + } + return dateToTag(source); + } + if (typeof source === "function" || typeof source === "object") { + const sourceObject = source; + if (ns.isListSchema() && Array.isArray(sourceObject)) { + const sparse = !!ns.getMergedTraits().sparse; + const newArray = []; + let i = 0; + for (const item of sourceObject) { + const value = this.serialize(ns.getValueSchema(), item); + if (value != null || sparse) { + newArray[i++] = value; + } + } + return newArray; + } + if (sourceObject instanceof Date) { + return dateToTag(sourceObject); + } + const newObject = {}; + if (ns.isMapSchema()) { + const sparse = !!ns.getMergedTraits().sparse; + for (const key of Object.keys(sourceObject)) { + const value = this.serialize(ns.getValueSchema(), sourceObject[key]); + if (value != null || sparse) { + newObject[key] = value; + } + } + } + else if (ns.isStructSchema()) { + for (const [key, memberSchema] of ns.structIterator()) { + const value = this.serialize(memberSchema, sourceObject[key]); + if (value != null) { + newObject[key] = value; + } + } + const isUnion = ns.isUnionSchema(); + if (isUnion && Array.isArray(sourceObject.$unknown)) { + const [k, v] = sourceObject.$unknown; + newObject[k] = v; + } + else if (typeof sourceObject.__type === "string") { + for (const [k, v] of Object.entries(sourceObject)) { + if (!(k in newObject)) { + newObject[k] = this.serialize(15, v); + } + } + } + } + else if (ns.isDocumentSchema()) { + for (const key of Object.keys(sourceObject)) { + newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]); + } + } + else if (ns.isBigDecimalSchema()) { + return sourceObject; + } + return newObject; + } + return source; } - withName(name) { - this.name = name; - return this; + flush() { + const buffer = cbor.serialize(this.value); + this.value = undefined; + return buffer; } - addAttribute(name, value) { - this.attributes[name] = value; - return this; +} +class CborShapeDeserializer extends protocols.SerdeContext { + read(schema, bytes) { + const data = cbor.deserialize(bytes); + return this.readValue(schema, data); } - addChildNode(child) { - this.children.push(child); - return this; + readValue(_schema, value) { + const ns = schema.NormalizedSchema.of(_schema); + if (ns.isTimestampSchema()) { + if (typeof value === "number") { + return serde._parseEpochTimestamp(value); + } + if (typeof value === "object") { + if (value.tag === 1 && "value" in value) { + return serde._parseEpochTimestamp(value.value); + } + } + } + if (ns.isBlobSchema()) { + if (typeof value === "string") { + return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value); + } + return value; + } + if (typeof value === "undefined" || + typeof value === "boolean" || + typeof value === "number" || + typeof value === "string" || + typeof value === "bigint" || + typeof value === "symbol") { + return value; + } + else if (typeof value === "object") { + if (value === null) { + return null; + } + if ("byteLength" in value) { + return value; + } + if (value instanceof Date) { + return value; + } + if (ns.isDocumentSchema()) { + return value; + } + if (ns.isListSchema()) { + const newArray = []; + const memberSchema = ns.getValueSchema(); + for (const item of value) { + const itemValue = this.readValue(memberSchema, item); + newArray.push(itemValue); + } + return newArray; + } + const newObject = {}; + if (ns.isMapSchema()) { + const targetSchema = ns.getValueSchema(); + for (const key of Object.keys(value)) { + const itemValue = this.readValue(targetSchema, value[key]); + newObject[key] = itemValue; + } + } + else if (ns.isStructSchema()) { + const isUnion = ns.isUnionSchema(); + let keys; + if (isUnion) { + keys = new Set(Object.keys(value).filter((k) => k !== "__type")); + } + for (const [key, memberSchema] of ns.structIterator()) { + if (isUnion) { + keys.delete(key); + } + if (value[key] != null) { + newObject[key] = this.readValue(memberSchema, value[key]); + } + } + if (isUnion && keys?.size === 1 && Object.keys(newObject).length === 0) { + const k = keys.values().next().value; + newObject.$unknown = [k, value[k]]; + } + else if (typeof value.__type === "string") { + for (const [k, v] of Object.entries(value)) { + if (!(k in newObject)) { + newObject[k] = v; + } + } + } + } + else if (value instanceof serde.NumericValue) { + return value; + } + return newObject; + } + else { + return value; + } } - removeAttribute(name) { - delete this.attributes[name]; - return this; +} + +class SmithyRpcV2CborProtocol extends protocols.RpcProtocol { + codec = new CborCodec(); + serializer = this.codec.createSerializer(); + deserializer = this.codec.createDeserializer(); + constructor({ defaultNamespace, errorTypeRegistries, }) { + super({ defaultNamespace, errorTypeRegistries }); } - n(name) { - this.name = name; - return this; + getShapeId() { + return "smithy.protocols#rpcv2Cbor"; } - c(child) { - this.children.push(child); - return this; + getPayloadCodec() { + return this.codec; } - a(name, value) { - if (value != null) { - this.attributes[name] = value; + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + Object.assign(request.headers, { + "content-type": this.getDefaultContentType(), + "smithy-protocol": "rpc-v2-cbor", + accept: this.getDefaultContentType(), + }); + if (schema.deref(operationSchema.input) === "unit") { + delete request.body; + delete request.headers["content-type"]; } - return this; - } - cc(input, field, withName = field) { - if (input[field] != null) { - const node = XmlNode.of(field, input[field]).withName(withName); - this.c(node); + else { + if (!request.body) { + this.serializer.write(15, {}); + request.body = this.serializer.flush(); + } + try { + request.headers["content-length"] = String(request.body.byteLength); + } + catch (e) { } + } + const { service, operation } = utilMiddleware.getSmithyContext(context); + const path = `/service/${service}/operation/${operation}`; + if (request.path.endsWith("/")) { + request.path += path.slice(1); + } + else { + request.path += path; } + return request; } - l(input, listName, memberName, valueProvider) { - if (input[listName] != null) { - const nodes = valueProvider(); - nodes.map((node) => { - node.withName(memberName); - this.c(node); - }); - } + async deserializeResponse(operationSchema, context, response) { + return super.deserializeResponse(operationSchema, context, response); } - lc(input, listName, memberName, valueProvider) { - if (input[listName] != null) { - const nodes = valueProvider(); - const containerNode = new XmlNode(memberName); - nodes.map((node) => { - containerNode.c(node); - }); - this.c(containerNode); + async handleError(operationSchema, context, response, dataObject, metadata) { + const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; + const errorMetadata = { + $metadata: metadata, + $fault: response.statusCode <= 500 ? "client" : "server", + }; + let namespace = this.options.defaultNamespace; + if (errorName.includes("#")) { + [namespace] = errorName.split("#"); } - } - toString() { - const hasChildren = Boolean(this.children.length); - let xmlText = `<${this.name}`; - const attributes = this.attributes; - for (const attributeName of Object.keys(attributes)) { - const attribute = attributes[attributeName]; - if (attribute != null) { - xmlText += ` ${attributeName}="${escapeAttribute("" + attribute)}"`; + const registry = this.compositeErrorRegistry; + const nsRegistry = schema.TypeRegistry.for(namespace); + registry.copyFrom(nsRegistry); + let errorSchema; + try { + errorSchema = registry.getSchema(errorName); + } + catch (e) { + if (dataObject.Message) { + dataObject.message = dataObject.Message; } + const syntheticRegistry = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); + registry.copyFrom(syntheticRegistry); + const baseExceptionSchema = registry.getBaseException(); + if (baseExceptionSchema) { + const ErrorCtor = registry.getErrorCtor(baseExceptionSchema); + throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject); + } + throw Object.assign(new Error(errorName), errorMetadata, dataObject); } - return (xmlText += !hasChildren ? "/>" : `>${this.children.map((c) => c.toString()).join("")}`); + const ns = schema.NormalizedSchema.of(errorSchema); + const ErrorCtor = registry.getErrorCtor(errorSchema); + const message = dataObject.message ?? dataObject.Message ?? "Unknown"; + const exception = new ErrorCtor(message); + const output = {}; + for (const [name, member] of ns.structIterator()) { + output[name] = this.deserializer.readValue(member, dataObject[name]); + } + throw Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message, + }, output); + } + getDefaultContentType() { + return "application/cbor"; } } -Object.defineProperty(exports, "parseXML", ({ - enumerable: true, - get: function () { return xmlParser.parseXML; } -})); -exports.XmlNode = XmlNode; -exports.XmlText = XmlText; +exports.CborCodec = CborCodec; +exports.CborShapeDeserializer = CborShapeDeserializer; +exports.CborShapeSerializer = CborShapeSerializer; +exports.SmithyRpcV2CborProtocol = SmithyRpcV2CborProtocol; +exports.buildHttpRpcRequest = buildHttpRpcRequest; +exports.cbor = cbor; +exports.checkCborResponse = checkCborResponse; +exports.dateToTag = dateToTag; +exports.loadSmithyRpcV2CborErrorCode = loadSmithyRpcV2CborErrorCode; +exports.parseCborBody = parseCborBody; +exports.parseCborErrorBody = parseCborErrorBody; +exports.tag = tag; +exports.tagSymbol = tagSymbol; /***/ }), -/***/ 3343: +/***/ 3422: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseXML = parseXML; -const fast_xml_parser_1 = __nccwpck_require__(591); -const parser = new fast_xml_parser_1.XMLParser({ - attributeNamePrefix: "", - htmlEntities: true, - ignoreAttributes: false, - ignoreDeclaration: true, - parseTagValue: false, - trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), -}); -parser.addEntity("#xD", "\r"); -parser.addEntity("#10", "\n"); -function parseXML(xmlString) { - return parser.parse(xmlString, true); -} - - -/***/ }), - -/***/ 9320: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +var utilStream = __nccwpck_require__(4252); +var schema = __nccwpck_require__(6890); +var serde = __nccwpck_require__(2430); +var protocolHttp = __nccwpck_require__(2356); +var utilBase64 = __nccwpck_require__(8385); +var utilUtf8 = __nccwpck_require__(1577); -const PROTECTED_KEYS = { - REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"), - X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"), - TENANT_ID: Symbol.for("_AWS_LAMBDA_TENANT_ID"), -}; -const NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? ""); -if (!NO_GLOBAL_AWS_LAMBDA) { - globalThis.awslambda = globalThis.awslambda || {}; -} -class InvokeStoreBase { - static PROTECTED_KEYS = PROTECTED_KEYS; - isProtectedKey(key) { - return Object.values(PROTECTED_KEYS).includes(key); - } - getRequestId() { - return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-"; +const collectBody = async (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return utilStream.Uint8ArrayBlobAdapter.mutate(streamBody); } - getXRayTraceId() { - return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID); + if (!streamBody) { + return utilStream.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); } - getTenantId() { - return this.get(PROTECTED_KEYS.TENANT_ID); + const fromContext = context.streamCollector(streamBody); + return utilStream.Uint8ArrayBlobAdapter.mutate(await fromContext); +}; + +function extendedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} + +class SerdeContext { + serdeContext; + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; } } -class InvokeStoreSingle extends InvokeStoreBase { - currentContext; - getContext() { - return this.currentContext; + +class HttpProtocol extends SerdeContext { + options; + compositeErrorRegistry; + constructor(options) { + super(); + this.options = options; + this.compositeErrorRegistry = schema.TypeRegistry.for(options.defaultNamespace); + for (const etr of options.errorTypeRegistries ?? []) { + this.compositeErrorRegistry.copyFrom(etr); + } } - hasContext() { - return this.currentContext !== undefined; + getRequestType() { + return protocolHttp.HttpRequest; } - get(key) { - return this.currentContext?.[key]; + getResponseType() { + return protocolHttp.HttpResponse; } - set(key, value) { - if (this.isProtectedKey(key)) { - throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + this.serializer.setSerdeContext(serdeContext); + this.deserializer.setSerdeContext(serdeContext); + if (this.getPayloadCodec()) { + this.getPayloadCodec().setSerdeContext(serdeContext); } - this.currentContext = this.currentContext || {}; - this.currentContext[key] = value; } - run(context, fn) { - this.currentContext = context; - try { - return fn(); + updateServiceEndpoint(request, endpoint) { + if ("url" in endpoint) { + request.protocol = endpoint.url.protocol; + request.hostname = endpoint.url.hostname; + request.port = endpoint.url.port ? Number(endpoint.url.port) : undefined; + request.path = endpoint.url.pathname; + request.fragment = endpoint.url.hash || void 0; + request.username = endpoint.url.username || void 0; + request.password = endpoint.url.password || void 0; + if (!request.query) { + request.query = {}; + } + for (const [k, v] of endpoint.url.searchParams.entries()) { + request.query[k] = v; + } + return request; } - finally { - this.currentContext = undefined; + else { + request.protocol = endpoint.protocol; + request.hostname = endpoint.hostname; + request.port = endpoint.port ? Number(endpoint.port) : undefined; + request.path = endpoint.path; + request.query = { + ...endpoint.query, + }; + return request; } } -} -class InvokeStoreMulti extends InvokeStoreBase { - als; - static async create() { - const instance = new InvokeStoreMulti(); - const asyncHooks = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6698, 23)); - instance.als = new asyncHooks.AsyncLocalStorage(); - return instance; + setHostPrefix(request, operationSchema, input) { + if (this.serdeContext?.disableHostPrefix) { + return; + } + const inputNs = schema.NormalizedSchema.of(operationSchema.input); + const opTraits = schema.translateTraits(operationSchema.traits ?? {}); + if (opTraits.endpoint) { + let hostPrefix = opTraits.endpoint?.[0]; + if (typeof hostPrefix === "string") { + const hostLabelInputs = [...inputNs.structIterator()].filter(([, member]) => member.getMergedTraits().hostLabel); + for (const [name] of hostLabelInputs) { + const replacement = input[name]; + if (typeof replacement !== "string") { + throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`); + } + hostPrefix = hostPrefix.replace(`{${name}}`, replacement); + } + request.hostname = hostPrefix + request.hostname; + } + } } - getContext() { - return this.als.getStore(); + deserializeMetadata(output) { + return { + 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"], + }; } - hasContext() { - return this.als.getStore() !== undefined; + async serializeEventStream({ eventStream, requestSchema, initialRequest, }) { + const eventStreamSerde = await this.loadEventStreamCapability(); + return eventStreamSerde.serializeEventStream({ + eventStream, + requestSchema, + initialRequest, + }); } - get(key) { - return this.als.getStore()?.[key]; + async deserializeEventStream({ response, responseSchema, initialResponseContainer, }) { + const eventStreamSerde = await this.loadEventStreamCapability(); + return eventStreamSerde.deserializeEventStream({ + response, + responseSchema, + initialResponseContainer, + }); } - set(key, value) { - if (this.isProtectedKey(key)) { - throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); - } - const store = this.als.getStore(); - if (!store) { - throw new Error("No context available"); - } - store[key] = value; + async loadEventStreamCapability() { + const { EventStreamSerde } = await __nccwpck_require__.e(/* import() */ 579).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6579, 19)); + return new EventStreamSerde({ + marshaller: this.getEventStreamMarshaller(), + serializer: this.serializer, + deserializer: this.deserializer, + serdeContext: this.serdeContext, + defaultContentType: this.getDefaultContentType(), + }); } - run(context, fn) { - return this.als.run(context, fn); + getDefaultContentType() { + throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`); + } + async deserializeHttpMessage(schema, context, response, arg4, arg5) { + return []; + } + getEventStreamMarshaller() { + const context = this.serdeContext; + if (!context.eventStreamMarshaller) { + throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext."); + } + return context.eventStreamMarshaller; } } -exports.InvokeStore = void 0; -(function (InvokeStore) { - let instance = null; - async function getInstanceAsync() { - if (!instance) { - instance = (async () => { - const isMulti = "AWS_LAMBDA_MAX_CONCURRENCY" in process.env; - const newInstance = isMulti - ? await InvokeStoreMulti.create() - : new InvokeStoreSingle(); - if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) { - return globalThis.awslambda.InvokeStore; - } - else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) { - globalThis.awslambda.InvokeStore = newInstance; - return newInstance; + +class HttpBindingProtocol extends HttpProtocol { + async serializeRequest(operationSchema, _input, context) { + const input = { + ...(_input ?? {}), + }; + const serializer = this.serializer; + const query = {}; + const headers = {}; + const endpoint = await context.endpoint(); + const ns = schema.NormalizedSchema.of(operationSchema?.input); + const payloadMemberNames = []; + const payloadMemberSchemas = []; + let hasNonHttpBindingMember = false; + let payload; + const request = new protocolHttp.HttpRequest({ + protocol: "", + hostname: "", + port: undefined, + path: "", + fragment: undefined, + query: query, + headers: headers, + body: undefined, + }); + if (endpoint) { + this.updateServiceEndpoint(request, endpoint); + this.setHostPrefix(request, operationSchema, input); + const opTraits = schema.translateTraits(operationSchema.traits); + if (opTraits.http) { + request.method = opTraits.http[0]; + const [path, search] = opTraits.http[1].split("?"); + if (request.path == "/") { + request.path = path; } else { - return newInstance; + request.path += path; } - })(); + const traitSearchParams = new URLSearchParams(search ?? ""); + Object.assign(query, Object.fromEntries(traitSearchParams)); + } } - return instance; - } - InvokeStore.getInstanceAsync = getInstanceAsync; - InvokeStore._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" - ? { - reset: () => { - instance = null; - if (globalThis.awslambda?.InvokeStore) { - delete globalThis.awslambda.InvokeStore; + for (const [memberName, memberNs] of ns.structIterator()) { + const memberTraits = memberNs.getMergedTraits() ?? {}; + const inputMemberValue = input[memberName]; + if (inputMemberValue == null && !memberNs.isIdempotencyToken()) { + if (memberTraits.httpLabel) { + if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) { + throw new Error(`No value provided for input HTTP label: ${memberName}.`); + } } - globalThis.awslambda = {}; - }, - } - : undefined; -})(exports.InvokeStore || (exports.InvokeStore = {})); - -exports.InvokeStoreBase = InvokeStoreBase; - - -/***/ }), - -/***/ 9316: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var utilConfigProvider = __nccwpck_require__(6716); -var utilMiddleware = __nccwpck_require__(6324); -var utilEndpoints = __nccwpck_require__(9674); - -const ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; -const CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; -const DEFAULT_USE_DUALSTACK_ENDPOINT = false; -const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.ENV), - configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), - default: false, -}; - -const ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; -const CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; -const DEFAULT_USE_FIPS_ENDPOINT = false; -const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.ENV), - configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), - default: false, -}; - -const resolveCustomEndpointsConfig = (input) => { - const { tls, endpoint, urlParser, useDualstackEndpoint } = input; - return Object.assign(input, { - tls: tls ?? true, - endpoint: utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), - isCustomEndpoint: true, - useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false), - }); -}; - -const getEndpointFromRegion = 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 input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); -}; - -const resolveEndpointsConfig = (input) => { - const useDualstackEndpoint = utilMiddleware.normalizeProvider(input.useDualstackEndpoint ?? false); - const { endpoint, useFipsEndpoint, urlParser, tls } = input; - return Object.assign(input, { - tls: tls ?? true, - endpoint: endpoint - ? utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) - : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }), - isCustomEndpoint: !!endpoint, - useDualstackEndpoint, - }); -}; - -const REGION_ENV_NAME = "AWS_REGION"; -const REGION_INI_NAME = "region"; -const NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[REGION_ENV_NAME], - configFileSelector: (profile) => profile[REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); - }, -}; -const NODE_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials", -}; - -const validRegions = new Set(); -const checkRegion = (region, check = utilEndpoints.isValidHostLabel) => { - if (!validRegions.has(region) && !check(region)) { - if (region === "*") { - console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`); + continue; + } + if (memberTraits.httpPayload) { + const isStreaming = memberNs.isStreaming(); + if (isStreaming) { + const isEventStream = memberNs.isStructSchema(); + if (isEventStream) { + if (input[memberName]) { + payload = await this.serializeEventStream({ + eventStream: input[memberName], + requestSchema: ns, + }); + } + } + else { + payload = inputMemberValue; + } + } + else { + serializer.write(memberNs, inputMemberValue); + payload = serializer.flush(); + } + delete input[memberName]; + } + else if (memberTraits.httpLabel) { + serializer.write(memberNs, inputMemberValue); + const replacement = serializer.flush(); + if (request.path.includes(`{${memberName}+}`)) { + request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/")); + } + else if (request.path.includes(`{${memberName}}`)) { + request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement)); + } + delete input[memberName]; + } + else if (memberTraits.httpHeader) { + serializer.write(memberNs, inputMemberValue); + headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush()); + delete input[memberName]; + } + else if (typeof memberTraits.httpPrefixHeaders === "string") { + for (const [key, val] of Object.entries(inputMemberValue)) { + const amalgam = memberTraits.httpPrefixHeaders + key; + serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val); + headers[amalgam.toLowerCase()] = serializer.flush(); + } + delete input[memberName]; + } + else if (memberTraits.httpQuery || memberTraits.httpQueryParams) { + this.serializeQuery(memberNs, inputMemberValue, query); + delete input[memberName]; + } + else { + hasNonHttpBindingMember = true; + payloadMemberNames.push(memberName); + payloadMemberSchemas.push(memberNs); + } } - else { - throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`); + if (hasNonHttpBindingMember && input) { + const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#"); + const requiredMembers = ns.getSchema()[6]; + const payloadSchema = [ + 3, + namespace, + name, + ns.getMergedTraits(), + payloadMemberNames, + payloadMemberSchemas, + undefined, + ]; + if (requiredMembers) { + payloadSchema[6] = requiredMembers; + } + else { + payloadSchema.pop(); + } + serializer.write(payloadSchema, input); + payload = serializer.flush(); } + request.headers = headers; + request.query = query; + request.body = payload; + return request; } - else { - validRegions.add(region); - } -}; - -const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); - -const getRealRegion = (region) => isFipsRegion(region) - ? ["fips-aws-global", "aws-fips"].includes(region) - ? "us-east-1" - : region.replace(/fips-(dkr-|prod-)?|-fips/, "") - : region; - -const resolveRegionConfig = (input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); - } - return Object.assign(input, { - region: async () => { - const providedRegion = typeof region === "function" ? await region() : region; - const realRegion = getRealRegion(providedRegion); - checkRegion(realRegion); - return realRegion; - }, - useFipsEndpoint: async () => { - const providedRegion = typeof region === "string" ? region : await region(); - if (isFipsRegion(providedRegion)) { - return true; + serializeQuery(ns, data, query) { + const serializer = this.serializer; + const traits = ns.getMergedTraits(); + if (traits.httpQueryParams) { + for (const [key, val] of Object.entries(data)) { + if (!(key in query)) { + const valueSchema = ns.getValueSchema(); + Object.assign(valueSchema.getMergedTraits(), { + ...traits, + httpQuery: key, + httpQueryParams: undefined, + }); + this.serializeQuery(valueSchema, val, query); + } } - return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); - }, - }); -}; - -const getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))?.hostname; - -const getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname - ? regionHostname - : partitionHostname - ? partitionHostname.replace("{region}", resolvedRegion) - : undefined; - -const getResolvedPartition = (region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws"; - -const getResolvedSigningRegion = (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); + return; } - } -}; - -const getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => { - const partition = getResolvedPartition(region, { partitionHash }); - const resolvedRegion = region in regionHash ? region : partitionHash[partition]?.endpoint ?? region; - const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; - const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions); - const partitionHostname = getHostnameFromVariants(partitionHash[partition]?.variants, hostnameOptions); - const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname }); - if (hostname === undefined) { - throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); - } - const signingRegion = getResolvedSigningRegion(hostname, { - signingRegion: regionHash[resolvedRegion]?.signingRegion, - regionRegex: partitionHash[partition].regionRegex, - useFipsEndpoint, - }); - return { - partition, - signingService, - hostname, - ...(signingRegion && { signingRegion }), - ...(regionHash[resolvedRegion]?.signingService && { - signingService: regionHash[resolvedRegion].signingService, - }), - }; -}; - -exports.CONFIG_USE_DUALSTACK_ENDPOINT = CONFIG_USE_DUALSTACK_ENDPOINT; -exports.CONFIG_USE_FIPS_ENDPOINT = CONFIG_USE_FIPS_ENDPOINT; -exports.DEFAULT_USE_DUALSTACK_ENDPOINT = DEFAULT_USE_DUALSTACK_ENDPOINT; -exports.DEFAULT_USE_FIPS_ENDPOINT = DEFAULT_USE_FIPS_ENDPOINT; -exports.ENV_USE_DUALSTACK_ENDPOINT = ENV_USE_DUALSTACK_ENDPOINT; -exports.ENV_USE_FIPS_ENDPOINT = ENV_USE_FIPS_ENDPOINT; -exports.NODE_REGION_CONFIG_FILE_OPTIONS = NODE_REGION_CONFIG_FILE_OPTIONS; -exports.NODE_REGION_CONFIG_OPTIONS = NODE_REGION_CONFIG_OPTIONS; -exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS; -exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS; -exports.REGION_ENV_NAME = REGION_ENV_NAME; -exports.REGION_INI_NAME = REGION_INI_NAME; -exports.getRegionInfo = getRegionInfo; -exports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; -exports.resolveEndpointsConfig = resolveEndpointsConfig; -exports.resolveRegionConfig = resolveRegionConfig; - - -/***/ }), - -/***/ 402: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var types = __nccwpck_require__(690); -var utilMiddleware = __nccwpck_require__(6324); -var middlewareSerde = __nccwpck_require__(3255); -var protocolHttp = __nccwpck_require__(2356); -var protocols = __nccwpck_require__(3422); - -const getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {}); - -const resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => { - if (!authSchemePreference || authSchemePreference.length === 0) { - return candidateAuthOptions; - } - const preferredAuthOptions = []; - for (const preferredSchemeName of authSchemePreference) { - for (const candidateAuthOption of candidateAuthOptions) { - const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; - if (candidateAuthSchemeName === preferredSchemeName) { - preferredAuthOptions.push(candidateAuthOption); + if (ns.isListSchema()) { + const sparse = !!ns.getMergedTraits().sparse; + const buffer = []; + for (const item of data) { + serializer.write([ns.getValueSchema(), traits], item); + const serializable = serializer.flush(); + if (sparse || serializable !== undefined) { + buffer.push(serializable); + } } + query[traits.httpQuery] = buffer; } - } - for (const candidateAuthOption of candidateAuthOptions) { - if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { - preferredAuthOptions.push(candidateAuthOption); + else { + serializer.write([ns, traits], data); + query[traits.httpQuery] = serializer.flush(); } } - return preferredAuthOptions; -}; - -function convertHttpAuthSchemesToMap(httpAuthSchemes) { - const map = new Map(); - for (const scheme of httpAuthSchemes) { - map.set(scheme.schemeId, scheme); - } - return map; -} -const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => { - const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input)); - const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : []; - const resolvedOptions = resolveAuthOptions(options, authSchemePreference); - const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); - const smithyContext = utilMiddleware.getSmithyContext(context); - const failureReasons = []; - for (const option of resolvedOptions) { - const scheme = authSchemes.get(option.schemeId); - if (!scheme) { - failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); - continue; + async deserializeResponse(operationSchema, context, response) { + const deserializer = this.deserializer; + const ns = schema.NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes)); + } + await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); + throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw."); } - const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config)); - if (!identityProvider) { - failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); - continue; + for (const header in response.headers) { + const value = response.headers[header]; + delete response.headers[header]; + response.headers[header.toLowerCase()] = value; } - const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {}; - option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties); - option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties); - smithyContext.selectedHttpAuthScheme = { - httpAuthOption: option, - identity: await identityProvider(option.identityProperties), - signer: scheme.signer, - }; - break; - } - if (!smithyContext.selectedHttpAuthScheme) { - throw new Error(failureReasons.join("\n")); - } - return next(args); -}; - -const httpAuthSchemeEndpointRuleSetMiddlewareOptions = { - step: "serialize", - tags: ["HTTP_AUTH_SCHEME"], - name: "httpAuthSchemeMiddleware", - override: true, - relation: "before", - toMiddleware: "endpointV2Middleware", -}; -const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { - httpAuthSchemeParametersProvider, - identityProviderConfigProvider, - }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); - }, -}); - -const httpAuthSchemeMiddlewareOptions = { - step: "serialize", - tags: ["HTTP_AUTH_SCHEME"], - name: "httpAuthSchemeMiddleware", - override: true, - relation: "before", - toMiddleware: middlewareSerde.serializerMiddlewareOption.name, -}; -const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { - httpAuthSchemeParametersProvider, - identityProviderConfigProvider, - }), httpAuthSchemeMiddlewareOptions); - }, -}); - -const defaultErrorHandler = (signingProperties) => (error) => { - throw error; -}; -const defaultSuccessHandler = (httpResponse, signingProperties) => { }; -const httpSigningMiddleware = (config) => (next, context) => async (args) => { - if (!protocolHttp.HttpRequest.isInstance(args.request)) { - return next(args); + const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject); + if (nonHttpBindingMembers.length) { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + const dataFromBody = await deserializer.read(ns, bytes); + for (const member of nonHttpBindingMembers) { + if (dataFromBody[member] != null) { + dataObject[member] = dataFromBody[member]; + } + } + } + } + else if (nonHttpBindingMembers.discardResponseBody) { + await collectBody(response.body, context); + } + dataObject.$metadata = this.deserializeMetadata(response); + return dataObject; } - const smithyContext = utilMiddleware.getSmithyContext(context); - const scheme = smithyContext.selectedHttpAuthScheme; - if (!scheme) { - throw new Error(`No HttpAuthScheme was selected: unable to sign request`); + async deserializeHttpMessage(schema$1, context, response, arg4, arg5) { + let dataObject; + if (arg4 instanceof Set) { + dataObject = arg5; + } + else { + dataObject = arg4; + } + let discardResponseBody = true; + const deserializer = this.deserializer; + const ns = schema.NormalizedSchema.of(schema$1); + const nonHttpBindingMembers = []; + for (const [memberName, memberSchema] of ns.structIterator()) { + const memberTraits = memberSchema.getMemberTraits(); + if (memberTraits.httpPayload) { + discardResponseBody = false; + const isStreaming = memberSchema.isStreaming(); + if (isStreaming) { + const isEventStream = memberSchema.isStructSchema(); + if (isEventStream) { + dataObject[memberName] = await this.deserializeEventStream({ + response, + responseSchema: ns, + }); + } + else { + dataObject[memberName] = utilStream.sdkStreamMixin(response.body); + } + } + else if (response.body) { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + dataObject[memberName] = await deserializer.read(memberSchema, bytes); + } + } + } + else if (memberTraits.httpHeader) { + const key = String(memberTraits.httpHeader).toLowerCase(); + const value = response.headers[key]; + if (null != value) { + if (memberSchema.isListSchema()) { + const headerListValueSchema = memberSchema.getValueSchema(); + headerListValueSchema.getMergedTraits().httpHeader = key; + let sections; + if (headerListValueSchema.isTimestampSchema() && + headerListValueSchema.getSchema() === 4) { + sections = serde.splitEvery(value, ",", 2); + } + else { + sections = serde.splitHeader(value); + } + const list = []; + for (const section of sections) { + list.push(await deserializer.read(headerListValueSchema, section.trim())); + } + dataObject[memberName] = list; + } + else { + dataObject[memberName] = await deserializer.read(memberSchema, value); + } + } + } + else if (memberTraits.httpPrefixHeaders !== undefined) { + dataObject[memberName] = {}; + for (const [header, value] of Object.entries(response.headers)) { + if (header.startsWith(memberTraits.httpPrefixHeaders)) { + const valueSchema = memberSchema.getValueSchema(); + valueSchema.getMergedTraits().httpHeader = header; + dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value); + } + } + } + else if (memberTraits.httpResponseCode) { + dataObject[memberName] = response.statusCode; + } + else { + nonHttpBindingMembers.push(memberName); + } + } + nonHttpBindingMembers.discardResponseBody = discardResponseBody; + return nonHttpBindingMembers; } - 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; -}; - -const httpSigningMiddlewareOptions = { - step: "finalizeRequest", - tags: ["HTTP_SIGNING"], - name: "httpSigningMiddleware", - aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], - override: true, - relation: "after", - toMiddleware: "retryMiddleware", -}; -const getHttpSigningPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpSigningMiddleware(), httpSigningMiddlewareOptions); - }, -}); - -const normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; -}; +} -const makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => { - let command = new CommandCtor(input); - command = withCommand(command) ?? command; - return await client.send(command, ...args); -}; -function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { - return async function* paginateOperation(config, input, ...additionalArguments) { - const _input = input; - let token = config.startingToken ?? _input[inputTokenName]; - 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, config.withCommand, ...additionalArguments); +class RpcProtocol extends HttpProtocol { + async serializeRequest(operationSchema, input, context) { + const serializer = this.serializer; + const query = {}; + const headers = {}; + const endpoint = await context.endpoint(); + const ns = schema.NormalizedSchema.of(operationSchema?.input); + const schema$1 = ns.getSchema(); + let payload; + const request = new protocolHttp.HttpRequest({ + protocol: "", + hostname: "", + port: undefined, + path: "/", + fragment: undefined, + query: query, + headers: headers, + body: undefined, + }); + if (endpoint) { + this.updateServiceEndpoint(request, endpoint); + this.setHostPrefix(request, operationSchema, input); + } + const _input = { + ...input, + }; + if (input) { + const eventStreamMember = ns.getEventStreamMember(); + if (eventStreamMember) { + if (_input[eventStreamMember]) { + const initialRequest = {}; + for (const [memberName, memberSchema] of ns.structIterator()) { + if (memberName !== eventStreamMember && _input[memberName]) { + serializer.write(memberSchema, _input[memberName]); + initialRequest[memberName] = serializer.flush(); + } + } + payload = await this.serializeEventStream({ + eventStream: _input[eventStreamMember], + requestSchema: ns, + initialRequest, + }); + } } else { - throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); + serializer.write(schema$1, _input); + payload = serializer.flush(); } - yield page; - const prevToken = token; - token = get(page, outputTokenName); - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); } - return undefined; - }; + request.headers = headers; + request.query = query; + request.body = payload; + request.method = "POST"; + return request; + } + async deserializeResponse(operationSchema, context, response) { + const deserializer = this.deserializer; + const ns = schema.NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes)); + } + await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); + throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw."); + } + for (const header in response.headers) { + const value = response.headers[header]; + delete response.headers[header]; + response.headers[header.toLowerCase()] = value; + } + const eventStreamMember = ns.getEventStreamMember(); + if (eventStreamMember) { + dataObject[eventStreamMember] = await this.deserializeEventStream({ + response, + responseSchema: ns, + initialResponseContainer: dataObject, + }); + } + else { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(ns, bytes)); + } + } + dataObject.$metadata = this.deserializeMetadata(response); + return dataObject; + } } -const get = (fromObject, path) => { - let cursor = fromObject; - const pathComponents = path.split("."); - for (const step of pathComponents) { - if (!cursor || typeof cursor !== "object") { - return undefined; + +const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { + if (input != null && input[memberName] !== undefined) { + const labelValue = labelValueProvider(); + if (labelValue == null || labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: " + memberName + "."); } - cursor = cursor[step]; + resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel + ? labelValue + .split("/") + .map((segment) => extendedEncodeURIComponent(segment)) + .join("/") + : extendedEncodeURIComponent(labelValue)); } - return cursor; + else { + throw new Error("No value provided for input HTTP label: " + memberName + "."); + } + return resolvedPath; }; -function setFeature(context, feature, value) { - if (!context.__smithy_context) { - context.__smithy_context = { - features: {}, - }; +function requestBuilder(input, context) { + return new RequestBuilder(input, context); +} +class RequestBuilder { + input; + context; + query = {}; + method = ""; + headers = {}; + path = ""; + body = null; + hostname = ""; + resolvePathStack = []; + constructor(input, context) { + this.input = input; + this.context = context; } - else if (!context.__smithy_context.features) { - context.__smithy_context.features = {}; + 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 new protocolHttp.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; + } + p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { + this.resolvePathStack.push((path) => { + this.path = resolvedPath(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; } - context.__smithy_context.features[feature] = value; } -class DefaultIdentityProviderConfig { - authSchemes = new Map(); - constructor(config) { - for (const [key, value] of Object.entries(config)) { - if (value !== undefined) { - this.authSchemes.set(key, value); - } +function determineTimestampFormat(ns, settings) { + if (settings.timestampFormat.useTrait) { + if (ns.isTimestampSchema() && + (ns.getSchema() === 5 || + ns.getSchema() === 6 || + ns.getSchema() === 7)) { + return ns.getSchema(); } } - getIdentityProvider(schemeId) { - return this.authSchemes.get(schemeId); - } + const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits(); + const bindingFormat = settings.httpBindings + ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) + ? 6 + : Boolean(httpQuery) || Boolean(httpLabel) + ? 5 + : undefined + : undefined; + return bindingFormat ?? settings.timestampFormat.default; } -class HttpApiKeyAuthSigner { - 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"); +class FromStringShapeDeserializer extends SerdeContext { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + read(_schema, data) { + const ns = schema.NormalizedSchema.of(_schema); + if (ns.isListSchema()) { + return serde.splitHeader(data).map((item) => this.read(ns.getValueSchema(), item)); } - if (!signingProperties.name) { - throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing"); + if (ns.isBlobSchema()) { + return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(data); } - if (!signingProperties.in) { - throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing"); + if (ns.isTimestampSchema()) { + const format = determineTimestampFormat(ns, this.settings); + switch (format) { + case 5: + return serde._parseRfc3339DateTimeWithOffset(data); + case 6: + return serde._parseRfc7231DateTime(data); + case 7: + return serde._parseEpochTimestamp(data); + default: + console.warn("Missing timestamp format, parsing value with Date constructor:", data); + return new Date(data); + } } - if (!identity.apiKey) { - throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined"); + if (ns.isStringSchema()) { + const mediaType = ns.getMergedTraits().mediaType; + let intermediateValue = data; + if (mediaType) { + if (ns.getMergedTraits().httpHeader) { + intermediateValue = this.base64ToUtf8(intermediateValue); + } + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + intermediateValue = serde.LazyJsonString.from(intermediateValue); + } + return intermediateValue; + } } - const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest); - if (signingProperties.in === types.HttpApiKeyAuthLocation.QUERY) { - clonedRequest.query[signingProperties.name] = identity.apiKey; + if (ns.isNumericSchema()) { + return Number(data); } - else if (signingProperties.in === types.HttpApiKeyAuthLocation.HEADER) { - clonedRequest.headers[signingProperties.name] = signingProperties.scheme - ? `${signingProperties.scheme} ${identity.apiKey}` - : identity.apiKey; + if (ns.isBigIntegerSchema()) { + return BigInt(data); } - else { - throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " + - "but found: `" + - signingProperties.in + - "`"); + if (ns.isBigDecimalSchema()) { + return new serde.NumericValue(data, "bigDecimal"); } - return clonedRequest; + if (ns.isBooleanSchema()) { + return String(data).toLowerCase() === "true"; + } + return data; + } + base64ToUtf8(base64String) { + return (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)((this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(base64String)); } } -class HttpBearerAuthSigner { - async sign(httpRequest, identity, signingProperties) { - const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest); - if (!identity.token) { - throw new Error("request could not be signed with `token` since the `token` is not defined"); +class HttpInterceptingShapeDeserializer extends SerdeContext { + codecDeserializer; + stringDeserializer; + constructor(codecDeserializer, codecSettings) { + super(); + this.codecDeserializer = codecDeserializer; + this.stringDeserializer = new FromStringShapeDeserializer(codecSettings); + } + setSerdeContext(serdeContext) { + this.stringDeserializer.setSerdeContext(serdeContext); + this.codecDeserializer.setSerdeContext(serdeContext); + this.serdeContext = serdeContext; + } + read(schema$1, data) { + const ns = schema.NormalizedSchema.of(schema$1); + const traits = ns.getMergedTraits(); + const toString = this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8; + if (traits.httpHeader || traits.httpResponseCode) { + return this.stringDeserializer.read(ns, toString(data)); } - clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; - return clonedRequest; + if (traits.httpPayload) { + if (ns.isBlobSchema()) { + const toBytes = this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8; + if (typeof data === "string") { + return toBytes(data); + } + return data; + } + else if (ns.isStringSchema()) { + if ("byteLength" in data) { + return toString(data); + } + return data; + } + } + return this.codecDeserializer.read(ns, data); } } -class NoAuthSigner { - async sign(httpRequest, identity, signingProperties) { - return httpRequest; +class ToStringShapeSerializer extends SerdeContext { + settings; + stringBuffer = ""; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema$1, value) { + const ns = schema.NormalizedSchema.of(schema$1); + switch (typeof value) { + case "object": + if (value === null) { + this.stringBuffer = "null"; + return; + } + if (ns.isTimestampSchema()) { + if (!(value instanceof Date)) { + throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`); + } + const format = determineTimestampFormat(ns, this.settings); + switch (format) { + case 5: + this.stringBuffer = value.toISOString().replace(".000Z", "Z"); + break; + case 6: + this.stringBuffer = serde.dateToUtcString(value); + break; + case 7: + this.stringBuffer = String(value.getTime() / 1000); + break; + default: + console.warn("Missing timestamp format, using epoch seconds", value); + this.stringBuffer = String(value.getTime() / 1000); + } + return; + } + if (ns.isBlobSchema() && "byteLength" in value) { + this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); + return; + } + if (ns.isListSchema() && Array.isArray(value)) { + let buffer = ""; + for (const item of value) { + this.write([ns.getValueSchema(), ns.getMergedTraits()], item); + const headerItem = this.flush(); + const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : serde.quoteHeader(headerItem); + if (buffer !== "") { + buffer += ", "; + } + buffer += serialized; + } + this.stringBuffer = buffer; + return; + } + this.stringBuffer = JSON.stringify(value, null, 2); + break; + case "string": + const mediaType = ns.getMergedTraits().mediaType; + let intermediateValue = value; + if (mediaType) { + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + intermediateValue = serde.LazyJsonString.from(intermediateValue); + } + if (ns.getMergedTraits().httpHeader) { + this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(intermediateValue.toString()); + return; + } + } + this.stringBuffer = value; + break; + default: + if (ns.isIdempotencyToken()) { + this.stringBuffer = serde.generateIdempotencyToken(); + } + else { + this.stringBuffer = String(value); + } + } + } + flush() { + const buffer = this.stringBuffer; + this.stringBuffer = ""; + return buffer; } } -const createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired(identity) { - return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs; -}; -const EXPIRATION_MS = 300_000; -const isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); -const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined; -const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => { - if (provider === undefined) { - return undefined; +class HttpInterceptingShapeSerializer { + codecSerializer; + stringSerializer; + buffer; + constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) { + this.codecSerializer = codecSerializer; + this.stringSerializer = stringSerializer; } - 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); - } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } - finally { - pending = undefined; - } - return resolved; - }; - if (isExpired === undefined) { - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(options); - } - return resolved; - }; + setSerdeContext(serdeContext) { + this.codecSerializer.setSerdeContext(serdeContext); + this.stringSerializer.setSerdeContext(serdeContext); } - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(options); - } - if (isConstant) { - return resolved; - } - if (!requiresRefresh(resolved)) { - isConstant = true; - return resolved; + write(schema$1, value) { + const ns = schema.NormalizedSchema.of(schema$1); + const traits = ns.getMergedTraits(); + if (traits.httpHeader || traits.httpLabel || traits.httpQuery) { + this.stringSerializer.write(ns, value); + this.buffer = this.stringSerializer.flush(); + return; } - if (isExpired(resolved)) { - await coalesceProvider(options); - return resolved; + return this.codecSerializer.write(ns, value); + } + flush() { + if (this.buffer !== undefined) { + const buffer = this.buffer; + this.buffer = undefined; + return buffer; } - return resolved; - }; -}; + return this.codecSerializer.flush(); + } +} -Object.defineProperty(exports, "requestBuilder", ({ - enumerable: true, - get: function () { return protocols.requestBuilder; } -})); -exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig; -exports.EXPIRATION_MS = EXPIRATION_MS; -exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner; -exports.HttpBearerAuthSigner = HttpBearerAuthSigner; -exports.NoAuthSigner = NoAuthSigner; -exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction; -exports.createPaginator = createPaginator; -exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh; -exports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin; -exports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin; -exports.getHttpSigningPlugin = getHttpSigningPlugin; -exports.getSmithyContext = getSmithyContext; -exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = httpAuthSchemeEndpointRuleSetMiddlewareOptions; -exports.httpAuthSchemeMiddleware = httpAuthSchemeMiddleware; -exports.httpAuthSchemeMiddlewareOptions = httpAuthSchemeMiddlewareOptions; -exports.httpSigningMiddleware = httpSigningMiddleware; -exports.httpSigningMiddlewareOptions = httpSigningMiddlewareOptions; -exports.isIdentityExpired = isIdentityExpired; -exports.memoizeIdentityProvider = memoizeIdentityProvider; -exports.normalizeProvider = normalizeProvider; -exports.setFeature = setFeature; +exports.FromStringShapeDeserializer = FromStringShapeDeserializer; +exports.HttpBindingProtocol = HttpBindingProtocol; +exports.HttpInterceptingShapeDeserializer = HttpInterceptingShapeDeserializer; +exports.HttpInterceptingShapeSerializer = HttpInterceptingShapeSerializer; +exports.HttpProtocol = HttpProtocol; +exports.RequestBuilder = RequestBuilder; +exports.RpcProtocol = RpcProtocol; +exports.SerdeContext = SerdeContext; +exports.ToStringShapeSerializer = ToStringShapeSerializer; +exports.collectBody = collectBody; +exports.determineTimestampFormat = determineTimestampFormat; +exports.extendedEncodeURIComponent = extendedEncodeURIComponent; +exports.requestBuilder = requestBuilder; +exports.resolvedPath = resolvedPath; /***/ }), -/***/ 4645: +/***/ 6890: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var serde = __nccwpck_require__(2430); -var utilUtf8 = __nccwpck_require__(1577); -var protocols = __nccwpck_require__(3422); var protocolHttp = __nccwpck_require__(2356); -var utilBodyLengthBrowser = __nccwpck_require__(2098); -var schema = __nccwpck_require__(6890); var utilMiddleware = __nccwpck_require__(6324); -var utilBase64 = __nccwpck_require__(8385); -const majorUint64 = 0; -const majorNegativeInt64 = 1; -const majorUnstructuredByteString = 2; -const majorUtf8String = 3; -const majorList = 4; -const majorMap = 5; -const majorTag = 6; -const majorSpecial = 7; -const specialFalse = 20; -const specialTrue = 21; -const specialNull = 22; -const specialUndefined = 23; -const extendedOneByte = 24; -const extendedFloat16 = 25; -const extendedFloat32 = 26; -const extendedFloat64 = 27; -const minorIndefinite = 31; -function alloc(size) { - return typeof Buffer !== "undefined" ? Buffer.alloc(size) : new Uint8Array(size); -} -const tagSymbol = Symbol("@smithy/core/cbor::tagSymbol"); -function tag(data) { - data[tagSymbol] = true; - return data; -} +const deref = (schemaRef) => { + if (typeof schemaRef === "function") { + return schemaRef(); + } + return schemaRef; +}; -const USE_TEXT_DECODER = typeof TextDecoder !== "undefined"; -const USE_BUFFER$1 = typeof Buffer !== "undefined"; -let payload = alloc(0); -let dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); -const textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null; -let _offset = 0; -function setPayload(bytes) { - payload = bytes; - dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); -} -function decode(at, to) { - if (at >= to) { - throw new Error("unexpected end of (decode) payload."); +const operation = (namespace, name, traits, input, output) => ({ + name, + namespace, + traits, + input, + output, +}); + +const schemaDeserializationMiddleware = (config) => (next, context) => async (args) => { + const { response } = await next(args); + const { operationSchema } = utilMiddleware.getSmithyContext(context); + const [, ns, n, t, i, o] = operationSchema ?? []; + try { + const parsed = await config.protocol.deserializeResponse(operation(ns, n, t, i, o), { + ...config, + ...context, + }, response); + return { + response, + output: parsed, + }; } - const major = (payload[at] & 0b1110_0000) >> 5; - const minor = payload[at] & 0b0001_1111; - switch (major) { - case majorUint64: - case majorNegativeInt64: - case majorTag: - let unsignedInt; - let offset; - if (minor < 24) { - unsignedInt = minor; - offset = 1; - } - else { - switch (minor) { - case extendedOneByte: - case extendedFloat16: - case extendedFloat32: - case extendedFloat64: - const countLength = minorValueToArgumentLength[minor]; - const countOffset = (countLength + 1); - offset = countOffset; - if (to - at < countOffset) { - throw new Error(`countLength ${countLength} greater than remaining buf len.`); - } - const countIndex = at + 1; - if (countLength === 1) { - unsignedInt = payload[countIndex]; - } - else if (countLength === 2) { - unsignedInt = dataView$1.getUint16(countIndex); - } - else if (countLength === 4) { - unsignedInt = dataView$1.getUint32(countIndex); - } - else { - unsignedInt = dataView$1.getBigUint64(countIndex); - } - break; - default: - throw new Error(`unexpected minor value ${minor}.`); - } - } - if (major === majorUint64) { - _offset = offset; - return castBigInt(unsignedInt); + catch (error) { + Object.defineProperty(error, "$response", { + value: response, + enumerable: false, + writable: false, + configurable: false, + }); + if (!("$metadata" in error)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + try { + error.message += "\n " + hint; } - else if (major === majorNegativeInt64) { - let negativeInt; - if (typeof unsignedInt === "bigint") { - negativeInt = BigInt(-1) - unsignedInt; + catch (e) { + if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { + console.warn(hint); } else { - negativeInt = -1 - unsignedInt; + context.logger?.warn?.(hint); } - _offset = offset; - return castBigInt(negativeInt); } - else { - if (minor === 2 || minor === 3) { - const length = decodeCount(at + offset, to); - let b = BigInt(0); - const start = at + offset + _offset; - for (let i = start; i < start + length; ++i) { - b = (b << BigInt(8)) | BigInt(payload[i]); - } - _offset = offset + _offset + length; - return minor === 3 ? -b - BigInt(1) : b; - } - else if (minor === 4) { - const decimalFraction = decode(at + offset, to); - const [exponent, mantissa] = decimalFraction; - const normalizer = mantissa < 0 ? -1 : 1; - const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa)); - let numericString; - const sign = mantissa < 0 ? "-" : ""; - numericString = - exponent === 0 - ? mantissaStr - : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent); - numericString = numericString.replace(/^0+/g, ""); - if (numericString === "") { - numericString = "0"; - } - if (numericString[0] === ".") { - numericString = "0" + numericString; - } - numericString = sign + numericString; - _offset = offset + _offset; - return serde.nv(numericString); - } - else { - const value = decode(at + offset, to); - const valueOffset = _offset; - _offset = offset + valueOffset; - return tag({ tag: castBigInt(unsignedInt), value }); + if (typeof error.$responseBodyText !== "undefined") { + if (error.$response) { + error.$response.body = error.$responseBodyText; } } - case majorUtf8String: - case majorMap: - case majorList: - case majorUnstructuredByteString: - if (minor === minorIndefinite) { - switch (major) { - case majorUtf8String: - return decodeUtf8StringIndefinite(at, to); - case majorMap: - return decodeMapIndefinite(at, to); - case majorList: - return decodeListIndefinite(at, to); - case majorUnstructuredByteString: - return decodeUnstructuredByteStringIndefinite(at, to); + try { + if (protocolHttp.HttpResponse.isInstance(response)) { + const { headers = {} } = response; + const headerEntries = Object.entries(headers); + error.$metadata = { + httpStatusCode: response.statusCode, + requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), + extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), + cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries), + }; } } - else { - switch (major) { - case majorUtf8String: - return decodeUtf8String(at, to); - case majorMap: - return decodeMap(at, to); - case majorList: - return decodeList(at, to); - case majorUnstructuredByteString: - return decodeUnstructuredByteString(at, to); - } + catch (e) { } - default: - return decodeSpecial(at, to); - } -} -function bytesToUtf8(bytes, at, to) { - if (USE_BUFFER$1 && bytes.constructor?.name === "Buffer") { - return bytes.toString("utf-8", at, to); - } - if (textDecoder) { - return textDecoder.decode(bytes.subarray(at, to)); - } - return utilUtf8.toUtf8(bytes.subarray(at, to)); -} -function demote(bigInteger) { - const num = Number(bigInteger); - if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) { - console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`)); + } + throw error; } - return num; -} -const minorValueToArgumentLength = { - [extendedOneByte]: 1, - [extendedFloat16]: 2, - [extendedFloat32]: 4, - [extendedFloat64]: 8, }; -function bytesToFloat16(a, b) { - const sign = a >> 7; - const exponent = (a & 0b0111_1100) >> 2; - const fraction = ((a & 0b0000_0011) << 8) | b; - const scalar = sign === 0 ? 1 : -1; - let exponentComponent; - let summation; - if (exponent === 0b00000) { - if (fraction === 0b00000_00000) { - return 0; - } - else { - exponentComponent = Math.pow(2, 1 - 15); - summation = 0; - } +const findHeader = (pattern, headers) => { + return (headers.find(([k]) => { + return k.match(pattern); + }) || [void 0, void 0])[1]; +}; + +const schemaSerializationMiddleware = (config) => (next, context) => async (args) => { + const { operationSchema } = utilMiddleware.getSmithyContext(context); + const [, ns, n, t, i, o] = operationSchema ?? []; + const endpoint = context.endpointV2?.url && config.urlParser + ? async () => config.urlParser(context.endpointV2.url) + : config.endpoint; + const request = await config.protocol.serializeRequest(operation(ns, n, t, i, o), args.input, { + ...config, + ...context, + endpoint, + }); + return next({ + ...args, + request, + }); +}; + +const deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true, +}; +const serializerMiddlewareOption = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true, +}; +function getSchemaSerdePlugin(config) { + return { + applyToStack: (commandStack) => { + commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption); + commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption); + config.protocol.setSerdeContext(config); + }, + }; +} + +class Schema { + name; + namespace; + traits; + static assign(instance, values) { + const schema = Object.assign(instance, values); + return schema; } - else if (exponent === 0b11111) { - if (fraction === 0b00000_00000) { - return scalar * Infinity; - } - else { - return NaN; + static [Symbol.hasInstance](lhs) { + const isPrototype = this.prototype.isPrototypeOf(lhs); + if (!isPrototype && typeof lhs === "object" && lhs !== null) { + const list = lhs; + return list.symbol === this.symbol; } + return isPrototype; } - else { - exponentComponent = Math.pow(2, exponent - 15); - summation = 1; + getName() { + return this.namespace + "#" + this.name; } - summation += fraction / 1024; - return scalar * (exponentComponent * summation); } -function decodeCount(at, to) { - const minor = payload[at] & 0b0001_1111; - if (minor < 24) { - _offset = 1; - return minor; - } - if (minor === extendedOneByte || - minor === extendedFloat16 || - minor === extendedFloat32 || - minor === extendedFloat64) { - const countLength = minorValueToArgumentLength[minor]; - _offset = (countLength + 1); - if (to - at < _offset) { - throw new Error(`countLength ${countLength} greater than remaining buf len.`); - } - const countIndex = at + 1; - if (countLength === 1) { - return payload[countIndex]; - } - else if (countLength === 2) { - return dataView$1.getUint16(countIndex); - } - else if (countLength === 4) { - return dataView$1.getUint32(countIndex); - } - return demote(dataView$1.getBigUint64(countIndex)); - } - throw new Error(`unexpected minor value ${minor}.`); + +class ListSchema extends Schema { + static symbol = Symbol.for("@smithy/lis"); + name; + traits; + valueSchema; + symbol = ListSchema.symbol; } -function decodeUtf8String(at, to) { - const length = decodeCount(at, to); - const offset = _offset; - at += offset; - if (to - at < length) { - throw new Error(`string len ${length} greater than remaining buf len.`); - } - const value = bytesToUtf8(payload, at, at + length); - _offset = offset + length; - return value; +const list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), { + name, + namespace, + traits, + valueSchema, +}); + +class MapSchema extends Schema { + static symbol = Symbol.for("@smithy/map"); + name; + traits; + keySchema; + valueSchema; + symbol = MapSchema.symbol; } -function decodeUtf8StringIndefinite(at, to) { - at += 1; - const vector = []; - for (const base = at; at < to;) { - if (payload[at] === 0b1111_1111) { - const data = alloc(vector.length); - data.set(vector, 0); - _offset = at - base + 2; - return bytesToUtf8(data, 0, data.length); - } - const major = (payload[at] & 0b1110_0000) >> 5; - const minor = payload[at] & 0b0001_1111; - if (major !== majorUtf8String) { - throw new Error(`unexpected major type ${major} in indefinite string.`); - } - if (minor === minorIndefinite) { - throw new Error("nested indefinite string."); - } - const bytes = decodeUnstructuredByteString(at, to); - const length = _offset; - at += length; - for (let i = 0; i < bytes.length; ++i) { - vector.push(bytes[i]); - } - } - throw new Error("expected break marker."); +const map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), { + name, + namespace, + traits, + keySchema, + valueSchema, +}); + +class OperationSchema extends Schema { + static symbol = Symbol.for("@smithy/ope"); + name; + traits; + input; + output; + symbol = OperationSchema.symbol; } -function decodeUnstructuredByteString(at, to) { - const length = decodeCount(at, to); - const offset = _offset; - at += offset; - if (to - at < length) { - throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`); +const op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), { + name, + namespace, + traits, + input, + output, +}); + +class StructureSchema extends Schema { + static symbol = Symbol.for("@smithy/str"); + name; + traits; + memberNames; + memberList; + symbol = StructureSchema.symbol; +} +const struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), { + name, + namespace, + traits, + memberNames, + memberList, +}); + +class ErrorSchema extends StructureSchema { + static symbol = Symbol.for("@smithy/err"); + ctor; + symbol = ErrorSchema.symbol; +} +const error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), { + name, + namespace, + traits, + memberNames, + memberList, + ctor: null, +}); + +function translateTraits(indicator) { + if (typeof indicator === "object") { + return indicator; } - const value = payload.subarray(at, at + length); - _offset = offset + length; - return value; + indicator = indicator | 0; + const traits = {}; + let i = 0; + for (const trait of [ + "httpLabel", + "idempotent", + "idempotencyToken", + "sensitive", + "httpPayload", + "httpResponseCode", + "httpQueryParams", + ]) { + if (((indicator >> i++) & 1) === 1) { + traits[trait] = 1; + } + } + return traits; } -function decodeUnstructuredByteStringIndefinite(at, to) { - at += 1; - const vector = []; - for (const base = at; at < to;) { - if (payload[at] === 0b1111_1111) { - const data = alloc(vector.length); - data.set(vector, 0); - _offset = at - base + 2; - return data; + +const anno = { + it: Symbol.for("@smithy/nor-struct-it"), +}; +class NormalizedSchema { + ref; + memberName; + static symbol = Symbol.for("@smithy/nor"); + symbol = NormalizedSchema.symbol; + name; + schema; + _isMemberSchema; + traits; + memberTraits; + normalizedTraits; + constructor(ref, memberName) { + this.ref = ref; + this.memberName = memberName; + const traitStack = []; + let _ref = ref; + let schema = ref; + this._isMemberSchema = false; + while (isMemberSchema(_ref)) { + traitStack.push(_ref[1]); + _ref = _ref[0]; + schema = deref(_ref); + this._isMemberSchema = true; } - const major = (payload[at] & 0b1110_0000) >> 5; - const minor = payload[at] & 0b0001_1111; - if (major !== majorUnstructuredByteString) { - throw new Error(`unexpected major type ${major} in indefinite string.`); + if (traitStack.length > 0) { + this.memberTraits = {}; + for (let i = traitStack.length - 1; i >= 0; --i) { + const traitSet = traitStack[i]; + Object.assign(this.memberTraits, translateTraits(traitSet)); + } } - if (minor === minorIndefinite) { - throw new Error("nested indefinite string."); + else { + this.memberTraits = 0; } - const bytes = decodeUnstructuredByteString(at, to); - const length = _offset; - at += length; - for (let i = 0; i < bytes.length; ++i) { - vector.push(bytes[i]); + if (schema instanceof NormalizedSchema) { + const computedMemberTraits = this.memberTraits; + Object.assign(this, schema); + this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits()); + this.normalizedTraits = void 0; + this.memberName = memberName ?? schema.memberName; + return; } - } - throw new Error("expected break marker."); -} -function decodeList(at, to) { - const listDataLength = decodeCount(at, to); - const offset = _offset; - at += offset; - const base = at; - const list = Array(listDataLength); - for (let i = 0; i < listDataLength; ++i) { - const item = decode(at, to); - const itemOffset = _offset; - list[i] = item; - at += itemOffset; - } - _offset = offset + (at - base); - return list; -} -function decodeListIndefinite(at, to) { - at += 1; - const list = []; - for (const base = at; at < to;) { - if (payload[at] === 0b1111_1111) { - _offset = at - base + 2; - return list; + this.schema = deref(schema); + if (isStaticSchema(this.schema)) { + this.name = `${this.schema[1]}#${this.schema[2]}`; + this.traits = this.schema[3]; } - const item = decode(at, to); - const n = _offset; - at += n; - list.push(item); - } - throw new Error("expected break marker."); -} -function decodeMap(at, to) { - const mapDataLength = decodeCount(at, to); - const offset = _offset; - at += offset; - const base = at; - const map = {}; - for (let i = 0; i < mapDataLength; ++i) { - if (at >= to) { - throw new Error("unexpected end of map payload."); + else { + this.name = this.memberName ?? String(schema); + this.traits = 0; } - const major = (payload[at] & 0b1110_0000) >> 5; - if (major !== majorUtf8String) { - throw new Error(`unexpected major type ${major} for map key at index ${at}.`); + if (this._isMemberSchema && !memberName) { + throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`); } - const key = decode(at, to); - at += _offset; - const value = decode(at, to); - at += _offset; - map[key] = value; } - _offset = offset + (at - base); - return map; -} -function decodeMapIndefinite(at, to) { - at += 1; - const base = at; - const map = {}; - for (; at < to;) { - if (at >= to) { - throw new Error("unexpected end of map payload."); + static [Symbol.hasInstance](lhs) { + const isPrototype = this.prototype.isPrototypeOf(lhs); + if (!isPrototype && typeof lhs === "object" && lhs !== null) { + const ns = lhs; + return ns.symbol === this.symbol; } - if (payload[at] === 0b1111_1111) { - _offset = at - base + 2; - return map; + return isPrototype; + } + static of(ref) { + const sc = deref(ref); + if (sc instanceof NormalizedSchema) { + return sc; } - const major = (payload[at] & 0b1110_0000) >> 5; - if (major !== majorUtf8String) { - throw new Error(`unexpected major type ${major} for map key.`); + if (isMemberSchema(sc)) { + const [ns, traits] = sc; + if (ns instanceof NormalizedSchema) { + Object.assign(ns.getMergedTraits(), translateTraits(traits)); + return ns; + } + throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`); } - const key = decode(at, to); - at += _offset; - const value = decode(at, to); - at += _offset; - map[key] = value; + return new NormalizedSchema(sc); } - throw new Error("expected break marker."); -} -function decodeSpecial(at, to) { - const minor = payload[at] & 0b0001_1111; - switch (minor) { - case specialTrue: - case specialFalse: - _offset = 1; - return minor === specialTrue; - case specialNull: - _offset = 1; - return null; - case specialUndefined: - _offset = 1; - return null; - case extendedFloat16: - if (to - at < 3) { - throw new Error("incomplete float16 at end of buf."); - } - _offset = 3; - return bytesToFloat16(payload[at + 1], payload[at + 2]); - case extendedFloat32: - if (to - at < 5) { - throw new Error("incomplete float32 at end of buf."); - } - _offset = 5; - return dataView$1.getFloat32(at + 1); - case extendedFloat64: - if (to - at < 9) { - throw new Error("incomplete float64 at end of buf."); - } - _offset = 9; - return dataView$1.getFloat64(at + 1); - default: - throw new Error(`unexpected minor value ${minor}.`); + getSchema() { + const sc = this.schema; + if (Array.isArray(sc) && sc[0] === 0) { + return sc[4]; + } + return sc; } -} -function castBigInt(bigInt) { - if (typeof bigInt === "number") { - return bigInt; + getName(withNamespace = false) { + const { name } = this; + const short = !withNamespace && name && name.includes("#"); + return short ? name.split("#")[1] : name || undefined; } - const num = Number(bigInt); - if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) { - return num; + getMemberName() { + return this.memberName; } - return bigInt; -} - -const USE_BUFFER = typeof Buffer !== "undefined"; -const initialSize = 2048; -let data = alloc(initialSize); -let dataView = new DataView(data.buffer, data.byteOffset, data.byteLength); -let cursor = 0; -function ensureSpace(bytes) { - const remaining = data.byteLength - cursor; - if (remaining < bytes) { - if (cursor < 16_000_000) { - resize(Math.max(data.byteLength * 4, data.byteLength + bytes)); - } - else { - resize(data.byteLength + bytes + 16_000_000); - } + isMemberSchema() { + return this._isMemberSchema; } -} -function toUint8Array() { - const out = alloc(cursor); - out.set(data.subarray(0, cursor), 0); - cursor = 0; - return out; -} -function resize(size) { - const old = data; - data = alloc(size); - if (old) { - if (old.copy) { - old.copy(data, 0, 0, old.byteLength); + isListSchema() { + const sc = this.getSchema(); + return typeof sc === "number" + ? sc >= 64 && sc < 128 + : sc[0] === 1; + } + isMapSchema() { + const sc = this.getSchema(); + return typeof sc === "number" + ? sc >= 128 && sc <= 0b1111_1111 + : sc[0] === 2; + } + isStructSchema() { + const sc = this.getSchema(); + if (typeof sc !== "object") { + return false; } - else { - data.set(old, 0); + const id = sc[0]; + return (id === 3 || + id === -3 || + id === 4); + } + isUnionSchema() { + const sc = this.getSchema(); + if (typeof sc !== "object") { + return false; } + return sc[0] === 4; } - dataView = new DataView(data.buffer, data.byteOffset, data.byteLength); -} -function encodeHeader(major, value) { - if (value < 24) { - data[cursor++] = (major << 5) | value; + isBlobSchema() { + const sc = this.getSchema(); + return sc === 21 || sc === 42; } - else if (value < 1 << 8) { - data[cursor++] = (major << 5) | 24; - data[cursor++] = value; + isTimestampSchema() { + const sc = this.getSchema(); + return (typeof sc === "number" && + sc >= 4 && + sc <= 7); } - else if (value < 1 << 16) { - data[cursor++] = (major << 5) | extendedFloat16; - dataView.setUint16(cursor, value); - cursor += 2; + isUnitSchema() { + return this.getSchema() === "unit"; } - else if (value < 2 ** 32) { - data[cursor++] = (major << 5) | extendedFloat32; - dataView.setUint32(cursor, value); - cursor += 4; + isDocumentSchema() { + return this.getSchema() === 15; } - else { - data[cursor++] = (major << 5) | extendedFloat64; - dataView.setBigUint64(cursor, typeof value === "bigint" ? value : BigInt(value)); - cursor += 8; + isStringSchema() { + return this.getSchema() === 0; } -} -function encode(_input) { - const encodeStack = [_input]; - while (encodeStack.length) { - const input = encodeStack.pop(); - ensureSpace(typeof input === "string" ? input.length * 4 : 64); - if (typeof input === "string") { - if (USE_BUFFER) { - encodeHeader(majorUtf8String, Buffer.byteLength(input)); - cursor += data.write(input, cursor); - } - else { - const bytes = utilUtf8.fromUtf8(input); - encodeHeader(majorUtf8String, bytes.byteLength); - data.set(bytes, cursor); - cursor += bytes.byteLength; - } - continue; + isBooleanSchema() { + return this.getSchema() === 2; + } + isNumericSchema() { + return this.getSchema() === 1; + } + isBigIntegerSchema() { + return this.getSchema() === 17; + } + isBigDecimalSchema() { + return this.getSchema() === 19; + } + isStreaming() { + const { streaming } = this.getMergedTraits(); + return !!streaming || this.getSchema() === 42; + } + isIdempotencyToken() { + return !!this.getMergedTraits().idempotencyToken; + } + getMergedTraits() { + return (this.normalizedTraits ?? + (this.normalizedTraits = { + ...this.getOwnTraits(), + ...this.getMemberTraits(), + })); + } + getMemberTraits() { + return translateTraits(this.memberTraits); + } + getOwnTraits() { + return translateTraits(this.traits); + } + getKeySchema() { + const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()]; + if (!isDoc && !isMap) { + throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`); } - else if (typeof input === "number") { - if (Number.isInteger(input)) { - const nonNegative = input >= 0; - const major = nonNegative ? majorUint64 : majorNegativeInt64; - const value = nonNegative ? input : -input - 1; - if (value < 24) { - data[cursor++] = (major << 5) | value; - } - else if (value < 256) { - data[cursor++] = (major << 5) | 24; - data[cursor++] = value; - } - else if (value < 65536) { - data[cursor++] = (major << 5) | extendedFloat16; - data[cursor++] = value >> 8; - data[cursor++] = value; - } - else if (value < 4294967296) { - data[cursor++] = (major << 5) | extendedFloat32; - dataView.setUint32(cursor, value); - cursor += 4; - } - else { - data[cursor++] = (major << 5) | extendedFloat64; - dataView.setBigUint64(cursor, BigInt(value)); - cursor += 8; - } - continue; - } - data[cursor++] = (majorSpecial << 5) | extendedFloat64; - dataView.setFloat64(cursor, input); - cursor += 8; - continue; + const schema = this.getSchema(); + const memberSchema = isDoc + ? 15 + : schema[4] ?? 0; + return member([memberSchema, 0], "key"); + } + getValueSchema() { + const sc = this.getSchema(); + const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()]; + const memberSchema = typeof sc === "number" + ? 0b0011_1111 & sc + : sc && typeof sc === "object" && (isMap || isList) + ? sc[3 + sc[0]] + : isDoc + ? 15 + : void 0; + if (memberSchema != null) { + return member([memberSchema, 0], isMap ? "value" : "member"); } - else if (typeof input === "bigint") { - const nonNegative = input >= 0; - const major = nonNegative ? majorUint64 : majorNegativeInt64; - const value = nonNegative ? input : -input - BigInt(1); - const n = Number(value); - if (n < 24) { - data[cursor++] = (major << 5) | n; - } - else if (n < 256) { - data[cursor++] = (major << 5) | 24; - data[cursor++] = n; - } - else if (n < 65536) { - data[cursor++] = (major << 5) | extendedFloat16; - data[cursor++] = n >> 8; - data[cursor++] = n & 0b1111_1111; - } - else if (n < 4294967296) { - data[cursor++] = (major << 5) | extendedFloat32; - dataView.setUint32(cursor, n); - cursor += 4; - } - else if (value < BigInt("18446744073709551616")) { - data[cursor++] = (major << 5) | extendedFloat64; - dataView.setBigUint64(cursor, value); - cursor += 8; + throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`); + } + getMemberSchema(memberName) { + const struct = this.getSchema(); + if (this.isStructSchema() && struct[4].includes(memberName)) { + const i = struct[4].indexOf(memberName); + const memberSchema = struct[5][i]; + return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName); + } + if (this.isDocumentSchema()) { + return member([15, 0], memberName); + } + throw new Error(`@smithy/core/schema - ${this.getName(true)} has no no member=${memberName}.`); + } + getMemberSchemas() { + const buffer = {}; + try { + for (const [k, v] of this.structIterator()) { + buffer[k] = v; } - else { - const binaryBigInt = value.toString(2); - const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8)); - let b = value; - let i = 0; - while (bigIntBytes.byteLength - ++i >= 0) { - bigIntBytes[bigIntBytes.byteLength - i] = Number(b & BigInt(255)); - b >>= BigInt(8); - } - ensureSpace(bigIntBytes.byteLength * 2); - data[cursor++] = nonNegative ? 0b110_00010 : 0b110_00011; - if (USE_BUFFER) { - encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes)); - } - else { - encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength); + } + catch (ignored) { } + return buffer; + } + getEventStreamMember() { + if (this.isStructSchema()) { + for (const [memberName, memberSchema] of this.structIterator()) { + if (memberSchema.isStreaming() && memberSchema.isStructSchema()) { + return memberName; } - data.set(bigIntBytes, cursor); - cursor += bigIntBytes.byteLength; } - continue; } - else if (input === null) { - data[cursor++] = (majorSpecial << 5) | specialNull; - continue; + return ""; + } + *structIterator() { + if (this.isUnitSchema()) { + return; } - else if (typeof input === "boolean") { - data[cursor++] = (majorSpecial << 5) | (input ? specialTrue : specialFalse); - continue; + if (!this.isStructSchema()) { + throw new Error("@smithy/core/schema - cannot iterate non-struct schema."); } - else if (typeof input === "undefined") { - throw new Error("@smithy/core/cbor: client may not serialize undefined value."); + const struct = this.getSchema(); + const z = struct[4].length; + let it = struct[anno.it]; + if (it && z === it.length) { + yield* it; + return; } - else if (Array.isArray(input)) { - for (let i = input.length - 1; i >= 0; --i) { - encodeStack.push(input[i]); - } - encodeHeader(majorList, input.length); - continue; + it = Array(z); + for (let i = 0; i < z; ++i) { + const k = struct[4][i]; + const v = member([struct[5][i], 0], k); + yield (it[i] = [k, v]); } - else if (typeof input.byteLength === "number") { - ensureSpace(input.length * 2); - encodeHeader(majorUnstructuredByteString, input.length); - data.set(input, cursor); - cursor += input.byteLength; - continue; + struct[anno.it] = it; + } +} +function member(memberSchema, memberName) { + if (memberSchema instanceof NormalizedSchema) { + return Object.assign(memberSchema, { + memberName, + _isMemberSchema: true, + }); + } + const internalCtorAccess = NormalizedSchema; + return new internalCtorAccess(memberSchema, memberName); +} +const isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2; +const isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5; + +class SimpleSchema extends Schema { + static symbol = Symbol.for("@smithy/sim"); + name; + schemaRef; + traits; + symbol = SimpleSchema.symbol; +} +const sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), { + name, + namespace, + traits, + schemaRef, +}); +const simAdapter = (namespace, name, traits, schemaRef) => Schema.assign(new SimpleSchema(), { + name, + namespace, + traits, + schemaRef, +}); + +const SCHEMA = { + BLOB: 0b0001_0101, + STREAMING_BLOB: 0b0010_1010, + BOOLEAN: 0b0000_0010, + STRING: 0b0000_0000, + NUMERIC: 0b0000_0001, + BIG_INTEGER: 0b0001_0001, + BIG_DECIMAL: 0b0001_0011, + DOCUMENT: 0b0000_1111, + TIMESTAMP_DEFAULT: 0b0000_0100, + TIMESTAMP_DATE_TIME: 0b0000_0101, + TIMESTAMP_HTTP_DATE: 0b0000_0110, + TIMESTAMP_EPOCH_SECONDS: 0b0000_0111, + LIST_MODIFIER: 0b0100_0000, + MAP_MODIFIER: 0b1000_0000, +}; + +class TypeRegistry { + namespace; + schemas; + exceptions; + static registries = new Map(); + constructor(namespace, schemas = new Map(), exceptions = new Map()) { + this.namespace = namespace; + this.schemas = schemas; + this.exceptions = exceptions; + } + static for(namespace) { + if (!TypeRegistry.registries.has(namespace)) { + TypeRegistry.registries.set(namespace, new TypeRegistry(namespace)); } - else if (typeof input === "object") { - if (input instanceof serde.NumericValue) { - const decimalIndex = input.string.indexOf("."); - const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1; - const mantissa = BigInt(input.string.replace(".", "")); - data[cursor++] = 0b110_00100; - encodeStack.push(mantissa); - encodeStack.push(exponent); - encodeHeader(majorList, 2); - continue; + return TypeRegistry.registries.get(namespace); + } + copyFrom(other) { + const { schemas, exceptions } = this; + for (const [k, v] of other.schemas) { + if (!schemas.has(k)) { + schemas.set(k, v); } - if (input[tagSymbol]) { - if ("tag" in input && "value" in input) { - encodeStack.push(input.value); - encodeHeader(majorTag, input.tag); - continue; - } - else { - throw new Error("tag encountered with missing fields, need 'tag' and 'value', found: " + JSON.stringify(input)); + } + for (const [k, v] of other.exceptions) { + if (!exceptions.has(k)) { + exceptions.set(k, v); + } + } + } + register(shapeId, schema) { + const qualifiedName = this.normalizeShapeId(shapeId); + for (const r of [this, TypeRegistry.for(qualifiedName.split("#")[0])]) { + r.schemas.set(qualifiedName, schema); + } + } + getSchema(shapeId) { + const id = this.normalizeShapeId(shapeId); + if (!this.schemas.has(id)) { + throw new Error(`@smithy/core/schema - schema not found for ${id}`); + } + return this.schemas.get(id); + } + registerError(es, ctor) { + const $error = es; + const ns = $error[1]; + for (const r of [this, TypeRegistry.for(ns)]) { + r.schemas.set(ns + "#" + $error[2], $error); + r.exceptions.set($error, ctor); + } + } + getErrorCtor(es) { + const $error = es; + if (this.exceptions.has($error)) { + return this.exceptions.get($error); + } + const registry = TypeRegistry.for($error[1]); + return registry.exceptions.get($error); + } + getBaseException() { + for (const exceptionKey of this.exceptions.keys()) { + if (Array.isArray(exceptionKey)) { + const [, ns, name] = exceptionKey; + const id = ns + "#" + name; + if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) { + return exceptionKey; } } - const keys = Object.keys(input); - for (let i = keys.length - 1; i >= 0; --i) { - const key = keys[i]; - encodeStack.push(input[key]); - encodeStack.push(key); - } - encodeHeader(majorMap, keys.length); - continue; } - throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`); + return undefined; + } + find(predicate) { + return [...this.schemas.values()].find(predicate); + } + clear() { + this.schemas.clear(); + this.exceptions.clear(); + } + normalizeShapeId(shapeId) { + if (shapeId.includes("#")) { + return shapeId; + } + return this.namespace + "#" + shapeId; } } -const cbor = { - deserialize(payload) { - setPayload(payload); - return decode(0, payload.length); - }, - serialize(input) { - try { - encode(input); - return toUint8Array(); +exports.ErrorSchema = ErrorSchema; +exports.ListSchema = ListSchema; +exports.MapSchema = MapSchema; +exports.NormalizedSchema = NormalizedSchema; +exports.OperationSchema = OperationSchema; +exports.SCHEMA = SCHEMA; +exports.Schema = Schema; +exports.SimpleSchema = SimpleSchema; +exports.StructureSchema = StructureSchema; +exports.TypeRegistry = TypeRegistry; +exports.deref = deref; +exports.deserializerMiddlewareOption = deserializerMiddlewareOption; +exports.error = error; +exports.getSchemaSerdePlugin = getSchemaSerdePlugin; +exports.isStaticSchema = isStaticSchema; +exports.list = list; +exports.map = map; +exports.op = op; +exports.operation = operation; +exports.serializerMiddlewareOption = serializerMiddlewareOption; +exports.sim = sim; +exports.simAdapter = simAdapter; +exports.struct = struct; +exports.translateTraits = translateTraits; + + +/***/ }), + +/***/ 2430: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var uuid = __nccwpck_require__(266); + +const copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source; + +const parseBoolean = (value) => { + switch (value) { + case "true": + return true; + case "false": + return false; + default: + throw new Error(`Unable to parse boolean value "${value}"`); + } +}; +const expectBoolean = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "number") { + if (value === 0 || value === 1) { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); } - catch (e) { - toUint8Array(); - throw e; + if (value === 0) { + return false; } - }, - resizeEncodingBuffer(size) { - resize(size); - }, + 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}`); }; - -const parseCborBody = (streamBody, context) => { - return protocols.collectBody(streamBody, context).then(async (bytes) => { - if (bytes.length) { - try { - return cbor.deserialize(bytes); - } - catch (e) { - Object.defineProperty(e, "$responseBodyText", { - value: context.utf8Encoder(bytes), - }); - throw e; +const expectNumber = (value) => { + if (value === null || value === undefined) { + return undefined; + } + 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; } - return {}; - }); + } + if (typeof value === "number") { + return value; + } + throw new TypeError(`Expected number, got ${typeof value}: ${value}`); }; -const dateToTag = (date) => { - return tag({ - tag: 1, - value: date.getTime() / 1000, - }); +const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); +const expectFloat32 = (value) => { + const expected = expectNumber(value); + if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { + if (Math.abs(expected) > MAX_FLOAT) { + throw new TypeError(`Expected 32-bit float, got ${value}`); + } + } + return expected; }; -const parseCborErrorBody = async (errorBody, context) => { - const value = await parseCborBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; +const expectLong = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (Number.isInteger(value) && !Number.isNaN(value)) { + return value; + } + throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); }; -const loadSmithyRpcV2CborErrorCode = (output, data) => { - 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]; +const expectInt = expectLong; +const expectInt32 = (value) => expectSizedInt(value, 32); +const expectShort = (value) => expectSizedInt(value, 16); +const expectByte = (value) => expectSizedInt(value, 8); +const expectSizedInt = (value, size) => { + const expected = expectLong(value); + if (expected !== undefined && castInt(expected, size) !== expected) { + throw new TypeError(`Expected ${size}-bit integer, got ${value}`); + } + return expected; +}; +const castInt = (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]; + } +}; +const expectNonNull = (value, location) => { + if (value === null || value === undefined) { + if (location) { + throw new TypeError(`Expected a non-null value for ${location}`); } - return cleanValue; - }; - if (data["__type"] !== undefined) { - return sanitizeErrorCode(data["__type"]); + throw new TypeError("Expected a non-null value"); } - const codeKey = Object.keys(data).find((key) => key.toLowerCase() === "code"); - if (codeKey && data[codeKey] !== undefined) { - return sanitizeErrorCode(data[codeKey]); + return value; +}; +const expectObject = (value) => { + if (value === null || value === undefined) { + return undefined; + } + 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}`); }; -const checkCborResponse = (response) => { - if (String(response.headers["smithy-protocol"]).toLowerCase() !== "rpc-v2-cbor") { - throw new Error("Malformed RPCv2 CBOR response, status: " + response.statusCode); +const expectString = (value) => { + if (value === null || value === undefined) { + return undefined; + } + 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}`); }; -const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const contents = { - protocol, - hostname, - port, - method: "POST", - path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, - headers: { - ...headers, - }, - }; - if (resolvedHostname !== undefined) { - contents.hostname = resolvedHostname; +const expectUnion = (value) => { + if (value === null || value === undefined) { + return undefined; } - if (body !== undefined) { - contents.body = body; - try { - contents.headers["content-length"] = String(utilBodyLengthBrowser.calculateBodyLength(body)); - } - catch (e) { } + 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.`); } - return new protocolHttp.HttpRequest(contents); + if (setKeys.length > 1) { + throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); + } + return asObject; }; - -class CborCodec extends protocols.SerdeContext { - createSerializer() { - const serializer = new CborShapeSerializer(); - serializer.setSerdeContext(this.serdeContext); - return serializer; +const strictParseDouble = (value) => { + if (typeof value == "string") { + return expectNumber(parseNumber(value)); } - createDeserializer() { - const deserializer = new CborShapeDeserializer(); - deserializer.setSerdeContext(this.serdeContext); - return deserializer; + return expectNumber(value); +}; +const strictParseFloat = strictParseDouble; +const strictParseFloat32 = (value) => { + if (typeof value == "string") { + return expectFloat32(parseNumber(value)); + } + return expectFloat32(value); +}; +const NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; +const parseNumber = (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); +}; +const limitedParseDouble = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectNumber(value); +}; +const handleFloat = limitedParseDouble; +const limitedParseFloat = limitedParseDouble; +const limitedParseFloat32 = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectFloat32(value); +}; +const parseFloatString = (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}`); + } +}; +const strictParseLong = (value) => { + if (typeof value === "string") { + return expectLong(parseNumber(value)); + } + return expectLong(value); +}; +const strictParseInt = strictParseLong; +const strictParseInt32 = (value) => { + if (typeof value === "string") { + return expectInt32(parseNumber(value)); + } + return expectInt32(value); +}; +const strictParseShort = (value) => { + if (typeof value === "string") { + return expectShort(parseNumber(value)); + } + return expectShort(value); +}; +const strictParseByte = (value) => { + if (typeof value === "string") { + return expectByte(parseNumber(value)); } + return expectByte(value); +}; +const stackTraceWarning = (message) => { + return String(new TypeError(message).stack || message) + .split("\n") + .slice(0, 5) + .filter((s) => !s.includes("stackTraceWarning")) + .join("\n"); +}; +const logger = { + warn: console.warn, +}; + +const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; +const 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`; } -class CborShapeSerializer extends protocols.SerdeContext { - value; - write(schema, value) { - this.value = this.serialize(schema, value); +const RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); +const parseRfc3339DateTime = (value) => { + if (value === null || value === undefined) { + return undefined; } - serialize(schema$1, source) { - const ns = schema.NormalizedSchema.of(schema$1); - if (source == null) { - if (ns.isIdempotencyToken()) { - return serde.generateIdempotencyToken(); - } - return source; - } - if (ns.isBlobSchema()) { - if (typeof source === "string") { - return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(source); - } - return source; - } - if (ns.isTimestampSchema()) { - if (typeof source === "number" || typeof source === "bigint") { - return dateToTag(new Date((Number(source) / 1000) | 0)); - } - return dateToTag(source); - } - if (typeof source === "function" || typeof source === "object") { - const sourceObject = source; - if (ns.isListSchema() && Array.isArray(sourceObject)) { - const sparse = !!ns.getMergedTraits().sparse; - const newArray = []; - let i = 0; - for (const item of sourceObject) { - const value = this.serialize(ns.getValueSchema(), item); - if (value != null || sparse) { - newArray[i++] = value; - } - } - return newArray; - } - if (sourceObject instanceof Date) { - return dateToTag(sourceObject); - } - const newObject = {}; - if (ns.isMapSchema()) { - const sparse = !!ns.getMergedTraits().sparse; - for (const key of Object.keys(sourceObject)) { - const value = this.serialize(ns.getValueSchema(), sourceObject[key]); - if (value != null || sparse) { - newObject[key] = value; - } - } - } - else if (ns.isStructSchema()) { - for (const [key, memberSchema] of ns.structIterator()) { - const value = this.serialize(memberSchema, sourceObject[key]); - if (value != null) { - newObject[key] = value; - } - } - } - else if (ns.isDocumentSchema()) { - for (const key of Object.keys(sourceObject)) { - newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]); - } - } - return newObject; - } - return source; + 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 }); +}; +const RFC3339_WITH_OFFSET$1 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); +const parseRfc3339DateTimeWithOffset = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339_WITH_OFFSET$1.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; +}; +const IMF_FIXDATE$1 = 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$/); +const RFC_850_DATE$1 = 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$/); +const ASC_TIME$1 = 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})$/); +const parseRfc7231DateTime = (value) => { + if (value === null || value === undefined) { + return undefined; } - flush() { - const buffer = cbor.serialize(this.value); - this.value = undefined; - return buffer; + if (typeof value !== "string") { + throw new TypeError("RFC-7231 date-times must be expressed as strings"); } -} -class CborShapeDeserializer extends protocols.SerdeContext { - read(schema, bytes) { - const data = cbor.deserialize(bytes); - return this.readValue(schema, data); + let match = IMF_FIXDATE$1.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 }); } - readValue(_schema, value) { - const ns = schema.NormalizedSchema.of(_schema); - if (ns.isTimestampSchema() && typeof value === "number") { - return serde._parseEpochTimestamp(value); - } - if (ns.isBlobSchema()) { - if (typeof value === "string") { - return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value); - } - return value; - } - if (typeof value === "undefined" || - typeof value === "boolean" || - typeof value === "number" || - typeof value === "string" || - typeof value === "bigint" || - typeof value === "symbol") { - return value; - } - else if (typeof value === "function" || typeof value === "object") { - if (value === null) { - return null; - } - if ("byteLength" in value) { - return value; - } - if (value instanceof Date) { - return value; - } - if (ns.isDocumentSchema()) { - return value; - } - if (ns.isListSchema()) { - const newArray = []; - const memberSchema = ns.getValueSchema(); - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - const itemValue = this.readValue(memberSchema, item); - if (itemValue != null || sparse) { - newArray.push(itemValue); - } - } - return newArray; - } - const newObject = {}; - if (ns.isMapSchema()) { - const sparse = !!ns.getMergedTraits().sparse; - const targetSchema = ns.getValueSchema(); - for (const key of Object.keys(value)) { - const itemValue = this.readValue(targetSchema, value[key]); - if (itemValue != null || sparse) { - newObject[key] = itemValue; - } - } - } - else if (ns.isStructSchema()) { - for (const [key, memberSchema] of ns.structIterator()) { - const v = this.readValue(memberSchema, value[key]); - if (v != null) { - newObject[key] = v; - } - } - } - return newObject; - } - else { - return value; - } + match = RFC_850_DATE$1.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, + })); } -} - -class SmithyRpcV2CborProtocol extends protocols.RpcProtocol { - codec = new CborCodec(); - serializer = this.codec.createSerializer(); - deserializer = this.codec.createDeserializer(); - constructor({ defaultNamespace }) { - super({ defaultNamespace }); + match = ASC_TIME$1.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 }); } - getShapeId() { - return "smithy.protocols#rpcv2Cbor"; + throw new TypeError("Invalid RFC-7231 date-time value"); +}; +const parseEpochTimestamp = (value) => { + if (value === null || value === undefined) { + return undefined; } - getPayloadCodec() { - return this.codec; + let valueAsDouble; + if (typeof value === "number") { + valueAsDouble = value; } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - Object.assign(request.headers, { - "content-type": this.getDefaultContentType(), - "smithy-protocol": "rpc-v2-cbor", - accept: this.getDefaultContentType(), - }); - if (schema.deref(operationSchema.input) === "unit") { - delete request.body; - delete request.headers["content-type"]; - } - else { - if (!request.body) { - this.serializer.write(15, {}); - request.body = this.serializer.flush(); - } - try { - request.headers["content-length"] = String(request.body.byteLength); - } - catch (e) { } - } - const { service, operation } = utilMiddleware.getSmithyContext(context); - const path = `/service/${service}/operation/${operation}`; - if (request.path.endsWith("/")) { - request.path += path.slice(1); - } - else { - request.path += path; - } - return request; + else if (typeof value === "string") { + valueAsDouble = strictParseDouble(value); } - async deserializeResponse(operationSchema, context, response) { - return super.deserializeResponse(operationSchema, context, response); + else if (typeof value === "object" && value.tag === 1) { + valueAsDouble = value.value; } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; - let namespace = this.options.defaultNamespace; - if (errorName.includes("#")) { - [namespace] = errorName.split("#"); - } - const errorMetadata = { - $metadata: metadata, - $fault: response.statusCode <= 500 ? "client" : "server", - }; - const registry = schema.TypeRegistry.for(namespace); - let errorSchema; - try { - errorSchema = registry.getSchema(errorName); - } - catch (e) { - if (dataObject.Message) { - dataObject.message = dataObject.Message; - } - const synthetic = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); - const baseExceptionSchema = synthetic.getBaseException(); - if (baseExceptionSchema) { - const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema); - throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject); - } - throw Object.assign(new Error(errorName), errorMetadata, dataObject); - } - const ns = schema.NormalizedSchema.of(errorSchema); - const ErrorCtor = registry.getErrorCtor(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const exception = new ErrorCtor(message); - const output = {}; - for (const [name, member] of ns.structIterator()) { - output[name] = this.deserializer.readValue(member, dataObject[name]); - } - throw Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message, - }, output); + else { + throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); } - getDefaultContentType() { - return "application/cbor"; + if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { + throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); } -} - -exports.CborCodec = CborCodec; -exports.CborShapeDeserializer = CborShapeDeserializer; -exports.CborShapeSerializer = CborShapeSerializer; -exports.SmithyRpcV2CborProtocol = SmithyRpcV2CborProtocol; -exports.buildHttpRpcRequest = buildHttpRpcRequest; -exports.cbor = cbor; -exports.checkCborResponse = checkCborResponse; -exports.dateToTag = dateToTag; -exports.loadSmithyRpcV2CborErrorCode = loadSmithyRpcV2CborErrorCode; -exports.parseCborBody = parseCborBody; -exports.parseCborErrorBody = parseCborErrorBody; -exports.tag = tag; -exports.tagSymbol = tagSymbol; - - -/***/ }), - -/***/ 3422: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var utilStream = __nccwpck_require__(4252); -var schema = __nccwpck_require__(6890); -var serde = __nccwpck_require__(2430); -var protocolHttp = __nccwpck_require__(2356); -var utilBase64 = __nccwpck_require__(8385); -var utilUtf8 = __nccwpck_require__(1577); - -const collectBody = async (streamBody = new Uint8Array(), context) => { - if (streamBody instanceof Uint8Array) { - return utilStream.Uint8ArrayBlobAdapter.mutate(streamBody); + return new Date(Math.round(valueAsDouble * 1000)); +}; +const buildDate = (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), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds))); +}; +const parseTwoDigitYear = (value) => { + const thisYear = new Date().getUTCFullYear(); + const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); + if (valueInThisCentury < thisYear) { + return valueInThisCentury + 100; } - if (!streamBody) { - return utilStream.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); + return valueInThisCentury; +}; +const FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000; +const adjustRfc850Year = (input) => { + if (input.getTime() - 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())); } - const fromContext = context.streamCollector(streamBody); - return utilStream.Uint8ArrayBlobAdapter.mutate(await fromContext); + return input; +}; +const parseMonthByShortName = (value) => { + const monthIdx = MONTHS.indexOf(value); + if (monthIdx < 0) { + throw new TypeError(`Invalid month: ${value}`); + } + return monthIdx + 1; +}; +const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +const validateDayOfMonth = (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}`); + } +}; +const isLeapYear = (year) => { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +}; +const parseDateValue = (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; +}; +const parseMilliseconds = (value) => { + if (value === null || value === undefined) { + return 0; + } + return strictParseFloat32("0." + value) * 1000; +}; +const parseOffsetToMilliseconds = (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 * 1000; +}; +const stripLeadingZeroes = (value) => { + let idx = 0; + while (idx < value.length - 1 && value.charAt(idx) === "0") { + idx++; + } + if (idx === 0) { + return value; + } + return value.slice(idx); }; -function extendedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); +const LazyJsonString = function LazyJsonString(val) { + const str = Object.assign(new String(val), { + deserializeJSON() { + return JSON.parse(String(val)); + }, + toString() { + return String(val); + }, + toJSON() { + return String(val); + }, }); -} + return str; +}; +LazyJsonString.from = (object) => { + if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) { + return object; + } + else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) { + return LazyJsonString(String(object)); + } + return LazyJsonString(JSON.stringify(object)); +}; +LazyJsonString.fromObject = LazyJsonString.from; -class SerdeContext { - serdeContext; - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; +function quoteHeader(part) { + if (part.includes(",") || part.includes('"')) { + part = `"${part.replace(/"/g, '\\"')}"`; } + return part; } -class HttpProtocol extends SerdeContext { - options; - constructor(options) { - super(); - this.options = options; - } - getRequestType() { - return protocolHttp.HttpRequest; +const ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`; +const mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`; +const time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`; +const date = `(\\d?\\d)`; +const year = `(\\d{4})`; +const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/); +const IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`); +const RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`); +const ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`); +const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +const _parseEpochTimestamp = (value) => { + if (value == null) { + return void 0; } - getResponseType() { - return protocolHttp.HttpResponse; + let num = NaN; + if (typeof value === "number") { + num = value; } - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - this.serializer.setSerdeContext(serdeContext); - this.deserializer.setSerdeContext(serdeContext); - if (this.getPayloadCodec()) { - this.getPayloadCodec().setSerdeContext(serdeContext); + else if (typeof value === "string") { + if (!/^-?\d*\.?\d+$/.test(value)) { + throw new TypeError(`parseEpochTimestamp - numeric string invalid.`); } + num = Number.parseFloat(value); } - updateServiceEndpoint(request, endpoint) { - if ("url" in endpoint) { - request.protocol = endpoint.url.protocol; - request.hostname = endpoint.url.hostname; - request.port = endpoint.url.port ? Number(endpoint.url.port) : undefined; - request.path = endpoint.url.pathname; - request.fragment = endpoint.url.hash || void 0; - request.username = endpoint.url.username || void 0; - request.password = endpoint.url.password || void 0; - if (!request.query) { - request.query = {}; - } - for (const [k, v] of endpoint.url.searchParams.entries()) { - request.query[k] = v; - } - return request; - } - else { - request.protocol = endpoint.protocol; - request.hostname = endpoint.hostname; - request.port = endpoint.port ? Number(endpoint.port) : undefined; - request.path = endpoint.path; - request.query = { - ...endpoint.query, - }; - return request; - } + else if (typeof value === "object" && value.tag === 1) { + num = value.value; } - setHostPrefix(request, operationSchema, input) { - const inputNs = schema.NormalizedSchema.of(operationSchema.input); - const opTraits = schema.translateTraits(operationSchema.traits ?? {}); - if (opTraits.endpoint) { - let hostPrefix = opTraits.endpoint?.[0]; - if (typeof hostPrefix === "string") { - const hostLabelInputs = [...inputNs.structIterator()].filter(([, member]) => member.getMergedTraits().hostLabel); - for (const [name] of hostLabelInputs) { - const replacement = input[name]; - if (typeof replacement !== "string") { - throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`); - } - hostPrefix = hostPrefix.replace(`{${name}}`, replacement); - } - request.hostname = hostPrefix + request.hostname; - } - } + if (isNaN(num) || Math.abs(num) === Infinity) { + throw new TypeError("Epoch timestamps must be valid finite numbers."); } - deserializeMetadata(output) { - return { - 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"], - }; + return new Date(Math.round(num * 1000)); +}; +const _parseRfc3339DateTimeWithOffset = (value) => { + if (value == null) { + return void 0; } - async serializeEventStream({ eventStream, requestSchema, initialRequest, }) { - const eventStreamSerde = await this.loadEventStreamCapability(); - return eventStreamSerde.serializeEventStream({ - eventStream, - requestSchema, - initialRequest, - }); + if (typeof value !== "string") { + throw new TypeError("RFC3339 timestamps must be strings"); } - async deserializeEventStream({ response, responseSchema, initialResponseContainer, }) { - const eventStreamSerde = await this.loadEventStreamCapability(); - return eventStreamSerde.deserializeEventStream({ - response, - responseSchema, - initialResponseContainer, - }); + const matches = RFC3339_WITH_OFFSET.exec(value); + if (!matches) { + throw new TypeError(`Invalid RFC3339 timestamp format ${value}`); } - async loadEventStreamCapability() { - const { EventStreamSerde } = await __nccwpck_require__.e(/* import() */ 579).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6579, 19)); - return new EventStreamSerde({ - marshaller: this.getEventStreamMarshaller(), - serializer: this.serializer, - deserializer: this.deserializer, - serdeContext: this.serdeContext, - defaultContentType: this.getDefaultContentType(), - }); + const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches; + range(monthStr, 1, 12); + range(dayStr, 1, 31); + range(hours, 0, 23); + range(minutes, 0, 59); + range(seconds, 0, 60); + const date = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1000) : 0)); + date.setUTCFullYear(Number(yearStr)); + if (offsetStr.toUpperCase() != "Z") { + const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0]; + const scalar = sign === "-" ? 1 : -1; + date.setTime(date.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1000 + Number(offsetM) * 60 * 1000)); } - getDefaultContentType() { - throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`); + return date; +}; +const _parseRfc7231DateTime = (value) => { + if (value == null) { + return void 0; } - async deserializeHttpMessage(schema, context, response, arg4, arg5) { - return []; + if (typeof value !== "string") { + throw new TypeError("RFC7231 timestamps must be strings."); + } + let day; + let month; + let year; + let hour; + let minute; + let second; + let fraction; + let matches; + if ((matches = IMF_FIXDATE.exec(value))) { + [, day, month, year, hour, minute, second, fraction] = matches; + } + else if ((matches = RFC_850_DATE.exec(value))) { + [, day, month, year, hour, minute, second, fraction] = matches; + year = (Number(year) + 1900).toString(); + } + else if ((matches = ASC_TIME.exec(value))) { + [, month, day, hour, minute, second, fraction, year] = matches; + } + if (year && second) { + const timestamp = Date.UTC(Number(year), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1000) : 0); + range(day, 1, 31); + range(hour, 0, 23); + range(minute, 0, 59); + range(second, 0, 60); + const date = new Date(timestamp); + date.setUTCFullYear(Number(year)); + return date; } - getEventStreamMarshaller() { - const context = this.serdeContext; - if (!context.eventStreamMarshaller) { - throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext."); - } - return context.eventStreamMarshaller; + throw new TypeError(`Invalid RFC7231 date-time value ${value}.`); +}; +function range(v, min, max) { + const _v = Number(v); + if (_v < min || _v > max) { + throw new Error(`Value ${_v} out of range [${min}, ${max}]`); } } -class HttpBindingProtocol extends HttpProtocol { - async serializeRequest(operationSchema, _input, context) { - const input = { - ...(_input ?? {}), - }; - const serializer = this.serializer; - const query = {}; - const headers = {}; - const endpoint = await context.endpoint(); - const ns = schema.NormalizedSchema.of(operationSchema?.input); - const schema$1 = ns.getSchema(); - let hasNonHttpBindingMember = false; - let payload; - const request = new protocolHttp.HttpRequest({ - protocol: "", - hostname: "", - port: undefined, - path: "", - fragment: undefined, - query: query, - headers: headers, - body: undefined, - }); - if (endpoint) { - this.updateServiceEndpoint(request, endpoint); - this.setHostPrefix(request, operationSchema, input); - const opTraits = schema.translateTraits(operationSchema.traits); - if (opTraits.http) { - request.method = opTraits.http[0]; - const [path, search] = opTraits.http[1].split("?"); - if (request.path == "/") { - request.path = path; - } - else { - request.path += path; - } - const traitSearchParams = new URLSearchParams(search ?? ""); - Object.assign(query, Object.fromEntries(traitSearchParams)); - } - } - for (const [memberName, memberNs] of ns.structIterator()) { - const memberTraits = memberNs.getMergedTraits() ?? {}; - const inputMemberValue = input[memberName]; - if (inputMemberValue == null && !memberNs.isIdempotencyToken()) { - continue; - } - if (memberTraits.httpPayload) { - const isStreaming = memberNs.isStreaming(); - if (isStreaming) { - const isEventStream = memberNs.isStructSchema(); - if (isEventStream) { - if (input[memberName]) { - payload = await this.serializeEventStream({ - eventStream: input[memberName], - requestSchema: ns, - }); - } - } - else { - payload = inputMemberValue; - } - } - else { - serializer.write(memberNs, inputMemberValue); - payload = serializer.flush(); - } - delete input[memberName]; - } - else if (memberTraits.httpLabel) { - serializer.write(memberNs, inputMemberValue); - const replacement = serializer.flush(); - if (request.path.includes(`{${memberName}+}`)) { - request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/")); - } - else if (request.path.includes(`{${memberName}}`)) { - request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement)); - } - delete input[memberName]; - } - else if (memberTraits.httpHeader) { - serializer.write(memberNs, inputMemberValue); - headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush()); - delete input[memberName]; - } - else if (typeof memberTraits.httpPrefixHeaders === "string") { - for (const [key, val] of Object.entries(inputMemberValue)) { - const amalgam = memberTraits.httpPrefixHeaders + key; - serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val); - headers[amalgam.toLowerCase()] = serializer.flush(); - } - delete input[memberName]; - } - else if (memberTraits.httpQuery || memberTraits.httpQueryParams) { - this.serializeQuery(memberNs, inputMemberValue, query); - delete input[memberName]; - } - else { - hasNonHttpBindingMember = true; - } - } - if (hasNonHttpBindingMember && input) { - serializer.write(schema$1, input); - payload = serializer.flush(); - } - request.headers = headers; - request.query = query; - request.body = payload; - return request; - } - serializeQuery(ns, data, query) { - const serializer = this.serializer; - const traits = ns.getMergedTraits(); - if (traits.httpQueryParams) { - for (const [key, val] of Object.entries(data)) { - if (!(key in query)) { - const valueSchema = ns.getValueSchema(); - Object.assign(valueSchema.getMergedTraits(), { - ...traits, - httpQuery: key, - httpQueryParams: undefined, - }); - this.serializeQuery(valueSchema, val, query); - } - } - return; - } - if (ns.isListSchema()) { - const sparse = !!ns.getMergedTraits().sparse; - const buffer = []; - for (const item of data) { - serializer.write([ns.getValueSchema(), traits], item); - const serializable = serializer.flush(); - if (sparse || serializable !== undefined) { - buffer.push(serializable); - } - } - query[traits.httpQuery] = buffer; - } - else { - serializer.write([ns, traits], data); - query[traits.httpQuery] = serializer.flush(); - } +function splitEvery(value, delimiter, numDelimiters) { + if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { + throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); } - async deserializeResponse(operationSchema, context, response) { - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes)); - } - await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); - throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw."); - } - for (const header in response.headers) { - const value = response.headers[header]; - delete response.headers[header]; - response.headers[header.toLowerCase()] = value; - } - const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject); - if (nonHttpBindingMembers.length) { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - const dataFromBody = await deserializer.read(ns, bytes); - for (const member of nonHttpBindingMembers) { - dataObject[member] = dataFromBody[member]; - } - } - } - else if (nonHttpBindingMembers.discardResponseBody) { - await collectBody(response.body, context); - } - dataObject.$metadata = this.deserializeMetadata(response); - return dataObject; + const segments = value.split(delimiter); + if (numDelimiters === 1) { + return segments; } - async deserializeHttpMessage(schema$1, context, response, arg4, arg5) { - let dataObject; - if (arg4 instanceof Set) { - dataObject = arg5; + const compoundSegments = []; + let currentSegment = ""; + for (let i = 0; i < segments.length; i++) { + if (currentSegment === "") { + currentSegment = segments[i]; } else { - dataObject = arg4; + currentSegment += delimiter + segments[i]; } - let discardResponseBody = true; - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(schema$1); - const nonHttpBindingMembers = []; - for (const [memberName, memberSchema] of ns.structIterator()) { - const memberTraits = memberSchema.getMemberTraits(); - if (memberTraits.httpPayload) { - discardResponseBody = false; - const isStreaming = memberSchema.isStreaming(); - if (isStreaming) { - const isEventStream = memberSchema.isStructSchema(); - if (isEventStream) { - dataObject[memberName] = await this.deserializeEventStream({ - response, - responseSchema: ns, - }); - } - else { - dataObject[memberName] = utilStream.sdkStreamMixin(response.body); - } - } - else if (response.body) { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - dataObject[memberName] = await deserializer.read(memberSchema, bytes); - } - } - } - else if (memberTraits.httpHeader) { - const key = String(memberTraits.httpHeader).toLowerCase(); - const value = response.headers[key]; - if (null != value) { - if (memberSchema.isListSchema()) { - const headerListValueSchema = memberSchema.getValueSchema(); - headerListValueSchema.getMergedTraits().httpHeader = key; - let sections; - if (headerListValueSchema.isTimestampSchema() && - headerListValueSchema.getSchema() === 4) { - sections = serde.splitEvery(value, ",", 2); - } - else { - sections = serde.splitHeader(value); - } - const list = []; - for (const section of sections) { - list.push(await deserializer.read(headerListValueSchema, section.trim())); - } - dataObject[memberName] = list; - } - else { - dataObject[memberName] = await deserializer.read(memberSchema, value); - } - } - } - else if (memberTraits.httpPrefixHeaders !== undefined) { - dataObject[memberName] = {}; - for (const [header, value] of Object.entries(response.headers)) { - if (header.startsWith(memberTraits.httpPrefixHeaders)) { - const valueSchema = memberSchema.getValueSchema(); - valueSchema.getMergedTraits().httpHeader = header; - dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value); - } - } - } - else if (memberTraits.httpResponseCode) { - dataObject[memberName] = response.statusCode; - } - else { - nonHttpBindingMembers.push(memberName); - } + if ((i + 1) % numDelimiters === 0) { + compoundSegments.push(currentSegment); + currentSegment = ""; } - nonHttpBindingMembers.discardResponseBody = discardResponseBody; - return nonHttpBindingMembers; } + if (currentSegment !== "") { + compoundSegments.push(currentSegment); + } + return compoundSegments; } -class RpcProtocol extends HttpProtocol { - async serializeRequest(operationSchema, input, context) { - const serializer = this.serializer; - const query = {}; - const headers = {}; - const endpoint = await context.endpoint(); - const ns = schema.NormalizedSchema.of(operationSchema?.input); - const schema$1 = ns.getSchema(); - let payload; - const request = new protocolHttp.HttpRequest({ - protocol: "", - hostname: "", - port: undefined, - path: "/", - fragment: undefined, - query: query, - headers: headers, - body: undefined, - }); - if (endpoint) { - this.updateServiceEndpoint(request, endpoint); - this.setHostPrefix(request, operationSchema, input); - } - const _input = { - ...input, - }; - if (input) { - const eventStreamMember = ns.getEventStreamMember(); - if (eventStreamMember) { - if (_input[eventStreamMember]) { - const initialRequest = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - if (memberName !== eventStreamMember && _input[memberName]) { - serializer.write(memberSchema, _input[memberName]); - initialRequest[memberName] = serializer.flush(); - } - } - payload = await this.serializeEventStream({ - eventStream: _input[eventStreamMember], - requestSchema: ns, - initialRequest, - }); +const splitHeader = (value) => { + const z = value.length; + const values = []; + let withinQuotes = false; + let prevChar = undefined; + let anchor = 0; + for (let i = 0; i < z; ++i) { + const char = value[i]; + switch (char) { + case `"`: + if (prevChar !== "\\") { + withinQuotes = !withinQuotes; } - } - else { - serializer.write(schema$1, _input); - payload = serializer.flush(); - } + break; + case ",": + if (!withinQuotes) { + values.push(value.slice(anchor, i)); + anchor = i + 1; + } + break; } - request.headers = headers; - request.query = query; - request.body = payload; - request.method = "POST"; - return request; + prevChar = char; } - async deserializeResponse(operationSchema, context, response) { - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes)); - } - await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); - throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw."); - } - for (const header in response.headers) { - const value = response.headers[header]; - delete response.headers[header]; - response.headers[header.toLowerCase()] = value; - } - const eventStreamMember = ns.getEventStreamMember(); - if (eventStreamMember) { - dataObject[eventStreamMember] = await this.deserializeEventStream({ - response, - responseSchema: ns, - initialResponseContainer: dataObject, - }); - } - else { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(ns, bytes)); - } + values.push(value.slice(anchor)); + return values.map((v) => { + v = v.trim(); + const z = v.length; + if (z < 2) { + return v; } - dataObject.$metadata = this.deserializeMetadata(response); - return dataObject; - } -} - -const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { - if (input != null && input[memberName] !== undefined) { - const labelValue = labelValueProvider(); - if (labelValue.length <= 0) { - throw new Error("Empty value provided for input HTTP label: " + memberName + "."); + if (v[0] === `"` && v[z - 1] === `"`) { + v = v.slice(1, z - 1); } - resolvedPath = resolvedPath.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 resolvedPath; + return v.replace(/\\"/g, '"'); + }); }; -function requestBuilder(input, context) { - return new RequestBuilder(input, context); -} -class RequestBuilder { - input; - context; - query = {}; - method = ""; - headers = {}; - path = ""; - body = null; - hostname = ""; - resolvePathStack = []; - constructor(input, context) { - this.input = input; - this.context = context; - } - 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); +const format = /^-?\d*(\.\d+)?$/; +class NumericValue { + string; + type; + constructor(string, type) { + this.string = string; + this.type = type; + if (!format.test(string)) { + throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`); } - return new protocolHttp.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; - } - p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { - this.resolvePathStack.push((path) => { - this.path = resolvedPath(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; + toString() { + return this.string; } - m(method) { - this.method = method; - return this; + static [Symbol.hasInstance](object) { + if (!object || typeof object !== "object") { + return false; + } + const _nv = object; + return NumericValue.prototype.isPrototypeOf(object) || (_nv.type === "bigDecimal" && format.test(_nv.string)); } } +function nv(input) { + return new NumericValue(String(input), "bigDecimal"); +} + +exports.generateIdempotencyToken = uuid.v4; +exports.LazyJsonString = LazyJsonString; +exports.NumericValue = NumericValue; +exports._parseEpochTimestamp = _parseEpochTimestamp; +exports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset; +exports._parseRfc7231DateTime = _parseRfc7231DateTime; +exports.copyDocumentWithTransform = copyDocumentWithTransform; +exports.dateToUtcString = dateToUtcString; +exports.expectBoolean = expectBoolean; +exports.expectByte = expectByte; +exports.expectFloat32 = expectFloat32; +exports.expectInt = expectInt; +exports.expectInt32 = expectInt32; +exports.expectLong = expectLong; +exports.expectNonNull = expectNonNull; +exports.expectNumber = expectNumber; +exports.expectObject = expectObject; +exports.expectShort = expectShort; +exports.expectString = expectString; +exports.expectUnion = expectUnion; +exports.handleFloat = handleFloat; +exports.limitedParseDouble = limitedParseDouble; +exports.limitedParseFloat = limitedParseFloat; +exports.limitedParseFloat32 = limitedParseFloat32; +exports.logger = logger; +exports.nv = nv; +exports.parseBoolean = parseBoolean; +exports.parseEpochTimestamp = parseEpochTimestamp; +exports.parseRfc3339DateTime = parseRfc3339DateTime; +exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset; +exports.parseRfc7231DateTime = parseRfc7231DateTime; +exports.quoteHeader = quoteHeader; +exports.splitEvery = splitEvery; +exports.splitHeader = splitHeader; +exports.strictParseByte = strictParseByte; +exports.strictParseDouble = strictParseDouble; +exports.strictParseFloat = strictParseFloat; +exports.strictParseFloat32 = strictParseFloat32; +exports.strictParseInt = strictParseInt; +exports.strictParseInt32 = strictParseInt32; +exports.strictParseLong = strictParseLong; +exports.strictParseShort = strictParseShort; + + +/***/ }), + +/***/ 7809: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var protocolHttp = __nccwpck_require__(2356); +var querystringBuilder = __nccwpck_require__(8256); +var utilBase64 = __nccwpck_require__(8385); + +function createRequest(url, requestOptions) { + return new Request(url, requestOptions); +} -function determineTimestampFormat(ns, settings) { - if (settings.timestampFormat.useTrait) { - if (ns.isTimestampSchema() && - (ns.getSchema() === 5 || - ns.getSchema() === 6 || - ns.getSchema() === 7)) { - return ns.getSchema(); +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); } - } - const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits(); - const bindingFormat = settings.httpBindings - ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) - ? 6 - : Boolean(httpQuery) || Boolean(httpLabel) - ? 5 - : undefined - : undefined; - return bindingFormat ?? settings.timestampFormat.default; + }); } -class FromStringShapeDeserializer extends SerdeContext { - settings; - constructor(settings) { - super(); - this.settings = settings; +const keepAliveSupport = { + supported: undefined, +}; +class FetchHttpHandler { + config; + configProvider; + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new FetchHttpHandler(instanceOrOptions); } - read(_schema, data) { - const ns = schema.NormalizedSchema.of(_schema); - if (ns.isListSchema()) { - return serde.splitHeader(data).map((item) => this.read(ns.getValueSchema(), item)); + constructor(options) { + if (typeof options === "function") { + this.configProvider = options().then((opts) => opts || {}); } - if (ns.isBlobSchema()) { - return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(data); + else { + this.config = options ?? {}; + this.configProvider = Promise.resolve(this.config); } - if (ns.isTimestampSchema()) { - const format = determineTimestampFormat(ns, this.settings); - switch (format) { - case 5: - return serde._parseRfc3339DateTimeWithOffset(data); - case 6: - return serde._parseRfc7231DateTime(data); - case 7: - return serde._parseEpochTimestamp(data); - default: - console.warn("Missing timestamp format, parsing value with Date constructor:", data); - return new Date(data); - } + if (keepAliveSupport.supported === undefined) { + keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]")); } - if (ns.isStringSchema()) { - const mediaType = ns.getMergedTraits().mediaType; - let intermediateValue = data; - if (mediaType) { - if (ns.getMergedTraits().httpHeader) { - intermediateValue = this.base64ToUtf8(intermediateValue); - } - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - intermediateValue = serde.LazyJsonString.from(intermediateValue); - } - return intermediateValue; - } + } + destroy() { + } + async handle(request, { abortSignal, requestTimeout: requestTimeout$1 } = {}) { + if (!this.config) { + this.config = await this.configProvider; } - if (ns.isNumericSchema()) { - return Number(data); + const requestTimeoutInMs = requestTimeout$1 ?? this.config.requestTimeout; + const keepAlive = this.config.keepAlive === true; + const credentials = this.config.credentials; + if (abortSignal?.aborted) { + const abortError = buildAbortError(abortSignal); + return Promise.reject(abortError); } - if (ns.isBigIntegerSchema()) { - return BigInt(data); + let path = request.path; + const queryString = querystringBuilder.buildQueryString(request.query || {}); + if (queryString) { + path += `?${queryString}`; } - if (ns.isBigDecimalSchema()) { - return new serde.NumericValue(data, "bigDecimal"); + if (request.fragment) { + path += `#${request.fragment}`; } - if (ns.isBooleanSchema()) { - return String(data).toLowerCase() === "true"; + let auth = ""; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}@`; } - return data; - } - base64ToUtf8(base64String) { - return (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)((this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(base64String)); - } -} - -class HttpInterceptingShapeDeserializer extends SerdeContext { - codecDeserializer; - stringDeserializer; - constructor(codecDeserializer, codecSettings) { - super(); - this.codecDeserializer = codecDeserializer; - this.stringDeserializer = new FromStringShapeDeserializer(codecSettings); - } - setSerdeContext(serdeContext) { - this.stringDeserializer.setSerdeContext(serdeContext); - this.codecDeserializer.setSerdeContext(serdeContext); - this.serdeContext = serdeContext; - } - read(schema$1, data) { - const ns = schema.NormalizedSchema.of(schema$1); - const traits = ns.getMergedTraits(); - const toString = this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8; - if (traits.httpHeader || traits.httpResponseCode) { - return this.stringDeserializer.read(ns, toString(data)); + const { port, method } = request; + const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`; + const body = method === "GET" || method === "HEAD" ? undefined : request.body; + const requestOptions = { + body, + headers: new Headers(request.headers), + method: method, + credentials, + }; + if (this.config?.cache) { + requestOptions.cache = this.config.cache; } - if (traits.httpPayload) { - if (ns.isBlobSchema()) { - const toBytes = this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8; - if (typeof data === "string") { - return toBytes(data); + 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(request)); + } + let removeSignalEventListener = () => { }; + const fetchRequest = createRequest(url, requestOptions); + const raceOfPromises = [ + fetch(fetchRequest).then((response) => { + const fetchHeaders = response.headers; + const transformedHeaders = {}; + for (const pair of fetchHeaders.entries()) { + transformedHeaders[pair[0]] = pair[1]; } - return data; - } - else if (ns.isStringSchema()) { - if ("byteLength" in data) { - return toString(data); + const hasReadableStream = response.body != undefined; + if (!hasReadableStream) { + return response.blob().then((body) => ({ + response: new protocolHttp.HttpResponse({ + headers: transformedHeaders, + reason: response.statusText, + statusCode: response.status, + body, + }), + })); } - return data; - } + return { + response: new protocolHttp.HttpResponse({ + headers: transformedHeaders, + reason: response.statusText, + statusCode: response.status, + body: response.body, + }), + }; + }), + requestTimeout(requestTimeoutInMs), + ]; + if (abortSignal) { + raceOfPromises.push(new Promise((resolve, reject) => { + const onAbort = () => { + const abortError = buildAbortError(abortSignal); + reject(abortError); + }; + if (typeof abortSignal.addEventListener === "function") { + const signal = abortSignal; + signal.addEventListener("abort", onAbort, { once: true }); + removeSignalEventListener = () => signal.removeEventListener("abort", onAbort); + } + else { + abortSignal.onabort = onAbort; + } + })); } - return this.codecDeserializer.read(ns, data); + return Promise.race(raceOfPromises).finally(removeSignalEventListener); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + config[key] = value; + return config; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } +} +function buildAbortError(abortSignal) { + const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal + ? abortSignal.reason + : undefined; + if (reason) { + if (reason instanceof Error) { + return reason; + } + const abortError = new Error(String(reason)); + abortError.name = "AbortError"; + return abortError; } + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return abortError; } -class ToStringShapeSerializer extends SerdeContext { - settings; - stringBuffer = ""; - constructor(settings) { - super(); - this.settings = settings; +const streamCollector = async (stream) => { + if ((typeof Blob === "function" && stream instanceof Blob) || stream.constructor?.name === "Blob") { + if (Blob.prototype.arrayBuffer !== undefined) { + return new Uint8Array(await stream.arrayBuffer()); + } + return collectBlob(stream); } - write(schema$1, value) { - const ns = schema.NormalizedSchema.of(schema$1); - switch (typeof value) { - case "object": - if (value === null) { - this.stringBuffer = "null"; - return; - } - if (ns.isTimestampSchema()) { - if (!(value instanceof Date)) { - throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`); - } - const format = determineTimestampFormat(ns, this.settings); - switch (format) { - case 5: - this.stringBuffer = value.toISOString().replace(".000Z", "Z"); - break; - case 6: - this.stringBuffer = serde.dateToUtcString(value); - break; - case 7: - this.stringBuffer = String(value.getTime() / 1000); - break; - default: - console.warn("Missing timestamp format, using epoch seconds", value); - this.stringBuffer = String(value.getTime() / 1000); - } - return; - } - if (ns.isBlobSchema() && "byteLength" in value) { - this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - return; - } - if (ns.isListSchema() && Array.isArray(value)) { - let buffer = ""; - for (const item of value) { - this.write([ns.getValueSchema(), ns.getMergedTraits()], item); - const headerItem = this.flush(); - const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : serde.quoteHeader(headerItem); - if (buffer !== "") { - buffer += ", "; - } - buffer += serialized; - } - this.stringBuffer = buffer; - return; - } - this.stringBuffer = JSON.stringify(value, null, 2); - break; - case "string": - const mediaType = ns.getMergedTraits().mediaType; - let intermediateValue = value; - if (mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - intermediateValue = serde.LazyJsonString.from(intermediateValue); - } - if (ns.getMergedTraits().httpHeader) { - this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(intermediateValue.toString()); - return; - } - } - this.stringBuffer = value; - break; - default: - if (ns.isIdempotencyToken()) { - this.stringBuffer = serde.generateIdempotencyToken(); - } - else { - this.stringBuffer = String(value); - } + return collectStream(stream); +}; +async function collectBlob(blob) { + const base64 = await readToBase64(blob); + const arrayBuffer = utilBase64.fromBase64(base64); + return new Uint8Array(arrayBuffer); +} +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; } - flush() { - const buffer = this.stringBuffer; - this.stringBuffer = ""; - return buffer; + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; } + return collected; +} +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); + }); } -class HttpInterceptingShapeSerializer { - codecSerializer; - stringSerializer; - buffer; - constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) { - this.codecSerializer = codecSerializer; - this.stringSerializer = stringSerializer; +exports.FetchHttpHandler = FetchHttpHandler; +exports.keepAliveSupport = keepAliveSupport; +exports.streamCollector = streamCollector; + + +/***/ }), + +/***/ 2711: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var utilBufferFrom = __nccwpck_require__(4151); +var utilUtf8 = __nccwpck_require__(1577); +var buffer = __nccwpck_require__(181); +var crypto = __nccwpck_require__(6982); + +class Hash { + algorithmIdentifier; + secret; + hash; + constructor(algorithmIdentifier, secret) { + this.algorithmIdentifier = algorithmIdentifier; + this.secret = secret; + this.reset(); } - setSerdeContext(serdeContext) { - this.codecSerializer.setSerdeContext(serdeContext); - this.stringSerializer.setSerdeContext(serdeContext); + update(toHash, encoding) { + this.hash.update(utilUtf8.toUint8Array(castSourceData(toHash, encoding))); } - write(schema$1, value) { - const ns = schema.NormalizedSchema.of(schema$1); - const traits = ns.getMergedTraits(); - if (traits.httpHeader || traits.httpLabel || traits.httpQuery) { - this.stringSerializer.write(ns, value); - this.buffer = this.stringSerializer.flush(); - return; - } - return this.codecSerializer.write(ns, value); + digest() { + return Promise.resolve(this.hash.digest()); } - flush() { - if (this.buffer !== undefined) { - const buffer = this.buffer; - this.buffer = undefined; - return buffer; + reset() { + this.hash = this.secret + ? crypto.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) + : crypto.createHash(this.algorithmIdentifier); + } +} +function castSourceData(toCast, encoding) { + if (buffer.Buffer.isBuffer(toCast)) { + return toCast; + } + if (typeof toCast === "string") { + return utilBufferFrom.fromString(toCast, encoding); + } + if (ArrayBuffer.isView(toCast)) { + return utilBufferFrom.fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); + } + return utilBufferFrom.fromArrayBuffer(toCast); +} + +exports.Hash = Hash; + + +/***/ }), + +/***/ 6130: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) || + Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; + +exports.isArrayBuffer = isArrayBuffer; + + +/***/ }), + +/***/ 7212: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var protocolHttp = __nccwpck_require__(2356); + +const CONTENT_LENGTH_HEADER = "content-length"; +function contentLengthMiddleware(bodyLengthChecker) { + return (next) => async (args) => { + const request = args.request; + if (protocolHttp.HttpRequest.isInstance(request)) { + const { body, headers } = request; + if (body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf(CONTENT_LENGTH_HEADER) === -1) { + try { + const length = bodyLengthChecker(body); + request.headers = { + ...request.headers, + [CONTENT_LENGTH_HEADER]: String(length), + }; + } + catch (error) { + } + } } - return this.codecSerializer.flush(); - } + return next({ + ...args, + request, + }); + }; } +const contentLengthMiddlewareOptions = { + step: "build", + tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], + name: "contentLengthMiddleware", + override: true, +}; +const getContentLengthPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); + }, +}); -exports.FromStringShapeDeserializer = FromStringShapeDeserializer; -exports.HttpBindingProtocol = HttpBindingProtocol; -exports.HttpInterceptingShapeDeserializer = HttpInterceptingShapeDeserializer; -exports.HttpInterceptingShapeSerializer = HttpInterceptingShapeSerializer; -exports.HttpProtocol = HttpProtocol; -exports.RequestBuilder = RequestBuilder; -exports.RpcProtocol = RpcProtocol; -exports.SerdeContext = SerdeContext; -exports.ToStringShapeSerializer = ToStringShapeSerializer; -exports.collectBody = collectBody; -exports.determineTimestampFormat = determineTimestampFormat; -exports.extendedEncodeURIComponent = extendedEncodeURIComponent; -exports.requestBuilder = requestBuilder; -exports.resolvedPath = resolvedPath; +exports.contentLengthMiddleware = contentLengthMiddleware; +exports.contentLengthMiddlewareOptions = contentLengthMiddlewareOptions; +exports.getContentLengthPlugin = getContentLengthPlugin; /***/ }), -/***/ 6890: +/***/ 6041: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEndpointFromConfig = void 0; +const node_config_provider_1 = __nccwpck_require__(5704); +const getEndpointUrlConfig_1 = __nccwpck_require__(8008); +const getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId ?? ""))(); +exports.getEndpointFromConfig = getEndpointFromConfig; + -var protocolHttp = __nccwpck_require__(2356); +/***/ }), + +/***/ 8008: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEndpointUrlConfig = void 0; +const shared_ini_file_loader_1 = __nccwpck_require__(4964); +const ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; +const CONFIG_ENDPOINT_URL = "endpoint_url"; +const 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 undefined; + }, + 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 endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; + if (endpointUrl) + return endpointUrl; + } + } + const endpointUrl = profile[CONFIG_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return undefined; + }, + default: undefined, +}); +exports.getEndpointUrlConfig = getEndpointUrlConfig; + + +/***/ }), + +/***/ 99: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var getEndpointFromConfig = __nccwpck_require__(6041); +var urlParser = __nccwpck_require__(4494); +var core = __nccwpck_require__(402); var utilMiddleware = __nccwpck_require__(6324); +var middlewareSerde = __nccwpck_require__(3255); -const deref = (schemaRef) => { - if (typeof schemaRef === "function") { - return schemaRef(); +const resolveParamsForS3 = async (endpointParams) => { + const bucket = endpointParams?.Bucket || ""; + if (typeof endpointParams.Bucket === "string") { + endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); } - return schemaRef; + 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; +}; +const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; +const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; +const DOTS_PATTERN = /\.\./; +const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); +const isArnBucketName = (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; }; -const operation = (namespace, name, traits, input, output) => ({ - name, - namespace, - traits, - input, - output, -}); - -const schemaDeserializationMiddleware = (config) => (next, context) => async (args) => { - const { response } = await next(args); - const { operationSchema } = utilMiddleware.getSmithyContext(context); - const [, ns, n, t, i, o] = operationSchema ?? []; - try { - const parsed = await config.protocol.deserializeResponse(operation(ns, n, t, i, o), { - ...config, - ...context, - }, response); - return { - response, - output: parsed, +const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config, isClientContextParam = false) => { + const configProvider = async () => { + let configValue; + if (isClientContextParam) { + const clientContextParams = config.clientContextParams; + const nestedValue = clientContextParams?.[configKey]; + configValue = nestedValue ?? config[configKey] ?? config[canonicalEndpointParamKey]; + } + else { + configValue = config[configKey] ?? config[canonicalEndpointParamKey]; + } + if (typeof configValue === "function") { + return configValue(); + } + return configValue; + }; + if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { + return async () => { + const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; + const configValue = credentials?.credentialScope ?? credentials?.CredentialScope; + return configValue; }; } - catch (error) { - Object.defineProperty(error, "$response", { - value: response, - enumerable: false, - writable: false, - configurable: false, - }); - if (!("$metadata" in error)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - try { - error.message += "\n " + hint; - } - catch (e) { - if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { - console.warn(hint); - } - else { - context.logger?.warn?.(hint); - } + if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { + return async () => { + const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; + const configValue = credentials?.accountId ?? credentials?.AccountId; + return configValue; + }; + } + if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { + return async () => { + if (config.isCustomEndpoint === false) { + return undefined; } - if (typeof error.$responseBodyText !== "undefined") { - if (error.$response) { - error.$response.body = error.$responseBodyText; + const endpoint = await configProvider(); + if (endpoint && typeof endpoint === "object") { + if ("url" in endpoint) { + return endpoint.url.href; } - } - try { - if (protocolHttp.HttpResponse.isInstance(response)) { - const { headers = {} } = response; - const headerEntries = Object.entries(headers); - error.$metadata = { - httpStatusCode: response.statusCode, - requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), - extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), - cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries), - }; + if ("hostname" in endpoint) { + const { protocol, hostname, port, path } = endpoint; + return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; } } - catch (e) { - } - } - throw error; + return endpoint; + }; } + return configProvider; }; -const findHeader = (pattern, headers) => { - return (headers.find(([k]) => { - return k.match(pattern); - }) || [void 0, void 0])[1]; + +const toEndpointV1 = (endpoint) => { + if (typeof endpoint === "object") { + if ("url" in endpoint) { + return urlParser.parseUrl(endpoint.url); + } + return endpoint; + } + return urlParser.parseUrl(endpoint); }; -const schemaSerializationMiddleware = (config) => (next, context) => async (args) => { - const { operationSchema } = utilMiddleware.getSmithyContext(context); - const [, ns, n, t, i, o] = operationSchema ?? []; - const endpoint = context.endpointV2?.url && config.urlParser - ? async () => config.urlParser(context.endpointV2.url) - : config.endpoint; - const request = await config.protocol.serializeRequest(operation(ns, n, t, i, o), args.input, { - ...config, - ...context, - endpoint, - }); - return next({ - ...args, - request, - }); +const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { + if (!clientConfig.isCustomEndpoint) { + let endpointFromConfig; + if (clientConfig.serviceConfiguredEndpoint) { + endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); + } + else { + endpointFromConfig = await getEndpointFromConfig.getEndpointFromConfig(clientConfig.serviceId); + } + if (endpointFromConfig) { + clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); + clientConfig.isCustomEndpoint = true; + } + } + 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; +}; +const resolveParams = async (commandInput, instructionsSupplier, clientConfig) => { + const endpointParams = {}; + const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {}; + 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, instruction.type !== "builtInParams")(); + break; + case "operationContextParams": + endpointParams[name] = instruction.get(commandInput); + 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; }; -const deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true, +const endpointMiddleware = ({ config, instructions, }) => { + return (next, context) => async (args) => { + if (config.isCustomEndpoint) { + core.setFeature(context, "ENDPOINT_OVERRIDE", "N"); + } + const endpoint = await getEndpointFromInstructions(args.input, { + getEndpointParameterInstructions() { + return instructions; + }, + }, { ...config }, context); + context.endpointV2 = endpoint; + context.authSchemes = endpoint.properties?.authSchemes; + const authScheme = context.authSchemes?.[0]; + if (authScheme) { + context["signing_region"] = authScheme.signingRegion; + context["signing_service"] = authScheme.signingName; + const smithyContext = utilMiddleware.getSmithyContext(context); + const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.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); + } + } + return next({ + ...args, + }); + }; }; -const serializerMiddlewareOption = { - name: "serializerMiddleware", + +const endpointMiddlewareOptions = { step: "serialize", - tags: ["SERIALIZER"], + tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], + name: "endpointV2Middleware", override: true, + relation: "before", + toMiddleware: middlewareSerde.serializerMiddlewareOption.name, }; -function getSchemaSerdePlugin(config) { - return { - applyToStack: (commandStack) => { - commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption); - commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption); - config.protocol.setSerdeContext(config); - }, - }; -} +const getEndpointPlugin = (config, instructions) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(endpointMiddleware({ + config, + instructions, + }), endpointMiddlewareOptions); + }, +}); -class Schema { - name; - namespace; - traits; - static assign(instance, values) { - const schema = Object.assign(instance, values); - return schema; - } - static [Symbol.hasInstance](lhs) { - const isPrototype = this.prototype.isPrototypeOf(lhs); - if (!isPrototype && typeof lhs === "object" && lhs !== null) { - const list = lhs; - return list.symbol === this.symbol; +const resolveEndpointConfig = (input) => { + const tls = input.tls ?? true; + const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input; + const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await utilMiddleware.normalizeProvider(endpoint)()) : undefined; + const isCustomEndpoint = !!endpoint; + const resolvedConfig = Object.assign(input, { + endpoint: customEndpointProvider, + tls, + isCustomEndpoint, + useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false), + useFipsEndpoint: utilMiddleware.normalizeProvider(useFipsEndpoint ?? false), + }); + let configuredEndpointPromise = undefined; + resolvedConfig.serviceConfiguredEndpoint = async () => { + if (input.serviceId && !configuredEndpointPromise) { + configuredEndpointPromise = getEndpointFromConfig.getEndpointFromConfig(input.serviceId); } - return isPrototype; - } - getName() { - return this.namespace + "#" + this.name; + return configuredEndpointPromise; + }; + return resolvedConfig; +}; + +const resolveEndpointRequiredConfig = (input) => { + const { endpoint } = input; + if (endpoint === undefined) { + input.endpoint = async () => { + throw new Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint."); + }; } -} + return input; +}; -class ListSchema extends Schema { - static symbol = Symbol.for("@smithy/lis"); - name; - traits; - valueSchema; - symbol = ListSchema.symbol; -} -const list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), { - name, - namespace, - traits, - valueSchema, -}); +exports.endpointMiddleware = endpointMiddleware; +exports.endpointMiddlewareOptions = endpointMiddlewareOptions; +exports.getEndpointFromInstructions = getEndpointFromInstructions; +exports.getEndpointPlugin = getEndpointPlugin; +exports.resolveEndpointConfig = resolveEndpointConfig; +exports.resolveEndpointRequiredConfig = resolveEndpointRequiredConfig; +exports.resolveParams = resolveParams; +exports.toEndpointV1 = toEndpointV1; -class MapSchema extends Schema { - static symbol = Symbol.for("@smithy/map"); - name; - traits; - keySchema; - valueSchema; - symbol = MapSchema.symbol; -} -const map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), { - name, - namespace, - traits, - keySchema, - valueSchema, -}); -class OperationSchema extends Schema { - static symbol = Symbol.for("@smithy/ope"); - name; - traits; - input; - output; - symbol = OperationSchema.symbol; -} -const op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), { - name, - namespace, - traits, - input, - output, -}); +/***/ }), + +/***/ 9618: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var utilRetry = __nccwpck_require__(5518); +var protocolHttp = __nccwpck_require__(2356); +var serviceErrorClassification = __nccwpck_require__(2058); +var uuid = __nccwpck_require__(266); +var utilMiddleware = __nccwpck_require__(6324); +var smithyClient = __nccwpck_require__(1411); +var isStreamingPayload = __nccwpck_require__(9831); + +const getDefaultRetryQuota = (initialRetryTokens, options) => { + const MAX_CAPACITY = initialRetryTokens; + const noRetryIncrement = utilRetry.NO_RETRY_INCREMENT; + const retryCost = utilRetry.RETRY_COST; + const timeoutRetryCost = utilRetry.TIMEOUT_RETRY_COST; + let availableCapacity = initialRetryTokens; + const getCapacityAmount = (error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost); + const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity; + const retrieveRetryTokens = (error) => { + if (!hasRetryTokens(error)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(error); + availableCapacity -= capacityAmount; + return capacityAmount; + }; + const releaseRetryTokens = (capacityReleaseAmount) => { + availableCapacity += capacityReleaseAmount ?? noRetryIncrement; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }; + return Object.freeze({ + hasRetryTokens, + retrieveRetryTokens, + releaseRetryTokens, + }); +}; -class StructureSchema extends Schema { - static symbol = Symbol.for("@smithy/str"); - name; - traits; - memberNames; - memberList; - symbol = StructureSchema.symbol; -} -const struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), { - name, - namespace, - traits, - memberNames, - memberList, -}); +const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(utilRetry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); -class ErrorSchema extends StructureSchema { - static symbol = Symbol.for("@smithy/err"); - ctor; - symbol = ErrorSchema.symbol; -} -const error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), { - name, - namespace, - traits, - memberNames, - memberList, - ctor: null, -}); +const defaultRetryDecider = (error) => { + if (!error) { + return false; + } + return serviceErrorClassification.isRetryableByTrait(error) || serviceErrorClassification.isClockSkewError(error) || serviceErrorClassification.isThrottlingError(error) || serviceErrorClassification.isTransientError(error); +}; -function translateTraits(indicator) { - if (typeof indicator === "object") { - return indicator; +const asSdkError = (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}`); +}; + +class StandardRetryStrategy { + maxAttemptsProvider; + retryDecider; + delayDecider; + retryQuota; + mode = utilRetry.RETRY_MODES.STANDARD; + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.retryDecider = options?.retryDecider ?? defaultRetryDecider; + this.delayDecider = options?.delayDecider ?? defaultDelayDecider; + this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(utilRetry.INITIAL_RETRY_TOKENS); } - indicator = indicator | 0; - const traits = {}; - let i = 0; - for (const trait of [ - "httpLabel", - "idempotent", - "idempotencyToken", - "sensitive", - "httpPayload", - "httpResponseCode", - "httpQueryParams", - ]) { - if (((indicator >> i++) & 1) === 1) { - traits[trait] = 1; - } + shouldRetry(error, attempts, maxAttempts) { + return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); } - return traits; -} - -class NormalizedSchema { - ref; - memberName; - static symbol = Symbol.for("@smithy/nor"); - symbol = NormalizedSchema.symbol; - name; - schema; - _isMemberSchema; - traits; - memberTraits; - normalizedTraits; - constructor(ref, memberName) { - this.ref = ref; - this.memberName = memberName; - const traitStack = []; - let _ref = ref; - let schema = ref; - this._isMemberSchema = false; - while (isMemberSchema(_ref)) { - traitStack.push(_ref[1]); - _ref = _ref[0]; - schema = deref(_ref); - this._isMemberSchema = true; - } - if (traitStack.length > 0) { - this.memberTraits = {}; - for (let i = traitStack.length - 1; i >= 0; --i) { - const traitSet = traitStack[i]; - Object.assign(this.memberTraits, translateTraits(traitSet)); - } - } - else { - this.memberTraits = 0; - } - if (schema instanceof NormalizedSchema) { - const computedMemberTraits = this.memberTraits; - Object.assign(this, schema); - this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits()); - this.normalizedTraits = void 0; - this.memberName = memberName ?? schema.memberName; - return; - } - this.schema = deref(schema); - if (isStaticSchema(this.schema)) { - this.name = `${this.schema[1]}#${this.schema[2]}`; - this.traits = this.schema[3]; - } - else { - this.name = this.memberName ?? String(schema); - this.traits = 0; - } - if (this._isMemberSchema && !memberName) { - throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`); + async getMaxAttempts() { + let maxAttempts; + try { + maxAttempts = await this.maxAttemptsProvider(); } - } - static [Symbol.hasInstance](lhs) { - const isPrototype = this.prototype.isPrototypeOf(lhs); - if (!isPrototype && typeof lhs === "object" && lhs !== null) { - const ns = lhs; - return ns.symbol === this.symbol; + catch (error) { + maxAttempts = utilRetry.DEFAULT_MAX_ATTEMPTS; } - return isPrototype; + return maxAttempts; } - static of(ref) { - const sc = deref(ref); - if (sc instanceof NormalizedSchema) { - return sc; + async retry(next, args, options) { + let retryTokenAmount; + let attempts = 0; + let totalDelay = 0; + const maxAttempts = await this.getMaxAttempts(); + const { request } = args; + if (protocolHttp.HttpRequest.isInstance(request)) { + request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4(); } - if (isMemberSchema(sc)) { - const [ns, traits] = sc; - if (ns instanceof NormalizedSchema) { - Object.assign(ns.getMergedTraits(), translateTraits(traits)); - return ns; + while (true) { + try { + if (protocolHttp.HttpRequest.isInstance(request)) { + request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + if (options?.beforeRequest) { + await options.beforeRequest(); + } + const { response, output } = await next(args); + if (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(serviceErrorClassification.isThrottlingError(err) ? utilRetry.THROTTLING_RETRY_DELAY_BASE : utilRetry.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; } - throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`); - } - return new NormalizedSchema(sc); - } - getSchema() { - const sc = this.schema; - if (sc[0] === 0) { - return sc[4]; } - return sc; - } - getName(withNamespace = false) { - const { name } = this; - const short = !withNamespace && name && name.includes("#"); - return short ? name.split("#")[1] : name || undefined; - } - getMemberName() { - return this.memberName; - } - isMemberSchema() { - return this._isMemberSchema; - } - isListSchema() { - const sc = this.getSchema(); - return typeof sc === "number" - ? sc >= 64 && sc < 128 - : sc[0] === 1; - } - isMapSchema() { - const sc = this.getSchema(); - return typeof sc === "number" - ? sc >= 128 && sc <= 0b1111_1111 - : sc[0] === 2; - } - isStructSchema() { - const sc = this.getSchema(); - return (sc[0] === 3 || - sc[0] === -3); - } - isBlobSchema() { - const sc = this.getSchema(); - return sc === 21 || sc === 42; - } - isTimestampSchema() { - const sc = this.getSchema(); - return (typeof sc === "number" && - sc >= 4 && - sc <= 7); - } - isUnitSchema() { - return this.getSchema() === "unit"; - } - isDocumentSchema() { - return this.getSchema() === 15; - } - isStringSchema() { - return this.getSchema() === 0; - } - isBooleanSchema() { - return this.getSchema() === 2; - } - isNumericSchema() { - return this.getSchema() === 1; - } - isBigIntegerSchema() { - return this.getSchema() === 17; - } - isBigDecimalSchema() { - return this.getSchema() === 19; - } - isStreaming() { - const { streaming } = this.getMergedTraits(); - return !!streaming || this.getSchema() === 42; - } - isIdempotencyToken() { - const match = (traits) => (traits & 0b0100) === 0b0100 || - !!traits?.idempotencyToken; - const { normalizedTraits, traits, memberTraits } = this; - return match(normalizedTraits) || match(traits) || match(memberTraits); - } - getMergedTraits() { - return (this.normalizedTraits ?? - (this.normalizedTraits = { - ...this.getOwnTraits(), - ...this.getMemberTraits(), - })); } - getMemberTraits() { - return translateTraits(this.memberTraits); +} +const getDelayFromRetryAfterHeader = (response) => { + if (!protocolHttp.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 * 1000; + const retryAfterDate = new Date(retryAfter); + return retryAfterDate.getTime() - Date.now(); +}; + +class AdaptiveRetryStrategy extends StandardRetryStrategy { + rateLimiter; + constructor(maxAttemptsProvider, options) { + const { rateLimiter, ...superOptions } = options ?? {}; + super(maxAttemptsProvider, superOptions); + this.rateLimiter = rateLimiter ?? new utilRetry.DefaultRateLimiter(); + this.mode = utilRetry.RETRY_MODES.ADAPTIVE; } - getOwnTraits() { - return translateTraits(this.traits); + async retry(next, args) { + return super.retry(next, args, { + beforeRequest: async () => { + return this.rateLimiter.getSendToken(); + }, + afterRequest: (response) => { + this.rateLimiter.updateClientSendingRate(response); + }, + }); } - getKeySchema() { - const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()]; - if (!isDoc && !isMap) { - throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`); +} + +const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; +const CONFIG_MAX_ATTEMPTS = "max_attempts"; +const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + const value = env[ENV_MAX_ATTEMPTS]; + if (!value) + return undefined; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); } - const schema = this.getSchema(); - const memberSchema = isDoc - ? 15 - : schema[4] ?? 0; - return member([memberSchema, 0], "key"); - } - getValueSchema() { - const sc = this.getSchema(); - const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()]; - const memberSchema = typeof sc === "number" - ? 0b0011_1111 & sc - : sc && typeof sc === "object" && (isMap || isList) - ? sc[3 + sc[0]] - : isDoc - ? 15 - : void 0; - if (memberSchema != null) { - return member([memberSchema, 0], isMap ? "value" : "member"); + return maxAttempt; + }, + configFileSelector: (profile) => { + const value = profile[CONFIG_MAX_ATTEMPTS]; + if (!value) + return undefined; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); } - throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`); + return maxAttempt; + }, + default: utilRetry.DEFAULT_MAX_ATTEMPTS, +}; +const resolveRetryConfig = (input) => { + const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input; + const maxAttempts = utilMiddleware.normalizeProvider(_maxAttempts ?? utilRetry.DEFAULT_MAX_ATTEMPTS); + return Object.assign(input, { + maxAttempts, + retryStrategy: async () => { + if (retryStrategy) { + return retryStrategy; + } + const retryMode = await utilMiddleware.normalizeProvider(_retryMode)(); + if (retryMode === utilRetry.RETRY_MODES.ADAPTIVE) { + return new utilRetry.AdaptiveRetryStrategy(maxAttempts); + } + return new utilRetry.StandardRetryStrategy(maxAttempts); + }, + }); +}; +const ENV_RETRY_MODE = "AWS_RETRY_MODE"; +const CONFIG_RETRY_MODE = "retry_mode"; +const NODE_RETRY_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_RETRY_MODE], + configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], + default: utilRetry.DEFAULT_RETRY_MODE, +}; + +const omitRetryHeadersMiddleware = () => (next) => async (args) => { + const { request } = args; + if (protocolHttp.HttpRequest.isInstance(request)) { + delete request.headers[utilRetry.INVOCATION_ID_HEADER]; + delete request.headers[utilRetry.REQUEST_HEADER]; } - getMemberSchema(memberName) { - const struct = this.getSchema(); - if (this.isStructSchema() && struct[4].includes(memberName)) { - const i = struct[4].indexOf(memberName); - const memberSchema = struct[5][i]; - return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName); + return next(args); +}; +const omitRetryHeadersMiddlewareOptions = { + name: "omitRetryHeadersMiddleware", + tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], + relation: "before", + toMiddleware: "awsAuthMiddleware", + override: true, +}; +const getOmitRetryHeadersPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); + }, +}); + +const retryMiddleware = (options) => (next, context) => async (args) => { + 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 } = args; + const isRequest = protocolHttp.HttpRequest.isInstance(request); + if (isRequest) { + request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4(); } - if (this.isDocumentSchema()) { - return member([15, 0], memberName); + while (true) { + try { + if (isRequest) { + request.headers[utilRetry.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 && isStreamingPayload.isStreamingPayload(request)) { + (context.logger instanceof smithyClient.NoOpLogger ? console : context.logger)?.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)); + } } - throw new Error(`@smithy/core/schema - ${this.getName(true)} has no no member=${memberName}.`); } - getMemberSchemas() { - const buffer = {}; - try { - for (const [k, v] of this.structIterator()) { - buffer[k] = v; + else { + retryStrategy = retryStrategy; + if (retryStrategy?.mode) + context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]]; + return retryStrategy.retry(next, args); + } +}; +const isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && + typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && + typeof retryStrategy.recordSuccess !== "undefined"; +const getRetryErrorInfo = (error) => { + const errorInfo = { + error, + errorType: getRetryErrorType(error), + }; + const retryAfterHint = getRetryAfterHint(error.$response); + if (retryAfterHint) { + errorInfo.retryAfterHint = retryAfterHint; + } + return errorInfo; +}; +const getRetryErrorType = (error) => { + if (serviceErrorClassification.isThrottlingError(error)) + return "THROTTLING"; + if (serviceErrorClassification.isTransientError(error)) + return "TRANSIENT"; + if (serviceErrorClassification.isServerError(error)) + return "SERVER_ERROR"; + return "CLIENT_ERROR"; +}; +const retryMiddlewareOptions = { + name: "retryMiddleware", + tags: ["RETRY"], + step: "finalizeRequest", + priority: "high", + override: true, +}; +const getRetryPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(retryMiddleware(options), retryMiddlewareOptions); + }, +}); +const getRetryAfterHint = (response) => { + if (!protocolHttp.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 * 1000); + const retryAfterDate = new Date(retryAfter); + return retryAfterDate; +}; + +exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; +exports.CONFIG_MAX_ATTEMPTS = CONFIG_MAX_ATTEMPTS; +exports.CONFIG_RETRY_MODE = CONFIG_RETRY_MODE; +exports.ENV_MAX_ATTEMPTS = ENV_MAX_ATTEMPTS; +exports.ENV_RETRY_MODE = ENV_RETRY_MODE; +exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = NODE_MAX_ATTEMPT_CONFIG_OPTIONS; +exports.NODE_RETRY_MODE_CONFIG_OPTIONS = NODE_RETRY_MODE_CONFIG_OPTIONS; +exports.StandardRetryStrategy = StandardRetryStrategy; +exports.defaultDelayDecider = defaultDelayDecider; +exports.defaultRetryDecider = defaultRetryDecider; +exports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; +exports.getRetryAfterHint = getRetryAfterHint; +exports.getRetryPlugin = getRetryPlugin; +exports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; +exports.omitRetryHeadersMiddlewareOptions = omitRetryHeadersMiddlewareOptions; +exports.resolveRetryConfig = resolveRetryConfig; +exports.retryMiddleware = retryMiddleware; +exports.retryMiddlewareOptions = retryMiddlewareOptions; + + +/***/ }), + +/***/ 9831: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isStreamingPayload = void 0; +const stream_1 = __nccwpck_require__(2203); +const isStreamingPayload = (request) => request?.body instanceof stream_1.Readable || + (typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream); +exports.isStreamingPayload = isStreamingPayload; + + +/***/ }), + +/***/ 3255: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var protocolHttp = __nccwpck_require__(2356); + +const deserializerMiddleware = (options, deserializer) => (next, context) => 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, + enumerable: false, + writable: false, + configurable: false, + }); + if (!("$metadata" in error)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + try { + error.message += "\n " + hint; } - } - catch (ignored) { } - return buffer; - } - getEventStreamMember() { - if (this.isStructSchema()) { - for (const [memberName, memberSchema] of this.structIterator()) { - if (memberSchema.isStreaming() && memberSchema.isStructSchema()) { - return memberName; + catch (e) { + if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { + console.warn(hint); + } + else { + context.logger?.warn?.(hint); } } + if (typeof error.$responseBodyText !== "undefined") { + if (error.$response) { + error.$response.body = error.$responseBodyText; + } + } + try { + if (protocolHttp.HttpResponse.isInstance(response)) { + const { headers = {} } = response; + const headerEntries = Object.entries(headers); + error.$metadata = { + httpStatusCode: response.statusCode, + requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), + extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), + cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries), + }; + } + } + catch (e) { + } } - return ""; - } - *structIterator() { - if (this.isUnitSchema()) { - return; - } - if (!this.isStructSchema()) { - throw new Error("@smithy/core/schema - cannot iterate non-struct schema."); - } - const struct = this.getSchema(); - for (let i = 0; i < struct[4].length; ++i) { - yield [struct[4][i], member([struct[5][i], 0], struct[4][i])]; - } + throw error; } -} -function member(memberSchema, memberName) { - if (memberSchema instanceof NormalizedSchema) { - return Object.assign(memberSchema, { - memberName, - _isMemberSchema: true, - }); +}; +const findHeader = (pattern, headers) => { + return (headers.find(([k]) => { + return k.match(pattern); + }) || [void 0, void 0])[1]; +}; + +const serializerMiddleware = (options, serializer) => (next, context) => async (args) => { + const endpointConfig = options; + const endpoint = context.endpointV2?.url && endpointConfig.urlParser + ? async () => endpointConfig.urlParser(context.endpointV2.url) + : endpointConfig.endpoint; + if (!endpoint) { + throw new Error("No valid endpoint provider available."); } - const internalCtorAccess = NormalizedSchema; - return new internalCtorAccess(memberSchema, memberName); -} -const isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2; -const isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5; + const request = await serializer(args.input, { ...options, endpoint }); + return next({ + ...args, + request, + }); +}; -class SimpleSchema extends Schema { - static symbol = Symbol.for("@smithy/sim"); - name; - schemaRef; - traits; - symbol = SimpleSchema.symbol; +const deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true, +}; +const serializerMiddlewareOption = { + 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), serializerMiddlewareOption); + }, + }; } -const sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), { - name, - namespace, - traits, - schemaRef, -}); -const simAdapter = (namespace, name, traits, schemaRef) => Schema.assign(new SimpleSchema(), { - name, - namespace, - traits, - schemaRef, -}); -const SCHEMA = { - BLOB: 0b0001_0101, - STREAMING_BLOB: 0b0010_1010, - BOOLEAN: 0b0000_0010, - STRING: 0b0000_0000, - NUMERIC: 0b0000_0001, - BIG_INTEGER: 0b0001_0001, - BIG_DECIMAL: 0b0001_0011, - DOCUMENT: 0b0000_1111, - TIMESTAMP_DEFAULT: 0b0000_0100, - TIMESTAMP_DATE_TIME: 0b0000_0101, - TIMESTAMP_HTTP_DATE: 0b0000_0110, - TIMESTAMP_EPOCH_SECONDS: 0b0000_0111, - LIST_MODIFIER: 0b0100_0000, - MAP_MODIFIER: 0b1000_0000, -}; +exports.deserializerMiddleware = deserializerMiddleware; +exports.deserializerMiddlewareOption = deserializerMiddlewareOption; +exports.getSerdePlugin = getSerdePlugin; +exports.serializerMiddleware = serializerMiddleware; +exports.serializerMiddlewareOption = serializerMiddlewareOption; -class TypeRegistry { - namespace; - schemas; - exceptions; - static registries = new Map(); - constructor(namespace, schemas = new Map(), exceptions = new Map()) { - this.namespace = namespace; - this.schemas = schemas; - this.exceptions = exceptions; - } - static for(namespace) { - if (!TypeRegistry.registries.has(namespace)) { - TypeRegistry.registries.set(namespace, new TypeRegistry(namespace)); - } - return TypeRegistry.registries.get(namespace); - } - register(shapeId, schema) { - const qualifiedName = this.normalizeShapeId(shapeId); - const registry = TypeRegistry.for(qualifiedName.split("#")[0]); - registry.schemas.set(qualifiedName, schema); + +/***/ }), + +/***/ 9208: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +const getAllAliases = (name, aliases) => { + const _aliases = []; + if (name) { + _aliases.push(name); } - getSchema(shapeId) { - const id = this.normalizeShapeId(shapeId); - if (!this.schemas.has(id)) { - throw new Error(`@smithy/core/schema - schema not found for ${id}`); + if (aliases) { + for (const alias of aliases) { + _aliases.push(alias); } - return this.schemas.get(id); - } - registerError(es, ctor) { - const $error = es; - const registry = TypeRegistry.for($error[1]); - registry.schemas.set($error[1] + "#" + $error[2], $error); - registry.exceptions.set($error, ctor); - } - getErrorCtor(es) { - const $error = es; - const registry = TypeRegistry.for($error[1]); - return registry.exceptions.get($error); } - getBaseException() { - for (const exceptionKey of this.exceptions.keys()) { - if (Array.isArray(exceptionKey)) { - const [, ns, name] = exceptionKey; - const id = ns + "#" + name; - if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) { - return exceptionKey; + return _aliases; +}; +const getMiddlewareNameWithAliases = (name, aliases) => { + return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; +}; +const constructStack = () => { + let absoluteEntries = []; + let relativeEntries = []; + let identifyOnResolve = false; + const entriesNameSet = new Set(); + const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || + priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]); + const removeByName = (toRemove) => { + let isRemoved = false; + const filterCb = (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; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const removeByReference = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + if (entry.middleware === toRemove) { + isRemoved = true; + for (const alias of getAllAliases(entry.name, entry.aliases)) { + entriesNameSet.delete(alias); + } + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const cloneTo = (toStack) => { + absoluteEntries.forEach((entry) => { + toStack.add(entry.middleware, { ...entry }); + }); + relativeEntries.forEach((entry) => { + toStack.addRelativeTo(entry.middleware, { ...entry }); + }); + toStack.identifyOnResolve?.(stack.identifyOnResolve()); + return toStack; + }; + const expandRelativeMiddlewareList = (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; + }; + const getMiddlewareList = (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 === undefined) { + 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; + }; + 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((entry) => entry.name === alias || entry.aliases?.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((entry) => entry.name === alias || entry.aliases?.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 = (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; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, + concat: (from) => { + const cloned = cloneTo(constructStack()); + cloned.use(from); + cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? 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: (handler, context) => { + for (const middleware of getMiddlewareList() + .map((entry) => entry.middleware) + .reverse()) { + handler = middleware(handler, context); } - } - return undefined; - } - find(predicate) { - return [...this.schemas.values()].find(predicate); - } - clear() { - this.schemas.clear(); - this.exceptions.clear(); - } - normalizeShapeId(shapeId) { - if (shapeId.includes("#")) { - return shapeId; - } - return this.namespace + "#" + shapeId; - } -} + if (identifyOnResolve) { + console.log(stack.identify()); + } + return handler; + }, + }; + return stack; +}; +const stepWeights = { + initialize: 5, + serialize: 4, + build: 3, + finalizeRequest: 2, + deserialize: 1, +}; +const priorityWeights = { + high: 3, + normal: 2, + low: 1, +}; -exports.ErrorSchema = ErrorSchema; -exports.ListSchema = ListSchema; -exports.MapSchema = MapSchema; -exports.NormalizedSchema = NormalizedSchema; -exports.OperationSchema = OperationSchema; -exports.SCHEMA = SCHEMA; -exports.Schema = Schema; -exports.SimpleSchema = SimpleSchema; -exports.StructureSchema = StructureSchema; -exports.TypeRegistry = TypeRegistry; -exports.deref = deref; -exports.deserializerMiddlewareOption = deserializerMiddlewareOption; -exports.error = error; -exports.getSchemaSerdePlugin = getSchemaSerdePlugin; -exports.isStaticSchema = isStaticSchema; -exports.list = list; -exports.map = map; -exports.op = op; -exports.operation = operation; -exports.serializerMiddlewareOption = serializerMiddlewareOption; -exports.sim = sim; -exports.simAdapter = simAdapter; -exports.struct = struct; -exports.translateTraits = translateTraits; +exports.constructStack = constructStack; /***/ }), -/***/ 2430: +/***/ 5704: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var uuid = __nccwpck_require__(266); - -const copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source; +var propertyProvider = __nccwpck_require__(8857); +var sharedIniFileLoader = __nccwpck_require__(4964); -const parseBoolean = (value) => { - switch (value) { - case "true": - return true; - case "false": - return false; - default: - throw new Error(`Unable to parse boolean value "${value}"`); - } -}; -const expectBoolean = (value) => { - if (value === null || value === undefined) { - return undefined; - } - 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}`); -}; -const expectNumber = (value) => { - if (value === null || value === undefined) { - return undefined; - } - 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 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(", "); } - if (typeof value === "number") { - return value; + catch (e) { + return functionString; } - throw new TypeError(`Expected number, got ${typeof value}: ${value}`); -}; -const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); -const expectFloat32 = (value) => { - const expected = expectNumber(value); - if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { - if (Math.abs(expected) > MAX_FLOAT) { - throw new TypeError(`Expected 32-bit float, got ${value}`); +} + +const fromEnv = (envVarSelector, options) => async () => { + try { + const config = envVarSelector(process.env, options); + if (config === undefined) { + throw new Error(); } + return config; } - return expected; -}; -const expectLong = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (Number.isInteger(value) && !Number.isNaN(value)) { - return value; - } - throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); -}; -const expectInt = expectLong; -const expectInt32 = (value) => expectSizedInt(value, 32); -const expectShort = (value) => expectSizedInt(value, 16); -const expectByte = (value) => expectSizedInt(value, 8); -const expectSizedInt = (value, size) => { - const expected = expectLong(value); - if (expected !== undefined && castInt(expected, size) !== expected) { - throw new TypeError(`Expected ${size}-bit integer, got ${value}`); - } - return expected; -}; -const castInt = (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]; + catch (e) { + throw new propertyProvider.CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger }); } }; -const expectNonNull = (value, location) => { - if (value === null || value === undefined) { - if (location) { - throw new TypeError(`Expected a non-null value for ${location}`); + +const fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { + const profile = sharedIniFileLoader.getProfileName(init); + const { configFile, credentialsFile } = await sharedIniFileLoader.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 === undefined) { + throw new Error(); } - throw new TypeError("Expected a non-null value"); - } - return value; -}; -const expectObject = (value) => { - if (value === null || value === undefined) { - return undefined; - } - 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}`); -}; -const expectString = (value) => { - if (value === null || value === undefined) { - return undefined; - } - 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}`); -}; -const expectUnion = (value) => { - if (value === null || value === undefined) { - return undefined; - } - 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; -}; -const strictParseDouble = (value) => { - if (typeof value == "string") { - return expectNumber(parseNumber(value)); - } - return expectNumber(value); -}; -const strictParseFloat = strictParseDouble; -const strictParseFloat32 = (value) => { - if (typeof value == "string") { - return expectFloat32(parseNumber(value)); - } - return expectFloat32(value); -}; -const NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; -const parseNumber = (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); -}; -const limitedParseDouble = (value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return expectNumber(value); -}; -const handleFloat = limitedParseDouble; -const limitedParseFloat = limitedParseDouble; -const limitedParseFloat32 = (value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return expectFloat32(value); -}; -const parseFloatString = (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}`); - } -}; -const strictParseLong = (value) => { - if (typeof value === "string") { - return expectLong(parseNumber(value)); - } - return expectLong(value); -}; -const strictParseInt = strictParseLong; -const strictParseInt32 = (value) => { - if (typeof value === "string") { - return expectInt32(parseNumber(value)); - } - return expectInt32(value); -}; -const strictParseShort = (value) => { - if (typeof value === "string") { - return expectShort(parseNumber(value)); + return configValue; } - return expectShort(value); -}; -const strictParseByte = (value) => { - if (typeof value === "string") { - return expectByte(parseNumber(value)); + catch (e) { + throw new propertyProvider.CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger }); } - return expectByte(value); -}; -const stackTraceWarning = (message) => { - return String(new TypeError(message).stack || message) - .split("\n") - .slice(0, 5) - .filter((s) => !s.includes("stackTraceWarning")) - .join("\n"); -}; -const logger = { - warn: console.warn, }; -const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; -const 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`; -} -const RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); -const parseRfc3339DateTime = (value) => { - if (value === null || value === undefined) { - return undefined; - } - 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 }); -}; -const RFC3339_WITH_OFFSET$1 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); -const parseRfc3339DateTimeWithOffset = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339_WITH_OFFSET$1.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; -}; -const IMF_FIXDATE$1 = 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$/); -const RFC_850_DATE$1 = 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$/); -const ASC_TIME$1 = 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})$/); -const parseRfc7231DateTime = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value !== "string") { - throw new TypeError("RFC-7231 date-times must be expressed as strings"); - } - let match = IMF_FIXDATE$1.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$1.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$1.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"); -}; -const parseEpochTimestamp = (value) => { - if (value === null || value === undefined) { - return undefined; - } - 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 * 1000)); -}; -const buildDate = (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), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds))); -}; -const parseTwoDigitYear = (value) => { - const thisYear = new Date().getUTCFullYear(); - const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); - if (valueInThisCentury < thisYear) { - return valueInThisCentury + 100; - } - return valueInThisCentury; -}; -const FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000; -const adjustRfc850Year = (input) => { - if (input.getTime() - 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; -}; -const parseMonthByShortName = (value) => { - const monthIdx = MONTHS.indexOf(value); - if (monthIdx < 0) { - throw new TypeError(`Invalid month: ${value}`); - } - return monthIdx + 1; +const isFunction = (func) => typeof func === "function"; +const fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue); + +const loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => { + const { signingName, logger } = configuration; + const envOptions = { signingName, logger }; + return propertyProvider.memoize(propertyProvider.chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue))); }; -const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -const validateDayOfMonth = (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}`); + +exports.loadConfig = loadConfig; + + +/***/ }), + +/***/ 1279: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var protocolHttp = __nccwpck_require__(2356); +var querystringBuilder = __nccwpck_require__(8256); +var http = __nccwpck_require__(8611); +var https = __nccwpck_require__(5692); +var stream = __nccwpck_require__(2203); +var http2 = __nccwpck_require__(5675); + +const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +const getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; } + return transformedHeaders; }; -const isLeapYear = (year) => { - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + +const timing = { + setTimeout: (cb, ms) => setTimeout(cb, ms), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), }; -const parseDateValue = (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`); + +const DEFER_EVENT_LISTENER_TIME$2 = 1000; +const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return -1; } - return dateVal; -}; -const parseMilliseconds = (value) => { - if (value === null || value === undefined) { + const registerTimeout = (offset) => { + const timeoutId = timing.setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { + name: "TimeoutError", + })); + }, timeoutInMs - offset); + const doWithSocket = (socket) => { + if (socket?.connecting) { + socket.on("connect", () => { + timing.clearTimeout(timeoutId); + }); + } + else { + timing.clearTimeout(timeoutId); + } + }; + if (request.socket) { + doWithSocket(request.socket); + } + else { + request.on("socket", doWithSocket); + } + }; + if (timeoutInMs < 2000) { + registerTimeout(0); return 0; } - return strictParseFloat32("0." + value) * 1000; + return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2); }; -const parseOffsetToMilliseconds = (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 setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => { + if (timeoutInMs) { + return timing.setTimeout(() => { + let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; + if (throwOnRequestTimeout) { + const error = Object.assign(new Error(msg), { + name: "TimeoutError", + code: "ETIMEDOUT", + }); + req.destroy(error); + reject(error); + } + else { + msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; + logger?.warn?.(msg); + } + }, timeoutInMs); } - const hour = Number(value.substring(1, 3)); - const minute = Number(value.substring(4, 6)); - return direction * (hour * 60 + minute) * 60 * 1000; + return -1; }; -const stripLeadingZeroes = (value) => { - let idx = 0; - while (idx < value.length - 1 && value.charAt(idx) === "0") { - idx++; + +const DEFER_EVENT_LISTENER_TIME$1 = 3000; +const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => { + if (keepAlive !== true) { + return -1; } - if (idx === 0) { - return value; + const registerListener = () => { + if (request.socket) { + request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + } + else { + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); + } + }; + if (deferTimeMs === 0) { + registerListener(); + return 0; } - return value.slice(idx); + return timing.setTimeout(registerListener, deferTimeMs); }; -const LazyJsonString = function LazyJsonString(val) { - const str = Object.assign(new String(val), { - deserializeJSON() { - return JSON.parse(String(val)); - }, - toString() { - return String(val); - }, - toJSON() { - return String(val); - }, - }); - return str; -}; -LazyJsonString.from = (object) => { - if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) { - return object; - } - else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) { - return LazyJsonString(String(object)); +const DEFER_EVENT_LISTENER_TIME = 3000; +const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + const registerTimeout = (offset) => { + const timeout = timeoutInMs - offset; + const onTimeout = () => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); + }; + if (request.socket) { + request.socket.setTimeout(timeout, onTimeout); + request.on("close", () => request.socket?.removeListener("timeout", onTimeout)); + } + else { + request.setTimeout(timeout, onTimeout); + } + }; + if (0 < timeoutInMs && timeoutInMs < 6000) { + registerTimeout(0); + return 0; } - return LazyJsonString(JSON.stringify(object)); + return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); }; -LazyJsonString.fromObject = LazyJsonString.from; -function quoteHeader(part) { - if (part.includes(",") || part.includes('"')) { - part = `"${part.replace(/"/g, '\\"')}"`; +const MIN_WAIT_TIME = 6_000; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { + const headers = request.headers ?? {}; + const expect = headers.Expect || headers.expect; + let timeoutId = -1; + let sendBody = true; + if (!externalAgent && expect === "100-continue") { + sendBody = await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + timing.clearTimeout(timeoutId); + resolve(true); + }); + httpRequest.on("response", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + httpRequest.on("error", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + }), + ]); } - return part; -} - -const ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`; -const mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`; -const time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`; -const date = `(\\d?\\d)`; -const year = `(\\d{4})`; -const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/); -const IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`); -const RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`); -const ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`); -const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; -const _parseEpochTimestamp = (value) => { - if (value == null) { - return void 0; + if (sendBody) { + writeBody(httpRequest, request.body); } - let num = NaN; - if (typeof value === "number") { - num = value; +} +function writeBody(httpRequest, body) { + if (body instanceof stream.Readable) { + body.pipe(httpRequest); + return; } - else if (typeof value === "string") { - if (!/^-?\d*\.?\d+$/.test(value)) { - throw new TypeError(`parseEpochTimestamp - numeric string invalid.`); + if (body) { + if (Buffer.isBuffer(body) || typeof body === "string") { + httpRequest.end(body); + return; } - num = Number.parseFloat(value); - } - else if (typeof value === "object" && value.tag === 1) { - num = value.value; - } - if (isNaN(num) || Math.abs(num) === Infinity) { - throw new TypeError("Epoch timestamps must be valid finite numbers."); + 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; } - return new Date(Math.round(num * 1000)); -}; -const _parseRfc3339DateTimeWithOffset = (value) => { - if (value == null) { - return void 0; + httpRequest.end(); +} + +const DEFAULT_REQUEST_TIMEOUT = 0; +class NodeHttpHandler { + config; + configProvider; + socketWarningTimestamp = 0; + externalAgent = false; + metadata = { handlerProtocol: "http/1.1" }; + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new NodeHttpHandler(instanceOrOptions); } - if (typeof value !== "string") { - throw new TypeError("RFC3339 timestamps must be strings"); + static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15_000; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = sockets[origin]?.length ?? 0; + const requestsEnqueued = requests[origin]?.length ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + logger?.warn?.(`@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; } - const matches = RFC3339_WITH_OFFSET.exec(value); - if (!matches) { - throw new TypeError(`Invalid RFC3339 timestamp format ${value}`); + constructor(options) { + 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 [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches; - range(monthStr, 1, 12); - range(dayStr, 1, 31); - range(hours, 0, 23); - range(minutes, 0, 59); - range(seconds, 0, 60); - const date = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1000) : 0)); - date.setUTCFullYear(Number(yearStr)); - if (offsetStr.toUpperCase() != "Z") { - const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0]; - const scalar = sign === "-" ? 1 : -1; - date.setTime(date.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1000 + Number(offsetM) * 60 * 1000)); + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout, + socketTimeout, + socketAcquisitionWarningTimeout, + throwOnRequestTimeout, + httpAgent: (() => { + if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") { + this.externalAgent = true; + return httpAgent; + } + return new http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") { + this.externalAgent = true; + return httpsAgent; + } + return new https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })(), + logger: console, + }; } - return date; -}; -const _parseRfc7231DateTime = (value) => { - if (value == null) { - return void 0; + destroy() { + this.config?.httpAgent?.destroy(); + this.config?.httpsAgent?.destroy(); } - if (typeof value !== "string") { - throw new TypeError("RFC7231 timestamps must be strings."); + async handle(request, { abortSignal, requestTimeout } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + return new Promise((_resolve, _reject) => { + const config = this.config; + let writeRequestBodyPromise = undefined; + const timeouts = []; + const resolve = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _reject(arg); + }; + if (abortSignal?.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const headers = request.headers ?? {}; + const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; + let agent = isSSL ? config.httpsAgent : config.httpAgent; + if (expectContinue && !this.externalAgent) { + agent = new (isSSL ? https.Agent : http.Agent)({ + keepAlive: false, + maxSockets: Infinity, + }); + } + timeouts.push(timing.setTimeout(() => { + this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); + }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2000) + (config.connectionTimeout ?? 1000))); + const queryString = querystringBuilder.buildQueryString(request.query || {}); + let auth = undefined; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}`; + } + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + let hostname = request.hostname ?? ""; + if (hostname[0] === "[" && hostname.endsWith("]")) { + hostname = request.hostname.slice(1, -1); + } + else { + hostname = request.hostname; + } + const nodeHttpsOptions = { + headers: request.headers, + host: hostname, + method: request.method, + path, + port: request.port, + agent, + auth, + }; + const requestFunc = isSSL ? https.request : http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocolHttp.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 = () => { + req.destroy(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + 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; + } + } + const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; + timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout)); + timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); + timeouts.push(setSocketTimeout(req, reject, config.socketTimeout)); + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + timeouts.push(setSocketKeepAlive(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs, + })); + } + writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e) => { + timeouts.forEach(timing.clearTimeout); + return _reject(e); + }); + }); } - let day; - let month; - let year; - let hour; - let minute; - let second; - let fraction; - let matches; - if ((matches = IMF_FIXDATE.exec(value))) { - [, day, month, year, hour, minute, second, fraction] = matches; + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); } - else if ((matches = RFC_850_DATE.exec(value))) { - [, day, month, year, hour, minute, second, fraction] = matches; - year = (Number(year) + 1900).toString(); + httpHandlerConfigs() { + return this.config ?? {}; } - else if ((matches = ASC_TIME.exec(value))) { - [, month, day, hour, minute, second, fraction, year] = matches; +} + +class NodeHttp2ConnectionPool { + sessions = []; + constructor(sessions) { + this.sessions = sessions ?? []; } - if (year && second) { - const timestamp = Date.UTC(Number(year), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1000) : 0); - range(day, 1, 31); - range(hour, 0, 23); - range(minute, 0, 59); - range(second, 0, 60); - const date = new Date(timestamp); - date.setUTCFullYear(Number(year)); - return date; + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); + } } - throw new TypeError(`Invalid RFC7231 date-time value ${value}.`); -}; -function range(v, min, max) { - const _v = Number(v); - if (_v < min || _v > max) { - throw new Error(`Value ${_v} out of range [${min}, ${max}]`); + offerLast(session) { + this.sessions.push(session); } -} - -function splitEvery(value, delimiter, numDelimiters) { - if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { - throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); + contains(session) { + return this.sessions.includes(session); } - const segments = value.split(delimiter); - if (numDelimiters === 1) { - return segments; + remove(session) { + this.sessions = this.sessions.filter((s) => s !== session); } - 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 = ""; - } + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); } - if (currentSegment !== "") { - compoundSegments.push(currentSegment); + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); + } + } + } } - return compoundSegments; } -const splitHeader = (value) => { - const z = value.length; - const values = []; - let withinQuotes = false; - let prevChar = undefined; - 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; - } - break; +class NodeHttp2ConnectionManager { + constructor(config) { + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); } - prevChar = char; } - values.push(value.slice(anchor)); - return values.map((v) => { - v = v.trim(); - const z = v.length; - if (z < 2) { - return v; + config; + sessionCache = new Map(); + lease(requestContext, connectionConfiguration) { + const url = this.getUrlString(requestContext); + const existingPool = this.sessionCache.get(url); + if (existingPool) { + const existingSession = existingPool.poll(); + if (existingSession && !this.config.disableConcurrency) { + return existingSession; + } } - if (v[0] === `"` && v[z - 1] === `"`) { - v = v.slice(1, z - 1); + const session = http2.connect(url); + 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 v.replace(/\\"/g, '"'); - }); -}; - -const format = /^-?\d*(\.\d+)?$/; -class NumericValue { - string; - type; - constructor(string, type) { - this.string = string; - this.type = type; - if (!format.test(string)) { - throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`); + session.unref(); + const destroySessionCb = () => { + session.destroy(); + this.deleteSession(url, session); + }; + session.on("goaway", destroySessionCb); + session.on("error", destroySessionCb); + session.on("frameError", destroySessionCb); + session.on("close", () => this.deleteSession(url, session)); + if (connectionConfiguration.requestTimeout) { + session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); } + const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool(); + connectionPool.offerLast(session); + this.sessionCache.set(url, connectionPool); + return session; } - toString() { - return this.string; + 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); } - static [Symbol.hasInstance](object) { - if (!object || typeof object !== "object") { - return false; + release(requestContext, session) { + const cacheKey = this.getUrlString(requestContext); + this.sessionCache.get(cacheKey)?.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); } - const _nv = object; - return NumericValue.prototype.isPrototypeOf(object) || (_nv.type === "bigDecimal" && format.test(_nv.string)); } -} -function nv(input) { - return new NumericValue(String(input), "bigDecimal"); -} - -Object.defineProperty(exports, "generateIdempotencyToken", ({ - enumerable: true, - get: function () { return uuid.v4; } -})); -exports.LazyJsonString = LazyJsonString; -exports.NumericValue = NumericValue; -exports._parseEpochTimestamp = _parseEpochTimestamp; -exports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset; -exports._parseRfc7231DateTime = _parseRfc7231DateTime; -exports.copyDocumentWithTransform = copyDocumentWithTransform; -exports.dateToUtcString = dateToUtcString; -exports.expectBoolean = expectBoolean; -exports.expectByte = expectByte; -exports.expectFloat32 = expectFloat32; -exports.expectInt = expectInt; -exports.expectInt32 = expectInt32; -exports.expectLong = expectLong; -exports.expectNonNull = expectNonNull; -exports.expectNumber = expectNumber; -exports.expectObject = expectObject; -exports.expectShort = expectShort; -exports.expectString = expectString; -exports.expectUnion = expectUnion; -exports.handleFloat = handleFloat; -exports.limitedParseDouble = limitedParseDouble; -exports.limitedParseFloat = limitedParseFloat; -exports.limitedParseFloat32 = limitedParseFloat32; -exports.logger = logger; -exports.nv = nv; -exports.parseBoolean = parseBoolean; -exports.parseEpochTimestamp = parseEpochTimestamp; -exports.parseRfc3339DateTime = parseRfc3339DateTime; -exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset; -exports.parseRfc7231DateTime = parseRfc7231DateTime; -exports.quoteHeader = quoteHeader; -exports.splitEvery = splitEvery; -exports.splitHeader = splitHeader; -exports.strictParseByte = strictParseByte; -exports.strictParseDouble = strictParseDouble; -exports.strictParseFloat = strictParseFloat; -exports.strictParseFloat32 = strictParseFloat32; -exports.strictParseInt = strictParseInt; -exports.strictParseInt32 = strictParseInt32; -exports.strictParseLong = strictParseLong; -exports.strictParseShort = strictParseShort; - - -/***/ }), - -/***/ 7809: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var protocolHttp = __nccwpck_require__(2356); -var querystringBuilder = __nccwpck_require__(8256); -var utilBase64 = __nccwpck_require__(8385); - -function createRequest(url, requestOptions) { - return new Request(url, requestOptions); -} - -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); + setMaxConcurrentStreams(maxConcurrentStreams) { + if (maxConcurrentStreams && maxConcurrentStreams <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); } - }); + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } } -const keepAliveSupport = { - supported: undefined, -}; -class FetchHttpHandler { +class NodeHttp2Handler { config; configProvider; + metadata = { handlerProtocol: "h2" }; + connectionManager = new NodeHttp2ConnectionManager({}); static create(instanceOrOptions) { if (typeof instanceOrOptions?.handle === "function") { return instanceOrOptions; } - return new FetchHttpHandler(instanceOrOptions); + return new NodeHttp2Handler(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 === undefined) { - keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]")); - } + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((opts) => { + resolve(opts || {}); + }) + .catch(reject); + } + else { + resolve(options || {}); + } + }); } destroy() { + this.connectionManager.destroy(); } - async handle(request, { abortSignal, requestTimeout: requestTimeout$1 } = {}) { + async handle(request, { abortSignal, requestTimeout } = {}) { 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 requestTimeoutInMs = requestTimeout$1 ?? this.config.requestTimeout; - const keepAlive = this.config.keepAlive === true; - const credentials = this.config.credentials; - if (abortSignal?.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - return Promise.reject(abortError); - } - let path = request.path; - const queryString = querystringBuilder.buildQueryString(request.query || {}); - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - let auth = ""; - if (request.username != null || request.password != null) { - const username = request.username ?? ""; - const password = request.password ?? ""; - auth = `${username}:${password}@`; - } - const { port, method } = request; - const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`; - const body = method === "GET" || method === "HEAD" ? undefined : request.body; - const requestOptions = { - body, - headers: new Headers(request.headers), - method: method, - credentials, - }; - if (this.config?.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(request)); - } - let removeSignalEventListener = () => { }; - const fetchRequest = createRequest(url, 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 { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config; + const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; + return new Promise((_resolve, _reject) => { + let fulfilled = false; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal?.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = request; + let auth = ""; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}@`; + } + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: this.config?.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false, + }); + const rejectWithDestroy = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); } - const hasReadableStream = response.body != undefined; - if (!hasReadableStream) { - return response.blob().then((body) => ({ - response: new protocolHttp.HttpResponse({ - headers: transformedHeaders, - reason: response.statusText, - statusCode: response.status, - body, - }), - })); + fulfilled = true; + reject(err); + }; + const queryString = querystringBuilder.buildQueryString(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [http2.constants.HTTP2_HEADER_PATH]: path, + [http2.constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocolHttp.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req, + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); } - return { - response: new protocolHttp.HttpResponse({ - headers: transformedHeaders, - reason: response.statusText, - statusCode: response.status, - body: response.body, - }), - }; - }), - requestTimeout(requestTimeoutInMs), - ]; - if (abortSignal) { - raceOfPromises.push(new Promise((resolve, reject) => { + }); + if (effectiveRequestTimeout) { + req.setTimeout(effectiveRequestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { const onAbort = () => { + req.close(); const abortError = new Error("Request aborted"); abortError.name = "AbortError"; - reject(abortError); + rejectWithDestroy(abortError); }; if (typeof abortSignal.addEventListener === "function") { const signal = abortSignal; signal.addEventListener("abort", onAbort, { once: true }); - removeSignalEventListener = () => signal.removeEventListener("abort", onAbort); + req.once("close", () => signal.removeEventListener("abort", onAbort)); } else { abortSignal.onabort = onAbort; } - })); - } - return Promise.race(raceOfPromises).finally(removeSignalEventListener); + } + 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, request, effectiveRequestTimeout); + }); } updateHttpClientConfig(key, value) { this.config = undefined; this.configProvider = this.configProvider.then((config) => { - config[key] = value; - return config; + return { + ...config, + [key]: value, + }; }); } httpHandlerConfigs() { return this.config ?? {}; } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } } -const streamCollector = async (stream) => { - if ((typeof Blob === "function" && stream instanceof Blob) || stream.constructor?.name === "Blob") { - if (Blob.prototype.arrayBuffer !== undefined) { - return new Uint8Array(await stream.arrayBuffer()); - } - return collectBlob(stream); +class Collector extends stream.Writable { + bufferedBytes = []; + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); } - return collectStream(stream); -}; -async function collectBlob(blob) { - const base64 = await readToBase64(blob); - const arrayBuffer = utilBase64.fromBase64(base64); - return new Uint8Array(arrayBuffer); } -async function collectStream(stream) { + +const streamCollector = (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); + }); + }); +}; +const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream; +async function collectReadableStream(stream) { const chunks = []; const reader = stream.getReader(); let isDone = false; @@ -19406,5702 +22466,4848 @@ async function collectStream(stream) { } return collected; } -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); - }); -} -exports.FetchHttpHandler = FetchHttpHandler; -exports.keepAliveSupport = keepAliveSupport; +exports.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; +exports.NodeHttp2Handler = NodeHttp2Handler; +exports.NodeHttpHandler = NodeHttpHandler; exports.streamCollector = streamCollector; /***/ }), -/***/ 2711: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 8857: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var utilBufferFrom = __nccwpck_require__(4151); -var utilUtf8 = __nccwpck_require__(1577); -var buffer = __nccwpck_require__(181); -var crypto = __nccwpck_require__(6982); - -class Hash { - algorithmIdentifier; - secret; - hash; - constructor(algorithmIdentifier, secret) { - this.algorithmIdentifier = algorithmIdentifier; - this.secret = secret; - this.reset(); - } - update(toHash, encoding) { - this.hash.update(utilUtf8.toUint8Array(castSourceData(toHash, encoding))); - } - digest() { - return Promise.resolve(this.hash.digest()); +class ProviderError extends Error { + name = "ProviderError"; + tryNextLink; + constructor(message, options = true) { + let logger; + let tryNextLink = true; + if (typeof options === "boolean") { + logger = undefined; + tryNextLink = options; + } + else if (options != null && typeof options === "object") { + logger = options.logger; + tryNextLink = options.tryNextLink ?? true; + } + super(message); + this.tryNextLink = tryNextLink; + Object.setPrototypeOf(this, ProviderError.prototype); + logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); } - reset() { - this.hash = this.secret - ? crypto.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) - : crypto.createHash(this.algorithmIdentifier); + static from(error, options = true) { + return Object.assign(new this(error.message, options), error); } } -function castSourceData(toCast, encoding) { - if (buffer.Buffer.isBuffer(toCast)) { - return toCast; - } - if (typeof toCast === "string") { - return utilBufferFrom.fromString(toCast, encoding); - } - if (ArrayBuffer.isView(toCast)) { - return utilBufferFrom.fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); + +class CredentialsProviderError extends ProviderError { + name = "CredentialsProviderError"; + constructor(message, options = true) { + super(message, options); + Object.setPrototypeOf(this, CredentialsProviderError.prototype); } - return utilBufferFrom.fromArrayBuffer(toCast); } -exports.Hash = Hash; - - -/***/ }), - -/***/ 6130: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) || - Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; - -exports.isArrayBuffer = isArrayBuffer; - - -/***/ }), - -/***/ 7212: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var protocolHttp = __nccwpck_require__(2356); +class TokenProviderError extends ProviderError { + name = "TokenProviderError"; + constructor(message, options = true) { + super(message, options); + Object.setPrototypeOf(this, TokenProviderError.prototype); + } +} -const CONTENT_LENGTH_HEADER = "content-length"; -function contentLengthMiddleware(bodyLengthChecker) { - return (next) => async (args) => { - const request = args.request; - if (protocolHttp.HttpRequest.isInstance(request)) { - const { body, headers } = request; - if (body && - Object.keys(headers) - .map((str) => str.toLowerCase()) - .indexOf(CONTENT_LENGTH_HEADER) === -1) { - try { - const length = bodyLengthChecker(body); - request.headers = { - ...request.headers, - [CONTENT_LENGTH_HEADER]: String(length), - }; - } - catch (error) { - } +const chain = (...providers) => async () => { + if (providers.length === 0) { + throw new ProviderError("No providers in chain"); + } + let lastProviderError; + for (const provider of providers) { + try { + const credentials = await provider(); + return credentials; + } + catch (err) { + lastProviderError = err; + if (err?.tryNextLink) { + continue; } + throw err; } - return next({ - ...args, - request, - }); - }; -} -const contentLengthMiddlewareOptions = { - step: "build", - tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], - name: "contentLengthMiddleware", - override: true, + } + throw lastProviderError; }; -const getContentLengthPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); - }, -}); - -exports.contentLengthMiddleware = contentLengthMiddleware; -exports.contentLengthMiddlewareOptions = contentLengthMiddlewareOptions; -exports.getContentLengthPlugin = getContentLengthPlugin; - - -/***/ }), -/***/ 6041: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointFromConfig = void 0; -const node_config_provider_1 = __nccwpck_require__(5704); -const getEndpointUrlConfig_1 = __nccwpck_require__(8008); -const getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId ?? ""))(); -exports.getEndpointFromConfig = getEndpointFromConfig; - - -/***/ }), - -/***/ 8008: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +const fromStatic = (staticValue) => () => Promise.resolve(staticValue); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointUrlConfig = void 0; -const shared_ini_file_loader_1 = __nccwpck_require__(4964); -const ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; -const CONFIG_ENDPOINT_URL = "endpoint_url"; -const 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 undefined; - }, - 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 endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (endpointUrl) - return endpointUrl; +const memoize = (provider, isExpired, requiresRefresh) => { + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async () => { + if (!pending) { + pending = provider(); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } + finally { + pending = undefined; + } + return resolved; + }; + if (isExpired === undefined) { + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(); } + return resolved; + }; + } + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(); } - const endpointUrl = profile[CONFIG_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return undefined; - }, - default: undefined, -}); -exports.getEndpointUrlConfig = getEndpointUrlConfig; + if (isConstant) { + return resolved; + } + if (requiresRefresh && !requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(); + return resolved; + } + return resolved; + }; +}; + +exports.CredentialsProviderError = CredentialsProviderError; +exports.ProviderError = ProviderError; +exports.TokenProviderError = TokenProviderError; +exports.chain = chain; +exports.fromStatic = fromStatic; +exports.memoize = memoize; /***/ }), -/***/ 99: +/***/ 2356: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var getEndpointFromConfig = __nccwpck_require__(6041); -var urlParser = __nccwpck_require__(4494); -var core = __nccwpck_require__(402); -var utilMiddleware = __nccwpck_require__(6324); -var middlewareSerde = __nccwpck_require__(3255); +var types = __nccwpck_require__(690); -const resolveParamsForS3 = async (endpointParams) => { - const bucket = 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; +const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { + return { + setHttpHandler(handler) { + runtimeConfig.httpHandler = handler; + }, + httpHandler() { + return runtimeConfig.httpHandler; + }, + updateHttpClientConfig(key, value) { + runtimeConfig.httpHandler?.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return runtimeConfig.httpHandler.httpHandlerConfigs(); + }, + }; }; -const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; -const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; -const DOTS_PATTERN = /\.\./; -const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); -const isArnBucketName = (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; +const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler(), + }; }; -const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => { - const configProvider = async () => { - const configValue = config[configKey] ?? config[canonicalEndpointParamKey]; - if (typeof configValue === "function") { - return configValue(); - } - return configValue; - }; - if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { - return async () => { - const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; - const configValue = credentials?.credentialScope ?? credentials?.CredentialScope; - return configValue; - }; +class Field { + name; + kind; + values; + constructor({ name, kind = types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; } - if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { - return async () => { - const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; - const configValue = credentials?.accountId ?? credentials?.AccountId; - return configValue; - }; + add(value) { + this.values.push(value); } - if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { - return async () => { - if (config.isCustomEndpoint === false) { - return undefined; - } - 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; - }; + set(values) { + this.values = values; } - return configProvider; -}; - -const toEndpointV1 = (endpoint) => { - if (typeof endpoint === "object") { - if ("url" in endpoint) { - return urlParser.parseUrl(endpoint.url); - } - return endpoint; + remove(value) { + this.values = this.values.filter((v) => v !== value); } - return urlParser.parseUrl(endpoint); -}; + toString() { + return this.values.map((v) => (v.includes(",") || v.includes(" ") ? `"${v}"` : v)).join(", "); + } + get() { + return this.values; + } +} -const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { - if (!clientConfig.isCustomEndpoint) { - let endpointFromConfig; - if (clientConfig.serviceConfiguredEndpoint) { - endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); - } - else { - endpointFromConfig = await getEndpointFromConfig.getEndpointFromConfig(clientConfig.serviceId); - } - if (endpointFromConfig) { - clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); - clientConfig.isCustomEndpoint = true; - } +class Fields { + entries = {}; + encoding; + constructor({ fields = [], encoding = "utf-8" }) { + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; } - const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); - if (typeof clientConfig.endpointProvider !== "function") { - throw new Error("config.endpointProvider is not set."); + setField(field) { + this.entries[field.name.toLowerCase()] = field; } - const endpoint = clientConfig.endpointProvider(endpointParams, context); - return endpoint; -}; -const resolveParams = async (commandInput, instructionsSupplier, clientConfig) => { - const endpointParams = {}; - const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {}; - 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; - case "operationContextParams": - endpointParams[name] = instruction.get(commandInput); - break; - default: - throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); - } + getField(name) { + return this.entries[name.toLowerCase()]; } - if (Object.keys(instructions).length === 0) { - Object.assign(endpointParams, clientConfig); + removeField(name) { + delete this.entries[name.toLowerCase()]; } - if (String(clientConfig.serviceId).toLowerCase() === "s3") { - await resolveParamsForS3(endpointParams); + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); } - return endpointParams; -}; +} -const endpointMiddleware = ({ config, instructions, }) => { - return (next, context) => async (args) => { - if (config.isCustomEndpoint) { - core.setFeature(context, "ENDPOINT_OVERRIDE", "N"); - } - const endpoint = await getEndpointFromInstructions(args.input, { - getEndpointParameterInstructions() { - return instructions; - }, - }, { ...config }, context); - context.endpointV2 = endpoint; - context.authSchemes = endpoint.properties?.authSchemes; - const authScheme = context.authSchemes?.[0]; - if (authScheme) { - context["signing_region"] = authScheme.signingRegion; - context["signing_service"] = authScheme.signingName; - const smithyContext = utilMiddleware.getSmithyContext(context); - const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.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); - } - } - return next({ - ...args, +class HttpRequest { + method; + protocol; + hostname; + port; + path; + query; + headers; + username; + password; + fragment; + body; + 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; + } + static clone(request) { + const cloned = new HttpRequest({ + ...request, + headers: { ...request.headers }, }); - }; -}; - -const endpointMiddlewareOptions = { - step: "serialize", - tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], - name: "endpointV2Middleware", - override: true, - relation: "before", - toMiddleware: middlewareSerde.serializerMiddlewareOption.name, -}; -const getEndpointPlugin = (config, instructions) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(endpointMiddleware({ - config, - instructions, - }), endpointMiddlewareOptions); - }, -}); - -const resolveEndpointConfig = (input) => { - const tls = input.tls ?? true; - const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input; - const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await utilMiddleware.normalizeProvider(endpoint)()) : undefined; - const isCustomEndpoint = !!endpoint; - const resolvedConfig = Object.assign(input, { - endpoint: customEndpointProvider, - tls, - isCustomEndpoint, - useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false), - useFipsEndpoint: utilMiddleware.normalizeProvider(useFipsEndpoint ?? false), - }); - let configuredEndpointPromise = undefined; - resolvedConfig.serviceConfiguredEndpoint = async () => { - if (input.serviceId && !configuredEndpointPromise) { - configuredEndpointPromise = getEndpointFromConfig.getEndpointFromConfig(input.serviceId); + if (cloned.query) { + cloned.query = cloneQuery(cloned.query); } - return configuredEndpointPromise; - }; - return resolvedConfig; -}; - -const resolveEndpointRequiredConfig = (input) => { - const { endpoint } = input; - if (endpoint === undefined) { - input.endpoint = async () => { - throw new Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint."); + return cloned; + } + static isInstance(request) { + if (!request) { + return false; + } + const req = request; + return ("method" in req && + "protocol" in req && + "hostname" in req && + "path" in req && + typeof req["query"] === "object" && + typeof req["headers"] === "object"); + } + clone() { + return HttpRequest.clone(this); + } +} +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param, }; + }, {}); +} + +class HttpResponse { + statusCode; + reason; + headers; + body; + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; } - return input; -}; + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +} -exports.endpointMiddleware = endpointMiddleware; -exports.endpointMiddlewareOptions = endpointMiddlewareOptions; -exports.getEndpointFromInstructions = getEndpointFromInstructions; -exports.getEndpointPlugin = getEndpointPlugin; -exports.resolveEndpointConfig = resolveEndpointConfig; -exports.resolveEndpointRequiredConfig = resolveEndpointRequiredConfig; -exports.resolveParams = resolveParams; -exports.toEndpointV1 = toEndpointV1; +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} + +exports.Field = Field; +exports.Fields = Fields; +exports.HttpRequest = HttpRequest; +exports.HttpResponse = HttpResponse; +exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; +exports.isValidHostname = isValidHostname; +exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; /***/ }), -/***/ 9618: +/***/ 8256: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var utilRetry = __nccwpck_require__(5518); -var protocolHttp = __nccwpck_require__(2356); -var serviceErrorClassification = __nccwpck_require__(2058); -var uuid = __nccwpck_require__(266); -var utilMiddleware = __nccwpck_require__(6324); -var smithyClient = __nccwpck_require__(1411); -var isStreamingPayload = __nccwpck_require__(9831); +var utilUriEscape = __nccwpck_require__(146); -const getDefaultRetryQuota = (initialRetryTokens, options) => { - const MAX_CAPACITY = initialRetryTokens; - const noRetryIncrement = utilRetry.NO_RETRY_INCREMENT; - const retryCost = utilRetry.RETRY_COST; - const timeoutRetryCost = utilRetry.TIMEOUT_RETRY_COST; - let availableCapacity = initialRetryTokens; - const getCapacityAmount = (error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost); - const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity; - const retrieveRetryTokens = (error) => { - if (!hasRetryTokens(error)) { - throw new Error("No retry token available"); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = utilUriEscape.escapeUri(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${utilUriEscape.escapeUri(value[i])}`); + } } - const capacityAmount = getCapacityAmount(error); - availableCapacity -= capacityAmount; - return capacityAmount; - }; - const releaseRetryTokens = (capacityReleaseAmount) => { - availableCapacity += capacityReleaseAmount ?? noRetryIncrement; - availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); - }; - return Object.freeze({ - hasRetryTokens, - retrieveRetryTokens, - releaseRetryTokens, - }); -}; + else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${utilUriEscape.escapeUri(value)}`; + } + parts.push(qsEntry); + } + } + return parts.join("&"); +} -const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(utilRetry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); +exports.buildQueryString = buildQueryString; -const defaultRetryDecider = (error) => { - if (!error) { - return false; - } - return serviceErrorClassification.isRetryableByTrait(error) || serviceErrorClassification.isClockSkewError(error) || serviceErrorClassification.isThrottlingError(error) || serviceErrorClassification.isTransientError(error); -}; -const asSdkError = (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}`); -}; +/***/ }), -class StandardRetryStrategy { - maxAttemptsProvider; - retryDecider; - delayDecider; - retryQuota; - mode = utilRetry.RETRY_MODES.STANDARD; - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - this.retryDecider = options?.retryDecider ?? defaultRetryDecider; - this.delayDecider = options?.delayDecider ?? defaultDelayDecider; - this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(utilRetry.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 = utilRetry.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 } = args; - if (protocolHttp.HttpRequest.isInstance(request)) { - request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4(); - } - while (true) { - try { - if (protocolHttp.HttpRequest.isInstance(request)) { - request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - if (options?.beforeRequest) { - await options.beforeRequest(); - } - const { response, output } = await next(args); - if (options?.afterRequest) { - options.afterRequest(response); - } - this.retryQuota.releaseRetryTokens(retryTokenAmount); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalDelay; - return { response, output }; +/***/ 8822: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +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); } - catch (e) { - const err = asSdkError(e); - attempts++; - if (this.shouldRetry(err, attempts, maxAttempts)) { - retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); - const delayFromDecider = this.delayDecider(serviceErrorClassification.isThrottlingError(err) ? utilRetry.THROTTLING_RETRY_DELAY_BASE : utilRetry.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; + 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; } -const getDelayFromRetryAfterHeader = (response) => { - if (!protocolHttp.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 * 1000; - const retryAfterDate = new Date(retryAfter); - return retryAfterDate.getTime() - Date.now(); -}; -class AdaptiveRetryStrategy extends StandardRetryStrategy { - rateLimiter; - constructor(maxAttemptsProvider, options) { - const { rateLimiter, ...superOptions } = options ?? {}; - super(maxAttemptsProvider, superOptions); - this.rateLimiter = rateLimiter ?? new utilRetry.DefaultRateLimiter(); - this.mode = utilRetry.RETRY_MODES.ADAPTIVE; - } - async retry(next, args) { - return super.retry(next, args, { - beforeRequest: async () => { - return this.rateLimiter.getSendToken(); - }, - afterRequest: (response) => { - this.rateLimiter.updateClientSendingRate(response); - }, - }); - } -} +exports.parseQueryString = parseQueryString; -const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; -const CONFIG_MAX_ATTEMPTS = "max_attempts"; -const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - const value = env[ENV_MAX_ATTEMPTS]; - if (!value) - return undefined; - 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 undefined; - 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: utilRetry.DEFAULT_MAX_ATTEMPTS, -}; -const resolveRetryConfig = (input) => { - const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input; - const maxAttempts = utilMiddleware.normalizeProvider(_maxAttempts ?? utilRetry.DEFAULT_MAX_ATTEMPTS); - return Object.assign(input, { - maxAttempts, - retryStrategy: async () => { - if (retryStrategy) { - return retryStrategy; - } - const retryMode = await utilMiddleware.normalizeProvider(_retryMode)(); - if (retryMode === utilRetry.RETRY_MODES.ADAPTIVE) { - return new utilRetry.AdaptiveRetryStrategy(maxAttempts); - } - return new utilRetry.StandardRetryStrategy(maxAttempts); - }, - }); -}; -const ENV_RETRY_MODE = "AWS_RETRY_MODE"; -const CONFIG_RETRY_MODE = "retry_mode"; -const NODE_RETRY_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[ENV_RETRY_MODE], - configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], - default: utilRetry.DEFAULT_RETRY_MODE, -}; -const omitRetryHeadersMiddleware = () => (next) => async (args) => { - const { request } = args; - if (protocolHttp.HttpRequest.isInstance(request)) { - delete request.headers[utilRetry.INVOCATION_ID_HEADER]; - delete request.headers[utilRetry.REQUEST_HEADER]; - } - return next(args); -}; -const omitRetryHeadersMiddlewareOptions = { - name: "omitRetryHeadersMiddleware", - tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], - relation: "before", - toMiddleware: "awsAuthMiddleware", - override: true, -}; -const getOmitRetryHeadersPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); - }, -}); +/***/ }), -const retryMiddleware = (options) => (next, context) => async (args) => { - 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 } = args; - const isRequest = protocolHttp.HttpRequest.isInstance(request); - if (isRequest) { - request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4(); - } - while (true) { - try { - if (isRequest) { - request.headers[utilRetry.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 && isStreamingPayload.isStreamingPayload(request)) { - (context.logger instanceof smithyClient.NoOpLogger ? console : context.logger)?.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?.mode) - context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]]; - return retryStrategy.retry(next, args); - } -}; -const isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && - typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && - typeof retryStrategy.recordSuccess !== "undefined"; -const getRetryErrorInfo = (error) => { - const errorInfo = { - error, - errorType: getRetryErrorType(error), - }; - const retryAfterHint = getRetryAfterHint(error.$response); - if (retryAfterHint) { - errorInfo.retryAfterHint = retryAfterHint; - } - return errorInfo; -}; -const getRetryErrorType = (error) => { - if (serviceErrorClassification.isThrottlingError(error)) - return "THROTTLING"; - if (serviceErrorClassification.isTransientError(error)) - return "TRANSIENT"; - if (serviceErrorClassification.isServerError(error)) - return "SERVER_ERROR"; - return "CLIENT_ERROR"; -}; -const retryMiddlewareOptions = { - name: "retryMiddleware", - tags: ["RETRY"], - step: "finalizeRequest", - priority: "high", - override: true, +/***/ 2058: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +const CLOCK_SKEW_ERROR_CODES = [ + "AuthFailure", + "InvalidSignatureException", + "RequestExpired", + "RequestInTheFuture", + "RequestTimeTooSkewed", + "SignatureDoesNotMatch", +]; +const THROTTLING_ERROR_CODES = [ + "BandwidthLimitExceeded", + "EC2ThrottledException", + "LimitExceededException", + "PriorRequestNotComplete", + "ProvisionedThroughputExceededException", + "RequestLimitExceeded", + "RequestThrottled", + "RequestThrottledException", + "SlowDown", + "ThrottledException", + "Throttling", + "ThrottlingException", + "TooManyRequestsException", + "TransactionInProgressException", +]; +const TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; +const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; +const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; +const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"]; + +const isRetryableByTrait = (error) => error?.$retryable !== undefined; +const isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name); +const isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCorrected; +const isBrowserNetworkError = (error) => { + const errorMessages = new Set([ + "Failed to fetch", + "NetworkError when attempting to fetch resource", + "The Internet connection appears to be offline", + "Load failed", + "Network request failed", + ]); + const isValid = error && error instanceof TypeError; + if (!isValid) { + return false; + } + return errorMessages.has(error.message); }; -const getRetryPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(retryMiddleware(options), retryMiddlewareOptions); - }, -}); -const getRetryAfterHint = (response) => { - if (!protocolHttp.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 * 1000); - const retryAfterDate = new Date(retryAfter); - return retryAfterDate; +const isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 || + THROTTLING_ERROR_CODES.includes(error.name) || + error.$retryable?.throttling == true; +const isTransientError = (error, depth = 0) => isRetryableByTrait(error) || + isClockSkewCorrectedError(error) || + TRANSIENT_ERROR_CODES.includes(error.name) || + NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || + NODEJS_NETWORK_ERROR_CODES.includes(error?.code || "") || + TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || + isBrowserNetworkError(error) || + (error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1)); +const isServerError = (error) => { + if (error.$metadata?.httpStatusCode !== undefined) { + const statusCode = error.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) { + return true; + } + return false; + } + return false; }; -exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; -exports.CONFIG_MAX_ATTEMPTS = CONFIG_MAX_ATTEMPTS; -exports.CONFIG_RETRY_MODE = CONFIG_RETRY_MODE; -exports.ENV_MAX_ATTEMPTS = ENV_MAX_ATTEMPTS; -exports.ENV_RETRY_MODE = ENV_RETRY_MODE; -exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = NODE_MAX_ATTEMPT_CONFIG_OPTIONS; -exports.NODE_RETRY_MODE_CONFIG_OPTIONS = NODE_RETRY_MODE_CONFIG_OPTIONS; -exports.StandardRetryStrategy = StandardRetryStrategy; -exports.defaultDelayDecider = defaultDelayDecider; -exports.defaultRetryDecider = defaultRetryDecider; -exports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; -exports.getRetryAfterHint = getRetryAfterHint; -exports.getRetryPlugin = getRetryPlugin; -exports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; -exports.omitRetryHeadersMiddlewareOptions = omitRetryHeadersMiddlewareOptions; -exports.resolveRetryConfig = resolveRetryConfig; -exports.retryMiddleware = retryMiddleware; -exports.retryMiddlewareOptions = retryMiddlewareOptions; +exports.isBrowserNetworkError = isBrowserNetworkError; +exports.isClockSkewCorrectedError = isClockSkewCorrectedError; +exports.isClockSkewError = isClockSkewError; +exports.isRetryableByTrait = isRetryableByTrait; +exports.isServerError = isServerError; +exports.isThrottlingError = isThrottlingError; +exports.isTransientError = isTransientError; /***/ }), -/***/ 9831: +/***/ 4172: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isStreamingPayload = void 0; -const stream_1 = __nccwpck_require__(2203); -const isStreamingPayload = (request) => request?.body instanceof stream_1.Readable || - (typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream); -exports.isStreamingPayload = isStreamingPayload; +exports.getHomeDir = void 0; +const os_1 = __nccwpck_require__(857); +const path_1 = __nccwpck_require__(6928); +const homeDirCache = {}; +const getHomeDirCacheKey = () => { + if (process && process.geteuid) { + return `${process.geteuid()}`; + } + return "DEFAULT"; +}; +const getHomeDir = () => { + 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]; +}; +exports.getHomeDir = getHomeDir; /***/ }), -/***/ 3255: +/***/ 269: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -var protocolHttp = __nccwpck_require__(2356); - -const deserializerMiddleware = (options, deserializer) => (next, context) => 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, - enumerable: false, - writable: false, - configurable: false, - }); - if (!("$metadata" in error)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - try { - error.message += "\n " + hint; - } - catch (e) { - if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { - console.warn(hint); - } - else { - context.logger?.warn?.(hint); - } - } - if (typeof error.$responseBodyText !== "undefined") { - if (error.$response) { - error.$response.body = error.$responseBodyText; - } - } - try { - if (protocolHttp.HttpResponse.isInstance(response)) { - const { headers = {} } = response; - const headerEntries = Object.entries(headers); - error.$metadata = { - httpStatusCode: response.statusCode, - requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), - extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), - cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries), - }; - } - } - catch (e) { - } - } - throw error; - } -}; -const findHeader = (pattern, headers) => { - return (headers.find(([k]) => { - return k.match(pattern); - }) || [void 0, void 0])[1]; -}; - -const serializerMiddleware = (options, serializer) => (next, context) => async (args) => { - const endpointConfig = options; - const endpoint = context.endpointV2?.url && endpointConfig.urlParser - ? async () => endpointConfig.urlParser(context.endpointV2.url) - : endpointConfig.endpoint; - if (!endpoint) { - throw new Error("No valid endpoint provider available."); - } - const request = await serializer(args.input, { ...options, endpoint }); - return next({ - ...args, - request, - }); -}; - -const deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true, -}; -const serializerMiddlewareOption = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true, +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSSOTokenFilepath = void 0; +const crypto_1 = __nccwpck_require__(6982); +const path_1 = __nccwpck_require__(6928); +const getHomeDir_1 = __nccwpck_require__(4172); +const getSSOTokenFilepath = (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`); }; -function getSerdePlugin(config, serializer, deserializer) { - return { - applyToStack: (commandStack) => { - commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption); - commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption); - }, - }; -} - -exports.deserializerMiddleware = deserializerMiddleware; -exports.deserializerMiddlewareOption = deserializerMiddlewareOption; -exports.getSerdePlugin = getSerdePlugin; -exports.serializerMiddleware = serializerMiddleware; -exports.serializerMiddlewareOption = serializerMiddlewareOption; +exports.getSSOTokenFilepath = getSSOTokenFilepath; /***/ }), -/***/ 9208: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1326: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -const getAllAliases = (name, aliases) => { - const _aliases = []; - if (name) { - _aliases.push(name); - } - if (aliases) { - for (const alias of aliases) { - _aliases.push(alias); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSSOTokenFromFile = exports.tokenIntercept = void 0; +const promises_1 = __nccwpck_require__(1943); +const getSSOTokenFilepath_1 = __nccwpck_require__(269); +exports.tokenIntercept = {}; +const getSSOTokenFromFile = async (id) => { + if (exports.tokenIntercept[id]) { + return exports.tokenIntercept[id]; } - return _aliases; -}; -const getMiddlewareNameWithAliases = (name, aliases) => { - return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; -}; -const constructStack = () => { - let absoluteEntries = []; - let relativeEntries = []; - let identifyOnResolve = false; - const entriesNameSet = new Set(); - const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || - priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]); - const removeByName = (toRemove) => { - let isRemoved = false; - const filterCb = (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; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }; - const removeByReference = (toRemove) => { - let isRemoved = false; - const filterCb = (entry) => { - if (entry.middleware === toRemove) { - isRemoved = true; - for (const alias of getAllAliases(entry.name, entry.aliases)) { - entriesNameSet.delete(alias); - } - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }; - const cloneTo = (toStack) => { - absoluteEntries.forEach((entry) => { - toStack.add(entry.middleware, { ...entry }); - }); - relativeEntries.forEach((entry) => { - toStack.addRelativeTo(entry.middleware, { ...entry }); - }); - toStack.identifyOnResolve?.(stack.identifyOnResolve()); - return toStack; - }; - const expandRelativeMiddlewareList = (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; - }; - const getMiddlewareList = (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 === undefined) { - 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; - }; - 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((entry) => entry.name === alias || entry.aliases?.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((entry) => entry.name === alias || entry.aliases?.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 = (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; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, - concat: (from) => { - const cloned = cloneTo(constructStack()); - cloned.use(from); - cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? 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: (handler, context) => { - for (const middleware of getMiddlewareList() - .map((entry) => entry.middleware) - .reverse()) { - handler = middleware(handler, context); - } - if (identifyOnResolve) { - console.log(stack.identify()); - } - return handler; - }, - }; - return stack; -}; -const stepWeights = { - initialize: 5, - serialize: 4, - build: 3, - finalizeRequest: 2, - deserialize: 1, -}; -const priorityWeights = { - high: 3, - normal: 2, - low: 1, + const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); + const ssoTokenText = await (0, promises_1.readFile)(ssoTokenFilepath, "utf8"); + return JSON.parse(ssoTokenText); }; - -exports.constructStack = constructStack; +exports.getSSOTokenFromFile = getSSOTokenFromFile; /***/ }), -/***/ 5704: +/***/ 4964: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var propertyProvider = __nccwpck_require__(8857); -var sharedIniFileLoader = __nccwpck_require__(4964); +var getHomeDir = __nccwpck_require__(4172); +var getSSOTokenFilepath = __nccwpck_require__(269); +var getSSOTokenFromFile = __nccwpck_require__(1326); +var path = __nccwpck_require__(6928); +var types = __nccwpck_require__(690); +var readFile = __nccwpck_require__(6684); -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; +const ENV_PROFILE = "AWS_PROFILE"; +const DEFAULT_PROFILE = "default"; +const getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; + +const CONFIG_PREFIX_SEPARATOR = "."; + +const getConfigData = (data) => Object.entries(data) + .filter(([key]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + if (indexOfSeparator === -1) { + return false; } -} + return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator)); +}) + .reduce((acc, [key, value]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; + acc[updatedKey] = value; + return acc; +}, { + ...(data.default && { default: data.default }), +}); -const fromEnv = (envVarSelector, options) => async () => { - try { - const config = envVarSelector(process.env, options); - if (config === undefined) { - throw new Error(); +const ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; +const getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path.join(getHomeDir.getHomeDir(), ".aws", "config"); + +const ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; +const getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path.join(getHomeDir.getHomeDir(), ".aws", "credentials"); + +const prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; +const profileNameBlockList = ["__proto__", "profile __proto__"]; +const parseIni = (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 = undefined; + currentSubSection = undefined; + const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); + const matches = prefixKeyRegex.exec(sectionName); + if (matches) { + const [, prefix, , name] = matches; + if (Object.values(types.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 = undefined; + } + map[currentSection] = map[currentSection] || {}; + const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; + map[currentSection][key] = value; + } + } } - return config; } - catch (e) { - throw new propertyProvider.CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger }); + return map; +}; + +const swallowError$1 = () => ({}); +const loadSharedConfigFiles = async (init = {}) => { + const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; + const homeDir = getHomeDir.getHomeDir(); + const relativeHomeDirPrefix = "~/"; + let resolvedFilepath = filepath; + if (filepath.startsWith(relativeHomeDirPrefix)) { + resolvedFilepath = path.join(homeDir, filepath.slice(2)); + } + let resolvedConfigFilepath = configFilepath; + if (configFilepath.startsWith(relativeHomeDirPrefix)) { + resolvedConfigFilepath = path.join(homeDir, configFilepath.slice(2)); } + const parsedFiles = await Promise.all([ + readFile.readFile(resolvedConfigFilepath, { + ignoreCache: init.ignoreCache, + }) + .then(parseIni) + .then(getConfigData) + .catch(swallowError$1), + readFile.readFile(resolvedFilepath, { + ignoreCache: init.ignoreCache, + }) + .then(parseIni) + .catch(swallowError$1), + ]); + return { + configFile: parsedFiles[0], + credentialsFile: parsedFiles[1], + }; }; -const fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = sharedIniFileLoader.getProfileName(init); - const { configFile, credentialsFile } = await sharedIniFileLoader.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 === undefined) { - throw new Error(); +const getSsoSessionData = (data) => Object.entries(data) + .filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)) + .reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}); + +const swallowError = () => ({}); +const loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath()) + .then(parseIni) + .then(getSsoSessionData) + .catch(swallowError); + +const mergeConfigFiles = (...files) => { + const merged = {}; + for (const file of files) { + for (const [key, values] of Object.entries(file)) { + if (merged[key] !== undefined) { + Object.assign(merged[key], values); + } + else { + merged[key] = values; + } } - return configValue; - } - catch (e) { - throw new propertyProvider.CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger }); } + return merged; }; -const isFunction = (func) => typeof func === "function"; -const fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue); +const parseKnownFiles = async (init) => { + const parsedFiles = await loadSharedConfigFiles(init); + return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); +}; -const loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => { - const { signingName, logger } = configuration; - const envOptions = { signingName, logger }; - return propertyProvider.memoize(propertyProvider.chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue))); +const externalDataInterceptor = { + getFileRecord() { + return readFile.fileIntercept; + }, + interceptFile(path, contents) { + readFile.fileIntercept[path] = Promise.resolve(contents); + }, + getTokenRecord() { + return getSSOTokenFromFile.tokenIntercept; + }, + interceptToken(id, contents) { + getSSOTokenFromFile.tokenIntercept[id] = contents; + }, }; -exports.loadConfig = loadConfig; +exports.getSSOTokenFromFile = getSSOTokenFromFile.getSSOTokenFromFile; +exports.readFile = readFile.readFile; +exports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR; +exports.DEFAULT_PROFILE = DEFAULT_PROFILE; +exports.ENV_PROFILE = ENV_PROFILE; +exports.externalDataInterceptor = externalDataInterceptor; +exports.getProfileName = getProfileName; +exports.loadSharedConfigFiles = loadSharedConfigFiles; +exports.loadSsoSessionData = loadSsoSessionData; +exports.parseKnownFiles = parseKnownFiles; +Object.prototype.hasOwnProperty.call(getHomeDir, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: getHomeDir['__proto__'] + }); + +Object.keys(getHomeDir).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getHomeDir[k]; +}); +Object.prototype.hasOwnProperty.call(getSSOTokenFilepath, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: getSSOTokenFilepath['__proto__'] + }); + +Object.keys(getSSOTokenFilepath).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getSSOTokenFilepath[k]; +}); /***/ }), -/***/ 1279: +/***/ 6684: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.readFile = exports.fileIntercept = exports.filePromises = void 0; +const promises_1 = __nccwpck_require__(1455); +exports.filePromises = {}; +exports.fileIntercept = {}; +const readFile = (path, options) => { + if (exports.fileIntercept[path] !== undefined) { + return exports.fileIntercept[path]; + } + if (!exports.filePromises[path] || options?.ignoreCache) { + exports.filePromises[path] = (0, promises_1.readFile)(path, "utf8"); + } + return exports.filePromises[path]; +}; +exports.readFile = readFile; + + +/***/ }), + +/***/ 5118: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +var utilHexEncoding = __nccwpck_require__(6435); +var utilUtf8 = __nccwpck_require__(1577); +var isArrayBuffer = __nccwpck_require__(6130); var protocolHttp = __nccwpck_require__(2356); -var querystringBuilder = __nccwpck_require__(8256); -var http = __nccwpck_require__(8611); -var https = __nccwpck_require__(5692); -var stream = __nccwpck_require__(2203); -var http2 = __nccwpck_require__(5675); +var utilMiddleware = __nccwpck_require__(6324); +var utilUriEscape = __nccwpck_require__(146); -const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; +const ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; +const CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; +const AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; +const SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; +const EXPIRES_QUERY_PARAM = "X-Amz-Expires"; +const SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; +const TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; +const REGION_SET_PARAM = "X-Amz-Region-Set"; +const AUTH_HEADER = "authorization"; +const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); +const DATE_HEADER = "date"; +const GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; +const SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); +const SHA256_HEADER = "x-amz-content-sha256"; +const TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); +const HOST_HEADER = "host"; +const 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, +}; +const PROXY_HEADER_PATTERN = /^proxy-/; +const SEC_HEADER_PATTERN = /^sec-/; +const UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; +const ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; +const ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; +const EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; +const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; +const MAX_CACHE_SIZE = 50; +const KEY_TYPE_IDENTIFIER = "aws4_request"; +const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; -const getTransformedHeaders = (headers) => { - const transformedHeaders = {}; - for (const name of Object.keys(headers)) { - const headerValues = headers[name]; - transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; +const signingKeyCache = {}; +const cacheQueue = []; +const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`; +const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { + const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); + const cacheKey = `${shortDate}:${region}:${service}:${utilHexEncoding.toHex(credsHash)}:${credentials.sessionToken}`; + if (cacheKey in signingKeyCache) { + return signingKeyCache[cacheKey]; } - return transformedHeaders; + 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); }; - -const timing = { - setTimeout: (cb, ms) => setTimeout(cb, ms), - clearTimeout: (timeoutId) => clearTimeout(timeoutId), +const clearCredentialCache = () => { + cacheQueue.length = 0; + Object.keys(signingKeyCache).forEach((cacheKey) => { + delete signingKeyCache[cacheKey]; + }); +}; +const hmac = (ctor, secret, data) => { + const hash = new ctor(secret); + hash.update(utilUtf8.toUint8Array(data)); + return hash.digest(); }; -const DEFER_EVENT_LISTENER_TIME$2 = 1000; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return -1; - } - const registerTimeout = (offset) => { - const timeoutId = timing.setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { - name: "TimeoutError", - })); - }, timeoutInMs - offset); - const doWithSocket = (socket) => { - if (socket?.connecting) { - socket.on("connect", () => { - timing.clearTimeout(timeoutId); - }); - } - else { - timing.clearTimeout(timeoutId); +const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => { + const canonical = {}; + for (const headerName of Object.keys(headers).sort()) { + if (headers[headerName] == undefined) { + continue; + } + const canonicalHeaderName = headerName.toLowerCase(); + if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || + unsignableHeaders?.has(canonicalHeaderName) || + PROXY_HEADER_PATTERN.test(canonicalHeaderName) || + SEC_HEADER_PATTERN.test(canonicalHeaderName)) { + if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) { + continue; } - }; - if (request.socket) { - doWithSocket(request.socket); } - else { - request.on("socket", doWithSocket); + canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); + } + return canonical; +}; + +const getPayloadHash = async ({ headers, body }, hashConstructor) => { + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase() === SHA256_HEADER) { + return headers[headerName]; } - }; - if (timeoutInMs < 2000) { - registerTimeout(0); - return 0; } - return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2); + if (body == undefined) { + return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + } + else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer.isArrayBuffer(body)) { + const hashCtor = new hashConstructor(); + hashCtor.update(utilUtf8.toUint8Array(body)); + return utilHexEncoding.toHex(await hashCtor.digest()); + } + return UNSIGNED_PAYLOAD; }; -const setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => { - if (timeoutInMs) { - return timing.setTimeout(() => { - let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; - if (throwOnRequestTimeout) { - const error = Object.assign(new Error(msg), { - name: "TimeoutError", - code: "ETIMEDOUT", - }); - req.destroy(error); - reject(error); - } - else { - msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; - logger?.warn?.(msg); - } - }, timeoutInMs); +class HeaderFormatter { + format(headers) { + const chunks = []; + for (const headerName of Object.keys(headers)) { + const bytes = utilUtf8.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]); + case "byte": + return Uint8Array.from([2, header.value]); + case "short": + const shortView = new DataView(new ArrayBuffer(3)); + shortView.setUint8(0, 3); + shortView.setInt16(1, header.value, false); + return new Uint8Array(shortView.buffer); + case "integer": + const intView = new DataView(new ArrayBuffer(5)); + intView.setUint8(0, 4); + 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); + binView.setUint16(1, header.value.byteLength, false); + const binBytes = new Uint8Array(binView.buffer); + binBytes.set(header.value, 3); + return binBytes; + case "string": + const utf8Bytes = utilUtf8.fromUtf8(header.value); + const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); + strView.setUint8(0, 7); + 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(utilHexEncoding.fromHex(header.value.replace(/\-/g, "")), 1); + return uuidBytes; + } + } +} +const UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; +class Int64 { + bytes; + constructor(bytes) { + this.bytes = bytes; + if (bytes.byteLength !== 8) { + throw new Error("Int64 buffers must be exactly 8 bytes"); + } + } + static fromNumber(number) { + if (number > 9_223_372_036_854_775_807 || 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 Int64(bytes); + } + valueOf() { + const bytes = this.bytes.slice(0); + const negative = bytes[0] & 0b10000000; + if (negative) { + negate(bytes); + } + return parseInt(utilHexEncoding.toHex(bytes), 16) * (negative ? -1 : 1); + } + toString() { + return String(this.valueOf()); + } +} +function negate(bytes) { + for (let i = 0; i < 8; i++) { + bytes[i] ^= 0xff; + } + for (let i = 7; i > -1; i--) { + bytes[i]++; + if (bytes[i] !== 0) + break; } - return -1; -}; +} -const DEFER_EVENT_LISTENER_TIME$1 = 3000; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => { - if (keepAlive !== true) { - return -1; - } - const registerListener = () => { - if (request.socket) { - request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - } - else { - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); +const hasHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; } - }; - if (deferTimeMs === 0) { - registerListener(); - return 0; } - return timing.setTimeout(registerListener, deferTimeMs); + return false; }; -const DEFER_EVENT_LISTENER_TIME = 3000; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - const registerTimeout = (offset) => { - const timeout = timeoutInMs - offset; - const onTimeout = () => { - request.destroy(); - reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); - }; - if (request.socket) { - request.socket.setTimeout(timeout, onTimeout); - request.on("close", () => request.socket?.removeListener("timeout", onTimeout)); - } - else { - request.setTimeout(timeout, onTimeout); +const moveHeadersToQuery = (request, options = {}) => { + const { headers, query = {} } = protocolHttp.HttpRequest.clone(request); + for (const name of Object.keys(headers)) { + const lname = name.toLowerCase(); + if ((lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname)) || + options.hoistableHeaders?.has(lname)) { + query[name] = headers[name]; + delete headers[name]; } - }; - if (0 < timeoutInMs && timeoutInMs < 6000) { - registerTimeout(0); - return 0; } - return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); + return { + ...request, + headers, + query, + }; }; -const MIN_WAIT_TIME = 6_000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { - const headers = request.headers ?? {}; - const expect = headers.Expect || headers.expect; - let timeoutId = -1; - let sendBody = true; - if (!externalAgent && expect === "100-continue") { - sendBody = await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - timing.clearTimeout(timeoutId); - resolve(true); - }); - httpRequest.on("response", () => { - timing.clearTimeout(timeoutId); - resolve(false); - }); - httpRequest.on("error", () => { - timing.clearTimeout(timeoutId); - resolve(false); - }); - }), - ]); - } - if (sendBody) { - writeBody(httpRequest, request.body); - } -} -function writeBody(httpRequest, body) { - if (body instanceof 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; +const prepareRequest = (request) => { + request = protocolHttp.HttpRequest.clone(request); + for (const headerName of Object.keys(request.headers)) { + if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { + delete request.headers[headerName]; } - httpRequest.end(Buffer.from(body)); - return; } - httpRequest.end(); -} + return request; +}; -const DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - config; - configProvider; - socketWarningTimestamp = 0; - externalAgent = false; - metadata = { handlerProtocol: "http/1.1" }; - static create(instanceOrOptions) { - if (typeof instanceOrOptions?.handle === "function") { - return instanceOrOptions; +const getCanonicalQuery = ({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query)) { + if (key.toLowerCase() === SIGNATURE_HEADER) { + continue; } - return new NodeHttpHandler(instanceOrOptions); - } - static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { - const { sockets, requests, maxSockets } = agent; - if (typeof maxSockets !== "number" || maxSockets === Infinity) { - return socketWarningTimestamp; + const encodedKey = utilUriEscape.escapeUri(key); + keys.push(encodedKey); + const value = query[key]; + if (typeof value === "string") { + serialized[encodedKey] = `${encodedKey}=${utilUriEscape.escapeUri(value)}`; } - const interval = 15_000; - if (Date.now() - interval < socketWarningTimestamp) { - return socketWarningTimestamp; + else if (Array.isArray(value)) { + serialized[encodedKey] = value + .slice(0) + .reduce((encoded, value) => encoded.concat([`${encodedKey}=${utilUriEscape.escapeUri(value)}`]), []) + .sort() + .join("&"); } - if (sockets && requests) { - for (const origin in sockets) { - const socketsInUse = sockets[origin]?.length ?? 0; - const requestsEnqueued = requests[origin]?.length ?? 0; - if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { - logger?.warn?.(`@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 keys + .sort() + .map((key) => serialized[key]) + .filter((serialized) => serialized) + .join("&"); +}; + +const iso8601 = (time) => toDate(time) + .toISOString() + .replace(/\.\d{3}Z$/, "Z"); +const toDate = (time) => { + if (typeof time === "number") { + return new Date(time * 1000); + } + if (typeof time === "string") { + if (Number(time)) { + return new Date(Number(time) * 1000); } - return socketWarningTimestamp; + return new Date(time); } - constructor(options) { - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); + return time; +}; + +class SignatureV4Base { + service; + regionProvider; + credentialProvider; + sha256; + uriEscapePath; + applyChecksum; + constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { + this.service = service; + this.sha256 = sha256; + this.uriEscapePath = uriEscapePath; + this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; + this.regionProvider = utilMiddleware.normalizeProvider(region); + this.credentialProvider = utilMiddleware.normalizeProvider(credentials); } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout, - socketTimeout, - socketAcquisitionWarningTimeout, - throwOnRequestTimeout, - httpAgent: (() => { - if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") { - this.externalAgent = true; - return httpAgent; - } - return new http.Agent({ keepAlive, maxSockets, ...httpAgent }); - })(), - httpsAgent: (() => { - if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") { - this.externalAgent = true; - return httpsAgent; - } - return new https.Agent({ keepAlive, maxSockets, ...httpsAgent }); - })(), - logger: console, - }; + createCanonicalRequest(request, canonicalHeaders, payloadHash) { + const sortedHeaders = Object.keys(canonicalHeaders).sort(); + return `${request.method} +${this.getCanonicalPath(request)} +${getCanonicalQuery(request)} +${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} + +${sortedHeaders.join(";")} +${payloadHash}`; } - destroy() { - this.config?.httpAgent?.destroy(); - this.config?.httpsAgent?.destroy(); + async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) { + const hash = new this.sha256(); + hash.update(utilUtf8.toUint8Array(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${algorithmIdentifier} +${longDate} +${credentialScope} +${utilHexEncoding.toHex(hashedRequest)}`; } - async handle(request, { abortSignal, requestTimeout } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - const config = this.config; - let writeRequestBodyPromise = undefined; - const timeouts = []; - const resolve = async (arg) => { - await writeRequestBodyPromise; - timeouts.forEach(timing.clearTimeout); - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - timeouts.forEach(timing.clearTimeout); - _reject(arg); - }; - if (abortSignal?.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const headers = request.headers ?? {}; - const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; - let agent = isSSL ? config.httpsAgent : config.httpAgent; - if (expectContinue && !this.externalAgent) { - agent = new (isSSL ? https.Agent : http.Agent)({ - keepAlive: false, - maxSockets: Infinity, - }); - } - timeouts.push(timing.setTimeout(() => { - this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); - }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2000) + (config.connectionTimeout ?? 1000))); - const queryString = querystringBuilder.buildQueryString(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = request.username ?? ""; - const password = request.password ?? ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - let hostname = request.hostname ?? ""; - if (hostname[0] === "[" && hostname.endsWith("]")) { - hostname = request.hostname.slice(1, -1); - } - else { - hostname = request.hostname; - } - const nodeHttpsOptions = { - headers: request.headers, - host: hostname, - method: request.method, - path, - port: request.port, - agent, - auth, - }; - const requestFunc = isSSL ? https.request : http.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocolHttp.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 = () => { - req.destroy(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - if (typeof abortSignal.addEventListener === "function") { - const signal = abortSignal; - signal.addEventListener("abort", onAbort, { once: true }); - req.once("close", () => signal.removeEventListener("abort", onAbort)); + getCanonicalPath({ path }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path.split("/")) { + if (pathSegment?.length === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); } else { - abortSignal.onabort = onAbort; + normalizedPathSegments.push(pathSegment); } } - const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; - timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout)); - timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); - timeouts.push(setSocketTimeout(req, reject, config.socketTimeout)); - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - timeouts.push(setSocketKeepAlive(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - })); - } - writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e) => { - timeouts.forEach(timing.clearTimeout); - return _reject(e); - }); - }); + const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`; + const doubleEncoded = utilUriEscape.escapeUri(normalizedPath); + return doubleEncoded.replace(/%2F/g, "/"); + } + return path; } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); + validateResolvedCredentials(credentials) { + if (typeof credentials !== "object" || + typeof credentials.accessKeyId !== "string" || + typeof credentials.secretAccessKey !== "string") { + throw new Error("Resolved credential object is not valid"); + } } - httpHandlerConfigs() { - return this.config ?? {}; + formatDate(now) { + const longDate = iso8601(now).replace(/[\-:]/g, ""); + return { + longDate, + shortDate: longDate.slice(0, 8), + }; + } + getCanonicalHeaderList(headers) { + return Object.keys(headers).sort().join(";"); } } -class NodeHttp2ConnectionPool { - sessions = []; - constructor(sessions) { - this.sessions = sessions ?? []; +class SignatureV4 extends SignatureV4Base { + headerFormatter = new HeaderFormatter(); + constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { + super({ + applyChecksum, + credentials, + region, + service, + sha256, + uriEscapePath, + }); } - poll() { - if (this.sessions.length > 0) { - return this.sessions.shift(); + async presign(originalRequest, options = {}) { + const { signingDate = 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 } = this.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 scope = createScope(shortDate, region, signingService ?? this.service); + const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); + if (credentials.sessionToken) { + request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; } + request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; + request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; + request.query[AMZ_DATE_QUERY_PARAM] = longDate; + request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); + const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); + request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders); + request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); + return request; } - offerLast(session) { - this.sessions.push(session); + 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); + } } - contains(session) { - return this.sessions.includes(session); + async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) { + const region = signingRegion ?? (await this.regionProvider()); + const { shortDate, longDate } = this.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 = utilHexEncoding.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 = 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 }; + }); + } + async signString(stringToSign, { signingDate = new Date(), signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? (await this.regionProvider()); + const { shortDate } = this.formatDate(signingDate); + const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); + hash.update(utilUtf8.toUint8Array(stringToSign)); + return utilHexEncoding.toHex(await hash.digest()); } - remove(session) { - this.sessions = this.sessions.filter((s) => s !== session); + async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? (await this.regionProvider()); + const request = prepareRequest(requestToSign); + const { longDate, shortDate } = this.formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + request.headers[AMZ_DATE_HEADER] = longDate; + if (credentials.sessionToken) { + request.headers[TOKEN_HEADER] = credentials.sessionToken; + } + const payloadHash = await getPayloadHash(request, this.sha256); + if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) { + request.headers[SHA256_HEADER] = payloadHash; + } + const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); + const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); + request.headers[AUTH_HEADER] = + `${ALGORITHM_IDENTIFIER} ` + + `Credential=${credentials.accessKeyId}/${scope}, ` + + `SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, ` + + `Signature=${signature}`; + return request; } - [Symbol.iterator]() { - return this.sessions[Symbol.iterator](); + async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { + const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER); + const hash = new this.sha256(await keyPromise); + hash.update(utilUtf8.toUint8Array(stringToSign)); + return utilHexEncoding.toHex(await hash.digest()); } - destroy(connection) { - for (const session of this.sessions) { - if (session === connection) { - if (!session.destroyed) { - session.destroy(); - } - } - } + getSigningKey(credentials, region, shortDate, service) { + return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); } } -class NodeHttp2ConnectionManager { +const signatureV4aContainer = { + SignatureV4a: null, +}; + +exports.ALGORITHM_IDENTIFIER = ALGORITHM_IDENTIFIER; +exports.ALGORITHM_IDENTIFIER_V4A = ALGORITHM_IDENTIFIER_V4A; +exports.ALGORITHM_QUERY_PARAM = ALGORITHM_QUERY_PARAM; +exports.ALWAYS_UNSIGNABLE_HEADERS = ALWAYS_UNSIGNABLE_HEADERS; +exports.AMZ_DATE_HEADER = AMZ_DATE_HEADER; +exports.AMZ_DATE_QUERY_PARAM = AMZ_DATE_QUERY_PARAM; +exports.AUTH_HEADER = AUTH_HEADER; +exports.CREDENTIAL_QUERY_PARAM = CREDENTIAL_QUERY_PARAM; +exports.DATE_HEADER = DATE_HEADER; +exports.EVENT_ALGORITHM_IDENTIFIER = EVENT_ALGORITHM_IDENTIFIER; +exports.EXPIRES_QUERY_PARAM = EXPIRES_QUERY_PARAM; +exports.GENERATED_HEADERS = GENERATED_HEADERS; +exports.HOST_HEADER = HOST_HEADER; +exports.KEY_TYPE_IDENTIFIER = KEY_TYPE_IDENTIFIER; +exports.MAX_CACHE_SIZE = MAX_CACHE_SIZE; +exports.MAX_PRESIGNED_TTL = MAX_PRESIGNED_TTL; +exports.PROXY_HEADER_PATTERN = PROXY_HEADER_PATTERN; +exports.REGION_SET_PARAM = REGION_SET_PARAM; +exports.SEC_HEADER_PATTERN = SEC_HEADER_PATTERN; +exports.SHA256_HEADER = SHA256_HEADER; +exports.SIGNATURE_HEADER = SIGNATURE_HEADER; +exports.SIGNATURE_QUERY_PARAM = SIGNATURE_QUERY_PARAM; +exports.SIGNED_HEADERS_QUERY_PARAM = SIGNED_HEADERS_QUERY_PARAM; +exports.SignatureV4 = SignatureV4; +exports.SignatureV4Base = SignatureV4Base; +exports.TOKEN_HEADER = TOKEN_HEADER; +exports.TOKEN_QUERY_PARAM = TOKEN_QUERY_PARAM; +exports.UNSIGNABLE_PATTERNS = UNSIGNABLE_PATTERNS; +exports.UNSIGNED_PAYLOAD = UNSIGNED_PAYLOAD; +exports.clearCredentialCache = clearCredentialCache; +exports.createScope = createScope; +exports.getCanonicalHeaders = getCanonicalHeaders; +exports.getCanonicalQuery = getCanonicalQuery; +exports.getPayloadHash = getPayloadHash; +exports.getSigningKey = getSigningKey; +exports.hasHeader = hasHeader; +exports.moveHeadersToQuery = moveHeadersToQuery; +exports.prepareRequest = prepareRequest; +exports.signatureV4aContainer = signatureV4aContainer; + + +/***/ }), + +/***/ 1411: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var middlewareStack = __nccwpck_require__(9208); +var protocols = __nccwpck_require__(3422); +var types = __nccwpck_require__(690); +var schema = __nccwpck_require__(6890); +var serde = __nccwpck_require__(2430); + +class Client { + config; + middlewareStack = middlewareStack.constructStack(); + initConfig; + handlers; constructor(config) { this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); + const { protocol, protocolSettings } = config; + if (protocolSettings) { + if (typeof protocol === "function") { + config.protocol = new protocol(protocolSettings); + } } } - config; - sessionCache = new Map(); - lease(requestContext, connectionConfiguration) { - const url = this.getUrlString(requestContext); - const existingPool = this.sessionCache.get(url); - if (existingPool) { - const existingSession = existingPool.poll(); - if (existingSession && !this.config.disableConcurrency) { - return existingSession; + send(command, optionsOrCb, cb) { + const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; + const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; + const useHandlerCache = options === undefined && this.config.cacheMiddleware === true; + let handler; + if (useHandlerCache) { + if (!this.handlers) { + this.handlers = new WeakMap(); + } + const handlers = this.handlers; + if (handlers.has(command.constructor)) { + handler = handlers.get(command.constructor); + } + else { + handler = command.resolveMiddleware(this.middlewareStack, this.config, options); + handlers.set(command.constructor, handler); } } - const session = http2.connect(url); - 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 = () => { - session.destroy(); - this.deleteSession(url, session); - }; - session.on("goaway", destroySessionCb); - session.on("error", destroySessionCb); - session.on("frameError", destroySessionCb); - session.on("close", () => this.deleteSession(url, session)); - if (connectionConfiguration.requestTimeout) { - session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); + else { + delete this.handlers; + handler = command.resolveMiddleware(this.middlewareStack, this.config, options); } - const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool(); - connectionPool.offerLast(session); - this.sessionCache.set(url, connectionPool); - return session; - } - deleteSession(authority, session) { - const existingConnectionPool = this.sessionCache.get(authority); - if (!existingConnectionPool) { - return; + if (callback) { + handler(command) + .then((result) => callback(null, result.output), (err) => callback(err)) + .catch(() => { }); } - if (!existingConnectionPool.contains(session)) { - return; + else { + return handler(command).then((result) => result.output); } - existingConnectionPool.remove(session); - this.sessionCache.set(authority, existingConnectionPool); - } - release(requestContext, session) { - const cacheKey = this.getUrlString(requestContext); - this.sessionCache.get(cacheKey)?.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); - } + this.config?.requestHandler?.destroy?.(); + delete this.handlers; } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (maxConcurrentStreams && maxConcurrentStreams <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); +} + +const SENSITIVE_STRING$1 = "***SensitiveInformation***"; +function schemaLogFilter(schema$1, data) { + if (data == null) { + return data; + } + const ns = schema.NormalizedSchema.of(schema$1); + if (ns.getMergedTraits().sensitive) { + return SENSITIVE_STRING$1; + } + if (ns.isListSchema()) { + const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive; + if (isSensitive) { + return SENSITIVE_STRING$1; } - this.config.maxConcurrency = maxConcurrentStreams; } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; + else if (ns.isMapSchema()) { + const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive; + if (isSensitive) { + return SENSITIVE_STRING$1; + } } - getUrlString(request) { - return request.destination.toString(); + else if (ns.isStructSchema() && typeof data === "object") { + const object = data; + const newObject = {}; + for (const [member, memberNs] of ns.structIterator()) { + if (object[member] != null) { + newObject[member] = schemaLogFilter(memberNs, object[member]); + } + } + return newObject; } + return data; } -class NodeHttp2Handler { - config; - configProvider; - metadata = { handlerProtocol: "h2" }; - connectionManager = new NodeHttp2ConnectionManager({}); - static create(instanceOrOptions) { - if (typeof instanceOrOptions?.handle === "function") { - return instanceOrOptions; +class Command { + middlewareStack = middlewareStack.constructStack(); + schema; + static classBuilder() { + return new ClassBuilder(); + } + 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); } - return new NodeHttp2Handler(instanceOrOptions); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog, + outputFilterSensitiveLog, + [types.SMITHY_CONTEXT_KEY]: { + commandInstance: this, + ...smithyContext, + }, + ...additionalContext, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); } - constructor(options) { - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((opts) => { - resolve(opts || {}); - }) - .catch(reject); - } - else { - resolve(options || {}); - } - }); +} +class ClassBuilder { + _init = () => { }; + _ep = {}; + _middlewareFn = () => []; + _commandName = ""; + _clientName = ""; + _additionalContext = {}; + _smithyContext = {}; + _inputFilterSensitiveLog = undefined; + _outputFilterSensitiveLog = undefined; + _serializer = null; + _deserializer = null; + _operationSchema; + init(cb) { + this._init = cb; } - destroy() { - this.connectionManager.destroy(); + ep(endpointParameterInstructions) { + this._ep = endpointParameterInstructions; + return this; } - async handle(request, { abortSignal, requestTimeout } = {}) { - 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: configRequestTimeout, disableConcurrentStreams } = this.config; - const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; - return new Promise((_resolve, _reject) => { - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal?.aborted) { - fulfilled = true; - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const { hostname, method, port, protocol, query } = request; - let auth = ""; - if (request.username != null || request.password != null) { - const username = request.username ?? ""; - const password = request.password ?? ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: this.config?.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = querystringBuilder.buildQueryString(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2.constants.HTTP2_HEADER_PATH]: path, - [http2.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocolHttp.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 (effectiveRequestTimeout) { - req.setTimeout(effectiveRequestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - const onAbort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - 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, request, effectiveRequestTimeout); - }); + m(middlewareSupplier) { + this._middlewareFn = middlewareSupplier; + return this; } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); + s(service, operation, smithyContext = {}) { + this._smithyContext = { + service, + operation, + ...smithyContext, + }; + return this; } - httpHandlerConfigs() { - return this.config ?? {}; + c(additionalContext = {}) { + this._additionalContext = additionalContext; + return this; } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } + n(clientName, commandName) { + this._clientName = clientName; + this._commandName = commandName; + return this; } -} - -class Collector extends stream.Writable { - bufferedBytes = []; - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); + f(inputFilter = (_) => _, outputFilter = (_) => _) { + this._inputFilterSensitiveLog = inputFilter; + this._outputFilterSensitiveLog = outputFilter; + return this; } -} - -const streamCollector = (stream) => { - if (isReadableStreamInstance(stream)) { - return collectReadableStream(stream); + ser(serializer) { + this._serializer = serializer; + return this; } - 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); + de(deserializer) { + this._deserializer = deserializer; + return this; + } + sc(operation) { + this._operationSchema = operation; + this._smithyContext.operationSchema = operation; + return this; + } + build() { + const closure = this; + let CommandRef; + return (CommandRef = class extends Command { + input; + static getEndpointParameterInstructions() { + return closure._ep; + } + constructor(...[input]) { + super(); + this.input = input ?? {}; + closure._init(this); + this.schema = closure._operationSchema; + } + resolveMiddleware(stack, configuration, options) { + const op = closure._operationSchema; + const input = op?.[4] ?? op?.input; + const output = op?.[5] ?? op?.output; + return this.resolveMiddlewareWithContext(stack, configuration, options, { + CommandCtor: CommandRef, + middlewareFn: closure._middlewareFn, + clientName: closure._clientName, + commandName: closure._commandName, + inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_) => _), + outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_) => _), + smithyContext: closure._smithyContext, + additionalContext: closure._additionalContext, + }); + } + serialize = closure._serializer; + deserialize = closure._deserializer; }); - }); -}; -const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream; -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; } -exports.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; -exports.NodeHttp2Handler = NodeHttp2Handler; -exports.NodeHttpHandler = NodeHttpHandler; -exports.streamCollector = streamCollector; - - -/***/ }), - -/***/ 8857: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - +const SENSITIVE_STRING = "***SensitiveInformation***"; -class ProviderError extends Error { - name = "ProviderError"; - tryNextLink; - constructor(message, options = true) { - let logger; - let tryNextLink = true; - if (typeof options === "boolean") { - logger = undefined; - tryNextLink = options; - } - else if (options != null && typeof options === "object") { - logger = options.logger; - tryNextLink = options.tryNextLink ?? true; - } - super(message); - this.tryNextLink = tryNextLink; - Object.setPrototypeOf(this, ProviderError.prototype); - logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); +const createAggregatedClient = (commands, Client, options) => { + for (const [command, CommandCtor] of Object.entries(commands)) { + const methodImpl = async function (args, optionsOrCb, cb) { + const command = new CommandCtor(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expected http options but got ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + }; + const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); + Client.prototype[methodName] = methodImpl; } - static from(error, options = true) { - return Object.assign(new this(error.message, options), error); + const { paginators = {}, waiters = {} } = options ?? {}; + for (const [paginatorName, paginatorFn] of Object.entries(paginators)) { + if (Client.prototype[paginatorName] === void 0) { + Client.prototype[paginatorName] = function (commandInput = {}, paginationConfiguration, ...rest) { + return paginatorFn({ + ...paginationConfiguration, + client: this, + }, commandInput, ...rest); + }; + } } -} - -class CredentialsProviderError extends ProviderError { - name = "CredentialsProviderError"; - constructor(message, options = true) { - super(message, options); - Object.setPrototypeOf(this, CredentialsProviderError.prototype); + for (const [waiterName, waiterFn] of Object.entries(waiters)) { + if (Client.prototype[waiterName] === void 0) { + Client.prototype[waiterName] = async function (commandInput = {}, waiterConfiguration, ...rest) { + let config = waiterConfiguration; + if (typeof waiterConfiguration === "number") { + config = { + maxWaitTime: waiterConfiguration, + }; + } + return waiterFn({ + ...config, + client: this, + }, commandInput, ...rest); + }; + } } -} +}; -class TokenProviderError extends ProviderError { - name = "TokenProviderError"; - constructor(message, options = true) { - super(message, options); - Object.setPrototypeOf(this, TokenProviderError.prototype); +class ServiceException extends Error { + $fault; + $response; + $retryable; + $metadata; + constructor(options) { + super(options.message); + Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype); + this.name = options.name; + this.$fault = options.$fault; + this.$metadata = options.$metadata; } -} - -const chain = (...providers) => async () => { - if (providers.length === 0) { - throw new ProviderError("No providers in chain"); + static isInstance(value) { + if (!value) + return false; + const candidate = value; + return (ServiceException.prototype.isPrototypeOf(candidate) || + (Boolean(candidate.$fault) && + Boolean(candidate.$metadata) && + (candidate.$fault === "client" || candidate.$fault === "server"))); } - let lastProviderError; - for (const provider of providers) { - try { - const credentials = await provider(); - return credentials; + static [Symbol.hasInstance](instance) { + if (!instance) + return false; + const candidate = instance; + if (this === ServiceException) { + return ServiceException.isInstance(instance); } - catch (err) { - lastProviderError = err; - if (err?.tryNextLink) { - continue; + if (ServiceException.isInstance(instance)) { + if (candidate.name && this.name) { + return this.prototype.isPrototypeOf(instance) || candidate.name === this.name; } - throw err; + return this.prototype.isPrototypeOf(instance); } + return false; } - throw lastProviderError; +} +const decorateServiceException = (exception, additions = {}) => { + Object.entries(additions) + .filter(([, v]) => v !== undefined) + .forEach(([k, v]) => { + if (exception[k] == undefined || exception[k] === "") { + exception[k] = v; + } + }); + const message = exception.message || exception.Message || "UnknownError"; + exception.message = message; + delete exception.Message; + return exception; }; -const fromStatic = (staticValue) => () => Promise.resolve(staticValue); - -const memoize = (provider, isExpired, requiresRefresh) => { - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = async () => { - if (!pending) { - pending = provider(); - } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } - finally { - pending = undefined; - } - return resolved; - }; - if (isExpired === undefined) { - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(); - } - return resolved; - }; - } - return async (options) => { - if (!hasResult || 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; +const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + const response = new exceptionCtor({ + name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError", + $fault: "client", + $metadata, + }); + throw decorateServiceException(response, parsedBody); +}; +const withBaseException = (ExceptionCtor) => { + return ({ output, parsedBody, errorCode }) => { + throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); }; }; +const deserializeMetadata = (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"], +}); -exports.CredentialsProviderError = CredentialsProviderError; -exports.ProviderError = ProviderError; -exports.TokenProviderError = TokenProviderError; -exports.chain = chain; -exports.fromStatic = fromStatic; -exports.memoize = memoize; - - -/***/ }), - -/***/ 2356: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - +const loadConfigsForDefaultMode = (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: 30000, + }; + default: + return {}; + } +}; -var types = __nccwpck_require__(690); +let warningEmitted = false; +const emitWarningIfUnsupportedVersion = (version) => { + if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) { + warningEmitted = true; + } +}; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { +const knownAlgorithms = Object.values(types.AlgorithmId); +const getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + for (const id in types.AlgorithmId) { + const algorithmId = types.AlgorithmId[id]; + if (runtimeConfig[algorithmId] === undefined) { + continue; + } + checksumAlgorithms.push({ + algorithmId: () => algorithmId, + checksumConstructor: () => runtimeConfig[algorithmId], + }); + } + for (const [id, ChecksumCtor] of Object.entries(runtimeConfig.checksumAlgorithms ?? {})) { + checksumAlgorithms.push({ + algorithmId: () => id, + checksumConstructor: () => ChecksumCtor, + }); + } return { - setHttpHandler(handler) { - runtimeConfig.httpHandler = handler; - }, - httpHandler() { - return runtimeConfig.httpHandler; - }, - updateHttpClientConfig(key, value) { - runtimeConfig.httpHandler?.updateHttpClientConfig(key, value); + addChecksumAlgorithm(algo) { + runtimeConfig.checksumAlgorithms = runtimeConfig.checksumAlgorithms ?? {}; + const id = algo.algorithmId(); + const ctor = algo.checksumConstructor(); + if (knownAlgorithms.includes(id)) { + runtimeConfig.checksumAlgorithms[id.toUpperCase()] = ctor; + } + else { + runtimeConfig.checksumAlgorithms[id] = ctor; + } + checksumAlgorithms.push(algo); }, - httpHandlerConfigs() { - return runtimeConfig.httpHandler.httpHandlerConfigs(); + checksumAlgorithms() { + return checksumAlgorithms; }, }; }; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { +const resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + const id = checksumAlgorithm.algorithmId(); + if (knownAlgorithms.includes(id)) { + runtimeConfig[id] = checksumAlgorithm.checksumConstructor(); + } + }); + return runtimeConfig; +}; + +const getRetryConfiguration = (runtimeConfig) => { return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), + setRetryStrategy(retryStrategy) { + runtimeConfig.retryStrategy = retryStrategy; + }, + retryStrategy() { + return runtimeConfig.retryStrategy; + }, }; }; +const resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { + const runtimeConfig = {}; + runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); + return runtimeConfig; +}; -class Field { - name; - kind; - values; - constructor({ name, kind = types.FieldPosition.HEADER, values = [] }) { - this.name = name; - this.kind = kind; - this.values = values; - } - add(value) { - this.values.push(value); - } - set(values) { - this.values = values; - } - remove(value) { - this.values = this.values.filter((v) => v !== value); - } - toString() { - return this.values.map((v) => (v.includes(",") || v.includes(" ") ? `"${v}"` : v)).join(", "); - } - get() { - return this.values; - } -} +const getDefaultExtensionConfiguration = (runtimeConfig) => { + return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig)); +}; +const getDefaultClientConfiguration = getDefaultExtensionConfiguration; +const resolveDefaultRuntimeConfig = (config) => { + return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config)); +}; -class Fields { - entries = {}; - encoding; - constructor({ fields = [], encoding = "utf-8" }) { - fields.forEach(this.setField.bind(this)); - this.encoding = encoding; - } - setField(field) { - this.entries[field.name.toLowerCase()] = field; - } - getField(name) { - return this.entries[name.toLowerCase()]; - } - removeField(name) { - delete this.entries[name.toLowerCase()]; - } - getByType(kind) { - return Object.values(this.entries).filter((field) => field.kind === kind); - } -} +const getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; -class HttpRequest { - method; - protocol; - hostname; - port; - path; - query; - headers; - username; - password; - fragment; - body; - 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; - } - static clone(request) { - const cloned = new HttpRequest({ - ...request, - headers: { ...request.headers }, - }); - if (cloned.query) { - cloned.query = cloneQuery(cloned.query); +const getValueFromTextNode = (obj) => { + const textNodeName = "#text"; + for (const key in obj) { + if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { + obj[key] = obj[key][textNodeName]; } - return cloned; - } - static isInstance(request) { - if (!request) { - return false; + else if (typeof obj[key] === "object" && obj[key] !== null) { + obj[key] = getValueFromTextNode(obj[key]); } - const req = request; - return ("method" in req && - "protocol" in req && - "hostname" in req && - "path" in req && - typeof req["query"] === "object" && - typeof req["headers"] === "object"); - } - clone() { - return HttpRequest.clone(this); } -} -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} + return obj; +}; -class HttpResponse { - statusCode; - reason; - headers; - body; - 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"; - } -} +const isSerializableHeaderValue = (value) => { + return value != null; +}; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); +class NoOpLogger { + trace() { } + debug() { } + info() { } + warn() { } + error() { } } -exports.Field = Field; -exports.Fields = Fields; -exports.HttpRequest = HttpRequest; -exports.HttpResponse = HttpResponse; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -exports.isValidHostname = isValidHostname; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 8256: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var utilUriEscape = __nccwpck_require__(146); - -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = utilUriEscape.escapeUri(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${utilUriEscape.escapeUri(value[i])}`); - } +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 { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${utilUriEscape.escapeUri(value)}`; - } - parts.push(qsEntry); + instructions = arg1; } } - return parts.join("&"); + for (const key of Object.keys(instructions)) { + if (!Array.isArray(instructions[key])) { + target[key] = instructions[key]; + continue; + } + applyInstruction(target, null, instructions, key); + } + return target; } - -exports.buildQueryString = buildQueryString; - - -/***/ }), - -/***/ 8822: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -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); +const convertMap = (target) => { + const output = {}; + for (const [k, v] of Object.entries(target || {})) { + output[k] = [, v]; + } + return output; +}; +const take = (source, instructions) => { + const out = {}; + for (const key in instructions) { + applyInstruction(out, source, instructions, key); + } + return out; +}; +const mapWithFilter = (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 { - query[key] = [query[key], value]; + _instructions[key] = [filter, value]; } } + return _instructions; + }, {})); +}; +const applyInstruction = (target, source, instructions, targetKey) => { + if (source !== null) { + let instruction = instructions[targetKey]; + if (typeof instruction === "function") { + instruction = [, instruction]; + } + const [filter = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; + if ((typeof filter === "function" && filter(source[sourceKey])) || (typeof filter !== "function" && !!filter)) { + target[targetKey] = valueFn(source[sourceKey]); + } + return; } - return query; -} - -exports.parseQueryString = parseQueryString; - - -/***/ }), - -/***/ 2058: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -const CLOCK_SKEW_ERROR_CODES = [ - "AuthFailure", - "InvalidSignatureException", - "RequestExpired", - "RequestInTheFuture", - "RequestTimeTooSkewed", - "SignatureDoesNotMatch", -]; -const THROTTLING_ERROR_CODES = [ - "BandwidthLimitExceeded", - "EC2ThrottledException", - "LimitExceededException", - "PriorRequestNotComplete", - "ProvisionedThroughputExceededException", - "RequestLimitExceeded", - "RequestThrottled", - "RequestThrottledException", - "SlowDown", - "ThrottledException", - "Throttling", - "ThrottlingException", - "TooManyRequestsException", - "TransactionInProgressException", -]; -const TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; -const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; -const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; -const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"]; - -const isRetryableByTrait = (error) => error?.$retryable !== undefined; -const isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name); -const isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCorrected; -const isBrowserNetworkError = (error) => { - const errorMessages = new Set([ - "Failed to fetch", - "NetworkError when attempting to fetch resource", - "The Internet connection appears to be offline", - "Load failed", - "Network request failed", - ]); - const isValid = error && error instanceof TypeError; - if (!isValid) { - return false; + let [filter, value] = instructions[targetKey]; + if (typeof value === "function") { + let _value; + const defaultFilterPassed = filter === undefined && (_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(); + } } - return errorMessages.has(error.message); -}; -const isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 || - THROTTLING_ERROR_CODES.includes(error.name) || - error.$retryable?.throttling == true; -const isTransientError = (error, depth = 0) => isRetryableByTrait(error) || - isClockSkewCorrectedError(error) || - TRANSIENT_ERROR_CODES.includes(error.name) || - NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || - NODEJS_NETWORK_ERROR_CODES.includes(error?.code || "") || - TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || - isBrowserNetworkError(error) || - (error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1)); -const isServerError = (error) => { - if (error.$metadata?.httpStatusCode !== undefined) { - const statusCode = error.$metadata.httpStatusCode; - if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) { - return true; + else { + const defaultFilterPassed = filter === undefined && value != null; + const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter); + if (defaultFilterPassed || customFilterPassed) { + target[targetKey] = value; } - return false; } - return false; }; +const nonNullish = (_) => _ != null; +const pass = (_) => _; -exports.isBrowserNetworkError = isBrowserNetworkError; -exports.isClockSkewCorrectedError = isClockSkewCorrectedError; -exports.isClockSkewError = isClockSkewError; -exports.isRetryableByTrait = isRetryableByTrait; -exports.isServerError = isServerError; -exports.isThrottlingError = isThrottlingError; -exports.isTransientError = isTransientError; - - -/***/ }), - -/***/ 4172: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHomeDir = void 0; -const os_1 = __nccwpck_require__(857); -const path_1 = __nccwpck_require__(6928); -const homeDirCache = {}; -const getHomeDirCacheKey = () => { - if (process && process.geteuid) { - return `${process.geteuid()}`; +const serializeFloat = (value) => { + if (value !== value) { + return "NaN"; + } + switch (value) { + case Infinity: + return "Infinity"; + case -Infinity: + return "-Infinity"; + default: + return value; } - return "DEFAULT"; -}; -const getHomeDir = () => { - 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]; }; -exports.getHomeDir = getHomeDir; - - -/***/ }), - -/***/ 269: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +const serializeDateTime = (date) => date.toISOString().replace(".000Z", "Z"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSSOTokenFilepath = void 0; -const crypto_1 = __nccwpck_require__(6982); -const path_1 = __nccwpck_require__(6928); -const getHomeDir_1 = __nccwpck_require__(4172); -const getSSOTokenFilepath = (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`); +const _json = (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; + } + target[key] = _json(obj[key]); + } + return target; + } + return obj; }; -exports.getSSOTokenFilepath = getSSOTokenFilepath; +exports.collectBody = protocols.collectBody; +exports.extendedEncodeURIComponent = protocols.extendedEncodeURIComponent; +exports.resolvedPath = protocols.resolvedPath; +exports.Client = Client; +exports.Command = Command; +exports.NoOpLogger = NoOpLogger; +exports.SENSITIVE_STRING = SENSITIVE_STRING; +exports.ServiceException = ServiceException; +exports._json = _json; +exports.convertMap = convertMap; +exports.createAggregatedClient = createAggregatedClient; +exports.decorateServiceException = decorateServiceException; +exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; +exports.getArrayIfSingleItem = getArrayIfSingleItem; +exports.getDefaultClientConfiguration = getDefaultClientConfiguration; +exports.getDefaultExtensionConfiguration = getDefaultExtensionConfiguration; +exports.getValueFromTextNode = getValueFromTextNode; +exports.isSerializableHeaderValue = isSerializableHeaderValue; +exports.loadConfigsForDefaultMode = loadConfigsForDefaultMode; +exports.map = map; +exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; +exports.serializeDateTime = serializeDateTime; +exports.serializeFloat = serializeFloat; +exports.take = take; +exports.throwDefaultError = throwDefaultError; +exports.withBaseException = withBaseException; +Object.prototype.hasOwnProperty.call(serde, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: serde['__proto__'] + }); -/***/ }), - -/***/ 1326: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSSOTokenFromFile = exports.tokenIntercept = void 0; -const promises_1 = __nccwpck_require__(1943); -const getSSOTokenFilepath_1 = __nccwpck_require__(269); -exports.tokenIntercept = {}; -const getSSOTokenFromFile = async (id) => { - if (exports.tokenIntercept[id]) { - return exports.tokenIntercept[id]; - } - const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); - const ssoTokenText = await (0, promises_1.readFile)(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); -}; -exports.getSSOTokenFromFile = getSSOTokenFromFile; +Object.keys(serde).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = serde[k]; +}); /***/ }), -/***/ 4964: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 690: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var getHomeDir = __nccwpck_require__(4172); -var getSSOTokenFilepath = __nccwpck_require__(269); -var getSSOTokenFromFile = __nccwpck_require__(1326); -var path = __nccwpck_require__(6928); -var types = __nccwpck_require__(690); -var readFile = __nccwpck_require__(6684); - -const ENV_PROFILE = "AWS_PROFILE"; -const DEFAULT_PROFILE = "default"; -const getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; - -const CONFIG_PREFIX_SEPARATOR = "."; - -const getConfigData = (data) => Object.entries(data) - .filter(([key]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - if (indexOfSeparator === -1) { - return false; - } - return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator)); -}) - .reduce((acc, [key, value]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; - acc[updatedKey] = value; - return acc; -}, { - ...(data.default && { default: data.default }), -}); - -const ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; -const getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path.join(getHomeDir.getHomeDir(), ".aws", "config"); +exports.HttpAuthLocation = void 0; +(function (HttpAuthLocation) { + HttpAuthLocation["HEADER"] = "header"; + HttpAuthLocation["QUERY"] = "query"; +})(exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); -const ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; -const getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path.join(getHomeDir.getHomeDir(), ".aws", "credentials"); +exports.HttpApiKeyAuthLocation = void 0; +(function (HttpApiKeyAuthLocation) { + HttpApiKeyAuthLocation["HEADER"] = "header"; + HttpApiKeyAuthLocation["QUERY"] = "query"; +})(exports.HttpApiKeyAuthLocation || (exports.HttpApiKeyAuthLocation = {})); -const prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; -const profileNameBlockList = ["__proto__", "profile __proto__"]; -const parseIni = (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 = undefined; - currentSubSection = undefined; - const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); - const matches = prefixKeyRegex.exec(sectionName); - if (matches) { - const [, prefix, , name] = matches; - if (Object.values(types.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 = undefined; - } - map[currentSection] = map[currentSection] || {}; - const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; - map[currentSection][key] = value; - } - } - } - } - return map; -}; +exports.EndpointURLScheme = void 0; +(function (EndpointURLScheme) { + EndpointURLScheme["HTTP"] = "http"; + EndpointURLScheme["HTTPS"] = "https"; +})(exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); -const swallowError$1 = () => ({}); -const loadSharedConfigFiles = async (init = {}) => { - const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; - const homeDir = getHomeDir.getHomeDir(); - const relativeHomeDirPrefix = "~/"; - let resolvedFilepath = filepath; - if (filepath.startsWith(relativeHomeDirPrefix)) { - resolvedFilepath = path.join(homeDir, filepath.slice(2)); +exports.AlgorithmId = void 0; +(function (AlgorithmId) { + AlgorithmId["MD5"] = "md5"; + AlgorithmId["CRC32"] = "crc32"; + AlgorithmId["CRC32C"] = "crc32c"; + AlgorithmId["SHA1"] = "sha1"; + AlgorithmId["SHA256"] = "sha256"; +})(exports.AlgorithmId || (exports.AlgorithmId = {})); +const getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== undefined) { + checksumAlgorithms.push({ + algorithmId: () => exports.AlgorithmId.SHA256, + checksumConstructor: () => runtimeConfig.sha256, + }); } - let resolvedConfigFilepath = configFilepath; - if (configFilepath.startsWith(relativeHomeDirPrefix)) { - resolvedConfigFilepath = path.join(homeDir, configFilepath.slice(2)); + if (runtimeConfig.md5 != undefined) { + checksumAlgorithms.push({ + algorithmId: () => exports.AlgorithmId.MD5, + checksumConstructor: () => runtimeConfig.md5, + }); } - const parsedFiles = await Promise.all([ - readFile.readFile(resolvedConfigFilepath, { - ignoreCache: init.ignoreCache, - }) - .then(parseIni) - .then(getConfigData) - .catch(swallowError$1), - readFile.readFile(resolvedFilepath, { - ignoreCache: init.ignoreCache, - }) - .then(parseIni) - .catch(swallowError$1), - ]); return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1], + addChecksumAlgorithm(algo) { + checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return checksumAlgorithms; + }, }; }; +const resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}; + +const getDefaultClientConfiguration = (runtimeConfig) => { + return getChecksumConfiguration(runtimeConfig); +}; +const resolveDefaultRuntimeConfig = (config) => { + return resolveChecksumRuntimeConfig(config); +}; + +exports.FieldPosition = void 0; +(function (FieldPosition) { + FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; + FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; +})(exports.FieldPosition || (exports.FieldPosition = {})); + +const SMITHY_CONTEXT_KEY = "__smithy_context"; + +exports.IniSectionType = void 0; +(function (IniSectionType) { + IniSectionType["PROFILE"] = "profile"; + IniSectionType["SSO_SESSION"] = "sso-session"; + IniSectionType["SERVICES"] = "services"; +})(exports.IniSectionType || (exports.IniSectionType = {})); + +exports.RequestHandlerProtocol = void 0; +(function (RequestHandlerProtocol) { + RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; +})(exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); + +exports.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY; +exports.getDefaultClientConfiguration = getDefaultClientConfiguration; +exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; -const getSsoSessionData = (data) => Object.entries(data) - .filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)) - .reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}); -const swallowError = () => ({}); -const loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath()) - .then(parseIni) - .then(getSsoSessionData) - .catch(swallowError); +/***/ }), -const mergeConfigFiles = (...files) => { - const merged = {}; - for (const file of files) { - for (const [key, values] of Object.entries(file)) { - if (merged[key] !== undefined) { - Object.assign(merged[key], values); - } - else { - merged[key] = values; - } - } - } - return merged; -}; +/***/ 4494: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const parseKnownFiles = async (init) => { - const parsedFiles = await loadSharedConfigFiles(init); - return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); -}; +"use strict"; -const externalDataInterceptor = { - getFileRecord() { - return readFile.fileIntercept; - }, - interceptFile(path, contents) { - readFile.fileIntercept[path] = Promise.resolve(contents); - }, - getTokenRecord() { - return getSSOTokenFromFile.tokenIntercept; - }, - interceptToken(id, contents) { - getSSOTokenFromFile.tokenIntercept[id] = contents; - }, + +var querystringParser = __nccwpck_require__(8822); + +const parseUrl = (url) => { + if (typeof url === "string") { + return parseUrl(new URL(url)); + } + const { hostname, pathname, port, protocol, search } = url; + let query; + if (search) { + query = querystringParser.parseQueryString(search); + } + return { + hostname, + port: port ? parseInt(port) : undefined, + protocol, + path: pathname, + query, + }; }; -Object.defineProperty(exports, "getSSOTokenFromFile", ({ - enumerable: true, - get: function () { return getSSOTokenFromFile.getSSOTokenFromFile; } -})); -Object.defineProperty(exports, "readFile", ({ - enumerable: true, - get: function () { return readFile.readFile; } -})); -exports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR; -exports.DEFAULT_PROFILE = DEFAULT_PROFILE; -exports.ENV_PROFILE = ENV_PROFILE; -exports.externalDataInterceptor = externalDataInterceptor; -exports.getProfileName = getProfileName; -exports.loadSharedConfigFiles = loadSharedConfigFiles; -exports.loadSsoSessionData = loadSsoSessionData; -exports.parseKnownFiles = parseKnownFiles; -Object.keys(getHomeDir).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return getHomeDir[k]; } - }); -}); -Object.keys(getSSOTokenFilepath).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return getSSOTokenFilepath[k]; } - }); -}); +exports.parseUrl = parseUrl; /***/ }), -/***/ 6684: +/***/ 2674: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readFile = exports.fileIntercept = exports.filePromises = void 0; -const promises_1 = __nccwpck_require__(1455); -exports.filePromises = {}; -exports.fileIntercept = {}; -const readFile = (path, options) => { - if (exports.fileIntercept[path] !== undefined) { - return exports.fileIntercept[path]; +exports.fromBase64 = void 0; +const util_buffer_from_1 = __nccwpck_require__(4151); +const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; +const fromBase64 = (input) => { + if ((input.length * 3) % 4 !== 0) { + throw new TypeError(`Incorrect padding on base64 string.`); } - if (!exports.filePromises[path] || options?.ignoreCache) { - exports.filePromises[path] = (0, promises_1.readFile)(path, "utf8"); + if (!BASE64_REGEX.exec(input)) { + throw new TypeError(`Invalid base64 string.`); } - return exports.filePromises[path]; + const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); }; -exports.readFile = readFile; +exports.fromBase64 = fromBase64; /***/ }), -/***/ 5118: +/***/ 8385: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var utilHexEncoding = __nccwpck_require__(6435); -var utilUtf8 = __nccwpck_require__(1577); -var isArrayBuffer = __nccwpck_require__(6130); -var protocolHttp = __nccwpck_require__(2356); -var utilMiddleware = __nccwpck_require__(6324); -var utilUriEscape = __nccwpck_require__(146); +var fromBase64 = __nccwpck_require__(2674); +var toBase64 = __nccwpck_require__(4871); -const ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; -const CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; -const AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; -const SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; -const EXPIRES_QUERY_PARAM = "X-Amz-Expires"; -const SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; -const TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; -const REGION_SET_PARAM = "X-Amz-Region-Set"; -const AUTH_HEADER = "authorization"; -const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); -const DATE_HEADER = "date"; -const GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; -const SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); -const SHA256_HEADER = "x-amz-content-sha256"; -const TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); -const HOST_HEADER = "host"; -const 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, -}; -const PROXY_HEADER_PATTERN = /^proxy-/; -const SEC_HEADER_PATTERN = /^sec-/; -const UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; -const ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; -const ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; -const EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; -const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; -const MAX_CACHE_SIZE = 50; -const KEY_TYPE_IDENTIFIER = "aws4_request"; -const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; -const signingKeyCache = {}; -const cacheQueue = []; -const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`; -const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { - const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); - const cacheKey = `${shortDate}:${region}:${service}:${utilHexEncoding.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); -}; -const clearCredentialCache = () => { - cacheQueue.length = 0; - Object.keys(signingKeyCache).forEach((cacheKey) => { - delete signingKeyCache[cacheKey]; - }); -}; -const hmac = (ctor, secret, data) => { - const hash = new ctor(secret); - hash.update(utilUtf8.toUint8Array(data)); - return hash.digest(); -}; -const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => { - const canonical = {}; - for (const headerName of Object.keys(headers).sort()) { - if (headers[headerName] == undefined) { - continue; - } - const canonicalHeaderName = headerName.toLowerCase(); - if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || - 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; -}; +Object.prototype.hasOwnProperty.call(fromBase64, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: fromBase64['__proto__'] + }); -const getPayloadHash = async ({ headers, body }, hashConstructor) => { - for (const headerName of Object.keys(headers)) { - if (headerName.toLowerCase() === SHA256_HEADER) { - return headers[headerName]; - } - } - if (body == undefined) { - return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; - } - else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer.isArrayBuffer(body)) { - const hashCtor = new hashConstructor(); - hashCtor.update(utilUtf8.toUint8Array(body)); - return utilHexEncoding.toHex(await hashCtor.digest()); - } - return UNSIGNED_PAYLOAD; -}; +Object.keys(fromBase64).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = fromBase64[k]; +}); +Object.prototype.hasOwnProperty.call(toBase64, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: toBase64['__proto__'] + }); -class HeaderFormatter { - format(headers) { - const chunks = []; - for (const headerName of Object.keys(headers)) { - const bytes = utilUtf8.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]); - case "byte": - return Uint8Array.from([2, header.value]); - case "short": - const shortView = new DataView(new ArrayBuffer(3)); - shortView.setUint8(0, 3); - shortView.setInt16(1, header.value, false); - return new Uint8Array(shortView.buffer); - case "integer": - const intView = new DataView(new ArrayBuffer(5)); - intView.setUint8(0, 4); - 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); - binView.setUint16(1, header.value.byteLength, false); - const binBytes = new Uint8Array(binView.buffer); - binBytes.set(header.value, 3); - return binBytes; - case "string": - const utf8Bytes = utilUtf8.fromUtf8(header.value); - const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); - strView.setUint8(0, 7); - 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(utilHexEncoding.fromHex(header.value.replace(/\-/g, "")), 1); - return uuidBytes; - } - } -} -const UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; -class Int64 { - bytes; - constructor(bytes) { - this.bytes = bytes; - if (bytes.byteLength !== 8) { - throw new Error("Int64 buffers must be exactly 8 bytes"); - } - } - static fromNumber(number) { - if (number > 9_223_372_036_854_775_807 || 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 Int64(bytes); - } - valueOf() { - const bytes = this.bytes.slice(0); - const negative = bytes[0] & 0b10000000; - if (negative) { - negate(bytes); - } - return parseInt(utilHexEncoding.toHex(bytes), 16) * (negative ? -1 : 1); - } - toString() { - return String(this.valueOf()); - } -} -function negate(bytes) { - for (let i = 0; i < 8; i++) { - bytes[i] ^= 0xff; - } - for (let i = 7; i > -1; i--) { - bytes[i]++; - if (bytes[i] !== 0) - break; - } -} +Object.keys(toBase64).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = toBase64[k]; +}); -const hasHeader = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return true; - } - } - return false; -}; -const moveHeadersToQuery = (request, options = {}) => { - const { headers, query = {} } = protocolHttp.HttpRequest.clone(request); - for (const name of Object.keys(headers)) { - const lname = name.toLowerCase(); - if ((lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname)) || - options.hoistableHeaders?.has(lname)) { - query[name] = headers[name]; - delete headers[name]; - } - } - return { - ...request, - headers, - query, - }; -}; +/***/ }), -const prepareRequest = (request) => { - request = protocolHttp.HttpRequest.clone(request); - for (const headerName of Object.keys(request.headers)) { - if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { - delete request.headers[headerName]; - } - } - return request; -}; +/***/ 4871: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const getCanonicalQuery = ({ query = {} }) => { - const keys = []; - const serialized = {}; - for (const key of Object.keys(query)) { - if (key.toLowerCase() === SIGNATURE_HEADER) { - continue; - } - const encodedKey = utilUriEscape.escapeUri(key); - keys.push(encodedKey); - const value = query[key]; - if (typeof value === "string") { - serialized[encodedKey] = `${encodedKey}=${utilUriEscape.escapeUri(value)}`; - } - else if (Array.isArray(value)) { - serialized[encodedKey] = value - .slice(0) - .reduce((encoded, value) => encoded.concat([`${encodedKey}=${utilUriEscape.escapeUri(value)}`]), []) - .sort() - .join("&"); - } - } - return keys - .sort() - .map((key) => serialized[key]) - .filter((serialized) => serialized) - .join("&"); -}; +"use strict"; -const iso8601 = (time) => toDate(time) - .toISOString() - .replace(/\.\d{3}Z$/, "Z"); -const toDate = (time) => { - if (typeof time === "number") { - return new Date(time * 1000); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toBase64 = void 0; +const util_buffer_from_1 = __nccwpck_require__(4151); +const util_utf8_1 = __nccwpck_require__(1577); +const toBase64 = (_input) => { + let input; + if (typeof _input === "string") { + input = (0, util_utf8_1.fromUtf8)(_input); } - if (typeof time === "string") { - if (Number(time)) { - return new Date(Number(time) * 1000); - } - return new Date(time); + else { + input = _input; } - return time; + 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"); }; +exports.toBase64 = toBase64; -class SignatureV4Base { - service; - regionProvider; - credentialProvider; - sha256; - uriEscapePath; - applyChecksum; - constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { - this.service = service; - this.sha256 = sha256; - this.uriEscapePath = uriEscapePath; - this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; - this.regionProvider = utilMiddleware.normalizeProvider(region); - this.credentialProvider = utilMiddleware.normalizeProvider(credentials); - } - createCanonicalRequest(request, canonicalHeaders, payloadHash) { - const sortedHeaders = Object.keys(canonicalHeaders).sort(); - return `${request.method} -${this.getCanonicalPath(request)} -${getCanonicalQuery(request)} -${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} -${sortedHeaders.join(";")} -${payloadHash}`; - } - async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) { - const hash = new this.sha256(); - hash.update(utilUtf8.toUint8Array(canonicalRequest)); - const hashedRequest = await hash.digest(); - return `${algorithmIdentifier} -${longDate} -${credentialScope} -${utilHexEncoding.toHex(hashedRequest)}`; - } - getCanonicalPath({ path }) { - if (this.uriEscapePath) { - const normalizedPathSegments = []; - for (const pathSegment of path.split("/")) { - if (pathSegment?.length === 0) - continue; - if (pathSegment === ".") - continue; - if (pathSegment === "..") { - normalizedPathSegments.pop(); - } - else { - normalizedPathSegments.push(pathSegment); - } - } - const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`; - const doubleEncoded = utilUriEscape.escapeUri(normalizedPath); - return doubleEncoded.replace(/%2F/g, "/"); +/***/ }), + +/***/ 2098: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +const TEXT_ENCODER = typeof TextEncoder == "function" ? new TextEncoder() : null; +const calculateBodyLength = (body) => { + if (typeof body === "string") { + if (TEXT_ENCODER) { + return TEXT_ENCODER.encode(body).byteLength; } - return path; - } - validateResolvedCredentials(credentials) { - if (typeof credentials !== "object" || - typeof credentials.accessKeyId !== "string" || - typeof credentials.secretAccessKey !== "string") { - throw new Error("Resolved credential object is not valid"); + let len = body.length; + for (let i = len - 1; i >= 0; i--) { + const code = body.charCodeAt(i); + if (code > 0x7f && code <= 0x7ff) + len++; + else if (code > 0x7ff && code <= 0xffff) + len += 2; + if (code >= 0xdc00 && code <= 0xdfff) + i--; } + return len; } - formatDate(now) { - const longDate = iso8601(now).replace(/[\-:]/g, ""); - return { - longDate, - shortDate: longDate.slice(0, 8), - }; + else if (typeof body.byteLength === "number") { + return body.byteLength; } - getCanonicalHeaderList(headers) { - return Object.keys(headers).sort().join(";"); + else if (typeof body.size === "number") { + return body.size; } -} + throw new Error(`Body Length computation failed for ${body}`); +}; -class SignatureV4 extends SignatureV4Base { - headerFormatter = new HeaderFormatter(); - constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { - super({ - applyChecksum, - credentials, - region, - service, - sha256, - uriEscapePath, - }); - } - async presign(originalRequest, options = {}) { - const { signingDate = 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 } = this.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 scope = createScope(shortDate, region, signingService ?? this.service); - const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); - if (credentials.sessionToken) { - request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; - } - request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; - request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; - request.query[AMZ_DATE_QUERY_PARAM] = longDate; - request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); - const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); - request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders); - request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); - return request; +exports.calculateBodyLength = calculateBodyLength; + + +/***/ }), + +/***/ 3638: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var node_fs = __nccwpck_require__(3024); + +const calculateBodyLength = (body) => { + if (!body) { + return 0; } - 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); - } + if (typeof body === "string") { + return Buffer.byteLength(body); } - async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) { - const region = signingRegion ?? (await this.regionProvider()); - const { shortDate, longDate } = this.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 = utilHexEncoding.toHex(await hash.digest()); - const stringToSign = [ - EVENT_ALGORITHM_IDENTIFIER, - longDate, - scope, - priorSignature, - hashedHeaders, - hashedPayload, - ].join("\n"); - return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); + else if (typeof body.byteLength === "number") { + return body.byteLength; } - async signMessage(signableMessage, { signingDate = 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 }; - }); + else if (typeof body.size === "number") { + return body.size; } - async signString(stringToSign, { signingDate = new Date(), signingRegion, signingService } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? (await this.regionProvider()); - const { shortDate } = this.formatDate(signingDate); - const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); - hash.update(utilUtf8.toUint8Array(stringToSign)); - return utilHexEncoding.toHex(await hash.digest()); + else if (typeof body.start === "number" && typeof body.end === "number") { + return body.end + 1 - body.start; } - async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? (await this.regionProvider()); - const request = prepareRequest(requestToSign); - const { longDate, shortDate } = this.formatDate(signingDate); - const scope = createScope(shortDate, region, signingService ?? this.service); - request.headers[AMZ_DATE_HEADER] = longDate; - if (credentials.sessionToken) { - request.headers[TOKEN_HEADER] = credentials.sessionToken; + else if (body instanceof node_fs.ReadStream) { + if (body.path != null) { + return node_fs.lstatSync(body.path).size; } - const payloadHash = await getPayloadHash(request, this.sha256); - if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) { - request.headers[SHA256_HEADER] = payloadHash; + else if (typeof body.fd === "number") { + return node_fs.fstatSync(body.fd).size; } - const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); - const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); - request.headers[AUTH_HEADER] = - `${ALGORITHM_IDENTIFIER} ` + - `Credential=${credentials.accessKeyId}/${scope}, ` + - `SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, ` + - `Signature=${signature}`; - return request; } - async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { - const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER); - const hash = new this.sha256(await keyPromise); - hash.update(utilUtf8.toUint8Array(stringToSign)); - return utilHexEncoding.toHex(await hash.digest()); + throw new Error(`Body Length computation failed for ${body}`); +}; + +exports.calculateBodyLength = calculateBodyLength; + + +/***/ }), + +/***/ 4151: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var isArrayBuffer = __nccwpck_require__(6130); +var buffer = __nccwpck_require__(181); + +const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { + if (!isArrayBuffer.isArrayBuffer(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); } - getSigningKey(credentials, region, shortDate, service) { - return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); + return buffer.Buffer.from(input, offset, length); +}; +const fromString = (input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); } -} + return encoding ? buffer.Buffer.from(input, encoding) : buffer.Buffer.from(input); +}; -const signatureV4aContainer = { - SignatureV4a: null, +exports.fromArrayBuffer = fromArrayBuffer; +exports.fromString = fromString; + + +/***/ }), + +/***/ 6716: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +const booleanSelector = (obj, key, type) => { + if (!(key in obj)) + return undefined; + if (obj[key] === "true") + return true; + if (obj[key] === "false") + return false; + throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); }; -exports.ALGORITHM_IDENTIFIER = ALGORITHM_IDENTIFIER; -exports.ALGORITHM_IDENTIFIER_V4A = ALGORITHM_IDENTIFIER_V4A; -exports.ALGORITHM_QUERY_PARAM = ALGORITHM_QUERY_PARAM; -exports.ALWAYS_UNSIGNABLE_HEADERS = ALWAYS_UNSIGNABLE_HEADERS; -exports.AMZ_DATE_HEADER = AMZ_DATE_HEADER; -exports.AMZ_DATE_QUERY_PARAM = AMZ_DATE_QUERY_PARAM; -exports.AUTH_HEADER = AUTH_HEADER; -exports.CREDENTIAL_QUERY_PARAM = CREDENTIAL_QUERY_PARAM; -exports.DATE_HEADER = DATE_HEADER; -exports.EVENT_ALGORITHM_IDENTIFIER = EVENT_ALGORITHM_IDENTIFIER; -exports.EXPIRES_QUERY_PARAM = EXPIRES_QUERY_PARAM; -exports.GENERATED_HEADERS = GENERATED_HEADERS; -exports.HOST_HEADER = HOST_HEADER; -exports.KEY_TYPE_IDENTIFIER = KEY_TYPE_IDENTIFIER; -exports.MAX_CACHE_SIZE = MAX_CACHE_SIZE; -exports.MAX_PRESIGNED_TTL = MAX_PRESIGNED_TTL; -exports.PROXY_HEADER_PATTERN = PROXY_HEADER_PATTERN; -exports.REGION_SET_PARAM = REGION_SET_PARAM; -exports.SEC_HEADER_PATTERN = SEC_HEADER_PATTERN; -exports.SHA256_HEADER = SHA256_HEADER; -exports.SIGNATURE_HEADER = SIGNATURE_HEADER; -exports.SIGNATURE_QUERY_PARAM = SIGNATURE_QUERY_PARAM; -exports.SIGNED_HEADERS_QUERY_PARAM = SIGNED_HEADERS_QUERY_PARAM; -exports.SignatureV4 = SignatureV4; -exports.SignatureV4Base = SignatureV4Base; -exports.TOKEN_HEADER = TOKEN_HEADER; -exports.TOKEN_QUERY_PARAM = TOKEN_QUERY_PARAM; -exports.UNSIGNABLE_PATTERNS = UNSIGNABLE_PATTERNS; -exports.UNSIGNED_PAYLOAD = UNSIGNED_PAYLOAD; -exports.clearCredentialCache = clearCredentialCache; -exports.createScope = createScope; -exports.getCanonicalHeaders = getCanonicalHeaders; -exports.getCanonicalQuery = getCanonicalQuery; -exports.getPayloadHash = getPayloadHash; -exports.getSigningKey = getSigningKey; -exports.hasHeader = hasHeader; -exports.moveHeadersToQuery = moveHeadersToQuery; -exports.prepareRequest = prepareRequest; -exports.signatureV4aContainer = signatureV4aContainer; +const numberSelector = (obj, key, type) => { + if (!(key in obj)) + return undefined; + const numberValue = parseInt(obj[key], 10); + if (Number.isNaN(numberValue)) { + throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); + } + return numberValue; +}; + +exports.SelectorType = void 0; +(function (SelectorType) { + SelectorType["ENV"] = "env"; + SelectorType["CONFIG"] = "shared config entry"; +})(exports.SelectorType || (exports.SelectorType = {})); + +exports.booleanSelector = booleanSelector; +exports.numberSelector = numberSelector; /***/ }), -/***/ 1411: +/***/ 5435: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var middlewareStack = __nccwpck_require__(9208); -var protocols = __nccwpck_require__(3422); -var types = __nccwpck_require__(690); -var schema = __nccwpck_require__(6890); -var serde = __nccwpck_require__(2430); +var configResolver = __nccwpck_require__(9316); +var nodeConfigProvider = __nccwpck_require__(5704); +var propertyProvider = __nccwpck_require__(8857); -class Client { - config; - middlewareStack = middlewareStack.constructStack(); - initConfig; - handlers; - constructor(config) { - this.config = config; +const AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; +const AWS_REGION_ENV = "AWS_REGION"; +const AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; +const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +const DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; +const IMDS_REGION_PATH = "/latest/meta-data/placement/region"; + +const AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; +const AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; +const NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + return env[AWS_DEFAULTS_MODE_ENV]; + }, + configFileSelector: (profile) => { + return profile[AWS_DEFAULTS_MODE_CONFIG]; + }, + default: "legacy", +}; + +const resolveDefaultsModeConfig = ({ region = nodeConfigProvider.loadConfig(configResolver.NODE_REGION_CONFIG_OPTIONS), defaultsMode = nodeConfigProvider.loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => propertyProvider.memoize(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode?.toLowerCase()) { + case "auto": + return resolveNodeDefaultsModeAuto(region); + case "in-region": + case "cross-region": + case "mobile": + case "standard": + case "legacy": + return Promise.resolve(mode?.toLocaleLowerCase()); + case undefined: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); } - send(command, optionsOrCb, cb) { - const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; - const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; - const useHandlerCache = options === undefined && this.config.cacheMiddleware === true; - let handler; - if (useHandlerCache) { - if (!this.handlers) { - this.handlers = new WeakMap(); - } - const handlers = this.handlers; - if (handlers.has(command.constructor)) { - handler = handlers.get(command.constructor); - } - else { - handler = command.resolveMiddleware(this.middlewareStack, this.config, options); - handlers.set(command.constructor, handler); - } - } - else { - delete this.handlers; - handler = command.resolveMiddleware(this.middlewareStack, this.config, options); +}); +const resolveNodeDefaultsModeAuto = async (clientRegion) => { + if (clientRegion) { + const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; + const inferredRegion = await inferPhysicalRegion(); + if (!inferredRegion) { + return "standard"; } - if (callback) { - handler(command) - .then((result) => callback(null, result.output), (err) => callback(err)) - .catch(() => { }); + if (resolvedRegion === inferredRegion) { + return "in-region"; } else { - return handler(command).then((result) => result.output); + return "cross-region"; } } - destroy() { - this.config?.requestHandler?.destroy?.(); - delete this.handlers; - } -} - -const SENSITIVE_STRING$1 = "***SensitiveInformation***"; -function schemaLogFilter(schema$1, data) { - if (data == null) { - return data; - } - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.getMergedTraits().sensitive) { - return SENSITIVE_STRING$1; + return "standard"; +}; +const inferPhysicalRegion = async () => { + if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) { + return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV]; } - if (ns.isListSchema()) { - const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive; - if (isSensitive) { - return SENSITIVE_STRING$1; + if (!process.env[ENV_IMDS_DISABLED]) { + try { + const { getInstanceMetadataEndpoint, httpRequest } = await __nccwpck_require__.e(/* import() */ 566).then(__nccwpck_require__.t.bind(__nccwpck_require__, 566, 19)); + const endpoint = await getInstanceMetadataEndpoint(); + return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString(); + } + catch (e) { } } - else if (ns.isMapSchema()) { - const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive; - if (isSensitive) { - return SENSITIVE_STRING$1; +}; + +exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; + + +/***/ }), + +/***/ 9674: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var types = __nccwpck_require__(690); + +class EndpointCache { + capacity; + data = new Map(); + parameters = []; + constructor({ size, params }) { + this.capacity = size ?? 50; + if (params) { + this.parameters = params; } } - else if (ns.isStructSchema() && typeof data === "object") { - const object = data; - const newObject = {}; - for (const [member, memberNs] of ns.structIterator()) { - if (object[member] != null) { - newObject[member] = schemaLogFilter(memberNs, object[member]); + get(endpointParams, resolver) { + const key = this.hash(endpointParams); + if (key === false) { + return resolver(); + } + if (!this.data.has(key)) { + if (this.data.size > this.capacity + 10) { + const keys = this.data.keys(); + let i = 0; + while (true) { + const { value, done } = keys.next(); + this.data.delete(value); + if (done || ++i > 10) { + break; + } + } } + this.data.set(key, resolver()); } - return newObject; + return this.data.get(key); } - return data; -} - -class Command { - middlewareStack = middlewareStack.constructStack(); - schema; - static classBuilder() { - return new ClassBuilder(); + size() { + return this.data.size; } - 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); + hash(endpointParams) { + let buffer = ""; + const { parameters } = this; + if (parameters.length === 0) { + return false; } - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog, - outputFilterSensitiveLog, - [types.SMITHY_CONTEXT_KEY]: { - commandInstance: this, - ...smithyContext, - }, - ...additionalContext, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } -} -class ClassBuilder { - _init = () => { }; - _ep = {}; - _middlewareFn = () => []; - _commandName = ""; - _clientName = ""; - _additionalContext = {}; - _smithyContext = {}; - _inputFilterSensitiveLog = undefined; - _outputFilterSensitiveLog = undefined; - _serializer = null; - _deserializer = null; - _operationSchema; - init(cb) { - this._init = cb; - } - ep(endpointParameterInstructions) { - this._ep = endpointParameterInstructions; - return this; - } - m(middlewareSupplier) { - this._middlewareFn = middlewareSupplier; - return this; - } - s(service, operation, smithyContext = {}) { - this._smithyContext = { - service, - operation, - ...smithyContext, - }; - return this; - } - c(additionalContext = {}) { - this._additionalContext = additionalContext; - return this; + for (const param of parameters) { + const val = String(endpointParams[param] ?? ""); + if (val.includes("|;")) { + return false; + } + buffer += val + "|;"; + } + return buffer; } - n(clientName, commandName) { - this._clientName = clientName; - this._commandName = commandName; - return this; +} + +const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); +const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]")); + +const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); +const isValidHostLabel = (value, allowSubDomains = false) => { + if (!allowSubDomains) { + return VALID_HOST_LABEL_REGEX.test(value); } - f(inputFilter = (_) => _, outputFilter = (_) => _) { - this._inputFilterSensitiveLog = inputFilter; - this._outputFilterSensitiveLog = outputFilter; - return this; + const labels = value.split("."); + for (const label of labels) { + if (!isValidHostLabel(label)) { + return false; + } } - ser(serializer) { - this._serializer = serializer; - return this; + return true; +}; + +const customEndpointFunctions = {}; + +const debugId = "endpoints"; + +function toDebugString(input) { + if (typeof input !== "object" || input == null) { + return input; } - de(deserializer) { - this._deserializer = deserializer; - return this; + if ("ref" in input) { + return `$${toDebugString(input.ref)}`; } - sc(operation) { - this._operationSchema = operation; - this._smithyContext.operationSchema = operation; - return this; + if ("fn" in input) { + return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; } - build() { - const closure = this; - let CommandRef; - return (CommandRef = class extends Command { - input; - static getEndpointParameterInstructions() { - return closure._ep; - } - constructor(...[input]) { - super(); - this.input = input ?? {}; - closure._init(this); - this.schema = closure._operationSchema; - } - resolveMiddleware(stack, configuration, options) { - const op = closure._operationSchema; - const input = op?.[4] ?? op?.input; - const output = op?.[5] ?? op?.output; - return this.resolveMiddlewareWithContext(stack, configuration, options, { - CommandCtor: CommandRef, - middlewareFn: closure._middlewareFn, - clientName: closure._clientName, - commandName: closure._commandName, - inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_) => _), - outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_) => _), - smithyContext: closure._smithyContext, - additionalContext: closure._additionalContext, - }); - } - serialize = closure._serializer; - deserialize = closure._deserializer; - }); + return JSON.stringify(input, null, 2); +} + +class EndpointError extends Error { + constructor(message) { + super(message); + this.name = "EndpointError"; } } -const SENSITIVE_STRING = "***SensitiveInformation***"; +const booleanEquals = (value1, value2) => value1 === value2; -const createAggregatedClient = (commands, Client) => { - for (const command of Object.keys(commands)) { - const CommandCtor = commands[command]; - const methodImpl = async function (args, optionsOrCb, cb) { - const command = new CommandCtor(args); - if (typeof optionsOrCb === "function") { - this.send(command, optionsOrCb); +const getAttrPathList = (path) => { + const parts = path.split("."); + const pathList = []; + for (const part of parts) { + const squareBracketIndex = part.indexOf("["); + if (squareBracketIndex !== -1) { + if (part.indexOf("]") !== part.length - 1) { + throw new EndpointError(`Path: '${path}' does not end with ']'`); } - else if (typeof cb === "function") { - if (typeof optionsOrCb !== "object") - throw new Error(`Expected http options but got ${typeof optionsOrCb}`); - this.send(command, optionsOrCb || {}, cb); + const arrayIndex = part.slice(squareBracketIndex + 1, -1); + if (Number.isNaN(parseInt(arrayIndex))) { + throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); } - else { - return this.send(command, optionsOrCb); + if (squareBracketIndex !== 0) { + pathList.push(part.slice(0, squareBracketIndex)); } - }; - const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); - Client.prototype[methodName] = methodImpl; + pathList.push(arrayIndex); + } + else { + pathList.push(part); + } } + return pathList; }; -class ServiceException extends Error { - $fault; - $response; - $retryable; - $metadata; - constructor(options) { - super(options.message); - Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype); - this.name = options.name; - this.$fault = options.$fault; - this.$metadata = options.$metadata; - } - static isInstance(value) { - if (!value) - return false; - const candidate = value; - return (ServiceException.prototype.isPrototypeOf(candidate) || - (Boolean(candidate.$fault) && - Boolean(candidate.$metadata) && - (candidate.$fault === "client" || candidate.$fault === "server"))); +const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => { + if (typeof acc !== "object") { + throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); } - static [Symbol.hasInstance](instance) { - if (!instance) - return false; - const candidate = instance; - if (this === ServiceException) { - return ServiceException.isInstance(instance); - } - if (ServiceException.isInstance(instance)) { - if (candidate.name && this.name) { - return this.prototype.isPrototypeOf(instance) || candidate.name === this.name; - } - return this.prototype.isPrototypeOf(instance); - } - return false; + else if (Array.isArray(acc)) { + return acc[parseInt(index)]; } -} -const decorateServiceException = (exception, additions = {}) => { - Object.entries(additions) - .filter(([, v]) => v !== undefined) - .forEach(([k, v]) => { - if (exception[k] == undefined || exception[k] === "") { - exception[k] = v; - } - }); - const message = exception.message || exception.Message || "UnknownError"; - exception.message = message; - delete exception.Message; - return exception; -}; + return acc[index]; +}, value); -const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { - const $metadata = deserializeMetadata(output); - const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; - const response = new exceptionCtor({ - name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError", - $fault: "client", - $metadata, - }); - throw decorateServiceException(response, parsedBody); -}; -const withBaseException = (ExceptionCtor) => { - return ({ output, parsedBody, errorCode }) => { - throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); - }; -}; -const deserializeMetadata = (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"], -}); +const isSet = (value) => value != null; -const loadConfigsForDefaultMode = (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: 30000, - }; - default: - return {}; - } -}; +const not = (value) => !value; -let warningEmitted = false; -const emitWarningIfUnsupportedVersion = (version) => { - if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) { - warningEmitted = true; - } +const DEFAULT_PORTS = { + [types.EndpointURLScheme.HTTP]: 80, + [types.EndpointURLScheme.HTTPS]: 443, }; - -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - for (const id in types.AlgorithmId) { - const algorithmId = types.AlgorithmId[id]; - if (runtimeConfig[algorithmId] === undefined) { - continue; +const parseURL = (value) => { + const whatwgURL = (() => { + try { + if (value instanceof URL) { + return value; + } + if (typeof value === "object" && "hostname" in value) { + const { hostname, port, protocol = "", path = "", query = {} } = value; + const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : ""}${path}`); + url.search = Object.entries(query) + .map(([k, v]) => `${k}=${v}`) + .join("&"); + return url; + } + return new URL(value); } - checksumAlgorithms.push({ - algorithmId: () => algorithmId, - checksumConstructor: () => runtimeConfig[algorithmId], - }); + catch (error) { + return null; + } + })(); + if (!whatwgURL) { + console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); + return null; } + const urlString = whatwgURL.href; + const { host, hostname, pathname, protocol, search } = whatwgURL; + if (search) { + return null; + } + const scheme = protocol.slice(0, -1); + if (!Object.values(types.EndpointURLScheme).includes(scheme)) { + return null; + } + const isIp = isIpAddress(hostname); + const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || + (typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`)); + const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; return { - addChecksumAlgorithm(algo) { - checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return checksumAlgorithms; - }, + scheme, + authority, + path: pathname, + normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, + isIp, }; }; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -const getRetryConfiguration = (runtimeConfig) => { - return { - setRetryStrategy(retryStrategy) { - runtimeConfig.retryStrategy = retryStrategy; - }, - retryStrategy() { - return runtimeConfig.retryStrategy; - }, - }; -}; -const resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { - const runtimeConfig = {}; - runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); - return runtimeConfig; -}; +const stringEquals = (value1, value2) => value1 === value2; -const getDefaultExtensionConfiguration = (runtimeConfig) => { - return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig)); -}; -const getDefaultClientConfiguration = getDefaultExtensionConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config)); +const substring = (input, start, stop, reverse) => { + if (start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) { + return null; + } + if (!reverse) { + return input.substring(start, stop); + } + return input.substring(input.length - stop, input.length - start); }; -const getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; +const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); -const getValueFromTextNode = (obj) => { - const textNodeName = "#text"; - for (const key in obj) { - if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { - obj[key] = obj[key][textNodeName]; +const endpointFunctions = { + booleanEquals, + getAttr, + isSet, + isValidHostLabel, + not, + parseURL, + stringEquals, + substring, + uriEncode, +}; + +const evaluateTemplate = (template, options) => { + const evaluatedTemplateArr = []; + const templateContext = { + ...options.endpointParams, + ...options.referenceRecord, + }; + let currentIndex = 0; + while (currentIndex < template.length) { + const openingBraceIndex = template.indexOf("{", currentIndex); + if (openingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(currentIndex)); + break; } - else if (typeof obj[key] === "object" && obj[key] !== null) { - obj[key] = getValueFromTextNode(obj[key]); + evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); + const closingBraceIndex = template.indexOf("}", openingBraceIndex); + if (closingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(openingBraceIndex)); + break; + } + if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { + evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); + currentIndex = closingBraceIndex + 2; + } + const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); + if (parameterName.includes("#")) { + const [refName, attrName] = parameterName.split("#"); + evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName)); + } + else { + evaluatedTemplateArr.push(templateContext[parameterName]); } + currentIndex = closingBraceIndex + 1; } - return obj; + return evaluatedTemplateArr.join(""); }; -const isSerializableHeaderValue = (value) => { - return value != null; +const getReferenceValue = ({ ref }, options) => { + const referenceRecord = { + ...options.endpointParams, + ...options.referenceRecord, + }; + return referenceRecord[ref]; }; -class NoOpLogger { - trace() { } - debug() { } - info() { } - warn() { } - error() { } -} - -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; - } +const evaluateExpression = (obj, keyName, options) => { + if (typeof obj === "string") { + return evaluateTemplate(obj, options); } - for (const key of Object.keys(instructions)) { - if (!Array.isArray(instructions[key])) { - target[key] = instructions[key]; - continue; - } - applyInstruction(target, null, instructions, key); + else if (obj["fn"]) { + return group$2.callFunction(obj, options); } - return target; -} -const convertMap = (target) => { - const output = {}; - for (const [k, v] of Object.entries(target || {})) { - output[k] = [, v]; + else if (obj["ref"]) { + return getReferenceValue(obj, options); } - return output; + throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); }; -const take = (source, instructions) => { - const out = {}; - for (const key in instructions) { - applyInstruction(out, source, instructions, key); +const callFunction = ({ fn, argv }, options) => { + const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : group$2.evaluateExpression(arg, "arg", options)); + const fnSegments = fn.split("."); + if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) { + return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs); } - return out; + return endpointFunctions[fn](...evaluatedArgs); }; -const mapWithFilter = (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; - }, {})); +const group$2 = { + evaluateExpression, + callFunction, }; -const applyInstruction = (target, source, instructions, targetKey) => { - if (source !== null) { - let instruction = instructions[targetKey]; - if (typeof instruction === "function") { - instruction = [, instruction]; - } - const [filter = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; - if ((typeof filter === "function" && filter(source[sourceKey])) || (typeof filter !== "function" && !!filter)) { - target[targetKey] = valueFn(source[sourceKey]); - } - return; + +const evaluateCondition = ({ assign, ...fnArgs }, options) => { + if (assign && assign in options.referenceRecord) { + throw new EndpointError(`'${assign}' is already defined in Reference Record.`); } - let [filter, value] = instructions[targetKey]; - if (typeof value === "function") { - let _value; - const defaultFilterPassed = filter === undefined && (_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(); + const value = callFunction(fnArgs, options); + options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); + return { + result: value === "" ? true : !!value, + ...(assign != null && { toAssign: { name: assign, value } }), + }; +}; + +const evaluateConditions = (conditions = [], options) => { + const conditionsReferenceRecord = {}; + for (const condition of conditions) { + const { result, toAssign } = evaluateCondition(condition, { + ...options, + referenceRecord: { + ...options.referenceRecord, + ...conditionsReferenceRecord, + }, + }); + if (!result) { + return { result }; } - } - else { - const defaultFilterPassed = filter === undefined && value != null; - const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter); - if (defaultFilterPassed || customFilterPassed) { - target[targetKey] = value; + if (toAssign) { + conditionsReferenceRecord[toAssign.name] = toAssign.value; + options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); } } + return { result: true, referenceRecord: conditionsReferenceRecord }; }; -const nonNullish = (_) => _ != null; -const pass = (_) => _; -const serializeFloat = (value) => { - if (value !== value) { - return "NaN"; +const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ + ...acc, + [headerKey]: headerVal.map((headerValEntry) => { + const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options); + if (typeof processedExpr !== "string") { + throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); + } + return processedExpr; + }), +}), {}); + +const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ + ...acc, + [propertyKey]: group$1.getEndpointProperty(propertyVal, options), +}), {}); +const getEndpointProperty = (property, options) => { + if (Array.isArray(property)) { + return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options)); } - switch (value) { - case Infinity: - return "Infinity"; - case -Infinity: - return "-Infinity"; + switch (typeof property) { + case "string": + return evaluateTemplate(property, options); + case "object": + if (property === null) { + throw new EndpointError(`Unexpected endpoint property: ${property}`); + } + return group$1.getEndpointProperties(property, options); + case "boolean": + return property; default: - return value; + throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); } }; -const serializeDateTime = (date) => date.toISOString().replace(".000Z", "Z"); +const group$1 = { + getEndpointProperty, + getEndpointProperties, +}; -const _json = (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; - } - target[key] = _json(obj[key]); +const getEndpointUrl = (endpointUrl, options) => { + const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); + if (typeof expression === "string") { + try { + return new URL(expression); + } + catch (error) { + console.error(`Failed to construct URL with ${expression}`, error); + throw error; } - return target; } - return obj; + throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); }; -Object.defineProperty(exports, "collectBody", ({ - enumerable: true, - get: function () { return protocols.collectBody; } -})); -Object.defineProperty(exports, "extendedEncodeURIComponent", ({ - enumerable: true, - get: function () { return protocols.extendedEncodeURIComponent; } -})); -Object.defineProperty(exports, "resolvedPath", ({ - enumerable: true, - get: function () { return protocols.resolvedPath; } -})); -exports.Client = Client; -exports.Command = Command; -exports.NoOpLogger = NoOpLogger; -exports.SENSITIVE_STRING = SENSITIVE_STRING; -exports.ServiceException = ServiceException; -exports._json = _json; -exports.convertMap = convertMap; -exports.createAggregatedClient = createAggregatedClient; -exports.decorateServiceException = decorateServiceException; -exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; -exports.getArrayIfSingleItem = getArrayIfSingleItem; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -exports.getDefaultExtensionConfiguration = getDefaultExtensionConfiguration; -exports.getValueFromTextNode = getValueFromTextNode; -exports.isSerializableHeaderValue = isSerializableHeaderValue; -exports.loadConfigsForDefaultMode = loadConfigsForDefaultMode; -exports.map = map; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; -exports.serializeDateTime = serializeDateTime; -exports.serializeFloat = serializeFloat; -exports.take = take; -exports.throwDefaultError = throwDefaultError; -exports.withBaseException = withBaseException; -Object.keys(serde).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return serde[k]; } - }); -}); - - -/***/ }), - -/***/ 690: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -exports.HttpAuthLocation = void 0; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - -exports.HttpApiKeyAuthLocation = void 0; -(function (HttpApiKeyAuthLocation) { - HttpApiKeyAuthLocation["HEADER"] = "header"; - HttpApiKeyAuthLocation["QUERY"] = "query"; -})(exports.HttpApiKeyAuthLocation || (exports.HttpApiKeyAuthLocation = {})); - -exports.EndpointURLScheme = void 0; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - -exports.AlgorithmId = void 0; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => exports.AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => exports.AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); +const evaluateEndpointRule = (endpointRule, options) => { + const { conditions, endpoint } = endpointRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; } + const endpointRuleOptions = { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + }; + const { url, properties, headers } = endpoint; + options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); return { - addChecksumAlgorithm(algo) { - checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return checksumAlgorithms; - }, + ...(headers != undefined && { + headers: getEndpointHeaders(headers, endpointRuleOptions), + }), + ...(properties != undefined && { + properties: getEndpointProperties(properties, endpointRuleOptions), + }), + url: getEndpointUrl(url, endpointRuleOptions), }; }; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; + +const evaluateErrorRule = (errorRule, options) => { + const { conditions, error } = errorRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + throw new EndpointError(evaluateExpression(error, "Error", { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + })); }; -const getDefaultClientConfiguration = (runtimeConfig) => { - return getChecksumConfiguration(runtimeConfig); +const evaluateRules = (rules, options) => { + for (const rule of rules) { + if (rule.type === "endpoint") { + const endpointOrUndefined = evaluateEndpointRule(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } + else if (rule.type === "error") { + evaluateErrorRule(rule, options); + } + else if (rule.type === "tree") { + const endpointOrUndefined = group.evaluateTreeRule(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } + else { + throw new EndpointError(`Unknown endpoint rule: ${rule}`); + } + } + throw new EndpointError(`Rules evaluation failed`); }; -const resolveDefaultRuntimeConfig = (config) => { - return resolveChecksumRuntimeConfig(config); +const evaluateTreeRule = (treeRule, options) => { + const { conditions, rules } = treeRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + return group.evaluateRules(rules, { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + }); +}; +const group = { + evaluateRules, + evaluateTreeRule, }; -exports.FieldPosition = void 0; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(exports.FieldPosition || (exports.FieldPosition = {})); - -const SMITHY_CONTEXT_KEY = "__smithy_context"; - -exports.IniSectionType = void 0; -(function (IniSectionType) { - IniSectionType["PROFILE"] = "profile"; - IniSectionType["SSO_SESSION"] = "sso-session"; - IniSectionType["SERVICES"] = "services"; -})(exports.IniSectionType || (exports.IniSectionType = {})); - -exports.RequestHandlerProtocol = void 0; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - -exports.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 4494: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var querystringParser = __nccwpck_require__(8822); - -const parseUrl = (url) => { - if (typeof url === "string") { - return parseUrl(new URL(url)); +const resolveEndpoint = (ruleSetObject, options) => { + const { endpointParams, logger } = options; + const { parameters, rules } = ruleSetObject; + options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); + const paramsWithDefault = Object.entries(parameters) + .filter(([, v]) => v.default != null) + .map(([k, v]) => [k, v.default]); + if (paramsWithDefault.length > 0) { + for (const [paramKey, paramDefaultValue] of paramsWithDefault) { + endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue; + } } - const { hostname, pathname, port, protocol, search } = url; - let query; - if (search) { - query = querystringParser.parseQueryString(search); + const requiredParams = Object.entries(parameters) + .filter(([, v]) => v.required) + .map(([k]) => k); + for (const requiredParam of requiredParams) { + if (endpointParams[requiredParam] == null) { + throw new EndpointError(`Missing required parameter: '${requiredParam}'`); + } } - return { - hostname, - port: port ? parseInt(port) : undefined, - protocol, - path: pathname, - query, - }; + const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} }); + options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); + return endpoint; }; -exports.parseUrl = parseUrl; +exports.EndpointCache = EndpointCache; +exports.EndpointError = EndpointError; +exports.customEndpointFunctions = customEndpointFunctions; +exports.isIpAddress = isIpAddress; +exports.isValidHostLabel = isValidHostLabel; +exports.resolveEndpoint = resolveEndpoint; /***/ }), -/***/ 2674: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6435: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromBase64 = void 0; -const util_buffer_from_1 = __nccwpck_require__(4151); -const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; -const fromBase64 = (input) => { - if ((input.length * 3) % 4 !== 0) { - throw new TypeError(`Incorrect padding on base64 string.`); + +const SHORT_TO_HEX = {}; +const HEX_TO_SHORT = {}; +for (let i = 0; i < 256; i++) { + let encodedByte = i.toString(16).toLowerCase(); + if (encodedByte.length === 1) { + encodedByte = `0${encodedByte}`; } - if (!BASE64_REGEX.exec(input)) { - throw new TypeError(`Invalid base64 string.`); + 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 buffer = (0, util_buffer_from_1.fromString)(input, "base64"); - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); -}; -exports.fromBase64 = fromBase64; + 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; +} +function toHex(bytes) { + let out = ""; + for (let i = 0; i < bytes.byteLength; i++) { + out += SHORT_TO_HEX[bytes[i]]; + } + return out; +} + +exports.fromHex = fromHex; +exports.toHex = toHex; /***/ }), -/***/ 8385: +/***/ 6324: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var fromBase64 = __nccwpck_require__(2674); -var toBase64 = __nccwpck_require__(4871); +var types = __nccwpck_require__(690); +const getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {}); +const normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; +}; -Object.keys(fromBase64).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return fromBase64[k]; } - }); -}); -Object.keys(toBase64).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return toBase64[k]; } - }); -}); +exports.getSmithyContext = getSmithyContext; +exports.normalizeProvider = normalizeProvider; /***/ }), -/***/ 4871: +/***/ 5518: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toBase64 = void 0; -const util_buffer_from_1 = __nccwpck_require__(4151); -const util_utf8_1 = __nccwpck_require__(1577); -const toBase64 = (_input) => { - let input; - if (typeof _input === "string") { - input = (0, util_utf8_1.fromUtf8)(_input); + +var serviceErrorClassification = __nccwpck_require__(2058); + +exports.RETRY_MODES = void 0; +(function (RETRY_MODES) { + RETRY_MODES["STANDARD"] = "standard"; + RETRY_MODES["ADAPTIVE"] = "adaptive"; +})(exports.RETRY_MODES || (exports.RETRY_MODES = {})); +const DEFAULT_MAX_ATTEMPTS = 3; +const DEFAULT_RETRY_MODE = exports.RETRY_MODES.STANDARD; + +class DefaultRateLimiter { + static setTimeoutFn = setTimeout; + beta; + minCapacity; + minFillRate; + scaleConstant; + smooth; + currentCapacity = 0; + enabled = false; + lastMaxRate = 0; + measuredTxRate = 0; + requestCount = 0; + fillRate; + lastThrottleTime; + lastTimestamp = 0; + lastTxRateBucket; + maxCapacity; + timeWindow = 0; + constructor(options) { + this.beta = options?.beta ?? 0.7; + this.minCapacity = options?.minCapacity ?? 1; + this.minFillRate = options?.minFillRate ?? 0.5; + this.scaleConstant = options?.scaleConstant ?? 0.4; + this.smooth = 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() / 1000; + } + 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) * 1000; + await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(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 (serviceErrorClassification.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); } - else { - input = _input; + 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 (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { - throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); + getPrecise(num) { + return parseFloat(num.toFixed(8)); } - return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); -}; -exports.toBase64 = toBase64; - - -/***/ }), +} -/***/ 2098: -/***/ ((__unused_webpack_module, exports) => { +const DEFAULT_RETRY_DELAY_BASE = 100; +const MAXIMUM_RETRY_DELAY = 20 * 1000; +const THROTTLING_RETRY_DELAY_BASE = 500; +const INITIAL_RETRY_TOKENS = 500; +const RETRY_COST = 5; +const TIMEOUT_RETRY_COST = 10; +const NO_RETRY_INCREMENT = 1; +const INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; +const REQUEST_HEADER = "amz-sdk-request"; -"use strict"; +const getDefaultRetryBackoffStrategy = () => { + let delayBase = DEFAULT_RETRY_DELAY_BASE; + const computeNextBackoffDelay = (attempts) => { + return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); + }; + const setDelayBase = (delay) => { + delayBase = delay; + }; + return { + computeNextBackoffDelay, + setDelayBase, + }; +}; +const createDefaultRetryToken = ({ retryDelay, retryCount, retryCost, }) => { + const getRetryCount = () => retryCount; + const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay); + const getRetryCost = () => retryCost; + return { + getRetryCount, + getRetryDelay, + getRetryCost, + }; +}; -const TEXT_ENCODER = typeof TextEncoder == "function" ? new TextEncoder() : null; -const calculateBodyLength = (body) => { - if (typeof body === "string") { - if (TEXT_ENCODER) { - return TEXT_ENCODER.encode(body).byteLength; +class StandardRetryStrategy { + maxAttempts; + mode = exports.RETRY_MODES.STANDARD; + capacity = INITIAL_RETRY_TOKENS; + retryBackoffStrategy = getDefaultRetryBackoffStrategy(); + maxAttemptsProvider; + constructor(maxAttempts) { + this.maxAttempts = maxAttempts; + this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; + } + 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, + }); } - let len = body.length; - for (let i = len - 1; i >= 0; i--) { - const code = body.charCodeAt(i); - if (code > 0x7f && code <= 0x7ff) - len++; - else if (code > 0x7ff && code <= 0xffff) - len += 2; - if (code >= 0xdc00 && code <= 0xdfff) - i--; + throw new Error("No retry token available"); + } + recordSuccess(token) { + this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); + } + 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; } - return len; } - else if (typeof body.byteLength === "number") { - return body.byteLength; + shouldRetry(tokenToRenew, errorInfo, maxAttempts) { + const attempts = tokenToRenew.getRetryCount() + 1; + return (attempts < maxAttempts && + this.capacity >= this.getCapacityCost(errorInfo.errorType) && + this.isRetryableError(errorInfo.errorType)); } - else if (typeof body.size === "number") { - return body.size; + getCapacityCost(errorType) { + return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; } - throw new Error(`Body Length computation failed for ${body}`); -}; - -exports.calculateBodyLength = calculateBodyLength; - - -/***/ }), - -/***/ 3638: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var node_fs = __nccwpck_require__(3024); - -const calculateBodyLength = (body) => { - if (!body) { - return 0; + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; } - if (typeof body === "string") { - return Buffer.byteLength(body); +} + +class AdaptiveRetryStrategy { + maxAttemptsProvider; + rateLimiter; + standardRetryStrategy; + mode = exports.RETRY_MODES.ADAPTIVE; + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + const { rateLimiter } = options ?? {}; + this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); + this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); } - else if (typeof body.byteLength === "number") { - return body.byteLength; + async acquireInitialRetryToken(retryTokenScope) { + await this.rateLimiter.getSendToken(); + return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); } - else if (typeof body.size === "number") { - return body.size; + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + this.rateLimiter.updateClientSendingRate(errorInfo); + return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); } - else if (typeof body.start === "number" && typeof body.end === "number") { - return body.end + 1 - body.start; + recordSuccess(token) { + this.rateLimiter.updateClientSendingRate({}); + this.standardRetryStrategy.recordSuccess(token); } - else if (body instanceof node_fs.ReadStream) { - if (body.path != null) { - return node_fs.lstatSync(body.path).size; +} + +class ConfiguredRetryStrategy extends StandardRetryStrategy { + computeNextBackoffDelay; + constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) { + super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); + if (typeof computeNextBackoffDelay === "number") { + this.computeNextBackoffDelay = () => computeNextBackoffDelay; } - else if (typeof body.fd === "number") { - return node_fs.fstatSync(body.fd).size; + else { + this.computeNextBackoffDelay = computeNextBackoffDelay; } } - throw new Error(`Body Length computation failed for ${body}`); -}; + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); + return token; + } +} -exports.calculateBodyLength = calculateBodyLength; +exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; +exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy; +exports.DEFAULT_MAX_ATTEMPTS = DEFAULT_MAX_ATTEMPTS; +exports.DEFAULT_RETRY_DELAY_BASE = DEFAULT_RETRY_DELAY_BASE; +exports.DEFAULT_RETRY_MODE = DEFAULT_RETRY_MODE; +exports.DefaultRateLimiter = DefaultRateLimiter; +exports.INITIAL_RETRY_TOKENS = INITIAL_RETRY_TOKENS; +exports.INVOCATION_ID_HEADER = INVOCATION_ID_HEADER; +exports.MAXIMUM_RETRY_DELAY = MAXIMUM_RETRY_DELAY; +exports.NO_RETRY_INCREMENT = NO_RETRY_INCREMENT; +exports.REQUEST_HEADER = REQUEST_HEADER; +exports.RETRY_COST = RETRY_COST; +exports.StandardRetryStrategy = StandardRetryStrategy; +exports.THROTTLING_RETRY_DELAY_BASE = THROTTLING_RETRY_DELAY_BASE; +exports.TIMEOUT_RETRY_COST = TIMEOUT_RETRY_COST; /***/ }), -/***/ 4151: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 1732: +/***/ ((__unused_webpack_module, exports) => { "use strict"; - -var isArrayBuffer = __nccwpck_require__(6130); -var buffer = __nccwpck_require__(181); - -const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { - if (!isArrayBuffer.isArrayBuffer(input)) { - throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ByteArrayCollector = void 0; +class ByteArrayCollector { + allocByteArray; + byteLength = 0; + byteArrays = []; + constructor(allocByteArray) { + this.allocByteArray = allocByteArray; } - return buffer.Buffer.from(input, offset, length); -}; -const fromString = (input, encoding) => { - if (typeof input !== "string") { - throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + push(byteArray) { + this.byteArrays.push(byteArray); + this.byteLength += byteArray.byteLength; } - return encoding ? buffer.Buffer.from(input, encoding) : buffer.Buffer.from(input); -}; - -exports.fromArrayBuffer = fromArrayBuffer; -exports.fromString = fromString; + flush() { + if (this.byteArrays.length === 1) { + const bytes = this.byteArrays[0]; + this.reset(); + return bytes; + } + const aggregation = this.allocByteArray(this.byteLength); + let cursor = 0; + for (let i = 0; i < this.byteArrays.length; ++i) { + const bytes = this.byteArrays[i]; + aggregation.set(bytes, cursor); + cursor += bytes.byteLength; + } + this.reset(); + return aggregation; + } + reset() { + this.byteArrays = []; + this.byteLength = 0; + } +} +exports.ByteArrayCollector = ByteArrayCollector; /***/ }), -/***/ 6716: +/***/ 7753: /***/ ((__unused_webpack_module, exports) => { "use strict"; - -const booleanSelector = (obj, key, type) => { - if (!(key in obj)) - return undefined; - if (obj[key] === "true") - return true; - if (obj[key] === "false") - return false; - throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); -}; - -const numberSelector = (obj, key, type) => { - if (!(key in obj)) - return undefined; - const numberValue = parseInt(obj[key], 10); - if (Number.isNaN(numberValue)) { - throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); - } - return numberValue; -}; - -exports.SelectorType = void 0; -(function (SelectorType) { - SelectorType["ENV"] = "env"; - SelectorType["CONFIG"] = "shared config entry"; -})(exports.SelectorType || (exports.SelectorType = {})); - -exports.booleanSelector = booleanSelector; -exports.numberSelector = numberSelector; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ChecksumStream = void 0; +const ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function () { }; +class ChecksumStream extends ReadableStreamRef { +} +exports.ChecksumStream = ChecksumStream; /***/ }), -/***/ 5435: +/***/ 1775: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -var configResolver = __nccwpck_require__(9316); -var nodeConfigProvider = __nccwpck_require__(5704); -var propertyProvider = __nccwpck_require__(8857); - -const AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; -const AWS_REGION_ENV = "AWS_REGION"; -const AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; -const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; -const DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; -const IMDS_REGION_PATH = "/latest/meta-data/placement/region"; - -const AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; -const AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; -const NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - return env[AWS_DEFAULTS_MODE_ENV]; - }, - configFileSelector: (profile) => { - return profile[AWS_DEFAULTS_MODE_CONFIG]; - }, - default: "legacy", -}; - -const resolveDefaultsModeConfig = ({ region = nodeConfigProvider.loadConfig(configResolver.NODE_REGION_CONFIG_OPTIONS), defaultsMode = nodeConfigProvider.loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => propertyProvider.memoize(async () => { - const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; - switch (mode?.toLowerCase()) { - case "auto": - return resolveNodeDefaultsModeAuto(region); - case "in-region": - case "cross-region": - case "mobile": - case "standard": - case "legacy": - return Promise.resolve(mode?.toLocaleLowerCase()); - case undefined: - return Promise.resolve("legacy"); - default: - throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); - } -}); -const resolveNodeDefaultsModeAuto = async (clientRegion) => { - if (clientRegion) { - const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; - const inferredRegion = await inferPhysicalRegion(); - if (!inferredRegion) { - return "standard"; - } - if (resolvedRegion === inferredRegion) { - return "in-region"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ChecksumStream = void 0; +const util_base64_1 = __nccwpck_require__(8385); +const stream_1 = __nccwpck_require__(2203); +class ChecksumStream extends stream_1.Duplex { + expectedChecksum; + checksumSourceLocation; + checksum; + source; + base64Encoder; + pendingCallback = null; + constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }) { + super(); + if (typeof source.pipe === "function") { + this.source = source; } else { - return "cross-region"; + throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); + } + this.base64Encoder = base64Encoder ?? util_base64_1.toBase64; + this.expectedChecksum = expectedChecksum; + this.checksum = checksum; + this.checksumSourceLocation = checksumSourceLocation; + this.source.pipe(this); + } + _read(size) { + if (this.pendingCallback) { + const callback = this.pendingCallback; + this.pendingCallback = null; + callback(); } } - return "standard"; -}; -const inferPhysicalRegion = async () => { - if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) { - return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV]; + _write(chunk, encoding, callback) { + try { + this.checksum.update(chunk); + const canPushMore = this.push(chunk); + if (!canPushMore) { + this.pendingCallback = callback; + return; + } + } + catch (e) { + return callback(e); + } + return callback(); } - if (!process.env[ENV_IMDS_DISABLED]) { + async _final(callback) { try { - const { getInstanceMetadataEndpoint, httpRequest } = await __nccwpck_require__.e(/* import() */ 566).then(__nccwpck_require__.t.bind(__nccwpck_require__, 566, 19)); - const endpoint = await getInstanceMetadataEndpoint(); - return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString(); + 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(); } -}; - -exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; +} +exports.ChecksumStream = ChecksumStream; /***/ }), -/***/ 9674: +/***/ 4129: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -var types = __nccwpck_require__(690); - -class EndpointCache { - capacity; - data = new Map(); - parameters = []; - constructor({ size, params }) { - this.capacity = size ?? 50; - if (params) { - this.parameters = params; - } - } - get(endpointParams, resolver) { - const key = this.hash(endpointParams); - if (key === false) { - return resolver(); - } - if (!this.data.has(key)) { - if (this.data.size > this.capacity + 10) { - const keys = this.data.keys(); - let i = 0; - while (true) { - const { value, done } = keys.next(); - this.data.delete(value); - if (done || ++i > 10) { - break; - } - } - } - this.data.set(key, resolver()); - } - return this.data.get(key); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createChecksumStream = void 0; +const util_base64_1 = __nccwpck_require__(8385); +const stream_type_check_1 = __nccwpck_require__(4414); +const ChecksumStream_browser_1 = __nccwpck_require__(7753); +const createChecksumStream = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }) => { + if (!(0, stream_type_check_1.isReadableStream)(source)) { + throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); } - size() { - return this.data.size; + const encoder = base64Encoder ?? util_base64_1.toBase64; + if (typeof TransformStream !== "function") { + throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream."); } - hash(endpointParams) { - let buffer = ""; - const { parameters } = this; - if (parameters.length === 0) { - return false; - } - for (const param of parameters) { - const val = String(endpointParams[param] ?? ""); - if (val.includes("|;")) { - return false; + 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); } - buffer += val + "|;"; - } - return buffer; - } -} - -const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); -const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]")); - -const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); -const isValidHostLabel = (value, allowSubDomains = false) => { - if (!allowSubDomains) { - return VALID_HOST_LABEL_REGEX.test(value); - } - const labels = value.split("."); - for (const label of labels) { - if (!isValidHostLabel(label)) { - return false; - } - } - return true; + else { + controller.terminate(); + } + }, + }); + source.pipeThrough(transform); + const readable = transform.readable; + Object.setPrototypeOf(readable, ChecksumStream_browser_1.ChecksumStream.prototype); + return readable; }; +exports.createChecksumStream = createChecksumStream; -const customEndpointFunctions = {}; -const debugId = "endpoints"; +/***/ }), -function toDebugString(input) { - if (typeof input !== "object" || input == null) { - return input; - } - if ("ref" in input) { - return `$${toDebugString(input.ref)}`; - } - if ("fn" in input) { - return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; - } - return JSON.stringify(input, null, 2); -} +/***/ 5639: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -class EndpointError extends Error { - constructor(message) { - super(message); - this.name = "EndpointError"; +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createChecksumStream = createChecksumStream; +const stream_type_check_1 = __nccwpck_require__(4414); +const ChecksumStream_1 = __nccwpck_require__(1775); +const createChecksumStream_browser_1 = __nccwpck_require__(4129); +function createChecksumStream(init) { + if (typeof ReadableStream === "function" && (0, stream_type_check_1.isReadableStream)(init.source)) { + return (0, createChecksumStream_browser_1.createChecksumStream)(init); } + return new ChecksumStream_1.ChecksumStream(init); } -const booleanEquals = (value1, value2) => value1 === value2; -const getAttrPathList = (path) => { - const parts = path.split("."); - const pathList = []; - for (const part of parts) { - const squareBracketIndex = part.indexOf("["); - if (squareBracketIndex !== -1) { - if (part.indexOf("]") !== part.length - 1) { - throw new EndpointError(`Path: '${path}' does not end with ']'`); +/***/ }), + +/***/ 2005: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createBufferedReadable = createBufferedReadable; +const node_stream_1 = __nccwpck_require__(7075); +const ByteArrayCollector_1 = __nccwpck_require__(1732); +const createBufferedReadableStream_1 = __nccwpck_require__(8213); +const stream_type_check_1 = __nccwpck_require__(4414); +function createBufferedReadable(upstream, size, logger) { + if ((0, stream_type_check_1.isReadableStream)(upstream)) { + return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger); + } + const downstream = new node_stream_1.Readable({ read() { } }); + let streamBufferingLoggedWarning = false; + let bytesSeen = 0; + const buffers = [ + "", + new ByteArrayCollector_1.ByteArrayCollector((size) => new Uint8Array(size)), + new ByteArrayCollector_1.ByteArrayCollector((size) => Buffer.from(new Uint8Array(size))), + ]; + let mode = -1; + upstream.on("data", (chunk) => { + const chunkMode = (0, createBufferedReadableStream_1.modeOf)(chunk, true); + if (mode !== chunkMode) { + if (mode >= 0) { + downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode)); } - const arrayIndex = part.slice(squareBracketIndex + 1, -1); - if (Number.isNaN(parseInt(arrayIndex))) { - throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); + mode = chunkMode; + } + if (mode === -1) { + downstream.push(chunk); + return; + } + const chunkSize = (0, createBufferedReadableStream_1.sizeOf)(chunk); + bytesSeen += chunkSize; + const bufferSize = (0, createBufferedReadableStream_1.sizeOf)(buffers[mode]); + if (chunkSize >= size && bufferSize === 0) { + downstream.push(chunk); + } + else { + const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk); + if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { + streamBufferingLoggedWarning = true; + logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); } - if (squareBracketIndex !== 0) { - pathList.push(part.slice(0, squareBracketIndex)); + if (newSize >= size) { + downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode)); } - pathList.push(arrayIndex); } - else { - pathList.push(part); + }); + upstream.on("end", () => { + if (mode !== -1) { + const remainder = (0, createBufferedReadableStream_1.flush)(buffers, mode); + if ((0, createBufferedReadableStream_1.sizeOf)(remainder) > 0) { + downstream.push(remainder); + } } - } - return pathList; -}; + downstream.push(null); + }); + return downstream; +} -const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => { - if (typeof acc !== "object") { - throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); - } - else if (Array.isArray(acc)) { - return acc[parseInt(index)]; - } - return acc[index]; -}, value); -const isSet = (value) => value != null; +/***/ }), -const not = (value) => !value; +/***/ 8213: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const DEFAULT_PORTS = { - [types.EndpointURLScheme.HTTP]: 80, - [types.EndpointURLScheme.HTTPS]: 443, -}; -const parseURL = (value) => { - const whatwgURL = (() => { - try { - if (value instanceof URL) { - return value; - } - if (typeof value === "object" && "hostname" in value) { - const { hostname, port, protocol = "", path = "", query = {} } = value; - const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : ""}${path}`); - url.search = Object.entries(query) - .map(([k, v]) => `${k}=${v}`) - .join("&"); - return url; +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createBufferedReadable = void 0; +exports.createBufferedReadableStream = createBufferedReadableStream; +exports.merge = merge; +exports.flush = flush; +exports.sizeOf = sizeOf; +exports.modeOf = modeOf; +const ByteArrayCollector_1 = __nccwpck_require__(1732); +function createBufferedReadableStream(upstream, size, logger) { + const reader = upstream.getReader(); + let streamBufferingLoggedWarning = false; + let bytesSeen = 0; + const buffers = ["", new ByteArrayCollector_1.ByteArrayCollector((size) => new Uint8Array(size))]; + let mode = -1; + const pull = async (controller) => { + const { value, done } = await reader.read(); + const chunk = value; + if (done) { + if (mode !== -1) { + const remainder = flush(buffers, mode); + if (sizeOf(remainder) > 0) { + controller.enqueue(remainder); + } } - return new URL(value); + controller.close(); } - catch (error) { - return null; + else { + const chunkMode = modeOf(chunk, false); + if (mode !== chunkMode) { + if (mode >= 0) { + controller.enqueue(flush(buffers, mode)); + } + mode = chunkMode; + } + if (mode === -1) { + controller.enqueue(chunk); + return; + } + const chunkSize = sizeOf(chunk); + bytesSeen += chunkSize; + const bufferSize = sizeOf(buffers[mode]); + if (chunkSize >= size && bufferSize === 0) { + controller.enqueue(chunk); + } + else { + const newSize = merge(buffers, mode, chunk); + if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { + streamBufferingLoggedWarning = true; + logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); + } + if (newSize >= size) { + controller.enqueue(flush(buffers, mode)); + } + else { + await pull(controller); + } + } } - })(); - if (!whatwgURL) { - console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); - return null; + }; + return new ReadableStream({ + pull, + }); +} +exports.createBufferedReadable = createBufferedReadableStream; +function merge(buffers, mode, chunk) { + switch (mode) { + case 0: + buffers[0] += chunk; + return sizeOf(buffers[0]); + case 1: + case 2: + buffers[mode].push(chunk); + return sizeOf(buffers[mode]); } - const urlString = whatwgURL.href; - const { host, hostname, pathname, protocol, search } = whatwgURL; - if (search) { - return null; +} +function flush(buffers, mode) { + switch (mode) { + case 0: + const s = buffers[0]; + buffers[0] = ""; + return s; + case 1: + case 2: + return buffers[mode].flush(); } - const scheme = protocol.slice(0, -1); - if (!Object.values(types.EndpointURLScheme).includes(scheme)) { - return null; + throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`); +} +function sizeOf(chunk) { + return chunk?.byteLength ?? chunk?.length ?? 0; +} +function modeOf(chunk, allowBuffer = true) { + if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) { + return 2; } - const isIp = isIpAddress(hostname); - const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || - (typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`)); - const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; - return { - scheme, - authority, - path: pathname, - normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, - isIp, - }; -}; - -const stringEquals = (value1, value2) => value1 === value2; - -const substring = (input, start, stop, reverse) => { - if (start >= stop || input.length < stop) { - return null; + if (chunk instanceof Uint8Array) { + return 1; } - if (!reverse) { - return input.substring(start, stop); + if (typeof chunk === "string") { + return 0; } - return input.substring(input.length - stop, input.length - start); -}; + return -1; +} -const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); -const endpointFunctions = { - booleanEquals, - getAttr, - isSet, - isValidHostLabel, - not, - parseURL, - stringEquals, - substring, - uriEncode, -}; +/***/ }), -const evaluateTemplate = (template, options) => { - const evaluatedTemplateArr = []; - const templateContext = { - ...options.endpointParams, - ...options.referenceRecord, - }; - let currentIndex = 0; - while (currentIndex < template.length) { - const openingBraceIndex = template.indexOf("{", currentIndex); - if (openingBraceIndex === -1) { - evaluatedTemplateArr.push(template.slice(currentIndex)); - break; - } - evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); - const closingBraceIndex = template.indexOf("}", openingBraceIndex); - if (closingBraceIndex === -1) { - evaluatedTemplateArr.push(template.slice(openingBraceIndex)); - break; - } - if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { - evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); - currentIndex = closingBraceIndex + 2; - } - const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); - if (parameterName.includes("#")) { - const [refName, attrName] = parameterName.split("#"); - evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName)); - } - else { - evaluatedTemplateArr.push(templateContext[parameterName]); - } - currentIndex = closingBraceIndex + 1; - } - return evaluatedTemplateArr.join(""); -}; +/***/ 3492: +/***/ ((__unused_webpack_module, exports) => { -const getReferenceValue = ({ ref }, options) => { - const referenceRecord = { - ...options.endpointParams, - ...options.referenceRecord, - }; - return referenceRecord[ref]; -}; +"use strict"; -const evaluateExpression = (obj, keyName, options) => { - if (typeof obj === "string") { - return evaluateTemplate(obj, options); - } - else if (obj["fn"]) { - return group$2.callFunction(obj, options); - } - else if (obj["ref"]) { - return getReferenceValue(obj, options); - } - throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); -}; -const callFunction = ({ fn, argv }, options) => { - const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : group$2.evaluateExpression(arg, "arg", options)); - const fnSegments = fn.split("."); - if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) { - return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs); - } - return endpointFunctions[fn](...evaluatedArgs); -}; -const group$2 = { - evaluateExpression, - callFunction, +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getAwsChunkedEncodingStream = void 0; +const getAwsChunkedEncodingStream = (readableStream, options) => { + const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; + const checksumRequired = base64Encoder !== undefined && + bodyLengthChecker !== undefined && + checksumAlgorithmFn !== undefined && + checksumLocationName !== undefined && + streamHasher !== undefined; + const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined; + const reader = readableStream.getReader(); + return new ReadableStream({ + async pull(controller) { + const { value, done } = await reader.read(); + if (done) { + controller.enqueue(`0\r\n`); + if (checksumRequired) { + const checksum = base64Encoder(await digest); + controller.enqueue(`${checksumLocationName}:${checksum}\r\n`); + controller.enqueue(`\r\n`); + } + controller.close(); + } + else { + controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r\n${value}\r\n`); + } + }, + }); }; +exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; -const evaluateCondition = ({ assign, ...fnArgs }, options) => { - if (assign && assign in options.referenceRecord) { - throw new EndpointError(`'${assign}' is already defined in Reference Record.`); - } - const value = callFunction(fnArgs, options); - options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); - return { - result: value === "" ? true : !!value, - ...(assign != null && { toAssign: { name: assign, value } }), - }; -}; -const evaluateConditions = (conditions = [], options) => { - const conditionsReferenceRecord = {}; - for (const condition of conditions) { - const { result, toAssign } = evaluateCondition(condition, { - ...options, - referenceRecord: { - ...options.referenceRecord, - ...conditionsReferenceRecord, - }, - }); - if (!result) { - return { result }; - } - if (toAssign) { - conditionsReferenceRecord[toAssign.name] = toAssign.value; - options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); - } - } - return { result: true, referenceRecord: conditionsReferenceRecord }; -}; +/***/ }), -const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ - ...acc, - [headerKey]: headerVal.map((headerValEntry) => { - const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options); - if (typeof processedExpr !== "string") { - throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); - } - return processedExpr; - }), -}), {}); +/***/ 6522: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ - ...acc, - [propertyKey]: group$1.getEndpointProperty(propertyVal, options), -}), {}); -const getEndpointProperty = (property, options) => { - if (Array.isArray(property)) { - return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options)); - } - switch (typeof property) { - case "string": - return evaluateTemplate(property, options); - case "object": - if (property === null) { - throw new EndpointError(`Unexpected endpoint property: ${property}`); - } - return group$1.getEndpointProperties(property, options); - case "boolean": - return property; - default: - throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); - } -}; -const group$1 = { - getEndpointProperty, - getEndpointProperties, -}; +"use strict"; -const getEndpointUrl = (endpointUrl, options) => { - const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); - if (typeof expression === "string") { - try { - return new URL(expression); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; +const node_stream_1 = __nccwpck_require__(7075); +const getAwsChunkedEncodingStream_browser_1 = __nccwpck_require__(3492); +const stream_type_check_1 = __nccwpck_require__(4414); +function getAwsChunkedEncodingStream(stream, options) { + const readable = stream; + const readableStream = stream; + if ((0, stream_type_check_1.isReadableStream)(readableStream)) { + return (0, getAwsChunkedEncodingStream_browser_1.getAwsChunkedEncodingStream)(readableStream, options); + } + const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; + const checksumRequired = base64Encoder !== undefined && + checksumAlgorithmFn !== undefined && + checksumLocationName !== undefined && + streamHasher !== undefined; + const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : undefined; + const awsChunkedEncodingStream = new node_stream_1.Readable({ + read: () => { }, + }); + readable.on("data", (data) => { + const length = bodyLengthChecker(data) || 0; + if (length === 0) { + return; } - catch (error) { - console.error(`Failed to construct URL with ${expression}`, error); - throw error; + awsChunkedEncodingStream.push(`${length.toString(16)}\r\n`); + awsChunkedEncodingStream.push(data); + awsChunkedEncodingStream.push("\r\n"); + }); + readable.on("end", async () => { + awsChunkedEncodingStream.push(`0\r\n`); + if (checksumRequired) { + const checksum = base64Encoder(await digest); + awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`); + awsChunkedEncodingStream.push(`\r\n`); } - } - throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); -}; - -const evaluateEndpointRule = (endpointRule, options) => { - const { conditions, endpoint } = endpointRule; - const { result, referenceRecord } = evaluateConditions(conditions, options); - if (!result) { - return; - } - const endpointRuleOptions = { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, - }; - const { url, properties, headers } = endpoint; - options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); - return { - ...(headers != undefined && { - headers: getEndpointHeaders(headers, endpointRuleOptions), - }), - ...(properties != undefined && { - properties: getEndpointProperties(properties, endpointRuleOptions), - }), - url: getEndpointUrl(url, endpointRuleOptions), - }; -}; + awsChunkedEncodingStream.push(null); + }); + return awsChunkedEncodingStream; +} -const evaluateErrorRule = (errorRule, options) => { - const { conditions, error } = errorRule; - const { result, referenceRecord } = evaluateConditions(conditions, options); - if (!result) { - return; - } - throw new EndpointError(evaluateExpression(error, "Error", { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, - })); -}; -const evaluateRules = (rules, options) => { - for (const rule of rules) { - if (rule.type === "endpoint") { - const endpointOrUndefined = evaluateEndpointRule(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } +/***/ }), + +/***/ 66: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.headStream = headStream; +async function headStream(stream, bytes) { + 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 += value?.byteLength ?? 0; } - else if (rule.type === "error") { - evaluateErrorRule(rule, options); + if (byteLengthCounter >= bytes) { + break; } - else if (rule.type === "tree") { - const endpointOrUndefined = group.evaluateTreeRule(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } + 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 { - throw new EndpointError(`Unknown endpoint rule: ${rule}`); + collected.set(chunk, offset); } + offset += chunk.length; } - throw new EndpointError(`Rules evaluation failed`); -}; -const evaluateTreeRule = (treeRule, options) => { - const { conditions, rules } = treeRule; - const { result, referenceRecord } = evaluateConditions(conditions, options); - if (!result) { - return; + return collected; +} + + +/***/ }), + +/***/ 8412: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.headStream = void 0; +const stream_1 = __nccwpck_require__(2203); +const headStream_browser_1 = __nccwpck_require__(66); +const stream_type_check_1 = __nccwpck_require__(4414); +const headStream = (stream, bytes) => { + if ((0, stream_type_check_1.isReadableStream)(stream)) { + return (0, headStream_browser_1.headStream)(stream, bytes); } - return group.evaluateRules(rules, { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + 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 bytes = new Uint8Array(Buffer.concat(this.buffers)); + resolve(bytes); + }); }); }; -const group = { - evaluateRules, - evaluateTreeRule, -}; - -const resolveEndpoint = (ruleSetObject, options) => { - const { endpointParams, logger } = options; - const { parameters, rules } = ruleSetObject; - options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); - const paramsWithDefault = Object.entries(parameters) - .filter(([, v]) => v.default != null) - .map(([k, v]) => [k, v.default]); - if (paramsWithDefault.length > 0) { - for (const [paramKey, paramDefaultValue] of paramsWithDefault) { - endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue; - } - } - const requiredParams = Object.entries(parameters) - .filter(([, v]) => v.required) - .map(([k]) => k); - for (const requiredParam of requiredParams) { - if (endpointParams[requiredParam] == null) { - throw new EndpointError(`Missing required parameter: '${requiredParam}'`); +exports.headStream = headStream; +class Collector extends stream_1.Writable { + buffers = []; + limit = Infinity; + bytesBuffered = 0; + _write(chunk, encoding, callback) { + this.buffers.push(chunk); + this.bytesBuffered += chunk.byteLength ?? 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(); } - const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} }); - options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); - return endpoint; -}; - -exports.EndpointCache = EndpointCache; -exports.EndpointError = EndpointError; -exports.customEndpointFunctions = customEndpointFunctions; -exports.isIpAddress = isIpAddress; -exports.isValidHostLabel = isValidHostLabel; -exports.resolveEndpoint = resolveEndpoint; +} /***/ }), -/***/ 6435: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4252: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const SHORT_TO_HEX = {}; -const HEX_TO_SHORT = {}; -for (let i = 0; i < 256; i++) { - let encodedByte = i.toString(16).toLowerCase(); - if (encodedByte.length === 1) { - encodedByte = `0${encodedByte}`; +var utilBase64 = __nccwpck_require__(8385); +var utilUtf8 = __nccwpck_require__(1577); +var ChecksumStream = __nccwpck_require__(1775); +var createChecksumStream = __nccwpck_require__(5639); +var createBufferedReadable = __nccwpck_require__(2005); +var getAwsChunkedEncodingStream = __nccwpck_require__(6522); +var headStream = __nccwpck_require__(8412); +var sdkStreamMixin = __nccwpck_require__(7201); +var splitStream = __nccwpck_require__(2108); +var streamTypeCheck = __nccwpck_require__(4414); + +class Uint8ArrayBlobAdapter extends Uint8Array { + static fromString(source, encoding = "utf-8") { + if (typeof source === "string") { + if (encoding === "base64") { + return Uint8ArrayBlobAdapter.mutate(utilBase64.fromBase64(source)); + } + return Uint8ArrayBlobAdapter.mutate(utilUtf8.fromUtf8(source)); + } + throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); } - 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"); + static mutate(source) { + Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype); + return source; } - 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`); + transformToString(encoding = "utf-8") { + if (encoding === "base64") { + return utilBase64.toBase64(this); } + return utilUtf8.toUtf8(this); } - return out; -} -function toHex(bytes) { - let out = ""; - for (let i = 0; i < bytes.byteLength; i++) { - out += SHORT_TO_HEX[bytes[i]]; - } - return out; } -exports.fromHex = fromHex; -exports.toHex = toHex; - - -/***/ }), +exports.isBlob = streamTypeCheck.isBlob; +exports.isReadableStream = streamTypeCheck.isReadableStream; +exports.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter; +Object.prototype.hasOwnProperty.call(ChecksumStream, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: ChecksumStream['__proto__'] + }); -/***/ 6324: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.keys(ChecksumStream).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = ChecksumStream[k]; +}); +Object.prototype.hasOwnProperty.call(createChecksumStream, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: createChecksumStream['__proto__'] + }); -"use strict"; +Object.keys(createChecksumStream).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = createChecksumStream[k]; +}); +Object.prototype.hasOwnProperty.call(createBufferedReadable, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: createBufferedReadable['__proto__'] + }); +Object.keys(createBufferedReadable).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = createBufferedReadable[k]; +}); +Object.prototype.hasOwnProperty.call(getAwsChunkedEncodingStream, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: getAwsChunkedEncodingStream['__proto__'] + }); -var types = __nccwpck_require__(690); +Object.keys(getAwsChunkedEncodingStream).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getAwsChunkedEncodingStream[k]; +}); +Object.prototype.hasOwnProperty.call(headStream, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: headStream['__proto__'] + }); -const getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {}); +Object.keys(headStream).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = headStream[k]; +}); +Object.prototype.hasOwnProperty.call(sdkStreamMixin, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: sdkStreamMixin['__proto__'] + }); -const normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; -}; +Object.keys(sdkStreamMixin).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = sdkStreamMixin[k]; +}); +Object.prototype.hasOwnProperty.call(splitStream, '__proto__') && + !Object.prototype.hasOwnProperty.call(exports, '__proto__') && + Object.defineProperty(exports, '__proto__', { + enumerable: true, + value: splitStream['__proto__'] + }); -exports.getSmithyContext = getSmithyContext; -exports.normalizeProvider = normalizeProvider; +Object.keys(splitStream).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = splitStream[k]; +}); /***/ }), -/***/ 5518: +/***/ 2207: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.sdkStreamMixin = void 0; +const fetch_http_handler_1 = __nccwpck_require__(7809); +const util_base64_1 = __nccwpck_require__(8385); +const util_hex_encoding_1 = __nccwpck_require__(6435); +const util_utf8_1 = __nccwpck_require__(1577); +const stream_type_check_1 = __nccwpck_require__(4414); +const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; +const sdkStreamMixin = (stream) => { + if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) { + const name = stream?.__proto__?.constructor?.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.\n" + + "If 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: 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 === undefined || 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}`); + } + }, + }); +}; +exports.sdkStreamMixin = sdkStreamMixin; +const isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob; + -var serviceErrorClassification = __nccwpck_require__(2058); +/***/ }), -exports.RETRY_MODES = void 0; -(function (RETRY_MODES) { - RETRY_MODES["STANDARD"] = "standard"; - RETRY_MODES["ADAPTIVE"] = "adaptive"; -})(exports.RETRY_MODES || (exports.RETRY_MODES = {})); -const DEFAULT_MAX_ATTEMPTS = 3; -const DEFAULT_RETRY_MODE = exports.RETRY_MODES.STANDARD; +/***/ 7201: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -class DefaultRateLimiter { - static setTimeoutFn = setTimeout; - beta; - minCapacity; - minFillRate; - scaleConstant; - smooth; - currentCapacity = 0; - enabled = false; - lastMaxRate = 0; - measuredTxRate = 0; - requestCount = 0; - fillRate; - lastThrottleTime; - lastTimestamp = 0; - lastTxRateBucket; - maxCapacity; - timeWindow = 0; - constructor(options) { - this.beta = options?.beta ?? 0.7; - this.minCapacity = options?.minCapacity ?? 1; - this.minFillRate = options?.minFillRate ?? 0.5; - this.scaleConstant = options?.scaleConstant ?? 0.4; - this.smooth = 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() / 1000; - } - 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) * 1000; - await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay)); +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.sdkStreamMixin = void 0; +const node_http_handler_1 = __nccwpck_require__(9245); +const util_buffer_from_1 = __nccwpck_require__(4151); +const stream_1 = __nccwpck_require__(2203); +const sdk_stream_mixin_browser_1 = __nccwpck_require__(2207); +const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; +const sdkStreamMixin = (stream) => { + if (!(stream instanceof stream_1.Readable)) { + try { + return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream); } - this.currentCapacity = this.currentCapacity - amount; - } - refillTokenBucket() { - const timestamp = this.getCurrentTimeInSeconds(); - if (!this.lastTimestamp) { - this.lastTimestamp = timestamp; - return; + catch (e) { + const name = stream?.__proto__?.constructor?.name || stream; + throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); } - 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 (serviceErrorClassification.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()); + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } - 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); + 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 === undefined || Buffer.isEncoding(encoding)) { + return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); + } + else { + const decoder = new TextDecoder(encoding); + return decoder.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 ensure a polyfill is available."); + } + transformed = true; + return stream_1.Readable.toWeb(stream); + }, + }); +}; +exports.sdkStreamMixin = sdkStreamMixin; + + +/***/ }), + +/***/ 7570: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.splitStream = splitStream; +async function splitStream(stream) { + if (typeof stream.stream === "function") { + stream = stream.stream(); } - 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; - } + const readableStream = stream; + return readableStream.tee(); +} + + +/***/ }), + +/***/ 2108: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.splitStream = splitStream; +const stream_1 = __nccwpck_require__(2203); +const splitStream_browser_1 = __nccwpck_require__(7570); +const stream_type_check_1 = __nccwpck_require__(4414); +async function splitStream(stream) { + if ((0, stream_type_check_1.isReadableStream)(stream) || (0, stream_type_check_1.isBlob)(stream)) { + return (0, splitStream_browser_1.splitStream)(stream); } - getPrecise(num) { - return parseFloat(num.toFixed(8)); + const stream1 = new stream_1.PassThrough(); + const stream2 = new stream_1.PassThrough(); + stream.pipe(stream1); + stream.pipe(stream2); + return [stream1, stream2]; +} + + +/***/ }), + +/***/ 4414: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isBlob = exports.isReadableStream = void 0; +const isReadableStream = (stream) => typeof ReadableStream === "function" && + (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream); +exports.isReadableStream = isReadableStream; +const isBlob = (blob) => { + return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob); +}; +exports.isBlob = isBlob; + + +/***/ }), + +/***/ 9245: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var protocolHttp = __nccwpck_require__(2356); +var querystringBuilder = __nccwpck_require__(8256); +var http = __nccwpck_require__(8611); +var https = __nccwpck_require__(5692); +var stream = __nccwpck_require__(2203); +var http2 = __nccwpck_require__(5675); + +function buildAbortError(abortSignal) { + const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal + ? abortSignal.reason + : undefined; + if (reason) { + if (reason instanceof Error) { + return reason; + } + const abortError = new Error(String(reason)); + abortError.name = "AbortError"; + return abortError; } + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return abortError; } -const DEFAULT_RETRY_DELAY_BASE = 100; -const MAXIMUM_RETRY_DELAY = 20 * 1000; -const THROTTLING_RETRY_DELAY_BASE = 500; -const INITIAL_RETRY_TOKENS = 500; -const RETRY_COST = 5; -const TIMEOUT_RETRY_COST = 10; -const NO_RETRY_INCREMENT = 1; -const INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; -const REQUEST_HEADER = "amz-sdk-request"; +const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; -const getDefaultRetryBackoffStrategy = () => { - let delayBase = DEFAULT_RETRY_DELAY_BASE; - const computeNextBackoffDelay = (attempts) => { - return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); - }; - const setDelayBase = (delay) => { - delayBase = delay; - }; - return { - computeNextBackoffDelay, - setDelayBase, - }; +const getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; }; -const createDefaultRetryToken = ({ retryDelay, retryCount, retryCost, }) => { - const getRetryCount = () => retryCount; - const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay); - const getRetryCost = () => retryCost; - return { - getRetryCount, - getRetryDelay, - getRetryCost, +const timing = { + setTimeout: (cb, ms) => setTimeout(cb, ms), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), +}; + +const DEFER_EVENT_LISTENER_TIME$2 = 1000; +const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return -1; + } + const registerTimeout = (offset) => { + const timeoutId = timing.setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { + name: "TimeoutError", + })); + }, timeoutInMs - offset); + const doWithSocket = (socket) => { + if (socket?.connecting) { + socket.on("connect", () => { + timing.clearTimeout(timeoutId); + }); + } + else { + timing.clearTimeout(timeoutId); + } + }; + if (request.socket) { + doWithSocket(request.socket); + } + else { + request.on("socket", doWithSocket); + } }; + if (timeoutInMs < 2000) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2); }; -class StandardRetryStrategy { - maxAttempts; - mode = exports.RETRY_MODES.STANDARD; - capacity = INITIAL_RETRY_TOKENS; - retryBackoffStrategy = getDefaultRetryBackoffStrategy(); - maxAttemptsProvider; - constructor(maxAttempts) { - this.maxAttempts = maxAttempts; - this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; +const setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => { + if (timeoutInMs) { + return timing.setTimeout(() => { + let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; + if (throwOnRequestTimeout) { + const error = Object.assign(new Error(msg), { + name: "TimeoutError", + code: "ETIMEDOUT", + }); + req.destroy(error); + reject(error); + } + else { + msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; + logger?.warn?.(msg); + } + }, timeoutInMs); } - async acquireInitialRetryToken(retryTokenScope) { - return createDefaultRetryToken({ - retryDelay: DEFAULT_RETRY_DELAY_BASE, - retryCount: 0, - }); + return -1; +}; + +const DEFER_EVENT_LISTENER_TIME$1 = 3000; +const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => { + if (keepAlive !== true) { + return -1; } - 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, + const registerListener = () => { + if (request.socket) { + request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + } + else { + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); }); } - throw new Error("No retry token available"); - } - recordSuccess(token) { - this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); - } - getCapacity() { - return this.capacity; + }; + if (deferTimeMs === 0) { + registerListener(); + return 0; } - async getMaxAttempts() { - try { - return await this.maxAttemptsProvider(); + return timing.setTimeout(registerListener, deferTimeMs); +}; + +const DEFER_EVENT_LISTENER_TIME = 3000; +const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + const registerTimeout = (offset) => { + const timeout = timeoutInMs - offset; + const onTimeout = () => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); + }; + if (request.socket) { + request.socket.setTimeout(timeout, onTimeout); + request.on("close", () => request.socket?.removeListener("timeout", onTimeout)); } - catch (error) { - console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); - return DEFAULT_MAX_ATTEMPTS; + else { + request.setTimeout(timeout, onTimeout); } + }; + if (0 < timeoutInMs && timeoutInMs < 6000) { + registerTimeout(0); + return 0; } - shouldRetry(tokenToRenew, errorInfo, maxAttempts) { - const attempts = tokenToRenew.getRetryCount() + 1; - return (attempts < maxAttempts && - this.capacity >= this.getCapacityCost(errorInfo.errorType) && - this.isRetryableError(errorInfo.errorType)); + return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); +}; + +const MIN_WAIT_TIME = 6_000; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { + const headers = request.headers ?? {}; + const expect = headers.Expect || headers.expect; + let timeoutId = -1; + let sendBody = true; + if (!externalAgent && expect === "100-continue") { + sendBody = await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + timing.clearTimeout(timeoutId); + resolve(true); + }); + httpRequest.on("response", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + httpRequest.on("error", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + }), + ]); } - getCapacityCost(errorType) { - return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; + if (sendBody) { + writeBody(httpRequest, request.body); } - isRetryableError(errorType) { - return errorType === "THROTTLING" || errorType === "TRANSIENT"; +} +function writeBody(httpRequest, body) { + if (body instanceof stream.Readable) { + body.pipe(httpRequest); + return; + } + if (body) { + const isBuffer = Buffer.isBuffer(body); + const isString = typeof body === "string"; + if (isBuffer || isString) { + if (isBuffer && body.byteLength === 0) { + httpRequest.end(); + } + else { + 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(); } -class AdaptiveRetryStrategy { - maxAttemptsProvider; - rateLimiter; - standardRetryStrategy; - mode = exports.RETRY_MODES.ADAPTIVE; - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - const { rateLimiter } = options ?? {}; - this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); - this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); +const DEFAULT_REQUEST_TIMEOUT = 0; +class NodeHttpHandler { + config; + configProvider; + socketWarningTimestamp = 0; + externalAgent = false; + metadata = { handlerProtocol: "http/1.1" }; + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new NodeHttpHandler(instanceOrOptions); } - async acquireInitialRetryToken(retryTokenScope) { - await this.rateLimiter.getSendToken(); - return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + static checkSocketUsage(agent, socketWarningTimestamp, logger = console) { + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15_000; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = sockets[origin]?.length ?? 0; + const requestsEnqueued = requests[origin]?.length ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + logger?.warn?.(`@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; } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - this.rateLimiter.updateClientSendingRate(errorInfo); - return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }) + .catch(reject); + } + else { + resolve(this.resolveDefaultConfig(options)); + } + }); } - recordSuccess(token) { - this.rateLimiter.updateClientSendingRate({}); - this.standardRetryStrategy.recordSuccess(token); + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout, + socketTimeout, + socketAcquisitionWarningTimeout, + throwOnRequestTimeout, + httpAgent: (() => { + if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") { + this.externalAgent = true; + return httpAgent; + } + return new http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") { + this.externalAgent = true; + return httpsAgent; + } + return new https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })(), + logger, + }; } -} - -class ConfiguredRetryStrategy extends StandardRetryStrategy { - computeNextBackoffDelay; - 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; + destroy() { + this.config?.httpAgent?.destroy(); + this.config?.httpsAgent?.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + if (!this.config) { + this.config = await this.configProvider; } + return new Promise((_resolve, _reject) => { + const config = this.config; + let writeRequestBodyPromise = undefined; + const timeouts = []; + const resolve = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _reject(arg); + }; + if (abortSignal?.aborted) { + const abortError = buildAbortError(abortSignal); + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const headers = request.headers ?? {}; + const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; + let agent = isSSL ? config.httpsAgent : config.httpAgent; + if (expectContinue && !this.externalAgent) { + agent = new (isSSL ? https.Agent : http.Agent)({ + keepAlive: false, + maxSockets: Infinity, + }); + } + timeouts.push(timing.setTimeout(() => { + this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); + }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2000) + (config.connectionTimeout ?? 1000))); + const queryString = querystringBuilder.buildQueryString(request.query || {}); + let auth = undefined; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}`; + } + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + let hostname = request.hostname ?? ""; + if (hostname[0] === "[" && hostname.endsWith("]")) { + hostname = request.hostname.slice(1, -1); + } + else { + hostname = request.hostname; + } + const nodeHttpsOptions = { + headers: request.headers, + host: hostname, + method: request.method, + path, + port: request.port, + agent, + auth, + }; + const requestFunc = isSSL ? https.request : http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocolHttp.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 = () => { + req.destroy(); + const abortError = buildAbortError(abortSignal); + reject(abortError); + }; + 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; + } + } + const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; + timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout)); + timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); + timeouts.push(setSocketTimeout(req, reject, config.socketTimeout)); + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + timeouts.push(setSocketKeepAlive(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs, + })); + } + writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e) => { + timeouts.forEach(timing.clearTimeout); + return _reject(e); + }); + }); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); - return token; + httpHandlerConfigs() { + return this.config ?? {}; } } -exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; -exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy; -exports.DEFAULT_MAX_ATTEMPTS = DEFAULT_MAX_ATTEMPTS; -exports.DEFAULT_RETRY_DELAY_BASE = DEFAULT_RETRY_DELAY_BASE; -exports.DEFAULT_RETRY_MODE = DEFAULT_RETRY_MODE; -exports.DefaultRateLimiter = DefaultRateLimiter; -exports.INITIAL_RETRY_TOKENS = INITIAL_RETRY_TOKENS; -exports.INVOCATION_ID_HEADER = INVOCATION_ID_HEADER; -exports.MAXIMUM_RETRY_DELAY = MAXIMUM_RETRY_DELAY; -exports.NO_RETRY_INCREMENT = NO_RETRY_INCREMENT; -exports.REQUEST_HEADER = REQUEST_HEADER; -exports.RETRY_COST = RETRY_COST; -exports.StandardRetryStrategy = StandardRetryStrategy; -exports.THROTTLING_RETRY_DELAY_BASE = THROTTLING_RETRY_DELAY_BASE; -exports.TIMEOUT_RETRY_COST = TIMEOUT_RETRY_COST; - - -/***/ }), - -/***/ 1732: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ByteArrayCollector = void 0; -class ByteArrayCollector { - allocByteArray; - byteLength = 0; - byteArrays = []; - constructor(allocByteArray) { - this.allocByteArray = allocByteArray; - } - push(byteArray) { - this.byteArrays.push(byteArray); - this.byteLength += byteArray.byteLength; +class NodeHttp2ConnectionPool { + sessions = []; + constructor(sessions) { + this.sessions = sessions ?? []; } - flush() { - if (this.byteArrays.length === 1) { - const bytes = this.byteArrays[0]; - this.reset(); - return bytes; - } - const aggregation = this.allocByteArray(this.byteLength); - let cursor = 0; - for (let i = 0; i < this.byteArrays.length; ++i) { - const bytes = this.byteArrays[i]; - aggregation.set(bytes, cursor); - cursor += bytes.byteLength; + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); } - this.reset(); - return aggregation; } - reset() { - this.byteArrays = []; - this.byteLength = 0; + 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(); + } + } + } } } -exports.ByteArrayCollector = ByteArrayCollector; - - -/***/ }), - -/***/ 7753: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ChecksumStream = void 0; -const ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function () { }; -class ChecksumStream extends ReadableStreamRef { -} -exports.ChecksumStream = ChecksumStream; - - -/***/ }), - -/***/ 1775: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ChecksumStream = void 0; -const util_base64_1 = __nccwpck_require__(8385); -const stream_1 = __nccwpck_require__(2203); -class ChecksumStream extends stream_1.Duplex { - expectedChecksum; - checksumSourceLocation; - checksum; - source; - base64Encoder; - constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }) { - super(); - if (typeof source.pipe === "function") { - this.source = source; +class NodeHttp2ConnectionManager { + constructor(config) { + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); } - else { - throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); + } + config; + sessionCache = new Map(); + lease(requestContext, connectionConfiguration) { + const url = this.getUrlString(requestContext); + const existingPool = this.sessionCache.get(url); + if (existingPool) { + const existingSession = existingPool.poll(); + if (existingSession && !this.config.disableConcurrency) { + return existingSession; + } } - this.base64Encoder = base64Encoder ?? util_base64_1.toBase64; - this.expectedChecksum = expectedChecksum; - this.checksum = checksum; - this.checksumSourceLocation = checksumSourceLocation; - this.source.pipe(this); + const session = http2.connect(url); + 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 = () => { + session.destroy(); + this.deleteSession(url, session); + }; + session.on("goaway", destroySessionCb); + session.on("error", destroySessionCb); + session.on("frameError", destroySessionCb); + session.on("close", () => this.deleteSession(url, session)); + if (connectionConfiguration.requestTimeout) { + session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); + } + const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool(); + connectionPool.offerLast(session); + this.sessionCache.set(url, connectionPool); + return session; } - _read(size) { } - _write(chunk, encoding, callback) { - try { - this.checksum.update(chunk); - this.push(chunk); + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; } - catch (e) { - return callback(e); + if (!existingConnectionPool.contains(session)) { + return; } - return callback(); + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); } - 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}".`)); + release(requestContext, session) { + const cacheKey = this.getUrlString(requestContext); + this.sessionCache.get(cacheKey)?.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); } - catch (e) { - return callback(e); + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (maxConcurrentStreams && maxConcurrentStreams <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); } - this.push(null); - return callback(); + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); } } -exports.ChecksumStream = ChecksumStream; - - -/***/ }), - -/***/ 4129: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createChecksumStream = void 0; -const util_base64_1 = __nccwpck_require__(8385); -const stream_type_check_1 = __nccwpck_require__(4414); -const ChecksumStream_browser_1 = __nccwpck_require__(7753); -const createChecksumStream = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }) => { - if (!(0, stream_type_check_1.isReadableStream)(source)) { - throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); - } - const encoder = base64Encoder ?? util_base64_1.toBase64; - if (typeof TransformStream !== "function") { - throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream."); +class NodeHttp2Handler { + config; + configProvider; + metadata = { handlerProtocol: "h2" }; + connectionManager = new NodeHttp2ConnectionManager({}); + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new NodeHttp2Handler(instanceOrOptions); } - 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); + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((opts) => { + resolve(opts || {}); + }) + .catch(reject); } else { - controller.terminate(); + resolve(options || {}); } - }, - }); - source.pipeThrough(transform); - const readable = transform.readable; - Object.setPrototypeOf(readable, ChecksumStream_browser_1.ChecksumStream.prototype); - return readable; -}; -exports.createChecksumStream = createChecksumStream; - - -/***/ }), - -/***/ 5639: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createChecksumStream = createChecksumStream; -const stream_type_check_1 = __nccwpck_require__(4414); -const ChecksumStream_1 = __nccwpck_require__(1775); -const createChecksumStream_browser_1 = __nccwpck_require__(4129); -function createChecksumStream(init) { - if (typeof ReadableStream === "function" && (0, stream_type_check_1.isReadableStream)(init.source)) { - return (0, createChecksumStream_browser_1.createChecksumStream)(init); + }); } - return new ChecksumStream_1.ChecksumStream(init); -} - - -/***/ }), - -/***/ 2005: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createBufferedReadable = createBufferedReadable; -const node_stream_1 = __nccwpck_require__(7075); -const ByteArrayCollector_1 = __nccwpck_require__(1732); -const createBufferedReadableStream_1 = __nccwpck_require__(8213); -const stream_type_check_1 = __nccwpck_require__(4414); -function createBufferedReadable(upstream, size, logger) { - if ((0, stream_type_check_1.isReadableStream)(upstream)) { - return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger); + destroy() { + this.connectionManager.destroy(); } - const downstream = new node_stream_1.Readable({ read() { } }); - let streamBufferingLoggedWarning = false; - let bytesSeen = 0; - const buffers = [ - "", - new ByteArrayCollector_1.ByteArrayCollector((size) => new Uint8Array(size)), - new ByteArrayCollector_1.ByteArrayCollector((size) => Buffer.from(new Uint8Array(size))), - ]; - let mode = -1; - upstream.on("data", (chunk) => { - const chunkMode = (0, createBufferedReadableStream_1.modeOf)(chunk, true); - if (mode !== chunkMode) { - if (mode >= 0) { - downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode)); - } - mode = chunkMode; - } - if (mode === -1) { - downstream.push(chunk); - return; - } - const chunkSize = (0, createBufferedReadableStream_1.sizeOf)(chunk); - bytesSeen += chunkSize; - const bufferSize = (0, createBufferedReadableStream_1.sizeOf)(buffers[mode]); - if (chunkSize >= size && bufferSize === 0) { - downstream.push(chunk); - } - else { - const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk); - if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { - streamBufferingLoggedWarning = true; - logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); - } - if (newSize >= size) { - downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode)); + async handle(request, { abortSignal, requestTimeout } = {}) { + 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); } } - }); - upstream.on("end", () => { - if (mode !== -1) { - const remainder = (0, createBufferedReadableStream_1.flush)(buffers, mode); - if ((0, createBufferedReadableStream_1.sizeOf)(remainder) > 0) { - downstream.push(remainder); + const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config; + const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; + return new Promise((_resolve, _reject) => { + let fulfilled = false; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal?.aborted) { + fulfilled = true; + const abortError = buildAbortError(abortSignal); + reject(abortError); + return; } - } - downstream.push(null); - }); - return downstream; -} - - -/***/ }), - -/***/ 8213: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createBufferedReadable = void 0; -exports.createBufferedReadableStream = createBufferedReadableStream; -exports.merge = merge; -exports.flush = flush; -exports.sizeOf = sizeOf; -exports.modeOf = modeOf; -const ByteArrayCollector_1 = __nccwpck_require__(1732); -function createBufferedReadableStream(upstream, size, logger) { - const reader = upstream.getReader(); - let streamBufferingLoggedWarning = false; - let bytesSeen = 0; - const buffers = ["", new ByteArrayCollector_1.ByteArrayCollector((size) => new Uint8Array(size))]; - let mode = -1; - const pull = async (controller) => { - const { value, done } = await reader.read(); - const chunk = value; - if (done) { - if (mode !== -1) { - const remainder = flush(buffers, mode); - if (sizeOf(remainder) > 0) { - controller.enqueue(remainder); - } + const { hostname, method, port, protocol, query } = request; + let auth = ""; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}@`; } - controller.close(); - } - else { - const chunkMode = modeOf(chunk, false); - if (mode !== chunkMode) { - if (mode >= 0) { - controller.enqueue(flush(buffers, mode)); + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: this.config?.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false, + }); + const rejectWithDestroy = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); } - mode = chunkMode; - } - if (mode === -1) { - controller.enqueue(chunk); - return; + fulfilled = true; + reject(err); + }; + const queryString = querystringBuilder.buildQueryString(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; } - const chunkSize = sizeOf(chunk); - bytesSeen += chunkSize; - const bufferSize = sizeOf(buffers[mode]); - if (chunkSize >= size && bufferSize === 0) { - controller.enqueue(chunk); + if (request.fragment) { + path += `#${request.fragment}`; } - else { - const newSize = merge(buffers, mode, chunk); - if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { - streamBufferingLoggedWarning = true; - logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); + const req = session.request({ + ...request.headers, + [http2.constants.HTTP2_HEADER_PATH]: path, + [http2.constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocolHttp.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 (newSize >= size) { - controller.enqueue(flush(buffers, mode)); + }); + if (effectiveRequestTimeout) { + req.setTimeout(effectiveRequestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + const onAbort = () => { + req.close(); + const abortError = buildAbortError(abortSignal); + rejectWithDestroy(abortError); + }; + if (typeof abortSignal.addEventListener === "function") { + const signal = abortSignal; + signal.addEventListener("abort", onAbort, { once: true }); + req.once("close", () => signal.removeEventListener("abort", onAbort)); } else { - await pull(controller); + abortSignal.onabort = onAbort; } } - } - }; - return new ReadableStream({ - pull, - }); -} -exports.createBufferedReadable = createBufferedReadableStream; -function merge(buffers, mode, chunk) { - switch (mode) { - case 0: - buffers[0] += chunk; - return sizeOf(buffers[0]); - case 1: - case 2: - buffers[mode].push(chunk); - return sizeOf(buffers[mode]); - } -} -function flush(buffers, mode) { - switch (mode) { - case 0: - const s = buffers[0]; - buffers[0] = ""; - return s; - case 1: - case 2: - return buffers[mode].flush(); + 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, request, effectiveRequestTimeout); + }); } - throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`); -} -function sizeOf(chunk) { - return chunk?.byteLength ?? chunk?.length ?? 0; -} -function modeOf(chunk, allowBuffer = true) { - if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) { - return 2; + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); } - if (chunk instanceof Uint8Array) { - return 1; + httpHandlerConfigs() { + return this.config ?? {}; } - if (typeof chunk === "string") { - return 0; + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } } - return -1; } - -/***/ }), - -/***/ 6522: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAwsChunkedEncodingStream = void 0; -const stream_1 = __nccwpck_require__(2203); -const getAwsChunkedEncodingStream = (readableStream, options) => { - const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; - const checksumRequired = base64Encoder !== undefined && - checksumAlgorithmFn !== undefined && - checksumLocationName !== undefined && - streamHasher !== undefined; - const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined; - const awsChunkedEncodingStream = new stream_1.Readable({ read: () => { } }); - readableStream.on("data", (data) => { - const length = bodyLengthChecker(data) || 0; - awsChunkedEncodingStream.push(`${length.toString(16)}\r\n`); - awsChunkedEncodingStream.push(data); - awsChunkedEncodingStream.push("\r\n"); - }); - readableStream.on("end", async () => { - awsChunkedEncodingStream.push(`0\r\n`); - if (checksumRequired) { - const checksum = base64Encoder(await digest); - awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`); - awsChunkedEncodingStream.push(`\r\n`); - } - awsChunkedEncodingStream.push(null); - }); - return awsChunkedEncodingStream; -}; -exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; - - -/***/ }), - -/***/ 66: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.headStream = headStream; -async function headStream(stream, bytes) { - 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 += value?.byteLength ?? 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; +class Collector extends stream.Writable { + bufferedBytes = []; + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); } - return collected; } - -/***/ }), - -/***/ 8412: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.headStream = void 0; -const stream_1 = __nccwpck_require__(2203); -const headStream_browser_1 = __nccwpck_require__(66); -const stream_type_check_1 = __nccwpck_require__(4414); -const headStream = (stream, bytes) => { - if ((0, stream_type_check_1.isReadableStream)(stream)) { - return (0, headStream_browser_1.headStream)(stream, bytes); +const streamCollector = (stream) => { + if (isReadableStreamInstance(stream)) { + return collectReadableStream(stream); } return new Promise((resolve, reject) => { const collector = new Collector(); - collector.limit = bytes; stream.pipe(collector); stream.on("error", (err) => { collector.end(); @@ -25109,318 +27315,38 @@ const headStream = (stream, bytes) => { }); collector.on("error", reject); collector.on("finish", function () { - const bytes = new Uint8Array(Buffer.concat(this.buffers)); + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); resolve(bytes); }); }); }; -exports.headStream = headStream; -class Collector extends stream_1.Writable { - buffers = []; - limit = Infinity; - bytesBuffered = 0; - _write(chunk, encoding, callback) { - this.buffers.push(chunk); - this.bytesBuffered += chunk.byteLength ?? 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(); - } -} - - -/***/ }), - -/***/ 4252: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var utilBase64 = __nccwpck_require__(8385); -var utilUtf8 = __nccwpck_require__(1577); -var ChecksumStream = __nccwpck_require__(1775); -var createChecksumStream = __nccwpck_require__(5639); -var createBufferedReadable = __nccwpck_require__(2005); -var getAwsChunkedEncodingStream = __nccwpck_require__(6522); -var headStream = __nccwpck_require__(8412); -var sdkStreamMixin = __nccwpck_require__(7201); -var splitStream = __nccwpck_require__(2108); -var streamTypeCheck = __nccwpck_require__(4414); - -class Uint8ArrayBlobAdapter extends Uint8Array { - static fromString(source, encoding = "utf-8") { - if (typeof source === "string") { - if (encoding === "base64") { - return Uint8ArrayBlobAdapter.mutate(utilBase64.fromBase64(source)); - } - return Uint8ArrayBlobAdapter.mutate(utilUtf8.fromUtf8(source)); - } - throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); - } - static mutate(source) { - Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype); - return source; - } - transformToString(encoding = "utf-8") { - if (encoding === "base64") { - return utilBase64.toBase64(this); - } - return utilUtf8.toUtf8(this); - } -} - -exports.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter; -Object.keys(ChecksumStream).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return ChecksumStream[k]; } - }); -}); -Object.keys(createChecksumStream).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return createChecksumStream[k]; } - }); -}); -Object.keys(createBufferedReadable).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return createBufferedReadable[k]; } - }); -}); -Object.keys(getAwsChunkedEncodingStream).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return getAwsChunkedEncodingStream[k]; } - }); -}); -Object.keys(headStream).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return headStream[k]; } - }); -}); -Object.keys(sdkStreamMixin).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return sdkStreamMixin[k]; } - }); -}); -Object.keys(splitStream).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return splitStream[k]; } - }); -}); -Object.keys(streamTypeCheck).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return streamTypeCheck[k]; } - }); -}); - - -/***/ }), - -/***/ 2207: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sdkStreamMixin = void 0; -const fetch_http_handler_1 = __nccwpck_require__(7809); -const util_base64_1 = __nccwpck_require__(8385); -const util_hex_encoding_1 = __nccwpck_require__(6435); -const util_utf8_1 = __nccwpck_require__(1577); -const stream_type_check_1 = __nccwpck_require__(4414); -const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; -const sdkStreamMixin = (stream) => { - if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) { - const name = stream?.__proto__?.constructor?.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.\n" + - "If 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: 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 === undefined || 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}`); - } - }, - }); -}; -exports.sdkStreamMixin = sdkStreamMixin; -const isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob; - - -/***/ }), - -/***/ 7201: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sdkStreamMixin = void 0; -const node_http_handler_1 = __nccwpck_require__(1279); -const util_buffer_from_1 = __nccwpck_require__(4151); -const stream_1 = __nccwpck_require__(2203); -const sdk_stream_mixin_browser_1 = __nccwpck_require__(2207); -const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; -const sdkStreamMixin = (stream) => { - if (!(stream instanceof stream_1.Readable)) { - try { - return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream); - } - catch (e) { - const name = stream?.__proto__?.constructor?.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); +const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream; +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; } - 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 === undefined || Buffer.isEncoding(encoding)) { - return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); - } - else { - const decoder = new TextDecoder(encoding); - return decoder.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 ensure a polyfill is available."); - } - transformed = true; - return stream_1.Readable.toWeb(stream); - }, - }); -}; -exports.sdkStreamMixin = sdkStreamMixin; - - -/***/ }), - -/***/ 7570: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitStream = splitStream; -async function splitStream(stream) { - if (typeof stream.stream === "function") { - stream = stream.stream(); + isDone = done; } - const readableStream = stream; - return readableStream.tee(); -} - - -/***/ }), - -/***/ 2108: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitStream = splitStream; -const stream_1 = __nccwpck_require__(2203); -const splitStream_browser_1 = __nccwpck_require__(7570); -const stream_type_check_1 = __nccwpck_require__(4414); -async function splitStream(stream) { - if ((0, stream_type_check_1.isReadableStream)(stream) || (0, stream_type_check_1.isBlob)(stream)) { - return (0, splitStream_browser_1.splitStream)(stream); + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; } - const stream1 = new stream_1.PassThrough(); - const stream2 = new stream_1.PassThrough(); - stream.pipe(stream1); - stream.pipe(stream2); - return [stream1, stream2]; + return collected; } - -/***/ }), - -/***/ 4414: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isBlob = exports.isReadableStream = void 0; -const isReadableStream = (stream) => typeof ReadableStream === "function" && - (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream); -exports.isReadableStream = isReadableStream; -const isBlob = (blob) => { - return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob); -}; -exports.isBlob = isBlob; +exports.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; +exports.NodeHttp2Handler = NodeHttp2Handler; +exports.NodeHttpHandler = NodeHttpHandler; +exports.streamCollector = streamCollector; /***/ }), @@ -62368,6 +64294,14 @@ module.exports = require("node:buffer"); /***/ }), +/***/ 1421: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:child_process"); + +/***/ }), + /***/ 7540: /***/ ((module) => { @@ -62448,6 +64382,22 @@ module.exports = require("node:net"); /***/ }), +/***/ 8161: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:os"); + +/***/ }), + +/***/ 6760: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:path"); + +/***/ }), + /***/ 643: /***/ ((module) => { @@ -62456,6 +64406,14 @@ module.exports = require("node:perf_hooks"); /***/ }), +/***/ 1708: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:process"); + +/***/ }), + /***/ 1792: /***/ ((module) => { @@ -62536,14 +64494,6 @@ module.exports = require("path"); /***/ }), -/***/ 932: -/***/ ((module) => { - -"use strict"; -module.exports = require("process"); - -/***/ }), - /***/ 2203: /***/ ((module) => { @@ -62603,7 +64553,7 @@ module.exports = require("util"); /***/ 591: /***/ ((module) => { -(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>ft,XMLParser:()=>st,XMLValidator:()=>mt});const n=":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",i=new RegExp("^["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function s(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)f+=t[o];if(f=f.trim(),"/"===f[f.length-1]&&(f=f.substring(0,f.length-1),o--),!r(f)){let e;return e=0===f.trim().length?"Invalid space after '<'.":"Tag '"+f+"' is an invalid name.",x("InvalidTag",e,N(t,o))}const p=c(t,o);if(!1===p)return x("InvalidAttr","Attributes for '"+f+"' have open quote.",N(t,o));let b=p.value;if(o=p.index,"/"===b[b.length-1]){const n=o-b.length;b=b.substring(0,b.length-1);const s=g(b,e);if(!0!==s)return x(s.err.code,s.err.msg,N(t,n+s.err.line));i=!0}else if(d){if(!p.tagClosed)return x("InvalidTag","Closing tag '"+f+"' doesn't have proper closing.",N(t,o));if(b.trim().length>0)return x("InvalidTag","Closing tag '"+f+"' can't have attributes or invalid starting.",N(t,a));if(0===n.length)return x("InvalidTag","Closing tag '"+f+"' has not been opened.",N(t,a));{const e=n.pop();if(f!==e.tagName){let n=N(t,e.tagStartPos);return x("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+f+"'.",N(t,a))}0==n.length&&(s=!0)}}else{const r=g(b,e);if(!0!==r)return x(r.err.code,r.err.msg,N(t,o-b.length+r.err.line));if(!0===s)return x("InvalidXml","Multiple possible root nodes found.",N(t,o));-1!==e.unpairedTags.indexOf(f)||n.push({tagName:f,tagStartPos:a}),i=!0}for(o++;o0)||x("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):x("InvalidXml","Start tag expected.",1)}function l(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function u(t,e){const n=e;for(;e5&&"xml"===i)return x("InvalidXml","XML declaration allowed only at the start of the document.",N(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function h(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}const d='"',f="'";function c(t,e){let n="",i="",s=!1;for(;e"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const p=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function g(t,e){const n=s(t,p),i={};for(let t=0;t!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1};let y;y="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class T{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][y]={startIndex:e})}static getMetaDataSymbol(){return y}}function w(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o="";for(;e"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,i--):i--,0===i)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&C(t,"!ENTITY",e)){let i,s;e+=7,[i,s,e]=O(t,e+1),-1===s.indexOf("&")&&(n[i]={regx:RegExp(`&${i};`,"g"),val:s})}else if(s&&C(t,"!ELEMENT",e)){e+=8;const{index:n}=S(t,e+1);e=n}else if(s&&C(t,"!ATTLIST",e))e+=8;else if(s&&C(t,"!NOTATION",e)){e+=9;const{index:n}=A(t,e+1);e=n}else{if(!C(t,"!--",e))throw new Error("Invalid DOCTYPE");r=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}const P=(t,e)=>{for(;e{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}class k{constructor(t){this.options=t,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:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCodePoint(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCodePoint(Number.parseInt(e,16))}},this.addExternalEntities=F,this.parseXml=X,this.parseTextData=L,this.resolveNameSpace=B,this.buildAttributesMap=G,this.isItStopNode=Z,this.replaceEntitiesValue=R,this.readStopNodeData=J,this.saveTextToParentTag=q,this.addChild=Y,this.ignoreAttributesFn=_(this.options.ignoreAttributes)}}function F(t){const e=Object.keys(t);for(let n=0;n0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,r);return null==i?t:typeof i!=typeof t||i!==t?i:this.options.trimValues||t.trim()===t?H(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function B(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const U=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function G(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const n=s(t,U),i=n.length,r={};for(let t=0;t",r,"Closing Tag is not closed.");let o=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: `);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",r=e}else if("?"===t[r+1]){let e=z(t,r,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new T(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s,r)}r=e.closeIndex+1}else if("!--"===t.substr(r+1,3)){const e=W(t,"--\x3e",r+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(r+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}r=e}else if("!D"===t.substr(r+1,2)){const e=w(t,r);this.docTypeEntities=e.entities,r=e.i}else if("!["===t.substr(r+1,2)){const e=W(t,"]]>",r,"CDATA is not closed.")-2,o=t.substring(r+9,e);i=this.saveTextToParentTag(i,n,s);let a=this.parseTextData(o,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,a),r=e+2}else{let o=z(t,r,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let u=o.tagExp,h=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const f=n;f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==e.tagname&&(s+=s?"."+a:a);const c=r;if(this.isItStopNode(this.options.stopNodes,s,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),r=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))r=o.closeIndex;else{const n=this.readStopNodeData(t,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);r=n.i,e=n.tagContent}const i=new T(a);a!==u&&h&&(i[":@"]=this.buildAttributesMap(u,s,a)),e&&(e=this.parseTextData(e,a,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s,c)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new T(a);a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,c),s=s.substr(0,s.lastIndexOf("."))}else{const t=new T(a);this.tagsNodeStack.push(n),a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,c),n=t}i="",r=d}}else i+=t[r];return e.child};function Y(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.updateTag(e.tagname,n,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}const R=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function q(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Z(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function W(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function z(t,e,n,i=">"){const s=function(t,e,n=">"){let i,s="";for(let r=e;r",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if("?"===t[n+1])n=W(t,"?>",n+1,"StopNode is not closed.");else if("!--"===t.substr(n+1,3))n=W(t,"--\x3e",n+3,"StopNode is not closed.");else if("!["===t.substr(n+1,2))n=W(t,"]]>",n,"StopNode is not closed.")-2;else{const i=z(t,n,">");i&&((i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex)}}function H(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&function(t,e={}){if(e=Object.assign({},V,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===t)return 0;if(e.hex&&j.test(n))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n);if(-1!==n.search(/.+[eE].+/))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(M);if(i){let s=i[1]||"";const r=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:1!==o.length||!i[3].startsWith(`.${r}`)&&i[3][0]!==r?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const s=D.exec(n);if(s){const r=s[1]||"",o=s[2];let a=(i=s[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const l=r?"."===t[o.length+1]:"."===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!l))return t;{const i=Number(n),s=String(i);if(0===i||-0===i)return i;if(-1!==s.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===s||s===a||s===`${r}${a}`?i:t;let l=o?a:n;return o?l===s||r+l===s?i:t:l===s||l===r+s?i:t}}return t}var i}(t,n)}return void 0!==t?t:""}const K=T.getMetaDataSymbol();function Q(t,e){return tt(t,e)}function tt(t,e,n){let i;const s={};for(let r=0;r0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function et(t){const e=Object.keys(t);for(let t=0;t0&&(n="\n"),ot(t,e,"",n)}function ot(t,e,n,i){let s="",r=!1;for(let o=0;o`,r=!1;continue}if(l===e.commentPropName){s+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=lt(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${l}${o}${t}?>`,r=!0;continue}let h=i;""!==h&&(h+=e.indentBy);const d=i+`<${l}${lt(a[":@"],e)}`,f=ot(a[l],e,u,h);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=d+">":s+=d+"/>":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(">")?s+=d+`>${f}${i}`:(s+=d+">",f&&""!==i&&(f.includes("/>")||f.includes("`):s+=d+"/>",r=!0}return s}function at(t){const e=Object.keys(t);for(let n=0;n0&&e.processEntities)for(let n=0;n","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ft(t){this.options=Object.assign({},dt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=_(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=gt),this.processTextOrObjNode=ct,this.options.format?(this.indentate=pt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ct(t,e,n,i){const s=this.j2x(t,n+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,n):this.buildObjectNode(s.val,e,s.attrStr,n)}function pt(t){return this.options.indentBy.repeat(t)}function gt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}ft.prototype.build=function(t){return this.options.preserveOrder?rt(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},ft.prototype.j2x=function(t,e,n){let i="",s="";const r=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(s+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?s+="":"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const n=this.isAttribute(o);if(n&&!this.ignoreAttributesFn(n,r))i+=this.buildAttrPairStr(n,""+t[o]);else if(!n)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(e)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const i=t[o].length;let r="",a="";for(let l=0;l"+t+s}},ft.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"0&&this.options.processEntities)for(let e=0;e{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>gt,XMLParser:()=>it,XMLValidator:()=>xt});const n=":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",i=new RegExp("^["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function s(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t"!==t[r]&&" "!==t[r]&&"\t"!==t[r]&&"\n"!==t[r]&&"\r"!==t[r];r++)h+=t[r];if(h=h.trim(),"/"===h[h.length-1]&&(h=h.substring(0,h.length-1),r--),!b(h)){let e;return e=0===h.trim().length?"Invalid space after '<'.":"Tag '"+h+"' is an invalid name.",m("InvalidTag",e,N(t,r))}const p=c(t,r);if(!1===p)return m("InvalidAttr","Attributes for '"+h+"' have open quote.",N(t,r));let f=p.value;if(r=p.index,"/"===f[f.length-1]){const n=r-f.length;f=f.substring(0,f.length-1);const s=g(f,e);if(!0!==s)return m(s.err.code,s.err.msg,N(t,n+s.err.line));i=!0}else if(a){if(!p.tagClosed)return m("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",N(t,r));if(f.trim().length>0)return m("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",N(t,o));if(0===n.length)return m("InvalidTag","Closing tag '"+h+"' has not been opened.",N(t,o));{const e=n.pop();if(h!==e.tagName){let n=N(t,e.tagStartPos);return m("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+h+"'.",N(t,o))}0==n.length&&(s=!0)}}else{const a=g(f,e);if(!0!==a)return m(a.err.code,a.err.msg,N(t,r-f.length+a.err.line));if(!0===s)return m("InvalidXml","Multiple possible root nodes found.",N(t,r));-1!==e.unpairedTags.indexOf(h)||n.push({tagName:h,tagStartPos:o}),i=!0}for(r++;r0)||m("InvalidXml","Invalid '"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):m("InvalidXml","Start tag expected.",1)}function l(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function u(t,e){const n=e;for(;e5&&"xml"===i)return m("InvalidXml","XML declaration allowed only at the start of the document.",N(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function d(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}const h='"',p="'";function c(t,e){let n="",i="",s=!1;for(;e"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const f=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function g(t,e){const n=s(t,f),i={};for(let t=0;t!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0};function w(t){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,allowedTags:null,tagFilter:null}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:t.maxEntitySize??1e4,maxExpansionDepth:t.maxExpansionDepth??10,maxTotalExpansions:t.maxTotalExpansions??1e3,maxExpandedLength:t.maxExpandedLength??1e5,allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:w(!0)}const v=function(t){const e=Object.assign({},T,t);return e.processEntities=w(e.processEntities),e};let O;O="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class I{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][O]={startIndex:e})}static getMetaDataSymbol(){return O}}class P{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){const n=Object.create(null);if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o="";for(;e"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,i--):i--,0===i)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&S(t,"!ENTITY",e)){let i,s;if(e+=7,[i,s,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===s.indexOf("&")){const t=i.replace(/[.\-+*:]/g,"\\.");n[i]={regx:RegExp(`&${t};`,"g"),val:s}}}else if(s&&S(t,"!ELEMENT",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(s&&S(t,"!ATTLIST",e))e+=8;else if(s&&S(t,"!NOTATION",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!S(t,"!--",e))throw new Error("Invalid DOCTYPE");r=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}readEntityExp(t,e){e=A(t,e);let n="";for(;ethis.options.maxEntitySize)throw new Error(`Entity "${n}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[n,i,--e]}readNotationExp(t,e){e=A(t,e);let n="";for(;e{for(;e"},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:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>K(e,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>K(e,16,"&#x")}},this.addExternalEntities=F,this.parseXml=R,this.parseTextData=M,this.resolveNameSpace=k,this.buildAttributesMap=U,this.isItStopNode=X,this.replaceEntitiesValue=Y,this.readStopNodeData=q,this.saveTextToParentTag=G,this.addChild=B,this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let t=0;t0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=this.options.tagValueProcessor(e,t,n,s,r);return null==i?t:typeof i!=typeof t||i!==t?i:this.options.trimValues||t.trim()===t?Z(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function k(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const _=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function U(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const i=s(t,_),r=i.length,o={};for(let t=0;t",o,"Closing Tag is not closed.");let r=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}this.options.transformTagName&&(r=this.options.transformTagName(r)),n&&(i=this.saveTextToParentTag(i,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(r&&-1!==this.options.unpairedTags.indexOf(r))throw new Error(`Unpaired tag can not be used as closing tag: `);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",o=e}else if("?"===t[o+1]){let e=W(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new I(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s,o)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=z(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const r=t.substring(o+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:r}])}o=e}else if("!D"===t.substr(o+1,2)){const e=r.readDocType(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=z(t,"]]>",o,"CDATA is not closed.")-2,r=t.substring(o+9,e);i=this.saveTextToParentTag(i,n,s);let a=this.parseTextData(r,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:r}]):n.add(this.options.textNodeName,a),o=e+2}else{let r=W(t,o,this.options.removeNSPrefix),a=r.tagName;const l=r.rawTagName;let u=r.tagExp,d=r.attrExpPresent,h=r.closeIndex;if(this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}if(this.options.strictReservedNames&&(a===this.options.commentPropName||a===this.options.cdataPropName))throw new Error(`Invalid tag name: ${a}`);n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const p=n;p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==e.tagname&&(s+=s?"."+a:a);const c=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),o=r.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=r.closeIndex;else{const n=this.readStopNodeData(t,l,h+1);if(!n)throw new Error(`Unexpected end of ${l}`);o=n.i,e=n.tagContent}const i=new I(a);a!==u&&d&&(i[":@"]=this.buildAttributesMap(u,s,a)),e&&(e=this.parseTextData(e,a,s,!0,d,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s,c)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){if("/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}const t=new I(a);a!==u&&d&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,c),s=s.substr(0,s.lastIndexOf("."))}else{if(-1!==this.options.unpairedTags.indexOf(a)){const t=new I(a);a!==u&&d&&(t[":@"]=this.buildAttributesMap(u,s)),this.addChild(n,t,s,c),s=s.substr(0,s.lastIndexOf(".")),o=r.closeIndex;continue}{const t=new I(a);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),a!==u&&d&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,c),n=t}}i="",o=h}}else i+=t[o];return e.child};function B(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.updateTag(e.tagname,n,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}const Y=function(t,e,n){if(-1===t.indexOf("&"))return t;const i=this.options.processEntities;if(!i.enabled)return t;if(i.allowedTags&&!i.allowedTags.includes(e))return t;if(i.tagFilter&&!i.tagFilter(e,n))return t;for(let e in this.docTypeEntities){const n=this.docTypeEntities[e],s=t.match(n.regx);if(s){if(this.entityExpansionCount+=s.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);const e=t.length;if(t=t.replace(n.regx,n.val),i.maxExpandedLength&&(this.currentExpandedLength+=t.length-e,this.currentExpandedLength>i.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${i.maxExpandedLength}`)}}if(-1===t.indexOf("&"))return t;for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(-1===t.indexOf("&"))return t;if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}return t.replace(this.ampEntity.regex,this.ampEntity.val)};function G(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function X(t,e,n,i){return!(!e||!e.has(i))||!(!t||!t.has(n))}function z(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function W(t,e,n,i=">"){const s=function(t,e,n=">"){let i,s="";for(let r=e;r",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if("?"===t[n+1])n=z(t,"?>",n+1,"StopNode is not closed.");else if("!--"===t.substr(n+1,3))n=z(t,"--\x3e",n+3,"StopNode is not closed.");else if("!["===t.substr(n+1,2))n=z(t,"]]>",n,"StopNode is not closed.")-2;else{const i=W(t,n,">");i&&((i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex)}}function Z(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&function(t,e={}){if(e=Object.assign({},D,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===t)return 0;if(e.hex&&$.test(n))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n);if(n.includes("e")||n.includes("E"))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(j);if(i){let s=i[1]||"";const r=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:1!==o.length||!i[3].startsWith(`.${r}`)&&i[3][0]!==r?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const s=V.exec(n);if(s){const r=s[1]||"",o=s[2];let a=(i=s[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const l=r?"."===t[o.length+1]:"."===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!l))return t;{const i=Number(n),s=String(i);if(0===i)return i;if(-1!==s.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===s||s===a||s===`${r}${a}`?i:t;let l=o?a:n;return o?l===s||r+l===s?i:t:l===s||l===r+s?i:t}}return t}var i}(t,n)}return void 0!==t?t:""}function K(t,e,n){const i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):n+t+";"}const Q=I.getMetaDataSymbol();function J(t,e){return H(t,e)}function H(t,e,n){let i;const s={};for(let r=0;r0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function tt(t){const e=Object.keys(t);for(let t=0;t0&&(n="\n"),rt(t,e,"",n)}function rt(t,e,n,i){let s="",r=!1;if(!Array.isArray(t)){if(null!=t){let n=t.toString();return n=ut(n,e),n}return""}for(let o=0;o`,r=!1;continue}if(l===e.commentPropName){s+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=at(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${l}${o}${t}?>`,r=!0;continue}let d=i;""!==d&&(d+=e.indentBy);const h=i+`<${l}${at(a[":@"],e)}`,p=rt(a[l],e,u,d);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=h+">":s+=h+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?s+=h+`>${p}${i}`:(s+=h+">",p&&""!==i&&(p.includes("/>")||p.includes("`):s+=h+"/>",r=!0}return s}function ot(t){const e=Object.keys(t);for(let n=0;n0&&e.processEntities)for(let n=0;n","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ht(t){var e;this.options=Object.assign({},dt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ft),this.processTextOrObjNode=pt,this.options.format?(this.indentate=ct,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function pt(t,e,n,i){const s=this.j2x(t,n+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,n):this.buildObjectNode(s.val,e,s.attrStr,n)}function ct(t){return this.options.indentBy.repeat(t)}function ft(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}ht.prototype.build=function(t){return this.options.preserveOrder?st(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},ht.prototype.j2x=function(t,e,n){let i="",s="";const r=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(s+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?s+="":"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const n=this.isAttribute(o);if(n&&!this.ignoreAttributesFn(n,r))i+=this.buildAttrPairStr(n,""+t[o]);else if(!n)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(e)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const i=t[o].length;let r="",a="";for(let l=0;l"+t+s}},ht.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"0&&this.options.processEntities)for(let e=0;e { "use strict"; -module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-cloudformation","description":"AWS SDK for JavaScript Cloudformation Client for Node.js, Browser and React Native","version":"3.935.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-cloudformation","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 cloudformation"},"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.935.0","@aws-sdk/credential-provider-node":"3.935.0","@aws-sdk/middleware-host-header":"3.930.0","@aws-sdk/middleware-logger":"3.930.0","@aws-sdk/middleware-recursion-detection":"3.933.0","@aws-sdk/middleware-user-agent":"3.935.0","@aws-sdk/region-config-resolver":"3.930.0","@aws-sdk/types":"3.930.0","@aws-sdk/util-endpoints":"3.930.0","@aws-sdk/util-user-agent-browser":"3.930.0","@aws-sdk/util-user-agent-node":"3.935.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0","@smithy/util-waiter":"^4.2.5","tslib":"^2.6.2"},"devDependencies":{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"engines":{"node":">=18.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-cloudformation","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-cloudformation"}}'); +module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-cloudformation","description":"AWS SDK for JavaScript Cloudformation Client for Node.js, Browser and React Native","version":"3.1003.0","scripts":{"build":"concurrently \'yarn:build:types\' \'yarn:build:es\' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline client-cloudformation","build:es":"tsc -p tsconfig.es.json","build:include:deps":"yarn g:turbo run build -F=\\"$npm_package_name\\"","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cloudformation","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs"},"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.973.18","@aws-sdk/credential-provider-node":"^3.972.17","@aws-sdk/middleware-host-header":"^3.972.7","@aws-sdk/middleware-logger":"^3.972.7","@aws-sdk/middleware-recursion-detection":"^3.972.7","@aws-sdk/middleware-user-agent":"^3.972.18","@aws-sdk/region-config-resolver":"^3.972.7","@aws-sdk/types":"^3.973.5","@aws-sdk/util-endpoints":"^3.996.4","@aws-sdk/util-user-agent-browser":"^3.972.7","@aws-sdk/util-user-agent-node":"^3.973.3","@smithy/config-resolver":"^4.4.10","@smithy/core":"^3.23.8","@smithy/fetch-http-handler":"^5.3.13","@smithy/hash-node":"^4.2.11","@smithy/invalid-dependency":"^4.2.11","@smithy/middleware-content-length":"^4.2.11","@smithy/middleware-endpoint":"^4.4.22","@smithy/middleware-retry":"^4.4.39","@smithy/middleware-serde":"^4.2.12","@smithy/middleware-stack":"^4.2.11","@smithy/node-config-provider":"^4.3.11","@smithy/node-http-handler":"^4.4.14","@smithy/protocol-http":"^5.3.11","@smithy/smithy-client":"^4.12.2","@smithy/types":"^4.13.0","@smithy/url-parser":"^4.2.11","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.38","@smithy/util-defaults-mode-node":"^4.2.41","@smithy/util-endpoints":"^3.3.2","@smithy/util-middleware":"^4.2.11","@smithy/util-retry":"^4.2.11","@smithy/util-utf8":"^4.2.2","@smithy/util-waiter":"^4.2.11","tslib":"^2.6.2"},"devDependencies":{"@tsconfig/node20":"20.1.8","@types/node":"^20.14.8","concurrently":"7.0.0","downlevel-dts":"0.10.1","premove":"4.0.0","typescript":"~5.8.3"},"engines":{"node":">=20.0.0"},"typesVersions":{"<4.5":{"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-cloudformation","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-cloudformation"}}'); /***/ })