From c8cbba3ca922c5031d77bbdc021c28d2c5eb3d30 Mon Sep 17 00:00:00 2001 From: Devon Mackay Date: Mon, 4 Mar 2024 16:16:35 -0600 Subject: [PATCH 1/3] Add use-fips-endpoint option - Add use-fips-endpoint input to actions.yml and index.js - Assemble ECR config once and pass it to wrapper functions - Add use-fips-endpoint input to existing tests --- action.yml | 6 ++++++ index.js | 44 +++++++++++++++++++++++++------------------- index.test.js | 30 ++++++++++++++++++++---------- 3 files changed, 51 insertions(+), 29 deletions(-) diff --git a/action.yml b/action.yml index 78324691..011ba261 100644 --- a/action.yml +++ b/action.yml @@ -35,6 +35,12 @@ inputs: Options: ['true', 'false'] required: false default: 'false' + use-fips-endpoint: + description: >- + Whether to use the FIPS endpoint when looking into ECR. + Options: ['true', 'false'] + required: false + default: 'false' outputs: registry: description: >- diff --git a/index.js b/index.js index 90daacc5..cea1cbd8 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,8 @@ const INPUTS = { maskPassword: 'mask-password', registries: 'registries', registryType: 'registry-type', - skipLogout: 'skip-logout' + skipLogout: 'skip-logout', + useFipsEndpoint: 'use-fips-endpoint' }; const OUTPUTS = { @@ -50,14 +51,8 @@ function configureProxy(httpProxy) { return null; } -async function getEcrAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { - const ecrClient = new ECRClient({ - customUserAgent: ECR_LOGIN_GITHUB_ACTION_USER_AGENT, - requestHandler: new NodeHttpHandler({ - httpAgent: httpsProxyAgent, - httpsAgent: httpsProxyAgent - }), - }); +async function getEcrAuthTokenWrapper(ecrClientConfig, authTokenRequest) { + const ecrClient = new ECRClient(ecrClientConfig); const command = new GetAuthorizationTokenCommand(authTokenRequest); const authTokenResponse = await ecrClient.send(command); if (!authTokenResponse) { @@ -71,14 +66,8 @@ async function getEcrAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { return authTokenResponse; } -async function getEcrPublicAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { - const ecrPublicClient = new ECRPUBLICClient({ - customUserAgent: ECR_LOGIN_GITHUB_ACTION_USER_AGENT, - requestHandler: new NodeHttpHandler({ - httpAgent: httpsProxyAgent, - httpsAgent: httpsProxyAgent - }), - }); +async function getEcrPublicAuthTokenWrapper(ecrClientConfig, authTokenRequest) { + const ecrPublicClient = new ECRPUBLICClient(ecrClientConfig); const command = new GetAuthorizationTokenCommandPublic(authTokenRequest); const authTokenResponse = await ecrPublicClient.send(command); if (!authTokenResponse) { @@ -89,6 +78,12 @@ async function getEcrPublicAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { throw new Error('Amazon ECR Public authorization token does not contain any authorization data'); } + if(ecrClientConfig.useFipsEndpoint) { + // If the registry type is public but `use-fips-endpoints` was also set, warn the action user that there + // are no fips compliant public endpoints for ECR + core.warning('Amazon ECR Public does not have any FIPS endpoints') + } + return { authorizationData: [ { @@ -110,6 +105,7 @@ async function run() { const registries = core.getInput(INPUTS.registries, { required: false }); const registryType = core.getInput(INPUTS.registryType, { required: false }).toLowerCase() || REGISTRY_TYPES.private; const skipLogout = core.getInput(INPUTS.skipLogout, { required: false }).toLowerCase() === 'true'; + const useFipsEndpoint = core.getInput(INPUTS.useFipsEndpoint, { required: false }).toLowerCase() === 'true'; const registryUriState = []; @@ -127,6 +123,16 @@ async function run() { // Configures proxy const httpsProxyAgent = configureProxy(httpProxy); + // Generate ECR client configuration + const ecrClientConfig = { + customUserAgent: ECR_LOGIN_GITHUB_ACTION_USER_AGENT, + requestHandler: new NodeHttpHandler({ + httpAgent: httpsProxyAgent, + httpsAgent: httpsProxyAgent + }), + useFipsEndpoint: useFipsEndpoint + }; + // Get the ECR/ECR Public authorization token(s) const authTokenRequest = {}; if (registryType === REGISTRY_TYPES.private && registries) { @@ -138,8 +144,8 @@ async function run() { authTokenRequest.registryIds = registryIds; } const authTokenResponse = registryType === REGISTRY_TYPES.private ? - await getEcrAuthTokenWrapper(authTokenRequest, httpsProxyAgent) : - await getEcrPublicAuthTokenWrapper(authTokenRequest, httpsProxyAgent); + await getEcrAuthTokenWrapper(ecrClientConfig, authTokenRequest) : + await getEcrPublicAuthTokenWrapper(ecrClientConfig, authTokenRequest); // Login to each registry for (const authData of authTokenResponse.authorizationData) { diff --git a/index.test.js b/index.test.js index 4f14c565..8331ec51 100644 --- a/index.test.js +++ b/index.test.js @@ -19,7 +19,8 @@ const ECR_DEFAULT_INPUTS = { 'mask-password': '', 'registries': '', 'registry-type': '', - 'skip-logout': '' + 'skip-logout': '', + 'use-fips-endpoint': '' }; const ECR_PUBLIC_DEFAULT_INPUTS = { @@ -27,7 +28,8 @@ const ECR_PUBLIC_DEFAULT_INPUTS = { 'mask-password': '', 'registries': '', 'registry-type': 'public', - 'skip-logout': '' + 'skip-logout': '', + 'use-fips-endpoint': '' }; const defaultAuthToken = { @@ -81,7 +83,8 @@ describe('Login to ECR', () => { 'mask-password': '', 'registries': '123456789012,111111111111', 'registry-type': '', - 'skip-logout': '' + 'skip-logout': '', + 'use-fips-endpoint': '' }; core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)); ecrMock.on(GetAuthorizationTokenCommand).resolves({ @@ -123,7 +126,8 @@ describe('Login to ECR', () => { 'mask-password': '', 'registries': '111111111111', 'registry-type': '', - 'skip-logout': '' + 'skip-logout': '', + 'use-fips-endpoint': '' }; core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)); ecrMock.on(GetAuthorizationTokenCommand).resolves({ @@ -168,7 +172,8 @@ describe('Login to ECR', () => { 'mask-password': '', 'registries': '123456789012,111111111111', 'registry-type': '', - 'skip-logout': '' + 'skip-logout': '', + 'use-fips-endpoint': '' }; core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)); ecrMock.on(GetAuthorizationTokenCommand).resolves({ @@ -270,7 +275,8 @@ describe('Login to ECR', () => { 'mask-password': '', 'registries': '', 'registry-type': '', - 'skip-logout': 'true' + 'skip-logout': 'true', + 'use-fips-endpoint': '' }; core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)); @@ -290,7 +296,8 @@ describe('Login to ECR', () => { 'mask-password': '', 'registries': '123456789012,111111111111', 'registry-type': '', - 'skip-logout': 'true' + 'skip-logout': 'true', + 'use-fips-endpoint': '' }; core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)); ecrMock.on(GetAuthorizationTokenCommand).resolves({ @@ -325,7 +332,8 @@ describe('Login to ECR', () => { 'mask-password': 'false', 'registries': '123456789012,111111111111', 'registry-type': '', - 'skip-logout': 'true' + 'skip-logout': 'true', + 'use-fips-endpoint': '' }; core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)); ecrMock.on(GetAuthorizationTokenCommand).resolves({ @@ -355,7 +363,8 @@ describe('Login to ECR', () => { 'mask-password': '', 'registries': '123456789012,111111111111', 'registry-type': '', - 'skip-logout': 'true' + 'skip-logout': 'true', + 'use-fips-endpoint': '' }; core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)); ecrMock.on(GetAuthorizationTokenCommand).resolves({ @@ -435,7 +444,8 @@ describe('Login to ECR Public', () => { 'mask-password': '', 'registries': '', 'registry-type': 'invalid', - 'skip-logout': '' + 'skip-logout': '', + 'use-fips-endpoint': '' }; core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)); ecrPublicMock.on(GetAuthorizationTokenCommandPublic).resolves(defaultAuthToken); From f1f31c7423dfd28141bf9d1ca2300f307075936f Mon Sep 17 00:00:00 2001 From: Devon Mackay Date: Mon, 4 Mar 2024 16:36:25 -0600 Subject: [PATCH 2/3] Move ecr config generation to function and add tests --- index.js | 21 +++++++++++++-------- index.test.js | 13 ++++++++++++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index cea1cbd8..df39fb0e 100644 --- a/index.js +++ b/index.js @@ -94,6 +94,17 @@ async function getEcrPublicAuthTokenWrapper(ecrClientConfig, authTokenRequest) { }; } +function generateEcrClientConfig(httpsProxyAgent, useFipsEndpoint) { + return { + customUserAgent: ECR_LOGIN_GITHUB_ACTION_USER_AGENT, + requestHandler: new NodeHttpHandler({ + httpAgent: httpsProxyAgent, + httpsAgent: httpsProxyAgent + }), + useFipsEndpoint: useFipsEndpoint + } +} + function replaceSpecialCharacters(registryUri) { return registryUri.replace(/[^a-zA-Z0-9_]+/g, '_'); } @@ -124,14 +135,7 @@ async function run() { const httpsProxyAgent = configureProxy(httpProxy); // Generate ECR client configuration - const ecrClientConfig = { - customUserAgent: ECR_LOGIN_GITHUB_ACTION_USER_AGENT, - requestHandler: new NodeHttpHandler({ - httpAgent: httpsProxyAgent, - httpsAgent: httpsProxyAgent - }), - useFipsEndpoint: useFipsEndpoint - }; + const ecrClientConfig = generateEcrClientConfig(httpsProxyAgent, useFipsEndpoint) // Get the ECR/ECR Public authorization token(s) const authTokenRequest = {}; @@ -208,6 +212,7 @@ async function run() { module.exports = { configureProxy, + generateEcrClientConfig, run, replaceSpecialCharacters }; diff --git a/index.test.js b/index.test.js index 8331ec51..a8d11fbb 100644 --- a/index.test.js +++ b/index.test.js @@ -1,4 +1,4 @@ -const { run, replaceSpecialCharacters, configureProxy } = require('./index.js'); +const { run, replaceSpecialCharacters, configureProxy, generateEcrClientConfig } = require('./index.js'); const core = require('@actions/core'); const exec = require('@actions/exec'); const { mockClient } = require('aws-sdk-client-mock'); @@ -390,6 +390,17 @@ describe('Login to ECR', () => { expect(core.setOutput).toHaveBeenNthCalledWith(4, 'docker_password_111111111111_dkr_ecr_aws_region_1_amazonaws_com', 'bar'); }); + describe('fips endpoint setting', () => { + test('setting use-fips-endpoint to true', async() => { + const ecrConfig = generateEcrClientConfig(null, true) + expect(ecrConfig.useFipsEndpoint).toBe(true); + }); + test('setting use-fips-endpoint to false', async() => { + const ecrConfig = generateEcrClientConfig(null, false) + expect(ecrConfig.useFipsEndpoint).toBe(false); + }) + }) + describe('proxy settings', () => { afterEach(() => { process.env = {}; From aa606903071640466257c6694e3aee865dcaaa55 Mon Sep 17 00:00:00 2001 From: Devon Mackay Date: Mon, 4 Mar 2024 16:48:21 -0600 Subject: [PATCH 3/3] Package action --- dist/index.js | 70593 +++++++++++++++++++++--------------------------- 1 file changed, 30382 insertions(+), 40211 deletions(-) diff --git a/dist/index.js b/dist/index.js index 2ed167bf..dd1ecb8a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,15 +1,15 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 32932: +/***/ 2932: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const core = __nccwpck_require__(42186); -const exec = __nccwpck_require__(71514); -const { HttpsProxyAgent } = __nccwpck_require__(77219); -const { NodeHttpHandler } = __nccwpck_require__(68805); +const core = __nccwpck_require__(2186); +const exec = __nccwpck_require__(1514); +const { HttpsProxyAgent } = __nccwpck_require__(7219); +const { NodeHttpHandler } = __nccwpck_require__(8805); const { ECRClient, GetAuthorizationTokenCommand } = __nccwpck_require__(8923); -const { ECRPUBLICClient, GetAuthorizationTokenCommand: GetAuthorizationTokenCommandPublic } = __nccwpck_require__(42308); +const { ECRPUBLICClient, GetAuthorizationTokenCommand: GetAuthorizationTokenCommandPublic } = __nccwpck_require__(2308); const ECR_LOGIN_GITHUB_ACTION_USER_AGENT = 'amazon-ecr-login-for-github-actions'; const ECR_PUBLIC_REGISTRY_URI = 'public.ecr.aws'; @@ -19,7 +19,8 @@ const INPUTS = { maskPassword: 'mask-password', registries: 'registries', registryType: 'registry-type', - skipLogout: 'skip-logout' + skipLogout: 'skip-logout', + useFipsEndpoint: 'use-fips-endpoint' }; const OUTPUTS = { @@ -56,14 +57,8 @@ function configureProxy(httpProxy) { return null; } -async function getEcrAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { - const ecrClient = new ECRClient({ - customUserAgent: ECR_LOGIN_GITHUB_ACTION_USER_AGENT, - requestHandler: new NodeHttpHandler({ - httpAgent: httpsProxyAgent, - httpsAgent: httpsProxyAgent - }), - }); +async function getEcrAuthTokenWrapper(ecrClientConfig, authTokenRequest) { + const ecrClient = new ECRClient(ecrClientConfig); const command = new GetAuthorizationTokenCommand(authTokenRequest); const authTokenResponse = await ecrClient.send(command); if (!authTokenResponse) { @@ -77,14 +72,8 @@ async function getEcrAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { return authTokenResponse; } -async function getEcrPublicAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { - const ecrPublicClient = new ECRPUBLICClient({ - customUserAgent: ECR_LOGIN_GITHUB_ACTION_USER_AGENT, - requestHandler: new NodeHttpHandler({ - httpAgent: httpsProxyAgent, - httpsAgent: httpsProxyAgent - }), - }); +async function getEcrPublicAuthTokenWrapper(ecrClientConfig, authTokenRequest) { + const ecrPublicClient = new ECRPUBLICClient(ecrClientConfig); const command = new GetAuthorizationTokenCommandPublic(authTokenRequest); const authTokenResponse = await ecrPublicClient.send(command); if (!authTokenResponse) { @@ -95,6 +84,12 @@ async function getEcrPublicAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { throw new Error('Amazon ECR Public authorization token does not contain any authorization data'); } + if(ecrClientConfig.useFipsEndpoint) { + // If the registry type is public but `use-fips-endpoints` was also set, warn the action user that there + // are no fips compliant public endpoints for ECR + core.warning('Amazon ECR Public does not have any FIPS endpoints') + } + return { authorizationData: [ { @@ -105,6 +100,17 @@ async function getEcrPublicAuthTokenWrapper(authTokenRequest, httpsProxyAgent) { }; } +function generateEcrClientConfig(httpsProxyAgent, useFipsEndpoint) { + return { + customUserAgent: ECR_LOGIN_GITHUB_ACTION_USER_AGENT, + requestHandler: new NodeHttpHandler({ + httpAgent: httpsProxyAgent, + httpsAgent: httpsProxyAgent + }), + useFipsEndpoint: useFipsEndpoint + } +} + function replaceSpecialCharacters(registryUri) { return registryUri.replace(/[^a-zA-Z0-9_]+/g, '_'); } @@ -116,6 +122,7 @@ async function run() { const registries = core.getInput(INPUTS.registries, { required: false }); const registryType = core.getInput(INPUTS.registryType, { required: false }).toLowerCase() || REGISTRY_TYPES.private; const skipLogout = core.getInput(INPUTS.skipLogout, { required: false }).toLowerCase() === 'true'; + const useFipsEndpoint = core.getInput(INPUTS.useFipsEndpoint, { required: false }).toLowerCase() === 'true'; const registryUriState = []; @@ -133,6 +140,9 @@ async function run() { // Configures proxy const httpsProxyAgent = configureProxy(httpProxy); + // Generate ECR client configuration + const ecrClientConfig = generateEcrClientConfig(httpsProxyAgent, useFipsEndpoint) + // Get the ECR/ECR Public authorization token(s) const authTokenRequest = {}; if (registryType === REGISTRY_TYPES.private && registries) { @@ -144,8 +154,8 @@ async function run() { authTokenRequest.registryIds = registryIds; } const authTokenResponse = registryType === REGISTRY_TYPES.private ? - await getEcrAuthTokenWrapper(authTokenRequest, httpsProxyAgent) : - await getEcrPublicAuthTokenWrapper(authTokenRequest, httpsProxyAgent); + await getEcrAuthTokenWrapper(ecrClientConfig, authTokenRequest) : + await getEcrPublicAuthTokenWrapper(ecrClientConfig, authTokenRequest); // Login to each registry for (const authData of authTokenResponse.authorizationData) { @@ -208,6 +218,7 @@ async function run() { module.exports = { configureProxy, + generateEcrClientConfig, run, replaceSpecialCharacters }; @@ -220,7 +231,7 @@ if (require.main === require.cache[eval('__filename')]) { /***/ }), -/***/ 87351: +/***/ 7351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -246,7 +257,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(22037)); +const os = __importStar(__nccwpck_require__(2037)); const utils_1 = __nccwpck_require__(5278); /** * Commands @@ -319,7 +330,7 @@ function escapeProperty(s) { /***/ }), -/***/ 42186: +/***/ 2186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -354,12 +365,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(87351); +const command_1 = __nccwpck_require__(7351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(22037)); -const path = __importStar(__nccwpck_require__(71017)); -const oidc_utils_1 = __nccwpck_require__(98041); +const os = __importStar(__nccwpck_require__(2037)); +const path = __importStar(__nccwpck_require__(1017)); +const oidc_utils_1 = __nccwpck_require__(8041); /** * The code to exit an action */ @@ -644,12 +655,12 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(81327); +var summary_1 = __nccwpck_require__(1327); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(81327); +var summary_2 = __nccwpck_require__(1327); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports @@ -691,9 +702,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(57147)); -const os = __importStar(__nccwpck_require__(22037)); -const uuid_1 = __nccwpck_require__(75840); +const fs = __importStar(__nccwpck_require__(7147)); +const os = __importStar(__nccwpck_require__(2037)); +const uuid_1 = __nccwpck_require__(5840); const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -727,7 +738,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 98041: +/***/ 8041: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -743,9 +754,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(96255); -const auth_1 = __nccwpck_require__(35526); -const core_1 = __nccwpck_require__(42186); +const http_client_1 = __nccwpck_require__(6255); +const auth_1 = __nccwpck_require__(5526); +const core_1 = __nccwpck_require__(2186); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -837,7 +848,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; -const path = __importStar(__nccwpck_require__(71017)); +const path = __importStar(__nccwpck_require__(1017)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. @@ -876,7 +887,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 81327: +/***/ 1327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -892,8 +903,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; -const os_1 = __nccwpck_require__(22037); -const fs_1 = __nccwpck_require__(57147); +const os_1 = __nccwpck_require__(2037); +const fs_1 = __nccwpck_require__(7147); const { access, appendFile, writeFile } = fs_1.promises; exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; @@ -1213,7 +1224,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 71514: +/***/ 1514: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1248,8 +1259,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; -const string_decoder_1 = __nccwpck_require__(71576); -const tr = __importStar(__nccwpck_require__(88159)); +const string_decoder_1 = __nccwpck_require__(1576); +const tr = __importStar(__nccwpck_require__(8159)); /** * Exec a command. * Output will be streamed to the live console. @@ -1323,7 +1334,7 @@ exports.getExecOutput = getExecOutput; /***/ }), -/***/ 88159: +/***/ 8159: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1358,13 +1369,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.argStringToArray = exports.ToolRunner = void 0; -const os = __importStar(__nccwpck_require__(22037)); -const events = __importStar(__nccwpck_require__(82361)); -const child = __importStar(__nccwpck_require__(32081)); -const path = __importStar(__nccwpck_require__(71017)); -const io = __importStar(__nccwpck_require__(47351)); -const ioUtil = __importStar(__nccwpck_require__(81962)); -const timers_1 = __nccwpck_require__(39512); +const os = __importStar(__nccwpck_require__(2037)); +const events = __importStar(__nccwpck_require__(2361)); +const child = __importStar(__nccwpck_require__(2081)); +const path = __importStar(__nccwpck_require__(1017)); +const io = __importStar(__nccwpck_require__(7436)); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const timers_1 = __nccwpck_require__(9512); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* @@ -1948,7 +1959,7 @@ class ExecState extends events.EventEmitter { /***/ }), -/***/ 35526: +/***/ 5526: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2036,7 +2047,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 96255: +/***/ 6255: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2072,10 +2083,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(13685)); -const https = __importStar(__nccwpck_require__(95687)); -const pm = __importStar(__nccwpck_require__(19835)); -const tunnel = __importStar(__nccwpck_require__(74294)); +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); +const pm = __importStar(__nccwpck_require__(9835)); +const tunnel = __importStar(__nccwpck_require__(4294)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -2648,7 +2659,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 19835: +/***/ 9835: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -2731,7 +2742,7 @@ function isLoopbackAddress(host) { /***/ }), -/***/ 81962: +/***/ 1962: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2767,8 +2778,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; -const fs = __importStar(__nccwpck_require__(57147)); -const path = __importStar(__nccwpck_require__(71017)); +const fs = __importStar(__nccwpck_require__(7147)); +const path = __importStar(__nccwpck_require__(1017)); _a = fs.promises // export const {open} = 'fs' , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; @@ -2921,7 +2932,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 47351: +/***/ 7436: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2956,9 +2967,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; -const assert_1 = __nccwpck_require__(39491); -const path = __importStar(__nccwpck_require__(71017)); -const ioUtil = __importStar(__nccwpck_require__(81962)); +const assert_1 = __nccwpck_require__(9491); +const path = __importStar(__nccwpck_require__(1017)); +const ioUtil = __importStar(__nccwpck_require__(1962)); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -3227,7 +3238,7 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 32374: +/***/ 2374: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3237,8 +3248,8 @@ function copyFile(srcFile, destFile, force) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AwsCrc32 = void 0; var tslib_1 = __nccwpck_require__(5066); -var util_1 = __nccwpck_require__(41236); -var index_1 = __nccwpck_require__(47327); +var util_1 = __nccwpck_require__(1236); +var index_1 = __nccwpck_require__(7327); var AwsCrc32 = /** @class */ (function () { function AwsCrc32() { this.crc32 = new index_1.Crc32(); @@ -3265,7 +3276,7 @@ exports.AwsCrc32 = AwsCrc32; /***/ }), -/***/ 47327: +/***/ 7327: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3273,7 +3284,7 @@ exports.AwsCrc32 = AwsCrc32; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AwsCrc32 = exports.Crc32 = exports.crc32 = void 0; var tslib_1 = __nccwpck_require__(5066); -var util_1 = __nccwpck_require__(41236); +var util_1 = __nccwpck_require__(1236); function crc32(data) { return new Crc32().update(data).digest(); } @@ -3374,7 +3385,7 @@ var a_lookUpTable = [ 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D, ]; var lookupTable = (0, util_1.uint32ArrayFrom)(a_lookUpTable); -var aws_crc32_1 = __nccwpck_require__(32374); +var aws_crc32_1 = __nccwpck_require__(2374); Object.defineProperty(exports, "AwsCrc32", ({ enumerable: true, get: function () { return aws_crc32_1.AwsCrc32; } })); //# sourceMappingURL=index.js.map @@ -3671,7 +3682,7 @@ var __createBinding; /***/ }), -/***/ 43228: +/***/ 3228: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3680,7 +3691,7 @@ var __createBinding; // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", ({ value: true })); exports.convertToBuffer = void 0; -var util_utf8_browser_1 = __nccwpck_require__(28172); +var util_utf8_browser_1 = __nccwpck_require__(8172); // Quick polyfill var fromUtf8 = typeof Buffer !== "undefined" && Buffer.from ? function (input) { return Buffer.from(input, "utf8"); } @@ -3702,7 +3713,7 @@ exports.convertToBuffer = convertToBuffer; /***/ }), -/***/ 41236: +/***/ 1236: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3711,19 +3722,19 @@ exports.convertToBuffer = convertToBuffer; // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", ({ value: true })); exports.uint32ArrayFrom = exports.numToUint8 = exports.isEmptyData = exports.convertToBuffer = void 0; -var convertToBuffer_1 = __nccwpck_require__(43228); +var convertToBuffer_1 = __nccwpck_require__(3228); Object.defineProperty(exports, "convertToBuffer", ({ enumerable: true, get: function () { return convertToBuffer_1.convertToBuffer; } })); -var isEmptyData_1 = __nccwpck_require__(18275); +var isEmptyData_1 = __nccwpck_require__(8275); Object.defineProperty(exports, "isEmptyData", ({ enumerable: true, get: function () { return isEmptyData_1.isEmptyData; } })); -var numToUint8_1 = __nccwpck_require__(93775); +var numToUint8_1 = __nccwpck_require__(3775); Object.defineProperty(exports, "numToUint8", ({ enumerable: true, get: function () { return numToUint8_1.numToUint8; } })); -var uint32ArrayFrom_1 = __nccwpck_require__(39404); +var uint32ArrayFrom_1 = __nccwpck_require__(9404); Object.defineProperty(exports, "uint32ArrayFrom", ({ enumerable: true, get: function () { return uint32ArrayFrom_1.uint32ArrayFrom; } })); //# sourceMappingURL=index.js.map /***/ }), -/***/ 18275: +/***/ 8275: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -3743,7 +3754,7 @@ exports.isEmptyData = isEmptyData; /***/ }), -/***/ 93775: +/***/ 3775: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -3765,7 +3776,7 @@ exports.numToUint8 = numToUint8; /***/ }), -/***/ 39404: +/***/ 9404: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -3792,41425 +3803,29067 @@ exports.uint32ArrayFrom = uint32ArrayFrom; /***/ }), -/***/ 86087: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ECRPUBLIC = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const BatchCheckLayerAvailabilityCommand_1 = __nccwpck_require__(25356); -const BatchDeleteImageCommand_1 = __nccwpck_require__(56517); -const CompleteLayerUploadCommand_1 = __nccwpck_require__(55490); -const CreateRepositoryCommand_1 = __nccwpck_require__(39633); -const DeleteRepositoryCommand_1 = __nccwpck_require__(60467); -const DeleteRepositoryPolicyCommand_1 = __nccwpck_require__(62528); -const DescribeImagesCommand_1 = __nccwpck_require__(22776); -const DescribeImageTagsCommand_1 = __nccwpck_require__(47670); -const DescribeRegistriesCommand_1 = __nccwpck_require__(78696); -const DescribeRepositoriesCommand_1 = __nccwpck_require__(82218); -const GetAuthorizationTokenCommand_1 = __nccwpck_require__(92674); -const GetRegistryCatalogDataCommand_1 = __nccwpck_require__(26518); -const GetRepositoryCatalogDataCommand_1 = __nccwpck_require__(53189); -const GetRepositoryPolicyCommand_1 = __nccwpck_require__(8562); -const InitiateLayerUploadCommand_1 = __nccwpck_require__(83675); -const ListTagsForResourceCommand_1 = __nccwpck_require__(80575); -const PutImageCommand_1 = __nccwpck_require__(86486); -const PutRegistryCatalogDataCommand_1 = __nccwpck_require__(46805); -const PutRepositoryCatalogDataCommand_1 = __nccwpck_require__(83753); -const SetRepositoryPolicyCommand_1 = __nccwpck_require__(79838); -const TagResourceCommand_1 = __nccwpck_require__(39869); -const UntagResourceCommand_1 = __nccwpck_require__(66689); -const UploadLayerPartCommand_1 = __nccwpck_require__(97429); -const ECRPUBLICClient_1 = __nccwpck_require__(30608); -const commands = { - BatchCheckLayerAvailabilityCommand: BatchCheckLayerAvailabilityCommand_1.BatchCheckLayerAvailabilityCommand, - BatchDeleteImageCommand: BatchDeleteImageCommand_1.BatchDeleteImageCommand, - CompleteLayerUploadCommand: CompleteLayerUploadCommand_1.CompleteLayerUploadCommand, - CreateRepositoryCommand: CreateRepositoryCommand_1.CreateRepositoryCommand, - DeleteRepositoryCommand: DeleteRepositoryCommand_1.DeleteRepositoryCommand, - DeleteRepositoryPolicyCommand: DeleteRepositoryPolicyCommand_1.DeleteRepositoryPolicyCommand, - DescribeImagesCommand: DescribeImagesCommand_1.DescribeImagesCommand, - DescribeImageTagsCommand: DescribeImageTagsCommand_1.DescribeImageTagsCommand, - DescribeRegistriesCommand: DescribeRegistriesCommand_1.DescribeRegistriesCommand, - DescribeRepositoriesCommand: DescribeRepositoriesCommand_1.DescribeRepositoriesCommand, - GetAuthorizationTokenCommand: GetAuthorizationTokenCommand_1.GetAuthorizationTokenCommand, - GetRegistryCatalogDataCommand: GetRegistryCatalogDataCommand_1.GetRegistryCatalogDataCommand, - GetRepositoryCatalogDataCommand: GetRepositoryCatalogDataCommand_1.GetRepositoryCatalogDataCommand, - GetRepositoryPolicyCommand: GetRepositoryPolicyCommand_1.GetRepositoryPolicyCommand, - InitiateLayerUploadCommand: InitiateLayerUploadCommand_1.InitiateLayerUploadCommand, - ListTagsForResourceCommand: ListTagsForResourceCommand_1.ListTagsForResourceCommand, - PutImageCommand: PutImageCommand_1.PutImageCommand, - PutRegistryCatalogDataCommand: PutRegistryCatalogDataCommand_1.PutRegistryCatalogDataCommand, - PutRepositoryCatalogDataCommand: PutRepositoryCatalogDataCommand_1.PutRepositoryCatalogDataCommand, - SetRepositoryPolicyCommand: SetRepositoryPolicyCommand_1.SetRepositoryPolicyCommand, - TagResourceCommand: TagResourceCommand_1.TagResourceCommand, - UntagResourceCommand: UntagResourceCommand_1.UntagResourceCommand, - UploadLayerPartCommand: UploadLayerPartCommand_1.UploadLayerPartCommand, -}; -class ECRPUBLIC extends ECRPUBLICClient_1.ECRPUBLICClient { -} -exports.ECRPUBLIC = ECRPUBLIC; -(0, smithy_client_1.createAggregatedClient)(commands, ECRPUBLIC); - - -/***/ }), - -/***/ 30608: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ECRPUBLICClient = exports.__Client = void 0; -const middleware_host_header_1 = __nccwpck_require__(22545); -const middleware_logger_1 = __nccwpck_require__(20014); -const middleware_recursion_detection_1 = __nccwpck_require__(85525); -const middleware_signing_1 = __nccwpck_require__(14935); -const middleware_user_agent_1 = __nccwpck_require__(64688); -const config_resolver_1 = __nccwpck_require__(53098); -const middleware_content_length_1 = __nccwpck_require__(82800); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_retry_1 = __nccwpck_require__(96039); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } })); -const EndpointParameters_1 = __nccwpck_require__(78258); -const runtimeConfig_1 = __nccwpck_require__(49324); -const runtimeExtensions_1 = __nccwpck_require__(22754); -class ECRPUBLICClient extends smithy_client_1.Client { - constructor(...[configuration]) { - const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); - const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); - const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); - const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); - const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); - const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_signing_1.resolveAwsAuthConfig)(_config_5); - const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6); - const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []); - super(_config_8); - this.config = _config_8; - this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); - this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); - this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); - this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); - this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); - } - destroy() { - super.destroy(); - } -} -exports.ECRPUBLICClient = ECRPUBLICClient; - - -/***/ }), - -/***/ 25356: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchCheckLayerAvailabilityCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class BatchCheckLayerAvailabilityCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, BatchCheckLayerAvailabilityCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "BatchCheckLayerAvailabilityCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "BatchCheckLayerAvailability", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_BatchCheckLayerAvailabilityCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_BatchCheckLayerAvailabilityCommand)(output, context); - } -} -exports.BatchCheckLayerAvailabilityCommand = BatchCheckLayerAvailabilityCommand; - - -/***/ }), - -/***/ 56517: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchDeleteImageCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class BatchDeleteImageCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, BatchDeleteImageCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "BatchDeleteImageCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "BatchDeleteImage", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_BatchDeleteImageCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_BatchDeleteImageCommand)(output, context); - } -} -exports.BatchDeleteImageCommand = BatchDeleteImageCommand; - - -/***/ }), - -/***/ 55490: +/***/ 7614: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompleteLayerUploadCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class CompleteLayerUploadCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CompleteLayerUploadCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "CompleteLayerUploadCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "CompleteLayerUpload", +exports.resolveHttpAuthSchemeConfig = exports.defaultECRPUBLICHttpAuthSchemeProvider = exports.defaultECRPUBLICHttpAuthSchemeParametersProvider = void 0; +const core_1 = __nccwpck_require__(9963); +const util_middleware_1 = __nccwpck_require__(2390); +const defaultECRPUBLICHttpAuthSchemeParametersProvider = 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.defaultECRPUBLICHttpAuthSchemeParametersProvider = defaultECRPUBLICHttpAuthSchemeParametersProvider; +function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "ecr-public", + region: authParameters.region, + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context, }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_CompleteLayerUploadCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_CompleteLayerUploadCommand)(output, context); - } + }), + }; } -exports.CompleteLayerUploadCommand = CompleteLayerUploadCommand; - - -/***/ }), - -/***/ 39633: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CreateRepositoryCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class CreateRepositoryCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreateRepositoryCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "CreateRepositoryCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "CreateRepository", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_CreateRepositoryCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_CreateRepositoryCommand)(output, context); +const defaultECRPUBLICHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } } -} -exports.CreateRepositoryCommand = CreateRepositoryCommand; + return options; +}; +exports.defaultECRPUBLICHttpAuthSchemeProvider = defaultECRPUBLICHttpAuthSchemeProvider; +const resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return { + ...config_0, + }; +}; +exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; /***/ }), -/***/ 60467: +/***/ 7377: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeleteRepositoryCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class DeleteRepositoryCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteRepositoryCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "DeleteRepositoryCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "DeleteRepository", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DeleteRepositoryCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DeleteRepositoryCommand)(output, context); - } -} -exports.DeleteRepositoryCommand = DeleteRepositoryCommand; +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = __nccwpck_require__(5473); +const ruleset_1 = __nccwpck_require__(888); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; +exports.defaultEndpointResolver = defaultEndpointResolver; /***/ }), -/***/ 62528: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 888: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeleteRepositoryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class DeleteRepositoryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteRepositoryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "DeleteRepositoryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "DeleteRepositoryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DeleteRepositoryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DeleteRepositoryPolicyCommand)(output, context); - } -} -exports.DeleteRepositoryPolicyCommand = DeleteRepositoryPolicyCommand; +exports.ruleSet = void 0; +const s = "required", t = "fn", u = "argv", v = "ref"; +const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = { [s]: false, "type": "String" }, i = { [s]: true, "default": false, "type": "Boolean" }, j = { [v]: "Endpoint" }, k = { [t]: c, [u]: [{ [v]: "UseFIPS" }, true] }, l = { [t]: c, [u]: [{ [v]: "UseDualStack" }, true] }, m = {}, n = { [t]: "getAttr", [u]: [{ [v]: g }, "supportsFIPS"] }, o = { [t]: c, [u]: [true, { [t]: "getAttr", [u]: [{ [v]: g }, "supportsDualStack"] }] }, p = [k], q = [l], r = [{ [v]: "Region" }]; +const _data = { version: "1.0", parameters: { Region: h, UseDualStack: i, UseFIPS: i, Endpoint: h }, rules: [{ conditions: [{ [t]: b, [u]: [j] }], rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: j, properties: m, headers: m }, type: e }], type: f }, { conditions: [{ [t]: b, [u]: r }], rules: [{ conditions: [{ [t]: "aws.partition", [u]: r, assign: g }], rules: [{ conditions: [k, l], rules: [{ conditions: [{ [t]: c, [u]: [a, n] }, o], rules: [{ endpoint: { url: "https://api.ecr-public-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: p, rules: [{ conditions: [{ [t]: c, [u]: [n, a] }], rules: [{ endpoint: { url: "https://api.ecr-public-fips.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: q, rules: [{ conditions: [o], rules: [{ endpoint: { url: "https://api.ecr-public.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://api.ecr-public.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; +exports.ruleSet = _data; /***/ }), -/***/ 47670: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 2308: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeImageTagsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class DescribeImageTagsCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeImageTagsCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "DescribeImageTagsCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "DescribeImageTags", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeImageTagsCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeImageTagsCommand)(output, context); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + BatchCheckLayerAvailabilityCommand: () => BatchCheckLayerAvailabilityCommand, + BatchDeleteImageCommand: () => BatchDeleteImageCommand, + CompleteLayerUploadCommand: () => CompleteLayerUploadCommand, + CreateRepositoryCommand: () => CreateRepositoryCommand, + DeleteRepositoryCommand: () => DeleteRepositoryCommand, + DeleteRepositoryPolicyCommand: () => DeleteRepositoryPolicyCommand, + DescribeImageTagsCommand: () => DescribeImageTagsCommand, + DescribeImagesCommand: () => DescribeImagesCommand, + DescribeRegistriesCommand: () => DescribeRegistriesCommand, + DescribeRepositoriesCommand: () => DescribeRepositoriesCommand, + ECRPUBLIC: () => ECRPUBLIC, + ECRPUBLICClient: () => ECRPUBLICClient, + ECRPUBLICServiceException: () => ECRPUBLICServiceException, + EmptyUploadException: () => EmptyUploadException, + GetAuthorizationTokenCommand: () => GetAuthorizationTokenCommand, + GetRegistryCatalogDataCommand: () => GetRegistryCatalogDataCommand, + GetRepositoryCatalogDataCommand: () => GetRepositoryCatalogDataCommand, + GetRepositoryPolicyCommand: () => GetRepositoryPolicyCommand, + ImageAlreadyExistsException: () => ImageAlreadyExistsException, + ImageDigestDoesNotMatchException: () => ImageDigestDoesNotMatchException, + ImageFailureCode: () => ImageFailureCode, + ImageNotFoundException: () => ImageNotFoundException, + ImageTagAlreadyExistsException: () => ImageTagAlreadyExistsException, + InitiateLayerUploadCommand: () => InitiateLayerUploadCommand, + InvalidLayerException: () => InvalidLayerException, + InvalidLayerPartException: () => InvalidLayerPartException, + InvalidParameterException: () => InvalidParameterException, + InvalidTagParameterException: () => InvalidTagParameterException, + LayerAlreadyExistsException: () => LayerAlreadyExistsException, + LayerAvailability: () => LayerAvailability, + LayerFailureCode: () => LayerFailureCode, + LayerPartTooSmallException: () => LayerPartTooSmallException, + LayersNotFoundException: () => LayersNotFoundException, + LimitExceededException: () => LimitExceededException, + ListTagsForResourceCommand: () => ListTagsForResourceCommand, + PutImageCommand: () => PutImageCommand, + PutRegistryCatalogDataCommand: () => PutRegistryCatalogDataCommand, + PutRepositoryCatalogDataCommand: () => PutRepositoryCatalogDataCommand, + ReferencedImagesNotFoundException: () => ReferencedImagesNotFoundException, + RegistryAliasStatus: () => RegistryAliasStatus, + RegistryNotFoundException: () => RegistryNotFoundException, + RepositoryAlreadyExistsException: () => RepositoryAlreadyExistsException, + RepositoryCatalogDataNotFoundException: () => RepositoryCatalogDataNotFoundException, + RepositoryNotEmptyException: () => RepositoryNotEmptyException, + RepositoryNotFoundException: () => RepositoryNotFoundException, + RepositoryPolicyNotFoundException: () => RepositoryPolicyNotFoundException, + ServerException: () => ServerException, + SetRepositoryPolicyCommand: () => SetRepositoryPolicyCommand, + TagResourceCommand: () => TagResourceCommand, + TooManyTagsException: () => TooManyTagsException, + UnsupportedCommandException: () => UnsupportedCommandException, + UntagResourceCommand: () => UntagResourceCommand, + UploadLayerPartCommand: () => UploadLayerPartCommand, + UploadNotFoundException: () => UploadNotFoundException, + __Client: () => import_smithy_client.Client, + paginateDescribeImageTags: () => paginateDescribeImageTags, + paginateDescribeImages: () => paginateDescribeImages, + paginateDescribeRegistries: () => paginateDescribeRegistries, + paginateDescribeRepositories: () => paginateDescribeRepositories +}); +module.exports = __toCommonJS(src_exports); + +// src/ECRPUBLICClient.ts +var import_middleware_host_header = __nccwpck_require__(2545); +var import_middleware_logger = __nccwpck_require__(14); +var import_middleware_recursion_detection = __nccwpck_require__(5525); +var import_middleware_user_agent = __nccwpck_require__(4688); +var import_config_resolver = __nccwpck_require__(3098); +var import_core = __nccwpck_require__(5829); +var import_middleware_content_length = __nccwpck_require__(2800); +var import_middleware_endpoint = __nccwpck_require__(2918); +var import_middleware_retry = __nccwpck_require__(6039); + +var import_httpAuthSchemeProvider = __nccwpck_require__(7614); + +// src/endpoint/EndpointParameters.ts +var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "ecr-public" + }; +}, "resolveClientEndpointParameters"); +var commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } +}; + +// src/ECRPUBLICClient.ts +var import_runtimeConfig = __nccwpck_require__(9324); + +// src/runtimeExtensions.ts +var import_region_config_resolver = __nccwpck_require__(8156); +var import_protocol_http = __nccwpck_require__(4483); +var import_smithy_client = __nccwpck_require__(3570); + +// src/auth/httpAuthExtensionConfiguration.ts +var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((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; } -} -exports.DescribeImageTagsCommand = DescribeImageTagsCommand; - + }; +}, "getHttpAuthExtensionConfiguration"); +var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; +}, "resolveHttpAuthRuntimeConfig"); + +// src/runtimeExtensions.ts +var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial"); +var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { + const extensionConfiguration = { + ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)), + ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)) + }; + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return { + ...runtimeConfig, + ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), + ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), + ...resolveHttpAuthRuntimeConfig(extensionConfiguration) + }; +}, "resolveRuntimeExtensions"); + +// src/ECRPUBLICClient.ts +var _ECRPUBLICClient = class _ECRPUBLICClient extends import_smithy_client.Client { + constructor(...[configuration]) { + const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1); + const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2); + const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3); + const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5); + const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); + this.middlewareStack.use( + (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, { + httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(), + identityProviderConfigProvider: this.getIdentityProviderConfigProvider() + }) + ); + this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config)); + } + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy() { + super.destroy(); + } + getDefaultHttpAuthSchemeParametersProvider() { + return import_httpAuthSchemeProvider.defaultECRPUBLICHttpAuthSchemeParametersProvider; + } + getIdentityProviderConfigProvider() { + return async (config) => new import_core.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials + }); + } +}; +__name(_ECRPUBLICClient, "ECRPUBLICClient"); +var ECRPUBLICClient = _ECRPUBLICClient; -/***/ }), +// src/ECRPUBLIC.ts -/***/ 22776: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +// src/commands/BatchCheckLayerAvailabilityCommand.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeImagesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class DescribeImagesCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeImagesCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "DescribeImagesCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "DescribeImages", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeImagesCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeImagesCommand)(output, context); - } -} -exports.DescribeImagesCommand = DescribeImagesCommand; +var import_middleware_serde = __nccwpck_require__(1238); +var import_types = __nccwpck_require__(3399); -/***/ }), +// src/protocols/Aws_json1_1.ts -/***/ 78696: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeRegistriesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class DescribeRegistriesCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeRegistriesCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "DescribeRegistriesCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "DescribeRegistries", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeRegistriesCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeRegistriesCommand)(output, context); - } -} -exports.DescribeRegistriesCommand = DescribeRegistriesCommand; +// src/models/ECRPUBLICServiceException.ts +var _ECRPUBLICServiceException = class _ECRPUBLICServiceException extends import_smithy_client.ServiceException { + /** + * @internal + */ + constructor(options) { + super(options); + Object.setPrototypeOf(this, _ECRPUBLICServiceException.prototype); + } +}; +__name(_ECRPUBLICServiceException, "ECRPUBLICServiceException"); +var ECRPUBLICServiceException = _ECRPUBLICServiceException; + +// src/models/models_0.ts +var LayerFailureCode = { + InvalidLayerDigest: "InvalidLayerDigest", + MissingLayerDigest: "MissingLayerDigest" +}; +var LayerAvailability = { + AVAILABLE: "AVAILABLE", + UNAVAILABLE: "UNAVAILABLE" +}; +var _InvalidParameterException = class _InvalidParameterException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidParameterException", + $fault: "client", + ...opts + }); + this.name = "InvalidParameterException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidParameterException.prototype); + } +}; +__name(_InvalidParameterException, "InvalidParameterException"); +var InvalidParameterException = _InvalidParameterException; +var _RegistryNotFoundException = class _RegistryNotFoundException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RegistryNotFoundException", + $fault: "client", + ...opts + }); + this.name = "RegistryNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RegistryNotFoundException.prototype); + } +}; +__name(_RegistryNotFoundException, "RegistryNotFoundException"); +var RegistryNotFoundException = _RegistryNotFoundException; +var _RepositoryNotFoundException = class _RepositoryNotFoundException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryNotFoundException", + $fault: "client", + ...opts + }); + this.name = "RepositoryNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryNotFoundException.prototype); + } +}; +__name(_RepositoryNotFoundException, "RepositoryNotFoundException"); +var RepositoryNotFoundException = _RepositoryNotFoundException; +var _ServerException = class _ServerException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ServerException", + $fault: "server", + ...opts + }); + this.name = "ServerException"; + this.$fault = "server"; + Object.setPrototypeOf(this, _ServerException.prototype); + } +}; +__name(_ServerException, "ServerException"); +var ServerException = _ServerException; +var _UnsupportedCommandException = class _UnsupportedCommandException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnsupportedCommandException", + $fault: "client", + ...opts + }); + this.name = "UnsupportedCommandException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnsupportedCommandException.prototype); + } +}; +__name(_UnsupportedCommandException, "UnsupportedCommandException"); +var UnsupportedCommandException = _UnsupportedCommandException; +var ImageFailureCode = { + ImageNotFound: "ImageNotFound", + ImageReferencedByManifestList: "ImageReferencedByManifestList", + ImageTagDoesNotMatchDigest: "ImageTagDoesNotMatchDigest", + InvalidImageDigest: "InvalidImageDigest", + InvalidImageTag: "InvalidImageTag", + KmsError: "KmsError", + MissingDigestAndTag: "MissingDigestAndTag" +}; +var _EmptyUploadException = class _EmptyUploadException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "EmptyUploadException", + $fault: "client", + ...opts + }); + this.name = "EmptyUploadException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _EmptyUploadException.prototype); + } +}; +__name(_EmptyUploadException, "EmptyUploadException"); +var EmptyUploadException = _EmptyUploadException; +var _InvalidLayerException = class _InvalidLayerException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidLayerException", + $fault: "client", + ...opts + }); + this.name = "InvalidLayerException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidLayerException.prototype); + } +}; +__name(_InvalidLayerException, "InvalidLayerException"); +var InvalidLayerException = _InvalidLayerException; +var _LayerAlreadyExistsException = class _LayerAlreadyExistsException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LayerAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "LayerAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LayerAlreadyExistsException.prototype); + } +}; +__name(_LayerAlreadyExistsException, "LayerAlreadyExistsException"); +var LayerAlreadyExistsException = _LayerAlreadyExistsException; +var _LayerPartTooSmallException = class _LayerPartTooSmallException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LayerPartTooSmallException", + $fault: "client", + ...opts + }); + this.name = "LayerPartTooSmallException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LayerPartTooSmallException.prototype); + } +}; +__name(_LayerPartTooSmallException, "LayerPartTooSmallException"); +var LayerPartTooSmallException = _LayerPartTooSmallException; +var _UploadNotFoundException = class _UploadNotFoundException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UploadNotFoundException", + $fault: "client", + ...opts + }); + this.name = "UploadNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UploadNotFoundException.prototype); + } +}; +__name(_UploadNotFoundException, "UploadNotFoundException"); +var UploadNotFoundException = _UploadNotFoundException; +var _InvalidTagParameterException = class _InvalidTagParameterException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidTagParameterException", + $fault: "client", + ...opts + }); + this.name = "InvalidTagParameterException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidTagParameterException.prototype); + } +}; +__name(_InvalidTagParameterException, "InvalidTagParameterException"); +var InvalidTagParameterException = _InvalidTagParameterException; +var _LimitExceededException = class _LimitExceededException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LimitExceededException", + $fault: "client", + ...opts + }); + this.name = "LimitExceededException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LimitExceededException.prototype); + } +}; +__name(_LimitExceededException, "LimitExceededException"); +var LimitExceededException = _LimitExceededException; +var _RepositoryAlreadyExistsException = class _RepositoryAlreadyExistsException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "RepositoryAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryAlreadyExistsException.prototype); + } +}; +__name(_RepositoryAlreadyExistsException, "RepositoryAlreadyExistsException"); +var RepositoryAlreadyExistsException = _RepositoryAlreadyExistsException; +var _TooManyTagsException = class _TooManyTagsException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "TooManyTagsException", + $fault: "client", + ...opts + }); + this.name = "TooManyTagsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _TooManyTagsException.prototype); + } +}; +__name(_TooManyTagsException, "TooManyTagsException"); +var TooManyTagsException = _TooManyTagsException; +var _RepositoryNotEmptyException = class _RepositoryNotEmptyException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryNotEmptyException", + $fault: "client", + ...opts + }); + this.name = "RepositoryNotEmptyException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryNotEmptyException.prototype); + } +}; +__name(_RepositoryNotEmptyException, "RepositoryNotEmptyException"); +var RepositoryNotEmptyException = _RepositoryNotEmptyException; +var _RepositoryPolicyNotFoundException = class _RepositoryPolicyNotFoundException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryPolicyNotFoundException", + $fault: "client", + ...opts + }); + this.name = "RepositoryPolicyNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryPolicyNotFoundException.prototype); + } +}; +__name(_RepositoryPolicyNotFoundException, "RepositoryPolicyNotFoundException"); +var RepositoryPolicyNotFoundException = _RepositoryPolicyNotFoundException; +var _ImageNotFoundException = class _ImageNotFoundException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ImageNotFoundException", + $fault: "client", + ...opts + }); + this.name = "ImageNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ImageNotFoundException.prototype); + } +}; +__name(_ImageNotFoundException, "ImageNotFoundException"); +var ImageNotFoundException = _ImageNotFoundException; +var RegistryAliasStatus = { + ACTIVE: "ACTIVE", + PENDING: "PENDING", + REJECTED: "REJECTED" +}; +var _RepositoryCatalogDataNotFoundException = class _RepositoryCatalogDataNotFoundException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryCatalogDataNotFoundException", + $fault: "client", + ...opts + }); + this.name = "RepositoryCatalogDataNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryCatalogDataNotFoundException.prototype); + } +}; +__name(_RepositoryCatalogDataNotFoundException, "RepositoryCatalogDataNotFoundException"); +var RepositoryCatalogDataNotFoundException = _RepositoryCatalogDataNotFoundException; +var _ImageAlreadyExistsException = class _ImageAlreadyExistsException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ImageAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "ImageAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ImageAlreadyExistsException.prototype); + } +}; +__name(_ImageAlreadyExistsException, "ImageAlreadyExistsException"); +var ImageAlreadyExistsException = _ImageAlreadyExistsException; +var _ImageDigestDoesNotMatchException = class _ImageDigestDoesNotMatchException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ImageDigestDoesNotMatchException", + $fault: "client", + ...opts + }); + this.name = "ImageDigestDoesNotMatchException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ImageDigestDoesNotMatchException.prototype); + } +}; +__name(_ImageDigestDoesNotMatchException, "ImageDigestDoesNotMatchException"); +var ImageDigestDoesNotMatchException = _ImageDigestDoesNotMatchException; +var _ImageTagAlreadyExistsException = class _ImageTagAlreadyExistsException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ImageTagAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "ImageTagAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ImageTagAlreadyExistsException.prototype); + } +}; +__name(_ImageTagAlreadyExistsException, "ImageTagAlreadyExistsException"); +var ImageTagAlreadyExistsException = _ImageTagAlreadyExistsException; +var _InvalidLayerPartException = class _InvalidLayerPartException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidLayerPartException", + $fault: "client", + ...opts + }); + this.name = "InvalidLayerPartException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidLayerPartException.prototype); + this.registryId = opts.registryId; + this.repositoryName = opts.repositoryName; + this.uploadId = opts.uploadId; + this.lastValidByteReceived = opts.lastValidByteReceived; + } +}; +__name(_InvalidLayerPartException, "InvalidLayerPartException"); +var InvalidLayerPartException = _InvalidLayerPartException; +var _LayersNotFoundException = class _LayersNotFoundException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LayersNotFoundException", + $fault: "client", + ...opts + }); + this.name = "LayersNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LayersNotFoundException.prototype); + } +}; +__name(_LayersNotFoundException, "LayersNotFoundException"); +var LayersNotFoundException = _LayersNotFoundException; +var _ReferencedImagesNotFoundException = class _ReferencedImagesNotFoundException extends ECRPUBLICServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ReferencedImagesNotFoundException", + $fault: "client", + ...opts + }); + this.name = "ReferencedImagesNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ReferencedImagesNotFoundException.prototype); + } +}; +__name(_ReferencedImagesNotFoundException, "ReferencedImagesNotFoundException"); +var ReferencedImagesNotFoundException = _ReferencedImagesNotFoundException; + +// src/protocols/Aws_json1_1.ts +var se_BatchCheckLayerAvailabilityCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("BatchCheckLayerAvailability"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_BatchCheckLayerAvailabilityCommand"); +var se_BatchDeleteImageCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("BatchDeleteImage"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_BatchDeleteImageCommand"); +var se_CompleteLayerUploadCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("CompleteLayerUpload"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_CompleteLayerUploadCommand"); +var se_CreateRepositoryCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("CreateRepository"); + let body; + body = JSON.stringify(se_CreateRepositoryRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_CreateRepositoryCommand"); +var se_DeleteRepositoryCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DeleteRepository"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DeleteRepositoryCommand"); +var se_DeleteRepositoryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DeleteRepositoryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DeleteRepositoryPolicyCommand"); +var se_DescribeImagesCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeImages"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeImagesCommand"); +var se_DescribeImageTagsCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeImageTags"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeImageTagsCommand"); +var se_DescribeRegistriesCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeRegistries"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeRegistriesCommand"); +var se_DescribeRepositoriesCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeRepositories"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeRepositoriesCommand"); +var se_GetAuthorizationTokenCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetAuthorizationToken"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetAuthorizationTokenCommand"); +var se_GetRegistryCatalogDataCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetRegistryCatalogData"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetRegistryCatalogDataCommand"); +var se_GetRepositoryCatalogDataCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetRepositoryCatalogData"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetRepositoryCatalogDataCommand"); +var se_GetRepositoryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetRepositoryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetRepositoryPolicyCommand"); +var se_InitiateLayerUploadCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("InitiateLayerUpload"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_InitiateLayerUploadCommand"); +var se_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("ListTagsForResource"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_ListTagsForResourceCommand"); +var se_PutImageCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutImage"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutImageCommand"); +var se_PutRegistryCatalogDataCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutRegistryCatalogData"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutRegistryCatalogDataCommand"); +var se_PutRepositoryCatalogDataCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutRepositoryCatalogData"); + let body; + body = JSON.stringify(se_PutRepositoryCatalogDataRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutRepositoryCatalogDataCommand"); +var se_SetRepositoryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("SetRepositoryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_SetRepositoryPolicyCommand"); +var se_TagResourceCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("TagResource"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_TagResourceCommand"); +var se_UntagResourceCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("UntagResource"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_UntagResourceCommand"); +var se_UploadLayerPartCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("UploadLayerPart"); + let body; + body = JSON.stringify(se_UploadLayerPartRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_UploadLayerPartCommand"); +var de_BatchCheckLayerAvailabilityCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_BatchCheckLayerAvailabilityCommand"); +var de_BatchDeleteImageCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_BatchDeleteImageCommand"); +var de_CompleteLayerUploadCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_CompleteLayerUploadCommand"); +var de_CreateRepositoryCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_CreateRepositoryResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_CreateRepositoryCommand"); +var de_DeleteRepositoryCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DeleteRepositoryResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DeleteRepositoryCommand"); +var de_DeleteRepositoryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DeleteRepositoryPolicyCommand"); +var de_DescribeImagesCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DescribeImagesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeImagesCommand"); +var de_DescribeImageTagsCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DescribeImageTagsResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeImageTagsCommand"); +var de_DescribeRegistriesCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeRegistriesCommand"); +var de_DescribeRepositoriesCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DescribeRepositoriesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeRepositoriesCommand"); +var de_GetAuthorizationTokenCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_GetAuthorizationTokenResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetAuthorizationTokenCommand"); +var de_GetRegistryCatalogDataCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetRegistryCatalogDataCommand"); +var de_GetRepositoryCatalogDataCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetRepositoryCatalogDataCommand"); +var de_GetRepositoryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetRepositoryPolicyCommand"); +var de_InitiateLayerUploadCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_InitiateLayerUploadCommand"); +var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_ListTagsForResourceCommand"); +var de_PutImageCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutImageCommand"); +var de_PutRegistryCatalogDataCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutRegistryCatalogDataCommand"); +var de_PutRepositoryCatalogDataCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutRepositoryCatalogDataCommand"); +var de_SetRepositoryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_SetRepositoryPolicyCommand"); +var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_TagResourceCommand"); +var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_UntagResourceCommand"); +var de_UploadLayerPartCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_UploadLayerPartCommand"); +var de_CommandError = /* @__PURE__ */ __name(async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context) + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidParameterException": + case "com.amazonaws.ecrpublic#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "RegistryNotFoundException": + case "com.amazonaws.ecrpublic#RegistryNotFoundException": + throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); + case "RepositoryNotFoundException": + case "com.amazonaws.ecrpublic#RepositoryNotFoundException": + throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); + case "ServerException": + case "com.amazonaws.ecrpublic#ServerException": + throw await de_ServerExceptionRes(parsedOutput, context); + case "UnsupportedCommandException": + case "com.amazonaws.ecrpublic#UnsupportedCommandException": + throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); + case "EmptyUploadException": + case "com.amazonaws.ecrpublic#EmptyUploadException": + throw await de_EmptyUploadExceptionRes(parsedOutput, context); + case "InvalidLayerException": + case "com.amazonaws.ecrpublic#InvalidLayerException": + throw await de_InvalidLayerExceptionRes(parsedOutput, context); + case "LayerAlreadyExistsException": + case "com.amazonaws.ecrpublic#LayerAlreadyExistsException": + throw await de_LayerAlreadyExistsExceptionRes(parsedOutput, context); + case "LayerPartTooSmallException": + case "com.amazonaws.ecrpublic#LayerPartTooSmallException": + throw await de_LayerPartTooSmallExceptionRes(parsedOutput, context); + case "UploadNotFoundException": + case "com.amazonaws.ecrpublic#UploadNotFoundException": + throw await de_UploadNotFoundExceptionRes(parsedOutput, context); + case "InvalidTagParameterException": + case "com.amazonaws.ecrpublic#InvalidTagParameterException": + throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.ecrpublic#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "RepositoryAlreadyExistsException": + case "com.amazonaws.ecrpublic#RepositoryAlreadyExistsException": + throw await de_RepositoryAlreadyExistsExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.ecrpublic#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "RepositoryNotEmptyException": + case "com.amazonaws.ecrpublic#RepositoryNotEmptyException": + throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); + case "RepositoryPolicyNotFoundException": + case "com.amazonaws.ecrpublic#RepositoryPolicyNotFoundException": + throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); + case "ImageNotFoundException": + case "com.amazonaws.ecrpublic#ImageNotFoundException": + throw await de_ImageNotFoundExceptionRes(parsedOutput, context); + case "RepositoryCatalogDataNotFoundException": + case "com.amazonaws.ecrpublic#RepositoryCatalogDataNotFoundException": + throw await de_RepositoryCatalogDataNotFoundExceptionRes(parsedOutput, context); + case "ImageAlreadyExistsException": + case "com.amazonaws.ecrpublic#ImageAlreadyExistsException": + throw await de_ImageAlreadyExistsExceptionRes(parsedOutput, context); + case "ImageDigestDoesNotMatchException": + case "com.amazonaws.ecrpublic#ImageDigestDoesNotMatchException": + throw await de_ImageDigestDoesNotMatchExceptionRes(parsedOutput, context); + case "ImageTagAlreadyExistsException": + case "com.amazonaws.ecrpublic#ImageTagAlreadyExistsException": + throw await de_ImageTagAlreadyExistsExceptionRes(parsedOutput, context); + case "LayersNotFoundException": + case "com.amazonaws.ecrpublic#LayersNotFoundException": + throw await de_LayersNotFoundExceptionRes(parsedOutput, context); + case "ReferencedImagesNotFoundException": + case "com.amazonaws.ecrpublic#ReferencedImagesNotFoundException": + throw await de_ReferencedImagesNotFoundExceptionRes(parsedOutput, context); + case "InvalidLayerPartException": + case "com.amazonaws.ecrpublic#InvalidLayerPartException": + throw await de_InvalidLayerPartExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode + }); + } +}, "de_CommandError"); +var de_EmptyUploadExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new EmptyUploadException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_EmptyUploadExceptionRes"); +var de_ImageAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ImageAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ImageAlreadyExistsExceptionRes"); +var de_ImageDigestDoesNotMatchExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ImageDigestDoesNotMatchException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ImageDigestDoesNotMatchExceptionRes"); +var de_ImageNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ImageNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ImageNotFoundExceptionRes"); +var de_ImageTagAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ImageTagAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ImageTagAlreadyExistsExceptionRes"); +var de_InvalidLayerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InvalidLayerException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidLayerExceptionRes"); +var de_InvalidLayerPartExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InvalidLayerPartException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidLayerPartExceptionRes"); +var de_InvalidParameterExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InvalidParameterException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidParameterExceptionRes"); +var de_InvalidTagParameterExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InvalidTagParameterException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidTagParameterExceptionRes"); +var de_LayerAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LayerAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LayerAlreadyExistsExceptionRes"); +var de_LayerPartTooSmallExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LayerPartTooSmallException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LayerPartTooSmallExceptionRes"); +var de_LayersNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LayersNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LayersNotFoundExceptionRes"); +var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LimitExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LimitExceededExceptionRes"); +var de_ReferencedImagesNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ReferencedImagesNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ReferencedImagesNotFoundExceptionRes"); +var de_RegistryNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RegistryNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RegistryNotFoundExceptionRes"); +var de_RepositoryAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryAlreadyExistsExceptionRes"); +var de_RepositoryCatalogDataNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryCatalogDataNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryCatalogDataNotFoundExceptionRes"); +var de_RepositoryNotEmptyExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryNotEmptyException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryNotEmptyExceptionRes"); +var de_RepositoryNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryNotFoundExceptionRes"); +var de_RepositoryPolicyNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryPolicyNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryPolicyNotFoundExceptionRes"); +var de_ServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ServerExceptionRes"); +var de_TooManyTagsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new TooManyTagsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_TooManyTagsExceptionRes"); +var de_UnsupportedCommandExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UnsupportedCommandException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UnsupportedCommandExceptionRes"); +var de_UploadNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UploadNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UploadNotFoundExceptionRes"); +var se_CreateRepositoryRequest = /* @__PURE__ */ __name((input, context) => { + return (0, import_smithy_client.take)(input, { + catalogData: (_) => se_RepositoryCatalogDataInput(_, context), + repositoryName: [], + tags: import_smithy_client._json + }); +}, "se_CreateRepositoryRequest"); +var se_PutRepositoryCatalogDataRequest = /* @__PURE__ */ __name((input, context) => { + return (0, import_smithy_client.take)(input, { + catalogData: (_) => se_RepositoryCatalogDataInput(_, context), + registryId: [], + repositoryName: [] + }); +}, "se_PutRepositoryCatalogDataRequest"); +var se_RepositoryCatalogDataInput = /* @__PURE__ */ __name((input, context) => { + return (0, import_smithy_client.take)(input, { + aboutText: [], + architectures: import_smithy_client._json, + description: [], + logoImageBlob: context.base64Encoder, + operatingSystems: import_smithy_client._json, + usageText: [] + }); +}, "se_RepositoryCatalogDataInput"); +var se_UploadLayerPartRequest = /* @__PURE__ */ __name((input, context) => { + return (0, import_smithy_client.take)(input, { + layerPartBlob: context.base64Encoder, + partFirstByte: [], + partLastByte: [], + registryId: [], + repositoryName: [], + uploadId: [] + }); +}, "se_UploadLayerPartRequest"); +var de_AuthorizationData = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + authorizationToken: import_smithy_client.expectString, + expiresAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))) + }); +}, "de_AuthorizationData"); +var de_CreateRepositoryResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + catalogData: import_smithy_client._json, + repository: (_) => de_Repository(_, context) + }); +}, "de_CreateRepositoryResponse"); +var de_DeleteRepositoryResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + repository: (_) => de_Repository(_, context) + }); +}, "de_DeleteRepositoryResponse"); +var de_DescribeImagesResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + imageDetails: (_) => de_ImageDetailList(_, context), + nextToken: import_smithy_client.expectString + }); +}, "de_DescribeImagesResponse"); +var de_DescribeImageTagsResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + imageTagDetails: (_) => de_ImageTagDetailList(_, context), + nextToken: import_smithy_client.expectString + }); +}, "de_DescribeImageTagsResponse"); +var de_DescribeRepositoriesResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + nextToken: import_smithy_client.expectString, + repositories: (_) => de_RepositoryList(_, context) + }); +}, "de_DescribeRepositoriesResponse"); +var de_GetAuthorizationTokenResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + authorizationData: (_) => de_AuthorizationData(_, context) + }); +}, "de_GetAuthorizationTokenResponse"); +var de_ImageDetail = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + artifactMediaType: import_smithy_client.expectString, + imageDigest: import_smithy_client.expectString, + imageManifestMediaType: import_smithy_client.expectString, + imagePushedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + imageSizeInBytes: import_smithy_client.expectLong, + imageTags: import_smithy_client._json, + registryId: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString + }); +}, "de_ImageDetail"); +var de_ImageDetailList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_ImageDetail(entry, context); + }); + return retVal; +}, "de_ImageDetailList"); +var de_ImageTagDetail = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + imageDetail: (_) => de_ReferencedImageDetail(_, context), + imageTag: import_smithy_client.expectString + }); +}, "de_ImageTagDetail"); +var de_ImageTagDetailList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_ImageTagDetail(entry, context); + }); + return retVal; +}, "de_ImageTagDetailList"); +var de_ReferencedImageDetail = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + artifactMediaType: import_smithy_client.expectString, + imageDigest: import_smithy_client.expectString, + imageManifestMediaType: import_smithy_client.expectString, + imagePushedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + imageSizeInBytes: import_smithy_client.expectLong + }); +}, "de_ReferencedImageDetail"); +var de_Repository = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + registryId: import_smithy_client.expectString, + repositoryArn: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString, + repositoryUri: import_smithy_client.expectString + }); +}, "de_Repository"); +var de_RepositoryList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_Repository(entry, context); + }); + return retVal; +}, "de_RepositoryList"); +var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] +}), "deserializeMetadata"); +var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString"); +var throwDefaultError = (0, import_smithy_client.withBaseException)(ECRPUBLICServiceException); +var buildHttpRpcRequest = /* @__PURE__ */ __name(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 + }; + if (resolvedHostname !== void 0) { + contents.hostname = resolvedHostname; + } + if (body !== void 0) { + contents.body = body; + } + return new import_protocol_http.HttpRequest(contents); +}, "buildHttpRpcRequest"); +function sharedHeaders(operation) { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `SpencerFrontendService.${operation}` + }; +} +__name(sharedHeaders, "sharedHeaders"); +var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}), "parseBody"); +var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}, "parseErrorBody"); +var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => { + const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey"); + const sanitizeErrorCode = /* @__PURE__ */ __name((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; + }, "sanitizeErrorCode"); + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== void 0) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== void 0) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== void 0) { + return sanitizeErrorCode(data["__type"]); + } +}, "loadRestJsonErrorCode"); -/***/ }), +// src/commands/BatchCheckLayerAvailabilityCommand.ts +var _BatchCheckLayerAvailabilityCommand = class _BatchCheckLayerAvailabilityCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "BatchCheckLayerAvailability", {}).n("ECRPUBLICClient", "BatchCheckLayerAvailabilityCommand").f(void 0, void 0).ser(se_BatchCheckLayerAvailabilityCommand).de(de_BatchCheckLayerAvailabilityCommand).build() { +}; +__name(_BatchCheckLayerAvailabilityCommand, "BatchCheckLayerAvailabilityCommand"); +var BatchCheckLayerAvailabilityCommand = _BatchCheckLayerAvailabilityCommand; -/***/ 82218: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/BatchDeleteImageCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeRepositoriesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class DescribeRepositoriesCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeRepositoriesCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "DescribeRepositoriesCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "DescribeRepositories", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeRepositoriesCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeRepositoriesCommand)(output, context); - } -} -exports.DescribeRepositoriesCommand = DescribeRepositoriesCommand; -/***/ }), +var _BatchDeleteImageCommand = class _BatchDeleteImageCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "BatchDeleteImage", {}).n("ECRPUBLICClient", "BatchDeleteImageCommand").f(void 0, void 0).ser(se_BatchDeleteImageCommand).de(de_BatchDeleteImageCommand).build() { +}; +__name(_BatchDeleteImageCommand, "BatchDeleteImageCommand"); +var BatchDeleteImageCommand = _BatchDeleteImageCommand; -/***/ 92674: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/CompleteLayerUploadCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetAuthorizationTokenCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class GetAuthorizationTokenCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetAuthorizationTokenCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "GetAuthorizationTokenCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "GetAuthorizationToken", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetAuthorizationTokenCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetAuthorizationTokenCommand)(output, context); - } -} -exports.GetAuthorizationTokenCommand = GetAuthorizationTokenCommand; -/***/ }), +var _CompleteLayerUploadCommand = class _CompleteLayerUploadCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "CompleteLayerUpload", {}).n("ECRPUBLICClient", "CompleteLayerUploadCommand").f(void 0, void 0).ser(se_CompleteLayerUploadCommand).de(de_CompleteLayerUploadCommand).build() { +}; +__name(_CompleteLayerUploadCommand, "CompleteLayerUploadCommand"); +var CompleteLayerUploadCommand = _CompleteLayerUploadCommand; -/***/ 26518: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/CreateRepositoryCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetRegistryCatalogDataCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class GetRegistryCatalogDataCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRegistryCatalogDataCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "GetRegistryCatalogDataCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "GetRegistryCatalogData", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetRegistryCatalogDataCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetRegistryCatalogDataCommand)(output, context); - } -} -exports.GetRegistryCatalogDataCommand = GetRegistryCatalogDataCommand; -/***/ }), +var _CreateRepositoryCommand = class _CreateRepositoryCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "CreateRepository", {}).n("ECRPUBLICClient", "CreateRepositoryCommand").f(void 0, void 0).ser(se_CreateRepositoryCommand).de(de_CreateRepositoryCommand).build() { +}; +__name(_CreateRepositoryCommand, "CreateRepositoryCommand"); +var CreateRepositoryCommand = _CreateRepositoryCommand; -/***/ 53189: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/DeleteRepositoryCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetRepositoryCatalogDataCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class GetRepositoryCatalogDataCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRepositoryCatalogDataCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "GetRepositoryCatalogDataCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "GetRepositoryCatalogData", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetRepositoryCatalogDataCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetRepositoryCatalogDataCommand)(output, context); - } -} -exports.GetRepositoryCatalogDataCommand = GetRepositoryCatalogDataCommand; -/***/ }), +var _DeleteRepositoryCommand = class _DeleteRepositoryCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "DeleteRepository", {}).n("ECRPUBLICClient", "DeleteRepositoryCommand").f(void 0, void 0).ser(se_DeleteRepositoryCommand).de(de_DeleteRepositoryCommand).build() { +}; +__name(_DeleteRepositoryCommand, "DeleteRepositoryCommand"); +var DeleteRepositoryCommand = _DeleteRepositoryCommand; -/***/ 8562: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/DeleteRepositoryPolicyCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetRepositoryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class GetRepositoryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRepositoryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "GetRepositoryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "GetRepositoryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetRepositoryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetRepositoryPolicyCommand)(output, context); - } -} -exports.GetRepositoryPolicyCommand = GetRepositoryPolicyCommand; -/***/ }), +var _DeleteRepositoryPolicyCommand = class _DeleteRepositoryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "DeleteRepositoryPolicy", {}).n("ECRPUBLICClient", "DeleteRepositoryPolicyCommand").f(void 0, void 0).ser(se_DeleteRepositoryPolicyCommand).de(de_DeleteRepositoryPolicyCommand).build() { +}; +__name(_DeleteRepositoryPolicyCommand, "DeleteRepositoryPolicyCommand"); +var DeleteRepositoryPolicyCommand = _DeleteRepositoryPolicyCommand; -/***/ 83675: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/DescribeImagesCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InitiateLayerUploadCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class InitiateLayerUploadCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, InitiateLayerUploadCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "InitiateLayerUploadCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "InitiateLayerUpload", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_InitiateLayerUploadCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_InitiateLayerUploadCommand)(output, context); - } -} -exports.InitiateLayerUploadCommand = InitiateLayerUploadCommand; -/***/ }), +var _DescribeImagesCommand = class _DescribeImagesCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "DescribeImages", {}).n("ECRPUBLICClient", "DescribeImagesCommand").f(void 0, void 0).ser(se_DescribeImagesCommand).de(de_DescribeImagesCommand).build() { +}; +__name(_DescribeImagesCommand, "DescribeImagesCommand"); +var DescribeImagesCommand = _DescribeImagesCommand; -/***/ 80575: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/DescribeImageTagsCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ListTagsForResourceCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class ListTagsForResourceCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "ListTagsForResourceCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "ListTagsForResource", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_ListTagsForResourceCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_ListTagsForResourceCommand)(output, context); - } -} -exports.ListTagsForResourceCommand = ListTagsForResourceCommand; -/***/ }), +var _DescribeImageTagsCommand = class _DescribeImageTagsCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "DescribeImageTags", {}).n("ECRPUBLICClient", "DescribeImageTagsCommand").f(void 0, void 0).ser(se_DescribeImageTagsCommand).de(de_DescribeImageTagsCommand).build() { +}; +__name(_DescribeImageTagsCommand, "DescribeImageTagsCommand"); +var DescribeImageTagsCommand = _DescribeImageTagsCommand; -/***/ 86486: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/DescribeRegistriesCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutImageCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class PutImageCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutImageCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "PutImageCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "PutImage", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutImageCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutImageCommand)(output, context); - } -} -exports.PutImageCommand = PutImageCommand; -/***/ }), +var _DescribeRegistriesCommand = class _DescribeRegistriesCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "DescribeRegistries", {}).n("ECRPUBLICClient", "DescribeRegistriesCommand").f(void 0, void 0).ser(se_DescribeRegistriesCommand).de(de_DescribeRegistriesCommand).build() { +}; +__name(_DescribeRegistriesCommand, "DescribeRegistriesCommand"); +var DescribeRegistriesCommand = _DescribeRegistriesCommand; -/***/ 46805: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/DescribeRepositoriesCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutRegistryCatalogDataCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class PutRegistryCatalogDataCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutRegistryCatalogDataCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "PutRegistryCatalogDataCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "PutRegistryCatalogData", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutRegistryCatalogDataCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutRegistryCatalogDataCommand)(output, context); - } -} -exports.PutRegistryCatalogDataCommand = PutRegistryCatalogDataCommand; -/***/ }), +var _DescribeRepositoriesCommand = class _DescribeRepositoriesCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "DescribeRepositories", {}).n("ECRPUBLICClient", "DescribeRepositoriesCommand").f(void 0, void 0).ser(se_DescribeRepositoriesCommand).de(de_DescribeRepositoriesCommand).build() { +}; +__name(_DescribeRepositoriesCommand, "DescribeRepositoriesCommand"); +var DescribeRepositoriesCommand = _DescribeRepositoriesCommand; -/***/ 83753: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/GetAuthorizationTokenCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutRepositoryCatalogDataCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class PutRepositoryCatalogDataCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutRepositoryCatalogDataCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "PutRepositoryCatalogDataCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "PutRepositoryCatalogData", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutRepositoryCatalogDataCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutRepositoryCatalogDataCommand)(output, context); - } -} -exports.PutRepositoryCatalogDataCommand = PutRepositoryCatalogDataCommand; -/***/ }), +var _GetAuthorizationTokenCommand = class _GetAuthorizationTokenCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "GetAuthorizationToken", {}).n("ECRPUBLICClient", "GetAuthorizationTokenCommand").f(void 0, void 0).ser(se_GetAuthorizationTokenCommand).de(de_GetAuthorizationTokenCommand).build() { +}; +__name(_GetAuthorizationTokenCommand, "GetAuthorizationTokenCommand"); +var GetAuthorizationTokenCommand = _GetAuthorizationTokenCommand; -/***/ 79838: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/GetRegistryCatalogDataCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SetRepositoryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class SetRepositoryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, SetRepositoryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "SetRepositoryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "SetRepositoryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_SetRepositoryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_SetRepositoryPolicyCommand)(output, context); - } -} -exports.SetRepositoryPolicyCommand = SetRepositoryPolicyCommand; -/***/ }), +var _GetRegistryCatalogDataCommand = class _GetRegistryCatalogDataCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "GetRegistryCatalogData", {}).n("ECRPUBLICClient", "GetRegistryCatalogDataCommand").f(void 0, void 0).ser(se_GetRegistryCatalogDataCommand).de(de_GetRegistryCatalogDataCommand).build() { +}; +__name(_GetRegistryCatalogDataCommand, "GetRegistryCatalogDataCommand"); +var GetRegistryCatalogDataCommand = _GetRegistryCatalogDataCommand; -/***/ 39869: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/GetRepositoryCatalogDataCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TagResourceCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class TagResourceCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, TagResourceCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "TagResourceCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "TagResource", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_TagResourceCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_TagResourceCommand)(output, context); - } -} -exports.TagResourceCommand = TagResourceCommand; -/***/ }), +var _GetRepositoryCatalogDataCommand = class _GetRepositoryCatalogDataCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "GetRepositoryCatalogData", {}).n("ECRPUBLICClient", "GetRepositoryCatalogDataCommand").f(void 0, void 0).ser(se_GetRepositoryCatalogDataCommand).de(de_GetRepositoryCatalogDataCommand).build() { +}; +__name(_GetRepositoryCatalogDataCommand, "GetRepositoryCatalogDataCommand"); +var GetRepositoryCatalogDataCommand = _GetRepositoryCatalogDataCommand; -/***/ 66689: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/GetRepositoryPolicyCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UntagResourceCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class UntagResourceCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UntagResourceCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "UntagResourceCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "UntagResource", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_UntagResourceCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_UntagResourceCommand)(output, context); - } -} -exports.UntagResourceCommand = UntagResourceCommand; -/***/ }), +var _GetRepositoryPolicyCommand = class _GetRepositoryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "GetRepositoryPolicy", {}).n("ECRPUBLICClient", "GetRepositoryPolicyCommand").f(void 0, void 0).ser(se_GetRepositoryPolicyCommand).de(de_GetRepositoryPolicyCommand).build() { +}; +__name(_GetRepositoryPolicyCommand, "GetRepositoryPolicyCommand"); +var GetRepositoryPolicyCommand = _GetRepositoryPolicyCommand; -/***/ 97429: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/InitiateLayerUploadCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UploadLayerPartCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(83399); -const Aws_json1_1_1 = __nccwpck_require__(64170); -class UploadLayerPartCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UploadLayerPartCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRPUBLICClient"; - const commandName = "UploadLayerPartCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SpencerFrontendService", - operation: "UploadLayerPart", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_UploadLayerPartCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_UploadLayerPartCommand)(output, context); - } -} -exports.UploadLayerPartCommand = UploadLayerPartCommand; -/***/ }), +var _InitiateLayerUploadCommand = class _InitiateLayerUploadCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "InitiateLayerUpload", {}).n("ECRPUBLICClient", "InitiateLayerUploadCommand").f(void 0, void 0).ser(se_InitiateLayerUploadCommand).de(de_InitiateLayerUploadCommand).build() { +}; +__name(_InitiateLayerUploadCommand, "InitiateLayerUploadCommand"); +var InitiateLayerUploadCommand = _InitiateLayerUploadCommand; -/***/ 65442: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/ListTagsForResourceCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(25356), exports); -tslib_1.__exportStar(__nccwpck_require__(56517), exports); -tslib_1.__exportStar(__nccwpck_require__(55490), exports); -tslib_1.__exportStar(__nccwpck_require__(39633), exports); -tslib_1.__exportStar(__nccwpck_require__(60467), exports); -tslib_1.__exportStar(__nccwpck_require__(62528), exports); -tslib_1.__exportStar(__nccwpck_require__(47670), exports); -tslib_1.__exportStar(__nccwpck_require__(22776), exports); -tslib_1.__exportStar(__nccwpck_require__(78696), exports); -tslib_1.__exportStar(__nccwpck_require__(82218), exports); -tslib_1.__exportStar(__nccwpck_require__(92674), exports); -tslib_1.__exportStar(__nccwpck_require__(26518), exports); -tslib_1.__exportStar(__nccwpck_require__(53189), exports); -tslib_1.__exportStar(__nccwpck_require__(8562), exports); -tslib_1.__exportStar(__nccwpck_require__(83675), exports); -tslib_1.__exportStar(__nccwpck_require__(80575), exports); -tslib_1.__exportStar(__nccwpck_require__(86486), exports); -tslib_1.__exportStar(__nccwpck_require__(46805), exports); -tslib_1.__exportStar(__nccwpck_require__(83753), exports); -tslib_1.__exportStar(__nccwpck_require__(79838), exports); -tslib_1.__exportStar(__nccwpck_require__(39869), exports); -tslib_1.__exportStar(__nccwpck_require__(66689), exports); -tslib_1.__exportStar(__nccwpck_require__(97429), exports); - - -/***/ }), - -/***/ 78258: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveClientEndpointParameters = void 0; -const resolveClientEndpointParameters = (options) => { - return { - ...options, - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "ecr-public", - }; +var _ListTagsForResourceCommand = class _ListTagsForResourceCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "ListTagsForResource", {}).n("ECRPUBLICClient", "ListTagsForResourceCommand").f(void 0, void 0).ser(se_ListTagsForResourceCommand).de(de_ListTagsForResourceCommand).build() { }; -exports.resolveClientEndpointParameters = resolveClientEndpointParameters; +__name(_ListTagsForResourceCommand, "ListTagsForResourceCommand"); +var ListTagsForResourceCommand = _ListTagsForResourceCommand; +// src/commands/PutImageCommand.ts -/***/ }), -/***/ 87377: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultEndpointResolver = void 0; -const util_endpoints_1 = __nccwpck_require__(13350); -const ruleset_1 = __nccwpck_require__(888); -const defaultEndpointResolver = (endpointParams, context = {}) => { - return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams: endpointParams, - logger: context.logger, - }); +var _PutImageCommand = class _PutImageCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "PutImage", {}).n("ECRPUBLICClient", "PutImageCommand").f(void 0, void 0).ser(se_PutImageCommand).de(de_PutImageCommand).build() { }; -exports.defaultEndpointResolver = defaultEndpointResolver; +__name(_PutImageCommand, "PutImageCommand"); +var PutImageCommand = _PutImageCommand; +// src/commands/PutRegistryCatalogDataCommand.ts -/***/ }), -/***/ 888: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ruleSet = void 0; -const q = "required", r = "fn", s = "argv", t = "ref"; -const a = "isSet", b = "tree", c = "error", d = "endpoint", e = "PartitionResult", f = { [q]: false, "type": "String" }, g = { [q]: true, "default": false, "type": "Boolean" }, h = { [t]: "Endpoint" }, i = { [r]: "booleanEquals", [s]: [{ [t]: "UseFIPS" }, true] }, j = { [r]: "booleanEquals", [s]: [{ [t]: "UseDualStack" }, true] }, k = {}, l = { [r]: "booleanEquals", [s]: [true, { [r]: "getAttr", [s]: [{ [t]: e }, "supportsFIPS"] }] }, m = { [r]: "booleanEquals", [s]: [true, { [r]: "getAttr", [s]: [{ [t]: e }, "supportsDualStack"] }] }, n = [i], o = [j], p = [{ [t]: "Region" }]; -const _data = { version: "1.0", parameters: { Region: f, UseDualStack: g, UseFIPS: g, Endpoint: f }, rules: [{ conditions: [{ [r]: a, [s]: [h] }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: h, properties: k, headers: k }, type: d }] }, { conditions: [{ [r]: a, [s]: p }], type: b, rules: [{ conditions: [{ [r]: "aws.partition", [s]: p, assign: e }], type: b, rules: [{ conditions: [i, j], type: b, rules: [{ conditions: [l, m], type: b, rules: [{ endpoint: { url: "https://api.ecr-public-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: k, headers: k }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://api.ecr-public-fips.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [m], type: b, rules: [{ endpoint: { url: "https://api.ecr-public.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: k, headers: k }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://api.ecr-public.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] }; -exports.ruleSet = _data; +var _PutRegistryCatalogDataCommand = class _PutRegistryCatalogDataCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "PutRegistryCatalogData", {}).n("ECRPUBLICClient", "PutRegistryCatalogDataCommand").f(void 0, void 0).ser(se_PutRegistryCatalogDataCommand).de(de_PutRegistryCatalogDataCommand).build() { +}; +__name(_PutRegistryCatalogDataCommand, "PutRegistryCatalogDataCommand"); +var PutRegistryCatalogDataCommand = _PutRegistryCatalogDataCommand; +// src/commands/PutRepositoryCatalogDataCommand.ts -/***/ }), -/***/ 42308: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ECRPUBLICServiceException = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(30608), exports); -tslib_1.__exportStar(__nccwpck_require__(86087), exports); -tslib_1.__exportStar(__nccwpck_require__(65442), exports); -tslib_1.__exportStar(__nccwpck_require__(75945), exports); -tslib_1.__exportStar(__nccwpck_require__(30183), exports); -var ECRPUBLICServiceException_1 = __nccwpck_require__(48278); -Object.defineProperty(exports, "ECRPUBLICServiceException", ({ enumerable: true, get: function () { return ECRPUBLICServiceException_1.ECRPUBLICServiceException; } })); +var _PutRepositoryCatalogDataCommand = class _PutRepositoryCatalogDataCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "PutRepositoryCatalogData", {}).n("ECRPUBLICClient", "PutRepositoryCatalogDataCommand").f(void 0, void 0).ser(se_PutRepositoryCatalogDataCommand).de(de_PutRepositoryCatalogDataCommand).build() { +}; +__name(_PutRepositoryCatalogDataCommand, "PutRepositoryCatalogDataCommand"); +var PutRepositoryCatalogDataCommand = _PutRepositoryCatalogDataCommand; +// src/commands/SetRepositoryPolicyCommand.ts -/***/ }), -/***/ 48278: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ECRPUBLICServiceException = exports.__ServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); -class ECRPUBLICServiceException extends smithy_client_1.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, ECRPUBLICServiceException.prototype); - } -} -exports.ECRPUBLICServiceException = ECRPUBLICServiceException; +var _SetRepositoryPolicyCommand = class _SetRepositoryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "SetRepositoryPolicy", {}).n("ECRPUBLICClient", "SetRepositoryPolicyCommand").f(void 0, void 0).ser(se_SetRepositoryPolicyCommand).de(de_SetRepositoryPolicyCommand).build() { +}; +__name(_SetRepositoryPolicyCommand, "SetRepositoryPolicyCommand"); +var SetRepositoryPolicyCommand = _SetRepositoryPolicyCommand; + +// src/commands/TagResourceCommand.ts + + + + +var _TagResourceCommand = class _TagResourceCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "TagResource", {}).n("ECRPUBLICClient", "TagResourceCommand").f(void 0, void 0).ser(se_TagResourceCommand).de(de_TagResourceCommand).build() { +}; +__name(_TagResourceCommand, "TagResourceCommand"); +var TagResourceCommand = _TagResourceCommand; + +// src/commands/UntagResourceCommand.ts + + + + +var _UntagResourceCommand = class _UntagResourceCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "UntagResource", {}).n("ECRPUBLICClient", "UntagResourceCommand").f(void 0, void 0).ser(se_UntagResourceCommand).de(de_UntagResourceCommand).build() { +}; +__name(_UntagResourceCommand, "UntagResourceCommand"); +var UntagResourceCommand = _UntagResourceCommand; + +// src/commands/UploadLayerPartCommand.ts + + + + +var _UploadLayerPartCommand = class _UploadLayerPartCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SpencerFrontendService", "UploadLayerPart", {}).n("ECRPUBLICClient", "UploadLayerPartCommand").f(void 0, void 0).ser(se_UploadLayerPartCommand).de(de_UploadLayerPartCommand).build() { +}; +__name(_UploadLayerPartCommand, "UploadLayerPartCommand"); +var UploadLayerPartCommand = _UploadLayerPartCommand; + +// src/ECRPUBLIC.ts +var commands = { + BatchCheckLayerAvailabilityCommand, + BatchDeleteImageCommand, + CompleteLayerUploadCommand, + CreateRepositoryCommand, + DeleteRepositoryCommand, + DeleteRepositoryPolicyCommand, + DescribeImagesCommand, + DescribeImageTagsCommand, + DescribeRegistriesCommand, + DescribeRepositoriesCommand, + GetAuthorizationTokenCommand, + GetRegistryCatalogDataCommand, + GetRepositoryCatalogDataCommand, + GetRepositoryPolicyCommand, + InitiateLayerUploadCommand, + ListTagsForResourceCommand, + PutImageCommand, + PutRegistryCatalogDataCommand, + PutRepositoryCatalogDataCommand, + SetRepositoryPolicyCommand, + TagResourceCommand, + UntagResourceCommand, + UploadLayerPartCommand +}; +var _ECRPUBLIC = class _ECRPUBLIC extends ECRPUBLICClient { +}; +__name(_ECRPUBLIC, "ECRPUBLIC"); +var ECRPUBLIC = _ECRPUBLIC; +(0, import_smithy_client.createAggregatedClient)(commands, ECRPUBLIC); + +// src/pagination/DescribeImageTagsPaginator.ts + +var paginateDescribeImageTags = (0, import_core.createPaginator)(ECRPUBLICClient, DescribeImageTagsCommand, "nextToken", "nextToken", "maxResults"); + +// src/pagination/DescribeImagesPaginator.ts + +var paginateDescribeImages = (0, import_core.createPaginator)(ECRPUBLICClient, DescribeImagesCommand, "nextToken", "nextToken", "maxResults"); + +// src/pagination/DescribeRegistriesPaginator.ts + +var paginateDescribeRegistries = (0, import_core.createPaginator)(ECRPUBLICClient, DescribeRegistriesCommand, "nextToken", "nextToken", "maxResults"); + +// src/pagination/DescribeRepositoriesPaginator.ts + +var paginateDescribeRepositories = (0, import_core.createPaginator)(ECRPUBLICClient, DescribeRepositoriesCommand, "nextToken", "nextToken", "maxResults"); + +// src/index.ts +var import_util_endpoints = __nccwpck_require__(3350); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 30183: +/***/ 9324: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRuntimeConfig = void 0; const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(38818), exports); +const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(5929)); +const core_1 = __nccwpck_require__(9963); +const credential_provider_node_1 = __nccwpck_require__(5531); +const util_user_agent_node_1 = __nccwpck_require__(8095); +const config_resolver_1 = __nccwpck_require__(3098); +const hash_node_1 = __nccwpck_require__(3081); +const middleware_retry_1 = __nccwpck_require__(6039); +const node_config_provider_1 = __nccwpck_require__(3461); +const node_http_handler_1 = __nccwpck_require__(7435); +const util_body_length_node_1 = __nccwpck_require__(8075); +const util_retry_1 = __nccwpck_require__(4902); +const runtimeConfig_shared_1 = __nccwpck_require__(6746); +const smithy_client_1 = __nccwpck_require__(3570); +const util_defaults_mode_node_1 = __nccwpck_require__(2429); +const smithy_client_2 = __nccwpck_require__(3570); +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); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + 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.defaultUserAgent)({ 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), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + 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, + }), + 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), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 38818: +/***/ 6746: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReferencedImagesNotFoundException = exports.LayersNotFoundException = exports.InvalidLayerPartException = exports.ImageTagAlreadyExistsException = exports.ImageDigestDoesNotMatchException = exports.ImageAlreadyExistsException = exports.RepositoryCatalogDataNotFoundException = exports.RegistryAliasStatus = exports.ImageNotFoundException = exports.RepositoryPolicyNotFoundException = exports.RepositoryNotEmptyException = exports.TooManyTagsException = exports.RepositoryAlreadyExistsException = exports.LimitExceededException = exports.InvalidTagParameterException = exports.UploadNotFoundException = exports.LayerPartTooSmallException = exports.LayerAlreadyExistsException = exports.InvalidLayerException = exports.EmptyUploadException = exports.ImageFailureCode = exports.UnsupportedCommandException = exports.ServerException = exports.RepositoryNotFoundException = exports.RegistryNotFoundException = exports.InvalidParameterException = exports.LayerAvailability = exports.LayerFailureCode = void 0; -const ECRPUBLICServiceException_1 = __nccwpck_require__(48278); -exports.LayerFailureCode = { - InvalidLayerDigest: "InvalidLayerDigest", - MissingLayerDigest: "MissingLayerDigest", -}; -exports.LayerAvailability = { - AVAILABLE: "AVAILABLE", - UNAVAILABLE: "UNAVAILABLE", +exports.getRuntimeConfig = void 0; +const core_1 = __nccwpck_require__(9963); +const smithy_client_1 = __nccwpck_require__(3570); +const url_parser_1 = __nccwpck_require__(4681); +const util_base64_1 = __nccwpck_require__(5600); +const util_utf8_1 = __nccwpck_require__(1895); +const httpAuthSchemeProvider_1 = __nccwpck_require__(7614); +const endpointResolver_1 = __nccwpck_require__(7377); +const getRuntimeConfig = (config) => { + return { + apiVersion: "2020-10-30", + 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.defaultECRPUBLICHttpAuthSchemeProvider, + 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(), + serviceId: config?.serviceId ?? "ECR PUBLIC", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, + }; }; -class InvalidParameterException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "InvalidParameterException", - $fault: "client", - ...opts, - }); - this.name = "InvalidParameterException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidParameterException.prototype); - } -} -exports.InvalidParameterException = InvalidParameterException; -class RegistryNotFoundException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "RegistryNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "RegistryNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RegistryNotFoundException.prototype); +exports.getRuntimeConfig = getRuntimeConfig; + + +/***/ }), + +/***/ 7435: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, + NodeHttp2Handler: () => NodeHttp2Handler, + NodeHttpHandler: () => NodeHttpHandler, + streamCollector: () => streamCollector +}); +module.exports = __toCommonJS(src_exports); + +// src/node-http-handler.ts +var import_protocol_http = __nccwpck_require__(4483); +var import_querystring_builder = __nccwpck_require__(8512); +var import_http = __nccwpck_require__(3685); +var import_https = __nccwpck_require__(5687); + +// src/constants.ts +var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +// src/get-transformed-headers.ts +var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}, "getTransformedHeaders"); + +// src/set-connection-timeout.ts +var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject( + Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError" + }) + ); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } else { + clearTimeout(timeoutId); } -} -exports.RegistryNotFoundException = RegistryNotFoundException; -class RepositoryNotFoundException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "RepositoryNotFoundException", - $fault: "client", - ...opts, + }); +}, "setConnectionTimeout"); + +// src/set-socket-keep-alive.ts +var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}, "setSocketKeepAlive"); + +// src/set-socket-timeout.ts +var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}, "setSocketTimeout"); + +// src/write-request-body.ts +var import_stream = __nccwpck_require__(2781); +var MIN_WAIT_TIME = 1e3; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + const headers = request.headers ?? {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); }); - this.name = "RepositoryNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryNotFoundException.prototype); - } -} -exports.RepositoryNotFoundException = RepositoryNotFoundException; -class ServerException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "ServerException", - $fault: "server", - ...opts, + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); }); - this.name = "ServerException"; - this.$fault = "server"; - Object.setPrototypeOf(this, ServerException.prototype); - } + }) + ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } } -exports.ServerException = ServerException; -class UnsupportedCommandException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "UnsupportedCommandException", - $fault: "client", - ...opts, - }); - this.name = "UnsupportedCommandException"; - this.$fault = "client"; - Object.setPrototypeOf(this, UnsupportedCommandException.prototype); - } -} -exports.UnsupportedCommandException = UnsupportedCommandException; -exports.ImageFailureCode = { - ImageNotFound: "ImageNotFound", - ImageReferencedByManifestList: "ImageReferencedByManifestList", - ImageTagDoesNotMatchDigest: "ImageTagDoesNotMatchDigest", - InvalidImageDigest: "InvalidImageDigest", - InvalidImageTag: "InvalidImageTag", - KmsError: "KmsError", - MissingDigestAndTag: "MissingDigestAndTag", -}; -class EmptyUploadException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "EmptyUploadException", - $fault: "client", - ...opts, - }); - this.name = "EmptyUploadException"; - this.$fault = "client"; - Object.setPrototypeOf(this, EmptyUploadException.prototype); - } +__name(writeRequestBody, "writeRequestBody"); +function writeBody(httpRequest, body) { + if (body instanceof import_stream.Readable) { + body.pipe(httpRequest); + } else if (body) { + httpRequest.end(Buffer.from(body)); + } else { + httpRequest.end(); + } } -exports.EmptyUploadException = EmptyUploadException; -class InvalidLayerException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "InvalidLayerException", - $fault: "client", - ...opts, - }); - this.name = "InvalidLayerException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidLayerException.prototype); +__name(writeBody, "writeBody"); + +// src/node-http-handler.ts +var DEFAULT_REQUEST_TIMEOUT = 0; +var _NodeHttpHandler = class _NodeHttpHandler { + constructor(options) { + this.socketWarningTimestamp = 0; + // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286 + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttpHandler(instanceOrOptions); + } + /** + * @internal + * + * @param agent - http(s) agent in use by the NodeHttpHandler instance. + * @returns timestamp of last emitted warning. + */ + static checkSocketUsage(agent, socketWarningTimestamp) { + var _a, _b; + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; + const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + console.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(); + } + } } -} -exports.InvalidLayerException = InvalidLayerException; -class LayerAlreadyExistsException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "LayerAlreadyExistsException", - $fault: "client", - ...opts, + return socketWarningTimestamp; + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout ?? socketTimeout, + httpAgent: (() => { + if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { + return httpAgent; + } + return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { + return httpsAgent; + } + return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })() + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); + (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + let socketCheckTimeoutId; + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + clearTimeout(socketCheckTimeoutId); + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; + socketCheckTimeoutId = setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp); + }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)); + const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); + let auth = void 0; + 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}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent, + auth + }; + const requestFunc = isSSL ? import_https.request : import_http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new import_protocol_http.HttpResponse({ + statusCode: res.statusCode || -1, + reason: res.statusMessage, + headers: getTransformedHeaders(res.headers), + body: res }); - this.name = "LayerAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LayerAlreadyExistsException.prototype); - } -} -exports.LayerAlreadyExistsException = LayerAlreadyExistsException; -class LayerPartTooSmallException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "LayerPartTooSmallException", - $fault: "client", - ...opts, + resolve({ response: httpResponse }); + }); + req.on("error", (err) => { + if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { + reject(Object.assign(err, { name: "TimeoutError" })); + } else { + reject(err); + } + }); + setConnectionTimeout(req, reject, this.config.connectionTimeout); + setSocketTimeout(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + setSocketKeepAlive(req, { + // @ts-expect-error keepAlive is not public on httpAgent. + keepAlive: httpAgent.keepAlive, + // @ts-expect-error keepAliveMsecs is not public on httpAgent. + keepAliveMsecs: httpAgent.keepAliveMsecs }); - this.name = "LayerPartTooSmallException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LayerPartTooSmallException.prototype); + } + writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } +}; +__name(_NodeHttpHandler, "NodeHttpHandler"); +var NodeHttpHandler = _NodeHttpHandler; + +// src/node-http2-handler.ts + + +var import_http22 = __nccwpck_require__(5158); + +// src/node-http2-connection-manager.ts +var import_http2 = __toESM(__nccwpck_require__(5158)); + +// src/node-http2-connection-pool.ts +var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); } -} -exports.LayerPartTooSmallException = LayerPartTooSmallException; -class UploadNotFoundException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "UploadNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "UploadNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, UploadNotFoundException.prototype); + } + 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.UploadNotFoundException = UploadNotFoundException; -class InvalidTagParameterException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "InvalidTagParameterException", - $fault: "client", - ...opts, - }); - this.name = "InvalidTagParameterException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidTagParameterException.prototype); + } +}; +__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); +var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; + +// src/node-http2-connection-manager.ts +var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = /* @__PURE__ */ new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); } -} -exports.InvalidTagParameterException = InvalidTagParameterException; -class LimitExceededException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "LimitExceededException", - $fault: "client", - ...opts, - }); - this.name = "LimitExceededException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LimitExceededException.prototype); + } + 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; + } } -} -exports.LimitExceededException = LimitExceededException; -class RepositoryAlreadyExistsException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "RepositoryAlreadyExistsException", - $fault: "client", - ...opts, - }); - this.name = "RepositoryAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryAlreadyExistsException.prototype); + const session = import_http2.default.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() + ); + } + }); } -} -exports.RepositoryAlreadyExistsException = RepositoryAlreadyExistsException; -class TooManyTagsException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "TooManyTagsException", - $fault: "client", - ...opts, - }); - this.name = "TooManyTagsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, TooManyTagsException.prototype); + session.unref(); + const destroySessionCb = /* @__PURE__ */ __name(() => { + session.destroy(); + this.deleteSession(url, session); + }, "destroySessionCb"); + 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; + } + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; } -} -exports.TooManyTagsException = TooManyTagsException; -class RepositoryNotEmptyException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "RepositoryNotEmptyException", - $fault: "client", - ...opts, - }); - this.name = "RepositoryNotEmptyException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryNotEmptyException.prototype); + if (!existingConnectionPool.contains(session)) { + return; } -} -exports.RepositoryNotEmptyException = RepositoryNotEmptyException; -class RepositoryPolicyNotFoundException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "RepositoryPolicyNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "RepositoryPolicyNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryPolicyNotFoundException.prototype); + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); } -} -exports.RepositoryPolicyNotFoundException = RepositoryPolicyNotFoundException; -class ImageNotFoundException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "ImageNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "ImageNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ImageNotFoundException.prototype); + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); } -} -exports.ImageNotFoundException = ImageNotFoundException; -exports.RegistryAliasStatus = { - ACTIVE: "ACTIVE", - PENDING: "PENDING", - REJECTED: "REJECTED", + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } }; -class RepositoryCatalogDataNotFoundException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "RepositoryCatalogDataNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "RepositoryCatalogDataNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryCatalogDataNotFoundException.prototype); - } -} -exports.RepositoryCatalogDataNotFoundException = RepositoryCatalogDataNotFoundException; -class ImageAlreadyExistsException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "ImageAlreadyExistsException", - $fault: "client", - ...opts, - }); - this.name = "ImageAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ImageAlreadyExistsException.prototype); - } -} -exports.ImageAlreadyExistsException = ImageAlreadyExistsException; -class ImageDigestDoesNotMatchException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "ImageDigestDoesNotMatchException", - $fault: "client", - ...opts, - }); - this.name = "ImageDigestDoesNotMatchException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ImageDigestDoesNotMatchException.prototype); - } -} -exports.ImageDigestDoesNotMatchException = ImageDigestDoesNotMatchException; -class ImageTagAlreadyExistsException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "ImageTagAlreadyExistsException", - $fault: "client", - ...opts, - }); - this.name = "ImageTagAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ImageTagAlreadyExistsException.prototype); - } -} -exports.ImageTagAlreadyExistsException = ImageTagAlreadyExistsException; -class InvalidLayerPartException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "InvalidLayerPartException", - $fault: "client", - ...opts, - }); - this.name = "InvalidLayerPartException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidLayerPartException.prototype); - this.registryId = opts.registryId; - this.repositoryName = opts.repositoryName; - this.uploadId = opts.uploadId; - this.lastValidByteReceived = opts.lastValidByteReceived; +__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); +var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; + +// src/node-http2-handler.ts +var _NodeHttp2Handler = class _NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttp2Handler(instanceOrOptions); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } } -} -exports.InvalidLayerPartException = InvalidLayerPartException; -class LayersNotFoundException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "LayersNotFoundException", - $fault: "client", - ...opts, + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a; + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (abortSignal == null ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = 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: (_a = this.config) == null ? void 0 : _a.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = /* @__PURE__ */ __name((err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }, "rejectWithDestroy"); + const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [import_http22.constants.HTTP2_HEADER_PATH]: path, + [import_http22.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new import_protocol_http.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req }); - this.name = "LayersNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LayersNotFoundException.prototype); - } -} -exports.LayersNotFoundException = LayersNotFoundException; -class ReferencedImagesNotFoundException extends ECRPUBLICServiceException_1.ECRPUBLICServiceException { - constructor(opts) { - super({ - name: "ReferencedImagesNotFoundException", - $fault: "client", - ...opts, + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); }); - this.name = "ReferencedImagesNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ReferencedImagesNotFoundException.prototype); - } -} -exports.ReferencedImagesNotFoundException = ReferencedImagesNotFoundException; - - -/***/ }), - -/***/ 99634: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateDescribeImageTags = void 0; -const DescribeImageTagsCommand_1 = __nccwpck_require__(47670); -const ECRPUBLICClient_1 = __nccwpck_require__(30608); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new DescribeImageTagsCommand_1.DescribeImageTagsCommand(input), ...args); -}; -async function* paginateDescribeImageTags(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRPUBLICClient_1.ECRPUBLICClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + 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(); } - else { - throw new Error("Invalid client, expected ECRPUBLIC | ECRPUBLICClient"); + if (!fulfilled) { + rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + }); + writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + /** + * Destroys a session. + * @param session The session to destroy. + */ + destroySession(session) { + if (!session.destroyed) { + session.destroy(); } - return undefined; -} -exports.paginateDescribeImageTags = paginateDescribeImageTags; + } +}; +__name(_NodeHttp2Handler, "NodeHttp2Handler"); +var NodeHttp2Handler = _NodeHttp2Handler; +// src/stream-collector/collector.ts -/***/ }), +var _Collector = class _Collector extends import_stream.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +}; +__name(_Collector, "Collector"); +var Collector = _Collector; -/***/ 74128: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/stream-collector/index.ts +var streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}), "streamCollector"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateDescribeImages = void 0; -const DescribeImagesCommand_1 = __nccwpck_require__(22776); -const ECRPUBLICClient_1 = __nccwpck_require__(30608); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new DescribeImagesCommand_1.DescribeImagesCommand(input), ...args); -}; -async function* paginateDescribeImages(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRPUBLICClient_1.ECRPUBLICClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECRPUBLIC | ECRPUBLICClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateDescribeImages = paginateDescribeImages; /***/ }), -/***/ 11720: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4483: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateDescribeRegistries = void 0; -const DescribeRegistriesCommand_1 = __nccwpck_require__(78696); -const ECRPUBLICClient_1 = __nccwpck_require__(30608); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new DescribeRegistriesCommand_1.DescribeRegistriesCommand(input), ...args); -}; -async function* paginateDescribeRegistries(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRPUBLICClient_1.ECRPUBLICClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECRPUBLIC | ECRPUBLICClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); } - return undefined; + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(3399); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; + +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); + +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; + +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); } -exports.paginateDescribeRegistries = paginateDescribeRegistries; +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 65474: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 8512: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateDescribeRepositories = void 0; -const DescribeRepositoriesCommand_1 = __nccwpck_require__(82218); -const ECRPUBLICClient_1 = __nccwpck_require__(30608); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new DescribeRepositoriesCommand_1.DescribeRepositoriesCommand(input), ...args); -}; -async function* paginateDescribeRepositories(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRPUBLICClient_1.ECRPUBLICClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECRPUBLIC | ECRPUBLICClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + buildQueryString: () => buildQueryString +}); +module.exports = __toCommonJS(src_exports); +var import_util_uri_escape = __nccwpck_require__(6236); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, import_util_uri_escape.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; + } + parts.push(qsEntry); } - return undefined; + } + return parts.join("&"); } -exports.paginateDescribeRepositories = paginateDescribeRepositories; +__name(buildQueryString, "buildQueryString"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 93463: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3399: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); + +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); + +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); + +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; + +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); + +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 75945: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6236: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath +}); +module.exports = __toCommonJS(src_exports); + +// src/escape-uri.ts +var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) +), "escapeUri"); +var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); + +// src/escape-uri-path.ts +var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(99634), exports); -tslib_1.__exportStar(__nccwpck_require__(74128), exports); -tslib_1.__exportStar(__nccwpck_require__(11720), exports); -tslib_1.__exportStar(__nccwpck_require__(65474), exports); -tslib_1.__exportStar(__nccwpck_require__(93463), exports); /***/ }), -/***/ 64170: +/***/ 4682: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.de_UploadLayerPartCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_SetRepositoryPolicyCommand = exports.de_PutRepositoryCatalogDataCommand = exports.de_PutRegistryCatalogDataCommand = exports.de_PutImageCommand = exports.de_ListTagsForResourceCommand = exports.de_InitiateLayerUploadCommand = exports.de_GetRepositoryPolicyCommand = exports.de_GetRepositoryCatalogDataCommand = exports.de_GetRegistryCatalogDataCommand = exports.de_GetAuthorizationTokenCommand = exports.de_DescribeRepositoriesCommand = exports.de_DescribeRegistriesCommand = exports.de_DescribeImageTagsCommand = exports.de_DescribeImagesCommand = exports.de_DeleteRepositoryPolicyCommand = exports.de_DeleteRepositoryCommand = exports.de_CreateRepositoryCommand = exports.de_CompleteLayerUploadCommand = exports.de_BatchDeleteImageCommand = exports.de_BatchCheckLayerAvailabilityCommand = exports.se_UploadLayerPartCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_SetRepositoryPolicyCommand = exports.se_PutRepositoryCatalogDataCommand = exports.se_PutRegistryCatalogDataCommand = exports.se_PutImageCommand = exports.se_ListTagsForResourceCommand = exports.se_InitiateLayerUploadCommand = exports.se_GetRepositoryPolicyCommand = exports.se_GetRepositoryCatalogDataCommand = exports.se_GetRegistryCatalogDataCommand = exports.se_GetAuthorizationTokenCommand = exports.se_DescribeRepositoriesCommand = exports.se_DescribeRegistriesCommand = exports.se_DescribeImageTagsCommand = exports.se_DescribeImagesCommand = exports.se_DeleteRepositoryPolicyCommand = exports.se_DeleteRepositoryCommand = exports.se_CreateRepositoryCommand = exports.se_CompleteLayerUploadCommand = exports.se_BatchDeleteImageCommand = exports.se_BatchCheckLayerAvailabilityCommand = void 0; -const protocol_http_1 = __nccwpck_require__(54483); -const smithy_client_1 = __nccwpck_require__(63570); -const ECRPUBLICServiceException_1 = __nccwpck_require__(48278); -const models_0_1 = __nccwpck_require__(38818); -const se_BatchCheckLayerAvailabilityCommand = async (input, context) => { - const headers = sharedHeaders("BatchCheckLayerAvailability"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_BatchCheckLayerAvailabilityCommand = se_BatchCheckLayerAvailabilityCommand; -const se_BatchDeleteImageCommand = async (input, context) => { - const headers = sharedHeaders("BatchDeleteImage"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_BatchDeleteImageCommand = se_BatchDeleteImageCommand; -const se_CompleteLayerUploadCommand = async (input, context) => { - const headers = sharedHeaders("CompleteLayerUpload"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_CompleteLayerUploadCommand = se_CompleteLayerUploadCommand; -const se_CreateRepositoryCommand = async (input, context) => { - const headers = sharedHeaders("CreateRepository"); - let body; - body = JSON.stringify(se_CreateRepositoryRequest(input, context)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_CreateRepositoryCommand = se_CreateRepositoryCommand; -const se_DeleteRepositoryCommand = async (input, context) => { - const headers = sharedHeaders("DeleteRepository"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DeleteRepositoryCommand = se_DeleteRepositoryCommand; -const se_DeleteRepositoryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("DeleteRepositoryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DeleteRepositoryPolicyCommand = se_DeleteRepositoryPolicyCommand; -const se_DescribeImagesCommand = async (input, context) => { - const headers = sharedHeaders("DescribeImages"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeImagesCommand = se_DescribeImagesCommand; -const se_DescribeImageTagsCommand = async (input, context) => { - const headers = sharedHeaders("DescribeImageTags"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeImageTagsCommand = se_DescribeImageTagsCommand; -const se_DescribeRegistriesCommand = async (input, context) => { - const headers = sharedHeaders("DescribeRegistries"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeRegistriesCommand = se_DescribeRegistriesCommand; -const se_DescribeRepositoriesCommand = async (input, context) => { - const headers = sharedHeaders("DescribeRepositories"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeRepositoriesCommand = se_DescribeRepositoriesCommand; -const se_GetAuthorizationTokenCommand = async (input, context) => { - const headers = sharedHeaders("GetAuthorizationToken"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetAuthorizationTokenCommand = se_GetAuthorizationTokenCommand; -const se_GetRegistryCatalogDataCommand = async (input, context) => { - const headers = sharedHeaders("GetRegistryCatalogData"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetRegistryCatalogDataCommand = se_GetRegistryCatalogDataCommand; -const se_GetRepositoryCatalogDataCommand = async (input, context) => { - const headers = sharedHeaders("GetRepositoryCatalogData"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetRepositoryCatalogDataCommand = se_GetRepositoryCatalogDataCommand; -const se_GetRepositoryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("GetRepositoryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetRepositoryPolicyCommand = se_GetRepositoryPolicyCommand; -const se_InitiateLayerUploadCommand = async (input, context) => { - const headers = sharedHeaders("InitiateLayerUpload"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_InitiateLayerUploadCommand = se_InitiateLayerUploadCommand; -const se_ListTagsForResourceCommand = async (input, context) => { - const headers = sharedHeaders("ListTagsForResource"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand; -const se_PutImageCommand = async (input, context) => { - const headers = sharedHeaders("PutImage"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutImageCommand = se_PutImageCommand; -const se_PutRegistryCatalogDataCommand = async (input, context) => { - const headers = sharedHeaders("PutRegistryCatalogData"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutRegistryCatalogDataCommand = se_PutRegistryCatalogDataCommand; -const se_PutRepositoryCatalogDataCommand = async (input, context) => { - const headers = sharedHeaders("PutRepositoryCatalogData"); - let body; - body = JSON.stringify(se_PutRepositoryCatalogDataRequest(input, context)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutRepositoryCatalogDataCommand = se_PutRepositoryCatalogDataCommand; -const se_SetRepositoryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("SetRepositoryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_SetRepositoryPolicyCommand = se_SetRepositoryPolicyCommand; -const se_TagResourceCommand = async (input, context) => { - const headers = sharedHeaders("TagResource"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_TagResourceCommand = se_TagResourceCommand; -const se_UntagResourceCommand = async (input, context) => { - const headers = sharedHeaders("UntagResource"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_UntagResourceCommand = se_UntagResourceCommand; -const se_UploadLayerPartCommand = async (input, context) => { - const headers = sharedHeaders("UploadLayerPart"); - let body; - body = JSON.stringify(se_UploadLayerPartRequest(input, context)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_UploadLayerPartCommand = se_UploadLayerPartCommand; -const de_BatchCheckLayerAvailabilityCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_BatchCheckLayerAvailabilityCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, +exports.resolveHttpAuthSchemeConfig = exports.defaultECRHttpAuthSchemeProvider = exports.defaultECRHttpAuthSchemeParametersProvider = void 0; +const core_1 = __nccwpck_require__(9963); +const util_middleware_1 = __nccwpck_require__(2390); +const defaultECRHttpAuthSchemeParametersProvider = 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`"); + })(), }; - return response; }; -exports.de_BatchCheckLayerAvailabilityCommand = de_BatchCheckLayerAvailabilityCommand; -const de_BatchCheckLayerAvailabilityCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), +exports.defaultECRHttpAuthSchemeParametersProvider = defaultECRHttpAuthSchemeParametersProvider; +function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "ecr", + region: authParameters.region, + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context, + }, + }), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +} +const defaultECRHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } } + return options; }; -const de_BatchDeleteImageCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_BatchDeleteImageCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, +exports.defaultECRHttpAuthSchemeProvider = defaultECRHttpAuthSchemeProvider; +const resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return { + ...config_0, }; - return response; }; -exports.de_BatchDeleteImageCommand = de_BatchDeleteImageCommand; -const de_BatchDeleteImageCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } +exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; + + +/***/ }), + +/***/ 1610: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = __nccwpck_require__(5473); +const ruleset_1 = __nccwpck_require__(4053); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); }; -const de_CompleteLayerUploadCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_CompleteLayerUploadCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +exports.defaultEndpointResolver = defaultEndpointResolver; + + +/***/ }), + +/***/ 4053: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ruleSet = void 0; +const v = "required", w = "fn", x = "argv", y = "ref"; +const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "stringEquals", i = { [v]: false, "type": "String" }, j = { [v]: true, "default": false, "type": "Boolean" }, k = { [y]: "Endpoint" }, l = { [w]: c, [x]: [{ [y]: "UseFIPS" }, true] }, m = { [w]: c, [x]: [{ [y]: "UseDualStack" }, true] }, n = {}, o = { [w]: "getAttr", [x]: [{ [y]: g }, "supportsFIPS"] }, p = { [w]: c, [x]: [true, { [w]: "getAttr", [x]: [{ [y]: g }, "supportsDualStack"] }] }, q = { [w]: "getAttr", [x]: [{ [y]: g }, "name"] }, r = { "url": "https://ecr-fips.{Region}.amazonaws.com", "properties": {}, "headers": {} }, s = [l], t = [m], u = [{ [y]: "Region" }]; +const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [w]: b, [x]: [k] }], rules: [{ conditions: s, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: t, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [w]: b, [x]: u }], rules: [{ conditions: [{ [w]: "aws.partition", [x]: u, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [w]: c, [x]: [a, o] }, p], rules: [{ endpoint: { url: "https://api.ecr-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: s, rules: [{ conditions: [{ [w]: c, [x]: [o, a] }], rules: [{ conditions: [{ [w]: h, [x]: [q, "aws"] }], endpoint: r, type: e }, { conditions: [{ [w]: h, [x]: [q, "aws-us-gov"] }], endpoint: r, type: e }, { endpoint: { url: "https://api.ecr-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: t, rules: [{ conditions: [p], rules: [{ endpoint: { url: "https://api.ecr.{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://api.ecr.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; +exports.ruleSet = _data; + + +/***/ }), + +/***/ 8923: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); }; -exports.de_CompleteLayerUploadCommand = de_CompleteLayerUploadCommand; -const de_CompleteLayerUploadCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EmptyUploadException": - case "com.amazonaws.ecrpublic#EmptyUploadException": - throw await de_EmptyUploadExceptionRes(parsedOutput, context); - case "InvalidLayerException": - case "com.amazonaws.ecrpublic#InvalidLayerException": - throw await de_InvalidLayerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LayerAlreadyExistsException": - case "com.amazonaws.ecrpublic#LayerAlreadyExistsException": - throw await de_LayerAlreadyExistsExceptionRes(parsedOutput, context); - case "LayerPartTooSmallException": - case "com.amazonaws.ecrpublic#LayerPartTooSmallException": - throw await de_LayerPartTooSmallExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - case "UploadNotFoundException": - case "com.amazonaws.ecrpublic#UploadNotFoundException": - throw await de_UploadNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + BatchCheckLayerAvailabilityCommand: () => BatchCheckLayerAvailabilityCommand, + BatchDeleteImageCommand: () => BatchDeleteImageCommand, + BatchGetImageCommand: () => BatchGetImageCommand, + BatchGetRepositoryScanningConfigurationCommand: () => BatchGetRepositoryScanningConfigurationCommand, + CompleteLayerUploadCommand: () => CompleteLayerUploadCommand, + CreatePullThroughCacheRuleCommand: () => CreatePullThroughCacheRuleCommand, + CreateRepositoryCommand: () => CreateRepositoryCommand, + DeleteLifecyclePolicyCommand: () => DeleteLifecyclePolicyCommand, + DeletePullThroughCacheRuleCommand: () => DeletePullThroughCacheRuleCommand, + DeleteRegistryPolicyCommand: () => DeleteRegistryPolicyCommand, + DeleteRepositoryCommand: () => DeleteRepositoryCommand, + DeleteRepositoryPolicyCommand: () => DeleteRepositoryPolicyCommand, + DescribeImageReplicationStatusCommand: () => DescribeImageReplicationStatusCommand, + DescribeImageScanFindingsCommand: () => DescribeImageScanFindingsCommand, + DescribeImagesCommand: () => DescribeImagesCommand, + DescribePullThroughCacheRulesCommand: () => DescribePullThroughCacheRulesCommand, + DescribeRegistryCommand: () => DescribeRegistryCommand, + DescribeRepositoriesCommand: () => DescribeRepositoriesCommand, + ECR: () => ECR, + ECRClient: () => ECRClient, + ECRServiceException: () => ECRServiceException, + EmptyUploadException: () => EmptyUploadException, + EncryptionType: () => EncryptionType, + FindingSeverity: () => FindingSeverity, + GetAuthorizationTokenCommand: () => GetAuthorizationTokenCommand, + GetDownloadUrlForLayerCommand: () => GetDownloadUrlForLayerCommand, + GetLifecyclePolicyCommand: () => GetLifecyclePolicyCommand, + GetLifecyclePolicyPreviewCommand: () => GetLifecyclePolicyPreviewCommand, + GetRegistryPolicyCommand: () => GetRegistryPolicyCommand, + GetRegistryScanningConfigurationCommand: () => GetRegistryScanningConfigurationCommand, + GetRepositoryPolicyCommand: () => GetRepositoryPolicyCommand, + ImageActionType: () => ImageActionType, + ImageAlreadyExistsException: () => ImageAlreadyExistsException, + ImageDigestDoesNotMatchException: () => ImageDigestDoesNotMatchException, + ImageFailureCode: () => ImageFailureCode, + ImageNotFoundException: () => ImageNotFoundException, + ImageTagAlreadyExistsException: () => ImageTagAlreadyExistsException, + ImageTagMutability: () => ImageTagMutability, + InitiateLayerUploadCommand: () => InitiateLayerUploadCommand, + InvalidLayerException: () => InvalidLayerException, + InvalidLayerPartException: () => InvalidLayerPartException, + InvalidParameterException: () => InvalidParameterException, + InvalidTagParameterException: () => InvalidTagParameterException, + KmsException: () => KmsException, + LayerAlreadyExistsException: () => LayerAlreadyExistsException, + LayerAvailability: () => LayerAvailability, + LayerFailureCode: () => LayerFailureCode, + LayerInaccessibleException: () => LayerInaccessibleException, + LayerPartTooSmallException: () => LayerPartTooSmallException, + LayersNotFoundException: () => LayersNotFoundException, + LifecyclePolicyNotFoundException: () => LifecyclePolicyNotFoundException, + LifecyclePolicyPreviewInProgressException: () => LifecyclePolicyPreviewInProgressException, + LifecyclePolicyPreviewNotFoundException: () => LifecyclePolicyPreviewNotFoundException, + LifecyclePolicyPreviewStatus: () => LifecyclePolicyPreviewStatus, + LimitExceededException: () => LimitExceededException, + ListImagesCommand: () => ListImagesCommand, + ListTagsForResourceCommand: () => ListTagsForResourceCommand, + PullThroughCacheRuleAlreadyExistsException: () => PullThroughCacheRuleAlreadyExistsException, + PullThroughCacheRuleNotFoundException: () => PullThroughCacheRuleNotFoundException, + PutImageCommand: () => PutImageCommand, + PutImageScanningConfigurationCommand: () => PutImageScanningConfigurationCommand, + PutImageTagMutabilityCommand: () => PutImageTagMutabilityCommand, + PutLifecyclePolicyCommand: () => PutLifecyclePolicyCommand, + PutRegistryPolicyCommand: () => PutRegistryPolicyCommand, + PutRegistryScanningConfigurationCommand: () => PutRegistryScanningConfigurationCommand, + PutReplicationConfigurationCommand: () => PutReplicationConfigurationCommand, + ReferencedImagesNotFoundException: () => ReferencedImagesNotFoundException, + RegistryPolicyNotFoundException: () => RegistryPolicyNotFoundException, + ReplicationStatus: () => ReplicationStatus, + RepositoryAlreadyExistsException: () => RepositoryAlreadyExistsException, + RepositoryFilterType: () => RepositoryFilterType, + RepositoryNotEmptyException: () => RepositoryNotEmptyException, + RepositoryNotFoundException: () => RepositoryNotFoundException, + RepositoryPolicyNotFoundException: () => RepositoryPolicyNotFoundException, + ScanFrequency: () => ScanFrequency, + ScanNotFoundException: () => ScanNotFoundException, + ScanStatus: () => ScanStatus, + ScanType: () => ScanType, + ScanningConfigurationFailureCode: () => ScanningConfigurationFailureCode, + ScanningRepositoryFilterType: () => ScanningRepositoryFilterType, + SecretNotFoundException: () => SecretNotFoundException, + ServerException: () => ServerException, + SetRepositoryPolicyCommand: () => SetRepositoryPolicyCommand, + StartImageScanCommand: () => StartImageScanCommand, + StartLifecyclePolicyPreviewCommand: () => StartLifecyclePolicyPreviewCommand, + TagResourceCommand: () => TagResourceCommand, + TagStatus: () => TagStatus, + TooManyTagsException: () => TooManyTagsException, + UnableToAccessSecretException: () => UnableToAccessSecretException, + UnableToDecryptSecretValueException: () => UnableToDecryptSecretValueException, + UnableToGetUpstreamImageException: () => UnableToGetUpstreamImageException, + UnableToGetUpstreamLayerException: () => UnableToGetUpstreamLayerException, + UnsupportedImageTypeException: () => UnsupportedImageTypeException, + UnsupportedUpstreamRegistryException: () => UnsupportedUpstreamRegistryException, + UntagResourceCommand: () => UntagResourceCommand, + UpdatePullThroughCacheRuleCommand: () => UpdatePullThroughCacheRuleCommand, + UploadLayerPartCommand: () => UploadLayerPartCommand, + UploadNotFoundException: () => UploadNotFoundException, + UpstreamRegistry: () => UpstreamRegistry, + ValidatePullThroughCacheRuleCommand: () => ValidatePullThroughCacheRuleCommand, + ValidationException: () => ValidationException, + __Client: () => import_smithy_client.Client, + paginateDescribeImageScanFindings: () => paginateDescribeImageScanFindings, + paginateDescribeImages: () => paginateDescribeImages, + paginateDescribePullThroughCacheRules: () => paginateDescribePullThroughCacheRules, + paginateDescribeRepositories: () => paginateDescribeRepositories, + paginateGetLifecyclePolicyPreview: () => paginateGetLifecyclePolicyPreview, + paginateListImages: () => paginateListImages, + waitForImageScanComplete: () => waitForImageScanComplete, + waitForLifecyclePolicyPreviewComplete: () => waitForLifecyclePolicyPreviewComplete, + waitUntilImageScanComplete: () => waitUntilImageScanComplete, + waitUntilLifecyclePolicyPreviewComplete: () => waitUntilLifecyclePolicyPreviewComplete +}); +module.exports = __toCommonJS(src_exports); + +// src/ECRClient.ts +var import_middleware_host_header = __nccwpck_require__(2545); +var import_middleware_logger = __nccwpck_require__(14); +var import_middleware_recursion_detection = __nccwpck_require__(5525); +var import_middleware_user_agent = __nccwpck_require__(4688); +var import_config_resolver = __nccwpck_require__(3098); +var import_core = __nccwpck_require__(5829); +var import_middleware_content_length = __nccwpck_require__(2800); +var import_middleware_endpoint = __nccwpck_require__(2918); +var import_middleware_retry = __nccwpck_require__(6039); + +var import_httpAuthSchemeProvider = __nccwpck_require__(4682); + +// src/endpoint/EndpointParameters.ts +var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "ecr" + }; +}, "resolveClientEndpointParameters"); +var commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } +}; + +// src/ECRClient.ts +var import_runtimeConfig = __nccwpck_require__(869); + +// src/runtimeExtensions.ts +var import_region_config_resolver = __nccwpck_require__(8156); +var import_protocol_http = __nccwpck_require__(2473); +var import_smithy_client = __nccwpck_require__(3570); + +// src/auth/httpAuthExtensionConfiguration.ts +var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((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; } + }; +}, "getHttpAuthExtensionConfiguration"); +var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; +}, "resolveHttpAuthRuntimeConfig"); + +// src/runtimeExtensions.ts +var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial"); +var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { + const extensionConfiguration = { + ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)), + ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)) + }; + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return { + ...runtimeConfig, + ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), + ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), + ...resolveHttpAuthRuntimeConfig(extensionConfiguration) + }; +}, "resolveRuntimeExtensions"); + +// src/ECRClient.ts +var _ECRClient = class _ECRClient extends import_smithy_client.Client { + constructor(...[configuration]) { + const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1); + const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2); + const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3); + const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5); + const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); + this.middlewareStack.use( + (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, { + httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(), + identityProviderConfigProvider: this.getIdentityProviderConfigProvider() + }) + ); + this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config)); + } + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy() { + super.destroy(); + } + getDefaultHttpAuthSchemeParametersProvider() { + return import_httpAuthSchemeProvider.defaultECRHttpAuthSchemeParametersProvider; + } + getIdentityProviderConfigProvider() { + return async (config) => new import_core.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials + }); + } }; -const de_CreateRepositoryCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_CreateRepositoryCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_CreateRepositoryResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +__name(_ECRClient, "ECRClient"); +var ECRClient = _ECRClient; + +// src/ECR.ts + + +// src/commands/BatchCheckLayerAvailabilityCommand.ts + +var import_middleware_serde = __nccwpck_require__(1238); + +var import_types = __nccwpck_require__(5417); + +// src/protocols/Aws_json1_1.ts + + + +// src/models/ECRServiceException.ts + +var _ECRServiceException = class _ECRServiceException extends import_smithy_client.ServiceException { + /** + * @internal + */ + constructor(options) { + super(options); + Object.setPrototypeOf(this, _ECRServiceException.prototype); + } }; -exports.de_CreateRepositoryCommand = de_CreateRepositoryCommand; -const de_CreateRepositoryCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecrpublic#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecrpublic#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryAlreadyExistsException": - case "com.amazonaws.ecrpublic#RepositoryAlreadyExistsException": - throw await de_RepositoryAlreadyExistsExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecrpublic#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } +__name(_ECRServiceException, "ECRServiceException"); +var ECRServiceException = _ECRServiceException; + +// src/models/models_0.ts +var LayerFailureCode = { + InvalidLayerDigest: "InvalidLayerDigest", + MissingLayerDigest: "MissingLayerDigest" +}; +var LayerAvailability = { + AVAILABLE: "AVAILABLE", + UNAVAILABLE: "UNAVAILABLE" +}; +var _InvalidParameterException = class _InvalidParameterException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidParameterException", + $fault: "client", + ...opts + }); + this.name = "InvalidParameterException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidParameterException.prototype); + } }; -const de_DeleteRepositoryCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DeleteRepositoryCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DeleteRepositoryResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +__name(_InvalidParameterException, "InvalidParameterException"); +var InvalidParameterException = _InvalidParameterException; +var _RepositoryNotFoundException = class _RepositoryNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryNotFoundException", + $fault: "client", + ...opts + }); + this.name = "RepositoryNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryNotFoundException.prototype); + } }; -exports.de_DeleteRepositoryCommand = de_DeleteRepositoryCommand; -const de_DeleteRepositoryCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotEmptyException": - case "com.amazonaws.ecrpublic#RepositoryNotEmptyException": - throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } +__name(_RepositoryNotFoundException, "RepositoryNotFoundException"); +var RepositoryNotFoundException = _RepositoryNotFoundException; +var _ServerException = class _ServerException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ServerException", + $fault: "server", + ...opts + }); + this.name = "ServerException"; + this.$fault = "server"; + Object.setPrototypeOf(this, _ServerException.prototype); + } }; -const de_DeleteRepositoryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DeleteRepositoryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +__name(_ServerException, "ServerException"); +var ServerException = _ServerException; +var ImageFailureCode = { + ImageNotFound: "ImageNotFound", + ImageReferencedByManifestList: "ImageReferencedByManifestList", + ImageTagDoesNotMatchDigest: "ImageTagDoesNotMatchDigest", + InvalidImageDigest: "InvalidImageDigest", + InvalidImageTag: "InvalidImageTag", + KmsError: "KmsError", + MissingDigestAndTag: "MissingDigestAndTag", + UpstreamAccessDenied: "UpstreamAccessDenied", + UpstreamTooManyRequests: "UpstreamTooManyRequests", + UpstreamUnavailable: "UpstreamUnavailable" +}; +var _LimitExceededException = class _LimitExceededException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LimitExceededException", + $fault: "client", + ...opts + }); + this.name = "LimitExceededException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LimitExceededException.prototype); + } }; -exports.de_DeleteRepositoryPolicyCommand = de_DeleteRepositoryPolicyCommand; -const de_DeleteRepositoryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryPolicyNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryPolicyNotFoundException": - throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } +__name(_LimitExceededException, "LimitExceededException"); +var LimitExceededException = _LimitExceededException; +var _UnableToGetUpstreamImageException = class _UnableToGetUpstreamImageException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnableToGetUpstreamImageException", + $fault: "client", + ...opts + }); + this.name = "UnableToGetUpstreamImageException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnableToGetUpstreamImageException.prototype); + } }; -const de_DescribeImagesCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeImagesCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DescribeImagesResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +__name(_UnableToGetUpstreamImageException, "UnableToGetUpstreamImageException"); +var UnableToGetUpstreamImageException = _UnableToGetUpstreamImageException; +var ScanningConfigurationFailureCode = { + REPOSITORY_NOT_FOUND: "REPOSITORY_NOT_FOUND" +}; +var ScanningRepositoryFilterType = { + WILDCARD: "WILDCARD" +}; +var ScanFrequency = { + CONTINUOUS_SCAN: "CONTINUOUS_SCAN", + MANUAL: "MANUAL", + SCAN_ON_PUSH: "SCAN_ON_PUSH" +}; +var _ValidationException = class _ValidationException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ValidationException", + $fault: "client", + ...opts + }); + this.name = "ValidationException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ValidationException.prototype); + } }; -exports.de_DescribeImagesCommand = de_DescribeImagesCommand; -const de_DescribeImagesCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecrpublic#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } +__name(_ValidationException, "ValidationException"); +var ValidationException = _ValidationException; +var _EmptyUploadException = class _EmptyUploadException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "EmptyUploadException", + $fault: "client", + ...opts + }); + this.name = "EmptyUploadException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _EmptyUploadException.prototype); + } }; -const de_DescribeImageTagsCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeImageTagsCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DescribeImageTagsResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +__name(_EmptyUploadException, "EmptyUploadException"); +var EmptyUploadException = _EmptyUploadException; +var _InvalidLayerException = class _InvalidLayerException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidLayerException", + $fault: "client", + ...opts + }); + this.name = "InvalidLayerException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidLayerException.prototype); + } }; -exports.de_DescribeImageTagsCommand = de_DescribeImageTagsCommand; -const de_DescribeImageTagsCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } +__name(_InvalidLayerException, "InvalidLayerException"); +var InvalidLayerException = _InvalidLayerException; +var _KmsException = class _KmsException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "KmsException", + $fault: "client", + ...opts + }); + this.name = "KmsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _KmsException.prototype); + this.kmsError = opts.kmsError; + } }; -const de_DescribeRegistriesCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeRegistriesCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +__name(_KmsException, "KmsException"); +var KmsException = _KmsException; +var _LayerAlreadyExistsException = class _LayerAlreadyExistsException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LayerAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "LayerAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LayerAlreadyExistsException.prototype); + } }; -exports.de_DescribeRegistriesCommand = de_DescribeRegistriesCommand; -const de_DescribeRegistriesCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } +__name(_LayerAlreadyExistsException, "LayerAlreadyExistsException"); +var LayerAlreadyExistsException = _LayerAlreadyExistsException; +var _LayerPartTooSmallException = class _LayerPartTooSmallException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LayerPartTooSmallException", + $fault: "client", + ...opts + }); + this.name = "LayerPartTooSmallException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LayerPartTooSmallException.prototype); + } }; -const de_DescribeRepositoriesCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeRepositoriesCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DescribeRepositoriesResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +__name(_LayerPartTooSmallException, "LayerPartTooSmallException"); +var LayerPartTooSmallException = _LayerPartTooSmallException; +var _UploadNotFoundException = class _UploadNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UploadNotFoundException", + $fault: "client", + ...opts + }); + this.name = "UploadNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UploadNotFoundException.prototype); + } }; -exports.de_DescribeRepositoriesCommand = de_DescribeRepositoriesCommand; -const de_DescribeRepositoriesCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } +__name(_UploadNotFoundException, "UploadNotFoundException"); +var UploadNotFoundException = _UploadNotFoundException; +var UpstreamRegistry = { + AzureContainerRegistry: "azure-container-registry", + DockerHub: "docker-hub", + EcrPublic: "ecr-public", + GitHubContainerRegistry: "github-container-registry", + K8s: "k8s", + Quay: "quay" +}; +var _PullThroughCacheRuleAlreadyExistsException = class _PullThroughCacheRuleAlreadyExistsException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "PullThroughCacheRuleAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "PullThroughCacheRuleAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _PullThroughCacheRuleAlreadyExistsException.prototype); + } }; -const de_GetAuthorizationTokenCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetAuthorizationTokenCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_GetAuthorizationTokenResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; +__name(_PullThroughCacheRuleAlreadyExistsException, "PullThroughCacheRuleAlreadyExistsException"); +var PullThroughCacheRuleAlreadyExistsException = _PullThroughCacheRuleAlreadyExistsException; +var _SecretNotFoundException = class _SecretNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "SecretNotFoundException", + $fault: "client", + ...opts + }); + this.name = "SecretNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _SecretNotFoundException.prototype); + } }; -exports.de_GetAuthorizationTokenCommand = de_GetAuthorizationTokenCommand; -const de_GetAuthorizationTokenCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetRegistryCatalogDataCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetRegistryCatalogDataCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetRegistryCatalogDataCommand = de_GetRegistryCatalogDataCommand; -const de_GetRegistryCatalogDataCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetRepositoryCatalogDataCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetRepositoryCatalogDataCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetRepositoryCatalogDataCommand = de_GetRepositoryCatalogDataCommand; -const de_GetRepositoryCatalogDataCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryCatalogDataNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryCatalogDataNotFoundException": - throw await de_RepositoryCatalogDataNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetRepositoryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetRepositoryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetRepositoryPolicyCommand = de_GetRepositoryPolicyCommand; -const de_GetRepositoryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryPolicyNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryPolicyNotFoundException": - throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_InitiateLayerUploadCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_InitiateLayerUploadCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_InitiateLayerUploadCommand = de_InitiateLayerUploadCommand; -const de_InitiateLayerUploadCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_ListTagsForResourceCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand; -const de_ListTagsForResourceCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutImageCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutImageCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutImageCommand = de_PutImageCommand; -const de_PutImageCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageAlreadyExistsException": - case "com.amazonaws.ecrpublic#ImageAlreadyExistsException": - throw await de_ImageAlreadyExistsExceptionRes(parsedOutput, context); - case "ImageDigestDoesNotMatchException": - case "com.amazonaws.ecrpublic#ImageDigestDoesNotMatchException": - throw await de_ImageDigestDoesNotMatchExceptionRes(parsedOutput, context); - case "ImageTagAlreadyExistsException": - case "com.amazonaws.ecrpublic#ImageTagAlreadyExistsException": - throw await de_ImageTagAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LayersNotFoundException": - case "com.amazonaws.ecrpublic#LayersNotFoundException": - throw await de_LayersNotFoundExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecrpublic#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ReferencedImagesNotFoundException": - case "com.amazonaws.ecrpublic#ReferencedImagesNotFoundException": - throw await de_ReferencedImagesNotFoundExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutRegistryCatalogDataCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutRegistryCatalogDataCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutRegistryCatalogDataCommand = de_PutRegistryCatalogDataCommand; -const de_PutRegistryCatalogDataCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutRepositoryCatalogDataCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutRepositoryCatalogDataCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutRepositoryCatalogDataCommand = de_PutRepositoryCatalogDataCommand; -const de_PutRepositoryCatalogDataCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_SetRepositoryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_SetRepositoryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_SetRepositoryPolicyCommand = de_SetRepositoryPolicyCommand; -const de_SetRepositoryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_TagResourceCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_TagResourceCommand = de_TagResourceCommand; -const de_TagResourceCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecrpublic#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecrpublic#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_UntagResourceCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_UntagResourceCommand = de_UntagResourceCommand; -const de_UntagResourceCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecrpublic#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecrpublic#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_UploadLayerPartCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_UploadLayerPartCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_UploadLayerPartCommand = de_UploadLayerPartCommand; -const de_UploadLayerPartCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLayerPartException": - case "com.amazonaws.ecrpublic#InvalidLayerPartException": - throw await de_InvalidLayerPartExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecrpublic#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - case "UploadNotFoundException": - case "com.amazonaws.ecrpublic#UploadNotFoundException": - throw await de_UploadNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_EmptyUploadExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.EmptyUploadException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ImageAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ImageAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ImageDigestDoesNotMatchExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ImageDigestDoesNotMatchException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ImageNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ImageNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ImageTagAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ImageTagAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidLayerExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.InvalidLayerException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidLayerPartExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.InvalidLayerPartException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidParameterExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.InvalidParameterException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidTagParameterExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.InvalidTagParameterException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LayerAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LayerAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LayerPartTooSmallExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LayerPartTooSmallException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LayersNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LayersNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LimitExceededExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LimitExceededException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ReferencedImagesNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ReferencedImagesNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RegistryNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RegistryNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryCatalogDataNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryCatalogDataNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryNotEmptyExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryNotEmptyException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryPolicyNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryPolicyNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ServerExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ServerException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_TooManyTagsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.TooManyTagsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_UnsupportedCommandExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.UnsupportedCommandException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_UploadNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.UploadNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); +__name(_SecretNotFoundException, "SecretNotFoundException"); +var SecretNotFoundException = _SecretNotFoundException; +var _UnableToAccessSecretException = class _UnableToAccessSecretException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnableToAccessSecretException", + $fault: "client", + ...opts + }); + this.name = "UnableToAccessSecretException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnableToAccessSecretException.prototype); + } }; -const se_CreateRepositoryRequest = (input, context) => { - return (0, smithy_client_1.take)(input, { - catalogData: (_) => se_RepositoryCatalogDataInput(_, context), - repositoryName: [], - tags: smithy_client_1._json, - }); +__name(_UnableToAccessSecretException, "UnableToAccessSecretException"); +var UnableToAccessSecretException = _UnableToAccessSecretException; +var _UnableToDecryptSecretValueException = class _UnableToDecryptSecretValueException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnableToDecryptSecretValueException", + $fault: "client", + ...opts + }); + this.name = "UnableToDecryptSecretValueException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnableToDecryptSecretValueException.prototype); + } }; -const se_PutRepositoryCatalogDataRequest = (input, context) => { - return (0, smithy_client_1.take)(input, { - catalogData: (_) => se_RepositoryCatalogDataInput(_, context), - registryId: [], - repositoryName: [], - }); +__name(_UnableToDecryptSecretValueException, "UnableToDecryptSecretValueException"); +var UnableToDecryptSecretValueException = _UnableToDecryptSecretValueException; +var _UnsupportedUpstreamRegistryException = class _UnsupportedUpstreamRegistryException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnsupportedUpstreamRegistryException", + $fault: "client", + ...opts + }); + this.name = "UnsupportedUpstreamRegistryException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnsupportedUpstreamRegistryException.prototype); + } }; -const se_RepositoryCatalogDataInput = (input, context) => { - return (0, smithy_client_1.take)(input, { - aboutText: [], - architectures: smithy_client_1._json, - description: [], - logoImageBlob: context.base64Encoder, - operatingSystems: smithy_client_1._json, - usageText: [], - }); +__name(_UnsupportedUpstreamRegistryException, "UnsupportedUpstreamRegistryException"); +var UnsupportedUpstreamRegistryException = _UnsupportedUpstreamRegistryException; +var EncryptionType = { + AES256: "AES256", + KMS: "KMS" +}; +var ImageTagMutability = { + IMMUTABLE: "IMMUTABLE", + MUTABLE: "MUTABLE" +}; +var _InvalidTagParameterException = class _InvalidTagParameterException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidTagParameterException", + $fault: "client", + ...opts + }); + this.name = "InvalidTagParameterException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidTagParameterException.prototype); + } }; -const se_UploadLayerPartRequest = (input, context) => { - return (0, smithy_client_1.take)(input, { - layerPartBlob: context.base64Encoder, - partFirstByte: [], - partLastByte: [], - registryId: [], - repositoryName: [], - uploadId: [], - }); +__name(_InvalidTagParameterException, "InvalidTagParameterException"); +var InvalidTagParameterException = _InvalidTagParameterException; +var _RepositoryAlreadyExistsException = class _RepositoryAlreadyExistsException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "RepositoryAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryAlreadyExistsException.prototype); + } }; -const de_AuthorizationData = (output, context) => { - return (0, smithy_client_1.take)(output, { - authorizationToken: smithy_client_1.expectString, - expiresAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - }); +__name(_RepositoryAlreadyExistsException, "RepositoryAlreadyExistsException"); +var RepositoryAlreadyExistsException = _RepositoryAlreadyExistsException; +var _TooManyTagsException = class _TooManyTagsException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "TooManyTagsException", + $fault: "client", + ...opts + }); + this.name = "TooManyTagsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _TooManyTagsException.prototype); + } }; -const de_CreateRepositoryResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - catalogData: smithy_client_1._json, - repository: (_) => de_Repository(_, context), - }); +__name(_TooManyTagsException, "TooManyTagsException"); +var TooManyTagsException = _TooManyTagsException; +var _LifecyclePolicyNotFoundException = class _LifecyclePolicyNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LifecyclePolicyNotFoundException", + $fault: "client", + ...opts + }); + this.name = "LifecyclePolicyNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LifecyclePolicyNotFoundException.prototype); + } }; -const de_DeleteRepositoryResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - repository: (_) => de_Repository(_, context), - }); +__name(_LifecyclePolicyNotFoundException, "LifecyclePolicyNotFoundException"); +var LifecyclePolicyNotFoundException = _LifecyclePolicyNotFoundException; +var _PullThroughCacheRuleNotFoundException = class _PullThroughCacheRuleNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "PullThroughCacheRuleNotFoundException", + $fault: "client", + ...opts + }); + this.name = "PullThroughCacheRuleNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _PullThroughCacheRuleNotFoundException.prototype); + } }; -const de_DescribeImagesResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - imageDetails: (_) => de_ImageDetailList(_, context), - nextToken: smithy_client_1.expectString, - }); +__name(_PullThroughCacheRuleNotFoundException, "PullThroughCacheRuleNotFoundException"); +var PullThroughCacheRuleNotFoundException = _PullThroughCacheRuleNotFoundException; +var _RegistryPolicyNotFoundException = class _RegistryPolicyNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RegistryPolicyNotFoundException", + $fault: "client", + ...opts + }); + this.name = "RegistryPolicyNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RegistryPolicyNotFoundException.prototype); + } }; -const de_DescribeImageTagsResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - imageTagDetails: (_) => de_ImageTagDetailList(_, context), - nextToken: smithy_client_1.expectString, - }); +__name(_RegistryPolicyNotFoundException, "RegistryPolicyNotFoundException"); +var RegistryPolicyNotFoundException = _RegistryPolicyNotFoundException; +var _RepositoryNotEmptyException = class _RepositoryNotEmptyException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryNotEmptyException", + $fault: "client", + ...opts + }); + this.name = "RepositoryNotEmptyException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryNotEmptyException.prototype); + } }; -const de_DescribeRepositoriesResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - nextToken: smithy_client_1.expectString, - repositories: (_) => de_RepositoryList(_, context), - }); +__name(_RepositoryNotEmptyException, "RepositoryNotEmptyException"); +var RepositoryNotEmptyException = _RepositoryNotEmptyException; +var _RepositoryPolicyNotFoundException = class _RepositoryPolicyNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RepositoryPolicyNotFoundException", + $fault: "client", + ...opts + }); + this.name = "RepositoryPolicyNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RepositoryPolicyNotFoundException.prototype); + } }; -const de_GetAuthorizationTokenResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - authorizationData: (_) => de_AuthorizationData(_, context), - }); +__name(_RepositoryPolicyNotFoundException, "RepositoryPolicyNotFoundException"); +var RepositoryPolicyNotFoundException = _RepositoryPolicyNotFoundException; +var ReplicationStatus = { + COMPLETE: "COMPLETE", + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS" +}; +var _ImageNotFoundException = class _ImageNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ImageNotFoundException", + $fault: "client", + ...opts + }); + this.name = "ImageNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ImageNotFoundException.prototype); + } }; -const de_ImageDetail = (output, context) => { - return (0, smithy_client_1.take)(output, { - artifactMediaType: smithy_client_1.expectString, - imageDigest: smithy_client_1.expectString, - imageManifestMediaType: smithy_client_1.expectString, - imagePushedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - imageSizeInBytes: smithy_client_1.expectLong, - imageTags: smithy_client_1._json, - registryId: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - }); +__name(_ImageNotFoundException, "ImageNotFoundException"); +var ImageNotFoundException = _ImageNotFoundException; +var TagStatus = { + ANY: "ANY", + TAGGED: "TAGGED", + UNTAGGED: "UNTAGGED" +}; +var FindingSeverity = { + CRITICAL: "CRITICAL", + HIGH: "HIGH", + INFORMATIONAL: "INFORMATIONAL", + LOW: "LOW", + MEDIUM: "MEDIUM", + UNDEFINED: "UNDEFINED" +}; +var ScanStatus = { + ACTIVE: "ACTIVE", + COMPLETE: "COMPLETE", + FAILED: "FAILED", + FINDINGS_UNAVAILABLE: "FINDINGS_UNAVAILABLE", + IN_PROGRESS: "IN_PROGRESS", + PENDING: "PENDING", + SCAN_ELIGIBILITY_EXPIRED: "SCAN_ELIGIBILITY_EXPIRED", + UNSUPPORTED_IMAGE: "UNSUPPORTED_IMAGE" +}; +var _ScanNotFoundException = class _ScanNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ScanNotFoundException", + $fault: "client", + ...opts + }); + this.name = "ScanNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ScanNotFoundException.prototype); + } }; -const de_ImageDetailList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_ImageDetail(entry, context); - }); - return retVal; +__name(_ScanNotFoundException, "ScanNotFoundException"); +var ScanNotFoundException = _ScanNotFoundException; +var RepositoryFilterType = { + PREFIX_MATCH: "PREFIX_MATCH" +}; +var _LayerInaccessibleException = class _LayerInaccessibleException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LayerInaccessibleException", + $fault: "client", + ...opts + }); + this.name = "LayerInaccessibleException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LayerInaccessibleException.prototype); + } }; -const de_ImageTagDetail = (output, context) => { - return (0, smithy_client_1.take)(output, { - createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - imageDetail: (_) => de_ReferencedImageDetail(_, context), - imageTag: smithy_client_1.expectString, - }); +__name(_LayerInaccessibleException, "LayerInaccessibleException"); +var LayerInaccessibleException = _LayerInaccessibleException; +var _LayersNotFoundException = class _LayersNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LayersNotFoundException", + $fault: "client", + ...opts + }); + this.name = "LayersNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LayersNotFoundException.prototype); + } }; -const de_ImageTagDetailList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_ImageTagDetail(entry, context); - }); - return retVal; +__name(_LayersNotFoundException, "LayersNotFoundException"); +var LayersNotFoundException = _LayersNotFoundException; +var _UnableToGetUpstreamLayerException = class _UnableToGetUpstreamLayerException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnableToGetUpstreamLayerException", + $fault: "client", + ...opts + }); + this.name = "UnableToGetUpstreamLayerException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnableToGetUpstreamLayerException.prototype); + } }; -const de_ReferencedImageDetail = (output, context) => { - return (0, smithy_client_1.take)(output, { - artifactMediaType: smithy_client_1.expectString, - imageDigest: smithy_client_1.expectString, - imageManifestMediaType: smithy_client_1.expectString, - imagePushedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - imageSizeInBytes: smithy_client_1.expectLong, - }); +__name(_UnableToGetUpstreamLayerException, "UnableToGetUpstreamLayerException"); +var UnableToGetUpstreamLayerException = _UnableToGetUpstreamLayerException; +var ImageActionType = { + EXPIRE: "EXPIRE" +}; +var LifecyclePolicyPreviewStatus = { + COMPLETE: "COMPLETE", + EXPIRED: "EXPIRED", + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS" +}; +var _LifecyclePolicyPreviewNotFoundException = class _LifecyclePolicyPreviewNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LifecyclePolicyPreviewNotFoundException", + $fault: "client", + ...opts + }); + this.name = "LifecyclePolicyPreviewNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LifecyclePolicyPreviewNotFoundException.prototype); + } }; -const de_Repository = (output, context) => { - return (0, smithy_client_1.take)(output, { - createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - registryId: smithy_client_1.expectString, - repositoryArn: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - repositoryUri: smithy_client_1.expectString, - }); +__name(_LifecyclePolicyPreviewNotFoundException, "LifecyclePolicyPreviewNotFoundException"); +var LifecyclePolicyPreviewNotFoundException = _LifecyclePolicyPreviewNotFoundException; +var ScanType = { + BASIC: "BASIC", + ENHANCED: "ENHANCED" +}; +var _ImageAlreadyExistsException = class _ImageAlreadyExistsException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ImageAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "ImageAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ImageAlreadyExistsException.prototype); + } }; -const de_RepositoryList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_Repository(entry, context); - }); - return retVal; +__name(_ImageAlreadyExistsException, "ImageAlreadyExistsException"); +var ImageAlreadyExistsException = _ImageAlreadyExistsException; +var _ImageDigestDoesNotMatchException = class _ImageDigestDoesNotMatchException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ImageDigestDoesNotMatchException", + $fault: "client", + ...opts + }); + this.name = "ImageDigestDoesNotMatchException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ImageDigestDoesNotMatchException.prototype); + } }; -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 collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); -const throwDefaultError = (0, smithy_client_1.withBaseException)(ECRPUBLICServiceException_1.ECRPUBLICServiceException); -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, - }; - if (resolvedHostname !== undefined) { - contents.hostname = resolvedHostname; - } - if (body !== undefined) { - contents.body = body; - } - return new protocol_http_1.HttpRequest(contents); +__name(_ImageDigestDoesNotMatchException, "ImageDigestDoesNotMatchException"); +var ImageDigestDoesNotMatchException = _ImageDigestDoesNotMatchException; +var _ImageTagAlreadyExistsException = class _ImageTagAlreadyExistsException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ImageTagAlreadyExistsException", + $fault: "client", + ...opts + }); + this.name = "ImageTagAlreadyExistsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ImageTagAlreadyExistsException.prototype); + } }; -function sharedHeaders(operation) { - return { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": `SpencerFrontendService.${operation}`, - }; -} -const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - return JSON.parse(encoded); - } - return {}; -}); -const parseErrorBody = async (errorBody, context) => { - const value = await parseBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; +__name(_ImageTagAlreadyExistsException, "ImageTagAlreadyExistsException"); +var ImageTagAlreadyExistsException = _ImageTagAlreadyExistsException; +var _ReferencedImagesNotFoundException = class _ReferencedImagesNotFoundException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ReferencedImagesNotFoundException", + $fault: "client", + ...opts + }); + this.name = "ReferencedImagesNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ReferencedImagesNotFoundException.prototype); + } }; -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.code !== undefined) { - return sanitizeErrorCode(data.code); - } - if (data["__type"] !== undefined) { - return sanitizeErrorCode(data["__type"]); - } +__name(_ReferencedImagesNotFoundException, "ReferencedImagesNotFoundException"); +var ReferencedImagesNotFoundException = _ReferencedImagesNotFoundException; +var _UnsupportedImageTypeException = class _UnsupportedImageTypeException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnsupportedImageTypeException", + $fault: "client", + ...opts + }); + this.name = "UnsupportedImageTypeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnsupportedImageTypeException.prototype); + } }; - - -/***/ }), - -/***/ 49324: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const tslib_1 = __nccwpck_require__(4351); -const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(9634)); -const client_sts_1 = __nccwpck_require__(52209); -const credential_provider_node_1 = __nccwpck_require__(75531); -const util_user_agent_node_1 = __nccwpck_require__(98095); -const config_resolver_1 = __nccwpck_require__(53098); -const hash_node_1 = __nccwpck_require__(3081); -const middleware_retry_1 = __nccwpck_require__(96039); -const node_config_provider_1 = __nccwpck_require__(33461); -const node_http_handler_1 = __nccwpck_require__(47435); -const util_body_length_node_1 = __nccwpck_require__(68075); -const util_retry_1 = __nccwpck_require__(84902); -const runtimeConfig_shared_1 = __nccwpck_require__(76746); -const smithy_client_1 = __nccwpck_require__(63570); -const util_defaults_mode_node_1 = __nccwpck_require__(72429); -const smithy_client_2 = __nccwpck_require__(63570); -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); - return { - ...clientSharedValues, - ...config, - runtime: "node", - defaultsMode, - bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider), - defaultUserAgentProvider: config?.defaultUserAgentProvider ?? - (0, util_user_agent_node_1.defaultUserAgent)({ 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), - region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(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, - }), - 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), - useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - }; +__name(_UnsupportedImageTypeException, "UnsupportedImageTypeException"); +var UnsupportedImageTypeException = _UnsupportedImageTypeException; +var _LifecyclePolicyPreviewInProgressException = class _LifecyclePolicyPreviewInProgressException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "LifecyclePolicyPreviewInProgressException", + $fault: "client", + ...opts + }); + this.name = "LifecyclePolicyPreviewInProgressException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _LifecyclePolicyPreviewInProgressException.prototype); + } }; -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), - -/***/ 76746: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const url_parser_1 = __nccwpck_require__(14681); -const util_base64_1 = __nccwpck_require__(75600); -const util_utf8_1 = __nccwpck_require__(41895); -const endpointResolver_1 = __nccwpck_require__(87377); -const getRuntimeConfig = (config) => ({ - apiVersion: "2020-10-30", - 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 ?? [], - logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - serviceId: config?.serviceId ?? "ECR PUBLIC", - urlParser: config?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, -}); -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), - -/***/ 22754: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRuntimeExtensions = void 0; -const region_config_resolver_1 = __nccwpck_require__(18156); -const protocol_http_1 = __nccwpck_require__(54483); -const smithy_client_1 = __nccwpck_require__(63570); -const asPartial = (t) => t; -const resolveRuntimeExtensions = (runtimeConfig, extensions) => { - const extensionConfiguration = { - ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)), - }; - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return { - ...runtimeConfig, - ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), - ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), - ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), - }; +__name(_LifecyclePolicyPreviewInProgressException, "LifecyclePolicyPreviewInProgressException"); +var LifecyclePolicyPreviewInProgressException = _LifecyclePolicyPreviewInProgressException; +var _InvalidLayerPartException = class _InvalidLayerPartException extends ECRServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidLayerPartException", + $fault: "client", + ...opts + }); + this.name = "InvalidLayerPartException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidLayerPartException.prototype); + this.registryId = opts.registryId; + this.repositoryName = opts.repositoryName; + this.uploadId = opts.uploadId; + this.lastValidByteReceived = opts.lastValidByteReceived; + } }; -exports.resolveRuntimeExtensions = resolveRuntimeExtensions; - - -/***/ }), +__name(_InvalidLayerPartException, "InvalidLayerPartException"); +var InvalidLayerPartException = _InvalidLayerPartException; + +// src/protocols/Aws_json1_1.ts +var se_BatchCheckLayerAvailabilityCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("BatchCheckLayerAvailability"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_BatchCheckLayerAvailabilityCommand"); +var se_BatchDeleteImageCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("BatchDeleteImage"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_BatchDeleteImageCommand"); +var se_BatchGetImageCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("BatchGetImage"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_BatchGetImageCommand"); +var se_BatchGetRepositoryScanningConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("BatchGetRepositoryScanningConfiguration"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_BatchGetRepositoryScanningConfigurationCommand"); +var se_CompleteLayerUploadCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("CompleteLayerUpload"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_CompleteLayerUploadCommand"); +var se_CreatePullThroughCacheRuleCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("CreatePullThroughCacheRule"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_CreatePullThroughCacheRuleCommand"); +var se_CreateRepositoryCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("CreateRepository"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_CreateRepositoryCommand"); +var se_DeleteLifecyclePolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DeleteLifecyclePolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DeleteLifecyclePolicyCommand"); +var se_DeletePullThroughCacheRuleCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DeletePullThroughCacheRule"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DeletePullThroughCacheRuleCommand"); +var se_DeleteRegistryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DeleteRegistryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DeleteRegistryPolicyCommand"); +var se_DeleteRepositoryCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DeleteRepository"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DeleteRepositoryCommand"); +var se_DeleteRepositoryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DeleteRepositoryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DeleteRepositoryPolicyCommand"); +var se_DescribeImageReplicationStatusCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeImageReplicationStatus"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeImageReplicationStatusCommand"); +var se_DescribeImagesCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeImages"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeImagesCommand"); +var se_DescribeImageScanFindingsCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeImageScanFindings"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeImageScanFindingsCommand"); +var se_DescribePullThroughCacheRulesCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribePullThroughCacheRules"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribePullThroughCacheRulesCommand"); +var se_DescribeRegistryCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeRegistry"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeRegistryCommand"); +var se_DescribeRepositoriesCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("DescribeRepositories"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DescribeRepositoriesCommand"); +var se_GetAuthorizationTokenCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetAuthorizationToken"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetAuthorizationTokenCommand"); +var se_GetDownloadUrlForLayerCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetDownloadUrlForLayer"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetDownloadUrlForLayerCommand"); +var se_GetLifecyclePolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetLifecyclePolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetLifecyclePolicyCommand"); +var se_GetLifecyclePolicyPreviewCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetLifecyclePolicyPreview"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetLifecyclePolicyPreviewCommand"); +var se_GetRegistryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetRegistryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetRegistryPolicyCommand"); +var se_GetRegistryScanningConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetRegistryScanningConfiguration"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetRegistryScanningConfigurationCommand"); +var se_GetRepositoryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("GetRepositoryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetRepositoryPolicyCommand"); +var se_InitiateLayerUploadCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("InitiateLayerUpload"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_InitiateLayerUploadCommand"); +var se_ListImagesCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("ListImages"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_ListImagesCommand"); +var se_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("ListTagsForResource"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_ListTagsForResourceCommand"); +var se_PutImageCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutImage"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutImageCommand"); +var se_PutImageScanningConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutImageScanningConfiguration"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutImageScanningConfigurationCommand"); +var se_PutImageTagMutabilityCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutImageTagMutability"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutImageTagMutabilityCommand"); +var se_PutLifecyclePolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutLifecyclePolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutLifecyclePolicyCommand"); +var se_PutRegistryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutRegistryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutRegistryPolicyCommand"); +var se_PutRegistryScanningConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutRegistryScanningConfiguration"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutRegistryScanningConfigurationCommand"); +var se_PutReplicationConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("PutReplicationConfiguration"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_PutReplicationConfigurationCommand"); +var se_SetRepositoryPolicyCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("SetRepositoryPolicy"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_SetRepositoryPolicyCommand"); +var se_StartImageScanCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("StartImageScan"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_StartImageScanCommand"); +var se_StartLifecyclePolicyPreviewCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("StartLifecyclePolicyPreview"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_StartLifecyclePolicyPreviewCommand"); +var se_TagResourceCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("TagResource"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_TagResourceCommand"); +var se_UntagResourceCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("UntagResource"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_UntagResourceCommand"); +var se_UpdatePullThroughCacheRuleCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("UpdatePullThroughCacheRule"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_UpdatePullThroughCacheRuleCommand"); +var se_UploadLayerPartCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("UploadLayerPart"); + let body; + body = JSON.stringify(se_UploadLayerPartRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_UploadLayerPartCommand"); +var se_ValidatePullThroughCacheRuleCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = sharedHeaders("ValidatePullThroughCacheRule"); + let body; + body = JSON.stringify((0, import_smithy_client._json)(input)); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_ValidatePullThroughCacheRuleCommand"); +var de_BatchCheckLayerAvailabilityCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_BatchCheckLayerAvailabilityCommand"); +var de_BatchDeleteImageCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_BatchDeleteImageCommand"); +var de_BatchGetImageCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_BatchGetImageCommand"); +var de_BatchGetRepositoryScanningConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_BatchGetRepositoryScanningConfigurationCommand"); +var de_CompleteLayerUploadCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_CompleteLayerUploadCommand"); +var de_CreatePullThroughCacheRuleCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_CreatePullThroughCacheRuleResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_CreatePullThroughCacheRuleCommand"); +var de_CreateRepositoryCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_CreateRepositoryResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_CreateRepositoryCommand"); +var de_DeleteLifecyclePolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DeleteLifecyclePolicyResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DeleteLifecyclePolicyCommand"); +var de_DeletePullThroughCacheRuleCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DeletePullThroughCacheRuleResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DeletePullThroughCacheRuleCommand"); +var de_DeleteRegistryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DeleteRegistryPolicyCommand"); +var de_DeleteRepositoryCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DeleteRepositoryResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DeleteRepositoryCommand"); +var de_DeleteRepositoryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DeleteRepositoryPolicyCommand"); +var de_DescribeImageReplicationStatusCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeImageReplicationStatusCommand"); +var de_DescribeImagesCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DescribeImagesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeImagesCommand"); +var de_DescribeImageScanFindingsCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DescribeImageScanFindingsResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeImageScanFindingsCommand"); +var de_DescribePullThroughCacheRulesCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DescribePullThroughCacheRulesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribePullThroughCacheRulesCommand"); +var de_DescribeRegistryCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeRegistryCommand"); +var de_DescribeRepositoriesCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DescribeRepositoriesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DescribeRepositoriesCommand"); +var de_GetAuthorizationTokenCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_GetAuthorizationTokenResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetAuthorizationTokenCommand"); +var de_GetDownloadUrlForLayerCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetDownloadUrlForLayerCommand"); +var de_GetLifecyclePolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_GetLifecyclePolicyResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetLifecyclePolicyCommand"); +var de_GetLifecyclePolicyPreviewCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_GetLifecyclePolicyPreviewResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetLifecyclePolicyPreviewCommand"); +var de_GetRegistryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetRegistryPolicyCommand"); +var de_GetRegistryScanningConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetRegistryScanningConfigurationCommand"); +var de_GetRepositoryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetRepositoryPolicyCommand"); +var de_InitiateLayerUploadCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_InitiateLayerUploadCommand"); +var de_ListImagesCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_ListImagesCommand"); +var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_ListTagsForResourceCommand"); +var de_PutImageCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutImageCommand"); +var de_PutImageScanningConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutImageScanningConfigurationCommand"); +var de_PutImageTagMutabilityCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutImageTagMutabilityCommand"); +var de_PutLifecyclePolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutLifecyclePolicyCommand"); +var de_PutRegistryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutRegistryPolicyCommand"); +var de_PutRegistryScanningConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutRegistryScanningConfigurationCommand"); +var de_PutReplicationConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_PutReplicationConfigurationCommand"); +var de_SetRepositoryPolicyCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_SetRepositoryPolicyCommand"); +var de_StartImageScanCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_StartImageScanCommand"); +var de_StartLifecyclePolicyPreviewCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_StartLifecyclePolicyPreviewCommand"); +var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_TagResourceCommand"); +var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_UntagResourceCommand"); +var de_UpdatePullThroughCacheRuleCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_UpdatePullThroughCacheRuleResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_UpdatePullThroughCacheRuleCommand"); +var de_UploadLayerPartCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_UploadLayerPartCommand"); +var de_ValidatePullThroughCacheRuleCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = (0, import_smithy_client._json)(data); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_ValidatePullThroughCacheRuleCommand"); +var de_CommandError = /* @__PURE__ */ __name(async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context) + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidParameterException": + case "com.amazonaws.ecr#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "RepositoryNotFoundException": + case "com.amazonaws.ecr#RepositoryNotFoundException": + throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); + case "ServerException": + case "com.amazonaws.ecr#ServerException": + throw await de_ServerExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.ecr#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "UnableToGetUpstreamImageException": + case "com.amazonaws.ecr#UnableToGetUpstreamImageException": + throw await de_UnableToGetUpstreamImageExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.ecr#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "EmptyUploadException": + case "com.amazonaws.ecr#EmptyUploadException": + throw await de_EmptyUploadExceptionRes(parsedOutput, context); + case "InvalidLayerException": + case "com.amazonaws.ecr#InvalidLayerException": + throw await de_InvalidLayerExceptionRes(parsedOutput, context); + case "KmsException": + case "com.amazonaws.ecr#KmsException": + throw await de_KmsExceptionRes(parsedOutput, context); + case "LayerAlreadyExistsException": + case "com.amazonaws.ecr#LayerAlreadyExistsException": + throw await de_LayerAlreadyExistsExceptionRes(parsedOutput, context); + case "LayerPartTooSmallException": + case "com.amazonaws.ecr#LayerPartTooSmallException": + throw await de_LayerPartTooSmallExceptionRes(parsedOutput, context); + case "UploadNotFoundException": + case "com.amazonaws.ecr#UploadNotFoundException": + throw await de_UploadNotFoundExceptionRes(parsedOutput, context); + case "PullThroughCacheRuleAlreadyExistsException": + case "com.amazonaws.ecr#PullThroughCacheRuleAlreadyExistsException": + throw await de_PullThroughCacheRuleAlreadyExistsExceptionRes(parsedOutput, context); + case "SecretNotFoundException": + case "com.amazonaws.ecr#SecretNotFoundException": + throw await de_SecretNotFoundExceptionRes(parsedOutput, context); + case "UnableToAccessSecretException": + case "com.amazonaws.ecr#UnableToAccessSecretException": + throw await de_UnableToAccessSecretExceptionRes(parsedOutput, context); + case "UnableToDecryptSecretValueException": + case "com.amazonaws.ecr#UnableToDecryptSecretValueException": + throw await de_UnableToDecryptSecretValueExceptionRes(parsedOutput, context); + case "UnsupportedUpstreamRegistryException": + case "com.amazonaws.ecr#UnsupportedUpstreamRegistryException": + throw await de_UnsupportedUpstreamRegistryExceptionRes(parsedOutput, context); + case "InvalidTagParameterException": + case "com.amazonaws.ecr#InvalidTagParameterException": + throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); + case "RepositoryAlreadyExistsException": + case "com.amazonaws.ecr#RepositoryAlreadyExistsException": + throw await de_RepositoryAlreadyExistsExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.ecr#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "LifecyclePolicyNotFoundException": + case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": + throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); + case "PullThroughCacheRuleNotFoundException": + case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException": + throw await de_PullThroughCacheRuleNotFoundExceptionRes(parsedOutput, context); + case "RegistryPolicyNotFoundException": + case "com.amazonaws.ecr#RegistryPolicyNotFoundException": + throw await de_RegistryPolicyNotFoundExceptionRes(parsedOutput, context); + case "RepositoryNotEmptyException": + case "com.amazonaws.ecr#RepositoryNotEmptyException": + throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); + case "RepositoryPolicyNotFoundException": + case "com.amazonaws.ecr#RepositoryPolicyNotFoundException": + throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); + case "ImageNotFoundException": + case "com.amazonaws.ecr#ImageNotFoundException": + throw await de_ImageNotFoundExceptionRes(parsedOutput, context); + case "ScanNotFoundException": + case "com.amazonaws.ecr#ScanNotFoundException": + throw await de_ScanNotFoundExceptionRes(parsedOutput, context); + case "LayerInaccessibleException": + case "com.amazonaws.ecr#LayerInaccessibleException": + throw await de_LayerInaccessibleExceptionRes(parsedOutput, context); + case "LayersNotFoundException": + case "com.amazonaws.ecr#LayersNotFoundException": + throw await de_LayersNotFoundExceptionRes(parsedOutput, context); + case "UnableToGetUpstreamLayerException": + case "com.amazonaws.ecr#UnableToGetUpstreamLayerException": + throw await de_UnableToGetUpstreamLayerExceptionRes(parsedOutput, context); + case "LifecyclePolicyPreviewNotFoundException": + case "com.amazonaws.ecr#LifecyclePolicyPreviewNotFoundException": + throw await de_LifecyclePolicyPreviewNotFoundExceptionRes(parsedOutput, context); + case "ImageAlreadyExistsException": + case "com.amazonaws.ecr#ImageAlreadyExistsException": + throw await de_ImageAlreadyExistsExceptionRes(parsedOutput, context); + case "ImageDigestDoesNotMatchException": + case "com.amazonaws.ecr#ImageDigestDoesNotMatchException": + throw await de_ImageDigestDoesNotMatchExceptionRes(parsedOutput, context); + case "ImageTagAlreadyExistsException": + case "com.amazonaws.ecr#ImageTagAlreadyExistsException": + throw await de_ImageTagAlreadyExistsExceptionRes(parsedOutput, context); + case "ReferencedImagesNotFoundException": + case "com.amazonaws.ecr#ReferencedImagesNotFoundException": + throw await de_ReferencedImagesNotFoundExceptionRes(parsedOutput, context); + case "UnsupportedImageTypeException": + case "com.amazonaws.ecr#UnsupportedImageTypeException": + throw await de_UnsupportedImageTypeExceptionRes(parsedOutput, context); + case "LifecyclePolicyPreviewInProgressException": + case "com.amazonaws.ecr#LifecyclePolicyPreviewInProgressException": + throw await de_LifecyclePolicyPreviewInProgressExceptionRes(parsedOutput, context); + case "InvalidLayerPartException": + case "com.amazonaws.ecr#InvalidLayerPartException": + throw await de_InvalidLayerPartExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode + }); + } +}, "de_CommandError"); +var de_EmptyUploadExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new EmptyUploadException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_EmptyUploadExceptionRes"); +var de_ImageAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ImageAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ImageAlreadyExistsExceptionRes"); +var de_ImageDigestDoesNotMatchExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ImageDigestDoesNotMatchException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ImageDigestDoesNotMatchExceptionRes"); +var de_ImageNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ImageNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ImageNotFoundExceptionRes"); +var de_ImageTagAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ImageTagAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ImageTagAlreadyExistsExceptionRes"); +var de_InvalidLayerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InvalidLayerException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidLayerExceptionRes"); +var de_InvalidLayerPartExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InvalidLayerPartException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidLayerPartExceptionRes"); +var de_InvalidParameterExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InvalidParameterException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidParameterExceptionRes"); +var de_InvalidTagParameterExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InvalidTagParameterException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidTagParameterExceptionRes"); +var de_KmsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new KmsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_KmsExceptionRes"); +var de_LayerAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LayerAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LayerAlreadyExistsExceptionRes"); +var de_LayerInaccessibleExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LayerInaccessibleException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LayerInaccessibleExceptionRes"); +var de_LayerPartTooSmallExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LayerPartTooSmallException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LayerPartTooSmallExceptionRes"); +var de_LayersNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LayersNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LayersNotFoundExceptionRes"); +var de_LifecyclePolicyNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LifecyclePolicyNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LifecyclePolicyNotFoundExceptionRes"); +var de_LifecyclePolicyPreviewInProgressExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LifecyclePolicyPreviewInProgressException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LifecyclePolicyPreviewInProgressExceptionRes"); +var de_LifecyclePolicyPreviewNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LifecyclePolicyPreviewNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LifecyclePolicyPreviewNotFoundExceptionRes"); +var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new LimitExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_LimitExceededExceptionRes"); +var de_PullThroughCacheRuleAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new PullThroughCacheRuleAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_PullThroughCacheRuleAlreadyExistsExceptionRes"); +var de_PullThroughCacheRuleNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new PullThroughCacheRuleNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_PullThroughCacheRuleNotFoundExceptionRes"); +var de_ReferencedImagesNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ReferencedImagesNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ReferencedImagesNotFoundExceptionRes"); +var de_RegistryPolicyNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RegistryPolicyNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RegistryPolicyNotFoundExceptionRes"); +var de_RepositoryAlreadyExistsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryAlreadyExistsExceptionRes"); +var de_RepositoryNotEmptyExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryNotEmptyException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryNotEmptyExceptionRes"); +var de_RepositoryNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryNotFoundExceptionRes"); +var de_RepositoryPolicyNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new RepositoryPolicyNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RepositoryPolicyNotFoundExceptionRes"); +var de_ScanNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ScanNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ScanNotFoundExceptionRes"); +var de_SecretNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new SecretNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_SecretNotFoundExceptionRes"); +var de_ServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ServerExceptionRes"); +var de_TooManyTagsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new TooManyTagsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_TooManyTagsExceptionRes"); +var de_UnableToAccessSecretExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UnableToAccessSecretException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UnableToAccessSecretExceptionRes"); +var de_UnableToDecryptSecretValueExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UnableToDecryptSecretValueException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UnableToDecryptSecretValueExceptionRes"); +var de_UnableToGetUpstreamImageExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UnableToGetUpstreamImageException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UnableToGetUpstreamImageExceptionRes"); +var de_UnableToGetUpstreamLayerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UnableToGetUpstreamLayerException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UnableToGetUpstreamLayerExceptionRes"); +var de_UnsupportedImageTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UnsupportedImageTypeException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UnsupportedImageTypeExceptionRes"); +var de_UnsupportedUpstreamRegistryExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UnsupportedUpstreamRegistryException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UnsupportedUpstreamRegistryExceptionRes"); +var de_UploadNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new UploadNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_UploadNotFoundExceptionRes"); +var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ValidationExceptionRes"); +var se_UploadLayerPartRequest = /* @__PURE__ */ __name((input, context) => { + return (0, import_smithy_client.take)(input, { + layerPartBlob: context.base64Encoder, + partFirstByte: [], + partLastByte: [], + registryId: [], + repositoryName: [], + uploadId: [] + }); +}, "se_UploadLayerPartRequest"); +var de_AuthorizationData = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + authorizationToken: import_smithy_client.expectString, + expiresAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + proxyEndpoint: import_smithy_client.expectString + }); +}, "de_AuthorizationData"); +var de_AuthorizationDataList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_AuthorizationData(entry, context); + }); + return retVal; +}, "de_AuthorizationDataList"); +var de_AwsEcrContainerImageDetails = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + architecture: import_smithy_client.expectString, + author: import_smithy_client.expectString, + imageHash: import_smithy_client.expectString, + imageTags: import_smithy_client._json, + platform: import_smithy_client.expectString, + pushedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + registry: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString + }); +}, "de_AwsEcrContainerImageDetails"); +var de_CreatePullThroughCacheRuleResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + credentialArn: import_smithy_client.expectString, + ecrRepositoryPrefix: import_smithy_client.expectString, + registryId: import_smithy_client.expectString, + upstreamRegistry: import_smithy_client.expectString, + upstreamRegistryUrl: import_smithy_client.expectString + }); +}, "de_CreatePullThroughCacheRuleResponse"); +var de_CreateRepositoryResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + repository: (_) => de_Repository(_, context) + }); +}, "de_CreateRepositoryResponse"); +var de_CvssScore = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + baseScore: import_smithy_client.limitedParseDouble, + scoringVector: import_smithy_client.expectString, + source: import_smithy_client.expectString, + version: import_smithy_client.expectString + }); +}, "de_CvssScore"); +var de_CvssScoreDetails = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + adjustments: import_smithy_client._json, + score: import_smithy_client.limitedParseDouble, + scoreSource: import_smithy_client.expectString, + scoringVector: import_smithy_client.expectString, + version: import_smithy_client.expectString + }); +}, "de_CvssScoreDetails"); +var de_CvssScoreList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_CvssScore(entry, context); + }); + return retVal; +}, "de_CvssScoreList"); +var de_DeleteLifecyclePolicyResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + lastEvaluatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + lifecyclePolicyText: import_smithy_client.expectString, + registryId: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString + }); +}, "de_DeleteLifecyclePolicyResponse"); +var de_DeletePullThroughCacheRuleResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + credentialArn: import_smithy_client.expectString, + ecrRepositoryPrefix: import_smithy_client.expectString, + registryId: import_smithy_client.expectString, + upstreamRegistryUrl: import_smithy_client.expectString + }); +}, "de_DeletePullThroughCacheRuleResponse"); +var de_DeleteRepositoryResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + repository: (_) => de_Repository(_, context) + }); +}, "de_DeleteRepositoryResponse"); +var de_DescribeImageScanFindingsResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + imageId: import_smithy_client._json, + imageScanFindings: (_) => de_ImageScanFindings(_, context), + imageScanStatus: import_smithy_client._json, + nextToken: import_smithy_client.expectString, + registryId: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString + }); +}, "de_DescribeImageScanFindingsResponse"); +var de_DescribeImagesResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + imageDetails: (_) => de_ImageDetailList(_, context), + nextToken: import_smithy_client.expectString + }); +}, "de_DescribeImagesResponse"); +var de_DescribePullThroughCacheRulesResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + nextToken: import_smithy_client.expectString, + pullThroughCacheRules: (_) => de_PullThroughCacheRuleList(_, context) + }); +}, "de_DescribePullThroughCacheRulesResponse"); +var de_DescribeRepositoriesResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + nextToken: import_smithy_client.expectString, + repositories: (_) => de_RepositoryList(_, context) + }); +}, "de_DescribeRepositoriesResponse"); +var de_EnhancedImageScanFinding = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + awsAccountId: import_smithy_client.expectString, + description: import_smithy_client.expectString, + findingArn: import_smithy_client.expectString, + firstObservedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + lastObservedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + packageVulnerabilityDetails: (_) => de_PackageVulnerabilityDetails(_, context), + remediation: import_smithy_client._json, + resources: (_) => de_ResourceList(_, context), + score: import_smithy_client.limitedParseDouble, + scoreDetails: (_) => de_ScoreDetails(_, context), + severity: import_smithy_client.expectString, + status: import_smithy_client.expectString, + title: import_smithy_client.expectString, + type: import_smithy_client.expectString, + updatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))) + }); +}, "de_EnhancedImageScanFinding"); +var de_EnhancedImageScanFindingList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_EnhancedImageScanFinding(entry, context); + }); + return retVal; +}, "de_EnhancedImageScanFindingList"); +var de_GetAuthorizationTokenResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + authorizationData: (_) => de_AuthorizationDataList(_, context) + }); +}, "de_GetAuthorizationTokenResponse"); +var de_GetLifecyclePolicyPreviewResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + lifecyclePolicyText: import_smithy_client.expectString, + nextToken: import_smithy_client.expectString, + previewResults: (_) => de_LifecyclePolicyPreviewResultList(_, context), + registryId: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString, + status: import_smithy_client.expectString, + summary: import_smithy_client._json + }); +}, "de_GetLifecyclePolicyPreviewResponse"); +var de_GetLifecyclePolicyResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + lastEvaluatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + lifecyclePolicyText: import_smithy_client.expectString, + registryId: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString + }); +}, "de_GetLifecyclePolicyResponse"); +var de_ImageDetail = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + artifactMediaType: import_smithy_client.expectString, + imageDigest: import_smithy_client.expectString, + imageManifestMediaType: import_smithy_client.expectString, + imagePushedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + imageScanFindingsSummary: (_) => de_ImageScanFindingsSummary(_, context), + imageScanStatus: import_smithy_client._json, + imageSizeInBytes: import_smithy_client.expectLong, + imageTags: import_smithy_client._json, + lastRecordedPullTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + registryId: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString + }); +}, "de_ImageDetail"); +var de_ImageDetailList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_ImageDetail(entry, context); + }); + return retVal; +}, "de_ImageDetailList"); +var de_ImageScanFindings = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + enhancedFindings: (_) => de_EnhancedImageScanFindingList(_, context), + findingSeverityCounts: import_smithy_client._json, + findings: import_smithy_client._json, + imageScanCompletedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + vulnerabilitySourceUpdatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))) + }); +}, "de_ImageScanFindings"); +var de_ImageScanFindingsSummary = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + findingSeverityCounts: import_smithy_client._json, + imageScanCompletedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + vulnerabilitySourceUpdatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))) + }); +}, "de_ImageScanFindingsSummary"); +var de_LifecyclePolicyPreviewResult = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + action: import_smithy_client._json, + appliedRulePriority: import_smithy_client.expectInt32, + imageDigest: import_smithy_client.expectString, + imagePushedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + imageTags: import_smithy_client._json + }); +}, "de_LifecyclePolicyPreviewResult"); +var de_LifecyclePolicyPreviewResultList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_LifecyclePolicyPreviewResult(entry, context); + }); + return retVal; +}, "de_LifecyclePolicyPreviewResultList"); +var de_PackageVulnerabilityDetails = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + cvss: (_) => de_CvssScoreList(_, context), + referenceUrls: import_smithy_client._json, + relatedVulnerabilities: import_smithy_client._json, + source: import_smithy_client.expectString, + sourceUrl: import_smithy_client.expectString, + vendorCreatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + vendorSeverity: import_smithy_client.expectString, + vendorUpdatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + vulnerabilityId: import_smithy_client.expectString, + vulnerablePackages: import_smithy_client._json + }); +}, "de_PackageVulnerabilityDetails"); +var de_PullThroughCacheRule = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + credentialArn: import_smithy_client.expectString, + ecrRepositoryPrefix: import_smithy_client.expectString, + registryId: import_smithy_client.expectString, + updatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + upstreamRegistry: import_smithy_client.expectString, + upstreamRegistryUrl: import_smithy_client.expectString + }); +}, "de_PullThroughCacheRule"); +var de_PullThroughCacheRuleList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_PullThroughCacheRule(entry, context); + }); + return retVal; +}, "de_PullThroughCacheRuleList"); +var de_Repository = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), + encryptionConfiguration: import_smithy_client._json, + imageScanningConfiguration: import_smithy_client._json, + imageTagMutability: import_smithy_client.expectString, + registryId: import_smithy_client.expectString, + repositoryArn: import_smithy_client.expectString, + repositoryName: import_smithy_client.expectString, + repositoryUri: import_smithy_client.expectString + }); +}, "de_Repository"); +var de_RepositoryList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_Repository(entry, context); + }); + return retVal; +}, "de_RepositoryList"); +var de_Resource = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + details: (_) => de_ResourceDetails(_, context), + id: import_smithy_client.expectString, + tags: import_smithy_client._json, + type: import_smithy_client.expectString + }); +}, "de_Resource"); +var de_ResourceDetails = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + awsEcrContainerImage: (_) => de_AwsEcrContainerImageDetails(_, context) + }); +}, "de_ResourceDetails"); +var de_ResourceList = /* @__PURE__ */ __name((output, context) => { + const retVal = (output || []).filter((e) => e != null).map((entry) => { + return de_Resource(entry, context); + }); + return retVal; +}, "de_ResourceList"); +var de_ScoreDetails = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + cvss: (_) => de_CvssScoreDetails(_, context) + }); +}, "de_ScoreDetails"); +var de_UpdatePullThroughCacheRuleResponse = /* @__PURE__ */ __name((output, context) => { + return (0, import_smithy_client.take)(output, { + credentialArn: import_smithy_client.expectString, + ecrRepositoryPrefix: import_smithy_client.expectString, + registryId: import_smithy_client.expectString, + updatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))) + }); +}, "de_UpdatePullThroughCacheRuleResponse"); +var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] +}), "deserializeMetadata"); +var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString"); +var throwDefaultError = (0, import_smithy_client.withBaseException)(ECRServiceException); +var buildHttpRpcRequest = /* @__PURE__ */ __name(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 + }; + if (resolvedHostname !== void 0) { + contents.hostname = resolvedHostname; + } + if (body !== void 0) { + contents.body = body; + } + return new import_protocol_http.HttpRequest(contents); +}, "buildHttpRpcRequest"); +function sharedHeaders(operation) { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonEC2ContainerRegistry_V20150921.${operation}` + }; +} +__name(sharedHeaders, "sharedHeaders"); +var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}), "parseBody"); +var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}, "parseErrorBody"); +var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => { + const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey"); + const sanitizeErrorCode = /* @__PURE__ */ __name((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; + }, "sanitizeErrorCode"); + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== void 0) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== void 0) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== void 0) { + return sanitizeErrorCode(data["__type"]); + } +}, "loadRestJsonErrorCode"); -/***/ 72242: -/***/ ((__unused_webpack_module, exports) => { +// src/commands/BatchCheckLayerAvailabilityCommand.ts +var _BatchCheckLayerAvailabilityCommand = class _BatchCheckLayerAvailabilityCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "BatchCheckLayerAvailability", {}).n("ECRClient", "BatchCheckLayerAvailabilityCommand").f(void 0, void 0).ser(se_BatchCheckLayerAvailabilityCommand).de(de_BatchCheckLayerAvailabilityCommand).build() { +}; +__name(_BatchCheckLayerAvailabilityCommand, "BatchCheckLayerAvailabilityCommand"); +var BatchCheckLayerAvailabilityCommand = _BatchCheckLayerAvailabilityCommand; -"use strict"; +// src/commands/BatchDeleteImageCommand.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; -/***/ }), -/***/ 36170: -/***/ ((__unused_webpack_module, exports) => { +var _BatchDeleteImageCommand = class _BatchDeleteImageCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "BatchDeleteImage", {}).n("ECRClient", "BatchDeleteImageCommand").f(void 0, void 0).ser(se_BatchDeleteImageCommand).de(de_BatchDeleteImageCommand).build() { +}; +__name(_BatchDeleteImageCommand, "BatchDeleteImageCommand"); +var BatchDeleteImageCommand = _BatchDeleteImageCommand; -"use strict"; +// src/commands/BatchGetImageCommand.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -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; + + + +var _BatchGetImageCommand = class _BatchGetImageCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "BatchGetImage", {}).n("ECRClient", "BatchGetImageCommand").f(void 0, void 0).ser(se_BatchGetImageCommand).de(de_BatchGetImageCommand).build() { }; -exports.getTransformedHeaders = getTransformedHeaders; +__name(_BatchGetImageCommand, "BatchGetImageCommand"); +var BatchGetImageCommand = _BatchGetImageCommand; +// src/commands/BatchGetRepositoryScanningConfigurationCommand.ts -/***/ }), -/***/ 47435: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(62111), exports); -tslib_1.__exportStar(__nccwpck_require__(4349), exports); -tslib_1.__exportStar(__nccwpck_require__(16006), exports); +var _BatchGetRepositoryScanningConfigurationCommand = class _BatchGetRepositoryScanningConfigurationCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "BatchGetRepositoryScanningConfiguration", {}).n("ECRClient", "BatchGetRepositoryScanningConfigurationCommand").f(void 0, void 0).ser(se_BatchGetRepositoryScanningConfigurationCommand).de(de_BatchGetRepositoryScanningConfigurationCommand).build() { +}; +__name(_BatchGetRepositoryScanningConfigurationCommand, "BatchGetRepositoryScanningConfigurationCommand"); +var BatchGetRepositoryScanningConfigurationCommand = _BatchGetRepositoryScanningConfigurationCommand; +// src/commands/CompleteLayerUploadCommand.ts -/***/ }), -/***/ 62111: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; -const protocol_http_1 = __nccwpck_require__(54483); -const querystring_builder_1 = __nccwpck_require__(78512); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(72242); -const get_transformed_headers_1 = __nccwpck_require__(36170); -const set_connection_timeout_1 = __nccwpck_require__(24246); -const set_socket_keep_alive_1 = __nccwpck_require__(93651); -const set_socket_timeout_1 = __nccwpck_require__(83099); -const write_request_body_1 = __nccwpck_require__(53122); -exports.DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - var _a, _b; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - auth, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - }); - } - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } -} -exports.NodeHttpHandler = NodeHttpHandler; +var _CompleteLayerUploadCommand = class _CompleteLayerUploadCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "CompleteLayerUpload", {}).n("ECRClient", "CompleteLayerUploadCommand").f(void 0, void 0).ser(se_CompleteLayerUploadCommand).de(de_CompleteLayerUploadCommand).build() { +}; +__name(_CompleteLayerUploadCommand, "CompleteLayerUploadCommand"); +var CompleteLayerUploadCommand = _CompleteLayerUploadCommand; +// src/commands/CreatePullThroughCacheRuleCommand.ts -/***/ }), -/***/ 39904: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionManager = void 0; -const tslib_1 = __nccwpck_require__(4351); -const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); -const node_http2_connection_pool_1 = __nccwpck_require__(22893); -class NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const 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_1.default.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 node_http2_connection_pool_1.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) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); - } -} -exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; +var _CreatePullThroughCacheRuleCommand = class _CreatePullThroughCacheRuleCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "CreatePullThroughCacheRule", {}).n("ECRClient", "CreatePullThroughCacheRuleCommand").f(void 0, void 0).ser(se_CreatePullThroughCacheRuleCommand).de(de_CreatePullThroughCacheRuleCommand).build() { +}; +__name(_CreatePullThroughCacheRuleCommand, "CreatePullThroughCacheRuleCommand"); +var CreatePullThroughCacheRuleCommand = _CreatePullThroughCacheRuleCommand; +// src/commands/CreateRepositoryCommand.ts -/***/ }), -/***/ 22893: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionPool = void 0; -class NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions !== null && sessions !== void 0 ? 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(); - } - } - } - } -} -exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; +var _CreateRepositoryCommand = class _CreateRepositoryCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "CreateRepository", {}).n("ECRClient", "CreateRepositoryCommand").f(void 0, void 0).ser(se_CreateRepositoryCommand).de(de_CreateRepositoryCommand).build() { +}; +__name(_CreateRepositoryCommand, "CreateRepositoryCommand"); +var CreateRepositoryCommand = _CreateRepositoryCommand; +// src/commands/DeleteLifecyclePolicyCommand.ts -/***/ }), -/***/ 4349: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(54483); -const querystring_builder_1 = __nccwpck_require__(78512); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(36170); -const node_http2_connection_manager_1 = __nccwpck_require__(39904); -const write_request_body_1 = __nccwpck_require__(53122); -class NodeHttp2Handler { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); - 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 } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a, _b, _c; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal === null || abortSignal === void 0 ? void 0 : 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 = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - 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 = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } -} -exports.NodeHttp2Handler = NodeHttp2Handler; +var _DeleteLifecyclePolicyCommand = class _DeleteLifecyclePolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DeleteLifecyclePolicy", {}).n("ECRClient", "DeleteLifecyclePolicyCommand").f(void 0, void 0).ser(se_DeleteLifecyclePolicyCommand).de(de_DeleteLifecyclePolicyCommand).build() { +}; +__name(_DeleteLifecyclePolicyCommand, "DeleteLifecyclePolicyCommand"); +var DeleteLifecyclePolicyCommand = _DeleteLifecyclePolicyCommand; +// src/commands/DeletePullThroughCacheRuleCommand.ts -/***/ }), -/***/ 24246: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; - } - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - else { - clearTimeout(timeoutId); - } - }); +var _DeletePullThroughCacheRuleCommand = class _DeletePullThroughCacheRuleCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DeletePullThroughCacheRule", {}).n("ECRClient", "DeletePullThroughCacheRuleCommand").f(void 0, void 0).ser(se_DeletePullThroughCacheRuleCommand).de(de_DeletePullThroughCacheRuleCommand).build() { }; -exports.setConnectionTimeout = setConnectionTimeout; +__name(_DeletePullThroughCacheRuleCommand, "DeletePullThroughCacheRuleCommand"); +var DeletePullThroughCacheRuleCommand = _DeletePullThroughCacheRuleCommand; +// src/commands/DeleteRegistryPolicyCommand.ts -/***/ }), -/***/ 93651: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketKeepAlive = void 0; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; - } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); +var _DeleteRegistryPolicyCommand = class _DeleteRegistryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DeleteRegistryPolicy", {}).n("ECRClient", "DeleteRegistryPolicyCommand").f(void 0, void 0).ser(se_DeleteRegistryPolicyCommand).de(de_DeleteRegistryPolicyCommand).build() { }; -exports.setSocketKeepAlive = setSocketKeepAlive; +__name(_DeleteRegistryPolicyCommand, "DeleteRegistryPolicyCommand"); +var DeleteRegistryPolicyCommand = _DeleteRegistryPolicyCommand; +// src/commands/DeleteRepositoryCommand.ts -/***/ }), -/***/ 83099: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); +var _DeleteRepositoryCommand = class _DeleteRepositoryCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DeleteRepository", {}).n("ECRClient", "DeleteRepositoryCommand").f(void 0, void 0).ser(se_DeleteRepositoryCommand).de(de_DeleteRepositoryCommand).build() { }; -exports.setSocketTimeout = setSocketTimeout; +__name(_DeleteRepositoryCommand, "DeleteRepositoryCommand"); +var DeleteRepositoryCommand = _DeleteRepositoryCommand; +// src/commands/DeleteRepositoryPolicyCommand.ts -/***/ }), -/***/ 52170: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } -} -exports.Collector = Collector; +var _DeleteRepositoryPolicyCommand = class _DeleteRepositoryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DeleteRepositoryPolicy", {}).n("ECRClient", "DeleteRepositoryPolicyCommand").f(void 0, void 0).ser(se_DeleteRepositoryPolicyCommand).de(de_DeleteRepositoryPolicyCommand).build() { +}; +__name(_DeleteRepositoryPolicyCommand, "DeleteRepositoryPolicyCommand"); +var DeleteRepositoryPolicyCommand = _DeleteRepositoryPolicyCommand; +// src/commands/DescribeImageReplicationStatusCommand.ts -/***/ }), -/***/ 16006: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(52170); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.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); - }); -}); -exports.streamCollector = streamCollector; +var _DescribeImageReplicationStatusCommand = class _DescribeImageReplicationStatusCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DescribeImageReplicationStatus", {}).n("ECRClient", "DescribeImageReplicationStatusCommand").f(void 0, void 0).ser(se_DescribeImageReplicationStatusCommand).de(de_DescribeImageReplicationStatusCommand).build() { +}; +__name(_DescribeImageReplicationStatusCommand, "DescribeImageReplicationStatusCommand"); +var DescribeImageReplicationStatusCommand = _DescribeImageReplicationStatusCommand; +// src/commands/DescribeImageScanFindingsCommand.ts -/***/ }), -/***/ 53122: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -const MIN_WAIT_TIME = 1000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - var _a; - const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }), - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} +var _DescribeImageScanFindingsCommand = class _DescribeImageScanFindingsCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DescribeImageScanFindings", {}).n("ECRClient", "DescribeImageScanFindingsCommand").f(void 0, void 0).ser(se_DescribeImageScanFindingsCommand).de(de_DescribeImageScanFindingsCommand).build() { +}; +__name(_DescribeImageScanFindingsCommand, "DescribeImageScanFindingsCommand"); +var DescribeImageScanFindingsCommand = _DescribeImageScanFindingsCommand; +// src/commands/DescribeImagesCommand.ts -/***/ }), -/***/ 80856: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(83399); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 74313: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 53792: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; +var _DescribeImagesCommand = class _DescribeImagesCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DescribeImages", {}).n("ECRClient", "DescribeImagesCommand").f(void 0, void 0).ser(se_DescribeImagesCommand).de(de_DescribeImagesCommand).build() { }; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 6564: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(53792), exports); - - -/***/ }), - -/***/ 84691: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61458: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 79030: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 54483: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(6564), exports); -tslib_1.__exportStar(__nccwpck_require__(80856), exports); -tslib_1.__exportStar(__nccwpck_require__(74313), exports); -tslib_1.__exportStar(__nccwpck_require__(84691), exports); -tslib_1.__exportStar(__nccwpck_require__(61458), exports); -tslib_1.__exportStar(__nccwpck_require__(79030), exports); -tslib_1.__exportStar(__nccwpck_require__(57703), exports); -tslib_1.__exportStar(__nccwpck_require__(24021), exports); +__name(_DescribeImagesCommand, "DescribeImagesCommand"); +var DescribeImagesCommand = _DescribeImagesCommand; +// src/commands/DescribePullThroughCacheRulesCommand.ts -/***/ }), -/***/ 57703: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; +var _DescribePullThroughCacheRulesCommand = class _DescribePullThroughCacheRulesCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DescribePullThroughCacheRules", {}).n("ECRClient", "DescribePullThroughCacheRulesCommand").f(void 0, void 0).ser(se_DescribePullThroughCacheRulesCommand).de(de_DescribePullThroughCacheRulesCommand).build() { +}; +__name(_DescribePullThroughCacheRulesCommand, "DescribePullThroughCacheRulesCommand"); +var DescribePullThroughCacheRulesCommand = _DescribePullThroughCacheRulesCommand; +// src/commands/DescribeRegistryCommand.ts -/***/ }), -/***/ 24021: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var _DescribeRegistryCommand = class _DescribeRegistryCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DescribeRegistry", {}).n("ECRClient", "DescribeRegistryCommand").f(void 0, void 0).ser(se_DescribeRegistryCommand).de(de_DescribeRegistryCommand).build() { +}; +__name(_DescribeRegistryCommand, "DescribeRegistryCommand"); +var DescribeRegistryCommand = _DescribeRegistryCommand; +// src/commands/DescribeRepositoriesCommand.ts -/***/ }), -/***/ 78512: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(56236); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } - } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; +var _DescribeRepositoriesCommand = class _DescribeRepositoriesCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "DescribeRepositories", {}).n("ECRClient", "DescribeRepositoriesCommand").f(void 0, void 0).ser(se_DescribeRepositoriesCommand).de(de_DescribeRepositoriesCommand).build() { +}; +__name(_DescribeRepositoriesCommand, "DescribeRepositoriesCommand"); +var DescribeRepositoriesCommand = _DescribeRepositoriesCommand; +// src/commands/GetAuthorizationTokenCommand.ts -/***/ }), -/***/ 83500: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var _GetAuthorizationTokenCommand = class _GetAuthorizationTokenCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "GetAuthorizationToken", {}).n("ECRClient", "GetAuthorizationTokenCommand").f(void 0, void 0).ser(se_GetAuthorizationTokenCommand).de(de_GetAuthorizationTokenCommand).build() { +}; +__name(_GetAuthorizationTokenCommand, "GetAuthorizationTokenCommand"); +var GetAuthorizationTokenCommand = _GetAuthorizationTokenCommand; +// src/commands/GetDownloadUrlForLayerCommand.ts -/***/ }), -/***/ 24439: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); +var _GetDownloadUrlForLayerCommand = class _GetDownloadUrlForLayerCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "GetDownloadUrlForLayer", {}).n("ECRClient", "GetDownloadUrlForLayerCommand").f(void 0, void 0).ser(se_GetDownloadUrlForLayerCommand).de(de_GetDownloadUrlForLayerCommand).build() { +}; +__name(_GetDownloadUrlForLayerCommand, "GetDownloadUrlForLayerCommand"); +var GetDownloadUrlForLayerCommand = _GetDownloadUrlForLayerCommand; +// src/commands/GetLifecyclePolicyCommand.ts -/***/ }), -/***/ 91415: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var _GetLifecyclePolicyCommand = class _GetLifecyclePolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "GetLifecyclePolicy", {}).n("ECRClient", "GetLifecyclePolicyCommand").f(void 0, void 0).ser(se_GetLifecyclePolicyCommand).de(de_GetLifecyclePolicyCommand).build() { +}; +__name(_GetLifecyclePolicyCommand, "GetLifecyclePolicyCommand"); +var GetLifecyclePolicyCommand = _GetLifecyclePolicyCommand; +// src/commands/GetLifecyclePolicyPreviewCommand.ts -/***/ }), -/***/ 32089: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var _GetLifecyclePolicyPreviewCommand = class _GetLifecyclePolicyPreviewCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "GetLifecyclePolicyPreview", {}).n("ECRClient", "GetLifecyclePolicyPreviewCommand").f(void 0, void 0).ser(se_GetLifecyclePolicyPreviewCommand).de(de_GetLifecyclePolicyPreviewCommand).build() { +}; +__name(_GetLifecyclePolicyPreviewCommand, "GetLifecyclePolicyPreviewCommand"); +var GetLifecyclePolicyPreviewCommand = _GetLifecyclePolicyPreviewCommand; +// src/commands/GetRegistryPolicyCommand.ts -/***/ }), -/***/ 28518: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var _GetRegistryPolicyCommand = class _GetRegistryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "GetRegistryPolicy", {}).n("ECRClient", "GetRegistryPolicyCommand").f(void 0, void 0).ser(se_GetRegistryPolicyCommand).de(de_GetRegistryPolicyCommand).build() { +}; +__name(_GetRegistryPolicyCommand, "GetRegistryPolicyCommand"); +var GetRegistryPolicyCommand = _GetRegistryPolicyCommand; +// src/commands/GetRegistryScanningConfigurationCommand.ts -/***/ }), -/***/ 91859: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var _GetRegistryScanningConfigurationCommand = class _GetRegistryScanningConfigurationCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "GetRegistryScanningConfiguration", {}).n("ECRClient", "GetRegistryScanningConfigurationCommand").f(void 0, void 0).ser(se_GetRegistryScanningConfigurationCommand).de(de_GetRegistryScanningConfigurationCommand).build() { +}; +__name(_GetRegistryScanningConfigurationCommand, "GetRegistryScanningConfigurationCommand"); +var GetRegistryScanningConfigurationCommand = _GetRegistryScanningConfigurationCommand; +// src/commands/GetRepositoryPolicyCommand.ts -/***/ }), - -/***/ 36815: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 3549: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(36815), exports); -tslib_1.__exportStar(__nccwpck_require__(21211), exports); -tslib_1.__exportStar(__nccwpck_require__(11375), exports); - - -/***/ }), - -/***/ 21211: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 11375: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 53070: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 32673: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43011: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 38203: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 41929: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 69357: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 14856: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 1523: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(38203), exports); -tslib_1.__exportStar(__nccwpck_require__(41929), exports); -tslib_1.__exportStar(__nccwpck_require__(69357), exports); -tslib_1.__exportStar(__nccwpck_require__(22525), exports); -tslib_1.__exportStar(__nccwpck_require__(14856), exports); - - -/***/ }), - -/***/ 22525: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 24878: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20575: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 34702: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(20575); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 22226: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 14985: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(34702), exports); -tslib_1.__exportStar(__nccwpck_require__(22226), exports); -var checksum_1 = __nccwpck_require__(20575); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 99312: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 71090: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 54783: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 11131: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(71090), exports); -tslib_1.__exportStar(__nccwpck_require__(54783), exports); - - -/***/ }), - -/***/ 83399: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(83500), exports); -tslib_1.__exportStar(__nccwpck_require__(24439), exports); -tslib_1.__exportStar(__nccwpck_require__(91415), exports); -tslib_1.__exportStar(__nccwpck_require__(32089), exports); -tslib_1.__exportStar(__nccwpck_require__(28518), exports); -tslib_1.__exportStar(__nccwpck_require__(91859), exports); -tslib_1.__exportStar(__nccwpck_require__(3549), exports); -tslib_1.__exportStar(__nccwpck_require__(53070), exports); -tslib_1.__exportStar(__nccwpck_require__(32673), exports); -tslib_1.__exportStar(__nccwpck_require__(43011), exports); -tslib_1.__exportStar(__nccwpck_require__(1523), exports); -tslib_1.__exportStar(__nccwpck_require__(24878), exports); -tslib_1.__exportStar(__nccwpck_require__(14985), exports); -tslib_1.__exportStar(__nccwpck_require__(99312), exports); -tslib_1.__exportStar(__nccwpck_require__(11131), exports); -tslib_1.__exportStar(__nccwpck_require__(50499), exports); -tslib_1.__exportStar(__nccwpck_require__(55118), exports); -tslib_1.__exportStar(__nccwpck_require__(43862), exports); -tslib_1.__exportStar(__nccwpck_require__(28350), exports); -tslib_1.__exportStar(__nccwpck_require__(24610), exports); -tslib_1.__exportStar(__nccwpck_require__(3920), exports); -tslib_1.__exportStar(__nccwpck_require__(63818), exports); -tslib_1.__exportStar(__nccwpck_require__(30132), exports); -tslib_1.__exportStar(__nccwpck_require__(56137), exports); -tslib_1.__exportStar(__nccwpck_require__(21487), exports); -tslib_1.__exportStar(__nccwpck_require__(808), exports); -tslib_1.__exportStar(__nccwpck_require__(77261), exports); -tslib_1.__exportStar(__nccwpck_require__(61266), exports); -tslib_1.__exportStar(__nccwpck_require__(46210), exports); -tslib_1.__exportStar(__nccwpck_require__(32451), exports); -tslib_1.__exportStar(__nccwpck_require__(58183), exports); -tslib_1.__exportStar(__nccwpck_require__(492), exports); -tslib_1.__exportStar(__nccwpck_require__(53534), exports); -tslib_1.__exportStar(__nccwpck_require__(18413), exports); - - -/***/ }), - -/***/ 50499: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 55118: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 43862: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 28350: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 24610: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 3920: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 63818: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 30132: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 56137: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21487: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 808: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 77261: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61266: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 46210: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 32451: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 58183: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 492: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 53534: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 18413: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89770: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(79683); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; - - -/***/ }), - -/***/ 79683: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; - - -/***/ }), - -/***/ 56236: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(79683), exports); -tslib_1.__exportStar(__nccwpck_require__(89770), exports); - - -/***/ }), - -/***/ 59167: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ECR = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const BatchCheckLayerAvailabilityCommand_1 = __nccwpck_require__(63804); -const BatchDeleteImageCommand_1 = __nccwpck_require__(15511); -const BatchGetImageCommand_1 = __nccwpck_require__(78859); -const BatchGetRepositoryScanningConfigurationCommand_1 = __nccwpck_require__(79728); -const CompleteLayerUploadCommand_1 = __nccwpck_require__(49003); -const CreatePullThroughCacheRuleCommand_1 = __nccwpck_require__(71454); -const CreateRepositoryCommand_1 = __nccwpck_require__(5074); -const DeleteLifecyclePolicyCommand_1 = __nccwpck_require__(48981); -const DeletePullThroughCacheRuleCommand_1 = __nccwpck_require__(83793); -const DeleteRegistryPolicyCommand_1 = __nccwpck_require__(31424); -const DeleteRepositoryCommand_1 = __nccwpck_require__(88651); -const DeleteRepositoryPolicyCommand_1 = __nccwpck_require__(36828); -const DescribeImageReplicationStatusCommand_1 = __nccwpck_require__(39694); -const DescribeImageScanFindingsCommand_1 = __nccwpck_require__(72987); -const DescribeImagesCommand_1 = __nccwpck_require__(95353); -const DescribePullThroughCacheRulesCommand_1 = __nccwpck_require__(31484); -const DescribeRegistryCommand_1 = __nccwpck_require__(26166); -const DescribeRepositoriesCommand_1 = __nccwpck_require__(21200); -const GetAuthorizationTokenCommand_1 = __nccwpck_require__(35828); -const GetDownloadUrlForLayerCommand_1 = __nccwpck_require__(51401); -const GetLifecyclePolicyCommand_1 = __nccwpck_require__(48469); -const GetLifecyclePolicyPreviewCommand_1 = __nccwpck_require__(17006); -const GetRegistryPolicyCommand_1 = __nccwpck_require__(33685); -const GetRegistryScanningConfigurationCommand_1 = __nccwpck_require__(82741); -const GetRepositoryPolicyCommand_1 = __nccwpck_require__(46330); -const InitiateLayerUploadCommand_1 = __nccwpck_require__(6936); -const ListImagesCommand_1 = __nccwpck_require__(3854); -const ListTagsForResourceCommand_1 = __nccwpck_require__(97403); -const PutImageCommand_1 = __nccwpck_require__(66844); -const PutImageScanningConfigurationCommand_1 = __nccwpck_require__(87935); -const PutImageTagMutabilityCommand_1 = __nccwpck_require__(66495); -const PutLifecyclePolicyCommand_1 = __nccwpck_require__(33854); -const PutRegistryPolicyCommand_1 = __nccwpck_require__(97928); -const PutRegistryScanningConfigurationCommand_1 = __nccwpck_require__(29529); -const PutReplicationConfigurationCommand_1 = __nccwpck_require__(14030); -const SetRepositoryPolicyCommand_1 = __nccwpck_require__(78300); -const StartImageScanCommand_1 = __nccwpck_require__(47984); -const StartLifecyclePolicyPreviewCommand_1 = __nccwpck_require__(35905); -const TagResourceCommand_1 = __nccwpck_require__(82665); -const UntagResourceCommand_1 = __nccwpck_require__(37225); -const UploadLayerPartCommand_1 = __nccwpck_require__(55825); -const ECRClient_1 = __nccwpck_require__(83391); -const commands = { - BatchCheckLayerAvailabilityCommand: BatchCheckLayerAvailabilityCommand_1.BatchCheckLayerAvailabilityCommand, - BatchDeleteImageCommand: BatchDeleteImageCommand_1.BatchDeleteImageCommand, - BatchGetImageCommand: BatchGetImageCommand_1.BatchGetImageCommand, - BatchGetRepositoryScanningConfigurationCommand: BatchGetRepositoryScanningConfigurationCommand_1.BatchGetRepositoryScanningConfigurationCommand, - CompleteLayerUploadCommand: CompleteLayerUploadCommand_1.CompleteLayerUploadCommand, - CreatePullThroughCacheRuleCommand: CreatePullThroughCacheRuleCommand_1.CreatePullThroughCacheRuleCommand, - CreateRepositoryCommand: CreateRepositoryCommand_1.CreateRepositoryCommand, - DeleteLifecyclePolicyCommand: DeleteLifecyclePolicyCommand_1.DeleteLifecyclePolicyCommand, - DeletePullThroughCacheRuleCommand: DeletePullThroughCacheRuleCommand_1.DeletePullThroughCacheRuleCommand, - DeleteRegistryPolicyCommand: DeleteRegistryPolicyCommand_1.DeleteRegistryPolicyCommand, - DeleteRepositoryCommand: DeleteRepositoryCommand_1.DeleteRepositoryCommand, - DeleteRepositoryPolicyCommand: DeleteRepositoryPolicyCommand_1.DeleteRepositoryPolicyCommand, - DescribeImageReplicationStatusCommand: DescribeImageReplicationStatusCommand_1.DescribeImageReplicationStatusCommand, - DescribeImagesCommand: DescribeImagesCommand_1.DescribeImagesCommand, - DescribeImageScanFindingsCommand: DescribeImageScanFindingsCommand_1.DescribeImageScanFindingsCommand, - DescribePullThroughCacheRulesCommand: DescribePullThroughCacheRulesCommand_1.DescribePullThroughCacheRulesCommand, - DescribeRegistryCommand: DescribeRegistryCommand_1.DescribeRegistryCommand, - DescribeRepositoriesCommand: DescribeRepositoriesCommand_1.DescribeRepositoriesCommand, - GetAuthorizationTokenCommand: GetAuthorizationTokenCommand_1.GetAuthorizationTokenCommand, - GetDownloadUrlForLayerCommand: GetDownloadUrlForLayerCommand_1.GetDownloadUrlForLayerCommand, - GetLifecyclePolicyCommand: GetLifecyclePolicyCommand_1.GetLifecyclePolicyCommand, - GetLifecyclePolicyPreviewCommand: GetLifecyclePolicyPreviewCommand_1.GetLifecyclePolicyPreviewCommand, - GetRegistryPolicyCommand: GetRegistryPolicyCommand_1.GetRegistryPolicyCommand, - GetRegistryScanningConfigurationCommand: GetRegistryScanningConfigurationCommand_1.GetRegistryScanningConfigurationCommand, - GetRepositoryPolicyCommand: GetRepositoryPolicyCommand_1.GetRepositoryPolicyCommand, - InitiateLayerUploadCommand: InitiateLayerUploadCommand_1.InitiateLayerUploadCommand, - ListImagesCommand: ListImagesCommand_1.ListImagesCommand, - ListTagsForResourceCommand: ListTagsForResourceCommand_1.ListTagsForResourceCommand, - PutImageCommand: PutImageCommand_1.PutImageCommand, - PutImageScanningConfigurationCommand: PutImageScanningConfigurationCommand_1.PutImageScanningConfigurationCommand, - PutImageTagMutabilityCommand: PutImageTagMutabilityCommand_1.PutImageTagMutabilityCommand, - PutLifecyclePolicyCommand: PutLifecyclePolicyCommand_1.PutLifecyclePolicyCommand, - PutRegistryPolicyCommand: PutRegistryPolicyCommand_1.PutRegistryPolicyCommand, - PutRegistryScanningConfigurationCommand: PutRegistryScanningConfigurationCommand_1.PutRegistryScanningConfigurationCommand, - PutReplicationConfigurationCommand: PutReplicationConfigurationCommand_1.PutReplicationConfigurationCommand, - SetRepositoryPolicyCommand: SetRepositoryPolicyCommand_1.SetRepositoryPolicyCommand, - StartImageScanCommand: StartImageScanCommand_1.StartImageScanCommand, - StartLifecyclePolicyPreviewCommand: StartLifecyclePolicyPreviewCommand_1.StartLifecyclePolicyPreviewCommand, - TagResourceCommand: TagResourceCommand_1.TagResourceCommand, - UntagResourceCommand: UntagResourceCommand_1.UntagResourceCommand, - UploadLayerPartCommand: UploadLayerPartCommand_1.UploadLayerPartCommand, -}; -class ECR extends ECRClient_1.ECRClient { -} -exports.ECR = ECR; -(0, smithy_client_1.createAggregatedClient)(commands, ECR); - - -/***/ }), - -/***/ 83391: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ECRClient = exports.__Client = void 0; -const middleware_host_header_1 = __nccwpck_require__(22545); -const middleware_logger_1 = __nccwpck_require__(20014); -const middleware_recursion_detection_1 = __nccwpck_require__(85525); -const middleware_signing_1 = __nccwpck_require__(14935); -const middleware_user_agent_1 = __nccwpck_require__(64688); -const config_resolver_1 = __nccwpck_require__(53098); -const middleware_content_length_1 = __nccwpck_require__(82800); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_retry_1 = __nccwpck_require__(96039); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } })); -const EndpointParameters_1 = __nccwpck_require__(49729); -const runtimeConfig_1 = __nccwpck_require__(869); -const runtimeExtensions_1 = __nccwpck_require__(86506); -class ECRClient extends smithy_client_1.Client { - constructor(...[configuration]) { - const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); - const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); - const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); - const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); - const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); - const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_signing_1.resolveAwsAuthConfig)(_config_5); - const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6); - const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []); - super(_config_8); - this.config = _config_8; - this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); - this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); - this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); - this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); - this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); - } - destroy() { - super.destroy(); - } -} -exports.ECRClient = ECRClient; - - -/***/ }), - -/***/ 63804: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchCheckLayerAvailabilityCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class BatchCheckLayerAvailabilityCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, BatchCheckLayerAvailabilityCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "BatchCheckLayerAvailabilityCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "BatchCheckLayerAvailability", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_BatchCheckLayerAvailabilityCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_BatchCheckLayerAvailabilityCommand)(output, context); - } -} -exports.BatchCheckLayerAvailabilityCommand = BatchCheckLayerAvailabilityCommand; - - -/***/ }), - -/***/ 15511: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchDeleteImageCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class BatchDeleteImageCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, BatchDeleteImageCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "BatchDeleteImageCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "BatchDeleteImage", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_BatchDeleteImageCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_BatchDeleteImageCommand)(output, context); - } -} -exports.BatchDeleteImageCommand = BatchDeleteImageCommand; - - -/***/ }), - -/***/ 78859: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchGetImageCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class BatchGetImageCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, BatchGetImageCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "BatchGetImageCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "BatchGetImage", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_BatchGetImageCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_BatchGetImageCommand)(output, context); - } -} -exports.BatchGetImageCommand = BatchGetImageCommand; - - -/***/ }), - -/***/ 79728: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchGetRepositoryScanningConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class BatchGetRepositoryScanningConfigurationCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, BatchGetRepositoryScanningConfigurationCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "BatchGetRepositoryScanningConfigurationCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "BatchGetRepositoryScanningConfiguration", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_BatchGetRepositoryScanningConfigurationCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_BatchGetRepositoryScanningConfigurationCommand)(output, context); - } -} -exports.BatchGetRepositoryScanningConfigurationCommand = BatchGetRepositoryScanningConfigurationCommand; - - -/***/ }), - -/***/ 49003: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompleteLayerUploadCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class CompleteLayerUploadCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CompleteLayerUploadCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "CompleteLayerUploadCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "CompleteLayerUpload", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_CompleteLayerUploadCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_CompleteLayerUploadCommand)(output, context); - } -} -exports.CompleteLayerUploadCommand = CompleteLayerUploadCommand; - - -/***/ }), - -/***/ 71454: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CreatePullThroughCacheRuleCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class CreatePullThroughCacheRuleCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreatePullThroughCacheRuleCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "CreatePullThroughCacheRuleCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "CreatePullThroughCacheRule", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_CreatePullThroughCacheRuleCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_CreatePullThroughCacheRuleCommand)(output, context); - } -} -exports.CreatePullThroughCacheRuleCommand = CreatePullThroughCacheRuleCommand; - - -/***/ }), - -/***/ 5074: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CreateRepositoryCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class CreateRepositoryCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreateRepositoryCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "CreateRepositoryCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "CreateRepository", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_CreateRepositoryCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_CreateRepositoryCommand)(output, context); - } -} -exports.CreateRepositoryCommand = CreateRepositoryCommand; - - -/***/ }), - -/***/ 48981: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeleteLifecyclePolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DeleteLifecyclePolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteLifecyclePolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DeleteLifecyclePolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DeleteLifecyclePolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DeleteLifecyclePolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DeleteLifecyclePolicyCommand)(output, context); - } -} -exports.DeleteLifecyclePolicyCommand = DeleteLifecyclePolicyCommand; - - -/***/ }), - -/***/ 83793: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeletePullThroughCacheRuleCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DeletePullThroughCacheRuleCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeletePullThroughCacheRuleCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DeletePullThroughCacheRuleCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DeletePullThroughCacheRule", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DeletePullThroughCacheRuleCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DeletePullThroughCacheRuleCommand)(output, context); - } -} -exports.DeletePullThroughCacheRuleCommand = DeletePullThroughCacheRuleCommand; - - -/***/ }), - -/***/ 31424: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeleteRegistryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DeleteRegistryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteRegistryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DeleteRegistryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DeleteRegistryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DeleteRegistryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DeleteRegistryPolicyCommand)(output, context); - } -} -exports.DeleteRegistryPolicyCommand = DeleteRegistryPolicyCommand; - - -/***/ }), - -/***/ 88651: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeleteRepositoryCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DeleteRepositoryCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteRepositoryCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DeleteRepositoryCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DeleteRepository", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DeleteRepositoryCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DeleteRepositoryCommand)(output, context); - } -} -exports.DeleteRepositoryCommand = DeleteRepositoryCommand; - - -/***/ }), - -/***/ 36828: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeleteRepositoryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DeleteRepositoryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteRepositoryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DeleteRepositoryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DeleteRepositoryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DeleteRepositoryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DeleteRepositoryPolicyCommand)(output, context); - } -} -exports.DeleteRepositoryPolicyCommand = DeleteRepositoryPolicyCommand; - - -/***/ }), - -/***/ 39694: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeImageReplicationStatusCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DescribeImageReplicationStatusCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeImageReplicationStatusCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DescribeImageReplicationStatusCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DescribeImageReplicationStatus", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeImageReplicationStatusCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeImageReplicationStatusCommand)(output, context); - } -} -exports.DescribeImageReplicationStatusCommand = DescribeImageReplicationStatusCommand; - - -/***/ }), - -/***/ 72987: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeImageScanFindingsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DescribeImageScanFindingsCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeImageScanFindingsCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DescribeImageScanFindingsCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DescribeImageScanFindings", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeImageScanFindingsCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeImageScanFindingsCommand)(output, context); - } -} -exports.DescribeImageScanFindingsCommand = DescribeImageScanFindingsCommand; - - -/***/ }), - -/***/ 95353: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeImagesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DescribeImagesCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeImagesCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DescribeImagesCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DescribeImages", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeImagesCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeImagesCommand)(output, context); - } -} -exports.DescribeImagesCommand = DescribeImagesCommand; - - -/***/ }), - -/***/ 31484: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribePullThroughCacheRulesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DescribePullThroughCacheRulesCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribePullThroughCacheRulesCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DescribePullThroughCacheRulesCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DescribePullThroughCacheRules", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribePullThroughCacheRulesCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribePullThroughCacheRulesCommand)(output, context); - } -} -exports.DescribePullThroughCacheRulesCommand = DescribePullThroughCacheRulesCommand; - - -/***/ }), - -/***/ 26166: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeRegistryCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DescribeRegistryCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeRegistryCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DescribeRegistryCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DescribeRegistry", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeRegistryCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeRegistryCommand)(output, context); - } -} -exports.DescribeRegistryCommand = DescribeRegistryCommand; - - -/***/ }), - -/***/ 21200: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DescribeRepositoriesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class DescribeRepositoriesCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeRepositoriesCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "DescribeRepositoriesCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "DescribeRepositories", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_DescribeRepositoriesCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_DescribeRepositoriesCommand)(output, context); - } -} -exports.DescribeRepositoriesCommand = DescribeRepositoriesCommand; - - -/***/ }), - -/***/ 35828: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetAuthorizationTokenCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class GetAuthorizationTokenCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetAuthorizationTokenCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "GetAuthorizationTokenCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "GetAuthorizationToken", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetAuthorizationTokenCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetAuthorizationTokenCommand)(output, context); - } -} -exports.GetAuthorizationTokenCommand = GetAuthorizationTokenCommand; - - -/***/ }), - -/***/ 51401: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetDownloadUrlForLayerCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class GetDownloadUrlForLayerCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetDownloadUrlForLayerCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "GetDownloadUrlForLayerCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "GetDownloadUrlForLayer", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetDownloadUrlForLayerCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetDownloadUrlForLayerCommand)(output, context); - } -} -exports.GetDownloadUrlForLayerCommand = GetDownloadUrlForLayerCommand; - - -/***/ }), - -/***/ 48469: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetLifecyclePolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class GetLifecyclePolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetLifecyclePolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "GetLifecyclePolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "GetLifecyclePolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetLifecyclePolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetLifecyclePolicyCommand)(output, context); - } -} -exports.GetLifecyclePolicyCommand = GetLifecyclePolicyCommand; - - -/***/ }), - -/***/ 17006: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetLifecyclePolicyPreviewCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class GetLifecyclePolicyPreviewCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetLifecyclePolicyPreviewCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "GetLifecyclePolicyPreviewCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "GetLifecyclePolicyPreview", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetLifecyclePolicyPreviewCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetLifecyclePolicyPreviewCommand)(output, context); - } -} -exports.GetLifecyclePolicyPreviewCommand = GetLifecyclePolicyPreviewCommand; - - -/***/ }), - -/***/ 33685: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetRegistryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class GetRegistryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRegistryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "GetRegistryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "GetRegistryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetRegistryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetRegistryPolicyCommand)(output, context); - } -} -exports.GetRegistryPolicyCommand = GetRegistryPolicyCommand; - - -/***/ }), - -/***/ 82741: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetRegistryScanningConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class GetRegistryScanningConfigurationCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRegistryScanningConfigurationCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "GetRegistryScanningConfigurationCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "GetRegistryScanningConfiguration", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetRegistryScanningConfigurationCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetRegistryScanningConfigurationCommand)(output, context); - } -} -exports.GetRegistryScanningConfigurationCommand = GetRegistryScanningConfigurationCommand; - - -/***/ }), - -/***/ 46330: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetRepositoryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class GetRepositoryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRepositoryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "GetRepositoryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "GetRepositoryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_GetRepositoryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_GetRepositoryPolicyCommand)(output, context); - } -} -exports.GetRepositoryPolicyCommand = GetRepositoryPolicyCommand; - - -/***/ }), - -/***/ 6936: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InitiateLayerUploadCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class InitiateLayerUploadCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, InitiateLayerUploadCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "InitiateLayerUploadCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "InitiateLayerUpload", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_InitiateLayerUploadCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_InitiateLayerUploadCommand)(output, context); - } -} -exports.InitiateLayerUploadCommand = InitiateLayerUploadCommand; - - -/***/ }), - -/***/ 3854: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ListImagesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class ListImagesCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListImagesCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "ListImagesCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "ListImages", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_ListImagesCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_ListImagesCommand)(output, context); - } -} -exports.ListImagesCommand = ListImagesCommand; - - -/***/ }), - -/***/ 97403: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ListTagsForResourceCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class ListTagsForResourceCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "ListTagsForResourceCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "ListTagsForResource", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_ListTagsForResourceCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_ListTagsForResourceCommand)(output, context); - } -} -exports.ListTagsForResourceCommand = ListTagsForResourceCommand; - - -/***/ }), - -/***/ 66844: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutImageCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class PutImageCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutImageCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "PutImageCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "PutImage", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutImageCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutImageCommand)(output, context); - } -} -exports.PutImageCommand = PutImageCommand; - - -/***/ }), - -/***/ 87935: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutImageScanningConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class PutImageScanningConfigurationCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutImageScanningConfigurationCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "PutImageScanningConfigurationCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "PutImageScanningConfiguration", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutImageScanningConfigurationCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutImageScanningConfigurationCommand)(output, context); - } -} -exports.PutImageScanningConfigurationCommand = PutImageScanningConfigurationCommand; - - -/***/ }), - -/***/ 66495: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutImageTagMutabilityCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class PutImageTagMutabilityCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutImageTagMutabilityCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "PutImageTagMutabilityCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "PutImageTagMutability", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutImageTagMutabilityCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutImageTagMutabilityCommand)(output, context); - } -} -exports.PutImageTagMutabilityCommand = PutImageTagMutabilityCommand; - - -/***/ }), - -/***/ 33854: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutLifecyclePolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class PutLifecyclePolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutLifecyclePolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "PutLifecyclePolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "PutLifecyclePolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutLifecyclePolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutLifecyclePolicyCommand)(output, context); - } -} -exports.PutLifecyclePolicyCommand = PutLifecyclePolicyCommand; - - -/***/ }), - -/***/ 97928: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutRegistryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class PutRegistryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutRegistryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "PutRegistryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "PutRegistryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutRegistryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutRegistryPolicyCommand)(output, context); - } -} -exports.PutRegistryPolicyCommand = PutRegistryPolicyCommand; - - -/***/ }), - -/***/ 29529: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutRegistryScanningConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class PutRegistryScanningConfigurationCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutRegistryScanningConfigurationCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "PutRegistryScanningConfigurationCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "PutRegistryScanningConfiguration", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutRegistryScanningConfigurationCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutRegistryScanningConfigurationCommand)(output, context); - } -} -exports.PutRegistryScanningConfigurationCommand = PutRegistryScanningConfigurationCommand; - - -/***/ }), - -/***/ 14030: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PutReplicationConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class PutReplicationConfigurationCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutReplicationConfigurationCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "PutReplicationConfigurationCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "PutReplicationConfiguration", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_PutReplicationConfigurationCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_PutReplicationConfigurationCommand)(output, context); - } -} -exports.PutReplicationConfigurationCommand = PutReplicationConfigurationCommand; - - -/***/ }), - -/***/ 78300: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SetRepositoryPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class SetRepositoryPolicyCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, SetRepositoryPolicyCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "SetRepositoryPolicyCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "SetRepositoryPolicy", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_SetRepositoryPolicyCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_SetRepositoryPolicyCommand)(output, context); - } -} -exports.SetRepositoryPolicyCommand = SetRepositoryPolicyCommand; - - -/***/ }), - -/***/ 47984: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StartImageScanCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class StartImageScanCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, StartImageScanCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "StartImageScanCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "StartImageScan", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_StartImageScanCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_StartImageScanCommand)(output, context); - } -} -exports.StartImageScanCommand = StartImageScanCommand; - - -/***/ }), - -/***/ 35905: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StartLifecyclePolicyPreviewCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class StartLifecyclePolicyPreviewCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, StartLifecyclePolicyPreviewCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "StartLifecyclePolicyPreviewCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "StartLifecyclePolicyPreview", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_StartLifecyclePolicyPreviewCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_StartLifecyclePolicyPreviewCommand)(output, context); - } -} -exports.StartLifecyclePolicyPreviewCommand = StartLifecyclePolicyPreviewCommand; - - -/***/ }), - -/***/ 82665: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TagResourceCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class TagResourceCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, TagResourceCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "TagResourceCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "TagResource", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_TagResourceCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_TagResourceCommand)(output, context); - } -} -exports.TagResourceCommand = TagResourceCommand; - - -/***/ }), - -/***/ 37225: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UntagResourceCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class UntagResourceCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UntagResourceCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "UntagResourceCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "UntagResource", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_UntagResourceCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_UntagResourceCommand)(output, context); - } -} -exports.UntagResourceCommand = UntagResourceCommand; - - -/***/ }), - -/***/ 55825: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UploadLayerPartCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(5417); -const Aws_json1_1_1 = __nccwpck_require__(56704); -class UploadLayerPartCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UploadLayerPartCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "ECRClient"; - const commandName = "UploadLayerPartCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AmazonEC2ContainerRegistry_V20150921", - operation: "UploadLayerPart", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_json1_1_1.se_UploadLayerPartCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_json1_1_1.de_UploadLayerPartCommand)(output, context); - } -} -exports.UploadLayerPartCommand = UploadLayerPartCommand; - - -/***/ }), - -/***/ 67407: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(63804), exports); -tslib_1.__exportStar(__nccwpck_require__(15511), exports); -tslib_1.__exportStar(__nccwpck_require__(78859), exports); -tslib_1.__exportStar(__nccwpck_require__(79728), exports); -tslib_1.__exportStar(__nccwpck_require__(49003), exports); -tslib_1.__exportStar(__nccwpck_require__(71454), exports); -tslib_1.__exportStar(__nccwpck_require__(5074), exports); -tslib_1.__exportStar(__nccwpck_require__(48981), exports); -tslib_1.__exportStar(__nccwpck_require__(83793), exports); -tslib_1.__exportStar(__nccwpck_require__(31424), exports); -tslib_1.__exportStar(__nccwpck_require__(88651), exports); -tslib_1.__exportStar(__nccwpck_require__(36828), exports); -tslib_1.__exportStar(__nccwpck_require__(39694), exports); -tslib_1.__exportStar(__nccwpck_require__(72987), exports); -tslib_1.__exportStar(__nccwpck_require__(95353), exports); -tslib_1.__exportStar(__nccwpck_require__(31484), exports); -tslib_1.__exportStar(__nccwpck_require__(26166), exports); -tslib_1.__exportStar(__nccwpck_require__(21200), exports); -tslib_1.__exportStar(__nccwpck_require__(35828), exports); -tslib_1.__exportStar(__nccwpck_require__(51401), exports); -tslib_1.__exportStar(__nccwpck_require__(48469), exports); -tslib_1.__exportStar(__nccwpck_require__(17006), exports); -tslib_1.__exportStar(__nccwpck_require__(33685), exports); -tslib_1.__exportStar(__nccwpck_require__(82741), exports); -tslib_1.__exportStar(__nccwpck_require__(46330), exports); -tslib_1.__exportStar(__nccwpck_require__(6936), exports); -tslib_1.__exportStar(__nccwpck_require__(3854), exports); -tslib_1.__exportStar(__nccwpck_require__(97403), exports); -tslib_1.__exportStar(__nccwpck_require__(66844), exports); -tslib_1.__exportStar(__nccwpck_require__(87935), exports); -tslib_1.__exportStar(__nccwpck_require__(66495), exports); -tslib_1.__exportStar(__nccwpck_require__(33854), exports); -tslib_1.__exportStar(__nccwpck_require__(97928), exports); -tslib_1.__exportStar(__nccwpck_require__(29529), exports); -tslib_1.__exportStar(__nccwpck_require__(14030), exports); -tslib_1.__exportStar(__nccwpck_require__(78300), exports); -tslib_1.__exportStar(__nccwpck_require__(47984), exports); -tslib_1.__exportStar(__nccwpck_require__(35905), exports); -tslib_1.__exportStar(__nccwpck_require__(82665), exports); -tslib_1.__exportStar(__nccwpck_require__(37225), exports); -tslib_1.__exportStar(__nccwpck_require__(55825), exports); - - -/***/ }), - -/***/ 49729: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveClientEndpointParameters = void 0; -const resolveClientEndpointParameters = (options) => { - return { - ...options, - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "ecr", - }; -}; -exports.resolveClientEndpointParameters = resolveClientEndpointParameters; - - -/***/ }), - -/***/ 61610: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultEndpointResolver = void 0; -const util_endpoints_1 = __nccwpck_require__(13350); -const ruleset_1 = __nccwpck_require__(64053); -const defaultEndpointResolver = (endpointParams, context = {}) => { - return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams: endpointParams, - logger: context.logger, - }); -}; -exports.defaultEndpointResolver = defaultEndpointResolver; - - -/***/ }), - -/***/ 64053: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ruleSet = void 0; -const t = "required", u = "fn", v = "argv", w = "ref"; -const a = "isSet", b = "tree", c = "error", d = "endpoint", e = "PartitionResult", f = "stringEquals", g = { [t]: false, "type": "String" }, h = { [t]: true, "default": false, "type": "Boolean" }, i = { [w]: "Endpoint" }, j = { [u]: "booleanEquals", [v]: [{ [w]: "UseFIPS" }, true] }, k = { [u]: "booleanEquals", [v]: [{ [w]: "UseDualStack" }, true] }, l = {}, m = { [u]: "booleanEquals", [v]: [true, { [u]: "getAttr", [v]: [{ [w]: e }, "supportsFIPS"] }] }, n = { [u]: "booleanEquals", [v]: [true, { [u]: "getAttr", [v]: [{ [w]: e }, "supportsDualStack"] }] }, o = { [u]: "getAttr", [v]: [{ [w]: e }, "name"] }, p = { "url": "https://ecr-fips.{Region}.amazonaws.com", "properties": {}, "headers": {} }, q = [j], r = [k], s = [{ [w]: "Region" }]; -const _data = { version: "1.0", parameters: { Region: g, UseDualStack: h, UseFIPS: h, Endpoint: g }, rules: [{ conditions: [{ [u]: a, [v]: [i] }], type: b, rules: [{ conditions: q, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { conditions: r, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: i, properties: l, headers: l }, type: d }] }, { conditions: [{ [u]: a, [v]: s }], type: b, rules: [{ conditions: [{ [u]: "aws.partition", [v]: s, assign: e }], type: b, rules: [{ conditions: [j, k], type: b, rules: [{ conditions: [m, n], type: b, rules: [{ endpoint: { url: "https://api.ecr-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: q, type: b, rules: [{ conditions: [m], type: b, rules: [{ conditions: [{ [u]: f, [v]: ["aws", o] }], endpoint: p, type: d }, { conditions: [{ [u]: f, [v]: ["aws-us-gov", o] }], endpoint: p, type: d }, { endpoint: { url: "https://api.ecr-fips.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: r, type: b, rules: [{ conditions: [n], type: b, rules: [{ endpoint: { url: "https://api.ecr.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://api.ecr.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: d }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] }; -exports.ruleSet = _data; - - -/***/ }), - -/***/ 8923: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ECRServiceException = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(83391), exports); -tslib_1.__exportStar(__nccwpck_require__(59167), exports); -tslib_1.__exportStar(__nccwpck_require__(67407), exports); -tslib_1.__exportStar(__nccwpck_require__(35356), exports); -tslib_1.__exportStar(__nccwpck_require__(28406), exports); -tslib_1.__exportStar(__nccwpck_require__(57451), exports); -var ECRServiceException_1 = __nccwpck_require__(11610); -Object.defineProperty(exports, "ECRServiceException", ({ enumerable: true, get: function () { return ECRServiceException_1.ECRServiceException; } })); - - -/***/ }), - -/***/ 11610: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ECRServiceException = exports.__ServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); -class ECRServiceException extends smithy_client_1.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, ECRServiceException.prototype); - } -} -exports.ECRServiceException = ECRServiceException; - - -/***/ }), - -/***/ 57451: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(79088), exports); - - -/***/ }), - -/***/ 79088: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InvalidLayerPartException = exports.LifecyclePolicyPreviewInProgressException = exports.UnsupportedImageTypeException = exports.ReferencedImagesNotFoundException = exports.ImageTagAlreadyExistsException = exports.ImageDigestDoesNotMatchException = exports.ImageAlreadyExistsException = exports.ScanType = exports.LifecyclePolicyPreviewNotFoundException = exports.LifecyclePolicyPreviewStatus = exports.ImageActionType = exports.LayersNotFoundException = exports.LayerInaccessibleException = exports.RepositoryFilterType = exports.ScanNotFoundException = exports.ScanStatus = exports.FindingSeverity = exports.TagStatus = exports.ImageNotFoundException = exports.ReplicationStatus = exports.RepositoryPolicyNotFoundException = exports.RepositoryNotEmptyException = exports.RegistryPolicyNotFoundException = exports.PullThroughCacheRuleNotFoundException = exports.LifecyclePolicyNotFoundException = exports.TooManyTagsException = exports.RepositoryAlreadyExistsException = exports.InvalidTagParameterException = exports.ImageTagMutability = exports.EncryptionType = exports.UnsupportedUpstreamRegistryException = exports.PullThroughCacheRuleAlreadyExistsException = exports.LimitExceededException = exports.UploadNotFoundException = exports.LayerPartTooSmallException = exports.LayerAlreadyExistsException = exports.KmsException = exports.InvalidLayerException = exports.EmptyUploadException = exports.ValidationException = exports.ScanFrequency = exports.ScanningRepositoryFilterType = exports.ScanningConfigurationFailureCode = exports.ImageFailureCode = exports.ServerException = exports.RepositoryNotFoundException = exports.InvalidParameterException = exports.LayerAvailability = exports.LayerFailureCode = void 0; -const ECRServiceException_1 = __nccwpck_require__(11610); -exports.LayerFailureCode = { - InvalidLayerDigest: "InvalidLayerDigest", - MissingLayerDigest: "MissingLayerDigest", -}; -exports.LayerAvailability = { - AVAILABLE: "AVAILABLE", - UNAVAILABLE: "UNAVAILABLE", -}; -class InvalidParameterException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "InvalidParameterException", - $fault: "client", - ...opts, - }); - this.name = "InvalidParameterException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidParameterException.prototype); - } -} -exports.InvalidParameterException = InvalidParameterException; -class RepositoryNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "RepositoryNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "RepositoryNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryNotFoundException.prototype); - } -} -exports.RepositoryNotFoundException = RepositoryNotFoundException; -class ServerException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "ServerException", - $fault: "server", - ...opts, - }); - this.name = "ServerException"; - this.$fault = "server"; - Object.setPrototypeOf(this, ServerException.prototype); - } -} -exports.ServerException = ServerException; -exports.ImageFailureCode = { - ImageNotFound: "ImageNotFound", - ImageReferencedByManifestList: "ImageReferencedByManifestList", - ImageTagDoesNotMatchDigest: "ImageTagDoesNotMatchDigest", - InvalidImageDigest: "InvalidImageDigest", - InvalidImageTag: "InvalidImageTag", - KmsError: "KmsError", - MissingDigestAndTag: "MissingDigestAndTag", -}; -exports.ScanningConfigurationFailureCode = { - REPOSITORY_NOT_FOUND: "REPOSITORY_NOT_FOUND", -}; -exports.ScanningRepositoryFilterType = { - WILDCARD: "WILDCARD", -}; -exports.ScanFrequency = { - CONTINUOUS_SCAN: "CONTINUOUS_SCAN", - MANUAL: "MANUAL", - SCAN_ON_PUSH: "SCAN_ON_PUSH", -}; -class ValidationException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "ValidationException", - $fault: "client", - ...opts, - }); - this.name = "ValidationException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ValidationException.prototype); - } -} -exports.ValidationException = ValidationException; -class EmptyUploadException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "EmptyUploadException", - $fault: "client", - ...opts, - }); - this.name = "EmptyUploadException"; - this.$fault = "client"; - Object.setPrototypeOf(this, EmptyUploadException.prototype); - } -} -exports.EmptyUploadException = EmptyUploadException; -class InvalidLayerException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "InvalidLayerException", - $fault: "client", - ...opts, - }); - this.name = "InvalidLayerException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidLayerException.prototype); - } -} -exports.InvalidLayerException = InvalidLayerException; -class KmsException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "KmsException", - $fault: "client", - ...opts, - }); - this.name = "KmsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, KmsException.prototype); - this.kmsError = opts.kmsError; - } -} -exports.KmsException = KmsException; -class LayerAlreadyExistsException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "LayerAlreadyExistsException", - $fault: "client", - ...opts, - }); - this.name = "LayerAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LayerAlreadyExistsException.prototype); - } -} -exports.LayerAlreadyExistsException = LayerAlreadyExistsException; -class LayerPartTooSmallException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "LayerPartTooSmallException", - $fault: "client", - ...opts, - }); - this.name = "LayerPartTooSmallException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LayerPartTooSmallException.prototype); - } -} -exports.LayerPartTooSmallException = LayerPartTooSmallException; -class UploadNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "UploadNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "UploadNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, UploadNotFoundException.prototype); - } -} -exports.UploadNotFoundException = UploadNotFoundException; -class LimitExceededException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "LimitExceededException", - $fault: "client", - ...opts, - }); - this.name = "LimitExceededException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LimitExceededException.prototype); - } -} -exports.LimitExceededException = LimitExceededException; -class PullThroughCacheRuleAlreadyExistsException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "PullThroughCacheRuleAlreadyExistsException", - $fault: "client", - ...opts, - }); - this.name = "PullThroughCacheRuleAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, PullThroughCacheRuleAlreadyExistsException.prototype); - } -} -exports.PullThroughCacheRuleAlreadyExistsException = PullThroughCacheRuleAlreadyExistsException; -class UnsupportedUpstreamRegistryException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "UnsupportedUpstreamRegistryException", - $fault: "client", - ...opts, - }); - this.name = "UnsupportedUpstreamRegistryException"; - this.$fault = "client"; - Object.setPrototypeOf(this, UnsupportedUpstreamRegistryException.prototype); - } -} -exports.UnsupportedUpstreamRegistryException = UnsupportedUpstreamRegistryException; -exports.EncryptionType = { - AES256: "AES256", - KMS: "KMS", -}; -exports.ImageTagMutability = { - IMMUTABLE: "IMMUTABLE", - MUTABLE: "MUTABLE", -}; -class InvalidTagParameterException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "InvalidTagParameterException", - $fault: "client", - ...opts, - }); - this.name = "InvalidTagParameterException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidTagParameterException.prototype); - } -} -exports.InvalidTagParameterException = InvalidTagParameterException; -class RepositoryAlreadyExistsException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "RepositoryAlreadyExistsException", - $fault: "client", - ...opts, - }); - this.name = "RepositoryAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryAlreadyExistsException.prototype); - } -} -exports.RepositoryAlreadyExistsException = RepositoryAlreadyExistsException; -class TooManyTagsException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "TooManyTagsException", - $fault: "client", - ...opts, - }); - this.name = "TooManyTagsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, TooManyTagsException.prototype); - } -} -exports.TooManyTagsException = TooManyTagsException; -class LifecyclePolicyNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "LifecyclePolicyNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "LifecyclePolicyNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LifecyclePolicyNotFoundException.prototype); - } -} -exports.LifecyclePolicyNotFoundException = LifecyclePolicyNotFoundException; -class PullThroughCacheRuleNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "PullThroughCacheRuleNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "PullThroughCacheRuleNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, PullThroughCacheRuleNotFoundException.prototype); - } -} -exports.PullThroughCacheRuleNotFoundException = PullThroughCacheRuleNotFoundException; -class RegistryPolicyNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "RegistryPolicyNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "RegistryPolicyNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RegistryPolicyNotFoundException.prototype); - } -} -exports.RegistryPolicyNotFoundException = RegistryPolicyNotFoundException; -class RepositoryNotEmptyException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "RepositoryNotEmptyException", - $fault: "client", - ...opts, - }); - this.name = "RepositoryNotEmptyException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryNotEmptyException.prototype); - } -} -exports.RepositoryNotEmptyException = RepositoryNotEmptyException; -class RepositoryPolicyNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "RepositoryPolicyNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "RepositoryPolicyNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RepositoryPolicyNotFoundException.prototype); - } -} -exports.RepositoryPolicyNotFoundException = RepositoryPolicyNotFoundException; -exports.ReplicationStatus = { - COMPLETE: "COMPLETE", - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", -}; -class ImageNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "ImageNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "ImageNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ImageNotFoundException.prototype); - } -} -exports.ImageNotFoundException = ImageNotFoundException; -exports.TagStatus = { - ANY: "ANY", - TAGGED: "TAGGED", - UNTAGGED: "UNTAGGED", -}; -exports.FindingSeverity = { - CRITICAL: "CRITICAL", - HIGH: "HIGH", - INFORMATIONAL: "INFORMATIONAL", - LOW: "LOW", - MEDIUM: "MEDIUM", - UNDEFINED: "UNDEFINED", -}; -exports.ScanStatus = { - ACTIVE: "ACTIVE", - COMPLETE: "COMPLETE", - FAILED: "FAILED", - FINDINGS_UNAVAILABLE: "FINDINGS_UNAVAILABLE", - IN_PROGRESS: "IN_PROGRESS", - PENDING: "PENDING", - SCAN_ELIGIBILITY_EXPIRED: "SCAN_ELIGIBILITY_EXPIRED", - UNSUPPORTED_IMAGE: "UNSUPPORTED_IMAGE", -}; -class ScanNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "ScanNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "ScanNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ScanNotFoundException.prototype); - } -} -exports.ScanNotFoundException = ScanNotFoundException; -exports.RepositoryFilterType = { - PREFIX_MATCH: "PREFIX_MATCH", -}; -class LayerInaccessibleException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "LayerInaccessibleException", - $fault: "client", - ...opts, - }); - this.name = "LayerInaccessibleException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LayerInaccessibleException.prototype); - } -} -exports.LayerInaccessibleException = LayerInaccessibleException; -class LayersNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "LayersNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "LayersNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LayersNotFoundException.prototype); - } -} -exports.LayersNotFoundException = LayersNotFoundException; -exports.ImageActionType = { - EXPIRE: "EXPIRE", -}; -exports.LifecyclePolicyPreviewStatus = { - COMPLETE: "COMPLETE", - EXPIRED: "EXPIRED", - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", -}; -class LifecyclePolicyPreviewNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "LifecyclePolicyPreviewNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "LifecyclePolicyPreviewNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LifecyclePolicyPreviewNotFoundException.prototype); - } -} -exports.LifecyclePolicyPreviewNotFoundException = LifecyclePolicyPreviewNotFoundException; -exports.ScanType = { - BASIC: "BASIC", - ENHANCED: "ENHANCED", -}; -class ImageAlreadyExistsException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "ImageAlreadyExistsException", - $fault: "client", - ...opts, - }); - this.name = "ImageAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ImageAlreadyExistsException.prototype); - } -} -exports.ImageAlreadyExistsException = ImageAlreadyExistsException; -class ImageDigestDoesNotMatchException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "ImageDigestDoesNotMatchException", - $fault: "client", - ...opts, - }); - this.name = "ImageDigestDoesNotMatchException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ImageDigestDoesNotMatchException.prototype); - } -} -exports.ImageDigestDoesNotMatchException = ImageDigestDoesNotMatchException; -class ImageTagAlreadyExistsException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "ImageTagAlreadyExistsException", - $fault: "client", - ...opts, - }); - this.name = "ImageTagAlreadyExistsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ImageTagAlreadyExistsException.prototype); - } -} -exports.ImageTagAlreadyExistsException = ImageTagAlreadyExistsException; -class ReferencedImagesNotFoundException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "ReferencedImagesNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "ReferencedImagesNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ReferencedImagesNotFoundException.prototype); - } -} -exports.ReferencedImagesNotFoundException = ReferencedImagesNotFoundException; -class UnsupportedImageTypeException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "UnsupportedImageTypeException", - $fault: "client", - ...opts, - }); - this.name = "UnsupportedImageTypeException"; - this.$fault = "client"; - Object.setPrototypeOf(this, UnsupportedImageTypeException.prototype); - } -} -exports.UnsupportedImageTypeException = UnsupportedImageTypeException; -class LifecyclePolicyPreviewInProgressException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "LifecyclePolicyPreviewInProgressException", - $fault: "client", - ...opts, - }); - this.name = "LifecyclePolicyPreviewInProgressException"; - this.$fault = "client"; - Object.setPrototypeOf(this, LifecyclePolicyPreviewInProgressException.prototype); - } -} -exports.LifecyclePolicyPreviewInProgressException = LifecyclePolicyPreviewInProgressException; -class InvalidLayerPartException extends ECRServiceException_1.ECRServiceException { - constructor(opts) { - super({ - name: "InvalidLayerPartException", - $fault: "client", - ...opts, - }); - this.name = "InvalidLayerPartException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidLayerPartException.prototype); - this.registryId = opts.registryId; - this.repositoryName = opts.repositoryName; - this.uploadId = opts.uploadId; - this.lastValidByteReceived = opts.lastValidByteReceived; - } -} -exports.InvalidLayerPartException = InvalidLayerPartException; - - -/***/ }), - -/***/ 58624: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateDescribeImageScanFindings = void 0; -const DescribeImageScanFindingsCommand_1 = __nccwpck_require__(72987); -const ECRClient_1 = __nccwpck_require__(83391); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new DescribeImageScanFindingsCommand_1.DescribeImageScanFindingsCommand(input), ...args); -}; -async function* paginateDescribeImageScanFindings(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRClient_1.ECRClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECR | ECRClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateDescribeImageScanFindings = paginateDescribeImageScanFindings; - - -/***/ }), - -/***/ 51351: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateDescribeImages = void 0; -const DescribeImagesCommand_1 = __nccwpck_require__(95353); -const ECRClient_1 = __nccwpck_require__(83391); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new DescribeImagesCommand_1.DescribeImagesCommand(input), ...args); -}; -async function* paginateDescribeImages(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRClient_1.ECRClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECR | ECRClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateDescribeImages = paginateDescribeImages; - - -/***/ }), - -/***/ 59589: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateDescribePullThroughCacheRules = void 0; -const DescribePullThroughCacheRulesCommand_1 = __nccwpck_require__(31484); -const ECRClient_1 = __nccwpck_require__(83391); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new DescribePullThroughCacheRulesCommand_1.DescribePullThroughCacheRulesCommand(input), ...args); -}; -async function* paginateDescribePullThroughCacheRules(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRClient_1.ECRClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECR | ECRClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateDescribePullThroughCacheRules = paginateDescribePullThroughCacheRules; - - -/***/ }), - -/***/ 16404: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateDescribeRepositories = void 0; -const DescribeRepositoriesCommand_1 = __nccwpck_require__(21200); -const ECRClient_1 = __nccwpck_require__(83391); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new DescribeRepositoriesCommand_1.DescribeRepositoriesCommand(input), ...args); -}; -async function* paginateDescribeRepositories(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRClient_1.ECRClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECR | ECRClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateDescribeRepositories = paginateDescribeRepositories; - - -/***/ }), - -/***/ 50987: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateGetLifecyclePolicyPreview = void 0; -const GetLifecyclePolicyPreviewCommand_1 = __nccwpck_require__(17006); -const ECRClient_1 = __nccwpck_require__(83391); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new GetLifecyclePolicyPreviewCommand_1.GetLifecyclePolicyPreviewCommand(input), ...args); -}; -async function* paginateGetLifecyclePolicyPreview(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRClient_1.ECRClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECR | ECRClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateGetLifecyclePolicyPreview = paginateGetLifecyclePolicyPreview; - - -/***/ }), - -/***/ 9010: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 1066: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateListImages = void 0; -const ListImagesCommand_1 = __nccwpck_require__(3854); -const ECRClient_1 = __nccwpck_require__(83391); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new ListImagesCommand_1.ListImagesCommand(input), ...args); -}; -async function* paginateListImages(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof ECRClient_1.ECRClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected ECR | ECRClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateListImages = paginateListImages; - - -/***/ }), - -/***/ 35356: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(58624), exports); -tslib_1.__exportStar(__nccwpck_require__(51351), exports); -tslib_1.__exportStar(__nccwpck_require__(59589), exports); -tslib_1.__exportStar(__nccwpck_require__(16404), exports); -tslib_1.__exportStar(__nccwpck_require__(50987), exports); -tslib_1.__exportStar(__nccwpck_require__(9010), exports); -tslib_1.__exportStar(__nccwpck_require__(1066), exports); - - -/***/ }), - -/***/ 56704: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.de_DeletePullThroughCacheRuleCommand = exports.de_DeleteLifecyclePolicyCommand = exports.de_CreateRepositoryCommand = exports.de_CreatePullThroughCacheRuleCommand = exports.de_CompleteLayerUploadCommand = exports.de_BatchGetRepositoryScanningConfigurationCommand = exports.de_BatchGetImageCommand = exports.de_BatchDeleteImageCommand = exports.de_BatchCheckLayerAvailabilityCommand = exports.se_UploadLayerPartCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StartLifecyclePolicyPreviewCommand = exports.se_StartImageScanCommand = exports.se_SetRepositoryPolicyCommand = exports.se_PutReplicationConfigurationCommand = exports.se_PutRegistryScanningConfigurationCommand = exports.se_PutRegistryPolicyCommand = exports.se_PutLifecyclePolicyCommand = exports.se_PutImageTagMutabilityCommand = exports.se_PutImageScanningConfigurationCommand = exports.se_PutImageCommand = exports.se_ListTagsForResourceCommand = exports.se_ListImagesCommand = exports.se_InitiateLayerUploadCommand = exports.se_GetRepositoryPolicyCommand = exports.se_GetRegistryScanningConfigurationCommand = exports.se_GetRegistryPolicyCommand = exports.se_GetLifecyclePolicyPreviewCommand = exports.se_GetLifecyclePolicyCommand = exports.se_GetDownloadUrlForLayerCommand = exports.se_GetAuthorizationTokenCommand = exports.se_DescribeRepositoriesCommand = exports.se_DescribeRegistryCommand = exports.se_DescribePullThroughCacheRulesCommand = exports.se_DescribeImageScanFindingsCommand = exports.se_DescribeImagesCommand = exports.se_DescribeImageReplicationStatusCommand = exports.se_DeleteRepositoryPolicyCommand = exports.se_DeleteRepositoryCommand = exports.se_DeleteRegistryPolicyCommand = exports.se_DeletePullThroughCacheRuleCommand = exports.se_DeleteLifecyclePolicyCommand = exports.se_CreateRepositoryCommand = exports.se_CreatePullThroughCacheRuleCommand = exports.se_CompleteLayerUploadCommand = exports.se_BatchGetRepositoryScanningConfigurationCommand = exports.se_BatchGetImageCommand = exports.se_BatchDeleteImageCommand = exports.se_BatchCheckLayerAvailabilityCommand = void 0; -exports.de_UploadLayerPartCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StartLifecyclePolicyPreviewCommand = exports.de_StartImageScanCommand = exports.de_SetRepositoryPolicyCommand = exports.de_PutReplicationConfigurationCommand = exports.de_PutRegistryScanningConfigurationCommand = exports.de_PutRegistryPolicyCommand = exports.de_PutLifecyclePolicyCommand = exports.de_PutImageTagMutabilityCommand = exports.de_PutImageScanningConfigurationCommand = exports.de_PutImageCommand = exports.de_ListTagsForResourceCommand = exports.de_ListImagesCommand = exports.de_InitiateLayerUploadCommand = exports.de_GetRepositoryPolicyCommand = exports.de_GetRegistryScanningConfigurationCommand = exports.de_GetRegistryPolicyCommand = exports.de_GetLifecyclePolicyPreviewCommand = exports.de_GetLifecyclePolicyCommand = exports.de_GetDownloadUrlForLayerCommand = exports.de_GetAuthorizationTokenCommand = exports.de_DescribeRepositoriesCommand = exports.de_DescribeRegistryCommand = exports.de_DescribePullThroughCacheRulesCommand = exports.de_DescribeImageScanFindingsCommand = exports.de_DescribeImagesCommand = exports.de_DescribeImageReplicationStatusCommand = exports.de_DeleteRepositoryPolicyCommand = exports.de_DeleteRepositoryCommand = exports.de_DeleteRegistryPolicyCommand = void 0; -const protocol_http_1 = __nccwpck_require__(82473); -const smithy_client_1 = __nccwpck_require__(63570); -const ECRServiceException_1 = __nccwpck_require__(11610); -const models_0_1 = __nccwpck_require__(79088); -const se_BatchCheckLayerAvailabilityCommand = async (input, context) => { - const headers = sharedHeaders("BatchCheckLayerAvailability"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_BatchCheckLayerAvailabilityCommand = se_BatchCheckLayerAvailabilityCommand; -const se_BatchDeleteImageCommand = async (input, context) => { - const headers = sharedHeaders("BatchDeleteImage"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_BatchDeleteImageCommand = se_BatchDeleteImageCommand; -const se_BatchGetImageCommand = async (input, context) => { - const headers = sharedHeaders("BatchGetImage"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_BatchGetImageCommand = se_BatchGetImageCommand; -const se_BatchGetRepositoryScanningConfigurationCommand = async (input, context) => { - const headers = sharedHeaders("BatchGetRepositoryScanningConfiguration"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_BatchGetRepositoryScanningConfigurationCommand = se_BatchGetRepositoryScanningConfigurationCommand; -const se_CompleteLayerUploadCommand = async (input, context) => { - const headers = sharedHeaders("CompleteLayerUpload"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_CompleteLayerUploadCommand = se_CompleteLayerUploadCommand; -const se_CreatePullThroughCacheRuleCommand = async (input, context) => { - const headers = sharedHeaders("CreatePullThroughCacheRule"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_CreatePullThroughCacheRuleCommand = se_CreatePullThroughCacheRuleCommand; -const se_CreateRepositoryCommand = async (input, context) => { - const headers = sharedHeaders("CreateRepository"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_CreateRepositoryCommand = se_CreateRepositoryCommand; -const se_DeleteLifecyclePolicyCommand = async (input, context) => { - const headers = sharedHeaders("DeleteLifecyclePolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DeleteLifecyclePolicyCommand = se_DeleteLifecyclePolicyCommand; -const se_DeletePullThroughCacheRuleCommand = async (input, context) => { - const headers = sharedHeaders("DeletePullThroughCacheRule"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DeletePullThroughCacheRuleCommand = se_DeletePullThroughCacheRuleCommand; -const se_DeleteRegistryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("DeleteRegistryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DeleteRegistryPolicyCommand = se_DeleteRegistryPolicyCommand; -const se_DeleteRepositoryCommand = async (input, context) => { - const headers = sharedHeaders("DeleteRepository"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DeleteRepositoryCommand = se_DeleteRepositoryCommand; -const se_DeleteRepositoryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("DeleteRepositoryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DeleteRepositoryPolicyCommand = se_DeleteRepositoryPolicyCommand; -const se_DescribeImageReplicationStatusCommand = async (input, context) => { - const headers = sharedHeaders("DescribeImageReplicationStatus"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeImageReplicationStatusCommand = se_DescribeImageReplicationStatusCommand; -const se_DescribeImagesCommand = async (input, context) => { - const headers = sharedHeaders("DescribeImages"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeImagesCommand = se_DescribeImagesCommand; -const se_DescribeImageScanFindingsCommand = async (input, context) => { - const headers = sharedHeaders("DescribeImageScanFindings"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeImageScanFindingsCommand = se_DescribeImageScanFindingsCommand; -const se_DescribePullThroughCacheRulesCommand = async (input, context) => { - const headers = sharedHeaders("DescribePullThroughCacheRules"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribePullThroughCacheRulesCommand = se_DescribePullThroughCacheRulesCommand; -const se_DescribeRegistryCommand = async (input, context) => { - const headers = sharedHeaders("DescribeRegistry"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeRegistryCommand = se_DescribeRegistryCommand; -const se_DescribeRepositoriesCommand = async (input, context) => { - const headers = sharedHeaders("DescribeRepositories"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DescribeRepositoriesCommand = se_DescribeRepositoriesCommand; -const se_GetAuthorizationTokenCommand = async (input, context) => { - const headers = sharedHeaders("GetAuthorizationToken"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetAuthorizationTokenCommand = se_GetAuthorizationTokenCommand; -const se_GetDownloadUrlForLayerCommand = async (input, context) => { - const headers = sharedHeaders("GetDownloadUrlForLayer"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetDownloadUrlForLayerCommand = se_GetDownloadUrlForLayerCommand; -const se_GetLifecyclePolicyCommand = async (input, context) => { - const headers = sharedHeaders("GetLifecyclePolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetLifecyclePolicyCommand = se_GetLifecyclePolicyCommand; -const se_GetLifecyclePolicyPreviewCommand = async (input, context) => { - const headers = sharedHeaders("GetLifecyclePolicyPreview"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetLifecyclePolicyPreviewCommand = se_GetLifecyclePolicyPreviewCommand; -const se_GetRegistryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("GetRegistryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetRegistryPolicyCommand = se_GetRegistryPolicyCommand; -const se_GetRegistryScanningConfigurationCommand = async (input, context) => { - const headers = sharedHeaders("GetRegistryScanningConfiguration"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetRegistryScanningConfigurationCommand = se_GetRegistryScanningConfigurationCommand; -const se_GetRepositoryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("GetRepositoryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetRepositoryPolicyCommand = se_GetRepositoryPolicyCommand; -const se_InitiateLayerUploadCommand = async (input, context) => { - const headers = sharedHeaders("InitiateLayerUpload"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_InitiateLayerUploadCommand = se_InitiateLayerUploadCommand; -const se_ListImagesCommand = async (input, context) => { - const headers = sharedHeaders("ListImages"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_ListImagesCommand = se_ListImagesCommand; -const se_ListTagsForResourceCommand = async (input, context) => { - const headers = sharedHeaders("ListTagsForResource"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand; -const se_PutImageCommand = async (input, context) => { - const headers = sharedHeaders("PutImage"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutImageCommand = se_PutImageCommand; -const se_PutImageScanningConfigurationCommand = async (input, context) => { - const headers = sharedHeaders("PutImageScanningConfiguration"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutImageScanningConfigurationCommand = se_PutImageScanningConfigurationCommand; -const se_PutImageTagMutabilityCommand = async (input, context) => { - const headers = sharedHeaders("PutImageTagMutability"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutImageTagMutabilityCommand = se_PutImageTagMutabilityCommand; -const se_PutLifecyclePolicyCommand = async (input, context) => { - const headers = sharedHeaders("PutLifecyclePolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutLifecyclePolicyCommand = se_PutLifecyclePolicyCommand; -const se_PutRegistryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("PutRegistryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutRegistryPolicyCommand = se_PutRegistryPolicyCommand; -const se_PutRegistryScanningConfigurationCommand = async (input, context) => { - const headers = sharedHeaders("PutRegistryScanningConfiguration"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutRegistryScanningConfigurationCommand = se_PutRegistryScanningConfigurationCommand; -const se_PutReplicationConfigurationCommand = async (input, context) => { - const headers = sharedHeaders("PutReplicationConfiguration"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_PutReplicationConfigurationCommand = se_PutReplicationConfigurationCommand; -const se_SetRepositoryPolicyCommand = async (input, context) => { - const headers = sharedHeaders("SetRepositoryPolicy"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_SetRepositoryPolicyCommand = se_SetRepositoryPolicyCommand; -const se_StartImageScanCommand = async (input, context) => { - const headers = sharedHeaders("StartImageScan"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_StartImageScanCommand = se_StartImageScanCommand; -const se_StartLifecyclePolicyPreviewCommand = async (input, context) => { - const headers = sharedHeaders("StartLifecyclePolicyPreview"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_StartLifecyclePolicyPreviewCommand = se_StartLifecyclePolicyPreviewCommand; -const se_TagResourceCommand = async (input, context) => { - const headers = sharedHeaders("TagResource"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_TagResourceCommand = se_TagResourceCommand; -const se_UntagResourceCommand = async (input, context) => { - const headers = sharedHeaders("UntagResource"); - let body; - body = JSON.stringify((0, smithy_client_1._json)(input)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_UntagResourceCommand = se_UntagResourceCommand; -const se_UploadLayerPartCommand = async (input, context) => { - const headers = sharedHeaders("UploadLayerPart"); - let body; - body = JSON.stringify(se_UploadLayerPartRequest(input, context)); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_UploadLayerPartCommand = se_UploadLayerPartCommand; -const de_BatchCheckLayerAvailabilityCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_BatchCheckLayerAvailabilityCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_BatchCheckLayerAvailabilityCommand = de_BatchCheckLayerAvailabilityCommand; -const de_BatchCheckLayerAvailabilityCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_BatchDeleteImageCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_BatchDeleteImageCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_BatchDeleteImageCommand = de_BatchDeleteImageCommand; -const de_BatchDeleteImageCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_BatchGetImageCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_BatchGetImageCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_BatchGetImageCommand = de_BatchGetImageCommand; -const de_BatchGetImageCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_BatchGetRepositoryScanningConfigurationCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_BatchGetRepositoryScanningConfigurationCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_BatchGetRepositoryScanningConfigurationCommand = de_BatchGetRepositoryScanningConfigurationCommand; -const de_BatchGetRepositoryScanningConfigurationCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_CompleteLayerUploadCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_CompleteLayerUploadCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_CompleteLayerUploadCommand = de_CompleteLayerUploadCommand; -const de_CompleteLayerUploadCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EmptyUploadException": - case "com.amazonaws.ecr#EmptyUploadException": - throw await de_EmptyUploadExceptionRes(parsedOutput, context); - case "InvalidLayerException": - case "com.amazonaws.ecr#InvalidLayerException": - throw await de_InvalidLayerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "LayerAlreadyExistsException": - case "com.amazonaws.ecr#LayerAlreadyExistsException": - throw await de_LayerAlreadyExistsExceptionRes(parsedOutput, context); - case "LayerPartTooSmallException": - case "com.amazonaws.ecr#LayerPartTooSmallException": - throw await de_LayerPartTooSmallExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UploadNotFoundException": - case "com.amazonaws.ecr#UploadNotFoundException": - throw await de_UploadNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_CreatePullThroughCacheRuleCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_CreatePullThroughCacheRuleCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_CreatePullThroughCacheRuleResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_CreatePullThroughCacheRuleCommand = de_CreatePullThroughCacheRuleCommand; -const de_CreatePullThroughCacheRuleCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PullThroughCacheRuleAlreadyExistsException": - case "com.amazonaws.ecr#PullThroughCacheRuleAlreadyExistsException": - throw await de_PullThroughCacheRuleAlreadyExistsExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedUpstreamRegistryException": - case "com.amazonaws.ecr#UnsupportedUpstreamRegistryException": - throw await de_UnsupportedUpstreamRegistryExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_CreateRepositoryCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_CreateRepositoryCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_CreateRepositoryResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_CreateRepositoryCommand = de_CreateRepositoryCommand; -const de_CreateRepositoryCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecr#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryAlreadyExistsException": - case "com.amazonaws.ecr#RepositoryAlreadyExistsException": - throw await de_RepositoryAlreadyExistsExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecr#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DeleteLifecyclePolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DeleteLifecyclePolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DeleteLifecyclePolicyResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DeleteLifecyclePolicyCommand = de_DeleteLifecyclePolicyCommand; -const de_DeleteLifecyclePolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LifecyclePolicyNotFoundException": - case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": - throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DeletePullThroughCacheRuleCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DeletePullThroughCacheRuleCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DeletePullThroughCacheRuleResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DeletePullThroughCacheRuleCommand = de_DeletePullThroughCacheRuleCommand; -const de_DeletePullThroughCacheRuleCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PullThroughCacheRuleNotFoundException": - case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException": - throw await de_PullThroughCacheRuleNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DeleteRegistryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DeleteRegistryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DeleteRegistryPolicyCommand = de_DeleteRegistryPolicyCommand; -const de_DeleteRegistryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegistryPolicyNotFoundException": - case "com.amazonaws.ecr#RegistryPolicyNotFoundException": - throw await de_RegistryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DeleteRepositoryCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DeleteRepositoryCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DeleteRepositoryResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DeleteRepositoryCommand = de_DeleteRepositoryCommand; -const de_DeleteRepositoryCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "RepositoryNotEmptyException": - case "com.amazonaws.ecr#RepositoryNotEmptyException": - throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DeleteRepositoryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DeleteRepositoryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DeleteRepositoryPolicyCommand = de_DeleteRepositoryPolicyCommand; -const de_DeleteRepositoryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryPolicyNotFoundException": - case "com.amazonaws.ecr#RepositoryPolicyNotFoundException": - throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DescribeImageReplicationStatusCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeImageReplicationStatusCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DescribeImageReplicationStatusCommand = de_DescribeImageReplicationStatusCommand; -const de_DescribeImageReplicationStatusCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecr#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DescribeImagesCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeImagesCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DescribeImagesResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DescribeImagesCommand = de_DescribeImagesCommand; -const de_DescribeImagesCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecr#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DescribeImageScanFindingsCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeImageScanFindingsCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DescribeImageScanFindingsResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DescribeImageScanFindingsCommand = de_DescribeImageScanFindingsCommand; -const de_DescribeImageScanFindingsCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecr#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ScanNotFoundException": - case "com.amazonaws.ecr#ScanNotFoundException": - throw await de_ScanNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DescribePullThroughCacheRulesCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribePullThroughCacheRulesCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DescribePullThroughCacheRulesResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DescribePullThroughCacheRulesCommand = de_DescribePullThroughCacheRulesCommand; -const de_DescribePullThroughCacheRulesCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PullThroughCacheRuleNotFoundException": - case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException": - throw await de_PullThroughCacheRuleNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DescribeRegistryCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeRegistryCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DescribeRegistryCommand = de_DescribeRegistryCommand; -const de_DescribeRegistryCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_DescribeRepositoriesCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DescribeRepositoriesCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DescribeRepositoriesResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DescribeRepositoriesCommand = de_DescribeRepositoriesCommand; -const de_DescribeRepositoriesCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetAuthorizationTokenCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetAuthorizationTokenCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_GetAuthorizationTokenResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetAuthorizationTokenCommand = de_GetAuthorizationTokenCommand; -const de_GetAuthorizationTokenCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetDownloadUrlForLayerCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetDownloadUrlForLayerCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetDownloadUrlForLayerCommand = de_GetDownloadUrlForLayerCommand; -const de_GetDownloadUrlForLayerCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LayerInaccessibleException": - case "com.amazonaws.ecr#LayerInaccessibleException": - throw await de_LayerInaccessibleExceptionRes(parsedOutput, context); - case "LayersNotFoundException": - case "com.amazonaws.ecr#LayersNotFoundException": - throw await de_LayersNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetLifecyclePolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetLifecyclePolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_GetLifecyclePolicyResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetLifecyclePolicyCommand = de_GetLifecyclePolicyCommand; -const de_GetLifecyclePolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LifecyclePolicyNotFoundException": - case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": - throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetLifecyclePolicyPreviewCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetLifecyclePolicyPreviewCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_GetLifecyclePolicyPreviewResponse(data, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetLifecyclePolicyPreviewCommand = de_GetLifecyclePolicyPreviewCommand; -const de_GetLifecyclePolicyPreviewCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LifecyclePolicyPreviewNotFoundException": - case "com.amazonaws.ecr#LifecyclePolicyPreviewNotFoundException": - throw await de_LifecyclePolicyPreviewNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetRegistryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetRegistryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetRegistryPolicyCommand = de_GetRegistryPolicyCommand; -const de_GetRegistryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegistryPolicyNotFoundException": - case "com.amazonaws.ecr#RegistryPolicyNotFoundException": - throw await de_RegistryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetRegistryScanningConfigurationCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetRegistryScanningConfigurationCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetRegistryScanningConfigurationCommand = de_GetRegistryScanningConfigurationCommand; -const de_GetRegistryScanningConfigurationCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_GetRepositoryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetRepositoryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetRepositoryPolicyCommand = de_GetRepositoryPolicyCommand; -const de_GetRepositoryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryPolicyNotFoundException": - case "com.amazonaws.ecr#RepositoryPolicyNotFoundException": - throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_InitiateLayerUploadCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_InitiateLayerUploadCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_InitiateLayerUploadCommand = de_InitiateLayerUploadCommand; -const de_InitiateLayerUploadCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_ListImagesCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_ListImagesCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_ListImagesCommand = de_ListImagesCommand; -const de_ListImagesCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_ListTagsForResourceCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand; -const de_ListTagsForResourceCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutImageCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutImageCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutImageCommand = de_PutImageCommand; -const de_PutImageCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageAlreadyExistsException": - case "com.amazonaws.ecr#ImageAlreadyExistsException": - throw await de_ImageAlreadyExistsExceptionRes(parsedOutput, context); - case "ImageDigestDoesNotMatchException": - case "com.amazonaws.ecr#ImageDigestDoesNotMatchException": - throw await de_ImageDigestDoesNotMatchExceptionRes(parsedOutput, context); - case "ImageTagAlreadyExistsException": - case "com.amazonaws.ecr#ImageTagAlreadyExistsException": - throw await de_ImageTagAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "LayersNotFoundException": - case "com.amazonaws.ecr#LayersNotFoundException": - throw await de_LayersNotFoundExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ReferencedImagesNotFoundException": - case "com.amazonaws.ecr#ReferencedImagesNotFoundException": - throw await de_ReferencedImagesNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutImageScanningConfigurationCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutImageScanningConfigurationCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutImageScanningConfigurationCommand = de_PutImageScanningConfigurationCommand; -const de_PutImageScanningConfigurationCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutImageTagMutabilityCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutImageTagMutabilityCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutImageTagMutabilityCommand = de_PutImageTagMutabilityCommand; -const de_PutImageTagMutabilityCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutLifecyclePolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutLifecyclePolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutLifecyclePolicyCommand = de_PutLifecyclePolicyCommand; -const de_PutLifecyclePolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutRegistryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutRegistryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutRegistryPolicyCommand = de_PutRegistryPolicyCommand; -const de_PutRegistryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutRegistryScanningConfigurationCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutRegistryScanningConfigurationCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutRegistryScanningConfigurationCommand = de_PutRegistryScanningConfigurationCommand; -const de_PutRegistryScanningConfigurationCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_PutReplicationConfigurationCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_PutReplicationConfigurationCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_PutReplicationConfigurationCommand = de_PutReplicationConfigurationCommand; -const de_PutReplicationConfigurationCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_SetRepositoryPolicyCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_SetRepositoryPolicyCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_SetRepositoryPolicyCommand = de_SetRepositoryPolicyCommand; -const de_SetRepositoryPolicyCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_StartImageScanCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_StartImageScanCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_StartImageScanCommand = de_StartImageScanCommand; -const de_StartImageScanCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecr#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedImageTypeException": - case "com.amazonaws.ecr#UnsupportedImageTypeException": - throw await de_UnsupportedImageTypeExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_StartLifecyclePolicyPreviewCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_StartLifecyclePolicyPreviewCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_StartLifecyclePolicyPreviewCommand = de_StartLifecyclePolicyPreviewCommand; -const de_StartLifecyclePolicyPreviewCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LifecyclePolicyNotFoundException": - case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": - throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); - case "LifecyclePolicyPreviewInProgressException": - case "com.amazonaws.ecr#LifecyclePolicyPreviewInProgressException": - throw await de_LifecyclePolicyPreviewInProgressExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_TagResourceCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_TagResourceCommand = de_TagResourceCommand; -const de_TagResourceCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecr#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecr#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_UntagResourceCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_UntagResourceCommand = de_UntagResourceCommand; -const de_UntagResourceCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecr#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecr#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_UploadLayerPartCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_UploadLayerPartCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = (0, smithy_client_1._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_UploadLayerPartCommand = de_UploadLayerPartCommand; -const de_UploadLayerPartCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLayerPartException": - case "com.amazonaws.ecr#InvalidLayerPartException": - throw await de_InvalidLayerPartExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UploadNotFoundException": - case "com.amazonaws.ecr#UploadNotFoundException": - throw await de_UploadNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_EmptyUploadExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.EmptyUploadException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ImageAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ImageAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ImageDigestDoesNotMatchExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ImageDigestDoesNotMatchException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ImageNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ImageNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ImageTagAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ImageTagAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidLayerExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.InvalidLayerException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidLayerPartExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.InvalidLayerPartException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidParameterExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.InvalidParameterException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidTagParameterExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.InvalidTagParameterException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_KmsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.KmsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LayerAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LayerAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LayerInaccessibleExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LayerInaccessibleException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LayerPartTooSmallExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LayerPartTooSmallException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LayersNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LayersNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LifecyclePolicyNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LifecyclePolicyNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LifecyclePolicyPreviewInProgressExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LifecyclePolicyPreviewInProgressException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LifecyclePolicyPreviewNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LifecyclePolicyPreviewNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_LimitExceededExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.LimitExceededException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_PullThroughCacheRuleAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.PullThroughCacheRuleAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_PullThroughCacheRuleNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.PullThroughCacheRuleNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ReferencedImagesNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ReferencedImagesNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RegistryPolicyNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RegistryPolicyNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryAlreadyExistsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryAlreadyExistsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryNotEmptyExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryNotEmptyException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RepositoryPolicyNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.RepositoryPolicyNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ScanNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ScanNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ServerExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ServerException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_TooManyTagsExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.TooManyTagsException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_UnsupportedImageTypeExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.UnsupportedImageTypeException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_UnsupportedUpstreamRegistryExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.UnsupportedUpstreamRegistryException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_UploadNotFoundExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.UploadNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_ValidationExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, smithy_client_1._json)(body); - const exception = new models_0_1.ValidationException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const se_UploadLayerPartRequest = (input, context) => { - return (0, smithy_client_1.take)(input, { - layerPartBlob: context.base64Encoder, - partFirstByte: [], - partLastByte: [], - registryId: [], - repositoryName: [], - uploadId: [], - }); -}; -const de_AuthorizationData = (output, context) => { - return (0, smithy_client_1.take)(output, { - authorizationToken: smithy_client_1.expectString, - expiresAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - proxyEndpoint: smithy_client_1.expectString, - }); -}; -const de_AuthorizationDataList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_AuthorizationData(entry, context); - }); - return retVal; -}; -const de_AwsEcrContainerImageDetails = (output, context) => { - return (0, smithy_client_1.take)(output, { - architecture: smithy_client_1.expectString, - author: smithy_client_1.expectString, - imageHash: smithy_client_1.expectString, - imageTags: smithy_client_1._json, - platform: smithy_client_1.expectString, - pushedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - registry: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - }); -}; -const de_CreatePullThroughCacheRuleResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - ecrRepositoryPrefix: smithy_client_1.expectString, - registryId: smithy_client_1.expectString, - upstreamRegistryUrl: smithy_client_1.expectString, - }); -}; -const de_CreateRepositoryResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - repository: (_) => de_Repository(_, context), - }); -}; -const de_CvssScore = (output, context) => { - return (0, smithy_client_1.take)(output, { - baseScore: smithy_client_1.limitedParseDouble, - scoringVector: smithy_client_1.expectString, - source: smithy_client_1.expectString, - version: smithy_client_1.expectString, - }); -}; -const de_CvssScoreDetails = (output, context) => { - return (0, smithy_client_1.take)(output, { - adjustments: smithy_client_1._json, - score: smithy_client_1.limitedParseDouble, - scoreSource: smithy_client_1.expectString, - scoringVector: smithy_client_1.expectString, - version: smithy_client_1.expectString, - }); -}; -const de_CvssScoreList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_CvssScore(entry, context); - }); - return retVal; -}; -const de_DeleteLifecyclePolicyResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - lastEvaluatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - lifecyclePolicyText: smithy_client_1.expectString, - registryId: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - }); -}; -const de_DeletePullThroughCacheRuleResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - ecrRepositoryPrefix: smithy_client_1.expectString, - registryId: smithy_client_1.expectString, - upstreamRegistryUrl: smithy_client_1.expectString, - }); -}; -const de_DeleteRepositoryResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - repository: (_) => de_Repository(_, context), - }); -}; -const de_DescribeImageScanFindingsResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - imageId: smithy_client_1._json, - imageScanFindings: (_) => de_ImageScanFindings(_, context), - imageScanStatus: smithy_client_1._json, - nextToken: smithy_client_1.expectString, - registryId: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - }); -}; -const de_DescribeImagesResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - imageDetails: (_) => de_ImageDetailList(_, context), - nextToken: smithy_client_1.expectString, - }); -}; -const de_DescribePullThroughCacheRulesResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - nextToken: smithy_client_1.expectString, - pullThroughCacheRules: (_) => de_PullThroughCacheRuleList(_, context), - }); -}; -const de_DescribeRepositoriesResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - nextToken: smithy_client_1.expectString, - repositories: (_) => de_RepositoryList(_, context), - }); -}; -const de_EnhancedImageScanFinding = (output, context) => { - return (0, smithy_client_1.take)(output, { - awsAccountId: smithy_client_1.expectString, - description: smithy_client_1.expectString, - findingArn: smithy_client_1.expectString, - firstObservedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - lastObservedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - packageVulnerabilityDetails: (_) => de_PackageVulnerabilityDetails(_, context), - remediation: smithy_client_1._json, - resources: (_) => de_ResourceList(_, context), - score: smithy_client_1.limitedParseDouble, - scoreDetails: (_) => de_ScoreDetails(_, context), - severity: smithy_client_1.expectString, - status: smithy_client_1.expectString, - title: smithy_client_1.expectString, - type: smithy_client_1.expectString, - updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - }); -}; -const de_EnhancedImageScanFindingList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_EnhancedImageScanFinding(entry, context); - }); - return retVal; -}; -const de_GetAuthorizationTokenResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - authorizationData: (_) => de_AuthorizationDataList(_, context), - }); -}; -const de_GetLifecyclePolicyPreviewResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - lifecyclePolicyText: smithy_client_1.expectString, - nextToken: smithy_client_1.expectString, - previewResults: (_) => de_LifecyclePolicyPreviewResultList(_, context), - registryId: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - status: smithy_client_1.expectString, - summary: smithy_client_1._json, - }); -}; -const de_GetLifecyclePolicyResponse = (output, context) => { - return (0, smithy_client_1.take)(output, { - lastEvaluatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - lifecyclePolicyText: smithy_client_1.expectString, - registryId: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - }); -}; -const de_ImageDetail = (output, context) => { - return (0, smithy_client_1.take)(output, { - artifactMediaType: smithy_client_1.expectString, - imageDigest: smithy_client_1.expectString, - imageManifestMediaType: smithy_client_1.expectString, - imagePushedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - imageScanFindingsSummary: (_) => de_ImageScanFindingsSummary(_, context), - imageScanStatus: smithy_client_1._json, - imageSizeInBytes: smithy_client_1.expectLong, - imageTags: smithy_client_1._json, - lastRecordedPullTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - registryId: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - }); -}; -const de_ImageDetailList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_ImageDetail(entry, context); - }); - return retVal; -}; -const de_ImageScanFindings = (output, context) => { - return (0, smithy_client_1.take)(output, { - enhancedFindings: (_) => de_EnhancedImageScanFindingList(_, context), - findingSeverityCounts: smithy_client_1._json, - findings: smithy_client_1._json, - imageScanCompletedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - vulnerabilitySourceUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - }); -}; -const de_ImageScanFindingsSummary = (output, context) => { - return (0, smithy_client_1.take)(output, { - findingSeverityCounts: smithy_client_1._json, - imageScanCompletedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - vulnerabilitySourceUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - }); -}; -const de_LifecyclePolicyPreviewResult = (output, context) => { - return (0, smithy_client_1.take)(output, { - action: smithy_client_1._json, - appliedRulePriority: smithy_client_1.expectInt32, - imageDigest: smithy_client_1.expectString, - imagePushedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - imageTags: smithy_client_1._json, - }); -}; -const de_LifecyclePolicyPreviewResultList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_LifecyclePolicyPreviewResult(entry, context); - }); - return retVal; -}; -const de_PackageVulnerabilityDetails = (output, context) => { - return (0, smithy_client_1.take)(output, { - cvss: (_) => de_CvssScoreList(_, context), - referenceUrls: smithy_client_1._json, - relatedVulnerabilities: smithy_client_1._json, - source: smithy_client_1.expectString, - sourceUrl: smithy_client_1.expectString, - vendorCreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - vendorSeverity: smithy_client_1.expectString, - vendorUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - vulnerabilityId: smithy_client_1.expectString, - vulnerablePackages: smithy_client_1._json, - }); -}; -const de_PullThroughCacheRule = (output, context) => { - return (0, smithy_client_1.take)(output, { - createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - ecrRepositoryPrefix: smithy_client_1.expectString, - registryId: smithy_client_1.expectString, - upstreamRegistryUrl: smithy_client_1.expectString, - }); -}; -const de_PullThroughCacheRuleList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_PullThroughCacheRule(entry, context); - }); - return retVal; -}; -const de_Repository = (output, context) => { - return (0, smithy_client_1.take)(output, { - createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))), - encryptionConfiguration: smithy_client_1._json, - imageScanningConfiguration: smithy_client_1._json, - imageTagMutability: smithy_client_1.expectString, - registryId: smithy_client_1.expectString, - repositoryArn: smithy_client_1.expectString, - repositoryName: smithy_client_1.expectString, - repositoryUri: smithy_client_1.expectString, - }); -}; -const de_RepositoryList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_Repository(entry, context); - }); - return retVal; -}; -const de_Resource = (output, context) => { - return (0, smithy_client_1.take)(output, { - details: (_) => de_ResourceDetails(_, context), - id: smithy_client_1.expectString, - tags: smithy_client_1._json, - type: smithy_client_1.expectString, - }); -}; -const de_ResourceDetails = (output, context) => { - return (0, smithy_client_1.take)(output, { - awsEcrContainerImage: (_) => de_AwsEcrContainerImageDetails(_, context), - }); -}; -const de_ResourceList = (output, context) => { - const retVal = (output || []) - .filter((e) => e != null) - .map((entry) => { - return de_Resource(entry, context); - }); - return retVal; -}; -const de_ScoreDetails = (output, context) => { - return (0, smithy_client_1.take)(output, { - cvss: (_) => de_CvssScoreDetails(_, context), - }); -}; -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 collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); -const throwDefaultError = (0, smithy_client_1.withBaseException)(ECRServiceException_1.ECRServiceException); -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, - }; - if (resolvedHostname !== undefined) { - contents.hostname = resolvedHostname; - } - if (body !== undefined) { - contents.body = body; - } - return new protocol_http_1.HttpRequest(contents); -}; -function sharedHeaders(operation) { - return { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": `AmazonEC2ContainerRegistry_V20150921.${operation}`, - }; -} -const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - return JSON.parse(encoded); - } - return {}; -}); -const parseErrorBody = async (errorBody, context) => { - const value = await parseBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; -}; -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.code !== undefined) { - return sanitizeErrorCode(data.code); - } - if (data["__type"] !== undefined) { - return sanitizeErrorCode(data["__type"]); - } -}; - - -/***/ }), - -/***/ 869: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const tslib_1 = __nccwpck_require__(4351); -const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(4289)); -const client_sts_1 = __nccwpck_require__(52209); -const credential_provider_node_1 = __nccwpck_require__(75531); -const util_user_agent_node_1 = __nccwpck_require__(98095); -const config_resolver_1 = __nccwpck_require__(53098); -const hash_node_1 = __nccwpck_require__(3081); -const middleware_retry_1 = __nccwpck_require__(96039); -const node_config_provider_1 = __nccwpck_require__(33461); -const node_http_handler_1 = __nccwpck_require__(64350); -const util_body_length_node_1 = __nccwpck_require__(68075); -const util_retry_1 = __nccwpck_require__(84902); -const runtimeConfig_shared_1 = __nccwpck_require__(70542); -const smithy_client_1 = __nccwpck_require__(63570); -const util_defaults_mode_node_1 = __nccwpck_require__(72429); -const smithy_client_2 = __nccwpck_require__(63570); -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); - return { - ...clientSharedValues, - ...config, - runtime: "node", - defaultsMode, - bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider), - defaultUserAgentProvider: config?.defaultUserAgentProvider ?? - (0, util_user_agent_node_1.defaultUserAgent)({ 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), - region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(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, - }), - 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), - useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - }; -}; -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), - -/***/ 70542: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const url_parser_1 = __nccwpck_require__(14681); -const util_base64_1 = __nccwpck_require__(75600); -const util_utf8_1 = __nccwpck_require__(41895); -const endpointResolver_1 = __nccwpck_require__(61610); -const getRuntimeConfig = (config) => ({ - apiVersion: "2015-09-21", - 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 ?? [], - logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - serviceId: config?.serviceId ?? "ECR", - urlParser: config?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, -}); -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), - -/***/ 86506: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRuntimeExtensions = void 0; -const region_config_resolver_1 = __nccwpck_require__(18156); -const protocol_http_1 = __nccwpck_require__(82473); -const smithy_client_1 = __nccwpck_require__(63570); -const asPartial = (t) => t; -const resolveRuntimeExtensions = (runtimeConfig, extensions) => { - const extensionConfiguration = { - ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)), - }; - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return { - ...runtimeConfig, - ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), - ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), - ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), - }; -}; -exports.resolveRuntimeExtensions = resolveRuntimeExtensions; - - -/***/ }), - -/***/ 28406: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(78547), exports); -tslib_1.__exportStar(__nccwpck_require__(45723), exports); - - -/***/ }), - -/***/ 78547: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.waitUntilImageScanComplete = exports.waitForImageScanComplete = void 0; -const util_waiter_1 = __nccwpck_require__(78011); -const DescribeImageScanFindingsCommand_1 = __nccwpck_require__(72987); -const checkState = async (client, input) => { - let reason; - try { - const result = await client.send(new DescribeImageScanFindingsCommand_1.DescribeImageScanFindingsCommand(input)); - reason = result; - try { - const returnComparator = () => { - return result.imageScanStatus.status; - }; - if (returnComparator() === "COMPLETE") { - return { state: util_waiter_1.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - return result.imageScanStatus.status; - }; - if (returnComparator() === "FAILED") { - return { state: util_waiter_1.WaiterState.FAILURE, reason }; - } - } - catch (e) { } - } - catch (exception) { - reason = exception; - } - return { state: util_waiter_1.WaiterState.RETRY, reason }; -}; -const waitForImageScanComplete = async (params, input) => { - const serviceDefaults = { minDelay: 5, maxDelay: 120 }; - return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState); -}; -exports.waitForImageScanComplete = waitForImageScanComplete; -const waitUntilImageScanComplete = async (params, input) => { - const serviceDefaults = { minDelay: 5, maxDelay: 120 }; - const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState); - return (0, util_waiter_1.checkExceptions)(result); -}; -exports.waitUntilImageScanComplete = waitUntilImageScanComplete; - - -/***/ }), - -/***/ 45723: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.waitUntilLifecyclePolicyPreviewComplete = exports.waitForLifecyclePolicyPreviewComplete = void 0; -const util_waiter_1 = __nccwpck_require__(78011); -const GetLifecyclePolicyPreviewCommand_1 = __nccwpck_require__(17006); -const checkState = async (client, input) => { - let reason; - try { - const result = await client.send(new GetLifecyclePolicyPreviewCommand_1.GetLifecyclePolicyPreviewCommand(input)); - reason = result; - try { - const returnComparator = () => { - return result.status; - }; - if (returnComparator() === "COMPLETE") { - return { state: util_waiter_1.WaiterState.SUCCESS, reason }; - } - } - catch (e) { } - try { - const returnComparator = () => { - return result.status; - }; - if (returnComparator() === "FAILED") { - return { state: util_waiter_1.WaiterState.FAILURE, reason }; - } - } - catch (e) { } - } - catch (exception) { - reason = exception; - } - return { state: util_waiter_1.WaiterState.RETRY, reason }; -}; -const waitForLifecyclePolicyPreviewComplete = async (params, input) => { - const serviceDefaults = { minDelay: 5, maxDelay: 120 }; - return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState); -}; -exports.waitForLifecyclePolicyPreviewComplete = waitForLifecyclePolicyPreviewComplete; -const waitUntilLifecyclePolicyPreviewComplete = async (params, input) => { - const serviceDefaults = { minDelay: 5, maxDelay: 120 }; - const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState); - return (0, util_waiter_1.checkExceptions)(result); -}; -exports.waitUntilLifecyclePolicyPreviewComplete = waitUntilLifecyclePolicyPreviewComplete; - - -/***/ }), - -/***/ 98253: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - - -/***/ }), - -/***/ 41680: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -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; -}; -exports.getTransformedHeaders = getTransformedHeaders; - - -/***/ }), - -/***/ 64350: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(52885), exports); -tslib_1.__exportStar(__nccwpck_require__(29415), exports); -tslib_1.__exportStar(__nccwpck_require__(53444), exports); - - -/***/ }), - -/***/ 52885: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; -const protocol_http_1 = __nccwpck_require__(82473); -const querystring_builder_1 = __nccwpck_require__(18021); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(98253); -const get_transformed_headers_1 = __nccwpck_require__(41680); -const set_connection_timeout_1 = __nccwpck_require__(79062); -const set_socket_keep_alive_1 = __nccwpck_require__(86268); -const set_socket_timeout_1 = __nccwpck_require__(11700); -const write_request_body_1 = __nccwpck_require__(94310); -exports.DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - var _a, _b; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - auth, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - }); - } - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } -} -exports.NodeHttpHandler = NodeHttpHandler; - - -/***/ }), - -/***/ 22219: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionManager = void 0; -const tslib_1 = __nccwpck_require__(4351); -const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); -const node_http2_connection_pool_1 = __nccwpck_require__(94783); -class NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const 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_1.default.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 node_http2_connection_pool_1.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) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); - } -} -exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; - - -/***/ }), - -/***/ 94783: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionPool = void 0; -class NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions !== null && sessions !== void 0 ? 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(); - } - } - } - } -} -exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; - - -/***/ }), - -/***/ 29415: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(82473); -const querystring_builder_1 = __nccwpck_require__(18021); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(41680); -const node_http2_connection_manager_1 = __nccwpck_require__(22219); -const write_request_body_1 = __nccwpck_require__(94310); -class NodeHttp2Handler { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); - 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 } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a, _b, _c; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal === null || abortSignal === void 0 ? void 0 : 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 = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - 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 = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } -} -exports.NodeHttp2Handler = NodeHttp2Handler; - - -/***/ }), - -/***/ 79062: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; - } - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - else { - clearTimeout(timeoutId); - } - }); -}; -exports.setConnectionTimeout = setConnectionTimeout; - - -/***/ }), - -/***/ 86268: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketKeepAlive = void 0; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; - } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); -}; -exports.setSocketKeepAlive = setSocketKeepAlive; - - -/***/ }), - -/***/ 11700: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); -}; -exports.setSocketTimeout = setSocketTimeout; - - -/***/ }), - -/***/ 13110: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } -} -exports.Collector = Collector; - - -/***/ }), - -/***/ 53444: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(13110); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.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); - }); -}); -exports.streamCollector = streamCollector; - - -/***/ }), - -/***/ 94310: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -const MIN_WAIT_TIME = 1000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - var _a; - const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }), - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} - - -/***/ }), - -/***/ 72435: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(5417); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 50120: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 75981: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 10418: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(75981), exports); - - -/***/ }), - -/***/ 91917: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 23343: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 55192: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 82473: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(10418), exports); -tslib_1.__exportStar(__nccwpck_require__(72435), exports); -tslib_1.__exportStar(__nccwpck_require__(50120), exports); -tslib_1.__exportStar(__nccwpck_require__(91917), exports); -tslib_1.__exportStar(__nccwpck_require__(23343), exports); -tslib_1.__exportStar(__nccwpck_require__(55192), exports); -tslib_1.__exportStar(__nccwpck_require__(36579), exports); -tslib_1.__exportStar(__nccwpck_require__(36198), exports); - - -/***/ }), - -/***/ 36579: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 36198: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 18021: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(92509); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } - } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; - - -/***/ }), - -/***/ 80352: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 55353: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 35136: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 69996: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 51485: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 52560: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 23421: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 4695: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(23421), exports); -tslib_1.__exportStar(__nccwpck_require__(92951), exports); -tslib_1.__exportStar(__nccwpck_require__(4706), exports); - - -/***/ }), - -/***/ 92951: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 4706: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 56579: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 27084: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 42184: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 74538: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 42927: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 19395: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 70478: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 79083: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(74538), exports); -tslib_1.__exportStar(__nccwpck_require__(42927), exports); -tslib_1.__exportStar(__nccwpck_require__(19395), exports); -tslib_1.__exportStar(__nccwpck_require__(55084), exports); -tslib_1.__exportStar(__nccwpck_require__(70478), exports); - - -/***/ }), - -/***/ 55084: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 117: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 16184: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 27690: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(16184); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 11948: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 79775: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(27690), exports); -tslib_1.__exportStar(__nccwpck_require__(11948), exports); -var checksum_1 = __nccwpck_require__(16184); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 51487: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 63083: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 60981: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 71249: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(63083), exports); -tslib_1.__exportStar(__nccwpck_require__(60981), exports); - - -/***/ }), - -/***/ 5417: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(80352), exports); -tslib_1.__exportStar(__nccwpck_require__(55353), exports); -tslib_1.__exportStar(__nccwpck_require__(35136), exports); -tslib_1.__exportStar(__nccwpck_require__(69996), exports); -tslib_1.__exportStar(__nccwpck_require__(51485), exports); -tslib_1.__exportStar(__nccwpck_require__(52560), exports); -tslib_1.__exportStar(__nccwpck_require__(4695), exports); -tslib_1.__exportStar(__nccwpck_require__(56579), exports); -tslib_1.__exportStar(__nccwpck_require__(27084), exports); -tslib_1.__exportStar(__nccwpck_require__(42184), exports); -tslib_1.__exportStar(__nccwpck_require__(79083), exports); -tslib_1.__exportStar(__nccwpck_require__(117), exports); -tslib_1.__exportStar(__nccwpck_require__(79775), exports); -tslib_1.__exportStar(__nccwpck_require__(51487), exports); -tslib_1.__exportStar(__nccwpck_require__(71249), exports); -tslib_1.__exportStar(__nccwpck_require__(25966), exports); -tslib_1.__exportStar(__nccwpck_require__(67184), exports); -tslib_1.__exportStar(__nccwpck_require__(7902), exports); -tslib_1.__exportStar(__nccwpck_require__(87206), exports); -tslib_1.__exportStar(__nccwpck_require__(2896), exports); -tslib_1.__exportStar(__nccwpck_require__(90859), exports); -tslib_1.__exportStar(__nccwpck_require__(91990), exports); -tslib_1.__exportStar(__nccwpck_require__(32651), exports); -tslib_1.__exportStar(__nccwpck_require__(23358), exports); -tslib_1.__exportStar(__nccwpck_require__(5786), exports); -tslib_1.__exportStar(__nccwpck_require__(87164), exports); -tslib_1.__exportStar(__nccwpck_require__(22194), exports); -tslib_1.__exportStar(__nccwpck_require__(97137), exports); -tslib_1.__exportStar(__nccwpck_require__(74406), exports); -tslib_1.__exportStar(__nccwpck_require__(5838), exports); -tslib_1.__exportStar(__nccwpck_require__(89072), exports); -tslib_1.__exportStar(__nccwpck_require__(32002), exports); -tslib_1.__exportStar(__nccwpck_require__(43006), exports); -tslib_1.__exportStar(__nccwpck_require__(95528), exports); - - -/***/ }), - -/***/ 25966: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 67184: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 7902: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87206: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 2896: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 90859: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 91990: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 32651: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 23358: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 5786: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87164: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 22194: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 97137: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 74406: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 5838: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89072: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 32002: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43006: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 95528: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 30862: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(39447); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; - - -/***/ }), - -/***/ 39447: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; - - -/***/ }), - -/***/ 92509: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(39447), exports); -tslib_1.__exportStar(__nccwpck_require__(30862), exports); - - -/***/ }), - -/***/ 69838: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SSO = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const GetRoleCredentialsCommand_1 = __nccwpck_require__(18972); -const ListAccountRolesCommand_1 = __nccwpck_require__(1513); -const ListAccountsCommand_1 = __nccwpck_require__(64296); -const LogoutCommand_1 = __nccwpck_require__(12586); -const SSOClient_1 = __nccwpck_require__(71057); -const commands = { - GetRoleCredentialsCommand: GetRoleCredentialsCommand_1.GetRoleCredentialsCommand, - ListAccountRolesCommand: ListAccountRolesCommand_1.ListAccountRolesCommand, - ListAccountsCommand: ListAccountsCommand_1.ListAccountsCommand, - LogoutCommand: LogoutCommand_1.LogoutCommand, -}; -class SSO extends SSOClient_1.SSOClient { -} -exports.SSO = SSO; -(0, smithy_client_1.createAggregatedClient)(commands, SSO); - - -/***/ }), - -/***/ 71057: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SSOClient = exports.__Client = void 0; -const middleware_host_header_1 = __nccwpck_require__(22545); -const middleware_logger_1 = __nccwpck_require__(20014); -const middleware_recursion_detection_1 = __nccwpck_require__(85525); -const middleware_user_agent_1 = __nccwpck_require__(64688); -const config_resolver_1 = __nccwpck_require__(53098); -const middleware_content_length_1 = __nccwpck_require__(82800); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_retry_1 = __nccwpck_require__(96039); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } })); -const EndpointParameters_1 = __nccwpck_require__(34214); -const runtimeConfig_1 = __nccwpck_require__(19756); -const runtimeExtensions_1 = __nccwpck_require__(63398); -class SSOClient extends smithy_client_1.Client { - constructor(...[configuration]) { - const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); - const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); - const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); - const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); - const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); - const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_5); - const _config_7 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_6, configuration?.extensions || []); - super(_config_7); - this.config = _config_7; - this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); - this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); - this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); - this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); - this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); - } - destroy() { - super.destroy(); - } -} -exports.SSOClient = SSOClient; - - -/***/ }), - -/***/ 18972: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetRoleCredentialsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(30917); -const models_0_1 = __nccwpck_require__(66390); -const Aws_restJson1_1 = __nccwpck_require__(98507); -class GetRoleCredentialsCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRoleCredentialsCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOClient"; - const commandName = "GetRoleCredentialsCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: models_0_1.GetRoleCredentialsRequestFilterSensitiveLog, - outputFilterSensitiveLog: models_0_1.GetRoleCredentialsResponseFilterSensitiveLog, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SWBPortalService", - operation: "GetRoleCredentials", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_restJson1_1.se_GetRoleCredentialsCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_restJson1_1.de_GetRoleCredentialsCommand)(output, context); - } -} -exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand; - - -/***/ }), - -/***/ 1513: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ListAccountRolesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(30917); -const models_0_1 = __nccwpck_require__(66390); -const Aws_restJson1_1 = __nccwpck_require__(98507); -class ListAccountRolesCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListAccountRolesCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOClient"; - const commandName = "ListAccountRolesCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: models_0_1.ListAccountRolesRequestFilterSensitiveLog, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SWBPortalService", - operation: "ListAccountRoles", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_restJson1_1.se_ListAccountRolesCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_restJson1_1.de_ListAccountRolesCommand)(output, context); - } -} -exports.ListAccountRolesCommand = ListAccountRolesCommand; - - -/***/ }), - -/***/ 64296: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ListAccountsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(30917); -const models_0_1 = __nccwpck_require__(66390); -const Aws_restJson1_1 = __nccwpck_require__(98507); -class ListAccountsCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListAccountsCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOClient"; - const commandName = "ListAccountsCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: models_0_1.ListAccountsRequestFilterSensitiveLog, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SWBPortalService", - operation: "ListAccounts", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_restJson1_1.se_ListAccountsCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_restJson1_1.de_ListAccountsCommand)(output, context); - } -} -exports.ListAccountsCommand = ListAccountsCommand; - - -/***/ }), - -/***/ 12586: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LogoutCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(30917); -const models_0_1 = __nccwpck_require__(66390); -const Aws_restJson1_1 = __nccwpck_require__(98507); -class LogoutCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, LogoutCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOClient"; - const commandName = "LogoutCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: models_0_1.LogoutRequestFilterSensitiveLog, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "SWBPortalService", - operation: "Logout", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_restJson1_1.se_LogoutCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_restJson1_1.de_LogoutCommand)(output, context); - } -} -exports.LogoutCommand = LogoutCommand; - - -/***/ }), - -/***/ 65706: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(18972), exports); -tslib_1.__exportStar(__nccwpck_require__(1513), exports); -tslib_1.__exportStar(__nccwpck_require__(64296), exports); -tslib_1.__exportStar(__nccwpck_require__(12586), exports); - - -/***/ }), - -/***/ 34214: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveClientEndpointParameters = void 0; -const resolveClientEndpointParameters = (options) => { - return { - ...options, - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "awsssoportal", - }; -}; -exports.resolveClientEndpointParameters = resolveClientEndpointParameters; - - -/***/ }), - -/***/ 30898: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultEndpointResolver = void 0; -const util_endpoints_1 = __nccwpck_require__(13350); -const ruleset_1 = __nccwpck_require__(13341); -const defaultEndpointResolver = (endpointParams, context = {}) => { - return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams: endpointParams, - logger: context.logger, - }); -}; -exports.defaultEndpointResolver = defaultEndpointResolver; - - -/***/ }), - -/***/ 13341: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ruleSet = void 0; -const q = "required", r = "fn", s = "argv", t = "ref"; -const a = "isSet", b = "tree", c = "error", d = "endpoint", e = "PartitionResult", f = { [q]: false, "type": "String" }, g = { [q]: true, "default": false, "type": "Boolean" }, h = { [t]: "Endpoint" }, i = { [r]: "booleanEquals", [s]: [{ [t]: "UseFIPS" }, true] }, j = { [r]: "booleanEquals", [s]: [{ [t]: "UseDualStack" }, true] }, k = {}, l = { [r]: "booleanEquals", [s]: [true, { [r]: "getAttr", [s]: [{ [t]: e }, "supportsFIPS"] }] }, m = { [r]: "booleanEquals", [s]: [true, { [r]: "getAttr", [s]: [{ [t]: e }, "supportsDualStack"] }] }, n = [i], o = [j], p = [{ [t]: "Region" }]; -const _data = { version: "1.0", parameters: { Region: f, UseDualStack: g, UseFIPS: g, Endpoint: f }, rules: [{ conditions: [{ [r]: a, [s]: [h] }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: h, properties: k, headers: k }, type: d }] }, { conditions: [{ [r]: a, [s]: p }], type: b, rules: [{ conditions: [{ [r]: "aws.partition", [s]: p, assign: e }], type: b, rules: [{ conditions: [i, j], type: b, rules: [{ conditions: [l, m], type: b, rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: k, headers: k }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [m], type: b, rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: k, headers: k }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] }; -exports.ruleSet = _data; - - -/***/ }), - -/***/ 82666: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SSOServiceException = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(71057), exports); -tslib_1.__exportStar(__nccwpck_require__(69838), exports); -tslib_1.__exportStar(__nccwpck_require__(65706), exports); -tslib_1.__exportStar(__nccwpck_require__(36773), exports); -tslib_1.__exportStar(__nccwpck_require__(14952), exports); -var SSOServiceException_1 = __nccwpck_require__(81517); -Object.defineProperty(exports, "SSOServiceException", ({ enumerable: true, get: function () { return SSOServiceException_1.SSOServiceException; } })); - - -/***/ }), - -/***/ 81517: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SSOServiceException = exports.__ServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -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; - - -/***/ }), - -/***/ 14952: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(66390), exports); - - -/***/ }), - -/***/ 66390: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LogoutRequestFilterSensitiveLog = exports.ListAccountsRequestFilterSensitiveLog = exports.ListAccountRolesRequestFilterSensitiveLog = exports.GetRoleCredentialsResponseFilterSensitiveLog = exports.RoleCredentialsFilterSensitiveLog = exports.GetRoleCredentialsRequestFilterSensitiveLog = exports.UnauthorizedException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.InvalidRequestException = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const SSOServiceException_1 = __nccwpck_require__(81517); -class InvalidRequestException extends SSOServiceException_1.SSOServiceException { - constructor(opts) { - super({ - name: "InvalidRequestException", - $fault: "client", - ...opts, - }); - this.name = "InvalidRequestException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidRequestException.prototype); - } -} -exports.InvalidRequestException = InvalidRequestException; -class ResourceNotFoundException extends SSOServiceException_1.SSOServiceException { - constructor(opts) { - super({ - name: "ResourceNotFoundException", - $fault: "client", - ...opts, - }); - this.name = "ResourceNotFoundException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ResourceNotFoundException.prototype); - } -} -exports.ResourceNotFoundException = ResourceNotFoundException; -class TooManyRequestsException extends SSOServiceException_1.SSOServiceException { - constructor(opts) { - super({ - name: "TooManyRequestsException", - $fault: "client", - ...opts, - }); - this.name = "TooManyRequestsException"; - this.$fault = "client"; - Object.setPrototypeOf(this, TooManyRequestsException.prototype); - } -} -exports.TooManyRequestsException = TooManyRequestsException; -class UnauthorizedException extends SSOServiceException_1.SSOServiceException { - constructor(opts) { - super({ - name: "UnauthorizedException", - $fault: "client", - ...opts, - }); - this.name = "UnauthorizedException"; - this.$fault = "client"; - Object.setPrototypeOf(this, UnauthorizedException.prototype); - } -} -exports.UnauthorizedException = UnauthorizedException; -const GetRoleCredentialsRequestFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.accessToken && { accessToken: smithy_client_1.SENSITIVE_STRING }), -}); -exports.GetRoleCredentialsRequestFilterSensitiveLog = GetRoleCredentialsRequestFilterSensitiveLog; -const RoleCredentialsFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.secretAccessKey && { secretAccessKey: smithy_client_1.SENSITIVE_STRING }), - ...(obj.sessionToken && { sessionToken: smithy_client_1.SENSITIVE_STRING }), -}); -exports.RoleCredentialsFilterSensitiveLog = RoleCredentialsFilterSensitiveLog; -const GetRoleCredentialsResponseFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.roleCredentials && { roleCredentials: (0, exports.RoleCredentialsFilterSensitiveLog)(obj.roleCredentials) }), -}); -exports.GetRoleCredentialsResponseFilterSensitiveLog = GetRoleCredentialsResponseFilterSensitiveLog; -const ListAccountRolesRequestFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.accessToken && { accessToken: smithy_client_1.SENSITIVE_STRING }), -}); -exports.ListAccountRolesRequestFilterSensitiveLog = ListAccountRolesRequestFilterSensitiveLog; -const ListAccountsRequestFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.accessToken && { accessToken: smithy_client_1.SENSITIVE_STRING }), -}); -exports.ListAccountsRequestFilterSensitiveLog = ListAccountsRequestFilterSensitiveLog; -const LogoutRequestFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.accessToken && { accessToken: smithy_client_1.SENSITIVE_STRING }), -}); -exports.LogoutRequestFilterSensitiveLog = LogoutRequestFilterSensitiveLog; - - -/***/ }), - -/***/ 80849: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 88460: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateListAccountRoles = void 0; -const ListAccountRolesCommand_1 = __nccwpck_require__(1513); -const SSOClient_1 = __nccwpck_require__(71057); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new ListAccountRolesCommand_1.ListAccountRolesCommand(input), ...args); -}; -async function* paginateListAccountRoles(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof SSOClient_1.SSOClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected SSO | SSOClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateListAccountRoles = paginateListAccountRoles; - - -/***/ }), - -/***/ 50938: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.paginateListAccounts = void 0; -const ListAccountsCommand_1 = __nccwpck_require__(64296); -const SSOClient_1 = __nccwpck_require__(71057); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new ListAccountsCommand_1.ListAccountsCommand(input), ...args); -}; -async function* paginateListAccounts(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof SSOClient_1.SSOClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected SSO | SSOClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateListAccounts = paginateListAccounts; - - -/***/ }), - -/***/ 36773: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(80849), exports); -tslib_1.__exportStar(__nccwpck_require__(88460), exports); -tslib_1.__exportStar(__nccwpck_require__(50938), exports); - - -/***/ }), - -/***/ 98507: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.de_LogoutCommand = exports.de_ListAccountsCommand = exports.de_ListAccountRolesCommand = exports.de_GetRoleCredentialsCommand = exports.se_LogoutCommand = exports.se_ListAccountsCommand = exports.se_ListAccountRolesCommand = exports.se_GetRoleCredentialsCommand = void 0; -const protocol_http_1 = __nccwpck_require__(23555); -const smithy_client_1 = __nccwpck_require__(63570); -const models_0_1 = __nccwpck_require__(66390); -const SSOServiceException_1 = __nccwpck_require__(81517); -const se_GetRoleCredentialsCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, { - "x-amz-sso_bearer_token": input.accessToken, - }); - const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/federation/credentials"; - const query = (0, smithy_client_1.map)({ - role_name: [, (0, smithy_client_1.expectNonNull)(input.roleName, `roleName`)], - account_id: [, (0, smithy_client_1.expectNonNull)(input.accountId, `accountId`)], - }); - let body; - return new protocol_http_1.HttpRequest({ - protocol, - hostname, - port, - method: "GET", - headers, - path: resolvedPath, - query, - body, - }); -}; -exports.se_GetRoleCredentialsCommand = se_GetRoleCredentialsCommand; -const se_ListAccountRolesCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, { - "x-amz-sso_bearer_token": input.accessToken, - }); - const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/roles"; - const query = (0, smithy_client_1.map)({ - next_token: [, input.nextToken], - max_result: [() => input.maxResults !== void 0, () => input.maxResults.toString()], - account_id: [, (0, smithy_client_1.expectNonNull)(input.accountId, `accountId`)], - }); - let body; - return new protocol_http_1.HttpRequest({ - protocol, - hostname, - port, - method: "GET", - headers, - path: resolvedPath, - query, - body, - }); -}; -exports.se_ListAccountRolesCommand = se_ListAccountRolesCommand; -const se_ListAccountsCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, { - "x-amz-sso_bearer_token": input.accessToken, - }); - const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/accounts"; - const query = (0, smithy_client_1.map)({ - next_token: [, input.nextToken], - max_result: [() => input.maxResults !== void 0, () => input.maxResults.toString()], - }); - let body; - return new protocol_http_1.HttpRequest({ - protocol, - hostname, - port, - method: "GET", - headers, - path: resolvedPath, - query, - body, - }); -}; -exports.se_ListAccountsCommand = se_ListAccountsCommand; -const se_LogoutCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, { - "x-amz-sso_bearer_token": input.accessToken, - }); - const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/logout"; - let body; - return new protocol_http_1.HttpRequest({ - protocol, - hostname, - port, - method: "POST", - headers, - path: resolvedPath, - body, - }); -}; -exports.se_LogoutCommand = se_LogoutCommand; -const de_GetRoleCredentialsCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRoleCredentialsCommandError(output, context); - } - const contents = (0, smithy_client_1.map)({ - $metadata: deserializeMetadata(output), - }); - const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_1.take)(data, { - roleCredentials: smithy_client_1._json, - }); - Object.assign(contents, doc); - return contents; -}; -exports.de_GetRoleCredentialsCommand = de_GetRoleCredentialsCommand; -const de_GetRoleCredentialsCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.sso#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sso#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sso#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.sso#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_ListAccountRolesCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccountRolesCommandError(output, context); - } - const contents = (0, smithy_client_1.map)({ - $metadata: deserializeMetadata(output), - }); - const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_1.take)(data, { - nextToken: smithy_client_1.expectString, - roleList: smithy_client_1._json, - }); - Object.assign(contents, doc); - return contents; -}; -exports.de_ListAccountRolesCommand = de_ListAccountRolesCommand; -const de_ListAccountRolesCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.sso#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sso#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sso#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.sso#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_ListAccountsCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccountsCommandError(output, context); - } - const contents = (0, smithy_client_1.map)({ - $metadata: deserializeMetadata(output), - }); - const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_1.take)(data, { - accountList: smithy_client_1._json, - nextToken: smithy_client_1.expectString, - }); - Object.assign(contents, doc); - return contents; -}; -exports.de_ListAccountsCommand = de_ListAccountsCommand; -const de_ListAccountsCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.sso#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sso#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sso#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.sso#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const de_LogoutCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_LogoutCommandError(output, context); - } - const contents = (0, smithy_client_1.map)({ - $metadata: deserializeMetadata(output), - }); - await (0, smithy_client_1.collectBody)(output.body, context); - return contents; -}; -exports.de_LogoutCommand = de_LogoutCommand; -const de_LogoutCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.sso#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sso#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.sso#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -const throwDefaultError = (0, smithy_client_1.withBaseException)(SSOServiceException_1.SSOServiceException); -const de_InvalidRequestExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_1.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_1.take)(data, { - message: smithy_client_1.expectString, - }); - Object.assign(contents, doc); - const exception = new models_0_1.InvalidRequestException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); -}; -const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_1.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_1.take)(data, { - message: smithy_client_1.expectString, - }); - Object.assign(contents, doc); - const exception = new models_0_1.ResourceNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); -}; -const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_1.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_1.take)(data, { - message: smithy_client_1.expectString, - }); - Object.assign(contents, doc); - const exception = new models_0_1.TooManyRequestsException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); -}; -const de_UnauthorizedExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_1.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_1.take)(data, { - message: smithy_client_1.expectString, - }); - Object.assign(contents, doc); - const exception = new models_0_1.UnauthorizedException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); -}; -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 collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); -const isSerializableHeaderValue = (value) => value !== undefined && - value !== null && - value !== "" && - (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && - (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); -const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - return JSON.parse(encoded); - } - return {}; -}); -const parseErrorBody = async (errorBody, context) => { - const value = await parseBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; -}; -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.code !== undefined) { - return sanitizeErrorCode(data.code); - } - if (data["__type"] !== undefined) { - return sanitizeErrorCode(data["__type"]); - } -}; - - -/***/ }), - -/***/ 19756: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const tslib_1 = __nccwpck_require__(4351); -const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(91092)); -const util_user_agent_node_1 = __nccwpck_require__(98095); -const config_resolver_1 = __nccwpck_require__(53098); -const hash_node_1 = __nccwpck_require__(3081); -const middleware_retry_1 = __nccwpck_require__(96039); -const node_config_provider_1 = __nccwpck_require__(33461); -const node_http_handler_1 = __nccwpck_require__(67028); -const util_body_length_node_1 = __nccwpck_require__(68075); -const util_retry_1 = __nccwpck_require__(84902); -const runtimeConfig_shared_1 = __nccwpck_require__(4355); -const smithy_client_1 = __nccwpck_require__(63570); -const util_defaults_mode_node_1 = __nccwpck_require__(72429); -const smithy_client_2 = __nccwpck_require__(63570); -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); - return { - ...clientSharedValues, - ...config, - runtime: "node", - defaultsMode, - bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - defaultUserAgentProvider: config?.defaultUserAgentProvider ?? - (0, util_user_agent_node_1.defaultUserAgent)({ 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), - region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(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, - }), - 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), - useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - }; -}; -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), - -/***/ 4355: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const url_parser_1 = __nccwpck_require__(14681); -const util_base64_1 = __nccwpck_require__(75600); -const util_utf8_1 = __nccwpck_require__(41895); -const endpointResolver_1 = __nccwpck_require__(30898); -const getRuntimeConfig = (config) => ({ - 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 ?? [], - logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - serviceId: config?.serviceId ?? "SSO", - urlParser: config?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, -}); -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), - -/***/ 63398: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRuntimeExtensions = void 0; -const region_config_resolver_1 = __nccwpck_require__(18156); -const protocol_http_1 = __nccwpck_require__(23555); -const smithy_client_1 = __nccwpck_require__(63570); -const asPartial = (t) => t; -const resolveRuntimeExtensions = (runtimeConfig, extensions) => { - const extensionConfiguration = { - ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)), - }; - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return { - ...runtimeConfig, - ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), - ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), - ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), - }; -}; -exports.resolveRuntimeExtensions = resolveRuntimeExtensions; - - -/***/ }), - -/***/ 70579: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - - -/***/ }), - -/***/ 64434: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -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; -}; -exports.getTransformedHeaders = getTransformedHeaders; - - -/***/ }), - -/***/ 67028: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(11081), exports); -tslib_1.__exportStar(__nccwpck_require__(75770), exports); -tslib_1.__exportStar(__nccwpck_require__(22775), exports); - - -/***/ }), - -/***/ 11081: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; -const protocol_http_1 = __nccwpck_require__(23555); -const querystring_builder_1 = __nccwpck_require__(77090); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(70579); -const get_transformed_headers_1 = __nccwpck_require__(64434); -const set_connection_timeout_1 = __nccwpck_require__(99643); -const set_socket_keep_alive_1 = __nccwpck_require__(90354); -const set_socket_timeout_1 = __nccwpck_require__(65050); -const write_request_body_1 = __nccwpck_require__(25185); -exports.DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - var _a, _b; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - auth, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - }); - } - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } -} -exports.NodeHttpHandler = NodeHttpHandler; - - -/***/ }), - -/***/ 15569: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionManager = void 0; -const tslib_1 = __nccwpck_require__(4351); -const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); -const node_http2_connection_pool_1 = __nccwpck_require__(33739); -class NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const 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_1.default.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 node_http2_connection_pool_1.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) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); - } -} -exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; - - -/***/ }), - -/***/ 33739: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionPool = void 0; -class NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions !== null && sessions !== void 0 ? 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(); - } - } - } - } -} -exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; - - -/***/ }), - -/***/ 75770: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(23555); -const querystring_builder_1 = __nccwpck_require__(77090); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(64434); -const node_http2_connection_manager_1 = __nccwpck_require__(15569); -const write_request_body_1 = __nccwpck_require__(25185); -class NodeHttp2Handler { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); - 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 } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a, _b, _c; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal === null || abortSignal === void 0 ? void 0 : 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 = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - 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 = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } -} -exports.NodeHttp2Handler = NodeHttp2Handler; - - -/***/ }), - -/***/ 99643: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; - } - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - else { - clearTimeout(timeoutId); - } - }); -}; -exports.setConnectionTimeout = setConnectionTimeout; - - -/***/ }), - -/***/ 90354: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketKeepAlive = void 0; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; - } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); -}; -exports.setSocketKeepAlive = setSocketKeepAlive; - - -/***/ }), - -/***/ 65050: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); -}; -exports.setSocketTimeout = setSocketTimeout; - - -/***/ }), - -/***/ 41986: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } -} -exports.Collector = Collector; - - -/***/ }), - -/***/ 22775: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(41986); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.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); - }); -}); -exports.streamCollector = streamCollector; - - -/***/ }), - -/***/ 25185: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -const MIN_WAIT_TIME = 1000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - var _a; - const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }), - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} - - -/***/ }), - -/***/ 23504: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(30917); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 10633: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 88255: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 30613: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(88255), exports); - - -/***/ }), - -/***/ 81888: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61324: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 93879: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 23555: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(30613), exports); -tslib_1.__exportStar(__nccwpck_require__(23504), exports); -tslib_1.__exportStar(__nccwpck_require__(10633), exports); -tslib_1.__exportStar(__nccwpck_require__(81888), exports); -tslib_1.__exportStar(__nccwpck_require__(61324), exports); -tslib_1.__exportStar(__nccwpck_require__(93879), exports); -tslib_1.__exportStar(__nccwpck_require__(994), exports); -tslib_1.__exportStar(__nccwpck_require__(74390), exports); - - -/***/ }), - -/***/ 994: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 74390: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 77090: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(54067); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } - } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; - - -/***/ }), - -/***/ 64329: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 24798: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 28760: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 95531: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 79936: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21170: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 58143: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 93150: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(58143), exports); -tslib_1.__exportStar(__nccwpck_require__(63368), exports); -tslib_1.__exportStar(__nccwpck_require__(13704), exports); - - -/***/ }), - -/***/ 63368: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13704: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 3992: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 59813: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 53088: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 22067: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 12370: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 99168: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 50491: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 71531: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(22067), exports); -tslib_1.__exportStar(__nccwpck_require__(12370), exports); -tslib_1.__exportStar(__nccwpck_require__(99168), exports); -tslib_1.__exportStar(__nccwpck_require__(20902), exports); -tslib_1.__exportStar(__nccwpck_require__(50491), exports); - - -/***/ }), - -/***/ 20902: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 1335: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 49180: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 11533: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(49180); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 29493: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87140: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(11533), exports); -tslib_1.__exportStar(__nccwpck_require__(29493), exports); -var checksum_1 = __nccwpck_require__(49180); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 75603: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 51779: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 71038: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61816: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(51779), exports); -tslib_1.__exportStar(__nccwpck_require__(71038), exports); - - -/***/ }), - -/***/ 30917: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(64329), exports); -tslib_1.__exportStar(__nccwpck_require__(24798), exports); -tslib_1.__exportStar(__nccwpck_require__(28760), exports); -tslib_1.__exportStar(__nccwpck_require__(95531), exports); -tslib_1.__exportStar(__nccwpck_require__(79936), exports); -tslib_1.__exportStar(__nccwpck_require__(21170), exports); -tslib_1.__exportStar(__nccwpck_require__(93150), exports); -tslib_1.__exportStar(__nccwpck_require__(3992), exports); -tslib_1.__exportStar(__nccwpck_require__(59813), exports); -tslib_1.__exportStar(__nccwpck_require__(53088), exports); -tslib_1.__exportStar(__nccwpck_require__(71531), exports); -tslib_1.__exportStar(__nccwpck_require__(1335), exports); -tslib_1.__exportStar(__nccwpck_require__(87140), exports); -tslib_1.__exportStar(__nccwpck_require__(75603), exports); -tslib_1.__exportStar(__nccwpck_require__(61816), exports); -tslib_1.__exportStar(__nccwpck_require__(22568), exports); -tslib_1.__exportStar(__nccwpck_require__(43236), exports); -tslib_1.__exportStar(__nccwpck_require__(88434), exports); -tslib_1.__exportStar(__nccwpck_require__(42986), exports); -tslib_1.__exportStar(__nccwpck_require__(35010), exports); -tslib_1.__exportStar(__nccwpck_require__(75383), exports); -tslib_1.__exportStar(__nccwpck_require__(72347), exports); -tslib_1.__exportStar(__nccwpck_require__(5009), exports); -tslib_1.__exportStar(__nccwpck_require__(45921), exports); -tslib_1.__exportStar(__nccwpck_require__(79748), exports); -tslib_1.__exportStar(__nccwpck_require__(76176), exports); -tslib_1.__exportStar(__nccwpck_require__(54284), exports); -tslib_1.__exportStar(__nccwpck_require__(98532), exports); -tslib_1.__exportStar(__nccwpck_require__(87522), exports); -tslib_1.__exportStar(__nccwpck_require__(26578), exports); -tslib_1.__exportStar(__nccwpck_require__(75330), exports); -tslib_1.__exportStar(__nccwpck_require__(5988), exports); -tslib_1.__exportStar(__nccwpck_require__(52121), exports); -tslib_1.__exportStar(__nccwpck_require__(91006), exports); - - -/***/ }), - -/***/ 22568: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43236: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 88434: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 42986: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 35010: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 75383: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 72347: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 5009: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 45921: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 79748: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 76176: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 54284: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 98532: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87522: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 26578: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 75330: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 5988: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 52121: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 91006: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 33240: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(56009); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; - - -/***/ }), - -/***/ 56009: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; - - -/***/ }), - -/***/ 54067: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(56009), exports); -tslib_1.__exportStar(__nccwpck_require__(33240), exports); - - -/***/ }), - -/***/ 32605: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.STS = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const AssumeRoleCommand_1 = __nccwpck_require__(59802); -const AssumeRoleWithSAMLCommand_1 = __nccwpck_require__(72865); -const AssumeRoleWithWebIdentityCommand_1 = __nccwpck_require__(37451); -const DecodeAuthorizationMessageCommand_1 = __nccwpck_require__(74150); -const GetAccessKeyInfoCommand_1 = __nccwpck_require__(49804); -const GetCallerIdentityCommand_1 = __nccwpck_require__(24278); -const GetFederationTokenCommand_1 = __nccwpck_require__(57552); -const GetSessionTokenCommand_1 = __nccwpck_require__(43285); -const STSClient_1 = __nccwpck_require__(64195); -const commands = { - AssumeRoleCommand: AssumeRoleCommand_1.AssumeRoleCommand, - AssumeRoleWithSAMLCommand: AssumeRoleWithSAMLCommand_1.AssumeRoleWithSAMLCommand, - AssumeRoleWithWebIdentityCommand: AssumeRoleWithWebIdentityCommand_1.AssumeRoleWithWebIdentityCommand, - DecodeAuthorizationMessageCommand: DecodeAuthorizationMessageCommand_1.DecodeAuthorizationMessageCommand, - GetAccessKeyInfoCommand: GetAccessKeyInfoCommand_1.GetAccessKeyInfoCommand, - GetCallerIdentityCommand: GetCallerIdentityCommand_1.GetCallerIdentityCommand, - GetFederationTokenCommand: GetFederationTokenCommand_1.GetFederationTokenCommand, - GetSessionTokenCommand: GetSessionTokenCommand_1.GetSessionTokenCommand, -}; -class STS extends STSClient_1.STSClient { -} -exports.STS = STS; -(0, smithy_client_1.createAggregatedClient)(commands, STS); - - -/***/ }), - -/***/ 64195: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.STSClient = exports.__Client = void 0; -const middleware_host_header_1 = __nccwpck_require__(22545); -const middleware_logger_1 = __nccwpck_require__(20014); -const middleware_recursion_detection_1 = __nccwpck_require__(85525); -const middleware_sdk_sts_1 = __nccwpck_require__(55959); -const middleware_user_agent_1 = __nccwpck_require__(64688); -const config_resolver_1 = __nccwpck_require__(53098); -const middleware_content_length_1 = __nccwpck_require__(82800); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_retry_1 = __nccwpck_require__(96039); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } })); -const EndpointParameters_1 = __nccwpck_require__(20510); -const runtimeConfig_1 = __nccwpck_require__(83405); -const runtimeExtensions_1 = __nccwpck_require__(32053); -class STSClient extends smithy_client_1.Client { - constructor(...[configuration]) { - const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); - const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); - const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); - const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); - const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); - const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_sdk_sts_1.resolveStsAuthConfig)(_config_5, { stsClientCtor: STSClient }); - const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6); - const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []); - super(_config_8); - this.config = _config_8; - this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); - this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); - this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); - this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); - this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); - } - destroy() { - super.destroy(); - } -} -exports.STSClient = STSClient; - - -/***/ }), - -/***/ 59802: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AssumeRoleCommand = exports.$Command = void 0; -const middleware_signing_1 = __nccwpck_require__(14935); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(71551); -const models_0_1 = __nccwpck_require__(21780); -const Aws_query_1 = __nccwpck_require__(10740); -class AssumeRoleCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleCommand.getEndpointParameterInstructions())); - this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "STSClient"; - const commandName = "AssumeRoleCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: models_0_1.AssumeRoleResponseFilterSensitiveLog, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSecurityTokenServiceV20110615", - operation: "AssumeRole", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_query_1.se_AssumeRoleCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_query_1.de_AssumeRoleCommand)(output, context); - } -} -exports.AssumeRoleCommand = AssumeRoleCommand; - - -/***/ }), - -/***/ 72865: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AssumeRoleWithSAMLCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(71551); -const models_0_1 = __nccwpck_require__(21780); -const Aws_query_1 = __nccwpck_require__(10740); -class AssumeRoleWithSAMLCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleWithSAMLCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "STSClient"; - const commandName = "AssumeRoleWithSAMLCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: models_0_1.AssumeRoleWithSAMLRequestFilterSensitiveLog, - outputFilterSensitiveLog: models_0_1.AssumeRoleWithSAMLResponseFilterSensitiveLog, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSecurityTokenServiceV20110615", - operation: "AssumeRoleWithSAML", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_query_1.se_AssumeRoleWithSAMLCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_query_1.de_AssumeRoleWithSAMLCommand)(output, context); - } -} -exports.AssumeRoleWithSAMLCommand = AssumeRoleWithSAMLCommand; - - -/***/ }), - -/***/ 37451: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AssumeRoleWithWebIdentityCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(71551); -const models_0_1 = __nccwpck_require__(21780); -const Aws_query_1 = __nccwpck_require__(10740); -class AssumeRoleWithWebIdentityCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleWithWebIdentityCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "STSClient"; - const commandName = "AssumeRoleWithWebIdentityCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: models_0_1.AssumeRoleWithWebIdentityRequestFilterSensitiveLog, - outputFilterSensitiveLog: models_0_1.AssumeRoleWithWebIdentityResponseFilterSensitiveLog, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSecurityTokenServiceV20110615", - operation: "AssumeRoleWithWebIdentity", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_query_1.se_AssumeRoleWithWebIdentityCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_query_1.de_AssumeRoleWithWebIdentityCommand)(output, context); - } -} -exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand; - - -/***/ }), - -/***/ 74150: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DecodeAuthorizationMessageCommand = exports.$Command = void 0; -const middleware_signing_1 = __nccwpck_require__(14935); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(71551); -const Aws_query_1 = __nccwpck_require__(10740); -class DecodeAuthorizationMessageCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DecodeAuthorizationMessageCommand.getEndpointParameterInstructions())); - this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "STSClient"; - const commandName = "DecodeAuthorizationMessageCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSecurityTokenServiceV20110615", - operation: "DecodeAuthorizationMessage", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_query_1.se_DecodeAuthorizationMessageCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_query_1.de_DecodeAuthorizationMessageCommand)(output, context); - } -} -exports.DecodeAuthorizationMessageCommand = DecodeAuthorizationMessageCommand; - - -/***/ }), - -/***/ 49804: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetAccessKeyInfoCommand = exports.$Command = void 0; -const middleware_signing_1 = __nccwpck_require__(14935); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(71551); -const Aws_query_1 = __nccwpck_require__(10740); -class GetAccessKeyInfoCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetAccessKeyInfoCommand.getEndpointParameterInstructions())); - this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "STSClient"; - const commandName = "GetAccessKeyInfoCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSecurityTokenServiceV20110615", - operation: "GetAccessKeyInfo", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_query_1.se_GetAccessKeyInfoCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_query_1.de_GetAccessKeyInfoCommand)(output, context); - } -} -exports.GetAccessKeyInfoCommand = GetAccessKeyInfoCommand; - - -/***/ }), - -/***/ 24278: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetCallerIdentityCommand = exports.$Command = void 0; -const middleware_signing_1 = __nccwpck_require__(14935); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(71551); -const Aws_query_1 = __nccwpck_require__(10740); -class GetCallerIdentityCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetCallerIdentityCommand.getEndpointParameterInstructions())); - this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "STSClient"; - const commandName = "GetCallerIdentityCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSecurityTokenServiceV20110615", - operation: "GetCallerIdentity", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_query_1.se_GetCallerIdentityCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_query_1.de_GetCallerIdentityCommand)(output, context); - } -} -exports.GetCallerIdentityCommand = GetCallerIdentityCommand; - - -/***/ }), - -/***/ 57552: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetFederationTokenCommand = exports.$Command = void 0; -const middleware_signing_1 = __nccwpck_require__(14935); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(71551); -const models_0_1 = __nccwpck_require__(21780); -const Aws_query_1 = __nccwpck_require__(10740); -class GetFederationTokenCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetFederationTokenCommand.getEndpointParameterInstructions())); - this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "STSClient"; - const commandName = "GetFederationTokenCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: models_0_1.GetFederationTokenResponseFilterSensitiveLog, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSecurityTokenServiceV20110615", - operation: "GetFederationToken", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_query_1.se_GetFederationTokenCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_query_1.de_GetFederationTokenCommand)(output, context); - } -} -exports.GetFederationTokenCommand = GetFederationTokenCommand; - - -/***/ }), - -/***/ 43285: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetSessionTokenCommand = exports.$Command = void 0; -const middleware_signing_1 = __nccwpck_require__(14935); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_1 = __nccwpck_require__(63570); -Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(71551); -const models_0_1 = __nccwpck_require__(21780); -const Aws_query_1 = __nccwpck_require__(10740); -class GetSessionTokenCommand extends smithy_client_1.Command { - static getEndpointParameterInstructions() { - return { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - constructor(input) { - super(); - this.input = input; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetSessionTokenCommand.getEndpointParameterInstructions())); - this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "STSClient"; - const commandName = "GetSessionTokenCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: models_0_1.GetSessionTokenResponseFilterSensitiveLog, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSecurityTokenServiceV20110615", - operation: "GetSessionToken", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return (0, Aws_query_1.se_GetSessionTokenCommand)(input, context); - } - deserialize(output, context) { - return (0, Aws_query_1.de_GetSessionTokenCommand)(output, context); - } -} -exports.GetSessionTokenCommand = GetSessionTokenCommand; - - -/***/ }), - -/***/ 55716: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(59802), exports); -tslib_1.__exportStar(__nccwpck_require__(72865), exports); -tslib_1.__exportStar(__nccwpck_require__(37451), exports); -tslib_1.__exportStar(__nccwpck_require__(74150), exports); -tslib_1.__exportStar(__nccwpck_require__(49804), exports); -tslib_1.__exportStar(__nccwpck_require__(24278), exports); -tslib_1.__exportStar(__nccwpck_require__(57552), exports); -tslib_1.__exportStar(__nccwpck_require__(43285), exports); - - -/***/ }), - -/***/ 88028: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.decorateDefaultCredentialProvider = exports.getDefaultRoleAssumerWithWebIdentity = exports.getDefaultRoleAssumer = void 0; -const defaultStsRoleAssumers_1 = __nccwpck_require__(90048); -const STSClient_1 = __nccwpck_require__(64195); -const getCustomizableStsClientCtor = (baseCtor, customizations) => { - if (!customizations) - return baseCtor; - else - return class CustomizableSTSClient extends baseCtor { - constructor(config) { - super(config); - for (const customization of customizations) { - this.middlewareStack.use(customization); - } - } - }; -}; -const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => (0, defaultStsRoleAssumers_1.getDefaultRoleAssumer)(stsOptions, getCustomizableStsClientCtor(STSClient_1.STSClient, stsPlugins)); -exports.getDefaultRoleAssumer = getDefaultRoleAssumer; -const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => (0, defaultStsRoleAssumers_1.getDefaultRoleAssumerWithWebIdentity)(stsOptions, getCustomizableStsClientCtor(STSClient_1.STSClient, stsPlugins)); -exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; -const decorateDefaultCredentialProvider = (provider) => (input) => provider({ - roleAssumer: (0, exports.getDefaultRoleAssumer)(input), - roleAssumerWithWebIdentity: (0, exports.getDefaultRoleAssumerWithWebIdentity)(input), - ...input, -}); -exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; - - -/***/ }), - -/***/ 90048: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.decorateDefaultCredentialProvider = exports.getDefaultRoleAssumerWithWebIdentity = exports.getDefaultRoleAssumer = void 0; -const AssumeRoleCommand_1 = __nccwpck_require__(59802); -const AssumeRoleWithWebIdentityCommand_1 = __nccwpck_require__(37451); -const ASSUME_ROLE_DEFAULT_REGION = "us-east-1"; -const decorateDefaultRegion = (region) => { - if (typeof region !== "function") { - return region === undefined ? ASSUME_ROLE_DEFAULT_REGION : region; - } - return async () => { - try { - return await region(); - } - catch (e) { - return ASSUME_ROLE_DEFAULT_REGION; - } - }; -}; -const getDefaultRoleAssumer = (stsOptions, stsClientCtor) => { - let stsClient; - let closureSourceCreds; - return async (sourceCreds, params) => { - closureSourceCreds = sourceCreds; - if (!stsClient) { - const { logger, region, requestHandler } = stsOptions; - stsClient = new stsClientCtor({ - logger, - credentialDefaultProvider: () => async () => closureSourceCreds, - region: decorateDefaultRegion(region || stsOptions.region), - ...(requestHandler ? { requestHandler } : {}), - }); - } - const { Credentials } = await stsClient.send(new AssumeRoleCommand_1.AssumeRoleCommand(params)); - if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { - throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); - } - return { - accessKeyId: Credentials.AccessKeyId, - secretAccessKey: Credentials.SecretAccessKey, - sessionToken: Credentials.SessionToken, - expiration: Credentials.Expiration, - }; - }; -}; -exports.getDefaultRoleAssumer = getDefaultRoleAssumer; -const getDefaultRoleAssumerWithWebIdentity = (stsOptions, stsClientCtor) => { - let stsClient; - return async (params) => { - if (!stsClient) { - const { logger, region, requestHandler } = stsOptions; - stsClient = new stsClientCtor({ - logger, - region: decorateDefaultRegion(region || stsOptions.region), - ...(requestHandler ? { requestHandler } : {}), - }); - } - const { Credentials } = await stsClient.send(new AssumeRoleWithWebIdentityCommand_1.AssumeRoleWithWebIdentityCommand(params)); - if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { - throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); - } - return { - accessKeyId: Credentials.AccessKeyId, - secretAccessKey: Credentials.SecretAccessKey, - sessionToken: Credentials.SessionToken, - expiration: Credentials.Expiration, - }; - }; -}; -exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; -const decorateDefaultCredentialProvider = (provider) => (input) => provider({ - roleAssumer: (0, exports.getDefaultRoleAssumer)(input, input.stsClientCtor), - roleAssumerWithWebIdentity: (0, exports.getDefaultRoleAssumerWithWebIdentity)(input, input.stsClientCtor), - ...input, -}); -exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; - - -/***/ }), - -/***/ 20510: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveClientEndpointParameters = void 0; -const resolveClientEndpointParameters = (options) => { - return { - ...options, - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - useGlobalEndpoint: options.useGlobalEndpoint ?? false, - defaultSigningName: "sts", - }; -}; -exports.resolveClientEndpointParameters = resolveClientEndpointParameters; - - -/***/ }), - -/***/ 41203: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultEndpointResolver = void 0; -const util_endpoints_1 = __nccwpck_require__(13350); -const ruleset_1 = __nccwpck_require__(86882); -const defaultEndpointResolver = (endpointParams, context = {}) => { - return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams: endpointParams, - logger: context.logger, - }); -}; -exports.defaultEndpointResolver = defaultEndpointResolver; - - -/***/ }), - -/***/ 86882: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -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 = "tree", e = "stringEquals", f = "sigv4", g = "sts", h = "us-east-1", i = "endpoint", j = "https://sts.{Region}.{PartitionResult#dnsSuffix}", 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": f, "signingName": g, "signingRegion": h }] }, "headers": {} }, v = {}, w = { "conditions": [{ [H]: e, [I]: [q, "aws-global"] }], [i]: u, [G]: i }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: c, [I]: [true, { [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] }], [G]: d, rules: [{ conditions: [{ [H]: e, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: i }, w, { conditions: [{ [H]: e, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, h] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "us-east-2"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "us-west-1"] }], endpoint: u, [G]: i }, { conditions: [{ [H]: e, [I]: [q, "us-west-2"] }], endpoint: u, [G]: i }, { endpoint: { url: j, properties: { authSchemes: [{ name: f, signingName: g, signingRegion: "{Region}" }] }, headers: v }, [G]: i }] }, { conditions: C, [G]: d, 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]: i }] }, { conditions: [p], [G]: d, rules: [{ conditions: [r], [G]: d, rules: [{ conditions: [x, y], [G]: d, rules: [{ conditions: [z, B], [G]: d, rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: i }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }] }, { conditions: D, [G]: d, rules: [{ conditions: [z], [G]: d, rules: [{ conditions: [{ [H]: e, [I]: ["aws-us-gov", { [H]: l, [I]: [A, "name"] }] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G]: i }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G]: i }] }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }] }, { conditions: E, [G]: d, rules: [{ conditions: [B], [G]: d, rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: i }] }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }] }, w, { endpoint: { url: j, properties: v, headers: v }, [G]: i }] }] }, { error: "Invalid Configuration: Missing Region", [G]: k }] }; -exports.ruleSet = _data; - - -/***/ }), - -/***/ 52209: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.STSServiceException = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(64195), exports); -tslib_1.__exportStar(__nccwpck_require__(32605), exports); -tslib_1.__exportStar(__nccwpck_require__(55716), exports); -tslib_1.__exportStar(__nccwpck_require__(20106), exports); -tslib_1.__exportStar(__nccwpck_require__(88028), exports); -var STSServiceException_1 = __nccwpck_require__(15770); -Object.defineProperty(exports, "STSServiceException", ({ enumerable: true, get: function () { return STSServiceException_1.STSServiceException; } })); - - -/***/ }), - -/***/ 15770: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.STSServiceException = exports.__ServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -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; - - -/***/ }), - -/***/ 20106: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(21780), exports); - - -/***/ }), - -/***/ 21780: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GetSessionTokenResponseFilterSensitiveLog = exports.GetFederationTokenResponseFilterSensitiveLog = exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = exports.AssumeRoleWithSAMLResponseFilterSensitiveLog = exports.AssumeRoleWithSAMLRequestFilterSensitiveLog = exports.AssumeRoleResponseFilterSensitiveLog = exports.CredentialsFilterSensitiveLog = exports.InvalidAuthorizationMessageException = exports.IDPCommunicationErrorException = exports.InvalidIdentityTokenException = exports.IDPRejectedClaimException = exports.RegionDisabledException = exports.PackedPolicyTooLargeException = exports.MalformedPolicyDocumentException = exports.ExpiredTokenException = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const STSServiceException_1 = __nccwpck_require__(15770); -class ExpiredTokenException extends STSServiceException_1.STSServiceException { - constructor(opts) { - super({ - name: "ExpiredTokenException", - $fault: "client", - ...opts, - }); - this.name = "ExpiredTokenException"; - this.$fault = "client"; - Object.setPrototypeOf(this, ExpiredTokenException.prototype); - } -} -exports.ExpiredTokenException = ExpiredTokenException; -class MalformedPolicyDocumentException extends STSServiceException_1.STSServiceException { - constructor(opts) { - super({ - name: "MalformedPolicyDocumentException", - $fault: "client", - ...opts, - }); - this.name = "MalformedPolicyDocumentException"; - this.$fault = "client"; - Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); - } -} -exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException; -class PackedPolicyTooLargeException extends STSServiceException_1.STSServiceException { - constructor(opts) { - super({ - name: "PackedPolicyTooLargeException", - $fault: "client", - ...opts, - }); - this.name = "PackedPolicyTooLargeException"; - this.$fault = "client"; - Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); - } -} -exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException; -class RegionDisabledException extends STSServiceException_1.STSServiceException { - constructor(opts) { - super({ - name: "RegionDisabledException", - $fault: "client", - ...opts, - }); - this.name = "RegionDisabledException"; - this.$fault = "client"; - Object.setPrototypeOf(this, RegionDisabledException.prototype); - } -} -exports.RegionDisabledException = RegionDisabledException; -class IDPRejectedClaimException extends STSServiceException_1.STSServiceException { - constructor(opts) { - super({ - name: "IDPRejectedClaimException", - $fault: "client", - ...opts, - }); - this.name = "IDPRejectedClaimException"; - this.$fault = "client"; - Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); - } -} -exports.IDPRejectedClaimException = IDPRejectedClaimException; -class InvalidIdentityTokenException extends STSServiceException_1.STSServiceException { - constructor(opts) { - super({ - name: "InvalidIdentityTokenException", - $fault: "client", - ...opts, - }); - this.name = "InvalidIdentityTokenException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); - } -} -exports.InvalidIdentityTokenException = InvalidIdentityTokenException; -class IDPCommunicationErrorException extends STSServiceException_1.STSServiceException { - constructor(opts) { - super({ - name: "IDPCommunicationErrorException", - $fault: "client", - ...opts, - }); - this.name = "IDPCommunicationErrorException"; - this.$fault = "client"; - Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); - } -} -exports.IDPCommunicationErrorException = IDPCommunicationErrorException; -class InvalidAuthorizationMessageException extends STSServiceException_1.STSServiceException { - constructor(opts) { - super({ - name: "InvalidAuthorizationMessageException", - $fault: "client", - ...opts, - }); - this.name = "InvalidAuthorizationMessageException"; - this.$fault = "client"; - Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype); - } -} -exports.InvalidAuthorizationMessageException = InvalidAuthorizationMessageException; -const CredentialsFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.SecretAccessKey && { SecretAccessKey: smithy_client_1.SENSITIVE_STRING }), -}); -exports.CredentialsFilterSensitiveLog = CredentialsFilterSensitiveLog; -const AssumeRoleResponseFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.Credentials && { Credentials: (0, exports.CredentialsFilterSensitiveLog)(obj.Credentials) }), -}); -exports.AssumeRoleResponseFilterSensitiveLog = AssumeRoleResponseFilterSensitiveLog; -const AssumeRoleWithSAMLRequestFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.SAMLAssertion && { SAMLAssertion: smithy_client_1.SENSITIVE_STRING }), -}); -exports.AssumeRoleWithSAMLRequestFilterSensitiveLog = AssumeRoleWithSAMLRequestFilterSensitiveLog; -const AssumeRoleWithSAMLResponseFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.Credentials && { Credentials: (0, exports.CredentialsFilterSensitiveLog)(obj.Credentials) }), -}); -exports.AssumeRoleWithSAMLResponseFilterSensitiveLog = AssumeRoleWithSAMLResponseFilterSensitiveLog; -const AssumeRoleWithWebIdentityRequestFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.WebIdentityToken && { WebIdentityToken: smithy_client_1.SENSITIVE_STRING }), -}); -exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = AssumeRoleWithWebIdentityRequestFilterSensitiveLog; -const AssumeRoleWithWebIdentityResponseFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.Credentials && { Credentials: (0, exports.CredentialsFilterSensitiveLog)(obj.Credentials) }), -}); -exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = AssumeRoleWithWebIdentityResponseFilterSensitiveLog; -const GetFederationTokenResponseFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.Credentials && { Credentials: (0, exports.CredentialsFilterSensitiveLog)(obj.Credentials) }), -}); -exports.GetFederationTokenResponseFilterSensitiveLog = GetFederationTokenResponseFilterSensitiveLog; -const GetSessionTokenResponseFilterSensitiveLog = (obj) => ({ - ...obj, - ...(obj.Credentials && { Credentials: (0, exports.CredentialsFilterSensitiveLog)(obj.Credentials) }), -}); -exports.GetSessionTokenResponseFilterSensitiveLog = GetSessionTokenResponseFilterSensitiveLog; - - -/***/ }), - -/***/ 10740: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.de_GetSessionTokenCommand = exports.de_GetFederationTokenCommand = exports.de_GetCallerIdentityCommand = exports.de_GetAccessKeyInfoCommand = exports.de_DecodeAuthorizationMessageCommand = exports.de_AssumeRoleWithWebIdentityCommand = exports.de_AssumeRoleWithSAMLCommand = exports.de_AssumeRoleCommand = exports.se_GetSessionTokenCommand = exports.se_GetFederationTokenCommand = exports.se_GetCallerIdentityCommand = exports.se_GetAccessKeyInfoCommand = exports.se_DecodeAuthorizationMessageCommand = exports.se_AssumeRoleWithWebIdentityCommand = exports.se_AssumeRoleWithSAMLCommand = exports.se_AssumeRoleCommand = void 0; -const protocol_http_1 = __nccwpck_require__(12223); -const smithy_client_1 = __nccwpck_require__(63570); -const fast_xml_parser_1 = __nccwpck_require__(12603); -const models_0_1 = __nccwpck_require__(21780); -const STSServiceException_1 = __nccwpck_require__(15770); -const se_AssumeRoleCommand = async (input, context) => { - const headers = SHARED_HEADERS; - let body; - body = buildFormUrlencodedString({ - ...se_AssumeRoleRequest(input, context), - Action: "AssumeRole", - Version: "2011-06-15", - }); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_AssumeRoleCommand = se_AssumeRoleCommand; -const se_AssumeRoleWithSAMLCommand = async (input, context) => { - const headers = SHARED_HEADERS; - let body; - body = buildFormUrlencodedString({ - ...se_AssumeRoleWithSAMLRequest(input, context), - Action: "AssumeRoleWithSAML", - Version: "2011-06-15", - }); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_AssumeRoleWithSAMLCommand = se_AssumeRoleWithSAMLCommand; -const se_AssumeRoleWithWebIdentityCommand = async (input, context) => { - const headers = SHARED_HEADERS; - let body; - body = buildFormUrlencodedString({ - ...se_AssumeRoleWithWebIdentityRequest(input, context), - Action: "AssumeRoleWithWebIdentity", - Version: "2011-06-15", - }); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_AssumeRoleWithWebIdentityCommand = se_AssumeRoleWithWebIdentityCommand; -const se_DecodeAuthorizationMessageCommand = async (input, context) => { - const headers = SHARED_HEADERS; - let body; - body = buildFormUrlencodedString({ - ...se_DecodeAuthorizationMessageRequest(input, context), - Action: "DecodeAuthorizationMessage", - Version: "2011-06-15", - }); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_DecodeAuthorizationMessageCommand = se_DecodeAuthorizationMessageCommand; -const se_GetAccessKeyInfoCommand = async (input, context) => { - const headers = SHARED_HEADERS; - let body; - body = buildFormUrlencodedString({ - ...se_GetAccessKeyInfoRequest(input, context), - Action: "GetAccessKeyInfo", - Version: "2011-06-15", - }); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetAccessKeyInfoCommand = se_GetAccessKeyInfoCommand; -const se_GetCallerIdentityCommand = async (input, context) => { - const headers = SHARED_HEADERS; - let body; - body = buildFormUrlencodedString({ - ...se_GetCallerIdentityRequest(input, context), - Action: "GetCallerIdentity", - Version: "2011-06-15", - }); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetCallerIdentityCommand = se_GetCallerIdentityCommand; -const se_GetFederationTokenCommand = async (input, context) => { - const headers = SHARED_HEADERS; - let body; - body = buildFormUrlencodedString({ - ...se_GetFederationTokenRequest(input, context), - Action: "GetFederationToken", - Version: "2011-06-15", - }); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetFederationTokenCommand = se_GetFederationTokenCommand; -const se_GetSessionTokenCommand = async (input, context) => { - const headers = SHARED_HEADERS; - let body; - body = buildFormUrlencodedString({ - ...se_GetSessionTokenRequest(input, context), - Action: "GetSessionToken", - Version: "2011-06-15", - }); - return buildHttpRpcRequest(context, headers, "/", undefined, body); -}; -exports.se_GetSessionTokenCommand = se_GetSessionTokenCommand; -const de_AssumeRoleCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_AssumeRoleCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_AssumeRoleResponse(data.AssumeRoleResult, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_AssumeRoleCommand = de_AssumeRoleCommand; -const de_AssumeRoleCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredTokenException": - case "com.amazonaws.sts#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.sts#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PackedPolicyTooLarge": - case "com.amazonaws.sts#PackedPolicyTooLargeException": - throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; -const de_AssumeRoleWithSAMLCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_AssumeRoleWithSAMLCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_AssumeRoleWithSAMLCommand = de_AssumeRoleWithSAMLCommand; -const de_AssumeRoleWithSAMLCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredTokenException": - case "com.amazonaws.sts#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "IDPRejectedClaim": - case "com.amazonaws.sts#IDPRejectedClaimException": - throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context); - case "InvalidIdentityToken": - case "com.amazonaws.sts#InvalidIdentityTokenException": - throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.sts#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PackedPolicyTooLarge": - case "com.amazonaws.sts#PackedPolicyTooLargeException": - throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; -const de_AssumeRoleWithWebIdentityCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_AssumeRoleWithWebIdentityCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_AssumeRoleWithWebIdentityCommand = de_AssumeRoleWithWebIdentityCommand; -const de_AssumeRoleWithWebIdentityCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredTokenException": - case "com.amazonaws.sts#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "IDPCommunicationError": - case "com.amazonaws.sts#IDPCommunicationErrorException": - throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context); - case "IDPRejectedClaim": - case "com.amazonaws.sts#IDPRejectedClaimException": - throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context); - case "InvalidIdentityToken": - case "com.amazonaws.sts#InvalidIdentityTokenException": - throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.sts#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PackedPolicyTooLarge": - case "com.amazonaws.sts#PackedPolicyTooLargeException": - throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; -const de_DecodeAuthorizationMessageCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_DecodeAuthorizationMessageCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_DecodeAuthorizationMessageCommand = de_DecodeAuthorizationMessageCommand; -const de_DecodeAuthorizationMessageCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAuthorizationMessageException": - case "com.amazonaws.sts#InvalidAuthorizationMessageException": - throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; -const de_GetAccessKeyInfoCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetAccessKeyInfoCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetAccessKeyInfoCommand = de_GetAccessKeyInfoCommand; -const de_GetAccessKeyInfoCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; -const de_GetCallerIdentityCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetCallerIdentityCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetCallerIdentityCommand = de_GetCallerIdentityCommand; -const de_GetCallerIdentityCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; -const de_GetFederationTokenCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetFederationTokenCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_GetFederationTokenResponse(data.GetFederationTokenResult, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetFederationTokenCommand = de_GetFederationTokenCommand; -const de_GetFederationTokenCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "MalformedPolicyDocument": - case "com.amazonaws.sts#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PackedPolicyTooLarge": - case "com.amazonaws.sts#PackedPolicyTooLargeException": - throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; -const de_GetSessionTokenCommand = async (output, context) => { - if (output.statusCode >= 300) { - return de_GetSessionTokenCommandError(output, context); - } - const data = await parseBody(output.body, context); - let contents = {}; - contents = de_GetSessionTokenResponse(data.GetSessionTokenResult, context); - const response = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; -exports.de_GetSessionTokenCommand = de_GetSessionTokenCommand; -const de_GetSessionTokenCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; -const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = de_ExpiredTokenException(body.Error, context); - const exception = new models_0_1.ExpiredTokenException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_IDPCommunicationErrorExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = de_IDPCommunicationErrorException(body.Error, context); - const exception = new models_0_1.IDPCommunicationErrorException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_IDPRejectedClaimExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = de_IDPRejectedClaimException(body.Error, context); - const exception = new models_0_1.IDPRejectedClaimException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidAuthorizationMessageExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = de_InvalidAuthorizationMessageException(body.Error, context); - const exception = new models_0_1.InvalidAuthorizationMessageException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_InvalidIdentityTokenExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = de_InvalidIdentityTokenException(body.Error, context); - const exception = new models_0_1.InvalidIdentityTokenException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = de_MalformedPolicyDocumentException(body.Error, context); - const exception = new models_0_1.MalformedPolicyDocumentException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_PackedPolicyTooLargeExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = de_PackedPolicyTooLargeException(body.Error, context); - const exception = new models_0_1.PackedPolicyTooLargeException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const de_RegionDisabledExceptionRes = async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = de_RegionDisabledException(body.Error, context); - const exception = new models_0_1.RegionDisabledException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return (0, smithy_client_1.decorateServiceException)(exception, body); -}; -const se_AssumeRoleRequest = (input, context) => { - const entries = {}; - if (input.RoleArn != null) { - entries["RoleArn"] = input.RoleArn; - } - if (input.RoleSessionName != null) { - entries["RoleSessionName"] = input.RoleSessionName; - } - if (input.PolicyArns != null) { - const memberEntries = se_policyDescriptorListType(input.PolicyArns, context); - if (input.PolicyArns?.length === 0) { - entries.PolicyArns = []; - } - Object.entries(memberEntries).forEach(([key, value]) => { - const loc = `PolicyArns.${key}`; - entries[loc] = value; - }); - } - if (input.Policy != null) { - entries["Policy"] = input.Policy; - } - if (input.DurationSeconds != null) { - entries["DurationSeconds"] = input.DurationSeconds; - } - if (input.Tags != null) { - const memberEntries = se_tagListType(input.Tags, context); - if (input.Tags?.length === 0) { - entries.Tags = []; - } - Object.entries(memberEntries).forEach(([key, value]) => { - const loc = `Tags.${key}`; - entries[loc] = value; - }); - } - if (input.TransitiveTagKeys != null) { - const memberEntries = se_tagKeyListType(input.TransitiveTagKeys, context); - if (input.TransitiveTagKeys?.length === 0) { - entries.TransitiveTagKeys = []; - } - Object.entries(memberEntries).forEach(([key, value]) => { - const loc = `TransitiveTagKeys.${key}`; - entries[loc] = value; - }); - } - if (input.ExternalId != null) { - entries["ExternalId"] = input.ExternalId; - } - if (input.SerialNumber != null) { - entries["SerialNumber"] = input.SerialNumber; - } - if (input.TokenCode != null) { - entries["TokenCode"] = input.TokenCode; - } - if (input.SourceIdentity != null) { - entries["SourceIdentity"] = input.SourceIdentity; - } - if (input.ProvidedContexts != null) { - const memberEntries = se_ProvidedContextsListType(input.ProvidedContexts, context); - if (input.ProvidedContexts?.length === 0) { - entries.ProvidedContexts = []; - } - Object.entries(memberEntries).forEach(([key, value]) => { - const loc = `ProvidedContexts.${key}`; - entries[loc] = value; - }); - } - return entries; -}; -const se_AssumeRoleWithSAMLRequest = (input, context) => { - const entries = {}; - if (input.RoleArn != null) { - entries["RoleArn"] = input.RoleArn; - } - if (input.PrincipalArn != null) { - entries["PrincipalArn"] = input.PrincipalArn; - } - if (input.SAMLAssertion != null) { - entries["SAMLAssertion"] = input.SAMLAssertion; - } - if (input.PolicyArns != null) { - const memberEntries = se_policyDescriptorListType(input.PolicyArns, context); - if (input.PolicyArns?.length === 0) { - entries.PolicyArns = []; - } - Object.entries(memberEntries).forEach(([key, value]) => { - const loc = `PolicyArns.${key}`; - entries[loc] = value; - }); - } - if (input.Policy != null) { - entries["Policy"] = input.Policy; - } - if (input.DurationSeconds != null) { - entries["DurationSeconds"] = input.DurationSeconds; - } - return entries; -}; -const se_AssumeRoleWithWebIdentityRequest = (input, context) => { - const entries = {}; - if (input.RoleArn != null) { - entries["RoleArn"] = input.RoleArn; - } - if (input.RoleSessionName != null) { - entries["RoleSessionName"] = input.RoleSessionName; - } - if (input.WebIdentityToken != null) { - entries["WebIdentityToken"] = input.WebIdentityToken; - } - if (input.ProviderId != null) { - entries["ProviderId"] = input.ProviderId; - } - if (input.PolicyArns != null) { - const memberEntries = se_policyDescriptorListType(input.PolicyArns, context); - if (input.PolicyArns?.length === 0) { - entries.PolicyArns = []; - } - Object.entries(memberEntries).forEach(([key, value]) => { - const loc = `PolicyArns.${key}`; - entries[loc] = value; - }); - } - if (input.Policy != null) { - entries["Policy"] = input.Policy; - } - if (input.DurationSeconds != null) { - entries["DurationSeconds"] = input.DurationSeconds; - } - return entries; -}; -const se_DecodeAuthorizationMessageRequest = (input, context) => { - const entries = {}; - if (input.EncodedMessage != null) { - entries["EncodedMessage"] = input.EncodedMessage; - } - return entries; -}; -const se_GetAccessKeyInfoRequest = (input, context) => { - const entries = {}; - if (input.AccessKeyId != null) { - entries["AccessKeyId"] = input.AccessKeyId; - } - return entries; -}; -const se_GetCallerIdentityRequest = (input, context) => { - const entries = {}; - return entries; -}; -const se_GetFederationTokenRequest = (input, context) => { - const entries = {}; - if (input.Name != null) { - entries["Name"] = input.Name; - } - if (input.Policy != null) { - entries["Policy"] = input.Policy; - } - if (input.PolicyArns != null) { - const memberEntries = se_policyDescriptorListType(input.PolicyArns, context); - if (input.PolicyArns?.length === 0) { - entries.PolicyArns = []; - } - Object.entries(memberEntries).forEach(([key, value]) => { - const loc = `PolicyArns.${key}`; - entries[loc] = value; - }); - } - if (input.DurationSeconds != null) { - entries["DurationSeconds"] = input.DurationSeconds; - } - if (input.Tags != null) { - const memberEntries = se_tagListType(input.Tags, context); - if (input.Tags?.length === 0) { - entries.Tags = []; - } - Object.entries(memberEntries).forEach(([key, value]) => { - const loc = `Tags.${key}`; - entries[loc] = value; - }); - } - return entries; -}; -const se_GetSessionTokenRequest = (input, context) => { - const entries = {}; - if (input.DurationSeconds != null) { - entries["DurationSeconds"] = input.DurationSeconds; - } - if (input.SerialNumber != null) { - entries["SerialNumber"] = input.SerialNumber; - } - if (input.TokenCode != null) { - entries["TokenCode"] = input.TokenCode; - } - return entries; -}; -const se_policyDescriptorListType = (input, context) => { - const entries = {}; - let counter = 1; - for (const entry of input) { - if (entry === null) { - continue; - } - const memberEntries = se_PolicyDescriptorType(entry, context); - Object.entries(memberEntries).forEach(([key, value]) => { - entries[`member.${counter}.${key}`] = value; - }); - counter++; - } - return entries; -}; -const se_PolicyDescriptorType = (input, context) => { - const entries = {}; - if (input.arn != null) { - entries["arn"] = input.arn; - } - return entries; -}; -const se_ProvidedContext = (input, context) => { - const entries = {}; - if (input.ProviderArn != null) { - entries["ProviderArn"] = input.ProviderArn; - } - if (input.ContextAssertion != null) { - entries["ContextAssertion"] = input.ContextAssertion; - } - return entries; -}; -const se_ProvidedContextsListType = (input, context) => { - const entries = {}; - let counter = 1; - for (const entry of input) { - if (entry === null) { - continue; - } - const memberEntries = se_ProvidedContext(entry, context); - Object.entries(memberEntries).forEach(([key, value]) => { - entries[`member.${counter}.${key}`] = value; - }); - counter++; - } - return entries; -}; -const se_Tag = (input, context) => { - const entries = {}; - if (input.Key != null) { - entries["Key"] = input.Key; - } - if (input.Value != null) { - entries["Value"] = input.Value; - } - return entries; -}; -const se_tagKeyListType = (input, context) => { - const entries = {}; - let counter = 1; - for (const entry of input) { - if (entry === null) { - continue; - } - entries[`member.${counter}`] = entry; - counter++; - } - return entries; -}; -const se_tagListType = (input, context) => { - const entries = {}; - let counter = 1; - for (const entry of input) { - if (entry === null) { - continue; - } - const memberEntries = se_Tag(entry, context); - Object.entries(memberEntries).forEach(([key, value]) => { - entries[`member.${counter}.${key}`] = value; - }); - counter++; - } - return entries; -}; -const de_AssumedRoleUser = (output, context) => { - const contents = {}; - if (output["AssumedRoleId"] !== undefined) { - contents.AssumedRoleId = (0, smithy_client_1.expectString)(output["AssumedRoleId"]); - } - if (output["Arn"] !== undefined) { - contents.Arn = (0, smithy_client_1.expectString)(output["Arn"]); - } - return contents; -}; -const de_AssumeRoleResponse = (output, context) => { - const contents = {}; - if (output["Credentials"] !== undefined) { - contents.Credentials = de_Credentials(output["Credentials"], context); - } - if (output["AssumedRoleUser"] !== undefined) { - contents.AssumedRoleUser = de_AssumedRoleUser(output["AssumedRoleUser"], context); - } - if (output["PackedPolicySize"] !== undefined) { - contents.PackedPolicySize = (0, smithy_client_1.strictParseInt32)(output["PackedPolicySize"]); - } - if (output["SourceIdentity"] !== undefined) { - contents.SourceIdentity = (0, smithy_client_1.expectString)(output["SourceIdentity"]); - } - return contents; -}; -const de_AssumeRoleWithSAMLResponse = (output, context) => { - const contents = {}; - if (output["Credentials"] !== undefined) { - contents.Credentials = de_Credentials(output["Credentials"], context); - } - if (output["AssumedRoleUser"] !== undefined) { - contents.AssumedRoleUser = de_AssumedRoleUser(output["AssumedRoleUser"], context); - } - if (output["PackedPolicySize"] !== undefined) { - contents.PackedPolicySize = (0, smithy_client_1.strictParseInt32)(output["PackedPolicySize"]); - } - if (output["Subject"] !== undefined) { - contents.Subject = (0, smithy_client_1.expectString)(output["Subject"]); - } - if (output["SubjectType"] !== undefined) { - contents.SubjectType = (0, smithy_client_1.expectString)(output["SubjectType"]); - } - if (output["Issuer"] !== undefined) { - contents.Issuer = (0, smithy_client_1.expectString)(output["Issuer"]); - } - if (output["Audience"] !== undefined) { - contents.Audience = (0, smithy_client_1.expectString)(output["Audience"]); - } - if (output["NameQualifier"] !== undefined) { - contents.NameQualifier = (0, smithy_client_1.expectString)(output["NameQualifier"]); - } - if (output["SourceIdentity"] !== undefined) { - contents.SourceIdentity = (0, smithy_client_1.expectString)(output["SourceIdentity"]); - } - return contents; -}; -const de_AssumeRoleWithWebIdentityResponse = (output, context) => { - const contents = {}; - if (output["Credentials"] !== undefined) { - contents.Credentials = de_Credentials(output["Credentials"], context); - } - if (output["SubjectFromWebIdentityToken"] !== undefined) { - contents.SubjectFromWebIdentityToken = (0, smithy_client_1.expectString)(output["SubjectFromWebIdentityToken"]); - } - if (output["AssumedRoleUser"] !== undefined) { - contents.AssumedRoleUser = de_AssumedRoleUser(output["AssumedRoleUser"], context); - } - if (output["PackedPolicySize"] !== undefined) { - contents.PackedPolicySize = (0, smithy_client_1.strictParseInt32)(output["PackedPolicySize"]); - } - if (output["Provider"] !== undefined) { - contents.Provider = (0, smithy_client_1.expectString)(output["Provider"]); - } - if (output["Audience"] !== undefined) { - contents.Audience = (0, smithy_client_1.expectString)(output["Audience"]); - } - if (output["SourceIdentity"] !== undefined) { - contents.SourceIdentity = (0, smithy_client_1.expectString)(output["SourceIdentity"]); - } - return contents; -}; -const de_Credentials = (output, context) => { - const contents = {}; - if (output["AccessKeyId"] !== undefined) { - contents.AccessKeyId = (0, smithy_client_1.expectString)(output["AccessKeyId"]); - } - if (output["SecretAccessKey"] !== undefined) { - contents.SecretAccessKey = (0, smithy_client_1.expectString)(output["SecretAccessKey"]); - } - if (output["SessionToken"] !== undefined) { - contents.SessionToken = (0, smithy_client_1.expectString)(output["SessionToken"]); - } - if (output["Expiration"] !== undefined) { - contents.Expiration = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output["Expiration"])); - } - return contents; -}; -const de_DecodeAuthorizationMessageResponse = (output, context) => { - const contents = {}; - if (output["DecodedMessage"] !== undefined) { - contents.DecodedMessage = (0, smithy_client_1.expectString)(output["DecodedMessage"]); - } - return contents; -}; -const de_ExpiredTokenException = (output, context) => { - const contents = {}; - if (output["message"] !== undefined) { - contents.message = (0, smithy_client_1.expectString)(output["message"]); - } - return contents; -}; -const de_FederatedUser = (output, context) => { - const contents = {}; - if (output["FederatedUserId"] !== undefined) { - contents.FederatedUserId = (0, smithy_client_1.expectString)(output["FederatedUserId"]); - } - if (output["Arn"] !== undefined) { - contents.Arn = (0, smithy_client_1.expectString)(output["Arn"]); - } - return contents; -}; -const de_GetAccessKeyInfoResponse = (output, context) => { - const contents = {}; - if (output["Account"] !== undefined) { - contents.Account = (0, smithy_client_1.expectString)(output["Account"]); - } - return contents; -}; -const de_GetCallerIdentityResponse = (output, context) => { - const contents = {}; - if (output["UserId"] !== undefined) { - contents.UserId = (0, smithy_client_1.expectString)(output["UserId"]); - } - if (output["Account"] !== undefined) { - contents.Account = (0, smithy_client_1.expectString)(output["Account"]); - } - if (output["Arn"] !== undefined) { - contents.Arn = (0, smithy_client_1.expectString)(output["Arn"]); - } - return contents; -}; -const de_GetFederationTokenResponse = (output, context) => { - const contents = {}; - if (output["Credentials"] !== undefined) { - contents.Credentials = de_Credentials(output["Credentials"], context); - } - if (output["FederatedUser"] !== undefined) { - contents.FederatedUser = de_FederatedUser(output["FederatedUser"], context); - } - if (output["PackedPolicySize"] !== undefined) { - contents.PackedPolicySize = (0, smithy_client_1.strictParseInt32)(output["PackedPolicySize"]); - } - return contents; -}; -const de_GetSessionTokenResponse = (output, context) => { - const contents = {}; - if (output["Credentials"] !== undefined) { - contents.Credentials = de_Credentials(output["Credentials"], context); - } - return contents; -}; -const de_IDPCommunicationErrorException = (output, context) => { - const contents = {}; - if (output["message"] !== undefined) { - contents.message = (0, smithy_client_1.expectString)(output["message"]); - } - return contents; -}; -const de_IDPRejectedClaimException = (output, context) => { - const contents = {}; - if (output["message"] !== undefined) { - contents.message = (0, smithy_client_1.expectString)(output["message"]); - } - return contents; -}; -const de_InvalidAuthorizationMessageException = (output, context) => { - const contents = {}; - if (output["message"] !== undefined) { - contents.message = (0, smithy_client_1.expectString)(output["message"]); - } - return contents; -}; -const de_InvalidIdentityTokenException = (output, context) => { - const contents = {}; - if (output["message"] !== undefined) { - contents.message = (0, smithy_client_1.expectString)(output["message"]); - } - return contents; -}; -const de_MalformedPolicyDocumentException = (output, context) => { - const contents = {}; - if (output["message"] !== undefined) { - contents.message = (0, smithy_client_1.expectString)(output["message"]); - } - return contents; -}; -const de_PackedPolicyTooLargeException = (output, context) => { - const contents = {}; - if (output["message"] !== undefined) { - contents.message = (0, smithy_client_1.expectString)(output["message"]); - } - return contents; -}; -const de_RegionDisabledException = (output, context) => { - const contents = {}; - if (output["message"] !== undefined) { - contents.message = (0, smithy_client_1.expectString)(output["message"]); - } - return contents; -}; -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 collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); -const throwDefaultError = (0, smithy_client_1.withBaseException)(STSServiceException_1.STSServiceException); -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, - }; - if (resolvedHostname !== undefined) { - contents.hostname = resolvedHostname; - } - if (body !== undefined) { - contents.body = body; - } - return new protocol_http_1.HttpRequest(contents); -}; -const SHARED_HEADERS = { - "content-type": "application/x-www-form-urlencoded", -}; -const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - 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"); - const parsedObj = parser.parse(encoded); - const textNodeName = "#text"; - const key = Object.keys(parsedObj)[0]; - const parsedObjToReturn = parsedObj[key]; - if (parsedObjToReturn[textNodeName]) { - parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; - delete parsedObjToReturn[textNodeName]; - } - return (0, smithy_client_1.getValueFromTextNode)(parsedObjToReturn); - } - return {}; -}); -const parseErrorBody = async (errorBody, context) => { - const value = await parseBody(errorBody, context); - if (value.Error) { - value.Error.message = value.Error.message ?? value.Error.Message; - } - return value; -}; -const buildFormUrlencodedString = (formEntries) => Object.entries(formEntries) - .map(([key, value]) => (0, smithy_client_1.extendedEncodeURIComponent)(key) + "=" + (0, smithy_client_1.extendedEncodeURIComponent)(value)) - .join("&"); -const loadQueryErrorCode = (output, data) => { - if (data.Error?.Code !== undefined) { - return data.Error.Code; - } - if (output.statusCode == 404) { - return "NotFound"; - } -}; - - -/***/ }), - -/***/ 83405: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const tslib_1 = __nccwpck_require__(4351); -const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(7947)); -const defaultStsRoleAssumers_1 = __nccwpck_require__(90048); -const credential_provider_node_1 = __nccwpck_require__(75531); -const util_user_agent_node_1 = __nccwpck_require__(98095); -const config_resolver_1 = __nccwpck_require__(53098); -const hash_node_1 = __nccwpck_require__(3081); -const middleware_retry_1 = __nccwpck_require__(96039); -const node_config_provider_1 = __nccwpck_require__(33461); -const node_http_handler_1 = __nccwpck_require__(58303); -const util_body_length_node_1 = __nccwpck_require__(68075); -const util_retry_1 = __nccwpck_require__(84902); -const runtimeConfig_shared_1 = __nccwpck_require__(52642); -const smithy_client_1 = __nccwpck_require__(63570); -const util_defaults_mode_node_1 = __nccwpck_require__(72429); -const smithy_client_2 = __nccwpck_require__(63570); -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); - return { - ...clientSharedValues, - ...config, - runtime: "node", - defaultsMode, - bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, defaultStsRoleAssumers_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider), - defaultUserAgentProvider: config?.defaultUserAgentProvider ?? - (0, util_user_agent_node_1.defaultUserAgent)({ 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), - region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(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, - }), - 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), - useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - }; -}; -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), - -/***/ 52642: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRuntimeConfig = void 0; -const smithy_client_1 = __nccwpck_require__(63570); -const url_parser_1 = __nccwpck_require__(14681); -const util_base64_1 = __nccwpck_require__(75600); -const util_utf8_1 = __nccwpck_require__(41895); -const endpointResolver_1 = __nccwpck_require__(41203); -const getRuntimeConfig = (config) => ({ - apiVersion: "2011-06-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 ?? [], - logger: config?.logger ?? new smithy_client_1.NoOpLogger(), - serviceId: config?.serviceId ?? "STS", - urlParser: config?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, -}); -exports.getRuntimeConfig = getRuntimeConfig; - - -/***/ }), - -/***/ 32053: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRuntimeExtensions = void 0; -const region_config_resolver_1 = __nccwpck_require__(18156); -const protocol_http_1 = __nccwpck_require__(12223); -const smithy_client_1 = __nccwpck_require__(63570); -const asPartial = (t) => t; -const resolveRuntimeExtensions = (runtimeConfig, extensions) => { - const extensionConfiguration = { - ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)), - }; - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return { - ...runtimeConfig, - ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), - ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), - ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), - }; -}; -exports.resolveRuntimeExtensions = resolveRuntimeExtensions; - - -/***/ }), - -/***/ 48922: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - - -/***/ }), - -/***/ 73546: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -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; -}; -exports.getTransformedHeaders = getTransformedHeaders; - - -/***/ }), - -/***/ 58303: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(72740), exports); -tslib_1.__exportStar(__nccwpck_require__(94175), exports); -tslib_1.__exportStar(__nccwpck_require__(47097), exports); - - -/***/ }), - -/***/ 72740: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; -const protocol_http_1 = __nccwpck_require__(12223); -const querystring_builder_1 = __nccwpck_require__(38815); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(48922); -const get_transformed_headers_1 = __nccwpck_require__(73546); -const set_connection_timeout_1 = __nccwpck_require__(2976); -const set_socket_keep_alive_1 = __nccwpck_require__(40131); -const set_socket_timeout_1 = __nccwpck_require__(31978); -const write_request_body_1 = __nccwpck_require__(41422); -exports.DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - var _a, _b; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - auth, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - }); - } - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } -} -exports.NodeHttpHandler = NodeHttpHandler; - - -/***/ }), - -/***/ 70066: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionManager = void 0; -const tslib_1 = __nccwpck_require__(4351); -const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); -const node_http2_connection_pool_1 = __nccwpck_require__(81737); -class NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const 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_1.default.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 node_http2_connection_pool_1.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) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); - } -} -exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; - - -/***/ }), - -/***/ 81737: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionPool = void 0; -class NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions !== null && sessions !== void 0 ? 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(); - } - } - } - } -} -exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; - - -/***/ }), - -/***/ 94175: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(12223); -const querystring_builder_1 = __nccwpck_require__(38815); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(73546); -const node_http2_connection_manager_1 = __nccwpck_require__(70066); -const write_request_body_1 = __nccwpck_require__(41422); -class NodeHttp2Handler { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); - 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 } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a, _b, _c; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal === null || abortSignal === void 0 ? void 0 : 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 = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - 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 = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } -} -exports.NodeHttp2Handler = NodeHttp2Handler; - - -/***/ }), - -/***/ 2976: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; - } - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - else { - clearTimeout(timeoutId); - } - }); -}; -exports.setConnectionTimeout = setConnectionTimeout; - - -/***/ }), - -/***/ 40131: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketKeepAlive = void 0; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; - } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); -}; -exports.setSocketKeepAlive = setSocketKeepAlive; - - -/***/ }), - -/***/ 31978: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); -}; -exports.setSocketTimeout = setSocketTimeout; - - -/***/ }), - -/***/ 95854: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } -} -exports.Collector = Collector; - - -/***/ }), - -/***/ 47097: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(95854); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.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); - }); -}); -exports.streamCollector = streamCollector; - - -/***/ }), - -/***/ 41422: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -const MIN_WAIT_TIME = 1000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - var _a; - const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }), - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} - - -/***/ }), - -/***/ 8452: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(71551); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 13374: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 10944: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 75612: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(10944), exports); - - -/***/ }), - -/***/ 86749: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61204: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 5193: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 12223: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(75612), exports); -tslib_1.__exportStar(__nccwpck_require__(8452), exports); -tslib_1.__exportStar(__nccwpck_require__(13374), exports); -tslib_1.__exportStar(__nccwpck_require__(86749), exports); -tslib_1.__exportStar(__nccwpck_require__(61204), exports); -tslib_1.__exportStar(__nccwpck_require__(5193), exports); -tslib_1.__exportStar(__nccwpck_require__(85583), exports); -tslib_1.__exportStar(__nccwpck_require__(28066), exports); - - -/***/ }), - -/***/ 85583: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 28066: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 38815: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(2996); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } - } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; - - -/***/ }), - -/***/ 88152: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 92514: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 41913: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61632: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48313: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 22840: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 14859: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 51530: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(14859), exports); -tslib_1.__exportStar(__nccwpck_require__(96439), exports); -tslib_1.__exportStar(__nccwpck_require__(58865), exports); - - -/***/ }), - -/***/ 96439: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 58865: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 33558: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 17043: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 54550: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 79044: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21391: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34697: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 77706: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 50616: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(79044), exports); -tslib_1.__exportStar(__nccwpck_require__(21391), exports); -tslib_1.__exportStar(__nccwpck_require__(34697), exports); -tslib_1.__exportStar(__nccwpck_require__(25250), exports); -tslib_1.__exportStar(__nccwpck_require__(77706), exports); - - -/***/ }), - -/***/ 25250: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 440: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34493: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 52685: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(34493); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 90339: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 17390: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(52685), exports); -tslib_1.__exportStar(__nccwpck_require__(90339), exports); -var checksum_1 = __nccwpck_require__(34493); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 73720: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 13908: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 31023: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 25340: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(13908), exports); -tslib_1.__exportStar(__nccwpck_require__(31023), exports); - - -/***/ }), - -/***/ 71551: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(88152), exports); -tslib_1.__exportStar(__nccwpck_require__(92514), exports); -tslib_1.__exportStar(__nccwpck_require__(41913), exports); -tslib_1.__exportStar(__nccwpck_require__(61632), exports); -tslib_1.__exportStar(__nccwpck_require__(48313), exports); -tslib_1.__exportStar(__nccwpck_require__(22840), exports); -tslib_1.__exportStar(__nccwpck_require__(51530), exports); -tslib_1.__exportStar(__nccwpck_require__(33558), exports); -tslib_1.__exportStar(__nccwpck_require__(17043), exports); -tslib_1.__exportStar(__nccwpck_require__(54550), exports); -tslib_1.__exportStar(__nccwpck_require__(50616), exports); -tslib_1.__exportStar(__nccwpck_require__(440), exports); -tslib_1.__exportStar(__nccwpck_require__(17390), exports); -tslib_1.__exportStar(__nccwpck_require__(73720), exports); -tslib_1.__exportStar(__nccwpck_require__(25340), exports); -tslib_1.__exportStar(__nccwpck_require__(23519), exports); -tslib_1.__exportStar(__nccwpck_require__(43347), exports); -tslib_1.__exportStar(__nccwpck_require__(27319), exports); -tslib_1.__exportStar(__nccwpck_require__(90229), exports); -tslib_1.__exportStar(__nccwpck_require__(95994), exports); -tslib_1.__exportStar(__nccwpck_require__(29703), exports); -tslib_1.__exportStar(__nccwpck_require__(62540), exports); -tslib_1.__exportStar(__nccwpck_require__(36267), exports); -tslib_1.__exportStar(__nccwpck_require__(75233), exports); -tslib_1.__exportStar(__nccwpck_require__(49620), exports); -tslib_1.__exportStar(__nccwpck_require__(29683), exports); -tslib_1.__exportStar(__nccwpck_require__(99324), exports); -tslib_1.__exportStar(__nccwpck_require__(82771), exports); -tslib_1.__exportStar(__nccwpck_require__(19222), exports); -tslib_1.__exportStar(__nccwpck_require__(72155), exports); -tslib_1.__exportStar(__nccwpck_require__(20346), exports); -tslib_1.__exportStar(__nccwpck_require__(57671), exports); -tslib_1.__exportStar(__nccwpck_require__(62165), exports); -tslib_1.__exportStar(__nccwpck_require__(6688), exports); - - -/***/ }), - -/***/ 23519: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43347: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 27319: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 90229: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 95994: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 29703: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 62540: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 36267: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 75233: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 49620: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 29683: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 99324: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 82771: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 19222: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 72155: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20346: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57671: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 62165: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 6688: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 3400: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(84025); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; - - -/***/ }), - -/***/ 84025: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; - - -/***/ }), - -/***/ 2996: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(84025), exports); -tslib_1.__exportStar(__nccwpck_require__(3400), exports); - - -/***/ }), - -/***/ 80255: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromEnv = exports.ENV_EXPIRATION = exports.ENV_SESSION = exports.ENV_SECRET = exports.ENV_KEY = void 0; -const property_provider_1 = __nccwpck_require__(79721); -exports.ENV_KEY = "AWS_ACCESS_KEY_ID"; -exports.ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; -exports.ENV_SESSION = "AWS_SESSION_TOKEN"; -exports.ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; -const fromEnv = () => async () => { - const accessKeyId = process.env[exports.ENV_KEY]; - const secretAccessKey = process.env[exports.ENV_SECRET]; - const sessionToken = process.env[exports.ENV_SESSION]; - const expiry = process.env[exports.ENV_EXPIRATION]; - if (accessKeyId && secretAccessKey) { - return { - accessKeyId, - secretAccessKey, - ...(sessionToken && { sessionToken }), - ...(expiry && { expiration: new Date(expiry) }), - }; - } - throw new property_provider_1.CredentialsProviderError("Unable to find environment variable credentials."); -}; -exports.fromEnv = fromEnv; - - -/***/ }), - -/***/ 15972: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(80255), exports); - - -/***/ }), - -/***/ 55442: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromIni = void 0; -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const resolveProfileData_1 = __nccwpck_require__(95653); -const fromIni = (init = {}) => async () => { - const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); - return (0, resolveProfileData_1.resolveProfileData)((0, shared_ini_file_loader_1.getProfileName)(init), profiles, init); -}; -exports.fromIni = fromIni; - - -/***/ }), - -/***/ 74203: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(55442), exports); - - -/***/ }), - -/***/ 60853: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveAssumeRoleCredentials = exports.isAssumeRoleProfile = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const resolveCredentialSource_1 = __nccwpck_require__(82458); -const resolveProfileData_1 = __nccwpck_require__(95653); -const isAssumeRoleProfile = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.role_arn === "string" && - ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && - ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && - ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && - (isAssumeRoleWithSourceProfile(arg) || isAssumeRoleWithProviderProfile(arg)); -exports.isAssumeRoleProfile = isAssumeRoleProfile; -const isAssumeRoleWithSourceProfile = (arg) => typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; -const isAssumeRoleWithProviderProfile = (arg) => typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; -const resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}) => { - const data = profiles[profileName]; - if (!options.roleAssumer) { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} requires a role to be assumed, but no role assumption callback was provided.`, false); - } - const { source_profile } = data; - if (source_profile && source_profile in visitedProfiles) { - throw new property_provider_1.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` + - ` ${(0, shared_ini_file_loader_1.getProfileName)(options)}. Profiles visited: ` + - Object.keys(visitedProfiles).join(", "), false); - } - const sourceCredsProvider = source_profile - ? (0, resolveProfileData_1.resolveProfileData)(source_profile, profiles, options, { - ...visitedProfiles, - [source_profile]: true, - }) - : (0, resolveCredentialSource_1.resolveCredentialSource)(data.credential_source, profileName)(); - const params = { - RoleArn: data.role_arn, - RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`, - ExternalId: data.external_id, - DurationSeconds: parseInt(data.duration_seconds || "3600", 10), - }; - const { mfa_serial } = data; - if (mfa_serial) { - if (!options.mfaCodeProvider) { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, false); - } - params.SerialNumber = mfa_serial; - params.TokenCode = await options.mfaCodeProvider(mfa_serial); - } - const sourceCreds = await sourceCredsProvider; - return options.roleAssumer(sourceCreds, params); -}; -exports.resolveAssumeRoleCredentials = resolveAssumeRoleCredentials; - - -/***/ }), - -/***/ 82458: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveCredentialSource = void 0; -const credential_provider_env_1 = __nccwpck_require__(15972); -const credential_provider_imds_1 = __nccwpck_require__(7477); -const property_provider_1 = __nccwpck_require__(79721); -const resolveCredentialSource = (credentialSource, profileName) => { - const sourceProvidersMap = { - EcsContainer: credential_provider_imds_1.fromContainerMetadata, - Ec2InstanceMetadata: credential_provider_imds_1.fromInstanceMetadata, - Environment: credential_provider_env_1.fromEnv, - }; - if (credentialSource in sourceProvidersMap) { - return sourceProvidersMap[credentialSource](); - } - else { - throw new property_provider_1.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` + - `expected EcsContainer or Ec2InstanceMetadata or Environment.`); - } -}; -exports.resolveCredentialSource = resolveCredentialSource; - - -/***/ }), - -/***/ 69993: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveProcessCredentials = exports.isProcessProfile = void 0; -const credential_provider_process_1 = __nccwpck_require__(89969); -const isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; -exports.isProcessProfile = isProcessProfile; -const resolveProcessCredentials = async (options, profile) => (0, credential_provider_process_1.fromProcess)({ - ...options, - profile, -})(); -exports.resolveProcessCredentials = resolveProcessCredentials; - - -/***/ }), - -/***/ 95653: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveProfileData = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const resolveAssumeRoleCredentials_1 = __nccwpck_require__(60853); -const resolveProcessCredentials_1 = __nccwpck_require__(69993); -const resolveSsoCredentials_1 = __nccwpck_require__(59867); -const resolveStaticCredentials_1 = __nccwpck_require__(33071); -const resolveWebIdentityCredentials_1 = __nccwpck_require__(58342); -const resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}) => { - const data = profiles[profileName]; - if (Object.keys(visitedProfiles).length > 0 && (0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) { - return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data); - } - if ((0, resolveAssumeRoleCredentials_1.isAssumeRoleProfile)(data)) { - return (0, resolveAssumeRoleCredentials_1.resolveAssumeRoleCredentials)(profileName, profiles, options, visitedProfiles); - } - if ((0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) { - return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data); - } - if ((0, resolveWebIdentityCredentials_1.isWebIdentityProfile)(data)) { - return (0, resolveWebIdentityCredentials_1.resolveWebIdentityCredentials)(data, options); - } - if ((0, resolveProcessCredentials_1.isProcessProfile)(data)) { - return (0, resolveProcessCredentials_1.resolveProcessCredentials)(options, profileName); - } - if ((0, resolveSsoCredentials_1.isSsoProfile)(data)) { - return (0, resolveSsoCredentials_1.resolveSsoCredentials)(data); - } - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found or parsed in shared credentials file.`); -}; -exports.resolveProfileData = resolveProfileData; - - -/***/ }), - -/***/ 59867: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveSsoCredentials = exports.isSsoProfile = void 0; -const credential_provider_sso_1 = __nccwpck_require__(26414); -var credential_provider_sso_2 = __nccwpck_require__(26414); -Object.defineProperty(exports, "isSsoProfile", ({ enumerable: true, get: function () { return credential_provider_sso_2.isSsoProfile; } })); -const resolveSsoCredentials = (data) => { - const { sso_start_url, sso_account_id, sso_session, sso_region, sso_role_name } = (0, credential_provider_sso_1.validateSsoProfile)(data); - return (0, credential_provider_sso_1.fromSSO)({ - ssoStartUrl: sso_start_url, - ssoAccountId: sso_account_id, - ssoSession: sso_session, - ssoRegion: sso_region, - ssoRoleName: sso_role_name, - })(); -}; -exports.resolveSsoCredentials = resolveSsoCredentials; - - -/***/ }), - -/***/ 33071: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveStaticCredentials = exports.isStaticCredsProfile = void 0; -const isStaticCredsProfile = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.aws_access_key_id === "string" && - typeof arg.aws_secret_access_key === "string" && - ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1; -exports.isStaticCredsProfile = isStaticCredsProfile; -const resolveStaticCredentials = (profile) => Promise.resolve({ - accessKeyId: profile.aws_access_key_id, - secretAccessKey: profile.aws_secret_access_key, - sessionToken: profile.aws_session_token, -}); -exports.resolveStaticCredentials = resolveStaticCredentials; - - -/***/ }), - -/***/ 58342: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveWebIdentityCredentials = exports.isWebIdentityProfile = void 0; -const credential_provider_web_identity_1 = __nccwpck_require__(15646); -const isWebIdentityProfile = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.web_identity_token_file === "string" && - typeof arg.role_arn === "string" && - ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; -exports.isWebIdentityProfile = isWebIdentityProfile; -const resolveWebIdentityCredentials = async (profile, options) => (0, credential_provider_web_identity_1.fromTokenFile)({ - webIdentityTokenFile: profile.web_identity_token_file, - roleArn: profile.role_arn, - roleSessionName: profile.role_session_name, - roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, -})(); -exports.resolveWebIdentityCredentials = resolveWebIdentityCredentials; - - -/***/ }), - -/***/ 15560: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultProvider = void 0; -const credential_provider_env_1 = __nccwpck_require__(15972); -const credential_provider_ini_1 = __nccwpck_require__(74203); -const credential_provider_process_1 = __nccwpck_require__(89969); -const credential_provider_sso_1 = __nccwpck_require__(26414); -const credential_provider_web_identity_1 = __nccwpck_require__(15646); -const property_provider_1 = __nccwpck_require__(79721); -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const remoteProvider_1 = __nccwpck_require__(50626); -const defaultProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)(...(init.profile || process.env[shared_ini_file_loader_1.ENV_PROFILE] ? [] : [(0, credential_provider_env_1.fromEnv)()]), (0, credential_provider_sso_1.fromSSO)(init), (0, credential_provider_ini_1.fromIni)(init), (0, credential_provider_process_1.fromProcess)(init), (0, credential_provider_web_identity_1.fromTokenFile)(init), (0, remoteProvider_1.remoteProvider)(init), async () => { - throw new property_provider_1.CredentialsProviderError("Could not load credentials from any providers", false); -}), (credentials) => credentials.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000, (credentials) => credentials.expiration !== undefined); -exports.defaultProvider = defaultProvider; - - -/***/ }), - -/***/ 75531: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(15560), exports); - - -/***/ }), - -/***/ 50626: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.remoteProvider = exports.ENV_IMDS_DISABLED = void 0; -const credential_provider_imds_1 = __nccwpck_require__(7477); -const property_provider_1 = __nccwpck_require__(79721); -exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; -const remoteProvider = (init) => { - if (process.env[credential_provider_imds_1.ENV_CMDS_RELATIVE_URI] || process.env[credential_provider_imds_1.ENV_CMDS_FULL_URI]) { - return (0, credential_provider_imds_1.fromContainerMetadata)(init); - } - if (process.env[exports.ENV_IMDS_DISABLED]) { - return async () => { - throw new property_provider_1.CredentialsProviderError("EC2 Instance Metadata Service access disabled"); - }; - } - return (0, credential_provider_imds_1.fromInstanceMetadata)(init); -}; -exports.remoteProvider = remoteProvider; - - -/***/ }), - -/***/ 72650: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromProcess = void 0; -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const resolveProcessCredentials_1 = __nccwpck_require__(74926); -const fromProcess = (init = {}) => async () => { - const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); - return (0, resolveProcessCredentials_1.resolveProcessCredentials)((0, shared_ini_file_loader_1.getProfileName)(init), profiles); -}; -exports.fromProcess = fromProcess; - - -/***/ }), - -/***/ 41104: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getValidatedProcessCredentials = void 0; -const getValidatedProcessCredentials = (profileName, data) => { - if (data.Version !== 1) { - throw Error(`Profile ${profileName} credential_process did not return Version 1.`); - } - if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) { - throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); - } - if (data.Expiration) { - const currentTime = new Date(); - const expireTime = new Date(data.Expiration); - if (expireTime < currentTime) { - throw Error(`Profile ${profileName} credential_process returned expired credentials.`); - } - } - return { - accessKeyId: data.AccessKeyId, - secretAccessKey: data.SecretAccessKey, - ...(data.SessionToken && { sessionToken: data.SessionToken }), - ...(data.Expiration && { expiration: new Date(data.Expiration) }), - }; -}; -exports.getValidatedProcessCredentials = getValidatedProcessCredentials; - - -/***/ }), - -/***/ 89969: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(72650), exports); - - -/***/ }), - -/***/ 74926: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveProcessCredentials = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const child_process_1 = __nccwpck_require__(32081); -const util_1 = __nccwpck_require__(73837); -const getValidatedProcessCredentials_1 = __nccwpck_require__(41104); -const resolveProcessCredentials = async (profileName, profiles) => { - const profile = profiles[profileName]; - if (profiles[profileName]) { - const credentialProcess = profile["credential_process"]; - if (credentialProcess !== undefined) { - const execPromise = (0, util_1.promisify)(child_process_1.exec); - try { - const { stdout } = await execPromise(credentialProcess); - let data; - try { - data = JSON.parse(stdout.trim()); - } - catch (_a) { - throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); - } - return (0, getValidatedProcessCredentials_1.getValidatedProcessCredentials)(profileName, data); - } - catch (error) { - throw new property_provider_1.CredentialsProviderError(error.message); - } - } - else { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`); - } - } - else { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`); - } -}; -exports.resolveProcessCredentials = resolveProcessCredentials; - - -/***/ }), - -/***/ 35959: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromSSO = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const isSsoProfile_1 = __nccwpck_require__(32572); -const resolveSSOCredentials_1 = __nccwpck_require__(94729); -const validateSsoProfile_1 = __nccwpck_require__(48098); -const fromSSO = (init = {}) => async () => { - const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, ssoSession } = init; - const profileName = (0, shared_ini_file_loader_1.getProfileName)(init); - if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { - const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); - const profile = profiles[profileName]; - if (!profile) { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} was not found.`); - } - if (!(0, isSsoProfile_1.isSsoProfile)(profile)) { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`); - } - if (profile === null || profile === void 0 ? void 0 : profile.sso_session) { - const ssoSessions = await (0, shared_ini_file_loader_1.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 property_provider_1.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, false); - } - if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { - throw new property_provider_1.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, false); - } - 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 } = (0, validateSsoProfile_1.validateSsoProfile)(profile); - return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ - ssoStartUrl: sso_start_url, - ssoSession: sso_session, - ssoAccountId: sso_account_id, - ssoRegion: sso_region, - ssoRoleName: sso_role_name, - ssoClient: ssoClient, - profile: profileName, - }); - } - else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { - throw new property_provider_1.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + - '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"'); - } - else { - return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ - ssoStartUrl, - ssoSession, - ssoAccountId, - ssoRegion, - ssoRoleName, - ssoClient, - profile: profileName, - }); - } -}; -exports.fromSSO = fromSSO; - - -/***/ }), - -/***/ 26414: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(35959), exports); -tslib_1.__exportStar(__nccwpck_require__(32572), exports); -tslib_1.__exportStar(__nccwpck_require__(86623), exports); -tslib_1.__exportStar(__nccwpck_require__(48098), exports); - - -/***/ }), - -/***/ 32572: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSsoProfile = void 0; -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"); -exports.isSsoProfile = isSsoProfile; - - -/***/ }), - -/***/ 94729: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveSSOCredentials = void 0; -const client_sso_1 = __nccwpck_require__(82666); -const token_providers_1 = __nccwpck_require__(52843); -const property_provider_1 = __nccwpck_require__(79721); -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const SHOULD_FAIL_CREDENTIAL_CHAIN = false; -const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }) => { - let token; - const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; - if (ssoSession) { - try { - const _token = await (0, token_providers_1.fromSso)({ profile })(); - token = { - accessToken: _token.token, - expiresAt: new Date(_token.expiration).toISOString(), - }; - } - catch (e) { - throw new property_provider_1.CredentialsProviderError(e.message, SHOULD_FAIL_CREDENTIAL_CHAIN); - } - } - else { - try { - token = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoStartUrl); - } - catch (e) { - throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); - } - } - if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { - throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); - } - const { accessToken } = token; - const sso = ssoClient || new client_sso_1.SSOClient({ region: ssoRegion }); - let ssoResp; - try { - ssoResp = await sso.send(new client_sso_1.GetRoleCredentialsCommand({ - accountId: ssoAccountId, - roleName: ssoRoleName, - accessToken, - })); - } - catch (e) { - throw property_provider_1.CredentialsProviderError.from(e, SHOULD_FAIL_CREDENTIAL_CHAIN); - } - const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration } = {} } = ssoResp; - if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { - throw new property_provider_1.CredentialsProviderError("SSO returns an invalid temporary credential.", SHOULD_FAIL_CREDENTIAL_CHAIN); - } - return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration) }; -}; -exports.resolveSSOCredentials = resolveSSOCredentials; - - -/***/ }), - -/***/ 86623: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48098: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateSsoProfile = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const validateSsoProfile = (profile) => { - 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 property_provider_1.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`, false); - } - return profile; -}; -exports.validateSsoProfile = validateSsoProfile; - - -/***/ }), - -/***/ 35614: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromTokenFile = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const fs_1 = __nccwpck_require__(57147); -const fromWebToken_1 = __nccwpck_require__(47905); -const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; -const ENV_ROLE_ARN = "AWS_ROLE_ARN"; -const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; -const fromTokenFile = (init = {}) => async () => { - var _a, _b, _c; - const webIdentityTokenFile = (_a = init === null || init === void 0 ? void 0 : init.webIdentityTokenFile) !== null && _a !== void 0 ? _a : process.env[ENV_TOKEN_FILE]; - const roleArn = (_b = init === null || init === void 0 ? void 0 : init.roleArn) !== null && _b !== void 0 ? _b : process.env[ENV_ROLE_ARN]; - const roleSessionName = (_c = init === null || init === void 0 ? void 0 : init.roleSessionName) !== null && _c !== void 0 ? _c : process.env[ENV_ROLE_SESSION_NAME]; - if (!webIdentityTokenFile || !roleArn) { - throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified"); - } - return (0, fromWebToken_1.fromWebToken)({ - ...init, - webIdentityToken: (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), - roleArn, - roleSessionName, - })(); -}; -exports.fromTokenFile = fromTokenFile; - - -/***/ }), - -/***/ 47905: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromWebToken = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const fromWebToken = (init) => () => { - const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds, roleAssumerWithWebIdentity, } = init; - if (!roleAssumerWithWebIdentity) { - throw new property_provider_1.CredentialsProviderError(`Role Arn '${roleArn}' needs to be assumed with web identity,` + - ` but no role assumption callback was provided.`, false); - } - return roleAssumerWithWebIdentity({ - RoleArn: roleArn, - RoleSessionName: roleSessionName !== null && roleSessionName !== void 0 ? roleSessionName : `aws-sdk-js-session-${Date.now()}`, - WebIdentityToken: webIdentityToken, - ProviderId: providerId, - PolicyArns: policyArns, - Policy: policy, - DurationSeconds: durationSeconds, - }); -}; -exports.fromWebToken = fromWebToken; - - -/***/ }), - -/***/ 15646: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(35614), exports); -tslib_1.__exportStar(__nccwpck_require__(47905), exports); - - -/***/ }), - -/***/ 22545: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHostHeaderPlugin = exports.hostHeaderMiddlewareOptions = exports.hostHeaderMiddleware = exports.resolveHostHeaderConfig = void 0; -const protocol_http_1 = __nccwpck_require__(40517); -function resolveHostHeaderConfig(input) { - return input; -} -exports.resolveHostHeaderConfig = resolveHostHeaderConfig; -const hostHeaderMiddleware = (options) => (next) => async (args) => { - if (!protocol_http_1.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"] = ""; - } - else if (!request.headers["host"]) { - let host = request.hostname; - if (request.port != null) - host += `:${request.port}`; - request.headers["host"] = host; - } - return next(args); -}; -exports.hostHeaderMiddleware = hostHeaderMiddleware; -exports.hostHeaderMiddlewareOptions = { - name: "hostHeaderMiddleware", - step: "build", - priority: "low", - tags: ["HOST"], - override: true, -}; -const getHostHeaderPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.hostHeaderMiddleware)(options), exports.hostHeaderMiddlewareOptions); - }, -}); -exports.getHostHeaderPlugin = getHostHeaderPlugin; - - -/***/ }), - -/***/ 60942: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(58968); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 11201: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 98066: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 8302: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(98066), exports); - - -/***/ }), - -/***/ 48043: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 15839: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 30288: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 40517: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(8302), exports); -tslib_1.__exportStar(__nccwpck_require__(60942), exports); -tslib_1.__exportStar(__nccwpck_require__(11201), exports); -tslib_1.__exportStar(__nccwpck_require__(48043), exports); -tslib_1.__exportStar(__nccwpck_require__(15839), exports); -tslib_1.__exportStar(__nccwpck_require__(30288), exports); -tslib_1.__exportStar(__nccwpck_require__(46607), exports); -tslib_1.__exportStar(__nccwpck_require__(73526), exports); - - -/***/ }), - -/***/ 46607: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 73526: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 93144: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 74878: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 88072: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 60045: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 62489: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 23457: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 51525: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13843: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(51525), exports); -tslib_1.__exportStar(__nccwpck_require__(98296), exports); -tslib_1.__exportStar(__nccwpck_require__(88810), exports); - - -/***/ }), - -/***/ 98296: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 88810: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 76780: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34348: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 23233: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 91012: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 69336: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 86264: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87526: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 84688: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(91012), exports); -tslib_1.__exportStar(__nccwpck_require__(69336), exports); -tslib_1.__exportStar(__nccwpck_require__(86264), exports); -tslib_1.__exportStar(__nccwpck_require__(64320), exports); -tslib_1.__exportStar(__nccwpck_require__(87526), exports); - - -/***/ }), - -/***/ 64320: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 84017: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 81112: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 41054: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(81112); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 34130: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 14547: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(41054), exports); -tslib_1.__exportStar(__nccwpck_require__(34130), exports); -var checksum_1 = __nccwpck_require__(81112); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 21016: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 65323: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 40196: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13258: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(65323), exports); -tslib_1.__exportStar(__nccwpck_require__(40196), exports); - - -/***/ }), - -/***/ 58968: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(93144), exports); -tslib_1.__exportStar(__nccwpck_require__(74878), exports); -tslib_1.__exportStar(__nccwpck_require__(88072), exports); -tslib_1.__exportStar(__nccwpck_require__(60045), exports); -tslib_1.__exportStar(__nccwpck_require__(62489), exports); -tslib_1.__exportStar(__nccwpck_require__(23457), exports); -tslib_1.__exportStar(__nccwpck_require__(13843), exports); -tslib_1.__exportStar(__nccwpck_require__(76780), exports); -tslib_1.__exportStar(__nccwpck_require__(34348), exports); -tslib_1.__exportStar(__nccwpck_require__(23233), exports); -tslib_1.__exportStar(__nccwpck_require__(84688), exports); -tslib_1.__exportStar(__nccwpck_require__(84017), exports); -tslib_1.__exportStar(__nccwpck_require__(14547), exports); -tslib_1.__exportStar(__nccwpck_require__(21016), exports); -tslib_1.__exportStar(__nccwpck_require__(13258), exports); -tslib_1.__exportStar(__nccwpck_require__(15385), exports); -tslib_1.__exportStar(__nccwpck_require__(63366), exports); -tslib_1.__exportStar(__nccwpck_require__(62763), exports); -tslib_1.__exportStar(__nccwpck_require__(81399), exports); -tslib_1.__exportStar(__nccwpck_require__(9067), exports); -tslib_1.__exportStar(__nccwpck_require__(27792), exports); -tslib_1.__exportStar(__nccwpck_require__(31995), exports); -tslib_1.__exportStar(__nccwpck_require__(31778), exports); -tslib_1.__exportStar(__nccwpck_require__(70266), exports); -tslib_1.__exportStar(__nccwpck_require__(38281), exports); -tslib_1.__exportStar(__nccwpck_require__(1620), exports); -tslib_1.__exportStar(__nccwpck_require__(83151), exports); -tslib_1.__exportStar(__nccwpck_require__(64988), exports); -tslib_1.__exportStar(__nccwpck_require__(2045), exports); -tslib_1.__exportStar(__nccwpck_require__(67984), exports); -tslib_1.__exportStar(__nccwpck_require__(65784), exports); -tslib_1.__exportStar(__nccwpck_require__(83116), exports); -tslib_1.__exportStar(__nccwpck_require__(22726), exports); -tslib_1.__exportStar(__nccwpck_require__(61623), exports); - - -/***/ }), - -/***/ 15385: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 63366: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 62763: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 81399: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 9067: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 27792: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 31995: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 31778: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 70266: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 38281: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 1620: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 83151: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 64988: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 2045: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 67984: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 65784: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 83116: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 22726: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61623: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20014: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(9754), exports); - - -/***/ }), - -/***/ 9754: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getLoggerPlugin = exports.loggerMiddlewareOptions = exports.loggerMiddleware = void 0; -const loggerMiddleware = () => (next, context) => async (args) => { - var _a, _b; - try { - const response = await next(args); - const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; - const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog; - const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog !== null && overrideOutputFilterSensitiveLog !== void 0 ? overrideOutputFilterSensitiveLog : context.outputFilterSensitiveLog; - const { $metadata, ...outputWithoutMetadata } = response.output; - (_a = logger === null || logger === void 0 ? void 0 : logger.info) === null || _a === void 0 ? void 0 : _a.call(logger, { - 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 !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog; - (_b = logger === null || logger === void 0 ? void 0 : logger.error) === null || _b === void 0 ? void 0 : _b.call(logger, { - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - error, - metadata: error.$metadata, - }); - throw error; - } -}; -exports.loggerMiddleware = loggerMiddleware; -exports.loggerMiddlewareOptions = { - name: "loggerMiddleware", - tags: ["LOGGER"], - step: "initialize", - override: true, -}; -const getLoggerPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.loggerMiddleware)(), exports.loggerMiddlewareOptions); - }, -}); -exports.getLoggerPlugin = getLoggerPlugin; - - -/***/ }), - -/***/ 85525: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRecursionDetectionPlugin = exports.addRecursionDetectionMiddlewareOptions = exports.recursionDetectionMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(22877); -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 = (options) => (next) => async (args) => { - const { request } = args; - if (!protocol_http_1.HttpRequest.isInstance(request) || - options.runtime !== "node" || - request.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) { - return next(args); - } - const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; - const traceId = process.env[ENV_TRACE_ID]; - 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; -exports.addRecursionDetectionMiddlewareOptions = { - step: "build", - tags: ["RECURSION_DETECTION"], - name: "recursionDetectionMiddleware", - override: true, - priority: "low", -}; -const getRecursionDetectionPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.recursionDetectionMiddleware)(options), exports.addRecursionDetectionMiddlewareOptions); - }, -}); -exports.getRecursionDetectionPlugin = getRecursionDetectionPlugin; - - -/***/ }), - -/***/ 27232: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(29360); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 94727: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 98392: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 26750: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(98392), exports); - - -/***/ }), - -/***/ 54967: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 58400: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 98882: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 22877: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(26750), exports); -tslib_1.__exportStar(__nccwpck_require__(27232), exports); -tslib_1.__exportStar(__nccwpck_require__(94727), exports); -tslib_1.__exportStar(__nccwpck_require__(54967), exports); -tslib_1.__exportStar(__nccwpck_require__(58400), exports); -tslib_1.__exportStar(__nccwpck_require__(98882), exports); -tslib_1.__exportStar(__nccwpck_require__(95224), exports); -tslib_1.__exportStar(__nccwpck_require__(65201), exports); - - -/***/ }), - -/***/ 95224: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 65201: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 29058: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 59582: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 80912: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 4285: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20600: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 35103: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 18495: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 96084: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(18495), exports); -tslib_1.__exportStar(__nccwpck_require__(54112), exports); -tslib_1.__exportStar(__nccwpck_require__(30629), exports); - - -/***/ }), - -/***/ 54112: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 30629: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 8172: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 98003: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43438: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 49248: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 91826: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 74843: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 38942: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87873: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(49248), exports); -tslib_1.__exportStar(__nccwpck_require__(91826), exports); -tslib_1.__exportStar(__nccwpck_require__(74843), exports); -tslib_1.__exportStar(__nccwpck_require__(44730), exports); -tslib_1.__exportStar(__nccwpck_require__(38942), exports); - - -/***/ }), - -/***/ 44730: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 2689: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20632: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 65598: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(20632); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 2248: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 54648: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(65598), exports); -tslib_1.__exportStar(__nccwpck_require__(2248), exports); -var checksum_1 = __nccwpck_require__(20632); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 30165: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 91291: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 4300: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 90320: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(91291), exports); -tslib_1.__exportStar(__nccwpck_require__(4300), exports); - - -/***/ }), - -/***/ 29360: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(29058), exports); -tslib_1.__exportStar(__nccwpck_require__(59582), exports); -tslib_1.__exportStar(__nccwpck_require__(80912), exports); -tslib_1.__exportStar(__nccwpck_require__(4285), exports); -tslib_1.__exportStar(__nccwpck_require__(20600), exports); -tslib_1.__exportStar(__nccwpck_require__(35103), exports); -tslib_1.__exportStar(__nccwpck_require__(96084), exports); -tslib_1.__exportStar(__nccwpck_require__(8172), exports); -tslib_1.__exportStar(__nccwpck_require__(98003), exports); -tslib_1.__exportStar(__nccwpck_require__(43438), exports); -tslib_1.__exportStar(__nccwpck_require__(87873), exports); -tslib_1.__exportStar(__nccwpck_require__(2689), exports); -tslib_1.__exportStar(__nccwpck_require__(54648), exports); -tslib_1.__exportStar(__nccwpck_require__(30165), exports); -tslib_1.__exportStar(__nccwpck_require__(90320), exports); -tslib_1.__exportStar(__nccwpck_require__(2081), exports); -tslib_1.__exportStar(__nccwpck_require__(76978), exports); -tslib_1.__exportStar(__nccwpck_require__(11017), exports); -tslib_1.__exportStar(__nccwpck_require__(48052), exports); -tslib_1.__exportStar(__nccwpck_require__(3060), exports); -tslib_1.__exportStar(__nccwpck_require__(64233), exports); -tslib_1.__exportStar(__nccwpck_require__(35562), exports); -tslib_1.__exportStar(__nccwpck_require__(52586), exports); -tslib_1.__exportStar(__nccwpck_require__(28133), exports); -tslib_1.__exportStar(__nccwpck_require__(47773), exports); -tslib_1.__exportStar(__nccwpck_require__(14661), exports); -tslib_1.__exportStar(__nccwpck_require__(25357), exports); -tslib_1.__exportStar(__nccwpck_require__(15064), exports); -tslib_1.__exportStar(__nccwpck_require__(63462), exports); -tslib_1.__exportStar(__nccwpck_require__(56241), exports); -tslib_1.__exportStar(__nccwpck_require__(46524), exports); -tslib_1.__exportStar(__nccwpck_require__(89855), exports); -tslib_1.__exportStar(__nccwpck_require__(7109), exports); -tslib_1.__exportStar(__nccwpck_require__(60855), exports); - - -/***/ }), - -/***/ 2081: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 76978: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 11017: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48052: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 3060: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 64233: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 35562: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 52586: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 28133: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 47773: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 14661: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 25357: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 15064: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 63462: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 56241: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 46524: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89855: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 7109: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 60855: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 55959: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveStsAuthConfig = void 0; -const middleware_signing_1 = __nccwpck_require__(14935); -const resolveStsAuthConfig = (input, { stsClientCtor }) => (0, middleware_signing_1.resolveAwsAuthConfig)({ - ...input, - stsClientCtor, -}); -exports.resolveStsAuthConfig = resolveStsAuthConfig; - - -/***/ }), - -/***/ 84193: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveSigV4AuthConfig = exports.resolveAwsAuthConfig = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const signature_v4_1 = __nccwpck_require__(11528); -const util_middleware_1 = __nccwpck_require__(2390); -const CREDENTIAL_EXPIRE_WINDOW = 300000; -const resolveAwsAuthConfig = (input) => { - const normalizedCreds = input.credentials - ? normalizeCredentialProvider(input.credentials) - : input.credentialDefaultProvider(input); - const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; - let signer; - if (input.signer) { - signer = (0, util_middleware_1.normalizeProvider)(input.signer); - } - else if (input.regionInfoProvider) { - signer = () => (0, util_middleware_1.normalizeProvider)(input.region)() - .then(async (region) => [ - (await input.regionInfoProvider(region, { - useFipsEndpoint: await input.useFipsEndpoint(), - useDualstackEndpoint: await input.useDualstackEndpoint(), - })) || {}, - region, - ]) - .then(([regionInfo, region]) => { - const { signingRegion, signingService } = regionInfo; - input.signingRegion = input.signingRegion || signingRegion || region; - input.signingName = input.signingName || signingService || input.serviceId; - const params = { - ...input, - credentials: normalizedCreds, - region: input.signingRegion, - service: input.signingName, - sha256, - uriEscapePath: signingEscapePath, - }; - const SignerCtor = input.signerConstructor || signature_v4_1.SignatureV4; - return new SignerCtor(params); - }); - } - else { - signer = async (authScheme) => { - authScheme = Object.assign({}, { - name: "sigv4", - signingName: input.signingName || input.defaultSigningName, - signingRegion: await (0, util_middleware_1.normalizeProvider)(input.region)(), - properties: {}, - }, authScheme); - const signingRegion = authScheme.signingRegion; - const signingService = authScheme.signingName; - input.signingRegion = input.signingRegion || signingRegion; - input.signingName = input.signingName || signingService || input.serviceId; - const params = { - ...input, - credentials: normalizedCreds, - region: input.signingRegion, - service: input.signingName, - sha256, - uriEscapePath: signingEscapePath, - }; - const SignerCtor = input.signerConstructor || signature_v4_1.SignatureV4; - return new SignerCtor(params); - }; - } - return { - ...input, - systemClockOffset, - signingEscapePath, - credentials: normalizedCreds, - signer, - }; -}; -exports.resolveAwsAuthConfig = resolveAwsAuthConfig; -const resolveSigV4AuthConfig = (input) => { - const normalizedCreds = input.credentials - ? normalizeCredentialProvider(input.credentials) - : input.credentialDefaultProvider(input); - const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; - let signer; - if (input.signer) { - signer = (0, util_middleware_1.normalizeProvider)(input.signer); - } - else { - signer = (0, util_middleware_1.normalizeProvider)(new signature_v4_1.SignatureV4({ - credentials: normalizedCreds, - region: input.region, - service: input.signingName, - sha256, - uriEscapePath: signingEscapePath, - })); - } - return { - ...input, - systemClockOffset, - signingEscapePath, - credentials: normalizedCreds, - signer, - }; -}; -exports.resolveSigV4AuthConfig = resolveSigV4AuthConfig; -const normalizeCredentialProvider = (credentials) => { - if (typeof credentials === "function") { - return (0, property_provider_1.memoize)(credentials, (credentials) => credentials.expiration !== undefined && - credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW, (credentials) => credentials.expiration !== undefined); - } - return (0, util_middleware_1.normalizeProvider)(credentials); -}; - - -/***/ }), - -/***/ 88053: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin = exports.awsAuthMiddlewareOptions = exports.awsAuthMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(98467); -const getSkewCorrectedDate_1 = __nccwpck_require__(68253); -const getUpdatedSystemClockOffset_1 = __nccwpck_require__(35863); -const awsAuthMiddleware = (options) => (next, context) => async function (args) { - var _a, _b, _c, _d; - if (!protocol_http_1.HttpRequest.isInstance(args.request)) - return next(args); - const authScheme = (_c = (_b = (_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.authSchemes) === null || _c === void 0 ? void 0 : _c[0]; - const multiRegionOverride = (authScheme === null || authScheme === void 0 ? void 0 : authScheme.name) === "sigv4a" ? (_d = authScheme === null || authScheme === void 0 ? void 0 : authScheme.signingRegionSet) === null || _d === void 0 ? void 0 : _d.join(",") : undefined; - const signer = await options.signer(authScheme); - const output = await next({ - ...args, - request: await signer.sign(args.request, { - signingDate: (0, getSkewCorrectedDate_1.getSkewCorrectedDate)(options.systemClockOffset), - signingRegion: multiRegionOverride || context["signing_region"], - signingService: context["signing_service"], - }), - }).catch((error) => { - var _a; - const serverTime = (_a = error.ServerTime) !== null && _a !== void 0 ? _a : getDateHeader(error.$response); - if (serverTime) { - options.systemClockOffset = (0, getUpdatedSystemClockOffset_1.getUpdatedSystemClockOffset)(serverTime, options.systemClockOffset); - } - throw error; - }); - const dateHeader = getDateHeader(output.response); - if (dateHeader) { - options.systemClockOffset = (0, getUpdatedSystemClockOffset_1.getUpdatedSystemClockOffset)(dateHeader, options.systemClockOffset); - } - return output; -}; -exports.awsAuthMiddleware = awsAuthMiddleware; -const getDateHeader = (response) => { var _a, _b, _c; return protocol_http_1.HttpResponse.isInstance(response) ? (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.date) !== null && _b !== void 0 ? _b : (_c = response.headers) === null || _c === void 0 ? void 0 : _c.Date : undefined; }; -exports.awsAuthMiddlewareOptions = { - name: "awsAuthMiddleware", - tags: ["SIGNATURE", "AWSAUTH"], - relation: "after", - toMiddleware: "retryMiddleware", - override: true, -}; -const getAwsAuthPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, exports.awsAuthMiddleware)(options), exports.awsAuthMiddlewareOptions); - }, -}); -exports.getAwsAuthPlugin = getAwsAuthPlugin; -exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin; - - -/***/ }), - -/***/ 14935: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(84193), exports); -tslib_1.__exportStar(__nccwpck_require__(88053), exports); - - -/***/ }), - -/***/ 68253: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSkewCorrectedDate = void 0; -const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); -exports.getSkewCorrectedDate = getSkewCorrectedDate; - - -/***/ }), - -/***/ 35863: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getUpdatedSystemClockOffset = void 0; -const isClockSkewed_1 = __nccwpck_require__(85301); -const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { - const clockTimeInMs = Date.parse(clockTime); - if ((0, isClockSkewed_1.isClockSkewed)(clockTimeInMs, currentSystemClockOffset)) { - return clockTimeInMs - Date.now(); - } - return currentSystemClockOffset; -}; -exports.getUpdatedSystemClockOffset = getUpdatedSystemClockOffset; - - -/***/ }), - -/***/ 85301: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isClockSkewed = void 0; -const getSkewCorrectedDate_1 = __nccwpck_require__(68253); -const isClockSkewed = (clockTime, systemClockOffset) => Math.abs((0, getSkewCorrectedDate_1.getSkewCorrectedDate)(systemClockOffset).getTime() - clockTime) >= 300000; -exports.isClockSkewed = isClockSkewed; - - -/***/ }), - -/***/ 86101: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(2430); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 40418: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 49377: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 58888: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(49377), exports); - - -/***/ }), - -/***/ 45667: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 37242: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 95032: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 98467: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(58888), exports); -tslib_1.__exportStar(__nccwpck_require__(86101), exports); -tslib_1.__exportStar(__nccwpck_require__(40418), exports); -tslib_1.__exportStar(__nccwpck_require__(45667), exports); -tslib_1.__exportStar(__nccwpck_require__(37242), exports); -tslib_1.__exportStar(__nccwpck_require__(95032), exports); -tslib_1.__exportStar(__nccwpck_require__(87689), exports); -tslib_1.__exportStar(__nccwpck_require__(82323), exports); - - -/***/ }), - -/***/ 87689: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 82323: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 63140: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 68961: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 27498: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 75793: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 55035: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 50635: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 92803: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 93677: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(92803), exports); -tslib_1.__exportStar(__nccwpck_require__(67454), exports); -tslib_1.__exportStar(__nccwpck_require__(65364), exports); - - -/***/ }), - -/***/ 67454: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 65364: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 49352: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 99089: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 65659: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 87896: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 73697: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 84494: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 73060: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 2309: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(87896), exports); -tslib_1.__exportStar(__nccwpck_require__(73697), exports); -tslib_1.__exportStar(__nccwpck_require__(84494), exports); -tslib_1.__exportStar(__nccwpck_require__(84285), exports); -tslib_1.__exportStar(__nccwpck_require__(73060), exports); - - -/***/ }), - -/***/ 84285: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 97740: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 60162: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 87320: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(60162); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 9066: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 65509: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(87320), exports); -tslib_1.__exportStar(__nccwpck_require__(9066), exports); -var checksum_1 = __nccwpck_require__(60162); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 95393: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 49754: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 62572: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 86902: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(49754), exports); -tslib_1.__exportStar(__nccwpck_require__(62572), exports); - - -/***/ }), - -/***/ 2430: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(63140), exports); -tslib_1.__exportStar(__nccwpck_require__(68961), exports); -tslib_1.__exportStar(__nccwpck_require__(27498), exports); -tslib_1.__exportStar(__nccwpck_require__(75793), exports); -tslib_1.__exportStar(__nccwpck_require__(55035), exports); -tslib_1.__exportStar(__nccwpck_require__(50635), exports); -tslib_1.__exportStar(__nccwpck_require__(93677), exports); -tslib_1.__exportStar(__nccwpck_require__(49352), exports); -tslib_1.__exportStar(__nccwpck_require__(99089), exports); -tslib_1.__exportStar(__nccwpck_require__(65659), exports); -tslib_1.__exportStar(__nccwpck_require__(2309), exports); -tslib_1.__exportStar(__nccwpck_require__(97740), exports); -tslib_1.__exportStar(__nccwpck_require__(65509), exports); -tslib_1.__exportStar(__nccwpck_require__(95393), exports); -tslib_1.__exportStar(__nccwpck_require__(86902), exports); -tslib_1.__exportStar(__nccwpck_require__(30116), exports); -tslib_1.__exportStar(__nccwpck_require__(92627), exports); -tslib_1.__exportStar(__nccwpck_require__(48461), exports); -tslib_1.__exportStar(__nccwpck_require__(78249), exports); -tslib_1.__exportStar(__nccwpck_require__(9616), exports); -tslib_1.__exportStar(__nccwpck_require__(18107), exports); -tslib_1.__exportStar(__nccwpck_require__(22744), exports); -tslib_1.__exportStar(__nccwpck_require__(43865), exports); -tslib_1.__exportStar(__nccwpck_require__(10038), exports); -tslib_1.__exportStar(__nccwpck_require__(68353), exports); -tslib_1.__exportStar(__nccwpck_require__(64337), exports); -tslib_1.__exportStar(__nccwpck_require__(45123), exports); -tslib_1.__exportStar(__nccwpck_require__(13829), exports); -tslib_1.__exportStar(__nccwpck_require__(16274), exports); -tslib_1.__exportStar(__nccwpck_require__(52027), exports); -tslib_1.__exportStar(__nccwpck_require__(73946), exports); -tslib_1.__exportStar(__nccwpck_require__(48366), exports); -tslib_1.__exportStar(__nccwpck_require__(67879), exports); -tslib_1.__exportStar(__nccwpck_require__(20949), exports); - - -/***/ }), - -/***/ 30116: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 92627: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 48461: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 78249: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 9616: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 18107: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 22744: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43865: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 10038: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 68353: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 64337: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 45123: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13829: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 16274: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 52027: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 73946: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48366: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 67879: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20949: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 36546: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveUserAgentConfig = void 0; -function resolveUserAgentConfig(input) { - return { - ...input, - customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent, - }; -} -exports.resolveUserAgentConfig = resolveUserAgentConfig; - - -/***/ }), - -/***/ 28025: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UA_ESCAPE_CHAR = exports.UA_VALUE_ESCAPE_REGEX = exports.UA_NAME_ESCAPE_REGEX = exports.UA_NAME_SEPARATOR = exports.SPACE = exports.X_AMZ_USER_AGENT = exports.USER_AGENT = void 0; -exports.USER_AGENT = "user-agent"; -exports.X_AMZ_USER_AGENT = "x-amz-user-agent"; -exports.SPACE = " "; -exports.UA_NAME_SEPARATOR = "/"; -exports.UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g; -exports.UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g; -exports.UA_ESCAPE_CHAR = "-"; - - -/***/ }), - -/***/ 64688: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(36546), exports); -tslib_1.__exportStar(__nccwpck_require__(76236), exports); - - -/***/ }), - -/***/ 76236: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getUserAgentPlugin = exports.getUserAgentMiddlewareOptions = exports.userAgentMiddleware = void 0; -const util_endpoints_1 = __nccwpck_require__(13350); -const protocol_http_1 = __nccwpck_require__(7992); -const constants_1 = __nccwpck_require__(28025); -const userAgentMiddleware = (options) => (next, context) => async (args) => { - var _a, _b; - const { request } = args; - if (!protocol_http_1.HttpRequest.isInstance(request)) - return next(args); - const { headers } = request; - const userAgent = ((_a = context === null || context === void 0 ? void 0 : context.userAgent) === null || _a === void 0 ? void 0 : _a.map(escapeUserAgent)) || []; - const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); - const customUserAgent = ((_b = options === null || options === void 0 ? void 0 : options.customUserAgent) === null || _b === void 0 ? void 0 : _b.map(escapeUserAgent)) || []; - const prefix = (0, util_endpoints_1.getUserAgentPrefix)(); - const sdkUserAgentValue = (prefix ? [prefix] : []) - .concat([...defaultUserAgent, ...userAgent, ...customUserAgent]) - .join(constants_1.SPACE); - const normalUAValue = [ - ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), - ...customUserAgent, - ].join(constants_1.SPACE); - if (options.runtime !== "browser") { - if (normalUAValue) { - headers[constants_1.X_AMZ_USER_AGENT] = headers[constants_1.X_AMZ_USER_AGENT] - ? `${headers[constants_1.USER_AGENT]} ${normalUAValue}` - : normalUAValue; - } - headers[constants_1.USER_AGENT] = sdkUserAgentValue; - } - else { - headers[constants_1.X_AMZ_USER_AGENT] = sdkUserAgentValue; - } - return next({ - ...args, - request, - }); -}; -exports.userAgentMiddleware = userAgentMiddleware; -const escapeUserAgent = (userAgentPair) => { - var _a; - const name = userAgentPair[0] - .split(constants_1.UA_NAME_SEPARATOR) - .map((part) => part.replace(constants_1.UA_NAME_ESCAPE_REGEX, constants_1.UA_ESCAPE_CHAR)) - .join(constants_1.UA_NAME_SEPARATOR); - const version = (_a = userAgentPair[1]) === null || _a === void 0 ? void 0 : _a.replace(constants_1.UA_VALUE_ESCAPE_REGEX, constants_1.UA_ESCAPE_CHAR); - const prefixSeparatorIndex = name.indexOf(constants_1.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}`; - } - }, ""); -}; -exports.getUserAgentMiddlewareOptions = { - name: "getUserAgentMiddleware", - step: "build", - priority: "low", - tags: ["SET_USER_AGENT", "USER_AGENT"], - override: true, -}; -const getUserAgentPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.userAgentMiddleware)(config), exports.getUserAgentMiddlewareOptions); - }, -}); -exports.getUserAgentPlugin = getUserAgentPlugin; - - -/***/ }), - -/***/ 56874: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(47866); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 95723: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 41127: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 49088: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(41127), exports); - - -/***/ }), - -/***/ 26998: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 72718: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 94110: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 7992: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(49088), exports); -tslib_1.__exportStar(__nccwpck_require__(56874), exports); -tslib_1.__exportStar(__nccwpck_require__(95723), exports); -tslib_1.__exportStar(__nccwpck_require__(26998), exports); -tslib_1.__exportStar(__nccwpck_require__(72718), exports); -tslib_1.__exportStar(__nccwpck_require__(94110), exports); -tslib_1.__exportStar(__nccwpck_require__(21082), exports); -tslib_1.__exportStar(__nccwpck_require__(75922), exports); - - -/***/ }), - -/***/ 21082: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 75922: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 59172: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 29271: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 53689: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 51199: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 24838: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 76179: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 55846: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 75194: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(55846), exports); -tslib_1.__exportStar(__nccwpck_require__(48650), exports); -tslib_1.__exportStar(__nccwpck_require__(18749), exports); - - -/***/ }), - -/***/ 48650: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 18749: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 1703: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 19956: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 27588: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 89740: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 82358: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43105: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 17402: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 4266: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(89740), exports); -tslib_1.__exportStar(__nccwpck_require__(82358), exports); -tslib_1.__exportStar(__nccwpck_require__(43105), exports); -tslib_1.__exportStar(__nccwpck_require__(10882), exports); -tslib_1.__exportStar(__nccwpck_require__(17402), exports); - - -/***/ }), - -/***/ 10882: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 52725: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 30452: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 96167: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(30452); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 6257: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 66139: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(96167), exports); -tslib_1.__exportStar(__nccwpck_require__(6257), exports); -var checksum_1 = __nccwpck_require__(30452); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 12694: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 26363: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 99614: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 44894: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(26363), exports); -tslib_1.__exportStar(__nccwpck_require__(99614), exports); - - -/***/ }), - -/***/ 47866: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(59172), exports); -tslib_1.__exportStar(__nccwpck_require__(29271), exports); -tslib_1.__exportStar(__nccwpck_require__(53689), exports); -tslib_1.__exportStar(__nccwpck_require__(51199), exports); -tslib_1.__exportStar(__nccwpck_require__(24838), exports); -tslib_1.__exportStar(__nccwpck_require__(76179), exports); -tslib_1.__exportStar(__nccwpck_require__(75194), exports); -tslib_1.__exportStar(__nccwpck_require__(1703), exports); -tslib_1.__exportStar(__nccwpck_require__(19956), exports); -tslib_1.__exportStar(__nccwpck_require__(27588), exports); -tslib_1.__exportStar(__nccwpck_require__(4266), exports); -tslib_1.__exportStar(__nccwpck_require__(52725), exports); -tslib_1.__exportStar(__nccwpck_require__(66139), exports); -tslib_1.__exportStar(__nccwpck_require__(12694), exports); -tslib_1.__exportStar(__nccwpck_require__(44894), exports); -tslib_1.__exportStar(__nccwpck_require__(99257), exports); -tslib_1.__exportStar(__nccwpck_require__(54343), exports); -tslib_1.__exportStar(__nccwpck_require__(83992), exports); -tslib_1.__exportStar(__nccwpck_require__(26539), exports); -tslib_1.__exportStar(__nccwpck_require__(39211), exports); -tslib_1.__exportStar(__nccwpck_require__(53294), exports); -tslib_1.__exportStar(__nccwpck_require__(83731), exports); -tslib_1.__exportStar(__nccwpck_require__(30257), exports); -tslib_1.__exportStar(__nccwpck_require__(98399), exports); -tslib_1.__exportStar(__nccwpck_require__(4498), exports); -tslib_1.__exportStar(__nccwpck_require__(12320), exports); -tslib_1.__exportStar(__nccwpck_require__(94694), exports); -tslib_1.__exportStar(__nccwpck_require__(30124), exports); -tslib_1.__exportStar(__nccwpck_require__(72388), exports); -tslib_1.__exportStar(__nccwpck_require__(35892), exports); -tslib_1.__exportStar(__nccwpck_require__(18356), exports); -tslib_1.__exportStar(__nccwpck_require__(42014), exports); -tslib_1.__exportStar(__nccwpck_require__(1691), exports); -tslib_1.__exportStar(__nccwpck_require__(9402), exports); - - -/***/ }), - -/***/ 99257: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 54343: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 83992: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 26539: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 39211: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 53294: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 83731: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 30257: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 98399: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 4498: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 12320: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 94694: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 30124: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 72388: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 35892: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 18356: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 42014: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 1691: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 9402: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 68805: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(20258), exports); - - -/***/ }), - -/***/ 60079: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveAwsRegionExtensionConfiguration = exports.getAwsRegionExtensionConfiguration = void 0; -const getAwsRegionExtensionConfiguration = (runtimeConfig) => { - let runtimeConfigRegion = async () => { - if (runtimeConfig.region === undefined) { - throw new Error("Region is missing from runtimeConfig"); - } - const region = runtimeConfig.region; - if (typeof region === "string") { - return region; - } - return region(); - }; - return { - setRegion(region) { - runtimeConfigRegion = region; - }, - region() { - return runtimeConfigRegion; - }, - }; -}; -exports.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration; -const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => { - return { - region: awsRegionExtensionConfiguration.region(), - }; -}; -exports.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration; - - -/***/ }), - -/***/ 18156: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(60079), exports); -tslib_1.__exportStar(__nccwpck_require__(17177), exports); - - -/***/ }), - -/***/ 60123: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_REGION_CONFIG_FILE_OPTIONS = exports.NODE_REGION_CONFIG_OPTIONS = exports.REGION_INI_NAME = exports.REGION_ENV_NAME = void 0; -exports.REGION_ENV_NAME = "AWS_REGION"; -exports.REGION_INI_NAME = "region"; -exports.NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.REGION_ENV_NAME], - configFileSelector: (profile) => profile[exports.REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); - }, -}; -exports.NODE_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials", -}; - - -/***/ }), - -/***/ 30048: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRealRegion = void 0; -const isFipsRegion_1 = __nccwpck_require__(37257); -const getRealRegion = (region) => (0, isFipsRegion_1.isFipsRegion)(region) - ? ["fips-aws-global", "aws-fips"].includes(region) - ? "us-east-1" - : region.replace(/fips-(dkr-|prod-)?|-fips/, "") - : region; -exports.getRealRegion = getRealRegion; - - -/***/ }), - -/***/ 17177: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(60123), exports); -tslib_1.__exportStar(__nccwpck_require__(46187), exports); - - -/***/ }), - -/***/ 37257: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isFipsRegion = void 0; -const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); -exports.isFipsRegion = isFipsRegion; - - -/***/ }), - -/***/ 46187: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRegionConfig = void 0; -const getRealRegion_1 = __nccwpck_require__(30048); -const isFipsRegion_1 = __nccwpck_require__(37257); -const resolveRegionConfig = (input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); - } - return { - ...input, - region: async () => { - if (typeof region === "string") { - return (0, getRealRegion_1.getRealRegion)(region); - } - const providedRegion = await region(); - return (0, getRealRegion_1.getRealRegion)(providedRegion); - }, - useFipsEndpoint: async () => { - const providedRegion = typeof region === "string" ? region : await region(); - if ((0, isFipsRegion_1.isFipsRegion)(providedRegion)) { - return true; - } - return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); - }, - }; -}; -exports.resolveRegionConfig = resolveRegionConfig; - - -/***/ }), - -/***/ 52664: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UnsupportedGrantTypeException = exports.UnauthorizedClientException = exports.SlowDownException = exports.SSOOIDCClient = exports.InvalidScopeException = exports.InvalidRequestException = exports.InvalidClientException = exports.InternalServerException = exports.ExpiredTokenException = exports.CreateTokenCommand = exports.AuthorizationPendingException = exports.AccessDeniedException = void 0; -const middleware_host_header_1 = __nccwpck_require__(22545); -const middleware_logger_1 = __nccwpck_require__(20014); -const middleware_recursion_detection_1 = __nccwpck_require__(85525); -const middleware_user_agent_1 = __nccwpck_require__(64688); -const config_resolver_1 = __nccwpck_require__(53098); -const middleware_content_length_1 = __nccwpck_require__(82800); -const middleware_endpoint_1 = __nccwpck_require__(82918); -const middleware_retry_1 = __nccwpck_require__(96039); -const smithy_client_1 = __nccwpck_require__(63570); -var resolveClientEndpointParameters = (options) => { - var _a, _b; - return { - ...options, - useDualstackEndpoint: (_a = options.useDualstackEndpoint) !== null && _a !== void 0 ? _a : false, - useFipsEndpoint: (_b = options.useFipsEndpoint) !== null && _b !== void 0 ? _b : false, - defaultSigningName: "awsssooidc" - }; -}; -var package_default = { version: "3.387.0" }; -const util_user_agent_node_1 = __nccwpck_require__(98095); -const config_resolver_2 = __nccwpck_require__(53098); -const hash_node_1 = __nccwpck_require__(3081); -const middleware_retry_2 = __nccwpck_require__(96039); -const node_config_provider_1 = __nccwpck_require__(33461); -const node_http_handler_1 = __nccwpck_require__(17150); -const util_body_length_node_1 = __nccwpck_require__(68075); -const util_retry_1 = __nccwpck_require__(84902); -const smithy_client_2 = __nccwpck_require__(63570); -const url_parser_1 = __nccwpck_require__(14681); -const util_base64_1 = __nccwpck_require__(75600); -const util_utf8_1 = __nccwpck_require__(41895); -const util_endpoints_1 = __nccwpck_require__(13350); -var p = "required"; -var q = "fn"; -var r = "argv"; -var s = "ref"; -var a = "PartitionResult"; -var b = "tree"; -var c = "error"; -var d = "endpoint"; -var e = { [p]: false, "type": "String" }; -var f = { [p]: true, "default": false, "type": "Boolean" }; -var g = { [s]: "Endpoint" }; -var h = { [q]: "booleanEquals", [r]: [{ [s]: "UseFIPS" }, true] }; -var i = { [q]: "booleanEquals", [r]: [{ [s]: "UseDualStack" }, true] }; -var j = {}; -var k = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsFIPS"] }] }; -var l = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsDualStack"] }] }; -var m = [g]; -var n = [h]; -var o = [i]; -var _data = { version: "1.0", parameters: { Region: e, UseDualStack: f, UseFIPS: f, Endpoint: e }, rules: [{ conditions: [{ [q]: "aws.partition", [r]: [{ [s]: "Region" }], assign: a }], type: b, rules: [{ conditions: [{ [q]: "isSet", [r]: m }, { [q]: "parseURL", [r]: m, assign: "url" }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: g, properties: j, headers: j }, type: d }] }] }, { conditions: [h, i], type: b, rules: [{ conditions: [k, l], type: b, rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [k], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }; -var ruleSet = _data; -var defaultEndpointResolver = (endpointParams, context = {}) => { - return (0, util_endpoints_1.resolveEndpoint)(ruleSet, { - endpointParams, - logger: context.logger - }); -}; -var getRuntimeConfig = (config) => { - var _a, _b, _c, _d, _e, _f, _g, _h, _j; - return ({ - apiVersion: "2019-06-10", - base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : util_base64_1.fromBase64, - base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : util_base64_1.toBase64, - disableHostPrefix: (_c = config === null || config === void 0 ? void 0 : config.disableHostPrefix) !== null && _c !== void 0 ? _c : false, - endpointProvider: (_d = config === null || config === void 0 ? void 0 : config.endpointProvider) !== null && _d !== void 0 ? _d : defaultEndpointResolver, - logger: (_e = config === null || config === void 0 ? void 0 : config.logger) !== null && _e !== void 0 ? _e : new smithy_client_2.NoOpLogger(), - serviceId: (_f = config === null || config === void 0 ? void 0 : config.serviceId) !== null && _f !== void 0 ? _f : "SSO OIDC", - urlParser: (_g = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _g !== void 0 ? _g : url_parser_1.parseUrl, - utf8Decoder: (_h = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _h !== void 0 ? _h : util_utf8_1.fromUtf8, - utf8Encoder: (_j = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _j !== void 0 ? _j : util_utf8_1.toUtf8 - }); -}; -const smithy_client_3 = __nccwpck_require__(63570); -const util_defaults_mode_node_1 = __nccwpck_require__(72429); -const smithy_client_4 = __nccwpck_require__(63570); -var getRuntimeConfig2 = (config) => { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; - (0, smithy_client_4.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_3.loadConfigsForDefaultMode); - const clientSharedValues = getRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - defaultsMode, - bodyLengthChecker: (_a = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _a !== void 0 ? _a : util_body_length_node_1.calculateBodyLength, - defaultUserAgentProvider: (_b = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _b !== void 0 ? _b : (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), - maxAttempts: (_c = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _c !== void 0 ? _c : (0, node_config_provider_1.loadConfig)(middleware_retry_2.NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: (_d = config === null || config === void 0 ? void 0 : config.region) !== null && _d !== void 0 ? _d : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_REGION_CONFIG_OPTIONS, config_resolver_2.NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: (_e = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _e !== void 0 ? _e : new node_http_handler_1.NodeHttpHandler(defaultConfigProvider), - retryMode: (_f = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _f !== void 0 ? _f : (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_2.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }), - sha256: (_g = config === null || config === void 0 ? void 0 : config.sha256) !== null && _g !== void 0 ? _g : hash_node_1.Hash.bind(null, "sha256"), - streamCollector: (_h = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _h !== void 0 ? _h : node_http_handler_1.streamCollector, - useDualstackEndpoint: (_j = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _j !== void 0 ? _j : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: (_k = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _k !== void 0 ? _k : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS) - }; -}; -var SSOOIDCClient = class extends smithy_client_1.Client { - constructor(...[configuration]) { - const _config_0 = getRuntimeConfig2(configuration || {}); - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); - const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); - const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); - const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_5); - super(_config_6); - this.config = _config_6; - this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); - this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); - this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); - this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); - this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); - } - destroy() { - super.destroy(); - } -}; -exports.SSOOIDCClient = SSOOIDCClient; -const smithy_client_5 = __nccwpck_require__(63570); -const middleware_endpoint_2 = __nccwpck_require__(82918); -const middleware_serde_1 = __nccwpck_require__(81238); -const smithy_client_6 = __nccwpck_require__(63570); -const protocol_http_1 = __nccwpck_require__(22916); -const smithy_client_7 = __nccwpck_require__(63570); -const smithy_client_8 = __nccwpck_require__(63570); -var SSOOIDCServiceException = class _SSOOIDCServiceException extends smithy_client_8.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype); - } -}; -var AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "AccessDeniedException", - $fault: "client", - ...opts - }); - this.name = "AccessDeniedException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _AccessDeniedException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.AccessDeniedException = AccessDeniedException; -var AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "AuthorizationPendingException", - $fault: "client", - ...opts - }); - this.name = "AuthorizationPendingException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _AuthorizationPendingException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.AuthorizationPendingException = AuthorizationPendingException; -var ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "ExpiredTokenException", - $fault: "client", - ...opts - }); - this.name = "ExpiredTokenException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _ExpiredTokenException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.ExpiredTokenException = ExpiredTokenException; -var InternalServerException = class _InternalServerException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InternalServerException", - $fault: "server", - ...opts - }); - this.name = "InternalServerException"; - this.$fault = "server"; - Object.setPrototypeOf(this, _InternalServerException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.InternalServerException = InternalServerException; -var InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidClientException", - $fault: "client", - ...opts - }); - this.name = "InvalidClientException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidClientException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.InvalidClientException = InvalidClientException; -var InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidGrantException", - $fault: "client", - ...opts - }); - this.name = "InvalidGrantException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidGrantException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -var InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidRequestException", - $fault: "client", - ...opts - }); - this.name = "InvalidRequestException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidRequestException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.InvalidRequestException = InvalidRequestException; -var InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidScopeException", - $fault: "client", - ...opts - }); - this.name = "InvalidScopeException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidScopeException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.InvalidScopeException = InvalidScopeException; -var SlowDownException = class _SlowDownException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "SlowDownException", - $fault: "client", - ...opts - }); - this.name = "SlowDownException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _SlowDownException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.SlowDownException = SlowDownException; -var UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "UnauthorizedClientException", - $fault: "client", - ...opts - }); - this.name = "UnauthorizedClientException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _UnauthorizedClientException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.UnauthorizedClientException = UnauthorizedClientException; -var UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "UnsupportedGrantTypeException", - $fault: "client", - ...opts - }); - this.name = "UnsupportedGrantTypeException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.UnsupportedGrantTypeException = UnsupportedGrantTypeException; -var InvalidClientMetadataException = class _InvalidClientMetadataException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidClientMetadataException", - $fault: "client", - ...opts - }); - this.name = "InvalidClientMetadataException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidClientMetadataException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -var se_CreateTokenCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = { - "content-type": "application/json" - }; - const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/token`; - let body; - body = JSON.stringify((0, smithy_client_7.take)(input, { - clientId: [], - clientSecret: [], - code: [], - deviceCode: [], - grantType: [], - redirectUri: [], - refreshToken: [], - scope: (_) => (0, smithy_client_7._json)(_) - })); - return new protocol_http_1.HttpRequest({ - protocol, - hostname, - port, - method: "POST", - headers, - path: resolvedPath, - body - }); -}; -var se_RegisterClientCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = { - "content-type": "application/json" - }; - const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/client/register`; - let body; - body = JSON.stringify((0, smithy_client_7.take)(input, { - clientName: [], - clientType: [], - scopes: (_) => (0, smithy_client_7._json)(_) - })); - return new protocol_http_1.HttpRequest({ - protocol, - hostname, - port, - method: "POST", - headers, - path: resolvedPath, - body - }); -}; -var se_StartDeviceAuthorizationCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = { - "content-type": "application/json" - }; - const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/device_authorization`; - let body; - body = JSON.stringify((0, smithy_client_7.take)(input, { - clientId: [], - clientSecret: [], - startUrl: [] - })); - return new protocol_http_1.HttpRequest({ - protocol, - hostname, - port, - method: "POST", - headers, - path: resolvedPath, - body - }); -}; -var de_CreateTokenCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTokenCommandError(output, context); - } - const contents = (0, smithy_client_7.map)({ - $metadata: deserializeMetadata(output) - }); - const data = (0, smithy_client_7.expectNonNull)((0, smithy_client_7.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_7.take)(data, { - accessToken: smithy_client_7.expectString, - expiresIn: smithy_client_7.expectInt32, - idToken: smithy_client_7.expectString, - refreshToken: smithy_client_7.expectString, - tokenType: smithy_client_7.expectString - }); - Object.assign(contents, doc); - return contents; -}; -var de_CreateTokenCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context) - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssooidc#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationPendingException": - case "com.amazonaws.ssooidc#AuthorizationPendingException": - throw await de_AuthorizationPendingExceptionRes(parsedOutput, context); - case "ExpiredTokenException": - case "com.amazonaws.ssooidc#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientException": - case "com.amazonaws.ssooidc#InvalidClientException": - throw await de_InvalidClientExceptionRes(parsedOutput, context); - case "InvalidGrantException": - case "com.amazonaws.ssooidc#InvalidGrantException": - throw await de_InvalidGrantExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidScopeException": - case "com.amazonaws.ssooidc#InvalidScopeException": - throw await de_InvalidScopeExceptionRes(parsedOutput, context); - case "SlowDownException": - case "com.amazonaws.ssooidc#SlowDownException": - throw await de_SlowDownExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.ssooidc#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnsupportedGrantTypeException": - case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": - throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode - }); - } -}; -var de_RegisterClientCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterClientCommandError(output, context); - } - const contents = (0, smithy_client_7.map)({ - $metadata: deserializeMetadata(output) - }); - const data = (0, smithy_client_7.expectNonNull)((0, smithy_client_7.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_7.take)(data, { - authorizationEndpoint: smithy_client_7.expectString, - clientId: smithy_client_7.expectString, - clientIdIssuedAt: smithy_client_7.expectLong, - clientSecret: smithy_client_7.expectString, - clientSecretExpiresAt: smithy_client_7.expectLong, - tokenEndpoint: smithy_client_7.expectString - }); - Object.assign(contents, doc); - return contents; -}; -var de_RegisterClientCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context) - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientMetadataException": - case "com.amazonaws.ssooidc#InvalidClientMetadataException": - throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidScopeException": - case "com.amazonaws.ssooidc#InvalidScopeException": - throw await de_InvalidScopeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode - }); - } -}; -var de_StartDeviceAuthorizationCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDeviceAuthorizationCommandError(output, context); - } - const contents = (0, smithy_client_7.map)({ - $metadata: deserializeMetadata(output) - }); - const data = (0, smithy_client_7.expectNonNull)((0, smithy_client_7.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_7.take)(data, { - deviceCode: smithy_client_7.expectString, - expiresIn: smithy_client_7.expectInt32, - interval: smithy_client_7.expectInt32, - userCode: smithy_client_7.expectString, - verificationUri: smithy_client_7.expectString, - verificationUriComplete: smithy_client_7.expectString - }); - Object.assign(contents, doc); - return contents; -}; -var de_StartDeviceAuthorizationCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context) - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientException": - case "com.amazonaws.ssooidc#InvalidClientException": - throw await de_InvalidClientExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "SlowDownException": - case "com.amazonaws.ssooidc#SlowDownException": - throw await de_SlowDownExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.ssooidc#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode - }); - } -}; -var throwDefaultError = (0, smithy_client_7.withBaseException)(SSOOIDCServiceException); -var de_AccessDeniedExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new AccessDeniedException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_AuthorizationPendingExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new AuthorizationPendingException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_ExpiredTokenExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new ExpiredTokenException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InternalServerExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new InternalServerException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidClientExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new InvalidClientException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidClientMetadataExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new InvalidClientMetadataException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidGrantExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new InvalidGrantException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidRequestExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new InvalidRequestException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidScopeExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new InvalidScopeException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_SlowDownExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new SlowDownException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_UnauthorizedClientExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new UnauthorizedClientException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_7.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_7.take)(data, { - error: smithy_client_7.expectString, - error_description: smithy_client_7.expectString - }); - Object.assign(contents, doc); - const exception = new UnsupportedGrantTypeException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return (0, smithy_client_7.decorateServiceException)(exception, parsedOutput.body); -}; -var deserializeMetadata = (output) => { - var _a, _b; - return ({ - httpStatusCode: output.statusCode, - requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"], - extendedRequestId: output.headers["x-amz-id-2"], - cfId: output.headers["x-amz-cf-id"] - }); -}; -var collectBodyString = (streamBody, context) => (0, smithy_client_7.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); -var parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - return JSON.parse(encoded); - } - return {}; -}); -var parseErrorBody = async (errorBody, context) => { - var _a; - const value = await parseBody(errorBody, context); - value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message; - return value; -}; -var loadRestJsonErrorCode = (output, data) => { - const findKey = (object, key) => Object.keys(object).find((k2) => k2.toLowerCase() === key.toLowerCase()); - const sanitizeErrorCode = (rawValue) => { - let cleanValue = rawValue; - if (typeof cleanValue === "number") { - cleanValue = cleanValue.toString(); - } - if (cleanValue.indexOf(",") >= 0) { - cleanValue = cleanValue.split(",")[0]; - } - if (cleanValue.indexOf(":") >= 0) { - cleanValue = cleanValue.split(":")[0]; - } - if (cleanValue.indexOf("#") >= 0) { - cleanValue = cleanValue.split("#")[1]; - } - return cleanValue; - }; - const headerKey = findKey(output.headers, "x-amzn-errortype"); - if (headerKey !== void 0) { - return sanitizeErrorCode(output.headers[headerKey]); - } - if (data.code !== void 0) { - return sanitizeErrorCode(data.code); - } - if (data["__type"] !== void 0) { - return sanitizeErrorCode(data["__type"]); - } -}; -var CreateTokenCommand = class _CreateTokenCommand extends smithy_client_6.Command { - constructor(input) { - super(); - this.input = input; - } - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_2.getEndpointPlugin)(configuration, _CreateTokenCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOOIDCClient"; - const commandName = "CreateTokenCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _ - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return se_CreateTokenCommand(input, context); - } - deserialize(output, context) { - return de_CreateTokenCommand(output, context); - } -}; -exports.CreateTokenCommand = CreateTokenCommand; -const middleware_endpoint_3 = __nccwpck_require__(82918); -const middleware_serde_2 = __nccwpck_require__(81238); -const smithy_client_9 = __nccwpck_require__(63570); -var RegisterClientCommand = class _RegisterClientCommand extends smithy_client_9.Command { - constructor(input) { - super(); - this.input = input; - } - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_2.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_3.getEndpointPlugin)(configuration, _RegisterClientCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOOIDCClient"; - const commandName = "RegisterClientCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _ - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return se_RegisterClientCommand(input, context); - } - deserialize(output, context) { - return de_RegisterClientCommand(output, context); - } -}; -const middleware_endpoint_4 = __nccwpck_require__(82918); -const middleware_serde_3 = __nccwpck_require__(81238); -const smithy_client_10 = __nccwpck_require__(63570); -var StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends smithy_client_10.Command { - constructor(input) { - super(); - this.input = input; - } - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_3.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_4.getEndpointPlugin)(configuration, _StartDeviceAuthorizationCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOOIDCClient"; - const commandName = "StartDeviceAuthorizationCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _ - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return se_StartDeviceAuthorizationCommand(input, context); - } - deserialize(output, context) { - return de_StartDeviceAuthorizationCommand(output, context); - } -}; -var commands = { - CreateTokenCommand, - RegisterClientCommand, - StartDeviceAuthorizationCommand -}; -var SSOOIDC = class extends SSOOIDCClient { -}; -(0, smithy_client_5.createAggregatedClient)(commands, SSOOIDC); - - -/***/ }), - -/***/ 92242: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.REFRESH_MESSAGE = exports.EXPIRE_WINDOW_MS = void 0; -exports.EXPIRE_WINDOW_MS = 5 * 60 * 1000; -exports.REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; - - -/***/ }), - -/***/ 85125: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromSso = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const constants_1 = __nccwpck_require__(92242); -const getNewSsoOidcToken_1 = __nccwpck_require__(93601); -const validateTokenExpiry_1 = __nccwpck_require__(28418); -const validateTokenKey_1 = __nccwpck_require__(2488); -const writeSSOTokenToFile_1 = __nccwpck_require__(48552); -const lastRefreshAttemptTime = new Date(0); -const fromSso = (init = {}) => async () => { - const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); - const profileName = (0, shared_ini_file_loader_1.getProfileName)(init); - const profile = profiles[profileName]; - if (!profile) { - throw new property_provider_1.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); - } - else if (!profile["sso_session"]) { - throw new property_provider_1.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); - } - const ssoSessionName = profile["sso_session"]; - const ssoSessions = await (0, shared_ini_file_loader_1.loadSsoSessionData)(init); - const ssoSession = ssoSessions[ssoSessionName]; - if (!ssoSession) { - throw new property_provider_1.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false); - } - for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { - if (!ssoSession[ssoSessionRequiredKey]) { - throw new property_provider_1.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); - } - } - const ssoStartUrl = ssoSession["sso_start_url"]; - const ssoRegion = ssoSession["sso_region"]; - let ssoToken; - try { - ssoToken = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoSessionName); - } - catch (e) { - throw new property_provider_1.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${constants_1.REFRESH_MESSAGE}`, false); - } - (0, validateTokenKey_1.validateTokenKey)("accessToken", ssoToken.accessToken); - (0, validateTokenKey_1.validateTokenKey)("expiresAt", ssoToken.expiresAt); - const { accessToken, expiresAt } = ssoToken; - const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; - if (existingToken.expiration.getTime() - Date.now() > constants_1.EXPIRE_WINDOW_MS) { - return existingToken; - } - if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) { - (0, validateTokenExpiry_1.validateTokenExpiry)(existingToken); - return existingToken; - } - (0, validateTokenKey_1.validateTokenKey)("clientId", ssoToken.clientId, true); - (0, validateTokenKey_1.validateTokenKey)("clientSecret", ssoToken.clientSecret, true); - (0, validateTokenKey_1.validateTokenKey)("refreshToken", ssoToken.refreshToken, true); - try { - lastRefreshAttemptTime.setTime(Date.now()); - const newSsoOidcToken = await (0, getNewSsoOidcToken_1.getNewSsoOidcToken)(ssoToken, ssoRegion); - (0, validateTokenKey_1.validateTokenKey)("accessToken", newSsoOidcToken.accessToken); - (0, validateTokenKey_1.validateTokenKey)("expiresIn", newSsoOidcToken.expiresIn); - const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000); - try { - await (0, writeSSOTokenToFile_1.writeSSOTokenToFile)(ssoSessionName, { - ...ssoToken, - accessToken: newSsoOidcToken.accessToken, - expiresAt: newTokenExpiration.toISOString(), - refreshToken: newSsoOidcToken.refreshToken, - }); - } - catch (error) { - } - return { - token: newSsoOidcToken.accessToken, - expiration: newTokenExpiration, - }; - } - catch (error) { - (0, validateTokenExpiry_1.validateTokenExpiry)(existingToken); - return existingToken; - } -}; -exports.fromSso = fromSso; - - -/***/ }), - -/***/ 63258: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromStatic = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const fromStatic = ({ token }) => async () => { - if (!token || !token.token) { - throw new property_provider_1.TokenProviderError(`Please pass a valid token to fromStatic`, false); - } - return token; -}; -exports.fromStatic = fromStatic; - - -/***/ }), - -/***/ 93601: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getNewSsoOidcToken = void 0; -const client_sso_oidc_node_1 = __nccwpck_require__(52664); -const getSsoOidcClient_1 = __nccwpck_require__(99775); -const getNewSsoOidcToken = (ssoToken, ssoRegion) => { - const ssoOidcClient = (0, getSsoOidcClient_1.getSsoOidcClient)(ssoRegion); - return ssoOidcClient.send(new client_sso_oidc_node_1.CreateTokenCommand({ - clientId: ssoToken.clientId, - clientSecret: ssoToken.clientSecret, - refreshToken: ssoToken.refreshToken, - grantType: "refresh_token", - })); -}; -exports.getNewSsoOidcToken = getNewSsoOidcToken; - - -/***/ }), - -/***/ 99775: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSsoOidcClient = void 0; -const client_sso_oidc_node_1 = __nccwpck_require__(52664); -const ssoOidcClientsHash = {}; -const getSsoOidcClient = (ssoRegion) => { - if (ssoOidcClientsHash[ssoRegion]) { - return ssoOidcClientsHash[ssoRegion]; - } - const ssoOidcClient = new client_sso_oidc_node_1.SSOOIDCClient({ region: ssoRegion }); - ssoOidcClientsHash[ssoRegion] = ssoOidcClient; - return ssoOidcClient; -}; -exports.getSsoOidcClient = getSsoOidcClient; - - -/***/ }), - -/***/ 52843: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(52664), exports); -tslib_1.__exportStar(__nccwpck_require__(85125), exports); -tslib_1.__exportStar(__nccwpck_require__(63258), exports); -tslib_1.__exportStar(__nccwpck_require__(70195), exports); - - -/***/ }), - -/***/ 70195: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.nodeProvider = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const fromSso_1 = __nccwpck_require__(85125); -const nodeProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromSso_1.fromSso)(init), async () => { - throw new property_provider_1.TokenProviderError("Could not load token from any providers", false); -}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined); -exports.nodeProvider = nodeProvider; - - -/***/ }), - -/***/ 28418: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateTokenExpiry = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const constants_1 = __nccwpck_require__(92242); -const validateTokenExpiry = (token) => { - if (token.expiration && token.expiration.getTime() < Date.now()) { - throw new property_provider_1.TokenProviderError(`Token is expired. ${constants_1.REFRESH_MESSAGE}`, false); - } -}; -exports.validateTokenExpiry = validateTokenExpiry; - - -/***/ }), - -/***/ 2488: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateTokenKey = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const constants_1 = __nccwpck_require__(92242); -const validateTokenKey = (key, value, forRefresh = false) => { - if (typeof value === "undefined") { - throw new property_provider_1.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${constants_1.REFRESH_MESSAGE}`, false); - } -}; -exports.validateTokenKey = validateTokenKey; - - -/***/ }), - -/***/ 48552: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeSSOTokenToFile = void 0; -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const fs_1 = __nccwpck_require__(57147); -const { writeFile } = fs_1.promises; -const writeSSOTokenToFile = (id, ssoToken) => { - const tokenFilepath = (0, shared_ini_file_loader_1.getSSOTokenFilepath)(id); - const tokenString = JSON.stringify(ssoToken, null, 2); - return writeFile(tokenFilepath, tokenString); -}; -exports.writeSSOTokenToFile = writeSSOTokenToFile; - - -/***/ }), - -/***/ 10653: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - - -/***/ }), - -/***/ 28778: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -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; -}; -exports.getTransformedHeaders = getTransformedHeaders; - - -/***/ }), - -/***/ 17150: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(77768), exports); -tslib_1.__exportStar(__nccwpck_require__(22256), exports); -tslib_1.__exportStar(__nccwpck_require__(49481), exports); - - -/***/ }), - -/***/ 77768: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; -const protocol_http_1 = __nccwpck_require__(22916); -const querystring_builder_1 = __nccwpck_require__(87983); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(10653); -const get_transformed_headers_1 = __nccwpck_require__(28778); -const set_connection_timeout_1 = __nccwpck_require__(14070); -const set_socket_keep_alive_1 = __nccwpck_require__(79401); -const set_socket_timeout_1 = __nccwpck_require__(56588); -const write_request_body_1 = __nccwpck_require__(60643); -exports.DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - var _a, _b; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - auth, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - }); - } - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } -} -exports.NodeHttpHandler = NodeHttpHandler; - - -/***/ }), - -/***/ 29584: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionManager = void 0; -const tslib_1 = __nccwpck_require__(4351); -const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); -const node_http2_connection_pool_1 = __nccwpck_require__(36070); -class NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const 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_1.default.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 node_http2_connection_pool_1.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) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); - } -} -exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; - - -/***/ }), - -/***/ 36070: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionPool = void 0; -class NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions !== null && sessions !== void 0 ? 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(); - } - } - } - } -} -exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; - - -/***/ }), - -/***/ 22256: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(22916); -const querystring_builder_1 = __nccwpck_require__(87983); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(28778); -const node_http2_connection_manager_1 = __nccwpck_require__(29584); -const write_request_body_1 = __nccwpck_require__(60643); -class NodeHttp2Handler { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); - 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 } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a, _b, _c; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal === null || abortSignal === void 0 ? void 0 : 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 = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - 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 = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } -} -exports.NodeHttp2Handler = NodeHttp2Handler; - - -/***/ }), - -/***/ 14070: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; - } - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - else { - clearTimeout(timeoutId); - } - }); -}; -exports.setConnectionTimeout = setConnectionTimeout; - - -/***/ }), - -/***/ 79401: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketKeepAlive = void 0; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; - } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); -}; -exports.setSocketKeepAlive = setSocketKeepAlive; - - -/***/ }), - -/***/ 56588: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); -}; -exports.setSocketTimeout = setSocketTimeout; - - -/***/ }), - -/***/ 17745: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } -} -exports.Collector = Collector; - - -/***/ }), - -/***/ 49481: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(17745); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.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); - }); -}); -exports.streamCollector = streamCollector; - - -/***/ }), - -/***/ 60643: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -const MIN_WAIT_TIME = 1000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - var _a; - const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }), - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} - - -/***/ }), - -/***/ 97519: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(55961); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 8296: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 71355: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 62240: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(71355), exports); - - -/***/ }), - -/***/ 71011: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 36744: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 11128: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 22916: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(62240), exports); -tslib_1.__exportStar(__nccwpck_require__(97519), exports); -tslib_1.__exportStar(__nccwpck_require__(8296), exports); -tslib_1.__exportStar(__nccwpck_require__(71011), exports); -tslib_1.__exportStar(__nccwpck_require__(36744), exports); -tslib_1.__exportStar(__nccwpck_require__(11128), exports); -tslib_1.__exportStar(__nccwpck_require__(23027), exports); -tslib_1.__exportStar(__nccwpck_require__(80354), exports); - - -/***/ }), - -/***/ 23027: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 80354: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87983: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(18802); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } - } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; - - -/***/ }), - -/***/ 59993: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 47111: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 86825: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 47409: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21795: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 52681: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 86638: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 12274: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(86638), exports); -tslib_1.__exportStar(__nccwpck_require__(39534), exports); -tslib_1.__exportStar(__nccwpck_require__(38832), exports); - - -/***/ }), - -/***/ 39534: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 38832: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 55780: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43170: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20502: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 60975: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 44216: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 8671: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 85462: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 92762: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(60975), exports); -tslib_1.__exportStar(__nccwpck_require__(44216), exports); -tslib_1.__exportStar(__nccwpck_require__(8671), exports); -tslib_1.__exportStar(__nccwpck_require__(12130), exports); -tslib_1.__exportStar(__nccwpck_require__(85462), exports); - - -/***/ }), - -/***/ 12130: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 28686: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43283: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 10838: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(43283); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 97892: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 94993: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(10838), exports); -tslib_1.__exportStar(__nccwpck_require__(97892), exports); -var checksum_1 = __nccwpck_require__(43283); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 84089: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 30843: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 40173: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21997: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(30843), exports); -tslib_1.__exportStar(__nccwpck_require__(40173), exports); - - -/***/ }), - -/***/ 55961: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(59993), exports); -tslib_1.__exportStar(__nccwpck_require__(47111), exports); -tslib_1.__exportStar(__nccwpck_require__(86825), exports); -tslib_1.__exportStar(__nccwpck_require__(47409), exports); -tslib_1.__exportStar(__nccwpck_require__(21795), exports); -tslib_1.__exportStar(__nccwpck_require__(52681), exports); -tslib_1.__exportStar(__nccwpck_require__(12274), exports); -tslib_1.__exportStar(__nccwpck_require__(55780), exports); -tslib_1.__exportStar(__nccwpck_require__(43170), exports); -tslib_1.__exportStar(__nccwpck_require__(20502), exports); -tslib_1.__exportStar(__nccwpck_require__(92762), exports); -tslib_1.__exportStar(__nccwpck_require__(28686), exports); -tslib_1.__exportStar(__nccwpck_require__(94993), exports); -tslib_1.__exportStar(__nccwpck_require__(84089), exports); -tslib_1.__exportStar(__nccwpck_require__(21997), exports); -tslib_1.__exportStar(__nccwpck_require__(27658), exports); -tslib_1.__exportStar(__nccwpck_require__(29966), exports); -tslib_1.__exportStar(__nccwpck_require__(30878), exports); -tslib_1.__exportStar(__nccwpck_require__(41567), exports); -tslib_1.__exportStar(__nccwpck_require__(77181), exports); -tslib_1.__exportStar(__nccwpck_require__(19900), exports); -tslib_1.__exportStar(__nccwpck_require__(70640), exports); -tslib_1.__exportStar(__nccwpck_require__(13136), exports); -tslib_1.__exportStar(__nccwpck_require__(30294), exports); -tslib_1.__exportStar(__nccwpck_require__(78922), exports); -tslib_1.__exportStar(__nccwpck_require__(61220), exports); -tslib_1.__exportStar(__nccwpck_require__(94269), exports); -tslib_1.__exportStar(__nccwpck_require__(33851), exports); -tslib_1.__exportStar(__nccwpck_require__(69224), exports); -tslib_1.__exportStar(__nccwpck_require__(66991), exports); -tslib_1.__exportStar(__nccwpck_require__(47521), exports); -tslib_1.__exportStar(__nccwpck_require__(46606), exports); -tslib_1.__exportStar(__nccwpck_require__(43741), exports); -tslib_1.__exportStar(__nccwpck_require__(35668), exports); - - -/***/ }), - -/***/ 27658: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 29966: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 30878: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 41567: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 77181: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 19900: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 70640: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13136: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 30294: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 78922: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61220: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 94269: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 33851: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 69224: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 66991: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 47521: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 46606: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43741: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 35668: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13834: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(54978); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; - - -/***/ }), - -/***/ 54978: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; - - -/***/ }), - -/***/ 18802: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(54978), exports); -tslib_1.__exportStar(__nccwpck_require__(13834), exports); - - -/***/ }), - -/***/ 52562: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 26913: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var types_1 = __nccwpck_require__(36424); -Object.defineProperty(exports, "HttpAuthLocation", ({ enumerable: true, get: function () { return types_1.HttpAuthLocation; } })); - - -/***/ }), - -/***/ 14994: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 65861: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 76527: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48470: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 28045: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 67736: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13268: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 90142: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HostAddressType = void 0; -var HostAddressType; -(function (HostAddressType) { - HostAddressType["AAAA"] = "AAAA"; - HostAddressType["A"] = "A"; -})(HostAddressType = exports.HostAddressType || (exports.HostAddressType = {})); - - -/***/ }), - -/***/ 62338: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 99385: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var types_1 = __nccwpck_require__(36424); -Object.defineProperty(exports, "EndpointURLScheme", ({ enumerable: true, get: function () { return types_1.EndpointURLScheme; } })); - - -/***/ }), - -/***/ 37521: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 76244: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61393: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 51821: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 92635: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 71301: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21268: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 7192: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 10640: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(51821), exports); -tslib_1.__exportStar(__nccwpck_require__(92635), exports); -tslib_1.__exportStar(__nccwpck_require__(71301), exports); -tslib_1.__exportStar(__nccwpck_require__(21268), exports); -tslib_1.__exportStar(__nccwpck_require__(7192), exports); - - -/***/ }), - -/***/ 89029: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(52562), exports); -tslib_1.__exportStar(__nccwpck_require__(26913), exports); -tslib_1.__exportStar(__nccwpck_require__(14994), exports); -tslib_1.__exportStar(__nccwpck_require__(65861), exports); -tslib_1.__exportStar(__nccwpck_require__(76527), exports); -tslib_1.__exportStar(__nccwpck_require__(48470), exports); -tslib_1.__exportStar(__nccwpck_require__(28045), exports); -tslib_1.__exportStar(__nccwpck_require__(67736), exports); -tslib_1.__exportStar(__nccwpck_require__(13268), exports); -tslib_1.__exportStar(__nccwpck_require__(90142), exports); -tslib_1.__exportStar(__nccwpck_require__(62338), exports); -tslib_1.__exportStar(__nccwpck_require__(99385), exports); -tslib_1.__exportStar(__nccwpck_require__(37521), exports); -tslib_1.__exportStar(__nccwpck_require__(76244), exports); -tslib_1.__exportStar(__nccwpck_require__(61393), exports); -tslib_1.__exportStar(__nccwpck_require__(10640), exports); -tslib_1.__exportStar(__nccwpck_require__(89910), exports); -tslib_1.__exportStar(__nccwpck_require__(36678), exports); -tslib_1.__exportStar(__nccwpck_require__(39931), exports); -tslib_1.__exportStar(__nccwpck_require__(42620), exports); -tslib_1.__exportStar(__nccwpck_require__(89062), exports); -tslib_1.__exportStar(__nccwpck_require__(89546), exports); -tslib_1.__exportStar(__nccwpck_require__(80316), exports); -tslib_1.__exportStar(__nccwpck_require__(57835), exports); -tslib_1.__exportStar(__nccwpck_require__(91678), exports); -tslib_1.__exportStar(__nccwpck_require__(93818), exports); -tslib_1.__exportStar(__nccwpck_require__(51991), exports); -tslib_1.__exportStar(__nccwpck_require__(24296), exports); -tslib_1.__exportStar(__nccwpck_require__(59416), exports); -tslib_1.__exportStar(__nccwpck_require__(92772), exports); -tslib_1.__exportStar(__nccwpck_require__(20134), exports); -tslib_1.__exportStar(__nccwpck_require__(34465), exports); - - -/***/ }), - -/***/ 89910: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 36678: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 39931: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 42620: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89062: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89546: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 80316: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57835: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 91678: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 93818: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 51991: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 24296: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 59416: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var types_1 = __nccwpck_require__(36424); -Object.defineProperty(exports, "RequestHandlerProtocol", ({ enumerable: true, get: function () { return types_1.RequestHandlerProtocol; } })); - - -/***/ }), - -/***/ 92772: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20134: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34465: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 49015: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 42268: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 87049: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 40109: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 24745: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 86373: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 82962: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 39891: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(82962), exports); -tslib_1.__exportStar(__nccwpck_require__(80847), exports); -tslib_1.__exportStar(__nccwpck_require__(31457), exports); - - -/***/ }), - -/***/ 80847: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 31457: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 26450: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 371: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 82836: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 28633: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 12818: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 98737: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 85468: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48275: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(28633), exports); -tslib_1.__exportStar(__nccwpck_require__(12818), exports); -tslib_1.__exportStar(__nccwpck_require__(98737), exports); -tslib_1.__exportStar(__nccwpck_require__(44093), exports); -tslib_1.__exportStar(__nccwpck_require__(85468), exports); - - -/***/ }), - -/***/ 44093: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89946: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 96692: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 79438: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(96692); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 79454: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 50617: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(79438), exports); -tslib_1.__exportStar(__nccwpck_require__(79454), exports); -var checksum_1 = __nccwpck_require__(96692); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 16618: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 42886: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21861: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 62426: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(42886), exports); -tslib_1.__exportStar(__nccwpck_require__(21861), exports); - - -/***/ }), - -/***/ 36424: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(49015), exports); -tslib_1.__exportStar(__nccwpck_require__(42268), exports); -tslib_1.__exportStar(__nccwpck_require__(87049), exports); -tslib_1.__exportStar(__nccwpck_require__(40109), exports); -tslib_1.__exportStar(__nccwpck_require__(24745), exports); -tslib_1.__exportStar(__nccwpck_require__(86373), exports); -tslib_1.__exportStar(__nccwpck_require__(39891), exports); -tslib_1.__exportStar(__nccwpck_require__(26450), exports); -tslib_1.__exportStar(__nccwpck_require__(371), exports); -tslib_1.__exportStar(__nccwpck_require__(82836), exports); -tslib_1.__exportStar(__nccwpck_require__(48275), exports); -tslib_1.__exportStar(__nccwpck_require__(89946), exports); -tslib_1.__exportStar(__nccwpck_require__(50617), exports); -tslib_1.__exportStar(__nccwpck_require__(16618), exports); -tslib_1.__exportStar(__nccwpck_require__(62426), exports); -tslib_1.__exportStar(__nccwpck_require__(76543), exports); -tslib_1.__exportStar(__nccwpck_require__(46236), exports); -tslib_1.__exportStar(__nccwpck_require__(16464), exports); -tslib_1.__exportStar(__nccwpck_require__(89055), exports); -tslib_1.__exportStar(__nccwpck_require__(15474), exports); -tslib_1.__exportStar(__nccwpck_require__(44715), exports); -tslib_1.__exportStar(__nccwpck_require__(92701), exports); -tslib_1.__exportStar(__nccwpck_require__(39602), exports); -tslib_1.__exportStar(__nccwpck_require__(59674), exports); -tslib_1.__exportStar(__nccwpck_require__(16546), exports); -tslib_1.__exportStar(__nccwpck_require__(41903), exports); -tslib_1.__exportStar(__nccwpck_require__(25929), exports); -tslib_1.__exportStar(__nccwpck_require__(44744), exports); -tslib_1.__exportStar(__nccwpck_require__(57898), exports); -tslib_1.__exportStar(__nccwpck_require__(26016), exports); -tslib_1.__exportStar(__nccwpck_require__(99459), exports); -tslib_1.__exportStar(__nccwpck_require__(48559), exports); -tslib_1.__exportStar(__nccwpck_require__(65436), exports); -tslib_1.__exportStar(__nccwpck_require__(34231), exports); - - -/***/ }), - -/***/ 76543: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 46236: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 16464: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89055: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 15474: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 44715: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 92701: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 39602: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 59674: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 16546: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 41903: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 25929: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 44744: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57898: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 26016: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 99459: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48559: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 65436: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34231: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 81809: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.debugId = void 0; -exports.debugId = "endpoints"; - - -/***/ }), - -/***/ 27617: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(81809), exports); -tslib_1.__exportStar(__nccwpck_require__(46833), exports); - - -/***/ }), - -/***/ 46833: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toDebugString = void 0; -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); -} -exports.toDebugString = toDebugString; - - -/***/ }), - -/***/ 13350: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(37482), exports); -tslib_1.__exportStar(__nccwpck_require__(73442), exports); -tslib_1.__exportStar(__nccwpck_require__(36563), exports); -tslib_1.__exportStar(__nccwpck_require__(57433), exports); - - -/***/ }), - -/***/ 46835: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(48079), exports); -tslib_1.__exportStar(__nccwpck_require__(34711), exports); -tslib_1.__exportStar(__nccwpck_require__(37482), exports); - - -/***/ }), - -/***/ 48079: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isVirtualHostableS3Bucket = void 0; -const isIpAddress_1 = __nccwpck_require__(73442); -const isValidHostLabel_1 = __nccwpck_require__(57373); -const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { - if (allowSubDomains) { - for (const label of value.split(".")) { - if (!(0, exports.isVirtualHostableS3Bucket)(label)) { - return false; - } - } - return true; - } - if (!(0, isValidHostLabel_1.isValidHostLabel)(value)) { - return false; - } - if (value.length < 3 || value.length > 63) { - return false; - } - if (value !== value.toLowerCase()) { - return false; - } - if ((0, isIpAddress_1.isIpAddress)(value)) { - return false; - } - return true; -}; -exports.isVirtualHostableS3Bucket = isVirtualHostableS3Bucket; - - -/***/ }), - -/***/ 34711: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseArn = void 0; -const parseArn = (value) => { - const segments = value.split(":"); - if (segments.length < 6) - return null; - const [arn, partition, service, region, accountId, ...resourceId] = segments; - if (arn !== "arn" || partition === "" || service === "" || resourceId[0] === "") - return null; - return { - partition, - service, - region, - accountId, - resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId, - }; -}; -exports.parseArn = parseArn; - - -/***/ }), - -/***/ 37482: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getUserAgentPrefix = exports.useDefaultPartitionInfo = exports.setPartitionInfo = exports.partition = void 0; -const tslib_1 = __nccwpck_require__(4351); -const partitions_json_1 = tslib_1.__importDefault(__nccwpck_require__(95367)); -let selectedPartitionsInfo = partitions_json_1.default; -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, - }; - } - } - } - for (const partition of partitions) { - const { regionRegex, outputs } = partition; - if (new RegExp(regionRegex).test(value)) { - return { - ...outputs, - }; - } - } - 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, - }; -}; -exports.partition = partition; -const setPartitionInfo = (partitionsInfo, userAgentPrefix = "") => { - selectedPartitionsInfo = partitionsInfo; - selectedUserAgentPrefix = userAgentPrefix; -}; -exports.setPartitionInfo = setPartitionInfo; -const useDefaultPartitionInfo = () => { - (0, exports.setPartitionInfo)(partitions_json_1.default, ""); -}; -exports.useDefaultPartitionInfo = useDefaultPartitionInfo; -const getUserAgentPrefix = () => selectedUserAgentPrefix; -exports.getUserAgentPrefix = getUserAgentPrefix; - - -/***/ }), - -/***/ 55370: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.booleanEquals = void 0; -const booleanEquals = (value1, value2) => value1 === value2; -exports.booleanEquals = booleanEquals; - - -/***/ }), - -/***/ 20767: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAttr = void 0; -const types_1 = __nccwpck_require__(57433); -const getAttrPathList_1 = __nccwpck_require__(81844); -const getAttr = (value, path) => (0, getAttrPathList_1.getAttrPathList)(path).reduce((acc, index) => { - if (typeof acc !== "object") { - throw new types_1.EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); - } - else if (Array.isArray(acc)) { - return acc[parseInt(index)]; - } - return acc[index]; -}, value); -exports.getAttr = getAttr; - - -/***/ }), - -/***/ 81844: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAttrPathList = void 0; -const types_1 = __nccwpck_require__(57433); -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 types_1.EndpointError(`Path: '${path}' does not end with ']'`); - } - const arrayIndex = part.slice(squareBracketIndex + 1, -1); - if (Number.isNaN(parseInt(arrayIndex))) { - throw new types_1.EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); - } - if (squareBracketIndex !== 0) { - pathList.push(part.slice(0, squareBracketIndex)); - } - pathList.push(arrayIndex); - } - else { - pathList.push(part); - } - } - return pathList; -}; -exports.getAttrPathList = getAttrPathList; - - -/***/ }), - -/***/ 83188: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.aws = void 0; -const tslib_1 = __nccwpck_require__(4351); -exports.aws = tslib_1.__importStar(__nccwpck_require__(46835)); -tslib_1.__exportStar(__nccwpck_require__(55370), exports); -tslib_1.__exportStar(__nccwpck_require__(20767), exports); -tslib_1.__exportStar(__nccwpck_require__(78816), exports); -tslib_1.__exportStar(__nccwpck_require__(57373), exports); -tslib_1.__exportStar(__nccwpck_require__(29692), exports); -tslib_1.__exportStar(__nccwpck_require__(22780), exports); -tslib_1.__exportStar(__nccwpck_require__(55182), exports); -tslib_1.__exportStar(__nccwpck_require__(48305), exports); -tslib_1.__exportStar(__nccwpck_require__(6535), exports); - - -/***/ }), - -/***/ 73442: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isIpAddress = void 0; -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("]")); -exports.isIpAddress = isIpAddress; - - -/***/ }), - -/***/ 78816: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSet = void 0; -const isSet = (value) => value != null; -exports.isSet = isSet; - - -/***/ }), - -/***/ 57373: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostLabel = void 0; -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 (!(0, exports.isValidHostLabel)(label)) { - return false; - } - } - return true; -}; -exports.isValidHostLabel = isValidHostLabel; - - -/***/ }), - -/***/ 29692: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.not = void 0; -const not = (value) => !value; -exports.not = not; - - -/***/ }), - -/***/ 22780: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseURL = void 0; -const types_1 = __nccwpck_require__(89029); -const isIpAddress_1 = __nccwpck_require__(73442); -const DEFAULT_PORTS = { - [types_1.EndpointURLScheme.HTTP]: 80, - [types_1.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; - } - return new URL(value); - } - 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_1.EndpointURLScheme).includes(scheme)) { - return null; - } - const isIp = (0, isIpAddress_1.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, - }; -}; -exports.parseURL = parseURL; - - -/***/ }), - -/***/ 55182: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.stringEquals = void 0; -const stringEquals = (value1, value2) => value1 === value2; -exports.stringEquals = stringEquals; - - -/***/ }), - -/***/ 48305: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.substring = void 0; -const substring = (input, start, stop, reverse) => { - if (start >= stop || input.length < stop) { - return null; - } - if (!reverse) { - return input.substring(start, stop); - } - return input.substring(input.length - stop, input.length - start); -}; -exports.substring = substring; - - -/***/ }), - -/***/ 6535: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.uriEncode = void 0; -const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); -exports.uriEncode = uriEncode; - - -/***/ }), - -/***/ 36563: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEndpoint = void 0; -const debug_1 = __nccwpck_require__(27617); -const types_1 = __nccwpck_require__(57433); -const utils_1 = __nccwpck_require__(81114); -const resolveEndpoint = (ruleSetObject, options) => { - var _a, _b, _c, _d, _e, _f; - const { endpointParams, logger } = options; - const { parameters, rules } = ruleSetObject; - (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, `${debug_1.debugId} Initial EndpointParams: ${(0, debug_1.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] = (_c = endpointParams[paramKey]) !== null && _c !== void 0 ? _c : paramDefaultValue; - } - } - const requiredParams = Object.entries(parameters) - .filter(([, v]) => v.required) - .map(([k]) => k); - for (const requiredParam of requiredParams) { - if (endpointParams[requiredParam] == null) { - throw new types_1.EndpointError(`Missing required parameter: '${requiredParam}'`); - } - } - const endpoint = (0, utils_1.evaluateRules)(rules, { endpointParams, logger, referenceRecord: {} }); - if ((_d = options.endpointParams) === null || _d === void 0 ? void 0 : _d.Endpoint) { - try { - const givenEndpoint = new URL(options.endpointParams.Endpoint); - const { protocol, port } = givenEndpoint; - endpoint.url.protocol = protocol; - endpoint.url.port = port; - } - catch (e) { - } - } - (_f = (_e = options.logger) === null || _e === void 0 ? void 0 : _e.debug) === null || _f === void 0 ? void 0 : _f.call(_e, `${debug_1.debugId} Resolved endpoint: ${(0, debug_1.toDebugString)(endpoint)}`); - return endpoint; -}; -exports.resolveEndpoint = resolveEndpoint; - - -/***/ }), - -/***/ 82605: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointError = void 0; -class EndpointError extends Error { - constructor(message) { - super(message); - this.name = "EndpointError"; - } -} -exports.EndpointError = EndpointError; - - -/***/ }), - -/***/ 21261: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20312: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 56083: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21767: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57433: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(82605), exports); -tslib_1.__exportStar(__nccwpck_require__(21261), exports); -tslib_1.__exportStar(__nccwpck_require__(20312), exports); -tslib_1.__exportStar(__nccwpck_require__(56083), exports); -tslib_1.__exportStar(__nccwpck_require__(21767), exports); -tslib_1.__exportStar(__nccwpck_require__(41811), exports); - - -/***/ }), - -/***/ 41811: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 65075: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.callFunction = void 0; -const tslib_1 = __nccwpck_require__(4351); -const lib = tslib_1.__importStar(__nccwpck_require__(83188)); -const evaluateExpression_1 = __nccwpck_require__(82980); -const callFunction = ({ fn, argv }, options) => { - const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : (0, evaluateExpression_1.evaluateExpression)(arg, "arg", options)); - return fn.split(".").reduce((acc, key) => acc[key], lib)(...evaluatedArgs); -}; -exports.callFunction = callFunction; - - -/***/ }), - -/***/ 77851: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateCondition = void 0; -const debug_1 = __nccwpck_require__(27617); -const types_1 = __nccwpck_require__(57433); -const callFunction_1 = __nccwpck_require__(65075); -const evaluateCondition = ({ assign, ...fnArgs }, options) => { - var _a, _b; - if (assign && assign in options.referenceRecord) { - throw new types_1.EndpointError(`'${assign}' is already defined in Reference Record.`); - } - const value = (0, callFunction_1.callFunction)(fnArgs, options); - (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `evaluateCondition: ${(0, debug_1.toDebugString)(fnArgs)} = ${(0, debug_1.toDebugString)(value)}`); - return { - result: value === "" ? true : !!value, - ...(assign != null && { toAssign: { name: assign, value } }), - }; -}; -exports.evaluateCondition = evaluateCondition; - - -/***/ }), - -/***/ 59169: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateConditions = void 0; -const debug_1 = __nccwpck_require__(27617); -const evaluateCondition_1 = __nccwpck_require__(77851); -const evaluateConditions = (conditions = [], options) => { - var _a, _b; - const conditionsReferenceRecord = {}; - for (const condition of conditions) { - const { result, toAssign } = (0, evaluateCondition_1.evaluateCondition)(condition, { - ...options, - referenceRecord: { - ...options.referenceRecord, - ...conditionsReferenceRecord, - }, - }); - if (!result) { - return { result }; - } - if (toAssign) { - conditionsReferenceRecord[toAssign.name] = toAssign.value; - (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `assign: ${toAssign.name} := ${(0, debug_1.toDebugString)(toAssign.value)}`); - } - } - return { result: true, referenceRecord: conditionsReferenceRecord }; -}; -exports.evaluateConditions = evaluateConditions; - - -/***/ }), - -/***/ 35324: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateEndpointRule = void 0; -const debug_1 = __nccwpck_require__(27617); -const evaluateConditions_1 = __nccwpck_require__(59169); -const getEndpointHeaders_1 = __nccwpck_require__(88268); -const getEndpointProperties_1 = __nccwpck_require__(34973); -const getEndpointUrl_1 = __nccwpck_require__(23602); -const evaluateEndpointRule = (endpointRule, options) => { - var _a, _b; - const { conditions, endpoint } = endpointRule; - const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); - if (!result) { - return; - } - const endpointRuleOptions = { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, - }; - const { url, properties, headers } = endpoint; - (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `Resolving endpoint from template: ${(0, debug_1.toDebugString)(endpoint)}`); - return { - ...(headers != undefined && { - headers: (0, getEndpointHeaders_1.getEndpointHeaders)(headers, endpointRuleOptions), - }), - ...(properties != undefined && { - properties: (0, getEndpointProperties_1.getEndpointProperties)(properties, endpointRuleOptions), - }), - url: (0, getEndpointUrl_1.getEndpointUrl)(url, endpointRuleOptions), - }; -}; -exports.evaluateEndpointRule = evaluateEndpointRule; - - -/***/ }), - -/***/ 12110: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateErrorRule = void 0; -const types_1 = __nccwpck_require__(57433); -const evaluateConditions_1 = __nccwpck_require__(59169); -const evaluateExpression_1 = __nccwpck_require__(82980); -const evaluateErrorRule = (errorRule, options) => { - const { conditions, error } = errorRule; - const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); - if (!result) { - return; - } - throw new types_1.EndpointError((0, evaluateExpression_1.evaluateExpression)(error, "Error", { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, - })); -}; -exports.evaluateErrorRule = evaluateErrorRule; - - -/***/ }), - -/***/ 82980: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateExpression = void 0; -const types_1 = __nccwpck_require__(57433); -const callFunction_1 = __nccwpck_require__(65075); -const evaluateTemplate_1 = __nccwpck_require__(57535); -const getReferenceValue_1 = __nccwpck_require__(68810); -const evaluateExpression = (obj, keyName, options) => { - if (typeof obj === "string") { - return (0, evaluateTemplate_1.evaluateTemplate)(obj, options); - } - else if (obj["fn"]) { - return (0, callFunction_1.callFunction)(obj, options); - } - else if (obj["ref"]) { - return (0, getReferenceValue_1.getReferenceValue)(obj, options); - } - throw new types_1.EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); -}; -exports.evaluateExpression = evaluateExpression; - - -/***/ }), - -/***/ 59738: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateRules = void 0; -const types_1 = __nccwpck_require__(57433); -const evaluateEndpointRule_1 = __nccwpck_require__(35324); -const evaluateErrorRule_1 = __nccwpck_require__(12110); -const evaluateTreeRule_1 = __nccwpck_require__(26587); -const evaluateRules = (rules, options) => { - for (const rule of rules) { - if (rule.type === "endpoint") { - const endpointOrUndefined = (0, evaluateEndpointRule_1.evaluateEndpointRule)(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } - } - else if (rule.type === "error") { - (0, evaluateErrorRule_1.evaluateErrorRule)(rule, options); - } - else if (rule.type === "tree") { - const endpointOrUndefined = (0, evaluateTreeRule_1.evaluateTreeRule)(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } - } - else { - throw new types_1.EndpointError(`Unknown endpoint rule: ${rule}`); - } - } - throw new types_1.EndpointError(`Rules evaluation failed`); -}; -exports.evaluateRules = evaluateRules; - - -/***/ }), - -/***/ 57535: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateTemplate = void 0; -const lib_1 = __nccwpck_require__(83188); -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((0, lib_1.getAttr)(templateContext[refName], attrName)); - } - else { - evaluatedTemplateArr.push(templateContext[parameterName]); - } - currentIndex = closingBraceIndex + 1; - } - return evaluatedTemplateArr.join(""); -}; -exports.evaluateTemplate = evaluateTemplate; - - -/***/ }), - -/***/ 26587: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateTreeRule = void 0; -const evaluateConditions_1 = __nccwpck_require__(59169); -const evaluateRules_1 = __nccwpck_require__(59738); -const evaluateTreeRule = (treeRule, options) => { - const { conditions, rules } = treeRule; - const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); - if (!result) { - return; - } - return (0, evaluateRules_1.evaluateRules)(rules, { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, - }); -}; -exports.evaluateTreeRule = evaluateTreeRule; - - -/***/ }), - -/***/ 88268: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointHeaders = void 0; -const types_1 = __nccwpck_require__(57433); -const evaluateExpression_1 = __nccwpck_require__(82980); -const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ - ...acc, - [headerKey]: headerVal.map((headerValEntry) => { - const processedExpr = (0, evaluateExpression_1.evaluateExpression)(headerValEntry, "Header value entry", options); - if (typeof processedExpr !== "string") { - throw new types_1.EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); - } - return processedExpr; - }), -}), {}); -exports.getEndpointHeaders = getEndpointHeaders; - - -/***/ }), - -/***/ 34973: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointProperties = void 0; -const getEndpointProperty_1 = __nccwpck_require__(42978); -const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ - ...acc, - [propertyKey]: (0, getEndpointProperty_1.getEndpointProperty)(propertyVal, options), -}), {}); -exports.getEndpointProperties = getEndpointProperties; - - -/***/ }), - -/***/ 42978: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointProperty = void 0; -const types_1 = __nccwpck_require__(57433); -const evaluateTemplate_1 = __nccwpck_require__(57535); -const getEndpointProperties_1 = __nccwpck_require__(34973); -const getEndpointProperty = (property, options) => { - if (Array.isArray(property)) { - return property.map((propertyEntry) => (0, exports.getEndpointProperty)(propertyEntry, options)); - } - switch (typeof property) { - case "string": - return (0, evaluateTemplate_1.evaluateTemplate)(property, options); - case "object": - if (property === null) { - throw new types_1.EndpointError(`Unexpected endpoint property: ${property}`); - } - return (0, getEndpointProperties_1.getEndpointProperties)(property, options); - case "boolean": - return property; - default: - throw new types_1.EndpointError(`Unexpected endpoint property type: ${typeof property}`); - } -}; -exports.getEndpointProperty = getEndpointProperty; - - -/***/ }), - -/***/ 23602: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointUrl = void 0; -const types_1 = __nccwpck_require__(57433); -const evaluateExpression_1 = __nccwpck_require__(82980); -const getEndpointUrl = (endpointUrl, options) => { - const expression = (0, evaluateExpression_1.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; - } - } - throw new types_1.EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); -}; -exports.getEndpointUrl = getEndpointUrl; - - -/***/ }), - -/***/ 68810: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getReferenceValue = void 0; -const getReferenceValue = ({ ref }, options) => { - const referenceRecord = { - ...options.endpointParams, - ...options.referenceRecord, - }; - return referenceRecord[ref]; -}; -exports.getReferenceValue = getReferenceValue; - - -/***/ }), - -/***/ 81114: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(59738), exports); - - -/***/ }), - -/***/ 98095: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultUserAgent = exports.UA_APP_ID_INI_NAME = exports.UA_APP_ID_ENV_NAME = void 0; -const node_config_provider_1 = __nccwpck_require__(33461); -const os_1 = __nccwpck_require__(22037); -const process_1 = __nccwpck_require__(77282); -const is_crt_available_1 = __nccwpck_require__(68390); -exports.UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; -exports.UA_APP_ID_INI_NAME = "sdk-ua-app-id"; -const defaultUserAgent = ({ serviceId, clientVersion }) => { - const sections = [ - ["aws-sdk-js", clientVersion], - ["ua", "2.0"], - [`os/${(0, os_1.platform)()}`, (0, os_1.release)()], - ["lang/js"], - ["md/nodejs", `${process_1.versions.node}`], - ]; - const crtAvailable = (0, is_crt_available_1.isCrtAvailable)(); - if (crtAvailable) { - sections.push(crtAvailable); - } - if (serviceId) { - sections.push([`api/${serviceId}`, clientVersion]); - } - if (process_1.env.AWS_EXECUTION_ENV) { - sections.push([`exec-env/${process_1.env.AWS_EXECUTION_ENV}`]); - } - const appIdPromise = (0, node_config_provider_1.loadConfig)({ - environmentVariableSelector: (env) => env[exports.UA_APP_ID_ENV_NAME], - configFileSelector: (profile) => profile[exports.UA_APP_ID_INI_NAME], - default: undefined, - })(); - let resolvedUserAgent = undefined; - return async () => { - if (!resolvedUserAgent) { - const appId = await appIdPromise; - resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; - } - return resolvedUserAgent; - }; -}; -exports.defaultUserAgent = defaultUserAgent; - - -/***/ }), - -/***/ 68390: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isCrtAvailable = void 0; -const isCrtAvailable = () => { - try { - if ( true && __nccwpck_require__(87578)) { - return ["md/crt-avail"]; - } - return null; - } - catch (e) { - return null; - } -}; -exports.isCrtAvailable = isCrtAvailable; - - -/***/ }), - -/***/ 28172: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = exports.fromUtf8 = void 0; -const pureJs_1 = __nccwpck_require__(21590); -const whatwgEncodingApi_1 = __nccwpck_require__(89215); -const fromUtf8 = (input) => typeof TextEncoder === "function" ? (0, whatwgEncodingApi_1.fromUtf8)(input) : (0, pureJs_1.fromUtf8)(input); -exports.fromUtf8 = fromUtf8; -const toUtf8 = (input) => typeof TextDecoder === "function" ? (0, whatwgEncodingApi_1.toUtf8)(input) : (0, pureJs_1.toUtf8)(input); -exports.toUtf8 = toUtf8; - - -/***/ }), - -/***/ 21590: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = exports.fromUtf8 = void 0; -const fromUtf8 = (input) => { - const bytes = []; - for (let i = 0, len = input.length; i < len; i++) { - const value = input.charCodeAt(i); - if (value < 0x80) { - bytes.push(value); - } - else if (value < 0x800) { - bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000); - } - else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { - const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111); - bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000); - } - else { - bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000); - } - } - return Uint8Array.from(bytes); -}; -exports.fromUtf8 = fromUtf8; -const toUtf8 = (input) => { - let decoded = ""; - for (let i = 0, len = input.length; i < len; i++) { - const byte = input[i]; - if (byte < 0x80) { - decoded += String.fromCharCode(byte); - } - else if (0b11000000 <= byte && byte < 0b11100000) { - const nextByte = input[++i]; - decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111)); - } - else if (0b11110000 <= byte && byte < 0b101101101) { - const surrogatePair = [byte, input[++i], input[++i], input[++i]]; - const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%"); - decoded += decodeURIComponent(encoded); - } - else { - decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111)); - } - } - return decoded; -}; -exports.toUtf8 = toUtf8; - - -/***/ }), - -/***/ 89215: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = exports.fromUtf8 = void 0; -function fromUtf8(input) { - return new TextEncoder().encode(input); -} -exports.fromUtf8 = fromUtf8; -function toUtf8(input) { - return new TextDecoder("utf-8").decode(input); -} -exports.toUtf8 = toUtf8; - - -/***/ }), - -/***/ 43779: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_DUALSTACK_ENDPOINT = exports.CONFIG_USE_DUALSTACK_ENDPOINT = exports.ENV_USE_DUALSTACK_ENDPOINT = void 0; -const util_config_provider_1 = __nccwpck_require__(83375); -exports.ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; -exports.CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; -exports.DEFAULT_USE_DUALSTACK_ENDPOINT = false; -exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), - default: false, -}; - - -/***/ }), - -/***/ 17994: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_FIPS_ENDPOINT = exports.CONFIG_USE_FIPS_ENDPOINT = exports.ENV_USE_FIPS_ENDPOINT = void 0; -const util_config_provider_1 = __nccwpck_require__(83375); -exports.ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; -exports.CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; -exports.DEFAULT_USE_FIPS_ENDPOINT = false; -exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), - default: false, -}; - - -/***/ }), - -/***/ 18421: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(43779), exports); -tslib_1.__exportStar(__nccwpck_require__(17994), exports); -tslib_1.__exportStar(__nccwpck_require__(37432), exports); -tslib_1.__exportStar(__nccwpck_require__(61892), exports); - - -/***/ }), - -/***/ 37432: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveCustomEndpointsConfig = void 0; -const util_middleware_1 = __nccwpck_require__(2390); -const resolveCustomEndpointsConfig = (input) => { - var _a, _b; - const { endpoint, urlParser } = input; - return { - ...input, - tls: (_a = input.tls) !== null && _a !== void 0 ? _a : true, - endpoint: (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), - isCustomEndpoint: true, - useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)((_b = input.useDualstackEndpoint) !== null && _b !== void 0 ? _b : false), - }; -}; -exports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; - - -/***/ }), - -/***/ 61892: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEndpointsConfig = void 0; -const util_middleware_1 = __nccwpck_require__(2390); -const getEndpointFromRegion_1 = __nccwpck_require__(48570); -const resolveEndpointsConfig = (input) => { - var _a, _b; - const useDualstackEndpoint = (0, util_middleware_1.normalizeProvider)((_a = input.useDualstackEndpoint) !== null && _a !== void 0 ? _a : false); - const { endpoint, useFipsEndpoint, urlParser } = input; - return { - ...input, - tls: (_b = input.tls) !== null && _b !== void 0 ? _b : true, - endpoint: endpoint - ? (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) - : () => (0, getEndpointFromRegion_1.getEndpointFromRegion)({ ...input, useDualstackEndpoint, useFipsEndpoint }), - isCustomEndpoint: !!endpoint, - useDualstackEndpoint, - }; -}; -exports.resolveEndpointsConfig = resolveEndpointsConfig; - - -/***/ }), - -/***/ 48570: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointFromRegion = void 0; -const getEndpointFromRegion = async (input) => { - var _a; - 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 } = (_a = (await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }))) !== null && _a !== void 0 ? _a : {}; - if (!hostname) { - throw new Error("Cannot resolve hostname from client config"); - } - return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); -}; -exports.getEndpointFromRegion = getEndpointFromRegion; - - -/***/ }), - -/***/ 53098: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(18421), exports); -tslib_1.__exportStar(__nccwpck_require__(221), exports); -tslib_1.__exportStar(__nccwpck_require__(86985), exports); - - -/***/ }), - -/***/ 33898: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_REGION_CONFIG_FILE_OPTIONS = exports.NODE_REGION_CONFIG_OPTIONS = exports.REGION_INI_NAME = exports.REGION_ENV_NAME = void 0; -exports.REGION_ENV_NAME = "AWS_REGION"; -exports.REGION_INI_NAME = "region"; -exports.NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.REGION_ENV_NAME], - configFileSelector: (profile) => profile[exports.REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); - }, -}; -exports.NODE_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials", -}; - - -/***/ }), - -/***/ 49506: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRealRegion = void 0; -const isFipsRegion_1 = __nccwpck_require__(43870); -const getRealRegion = (region) => (0, isFipsRegion_1.isFipsRegion)(region) - ? ["fips-aws-global", "aws-fips"].includes(region) - ? "us-east-1" - : region.replace(/fips-(dkr-|prod-)?|-fips/, "") - : region; -exports.getRealRegion = getRealRegion; - - -/***/ }), - -/***/ 221: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(33898), exports); -tslib_1.__exportStar(__nccwpck_require__(87065), exports); - - -/***/ }), - -/***/ 43870: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isFipsRegion = void 0; -const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); -exports.isFipsRegion = isFipsRegion; - - -/***/ }), - -/***/ 87065: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRegionConfig = void 0; -const getRealRegion_1 = __nccwpck_require__(49506); -const isFipsRegion_1 = __nccwpck_require__(43870); -const resolveRegionConfig = (input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); - } - return { - ...input, - region: async () => { - if (typeof region === "string") { - return (0, getRealRegion_1.getRealRegion)(region); - } - const providedRegion = await region(); - return (0, getRealRegion_1.getRealRegion)(providedRegion); - }, - useFipsEndpoint: async () => { - const providedRegion = typeof region === "string" ? region : await region(); - if ((0, isFipsRegion_1.isFipsRegion)(providedRegion)) { - return true; - } - return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); - }, - }; -}; -exports.resolveRegionConfig = resolveRegionConfig; - - -/***/ }), - -/***/ 19814: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 14832: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 99760: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHostnameFromVariants = void 0; -const getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => { - var _a; - return (_a = variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))) === null || _a === void 0 ? void 0 : _a.hostname; -}; -exports.getHostnameFromVariants = getHostnameFromVariants; - - -/***/ }), - -/***/ 77792: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRegionInfo = void 0; -const getHostnameFromVariants_1 = __nccwpck_require__(99760); -const getResolvedHostname_1 = __nccwpck_require__(1487); -const getResolvedPartition_1 = __nccwpck_require__(44441); -const getResolvedSigningRegion_1 = __nccwpck_require__(92281); -const getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => { - var _a, _b, _c, _d, _e, _f; - const partition = (0, getResolvedPartition_1.getResolvedPartition)(region, { partitionHash }); - const resolvedRegion = region in regionHash ? region : (_b = (_a = partitionHash[partition]) === null || _a === void 0 ? void 0 : _a.endpoint) !== null && _b !== void 0 ? _b : region; - const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; - const regionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_c = regionHash[resolvedRegion]) === null || _c === void 0 ? void 0 : _c.variants, hostnameOptions); - const partitionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_d = partitionHash[partition]) === null || _d === void 0 ? void 0 : _d.variants, hostnameOptions); - const hostname = (0, getResolvedHostname_1.getResolvedHostname)(resolvedRegion, { regionHostname, partitionHostname }); - if (hostname === undefined) { - throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); - } - const signingRegion = (0, getResolvedSigningRegion_1.getResolvedSigningRegion)(hostname, { - signingRegion: (_e = regionHash[resolvedRegion]) === null || _e === void 0 ? void 0 : _e.signingRegion, - regionRegex: partitionHash[partition].regionRegex, - useFipsEndpoint, - }); - return { - partition, - signingService, - hostname, - ...(signingRegion && { signingRegion }), - ...(((_f = regionHash[resolvedRegion]) === null || _f === void 0 ? void 0 : _f.signingService) && { - signingService: regionHash[resolvedRegion].signingService, - }), - }; -}; -exports.getRegionInfo = getRegionInfo; - - -/***/ }), - -/***/ 1487: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedHostname = void 0; -const getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname - ? regionHostname - : partitionHostname - ? partitionHostname.replace("{region}", resolvedRegion) - : undefined; -exports.getResolvedHostname = getResolvedHostname; - - -/***/ }), - -/***/ 44441: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedPartition = void 0; -const getResolvedPartition = (region, { partitionHash }) => { var _a; return (_a = Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region))) !== null && _a !== void 0 ? _a : "aws"; }; -exports.getResolvedPartition = getResolvedPartition; - - -/***/ }), - -/***/ 92281: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedSigningRegion = void 0; -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); - } - } -}; -exports.getResolvedSigningRegion = getResolvedSigningRegion; - - -/***/ }), - -/***/ 86985: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(19814), exports); -tslib_1.__exportStar(__nccwpck_require__(14832), exports); -tslib_1.__exportStar(__nccwpck_require__(77792), exports); - - -/***/ }), - -/***/ 18044: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Endpoint = void 0; -var Endpoint; -(function (Endpoint) { - Endpoint["IPv4"] = "http://169.254.169.254"; - Endpoint["IPv6"] = "http://[fd00:ec2::254]"; -})(Endpoint = exports.Endpoint || (exports.Endpoint = {})); - - -/***/ }), - -/***/ 57342: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ENDPOINT_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_NAME = exports.ENV_ENDPOINT_NAME = void 0; -exports.ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; -exports.CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; -exports.ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_NAME], - configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_NAME], - default: undefined, -}; - - -/***/ }), - -/***/ 80991: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointMode = void 0; -var EndpointMode; -(function (EndpointMode) { - EndpointMode["IPv4"] = "IPv4"; - EndpointMode["IPv6"] = "IPv6"; -})(EndpointMode = exports.EndpointMode || (exports.EndpointMode = {})); - - -/***/ }), - -/***/ 88337: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ENDPOINT_MODE_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_MODE_NAME = exports.ENV_ENDPOINT_MODE_NAME = void 0; -const EndpointMode_1 = __nccwpck_require__(80991); -exports.ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; -exports.CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; -exports.ENDPOINT_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_MODE_NAME], - configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_MODE_NAME], - default: EndpointMode_1.EndpointMode.IPv4, -}; - - -/***/ }), - -/***/ 89227: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromContainerMetadata = exports.ENV_CMDS_AUTH_TOKEN = exports.ENV_CMDS_RELATIVE_URI = exports.ENV_CMDS_FULL_URI = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const url_1 = __nccwpck_require__(57310); -const httpRequest_1 = __nccwpck_require__(32199); -const ImdsCredentials_1 = __nccwpck_require__(6894); -const RemoteProviderInit_1 = __nccwpck_require__(98533); -const retry_1 = __nccwpck_require__(91351); -exports.ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; -exports.ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; -exports.ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; -const fromContainerMetadata = (init = {}) => { - const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); - return () => (0, retry_1.retry)(async () => { - const requestOptions = await getCmdsUri(); - const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); - if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { - throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); - } - return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); - }, maxRetries); -}; -exports.fromContainerMetadata = fromContainerMetadata; -const requestFromEcsImds = async (timeout, options) => { - if (process.env[exports.ENV_CMDS_AUTH_TOKEN]) { - options.headers = { - ...options.headers, - Authorization: process.env[exports.ENV_CMDS_AUTH_TOKEN], - }; - } - const buffer = await (0, httpRequest_1.httpRequest)({ - ...options, - timeout, - }); - return buffer.toString(); -}; -const CMDS_IP = "169.254.170.2"; -const GREENGRASS_HOSTS = { - localhost: true, - "127.0.0.1": true, -}; -const GREENGRASS_PROTOCOLS = { - "http:": true, - "https:": true, -}; -const getCmdsUri = async () => { - if (process.env[exports.ENV_CMDS_RELATIVE_URI]) { - return { - hostname: CMDS_IP, - path: process.env[exports.ENV_CMDS_RELATIVE_URI], - }; - } - if (process.env[exports.ENV_CMDS_FULL_URI]) { - const parsed = (0, url_1.parse)(process.env[exports.ENV_CMDS_FULL_URI]); - if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { - throw new property_provider_1.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, false); - } - if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { - throw new property_provider_1.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, false); - } - return { - ...parsed, - port: parsed.port ? parseInt(parsed.port, 10) : undefined, - }; - } - throw new property_provider_1.CredentialsProviderError("The container metadata credential provider cannot be used unless" + - ` the ${exports.ENV_CMDS_RELATIVE_URI} or ${exports.ENV_CMDS_FULL_URI} environment` + - " variable is set", false); -}; - - -/***/ }), - -/***/ 52207: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromInstanceMetadata = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const httpRequest_1 = __nccwpck_require__(32199); -const ImdsCredentials_1 = __nccwpck_require__(6894); -const RemoteProviderInit_1 = __nccwpck_require__(98533); -const retry_1 = __nccwpck_require__(91351); -const getInstanceMetadataEndpoint_1 = __nccwpck_require__(92460); -const staticStabilityProvider_1 = __nccwpck_require__(74035); -const IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; -const IMDS_TOKEN_PATH = "/latest/api/token"; -const fromInstanceMetadata = (init = {}) => (0, staticStabilityProvider_1.staticStabilityProvider)(getInstanceImdsProvider(init), { logger: init.logger }); -exports.fromInstanceMetadata = fromInstanceMetadata; -const getInstanceImdsProvider = (init) => { - let disableFetchToken = false; - const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); - const getCredentials = async (maxRetries, options) => { - const profile = (await (0, retry_1.retry)(async () => { - let profile; - try { - profile = await getProfile(options); - } - catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return profile; - }, maxRetries)).trim(); - return (0, retry_1.retry)(async () => { - let creds; - try { - creds = await getCredentialsFromProfile(profile, options); - } - catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return creds; - }, maxRetries); - }; - return async () => { - const endpoint = await (0, getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint)(); - if (disableFetchToken) { - return getCredentials(maxRetries, { ...endpoint, timeout }); - } - else { - let token; - try { - token = (await getMetadataToken({ ...endpoint, timeout })).toString(); - } - catch (error) { - if ((error === null || error === void 0 ? void 0 : error.statusCode) === 400) { - throw Object.assign(error, { - message: "EC2 Metadata token request returned error", - }); - } - else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { - disableFetchToken = true; - } - return getCredentials(maxRetries, { ...endpoint, timeout }); - } - return getCredentials(maxRetries, { - ...endpoint, - headers: { - "x-aws-ec2-metadata-token": token, - }, - timeout, - }); - } - }; -}; -const getMetadataToken = async (options) => (0, httpRequest_1.httpRequest)({ - ...options, - path: IMDS_TOKEN_PATH, - method: "PUT", - headers: { - "x-aws-ec2-metadata-token-ttl-seconds": "21600", - }, -}); -const getProfile = async (options) => (await (0, httpRequest_1.httpRequest)({ ...options, path: IMDS_PATH })).toString(); -const getCredentialsFromProfile = async (profile, options) => { - const credsResponse = JSON.parse((await (0, httpRequest_1.httpRequest)({ - ...options, - path: IMDS_PATH + profile, - })).toString()); - if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { - throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); - } - return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); -}; - - -/***/ }), - -/***/ 7477: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getInstanceMetadataEndpoint = exports.httpRequest = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(89227), exports); -tslib_1.__exportStar(__nccwpck_require__(52207), exports); -tslib_1.__exportStar(__nccwpck_require__(98533), exports); -tslib_1.__exportStar(__nccwpck_require__(45036), exports); -var httpRequest_1 = __nccwpck_require__(32199); -Object.defineProperty(exports, "httpRequest", ({ enumerable: true, get: function () { return httpRequest_1.httpRequest; } })); -var getInstanceMetadataEndpoint_1 = __nccwpck_require__(92460); -Object.defineProperty(exports, "getInstanceMetadataEndpoint", ({ enumerable: true, get: function () { return getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint; } })); - - -/***/ }), - -/***/ 6894: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromImdsCredentials = exports.isImdsCredentials = void 0; -const isImdsCredentials = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.AccessKeyId === "string" && - typeof arg.SecretAccessKey === "string" && - typeof arg.Token === "string" && - typeof arg.Expiration === "string"; -exports.isImdsCredentials = isImdsCredentials; -const fromImdsCredentials = (creds) => ({ - accessKeyId: creds.AccessKeyId, - secretAccessKey: creds.SecretAccessKey, - sessionToken: creds.Token, - expiration: new Date(creds.Expiration), -}); -exports.fromImdsCredentials = fromImdsCredentials; - - -/***/ }), - -/***/ 98533: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.providerConfigFromInit = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_TIMEOUT = void 0; -exports.DEFAULT_TIMEOUT = 1000; -exports.DEFAULT_MAX_RETRIES = 0; -const providerConfigFromInit = ({ maxRetries = exports.DEFAULT_MAX_RETRIES, timeout = exports.DEFAULT_TIMEOUT, }) => ({ maxRetries, timeout }); -exports.providerConfigFromInit = providerConfigFromInit; - - -/***/ }), - -/***/ 32199: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.httpRequest = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const buffer_1 = __nccwpck_require__(14300); -const http_1 = __nccwpck_require__(13685); -function httpRequest(options) { - return new Promise((resolve, reject) => { - var _a; - const req = (0, http_1.request)({ - method: "GET", - ...options, - hostname: (_a = options.hostname) === null || _a === void 0 ? void 0 : _a.replace(/^\[(.+)\]$/, "$1"), - }); - req.on("error", (err) => { - reject(Object.assign(new property_provider_1.ProviderError("Unable to connect to instance metadata service"), err)); - req.destroy(); - }); - req.on("timeout", () => { - reject(new property_provider_1.ProviderError("TimeoutError from instance metadata service")); - req.destroy(); - }); - req.on("response", (res) => { - const { statusCode = 400 } = res; - if (statusCode < 200 || 300 <= statusCode) { - reject(Object.assign(new property_provider_1.ProviderError("Error response received from instance metadata service"), { statusCode })); - req.destroy(); - } - const chunks = []; - res.on("data", (chunk) => { - chunks.push(chunk); - }); - res.on("end", () => { - resolve(buffer_1.Buffer.concat(chunks)); - req.destroy(); - }); - }); - req.end(); - }); -} -exports.httpRequest = httpRequest; - - -/***/ }), - -/***/ 91351: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.retry = void 0; -const retry = (toRetry, maxRetries) => { - let promise = toRetry(); - for (let i = 0; i < maxRetries; i++) { - promise = promise.catch(toRetry); - } - return promise; -}; -exports.retry = retry; - - -/***/ }), - -/***/ 45036: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 22666: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getExtendedInstanceMetadataCredentials = void 0; -const STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; -const STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; -const STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; -const getExtendedInstanceMetadataCredentials = (credentials, logger) => { - var _a; - const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + - Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); - const newExpiration = new Date(Date.now() + refreshInterval * 1000); - logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these " + - "credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: " + - STATIC_STABILITY_DOC_URL); - const originalExpiration = (_a = credentials.originalExpiration) !== null && _a !== void 0 ? _a : credentials.expiration; - return { - ...credentials, - ...(originalExpiration ? { originalExpiration } : {}), - expiration: newExpiration, - }; -}; -exports.getExtendedInstanceMetadataCredentials = getExtendedInstanceMetadataCredentials; - - -/***/ }), - -/***/ 92460: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getInstanceMetadataEndpoint = void 0; -const node_config_provider_1 = __nccwpck_require__(33461); -const url_parser_1 = __nccwpck_require__(14681); -const Endpoint_1 = __nccwpck_require__(18044); -const EndpointConfigOptions_1 = __nccwpck_require__(57342); -const EndpointMode_1 = __nccwpck_require__(80991); -const EndpointModeConfigOptions_1 = __nccwpck_require__(88337); -const getInstanceMetadataEndpoint = async () => (0, url_parser_1.parseUrl)((await getFromEndpointConfig()) || (await getFromEndpointModeConfig())); -exports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint; -const getFromEndpointConfig = async () => (0, node_config_provider_1.loadConfig)(EndpointConfigOptions_1.ENDPOINT_CONFIG_OPTIONS)(); -const getFromEndpointModeConfig = async () => { - const endpointMode = await (0, node_config_provider_1.loadConfig)(EndpointModeConfigOptions_1.ENDPOINT_MODE_CONFIG_OPTIONS)(); - switch (endpointMode) { - case EndpointMode_1.EndpointMode.IPv4: - return Endpoint_1.Endpoint.IPv4; - case EndpointMode_1.EndpointMode.IPv6: - return Endpoint_1.Endpoint.IPv6; - default: - throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode_1.EndpointMode)}`); - } -}; - - -/***/ }), - -/***/ 74035: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.staticStabilityProvider = void 0; -const getExtendedInstanceMetadataCredentials_1 = __nccwpck_require__(22666); -const staticStabilityProvider = (provider, options = {}) => { - const logger = (options === null || options === void 0 ? void 0 : options.logger) || console; - let pastCredentials; - return async () => { - let credentials; - try { - credentials = await provider(); - if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { - credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(credentials, logger); - } - } - catch (e) { - if (pastCredentials) { - logger.warn("Credential renew failed: ", e); - credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(pastCredentials, logger); - } - else { - throw e; - } - } - pastCredentials = credentials; - return credentials; - }; -}; -exports.staticStabilityProvider = staticStabilityProvider; - - -/***/ }), - -/***/ 11014: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventStreamCodec = void 0; -const crc32_1 = __nccwpck_require__(47327); -const HeaderMarshaller_1 = __nccwpck_require__(74712); -const splitMessage_1 = __nccwpck_require__(20597); -class EventStreamCodec { - constructor(toUtf8, fromUtf8) { - this.headerMarshaller = new HeaderMarshaller_1.HeaderMarshaller(toUtf8, fromUtf8); - this.messageBuffer = []; - this.isEndOfStream = false; - } - feed(message) { - this.messageBuffer.push(this.decode(message)); - } - endOfStream() { - this.isEndOfStream = true; - } - getMessage() { - const message = this.messageBuffer.pop(); - const isEndOfStream = this.isEndOfStream; - return { - getMessage() { - return message; - }, - isEndOfStream() { - return isEndOfStream; - }, - }; - } - getAvailableMessages() { - const messages = this.messageBuffer; - this.messageBuffer = []; - const isEndOfStream = this.isEndOfStream; - return { - getMessages() { - return messages; - }, - isEndOfStream() { - return isEndOfStream; - }, - }; - } - encode({ headers: rawHeaders, body }) { - const headers = this.headerMarshaller.format(rawHeaders); - const length = headers.byteLength + body.byteLength + 16; - const out = new Uint8Array(length); - const view = new DataView(out.buffer, out.byteOffset, out.byteLength); - const checksum = new crc32_1.Crc32(); - view.setUint32(0, length, false); - view.setUint32(4, headers.byteLength, false); - view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false); - out.set(headers, 12); - out.set(body, headers.byteLength + 12); - view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); - return out; - } - decode(message) { - const { headers, body } = (0, splitMessage_1.splitMessage)(message); - return { headers: this.headerMarshaller.parse(headers), body }; - } - formatHeaders(rawHeaders) { - return this.headerMarshaller.format(rawHeaders); - } -} -exports.EventStreamCodec = EventStreamCodec; - - -/***/ }), - -/***/ 74712: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HeaderMarshaller = void 0; -const util_hex_encoding_1 = __nccwpck_require__(45364); -const Int64_1 = __nccwpck_require__(46086); -class HeaderMarshaller { - constructor(toUtf8, fromUtf8) { - this.toUtf8 = toUtf8; - this.fromUtf8 = fromUtf8; - } - format(headers) { - const chunks = []; - for (const headerName of Object.keys(headers)) { - const bytes = this.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 = this.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_1.Int64.fromNumber(header.value.valueOf()).bytes, 1); - return tsBytes; - case "uuid": - if (!UUID_PATTERN.test(header.value)) { - throw new Error(`Invalid UUID received: ${header.value}`); - } - const uuidBytes = new Uint8Array(17); - uuidBytes[0] = 9; - uuidBytes.set((0, util_hex_encoding_1.fromHex)(header.value.replace(/\-/g, "")), 1); - return uuidBytes; - } - } - parse(headers) { - const out = {}; - let position = 0; - while (position < headers.byteLength) { - const nameLength = headers.getUint8(position++); - const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); - position += nameLength; - switch (headers.getUint8(position++)) { - case 0: - out[name] = { - type: BOOLEAN_TAG, - value: true, - }; - break; - case 1: - out[name] = { - type: BOOLEAN_TAG, - value: false, - }; - break; - case 2: - out[name] = { - type: BYTE_TAG, - value: headers.getInt8(position++), - }; - break; - case 3: - out[name] = { - type: SHORT_TAG, - value: headers.getInt16(position, false), - }; - position += 2; - break; - case 4: - out[name] = { - type: INT_TAG, - value: headers.getInt32(position, false), - }; - position += 4; - break; - case 5: - out[name] = { - type: LONG_TAG, - value: new Int64_1.Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)), - }; - position += 8; - break; - case 6: - const binaryLength = headers.getUint16(position, false); - position += 2; - out[name] = { - type: BINARY_TAG, - value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength), - }; - position += binaryLength; - break; - case 7: - const stringLength = headers.getUint16(position, false); - position += 2; - out[name] = { - type: STRING_TAG, - value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)), - }; - position += stringLength; - break; - case 8: - out[name] = { - type: TIMESTAMP_TAG, - value: new Date(new Int64_1.Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()), - }; - position += 8; - break; - case 9: - const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); - position += 16; - out[name] = { - type: UUID_TAG, - value: `${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(0, 4))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(4, 6))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(6, 8))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(8, 10))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(10))}`, - }; - break; - default: - throw new Error(`Unrecognized header type tag`); - } - } - return out; - } -} -exports.HeaderMarshaller = HeaderMarshaller; -var HEADER_VALUE_TYPE; -(function (HEADER_VALUE_TYPE) { - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolTrue"] = 0] = "boolTrue"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolFalse"] = 1] = "boolFalse"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byte"] = 2] = "byte"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["short"] = 3] = "short"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["integer"] = 4] = "integer"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["long"] = 5] = "long"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byteArray"] = 6] = "byteArray"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["string"] = 7] = "string"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["timestamp"] = 8] = "timestamp"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["uuid"] = 9] = "uuid"; -})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {})); -const BOOLEAN_TAG = "boolean"; -const BYTE_TAG = "byte"; -const SHORT_TAG = "short"; -const INT_TAG = "integer"; -const LONG_TAG = "long"; -const BINARY_TAG = "binary"; -const STRING_TAG = "string"; -const TIMESTAMP_TAG = "timestamp"; -const UUID_TAG = "uuid"; -const UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; - - -/***/ }), - -/***/ 46086: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Int64 = void 0; -const util_hex_encoding_1 = __nccwpck_require__(45364); -class Int64 { - constructor(bytes) { - this.bytes = bytes; - if (bytes.byteLength !== 8) { - throw new Error("Int64 buffers must be exactly 8 bytes"); - } - } - static fromNumber(number) { - if (number > 9223372036854776000 || number < -9223372036854776000) { - 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((0, util_hex_encoding_1.toHex)(bytes), 16) * (negative ? -1 : 1); - } - toString() { - return String(this.valueOf()); - } -} -exports.Int64 = Int64; -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; - } -} - - -/***/ }), - -/***/ 73684: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57255: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MessageDecoderStream = void 0; -class MessageDecoderStream { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async *asyncIterator() { - for await (const bytes of this.options.inputStream) { - const decoded = this.options.decoder.decode(bytes); - yield decoded; - } - } -} -exports.MessageDecoderStream = MessageDecoderStream; - - -/***/ }), - -/***/ 52362: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MessageEncoderStream = void 0; -class MessageEncoderStream { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async *asyncIterator() { - for await (const msg of this.options.messageStream) { - const encoded = this.options.encoder.encode(msg); - yield encoded; - } - if (this.options.includeEndFrame) { - yield new Uint8Array(0); - } - } -} -exports.MessageEncoderStream = MessageEncoderStream; - - -/***/ }), - -/***/ 62379: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SmithyMessageDecoderStream = void 0; -class SmithyMessageDecoderStream { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async *asyncIterator() { - for await (const message of this.options.messageStream) { - const deserialized = await this.options.deserializer(message); - if (deserialized === undefined) - continue; - yield deserialized; - } - } -} -exports.SmithyMessageDecoderStream = SmithyMessageDecoderStream; - - -/***/ }), - -/***/ 12484: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SmithyMessageEncoderStream = void 0; -class SmithyMessageEncoderStream { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async *asyncIterator() { - for await (const chunk of this.options.inputStream) { - const payloadBuf = this.options.serializer(chunk); - yield payloadBuf; - } - } -} -exports.SmithyMessageEncoderStream = SmithyMessageEncoderStream; - - -/***/ }), - -/***/ 56459: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(11014), exports); -tslib_1.__exportStar(__nccwpck_require__(74712), exports); -tslib_1.__exportStar(__nccwpck_require__(46086), exports); -tslib_1.__exportStar(__nccwpck_require__(73684), exports); -tslib_1.__exportStar(__nccwpck_require__(57255), exports); -tslib_1.__exportStar(__nccwpck_require__(52362), exports); -tslib_1.__exportStar(__nccwpck_require__(62379), exports); -tslib_1.__exportStar(__nccwpck_require__(12484), exports); - - -/***/ }), - -/***/ 20597: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitMessage = void 0; -const crc32_1 = __nccwpck_require__(47327); -const PRELUDE_MEMBER_LENGTH = 4; -const PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; -const CHECKSUM_LENGTH = 4; -const MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; -function splitMessage({ byteLength, byteOffset, buffer }) { - if (byteLength < MINIMUM_MESSAGE_LENGTH) { - throw new Error("Provided message too short to accommodate event stream message overhead"); - } - const view = new DataView(buffer, byteOffset, byteLength); - const messageLength = view.getUint32(0, false); - if (byteLength !== messageLength) { - throw new Error("Reported message length does not match received message length"); - } - const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); - const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); - const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); - const checksummer = new crc32_1.Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH)); - if (expectedPreludeChecksum !== checksummer.digest()) { - throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`); - } - checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))); - if (expectedMessageChecksum !== checksummer.digest()) { - throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`); - } - return { - headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), - body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)), - }; -} -exports.splitMessage = splitMessage; - - -/***/ }), - -/***/ 3081: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Hash = void 0; -const util_buffer_from_1 = __nccwpck_require__(31381); -const util_utf8_1 = __nccwpck_require__(41895); -const buffer_1 = __nccwpck_require__(14300); -const crypto_1 = __nccwpck_require__(6113); -class Hash { - constructor(algorithmIdentifier, secret) { - this.algorithmIdentifier = algorithmIdentifier; - this.secret = secret; - this.reset(); - } - update(toHash, encoding) { - this.hash.update((0, util_utf8_1.toUint8Array)(castSourceData(toHash, encoding))); - } - digest() { - return Promise.resolve(this.hash.digest()); - } - reset() { - this.hash = this.secret - ? (0, crypto_1.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) - : (0, crypto_1.createHash)(this.algorithmIdentifier); - } -} -exports.Hash = Hash; -function castSourceData(toCast, encoding) { - if (buffer_1.Buffer.isBuffer(toCast)) { - return toCast; - } - if (typeof toCast === "string") { - return (0, util_buffer_from_1.fromString)(toCast, encoding); - } - if (ArrayBuffer.isView(toCast)) { - return (0, util_buffer_from_1.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength); - } - return (0, util_buffer_from_1.fromArrayBuffer)(toCast); -} - - -/***/ }), - -/***/ 10780: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isArrayBuffer = void 0; -const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) || - Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; -exports.isArrayBuffer = isArrayBuffer; - - -/***/ }), - -/***/ 82800: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getContentLengthPlugin = exports.contentLengthMiddlewareOptions = exports.contentLengthMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(87233); -const CONTENT_LENGTH_HEADER = "content-length"; -function contentLengthMiddleware(bodyLengthChecker) { - return (next) => async (args) => { - const request = args.request; - if (protocol_http_1.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 next({ - ...args, - request, - }); - }; -} -exports.contentLengthMiddleware = contentLengthMiddleware; -exports.contentLengthMiddlewareOptions = { - step: "build", - tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], - name: "contentLengthMiddleware", - override: true, -}; -const getContentLengthPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), exports.contentLengthMiddlewareOptions); - }, -}); -exports.getContentLengthPlugin = getContentLengthPlugin; - - -/***/ }), - -/***/ 71051: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(78954); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 61405: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 81803: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 89842: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(81803), exports); - - -/***/ }), - -/***/ 67442: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 54339: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 11723: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 87233: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(89842), exports); -tslib_1.__exportStar(__nccwpck_require__(71051), exports); -tslib_1.__exportStar(__nccwpck_require__(61405), exports); -tslib_1.__exportStar(__nccwpck_require__(67442), exports); -tslib_1.__exportStar(__nccwpck_require__(54339), exports); -tslib_1.__exportStar(__nccwpck_require__(11723), exports); -tslib_1.__exportStar(__nccwpck_require__(26369), exports); -tslib_1.__exportStar(__nccwpck_require__(41754), exports); - - -/***/ }), - -/***/ 26369: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 41754: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 8637: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 795: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 15282: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 39085: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 60864: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 23001: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21343: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 70664: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(21343), exports); -tslib_1.__exportStar(__nccwpck_require__(58597), exports); -tslib_1.__exportStar(__nccwpck_require__(19786), exports); - - -/***/ }), - -/***/ 58597: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 19786: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 86979: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 23312: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 26042: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 88823: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 25924: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34761: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 33191: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57615: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(88823), exports); -tslib_1.__exportStar(__nccwpck_require__(25924), exports); -tslib_1.__exportStar(__nccwpck_require__(34761), exports); -tslib_1.__exportStar(__nccwpck_require__(6374), exports); -tslib_1.__exportStar(__nccwpck_require__(33191), exports); - - -/***/ }), - -/***/ 6374: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 29689: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 80678: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 9102: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(80678); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 82748: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 67498: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(9102), exports); -tslib_1.__exportStar(__nccwpck_require__(82748), exports); -var checksum_1 = __nccwpck_require__(80678); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 83218: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 44809: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 47484: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 84010: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(44809), exports); -tslib_1.__exportStar(__nccwpck_require__(47484), exports); - - -/***/ }), - -/***/ 78954: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(8637), exports); -tslib_1.__exportStar(__nccwpck_require__(795), exports); -tslib_1.__exportStar(__nccwpck_require__(15282), exports); -tslib_1.__exportStar(__nccwpck_require__(39085), exports); -tslib_1.__exportStar(__nccwpck_require__(60864), exports); -tslib_1.__exportStar(__nccwpck_require__(23001), exports); -tslib_1.__exportStar(__nccwpck_require__(70664), exports); -tslib_1.__exportStar(__nccwpck_require__(86979), exports); -tslib_1.__exportStar(__nccwpck_require__(23312), exports); -tslib_1.__exportStar(__nccwpck_require__(26042), exports); -tslib_1.__exportStar(__nccwpck_require__(57615), exports); -tslib_1.__exportStar(__nccwpck_require__(29689), exports); -tslib_1.__exportStar(__nccwpck_require__(67498), exports); -tslib_1.__exportStar(__nccwpck_require__(83218), exports); -tslib_1.__exportStar(__nccwpck_require__(84010), exports); -tslib_1.__exportStar(__nccwpck_require__(81087), exports); -tslib_1.__exportStar(__nccwpck_require__(97058), exports); -tslib_1.__exportStar(__nccwpck_require__(77531), exports); -tslib_1.__exportStar(__nccwpck_require__(60215), exports); -tslib_1.__exportStar(__nccwpck_require__(66088), exports); -tslib_1.__exportStar(__nccwpck_require__(83732), exports); -tslib_1.__exportStar(__nccwpck_require__(8129), exports); -tslib_1.__exportStar(__nccwpck_require__(62061), exports); -tslib_1.__exportStar(__nccwpck_require__(18424), exports); -tslib_1.__exportStar(__nccwpck_require__(3428), exports); -tslib_1.__exportStar(__nccwpck_require__(84263), exports); -tslib_1.__exportStar(__nccwpck_require__(48603), exports); -tslib_1.__exportStar(__nccwpck_require__(46103), exports); -tslib_1.__exportStar(__nccwpck_require__(75310), exports); -tslib_1.__exportStar(__nccwpck_require__(6008), exports); -tslib_1.__exportStar(__nccwpck_require__(34926), exports); -tslib_1.__exportStar(__nccwpck_require__(87850), exports); -tslib_1.__exportStar(__nccwpck_require__(37295), exports); -tslib_1.__exportStar(__nccwpck_require__(6575), exports); - - -/***/ }), - -/***/ 81087: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 97058: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 77531: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 60215: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 66088: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 83732: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 8129: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 62061: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 18424: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 3428: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 84263: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48603: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 46103: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 75310: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 6008: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34926: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87850: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 37295: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 6575: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 465: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createConfigValueProvider = void 0; -const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => { - const configProvider = async () => { - var _a; - const configValue = (_a = config[configKey]) !== null && _a !== void 0 ? _a : config[canonicalEndpointParamKey]; - if (typeof configValue === "function") { - return configValue(); - } - return configValue; - }; - if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { - return async () => { - const endpoint = await configProvider(); - if (endpoint && typeof endpoint === "object") { - if ("url" in endpoint) { - return endpoint.url.href; - } - if ("hostname" in endpoint) { - const { protocol, hostname, port, path } = endpoint; - return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; - } - } - return endpoint; - }; - } - return configProvider; -}; -exports.createConfigValueProvider = createConfigValueProvider; - - -/***/ }), - -/***/ 73929: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveParams = exports.getEndpointFromInstructions = void 0; -const service_customizations_1 = __nccwpck_require__(13105); -const createConfigValueProvider_1 = __nccwpck_require__(465); -const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { - const endpointParams = await (0, exports.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; -}; -exports.getEndpointFromInstructions = getEndpointFromInstructions; -const resolveParams = async (commandInput, instructionsSupplier, clientConfig) => { - var _a; - const endpointParams = {}; - const instructions = ((_a = instructionsSupplier === null || instructionsSupplier === void 0 ? void 0 : instructionsSupplier.getEndpointParameterInstructions) === null || _a === void 0 ? void 0 : _a.call(instructionsSupplier)) || {}; - for (const [name, instruction] of Object.entries(instructions)) { - switch (instruction.type) { - case "staticContextParams": - endpointParams[name] = instruction.value; - break; - case "contextParams": - endpointParams[name] = commandInput[instruction.name]; - break; - case "clientContextParams": - case "builtInParams": - endpointParams[name] = await (0, createConfigValueProvider_1.createConfigValueProvider)(instruction.name, name, clientConfig)(); - break; - default: - throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); - } - } - if (Object.keys(instructions).length === 0) { - Object.assign(endpointParams, clientConfig); - } - if (String(clientConfig.serviceId).toLowerCase() === "s3") { - await (0, service_customizations_1.resolveParamsForS3)(endpointParams); - } - return endpointParams; -}; -exports.resolveParams = resolveParams; - - -/***/ }), - -/***/ 50890: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(73929), exports); -tslib_1.__exportStar(__nccwpck_require__(38938), exports); - - -/***/ }), - -/***/ 38938: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toEndpointV1 = void 0; -const url_parser_1 = __nccwpck_require__(14681); -const toEndpointV1 = (endpoint) => { - if (typeof endpoint === "object") { - if ("url" in endpoint) { - return (0, url_parser_1.parseUrl)(endpoint.url); - } - return endpoint; - } - return (0, url_parser_1.parseUrl)(endpoint); -}; -exports.toEndpointV1 = toEndpointV1; - - -/***/ }), - -/***/ 55520: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.endpointMiddleware = void 0; -const getEndpointFromInstructions_1 = __nccwpck_require__(73929); -const endpointMiddleware = ({ config, instructions, }) => { - return (next, context) => async (args) => { - var _a, _b; - const endpoint = await (0, getEndpointFromInstructions_1.getEndpointFromInstructions)(args.input, { - getEndpointParameterInstructions() { - return instructions; - }, - }, { ...config }, context); - context.endpointV2 = endpoint; - context.authSchemes = (_a = endpoint.properties) === null || _a === void 0 ? void 0 : _a.authSchemes; - const authScheme = (_b = context.authSchemes) === null || _b === void 0 ? void 0 : _b[0]; - if (authScheme) { - context["signing_region"] = authScheme.signingRegion; - context["signing_service"] = authScheme.signingName; - } - return next({ - ...args, - }); - }; -}; -exports.endpointMiddleware = endpointMiddleware; - - -/***/ }), - -/***/ 71329: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointPlugin = exports.endpointMiddlewareOptions = void 0; -const middleware_serde_1 = __nccwpck_require__(81238); -const endpointMiddleware_1 = __nccwpck_require__(55520); -exports.endpointMiddlewareOptions = { - step: "serialize", - tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], - name: "endpointV2Middleware", - override: true, - relation: "before", - toMiddleware: middleware_serde_1.serializerMiddlewareOption.name, -}; -const getEndpointPlugin = (config, instructions) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, endpointMiddleware_1.endpointMiddleware)({ - config, - instructions, - }), exports.endpointMiddlewareOptions); - }, -}); -exports.getEndpointPlugin = getEndpointPlugin; - - -/***/ }), - -/***/ 82918: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(50890), exports); -tslib_1.__exportStar(__nccwpck_require__(55520), exports); -tslib_1.__exportStar(__nccwpck_require__(71329), exports); -tslib_1.__exportStar(__nccwpck_require__(74139), exports); -tslib_1.__exportStar(__nccwpck_require__(39720), exports); - - -/***/ }), - -/***/ 74139: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEndpointConfig = void 0; -const util_middleware_1 = __nccwpck_require__(2390); -const toEndpointV1_1 = __nccwpck_require__(38938); -const resolveEndpointConfig = (input) => { - var _a, _b, _c; - const tls = (_a = input.tls) !== null && _a !== void 0 ? _a : true; - const { endpoint } = input; - const customEndpointProvider = endpoint != null ? async () => (0, toEndpointV1_1.toEndpointV1)(await (0, util_middleware_1.normalizeProvider)(endpoint)()) : undefined; - const isCustomEndpoint = !!endpoint; - return { - ...input, - endpoint: customEndpointProvider, - tls, - isCustomEndpoint, - useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)((_b = input.useDualstackEndpoint) !== null && _b !== void 0 ? _b : false), - useFipsEndpoint: (0, util_middleware_1.normalizeProvider)((_c = input.useFipsEndpoint) !== null && _c !== void 0 ? _c : false), - }; -}; -exports.resolveEndpointConfig = resolveEndpointConfig; - - -/***/ }), - -/***/ 13105: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(19194), exports); - - -/***/ }), - -/***/ 19194: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isArnBucketName = exports.isDnsCompatibleBucketName = exports.S3_HOSTNAME_PATTERN = exports.DOT_PATTERN = exports.resolveParamsForS3 = void 0; -const resolveParamsForS3 = async (endpointParams) => { - const bucket = (endpointParams === null || endpointParams === void 0 ? void 0 : endpointParams.Bucket) || ""; - if (typeof endpointParams.Bucket === "string") { - endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); - } - if ((0, exports.isArnBucketName)(bucket)) { - if (endpointParams.ForcePathStyle === true) { - throw new Error("Path-style addressing cannot be used with ARN buckets"); - } - } - else if (!(0, exports.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; -}; -exports.resolveParamsForS3 = resolveParamsForS3; -const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; -const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; -const DOTS_PATTERN = /\.\./; -exports.DOT_PATTERN = /\./; -exports.S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./; -const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); -exports.isDnsCompatibleBucketName = isDnsCompatibleBucketName; -const isArnBucketName = (bucketName) => { - const [arn, partition, service, region, account, typeOrId] = bucketName.split(":"); - const isArn = arn === "arn" && bucketName.split(":").length >= 6; - const isValidArn = [arn, partition, service, account, typeOrId].filter(Boolean).length === 5; - if (isArn && !isValidArn) { - throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); - } - return arn === "arn" && !!partition && !!service && !!account && !!typeOrId; -}; -exports.isArnBucketName = isArnBucketName; - - -/***/ }), - -/***/ 39720: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 80155: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AdaptiveRetryStrategy = void 0; -const util_retry_1 = __nccwpck_require__(84902); -const StandardRetryStrategy_1 = __nccwpck_require__(94582); -class AdaptiveRetryStrategy extends StandardRetryStrategy_1.StandardRetryStrategy { - constructor(maxAttemptsProvider, options) { - const { rateLimiter, ...superOptions } = options !== null && options !== void 0 ? options : {}; - super(maxAttemptsProvider, superOptions); - this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new util_retry_1.DefaultRateLimiter(); - this.mode = util_retry_1.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.AdaptiveRetryStrategy = AdaptiveRetryStrategy; - - -/***/ }), - -/***/ 94582: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StandardRetryStrategy = void 0; -const protocol_http_1 = __nccwpck_require__(3795); -const service_error_classification_1 = __nccwpck_require__(6375); -const util_retry_1 = __nccwpck_require__(84902); -const uuid_1 = __nccwpck_require__(75840); -const defaultRetryQuota_1 = __nccwpck_require__(29991); -const delayDecider_1 = __nccwpck_require__(9465); -const retryDecider_1 = __nccwpck_require__(67653); -const util_1 = __nccwpck_require__(42827); -class StandardRetryStrategy { - constructor(maxAttemptsProvider, options) { - var _a, _b, _c; - this.maxAttemptsProvider = maxAttemptsProvider; - this.mode = util_retry_1.RETRY_MODES.STANDARD; - this.retryDecider = (_a = options === null || options === void 0 ? void 0 : options.retryDecider) !== null && _a !== void 0 ? _a : retryDecider_1.defaultRetryDecider; - this.delayDecider = (_b = options === null || options === void 0 ? void 0 : options.delayDecider) !== null && _b !== void 0 ? _b : delayDecider_1.defaultDelayDecider; - this.retryQuota = (_c = options === null || options === void 0 ? void 0 : options.retryQuota) !== null && _c !== void 0 ? _c : (0, defaultRetryQuota_1.getDefaultRetryQuota)(util_retry_1.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 = util_retry_1.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 (protocol_http_1.HttpRequest.isInstance(request)) { - request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); - } - while (true) { - try { - if (protocol_http_1.HttpRequest.isInstance(request)) { - request.headers[util_retry_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - if (options === null || options === void 0 ? void 0 : options.beforeRequest) { - await options.beforeRequest(); - } - const { response, output } = await next(args); - if (options === null || options === void 0 ? void 0 : options.afterRequest) { - options.afterRequest(response); - } - this.retryQuota.releaseRetryTokens(retryTokenAmount); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalDelay; - return { response, output }; - } - catch (e) { - const err = (0, util_1.asSdkError)(e); - attempts++; - if (this.shouldRetry(err, attempts, maxAttempts)) { - retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); - const delayFromDecider = this.delayDecider((0, service_error_classification_1.isThrottlingError)(err) ? util_retry_1.THROTTLING_RETRY_DELAY_BASE : util_retry_1.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; - } - } - } -} -exports.StandardRetryStrategy = StandardRetryStrategy; -const getDelayFromRetryAfterHeader = (response) => { - if (!protocol_http_1.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(); -}; - - -/***/ }), - -/***/ 58709: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_RETRY_MODE_CONFIG_OPTIONS = exports.CONFIG_RETRY_MODE = exports.ENV_RETRY_MODE = exports.resolveRetryConfig = exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = exports.CONFIG_MAX_ATTEMPTS = exports.ENV_MAX_ATTEMPTS = void 0; -const util_middleware_1 = __nccwpck_require__(2390); -const util_retry_1 = __nccwpck_require__(84902); -exports.ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; -exports.CONFIG_MAX_ATTEMPTS = "max_attempts"; -exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - const value = env[exports.ENV_MAX_ATTEMPTS]; - if (!value) - return undefined; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Environment variable ${exports.ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); - } - return maxAttempt; - }, - configFileSelector: (profile) => { - const value = profile[exports.CONFIG_MAX_ATTEMPTS]; - if (!value) - return undefined; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Shared config file entry ${exports.CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); - } - return maxAttempt; - }, - default: util_retry_1.DEFAULT_MAX_ATTEMPTS, -}; -const resolveRetryConfig = (input) => { - var _a; - const { retryStrategy } = input; - const maxAttempts = (0, util_middleware_1.normalizeProvider)((_a = input.maxAttempts) !== null && _a !== void 0 ? _a : util_retry_1.DEFAULT_MAX_ATTEMPTS); - return { - ...input, - maxAttempts, - retryStrategy: async () => { - if (retryStrategy) { - return retryStrategy; - } - const retryMode = await (0, util_middleware_1.normalizeProvider)(input.retryMode)(); - if (retryMode === util_retry_1.RETRY_MODES.ADAPTIVE) { - return new util_retry_1.AdaptiveRetryStrategy(maxAttempts); - } - return new util_retry_1.StandardRetryStrategy(maxAttempts); - }, - }; -}; -exports.resolveRetryConfig = resolveRetryConfig; -exports.ENV_RETRY_MODE = "AWS_RETRY_MODE"; -exports.CONFIG_RETRY_MODE = "retry_mode"; -exports.NODE_RETRY_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_RETRY_MODE], - configFileSelector: (profile) => profile[exports.CONFIG_RETRY_MODE], - default: util_retry_1.DEFAULT_RETRY_MODE, -}; - - -/***/ }), - -/***/ 29991: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getDefaultRetryQuota = void 0; -const util_retry_1 = __nccwpck_require__(84902); -const getDefaultRetryQuota = (initialRetryTokens, options) => { - var _a, _b, _c; - const MAX_CAPACITY = initialRetryTokens; - const noRetryIncrement = (_a = options === null || options === void 0 ? void 0 : options.noRetryIncrement) !== null && _a !== void 0 ? _a : util_retry_1.NO_RETRY_INCREMENT; - const retryCost = (_b = options === null || options === void 0 ? void 0 : options.retryCost) !== null && _b !== void 0 ? _b : util_retry_1.RETRY_COST; - const timeoutRetryCost = (_c = options === null || options === void 0 ? void 0 : options.timeoutRetryCost) !== null && _c !== void 0 ? _c : util_retry_1.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 !== null && capacityReleaseAmount !== void 0 ? capacityReleaseAmount : noRetryIncrement; - availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); - }; - return Object.freeze({ - hasRetryTokens, - retrieveRetryTokens, - releaseRetryTokens, - }); -}; -exports.getDefaultRetryQuota = getDefaultRetryQuota; - - -/***/ }), - -/***/ 9465: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultDelayDecider = void 0; -const util_retry_1 = __nccwpck_require__(84902); -const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(util_retry_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); -exports.defaultDelayDecider = defaultDelayDecider; - - -/***/ }), - -/***/ 96039: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(80155), exports); -tslib_1.__exportStar(__nccwpck_require__(94582), exports); -tslib_1.__exportStar(__nccwpck_require__(58709), exports); -tslib_1.__exportStar(__nccwpck_require__(9465), exports); -tslib_1.__exportStar(__nccwpck_require__(76556), exports); -tslib_1.__exportStar(__nccwpck_require__(67653), exports); -tslib_1.__exportStar(__nccwpck_require__(81434), exports); - - -/***/ }), - -/***/ 76556: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOmitRetryHeadersPlugin = exports.omitRetryHeadersMiddlewareOptions = exports.omitRetryHeadersMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(3795); -const util_retry_1 = __nccwpck_require__(84902); -const omitRetryHeadersMiddleware = () => (next) => async (args) => { - const { request } = args; - if (protocol_http_1.HttpRequest.isInstance(request)) { - delete request.headers[util_retry_1.INVOCATION_ID_HEADER]; - delete request.headers[util_retry_1.REQUEST_HEADER]; - } - return next(args); -}; -exports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; -exports.omitRetryHeadersMiddlewareOptions = { - name: "omitRetryHeadersMiddleware", - tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], - relation: "before", - toMiddleware: "awsAuthMiddleware", - override: true, -}; -const getOmitRetryHeadersPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, exports.omitRetryHeadersMiddleware)(), exports.omitRetryHeadersMiddlewareOptions); - }, -}); -exports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; - - -/***/ }), - -/***/ 67653: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultRetryDecider = void 0; -const service_error_classification_1 = __nccwpck_require__(6375); -const defaultRetryDecider = (error) => { - if (!error) { - return false; - } - return (0, service_error_classification_1.isRetryableByTrait)(error) || (0, service_error_classification_1.isClockSkewError)(error) || (0, service_error_classification_1.isThrottlingError)(error) || (0, service_error_classification_1.isTransientError)(error); -}; -exports.defaultRetryDecider = defaultRetryDecider; - - -/***/ }), - -/***/ 81434: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRetryAfterHint = exports.getRetryPlugin = exports.retryMiddlewareOptions = exports.retryMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(3795); -const service_error_classification_1 = __nccwpck_require__(6375); -const util_retry_1 = __nccwpck_require__(84902); -const uuid_1 = __nccwpck_require__(75840); -const util_1 = __nccwpck_require__(42827); -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; - if (protocol_http_1.HttpRequest.isInstance(request)) { - request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); - } - while (true) { - try { - if (protocol_http_1.HttpRequest.isInstance(request)) { - request.headers[util_retry_1.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 = (0, util_1.asSdkError)(e); - try { - retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); - } - catch (refreshError) { - if (!lastError.$metadata) { - lastError.$metadata = {}; - } - lastError.$metadata.attempts = attempts + 1; - lastError.$metadata.totalRetryDelay = totalRetryDelay; - throw lastError; - } - attempts = retryToken.getRetryCount(); - const delay = retryToken.getRetryDelay(); - totalRetryDelay += delay; - await new Promise((resolve) => setTimeout(resolve, delay)); - } - } - } - else { - retryStrategy = retryStrategy; - if (retryStrategy === null || retryStrategy === void 0 ? void 0 : retryStrategy.mode) - context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]]; - return retryStrategy.retry(next, args); - } -}; -exports.retryMiddleware = retryMiddleware; -const isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && - typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && - typeof retryStrategy.recordSuccess !== "undefined"; -const getRetryErrorInfo = (error) => { - const errorInfo = { - errorType: getRetryErrorType(error), - }; - const retryAfterHint = (0, exports.getRetryAfterHint)(error.$response); - if (retryAfterHint) { - errorInfo.retryAfterHint = retryAfterHint; - } - return errorInfo; -}; -const getRetryErrorType = (error) => { - if ((0, service_error_classification_1.isThrottlingError)(error)) - return "THROTTLING"; - if ((0, service_error_classification_1.isTransientError)(error)) - return "TRANSIENT"; - if ((0, service_error_classification_1.isServerError)(error)) - return "SERVER_ERROR"; - return "CLIENT_ERROR"; -}; -exports.retryMiddlewareOptions = { - name: "retryMiddleware", - tags: ["RETRY"], - step: "finalizeRequest", - priority: "high", - override: true, -}; -const getRetryPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.retryMiddleware)(options), exports.retryMiddlewareOptions); - }, -}); -exports.getRetryPlugin = getRetryPlugin; -const getRetryAfterHint = (response) => { - if (!protocol_http_1.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.getRetryAfterHint = getRetryAfterHint; - - -/***/ }), - -/***/ 42827: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.asSdkError = void 0; -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}`); -}; -exports.asSdkError = asSdkError; - - -/***/ }), - -/***/ 16052: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(81460); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 93409: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 50540: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 57021: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(50540), exports); - - -/***/ }), - -/***/ 63682: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57943: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 6475: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 3795: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(57021), exports); -tslib_1.__exportStar(__nccwpck_require__(16052), exports); -tslib_1.__exportStar(__nccwpck_require__(93409), exports); -tslib_1.__exportStar(__nccwpck_require__(63682), exports); -tslib_1.__exportStar(__nccwpck_require__(57943), exports); -tslib_1.__exportStar(__nccwpck_require__(6475), exports); -tslib_1.__exportStar(__nccwpck_require__(19329), exports); -tslib_1.__exportStar(__nccwpck_require__(2871), exports); - - -/***/ }), - -/***/ 19329: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 2871: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 985: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13197: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 68397: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 19964: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 48296: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 72931: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 79294: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 88091: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(79294), exports); -tslib_1.__exportStar(__nccwpck_require__(4970), exports); -tslib_1.__exportStar(__nccwpck_require__(57275), exports); - - -/***/ }), - -/***/ 4970: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57275: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 96671: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 3473: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 52693: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 3394: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34041: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 81984: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 85317: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 76193: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(3394), exports); -tslib_1.__exportStar(__nccwpck_require__(34041), exports); -tslib_1.__exportStar(__nccwpck_require__(81984), exports); -tslib_1.__exportStar(__nccwpck_require__(29702), exports); -tslib_1.__exportStar(__nccwpck_require__(85317), exports); - - -/***/ }), - -/***/ 29702: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 16272: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20152: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 53018: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(20152); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 67390: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 45929: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(53018), exports); -tslib_1.__exportStar(__nccwpck_require__(67390), exports); -var checksum_1 = __nccwpck_require__(20152); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 34503: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 15096: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 45117: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 17920: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(15096), exports); -tslib_1.__exportStar(__nccwpck_require__(45117), exports); - - -/***/ }), - -/***/ 81460: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(985), exports); -tslib_1.__exportStar(__nccwpck_require__(13197), exports); -tslib_1.__exportStar(__nccwpck_require__(68397), exports); -tslib_1.__exportStar(__nccwpck_require__(19964), exports); -tslib_1.__exportStar(__nccwpck_require__(48296), exports); -tslib_1.__exportStar(__nccwpck_require__(72931), exports); -tslib_1.__exportStar(__nccwpck_require__(88091), exports); -tslib_1.__exportStar(__nccwpck_require__(96671), exports); -tslib_1.__exportStar(__nccwpck_require__(3473), exports); -tslib_1.__exportStar(__nccwpck_require__(52693), exports); -tslib_1.__exportStar(__nccwpck_require__(76193), exports); -tslib_1.__exportStar(__nccwpck_require__(16272), exports); -tslib_1.__exportStar(__nccwpck_require__(45929), exports); -tslib_1.__exportStar(__nccwpck_require__(34503), exports); -tslib_1.__exportStar(__nccwpck_require__(17920), exports); -tslib_1.__exportStar(__nccwpck_require__(58938), exports); -tslib_1.__exportStar(__nccwpck_require__(23724), exports); -tslib_1.__exportStar(__nccwpck_require__(86894), exports); -tslib_1.__exportStar(__nccwpck_require__(55720), exports); -tslib_1.__exportStar(__nccwpck_require__(11754), exports); -tslib_1.__exportStar(__nccwpck_require__(42168), exports); -tslib_1.__exportStar(__nccwpck_require__(37933), exports); -tslib_1.__exportStar(__nccwpck_require__(4903), exports); -tslib_1.__exportStar(__nccwpck_require__(66538), exports); -tslib_1.__exportStar(__nccwpck_require__(81594), exports); -tslib_1.__exportStar(__nccwpck_require__(43533), exports); -tslib_1.__exportStar(__nccwpck_require__(5405), exports); -tslib_1.__exportStar(__nccwpck_require__(96555), exports); -tslib_1.__exportStar(__nccwpck_require__(17129), exports); -tslib_1.__exportStar(__nccwpck_require__(12614), exports); -tslib_1.__exportStar(__nccwpck_require__(53396), exports); -tslib_1.__exportStar(__nccwpck_require__(21353), exports); -tslib_1.__exportStar(__nccwpck_require__(93105), exports); -tslib_1.__exportStar(__nccwpck_require__(60568), exports); - - -/***/ }), - -/***/ 58938: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 23724: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 86894: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 55720: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 11754: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 42168: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 37933: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 4903: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 66538: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 81594: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43533: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 5405: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 96555: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 17129: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 12614: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 53396: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21353: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 93105: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 60568: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 21595: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deserializerMiddleware = void 0; -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, - }); - if (!("$metadata" in error)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - error.message += "\n " + hint; - } - throw error; - } -}; -exports.deserializerMiddleware = deserializerMiddleware; - - -/***/ }), - -/***/ 81238: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(21595), exports); -tslib_1.__exportStar(__nccwpck_require__(72338), exports); -tslib_1.__exportStar(__nccwpck_require__(23566), exports); - - -/***/ }), - -/***/ 72338: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSerdePlugin = exports.serializerMiddlewareOption = exports.deserializerMiddlewareOption = void 0; -const deserializerMiddleware_1 = __nccwpck_require__(21595); -const serializerMiddleware_1 = __nccwpck_require__(23566); -exports.deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true, -}; -exports.serializerMiddlewareOption = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true, -}; -function getSerdePlugin(config, serializer, deserializer) { - return { - applyToStack: (commandStack) => { - commandStack.add((0, deserializerMiddleware_1.deserializerMiddleware)(config, deserializer), exports.deserializerMiddlewareOption); - commandStack.add((0, serializerMiddleware_1.serializerMiddleware)(config, serializer), exports.serializerMiddlewareOption); - }, - }; -} -exports.getSerdePlugin = getSerdePlugin; - - -/***/ }), - -/***/ 23566: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serializerMiddleware = void 0; -const serializerMiddleware = (options, serializer) => (next, context) => async (args) => { - var _a; - const endpoint = ((_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.url) && options.urlParser - ? async () => options.urlParser(context.endpointV2.url) - : options.endpoint; - if (!endpoint) { - throw new Error("No valid endpoint provider available."); - } - const request = await serializer(args.input, { ...options, endpoint }); - return next({ - ...args, - request, - }); -}; -exports.serializerMiddleware = serializerMiddleware; - - -/***/ }), - -/***/ 2404: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.constructStack = void 0; -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) => { - if (entry.name && entry.name === toRemove) { - isRemoved = true; - entriesNameSet.delete(toRemove); - 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; - if (entry.name) - entriesNameSet.delete(entry.name); - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }; - const cloneTo = (toStack) => { - var _a; - absoluteEntries.forEach((entry) => { - toStack.add(entry.middleware, { ...entry }); - }); - relativeEntries.forEach((entry) => { - toStack.addRelativeTo(entry.middleware, { ...entry }); - }); - (_a = toStack.identifyOnResolve) === null || _a === void 0 ? void 0 : _a.call(toStack, 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: [], - }; - if (normalizedEntry.name) - normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry; - normalizedAbsoluteEntries.push(normalizedEntry); - }); - relativeEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [], - }; - if (normalizedEntry.name) - normalizedEntriesNameMap[normalizedEntry.name] = 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 ${entry.name || "anonymous"} 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 } = options; - const entry = { - step: "initialize", - priority: "normal", - middleware, - ...options, - }; - if (name) { - if (entriesNameSet.has(name)) { - if (!override) - throw new Error(`Duplicate middleware name '${name}'`); - const toOverrideIndex = absoluteEntries.findIndex((entry) => entry.name === name); - const toOverride = absoluteEntries[toOverrideIndex]; - if (toOverride.step !== entry.step || toOverride.priority !== entry.priority) { - throw new Error(`"${name}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be ` + - `overridden by same-name middleware with ${entry.priority} priority in ${entry.step} step.`); - } - absoluteEntries.splice(toOverrideIndex, 1); - } - entriesNameSet.add(name); - } - absoluteEntries.push(entry); - }, - addRelativeTo: (middleware, options) => { - const { name, override } = options; - const entry = { - middleware, - ...options, - }; - if (name) { - if (entriesNameSet.has(name)) { - if (!override) - throw new Error(`Duplicate middleware name '${name}'`); - const toOverrideIndex = relativeEntries.findIndex((entry) => entry.name === name); - const toOverride = relativeEntries[toOverrideIndex]; - if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { - throw new Error(`"${name}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden ` + - `by same-name middleware ${entry.relation} "${entry.toMiddleware}" middleware.`); - } - relativeEntries.splice(toOverrideIndex, 1); - } - entriesNameSet.add(name); - } - relativeEntries.push(entry); - }, - clone: () => cloneTo((0, exports.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 } = entry; - if (tags && tags.includes(toRemove)) { - if (name) - entriesNameSet.delete(name); - isRemoved = true; - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, - concat: (from) => { - var _a, _b; - const cloned = cloneTo((0, exports.constructStack)()); - cloned.use(from); - cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || ((_b = (_a = from.identifyOnResolve) === null || _a === void 0 ? void 0 : _a.call(from)) !== null && _b !== void 0 ? _b : false)); - return cloned; - }, - applyToStack: cloneTo, - identify: () => { - return getMiddlewareList(true).map((mw) => { - var _a; - const step = (_a = mw.step) !== null && _a !== void 0 ? _a : mw.relation + - " " + - mw.toMiddleware; - return mw.name + " - " + 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; -}; -exports.constructStack = constructStack; -const stepWeights = { - initialize: 5, - serialize: 4, - build: 3, - finalizeRequest: 2, - deserialize: 1, -}; -const priorityWeights = { - high: 3, - normal: 2, - low: 1, -}; - - -/***/ }), - -/***/ 97911: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(2404), exports); - - -/***/ }), - -/***/ 54766: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadConfig = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const fromEnv_1 = __nccwpck_require__(15606); -const fromSharedConfigFiles_1 = __nccwpck_require__(45784); -const fromStatic_1 = __nccwpck_require__(23091); -const loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromEnv_1.fromEnv)(environmentVariableSelector), (0, fromSharedConfigFiles_1.fromSharedConfigFiles)(configFileSelector, configuration), (0, fromStatic_1.fromStatic)(defaultValue))); -exports.loadConfig = loadConfig; - - -/***/ }), - -/***/ 15606: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromEnv = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const fromEnv = (envVarSelector) => async () => { - try { - const config = envVarSelector(process.env); - if (config === undefined) { - throw new Error(); - } - return config; - } - catch (e) { - throw new property_provider_1.CredentialsProviderError(e.message || `Cannot load config from environment variables with getter: ${envVarSelector}`); - } -}; -exports.fromEnv = fromEnv; - - -/***/ }), - -/***/ 45784: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromSharedConfigFiles = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const shared_ini_file_loader_1 = __nccwpck_require__(43507); -const fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = (0, shared_ini_file_loader_1.getProfileName)(init); - const { configFile, credentialsFile } = await (0, shared_ini_file_loader_1.loadSharedConfigFiles)(init); - const profileFromCredentials = credentialsFile[profile] || {}; - const profileFromConfig = configFile[profile] || {}; - const mergedProfile = preferredFile === "config" - ? { ...profileFromCredentials, ...profileFromConfig } - : { ...profileFromConfig, ...profileFromCredentials }; - try { - const configValue = configSelector(mergedProfile); - if (configValue === undefined) { - throw new Error(); - } - return configValue; - } - catch (e) { - throw new property_provider_1.CredentialsProviderError(e.message || `Cannot load config for profile ${profile} in SDK configuration files with getter: ${configSelector}`); - } -}; -exports.fromSharedConfigFiles = fromSharedConfigFiles; - - -/***/ }), - -/***/ 23091: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromStatic = void 0; -const property_provider_1 = __nccwpck_require__(79721); -const isFunction = (func) => typeof func === "function"; -const fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, property_provider_1.fromStatic)(defaultValue); -exports.fromStatic = fromStatic; - - -/***/ }), - -/***/ 33461: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(54766), exports); - - -/***/ }), - -/***/ 33946: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - - -/***/ }), - -/***/ 70508: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -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; -}; -exports.getTransformedHeaders = getTransformedHeaders; - - -/***/ }), - -/***/ 20258: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(96948), exports); -tslib_1.__exportStar(__nccwpck_require__(46999), exports); -tslib_1.__exportStar(__nccwpck_require__(81030), exports); - - -/***/ }), - -/***/ 96948: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; -const protocol_http_1 = __nccwpck_require__(64418); -const querystring_builder_1 = __nccwpck_require__(68031); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(33946); -const get_transformed_headers_1 = __nccwpck_require__(70508); -const set_connection_timeout_1 = __nccwpck_require__(25545); -const set_socket_keep_alive_1 = __nccwpck_require__(83751); -const set_socket_timeout_1 = __nccwpck_require__(42618); -const write_request_body_1 = __nccwpck_require__(73766); -exports.DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - var _a, _b; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - auth, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - }); - } - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); - }); - } -} -exports.NodeHttpHandler = NodeHttpHandler; - - -/***/ }), - -/***/ 5771: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionManager = void 0; -const tslib_1 = __nccwpck_require__(4351); -const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); -const node_http2_connection_pool_1 = __nccwpck_require__(95157); -class NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const 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_1.default.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 node_http2_connection_pool_1.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) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); - } -} -exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; - - -/***/ }), - -/***/ 95157: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionPool = void 0; -class NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions !== null && sessions !== void 0 ? 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(); - } - } - } - } -} -exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; - - -/***/ }), - -/***/ 46999: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(64418); -const querystring_builder_1 = __nccwpck_require__(68031); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(70508); -const node_http2_connection_manager_1 = __nccwpck_require__(5771); -const write_request_body_1 = __nccwpck_require__(73766); -class NodeHttp2Handler { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); - 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 } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a, _b, _c; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal === null || abortSignal === void 0 ? void 0 : 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 = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - 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 = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); - }); - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } -} -exports.NodeHttp2Handler = NodeHttp2Handler; -/***/ }), -/***/ 25545: -/***/ ((__unused_webpack_module, exports) => { +var _GetRepositoryPolicyCommand = class _GetRepositoryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "GetRepositoryPolicy", {}).n("ECRClient", "GetRepositoryPolicyCommand").f(void 0, void 0).ser(se_GetRepositoryPolicyCommand).de(de_GetRepositoryPolicyCommand).build() { +}; +__name(_GetRepositoryPolicyCommand, "GetRepositoryPolicyCommand"); +var GetRepositoryPolicyCommand = _GetRepositoryPolicyCommand; -"use strict"; +// src/commands/InitiateLayerUploadCommand.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; - } - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - else { - clearTimeout(timeoutId); - } - }); + + + +var _InitiateLayerUploadCommand = class _InitiateLayerUploadCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "InitiateLayerUpload", {}).n("ECRClient", "InitiateLayerUploadCommand").f(void 0, void 0).ser(se_InitiateLayerUploadCommand).de(de_InitiateLayerUploadCommand).build() { }; -exports.setConnectionTimeout = setConnectionTimeout; +__name(_InitiateLayerUploadCommand, "InitiateLayerUploadCommand"); +var InitiateLayerUploadCommand = _InitiateLayerUploadCommand; +// src/commands/ListImagesCommand.ts -/***/ }), -/***/ 83751: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketKeepAlive = void 0; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; - } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); +var _ListImagesCommand = class _ListImagesCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "ListImages", {}).n("ECRClient", "ListImagesCommand").f(void 0, void 0).ser(se_ListImagesCommand).de(de_ListImagesCommand).build() { }; -exports.setSocketKeepAlive = setSocketKeepAlive; +__name(_ListImagesCommand, "ListImagesCommand"); +var ListImagesCommand = _ListImagesCommand; +// src/commands/ListTagsForResourceCommand.ts -/***/ }), -/***/ 42618: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); +var _ListTagsForResourceCommand = class _ListTagsForResourceCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "ListTagsForResource", {}).n("ECRClient", "ListTagsForResourceCommand").f(void 0, void 0).ser(se_ListTagsForResourceCommand).de(de_ListTagsForResourceCommand).build() { }; -exports.setSocketTimeout = setSocketTimeout; +__name(_ListTagsForResourceCommand, "ListTagsForResourceCommand"); +var ListTagsForResourceCommand = _ListTagsForResourceCommand; +// src/commands/PutImageCommand.ts -/***/ }), -/***/ 23211: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } -} -exports.Collector = Collector; +var _PutImageCommand = class _PutImageCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "PutImage", {}).n("ECRClient", "PutImageCommand").f(void 0, void 0).ser(se_PutImageCommand).de(de_PutImageCommand).build() { +}; +__name(_PutImageCommand, "PutImageCommand"); +var PutImageCommand = _PutImageCommand; +// src/commands/PutImageScanningConfigurationCommand.ts -/***/ }), -/***/ 81030: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(23211); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.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); - }); -}); -exports.streamCollector = streamCollector; +var _PutImageScanningConfigurationCommand = class _PutImageScanningConfigurationCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "PutImageScanningConfiguration", {}).n("ECRClient", "PutImageScanningConfigurationCommand").f(void 0, void 0).ser(se_PutImageScanningConfigurationCommand).de(de_PutImageScanningConfigurationCommand).build() { +}; +__name(_PutImageScanningConfigurationCommand, "PutImageScanningConfigurationCommand"); +var PutImageScanningConfigurationCommand = _PutImageScanningConfigurationCommand; +// src/commands/PutImageTagMutabilityCommand.ts -/***/ }), -/***/ 73766: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -const MIN_WAIT_TIME = 1000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - var _a; - const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }), - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} +var _PutImageTagMutabilityCommand = class _PutImageTagMutabilityCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "PutImageTagMutability", {}).n("ECRClient", "PutImageTagMutabilityCommand").f(void 0, void 0).ser(se_PutImageTagMutabilityCommand).de(de_PutImageTagMutabilityCommand).build() { +}; +__name(_PutImageTagMutabilityCommand, "PutImageTagMutabilityCommand"); +var PutImageTagMutabilityCommand = _PutImageTagMutabilityCommand; +// src/commands/PutLifecyclePolicyCommand.ts -/***/ }), -/***/ 63936: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CredentialsProviderError = void 0; -const ProviderError_1 = __nccwpck_require__(23324); -class CredentialsProviderError extends ProviderError_1.ProviderError { - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - this.name = "CredentialsProviderError"; - Object.setPrototypeOf(this, CredentialsProviderError.prototype); - } -} -exports.CredentialsProviderError = CredentialsProviderError; +var _PutLifecyclePolicyCommand = class _PutLifecyclePolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "PutLifecyclePolicy", {}).n("ECRClient", "PutLifecyclePolicyCommand").f(void 0, void 0).ser(se_PutLifecyclePolicyCommand).de(de_PutLifecyclePolicyCommand).build() { +}; +__name(_PutLifecyclePolicyCommand, "PutLifecyclePolicyCommand"); +var PutLifecyclePolicyCommand = _PutLifecyclePolicyCommand; +// src/commands/PutRegistryPolicyCommand.ts -/***/ }), -/***/ 23324: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProviderError = void 0; -class ProviderError extends Error { - constructor(message, tryNextLink = true) { - super(message); - this.tryNextLink = tryNextLink; - this.name = "ProviderError"; - Object.setPrototypeOf(this, ProviderError.prototype); +var _PutRegistryPolicyCommand = class _PutRegistryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "PutRegistryPolicy", {}).n("ECRClient", "PutRegistryPolicyCommand").f(void 0, void 0).ser(se_PutRegistryPolicyCommand).de(de_PutRegistryPolicyCommand).build() { +}; +__name(_PutRegistryPolicyCommand, "PutRegistryPolicyCommand"); +var PutRegistryPolicyCommand = _PutRegistryPolicyCommand; + +// src/commands/PutRegistryScanningConfigurationCommand.ts + + + + +var _PutRegistryScanningConfigurationCommand = class _PutRegistryScanningConfigurationCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "PutRegistryScanningConfiguration", {}).n("ECRClient", "PutRegistryScanningConfigurationCommand").f(void 0, void 0).ser(se_PutRegistryScanningConfigurationCommand).de(de_PutRegistryScanningConfigurationCommand).build() { +}; +__name(_PutRegistryScanningConfigurationCommand, "PutRegistryScanningConfigurationCommand"); +var PutRegistryScanningConfigurationCommand = _PutRegistryScanningConfigurationCommand; + +// src/commands/PutReplicationConfigurationCommand.ts + + + + +var _PutReplicationConfigurationCommand = class _PutReplicationConfigurationCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "PutReplicationConfiguration", {}).n("ECRClient", "PutReplicationConfigurationCommand").f(void 0, void 0).ser(se_PutReplicationConfigurationCommand).de(de_PutReplicationConfigurationCommand).build() { +}; +__name(_PutReplicationConfigurationCommand, "PutReplicationConfigurationCommand"); +var PutReplicationConfigurationCommand = _PutReplicationConfigurationCommand; + +// src/commands/SetRepositoryPolicyCommand.ts + + + + +var _SetRepositoryPolicyCommand = class _SetRepositoryPolicyCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "SetRepositoryPolicy", {}).n("ECRClient", "SetRepositoryPolicyCommand").f(void 0, void 0).ser(se_SetRepositoryPolicyCommand).de(de_SetRepositoryPolicyCommand).build() { +}; +__name(_SetRepositoryPolicyCommand, "SetRepositoryPolicyCommand"); +var SetRepositoryPolicyCommand = _SetRepositoryPolicyCommand; + +// src/commands/StartImageScanCommand.ts + + + + +var _StartImageScanCommand = class _StartImageScanCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "StartImageScan", {}).n("ECRClient", "StartImageScanCommand").f(void 0, void 0).ser(se_StartImageScanCommand).de(de_StartImageScanCommand).build() { +}; +__name(_StartImageScanCommand, "StartImageScanCommand"); +var StartImageScanCommand = _StartImageScanCommand; + +// src/commands/StartLifecyclePolicyPreviewCommand.ts + + + + +var _StartLifecyclePolicyPreviewCommand = class _StartLifecyclePolicyPreviewCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "StartLifecyclePolicyPreview", {}).n("ECRClient", "StartLifecyclePolicyPreviewCommand").f(void 0, void 0).ser(se_StartLifecyclePolicyPreviewCommand).de(de_StartLifecyclePolicyPreviewCommand).build() { +}; +__name(_StartLifecyclePolicyPreviewCommand, "StartLifecyclePolicyPreviewCommand"); +var StartLifecyclePolicyPreviewCommand = _StartLifecyclePolicyPreviewCommand; + +// src/commands/TagResourceCommand.ts + + + + +var _TagResourceCommand = class _TagResourceCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "TagResource", {}).n("ECRClient", "TagResourceCommand").f(void 0, void 0).ser(se_TagResourceCommand).de(de_TagResourceCommand).build() { +}; +__name(_TagResourceCommand, "TagResourceCommand"); +var TagResourceCommand = _TagResourceCommand; + +// src/commands/UntagResourceCommand.ts + + + + +var _UntagResourceCommand = class _UntagResourceCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "UntagResource", {}).n("ECRClient", "UntagResourceCommand").f(void 0, void 0).ser(se_UntagResourceCommand).de(de_UntagResourceCommand).build() { +}; +__name(_UntagResourceCommand, "UntagResourceCommand"); +var UntagResourceCommand = _UntagResourceCommand; + +// src/commands/UpdatePullThroughCacheRuleCommand.ts + + + + +var _UpdatePullThroughCacheRuleCommand = class _UpdatePullThroughCacheRuleCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "UpdatePullThroughCacheRule", {}).n("ECRClient", "UpdatePullThroughCacheRuleCommand").f(void 0, void 0).ser(se_UpdatePullThroughCacheRuleCommand).de(de_UpdatePullThroughCacheRuleCommand).build() { +}; +__name(_UpdatePullThroughCacheRuleCommand, "UpdatePullThroughCacheRuleCommand"); +var UpdatePullThroughCacheRuleCommand = _UpdatePullThroughCacheRuleCommand; + +// src/commands/UploadLayerPartCommand.ts + + + + +var _UploadLayerPartCommand = class _UploadLayerPartCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "UploadLayerPart", {}).n("ECRClient", "UploadLayerPartCommand").f(void 0, void 0).ser(se_UploadLayerPartCommand).de(de_UploadLayerPartCommand).build() { +}; +__name(_UploadLayerPartCommand, "UploadLayerPartCommand"); +var UploadLayerPartCommand = _UploadLayerPartCommand; + +// src/commands/ValidatePullThroughCacheRuleCommand.ts + + + + +var _ValidatePullThroughCacheRuleCommand = class _ValidatePullThroughCacheRuleCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AmazonEC2ContainerRegistry_V20150921", "ValidatePullThroughCacheRule", {}).n("ECRClient", "ValidatePullThroughCacheRuleCommand").f(void 0, void 0).ser(se_ValidatePullThroughCacheRuleCommand).de(de_ValidatePullThroughCacheRuleCommand).build() { +}; +__name(_ValidatePullThroughCacheRuleCommand, "ValidatePullThroughCacheRuleCommand"); +var ValidatePullThroughCacheRuleCommand = _ValidatePullThroughCacheRuleCommand; + +// src/ECR.ts +var commands = { + BatchCheckLayerAvailabilityCommand, + BatchDeleteImageCommand, + BatchGetImageCommand, + BatchGetRepositoryScanningConfigurationCommand, + CompleteLayerUploadCommand, + CreatePullThroughCacheRuleCommand, + CreateRepositoryCommand, + DeleteLifecyclePolicyCommand, + DeletePullThroughCacheRuleCommand, + DeleteRegistryPolicyCommand, + DeleteRepositoryCommand, + DeleteRepositoryPolicyCommand, + DescribeImageReplicationStatusCommand, + DescribeImagesCommand, + DescribeImageScanFindingsCommand, + DescribePullThroughCacheRulesCommand, + DescribeRegistryCommand, + DescribeRepositoriesCommand, + GetAuthorizationTokenCommand, + GetDownloadUrlForLayerCommand, + GetLifecyclePolicyCommand, + GetLifecyclePolicyPreviewCommand, + GetRegistryPolicyCommand, + GetRegistryScanningConfigurationCommand, + GetRepositoryPolicyCommand, + InitiateLayerUploadCommand, + ListImagesCommand, + ListTagsForResourceCommand, + PutImageCommand, + PutImageScanningConfigurationCommand, + PutImageTagMutabilityCommand, + PutLifecyclePolicyCommand, + PutRegistryPolicyCommand, + PutRegistryScanningConfigurationCommand, + PutReplicationConfigurationCommand, + SetRepositoryPolicyCommand, + StartImageScanCommand, + StartLifecyclePolicyPreviewCommand, + TagResourceCommand, + UntagResourceCommand, + UpdatePullThroughCacheRuleCommand, + UploadLayerPartCommand, + ValidatePullThroughCacheRuleCommand +}; +var _ECR = class _ECR extends ECRClient { +}; +__name(_ECR, "ECR"); +var ECR = _ECR; +(0, import_smithy_client.createAggregatedClient)(commands, ECR); + +// src/pagination/DescribeImageScanFindingsPaginator.ts + +var paginateDescribeImageScanFindings = (0, import_core.createPaginator)(ECRClient, DescribeImageScanFindingsCommand, "nextToken", "nextToken", "maxResults"); + +// src/pagination/DescribeImagesPaginator.ts + +var paginateDescribeImages = (0, import_core.createPaginator)(ECRClient, DescribeImagesCommand, "nextToken", "nextToken", "maxResults"); + +// src/pagination/DescribePullThroughCacheRulesPaginator.ts + +var paginateDescribePullThroughCacheRules = (0, import_core.createPaginator)(ECRClient, DescribePullThroughCacheRulesCommand, "nextToken", "nextToken", "maxResults"); + +// src/pagination/DescribeRepositoriesPaginator.ts + +var paginateDescribeRepositories = (0, import_core.createPaginator)(ECRClient, DescribeRepositoriesCommand, "nextToken", "nextToken", "maxResults"); + +// src/pagination/GetLifecyclePolicyPreviewPaginator.ts + +var paginateGetLifecyclePolicyPreview = (0, import_core.createPaginator)(ECRClient, GetLifecyclePolicyPreviewCommand, "nextToken", "nextToken", "maxResults"); + +// src/pagination/ListImagesPaginator.ts + +var paginateListImages = (0, import_core.createPaginator)(ECRClient, ListImagesCommand, "nextToken", "nextToken", "maxResults"); + +// src/waiters/waitForImageScanComplete.ts +var import_util_waiter = __nccwpck_require__(8011); +var checkState = /* @__PURE__ */ __name(async (client, input) => { + let reason; + try { + const result = await client.send(new DescribeImageScanFindingsCommand(input)); + reason = result; + try { + const returnComparator = /* @__PURE__ */ __name(() => { + return result.imageScanStatus.status; + }, "returnComparator"); + if (returnComparator() === "COMPLETE") { + return { state: import_util_waiter.WaiterState.SUCCESS, reason }; + } + } catch (e) { } - static from(error, tryNextLink = true) { - return Object.assign(new this(error.message, tryNextLink), error); + try { + const returnComparator = /* @__PURE__ */ __name(() => { + return result.imageScanStatus.status; + }, "returnComparator"); + if (returnComparator() === "FAILED") { + return { state: import_util_waiter.WaiterState.FAILURE, reason }; + } + } catch (e) { } -} -exports.ProviderError = ProviderError; + } catch (exception) { + reason = exception; + } + return { state: import_util_waiter.WaiterState.RETRY, reason }; +}, "checkState"); +var waitForImageScanComplete = /* @__PURE__ */ __name(async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return (0, import_util_waiter.createWaiter)({ ...serviceDefaults, ...params }, input, checkState); +}, "waitForImageScanComplete"); +var waitUntilImageScanComplete = /* @__PURE__ */ __name(async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await (0, import_util_waiter.createWaiter)({ ...serviceDefaults, ...params }, input, checkState); + return (0, import_util_waiter.checkExceptions)(result); +}, "waitUntilImageScanComplete"); + +// src/waiters/waitForLifecyclePolicyPreviewComplete.ts + +var checkState2 = /* @__PURE__ */ __name(async (client, input) => { + let reason; + try { + const result = await client.send(new GetLifecyclePolicyPreviewCommand(input)); + reason = result; + try { + const returnComparator = /* @__PURE__ */ __name(() => { + return result.status; + }, "returnComparator"); + if (returnComparator() === "COMPLETE") { + return { state: import_util_waiter.WaiterState.SUCCESS, reason }; + } + } catch (e) { + } + try { + const returnComparator = /* @__PURE__ */ __name(() => { + return result.status; + }, "returnComparator"); + if (returnComparator() === "FAILED") { + return { state: import_util_waiter.WaiterState.FAILURE, reason }; + } + } catch (e) { + } + } catch (exception) { + reason = exception; + } + return { state: import_util_waiter.WaiterState.RETRY, reason }; +}, "checkState"); +var waitForLifecyclePolicyPreviewComplete = /* @__PURE__ */ __name(async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return (0, import_util_waiter.createWaiter)({ ...serviceDefaults, ...params }, input, checkState2); +}, "waitForLifecyclePolicyPreviewComplete"); +var waitUntilLifecyclePolicyPreviewComplete = /* @__PURE__ */ __name(async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await (0, import_util_waiter.createWaiter)({ ...serviceDefaults, ...params }, input, checkState2); + return (0, import_util_waiter.checkExceptions)(result); +}, "waitUntilLifecyclePolicyPreviewComplete"); + +// src/index.ts +var import_util_endpoints = __nccwpck_require__(3350); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 50429: +/***/ 869: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TokenProviderError = void 0; -const ProviderError_1 = __nccwpck_require__(23324); -class TokenProviderError extends ProviderError_1.ProviderError { - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - this.name = "TokenProviderError"; - Object.setPrototypeOf(this, TokenProviderError.prototype); - } -} -exports.TokenProviderError = TokenProviderError; +exports.getRuntimeConfig = void 0; +const tslib_1 = __nccwpck_require__(4351); +const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(4289)); +const core_1 = __nccwpck_require__(9963); +const credential_provider_node_1 = __nccwpck_require__(5531); +const util_user_agent_node_1 = __nccwpck_require__(8095); +const config_resolver_1 = __nccwpck_require__(3098); +const hash_node_1 = __nccwpck_require__(3081); +const middleware_retry_1 = __nccwpck_require__(6039); +const node_config_provider_1 = __nccwpck_require__(3461); +const node_http_handler_1 = __nccwpck_require__(4350); +const util_body_length_node_1 = __nccwpck_require__(8075); +const util_retry_1 = __nccwpck_require__(4902); +const runtimeConfig_shared_1 = __nccwpck_require__(542); +const smithy_client_1 = __nccwpck_require__(3570); +const util_defaults_mode_node_1 = __nccwpck_require__(2429); +const smithy_client_2 = __nccwpck_require__(3570); +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); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + 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.defaultUserAgent)({ 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), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + 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, + }), + 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), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 45079: +/***/ 542: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.chain = void 0; -const ProviderError_1 = __nccwpck_require__(23324); -const chain = (...providers) => async () => { - if (providers.length === 0) { - throw new ProviderError_1.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 === null || err === void 0 ? void 0 : err.tryNextLink) { - continue; - } - throw err; - } - } - throw lastProviderError; +exports.getRuntimeConfig = void 0; +const core_1 = __nccwpck_require__(9963); +const smithy_client_1 = __nccwpck_require__(3570); +const url_parser_1 = __nccwpck_require__(4681); +const util_base64_1 = __nccwpck_require__(5600); +const util_utf8_1 = __nccwpck_require__(1895); +const httpAuthSchemeProvider_1 = __nccwpck_require__(4682); +const endpointResolver_1 = __nccwpck_require__(1610); +const getRuntimeConfig = (config) => { + return { + apiVersion: "2015-09-21", + 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.defaultECRHttpAuthSchemeProvider, + 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(), + serviceId: config?.serviceId ?? "ECR", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, + }; }; -exports.chain = chain; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 51322: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromStatic = void 0; -const fromStatic = (staticValue) => () => Promise.resolve(staticValue); -exports.fromStatic = fromStatic; +/***/ 4350: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, + NodeHttp2Handler: () => NodeHttp2Handler, + NodeHttpHandler: () => NodeHttpHandler, + streamCollector: () => streamCollector +}); +module.exports = __toCommonJS(src_exports); + +// src/node-http-handler.ts +var import_protocol_http = __nccwpck_require__(2473); +var import_querystring_builder = __nccwpck_require__(8021); +var import_http = __nccwpck_require__(3685); +var import_https = __nccwpck_require__(5687); + +// src/constants.ts +var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +// src/get-transformed-headers.ts +var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}, "getTransformedHeaders"); -/***/ }), +// src/set-connection-timeout.ts +var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject( + Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError" + }) + ); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } else { + clearTimeout(timeoutId); + } + }); +}, "setConnectionTimeout"); -/***/ 79721: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/set-socket-keep-alive.ts +var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}, "setSocketKeepAlive"); -"use strict"; +// src/set-socket-timeout.ts +var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}, "setSocketTimeout"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(63936), exports); -tslib_1.__exportStar(__nccwpck_require__(23324), exports); -tslib_1.__exportStar(__nccwpck_require__(50429), exports); -tslib_1.__exportStar(__nccwpck_require__(45079), exports); -tslib_1.__exportStar(__nccwpck_require__(51322), exports); -tslib_1.__exportStar(__nccwpck_require__(49762), exports); +// src/write-request-body.ts +var import_stream = __nccwpck_require__(2781); +var MIN_WAIT_TIME = 1e3; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + const headers = request.headers ?? {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }) + ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } +} +__name(writeRequestBody, "writeRequestBody"); +function writeBody(httpRequest, body) { + if (body instanceof import_stream.Readable) { + body.pipe(httpRequest); + } else if (body) { + httpRequest.end(Buffer.from(body)); + } else { + httpRequest.end(); + } +} +__name(writeBody, "writeBody"); + +// src/node-http-handler.ts +var DEFAULT_REQUEST_TIMEOUT = 0; +var _NodeHttpHandler = class _NodeHttpHandler { + constructor(options) { + this.socketWarningTimestamp = 0; + // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286 + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttpHandler(instanceOrOptions); + } + /** + * @internal + * + * @param agent - http(s) agent in use by the NodeHttpHandler instance. + * @returns timestamp of last emitted warning. + */ + static checkSocketUsage(agent, socketWarningTimestamp) { + var _a, _b; + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; + const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + console.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; + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout ?? socketTimeout, + httpAgent: (() => { + if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { + return httpAgent; + } + return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { + return httpsAgent; + } + return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })() + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); + (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + let socketCheckTimeoutId; + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + clearTimeout(socketCheckTimeoutId); + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; + socketCheckTimeoutId = setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp); + }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)); + const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); + let auth = void 0; + 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}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent, + auth + }; + const requestFunc = isSSL ? import_https.request : import_http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new import_protocol_http.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); + } + }); + setConnectionTimeout(req, reject, this.config.connectionTimeout); + setSocketTimeout(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + setSocketKeepAlive(req, { + // @ts-expect-error keepAlive is not public on httpAgent. + keepAlive: httpAgent.keepAlive, + // @ts-expect-error keepAliveMsecs is not public on httpAgent. + keepAliveMsecs: httpAgent.keepAliveMsecs + }); + } + writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } +}; +__name(_NodeHttpHandler, "NodeHttpHandler"); +var NodeHttpHandler = _NodeHttpHandler; +// src/node-http2-handler.ts -/***/ }), -/***/ 49762: -/***/ ((__unused_webpack_module, exports) => { +var import_http22 = __nccwpck_require__(5158); -"use strict"; +// src/node-http2-connection-manager.ts +var import_http2 = __toESM(__nccwpck_require__(5158)); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.memoize = void 0; -const memoize = (provider, isExpired, requiresRefresh) => { - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = async () => { - if (!pending) { - pending = provider(); +// src/node-http2-connection-pool.ts +var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); + } + } + offerLast(session) { + this.sessions.push(session); + } + contains(session) { + return this.sessions.includes(session); + } + remove(session) { + this.sessions = this.sessions.filter((s) => s !== session); + } + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); + } + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); } - try { - resolved = await pending; - hasResult = true; - isConstant = false; + } + } + } +}; +__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); +var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; + +// src/node-http2-connection-manager.ts +var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = /* @__PURE__ */ new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + lease(requestContext, connectionConfiguration) { + const 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 = import_http2.default.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() + ); } - finally { - pending = undefined; + }); + } + session.unref(); + const destroySessionCb = /* @__PURE__ */ __name(() => { + session.destroy(); + this.deleteSession(url, session); + }, "destroySessionCb"); + 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; + } + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; + } + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); } - return resolved; - }; - if (isExpired === undefined) { - return async (options) => { - if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - return resolved; - }; + connectionPool.remove(session); + } + this.sessionCache.delete(key); } - return async (options) => { - if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } +}; +__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); +var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; + +// src/node-http2-handler.ts +var _NodeHttp2Handler = class _NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttp2Handler(instanceOrOptions); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } + } + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a; + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (abortSignal == null ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = 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: (_a = this.config) == null ? void 0 : _a.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = /* @__PURE__ */ __name((err) => { + if (disableConcurrentStreams) { + this.destroySession(session); } - if (isConstant) { - return resolved; + fulfilled = true; + reject(err); + }, "rejectWithDestroy"); + const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [import_http22.constants.HTTP2_HEADER_PATH]: path, + [import_http22.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new import_protocol_http.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 (requiresRefresh && !requiresRefresh(resolved)) { - isConstant = true; - return resolved; + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + 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 (isExpired(resolved)) { - await coalesceProvider(); - return resolved; + if (!fulfilled) { + rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); } - return resolved; - }; + }); + writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + /** + * Destroys a session. + * @param session The session to destroy. + */ + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } }; -exports.memoize = memoize; +__name(_NodeHttp2Handler, "NodeHttp2Handler"); +var NodeHttp2Handler = _NodeHttp2Handler; +// src/stream-collector/collector.ts -/***/ }), +var _Collector = class _Collector extends import_stream.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +}; +__name(_Collector, "Collector"); +var Collector = _Collector; -/***/ 89179: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/stream-collector/index.ts +var streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}), "streamCollector"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(55756); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; /***/ }), -/***/ 99242: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2473: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(5417); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; + +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); } -exports.Fields = Fields; +__name(cloneQuery, "cloneQuery"); +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ }), - -/***/ 63206: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 38746: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8021: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; +// src/index.ts +var src_exports = {}; +__export(src_exports, { + buildQueryString: () => buildQueryString +}); +module.exports = __toCommonJS(src_exports); +var import_util_uri_escape = __nccwpck_require__(8235); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, import_util_uri_escape.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; + } + parts.push(qsEntry); } + } + return parts.join("&"); } -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} +__name(buildQueryString, "buildQueryString"); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -/***/ }), -/***/ 26322: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; +/***/ 5417: +/***/ ((module) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; } -} -exports.HttpResponse = HttpResponse; + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -/***/ }), +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ 64418: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -"use strict"; +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(89179), exports); -tslib_1.__exportStar(__nccwpck_require__(99242), exports); -tslib_1.__exportStar(__nccwpck_require__(63206), exports); -tslib_1.__exportStar(__nccwpck_require__(38746), exports); -tslib_1.__exportStar(__nccwpck_require__(26322), exports); -tslib_1.__exportStar(__nccwpck_require__(61466), exports); -tslib_1.__exportStar(__nccwpck_require__(19135), exports); +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -/***/ }), -/***/ 61466: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; +/***/ 8235: +/***/ ((module) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ }), +// src/index.ts +var src_exports = {}; +__export(src_exports, { + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath +}); +module.exports = __toCommonJS(src_exports); -/***/ 19135: -/***/ ((__unused_webpack_module, exports) => { +// src/escape-uri.ts +var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) +), "escapeUri"); +var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); -"use strict"; +// src/escape-uri-path.ts +var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 68031: +/***/ 4163: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(54197); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } +exports.resolveHttpAuthSchemeConfig = exports.defaultSSOOIDCHttpAuthSchemeProvider = exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = void 0; +const core_1 = __nccwpck_require__(9963); +const util_middleware_1 = __nccwpck_require__(2390); +const defaultSSOOIDCHttpAuthSchemeParametersProvider = 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.defaultSSOOIDCHttpAuthSchemeParametersProvider = defaultSSOOIDCHttpAuthSchemeParametersProvider; +function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "sso-oauth", + region: authParameters.region, + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context, + }, + }), + }; +} +function createSmithyApiNoAuthHttpAuthOption(authParameters) { + return { + schemeId: "smithy.api#noAuth", + }; +} +const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "CreateToken": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); + case "RegisterClient": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; } - } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; - - -/***/ }), - -/***/ 4769: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseQueryString = void 0; -function parseQueryString(querystring) { - const query = {}; - querystring = querystring.replace(/^\?/, ""); - if (querystring) { - for (const pair of querystring.split("&")) { - let [key, value = null] = pair.split("="); - key = decodeURIComponent(key); - if (value) { - value = decodeURIComponent(value); - } - if (!(key in query)) { - query[key] = value; - } - else if (Array.isArray(query[key])) { - query[key].push(value); - } - else { - query[key] = [query[key], value]; - } + case "StartDeviceAuthorization": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); } } - return query; -} -exports.parseQueryString = parseQueryString; - - -/***/ }), - -/***/ 68415: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = exports.TRANSIENT_ERROR_STATUS_CODES = exports.TRANSIENT_ERROR_CODES = exports.THROTTLING_ERROR_CODES = exports.CLOCK_SKEW_ERROR_CODES = void 0; -exports.CLOCK_SKEW_ERROR_CODES = [ - "AuthFailure", - "InvalidSignatureException", - "RequestExpired", - "RequestInTheFuture", - "RequestTimeTooSkewed", - "SignatureDoesNotMatch", -]; -exports.THROTTLING_ERROR_CODES = [ - "BandwidthLimitExceeded", - "EC2ThrottledException", - "LimitExceededException", - "PriorRequestNotComplete", - "ProvisionedThroughputExceededException", - "RequestLimitExceeded", - "RequestThrottled", - "RequestThrottledException", - "SlowDown", - "ThrottledException", - "Throttling", - "ThrottlingException", - "TooManyRequestsException", - "TransactionInProgressException", -]; -exports.TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; -exports.TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; + return options; +}; +exports.defaultSSOOIDCHttpAuthSchemeProvider = defaultSSOOIDCHttpAuthSchemeProvider; +const resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return { + ...config_0, + }; +}; +exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; /***/ }), -/***/ 6375: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 118: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isServerError = exports.isTransientError = exports.isThrottlingError = exports.isClockSkewError = exports.isRetryableByTrait = void 0; -const constants_1 = __nccwpck_require__(68415); -const isRetryableByTrait = (error) => error.$retryable !== undefined; -exports.isRetryableByTrait = isRetryableByTrait; -const isClockSkewError = (error) => constants_1.CLOCK_SKEW_ERROR_CODES.includes(error.name); -exports.isClockSkewError = isClockSkewError; -const isThrottlingError = (error) => { - var _a, _b; - return ((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) === 429 || - constants_1.THROTTLING_ERROR_CODES.includes(error.name) || - ((_b = error.$retryable) === null || _b === void 0 ? void 0 : _b.throttling) == true; -}; -exports.isThrottlingError = isThrottlingError; -const isTransientError = (error) => { - var _a; - return constants_1.TRANSIENT_ERROR_CODES.includes(error.name) || - constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes((error === null || error === void 0 ? void 0 : error.code) || "") || - constants_1.TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) || 0); -}; -exports.isTransientError = isTransientError; -const isServerError = (error) => { - var _a; - if (((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) !== undefined) { - const statusCode = error.$metadata.httpStatusCode; - if (500 <= statusCode && statusCode <= 599 && !(0, exports.isTransientError)(error)) { - return true; - } - return false; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } - return false; + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; -exports.isServerError = isServerError; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultProvider = void 0; +exports.defaultProvider = ((input) => { + return () => Promise.resolve().then(() => __importStar(__nccwpck_require__(5531))).then(({ defaultProvider }) => defaultProvider(input)()); +}); /***/ }), -/***/ 47237: +/***/ 7604: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getConfigFilepath = exports.ENV_CONFIG_PATH = void 0; -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(68340); -exports.ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; -const getConfigFilepath = () => process.env[exports.ENV_CONFIG_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "config"); -exports.getConfigFilepath = getConfigFilepath; +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = __nccwpck_require__(5473); +const ruleset_1 = __nccwpck_require__(1756); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; +exports.defaultEndpointResolver = defaultEndpointResolver; /***/ }), -/***/ 99036: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 1756: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCredentialsFilepath = exports.ENV_CREDENTIALS_PATH = void 0; -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(68340); -exports.ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; -const getCredentialsFilepath = () => process.env[exports.ENV_CREDENTIALS_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "credentials"); -exports.getCredentialsFilepath = getCredentialsFilepath; +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 }] }; +exports.ruleSet = _data; /***/ }), -/***/ 68340: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4527: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHomeDir = void 0; -const os_1 = __nccwpck_require__(22037); -const path_1 = __nccwpck_require__(71017); -const homeDirCache = {}; -const getHomeDirCacheKey = () => { - if (process && process.geteuid) { - return `${process.geteuid()}`; - } - return "DEFAULT"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); }; -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]; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AccessDeniedException: () => AccessDeniedException, + AuthorizationPendingException: () => AuthorizationPendingException, + CreateTokenCommand: () => CreateTokenCommand, + CreateTokenRequestFilterSensitiveLog: () => CreateTokenRequestFilterSensitiveLog, + CreateTokenResponseFilterSensitiveLog: () => CreateTokenResponseFilterSensitiveLog, + CreateTokenWithIAMCommand: () => CreateTokenWithIAMCommand, + CreateTokenWithIAMRequestFilterSensitiveLog: () => CreateTokenWithIAMRequestFilterSensitiveLog, + CreateTokenWithIAMResponseFilterSensitiveLog: () => CreateTokenWithIAMResponseFilterSensitiveLog, + ExpiredTokenException: () => ExpiredTokenException, + InternalServerException: () => InternalServerException, + InvalidClientException: () => InvalidClientException, + InvalidClientMetadataException: () => InvalidClientMetadataException, + InvalidGrantException: () => InvalidGrantException, + InvalidRequestException: () => InvalidRequestException, + InvalidRequestRegionException: () => InvalidRequestRegionException, + InvalidScopeException: () => InvalidScopeException, + RegisterClientCommand: () => RegisterClientCommand, + RegisterClientResponseFilterSensitiveLog: () => RegisterClientResponseFilterSensitiveLog, + SSOOIDC: () => SSOOIDC, + SSOOIDCClient: () => SSOOIDCClient, + SSOOIDCServiceException: () => SSOOIDCServiceException, + SlowDownException: () => SlowDownException, + StartDeviceAuthorizationCommand: () => StartDeviceAuthorizationCommand, + StartDeviceAuthorizationRequestFilterSensitiveLog: () => StartDeviceAuthorizationRequestFilterSensitiveLog, + UnauthorizedClientException: () => UnauthorizedClientException, + UnsupportedGrantTypeException: () => UnsupportedGrantTypeException, + __Client: () => import_smithy_client.Client +}); +module.exports = __toCommonJS(src_exports); + +// src/SSOOIDCClient.ts +var import_middleware_host_header = __nccwpck_require__(2545); +var import_middleware_logger = __nccwpck_require__(14); +var import_middleware_recursion_detection = __nccwpck_require__(5525); +var import_middleware_user_agent = __nccwpck_require__(4688); +var import_config_resolver = __nccwpck_require__(3098); +var import_core = __nccwpck_require__(5829); +var import_middleware_content_length = __nccwpck_require__(2800); +var import_middleware_endpoint = __nccwpck_require__(2918); +var import_middleware_retry = __nccwpck_require__(6039); + +var import_httpAuthSchemeProvider = __nccwpck_require__(4163); + +// src/endpoint/EndpointParameters.ts +var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "sso-oauth" + }; +}, "resolveClientEndpointParameters"); +var commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } +}; + +// src/SSOOIDCClient.ts +var import_runtimeConfig = __nccwpck_require__(5524); + +// src/runtimeExtensions.ts +var import_region_config_resolver = __nccwpck_require__(8156); +var import_protocol_http = __nccwpck_require__(3781); +var import_smithy_client = __nccwpck_require__(3570); + +// src/auth/httpAuthExtensionConfiguration.ts +var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((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; + } + }; +}, "getHttpAuthExtensionConfiguration"); +var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; +}, "resolveHttpAuthRuntimeConfig"); + +// src/runtimeExtensions.ts +var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial"); +var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { + const extensionConfiguration = { + ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)), + ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)) + }; + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return { + ...runtimeConfig, + ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), + ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), + ...resolveHttpAuthRuntimeConfig(extensionConfiguration) + }; +}, "resolveRuntimeExtensions"); + +// src/SSOOIDCClient.ts +var _SSOOIDCClient = class _SSOOIDCClient extends import_smithy_client.Client { + constructor(...[configuration]) { + const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1); + const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2); + const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3); + const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5); + const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); + this.middlewareStack.use( + (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, { + httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(), + identityProviderConfigProvider: this.getIdentityProviderConfigProvider() + }) + ); + this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config)); + } + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy() { + super.destroy(); + } + getDefaultHttpAuthSchemeParametersProvider() { + return import_httpAuthSchemeProvider.defaultSSOOIDCHttpAuthSchemeParametersProvider; + } + getIdentityProviderConfigProvider() { + return async (config) => new import_core.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials + }); + } }; -exports.getHomeDir = getHomeDir; +__name(_SSOOIDCClient, "SSOOIDCClient"); +var SSOOIDCClient = _SSOOIDCClient; +// src/SSOOIDC.ts -/***/ }), -/***/ 32041: -/***/ ((__unused_webpack_module, exports) => { +// src/commands/CreateTokenCommand.ts -"use strict"; +var import_middleware_serde = __nccwpck_require__(1238); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getProfileData = void 0; -const profileKeyRegex = /^profile\s(["'])?([^\1]+)\1$/; -const getProfileData = (data) => Object.entries(data) - .filter(([key]) => profileKeyRegex.test(key)) - .reduce((acc, [key, value]) => ({ ...acc, [profileKeyRegex.exec(key)[2]]: value }), { - ...(data.default && { default: data.default }), -}); -exports.getProfileData = getProfileData; +var import_types = __nccwpck_require__(6206); +// src/models/models_0.ts -/***/ }), -/***/ 52802: -/***/ ((__unused_webpack_module, exports) => { +// src/models/SSOOIDCServiceException.ts -"use strict"; +var _SSOOIDCServiceException = class _SSOOIDCServiceException extends import_smithy_client.ServiceException { + /** + * @internal + */ + constructor(options) { + super(options); + Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype); + } +}; +__name(_SSOOIDCServiceException, "SSOOIDCServiceException"); +var SSOOIDCServiceException = _SSOOIDCServiceException; + +// src/models/models_0.ts +var _AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts + }); + this.name = "AccessDeniedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _AccessDeniedException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_AccessDeniedException, "AccessDeniedException"); +var AccessDeniedException = _AccessDeniedException; +var _AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "AuthorizationPendingException", + $fault: "client", + ...opts + }); + this.name = "AuthorizationPendingException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _AuthorizationPendingException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_AuthorizationPendingException, "AuthorizationPendingException"); +var AuthorizationPendingException = _AuthorizationPendingException; +var _ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts + }); + this.name = "ExpiredTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ExpiredTokenException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_ExpiredTokenException, "ExpiredTokenException"); +var ExpiredTokenException = _ExpiredTokenException; +var _InternalServerException = class _InternalServerException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts + }); + this.name = "InternalServerException"; + this.$fault = "server"; + Object.setPrototypeOf(this, _InternalServerException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_InternalServerException, "InternalServerException"); +var InternalServerException = _InternalServerException; +var _InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidClientException", + $fault: "client", + ...opts + }); + this.name = "InvalidClientException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_InvalidClientException, "InvalidClientException"); +var InvalidClientException = _InvalidClientException; +var _InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidGrantException", + $fault: "client", + ...opts + }); + this.name = "InvalidGrantException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidGrantException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_InvalidGrantException, "InvalidGrantException"); +var InvalidGrantException = _InvalidGrantException; +var _InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts + }); + this.name = "InvalidRequestException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidRequestException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_InvalidRequestException, "InvalidRequestException"); +var InvalidRequestException = _InvalidRequestException; +var _InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidScopeException", + $fault: "client", + ...opts + }); + this.name = "InvalidScopeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidScopeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_InvalidScopeException, "InvalidScopeException"); +var InvalidScopeException = _InvalidScopeException; +var _SlowDownException = class _SlowDownException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "SlowDownException", + $fault: "client", + ...opts + }); + this.name = "SlowDownException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _SlowDownException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_SlowDownException, "SlowDownException"); +var SlowDownException = _SlowDownException; +var _UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnauthorizedClientException", + $fault: "client", + ...opts + }); + this.name = "UnauthorizedClientException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnauthorizedClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_UnauthorizedClientException, "UnauthorizedClientException"); +var UnauthorizedClientException = _UnauthorizedClientException; +var _UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnsupportedGrantTypeException", + $fault: "client", + ...opts + }); + this.name = "UnsupportedGrantTypeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_UnsupportedGrantTypeException, "UnsupportedGrantTypeException"); +var UnsupportedGrantTypeException = _UnsupportedGrantTypeException; +var _InvalidRequestRegionException = class _InvalidRequestRegionException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidRequestRegionException", + $fault: "client", + ...opts + }); + this.name = "InvalidRequestRegionException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidRequestRegionException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + this.endpoint = opts.endpoint; + this.region = opts.region; + } +}; +__name(_InvalidRequestRegionException, "InvalidRequestRegionException"); +var InvalidRequestRegionException = _InvalidRequestRegionException; +var _InvalidClientMetadataException = class _InvalidClientMetadataException extends SSOOIDCServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidClientMetadataException", + $fault: "client", + ...opts + }); + this.name = "InvalidClientMetadataException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidClientMetadataException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +__name(_InvalidClientMetadataException, "InvalidClientMetadataException"); +var InvalidClientMetadataException = _InvalidClientMetadataException; +var CreateTokenRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING }, + ...obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING } +}), "CreateTokenRequestFilterSensitiveLog"); +var CreateTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }, + ...obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING }, + ...obj.idToken && { idToken: import_smithy_client.SENSITIVE_STRING } +}), "CreateTokenResponseFilterSensitiveLog"); +var CreateTokenWithIAMRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING }, + ...obj.assertion && { assertion: import_smithy_client.SENSITIVE_STRING }, + ...obj.subjectToken && { subjectToken: import_smithy_client.SENSITIVE_STRING } +}), "CreateTokenWithIAMRequestFilterSensitiveLog"); +var CreateTokenWithIAMResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }, + ...obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING }, + ...obj.idToken && { idToken: import_smithy_client.SENSITIVE_STRING } +}), "CreateTokenWithIAMResponseFilterSensitiveLog"); +var RegisterClientResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING } +}), "RegisterClientResponseFilterSensitiveLog"); +var StartDeviceAuthorizationRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING } +}), "StartDeviceAuthorizationRequestFilterSensitiveLog"); + +// src/protocols/Aws_restJson1.ts + + +var se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context) => { + const b = (0, import_core.requestBuilder)(input, context); + const headers = { + "content-type": "application/json" + }; + b.bp("/token"); + let body; + body = JSON.stringify( + (0, import_smithy_client.take)(input, { + clientId: [], + clientSecret: [], + code: [], + deviceCode: [], + grantType: [], + redirectUri: [], + refreshToken: [], + scope: (_) => (0, import_smithy_client._json)(_) + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}, "se_CreateTokenCommand"); +var se_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (input, context) => { + const b = (0, import_core.requestBuilder)(input, context); + const headers = { + "content-type": "application/json" + }; + b.bp("/token"); + const query = (0, import_smithy_client.map)({ + [_ai]: [, "t"] + }); + let body; + body = JSON.stringify( + (0, import_smithy_client.take)(input, { + assertion: [], + clientId: [], + code: [], + grantType: [], + redirectUri: [], + refreshToken: [], + requestedTokenType: [], + scope: (_) => (0, import_smithy_client._json)(_), + subjectToken: [], + subjectTokenType: [] + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}, "se_CreateTokenWithIAMCommand"); +var se_RegisterClientCommand = /* @__PURE__ */ __name(async (input, context) => { + const b = (0, import_core.requestBuilder)(input, context); + const headers = { + "content-type": "application/json" + }; + b.bp("/client/register"); + let body; + body = JSON.stringify( + (0, import_smithy_client.take)(input, { + clientName: [], + clientType: [], + scopes: (_) => (0, import_smithy_client._json)(_) + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}, "se_RegisterClientCommand"); +var se_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (input, context) => { + const b = (0, import_core.requestBuilder)(input, context); + const headers = { + "content-type": "application/json" + }; + b.bp("/device_authorization"); + let body; + body = JSON.stringify( + (0, import_smithy_client.take)(input, { + clientId: [], + clientSecret: [], + startUrl: [] + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}, "se_StartDeviceAuthorizationCommand"); +var de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = (0, import_smithy_client.map)({ + $metadata: deserializeMetadata(output) + }); + const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, import_smithy_client.take)(data, { + accessToken: import_smithy_client.expectString, + expiresIn: import_smithy_client.expectInt32, + idToken: import_smithy_client.expectString, + refreshToken: import_smithy_client.expectString, + tokenType: import_smithy_client.expectString + }); + Object.assign(contents, doc); + return contents; +}, "de_CreateTokenCommand"); +var de_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = (0, import_smithy_client.map)({ + $metadata: deserializeMetadata(output) + }); + const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, import_smithy_client.take)(data, { + accessToken: import_smithy_client.expectString, + expiresIn: import_smithy_client.expectInt32, + idToken: import_smithy_client.expectString, + issuedTokenType: import_smithy_client.expectString, + refreshToken: import_smithy_client.expectString, + scope: import_smithy_client._json, + tokenType: import_smithy_client.expectString + }); + Object.assign(contents, doc); + return contents; +}, "de_CreateTokenWithIAMCommand"); +var de_RegisterClientCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = (0, import_smithy_client.map)({ + $metadata: deserializeMetadata(output) + }); + const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, import_smithy_client.take)(data, { + authorizationEndpoint: import_smithy_client.expectString, + clientId: import_smithy_client.expectString, + clientIdIssuedAt: import_smithy_client.expectLong, + clientSecret: import_smithy_client.expectString, + clientSecretExpiresAt: import_smithy_client.expectLong, + tokenEndpoint: import_smithy_client.expectString + }); + Object.assign(contents, doc); + return contents; +}, "de_RegisterClientCommand"); +var de_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = (0, import_smithy_client.map)({ + $metadata: deserializeMetadata(output) + }); + const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, import_smithy_client.take)(data, { + deviceCode: import_smithy_client.expectString, + expiresIn: import_smithy_client.expectInt32, + interval: import_smithy_client.expectInt32, + userCode: import_smithy_client.expectString, + verificationUri: import_smithy_client.expectString, + verificationUriComplete: import_smithy_client.expectString + }); + Object.assign(contents, doc); + return contents; +}, "de_StartDeviceAuthorizationCommand"); +var de_CommandError = /* @__PURE__ */ __name(async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context) + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.ssooidc#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "AuthorizationPendingException": + case "com.amazonaws.ssooidc#AuthorizationPendingException": + throw await de_AuthorizationPendingExceptionRes(parsedOutput, context); + case "ExpiredTokenException": + case "com.amazonaws.ssooidc#ExpiredTokenException": + throw await de_ExpiredTokenExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "InvalidClientException": + case "com.amazonaws.ssooidc#InvalidClientException": + throw await de_InvalidClientExceptionRes(parsedOutput, context); + case "InvalidGrantException": + case "com.amazonaws.ssooidc#InvalidGrantException": + throw await de_InvalidGrantExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "InvalidScopeException": + case "com.amazonaws.ssooidc#InvalidScopeException": + throw await de_InvalidScopeExceptionRes(parsedOutput, context); + case "SlowDownException": + case "com.amazonaws.ssooidc#SlowDownException": + throw await de_SlowDownExceptionRes(parsedOutput, context); + case "UnauthorizedClientException": + case "com.amazonaws.ssooidc#UnauthorizedClientException": + throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + case "UnsupportedGrantTypeException": + case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": + throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context); + case "InvalidRequestRegionException": + case "com.amazonaws.ssooidc#InvalidRequestRegionException": + throw await de_InvalidRequestRegionExceptionRes(parsedOutput, context); + case "InvalidClientMetadataException": + case "com.amazonaws.ssooidc#InvalidClientMetadataException": + throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode + }); + } +}, "de_CommandError"); +var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOOIDCServiceException); +var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_AccessDeniedExceptionRes"); +var de_AuthorizationPendingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new AuthorizationPendingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_AuthorizationPendingExceptionRes"); +var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new ExpiredTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_ExpiredTokenExceptionRes"); +var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_InternalServerExceptionRes"); +var de_InvalidClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new InvalidClientException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_InvalidClientExceptionRes"); +var de_InvalidClientMetadataExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new InvalidClientMetadataException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_InvalidClientMetadataExceptionRes"); +var de_InvalidGrantExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new InvalidGrantException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_InvalidGrantExceptionRes"); +var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new InvalidRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_InvalidRequestExceptionRes"); +var de_InvalidRequestRegionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + endpoint: import_smithy_client.expectString, + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString, + region: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new InvalidRequestRegionException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_InvalidRequestRegionExceptionRes"); +var de_InvalidScopeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new InvalidScopeException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_InvalidScopeExceptionRes"); +var de_SlowDownExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new SlowDownException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_SlowDownExceptionRes"); +var de_UnauthorizedClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new UnauthorizedClientException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_UnauthorizedClientExceptionRes"); +var de_UnsupportedGrantTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + error: import_smithy_client.expectString, + error_description: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new UnsupportedGrantTypeException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_UnsupportedGrantTypeExceptionRes"); +var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] +}), "deserializeMetadata"); +var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString"); +var _ai = "aws_iam"; +var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}), "parseBody"); +var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}, "parseErrorBody"); +var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => { + const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey"); + const sanitizeErrorCode = /* @__PURE__ */ __name((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; + }, "sanitizeErrorCode"); + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== void 0) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== void 0) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== void 0) { + return sanitizeErrorCode(data["__type"]); + } +}, "loadRestJsonErrorCode"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getProfileName = exports.DEFAULT_PROFILE = exports.ENV_PROFILE = void 0; -exports.ENV_PROFILE = "AWS_PROFILE"; -exports.DEFAULT_PROFILE = "default"; -const getProfileName = (init) => init.profile || process.env[exports.ENV_PROFILE] || exports.DEFAULT_PROFILE; -exports.getProfileName = getProfileName; +// src/commands/CreateTokenCommand.ts +var _CreateTokenCommand = class _CreateTokenCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build() { +}; +__name(_CreateTokenCommand, "CreateTokenCommand"); +var CreateTokenCommand = _CreateTokenCommand; +// src/commands/CreateTokenWithIAMCommand.ts -/***/ }), -/***/ 24740: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSSOTokenFilepath = void 0; -const crypto_1 = __nccwpck_require__(6113); -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(68340); -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`); +var _CreateTokenWithIAMCommand = class _CreateTokenWithIAMCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSSOOIDCService", "CreateTokenWithIAM", {}).n("SSOOIDCClient", "CreateTokenWithIAMCommand").f(CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog).ser(se_CreateTokenWithIAMCommand).de(de_CreateTokenWithIAMCommand).build() { }; -exports.getSSOTokenFilepath = getSSOTokenFilepath; +__name(_CreateTokenWithIAMCommand, "CreateTokenWithIAMCommand"); +var CreateTokenWithIAMCommand = _CreateTokenWithIAMCommand; +// src/commands/RegisterClientCommand.ts -/***/ }), -/***/ 69678: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSSOTokenFromFile = void 0; -const fs_1 = __nccwpck_require__(57147); -const getSSOTokenFilepath_1 = __nccwpck_require__(24740); -const { readFile } = fs_1.promises; -const getSSOTokenFromFile = async (id) => { - const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); - const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); +var _RegisterClientCommand = class _RegisterClientCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSSOOIDCService", "RegisterClient", {}).n("SSOOIDCClient", "RegisterClientCommand").f(void 0, RegisterClientResponseFilterSensitiveLog).ser(se_RegisterClientCommand).de(de_RegisterClientCommand).build() { }; -exports.getSSOTokenFromFile = getSSOTokenFromFile; +__name(_RegisterClientCommand, "RegisterClientCommand"); +var RegisterClientCommand = _RegisterClientCommand; +// src/commands/StartDeviceAuthorizationCommand.ts -/***/ }), -/***/ 82820: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSsoSessionData = void 0; -const ssoSessionKeyRegex = /^sso-session\s(["'])?([^\1]+)\1$/; -const getSsoSessionData = (data) => Object.entries(data) - .filter(([key]) => ssoSessionKeyRegex.test(key)) - .reduce((acc, [key, value]) => ({ ...acc, [ssoSessionKeyRegex.exec(key)[2]]: value }), {}); -exports.getSsoSessionData = getSsoSessionData; +var _StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSSOOIDCService", "StartDeviceAuthorization", {}).n("SSOOIDCClient", "StartDeviceAuthorizationCommand").f(StartDeviceAuthorizationRequestFilterSensitiveLog, void 0).ser(se_StartDeviceAuthorizationCommand).de(de_StartDeviceAuthorizationCommand).build() { +}; +__name(_StartDeviceAuthorizationCommand, "StartDeviceAuthorizationCommand"); +var StartDeviceAuthorizationCommand = _StartDeviceAuthorizationCommand; + +// src/SSOOIDC.ts +var commands = { + CreateTokenCommand, + CreateTokenWithIAMCommand, + RegisterClientCommand, + StartDeviceAuthorizationCommand +}; +var _SSOOIDC = class _SSOOIDC extends SSOOIDCClient { +}; +__name(_SSOOIDC, "SSOOIDC"); +var SSOOIDC = _SSOOIDC; +(0, import_smithy_client.createAggregatedClient)(commands, SSOOIDC); + +// src/index.ts +var import_util_endpoints = __nccwpck_require__(3350); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 43507: +/***/ 5524: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRuntimeConfig = void 0; const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(68340), exports); -tslib_1.__exportStar(__nccwpck_require__(52802), exports); -tslib_1.__exportStar(__nccwpck_require__(24740), exports); -tslib_1.__exportStar(__nccwpck_require__(69678), exports); -tslib_1.__exportStar(__nccwpck_require__(41879), exports); -tslib_1.__exportStar(__nccwpck_require__(34649), exports); -tslib_1.__exportStar(__nccwpck_require__(2546), exports); -tslib_1.__exportStar(__nccwpck_require__(63191), exports); +const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(9722)); +const credentialDefaultProvider_1 = __nccwpck_require__(118); +const core_1 = __nccwpck_require__(9963); +const util_user_agent_node_1 = __nccwpck_require__(8095); +const config_resolver_1 = __nccwpck_require__(3098); +const hash_node_1 = __nccwpck_require__(3081); +const middleware_retry_1 = __nccwpck_require__(6039); +const node_config_provider_1 = __nccwpck_require__(3461); +const node_http_handler_1 = __nccwpck_require__(7202); +const util_body_length_node_1 = __nccwpck_require__(8075); +const util_retry_1 = __nccwpck_require__(4902); +const runtimeConfig_shared_1 = __nccwpck_require__(8005); +const smithy_client_1 = __nccwpck_require__(3570); +const util_defaults_mode_node_1 = __nccwpck_require__(2429); +const smithy_client_2 = __nccwpck_require__(3570); +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); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider_1.defaultProvider, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.defaultUserAgent)({ 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), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + 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, + }), + 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), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 41879: +/***/ 8005: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadSharedConfigFiles = void 0; -const getConfigFilepath_1 = __nccwpck_require__(47237); -const getCredentialsFilepath_1 = __nccwpck_require__(99036); -const getProfileData_1 = __nccwpck_require__(32041); -const parseIni_1 = __nccwpck_require__(54262); -const slurpFile_1 = __nccwpck_require__(19155); -const swallowError = () => ({}); -const loadSharedConfigFiles = async (init = {}) => { - const { filepath = (0, getCredentialsFilepath_1.getCredentialsFilepath)(), configFilepath = (0, getConfigFilepath_1.getConfigFilepath)() } = init; - const parsedFiles = await Promise.all([ - (0, slurpFile_1.slurpFile)(configFilepath, { - ignoreCache: init.ignoreCache, - }) - .then(parseIni_1.parseIni) - .then(getProfileData_1.getProfileData) - .catch(swallowError), - (0, slurpFile_1.slurpFile)(filepath, { - ignoreCache: init.ignoreCache, - }) - .then(parseIni_1.parseIni) - .catch(swallowError), +exports.getRuntimeConfig = void 0; +const core_1 = __nccwpck_require__(9963); +const core_2 = __nccwpck_require__(5829); +const smithy_client_1 = __nccwpck_require__(3570); +const url_parser_1 = __nccwpck_require__(4681); +const util_base64_1 = __nccwpck_require__(5600); +const util_utf8_1 = __nccwpck_require__(1895); +const httpAuthSchemeProvider_1 = __nccwpck_require__(4163); +const endpointResolver_1 = __nccwpck_require__(7604); +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.defaultSSOOIDCHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new core_1.AwsSdkSigV4Signer(), + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new core_2.NoAuthSigner(), + }, + ], + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + serviceId: config?.serviceId ?? "SSO OIDC", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; + + +/***/ }), + +/***/ 7202: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, + NodeHttp2Handler: () => NodeHttp2Handler, + NodeHttpHandler: () => NodeHttpHandler, + streamCollector: () => streamCollector +}); +module.exports = __toCommonJS(src_exports); + +// src/node-http-handler.ts +var import_protocol_http = __nccwpck_require__(3781); +var import_querystring_builder = __nccwpck_require__(6006); +var import_http = __nccwpck_require__(3685); +var import_https = __nccwpck_require__(5687); + +// src/constants.ts +var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +// src/get-transformed-headers.ts +var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}, "getTransformedHeaders"); + +// src/set-connection-timeout.ts +var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject( + Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError" + }) + ); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } else { + clearTimeout(timeoutId); + } + }); +}, "setConnectionTimeout"); + +// src/set-socket-keep-alive.ts +var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}, "setSocketKeepAlive"); + +// src/set-socket-timeout.ts +var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}, "setSocketTimeout"); + +// src/write-request-body.ts +var import_stream = __nccwpck_require__(2781); +var MIN_WAIT_TIME = 1e3; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + const headers = request.headers ?? {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }) ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } +} +__name(writeRequestBody, "writeRequestBody"); +function writeBody(httpRequest, body) { + if (body instanceof import_stream.Readable) { + body.pipe(httpRequest); + } else if (body) { + httpRequest.end(Buffer.from(body)); + } else { + httpRequest.end(); + } +} +__name(writeBody, "writeBody"); + +// src/node-http-handler.ts +var DEFAULT_REQUEST_TIMEOUT = 0; +var _NodeHttpHandler = class _NodeHttpHandler { + constructor(options) { + this.socketWarningTimestamp = 0; + // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286 + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttpHandler(instanceOrOptions); + } + /** + * @internal + * + * @param agent - http(s) agent in use by the NodeHttpHandler instance. + * @returns timestamp of last emitted warning. + */ + static checkSocketUsage(agent, socketWarningTimestamp) { + var _a, _b; + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; + const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + console.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; + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1], + connectionTimeout, + requestTimeout: requestTimeout ?? socketTimeout, + httpAgent: (() => { + if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { + return httpAgent; + } + return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { + return httpsAgent; + } + return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })() }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); + (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + let socketCheckTimeoutId; + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + clearTimeout(socketCheckTimeoutId); + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; + socketCheckTimeoutId = setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp); + }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)); + const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); + let auth = void 0; + 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}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent, + auth + }; + const requestFunc = isSSL ? import_https.request : import_http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new import_protocol_http.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); + } + }); + setConnectionTimeout(req, reject, this.config.connectionTimeout); + setSocketTimeout(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + setSocketKeepAlive(req, { + // @ts-expect-error keepAlive is not public on httpAgent. + keepAlive: httpAgent.keepAlive, + // @ts-expect-error keepAliveMsecs is not public on httpAgent. + keepAliveMsecs: httpAgent.keepAliveMsecs + }); + } + writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } }; -exports.loadSharedConfigFiles = loadSharedConfigFiles; +__name(_NodeHttpHandler, "NodeHttpHandler"); +var NodeHttpHandler = _NodeHttpHandler; +// src/node-http2-handler.ts -/***/ }), -/***/ 34649: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var import_http22 = __nccwpck_require__(5158); -"use strict"; +// src/node-http2-connection-manager.ts +var import_http2 = __toESM(__nccwpck_require__(5158)); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadSsoSessionData = void 0; -const getConfigFilepath_1 = __nccwpck_require__(47237); -const getSsoSessionData_1 = __nccwpck_require__(82820); -const parseIni_1 = __nccwpck_require__(54262); -const slurpFile_1 = __nccwpck_require__(19155); -const swallowError = () => ({}); -const loadSsoSessionData = async (init = {}) => { - var _a; - return (0, slurpFile_1.slurpFile)((_a = init.configFilepath) !== null && _a !== void 0 ? _a : (0, getConfigFilepath_1.getConfigFilepath)()) - .then(parseIni_1.parseIni) - .then(getSsoSessionData_1.getSsoSessionData) - .catch(swallowError); +// src/node-http2-connection-pool.ts +var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); + } + } + offerLast(session) { + this.sessions.push(session); + } + contains(session) { + return this.sessions.includes(session); + } + remove(session) { + this.sessions = this.sessions.filter((s) => s !== session); + } + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); + } + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); + } + } + } + } }; -exports.loadSsoSessionData = loadSsoSessionData; - +__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); +var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; -/***/ }), - -/***/ 19447: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.mergeConfigFiles = void 0; -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; - } +// src/node-http2-connection-manager.ts +var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = /* @__PURE__ */ new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + lease(requestContext, connectionConfiguration) { + const 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 = import_http2.default.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 = /* @__PURE__ */ __name(() => { + session.destroy(); + this.deleteSession(url, session); + }, "destroySessionCb"); + 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; + } + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; + } + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); } + connectionPool.remove(session); + } + this.sessionCache.delete(key); + } + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); } - return merged; + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } }; -exports.mergeConfigFiles = mergeConfigFiles; - - -/***/ }), - -/***/ 54262: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseIni = void 0; -const profileNameBlockList = ["__proto__", "profile __proto__"]; -const parseIni = (iniData) => { - const map = {}; - let currentSection; - for (let line of iniData.split(/\r?\n/)) { - line = line.split(/(^|\s)[;#]/)[0].trim(); - const isSection = line[0] === "[" && line[line.length - 1] === "]"; - if (isSection) { - currentSection = line.substring(1, line.length - 1); - if (profileNameBlockList.includes(currentSection)) { - throw new Error(`Found invalid profile name "${currentSection}"`); - } +__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); +var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; + +// src/node-http2-handler.ts +var _NodeHttp2Handler = class _NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttp2Handler(instanceOrOptions); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } + } + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a; + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (abortSignal == null ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = 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: (_a = this.config) == null ? void 0 : _a.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = /* @__PURE__ */ __name((err) => { + if (disableConcurrentStreams) { + this.destroySession(session); } - else if (currentSection) { - const indexOfEqualsSign = line.indexOf("="); - const start = 0; - const end = line.length - 1; - const isAssignment = indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; - if (isAssignment) { - const [name, value] = [ - line.substring(0, indexOfEqualsSign).trim(), - line.substring(indexOfEqualsSign + 1).trim(), - ]; - map[currentSection] = map[currentSection] || {}; - map[currentSection][name] = value; - } + fulfilled = true; + reject(err); + }, "rejectWithDestroy"); + const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [import_http22.constants.HTTP2_HEADER_PATH]: path, + [import_http22.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new import_protocol_http.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + 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, requestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + /** + * Destroys a session. + * @param session The session to destroy. + */ + destroySession(session) { + if (!session.destroyed) { + session.destroy(); } - return map; + } }; -exports.parseIni = parseIni; +__name(_NodeHttp2Handler, "NodeHttp2Handler"); +var NodeHttp2Handler = _NodeHttp2Handler; +// src/stream-collector/collector.ts -/***/ }), +var _Collector = class _Collector extends import_stream.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +}; +__name(_Collector, "Collector"); +var Collector = _Collector; -/***/ 2546: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/stream-collector/index.ts +var streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}), "streamCollector"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKnownFiles = void 0; -const loadSharedConfigFiles_1 = __nccwpck_require__(41879); -const mergeConfigFiles_1 = __nccwpck_require__(19447); -const parseKnownFiles = async (init) => { - const parsedFiles = await (0, loadSharedConfigFiles_1.loadSharedConfigFiles)(init); - return (0, mergeConfigFiles_1.mergeConfigFiles)(parsedFiles.configFile, parsedFiles.credentialsFile); -}; -exports.parseKnownFiles = parseKnownFiles; /***/ }), -/***/ 19155: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3781: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.slurpFile = void 0; -const fs_1 = __nccwpck_require__(57147); -const { readFile } = fs_1.promises; -const filePromisesHash = {}; -const slurpFile = (path, options) => { - if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) { - filePromisesHash[path] = readFile(path, "utf8"); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); } - return filePromisesHash[path]; + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(6206); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } }; -exports.slurpFile = slurpFile; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 63191: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 39733: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 6006: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SignatureV4 = void 0; -const eventstream_codec_1 = __nccwpck_require__(56459); -const util_hex_encoding_1 = __nccwpck_require__(45364); -const util_middleware_1 = __nccwpck_require__(2390); -const util_utf8_1 = __nccwpck_require__(41895); -const constants_1 = __nccwpck_require__(48644); -const credentialDerivation_1 = __nccwpck_require__(19623); -const getCanonicalHeaders_1 = __nccwpck_require__(51393); -const getCanonicalQuery_1 = __nccwpck_require__(33243); -const getPayloadHash_1 = __nccwpck_require__(48545); -const headerUtil_1 = __nccwpck_require__(62179); -const moveHeadersToQuery_1 = __nccwpck_require__(49828); -const prepareRequest_1 = __nccwpck_require__(60075); -const utilDate_1 = __nccwpck_require__(39299); -class SignatureV4 { - constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { - this.headerMarshaller = new eventstream_codec_1.HeaderMarshaller(util_utf8_1.toUtf8, util_utf8_1.fromUtf8); - this.service = service; - this.sha256 = sha256; - this.uriEscapePath = uriEscapePath; - this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; - this.regionProvider = (0, util_middleware_1.normalizeProvider)(region); - this.credentialProvider = (0, util_middleware_1.normalizeProvider)(credentials); - } - async presign(originalRequest, options = {}) { - const { signingDate = new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, signingRegion, signingService, } = options; - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { longDate, shortDate } = formatDate(signingDate); - if (expiresIn > constants_1.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 = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - const request = (0, moveHeadersToQuery_1.moveHeadersToQuery)((0, prepareRequest_1.prepareRequest)(originalRequest), { unhoistableHeaders }); - if (credentials.sessionToken) { - request.query[constants_1.TOKEN_QUERY_PARAM] = credentials.sessionToken; - } - request.query[constants_1.ALGORITHM_QUERY_PARAM] = constants_1.ALGORITHM_IDENTIFIER; - request.query[constants_1.CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; - request.query[constants_1.AMZ_DATE_QUERY_PARAM] = longDate; - request.query[constants_1.EXPIRES_QUERY_PARAM] = expiresIn.toString(10); - const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); - request.query[constants_1.SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); - request.query[constants_1.SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await (0, getPayloadHash_1.getPayloadHash)(originalRequest, this.sha256))); - return request; - } - async sign(toSign, options) { - if (typeof toSign === "string") { - return this.signString(toSign, options); - } - else if (toSign.headers && toSign.payload) { - return this.signEvent(toSign, options); - } - else if (toSign.message) { - return this.signMessage(toSign, options); - } - else { - return this.signRequest(toSign, options); - } - } - async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) { - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { shortDate, longDate } = formatDate(signingDate); - const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - const hashedPayload = await (0, getPayloadHash_1.getPayloadHash)({ headers: {}, body: payload }, this.sha256); - const hash = new this.sha256(); - hash.update(headers); - const hashedHeaders = (0, util_hex_encoding_1.toHex)(await hash.digest()); - const stringToSign = [ - constants_1.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.headerMarshaller.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 !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { shortDate } = formatDate(signingDate); - const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); - hash.update((0, util_utf8_1.toUint8Array)(stringToSign)); - return (0, util_hex_encoding_1.toHex)(await hash.digest()); - } - async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const request = (0, prepareRequest_1.prepareRequest)(requestToSign); - const { longDate, shortDate } = formatDate(signingDate); - const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - request.headers[constants_1.AMZ_DATE_HEADER] = longDate; - if (credentials.sessionToken) { - request.headers[constants_1.TOKEN_HEADER] = credentials.sessionToken; - } - const payloadHash = await (0, getPayloadHash_1.getPayloadHash)(request, this.sha256); - if (!(0, headerUtil_1.hasHeader)(constants_1.SHA256_HEADER, request.headers) && this.applyChecksum) { - request.headers[constants_1.SHA256_HEADER] = payloadHash; - } - const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); - const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); - request.headers[constants_1.AUTH_HEADER] = - `${constants_1.ALGORITHM_IDENTIFIER} ` + - `Credential=${credentials.accessKeyId}/${scope}, ` + - `SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, ` + - `Signature=${signature}`; - return request; - } - createCanonicalRequest(request, canonicalHeaders, payloadHash) { - const sortedHeaders = Object.keys(canonicalHeaders).sort(); - return `${request.method} -${this.getCanonicalPath(request)} -${(0, getCanonicalQuery_1.getCanonicalQuery)(request)} -${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -${sortedHeaders.join(";")} -${payloadHash}`; - } - async createStringToSign(longDate, credentialScope, canonicalRequest) { - const hash = new this.sha256(); - hash.update((0, util_utf8_1.toUint8Array)(canonicalRequest)); - const hashedRequest = await hash.digest(); - return `${constants_1.ALGORITHM_IDENTIFIER} -${longDate} -${credentialScope} -${(0, util_hex_encoding_1.toHex)(hashedRequest)}`; - } - getCanonicalPath({ path }) { - if (this.uriEscapePath) { - const normalizedPathSegments = []; - for (const pathSegment of path.split("/")) { - if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0) - continue; - if (pathSegment === ".") - continue; - if (pathSegment === "..") { - normalizedPathSegments.pop(); - } - else { - normalizedPathSegments.push(pathSegment); - } - } - const normalizedPath = `${(path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : ""}`; - const doubleEncoded = encodeURIComponent(normalizedPath); - return doubleEncoded.replace(/%2F/g, "/"); - } - return path; - } - async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { - const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); - const hash = new this.sha256(await keyPromise); - hash.update((0, util_utf8_1.toUint8Array)(stringToSign)); - return (0, util_hex_encoding_1.toHex)(await hash.digest()); - } - getSigningKey(credentials, region, shortDate, service) { - return (0, credentialDerivation_1.getSigningKey)(this.sha256, credentials, shortDate, region, service || this.service); - } - validateResolvedCredentials(credentials) { - if (typeof credentials !== "object" || - typeof credentials.accessKeyId !== "string" || - typeof credentials.secretAccessKey !== "string") { - throw new Error("Resolved credential object is not valid"); - } +// src/index.ts +var src_exports = {}; +__export(src_exports, { + buildQueryString: () => buildQueryString +}); +module.exports = __toCommonJS(src_exports); +var import_util_uri_escape = __nccwpck_require__(3346); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, import_util_uri_escape.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; + } + parts.push(qsEntry); } + } + return parts.join("&"); } -exports.SignatureV4 = SignatureV4; -const formatDate = (now) => { - const longDate = (0, utilDate_1.iso8601)(now).replace(/[\-:]/g, ""); - return { - longDate, - shortDate: longDate.slice(0, 8), - }; -}; -const getCanonicalHeaderList = (headers) => Object.keys(headers).sort().join(";"); +__name(buildQueryString, "buildQueryString"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 6206: +/***/ ((module) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -/***/ }), +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -/***/ 69098: -/***/ ((__unused_webpack_module, exports) => { +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -"use strict"; +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.cloneQuery = exports.cloneRequest = void 0; -const cloneRequest = ({ headers, query, ...rest }) => ({ - ...rest, - headers: { ...headers }, - query: query ? (0, exports.cloneQuery)(query) : undefined, -}); -exports.cloneRequest = cloneRequest; -const cloneQuery = (query) => Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; -}, {}); -exports.cloneQuery = cloneQuery; +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: -/***/ }), +0 && (0); -/***/ 48644: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MAX_PRESIGNED_TTL = exports.KEY_TYPE_IDENTIFIER = exports.MAX_CACHE_SIZE = exports.UNSIGNED_PAYLOAD = exports.EVENT_ALGORITHM_IDENTIFIER = exports.ALGORITHM_IDENTIFIER_V4A = exports.ALGORITHM_IDENTIFIER = exports.UNSIGNABLE_PATTERNS = exports.SEC_HEADER_PATTERN = exports.PROXY_HEADER_PATTERN = exports.ALWAYS_UNSIGNABLE_HEADERS = exports.HOST_HEADER = exports.TOKEN_HEADER = exports.SHA256_HEADER = exports.SIGNATURE_HEADER = exports.GENERATED_HEADERS = exports.DATE_HEADER = exports.AMZ_DATE_HEADER = exports.AUTH_HEADER = exports.REGION_SET_PARAM = exports.TOKEN_QUERY_PARAM = exports.SIGNATURE_QUERY_PARAM = exports.EXPIRES_QUERY_PARAM = exports.SIGNED_HEADERS_QUERY_PARAM = exports.AMZ_DATE_QUERY_PARAM = exports.CREDENTIAL_QUERY_PARAM = exports.ALGORITHM_QUERY_PARAM = void 0; -exports.ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; -exports.CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; -exports.AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; -exports.SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; -exports.EXPIRES_QUERY_PARAM = "X-Amz-Expires"; -exports.SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; -exports.TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; -exports.REGION_SET_PARAM = "X-Amz-Region-Set"; -exports.AUTH_HEADER = "authorization"; -exports.AMZ_DATE_HEADER = exports.AMZ_DATE_QUERY_PARAM.toLowerCase(); -exports.DATE_HEADER = "date"; -exports.GENERATED_HEADERS = [exports.AUTH_HEADER, exports.AMZ_DATE_HEADER, exports.DATE_HEADER]; -exports.SIGNATURE_HEADER = exports.SIGNATURE_QUERY_PARAM.toLowerCase(); -exports.SHA256_HEADER = "x-amz-content-sha256"; -exports.TOKEN_HEADER = exports.TOKEN_QUERY_PARAM.toLowerCase(); -exports.HOST_HEADER = "host"; -exports.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, -}; -exports.PROXY_HEADER_PATTERN = /^proxy-/; -exports.SEC_HEADER_PATTERN = /^sec-/; -exports.UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; -exports.ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; -exports.ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; -exports.EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; -exports.UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; -exports.MAX_CACHE_SIZE = 50; -exports.KEY_TYPE_IDENTIFIER = "aws4_request"; -exports.MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; - - -/***/ }), - -/***/ 19623: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ }), -"use strict"; +/***/ 3346: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.clearCredentialCache = exports.getSigningKey = exports.createScope = void 0; -const util_hex_encoding_1 = __nccwpck_require__(45364); -const util_utf8_1 = __nccwpck_require__(41895); -const constants_1 = __nccwpck_require__(48644); -const signingKeyCache = {}; -const cacheQueue = []; -const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${constants_1.KEY_TYPE_IDENTIFIER}`; -exports.createScope = createScope; -const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { - const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); - const cacheKey = `${shortDate}:${region}:${service}:${(0, util_hex_encoding_1.toHex)(credsHash)}:${credentials.sessionToken}`; - if (cacheKey in signingKeyCache) { - return signingKeyCache[cacheKey]; - } - cacheQueue.push(cacheKey); - while (cacheQueue.length > constants_1.MAX_CACHE_SIZE) { - delete signingKeyCache[cacheQueue.shift()]; - } - let key = `AWS4${credentials.secretAccessKey}`; - for (const signable of [shortDate, region, service, constants_1.KEY_TYPE_IDENTIFIER]) { - key = await hmac(sha256Constructor, key, signable); - } - return (signingKeyCache[cacheKey] = key); -}; -exports.getSigningKey = getSigningKey; -const clearCredentialCache = () => { - cacheQueue.length = 0; - Object.keys(signingKeyCache).forEach((cacheKey) => { - delete signingKeyCache[cacheKey]; - }); -}; -exports.clearCredentialCache = clearCredentialCache; -const hmac = (ctor, secret, data) => { - const hash = new ctor(secret); - hash.update((0, util_utf8_1.toUint8Array)(data)); - return hash.digest(); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; }; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath +}); +module.exports = __toCommonJS(src_exports); -/***/ }), +// src/escape-uri.ts +var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) +), "escapeUri"); +var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); -/***/ 51393: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/escape-uri-path.ts +var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCanonicalHeaders = void 0; -const constants_1 = __nccwpck_require__(48644); -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 constants_1.ALWAYS_UNSIGNABLE_HEADERS || - (unsignableHeaders === null || unsignableHeaders === void 0 ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || - constants_1.PROXY_HEADER_PATTERN.test(canonicalHeaderName) || - constants_1.SEC_HEADER_PATTERN.test(canonicalHeaderName)) { - if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) { - continue; - } - } - canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); - } - return canonical; -}; -exports.getCanonicalHeaders = getCanonicalHeaders; /***/ }), -/***/ 33243: +/***/ 9344: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCanonicalQuery = void 0; -const util_uri_escape_1 = __nccwpck_require__(49617); -const constants_1 = __nccwpck_require__(48644); -const getCanonicalQuery = ({ query = {} }) => { - const keys = []; - const serialized = {}; - for (const key of Object.keys(query).sort()) { - if (key.toLowerCase() === constants_1.SIGNATURE_HEADER) { - continue; +exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0; +const core_1 = __nccwpck_require__(9963); +const util_middleware_1 = __nccwpck_require__(2390); +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`"); + })(), + }; +}; +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; } - keys.push(key); - const value = query[key]; - if (typeof value === "string") { - serialized[key] = `${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`; + case "ListAccountRoles": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + case "ListAccounts": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + case "Logout": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; } - else if (Array.isArray(value)) { - serialized[key] = value - .slice(0) - .sort() - .reduce((encoded, value) => encoded.concat([`${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`]), []) - .join("&"); + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); } } - return keys - .map((key) => serialized[key]) - .filter((serialized) => serialized) - .join("&"); + return options; }; -exports.getCanonicalQuery = getCanonicalQuery; +exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider; +const resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return { + ...config_0, + }; +}; +exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; /***/ }), -/***/ 48545: +/***/ 898: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getPayloadHash = void 0; -const is_array_buffer_1 = __nccwpck_require__(10780); -const util_hex_encoding_1 = __nccwpck_require__(45364); -const util_utf8_1 = __nccwpck_require__(41895); -const constants_1 = __nccwpck_require__(48644); -const getPayloadHash = async ({ headers, body }, hashConstructor) => { - for (const headerName of Object.keys(headers)) { - if (headerName.toLowerCase() === constants_1.SHA256_HEADER) { - return headers[headerName]; - } - } - if (body == undefined) { - return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; - } - else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, is_array_buffer_1.isArrayBuffer)(body)) { - const hashCtor = new hashConstructor(); - hashCtor.update((0, util_utf8_1.toUint8Array)(body)); - return (0, util_hex_encoding_1.toHex)(await hashCtor.digest()); - } - return constants_1.UNSIGNED_PAYLOAD; +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = __nccwpck_require__(5473); +const ruleset_1 = __nccwpck_require__(3341); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); }; -exports.getPayloadHash = getPayloadHash; +exports.defaultEndpointResolver = defaultEndpointResolver; /***/ }), -/***/ 62179: +/***/ 3341: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deleteHeader = exports.getHeaderValue = exports.hasHeader = void 0; -const hasHeader = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return true; - } - } - return false; -}; -exports.hasHeader = hasHeader; -const getHeaderValue = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return headers[headerName]; - } - } - return undefined; -}; -exports.getHeaderValue = getHeaderValue; -const deleteHeader = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - delete headers[headerName]; - } - } -}; -exports.deleteHeader = deleteHeader; +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; /***/ }), -/***/ 11528: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 2666: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.prepareRequest = exports.moveHeadersToQuery = exports.getPayloadHash = exports.getCanonicalQuery = exports.getCanonicalHeaders = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(39733), exports); -var getCanonicalHeaders_1 = __nccwpck_require__(51393); -Object.defineProperty(exports, "getCanonicalHeaders", ({ enumerable: true, get: function () { return getCanonicalHeaders_1.getCanonicalHeaders; } })); -var getCanonicalQuery_1 = __nccwpck_require__(33243); -Object.defineProperty(exports, "getCanonicalQuery", ({ enumerable: true, get: function () { return getCanonicalQuery_1.getCanonicalQuery; } })); -var getPayloadHash_1 = __nccwpck_require__(48545); -Object.defineProperty(exports, "getPayloadHash", ({ enumerable: true, get: function () { return getPayloadHash_1.getPayloadHash; } })); -var moveHeadersToQuery_1 = __nccwpck_require__(49828); -Object.defineProperty(exports, "moveHeadersToQuery", ({ enumerable: true, get: function () { return moveHeadersToQuery_1.moveHeadersToQuery; } })); -var prepareRequest_1 = __nccwpck_require__(60075); -Object.defineProperty(exports, "prepareRequest", ({ enumerable: true, get: function () { return prepareRequest_1.prepareRequest; } })); -tslib_1.__exportStar(__nccwpck_require__(19623), exports); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + GetRoleCredentialsCommand: () => GetRoleCredentialsCommand, + GetRoleCredentialsRequestFilterSensitiveLog: () => GetRoleCredentialsRequestFilterSensitiveLog, + GetRoleCredentialsResponseFilterSensitiveLog: () => GetRoleCredentialsResponseFilterSensitiveLog, + InvalidRequestException: () => InvalidRequestException, + ListAccountRolesCommand: () => ListAccountRolesCommand, + ListAccountRolesRequestFilterSensitiveLog: () => ListAccountRolesRequestFilterSensitiveLog, + ListAccountsCommand: () => ListAccountsCommand, + ListAccountsRequestFilterSensitiveLog: () => ListAccountsRequestFilterSensitiveLog, + LogoutCommand: () => LogoutCommand, + LogoutRequestFilterSensitiveLog: () => LogoutRequestFilterSensitiveLog, + ResourceNotFoundException: () => ResourceNotFoundException, + RoleCredentialsFilterSensitiveLog: () => RoleCredentialsFilterSensitiveLog, + SSO: () => SSO, + SSOClient: () => SSOClient, + SSOServiceException: () => SSOServiceException, + TooManyRequestsException: () => TooManyRequestsException, + UnauthorizedException: () => UnauthorizedException, + __Client: () => import_smithy_client.Client, + paginateListAccountRoles: () => paginateListAccountRoles, + paginateListAccounts: () => paginateListAccounts +}); +module.exports = __toCommonJS(src_exports); + +// src/SSOClient.ts +var import_middleware_host_header = __nccwpck_require__(2545); +var import_middleware_logger = __nccwpck_require__(14); +var import_middleware_recursion_detection = __nccwpck_require__(5525); +var import_middleware_user_agent = __nccwpck_require__(4688); +var import_config_resolver = __nccwpck_require__(3098); +var import_core = __nccwpck_require__(5829); +var import_middleware_content_length = __nccwpck_require__(2800); +var import_middleware_endpoint = __nccwpck_require__(2918); +var import_middleware_retry = __nccwpck_require__(6039); + +var import_httpAuthSchemeProvider = __nccwpck_require__(9344); + +// src/endpoint/EndpointParameters.ts +var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "awsssoportal" + }; +}, "resolveClientEndpointParameters"); +var commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } +}; + +// src/SSOClient.ts +var import_runtimeConfig = __nccwpck_require__(9756); + +// src/runtimeExtensions.ts +var import_region_config_resolver = __nccwpck_require__(8156); +var import_protocol_http = __nccwpck_require__(3555); +var import_smithy_client = __nccwpck_require__(3570); + +// src/auth/httpAuthExtensionConfiguration.ts +var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((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; + } + }; +}, "getHttpAuthExtensionConfiguration"); +var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; +}, "resolveHttpAuthRuntimeConfig"); + +// src/runtimeExtensions.ts +var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial"); +var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { + const extensionConfiguration = { + ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)), + ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)) + }; + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return { + ...runtimeConfig, + ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), + ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), + ...resolveHttpAuthRuntimeConfig(extensionConfiguration) + }; +}, "resolveRuntimeExtensions"); + +// src/SSOClient.ts +var _SSOClient = class _SSOClient extends import_smithy_client.Client { + constructor(...[configuration]) { + const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1); + const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2); + const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3); + const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5); + const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); + this.middlewareStack.use( + (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, { + httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(), + identityProviderConfigProvider: this.getIdentityProviderConfigProvider() + }) + ); + this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config)); + } + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy() { + super.destroy(); + } + getDefaultHttpAuthSchemeParametersProvider() { + return import_httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider; + } + getIdentityProviderConfigProvider() { + return async (config) => new import_core.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials + }); + } +}; +__name(_SSOClient, "SSOClient"); +var SSOClient = _SSOClient; +// src/SSO.ts -/***/ }), -/***/ 49828: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/commands/GetRoleCredentialsCommand.ts -"use strict"; +var import_middleware_serde = __nccwpck_require__(1238); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.moveHeadersToQuery = void 0; -const cloneRequest_1 = __nccwpck_require__(69098); -const moveHeadersToQuery = (request, options = {}) => { - var _a; - const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); - for (const name of Object.keys(headers)) { - const lname = name.toLowerCase(); - if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) === null || _a === void 0 ? void 0 : _a.has(lname))) { - query[name] = headers[name]; - delete headers[name]; - } - } - return { - ...request, - headers, - query, - }; -}; -exports.moveHeadersToQuery = moveHeadersToQuery; +var import_types = __nccwpck_require__(917); +// src/models/models_0.ts -/***/ }), -/***/ 60075: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/models/SSOServiceException.ts -"use strict"; +var _SSOServiceException = class _SSOServiceException extends import_smithy_client.ServiceException { + /** + * @internal + */ + constructor(options) { + super(options); + Object.setPrototypeOf(this, _SSOServiceException.prototype); + } +}; +__name(_SSOServiceException, "SSOServiceException"); +var SSOServiceException = _SSOServiceException; + +// src/models/models_0.ts +var _InvalidRequestException = class _InvalidRequestException extends SSOServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts + }); + this.name = "InvalidRequestException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidRequestException.prototype); + } +}; +__name(_InvalidRequestException, "InvalidRequestException"); +var InvalidRequestException = _InvalidRequestException; +var _ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts + }); + this.name = "ResourceNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ResourceNotFoundException.prototype); + } +}; +__name(_ResourceNotFoundException, "ResourceNotFoundException"); +var ResourceNotFoundException = _ResourceNotFoundException; +var _TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "TooManyRequestsException", + $fault: "client", + ...opts + }); + this.name = "TooManyRequestsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _TooManyRequestsException.prototype); + } +}; +__name(_TooManyRequestsException, "TooManyRequestsException"); +var TooManyRequestsException = _TooManyRequestsException; +var _UnauthorizedException = class _UnauthorizedException extends SSOServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "UnauthorizedException", + $fault: "client", + ...opts + }); + this.name = "UnauthorizedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnauthorizedException.prototype); + } +}; +__name(_UnauthorizedException, "UnauthorizedException"); +var UnauthorizedException = _UnauthorizedException; +var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING } +}), "GetRoleCredentialsRequestFilterSensitiveLog"); +var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.secretAccessKey && { secretAccessKey: import_smithy_client.SENSITIVE_STRING }, + ...obj.sessionToken && { sessionToken: import_smithy_client.SENSITIVE_STRING } +}), "RoleCredentialsFilterSensitiveLog"); +var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) } +}), "GetRoleCredentialsResponseFilterSensitiveLog"); +var ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING } +}), "ListAccountRolesRequestFilterSensitiveLog"); +var ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING } +}), "ListAccountsRequestFilterSensitiveLog"); +var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING } +}), "LogoutRequestFilterSensitiveLog"); + +// src/protocols/Aws_restJson1.ts + + +var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => { + const b = (0, import_core.requestBuilder)(input, context); + const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, { + [_xasbt]: input[_aT] + }); + b.bp("/federation/credentials"); + const query = (0, import_smithy_client.map)({ + [_rn]: [, (0, import_smithy_client.expectNonNull)(input[_rN], `roleName`)], + [_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)] + }); + let body; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}, "se_GetRoleCredentialsCommand"); +var se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context) => { + const b = (0, import_core.requestBuilder)(input, context); + const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, { + [_xasbt]: input[_aT] + }); + b.bp("/assignment/roles"); + const query = (0, import_smithy_client.map)({ + [_nt]: [, input[_nT]], + [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()], + [_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)] + }); + let body; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}, "se_ListAccountRolesCommand"); +var se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context) => { + const b = (0, import_core.requestBuilder)(input, context); + const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, { + [_xasbt]: input[_aT] + }); + b.bp("/assignment/accounts"); + const query = (0, import_smithy_client.map)({ + [_nt]: [, input[_nT]], + [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()] + }); + let body; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}, "se_ListAccountsCommand"); +var se_LogoutCommand = /* @__PURE__ */ __name(async (input, context) => { + const b = (0, import_core.requestBuilder)(input, context); + const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, { + [_xasbt]: input[_aT] + }); + b.bp("/logout"); + let body; + b.m("POST").h(headers).b(body); + return b.build(); +}, "se_LogoutCommand"); +var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = (0, import_smithy_client.map)({ + $metadata: deserializeMetadata(output) + }); + const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, import_smithy_client.take)(data, { + roleCredentials: import_smithy_client._json + }); + Object.assign(contents, doc); + return contents; +}, "de_GetRoleCredentialsCommand"); +var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = (0, import_smithy_client.map)({ + $metadata: deserializeMetadata(output) + }); + const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, import_smithy_client.take)(data, { + nextToken: import_smithy_client.expectString, + roleList: import_smithy_client._json + }); + Object.assign(contents, doc); + return contents; +}, "de_ListAccountRolesCommand"); +var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = (0, import_smithy_client.map)({ + $metadata: deserializeMetadata(output) + }); + const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, import_smithy_client.take)(data, { + accountList: import_smithy_client._json, + nextToken: import_smithy_client.expectString + }); + Object.assign(contents, doc); + return contents; +}, "de_ListAccountsCommand"); +var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = (0, import_smithy_client.map)({ + $metadata: deserializeMetadata(output) + }); + await (0, import_smithy_client.collectBody)(output.body, context); + return contents; +}, "de_LogoutCommand"); +var de_CommandError = /* @__PURE__ */ __name(async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context) + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sso#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode + }); + } +}, "de_CommandError"); +var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOServiceException); +var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + message: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new InvalidRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_InvalidRequestExceptionRes"); +var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + message: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_ResourceNotFoundExceptionRes"); +var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + message: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new TooManyRequestsException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_TooManyRequestsExceptionRes"); +var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const contents = (0, import_smithy_client.map)({}); + const data = parsedOutput.body; + const doc = (0, import_smithy_client.take)(data, { + message: import_smithy_client.expectString + }); + Object.assign(contents, doc); + const exception = new UnauthorizedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents + }); + return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body); +}, "de_UnauthorizedExceptionRes"); +var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] +}), "deserializeMetadata"); +var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString"); +var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue"); +var _aI = "accountId"; +var _aT = "accessToken"; +var _ai = "account_id"; +var _mR = "maxResults"; +var _mr = "max_result"; +var _nT = "nextToken"; +var _nt = "next_token"; +var _rN = "roleName"; +var _rn = "role_name"; +var _xasbt = "x-amz-sso_bearer_token"; +var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}), "parseBody"); +var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}, "parseErrorBody"); +var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => { + const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey"); + const sanitizeErrorCode = /* @__PURE__ */ __name((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; + }, "sanitizeErrorCode"); + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== void 0) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== void 0) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== void 0) { + return sanitizeErrorCode(data["__type"]); + } +}, "loadRestJsonErrorCode"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.prepareRequest = void 0; -const cloneRequest_1 = __nccwpck_require__(69098); -const constants_1 = __nccwpck_require__(48644); -const prepareRequest = (request) => { - request = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); - for (const headerName of Object.keys(request.headers)) { - if (constants_1.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { - delete request.headers[headerName]; - } - } - return request; +// src/commands/GetRoleCredentialsCommand.ts +var _GetRoleCredentialsCommand = class _GetRoleCredentialsCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() { }; -exports.prepareRequest = prepareRequest; +__name(_GetRoleCredentialsCommand, "GetRoleCredentialsCommand"); +var GetRoleCredentialsCommand = _GetRoleCredentialsCommand; +// src/commands/ListAccountRolesCommand.ts -/***/ }), -/***/ 39299: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toDate = exports.iso8601 = void 0; -const iso8601 = (time) => (0, exports.toDate)(time) - .toISOString() - .replace(/\.\d{3}Z$/, "Z"); -exports.iso8601 = iso8601; -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 new Date(time); - } - return time; +var _ListAccountRolesCommand = class _ListAccountRolesCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").f(ListAccountRolesRequestFilterSensitiveLog, void 0).ser(se_ListAccountRolesCommand).de(de_ListAccountRolesCommand).build() { }; -exports.toDate = toDate; +__name(_ListAccountRolesCommand, "ListAccountRolesCommand"); +var ListAccountRolesCommand = _ListAccountRolesCommand; +// src/commands/ListAccountsCommand.ts -/***/ }), - -/***/ 39674: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(49312); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; -/***/ }), +var _ListAccountsCommand = class _ListAccountsCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").f(ListAccountsRequestFilterSensitiveLog, void 0).ser(se_ListAccountsCommand).de(de_ListAccountsCommand).build() { +}; +__name(_ListAccountsCommand, "ListAccountsCommand"); +var ListAccountsCommand = _ListAccountsCommand; -/***/ 49312: -/***/ ((__unused_webpack_module, exports) => { +// src/commands/LogoutCommand.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; -/***/ }), +var _LogoutCommand = class _LogoutCommand extends import_smithy_client.Command.classBuilder().ep({ + ...commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").f(LogoutRequestFilterSensitiveLog, void 0).ser(se_LogoutCommand).de(de_LogoutCommand).build() { +}; +__name(_LogoutCommand, "LogoutCommand"); +var LogoutCommand = _LogoutCommand; -/***/ 49617: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/SSO.ts +var commands = { + GetRoleCredentialsCommand, + ListAccountRolesCommand, + ListAccountsCommand, + LogoutCommand +}; +var _SSO = class _SSO extends SSOClient { +}; +__name(_SSO, "SSO"); +var SSO = _SSO; +(0, import_smithy_client.createAggregatedClient)(commands, SSO); -"use strict"; +// src/pagination/ListAccountRolesPaginator.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(49312), exports); -tslib_1.__exportStar(__nccwpck_require__(39674), exports); +var paginateListAccountRoles = (0, import_core.createPaginator)(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults"); +// src/pagination/ListAccountsPaginator.ts -/***/ }), +var paginateListAccounts = (0, import_core.createPaginator)(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults"); -/***/ 70438: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var import_util_endpoints = __nccwpck_require__(3350); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoOpLogger = void 0; -class NoOpLogger { - trace() { } - debug() { } - info() { } - warn() { } - error() { } -} -exports.NoOpLogger = NoOpLogger; /***/ }), -/***/ 61600: +/***/ 9756: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Client = void 0; -const middleware_stack_1 = __nccwpck_require__(97911); -class Client { - constructor(config) { - this.middlewareStack = (0, middleware_stack_1.constructStack)(); - this.config = config; - } - send(command, optionsOrCb, cb) { - const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; - const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; - const handler = command.resolveMiddleware(this.middlewareStack, this.config, options); - if (callback) { - handler(command) - .then((result) => callback(null, result.output), (err) => callback(err)) - .catch(() => { }); - } - else { - return handler(command).then((result) => result.output); - } - } - destroy() { - if (this.config.requestHandler.destroy) - this.config.requestHandler.destroy(); - } -} -exports.Client = Client; +exports.getRuntimeConfig = void 0; +const tslib_1 = __nccwpck_require__(4351); +const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(1092)); +const core_1 = __nccwpck_require__(9963); +const util_user_agent_node_1 = __nccwpck_require__(8095); +const config_resolver_1 = __nccwpck_require__(3098); +const hash_node_1 = __nccwpck_require__(3081); +const middleware_retry_1 = __nccwpck_require__(6039); +const node_config_provider_1 = __nccwpck_require__(3461); +const node_http_handler_1 = __nccwpck_require__(7028); +const util_body_length_node_1 = __nccwpck_require__(8075); +const util_retry_1 = __nccwpck_require__(4902); +const runtimeConfig_shared_1 = __nccwpck_require__(4809); +const smithy_client_1 = __nccwpck_require__(3570); +const util_defaults_mode_node_1 = __nccwpck_require__(2429); +const smithy_client_2 = __nccwpck_require__(3570); +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); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.defaultUserAgent)({ 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), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + 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, + }), + 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), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 32813: +/***/ 4809: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.collectBody = void 0; -const util_stream_1 = __nccwpck_require__(96607); -const collectBody = async (streamBody = new Uint8Array(), context) => { - if (streamBody instanceof Uint8Array) { - return util_stream_1.Uint8ArrayBlobAdapter.mutate(streamBody); - } - if (!streamBody) { - return util_stream_1.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); - } - const fromContext = context.streamCollector(streamBody); - return util_stream_1.Uint8ArrayBlobAdapter.mutate(await fromContext); +exports.getRuntimeConfig = void 0; +const core_1 = __nccwpck_require__(9963); +const core_2 = __nccwpck_require__(5829); +const smithy_client_1 = __nccwpck_require__(3570); +const url_parser_1 = __nccwpck_require__(4681); +const util_base64_1 = __nccwpck_require__(5600); +const util_utf8_1 = __nccwpck_require__(1895); +const httpAuthSchemeProvider_1 = __nccwpck_require__(9344); +const endpointResolver_1 = __nccwpck_require__(898); +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(), + 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.collectBody = collectBody; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 75414: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7028: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, + NodeHttp2Handler: () => NodeHttp2Handler, + NodeHttpHandler: () => NodeHttpHandler, + streamCollector: () => streamCollector +}); +module.exports = __toCommonJS(src_exports); + +// src/node-http-handler.ts +var import_protocol_http = __nccwpck_require__(3555); +var import_querystring_builder = __nccwpck_require__(7090); +var import_http = __nccwpck_require__(3685); +var import_https = __nccwpck_require__(5687); + +// src/constants.ts +var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +// src/get-transformed-headers.ts +var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}, "getTransformedHeaders"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Command = void 0; -const middleware_stack_1 = __nccwpck_require__(97911); -class Command { - constructor() { - this.middlewareStack = (0, middleware_stack_1.constructStack)(); +// src/set-connection-timeout.ts +var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject( + Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError" + }) + ); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } else { + clearTimeout(timeoutId); } -} -exports.Command = Command; - - -/***/ }), - -/***/ 92541: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SENSITIVE_STRING = void 0; -exports.SENSITIVE_STRING = "***SensitiveInformation***"; - - -/***/ }), + }); +}, "setConnectionTimeout"); -/***/ 56929: -/***/ ((__unused_webpack_module, exports) => { +// src/set-socket-keep-alive.ts +var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}, "setSocketKeepAlive"); -"use strict"; +// src/set-socket-timeout.ts +var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}, "setSocketTimeout"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createAggregatedClient = void 0; -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); - } - 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; +// src/write-request-body.ts +var import_stream = __nccwpck_require__(2781); +var MIN_WAIT_TIME = 1e3; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + const headers = request.headers ?? {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }) + ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } +} +__name(writeRequestBody, "writeRequestBody"); +function writeBody(httpRequest, body) { + if (body instanceof import_stream.Readable) { + body.pipe(httpRequest); + } else if (body) { + httpRequest.end(Buffer.from(body)); + } else { + httpRequest.end(); + } +} +__name(writeBody, "writeBody"); + +// src/node-http-handler.ts +var DEFAULT_REQUEST_TIMEOUT = 0; +var _NodeHttpHandler = class _NodeHttpHandler { + constructor(options) { + this.socketWarningTimestamp = 0; + // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286 + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttpHandler(instanceOrOptions); + } + /** + * @internal + * + * @param agent - http(s) agent in use by the NodeHttpHandler instance. + * @returns timestamp of last emitted warning. + */ + static checkSocketUsage(agent, socketWarningTimestamp) { + var _a, _b; + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; + const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + console.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; + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout ?? socketTimeout, + httpAgent: (() => { + if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { + return httpAgent; + } + return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { + return httpsAgent; + } + return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })() + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); + (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + let socketCheckTimeoutId; + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + clearTimeout(socketCheckTimeoutId); + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; + socketCheckTimeoutId = setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp); + }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)); + const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); + let auth = void 0; + 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}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent, + auth + }; + const requestFunc = isSSL ? import_https.request : import_http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new import_protocol_http.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); + } + }); + setConnectionTimeout(req, reject, this.config.connectionTimeout); + setSocketTimeout(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + setSocketKeepAlive(req, { + // @ts-expect-error keepAlive is not public on httpAgent. + keepAlive: httpAgent.keepAlive, + // @ts-expect-error keepAliveMsecs is not public on httpAgent. + keepAliveMsecs: httpAgent.keepAliveMsecs + }); + } + writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } }; -exports.createAggregatedClient = createAggregatedClient; +__name(_NodeHttpHandler, "NodeHttpHandler"); +var NodeHttpHandler = _NodeHttpHandler; +// src/node-http2-handler.ts -/***/ }), -/***/ 21737: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var import_http22 = __nccwpck_require__(5158); -"use strict"; +// src/node-http2-connection-manager.ts +var import_http2 = __toESM(__nccwpck_require__(5158)); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEpochTimestamp = exports.parseRfc7231DateTime = exports.parseRfc3339DateTimeWithOffset = exports.parseRfc3339DateTime = exports.dateToUtcString = void 0; -const parse_utils_1 = __nccwpck_require__(74857); -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`; -} -exports.dateToUtcString = dateToUtcString; -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 = (0, parse_utils_1.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 }); -}; -exports.parseRfc3339DateTime = parseRfc3339DateTime; -const RFC3339_WITH_OFFSET = 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.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 = (0, parse_utils_1.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; -}; -exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset; -const IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); -const RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); -const ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); -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.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - match = RFC_850_DATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { - hours, - minutes, - seconds, - fractionalMilliseconds, - })); - } - match = ASC_TIME.exec(value); - if (match) { - const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; - return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - throw new TypeError("Invalid RFC-7231 date-time value"); -}; -exports.parseRfc7231DateTime = parseRfc7231DateTime; -const parseEpochTimestamp = (value) => { - if (value === null || value === undefined) { - return undefined; - } - let valueAsDouble; - if (typeof value === "number") { - valueAsDouble = value; - } - else if (typeof value === "string") { - valueAsDouble = (0, parse_utils_1.strictParseDouble)(value); - } - else { - throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); +// src/node-http2-connection-pool.ts +var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); } - if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { - throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); + } + 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(); + } + } } - return new Date(Math.round(valueAsDouble * 1000)); -}; -exports.parseEpochTimestamp = parseEpochTimestamp; -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 + (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(value)); - if (valueInThisCentury < thisYear) { - return valueInThisCentury + 100; +__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); +var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; + +// src/node-http2-connection-manager.ts +var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = /* @__PURE__ */ new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); } - 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())); + } + 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; + } } - return input; -}; -const parseMonthByShortName = (value) => { - const monthIdx = MONTHS.indexOf(value); - if (monthIdx < 0) { - throw new TypeError(`Invalid month: ${value}`); + const session = import_http2.default.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 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; + session.unref(); + const destroySessionCb = /* @__PURE__ */ __name(() => { + session.destroy(); + this.deleteSession(url, session); + }, "destroySessionCb"); + 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; + } + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; } - if (day > maxDays) { - throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); + if (!existingConnectionPool.contains(session)) { + return; } -}; -const isLeapYear = (year) => { - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); -}; -const parseDateValue = (value, type, lower, upper) => { - const dateVal = (0, parse_utils_1.strictParseByte)(stripLeadingZeroes(value)); - if (dateVal < lower || dateVal > upper) { - throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); } - return dateVal; -}; -const parseMilliseconds = (value) => { - if (value === null || value === undefined) { - return 0; + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); } - return (0, parse_utils_1.strictParseFloat32)("0." + value) * 1000; + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } }; -const parseOffsetToMilliseconds = (value) => { - const directionStr = value[0]; - let direction = 1; - if (directionStr == "+") { - direction = 1; - } - else if (directionStr == "-") { - direction = -1; +__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); +var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; + +// src/node-http2-handler.ts +var _NodeHttp2Handler = class _NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttp2Handler(instanceOrOptions); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } } - else { - throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a; + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (abortSignal == null ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = 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: (_a = this.config) == null ? void 0 : _a.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = /* @__PURE__ */ __name((err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }, "rejectWithDestroy"); + const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [import_http22.constants.HTTP2_HEADER_PATH]: path, + [import_http22.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new import_protocol_http.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + 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, requestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + /** + * Destroys a session. + * @param session The session to destroy. + */ + destroySession(session) { + if (!session.destroyed) { + session.destroy(); } - 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); +__name(_NodeHttp2Handler, "NodeHttp2Handler"); +var NodeHttp2Handler = _NodeHttp2Handler; + +// src/stream-collector/collector.ts + +var _Collector = class _Collector extends import_stream.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } }; +__name(_Collector, "Collector"); +var Collector = _Collector; + +// src/stream-collector/index.ts +var streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}), "streamCollector"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 9681: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3555: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.withBaseException = exports.throwDefaultError = void 0; -const exceptions_1 = __nccwpck_require__(88074); -const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { - const $metadata = deserializeMetadata(output); - const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; - const response = new exceptionCtor({ - name: (parsedBody === null || parsedBody === void 0 ? void 0 : parsedBody.code) || (parsedBody === null || parsedBody === void 0 ? void 0 : parsedBody.Code) || errorCode || statusCode || "UnknownError", - $fault: "client", - $metadata, - }); - throw (0, exceptions_1.decorateServiceException)(response, parsedBody); -}; -exports.throwDefaultError = throwDefaultError; -const withBaseException = (ExceptionCtor) => { - return ({ output, parsedBody, errorCode }) => { - (0, exports.throwDefaultError)({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); - }; +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(917); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } }; -exports.withBaseException = withBaseException; -const deserializeMetadata = (output) => { - var _a, _b; - return ({ - httpStatusCode: output.statusCode, - requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"], - extendedRequestId: output.headers["x-amz-id-2"], - cfId: output.headers["x-amz-cf-id"], - }); +__name(_Field, "Field"); +var Field = _Field; + +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } }; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ }), - -/***/ 11163: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadConfigsForDefaultMode = void 0; -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 {}; - } -}; -exports.loadConfigsForDefaultMode = loadConfigsForDefaultMode; /***/ }), -/***/ 91809: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7090: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.emitWarningIfUnsupportedVersion = void 0; -let warningEmitted = false; -const emitWarningIfUnsupportedVersion = (version) => { - if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 14) { - warningEmitted = true; +// src/index.ts +var src_exports = {}; +__export(src_exports, { + buildQueryString: () => buildQueryString +}); +module.exports = __toCommonJS(src_exports); +var import_util_uri_escape = __nccwpck_require__(4067); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, import_util_uri_escape.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; + } + parts.push(qsEntry); } -}; -exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; + } + return parts.join("&"); +} +__name(buildQueryString, "buildQueryString"); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -/***/ }), -/***/ 88074: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.decorateServiceException = exports.ServiceException = void 0; -class ServiceException extends Error { - constructor(options) { - super(options.message); - Object.setPrototypeOf(this, ServiceException.prototype); - this.name = options.name; - this.$fault = options.$fault; - this.$metadata = options.$metadata; - } -} -exports.ServiceException = ServiceException; -const decorateServiceException = (exception, additions = {}) => { - Object.entries(additions) - .filter(([, v]) => v !== undefined) - .forEach(([k, v]) => { - if (exception[k] == undefined || exception[k] === "") { - exception[k] = v; - } +/***/ 917: +/***/ ((module) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 }); - const message = exception.message || exception.Message || "UnknownError"; - exception.message = message; - delete exception.Message; - return exception; -}; -exports.decorateServiceException = decorateServiceException; + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -/***/ }), +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ 76016: -/***/ ((__unused_webpack_module, exports) => { +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -"use strict"; +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.extendedEncodeURIComponent = void 0; -function extendedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); -} -exports.extendedEncodeURIComponent = extendedEncodeURIComponent; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -/***/ }), -/***/ 30941: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -const types_1 = __nccwpck_require__(49185); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return types_1.AlgorithmId; } })); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - for (const id in types_1.AlgorithmId) { - const algorithmId = types_1.AlgorithmId[id]; - if (runtimeConfig[algorithmId] === undefined) { - continue; - } - checksumAlgorithms.push({ - algorithmId: () => algorithmId, - checksumConstructor: () => runtimeConfig[algorithmId], - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; +/***/ 4067: +/***/ ((module) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; }; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath +}); +module.exports = __toCommonJS(src_exports); -/***/ }), +// src/escape-uri.ts +var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) +), "escapeUri"); +var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); -/***/ 78643: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/escape-uri-path.ts +var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = exports.getDefaultExtensionConfiguration = void 0; -const checksum_1 = __nccwpck_require__(30941); -const retry_1 = __nccwpck_require__(67367); -const getDefaultExtensionConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - ...(0, retry_1.getRetryConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultExtensionConfiguration = getDefaultExtensionConfiguration; -exports.getDefaultClientConfiguration = exports.getDefaultExtensionConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - ...(0, retry_1.resolveRetryRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; /***/ }), -/***/ 1822: +/***/ 4195: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(78643), exports); +exports.STSClient = exports.__Client = void 0; +const middleware_host_header_1 = __nccwpck_require__(2545); +const middleware_logger_1 = __nccwpck_require__(14); +const middleware_recursion_detection_1 = __nccwpck_require__(5525); +const middleware_user_agent_1 = __nccwpck_require__(4688); +const config_resolver_1 = __nccwpck_require__(3098); +const core_1 = __nccwpck_require__(5829); +const middleware_content_length_1 = __nccwpck_require__(2800); +const middleware_endpoint_1 = __nccwpck_require__(2918); +const middleware_retry_1 = __nccwpck_require__(6039); +const smithy_client_1 = __nccwpck_require__(3570); +Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } })); +const httpAuthSchemeProvider_1 = __nccwpck_require__(7145); +const EndpointParameters_1 = __nccwpck_require__(510); +const runtimeConfig_1 = __nccwpck_require__(3405); +const runtimeExtensions_1 = __nccwpck_require__(2053); +class STSClient extends smithy_client_1.Client { + constructor(...[configuration]) { + const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); + const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); + const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); + const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); + const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); + const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_5); + const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6); + const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); + this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, { + httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(), + identityProviderConfigProvider: this.getIdentityProviderConfigProvider(), + })); + this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config)); + } + destroy() { + super.destroy(); + } + getDefaultHttpAuthSchemeParametersProvider() { + return httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider; + } + getIdentityProviderConfigProvider() { + return async (config) => new core_1.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }); + } +} +exports.STSClient = STSClient; /***/ }), -/***/ 67367: +/***/ 8527: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRetryRuntimeConfig = exports.getRetryConfiguration = void 0; -const getRetryConfiguration = (runtimeConfig) => { - let _retryStrategy = runtimeConfig.retryStrategy; +exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0; +const getHttpAuthExtensionConfiguration = (runtimeConfig) => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; + let _credentials = runtimeConfig.credentials; return { - setRetryStrategy(retryStrategy) { - _retryStrategy = retryStrategy; + 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; }, - retryStrategy() { - return _retryStrategy; + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; }, }; }; -exports.getRetryConfiguration = getRetryConfiguration; -const resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { - const runtimeConfig = {}; - runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); - return runtimeConfig; +exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration; +const resolveHttpAuthRuntimeConfig = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; }; -exports.resolveRetryRuntimeConfig = resolveRetryRuntimeConfig; - - -/***/ }), - -/***/ 42638: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getArrayIfSingleItem = void 0; -const getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; -exports.getArrayIfSingleItem = getArrayIfSingleItem; +exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig; /***/ }), -/***/ 92188: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7145: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getValueFromTextNode = void 0; -const getValueFromTextNode = (obj) => { - const textNodeName = "#text"; - for (const key in obj) { - if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { - obj[key] = obj[key][textNodeName]; +exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0; +const core_1 = __nccwpck_require__(9963); +const util_middleware_1 = __nccwpck_require__(2390); +const STSClient_1 = __nccwpck_require__(4195); +const defaultSTSHttpAuthSchemeParametersProvider = 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.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider; +function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "sts", + region: authParameters.region, + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context, + }, + }), + }; +} +function createSmithyApiNoAuthHttpAuthOption(authParameters) { + return { + schemeId: "smithy.api#noAuth", + }; +} +const defaultSTSHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "AssumeRoleWithSAML": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + case "AssumeRoleWithWebIdentity": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; } - else if (typeof obj[key] === "object" && obj[key] !== null) { - obj[key] = (0, exports.getValueFromTextNode)(obj[key]); + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); } } - return obj; + return options; +}; +exports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider; +const resolveStsAuthConfig = (input) => ({ + ...input, + stsClientCtor: STSClient_1.STSClient, +}); +exports.resolveStsAuthConfig = resolveStsAuthConfig; +const resolveHttpAuthSchemeConfig = (config) => { + const config_0 = (0, exports.resolveStsAuthConfig)(config); + const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0); + return { + ...config_1, + }; }; -exports.getValueFromTextNode = getValueFromTextNode; +exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; /***/ }), -/***/ 63570: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(70438), exports); -tslib_1.__exportStar(__nccwpck_require__(61600), exports); -tslib_1.__exportStar(__nccwpck_require__(32813), exports); -tslib_1.__exportStar(__nccwpck_require__(75414), exports); -tslib_1.__exportStar(__nccwpck_require__(92541), exports); -tslib_1.__exportStar(__nccwpck_require__(56929), exports); -tslib_1.__exportStar(__nccwpck_require__(21737), exports); -tslib_1.__exportStar(__nccwpck_require__(9681), exports); -tslib_1.__exportStar(__nccwpck_require__(11163), exports); -tslib_1.__exportStar(__nccwpck_require__(91809), exports); -tslib_1.__exportStar(__nccwpck_require__(1822), exports); -tslib_1.__exportStar(__nccwpck_require__(88074), exports); -tslib_1.__exportStar(__nccwpck_require__(76016), exports); -tslib_1.__exportStar(__nccwpck_require__(42638), exports); -tslib_1.__exportStar(__nccwpck_require__(92188), exports); -tslib_1.__exportStar(__nccwpck_require__(32964), exports); -tslib_1.__exportStar(__nccwpck_require__(83495), exports); -tslib_1.__exportStar(__nccwpck_require__(74857), exports); -tslib_1.__exportStar(__nccwpck_require__(15342), exports); -tslib_1.__exportStar(__nccwpck_require__(59796), exports); -tslib_1.__exportStar(__nccwpck_require__(1752), exports); -tslib_1.__exportStar(__nccwpck_require__(92480), exports); - - -/***/ }), - -/***/ 32964: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4800: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LazyJsonString = exports.StringWrapper = void 0; -const StringWrapper = function () { - const Class = Object.getPrototypeOf(this).constructor; - const Constructor = Function.bind.apply(String, [null, ...arguments]); - const instance = new Constructor(); - Object.setPrototypeOf(instance, Class.prototype); - return instance; -}; -exports.StringWrapper = StringWrapper; -exports.StringWrapper.prototype = Object.create(String.prototype, { - constructor: { - value: exports.StringWrapper, - enumerable: false, - writable: true, - configurable: true, - }, +exports.defaultProvider = void 0; +exports.defaultProvider = ((input) => { + return () => Promise.resolve().then(() => __importStar(__nccwpck_require__(5531))).then(({ defaultProvider }) => defaultProvider(input)()); }); -Object.setPrototypeOf(exports.StringWrapper, String); -class LazyJsonString extends exports.StringWrapper { - deserializeJSON() { - return JSON.parse(super.toString()); - } - toJSON() { - return super.toString(); - } - static fromObject(object) { - if (object instanceof LazyJsonString) { - return object; - } - else if (object instanceof String || typeof object === "string") { - return new LazyJsonString(object); - } - return new LazyJsonString(JSON.stringify(object)); - } -} -exports.LazyJsonString = LazyJsonString; /***/ }), -/***/ 83495: +/***/ 510: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.take = exports.convertMap = exports.map = void 0; -function map(arg0, arg1, arg2) { - let target; - let filter; - let instructions; - if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { - target = {}; - instructions = arg0; - } - else { - target = arg0; - if (typeof arg1 === "function") { - filter = arg1; - instructions = arg2; - return mapWithFilter(target, filter, instructions); - } - else { - instructions = arg1; - } - } - for (const key of Object.keys(instructions)) { - if (!Array.isArray(instructions[key])) { - target[key] = instructions[key]; - continue; - } - applyInstruction(target, null, instructions, key); - } - return target; -} -exports.map = map; -const convertMap = (target) => { - const output = {}; - for (const [k, v] of Object.entries(target || {})) { - output[k] = [, v]; - } - return output; -}; -exports.convertMap = convertMap; -const take = (source, instructions) => { - const out = {}; - for (const key in instructions) { - applyInstruction(out, source, instructions, key); - } - return out; -}; -exports.take = take; -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 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; - } - 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(); - } - } - else { - const defaultFilterPassed = filter === undefined && value != null; - const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter); - if (defaultFilterPassed || customFilterPassed) { - target[targetKey] = value; - } - } +exports.commonParams = exports.resolveClientEndpointParameters = void 0; +const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + useGlobalEndpoint: options.useGlobalEndpoint ?? false, + defaultSigningName: "sts", + }; +}; +exports.resolveClientEndpointParameters = resolveClientEndpointParameters; +exports.commonParams = { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, +}; + + +/***/ }), + +/***/ 1203: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = __nccwpck_require__(5473); +const ruleset_1 = __nccwpck_require__(6882); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); }; -const nonNullish = (_) => _ != null; -const pass = (_) => _; +exports.defaultEndpointResolver = defaultEndpointResolver; /***/ }), -/***/ 74857: +/***/ 6882: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.logger = exports.strictParseByte = exports.strictParseShort = exports.strictParseInt32 = exports.strictParseInt = exports.strictParseLong = exports.limitedParseFloat32 = exports.limitedParseFloat = exports.handleFloat = exports.limitedParseDouble = exports.strictParseFloat32 = exports.strictParseFloat = exports.strictParseDouble = exports.expectUnion = exports.expectString = exports.expectObject = exports.expectNonNull = exports.expectByte = exports.expectShort = exports.expectInt32 = exports.expectInt = exports.expectLong = exports.expectFloat32 = exports.expectNumber = exports.expectBoolean = exports.parseBoolean = void 0; -const parseBoolean = (value) => { - switch (value) { - case "true": - return true; - case "false": - return false; - default: - throw new Error(`Unable to parse boolean value "${value}"`); - } +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 }] }; +exports.ruleSet = _data; + + +/***/ }), + +/***/ 2209: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); }; -exports.parseBoolean = parseBoolean; -const expectBoolean = (value) => { - if (value === null || value === undefined) { - return undefined; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AssumeRoleCommand: () => AssumeRoleCommand, + AssumeRoleResponseFilterSensitiveLog: () => AssumeRoleResponseFilterSensitiveLog, + AssumeRoleWithSAMLCommand: () => AssumeRoleWithSAMLCommand, + AssumeRoleWithSAMLRequestFilterSensitiveLog: () => AssumeRoleWithSAMLRequestFilterSensitiveLog, + AssumeRoleWithSAMLResponseFilterSensitiveLog: () => AssumeRoleWithSAMLResponseFilterSensitiveLog, + AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand, + AssumeRoleWithWebIdentityRequestFilterSensitiveLog: () => AssumeRoleWithWebIdentityRequestFilterSensitiveLog, + AssumeRoleWithWebIdentityResponseFilterSensitiveLog: () => AssumeRoleWithWebIdentityResponseFilterSensitiveLog, + ClientInputEndpointParameters: () => import_EndpointParameters9.ClientInputEndpointParameters, + CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog, + DecodeAuthorizationMessageCommand: () => DecodeAuthorizationMessageCommand, + ExpiredTokenException: () => ExpiredTokenException, + GetAccessKeyInfoCommand: () => GetAccessKeyInfoCommand, + GetCallerIdentityCommand: () => GetCallerIdentityCommand, + GetFederationTokenCommand: () => GetFederationTokenCommand, + GetFederationTokenResponseFilterSensitiveLog: () => GetFederationTokenResponseFilterSensitiveLog, + GetSessionTokenCommand: () => GetSessionTokenCommand, + GetSessionTokenResponseFilterSensitiveLog: () => GetSessionTokenResponseFilterSensitiveLog, + IDPCommunicationErrorException: () => IDPCommunicationErrorException, + IDPRejectedClaimException: () => IDPRejectedClaimException, + InvalidAuthorizationMessageException: () => InvalidAuthorizationMessageException, + InvalidIdentityTokenException: () => InvalidIdentityTokenException, + MalformedPolicyDocumentException: () => MalformedPolicyDocumentException, + PackedPolicyTooLargeException: () => PackedPolicyTooLargeException, + RegionDisabledException: () => RegionDisabledException, + RuntimeExtension: () => import_runtimeExtensions.RuntimeExtension, + STS: () => STS, + STSServiceException: () => STSServiceException, + decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider, + getDefaultRoleAssumer: () => getDefaultRoleAssumer2, + getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2 +}); +module.exports = __toCommonJS(src_exports); +__reExport(src_exports, __nccwpck_require__(4195), module.exports); + +// src/STS.ts + + +// src/commands/AssumeRoleCommand.ts +var import_middleware_endpoint = __nccwpck_require__(2918); +var import_middleware_serde = __nccwpck_require__(1238); + +var import_types = __nccwpck_require__(1551); +var import_EndpointParameters = __nccwpck_require__(510); + +// src/models/models_0.ts + + +// src/models/STSServiceException.ts +var import_smithy_client = __nccwpck_require__(3570); +var _STSServiceException = class _STSServiceException extends import_smithy_client.ServiceException { + /** + * @internal + */ + constructor(options) { + super(options); + Object.setPrototypeOf(this, _STSServiceException.prototype); + } +}; +__name(_STSServiceException, "STSServiceException"); +var STSServiceException = _STSServiceException; + +// src/models/models_0.ts +var _ExpiredTokenException = class _ExpiredTokenException extends STSServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts + }); + this.name = "ExpiredTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ExpiredTokenException.prototype); + } +}; +__name(_ExpiredTokenException, "ExpiredTokenException"); +var ExpiredTokenException = _ExpiredTokenException; +var _MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "MalformedPolicyDocumentException", + $fault: "client", + ...opts + }); + this.name = "MalformedPolicyDocumentException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype); + } +}; +__name(_MalformedPolicyDocumentException, "MalformedPolicyDocumentException"); +var MalformedPolicyDocumentException = _MalformedPolicyDocumentException; +var _PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "PackedPolicyTooLargeException", + $fault: "client", + ...opts + }); + this.name = "PackedPolicyTooLargeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype); + } +}; +__name(_PackedPolicyTooLargeException, "PackedPolicyTooLargeException"); +var PackedPolicyTooLargeException = _PackedPolicyTooLargeException; +var _RegionDisabledException = class _RegionDisabledException extends STSServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "RegionDisabledException", + $fault: "client", + ...opts + }); + this.name = "RegionDisabledException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _RegionDisabledException.prototype); + } +}; +__name(_RegionDisabledException, "RegionDisabledException"); +var RegionDisabledException = _RegionDisabledException; +var _IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "IDPRejectedClaimException", + $fault: "client", + ...opts + }); + this.name = "IDPRejectedClaimException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype); + } +}; +__name(_IDPRejectedClaimException, "IDPRejectedClaimException"); +var IDPRejectedClaimException = _IDPRejectedClaimException; +var _InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidIdentityTokenException", + $fault: "client", + ...opts + }); + this.name = "InvalidIdentityTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype); + } +}; +__name(_InvalidIdentityTokenException, "InvalidIdentityTokenException"); +var InvalidIdentityTokenException = _InvalidIdentityTokenException; +var _IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "IDPCommunicationErrorException", + $fault: "client", + ...opts + }); + this.name = "IDPCommunicationErrorException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype); + } +}; +__name(_IDPCommunicationErrorException, "IDPCommunicationErrorException"); +var IDPCommunicationErrorException = _IDPCommunicationErrorException; +var _InvalidAuthorizationMessageException = class _InvalidAuthorizationMessageException extends STSServiceException { + /** + * @internal + */ + constructor(opts) { + super({ + name: "InvalidAuthorizationMessageException", + $fault: "client", + ...opts + }); + this.name = "InvalidAuthorizationMessageException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidAuthorizationMessageException.prototype); + } +}; +__name(_InvalidAuthorizationMessageException, "InvalidAuthorizationMessageException"); +var InvalidAuthorizationMessageException = _InvalidAuthorizationMessageException; +var CredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.SecretAccessKey && { SecretAccessKey: import_smithy_client.SENSITIVE_STRING } +}), "CredentialsFilterSensitiveLog"); +var AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } +}), "AssumeRoleResponseFilterSensitiveLog"); +var AssumeRoleWithSAMLRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.SAMLAssertion && { SAMLAssertion: import_smithy_client.SENSITIVE_STRING } +}), "AssumeRoleWithSAMLRequestFilterSensitiveLog"); +var AssumeRoleWithSAMLResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } +}), "AssumeRoleWithSAMLResponseFilterSensitiveLog"); +var AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.WebIdentityToken && { WebIdentityToken: import_smithy_client.SENSITIVE_STRING } +}), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog"); +var AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } +}), "AssumeRoleWithWebIdentityResponseFilterSensitiveLog"); +var GetFederationTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } +}), "GetFederationTokenResponseFilterSensitiveLog"); +var GetSessionTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ + ...obj, + ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } +}), "GetSessionTokenResponseFilterSensitiveLog"); + +// src/protocols/Aws_query.ts +var import_protocol_http = __nccwpck_require__(2223); + +var import_fast_xml_parser = __nccwpck_require__(2603); +var se_AssumeRoleCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = SHARED_HEADERS; + let body; + body = buildFormUrlencodedString({ + ...se_AssumeRoleRequest(input, context), + [_A]: _AR, + [_V]: _ + }); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_AssumeRoleCommand"); +var se_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = SHARED_HEADERS; + let body; + body = buildFormUrlencodedString({ + ...se_AssumeRoleWithSAMLRequest(input, context), + [_A]: _ARWSAML, + [_V]: _ + }); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_AssumeRoleWithSAMLCommand"); +var se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = SHARED_HEADERS; + let body; + body = buildFormUrlencodedString({ + ...se_AssumeRoleWithWebIdentityRequest(input, context), + [_A]: _ARWWI, + [_V]: _ + }); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_AssumeRoleWithWebIdentityCommand"); +var se_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = SHARED_HEADERS; + let body; + body = buildFormUrlencodedString({ + ...se_DecodeAuthorizationMessageRequest(input, context), + [_A]: _DAM, + [_V]: _ + }); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_DecodeAuthorizationMessageCommand"); +var se_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = SHARED_HEADERS; + let body; + body = buildFormUrlencodedString({ + ...se_GetAccessKeyInfoRequest(input, context), + [_A]: _GAKI, + [_V]: _ + }); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetAccessKeyInfoCommand"); +var se_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = SHARED_HEADERS; + let body; + body = buildFormUrlencodedString({ + ...se_GetCallerIdentityRequest(input, context), + [_A]: _GCI, + [_V]: _ + }); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetCallerIdentityCommand"); +var se_GetFederationTokenCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = SHARED_HEADERS; + let body; + body = buildFormUrlencodedString({ + ...se_GetFederationTokenRequest(input, context), + [_A]: _GFT, + [_V]: _ + }); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetFederationTokenCommand"); +var se_GetSessionTokenCommand = /* @__PURE__ */ __name(async (input, context) => { + const headers = SHARED_HEADERS; + let body; + body = buildFormUrlencodedString({ + ...se_GetSessionTokenRequest(input, context), + [_A]: _GST, + [_V]: _ + }); + return buildHttpRpcRequest(context, headers, "/", void 0, body); +}, "se_GetSessionTokenCommand"); +var de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_AssumeRoleResponse(data.AssumeRoleResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_AssumeRoleCommand"); +var de_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_AssumeRoleWithSAMLCommand"); +var de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_AssumeRoleWithWebIdentityCommand"); +var de_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_DecodeAuthorizationMessageCommand"); +var de_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetAccessKeyInfoCommand"); +var de_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetCallerIdentityCommand"); +var de_GetFederationTokenCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_GetFederationTokenResponse(data.GetFederationTokenResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetFederationTokenCommand"); +var de_GetSessionTokenCommand = /* @__PURE__ */ __name(async (output, context) => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = de_GetSessionTokenResponse(data.GetSessionTokenResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents + }; + return response; +}, "de_GetSessionTokenCommand"); +var de_CommandError = /* @__PURE__ */ __name(async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context) + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExpiredTokenException": + case "com.amazonaws.sts#ExpiredTokenException": + throw await de_ExpiredTokenExceptionRes(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await de_RegionDisabledExceptionRes(parsedOutput, context); + case "IDPRejectedClaim": + case "com.amazonaws.sts#IDPRejectedClaimException": + throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context); + case "InvalidIdentityToken": + case "com.amazonaws.sts#InvalidIdentityTokenException": + throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context); + case "IDPCommunicationError": + case "com.amazonaws.sts#IDPCommunicationErrorException": + throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context); + case "InvalidAuthorizationMessageException": + case "com.amazonaws.sts#InvalidAuthorizationMessageException": + throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Error, + errorCode + }); + } +}, "de_CommandError"); +var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = de_ExpiredTokenException(body.Error, context); + const exception = new ExpiredTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_ExpiredTokenExceptionRes"); +var de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = de_IDPCommunicationErrorException(body.Error, context); + const exception = new IDPCommunicationErrorException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_IDPCommunicationErrorExceptionRes"); +var de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = de_IDPRejectedClaimException(body.Error, context); + const exception = new IDPRejectedClaimException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_IDPRejectedClaimExceptionRes"); +var de_InvalidAuthorizationMessageExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = de_InvalidAuthorizationMessageException(body.Error, context); + const exception = new InvalidAuthorizationMessageException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidAuthorizationMessageExceptionRes"); +var de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = de_InvalidIdentityTokenException(body.Error, context); + const exception = new InvalidIdentityTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InvalidIdentityTokenExceptionRes"); +var de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = de_MalformedPolicyDocumentException(body.Error, context); + const exception = new MalformedPolicyDocumentException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_MalformedPolicyDocumentExceptionRes"); +var de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = de_PackedPolicyTooLargeException(body.Error, context); + const exception = new PackedPolicyTooLargeException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_PackedPolicyTooLargeExceptionRes"); +var de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = de_RegionDisabledException(body.Error, context); + const exception = new RegionDisabledException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_RegionDisabledExceptionRes"); +var se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context) => { + var _a2, _b, _c, _d; + const entries = {}; + if (input[_RA] != null) { + entries[_RA] = input[_RA]; + } + if (input[_RSN] != null) { + entries[_RSN] = input[_RSN]; + } + if (input[_PA] != null) { + const memberEntries = se_policyDescriptorListType(input[_PA], context); + if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) { + entries.PolicyArns = []; } - if (typeof value === "number") { - if (value === 0 || value === 1) { - exports.logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (value === 0) { - return false; - } - if (value === 1) { - return true; - } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input[_P] != null) { + entries[_P] = input[_P]; + } + if (input[_DS] != null) { + entries[_DS] = input[_DS]; + } + if (input[_T] != null) { + const memberEntries = se_tagListType(input[_T], context); + if (((_b = input[_T]) == null ? void 0 : _b.length) === 0) { + entries.Tags = []; } - if (typeof value === "string") { - const lower = value.toLowerCase(); - if (lower === "false" || lower === "true") { - exports.logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (lower === "false") { - return false; - } - if (lower === "true") { - return true; - } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Tags.${key}`; + entries[loc] = value; + }); + } + if (input[_TTK] != null) { + const memberEntries = se_tagKeyListType(input[_TTK], context); + if (((_c = input[_TTK]) == null ? void 0 : _c.length) === 0) { + entries.TransitiveTagKeys = []; } - if (typeof value === "boolean") { - return value; + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `TransitiveTagKeys.${key}`; + entries[loc] = value; + }); + } + if (input[_EI] != null) { + entries[_EI] = input[_EI]; + } + if (input[_SN] != null) { + entries[_SN] = input[_SN]; + } + if (input[_TC] != null) { + entries[_TC] = input[_TC]; + } + if (input[_SI] != null) { + entries[_SI] = input[_SI]; + } + if (input[_PC] != null) { + const memberEntries = se_ProvidedContextsListType(input[_PC], context); + if (((_d = input[_PC]) == null ? void 0 : _d.length) === 0) { + entries.ProvidedContexts = []; } - throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); -}; -exports.expectBoolean = expectBoolean; -const expectNumber = (value) => { - if (value === null || value === undefined) { - return undefined; + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ProvidedContexts.${key}`; + entries[loc] = value; + }); + } + return entries; +}, "se_AssumeRoleRequest"); +var se_AssumeRoleWithSAMLRequest = /* @__PURE__ */ __name((input, context) => { + var _a2; + const entries = {}; + if (input[_RA] != null) { + entries[_RA] = input[_RA]; + } + if (input[_PAr] != null) { + entries[_PAr] = input[_PAr]; + } + if (input[_SAMLA] != null) { + entries[_SAMLA] = input[_SAMLA]; + } + if (input[_PA] != null) { + const memberEntries = se_policyDescriptorListType(input[_PA], context); + if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) { + entries.PolicyArns = []; } - if (typeof value === "string") { - const parsed = parseFloat(value); - if (!Number.isNaN(parsed)) { - if (String(parsed) !== String(value)) { - exports.logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); - } - return parsed; - } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input[_P] != null) { + entries[_P] = input[_P]; + } + if (input[_DS] != null) { + entries[_DS] = input[_DS]; + } + return entries; +}, "se_AssumeRoleWithSAMLRequest"); +var se_AssumeRoleWithWebIdentityRequest = /* @__PURE__ */ __name((input, context) => { + var _a2; + const entries = {}; + if (input[_RA] != null) { + entries[_RA] = input[_RA]; + } + if (input[_RSN] != null) { + entries[_RSN] = input[_RSN]; + } + if (input[_WIT] != null) { + entries[_WIT] = input[_WIT]; + } + if (input[_PI] != null) { + entries[_PI] = input[_PI]; + } + if (input[_PA] != null) { + const memberEntries = se_policyDescriptorListType(input[_PA], context); + if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) { + entries.PolicyArns = []; } - if (typeof value === "number") { - return value; + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input[_P] != null) { + entries[_P] = input[_P]; + } + if (input[_DS] != null) { + entries[_DS] = input[_DS]; + } + return entries; +}, "se_AssumeRoleWithWebIdentityRequest"); +var se_DecodeAuthorizationMessageRequest = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + if (input[_EM] != null) { + entries[_EM] = input[_EM]; + } + return entries; +}, "se_DecodeAuthorizationMessageRequest"); +var se_GetAccessKeyInfoRequest = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + if (input[_AKI] != null) { + entries[_AKI] = input[_AKI]; + } + return entries; +}, "se_GetAccessKeyInfoRequest"); +var se_GetCallerIdentityRequest = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + return entries; +}, "se_GetCallerIdentityRequest"); +var se_GetFederationTokenRequest = /* @__PURE__ */ __name((input, context) => { + var _a2, _b; + const entries = {}; + if (input[_N] != null) { + entries[_N] = input[_N]; + } + if (input[_P] != null) { + entries[_P] = input[_P]; + } + if (input[_PA] != null) { + const memberEntries = se_policyDescriptorListType(input[_PA], context); + if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) { + entries.PolicyArns = []; } - throw new TypeError(`Expected number, got ${typeof value}: ${value}`); -}; -exports.expectNumber = expectNumber; -const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); -const expectFloat32 = (value) => { - const expected = (0, exports.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}`); - } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input[_DS] != null) { + entries[_DS] = input[_DS]; + } + if (input[_T] != null) { + const memberEntries = se_tagListType(input[_T], context); + if (((_b = input[_T]) == null ? void 0 : _b.length) === 0) { + entries.Tags = []; } - return expected; -}; -exports.expectFloat32 = expectFloat32; -const expectLong = (value) => { - if (value === null || value === undefined) { - return undefined; + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Tags.${key}`; + entries[loc] = value; + }); + } + return entries; +}, "se_GetFederationTokenRequest"); +var se_GetSessionTokenRequest = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + if (input[_DS] != null) { + entries[_DS] = input[_DS]; + } + if (input[_SN] != null) { + entries[_SN] = input[_SN]; + } + if (input[_TC] != null) { + entries[_TC] = input[_TC]; + } + return entries; +}, "se_GetSessionTokenRequest"); +var se_policyDescriptorListType = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; } - if (Number.isInteger(value) && !Number.isNaN(value)) { - return value; + const memberEntries = se_PolicyDescriptorType(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}, "se_policyDescriptorListType"); +var se_PolicyDescriptorType = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + if (input[_a] != null) { + entries[_a] = input[_a]; + } + return entries; +}, "se_PolicyDescriptorType"); +var se_ProvidedContext = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + if (input[_PAro] != null) { + entries[_PAro] = input[_PAro]; + } + if (input[_CA] != null) { + entries[_CA] = input[_CA]; + } + return entries; +}, "se_ProvidedContext"); +var se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; } - throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); -}; -exports.expectLong = expectLong; -exports.expectInt = exports.expectLong; -const expectInt32 = (value) => expectSizedInt(value, 32); -exports.expectInt32 = expectInt32; -const expectShort = (value) => expectSizedInt(value, 16); -exports.expectShort = expectShort; -const expectByte = (value) => expectSizedInt(value, 8); -exports.expectByte = expectByte; -const expectSizedInt = (value, size) => { - const expected = (0, exports.expectLong)(value); - if (expected !== undefined && castInt(expected, size) !== expected) { - throw new TypeError(`Expected ${size}-bit integer, got ${value}`); + const memberEntries = se_ProvidedContext(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}, "se_ProvidedContextsListType"); +var se_Tag = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + if (input[_K] != null) { + entries[_K] = input[_K]; + } + if (input[_Va] != null) { + entries[_Va] = input[_Va]; + } + return entries; +}, "se_Tag"); +var se_tagKeyListType = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; } - 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]; + entries[`member.${counter}`] = entry; + counter++; + } + return entries; +}, "se_tagKeyListType"); +var se_tagListType = /* @__PURE__ */ __name((input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + const memberEntries = se_Tag(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}, "se_tagListType"); +var de_AssumedRoleUser = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_ARI] != null) { + contents[_ARI] = (0, import_smithy_client.expectString)(output[_ARI]); + } + if (output[_Ar] != null) { + contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]); + } + return contents; +}, "de_AssumedRoleUser"); +var de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_C] != null) { + contents[_C] = de_Credentials(output[_C], context); + } + if (output[_ARU] != null) { + contents[_ARU] = de_AssumedRoleUser(output[_ARU], context); + } + if (output[_PPS] != null) { + contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]); + } + if (output[_SI] != null) { + contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]); + } + return contents; +}, "de_AssumeRoleResponse"); +var de_AssumeRoleWithSAMLResponse = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_C] != null) { + contents[_C] = de_Credentials(output[_C], context); + } + if (output[_ARU] != null) { + contents[_ARU] = de_AssumedRoleUser(output[_ARU], context); + } + if (output[_PPS] != null) { + contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]); + } + if (output[_S] != null) { + contents[_S] = (0, import_smithy_client.expectString)(output[_S]); + } + if (output[_ST] != null) { + contents[_ST] = (0, import_smithy_client.expectString)(output[_ST]); + } + if (output[_I] != null) { + contents[_I] = (0, import_smithy_client.expectString)(output[_I]); + } + if (output[_Au] != null) { + contents[_Au] = (0, import_smithy_client.expectString)(output[_Au]); + } + if (output[_NQ] != null) { + contents[_NQ] = (0, import_smithy_client.expectString)(output[_NQ]); + } + if (output[_SI] != null) { + contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]); + } + return contents; +}, "de_AssumeRoleWithSAMLResponse"); +var de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_C] != null) { + contents[_C] = de_Credentials(output[_C], context); + } + if (output[_SFWIT] != null) { + contents[_SFWIT] = (0, import_smithy_client.expectString)(output[_SFWIT]); + } + if (output[_ARU] != null) { + contents[_ARU] = de_AssumedRoleUser(output[_ARU], context); + } + if (output[_PPS] != null) { + contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]); + } + if (output[_Pr] != null) { + contents[_Pr] = (0, import_smithy_client.expectString)(output[_Pr]); + } + if (output[_Au] != null) { + contents[_Au] = (0, import_smithy_client.expectString)(output[_Au]); + } + if (output[_SI] != null) { + contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]); + } + return contents; +}, "de_AssumeRoleWithWebIdentityResponse"); +var de_Credentials = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_AKI] != null) { + contents[_AKI] = (0, import_smithy_client.expectString)(output[_AKI]); + } + if (output[_SAK] != null) { + contents[_SAK] = (0, import_smithy_client.expectString)(output[_SAK]); + } + if (output[_STe] != null) { + contents[_STe] = (0, import_smithy_client.expectString)(output[_STe]); + } + if (output[_E] != null) { + contents[_E] = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(output[_E])); + } + return contents; +}, "de_Credentials"); +var de_DecodeAuthorizationMessageResponse = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_DM] != null) { + contents[_DM] = (0, import_smithy_client.expectString)(output[_DM]); + } + return contents; +}, "de_DecodeAuthorizationMessageResponse"); +var de_ExpiredTokenException = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_m] != null) { + contents[_m] = (0, import_smithy_client.expectString)(output[_m]); + } + return contents; +}, "de_ExpiredTokenException"); +var de_FederatedUser = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_FUI] != null) { + contents[_FUI] = (0, import_smithy_client.expectString)(output[_FUI]); + } + if (output[_Ar] != null) { + contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]); + } + return contents; +}, "de_FederatedUser"); +var de_GetAccessKeyInfoResponse = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_Ac] != null) { + contents[_Ac] = (0, import_smithy_client.expectString)(output[_Ac]); + } + return contents; +}, "de_GetAccessKeyInfoResponse"); +var de_GetCallerIdentityResponse = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_UI] != null) { + contents[_UI] = (0, import_smithy_client.expectString)(output[_UI]); + } + if (output[_Ac] != null) { + contents[_Ac] = (0, import_smithy_client.expectString)(output[_Ac]); + } + if (output[_Ar] != null) { + contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]); + } + return contents; +}, "de_GetCallerIdentityResponse"); +var de_GetFederationTokenResponse = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_C] != null) { + contents[_C] = de_Credentials(output[_C], context); + } + if (output[_FU] != null) { + contents[_FU] = de_FederatedUser(output[_FU], context); + } + if (output[_PPS] != null) { + contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]); + } + return contents; +}, "de_GetFederationTokenResponse"); +var de_GetSessionTokenResponse = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_C] != null) { + contents[_C] = de_Credentials(output[_C], context); + } + return contents; +}, "de_GetSessionTokenResponse"); +var de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_m] != null) { + contents[_m] = (0, import_smithy_client.expectString)(output[_m]); + } + return contents; +}, "de_IDPCommunicationErrorException"); +var de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_m] != null) { + contents[_m] = (0, import_smithy_client.expectString)(output[_m]); + } + return contents; +}, "de_IDPRejectedClaimException"); +var de_InvalidAuthorizationMessageException = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_m] != null) { + contents[_m] = (0, import_smithy_client.expectString)(output[_m]); + } + return contents; +}, "de_InvalidAuthorizationMessageException"); +var de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_m] != null) { + contents[_m] = (0, import_smithy_client.expectString)(output[_m]); + } + return contents; +}, "de_InvalidIdentityTokenException"); +var de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_m] != null) { + contents[_m] = (0, import_smithy_client.expectString)(output[_m]); + } + return contents; +}, "de_MalformedPolicyDocumentException"); +var de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_m] != null) { + contents[_m] = (0, import_smithy_client.expectString)(output[_m]); + } + return contents; +}, "de_PackedPolicyTooLargeException"); +var de_RegionDisabledException = /* @__PURE__ */ __name((output, context) => { + const contents = {}; + if (output[_m] != null) { + contents[_m] = (0, import_smithy_client.expectString)(output[_m]); + } + return contents; +}, "de_RegionDisabledException"); +var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] +}), "deserializeMetadata"); +var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString"); +var throwDefaultError = (0, import_smithy_client.withBaseException)(STSServiceException); +var buildHttpRpcRequest = /* @__PURE__ */ __name(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 + }; + if (resolvedHostname !== void 0) { + contents.hostname = resolvedHostname; + } + if (body !== void 0) { + contents.body = body; + } + return new import_protocol_http.HttpRequest(contents); +}, "buildHttpRpcRequest"); +var SHARED_HEADERS = { + "content-type": "application/x-www-form-urlencoded" +}; +var _ = "2011-06-15"; +var _A = "Action"; +var _AKI = "AccessKeyId"; +var _AR = "AssumeRole"; +var _ARI = "AssumedRoleId"; +var _ARU = "AssumedRoleUser"; +var _ARWSAML = "AssumeRoleWithSAML"; +var _ARWWI = "AssumeRoleWithWebIdentity"; +var _Ac = "Account"; +var _Ar = "Arn"; +var _Au = "Audience"; +var _C = "Credentials"; +var _CA = "ContextAssertion"; +var _DAM = "DecodeAuthorizationMessage"; +var _DM = "DecodedMessage"; +var _DS = "DurationSeconds"; +var _E = "Expiration"; +var _EI = "ExternalId"; +var _EM = "EncodedMessage"; +var _FU = "FederatedUser"; +var _FUI = "FederatedUserId"; +var _GAKI = "GetAccessKeyInfo"; +var _GCI = "GetCallerIdentity"; +var _GFT = "GetFederationToken"; +var _GST = "GetSessionToken"; +var _I = "Issuer"; +var _K = "Key"; +var _N = "Name"; +var _NQ = "NameQualifier"; +var _P = "Policy"; +var _PA = "PolicyArns"; +var _PAr = "PrincipalArn"; +var _PAro = "ProviderArn"; +var _PC = "ProvidedContexts"; +var _PI = "ProviderId"; +var _PPS = "PackedPolicySize"; +var _Pr = "Provider"; +var _RA = "RoleArn"; +var _RSN = "RoleSessionName"; +var _S = "Subject"; +var _SAK = "SecretAccessKey"; +var _SAMLA = "SAMLAssertion"; +var _SFWIT = "SubjectFromWebIdentityToken"; +var _SI = "SourceIdentity"; +var _SN = "SerialNumber"; +var _ST = "SubjectType"; +var _STe = "SessionToken"; +var _T = "Tags"; +var _TC = "TokenCode"; +var _TTK = "TransitiveTagKeys"; +var _UI = "UserId"; +var _V = "Version"; +var _Va = "Value"; +var _WIT = "WebIdentityToken"; +var _a = "arn"; +var _m = "message"; +var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + const parser = new import_fast_xml_parser.XMLParser({ + attributeNamePrefix: "", + htmlEntities: true, + ignoreAttributes: false, + ignoreDeclaration: true, + parseTagValue: false, + trimValues: false, + tagValueProcessor: (_2, val) => val.trim() === "" && val.includes("\n") ? "" : void 0 + }); + parser.addEntity("#xD", "\r"); + parser.addEntity("#10", "\n"); + const parsedObj = parser.parse(encoded); + const textNodeName = "#text"; + const key = Object.keys(parsedObj)[0]; + const parsedObjToReturn = parsedObj[key]; + if (parsedObjToReturn[textNodeName]) { + parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; + delete parsedObjToReturn[textNodeName]; } + return (0, import_smithy_client.getValueFromTextNode)(parsedObjToReturn); + } + return {}; +}), "parseBody"); +var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => { + const value = await parseBody(errorBody, context); + if (value.Error) { + value.Error.message = value.Error.message ?? value.Error.Message; + } + return value; +}, "parseErrorBody"); +var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString"); +var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => { + var _a2; + if (((_a2 = data.Error) == null ? void 0 : _a2.Code) !== void 0) { + return data.Error.Code; + } + if (output.statusCode == 404) { + return "NotFound"; + } +}, "loadQueryErrorCode"); + +// src/commands/AssumeRoleCommand.ts +var _AssumeRoleCommand = class _AssumeRoleCommand extends import_smithy_client.Command.classBuilder().ep({ + ...import_EndpointParameters.commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() { +}; +__name(_AssumeRoleCommand, "AssumeRoleCommand"); +var AssumeRoleCommand = _AssumeRoleCommand; + +// src/commands/AssumeRoleWithSAMLCommand.ts + + + + +var import_EndpointParameters2 = __nccwpck_require__(510); +var _AssumeRoleWithSAMLCommand = class _AssumeRoleWithSAMLCommand extends import_smithy_client.Command.classBuilder().ep({ + ...import_EndpointParameters2.commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").f(AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog).ser(se_AssumeRoleWithSAMLCommand).de(de_AssumeRoleWithSAMLCommand).build() { +}; +__name(_AssumeRoleWithSAMLCommand, "AssumeRoleWithSAMLCommand"); +var AssumeRoleWithSAMLCommand = _AssumeRoleWithSAMLCommand; + +// src/commands/AssumeRoleWithWebIdentityCommand.ts + + + + +var import_EndpointParameters3 = __nccwpck_require__(510); +var _AssumeRoleWithWebIdentityCommand = class _AssumeRoleWithWebIdentityCommand extends import_smithy_client.Command.classBuilder().ep({ + ...import_EndpointParameters3.commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog).ser(se_AssumeRoleWithWebIdentityCommand).de(de_AssumeRoleWithWebIdentityCommand).build() { +}; +__name(_AssumeRoleWithWebIdentityCommand, "AssumeRoleWithWebIdentityCommand"); +var AssumeRoleWithWebIdentityCommand = _AssumeRoleWithWebIdentityCommand; + +// src/commands/DecodeAuthorizationMessageCommand.ts + + + + +var import_EndpointParameters4 = __nccwpck_require__(510); +var _DecodeAuthorizationMessageCommand = class _DecodeAuthorizationMessageCommand extends import_smithy_client.Command.classBuilder().ep({ + ...import_EndpointParameters4.commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").f(void 0, void 0).ser(se_DecodeAuthorizationMessageCommand).de(de_DecodeAuthorizationMessageCommand).build() { }; -const expectNonNull = (value, location) => { - if (value === null || value === undefined) { - if (location) { - throw new TypeError(`Expected a non-null value for ${location}`); - } - throw new TypeError("Expected a non-null value"); - } - return value; +__name(_DecodeAuthorizationMessageCommand, "DecodeAuthorizationMessageCommand"); +var DecodeAuthorizationMessageCommand = _DecodeAuthorizationMessageCommand; + +// src/commands/GetAccessKeyInfoCommand.ts + + + + +var import_EndpointParameters5 = __nccwpck_require__(510); +var _GetAccessKeyInfoCommand = class _GetAccessKeyInfoCommand extends import_smithy_client.Command.classBuilder().ep({ + ...import_EndpointParameters5.commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").f(void 0, void 0).ser(se_GetAccessKeyInfoCommand).de(de_GetAccessKeyInfoCommand).build() { }; -exports.expectNonNull = expectNonNull; -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}`); +__name(_GetAccessKeyInfoCommand, "GetAccessKeyInfoCommand"); +var GetAccessKeyInfoCommand = _GetAccessKeyInfoCommand; + +// src/commands/GetCallerIdentityCommand.ts + + + + +var import_EndpointParameters6 = __nccwpck_require__(510); +var _GetCallerIdentityCommand = class _GetCallerIdentityCommand extends import_smithy_client.Command.classBuilder().ep({ + ...import_EndpointParameters6.commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").f(void 0, void 0).ser(se_GetCallerIdentityCommand).de(de_GetCallerIdentityCommand).build() { }; -exports.expectObject = expectObject; -const expectString = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value === "string") { - return value; - } - if (["boolean", "number", "bigint"].includes(typeof value)) { - exports.logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); - return String(value); - } - throw new TypeError(`Expected string, got ${typeof value}: ${value}`); +__name(_GetCallerIdentityCommand, "GetCallerIdentityCommand"); +var GetCallerIdentityCommand = _GetCallerIdentityCommand; + +// src/commands/GetFederationTokenCommand.ts + + + + +var import_EndpointParameters7 = __nccwpck_require__(510); +var _GetFederationTokenCommand = class _GetFederationTokenCommand extends import_smithy_client.Command.classBuilder().ep({ + ...import_EndpointParameters7.commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").f(void 0, GetFederationTokenResponseFilterSensitiveLog).ser(se_GetFederationTokenCommand).de(de_GetFederationTokenCommand).build() { }; -exports.expectString = expectString; -const expectUnion = (value) => { - if (value === null || value === undefined) { - return undefined; - } - const asObject = (0, exports.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; -}; -exports.expectUnion = expectUnion; -const strictParseDouble = (value) => { - if (typeof value == "string") { - return (0, exports.expectNumber)(parseNumber(value)); - } - return (0, exports.expectNumber)(value); -}; -exports.strictParseDouble = strictParseDouble; -exports.strictParseFloat = exports.strictParseDouble; -const strictParseFloat32 = (value) => { - if (typeof value == "string") { - return (0, exports.expectFloat32)(parseNumber(value)); - } - return (0, exports.expectFloat32)(value); -}; -exports.strictParseFloat32 = strictParseFloat32; -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 (0, exports.expectNumber)(value); -}; -exports.limitedParseDouble = limitedParseDouble; -exports.handleFloat = exports.limitedParseDouble; -exports.limitedParseFloat = exports.limitedParseDouble; -const limitedParseFloat32 = (value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return (0, exports.expectFloat32)(value); -}; -exports.limitedParseFloat32 = limitedParseFloat32; -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}`); - } +__name(_GetFederationTokenCommand, "GetFederationTokenCommand"); +var GetFederationTokenCommand = _GetFederationTokenCommand; + +// src/commands/GetSessionTokenCommand.ts + + + + +var import_EndpointParameters8 = __nccwpck_require__(510); +var _GetSessionTokenCommand = class _GetSessionTokenCommand extends import_smithy_client.Command.classBuilder().ep({ + ...import_EndpointParameters8.commonParams +}).m(function(Command, cs, config, o) { + return [ + (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize), + (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()) + ]; +}).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").f(void 0, GetSessionTokenResponseFilterSensitiveLog).ser(se_GetSessionTokenCommand).de(de_GetSessionTokenCommand).build() { }; -const strictParseLong = (value) => { - if (typeof value === "string") { - return (0, exports.expectLong)(parseNumber(value)); +__name(_GetSessionTokenCommand, "GetSessionTokenCommand"); +var GetSessionTokenCommand = _GetSessionTokenCommand; + +// src/STS.ts +var import_STSClient = __nccwpck_require__(4195); +var commands = { + AssumeRoleCommand, + AssumeRoleWithSAMLCommand, + AssumeRoleWithWebIdentityCommand, + DecodeAuthorizationMessageCommand, + GetAccessKeyInfoCommand, + GetCallerIdentityCommand, + GetFederationTokenCommand, + GetSessionTokenCommand +}; +var _STS = class _STS extends import_STSClient.STSClient { +}; +__name(_STS, "STS"); +var STS = _STS; +(0, import_smithy_client.createAggregatedClient)(commands, STS); + +// src/index.ts +var import_EndpointParameters9 = __nccwpck_require__(510); +var import_runtimeExtensions = __nccwpck_require__(2053); +var import_util_endpoints = __nccwpck_require__(3350); + +// src/defaultStsRoleAssumers.ts +var ASSUME_ROLE_DEFAULT_REGION = "us-east-1"; +var resolveRegion = /* @__PURE__ */ __name(async (_region, _parentRegion, credentialProviderLogger) => { + var _a2; + const region = typeof _region === "function" ? await _region() : _region; + const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; + (_a2 = credentialProviderLogger == null ? void 0 : credentialProviderLogger.debug) == null ? void 0 : _a2.call( + credentialProviderLogger, + "@aws-sdk/client-sts::resolveRegion", + "accepting first of:", + `${region} (provider)`, + `${parentRegion} (parent client)`, + `${ASSUME_ROLE_DEFAULT_REGION} (STS default)` + ); + return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION; +}, "resolveRegion"); +var getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => { + let stsClient; + let closureSourceCreds; + return async (sourceCreds, params) => { + var _a2, _b, _c; + closureSourceCreds = sourceCreds; + if (!stsClient) { + const { + logger = (_a2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _a2.logger, + region, + requestHandler = (_b = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _b.requestHandler, + credentialProviderLogger + } = stsOptions; + const resolvedRegion = await resolveRegion( + region, + (_c = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _c.region, + credentialProviderLogger + ); + stsClient = new stsClientCtor({ + // A hack to make sts client uses the credential in current closure. + credentialDefaultProvider: () => async () => closureSourceCreds, + region: resolvedRegion, + requestHandler, + logger + }); } - return (0, exports.expectLong)(value); -}; -exports.strictParseLong = strictParseLong; -exports.strictParseInt = exports.strictParseLong; -const strictParseInt32 = (value) => { - if (typeof value === "string") { - return (0, exports.expectInt32)(parseNumber(value)); + const { Credentials: Credentials2 } = await stsClient.send(new AssumeRoleCommand(params)); + if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) { + throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); } - return (0, exports.expectInt32)(value); -}; -exports.strictParseInt32 = strictParseInt32; -const strictParseShort = (value) => { - if (typeof value === "string") { - return (0, exports.expectShort)(parseNumber(value)); + return { + accessKeyId: Credentials2.AccessKeyId, + secretAccessKey: Credentials2.SecretAccessKey, + sessionToken: Credentials2.SessionToken, + expiration: Credentials2.Expiration, + // TODO(credentialScope): access normally when shape is updated. + credentialScope: Credentials2.CredentialScope + }; + }; +}, "getDefaultRoleAssumer"); +var getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => { + let stsClient; + return async (params) => { + var _a2, _b, _c; + if (!stsClient) { + const { + logger = (_a2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _a2.logger, + region, + requestHandler = (_b = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _b.requestHandler, + credentialProviderLogger + } = stsOptions; + const resolvedRegion = await resolveRegion( + region, + (_c = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _c.region, + credentialProviderLogger + ); + stsClient = new stsClientCtor({ + region: resolvedRegion, + requestHandler, + logger + }); } - return (0, exports.expectShort)(value); -}; -exports.strictParseShort = strictParseShort; -const strictParseByte = (value) => { - if (typeof value === "string") { - return (0, exports.expectByte)(parseNumber(value)); + const { Credentials: Credentials2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params)); + if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) { + throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); } - return (0, exports.expectByte)(value); -}; -exports.strictParseByte = strictParseByte; -const stackTraceWarning = (message) => { - return String(new TypeError(message).stack || message) - .split("\n") - .slice(0, 5) - .filter((s) => !s.includes("stackTraceWarning")) - .join("\n"); -}; -exports.logger = { - warn: console.warn, -}; + return { + accessKeyId: Credentials2.AccessKeyId, + secretAccessKey: Credentials2.SecretAccessKey, + sessionToken: Credentials2.SessionToken, + expiration: Credentials2.Expiration, + // TODO(credentialScope): access normally when shape is updated. + credentialScope: Credentials2.CredentialScope + }; + }; +}, "getDefaultRoleAssumerWithWebIdentity"); + +// src/defaultRoleAssumers.ts +var import_STSClient2 = __nccwpck_require__(4195); +var getCustomizableStsClientCtor = /* @__PURE__ */ __name((baseCtor, customizations) => { + var _a2; + if (!customizations) + return baseCtor; + else + return _a2 = class extends baseCtor { + constructor(config) { + super(config); + for (const customization of customizations) { + this.middlewareStack.use(customization); + } + } + }, __name(_a2, "CustomizableSTSClient"), _a2; +}, "getCustomizableStsClientCtor"); +var getDefaultRoleAssumer2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumer"); +var getDefaultRoleAssumerWithWebIdentity2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumerWithWebIdentity"); +var decorateDefaultCredentialProvider = /* @__PURE__ */ __name((provider) => (input) => provider({ + roleAssumer: getDefaultRoleAssumer2(input), + roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input), + ...input +}), "decorateDefaultCredentialProvider"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 15342: +/***/ 3405: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolvedPath = void 0; -const extended_encode_uri_component_1 = __nccwpck_require__(76016); -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 + "."); - } - resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel - ? labelValue - .split("/") - .map((segment) => (0, extended_encode_uri_component_1.extendedEncodeURIComponent)(segment)) - .join("/") - : (0, extended_encode_uri_component_1.extendedEncodeURIComponent)(labelValue)); - } - else { - throw new Error("No value provided for input HTTP label: " + memberName + "."); - } - return resolvedPath; +exports.getRuntimeConfig = void 0; +const tslib_1 = __nccwpck_require__(4351); +const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(7947)); +const credentialDefaultProvider_1 = __nccwpck_require__(4800); +const core_1 = __nccwpck_require__(9963); +const util_user_agent_node_1 = __nccwpck_require__(8095); +const config_resolver_1 = __nccwpck_require__(3098); +const core_2 = __nccwpck_require__(5829); +const hash_node_1 = __nccwpck_require__(3081); +const middleware_retry_1 = __nccwpck_require__(6039); +const node_config_provider_1 = __nccwpck_require__(3461); +const node_http_handler_1 = __nccwpck_require__(8303); +const util_body_length_node_1 = __nccwpck_require__(8075); +const util_retry_1 = __nccwpck_require__(4902); +const runtimeConfig_shared_1 = __nccwpck_require__(2642); +const smithy_client_1 = __nccwpck_require__(3570); +const util_defaults_mode_node_1 = __nccwpck_require__(2429); +const smithy_client_2 = __nccwpck_require__(3570); +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); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider_1.defaultProvider, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || + (async (idProps) => await (0, credentialDefaultProvider_1.defaultProvider)(idProps?.__config || {})()), + signer: new core_1.AwsSdkSigV4Signer(), + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new core_2.NoAuthSigner(), + }, + ], + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + 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, + }), + 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), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; }; -exports.resolvedPath = resolvedPath; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 59796: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2642: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serializeFloat = void 0; -const serializeFloat = (value) => { - if (value !== value) { - return "NaN"; - } - switch (value) { - case Infinity: - return "Infinity"; - case -Infinity: - return "-Infinity"; - default: - return value; - } +exports.getRuntimeConfig = void 0; +const core_1 = __nccwpck_require__(9963); +const core_2 = __nccwpck_require__(5829); +const smithy_client_1 = __nccwpck_require__(3570); +const url_parser_1 = __nccwpck_require__(4681); +const util_base64_1 = __nccwpck_require__(5600); +const util_utf8_1 = __nccwpck_require__(1895); +const httpAuthSchemeProvider_1 = __nccwpck_require__(7145); +const endpointResolver_1 = __nccwpck_require__(1203); +const getRuntimeConfig = (config) => { + return { + apiVersion: "2011-06-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.defaultSTSHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new core_1.AwsSdkSigV4Signer(), + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new core_2.NoAuthSigner(), + }, + ], + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + serviceId: config?.serviceId ?? "STS", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, + }; }; -exports.serializeFloat = serializeFloat; +exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -/***/ 1752: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2053: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._json = void 0; -const _json = (obj) => { - if (obj == null) { - return {}; - } - if (Array.isArray(obj)) { - return obj.filter((_) => _ != null); +exports.resolveRuntimeExtensions = void 0; +const region_config_resolver_1 = __nccwpck_require__(8156); +const protocol_http_1 = __nccwpck_require__(2223); +const smithy_client_1 = __nccwpck_require__(3570); +const httpAuthExtensionConfiguration_1 = __nccwpck_require__(8527); +const asPartial = (t) => t; +const resolveRuntimeExtensions = (runtimeConfig, extensions) => { + const extensionConfiguration = { + ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)), + }; + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return { + ...runtimeConfig, + ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), + ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), + ...(0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration), + }; +}; +exports.resolveRuntimeExtensions = resolveRuntimeExtensions; + + +/***/ }), + +/***/ 8303: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, + NodeHttp2Handler: () => NodeHttp2Handler, + NodeHttpHandler: () => NodeHttpHandler, + streamCollector: () => streamCollector +}); +module.exports = __toCommonJS(src_exports); + +// src/node-http-handler.ts +var import_protocol_http = __nccwpck_require__(2223); +var import_querystring_builder = __nccwpck_require__(8815); +var import_http = __nccwpck_require__(3685); +var import_https = __nccwpck_require__(5687); + +// src/constants.ts +var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +// src/get-transformed-headers.ts +var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}, "getTransformedHeaders"); + +// src/set-connection-timeout.ts +var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject( + Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError" + }) + ); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } else { + clearTimeout(timeoutId); } - if (typeof obj === "object") { - const target = {}; - for (const key of Object.keys(obj)) { - if (obj[key] == null) { - continue; - } - target[key] = (0, exports._json)(obj[key]); + }); +}, "setConnectionTimeout"); + +// src/set-socket-keep-alive.ts +var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}, "setSocketKeepAlive"); + +// src/set-socket-timeout.ts +var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}, "setSocketTimeout"); + +// src/write-request-body.ts +var import_stream = __nccwpck_require__(2781); +var MIN_WAIT_TIME = 1e3; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + const headers = request.headers ?? {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }) + ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } +} +__name(writeRequestBody, "writeRequestBody"); +function writeBody(httpRequest, body) { + if (body instanceof import_stream.Readable) { + body.pipe(httpRequest); + } else if (body) { + httpRequest.end(Buffer.from(body)); + } else { + httpRequest.end(); + } +} +__name(writeBody, "writeBody"); + +// src/node-http-handler.ts +var DEFAULT_REQUEST_TIMEOUT = 0; +var _NodeHttpHandler = class _NodeHttpHandler { + constructor(options) { + this.socketWarningTimestamp = 0; + // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286 + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttpHandler(instanceOrOptions); + } + /** + * @internal + * + * @param agent - http(s) agent in use by the NodeHttpHandler instance. + * @returns timestamp of last emitted warning. + */ + static checkSocketUsage(agent, socketWarningTimestamp) { + var _a, _b; + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; + const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + console.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 target; + } } - return obj; + return socketWarningTimestamp; + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout ?? socketTimeout, + httpAgent: (() => { + if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { + return httpAgent; + } + return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { + return httpsAgent; + } + return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })() + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); + (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + let socketCheckTimeoutId; + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + clearTimeout(socketCheckTimeoutId); + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; + socketCheckTimeoutId = setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp); + }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)); + const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); + let auth = void 0; + 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}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent, + auth + }; + const requestFunc = isSSL ? import_https.request : import_http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new import_protocol_http.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); + } + }); + setConnectionTimeout(req, reject, this.config.connectionTimeout); + setSocketTimeout(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + setSocketKeepAlive(req, { + // @ts-expect-error keepAlive is not public on httpAgent. + keepAlive: httpAgent.keepAlive, + // @ts-expect-error keepAliveMsecs is not public on httpAgent. + keepAliveMsecs: httpAgent.keepAliveMsecs + }); + } + writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } }; -exports._json = _json; +__name(_NodeHttpHandler, "NodeHttpHandler"); +var NodeHttpHandler = _NodeHttpHandler; +// src/node-http2-handler.ts -/***/ }), -/***/ 92480: -/***/ ((__unused_webpack_module, exports) => { +var import_http22 = __nccwpck_require__(5158); -"use strict"; +// src/node-http2-connection-manager.ts +var import_http2 = __toESM(__nccwpck_require__(5158)); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitEvery = void 0; -function splitEvery(value, delimiter, numDelimiters) { - if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { - throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); +// src/node-http2-connection-pool.ts +var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); + } + } + offerLast(session) { + this.sessions.push(session); + } + contains(session) { + return this.sessions.includes(session); + } + remove(session) { + this.sessions = this.sessions.filter((s) => s !== session); + } + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); + } + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); + } + } + } + } +}; +__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); +var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; + +// src/node-http2-connection-manager.ts +var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = /* @__PURE__ */ new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + lease(requestContext, connectionConfiguration) { + const 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 = import_http2.default.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 = /* @__PURE__ */ __name(() => { + session.destroy(); + this.deleteSession(url, session); + }, "destroySessionCb"); + 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; + } + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; + } + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); + } + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); } - const segments = value.split(delimiter); - if (numDelimiters === 1) { - return segments; + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } +}; +__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); +var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; + +// src/node-http2-handler.ts +var _NodeHttp2Handler = class _NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttp2Handler(instanceOrOptions); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } } - const compoundSegments = []; - let currentSegment = ""; - for (let i = 0; i < segments.length; i++) { - if (currentSegment === "") { - currentSegment = segments[i]; + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a; + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (abortSignal == null ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = 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: (_a = this.config) == null ? void 0 : _a.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = /* @__PURE__ */ __name((err) => { + if (disableConcurrentStreams) { + this.destroySession(session); } - else { - currentSegment += delimiter + segments[i]; + fulfilled = true; + reject(err); + }, "rejectWithDestroy"); + const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [import_http22.constants.HTTP2_HEADER_PATH]: path, + [import_http22.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new import_protocol_http.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + 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 ((i + 1) % numDelimiters === 0) { - compoundSegments.push(currentSegment); - currentSegment = ""; + if (!fulfilled) { + rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); } + }); + writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + /** + * Destroys a session. + * @param session The session to destroy. + */ + destroySession(session) { + if (!session.destroyed) { + session.destroy(); } - if (currentSegment !== "") { - compoundSegments.push(currentSegment); - } - return compoundSegments; -} -exports.splitEvery = splitEvery; + } +}; +__name(_NodeHttp2Handler, "NodeHttp2Handler"); +var NodeHttp2Handler = _NodeHttp2Handler; +// src/stream-collector/collector.ts -/***/ }), +var _Collector = class _Collector extends import_stream.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +}; +__name(_Collector, "Collector"); +var Collector = _Collector; -/***/ 10301: -/***/ ((__unused_webpack_module, exports) => { +// src/stream-collector/index.ts +var streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}), "streamCollector"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 81401: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2223: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(1551); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 74394: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 67504: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - +/***/ 8815: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 82511: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + buildQueryString: () => buildQueryString +}); +module.exports = __toCommonJS(src_exports); +var import_util_uri_escape = __nccwpck_require__(2996); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, import_util_uri_escape.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; + } + parts.push(qsEntry); + } + } + return parts.join("&"); +} +__name(buildQueryString, "buildQueryString"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 37651: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1551: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 3063: -/***/ ((__unused_webpack_module, exports) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: -Object.defineProperty(exports, "__esModule", ({ value: true })); +0 && (0); -/***/ }), -/***/ 44900: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ }), -"use strict"; +/***/ 2996: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(3063), exports); -tslib_1.__exportStar(__nccwpck_require__(25705), exports); -tslib_1.__exportStar(__nccwpck_require__(36826), exports); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath +}); +module.exports = __toCommonJS(src_exports); -/***/ }), +// src/escape-uri.ts +var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) +), "escapeUri"); +var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); -/***/ 25705: -/***/ ((__unused_webpack_module, exports) => { +// src/escape-uri-path.ts +var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 36826: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9963: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AWSSDKSigV4Signer: () => AWSSDKSigV4Signer, + AwsSdkSigV4Signer: () => AwsSdkSigV4Signer, + _toBool: () => _toBool, + _toNum: () => _toNum, + _toStr: () => _toStr, + awsExpectUnion: () => awsExpectUnion, + emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion, + resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config, + resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config +}); +module.exports = __toCommonJS(src_exports); + +// src/client/emitWarningIfUnsupportedVersion.ts +var warningEmitted = false; +var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => { + if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) { + warningEmitted = true; + process.emitWarning( + `NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will +no longer support Node.js 14.x on May 1, 2024. + +To continue receiving updates to AWS services, bug fixes, and security +updates please upgrade to an active Node.js LTS version. + +More information can be found at: https://a.co/dzr2AJd` + ); + } +}, "emitWarningIfUnsupportedVersion"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts -/***/ }), +// src/httpAuthSchemes/utils/getDateHeader.ts +var import_protocol_http = __nccwpck_require__(7122); +var getDateHeader = /* @__PURE__ */ __name((response) => { + var _a, _b; + return import_protocol_http.HttpResponse.isInstance(response) ? ((_a = response.headers) == null ? void 0 : _a.date) ?? ((_b = response.headers) == null ? void 0 : _b.Date) : void 0; +}, "getDateHeader"); -/***/ 2037: -/***/ ((__unused_webpack_module, exports) => { +// src/httpAuthSchemes/utils/getSkewCorrectedDate.ts +var getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate"); -"use strict"; +// src/httpAuthSchemes/utils/isClockSkewed.ts +var isClockSkewed = /* @__PURE__ */ __name((clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5, "isClockSkewed"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/httpAuthSchemes/utils/getUpdatedSystemClockOffset.ts +var getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); + } + return currentSystemClockOffset; +}, "getUpdatedSystemClockOffset"); +// src/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts +var throwSigningPropertyError = /* @__PURE__ */ __name((name, property) => { + if (!property) { + throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); + } + return property; +}, "throwSigningPropertyError"); +var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => { + var _a, _b, _c; + const context = throwSigningPropertyError( + "context", + signingProperties.context + ); + const config = throwSigningPropertyError("config", signingProperties.config); + const authScheme = (_c = (_b = (_a = context.endpointV2) == null ? void 0 : _a.properties) == null ? void 0 : _b.authSchemes) == null ? void 0 : _c[0]; + const signerFunction = throwSigningPropertyError( + "signer", + config.signer + ); + const signer = await signerFunction(authScheme); + const signingRegion = signingProperties == null ? void 0 : signingProperties.signingRegion; + const signingName = signingProperties == null ? void 0 : signingProperties.signingName; + return { + config, + signer, + signingRegion, + signingName + }; +}, "validateSigningProperties"); +var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer { + async sign(httpRequest, identity, signingProperties) { + if (!import_protocol_http.HttpRequest.isInstance(httpRequest)) { + throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); + } + const { config, signer, signingRegion, signingName } = await validateSigningProperties(signingProperties); + const signedRequest = await signer.sign(httpRequest, { + signingDate: getSkewCorrectedDate(config.systemClockOffset), + signingRegion, + signingService: signingName + }); + return signedRequest; + } + errorHandler(signingProperties) { + return (error) => { + const serverTime = error.ServerTime ?? getDateHeader(error.$response); + if (serverTime) { + const config = throwSigningPropertyError("config", signingProperties.config); + const initialSystemClockOffset = config.systemClockOffset; + config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); + const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; + if (clockSkewCorrected && error.$metadata) { + error.$metadata.clockSkewCorrected = true; + } + } + throw error; + }; + } + successHandler(httpResponse, signingProperties) { + const dateHeader = getDateHeader(httpResponse); + if (dateHeader) { + const config = throwSigningPropertyError("config", signingProperties.config); + config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); + } + } +}; +__name(_AwsSdkSigV4Signer, "AwsSdkSigV4Signer"); +var AwsSdkSigV4Signer = _AwsSdkSigV4Signer; +var AWSSDKSigV4Signer = AwsSdkSigV4Signer; + +// src/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts +var import_core = __nccwpck_require__(5829); +var import_signature_v4 = __nccwpck_require__(1528); +var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => { + let normalizedCreds; + if (config.credentials) { + normalizedCreds = (0, import_core.memoizeIdentityProvider)(config.credentials, import_core.isIdentityExpired, import_core.doesIdentityRequireRefresh); + } + if (!normalizedCreds) { + if (config.credentialDefaultProvider) { + normalizedCreds = (0, import_core.normalizeProvider)( + config.credentialDefaultProvider( + Object.assign({}, config, { + parentClientConfig: config + }) + ) + ); + } else { + normalizedCreds = /* @__PURE__ */ __name(async () => { + throw new Error("`credentials` is missing"); + }, "normalizedCreds"); + } + } + const { + // Default for signingEscapePath + signingEscapePath = true, + // Default for systemClockOffset + systemClockOffset = config.systemClockOffset || 0, + // No default for sha256 since it is platform dependent + sha256 + } = config; + let signer; + if (config.signer) { + signer = (0, import_core.normalizeProvider)(config.signer); + } else if (config.regionInfoProvider) { + signer = /* @__PURE__ */ __name(() => (0, import_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: normalizedCreds, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath + }; + const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; + return new SignerCtor(params); + }), "signer"); + } else { + signer = /* @__PURE__ */ __name(async (authScheme) => { + authScheme = Object.assign( + {}, + { + name: "sigv4", + signingName: config.signingName || config.defaultSigningName, + signingRegion: await (0, import_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: normalizedCreds, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath + }; + const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; + return new SignerCtor(params); + }, "signer"); + } + return { + ...config, + systemClockOffset, + signingEscapePath, + credentials: normalizedCreds, + signer + }; +}, "resolveAwsSdkSigV4Config"); +var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; -/***/ }), +// src/protocols/coercing-serializers.ts +var _toStr = /* @__PURE__ */ __name((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; +}, "_toStr"); +var _toBool = /* @__PURE__ */ __name((val) => { + if (val == null) { + return val; + } + if (typeof val === "number") { + } + 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; +}, "_toBool"); +var _toNum = /* @__PURE__ */ __name((val) => { + if (val == null) { + return val; + } + if (typeof val === "boolean") { + } + 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; +}, "_toNum"); -/***/ 68866: -/***/ ((__unused_webpack_module, exports) => { +// src/protocols/json/awsExpectUnion.ts +var import_smithy_client = __nccwpck_require__(3570); +var awsExpectUnion = /* @__PURE__ */ __name((value) => { + if (value == null) { + return void 0; + } + if (typeof value === "object" && "__type" in value) { + delete value.__type; + } + return (0, import_smithy_client.expectUnion)(value); +}, "awsExpectUnion"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 75623: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7122: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(7391); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 89595: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 99451: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7391: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 99766: -/***/ ((__unused_webpack_module, exports) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 34898: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5972: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE, + ENV_EXPIRATION: () => ENV_EXPIRATION, + ENV_KEY: () => ENV_KEY, + ENV_SECRET: () => ENV_SECRET, + ENV_SESSION: () => ENV_SESSION, + fromEnv: () => fromEnv +}); +module.exports = __toCommonJS(src_exports); + +// src/fromEnv.ts +var import_property_provider = __nccwpck_require__(9721); +var ENV_KEY = "AWS_ACCESS_KEY_ID"; +var ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; +var ENV_SESSION = "AWS_SESSION_TOKEN"; +var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; +var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; +var fromEnv = /* @__PURE__ */ __name((init) => async () => { + var _a; + (_a = init == null ? void 0 : init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-env", "fromEnv"); + const accessKeyId = process.env[ENV_KEY]; + const secretAccessKey = process.env[ENV_SECRET]; + const sessionToken = process.env[ENV_SESSION]; + const expiry = process.env[ENV_EXPIRATION]; + const credentialScope = process.env[ENV_CREDENTIAL_SCOPE]; + if (accessKeyId && secretAccessKey) { + return { + accessKeyId, + secretAccessKey, + ...sessionToken && { sessionToken }, + ...expiry && { expiration: new Date(expiry) }, + ...credentialScope && { credentialScope } + }; + } + throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials."); +}, "fromEnv"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 4527: +/***/ 3757: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(89595), exports); -tslib_1.__exportStar(__nccwpck_require__(99451), exports); -tslib_1.__exportStar(__nccwpck_require__(99766), exports); -tslib_1.__exportStar(__nccwpck_require__(93330), exports); -tslib_1.__exportStar(__nccwpck_require__(34898), exports); +exports.checkUrl = void 0; +const property_provider_1 = __nccwpck_require__(9721); +const LOOPBACK_CIDR_IPv4 = "127.0.0.0/8"; +const LOOPBACK_CIDR_IPv6 = "::1/128"; +const ECS_CONTAINER_HOST = "169.254.170.2"; +const EKS_CONTAINER_HOST_IPv4 = "169.254.170.23"; +const EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]"; +const checkUrl = (url) => { + if (url.protocol === "https:") { + return; + } + if (url.hostname === ECS_CONTAINER_HOST || + url.hostname === EKS_CONTAINER_HOST_IPv4 || + url.hostname === EKS_CONTAINER_HOST_IPv6) { + return; + } + if (url.hostname.includes("[")) { + if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") { + return; + } + } + else { + if (url.hostname === "localhost") { + return; + } + const ipComponents = url.hostname.split("."); + const inRange = (component) => { + const num = parseInt(component, 10); + return 0 <= num && num <= 255; + }; + if (ipComponents[0] === "127" && + inRange(ipComponents[1]) && + inRange(ipComponents[2]) && + inRange(ipComponents[3]) && + ipComponents.length === 4) { + return; + } + } + throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following: + - loopback CIDR 127.0.0.0/8 or [::1/128] + - ECS container host 169.254.170.2 + - EKS container host 169.254.170.23 or [fd00:ec2::23]`); +}; +exports.checkUrl = checkUrl; /***/ }), -/***/ 93330: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6070: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromHttp = void 0; +const tslib_1 = __nccwpck_require__(4351); +const node_http_handler_1 = __nccwpck_require__(4893); +const property_provider_1 = __nccwpck_require__(9721); +const promises_1 = tslib_1.__importDefault(__nccwpck_require__(3292)); +const checkUrl_1 = __nccwpck_require__(3757); +const requestHelpers_1 = __nccwpck_require__(9287); +const retry_wrapper_1 = __nccwpck_require__(9921); +const AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; +const DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2"; +const AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; +const AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"; +const AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; +const fromHttp = (options) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; + (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug("@aws-sdk/credential-provider-http", "fromHttp"); + let host; + const relative = (_b = options.awsContainerCredentialsRelativeUri) !== null && _b !== void 0 ? _b : process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI]; + const full = (_c = options.awsContainerCredentialsFullUri) !== null && _c !== void 0 ? _c : process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI]; + const token = (_d = options.awsContainerAuthorizationToken) !== null && _d !== void 0 ? _d : process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN]; + const tokenFile = (_e = options.awsContainerAuthorizationTokenFile) !== null && _e !== void 0 ? _e : process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE]; + if (relative && full) { + console.warn("AWS SDK HTTP credentials provider:", "you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."); + console.warn("awsContainerCredentialsFullUri will take precedence."); + } + if (token && tokenFile) { + console.warn("AWS SDK HTTP credentials provider:", "you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."); + console.warn("awsContainerAuthorizationToken will take precedence."); + } + if (full) { + host = full; + } + else if (relative) { + host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`; + } + else { + throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided. +Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`); + } + const url = new URL(host); + (0, checkUrl_1.checkUrl)(url); + const requestHandler = new node_http_handler_1.NodeHttpHandler({ + requestTimeout: (_f = options.timeout) !== null && _f !== void 0 ? _f : 1000, + connectionTimeout: (_g = options.timeout) !== null && _g !== void 0 ? _g : 1000, + }); + return (0, retry_wrapper_1.retryWrapper)(async () => { + const request = (0, requestHelpers_1.createGetRequest)(url); + if (token) { + request.headers.Authorization = token; + } + else if (tokenFile) { + request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString(); + } + try { + const result = await requestHandler.handle(request); + return (0, requestHelpers_1.getCredentials)(result.response); + } + catch (e) { + throw new property_provider_1.CredentialsProviderError(String(e)); + } + }, (_h = options.maxRetries) !== null && _h !== void 0 ? _h : 3, (_j = options.timeout) !== null && _j !== void 0 ? _j : 1000); +}; +exports.fromHttp = fromHttp; /***/ }), -/***/ 16845: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9287: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCredentials = exports.createGetRequest = void 0; +const property_provider_1 = __nccwpck_require__(9721); +const protocol_http_1 = __nccwpck_require__(8429); +const smithy_client_1 = __nccwpck_require__(3570); +const util_stream_1 = __nccwpck_require__(6607); +function createGetRequest(url) { + return new protocol_http_1.HttpRequest({ + protocol: url.protocol, + hostname: url.hostname, + port: Number(url.port), + path: url.pathname, + query: Array.from(url.searchParams.entries()).reduce((acc, [k, v]) => { + acc[k] = v; + return acc; + }, {}), + fragment: url.hash, + }); +} +exports.createGetRequest = createGetRequest; +async function getCredentials(response) { + var _a, _b; + const contentType = (_b = (_a = response === null || response === void 0 ? void 0 : response.headers["content-type"]) !== null && _a !== void 0 ? _a : response === null || response === void 0 ? void 0 : response.headers["Content-Type"]) !== null && _b !== void 0 ? _b : ""; + if (!contentType.includes("json")) { + console.warn("HTTP credential provider response header content-type was not application/json. Observed: " + contentType + "."); + } + const stream = (0, util_stream_1.sdkStreamMixin)(response.body); + const str = await stream.transformToString(); + if (response.statusCode === 200) { + const parsed = JSON.parse(str); + if (typeof parsed.AccessKeyId !== "string" || + typeof parsed.SecretAccessKey !== "string" || + typeof parsed.Token !== "string" || + typeof parsed.Expiration !== "string") { + throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: " + + "{ AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }"); + } + return { + accessKeyId: parsed.AccessKeyId, + secretAccessKey: parsed.SecretAccessKey, + sessionToken: parsed.Token, + expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration), + }; + } + if (response.statusCode >= 400 && response.statusCode < 500) { + let parsedBody = {}; + try { + parsedBody = JSON.parse(str); + } + catch (e) { } + throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`), { + Code: parsedBody.Code, + Message: parsedBody.Message, + }); + } + throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`); +} +exports.getCredentials = getCredentials; /***/ }), -/***/ 70490: +/***/ 9921: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, +exports.retryWrapper = void 0; +const retryWrapper = (toRetry, maxRetries, delayMs) => { + return async () => { + for (let i = 0; i < maxRetries; ++i) { + try { + return await toRetry(); + } + catch (e) { + await new Promise((resolve) => setTimeout(resolve, delayMs)); + } + } + return await toRetry(); }; }; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; +exports.retryWrapper = retryWrapper; /***/ }), -/***/ 44762: +/***/ 7290: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(70490); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; +exports.fromHttp = void 0; +var fromHttp_1 = __nccwpck_require__(6070); +Object.defineProperty(exports, "fromHttp", ({ enumerable: true, get: function () { return fromHttp_1.fromHttp; } })); /***/ }), -/***/ 34581: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 4893: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, + NodeHttp2Handler: () => NodeHttp2Handler, + NodeHttpHandler: () => NodeHttpHandler, + streamCollector: () => streamCollector +}); +module.exports = __toCommonJS(src_exports); + +// src/node-http-handler.ts +var import_protocol_http = __nccwpck_require__(8429); +var import_querystring_builder = __nccwpck_require__(3322); +var import_http = __nccwpck_require__(3685); +var import_https = __nccwpck_require__(5687); + +// src/constants.ts +var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +// src/get-transformed-headers.ts +var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}, "getTransformedHeaders"); +// src/set-connection-timeout.ts +var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject( + Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError" + }) + ); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } else { + clearTimeout(timeoutId); + } + }); +}, "setConnectionTimeout"); -/***/ }), +// src/set-socket-keep-alive.ts +var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}, "setSocketKeepAlive"); -/***/ 97169: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/set-socket-timeout.ts +var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}, "setSocketTimeout"); -"use strict"; +// src/write-request-body.ts +var import_stream = __nccwpck_require__(2781); +var MIN_WAIT_TIME = 1e3; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + const headers = request.headers ?? {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }) + ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } +} +__name(writeRequestBody, "writeRequestBody"); +function writeBody(httpRequest, body) { + if (body instanceof import_stream.Readable) { + body.pipe(httpRequest); + } else if (body) { + httpRequest.end(Buffer.from(body)); + } else { + httpRequest.end(); + } +} +__name(writeBody, "writeBody"); + +// src/node-http-handler.ts +var DEFAULT_REQUEST_TIMEOUT = 0; +var _NodeHttpHandler = class _NodeHttpHandler { + constructor(options) { + this.socketWarningTimestamp = 0; + // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286 + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttpHandler(instanceOrOptions); + } + /** + * @internal + * + * @param agent - http(s) agent in use by the NodeHttpHandler instance. + * @returns timestamp of last emitted warning. + */ + static checkSocketUsage(agent, socketWarningTimestamp) { + var _a, _b; + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; + const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + console.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; + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout ?? socketTimeout, + httpAgent: (() => { + if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { + return httpAgent; + } + return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { + return httpsAgent; + } + return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })() + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); + (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + let socketCheckTimeoutId; + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + clearTimeout(socketCheckTimeoutId); + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; + socketCheckTimeoutId = setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp); + }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)); + const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); + let auth = void 0; + 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}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent, + auth + }; + const requestFunc = isSSL ? import_https.request : import_http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new import_protocol_http.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); + } + }); + setConnectionTimeout(req, reject, this.config.connectionTimeout); + setSocketTimeout(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + setSocketKeepAlive(req, { + // @ts-expect-error keepAlive is not public on httpAgent. + keepAlive: httpAgent.keepAlive, + // @ts-expect-error keepAliveMsecs is not public on httpAgent. + keepAliveMsecs: httpAgent.keepAliveMsecs + }); + } + writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } +}; +__name(_NodeHttpHandler, "NodeHttpHandler"); +var NodeHttpHandler = _NodeHttpHandler; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(44762), exports); -tslib_1.__exportStar(__nccwpck_require__(34581), exports); -var checksum_1 = __nccwpck_require__(70490); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); +// src/node-http2-handler.ts -/***/ }), +var import_http22 = __nccwpck_require__(5158); -/***/ 47461: -/***/ ((__unused_webpack_module, exports) => { +// src/node-http2-connection-manager.ts +var import_http2 = __toESM(__nccwpck_require__(5158)); -"use strict"; +// src/node-http2-connection-pool.ts +var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); + } + } + offerLast(session) { + this.sessions.push(session); + } + contains(session) { + return this.sessions.includes(session); + } + remove(session) { + this.sessions = this.sessions.filter((s) => s !== session); + } + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); + } + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); + } + } + } + } +}; +__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); +var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); +// src/node-http2-connection-manager.ts +var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = /* @__PURE__ */ new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + lease(requestContext, connectionConfiguration) { + const 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 = import_http2.default.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 = /* @__PURE__ */ __name(() => { + session.destroy(); + this.deleteSession(url, session); + }, "destroySessionCb"); + 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; + } + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; + } + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); + } + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } +}; +__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); +var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; + +// src/node-http2-handler.ts +var _NodeHttp2Handler = class _NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttp2Handler(instanceOrOptions); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } + } + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a; + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (abortSignal == null ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = 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: (_a = this.config) == null ? void 0 : _a.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = /* @__PURE__ */ __name((err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }, "rejectWithDestroy"); + const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [import_http22.constants.HTTP2_HEADER_PATH]: path, + [import_http22.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new import_protocol_http.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + 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, requestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + /** + * Destroys a session. + * @param session The session to destroy. + */ + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } +}; +__name(_NodeHttp2Handler, "NodeHttp2Handler"); +var NodeHttp2Handler = _NodeHttp2Handler; +// src/stream-collector/collector.ts -/***/ }), +var _Collector = class _Collector extends import_stream.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +}; +__name(_Collector, "Collector"); +var Collector = _Collector; -/***/ 39502: -/***/ ((__unused_webpack_module, exports) => { +// src/stream-collector/index.ts +var streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}), "streamCollector"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 57741: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8429: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(5162); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 20509: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(39502), exports); -tslib_1.__exportStar(__nccwpck_require__(57741), exports); /***/ }), -/***/ 49185: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(10301), exports); -tslib_1.__exportStar(__nccwpck_require__(81401), exports); -tslib_1.__exportStar(__nccwpck_require__(74394), exports); -tslib_1.__exportStar(__nccwpck_require__(67504), exports); -tslib_1.__exportStar(__nccwpck_require__(82511), exports); -tslib_1.__exportStar(__nccwpck_require__(37651), exports); -tslib_1.__exportStar(__nccwpck_require__(44900), exports); -tslib_1.__exportStar(__nccwpck_require__(2037), exports); -tslib_1.__exportStar(__nccwpck_require__(68866), exports); -tslib_1.__exportStar(__nccwpck_require__(75623), exports); -tslib_1.__exportStar(__nccwpck_require__(4527), exports); -tslib_1.__exportStar(__nccwpck_require__(16845), exports); -tslib_1.__exportStar(__nccwpck_require__(97169), exports); -tslib_1.__exportStar(__nccwpck_require__(47461), exports); -tslib_1.__exportStar(__nccwpck_require__(20509), exports); -tslib_1.__exportStar(__nccwpck_require__(81715), exports); -tslib_1.__exportStar(__nccwpck_require__(98702), exports); -tslib_1.__exportStar(__nccwpck_require__(71123), exports); -tslib_1.__exportStar(__nccwpck_require__(1413), exports); -tslib_1.__exportStar(__nccwpck_require__(3528), exports); -tslib_1.__exportStar(__nccwpck_require__(81983), exports); -tslib_1.__exportStar(__nccwpck_require__(64125), exports); -tslib_1.__exportStar(__nccwpck_require__(28694), exports); -tslib_1.__exportStar(__nccwpck_require__(91573), exports); -tslib_1.__exportStar(__nccwpck_require__(17790), exports); -tslib_1.__exportStar(__nccwpck_require__(6228), exports); -tslib_1.__exportStar(__nccwpck_require__(10209), exports); -tslib_1.__exportStar(__nccwpck_require__(57026), exports); -tslib_1.__exportStar(__nccwpck_require__(82698), exports); -tslib_1.__exportStar(__nccwpck_require__(14891), exports); -tslib_1.__exportStar(__nccwpck_require__(11255), exports); -tslib_1.__exportStar(__nccwpck_require__(49953), exports); -tslib_1.__exportStar(__nccwpck_require__(34660), exports); -tslib_1.__exportStar(__nccwpck_require__(41047), exports); - - -/***/ }), - -/***/ 81715: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - +/***/ 3322: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 98702: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + buildQueryString: () => buildQueryString +}); +module.exports = __toCommonJS(src_exports); +var import_util_uri_escape = __nccwpck_require__(2509); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, import_util_uri_escape.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; + } + parts.push(qsEntry); + } + } + return parts.join("&"); +} +__name(buildQueryString, "buildQueryString"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; /***/ }), -/***/ 71123: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), +/***/ 5162: +/***/ ((module) => { -/***/ 1413: -/***/ ((__unused_webpack_module, exports) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -"use strict"; +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ }), +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -/***/ 3528: -/***/ ((__unused_webpack_module, exports) => { +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 81983: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 2509: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath +}); +module.exports = __toCommonJS(src_exports); -/***/ }), +// src/escape-uri.ts +var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) +), "escapeUri"); +var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); -/***/ 64125: -/***/ ((__unused_webpack_module, exports) => { +// src/escape-uri-path.ts +var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 28694: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), +/***/ 4203: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ 91573: -/***/ ((__unused_webpack_module, exports) => { +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/loadSts.ts +var loadSts_exports = {}; +__export(loadSts_exports, { + getDefaultRoleAssumer: () => import_client_sts.getDefaultRoleAssumer +}); +var import_client_sts; +var init_loadSts = __esm({ + "src/loadSts.ts"() { + import_client_sts = __nccwpck_require__(2209); + } +}); -"use strict"; +// src/index.ts +var src_exports = {}; +__export(src_exports, { + fromIni: () => fromIni +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/fromIni.ts -/***/ }), +// src/resolveProfileData.ts -/***/ 17790: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +// src/resolveAssumeRoleCredentials.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); +var import_shared_ini_file_loader = __nccwpck_require__(3507); +// src/resolveCredentialSource.ts +var import_property_provider = __nccwpck_require__(9721); +var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName) => { + const sourceProvidersMap = { + EcsContainer: (options) => Promise.resolve().then(() => __toESM(__nccwpck_require__(7477))).then(({ fromContainerMetadata }) => fromContainerMetadata(options)), + Ec2InstanceMetadata: (options) => Promise.resolve().then(() => __toESM(__nccwpck_require__(7477))).then(({ fromInstanceMetadata }) => fromInstanceMetadata(options)), + Environment: (options) => Promise.resolve().then(() => __toESM(__nccwpck_require__(5972))).then(({ fromEnv }) => fromEnv(options)) + }; + if (credentialSource in sourceProvidersMap) { + return sourceProvidersMap[credentialSource]; + } else { + throw new import_property_provider.CredentialsProviderError( + `Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.` + ); + } +}, "resolveCredentialSource"); + +// src/resolveAssumeRoleCredentials.ts +var isAssumeRoleProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg) || isAssumeRoleWithProviderProfile(arg)), "isAssumeRoleProfile"); +var isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg) => typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined", "isAssumeRoleWithSourceProfile"); +var isAssumeRoleWithProviderProfile = /* @__PURE__ */ __name((arg) => typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined", "isAssumeRoleWithProviderProfile"); +var resolveAssumeRoleCredentials = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}) => { + var _a; + (_a = options.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-ini", "resolveAssumeRoleCredentials (STS)"); + const data = profiles[profileName]; + if (!options.roleAssumer) { + const { getDefaultRoleAssumer: getDefaultRoleAssumer2 } = await Promise.resolve().then(() => (init_loadSts(), loadSts_exports)); + options.roleAssumer = getDefaultRoleAssumer2( + { + ...options.clientConfig, + credentialProviderLogger: options.logger, + parentClientConfig: options == null ? void 0 : options.parentClientConfig + }, + options.clientPlugins + ); + } + const { source_profile } = data; + if (source_profile && source_profile in visitedProfiles) { + throw new import_property_provider.CredentialsProviderError( + `Detected a cycle attempting to resolve credentials for profile ${(0, import_shared_ini_file_loader.getProfileName)(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), + false + ); + } + const sourceCredsProvider = source_profile ? resolveProfileData(source_profile, profiles, options, { + ...visitedProfiles, + [source_profile]: true + }) : (await resolveCredentialSource(data.credential_source, profileName)(options))(); + const params = { + RoleArn: data.role_arn, + RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`, + ExternalId: data.external_id, + DurationSeconds: parseInt(data.duration_seconds || "3600", 10) + }; + const { mfa_serial } = data; + if (mfa_serial) { + if (!options.mfaCodeProvider) { + throw new import_property_provider.CredentialsProviderError( + `Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, + false + ); + } + params.SerialNumber = mfa_serial; + params.TokenCode = await options.mfaCodeProvider(mfa_serial); + } + const sourceCreds = await sourceCredsProvider; + return options.roleAssumer(sourceCreds, params); +}, "resolveAssumeRoleCredentials"); + +// src/resolveProcessCredentials.ts +var isProcessProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string", "isProcessProfile"); +var resolveProcessCredentials = /* @__PURE__ */ __name(async (options, profile) => Promise.resolve().then(() => __toESM(__nccwpck_require__(9969))).then( + ({ fromProcess }) => fromProcess({ + ...options, + profile + })() +), "resolveProcessCredentials"); + +// src/resolveSsoCredentials.ts +var resolveSsoCredentials = /* @__PURE__ */ __name(async (profile, options = {}) => { + const { fromSSO } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(6414))); + return fromSSO({ + profile, + logger: options.logger + })(); +}, "resolveSsoCredentials"); +var isSsoProfile = /* @__PURE__ */ __name((arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"), "isSsoProfile"); + +// src/resolveStaticCredentials.ts +var isStaticCredsProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1, "isStaticCredsProfile"); +var resolveStaticCredentials = /* @__PURE__ */ __name((profile, options) => { + var _a; + (_a = options == null ? void 0 : options.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-ini", "resolveStaticCredentials"); + return Promise.resolve({ + accessKeyId: profile.aws_access_key_id, + secretAccessKey: profile.aws_secret_access_key, + sessionToken: profile.aws_session_token, + credentialScope: profile.aws_credential_scope + }); +}, "resolveStaticCredentials"); -/***/ }), +// src/resolveWebIdentityCredentials.ts +var isWebIdentityProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1, "isWebIdentityProfile"); +var resolveWebIdentityCredentials = /* @__PURE__ */ __name(async (profile, options) => Promise.resolve().then(() => __toESM(__nccwpck_require__(5646))).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 + })() +), "resolveWebIdentityCredentials"); + +// src/resolveProfileData.ts +var resolveProfileData = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}) => { + const data = profiles[profileName]; + if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) { + return resolveStaticCredentials(data, options); + } + if (isAssumeRoleProfile(data)) { + return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles); + } + if (isStaticCredsProfile(data)) { + return resolveStaticCredentials(data, options); + } + if (isWebIdentityProfile(data)) { + return resolveWebIdentityCredentials(data, options); + } + if (isProcessProfile(data)) { + return resolveProcessCredentials(options, profileName); + } + if (isSsoProfile(data)) { + return await resolveSsoCredentials(profileName, options); + } + throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} could not be found or parsed in shared credentials file.`); +}, "resolveProfileData"); -/***/ 6228: -/***/ ((__unused_webpack_module, exports) => { +// src/fromIni.ts +var fromIni = /* @__PURE__ */ __name((init = {}) => async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-ini", "fromIni"); + const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init); + return resolveProfileData((0, import_shared_ini_file_loader.getProfileName)(init), profiles, init); +}, "fromIni"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 10209: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), +/***/ 5531: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ 57026: -/***/ ((__unused_webpack_module, exports) => { +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + credentialsTreatedAsExpired: () => credentialsTreatedAsExpired, + credentialsWillNeedRefresh: () => credentialsWillNeedRefresh, + defaultProvider: () => defaultProvider +}); +module.exports = __toCommonJS(src_exports); + +// src/defaultProvider.ts + +var import_shared_ini_file_loader = __nccwpck_require__(3507); + +// src/remoteProvider.ts +var import_property_provider = __nccwpck_require__(9721); +var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +var remoteProvider = /* @__PURE__ */ __name(async (init) => { + var _a, _b; + const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(7477))); + if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) { + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node", "remoteProvider::fromHttp/fromContainerMetadata"); + const { fromHttp } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(7290))); + return (0, import_property_provider.chain)(fromHttp(init), fromContainerMetadata(init)); + } + if (process.env[ENV_IMDS_DISABLED]) { + return async () => { + throw new import_property_provider.CredentialsProviderError("EC2 Instance Metadata Service access disabled"); + }; + } + (_b = init.logger) == null ? void 0 : _b.debug("@aws-sdk/credential-provider-node", "remoteProvider::fromInstanceMetadata"); + return fromInstanceMetadata(init); +}, "remoteProvider"); + +// src/defaultProvider.ts +var defaultProvider = /* @__PURE__ */ __name((init = {}) => (0, import_property_provider.memoize)( + (0, import_property_provider.chain)( + ...init.profile || process.env[import_shared_ini_file_loader.ENV_PROFILE] ? [] : [ + async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node", "defaultProvider::fromEnv"); + const { fromEnv } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(5972))); + return fromEnv(init)(); + } + ], + async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node", "defaultProvider::fromSSO"); + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + throw new import_property_provider.CredentialsProviderError( + "Skipping SSO provider in default chain (inputs do not include SSO fields)." + ); + } + const { fromSSO } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(6414))); + return fromSSO(init)(); + }, + async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node", "defaultProvider::fromIni"); + const { fromIni } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(4203))); + return fromIni(init)(); + }, + async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node", "defaultProvider::fromProcess"); + const { fromProcess } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(9969))); + return fromProcess(init)(); + }, + async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node", "defaultProvider::fromTokenFile"); + const { fromTokenFile } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(5646))); + return fromTokenFile(init)(); + }, + async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node", "defaultProvider::remoteProvider"); + return (await remoteProvider(init))(); + }, + async () => { + throw new import_property_provider.CredentialsProviderError("Could not load credentials from any providers", false); + } + ), + credentialsTreatedAsExpired, + credentialsWillNeedRefresh +), "defaultProvider"); +var credentialsWillNeedRefresh = /* @__PURE__ */ __name((credentials) => (credentials == null ? void 0 : credentials.expiration) !== void 0, "credentialsWillNeedRefresh"); +var credentialsTreatedAsExpired = /* @__PURE__ */ __name((credentials) => (credentials == null ? void 0 : credentials.expiration) !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5, "credentialsTreatedAsExpired"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 82698: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), +/***/ 9969: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ 14891: -/***/ ((__unused_webpack_module, exports) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -"use strict"; +// src/index.ts +var src_exports = {}; +__export(src_exports, { + fromProcess: () => fromProcess +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/fromProcess.ts +var import_shared_ini_file_loader = __nccwpck_require__(3507); +// src/resolveProcessCredentials.ts +var import_property_provider = __nccwpck_require__(9721); +var import_child_process = __nccwpck_require__(2081); +var import_util = __nccwpck_require__(3837); -/***/ }), +// src/getValidatedProcessCredentials.ts +var getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data) => { + if (data.Version !== 1) { + throw Error(`Profile ${profileName} credential_process did not return Version 1.`); + } + if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) { + throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); + } + if (data.Expiration) { + const currentTime = /* @__PURE__ */ new Date(); + const expireTime = new Date(data.Expiration); + if (expireTime < currentTime) { + throw Error(`Profile ${profileName} credential_process returned expired credentials.`); + } + } + return { + accessKeyId: data.AccessKeyId, + secretAccessKey: data.SecretAccessKey, + ...data.SessionToken && { sessionToken: data.SessionToken }, + ...data.Expiration && { expiration: new Date(data.Expiration) }, + ...data.CredentialScope && { credentialScope: data.CredentialScope } + }; +}, "getValidatedProcessCredentials"); + +// src/resolveProcessCredentials.ts +var resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles) => { + const profile = profiles[profileName]; + if (profiles[profileName]) { + const credentialProcess = profile["credential_process"]; + if (credentialProcess !== void 0) { + const execPromise = (0, import_util.promisify)(import_child_process.exec); + try { + const { stdout } = await execPromise(credentialProcess); + let data; + try { + data = JSON.parse(stdout.trim()); + } catch { + throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); + } + return getValidatedProcessCredentials(profileName, data); + } catch (error) { + throw new import_property_provider.CredentialsProviderError(error.message); + } + } else { + throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`); + } + } else { + throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`); + } +}, "resolveProcessCredentials"); -/***/ 11255: -/***/ ((__unused_webpack_module, exports) => { +// src/fromProcess.ts +var fromProcess = /* @__PURE__ */ __name((init = {}) => async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-process", "fromProcess"); + const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init); + return resolveProcessCredentials((0, import_shared_ini_file_loader.getProfileName)(init), profiles); +}, "fromProcess"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 49953: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 6414: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ }), +// src/loadSso.ts +var loadSso_exports = {}; +__export(loadSso_exports, { + GetRoleCredentialsCommand: () => import_client_sso.GetRoleCredentialsCommand, + SSOClient: () => import_client_sso.SSOClient +}); +var import_client_sso; +var init_loadSso = __esm({ + "src/loadSso.ts"() { + import_client_sso = __nccwpck_require__(2666); + } +}); -/***/ 34660: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + fromSSO: () => fromSSO, + isSsoProfile: () => isSsoProfile, + validateSsoProfile: () => validateSsoProfile +}); +module.exports = __toCommonJS(src_exports); + +// src/fromSSO.ts + + + +// src/isSsoProfile.ts +var isSsoProfile = /* @__PURE__ */ __name((arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"), "isSsoProfile"); + +// src/resolveSSOCredentials.ts +var import_token_providers = __nccwpck_require__(2843); +var import_property_provider = __nccwpck_require__(9721); +var import_shared_ini_file_loader = __nccwpck_require__(3507); +var SHOULD_FAIL_CREDENTIAL_CHAIN = false; +var resolveSSOCredentials = /* @__PURE__ */ __name(async ({ + ssoStartUrl, + ssoSession, + ssoAccountId, + ssoRegion, + ssoRoleName, + ssoClient, + clientConfig, + profile +}) => { + let token; + const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; + if (ssoSession) { + try { + const _token = await (0, import_token_providers.fromSso)({ profile })(); + token = { + accessToken: _token.token, + expiresAt: new Date(_token.expiration).toISOString() + }; + } catch (e) { + throw new import_property_provider.CredentialsProviderError(e.message, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + } else { + try { + token = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoStartUrl); + } catch (e) { + throw new import_property_provider.CredentialsProviderError( + `The SSO session associated with this profile is invalid. ${refreshMessage}`, + SHOULD_FAIL_CREDENTIAL_CHAIN + ); + } + } + if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { + throw new import_property_provider.CredentialsProviderError( + `The SSO session associated with this profile has expired. ${refreshMessage}`, + SHOULD_FAIL_CREDENTIAL_CHAIN + ); + } + const { accessToken } = token; + const { SSOClient: SSOClient2, GetRoleCredentialsCommand: GetRoleCredentialsCommand2 } = await Promise.resolve().then(() => (init_loadSso(), loadSso_exports)); + const sso = ssoClient || new SSOClient2( + Object.assign({}, clientConfig ?? {}, { + region: (clientConfig == null ? void 0 : clientConfig.region) ?? ssoRegion + }) + ); + let ssoResp; + try { + ssoResp = await sso.send( + new GetRoleCredentialsCommand2({ + accountId: ssoAccountId, + roleName: ssoRoleName, + accessToken + }) + ); + } catch (e) { + throw import_property_provider.CredentialsProviderError.from(e, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope } = {} } = ssoResp; + if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { + throw new import_property_provider.CredentialsProviderError("SSO returns an invalid temporary credential.", SHOULD_FAIL_CREDENTIAL_CHAIN); + } + return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration), credentialScope }; +}, "resolveSSOCredentials"); + +// src/validateSsoProfile.ts + +var validateSsoProfile = /* @__PURE__ */ __name((profile) => { + 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 import_property_provider.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( + ", " + )} +Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, + false + ); + } + return profile; +}, "validateSsoProfile"); + +// src/fromSSO.ts +var fromSSO = /* @__PURE__ */ __name((init = {}) => async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-sso", "fromSSO"); + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; + const { ssoClient } = init; + const profileName = (0, import_shared_ini_file_loader.getProfileName)(init); + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init); + const profile = profiles[profileName]; + if (!profile) { + throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} was not found.`); + } + if (!isSsoProfile(profile)) { + throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`); + } + if (profile == null ? void 0 : profile.sso_session) { + const ssoSessions = await (0, import_shared_ini_file_loader.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 import_property_provider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, false); + } + if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { + throw new import_property_provider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, false); + } + 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); + return resolveSSOCredentials({ + ssoStartUrl: sso_start_url, + ssoSession: sso_session, + ssoAccountId: sso_account_id, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + ssoClient, + clientConfig: init.clientConfig, + profile: profileName + }); + } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { + throw new import_property_provider.CredentialsProviderError( + 'Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"' + ); + } else { + return resolveSSOCredentials({ + ssoStartUrl, + ssoSession, + ssoAccountId, + ssoRegion, + ssoRoleName, + ssoClient, + clientConfig: init.clientConfig, + profile: profileName + }); + } +}, "fromSSO"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 41047: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5614: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromTokenFile = void 0; +const property_provider_1 = __nccwpck_require__(9721); +const fs_1 = __nccwpck_require__(7147); +const fromWebToken_1 = __nccwpck_require__(7905); +const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; +const ENV_ROLE_ARN = "AWS_ROLE_ARN"; +const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; +const fromTokenFile = (init = {}) => async () => { + var _a, _b, _c, _d; + (_a = init.logger) === null || _a === void 0 ? void 0 : _a.debug("@aws-sdk/credential-provider-web-identity", "fromTokenFile"); + const webIdentityTokenFile = (_b = init === null || init === void 0 ? void 0 : init.webIdentityTokenFile) !== null && _b !== void 0 ? _b : process.env[ENV_TOKEN_FILE]; + const roleArn = (_c = init === null || init === void 0 ? void 0 : init.roleArn) !== null && _c !== void 0 ? _c : process.env[ENV_ROLE_ARN]; + const roleSessionName = (_d = init === null || init === void 0 ? void 0 : init.roleSessionName) !== null && _d !== void 0 ? _d : process.env[ENV_ROLE_SESSION_NAME]; + if (!webIdentityTokenFile || !roleArn) { + throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified"); + } + return (0, fromWebToken_1.fromWebToken)({ + ...init, + webIdentityToken: (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), + roleArn, + roleSessionName, + })(); +}; +exports.fromTokenFile = fromTokenFile; /***/ }), -/***/ 74075: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7905: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromWebToken = void 0; +const fromWebToken = (init) => async () => { + var _a; + (_a = init.logger) === null || _a === void 0 ? void 0 : _a.debug("@aws-sdk/credential-provider-web-identity", "fromWebToken"); + const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init; + let { roleAssumerWithWebIdentity } = init; + if (!roleAssumerWithWebIdentity) { + const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(4999))); + roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({ + ...init.clientConfig, + credentialProviderLogger: init.logger, + parentClientConfig: init.parentClientConfig, + }, init.clientPlugins); + } + return roleAssumerWithWebIdentity({ + RoleArn: roleArn, + RoleSessionName: roleSessionName !== null && roleSessionName !== void 0 ? roleSessionName : `aws-sdk-js-session-${Date.now()}`, + WebIdentityToken: webIdentityToken, + ProviderId: providerId, + PolicyArns: policyArns, + Policy: policy, + DurationSeconds: durationSeconds, + }); +}; +exports.fromWebToken = fromWebToken; /***/ }), -/***/ 48960: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - +/***/ 5646: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 78340: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var src_exports = {}; +module.exports = __toCommonJS(src_exports); +__reExport(src_exports, __nccwpck_require__(5614), module.exports); +__reExport(src_exports, __nccwpck_require__(7905), module.exports); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 4744: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4999: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDefaultRoleAssumerWithWebIdentity = void 0; +const client_sts_1 = __nccwpck_require__(2209); +Object.defineProperty(exports, "getDefaultRoleAssumerWithWebIdentity", ({ enumerable: true, get: function () { return client_sts_1.getDefaultRoleAssumerWithWebIdentity; } })); /***/ }), -/***/ 68270: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - +/***/ 2545: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 39580: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + getHostHeaderPlugin: () => getHostHeaderPlugin, + hostHeaderMiddleware: () => hostHeaderMiddleware, + hostHeaderMiddlewareOptions: () => hostHeaderMiddlewareOptions, + resolveHostHeaderConfig: () => resolveHostHeaderConfig +}); +module.exports = __toCommonJS(src_exports); +var import_protocol_http = __nccwpck_require__(517); +function resolveHostHeaderConfig(input) { + return input; +} +__name(resolveHostHeaderConfig, "resolveHostHeaderConfig"); +var hostHeaderMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => { + if (!import_protocol_http.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); +}, "hostHeaderMiddleware"); +var hostHeaderMiddlewareOptions = { + name: "hostHeaderMiddleware", + step: "build", + priority: "low", + tags: ["HOST"], + override: true +}; +var getHostHeaderPlugin = /* @__PURE__ */ __name((options) => ({ + applyToStack: (clientStack) => { + clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); + } +}), "getHostHeaderPlugin"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 57628: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 517: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(39580), exports); -tslib_1.__exportStar(__nccwpck_require__(98398), exports); -tslib_1.__exportStar(__nccwpck_require__(76522), exports); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(8968); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 98398: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 76522: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8968: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 89035: -/***/ ((__unused_webpack_module, exports) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 7225: -/***/ ((__unused_webpack_module, exports) => { +/***/ 14: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + getLoggerPlugin: () => getLoggerPlugin, + loggerMiddleware: () => loggerMiddleware, + loggerMiddlewareOptions: () => loggerMiddlewareOptions +}); +module.exports = __toCommonJS(src_exports); +// src/loggerMiddleware.ts +var loggerMiddleware = /* @__PURE__ */ __name(() => (next, context) => async (args) => { + var _a, _b; + 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; + (_a = logger == null ? void 0 : logger.info) == null ? void 0 : _a.call(logger, { + 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; + (_b = logger == null ? void 0 : logger.error) == null ? void 0 : _b.call(logger, { + clientName, + commandName, + input: inputFilterSensitiveLog(args.input), + error, + metadata: error.$metadata + }); + throw error; + } +}, "loggerMiddleware"); +var loggerMiddlewareOptions = { + name: "loggerMiddleware", + tags: ["LOGGER"], + step: "initialize", + override: true +}; +var getLoggerPlugin = /* @__PURE__ */ __name((options) => ({ + applyToStack: (clientStack) => { + clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); + } +}), "getLoggerPlugin"); +// Annotate the CommonJS export names for ESM import in node: -/***/ }), +0 && (0); -/***/ 54126: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); +/***/ }), +/***/ 5525: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 55612: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + addRecursionDetectionMiddlewareOptions: () => addRecursionDetectionMiddlewareOptions, + getRecursionDetectionPlugin: () => getRecursionDetectionPlugin, + recursionDetectionMiddleware: () => recursionDetectionMiddleware +}); +module.exports = __toCommonJS(src_exports); +var import_protocol_http = __nccwpck_require__(2877); +var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; +var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; +var ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; +var recursionDetectionMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => { + const { request } = args; + if (!import_protocol_http.HttpRequest.isInstance(request) || options.runtime !== "node" || request.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) { + return next(args); + } + const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + const traceId = process.env[ENV_TRACE_ID]; + const nonEmptyString = /* @__PURE__ */ __name((str) => typeof str === "string" && str.length > 0, "nonEmptyString"); + if (nonEmptyString(functionName) && nonEmptyString(traceId)) { + request.headers[TRACE_ID_HEADER_NAME] = traceId; + } + return next({ + ...args, + request + }); +}, "recursionDetectionMiddleware"); +var addRecursionDetectionMiddlewareOptions = { + step: "build", + tags: ["RECURSION_DETECTION"], + name: "recursionDetectionMiddleware", + override: true, + priority: "low" +}; +var getRecursionDetectionPlugin = /* @__PURE__ */ __name((options) => ({ + applyToStack: (clientStack) => { + clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions); + } +}), "getRecursionDetectionPlugin"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 43084: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2877: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(9360); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 89843: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 63799: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9360: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 21550: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(55612), exports); -tslib_1.__exportStar(__nccwpck_require__(43084), exports); -tslib_1.__exportStar(__nccwpck_require__(89843), exports); -tslib_1.__exportStar(__nccwpck_require__(57658), exports); -tslib_1.__exportStar(__nccwpck_require__(63799), exports); /***/ }), -/***/ 57658: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4688: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + getUserAgentMiddlewareOptions: () => getUserAgentMiddlewareOptions, + getUserAgentPlugin: () => getUserAgentPlugin, + resolveUserAgentConfig: () => resolveUserAgentConfig, + userAgentMiddleware: () => userAgentMiddleware +}); +module.exports = __toCommonJS(src_exports); + +// src/configurations.ts +function resolveUserAgentConfig(input) { + return { + ...input, + customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent + }; +} +__name(resolveUserAgentConfig, "resolveUserAgentConfig"); + +// src/user-agent-middleware.ts +var import_util_endpoints = __nccwpck_require__(3350); +var import_protocol_http = __nccwpck_require__(7992); + +// src/constants.ts +var USER_AGENT = "user-agent"; +var X_AMZ_USER_AGENT = "x-amz-user-agent"; +var SPACE = " "; +var UA_NAME_SEPARATOR = "/"; +var UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g; +var UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g; +var UA_ESCAPE_CHAR = "-"; + +// src/user-agent-middleware.ts +var userAgentMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => { + var _a, _b; + const { request } = args; + if (!import_protocol_http.HttpRequest.isInstance(request)) + return next(args); + const { headers } = request; + const userAgent = ((_a = context == null ? void 0 : context.userAgent) == null ? void 0 : _a.map(escapeUserAgent)) || []; + const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); + const customUserAgent = ((_b = options == null ? void 0 : options.customUserAgent) == null ? void 0 : _b.map(escapeUserAgent)) || []; + const prefix = (0, import_util_endpoints.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; + } + headers[USER_AGENT] = sdkUserAgentValue; + } else { + headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; + } + return next({ + ...args, + request + }); +}, "userAgentMiddleware"); +var escapeUserAgent = /* @__PURE__ */ __name((userAgentPair) => { + var _a; + 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 = (_a = userAgentPair[1]) == null ? void 0 : _a.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}`; + } + }, ""); +}, "escapeUserAgent"); +var getUserAgentMiddlewareOptions = { + name: "getUserAgentMiddleware", + step: "build", + priority: "low", + tags: ["SET_USER_AGENT", "USER_AGENT"], + override: true +}; +var getUserAgentPlugin = /* @__PURE__ */ __name((config) => ({ + applyToStack: (clientStack) => { + clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); + } +}), "getUserAgentPlugin"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 88508: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7992: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(7866); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 18883: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); /***/ }), -/***/ 7545: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7866: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 49123: -/***/ ((__unused_webpack_module, exports) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 28006: +/***/ 8805: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(7545), exports); -tslib_1.__exportStar(__nccwpck_require__(49123), exports); +tslib_1.__exportStar(__nccwpck_require__(258), exports); /***/ }), -/***/ 55756: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(74075), exports); -tslib_1.__exportStar(__nccwpck_require__(48960), exports); -tslib_1.__exportStar(__nccwpck_require__(78340), exports); -tslib_1.__exportStar(__nccwpck_require__(4744), exports); -tslib_1.__exportStar(__nccwpck_require__(68270), exports); -tslib_1.__exportStar(__nccwpck_require__(57628), exports); -tslib_1.__exportStar(__nccwpck_require__(89035), exports); -tslib_1.__exportStar(__nccwpck_require__(7225), exports); -tslib_1.__exportStar(__nccwpck_require__(54126), exports); -tslib_1.__exportStar(__nccwpck_require__(21550), exports); -tslib_1.__exportStar(__nccwpck_require__(88508), exports); -tslib_1.__exportStar(__nccwpck_require__(18883), exports); -tslib_1.__exportStar(__nccwpck_require__(28006), exports); -tslib_1.__exportStar(__nccwpck_require__(52866), exports); -tslib_1.__exportStar(__nccwpck_require__(17756), exports); -tslib_1.__exportStar(__nccwpck_require__(45489), exports); -tslib_1.__exportStar(__nccwpck_require__(26524), exports); -tslib_1.__exportStar(__nccwpck_require__(14603), exports); -tslib_1.__exportStar(__nccwpck_require__(83752), exports); -tslib_1.__exportStar(__nccwpck_require__(30774), exports); -tslib_1.__exportStar(__nccwpck_require__(14089), exports); -tslib_1.__exportStar(__nccwpck_require__(45678), exports); -tslib_1.__exportStar(__nccwpck_require__(69926), exports); -tslib_1.__exportStar(__nccwpck_require__(50364), exports); -tslib_1.__exportStar(__nccwpck_require__(66894), exports); -tslib_1.__exportStar(__nccwpck_require__(57887), exports); -tslib_1.__exportStar(__nccwpck_require__(66255), exports); - - -/***/ }), - -/***/ 52866: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8156: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + NODE_REGION_CONFIG_FILE_OPTIONS: () => NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS: () => NODE_REGION_CONFIG_OPTIONS, + REGION_ENV_NAME: () => REGION_ENV_NAME, + REGION_INI_NAME: () => REGION_INI_NAME, + getAwsRegionExtensionConfiguration: () => getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration: () => resolveAwsRegionExtensionConfiguration, + resolveRegionConfig: () => resolveRegionConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/index.ts +var getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let runtimeConfigRegion = /* @__PURE__ */ __name(async () => { + if (runtimeConfig.region === void 0) { + throw new Error("Region is missing from runtimeConfig"); + } + const region = runtimeConfig.region; + if (typeof region === "string") { + return region; + } + return region(); + }, "runtimeConfigRegion"); + return { + setRegion(region) { + runtimeConfigRegion = region; + }, + region() { + return runtimeConfigRegion; + } + }; +}, "getAwsRegionExtensionConfiguration"); +var resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionExtensionConfiguration) => { + return { + region: awsRegionExtensionConfiguration.region() + }; +}, "resolveAwsRegionExtensionConfiguration"); + +// src/regionConfig/config.ts +var REGION_ENV_NAME = "AWS_REGION"; +var REGION_INI_NAME = "region"; +var NODE_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[REGION_ENV_NAME], + configFileSelector: (profile) => profile[REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + } +}; +var NODE_REGION_CONFIG_FILE_OPTIONS = { + preferredFile: "credentials" +}; +// src/regionConfig/isFipsRegion.ts +var isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion"); -/***/ }), +// src/regionConfig/getRealRegion.ts +var getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion"); -/***/ 17756: -/***/ ((__unused_webpack_module, exports) => { +// src/regionConfig/resolveRegionConfig.ts +var resolveRegionConfig = /* @__PURE__ */ __name((input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); + } + return { + ...input, + region: async () => { + if (typeof region === "string") { + return getRealRegion(region); + } + const providedRegion = await region(); + return getRealRegion(providedRegion); + }, + useFipsEndpoint: async () => { + const providedRegion = typeof region === "string" ? region : await region(); + if (isFipsRegion(providedRegion)) { + return true; + } + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + } + }; +}, "resolveRegionConfig"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 45489: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2843: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/loadSsoOidc.ts +var loadSsoOidc_exports = {}; +__export(loadSsoOidc_exports, { + CreateTokenCommand: () => import_client_sso_oidc.CreateTokenCommand, + SSOOIDCClient: () => import_client_sso_oidc.SSOOIDCClient +}); +var import_client_sso_oidc; +var init_loadSsoOidc = __esm({ + "src/loadSsoOidc.ts"() { + import_client_sso_oidc = __nccwpck_require__(4527); + } +}); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + fromSso: () => fromSso, + fromStatic: () => fromStatic, + nodeProvider: () => nodeProvider +}); +module.exports = __toCommonJS(src_exports); -/***/ }), +// src/fromSso.ts -/***/ 26524: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/constants.ts +var EXPIRE_WINDOW_MS = 5 * 60 * 1e3; +var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; +// src/getSsoOidcClient.ts +var ssoOidcClientsHash = {}; +var getSsoOidcClient = /* @__PURE__ */ __name(async (ssoRegion) => { + const { SSOOIDCClient: SSOOIDCClient2 } = await Promise.resolve().then(() => (init_loadSsoOidc(), loadSsoOidc_exports)); + if (ssoOidcClientsHash[ssoRegion]) { + return ssoOidcClientsHash[ssoRegion]; + } + const ssoOidcClient = new SSOOIDCClient2({ region: ssoRegion }); + ssoOidcClientsHash[ssoRegion] = ssoOidcClient; + return ssoOidcClient; +}, "getSsoOidcClient"); + +// src/getNewSsoOidcToken.ts +var getNewSsoOidcToken = /* @__PURE__ */ __name(async (ssoToken, ssoRegion) => { + const { CreateTokenCommand: CreateTokenCommand2 } = await Promise.resolve().then(() => (init_loadSsoOidc(), loadSsoOidc_exports)); + const ssoOidcClient = await getSsoOidcClient(ssoRegion); + return ssoOidcClient.send( + new CreateTokenCommand2({ + clientId: ssoToken.clientId, + clientSecret: ssoToken.clientSecret, + refreshToken: ssoToken.refreshToken, + grantType: "refresh_token" + }) + ); +}, "getNewSsoOidcToken"); -/***/ }), +// src/validateTokenExpiry.ts +var import_property_provider = __nccwpck_require__(9721); +var validateTokenExpiry = /* @__PURE__ */ __name((token) => { + if (token.expiration && token.expiration.getTime() < Date.now()) { + throw new import_property_provider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false); + } +}, "validateTokenExpiry"); -/***/ 14603: -/***/ ((__unused_webpack_module, exports) => { +// src/validateTokenKey.ts -"use strict"; +var validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => { + if (typeof value === "undefined") { + throw new import_property_provider.TokenProviderError( + `Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, + false + ); + } +}, "validateTokenKey"); + +// src/writeSSOTokenToFile.ts +var import_shared_ini_file_loader = __nccwpck_require__(3507); +var import_fs = __nccwpck_require__(7147); +var { writeFile } = import_fs.promises; +var writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => { + const tokenFilepath = (0, import_shared_ini_file_loader.getSSOTokenFilepath)(id); + const tokenString = JSON.stringify(ssoToken, null, 2); + return writeFile(tokenFilepath, tokenString); +}, "writeSSOTokenToFile"); + +// src/fromSso.ts +var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0); +var fromSso = /* @__PURE__ */ __name((init = {}) => async () => { + var _a; + (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers", "fromSso"); + const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init); + const profileName = (0, import_shared_ini_file_loader.getProfileName)(init); + const profile = profiles[profileName]; + if (!profile) { + throw new import_property_provider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); + } else if (!profile["sso_session"]) { + throw new import_property_provider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); + } + const ssoSessionName = profile["sso_session"]; + const ssoSessions = await (0, import_shared_ini_file_loader.loadSsoSessionData)(init); + const ssoSession = ssoSessions[ssoSessionName]; + if (!ssoSession) { + throw new import_property_provider.TokenProviderError( + `Sso session '${ssoSessionName}' could not be found in shared credentials file.`, + false + ); + } + for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { + if (!ssoSession[ssoSessionRequiredKey]) { + throw new import_property_provider.TokenProviderError( + `Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, + false + ); + } + } + const ssoStartUrl = ssoSession["sso_start_url"]; + const ssoRegion = ssoSession["sso_region"]; + let ssoToken; + try { + ssoToken = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoSessionName); + } catch (e) { + throw new import_property_provider.TokenProviderError( + `The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, + false + ); + } + validateTokenKey("accessToken", ssoToken.accessToken); + validateTokenKey("expiresAt", ssoToken.expiresAt); + const { accessToken, expiresAt } = ssoToken; + const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; + if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) { + return existingToken; + } + if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) { + validateTokenExpiry(existingToken); + return existingToken; + } + validateTokenKey("clientId", ssoToken.clientId, true); + validateTokenKey("clientSecret", ssoToken.clientSecret, true); + validateTokenKey("refreshToken", ssoToken.refreshToken, true); + try { + lastRefreshAttemptTime.setTime(Date.now()); + const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion); + validateTokenKey("accessToken", newSsoOidcToken.accessToken); + validateTokenKey("expiresIn", newSsoOidcToken.expiresIn); + const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3); + try { + await writeSSOTokenToFile(ssoSessionName, { + ...ssoToken, + accessToken: newSsoOidcToken.accessToken, + expiresAt: newTokenExpiration.toISOString(), + refreshToken: newSsoOidcToken.refreshToken + }); + } catch (error) { + } + return { + token: newSsoOidcToken.accessToken, + expiration: newTokenExpiration + }; + } catch (error) { + validateTokenExpiry(existingToken); + return existingToken; + } +}, "fromSso"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/fromStatic.ts +var fromStatic = /* @__PURE__ */ __name(({ token, logger }) => async () => { + logger == null ? void 0 : logger.debug("@aws-sdk/token-providers", "fromStatic"); + if (!token || !token.token) { + throw new import_property_provider.TokenProviderError(`Please pass a valid token to fromStatic`, false); + } + return token; +}, "fromStatic"); -/***/ }), +// src/nodeProvider.ts -/***/ 83752: -/***/ ((__unused_webpack_module, exports) => { +var nodeProvider = /* @__PURE__ */ __name((init = {}) => (0, import_property_provider.memoize)( + (0, import_property_provider.chain)(fromSso(init), async () => { + throw new import_property_provider.TokenProviderError("Could not load token from any providers", false); + }), + (token) => token.expiration !== void 0 && token.expiration.getTime() - Date.now() < 3e5, + (token) => token.expiration !== void 0 +), "nodeProvider"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 30774: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3350: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + ConditionObject: () => import_util_endpoints.ConditionObject, + DeprecatedObject: () => import_util_endpoints.DeprecatedObject, + EndpointError: () => import_util_endpoints.EndpointError, + EndpointObject: () => import_util_endpoints.EndpointObject, + EndpointObjectHeaders: () => import_util_endpoints.EndpointObjectHeaders, + EndpointObjectProperties: () => import_util_endpoints.EndpointObjectProperties, + EndpointParams: () => import_util_endpoints.EndpointParams, + EndpointResolverOptions: () => import_util_endpoints.EndpointResolverOptions, + EndpointRuleObject: () => import_util_endpoints.EndpointRuleObject, + ErrorRuleObject: () => import_util_endpoints.ErrorRuleObject, + EvaluateOptions: () => import_util_endpoints.EvaluateOptions, + Expression: () => import_util_endpoints.Expression, + FunctionArgv: () => import_util_endpoints.FunctionArgv, + FunctionObject: () => import_util_endpoints.FunctionObject, + FunctionReturn: () => import_util_endpoints.FunctionReturn, + ParameterObject: () => import_util_endpoints.ParameterObject, + ReferenceObject: () => import_util_endpoints.ReferenceObject, + ReferenceRecord: () => import_util_endpoints.ReferenceRecord, + RuleSetObject: () => import_util_endpoints.RuleSetObject, + RuleSetRules: () => import_util_endpoints.RuleSetRules, + TreeRuleObject: () => import_util_endpoints.TreeRuleObject, + getUserAgentPrefix: () => getUserAgentPrefix, + isIpAddress: () => import_util_endpoints.isIpAddress, + partition: () => partition, + resolveEndpoint: () => import_util_endpoints.resolveEndpoint, + setPartitionInfo: () => setPartitionInfo, + useDefaultPartitionInfo: () => useDefaultPartitionInfo +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/aws.ts -/***/ }), +// src/lib/aws/isVirtualHostableS3Bucket.ts -/***/ 14089: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +// src/lib/isIpAddress.ts +var import_util_endpoints = __nccwpck_require__(5473); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/lib/aws/isVirtualHostableS3Bucket.ts +var isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!isVirtualHostableS3Bucket(label)) { + return false; + } + } + return true; + } + if (!(0, import_util_endpoints.isValidHostLabel)(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if ((0, import_util_endpoints.isIpAddress)(value)) { + return false; + } + return true; +}, "isVirtualHostableS3Bucket"); + +// src/lib/aws/parseArn.ts +var parseArn = /* @__PURE__ */ __name((value) => { + const segments = value.split(":"); + if (segments.length < 6) + return null; + const [arn, partition2, service, region, accountId, ...resourceId] = segments; + if (arn !== "arn" || partition2 === "" || service === "" || resourceId[0] === "") + return null; + return { + partition: partition2, + service, + region, + accountId, + resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId + }; +}, "parseArn"); + +// src/lib/aws/partitions.json +var partitions_default = { + 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)\\-\\w+\\-\\d+$", + regions: { + "af-south-1": { + description: "Africa (Cape Town)" + }, + "ap-east-1": { + description: "Asia Pacific (Hong Kong)" + }, + "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)" + }, + "aws-global": { + description: "AWS Standard 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)" + }, + "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 China global region" + }, + "cn-north-1": { + description: "China (Beijing)" + }, + "cn-northwest-1": { + description: "China (Ningxia)" + } + } + }, { + 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 GovCloud (US) global region" + }, + "us-gov-east-1": { + description: "AWS GovCloud (US-East)" + }, + "us-gov-west-1": { + description: "AWS GovCloud (US-West)" + } + } + }, { + id: "aws-iso", + outputs: { + dnsSuffix: "c2s.ic.gov", + dualStackDnsSuffix: "c2s.ic.gov", + implicitGlobalRegion: "us-iso-east-1", + name: "aws-iso", + supportsDualStack: false, + supportsFIPS: true + }, + regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", + regions: { + "aws-iso-global": { + description: "AWS ISO (US) 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: "sc2s.sgov.gov", + implicitGlobalRegion: "us-isob-east-1", + name: "aws-iso-b", + supportsDualStack: false, + supportsFIPS: true + }, + regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", + regions: { + "aws-iso-b-global": { + description: "AWS ISOB (US) global region" + }, + "us-isob-east-1": { + description: "US ISOB East (Ohio)" + } + } + }, { + id: "aws-iso-e", + outputs: { + dnsSuffix: "cloud.adc-e.uk", + dualStackDnsSuffix: "cloud.adc-e.uk", + implicitGlobalRegion: "eu-isoe-west-1", + name: "aws-iso-e", + supportsDualStack: false, + supportsFIPS: true + }, + regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + regions: {} + }, { + id: "aws-iso-f", + outputs: { + dnsSuffix: "csp.hci.ic.gov", + dualStackDnsSuffix: "csp.hci.ic.gov", + implicitGlobalRegion: "us-isof-south-1", + name: "aws-iso-f", + supportsDualStack: false, + supportsFIPS: true + }, + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + regions: {} + }], + version: "1.1" +}; + +// src/lib/aws/partition.ts +var selectedPartitionsInfo = partitions_default; +var selectedUserAgentPrefix = ""; +var partition = /* @__PURE__ */ __name((value) => { + const { partitions } = selectedPartitionsInfo; + for (const partition2 of partitions) { + const { regions, outputs } = partition2; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData + }; + } + } + } + for (const partition2 of partitions) { + const { regionRegex, outputs } = partition2; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs + }; + } + } + const DEFAULT_PARTITION = partitions.find((partition2) => partition2.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 + }; +}, "partition"); +var setPartitionInfo = /* @__PURE__ */ __name((partitionsInfo, userAgentPrefix = "") => { + selectedPartitionsInfo = partitionsInfo; + selectedUserAgentPrefix = userAgentPrefix; +}, "setPartitionInfo"); +var useDefaultPartitionInfo = /* @__PURE__ */ __name(() => { + setPartitionInfo(partitions_default, ""); +}, "useDefaultPartitionInfo"); +var getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix"); +// src/aws.ts +var awsEndpointFunctions = { + isVirtualHostableS3Bucket, + parseArn, + partition +}; +import_util_endpoints.customEndpointFunctions.aws = awsEndpointFunctions; -/***/ }), +// src/resolveEndpoint.ts -/***/ 45678: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +// src/types/EndpointError.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/types/EndpointRuleObject.ts -/***/ }), -/***/ 69926: -/***/ ((__unused_webpack_module, exports) => { +// src/types/ErrorRuleObject.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/types/RuleSetObject.ts -/***/ }), +// src/types/TreeRuleObject.ts -/***/ 50364: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +// src/types/shared.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -/***/ }), -/***/ 66894: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 8095: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ }), +// src/index.ts +var src_exports = {}; +__export(src_exports, { + UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME, + UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME, + crtAvailability: () => crtAvailability, + defaultUserAgent: () => defaultUserAgent +}); +module.exports = __toCommonJS(src_exports); +var import_node_config_provider = __nccwpck_require__(3461); +var import_os = __nccwpck_require__(2037); +var import_process = __nccwpck_require__(7282); -/***/ 57887: -/***/ ((__unused_webpack_module, exports) => { +// src/crt-availability.ts +var crtAvailability = { + isCrtAvailable: false +}; -"use strict"; +// src/is-crt-available.ts +var isCrtAvailable = /* @__PURE__ */ __name(() => { + if (crtAvailability.isCrtAvailable) { + return ["md/crt-avail"]; + } + return null; +}, "isCrtAvailable"); + +// src/index.ts +var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; +var UA_APP_ID_INI_NAME = "sdk-ua-app-id"; +var defaultUserAgent = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => { + const sections = [ + // sdk-metadata + ["aws-sdk-js", clientVersion], + // ua-metadata + ["ua", "2.0"], + // os-metadata + [`os/${(0, import_os.platform)()}`, (0, import_os.release)()], + // language-metadata + // ECMAScript edition doesn't matter in JS, so no version needed. + ["lang/js"], + ["md/nodejs", `${import_process.versions.node}`] + ]; + const crtAvailable = isCrtAvailable(); + if (crtAvailable) { + sections.push(crtAvailable); + } + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + if (import_process.env.AWS_EXECUTION_ENV) { + sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]); + } + const appIdPromise = (0, import_node_config_provider.loadConfig)({ + environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME], + default: void 0 + })(); + let resolvedUserAgent = void 0; + return async () => { + if (!resolvedUserAgent) { + const appId = await appIdPromise; + resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; + } + return resolvedUserAgent; + }; +}, "defaultUserAgent"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 66255: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8172: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toUtf8 = exports.fromUtf8 = void 0; +const pureJs_1 = __nccwpck_require__(1590); +const whatwgEncodingApi_1 = __nccwpck_require__(9215); +const fromUtf8 = (input) => typeof TextEncoder === "function" ? (0, whatwgEncodingApi_1.fromUtf8)(input) : (0, pureJs_1.fromUtf8)(input); +exports.fromUtf8 = fromUtf8; +const toUtf8 = (input) => typeof TextDecoder === "function" ? (0, whatwgEncodingApi_1.toUtf8)(input) : (0, pureJs_1.toUtf8)(input); +exports.toUtf8 = toUtf8; /***/ }), -/***/ 14681: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 1590: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseUrl = void 0; -const querystring_parser_1 = __nccwpck_require__(4769); -const parseUrl = (url) => { - if (typeof url === "string") { - return (0, exports.parseUrl)(new URL(url)); +exports.toUtf8 = exports.fromUtf8 = void 0; +const fromUtf8 = (input) => { + const bytes = []; + for (let i = 0, len = input.length; i < len; i++) { + const value = input.charCodeAt(i); + if (value < 0x80) { + bytes.push(value); + } + else if (value < 0x800) { + bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000); + } + else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { + const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111); + bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000); + } + else { + bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000); + } } - const { hostname, pathname, port, protocol, search } = url; - let query; - if (search) { - query = (0, querystring_parser_1.parseQueryString)(search); + return Uint8Array.from(bytes); +}; +exports.fromUtf8 = fromUtf8; +const toUtf8 = (input) => { + let decoded = ""; + for (let i = 0, len = input.length; i < len; i++) { + const byte = input[i]; + if (byte < 0x80) { + decoded += String.fromCharCode(byte); + } + else if (0b11000000 <= byte && byte < 0b11100000) { + const nextByte = input[++i]; + decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111)); + } + else if (0b11110000 <= byte && byte < 0b101101101) { + const surrogatePair = [byte, input[++i], input[++i], input[++i]]; + const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%"); + decoded += decodeURIComponent(encoded); + } + else { + decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111)); + } } - return { - hostname, - port: port ? parseInt(port) : undefined, - protocol, - path: pathname, - query, - }; + return decoded; }; -exports.parseUrl = parseUrl; +exports.toUtf8 = toUtf8; /***/ }), -/***/ 30305: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 9215: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromBase64 = void 0; -const util_buffer_from_1 = __nccwpck_require__(31381); -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 (!BASE64_REGEX.exec(input)) { - throw new TypeError(`Invalid base64 string.`); - } - const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); -}; -exports.fromBase64 = fromBase64; +exports.toUtf8 = exports.fromUtf8 = void 0; +function fromUtf8(input) { + return new TextEncoder().encode(input); +} +exports.fromUtf8 = fromUtf8; +function toUtf8(input) { + return new TextDecoder("utf-8").decode(input); +} +exports.toUtf8 = toUtf8; /***/ }), -/***/ 75600: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + CONFIG_USE_DUALSTACK_ENDPOINT: () => CONFIG_USE_DUALSTACK_ENDPOINT, + CONFIG_USE_FIPS_ENDPOINT: () => CONFIG_USE_FIPS_ENDPOINT, + DEFAULT_USE_DUALSTACK_ENDPOINT: () => DEFAULT_USE_DUALSTACK_ENDPOINT, + DEFAULT_USE_FIPS_ENDPOINT: () => DEFAULT_USE_FIPS_ENDPOINT, + ENV_USE_DUALSTACK_ENDPOINT: () => ENV_USE_DUALSTACK_ENDPOINT, + ENV_USE_FIPS_ENDPOINT: () => ENV_USE_FIPS_ENDPOINT, + NODE_REGION_CONFIG_FILE_OPTIONS: () => NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS: () => NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: () => NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: () => NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, + REGION_ENV_NAME: () => REGION_ENV_NAME, + REGION_INI_NAME: () => REGION_INI_NAME, + getRegionInfo: () => getRegionInfo, + resolveCustomEndpointsConfig: () => resolveCustomEndpointsConfig, + resolveEndpointsConfig: () => resolveEndpointsConfig, + resolveRegionConfig: () => resolveRegionConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/endpointsConfig/NodeUseDualstackEndpointConfigOptions.ts +var import_util_config_provider = __nccwpck_require__(3375); +var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; +var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; +var DEFAULT_USE_DUALSTACK_ENDPOINT = false; +var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => (0, import_util_config_provider.booleanSelector)(env, ENV_USE_DUALSTACK_ENDPOINT, import_util_config_provider.SelectorType.ENV), + configFileSelector: (profile) => (0, import_util_config_provider.booleanSelector)(profile, CONFIG_USE_DUALSTACK_ENDPOINT, import_util_config_provider.SelectorType.CONFIG), + default: false +}; + +// src/endpointsConfig/NodeUseFipsEndpointConfigOptions.ts + +var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; +var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; +var DEFAULT_USE_FIPS_ENDPOINT = false; +var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => (0, import_util_config_provider.booleanSelector)(env, ENV_USE_FIPS_ENDPOINT, import_util_config_provider.SelectorType.ENV), + configFileSelector: (profile) => (0, import_util_config_provider.booleanSelector)(profile, CONFIG_USE_FIPS_ENDPOINT, import_util_config_provider.SelectorType.CONFIG), + default: false +}; + +// src/endpointsConfig/resolveCustomEndpointsConfig.ts +var import_util_middleware = __nccwpck_require__(2390); +var resolveCustomEndpointsConfig = /* @__PURE__ */ __name((input) => { + const { endpoint, urlParser } = input; + return { + ...input, + tls: input.tls ?? true, + endpoint: (0, import_util_middleware.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), + isCustomEndpoint: true, + useDualstackEndpoint: (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false) + }; +}, "resolveCustomEndpointsConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(30305), exports); -tslib_1.__exportStar(__nccwpck_require__(74730), exports); +// src/endpointsConfig/resolveEndpointsConfig.ts -/***/ }), +// src/endpointsConfig/utils/getEndpointFromRegion.ts +var getEndpointFromRegion = /* @__PURE__ */ __name(async (input) => { + const { tls = true } = input; + const region = await input.region(); + const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); + if (!dnsHostRegex.test(region)) { + throw new Error("Invalid region in client config"); + } + const useDualstackEndpoint = await input.useDualstackEndpoint(); + const useFipsEndpoint = await input.useFipsEndpoint(); + const { hostname } = await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }) ?? {}; + if (!hostname) { + throw new Error("Cannot resolve hostname from client config"); + } + return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); +}, "getEndpointFromRegion"); -/***/ 74730: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/endpointsConfig/resolveEndpointsConfig.ts +var resolveEndpointsConfig = /* @__PURE__ */ __name((input) => { + const useDualstackEndpoint = (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false); + const { endpoint, useFipsEndpoint, urlParser } = input; + return { + ...input, + tls: input.tls ?? true, + endpoint: endpoint ? (0, import_util_middleware.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }), + isCustomEndpoint: !!endpoint, + useDualstackEndpoint + }; +}, "resolveEndpointsConfig"); + +// src/regionConfig/config.ts +var REGION_ENV_NAME = "AWS_REGION"; +var REGION_INI_NAME = "region"; +var NODE_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[REGION_ENV_NAME], + configFileSelector: (profile) => profile[REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + } +}; +var NODE_REGION_CONFIG_FILE_OPTIONS = { + preferredFile: "credentials" +}; -"use strict"; +// src/regionConfig/isFipsRegion.ts +var isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion"); + +// src/regionConfig/getRealRegion.ts +var getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion"); + +// src/regionConfig/resolveRegionConfig.ts +var resolveRegionConfig = /* @__PURE__ */ __name((input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); + } + return { + ...input, + region: async () => { + if (typeof region === "string") { + return getRealRegion(region); + } + const providedRegion = await region(); + return getRealRegion(providedRegion); + }, + useFipsEndpoint: async () => { + const providedRegion = typeof region === "string" ? region : await region(); + if (isFipsRegion(providedRegion)) { + return true; + } + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + } + }; +}, "resolveRegionConfig"); + +// src/regionInfo/getHostnameFromVariants.ts +var getHostnameFromVariants = /* @__PURE__ */ __name((variants = [], { useFipsEndpoint, useDualstackEndpoint }) => { + var _a; + return (_a = variants.find( + ({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack") + )) == null ? void 0 : _a.hostname; +}, "getHostnameFromVariants"); + +// src/regionInfo/getResolvedHostname.ts +var getResolvedHostname = /* @__PURE__ */ __name((resolvedRegion, { regionHostname, partitionHostname }) => regionHostname ? regionHostname : partitionHostname ? partitionHostname.replace("{region}", resolvedRegion) : void 0, "getResolvedHostname"); + +// src/regionInfo/getResolvedPartition.ts +var getResolvedPartition = /* @__PURE__ */ __name((region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws", "getResolvedPartition"); + +// src/regionInfo/getResolvedSigningRegion.ts +var getResolvedSigningRegion = /* @__PURE__ */ __name((hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { + if (signingRegion) { + return signingRegion; + } else if (useFipsEndpoint) { + const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); + const regionRegexmatchArray = hostname.match(regionRegexJs); + if (regionRegexmatchArray) { + return regionRegexmatchArray[0].slice(1, -1); + } + } +}, "getResolvedSigningRegion"); + +// src/regionInfo/getRegionInfo.ts +var getRegionInfo = /* @__PURE__ */ __name((region, { + useFipsEndpoint = false, + useDualstackEndpoint = false, + signingService, + regionHash, + partitionHash +}) => { + var _a, _b, _c, _d, _e; + const partition = getResolvedPartition(region, { partitionHash }); + const resolvedRegion = region in regionHash ? region : ((_a = partitionHash[partition]) == null ? void 0 : _a.endpoint) ?? region; + const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; + const regionHostname = getHostnameFromVariants((_b = regionHash[resolvedRegion]) == null ? void 0 : _b.variants, hostnameOptions); + const partitionHostname = getHostnameFromVariants((_c = partitionHash[partition]) == null ? void 0 : _c.variants, hostnameOptions); + const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname }); + if (hostname === void 0) { + throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); + } + const signingRegion = getResolvedSigningRegion(hostname, { + signingRegion: (_d = regionHash[resolvedRegion]) == null ? void 0 : _d.signingRegion, + regionRegex: partitionHash[partition].regionRegex, + useFipsEndpoint + }); + return { + partition, + signingService, + hostname, + ...signingRegion && { signingRegion }, + ...((_e = regionHash[resolvedRegion]) == null ? void 0 : _e.signingService) && { + signingService: regionHash[resolvedRegion].signingService + } + }; +}, "getRegionInfo"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toBase64 = void 0; -const util_buffer_from_1 = __nccwpck_require__(31381); -const toBase64 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); -exports.toBase64 = toBase64; /***/ }), -/***/ 54880: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 5829: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DefaultIdentityProviderConfig: () => DefaultIdentityProviderConfig, + EXPIRATION_MS: () => EXPIRATION_MS, + HttpApiKeyAuthSigner: () => HttpApiKeyAuthSigner, + HttpBearerAuthSigner: () => HttpBearerAuthSigner, + NoAuthSigner: () => NoAuthSigner, + RequestBuilder: () => RequestBuilder, + createIsIdentityExpiredFunction: () => createIsIdentityExpiredFunction, + createPaginator: () => createPaginator, + doesIdentityRequireRefresh: () => doesIdentityRequireRefresh, + getHttpAuthSchemeEndpointRuleSetPlugin: () => getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpAuthSchemePlugin: () => getHttpAuthSchemePlugin, + getHttpSigningPlugin: () => getHttpSigningPlugin, + getSmithyContext: () => getSmithyContext3, + httpAuthSchemeEndpointRuleSetMiddlewareOptions: () => httpAuthSchemeEndpointRuleSetMiddlewareOptions, + httpAuthSchemeMiddleware: () => httpAuthSchemeMiddleware, + httpAuthSchemeMiddlewareOptions: () => httpAuthSchemeMiddlewareOptions, + httpSigningMiddleware: () => httpSigningMiddleware, + httpSigningMiddlewareOptions: () => httpSigningMiddlewareOptions, + isIdentityExpired: () => isIdentityExpired, + memoizeIdentityProvider: () => memoizeIdentityProvider, + normalizeProvider: () => normalizeProvider, + requestBuilder: () => requestBuilder +}); +module.exports = __toCommonJS(src_exports); + +// src/middleware-http-auth-scheme/httpAuthSchemeMiddleware.ts +var import_util_middleware = __nccwpck_require__(2390); +function convertHttpAuthSchemesToMap(httpAuthSchemes) { + const map = /* @__PURE__ */ new Map(); + for (const scheme of httpAuthSchemes) { + map.set(scheme.schemeId, scheme); + } + return map; +} +__name(convertHttpAuthSchemesToMap, "convertHttpAuthSchemesToMap"); +var httpAuthSchemeMiddleware = /* @__PURE__ */ __name((config, mwOptions) => (next, context) => async (args) => { + var _a; + const options = config.httpAuthSchemeProvider( + await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input) + ); + const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); + const smithyContext = (0, import_util_middleware.getSmithyContext)(context); + const failureReasons = []; + for (const option of options) { + 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 = {} } = ((_a = option.propertiesExtractor) == null ? void 0 : _a.call(option, 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); +}, "httpAuthSchemeMiddleware"); + +// src/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.ts +var import_middleware_endpoint = __nccwpck_require__(2918); +var httpAuthSchemeEndpointRuleSetMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", + override: true, + relation: "before", + toMiddleware: import_middleware_endpoint.endpointMiddlewareOptions.name +}; +var getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name((config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider +}) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo( + httpAuthSchemeMiddleware(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider + }), + httpAuthSchemeEndpointRuleSetMiddlewareOptions + ); + } +}), "getHttpAuthSchemeEndpointRuleSetPlugin"); + +// src/middleware-http-auth-scheme/getHttpAuthSchemePlugin.ts +var import_middleware_serde = __nccwpck_require__(1238); +var httpAuthSchemeMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", + override: true, + relation: "before", + toMiddleware: import_middleware_serde.serializerMiddlewareOption.name +}; +var getHttpAuthSchemePlugin = /* @__PURE__ */ __name((config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider +}) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo( + httpAuthSchemeMiddleware(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider + }), + httpAuthSchemeMiddlewareOptions + ); + } +}), "getHttpAuthSchemePlugin"); + +// src/middleware-http-signing/httpSigningMiddleware.ts +var import_protocol_http = __nccwpck_require__(1343); + +var defaultErrorHandler = /* @__PURE__ */ __name((signingProperties) => (error) => { + throw error; +}, "defaultErrorHandler"); +var defaultSuccessHandler = /* @__PURE__ */ __name((httpResponse, signingProperties) => { +}, "defaultSuccessHandler"); +var httpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, context) => async (args) => { + if (!import_protocol_http.HttpRequest.isInstance(args.request)) { + return next(args); + } + const smithyContext = (0, import_util_middleware.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; +}, "httpSigningMiddleware"); + +// src/middleware-http-signing/getHttpSigningMiddleware.ts +var import_middleware_retry = __nccwpck_require__(6039); +var httpSigningMiddlewareOptions = { + step: "finalizeRequest", + tags: ["HTTP_SIGNING"], + name: "httpSigningMiddleware", + aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], + override: true, + relation: "after", + toMiddleware: import_middleware_retry.retryMiddlewareOptions.name +}; +var getHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions); + } +}), "getHttpSigningPlugin"); + +// src/util-identity-and-auth/DefaultIdentityProviderConfig.ts +var _DefaultIdentityProviderConfig = class _DefaultIdentityProviderConfig { + /** + * Creates an IdentityProviderConfig with a record of scheme IDs to identity providers. + * + * @param config scheme IDs and identity providers to configure + */ + constructor(config) { + this.authSchemes = /* @__PURE__ */ new Map(); + for (const [key, value] of Object.entries(config)) { + if (value !== void 0) { + this.authSchemes.set(key, value); + } + } + } + getIdentityProvider(schemeId) { + return this.authSchemes.get(schemeId); + } +}; +__name(_DefaultIdentityProviderConfig, "DefaultIdentityProviderConfig"); +var DefaultIdentityProviderConfig = _DefaultIdentityProviderConfig; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.calculateBodyLength = void 0; -const fs_1 = __nccwpck_require__(57147); -const calculateBodyLength = (body) => { - if (!body) { - return 0; +// src/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.ts +var import_types = __nccwpck_require__(9801); +var _HttpApiKeyAuthSigner = 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 = httpRequest.clone(); + if (signingProperties.in === import_types.HttpApiKeyAuthLocation.QUERY) { + clonedRequest.query[signingProperties.name] = identity.apiKey; + } else if (signingProperties.in === import_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 + "`" + ); } - if (typeof body === "string") { - return Buffer.from(body).length; + return clonedRequest; + } +}; +__name(_HttpApiKeyAuthSigner, "HttpApiKeyAuthSigner"); +var HttpApiKeyAuthSigner = _HttpApiKeyAuthSigner; + +// src/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.ts +var _HttpBearerAuthSigner = class _HttpBearerAuthSigner { + async sign(httpRequest, identity, signingProperties) { + const clonedRequest = httpRequest.clone(); + if (!identity.token) { + throw new Error("request could not be signed with `token` since the `token` is not defined"); } - else if (typeof body.byteLength === "number") { - return body.byteLength; + clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; + return clonedRequest; + } +}; +__name(_HttpBearerAuthSigner, "HttpBearerAuthSigner"); +var HttpBearerAuthSigner = _HttpBearerAuthSigner; + +// src/util-identity-and-auth/httpAuthSchemes/noAuth.ts +var _NoAuthSigner = class _NoAuthSigner { + async sign(httpRequest, identity, signingProperties) { + return httpRequest; + } +}; +__name(_NoAuthSigner, "NoAuthSigner"); +var NoAuthSigner = _NoAuthSigner; + +// src/util-identity-and-auth/memoizeIdentityProvider.ts +var createIsIdentityExpiredFunction = /* @__PURE__ */ __name((expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs, "createIsIdentityExpiredFunction"); +var EXPIRATION_MS = 3e5; +var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); +var doesIdentityRequireRefresh = /* @__PURE__ */ __name((identity) => identity.expiration !== void 0, "doesIdentityRequireRefresh"); +var memoizeIdentityProvider = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { + if (provider === void 0) { + return void 0; + } + const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider; + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = /* @__PURE__ */ __name(async (options) => { + if (!pending) { + pending = normalizedProvider(options); } - else if (typeof body.size === "number") { - return body.size; + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } finally { + pending = void 0; + } + return resolved; + }, "coalesceProvider"); + if (isExpired === void 0) { + return async (options) => { + if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(options); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(options); } - else if (typeof body.start === "number" && typeof body.end === "number") { - return body.end + 1 - body.start; + if (isConstant) { + return resolved; } - else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { - return (0, fs_1.lstatSync)(body.path).size; + if (!requiresRefresh(resolved)) { + isConstant = true; + return resolved; } - else if (typeof body.fd === "number") { - return (0, fs_1.fstatSync)(body.fd).size; + if (isExpired(resolved)) { + await coalesceProvider(options); + return resolved; } - throw new Error(`Body Length computation failed for ${body}`); -}; -exports.calculateBodyLength = calculateBodyLength; + return resolved; + }; +}, "memoizeIdentityProvider"); +// src/getSmithyContext.ts -/***/ }), +var getSmithyContext3 = /* @__PURE__ */ __name((context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {}), "getSmithyContext"); -/***/ 68075: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/normalizeProvider.ts +var normalizeProvider = /* @__PURE__ */ __name((input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; +}, "normalizeProvider"); + +// src/protocols/requestBuilder.ts + +var import_smithy_client = __nccwpck_require__(3570); +function requestBuilder(input, context) { + return new RequestBuilder(input, context); +} +__name(requestBuilder, "requestBuilder"); +var _RequestBuilder = class _RequestBuilder { + constructor(input, context) { + this.input = input; + this.context = context; + this.query = {}; + this.method = ""; + this.headers = {}; + this.path = ""; + this.body = null; + this.hostname = ""; + this.resolvePathStack = []; + } + async build() { + const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint(); + this.path = basePath; + for (const resolvePath of this.resolvePathStack) { + resolvePath(this.path); + } + return new import_protocol_http.HttpRequest({ + protocol, + hostname: this.hostname || hostname, + port, + method: this.method, + path: this.path, + query: this.query, + body: this.body, + headers: this.headers + }); + } + /** + * Brevity setter for "hostname". + */ + hn(hostname) { + this.hostname = hostname; + return this; + } + /** + * Brevity initial builder for "basepath". + */ + bp(uriLabel) { + this.resolvePathStack.push((basePath) => { + this.path = `${(basePath == null ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + uriLabel; + }); + return this; + } + /** + * Brevity incremental builder for "path". + */ + p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { + this.resolvePathStack.push((path) => { + this.path = (0, import_smithy_client.resolvedPath)(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel); + }); + return this; + } + /** + * Brevity setter for "headers". + */ + h(headers) { + this.headers = headers; + return this; + } + /** + * Brevity setter for "query". + */ + q(query) { + this.query = query; + return this; + } + /** + * Brevity setter for "body". + */ + b(body) { + this.body = body; + return this; + } + /** + * Brevity setter for "method". + */ + m(method) { + this.method = method; + return this; + } +}; +__name(_RequestBuilder, "RequestBuilder"); +var RequestBuilder = _RequestBuilder; -"use strict"; +// src/pagination/createPaginator.ts +var makePagedClientRequest = /* @__PURE__ */ __name(async (CommandCtor, client, input, ...args) => { + return await client.send(new CommandCtor(input), ...args); +}, "makePagedClientRequest"); +function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { + return /* @__PURE__ */ __name(async function* paginateOperation(config, input, ...additionalArguments) { + let token = config.startingToken || void 0; + let hasNext = true; + let page; + while (hasNext) { + input[inputTokenName] = token; + if (pageSizeTokenName) { + input[pageSizeTokenName] = input[pageSizeTokenName] ?? config.pageSize; + } + if (config.client instanceof ClientCtor) { + page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments); + } else { + throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); + } + yield page; + const prevToken = token; + token = get(page, outputTokenName); + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return void 0; + }, "paginateOperation"); +} +__name(createPaginator, "createPaginator"); +var get = /* @__PURE__ */ __name((fromObject, path) => { + let cursor = fromObject; + const pathComponents = path.split("."); + for (const step of pathComponents) { + if (!cursor || typeof cursor !== "object") { + return void 0; + } + cursor = cursor[step]; + } + return cursor; +}, "get"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(54880), exports); /***/ }), -/***/ 31381: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 1343: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromString = exports.fromArrayBuffer = void 0; -const is_array_buffer_1 = __nccwpck_require__(10780); -const buffer_1 = __nccwpck_require__(14300); -const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { - if (!(0, is_array_buffer_1.isArrayBuffer)(input)) { - throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); } - return buffer_1.Buffer.from(input, offset, length); + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(9801); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } }; -exports.fromArrayBuffer = fromArrayBuffer; -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_1.Buffer.from(input, encoding) : buffer_1.Buffer.from(input); +__name(_Field, "Field"); +var Field = _Field; + +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); + +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } }; -exports.fromString = fromString; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; + +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 42491: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9801: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.booleanSelector = exports.SelectorType = void 0; -var SelectorType; -(function (SelectorType) { - SelectorType["ENV"] = "env"; - SelectorType["CONFIG"] = "shared config entry"; -})(SelectorType = exports.SelectorType || (exports.SelectorType = {})); -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.booleanSelector = booleanSelector; +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 83375: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(42491), exports); /***/ }), -/***/ 56470: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7477: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES, + DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT, + ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN, + ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI, + ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI, + fromContainerMetadata: () => fromContainerMetadata, + fromInstanceMetadata: () => fromInstanceMetadata, + getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint, + httpRequest: () => httpRequest, + providerConfigFromInit: () => providerConfigFromInit +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IMDS_REGION_PATH = exports.DEFAULTS_MODE_OPTIONS = exports.ENV_IMDS_DISABLED = exports.AWS_DEFAULT_REGION_ENV = exports.AWS_REGION_ENV = exports.AWS_EXECUTION_ENV = void 0; -exports.AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; -exports.AWS_REGION_ENV = "AWS_REGION"; -exports.AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; -exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; -exports.DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; -exports.IMDS_REGION_PATH = "/latest/meta-data/placement/region"; +// src/fromContainerMetadata.ts +var import_url = __nccwpck_require__(7310); -/***/ }), +// src/remoteProvider/httpRequest.ts +var import_property_provider = __nccwpck_require__(9721); +var import_buffer = __nccwpck_require__(4300); +var import_http = __nccwpck_require__(3685); +function httpRequest(options) { + return new Promise((resolve, reject) => { + var _a; + const req = (0, import_http.request)({ + method: "GET", + ...options, + // Node.js http module doesn't accept hostname with square brackets + // Refs: https://github.com/nodejs/node/issues/39738 + hostname: (_a = options.hostname) == null ? void 0 : _a.replace(/^\[(.+)\]$/, "$1") + }); + req.on("error", (err) => { + reject(Object.assign(new import_property_provider.ProviderError("Unable to connect to instance metadata service"), err)); + req.destroy(); + }); + req.on("timeout", () => { + reject(new import_property_provider.ProviderError("TimeoutError from instance metadata service")); + req.destroy(); + }); + req.on("response", (res) => { + const { statusCode = 400 } = res; + if (statusCode < 200 || 300 <= statusCode) { + reject( + Object.assign(new import_property_provider.ProviderError("Error response received from instance metadata service"), { statusCode }) + ); + req.destroy(); + } + const chunks = []; + res.on("data", (chunk) => { + chunks.push(chunk); + }); + res.on("end", () => { + resolve(import_buffer.Buffer.concat(chunks)); + req.destroy(); + }); + }); + req.end(); + }); +} +__name(httpRequest, "httpRequest"); + +// src/remoteProvider/ImdsCredentials.ts +var isImdsCredentials = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string", "isImdsCredentials"); +var fromImdsCredentials = /* @__PURE__ */ __name((creds) => ({ + accessKeyId: creds.AccessKeyId, + secretAccessKey: creds.SecretAccessKey, + sessionToken: creds.Token, + expiration: new Date(creds.Expiration) +}), "fromImdsCredentials"); + +// src/remoteProvider/RemoteProviderInit.ts +var DEFAULT_TIMEOUT = 1e3; +var DEFAULT_MAX_RETRIES = 0; +var providerConfigFromInit = /* @__PURE__ */ __name(({ + maxRetries = DEFAULT_MAX_RETRIES, + timeout = DEFAULT_TIMEOUT +}) => ({ maxRetries, timeout }), "providerConfigFromInit"); + +// src/remoteProvider/retry.ts +var retry = /* @__PURE__ */ __name((toRetry, maxRetries) => { + let promise = toRetry(); + for (let i = 0; i < maxRetries; i++) { + promise = promise.catch(toRetry); + } + return promise; +}, "retry"); + +// src/fromContainerMetadata.ts +var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; +var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; +var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; +var fromContainerMetadata = /* @__PURE__ */ __name((init = {}) => { + const { timeout, maxRetries } = providerConfigFromInit(init); + return () => retry(async () => { + const requestOptions = await getCmdsUri(); + const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); + if (!isImdsCredentials(credsResponse)) { + throw new import_property_provider.CredentialsProviderError("Invalid response received from instance metadata service."); + } + return fromImdsCredentials(credsResponse); + }, maxRetries); +}, "fromContainerMetadata"); +var requestFromEcsImds = /* @__PURE__ */ __name(async (timeout, options) => { + if (process.env[ENV_CMDS_AUTH_TOKEN]) { + options.headers = { + ...options.headers, + Authorization: process.env[ENV_CMDS_AUTH_TOKEN] + }; + } + const buffer = await httpRequest({ + ...options, + timeout + }); + return buffer.toString(); +}, "requestFromEcsImds"); +var CMDS_IP = "169.254.170.2"; +var GREENGRASS_HOSTS = { + localhost: true, + "127.0.0.1": true +}; +var GREENGRASS_PROTOCOLS = { + "http:": true, + "https:": true +}; +var getCmdsUri = /* @__PURE__ */ __name(async () => { + if (process.env[ENV_CMDS_RELATIVE_URI]) { + return { + hostname: CMDS_IP, + path: process.env[ENV_CMDS_RELATIVE_URI] + }; + } + if (process.env[ENV_CMDS_FULL_URI]) { + const parsed = (0, import_url.parse)(process.env[ENV_CMDS_FULL_URI]); + if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { + throw new import_property_provider.CredentialsProviderError( + `${parsed.hostname} is not a valid container metadata service hostname`, + false + ); + } + if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { + throw new import_property_provider.CredentialsProviderError( + `${parsed.protocol} is not a valid container metadata service protocol`, + false + ); + } + return { + ...parsed, + port: parsed.port ? parseInt(parsed.port, 10) : void 0 + }; + } + throw new import_property_provider.CredentialsProviderError( + `The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, + false + ); +}, "getCmdsUri"); -/***/ 15577: -/***/ ((__unused_webpack_module, exports) => { +// src/fromInstanceMetadata.ts -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = void 0; -const AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; -const AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; -exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - return env[AWS_DEFAULTS_MODE_ENV]; - }, - configFileSelector: (profile) => { - return profile[AWS_DEFAULTS_MODE_CONFIG]; - }, - default: "legacy", + +// src/error/InstanceMetadataV1FallbackError.ts + +var _InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends import_property_provider.CredentialsProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "InstanceMetadataV1FallbackError"; + Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype); + } }; +__name(_InstanceMetadataV1FallbackError, "InstanceMetadataV1FallbackError"); +var InstanceMetadataV1FallbackError = _InstanceMetadataV1FallbackError; + +// src/utils/getInstanceMetadataEndpoint.ts +var import_node_config_provider = __nccwpck_require__(3461); +var import_url_parser = __nccwpck_require__(4681); + +// src/config/EndpointConfigOptions.ts +var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; +var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; +var ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME], + configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], + default: void 0 +}; + +// src/config/EndpointMode.ts +var EndpointMode = /* @__PURE__ */ ((EndpointMode2) => { + EndpointMode2["IPv4"] = "IPv4"; + EndpointMode2["IPv6"] = "IPv6"; + return EndpointMode2; +})(EndpointMode || {}); + +// src/config/EndpointModeConfigOptions.ts +var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; +var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; +var ENDPOINT_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME], + configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], + default: "IPv4" /* IPv4 */ +}; + +// src/utils/getInstanceMetadataEndpoint.ts +var getInstanceMetadataEndpoint = /* @__PURE__ */ __name(async () => (0, import_url_parser.parseUrl)(await getFromEndpointConfig() || await getFromEndpointModeConfig()), "getInstanceMetadataEndpoint"); +var getFromEndpointConfig = /* @__PURE__ */ __name(async () => (0, import_node_config_provider.loadConfig)(ENDPOINT_CONFIG_OPTIONS)(), "getFromEndpointConfig"); +var getFromEndpointModeConfig = /* @__PURE__ */ __name(async () => { + const endpointMode = await (0, import_node_config_provider.loadConfig)(ENDPOINT_MODE_CONFIG_OPTIONS)(); + switch (endpointMode) { + case "IPv4" /* IPv4 */: + return "http://169.254.169.254" /* IPv4 */; + case "IPv6" /* IPv6 */: + return "http://[fd00:ec2::254]" /* IPv6 */; + default: + throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`); + } +}, "getFromEndpointModeConfig"); + +// src/utils/getExtendedInstanceMetadataCredentials.ts +var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; +var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; +var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; +var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger) => { + const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); + const newExpiration = new Date(Date.now() + refreshInterval * 1e3); + logger.warn( + "Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: " + STATIC_STABILITY_DOC_URL + ); + const originalExpiration = credentials.originalExpiration ?? credentials.expiration; + return { + ...credentials, + ...originalExpiration ? { originalExpiration } : {}, + expiration: newExpiration + }; +}, "getExtendedInstanceMetadataCredentials"); + +// src/utils/staticStabilityProvider.ts +var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => { + const logger = (options == null ? void 0 : options.logger) || console; + let pastCredentials; + return async () => { + let credentials; + try { + credentials = await provider(); + if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { + credentials = getExtendedInstanceMetadataCredentials(credentials, logger); + } + } catch (e) { + if (pastCredentials) { + logger.warn("Credential renew failed: ", e); + credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger); + } else { + throw e; + } + } + pastCredentials = credentials; + return credentials; + }; +}, "staticStabilityProvider"); + +// src/fromInstanceMetadata.ts +var IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; +var IMDS_TOKEN_PATH = "/latest/api/token"; +var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; +var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; +var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; +var fromInstanceMetadata = /* @__PURE__ */ __name((init = {}) => staticStabilityProvider(getInstanceImdsProvider(init), { logger: init.logger }), "fromInstanceMetadata"); +var getInstanceImdsProvider = /* @__PURE__ */ __name((init) => { + let disableFetchToken = false; + const { logger, profile } = init; + const { timeout, maxRetries } = providerConfigFromInit(init); + const getCredentials = /* @__PURE__ */ __name(async (maxRetries2, options) => { + var _a; + const isImdsV1Fallback = disableFetchToken || ((_a = options.headers) == null ? void 0 : _a[X_AWS_EC2_METADATA_TOKEN]) == null; + if (isImdsV1Fallback) { + let fallbackBlockedFromProfile = false; + let fallbackBlockedFromProcessEnv = false; + const configValue = await (0, import_node_config_provider.loadConfig)( + { + environmentVariableSelector: (env) => { + const envValue = env[AWS_EC2_METADATA_V1_DISABLED]; + fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; + if (envValue === void 0) { + throw new import_property_provider.CredentialsProviderError( + `${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.` + ); + } + return fallbackBlockedFromProcessEnv; + }, + configFileSelector: (profile2) => { + const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; + fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; + return fallbackBlockedFromProfile; + }, + default: false + }, + { + profile + } + )(); + if (init.ec2MetadataV1Disabled || configValue) { + const causes = []; + if (init.ec2MetadataV1Disabled) + causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); + if (fallbackBlockedFromProfile) + causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); + if (fallbackBlockedFromProcessEnv) + causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); + throw new InstanceMetadataV1FallbackError( + `AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join( + ", " + )}].` + ); + } + } + const imdsProfile = (await retry(async () => { + let profile2; + try { + profile2 = await getProfile(options); + } catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return profile2; + }, maxRetries2)).trim(); + return retry(async () => { + let creds; + try { + creds = await getCredentialsFromProfile(imdsProfile, options); + } catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return creds; + }, maxRetries2); + }, "getCredentials"); + return async () => { + const endpoint = await getInstanceMetadataEndpoint(); + if (disableFetchToken) { + logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); + return getCredentials(maxRetries, { ...endpoint, timeout }); + } else { + let token; + try { + token = (await getMetadataToken({ ...endpoint, timeout })).toString(); + } catch (error) { + if ((error == null ? void 0 : error.statusCode) === 400) { + throw Object.assign(error, { + message: "EC2 Metadata token request returned error" + }); + } else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { + disableFetchToken = true; + } + logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); + return getCredentials(maxRetries, { ...endpoint, timeout }); + } + return getCredentials(maxRetries, { + ...endpoint, + headers: { + [X_AWS_EC2_METADATA_TOKEN]: token + }, + timeout + }); + } + }; +}, "getInstanceImdsProvider"); +var getMetadataToken = /* @__PURE__ */ __name(async (options) => httpRequest({ + ...options, + path: IMDS_TOKEN_PATH, + method: "PUT", + headers: { + "x-aws-ec2-metadata-token-ttl-seconds": "21600" + } +}), "getMetadataToken"); +var getProfile = /* @__PURE__ */ __name(async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(), "getProfile"); +var getCredentialsFromProfile = /* @__PURE__ */ __name(async (profile, options) => { + const credsResponse = JSON.parse( + (await httpRequest({ + ...options, + path: IMDS_PATH + profile + })).toString() + ); + if (!isImdsCredentials(credsResponse)) { + throw new import_property_provider.CredentialsProviderError("Invalid response received from instance metadata service."); + } + return fromImdsCredentials(credsResponse); +}, "getCredentialsFromProfile"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 72429: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6459: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + EventStreamCodec: () => EventStreamCodec, + HeaderMarshaller: () => HeaderMarshaller, + Int64: () => Int64, + MessageDecoderStream: () => MessageDecoderStream, + MessageEncoderStream: () => MessageEncoderStream, + SmithyMessageDecoderStream: () => SmithyMessageDecoderStream, + SmithyMessageEncoderStream: () => SmithyMessageEncoderStream +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(46217), exports); +// src/EventStreamCodec.ts +var import_crc322 = __nccwpck_require__(7327); +// src/HeaderMarshaller.ts -/***/ }), -/***/ 46217: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/Int64.ts +var import_util_hex_encoding = __nccwpck_require__(5364); +var _Int64 = class _Int64 { + constructor(bytes) { + this.bytes = bytes; + if (bytes.byteLength !== 8) { + throw new Error("Int64 buffers must be exactly 8 bytes"); + } + } + static fromNumber(number) { + if (number > 9223372036854776e3 || number < -9223372036854776e3) { + throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); + } + const bytes = new Uint8Array(8); + for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) { + bytes[i] = remaining; + } + if (number < 0) { + negate(bytes); + } + return new _Int64(bytes); + } + /** + * Called implicitly by infix arithmetic operators. + */ + valueOf() { + const bytes = this.bytes.slice(0); + const negative = bytes[0] & 128; + if (negative) { + negate(bytes); + } + return parseInt((0, import_util_hex_encoding.toHex)(bytes), 16) * (negative ? -1 : 1); + } + toString() { + return String(this.valueOf()); + } +}; +__name(_Int64, "Int64"); +var Int64 = _Int64; +function negate(bytes) { + for (let i = 0; i < 8; i++) { + bytes[i] ^= 255; + } + for (let i = 7; i > -1; i--) { + bytes[i]++; + if (bytes[i] !== 0) + break; + } +} +__name(negate, "negate"); + +// src/HeaderMarshaller.ts +var _HeaderMarshaller = class _HeaderMarshaller { + constructor(toUtf8, fromUtf8) { + this.toUtf8 = toUtf8; + this.fromUtf8 = fromUtf8; + } + format(headers) { + const chunks = []; + for (const headerName of Object.keys(headers)) { + const bytes = this.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 /* boolTrue */ : 1 /* boolFalse */]); + case "byte": + return Uint8Array.from([2 /* byte */, header.value]); + case "short": + const shortView = new DataView(new ArrayBuffer(3)); + shortView.setUint8(0, 3 /* short */); + shortView.setInt16(1, header.value, false); + return new Uint8Array(shortView.buffer); + case "integer": + const intView = new DataView(new ArrayBuffer(5)); + intView.setUint8(0, 4 /* integer */); + intView.setInt32(1, header.value, false); + return new Uint8Array(intView.buffer); + case "long": + const longBytes = new Uint8Array(9); + longBytes[0] = 5 /* long */; + longBytes.set(header.value.bytes, 1); + return longBytes; + case "binary": + const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); + binView.setUint8(0, 6 /* byteArray */); + binView.setUint16(1, header.value.byteLength, false); + const binBytes = new Uint8Array(binView.buffer); + binBytes.set(header.value, 3); + return binBytes; + case "string": + const utf8Bytes = this.fromUtf8(header.value); + const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); + strView.setUint8(0, 7 /* string */); + strView.setUint16(1, utf8Bytes.byteLength, false); + const strBytes = new Uint8Array(strView.buffer); + strBytes.set(utf8Bytes, 3); + return strBytes; + case "timestamp": + const tsBytes = new Uint8Array(9); + tsBytes[0] = 8 /* timestamp */; + 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 /* uuid */; + uuidBytes.set((0, import_util_hex_encoding.fromHex)(header.value.replace(/\-/g, "")), 1); + return uuidBytes; + } + } + parse(headers) { + const out = {}; + let position = 0; + while (position < headers.byteLength) { + const nameLength = headers.getUint8(position++); + const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); + position += nameLength; + switch (headers.getUint8(position++)) { + case 0 /* boolTrue */: + out[name] = { + type: BOOLEAN_TAG, + value: true + }; + break; + case 1 /* boolFalse */: + out[name] = { + type: BOOLEAN_TAG, + value: false + }; + break; + case 2 /* byte */: + out[name] = { + type: BYTE_TAG, + value: headers.getInt8(position++) + }; + break; + case 3 /* short */: + out[name] = { + type: SHORT_TAG, + value: headers.getInt16(position, false) + }; + position += 2; + break; + case 4 /* integer */: + out[name] = { + type: INT_TAG, + value: headers.getInt32(position, false) + }; + position += 4; + break; + case 5 /* long */: + out[name] = { + type: LONG_TAG, + value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)) + }; + position += 8; + break; + case 6 /* byteArray */: + const binaryLength = headers.getUint16(position, false); + position += 2; + out[name] = { + type: BINARY_TAG, + value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength) + }; + position += binaryLength; + break; + case 7 /* string */: + const stringLength = headers.getUint16(position, false); + position += 2; + out[name] = { + type: STRING_TAG, + value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)) + }; + position += stringLength; + break; + case 8 /* timestamp */: + out[name] = { + type: TIMESTAMP_TAG, + value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()) + }; + position += 8; + break; + case 9 /* uuid */: + const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); + position += 16; + out[name] = { + type: UUID_TAG, + value: `${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(0, 4))}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(4, 6))}-${(0, import_util_hex_encoding.toHex)( + uuidBytes.subarray(6, 8) + )}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(8, 10))}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(10))}` + }; + break; + default: + throw new Error(`Unrecognized header type tag`); + } + } + return out; + } +}; +__name(_HeaderMarshaller, "HeaderMarshaller"); +var HeaderMarshaller = _HeaderMarshaller; +var BOOLEAN_TAG = "boolean"; +var BYTE_TAG = "byte"; +var SHORT_TAG = "short"; +var INT_TAG = "integer"; +var LONG_TAG = "long"; +var BINARY_TAG = "binary"; +var STRING_TAG = "string"; +var TIMESTAMP_TAG = "timestamp"; +var UUID_TAG = "uuid"; +var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; + +// src/splitMessage.ts +var import_crc32 = __nccwpck_require__(7327); +var PRELUDE_MEMBER_LENGTH = 4; +var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; +var CHECKSUM_LENGTH = 4; +var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; +function splitMessage({ byteLength, byteOffset, buffer }) { + if (byteLength < MINIMUM_MESSAGE_LENGTH) { + throw new Error("Provided message too short to accommodate event stream message overhead"); + } + const view = new DataView(buffer, byteOffset, byteLength); + const messageLength = view.getUint32(0, false); + if (byteLength !== messageLength) { + throw new Error("Reported message length does not match received message length"); + } + const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); + const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); + const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); + const checksummer = new import_crc32.Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH)); + if (expectedPreludeChecksum !== checksummer.digest()) { + throw new Error( + `The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})` + ); + } + checksummer.update( + new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH)) + ); + if (expectedMessageChecksum !== checksummer.digest()) { + throw new Error( + `The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}` + ); + } + return { + headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), + body: new Uint8Array( + buffer, + byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, + messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH) + ) + }; +} +__name(splitMessage, "splitMessage"); + +// src/EventStreamCodec.ts +var _EventStreamCodec = class _EventStreamCodec { + constructor(toUtf8, fromUtf8) { + this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8); + this.messageBuffer = []; + this.isEndOfStream = false; + } + feed(message) { + this.messageBuffer.push(this.decode(message)); + } + endOfStream() { + this.isEndOfStream = true; + } + getMessage() { + const message = this.messageBuffer.pop(); + const isEndOfStream = this.isEndOfStream; + return { + getMessage() { + return message; + }, + isEndOfStream() { + return isEndOfStream; + } + }; + } + getAvailableMessages() { + const messages = this.messageBuffer; + this.messageBuffer = []; + const isEndOfStream = this.isEndOfStream; + return { + getMessages() { + return messages; + }, + isEndOfStream() { + return isEndOfStream; + } + }; + } + /** + * Convert a structured JavaScript object with tagged headers into a binary + * event stream message. + */ + encode({ headers: rawHeaders, body }) { + const headers = this.headerMarshaller.format(rawHeaders); + const length = headers.byteLength + body.byteLength + 16; + const out = new Uint8Array(length); + const view = new DataView(out.buffer, out.byteOffset, out.byteLength); + const checksum = new import_crc322.Crc32(); + view.setUint32(0, length, false); + view.setUint32(4, headers.byteLength, false); + view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false); + out.set(headers, 12); + out.set(body, headers.byteLength + 12); + view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); + return out; + } + /** + * Convert a binary event stream message into a JavaScript object with an + * opaque, binary body and tagged, parsed headers. + */ + decode(message) { + const { headers, body } = splitMessage(message); + return { headers: this.headerMarshaller.parse(headers), body }; + } + /** + * Convert a structured JavaScript object with tagged headers into a binary + * event stream message header. + */ + formatHeaders(rawHeaders) { + return this.headerMarshaller.format(rawHeaders); + } +}; +__name(_EventStreamCodec, "EventStreamCodec"); +var EventStreamCodec = _EventStreamCodec; -"use strict"; +// src/MessageDecoderStream.ts +var _MessageDecoderStream = class _MessageDecoderStream { + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const bytes of this.options.inputStream) { + const decoded = this.options.decoder.decode(bytes); + yield decoded; + } + } +}; +__name(_MessageDecoderStream, "MessageDecoderStream"); +var MessageDecoderStream = _MessageDecoderStream; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultsModeConfig = void 0; -const config_resolver_1 = __nccwpck_require__(53098); -const credential_provider_imds_1 = __nccwpck_require__(7477); -const node_config_provider_1 = __nccwpck_require__(33461); -const property_provider_1 = __nccwpck_require__(79721); -const constants_1 = __nccwpck_require__(56470); -const defaultsModeConfig_1 = __nccwpck_require__(15577); -const resolveDefaultsModeConfig = ({ region = (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS), defaultsMode = (0, node_config_provider_1.loadConfig)(defaultsModeConfig_1.NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => (0, property_provider_1.memoize)(async () => { - const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; - switch (mode === null || mode === void 0 ? void 0 : mode.toLowerCase()) { - case "auto": - return resolveNodeDefaultsModeAuto(region); - case "in-region": - case "cross-region": - case "mobile": - case "standard": - case "legacy": - return Promise.resolve(mode === null || mode === void 0 ? void 0 : mode.toLocaleLowerCase()); - case undefined: - return Promise.resolve("legacy"); - default: - throw new Error(`Invalid parameter for "defaultsMode", expect ${constants_1.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); +// src/MessageEncoderStream.ts +var _MessageEncoderStream = class _MessageEncoderStream { + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const msg of this.options.messageStream) { + const encoded = this.options.encoder.encode(msg); + yield encoded; } -}); -exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; -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"; - } - else { - return "cross-region"; - } + if (this.options.includeEndFrame) { + yield new Uint8Array(0); } - return "standard"; + } }; -const inferPhysicalRegion = async () => { - var _a; - if (process.env[constants_1.AWS_EXECUTION_ENV] && (process.env[constants_1.AWS_REGION_ENV] || process.env[constants_1.AWS_DEFAULT_REGION_ENV])) { - return (_a = process.env[constants_1.AWS_REGION_ENV]) !== null && _a !== void 0 ? _a : process.env[constants_1.AWS_DEFAULT_REGION_ENV]; +__name(_MessageEncoderStream, "MessageEncoderStream"); +var MessageEncoderStream = _MessageEncoderStream; + +// src/SmithyMessageDecoderStream.ts +var _SmithyMessageDecoderStream = class _SmithyMessageDecoderStream { + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const message of this.options.messageStream) { + const deserialized = await this.options.deserializer(message); + if (deserialized === void 0) + continue; + yield deserialized; } - if (!process.env[constants_1.ENV_IMDS_DISABLED]) { - try { - const endpoint = await (0, credential_provider_imds_1.getInstanceMetadataEndpoint)(); - return (await (0, credential_provider_imds_1.httpRequest)({ ...endpoint, path: constants_1.IMDS_REGION_PATH })).toString(); - } - catch (e) { - } + } +}; +__name(_SmithyMessageDecoderStream, "SmithyMessageDecoderStream"); +var SmithyMessageDecoderStream = _SmithyMessageDecoderStream; + +// src/SmithyMessageEncoderStream.ts +var _SmithyMessageEncoderStream = class _SmithyMessageEncoderStream { + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const chunk of this.options.inputStream) { + const payloadBuf = this.options.serializer(chunk); + yield payloadBuf; } + } }; +__name(_SmithyMessageEncoderStream, "SmithyMessageEncoderStream"); +var SmithyMessageEncoderStream = _SmithyMessageEncoderStream; +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 45364: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3081: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toHex = exports.fromHex = void 0; -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}`; - } - SHORT_TO_HEX[i] = encodedByte; - HEX_TO_SHORT[encodedByte] = i; -} -function fromHex(encoded) { - if (encoded.length % 2 !== 0) { - throw new Error("Hex encoded strings must have an even number length"); - } - const out = new Uint8Array(encoded.length / 2); - for (let i = 0; i < encoded.length; i += 2) { - const encodedByte = encoded.slice(i, i + 2).toLowerCase(); - if (encodedByte in HEX_TO_SHORT) { - out[i / 2] = HEX_TO_SHORT[encodedByte]; - } - else { - throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); - } - } - return out; -} -exports.fromHex = fromHex; -function toHex(bytes) { - let out = ""; - for (let i = 0; i < bytes.byteLength; i++) { - out += SHORT_TO_HEX[bytes[i]]; - } - return out; +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Hash: () => Hash +}); +module.exports = __toCommonJS(src_exports); +var import_util_buffer_from = __nccwpck_require__(1381); +var import_util_utf8 = __nccwpck_require__(1895); +var import_buffer = __nccwpck_require__(4300); +var import_crypto = __nccwpck_require__(6113); +var _Hash = class _Hash { + constructor(algorithmIdentifier, secret) { + this.algorithmIdentifier = algorithmIdentifier; + this.secret = secret; + this.reset(); + } + update(toHash, encoding) { + this.hash.update((0, import_util_utf8.toUint8Array)(castSourceData(toHash, encoding))); + } + digest() { + return Promise.resolve(this.hash.digest()); + } + reset() { + this.hash = this.secret ? (0, import_crypto.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) : (0, import_crypto.createHash)(this.algorithmIdentifier); + } +}; +__name(_Hash, "Hash"); +var Hash = _Hash; +function castSourceData(toCast, encoding) { + if (import_buffer.Buffer.isBuffer(toCast)) { + return toCast; + } + if (typeof toCast === "string") { + return (0, import_util_buffer_from.fromString)(toCast, encoding); + } + if (ArrayBuffer.isView(toCast)) { + return (0, import_util_buffer_from.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength); + } + return (0, import_util_buffer_from.fromArrayBuffer)(toCast); } -exports.toHex = toHex; +__name(castSourceData, "castSourceData"); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -/***/ }), - -/***/ 85730: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSmithyContext = void 0; -const types_1 = __nccwpck_require__(73998); -const getSmithyContext = (context) => context[types_1.SMITHY_CONTEXT_KEY] || (context[types_1.SMITHY_CONTEXT_KEY] = {}); -exports.getSmithyContext = getSmithyContext; +/***/ }), +/***/ 780: +/***/ ((module) => { -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 2390: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + isArrayBuffer: () => isArrayBuffer +}); +module.exports = __toCommonJS(src_exports); +var isArrayBuffer = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(85730), exports); -tslib_1.__exportStar(__nccwpck_require__(80149), exports); /***/ }), -/***/ 80149: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 2800: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalizeProvider = void 0; -const normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; }; -exports.normalizeProvider = normalizeProvider; - +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ }), - -/***/ 94353: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + contentLengthMiddleware: () => contentLengthMiddleware, + contentLengthMiddlewareOptions: () => contentLengthMiddlewareOptions, + getContentLengthPlugin: () => getContentLengthPlugin +}); +module.exports = __toCommonJS(src_exports); +var import_protocol_http = __nccwpck_require__(7233); +var CONTENT_LENGTH_HEADER = "content-length"; +function contentLengthMiddleware(bodyLengthChecker) { + return (next) => async (args) => { + const request = args.request; + if (import_protocol_http.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 next({ + ...args, + request + }); + }; +} +__name(contentLengthMiddleware, "contentLengthMiddleware"); +var contentLengthMiddlewareOptions = { + step: "build", + tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], + name: "contentLengthMiddleware", + override: true +}; +var getContentLengthPlugin = /* @__PURE__ */ __name((options) => ({ + applyToStack: (clientStack) => { + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); + } +}), "getContentLengthPlugin"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 78556: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7233: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(8954); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 6392: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 69888: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8954: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 74937: -/***/ ((__unused_webpack_module, exports) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 3546: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1518: +/***/ ((__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__(3461); +const getEndpointUrlConfig_1 = __nccwpck_require__(7574); +const getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId))(); +exports.getEndpointFromConfig = getEndpointFromConfig; /***/ }), -/***/ 1550: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7574: +/***/ ((__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__(3507); +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; /***/ }), -/***/ 87382: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 2918: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + endpointMiddleware: () => endpointMiddleware, + endpointMiddlewareOptions: () => endpointMiddlewareOptions, + getEndpointFromInstructions: () => getEndpointFromInstructions, + getEndpointPlugin: () => getEndpointPlugin, + resolveEndpointConfig: () => resolveEndpointConfig, + resolveParams: () => resolveParams, + toEndpointV1: () => toEndpointV1 +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(1550), exports); -tslib_1.__exportStar(__nccwpck_require__(22585), exports); -tslib_1.__exportStar(__nccwpck_require__(37622), exports); +// src/service-customizations/s3.ts +var resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => { + const bucket = (endpointParams == null ? void 0 : endpointParams.Bucket) || ""; + if (typeof endpointParams.Bucket === "string") { + endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); + } + if (isArnBucketName(bucket)) { + if (endpointParams.ForcePathStyle === true) { + throw new Error("Path-style addressing cannot be used with ARN buckets"); + } + } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) { + endpointParams.ForcePathStyle = true; + } + if (endpointParams.DisableMultiRegionAccessPoints) { + endpointParams.disableMultiRegionAccessPoints = true; + endpointParams.DisableMRAP = true; + } + return endpointParams; +}, "resolveParamsForS3"); +var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; +var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; +var DOTS_PATTERN = /\.\./; +var isDnsCompatibleBucketName = /* @__PURE__ */ __name((bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName), "isDnsCompatibleBucketName"); +var isArnBucketName = /* @__PURE__ */ __name((bucketName) => { + const [arn, partition, service, region, account, typeOrId] = bucketName.split(":"); + const isArn = arn === "arn" && bucketName.split(":").length >= 6; + const isValidArn = [arn, partition, service, account, typeOrId].filter(Boolean).length === 5; + if (isArn && !isValidArn) { + throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); + } + return arn === "arn" && !!partition && !!service && !!account && !!typeOrId; +}, "isArnBucketName"); + +// src/adaptors/createConfigValueProvider.ts +var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config) => { + const configProvider = /* @__PURE__ */ __name(async () => { + const configValue = config[configKey] ?? config[canonicalEndpointParamKey]; + if (typeof configValue === "function") { + return configValue(); + } + return configValue; + }, "configProvider"); + if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { + return async () => { + const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; + const configValue = (credentials == null ? void 0 : credentials.credentialScope) ?? (credentials == null ? void 0 : credentials.CredentialScope); + return configValue; + }; + } + if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { + return async () => { + const endpoint = await configProvider(); + if (endpoint && typeof endpoint === "object") { + if ("url" in endpoint) { + return endpoint.url.href; + } + if ("hostname" in endpoint) { + const { protocol, hostname, port, path } = endpoint; + return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; + } + } + return endpoint; + }; + } + return configProvider; +}, "createConfigValueProvider"); +// src/adaptors/getEndpointFromInstructions.ts +var import_getEndpointFromConfig = __nccwpck_require__(1518); -/***/ }), +// src/adaptors/toEndpointV1.ts +var import_url_parser = __nccwpck_require__(4681); +var toEndpointV1 = /* @__PURE__ */ __name((endpoint) => { + if (typeof endpoint === "object") { + if ("url" in endpoint) { + return (0, import_url_parser.parseUrl)(endpoint.url); + } + return endpoint; + } + return (0, import_url_parser.parseUrl)(endpoint); +}, "toEndpointV1"); -/***/ 22585: -/***/ ((__unused_webpack_module, exports) => { +// src/adaptors/getEndpointFromInstructions.ts +var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context) => { + if (!clientConfig.endpoint) { + const endpointFromConfig = await (0, import_getEndpointFromConfig.getEndpointFromConfig)(clientConfig.serviceId || ""); + if (endpointFromConfig) { + clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); + } + } + const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); + if (typeof clientConfig.endpointProvider !== "function") { + throw new Error("config.endpointProvider is not set."); + } + const endpoint = clientConfig.endpointProvider(endpointParams, context); + return endpoint; +}, "getEndpointFromInstructions"); +var resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => { + var _a; + const endpointParams = {}; + const instructions = ((_a = instructionsSupplier == null ? void 0 : instructionsSupplier.getEndpointParameterInstructions) == null ? void 0 : _a.call(instructionsSupplier)) || {}; + for (const [name, instruction] of Object.entries(instructions)) { + switch (instruction.type) { + case "staticContextParams": + endpointParams[name] = instruction.value; + break; + case "contextParams": + endpointParams[name] = commandInput[instruction.name]; + break; + case "clientContextParams": + case "builtInParams": + endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)(); + break; + default: + throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); + } + } + if (Object.keys(instructions).length === 0) { + Object.assign(endpointParams, clientConfig); + } + if (String(clientConfig.serviceId).toLowerCase() === "s3") { + await resolveParamsForS3(endpointParams); + } + return endpointParams; +}, "resolveParams"); + +// src/endpointMiddleware.ts +var import_util_middleware = __nccwpck_require__(2390); +var endpointMiddleware = /* @__PURE__ */ __name(({ + config, + instructions +}) => { + return (next, context) => async (args) => { + var _a, _b, _c; + const endpoint = await getEndpointFromInstructions( + args.input, + { + getEndpointParameterInstructions() { + return instructions; + } + }, + { ...config }, + context + ); + context.endpointV2 = endpoint; + context.authSchemes = (_a = endpoint.properties) == null ? void 0 : _a.authSchemes; + const authScheme = (_b = context.authSchemes) == null ? void 0 : _b[0]; + if (authScheme) { + context["signing_region"] = authScheme.signingRegion; + context["signing_service"] = authScheme.signingName; + const smithyContext = (0, import_util_middleware.getSmithyContext)(context); + const httpAuthOption = (_c = smithyContext == null ? void 0 : smithyContext.selectedHttpAuthScheme) == null ? void 0 : _c.httpAuthOption; + if (httpAuthOption) { + httpAuthOption.signingProperties = Object.assign( + httpAuthOption.signingProperties || {}, + { + signing_region: authScheme.signingRegion, + signingRegion: authScheme.signingRegion, + signing_service: authScheme.signingName, + signingName: authScheme.signingName, + signingRegionSet: authScheme.signingRegionSet + }, + authScheme.properties + ); + } + } + return next({ + ...args + }); + }; +}, "endpointMiddleware"); + +// src/getEndpointPlugin.ts +var import_middleware_serde = __nccwpck_require__(1238); +var endpointMiddlewareOptions = { + step: "serialize", + tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], + name: "endpointV2Middleware", + override: true, + relation: "before", + toMiddleware: import_middleware_serde.serializerMiddlewareOption.name +}; +var getEndpointPlugin = /* @__PURE__ */ __name((config, instructions) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo( + endpointMiddleware({ + config, + instructions + }), + endpointMiddlewareOptions + ); + } +}), "getEndpointPlugin"); + +// src/resolveEndpointConfig.ts + +var resolveEndpointConfig = /* @__PURE__ */ __name((input) => { + const tls = input.tls ?? true; + const { endpoint } = input; + const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await (0, import_util_middleware.normalizeProvider)(endpoint)()) : void 0; + const isCustomEndpoint = !!endpoint; + return { + ...input, + endpoint: customEndpointProvider, + tls, + isCustomEndpoint, + useDualstackEndpoint: (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false), + useFipsEndpoint: (0, import_util_middleware.normalizeProvider)(input.useFipsEndpoint ?? false) + }; +}, "resolveEndpointConfig"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 37622: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 6039: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AdaptiveRetryStrategy: () => AdaptiveRetryStrategy, + CONFIG_MAX_ATTEMPTS: () => CONFIG_MAX_ATTEMPTS, + CONFIG_RETRY_MODE: () => CONFIG_RETRY_MODE, + ENV_MAX_ATTEMPTS: () => ENV_MAX_ATTEMPTS, + ENV_RETRY_MODE: () => ENV_RETRY_MODE, + NODE_MAX_ATTEMPT_CONFIG_OPTIONS: () => NODE_MAX_ATTEMPT_CONFIG_OPTIONS, + NODE_RETRY_MODE_CONFIG_OPTIONS: () => NODE_RETRY_MODE_CONFIG_OPTIONS, + StandardRetryStrategy: () => StandardRetryStrategy, + defaultDelayDecider: () => defaultDelayDecider, + defaultRetryDecider: () => defaultRetryDecider, + getOmitRetryHeadersPlugin: () => getOmitRetryHeadersPlugin, + getRetryAfterHint: () => getRetryAfterHint, + getRetryPlugin: () => getRetryPlugin, + omitRetryHeadersMiddleware: () => omitRetryHeadersMiddleware, + omitRetryHeadersMiddlewareOptions: () => omitRetryHeadersMiddlewareOptions, + resolveRetryConfig: () => resolveRetryConfig, + retryMiddleware: () => retryMiddleware, + retryMiddlewareOptions: () => retryMiddlewareOptions +}); +module.exports = __toCommonJS(src_exports); + +// src/AdaptiveRetryStrategy.ts + + +// src/StandardRetryStrategy.ts +var import_protocol_http = __nccwpck_require__(3795); + + +var import_uuid = __nccwpck_require__(5840); + +// src/defaultRetryQuota.ts +var import_util_retry = __nccwpck_require__(4902); +var getDefaultRetryQuota = /* @__PURE__ */ __name((initialRetryTokens, options) => { + const MAX_CAPACITY = initialRetryTokens; + const noRetryIncrement = (options == null ? void 0 : options.noRetryIncrement) ?? import_util_retry.NO_RETRY_INCREMENT; + const retryCost = (options == null ? void 0 : options.retryCost) ?? import_util_retry.RETRY_COST; + const timeoutRetryCost = (options == null ? void 0 : options.timeoutRetryCost) ?? import_util_retry.TIMEOUT_RETRY_COST; + let availableCapacity = initialRetryTokens; + const getCapacityAmount = /* @__PURE__ */ __name((error) => error.name === "TimeoutError" ? timeoutRetryCost : retryCost, "getCapacityAmount"); + const hasRetryTokens = /* @__PURE__ */ __name((error) => getCapacityAmount(error) <= availableCapacity, "hasRetryTokens"); + const retrieveRetryTokens = /* @__PURE__ */ __name((error) => { + if (!hasRetryTokens(error)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(error); + availableCapacity -= capacityAmount; + return capacityAmount; + }, "retrieveRetryTokens"); + const releaseRetryTokens = /* @__PURE__ */ __name((capacityReleaseAmount) => { + availableCapacity += capacityReleaseAmount ?? noRetryIncrement; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }, "releaseRetryTokens"); + return Object.freeze({ + hasRetryTokens, + retrieveRetryTokens, + releaseRetryTokens + }); +}, "getDefaultRetryQuota"); +// src/delayDecider.ts -/***/ }), +var defaultDelayDecider = /* @__PURE__ */ __name((delayBase, attempts) => Math.floor(Math.min(import_util_retry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)), "defaultDelayDecider"); -/***/ 48734: -/***/ ((__unused_webpack_module, exports) => { +// src/retryDecider.ts +var import_service_error_classification = __nccwpck_require__(6375); +var defaultRetryDecider = /* @__PURE__ */ __name((error) => { + if (!error) { + return false; + } + return (0, import_service_error_classification.isRetryableByTrait)(error) || (0, import_service_error_classification.isClockSkewError)(error) || (0, import_service_error_classification.isThrottlingError)(error) || (0, import_service_error_classification.isTransientError)(error); +}, "defaultRetryDecider"); + +// src/util.ts +var asSdkError = /* @__PURE__ */ __name((error) => { + if (error instanceof Error) + return error; + if (error instanceof Object) + return Object.assign(new Error(), error); + if (typeof error === "string") + return new Error(error); + return new Error(`AWS SDK error wrapper for ${error}`); +}, "asSdkError"); + +// src/StandardRetryStrategy.ts +var _StandardRetryStrategy = class _StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = import_util_retry.RETRY_MODES.STANDARD; + this.retryDecider = (options == null ? void 0 : options.retryDecider) ?? defaultRetryDecider; + this.delayDecider = (options == null ? void 0 : options.delayDecider) ?? defaultDelayDecider; + this.retryQuota = (options == null ? void 0 : options.retryQuota) ?? getDefaultRetryQuota(import_util_retry.INITIAL_RETRY_TOKENS); + } + shouldRetry(error, attempts, maxAttempts) { + return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); + } + async getMaxAttempts() { + let maxAttempts; + try { + maxAttempts = await this.maxAttemptsProvider(); + } catch (error) { + maxAttempts = import_util_retry.DEFAULT_MAX_ATTEMPTS; + } + return maxAttempts; + } + async retry(next, args, options) { + let retryTokenAmount; + let attempts = 0; + let totalDelay = 0; + const maxAttempts = await this.getMaxAttempts(); + const { request } = args; + if (import_protocol_http.HttpRequest.isInstance(request)) { + request.headers[import_util_retry.INVOCATION_ID_HEADER] = (0, import_uuid.v4)(); + } + while (true) { + try { + if (import_protocol_http.HttpRequest.isInstance(request)) { + request.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + if (options == null ? void 0 : options.beforeRequest) { + await options.beforeRequest(); + } + const { response, output } = await next(args); + if (options == null ? void 0 : options.afterRequest) { + options.afterRequest(response); + } + this.retryQuota.releaseRetryTokens(retryTokenAmount); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalDelay; + return { response, output }; + } catch (e) { + const err = asSdkError(e); + attempts++; + if (this.shouldRetry(err, attempts, maxAttempts)) { + retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); + const delayFromDecider = this.delayDecider( + (0, import_service_error_classification.isThrottlingError)(err) ? import_util_retry.THROTTLING_RETRY_DELAY_BASE : import_util_retry.DEFAULT_RETRY_DELAY_BASE, + attempts + ); + const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); + const delay = Math.max(delayFromResponse || 0, delayFromDecider); + totalDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + continue; + } + if (!err.$metadata) { + err.$metadata = {}; + } + err.$metadata.attempts = attempts; + err.$metadata.totalRetryDelay = totalDelay; + throw err; + } + } + } +}; +__name(_StandardRetryStrategy, "StandardRetryStrategy"); +var StandardRetryStrategy = _StandardRetryStrategy; +var getDelayFromRetryAfterHeader = /* @__PURE__ */ __name((response) => { + if (!import_protocol_http.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return retryAfterSeconds * 1e3; + const retryAfterDate = new Date(retryAfter); + return retryAfterDate.getTime() - Date.now(); +}, "getDelayFromRetryAfterHeader"); + +// src/AdaptiveRetryStrategy.ts +var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy extends StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + const { rateLimiter, ...superOptions } = options ?? {}; + super(maxAttemptsProvider, superOptions); + this.rateLimiter = rateLimiter ?? new import_util_retry.DefaultRateLimiter(); + this.mode = import_util_retry.RETRY_MODES.ADAPTIVE; + } + async retry(next, args) { + return super.retry(next, args, { + beforeRequest: async () => { + return this.rateLimiter.getSendToken(); + }, + afterRequest: (response) => { + this.rateLimiter.updateClientSendingRate(response); + } + }); + } +}; +__name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); +var AdaptiveRetryStrategy = _AdaptiveRetryStrategy; -"use strict"; +// src/configurations.ts +var import_util_middleware = __nccwpck_require__(2390); -Object.defineProperty(exports, "__esModule", ({ value: true })); +var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; +var CONFIG_MAX_ATTEMPTS = "max_attempts"; +var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + const value = env[ENV_MAX_ATTEMPTS]; + if (!value) + return void 0; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + configFileSelector: (profile) => { + const value = profile[CONFIG_MAX_ATTEMPTS]; + if (!value) + return void 0; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + default: import_util_retry.DEFAULT_MAX_ATTEMPTS +}; +var resolveRetryConfig = /* @__PURE__ */ __name((input) => { + const { retryStrategy } = input; + const maxAttempts = (0, import_util_middleware.normalizeProvider)(input.maxAttempts ?? import_util_retry.DEFAULT_MAX_ATTEMPTS); + return { + ...input, + maxAttempts, + retryStrategy: async () => { + if (retryStrategy) { + return retryStrategy; + } + const retryMode = await (0, import_util_middleware.normalizeProvider)(input.retryMode)(); + if (retryMode === import_util_retry.RETRY_MODES.ADAPTIVE) { + return new import_util_retry.AdaptiveRetryStrategy(maxAttempts); + } + return new import_util_retry.StandardRetryStrategy(maxAttempts); + } + }; +}, "resolveRetryConfig"); +var ENV_RETRY_MODE = "AWS_RETRY_MODE"; +var CONFIG_RETRY_MODE = "retry_mode"; +var NODE_RETRY_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_RETRY_MODE], + configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], + default: import_util_retry.DEFAULT_RETRY_MODE +}; +// src/omitRetryHeadersMiddleware.ts -/***/ }), -/***/ 23399: -/***/ ((__unused_webpack_module, exports) => { +var omitRetryHeadersMiddleware = /* @__PURE__ */ __name(() => (next) => async (args) => { + const { request } = args; + if (import_protocol_http.HttpRequest.isInstance(request)) { + delete request.headers[import_util_retry.INVOCATION_ID_HEADER]; + delete request.headers[import_util_retry.REQUEST_HEADER]; + } + return next(args); +}, "omitRetryHeadersMiddleware"); +var omitRetryHeadersMiddlewareOptions = { + name: "omitRetryHeadersMiddleware", + tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], + relation: "before", + toMiddleware: "awsAuthMiddleware", + override: true +}; +var getOmitRetryHeadersPlugin = /* @__PURE__ */ __name((options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); + } +}), "getOmitRetryHeadersPlugin"); -"use strict"; +// src/retryMiddleware.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); +var import_smithy_client = __nccwpck_require__(3570); -/***/ }), -/***/ 58468: -/***/ ((__unused_webpack_module, exports) => { +var import_isStreamingPayload = __nccwpck_require__(8977); +var retryMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => { + var _a; + let retryStrategy = await options.retryStrategy(); + const maxAttempts = await options.maxAttempts(); + if (isRetryStrategyV2(retryStrategy)) { + retryStrategy = retryStrategy; + let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); + let lastError = new Error(); + let attempts = 0; + let totalRetryDelay = 0; + const { request } = args; + const isRequest = import_protocol_http.HttpRequest.isInstance(request); + if (isRequest) { + request.headers[import_util_retry.INVOCATION_ID_HEADER] = (0, import_uuid.v4)(); + } + while (true) { + try { + if (isRequest) { + request.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + const { response, output } = await next(args); + retryStrategy.recordSuccess(retryToken); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalRetryDelay; + return { response, output }; + } catch (e) { + const retryErrorInfo = getRetryErrorInfo(e); + lastError = asSdkError(e); + if (isRequest && (0, import_isStreamingPayload.isStreamingPayload)(request)) { + (_a = context.logger instanceof import_smithy_client.NoOpLogger ? console : context.logger) == null ? void 0 : _a.warn( + "An error was encountered in a non-retryable streaming request." + ); + throw lastError; + } + try { + retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); + } catch (refreshError) { + if (!lastError.$metadata) { + lastError.$metadata = {}; + } + lastError.$metadata.attempts = attempts + 1; + lastError.$metadata.totalRetryDelay = totalRetryDelay; + throw lastError; + } + attempts = retryToken.getRetryCount(); + const delay = retryToken.getRetryDelay(); + totalRetryDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + } + } else { + retryStrategy = retryStrategy; + if (retryStrategy == null ? void 0 : retryStrategy.mode) + context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; + return retryStrategy.retry(next, args); + } +}, "retryMiddleware"); +var isRetryStrategyV2 = /* @__PURE__ */ __name((retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined", "isRetryStrategyV2"); +var getRetryErrorInfo = /* @__PURE__ */ __name((error) => { + const errorInfo = { + error, + errorType: getRetryErrorType(error) + }; + const retryAfterHint = getRetryAfterHint(error.$response); + if (retryAfterHint) { + errorInfo.retryAfterHint = retryAfterHint; + } + return errorInfo; +}, "getRetryErrorInfo"); +var getRetryErrorType = /* @__PURE__ */ __name((error) => { + if ((0, import_service_error_classification.isThrottlingError)(error)) + return "THROTTLING"; + if ((0, import_service_error_classification.isTransientError)(error)) + return "TRANSIENT"; + if ((0, import_service_error_classification.isServerError)(error)) + return "SERVER_ERROR"; + return "CLIENT_ERROR"; +}, "getRetryErrorType"); +var retryMiddlewareOptions = { + name: "retryMiddleware", + tags: ["RETRY"], + step: "finalizeRequest", + priority: "high", + override: true +}; +var getRetryPlugin = /* @__PURE__ */ __name((options) => ({ + applyToStack: (clientStack) => { + clientStack.add(retryMiddleware(options), retryMiddlewareOptions); + } +}), "getRetryPlugin"); +var getRetryAfterHint = /* @__PURE__ */ __name((response) => { + if (!import_protocol_http.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return new Date(retryAfterSeconds * 1e3); + const retryAfterDate = new Date(retryAfter); + return retryAfterDate; +}, "getRetryAfterHint"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); /***/ }), -/***/ 86361: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8977: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isStreamingPayload = void 0; +const stream_1 = __nccwpck_require__(2781); +const isStreamingPayload = (request) => (request === null || request === void 0 ? void 0 : request.body) instanceof stream_1.Readable || + (typeof ReadableStream !== "undefined" && (request === null || request === void 0 ? void 0 : request.body) instanceof ReadableStream); +exports.isStreamingPayload = isStreamingPayload; /***/ }), -/***/ 28497: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3795: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(1460); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 73326: -/***/ ((__unused_webpack_module, exports) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 94074: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 1460: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -/***/ }), +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ 13762: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -"use strict"; +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(86361), exports); -tslib_1.__exportStar(__nccwpck_require__(28497), exports); -tslib_1.__exportStar(__nccwpck_require__(73326), exports); -tslib_1.__exportStar(__nccwpck_require__(56398), exports); -tslib_1.__exportStar(__nccwpck_require__(94074), exports); +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -/***/ }), -/***/ 56398: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 1238: +/***/ ((module) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + deserializerMiddleware: () => deserializerMiddleware, + deserializerMiddlewareOption: () => deserializerMiddlewareOption, + getSerdePlugin: () => getSerdePlugin, + serializerMiddleware: () => serializerMiddleware, + serializerMiddlewareOption: () => serializerMiddlewareOption +}); +module.exports = __toCommonJS(src_exports); -/***/ }), +// src/deserializerMiddleware.ts +var deserializerMiddleware = /* @__PURE__ */ __name((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 + }); + if (!("$metadata" in error)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + error.message += "\n " + hint; + } + throw error; + } +}, "deserializerMiddleware"); + +// src/serializerMiddleware.ts +var serializerMiddleware = /* @__PURE__ */ __name((options, serializer) => (next, context) => async (args) => { + var _a; + const endpoint = ((_a = context.endpointV2) == null ? void 0 : _a.url) && options.urlParser ? async () => options.urlParser(context.endpointV2.url) : options.endpoint; + if (!endpoint) { + throw new Error("No valid endpoint provider available."); + } + const request = await serializer(args.input, { ...options, endpoint }); + return next({ + ...args, + request + }); +}, "serializerMiddleware"); -/***/ 5742: -/***/ ((__unused_webpack_module, exports) => { +// src/serdePlugin.ts +var deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true +}; +var 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); + } + }; +} +__name(getSerdePlugin, "getSerdePlugin"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 40596: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7911: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + constructStack: () => constructStack +}); +module.exports = __toCommonJS(src_exports); + +// src/MiddlewareStack.ts +var getAllAliases = /* @__PURE__ */ __name((name, aliases) => { + const _aliases = []; + if (name) { + _aliases.push(name); + } + if (aliases) { + for (const alias of aliases) { + _aliases.push(alias); } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); + } + return _aliases; +}, "getAllAliases"); +var getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name, aliases) => { + return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; +}, "getMiddlewareNameWithAliases"); +var constructStack = /* @__PURE__ */ __name(() => { + let absoluteEntries = []; + let relativeEntries = []; + let identifyOnResolve = false; + const entriesNameSet = /* @__PURE__ */ new Set(); + const sort = /* @__PURE__ */ __name((entries) => entries.sort( + (a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"] + ), "sort"); + const removeByName = /* @__PURE__ */ __name((toRemove) => { + let isRemoved = false; + const filterCb = /* @__PURE__ */ __name((entry) => { + const aliases = getAllAliases(entry.name, entry.aliases); + if (aliases.includes(toRemove)) { + isRemoved = true; + for (const alias of aliases) { + entriesNameSet.delete(alias); + } + return false; + } + return true; + }, "filterCb"); + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, "removeByName"); + const removeByReference = /* @__PURE__ */ __name((toRemove) => { + let isRemoved = false; + const filterCb = /* @__PURE__ */ __name((entry) => { + if (entry.middleware === toRemove) { + isRemoved = true; + for (const alias of getAllAliases(entry.name, entry.aliases)) { + entriesNameSet.delete(alias); + } + return false; + } + return true; + }, "filterCb"); + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, "removeByReference"); + const cloneTo = /* @__PURE__ */ __name((toStack) => { + var _a; + absoluteEntries.forEach((entry) => { + toStack.add(entry.middleware, { ...entry }); + }); + relativeEntries.forEach((entry) => { + toStack.addRelativeTo(entry.middleware, { ...entry }); + }); + (_a = toStack.identifyOnResolve) == null ? void 0 : _a.call(toStack, stack.identifyOnResolve()); + return toStack; + }, "cloneTo"); + const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => { + const expandedMiddlewareList = []; + from.before.forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + expandedMiddlewareList.push(from); + from.after.reverse().forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + return expandedMiddlewareList; + }, "expandRelativeMiddlewareList"); + const getMiddlewareList = /* @__PURE__ */ __name((debug = false) => { + const normalizedAbsoluteEntries = []; + const normalizedRelativeEntries = []; + const normalizedEntriesNameMap = {}; + absoluteEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [] + }; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; + } + normalizedAbsoluteEntries.push(normalizedEntry); + }); + relativeEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [] + }; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; + } + normalizedRelativeEntries.push(normalizedEntry); + }); + normalizedRelativeEntries.forEach((entry) => { + if (entry.toMiddleware) { + const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; + if (toMiddleware === void 0) { + if (debug) { + return; + } + throw new Error( + `${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}` + ); + } + if (entry.relation === "after") { + toMiddleware.after.push(entry); + } + if (entry.relation === "before") { + toMiddleware.before.push(entry); + } + } + }); + const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => { + wholeList.push(...expandedMiddlewareList); + return wholeList; + }, []); + return mainChain; + }, "getMiddlewareList"); + const stack = { + add: (middleware, options = {}) => { + const { name, override, aliases: _aliases } = options; + const entry = { + step: "initialize", + priority: "normal", + middleware, + ...options + }; + const aliases = getAllAliases(name, _aliases); + if (aliases.length > 0) { + if (aliases.some((alias) => entriesNameSet.has(alias))) { + if (!override) + throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + for (const alias of aliases) { + const toOverrideIndex = absoluteEntries.findIndex( + (entry2) => { + var _a; + return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias)); + } + ); + if (toOverrideIndex === -1) { + continue; + } + const toOverride = absoluteEntries[toOverrideIndex]; + if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) { + throw new Error( + `"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.` + ); + } + absoluteEntries.splice(toOverrideIndex, 1); + } + } + for (const alias of aliases) { + entriesNameSet.add(alias); + } + } + absoluteEntries.push(entry); + }, + addRelativeTo: (middleware, options) => { + const { name, override, aliases: _aliases } = options; + const entry = { + middleware, + ...options + }; + const aliases = getAllAliases(name, _aliases); + if (aliases.length > 0) { + if (aliases.some((alias) => entriesNameSet.has(alias))) { + if (!override) + throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + for (const alias of aliases) { + const toOverrideIndex = relativeEntries.findIndex( + (entry2) => { + var _a; + return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias)); + } + ); + if (toOverrideIndex === -1) { + continue; + } + const toOverride = relativeEntries[toOverrideIndex]; + if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { + throw new Error( + `"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.` + ); + } + relativeEntries.splice(toOverrideIndex, 1); + } + } + for (const alias of aliases) { + entriesNameSet.add(alias); + } + } + relativeEntries.push(entry); + }, + clone: () => cloneTo(constructStack()), + use: (plugin) => { + plugin.applyToStack(stack); + }, + remove: (toRemove) => { + if (typeof toRemove === "string") + return removeByName(toRemove); + else + return removeByReference(toRemove); + }, + removeByTag: (toRemove) => { + let isRemoved = false; + const filterCb = /* @__PURE__ */ __name((entry) => { + const { tags, name, aliases: _aliases } = entry; + if (tags && tags.includes(toRemove)) { + const aliases = getAllAliases(name, _aliases); + for (const alias of aliases) { + entriesNameSet.delete(alias); + } + isRemoved = true; + return false; + } + return true; + }, "filterCb"); + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, + concat: (from) => { + var _a; + const cloned = cloneTo(constructStack()); + cloned.use(from); + cloned.identifyOnResolve( + identifyOnResolve || cloned.identifyOnResolve() || (((_a = from.identifyOnResolve) == null ? void 0 : _a.call(from)) ?? false) + ); + return cloned; + }, + applyToStack: cloneTo, + identify: () => { + return getMiddlewareList(true).map((mw) => { + const step = mw.step ?? mw.relation + " " + mw.toMiddleware; + return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; + }); + }, + identifyOnResolve(toggle) { + if (typeof toggle === "boolean") + identifyOnResolve = toggle; + return identifyOnResolve; + }, + resolve: (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 { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; + }; + return stack; +}, "constructStack"); +var stepWeights = { + initialize: 5, + serialize: 4, + build: 3, + finalizeRequest: 2, + deserialize: 1 }; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; +var priorityWeights = { + high: 3, + normal: 2, + low: 1 }; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), +// Annotate the CommonJS export names for ESM import in node: -/***/ 63089: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(40596); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; /***/ }), -/***/ 95712: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3461: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + loadConfig: () => loadConfig +}); +module.exports = __toCommonJS(src_exports); +// src/configLoader.ts -/***/ }), -/***/ 76332: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/fromEnv.ts +var import_property_provider = __nccwpck_require__(9721); +var fromEnv = /* @__PURE__ */ __name((envVarSelector) => async () => { + try { + const config = envVarSelector(process.env); + if (config === void 0) { + throw new Error(); + } + return config; + } catch (e) { + throw new import_property_provider.CredentialsProviderError( + e.message || `Cannot load config from environment variables with getter: ${envVarSelector}` + ); + } +}, "fromEnv"); -"use strict"; +// src/fromSharedConfigFiles.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(63089), exports); -tslib_1.__exportStar(__nccwpck_require__(95712), exports); -var checksum_1 = __nccwpck_require__(40596); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); +var import_shared_ini_file_loader = __nccwpck_require__(3507); +var fromSharedConfigFiles = /* @__PURE__ */ __name((configSelector, { preferredFile = "config", ...init } = {}) => async () => { + const profile = (0, import_shared_ini_file_loader.getProfileName)(init); + const { configFile, credentialsFile } = await (0, import_shared_ini_file_loader.loadSharedConfigFiles)(init); + const profileFromCredentials = credentialsFile[profile] || {}; + const profileFromConfig = configFile[profile] || {}; + const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials }; + try { + const cfgFile = preferredFile === "config" ? configFile : credentialsFile; + const configValue = configSelector(mergedProfile, cfgFile); + if (configValue === void 0) { + throw new Error(); + } + return configValue; + } catch (e) { + throw new import_property_provider.CredentialsProviderError( + e.message || `Cannot load config for profile ${profile} in SDK configuration files with getter: ${configSelector}` + ); + } +}, "fromSharedConfigFiles"); +// src/fromStatic.ts -/***/ }), +var isFunction = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction"); +var fromStatic = /* @__PURE__ */ __name((defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, import_property_provider.fromStatic)(defaultValue), "fromStatic"); -/***/ 67186: -/***/ ((__unused_webpack_module, exports) => { +// src/configLoader.ts +var loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, import_property_provider.memoize)( + (0, import_property_provider.chain)( + fromEnv(environmentVariableSelector), + fromSharedConfigFiles(configFileSelector, configuration), + fromStatic(defaultValue) + ) +), "loadConfig"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); /***/ }), -/***/ 91655: +/***/ 3946: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; +exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; /***/ }), -/***/ 64554: +/***/ 508: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getTransformedHeaders = void 0; +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; +}; +exports.getTransformedHeaders = getTransformedHeaders; /***/ }), -/***/ 76493: +/***/ 258: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(91655), exports); -tslib_1.__exportStar(__nccwpck_require__(64554), exports); +tslib_1.__exportStar(__nccwpck_require__(6948), exports); +tslib_1.__exportStar(__nccwpck_require__(6999), exports); +tslib_1.__exportStar(__nccwpck_require__(1030), exports); /***/ }), -/***/ 73998: +/***/ 6948: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(94353), exports); -tslib_1.__exportStar(__nccwpck_require__(78556), exports); -tslib_1.__exportStar(__nccwpck_require__(6392), exports); -tslib_1.__exportStar(__nccwpck_require__(69888), exports); -tslib_1.__exportStar(__nccwpck_require__(74937), exports); -tslib_1.__exportStar(__nccwpck_require__(3546), exports); -tslib_1.__exportStar(__nccwpck_require__(87382), exports); -tslib_1.__exportStar(__nccwpck_require__(48734), exports); -tslib_1.__exportStar(__nccwpck_require__(23399), exports); -tslib_1.__exportStar(__nccwpck_require__(58468), exports); -tslib_1.__exportStar(__nccwpck_require__(13762), exports); -tslib_1.__exportStar(__nccwpck_require__(5742), exports); -tslib_1.__exportStar(__nccwpck_require__(76332), exports); -tslib_1.__exportStar(__nccwpck_require__(67186), exports); -tslib_1.__exportStar(__nccwpck_require__(76493), exports); -tslib_1.__exportStar(__nccwpck_require__(43667), exports); -tslib_1.__exportStar(__nccwpck_require__(55138), exports); -tslib_1.__exportStar(__nccwpck_require__(90095), exports); -tslib_1.__exportStar(__nccwpck_require__(2173), exports); -tslib_1.__exportStar(__nccwpck_require__(50143), exports); -tslib_1.__exportStar(__nccwpck_require__(74835), exports); -tslib_1.__exportStar(__nccwpck_require__(36627), exports); -tslib_1.__exportStar(__nccwpck_require__(87004), exports); -tslib_1.__exportStar(__nccwpck_require__(91422), exports); -tslib_1.__exportStar(__nccwpck_require__(89958), exports); -tslib_1.__exportStar(__nccwpck_require__(87437), exports); -tslib_1.__exportStar(__nccwpck_require__(62433), exports); -tslib_1.__exportStar(__nccwpck_require__(37542), exports); -tslib_1.__exportStar(__nccwpck_require__(73534), exports); -tslib_1.__exportStar(__nccwpck_require__(70696), exports); -tslib_1.__exportStar(__nccwpck_require__(81093), exports); -tslib_1.__exportStar(__nccwpck_require__(96437), exports); -tslib_1.__exportStar(__nccwpck_require__(62209), exports); -tslib_1.__exportStar(__nccwpck_require__(94955), exports); - - -/***/ }), - -/***/ 43667: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 55138: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 90095: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 2173: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 50143: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 74835: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; +const protocol_http_1 = __nccwpck_require__(4418); +const querystring_builder_1 = __nccwpck_require__(8031); +const http_1 = __nccwpck_require__(3685); +const https_1 = __nccwpck_require__(5687); +const constants_1 = __nccwpck_require__(3946); +const get_transformed_headers_1 = __nccwpck_require__(508); +const set_connection_timeout_1 = __nccwpck_require__(5545); +const set_socket_keep_alive_1 = __nccwpck_require__(3751); +const set_socket_timeout_1 = __nccwpck_require__(2618); +const write_request_body_1 = __nccwpck_require__(3766); +exports.DEFAULT_REQUEST_TIMEOUT = 0; +class NodeHttpHandler { + constructor(options) { + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }) + .catch(reject); + } + else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, + httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), + httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); + (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + return new Promise((_resolve, _reject) => { + var _a, _b; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); + let auth = undefined; + if (request.username != null || request.password != null) { + const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; + const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; + auth = `${username}:${password}`; + } + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, + auth, + }; + const requestFunc = isSSL ? https_1.request : http_1.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocol_http_1.HttpResponse({ + statusCode: res.statusCode || -1, + reason: res.statusMessage, + headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), + body: res, + }); + resolve({ response: httpResponse }); + }); + req.on("error", (err) => { + if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { + reject(Object.assign(err, { name: "TimeoutError" })); + } + else { + reject(err); + } + }); + (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); + (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs, + }); + } + writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); + }); + } +} +exports.NodeHttpHandler = NodeHttpHandler; /***/ }), -/***/ 36627: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5771: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NodeHttp2ConnectionManager = void 0; +const tslib_1 = __nccwpck_require__(4351); +const http2_1 = tslib_1.__importDefault(__nccwpck_require__(5158)); +const node_http2_connection_pool_1 = __nccwpck_require__(5157); +class NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + lease(requestContext, connectionConfiguration) { + const 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_1.default.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 node_http2_connection_pool_1.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) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); + } + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } +} +exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; /***/ }), -/***/ 87004: +/***/ 5157: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NodeHttp2ConnectionPool = void 0; +class NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions !== null && sessions !== void 0 ? 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(); + } + } + } + } +} +exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; /***/ }), -/***/ 91422: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6999: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NodeHttp2Handler = void 0; +const protocol_http_1 = __nccwpck_require__(4418); +const querystring_builder_1 = __nccwpck_require__(8031); +const http2_1 = __nccwpck_require__(5158); +const get_transformed_headers_1 = __nccwpck_require__(508); +const node_http2_connection_manager_1 = __nccwpck_require__(5771); +const write_request_body_1 = __nccwpck_require__(3766); +class NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); + 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 } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } + } + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a, _b, _c; + let fulfilled = false; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal === null || abortSignal === void 0 ? void 0 : 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 = (_a = request.username) !== null && _a !== void 0 ? _a : ""; + const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; + auth = `${username}:${password}@`; + } + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false, + }); + const rejectWithDestroy = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }; + const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [http2_1.constants.HTTP2_HEADER_PATH]: path, + [http2_1.constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocol_http_1.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), + body: req, + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + 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 = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); + }); + } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } +} +exports.NodeHttp2Handler = NodeHttp2Handler; /***/ }), -/***/ 89958: +/***/ 5545: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.setConnectionTimeout = void 0; +const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError", + })); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } + else { + clearTimeout(timeoutId); + } + }); +}; +exports.setConnectionTimeout = setConnectionTimeout; /***/ }), -/***/ 87437: +/***/ 3751: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.setSocketKeepAlive = void 0; +const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}; +exports.setSocketKeepAlive = setSocketKeepAlive; /***/ }), -/***/ 62433: +/***/ 2618: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.setSocketTimeout = void 0; +const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}; +exports.setSocketTimeout = setSocketTimeout; /***/ }), -/***/ 37542: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3211: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Collector = void 0; +const stream_1 = __nccwpck_require__(2781); +class Collector extends stream_1.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +} +exports.Collector = Collector; /***/ }), -/***/ 73534: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1030: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); +exports.streamCollector = void 0; +const collector_1 = __nccwpck_require__(3211); +const streamCollector = (stream) => new Promise((resolve, reject) => { + const collector = new collector_1.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); + }); +}); +exports.streamCollector = streamCollector; /***/ }), -/***/ 70696: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3766: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.writeRequestBody = void 0; +const stream_1 = __nccwpck_require__(2781); +const MIN_WAIT_TIME = 1000; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + var _a; + const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }), + ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } +} +exports.writeRequestBody = writeRequestBody; +function writeBody(httpRequest, body) { + if (body instanceof stream_1.Readable) { + body.pipe(httpRequest); + } + else if (body) { + httpRequest.end(Buffer.from(body)); + } + else { + httpRequest.end(); + } +} /***/ }), -/***/ 81093: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 9721: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + CredentialsProviderError: () => CredentialsProviderError, + ProviderError: () => ProviderError, + TokenProviderError: () => TokenProviderError, + chain: () => chain, + fromStatic: () => fromStatic, + memoize: () => memoize +}); +module.exports = __toCommonJS(src_exports); + +// src/ProviderError.ts +var _ProviderError = class _ProviderError extends Error { + constructor(message, tryNextLink = true) { + super(message); + this.tryNextLink = tryNextLink; + this.name = "ProviderError"; + Object.setPrototypeOf(this, _ProviderError.prototype); + } + static from(error, tryNextLink = true) { + return Object.assign(new this(error.message, tryNextLink), error); + } +}; +__name(_ProviderError, "ProviderError"); +var ProviderError = _ProviderError; +// src/CredentialsProviderError.ts +var _CredentialsProviderError = class _CredentialsProviderError extends ProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "CredentialsProviderError"; + Object.setPrototypeOf(this, _CredentialsProviderError.prototype); + } +}; +__name(_CredentialsProviderError, "CredentialsProviderError"); +var CredentialsProviderError = _CredentialsProviderError; -/***/ }), +// src/TokenProviderError.ts +var _TokenProviderError = class _TokenProviderError extends ProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "TokenProviderError"; + Object.setPrototypeOf(this, _TokenProviderError.prototype); + } +}; +__name(_TokenProviderError, "TokenProviderError"); +var TokenProviderError = _TokenProviderError; -/***/ 96437: -/***/ ((__unused_webpack_module, exports) => { +// src/chain.ts +var chain = /* @__PURE__ */ __name((...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 == null ? void 0 : err.tryNextLink) { + continue; + } + throw err; + } + } + throw lastProviderError; +}, "chain"); + +// src/fromStatic.ts +var fromStatic = /* @__PURE__ */ __name((staticValue) => () => Promise.resolve(staticValue), "fromStatic"); + +// src/memoize.ts +var memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = /* @__PURE__ */ __name(async () => { + if (!pending) { + pending = provider(); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } finally { + pending = void 0; + } + return resolved; + }, "coalesceProvider"); + if (isExpired === void 0) { + return async (options) => { + if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || (options == null ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(); + } + if (isConstant) { + return resolved; + } + if (requiresRefresh && !requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(); + return resolved; + } + return resolved; + }; +}, "memoize"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 62209: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9179: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Field = void 0; +const types_1 = __nccwpck_require__(5756); +class Field { + constructor({ name, kind = types_1.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; + } +} +exports.Field = Field; /***/ }), -/***/ 94955: +/***/ 9242: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 65053: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AdaptiveRetryStrategy = void 0; -const config_1 = __nccwpck_require__(93435); -const DefaultRateLimiter_1 = __nccwpck_require__(22234); -const StandardRetryStrategy_1 = __nccwpck_require__(48361); -class AdaptiveRetryStrategy { - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - this.mode = config_1.RETRY_MODES.ADAPTIVE; - const { rateLimiter } = options !== null && options !== void 0 ? options : {}; - this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new DefaultRateLimiter_1.DefaultRateLimiter(); - this.standardRetryStrategy = new StandardRetryStrategy_1.StandardRetryStrategy(maxAttemptsProvider); +exports.Fields = void 0; +class Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + setField(field) { + this.entries[field.name.toLowerCase()] = field; } - async acquireInitialRetryToken(retryTokenScope) { - await this.rateLimiter.getSendToken(); - return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + getField(name) { + return this.entries[name.toLowerCase()]; } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - this.rateLimiter.updateClientSendingRate(errorInfo); - return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + removeField(name) { + delete this.entries[name.toLowerCase()]; } - recordSuccess(token) { - this.rateLimiter.updateClientSendingRate({}); - this.standardRetryStrategy.recordSuccess(token); + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); } } -exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; +exports.Fields = Fields; /***/ }), -/***/ 25689: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3206: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConfiguredRetryStrategy = void 0; -const constants_1 = __nccwpck_require__(66302); -const StandardRetryStrategy_1 = __nccwpck_require__(48361); -class ConfiguredRetryStrategy extends StandardRetryStrategy_1.StandardRetryStrategy { - constructor(maxAttempts, computeNextBackoffDelay = constants_1.DEFAULT_RETRY_DELAY_BASE) { - super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); - if (typeof computeNextBackoffDelay === "number") { - this.computeNextBackoffDelay = () => computeNextBackoffDelay; - } - else { - this.computeNextBackoffDelay = computeNextBackoffDelay; - } - } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); - return token; - } -} -exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy; /***/ }), -/***/ 22234: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 8746: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefaultRateLimiter = void 0; -const service_error_classification_1 = __nccwpck_require__(6375); -class DefaultRateLimiter { +exports.HttpRequest = void 0; +class HttpRequest { constructor(options) { - var _a, _b, _c, _d, _e; - this.currentCapacity = 0; - this.enabled = false; - this.lastMaxRate = 0; - this.measuredTxRate = 0; - this.requestCount = 0; - this.lastTimestamp = 0; - this.timeWindow = 0; - this.beta = (_a = options === null || options === void 0 ? void 0 : options.beta) !== null && _a !== void 0 ? _a : 0.7; - this.minCapacity = (_b = options === null || options === void 0 ? void 0 : options.minCapacity) !== null && _b !== void 0 ? _b : 1; - this.minFillRate = (_c = options === null || options === void 0 ? void 0 : options.minFillRate) !== null && _c !== void 0 ? _c : 0.5; - this.scaleConstant = (_d = options === null || options === void 0 ? void 0 : options.scaleConstant) !== null && _d !== void 0 ? _d : 0.4; - this.smooth = (_e = options === null || options === void 0 ? void 0 : options.smooth) !== null && _e !== void 0 ? _e : 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) => setTimeout(resolve, delay)); - } - this.currentCapacity = this.currentCapacity - amount; - } - refillTokenBucket() { - const timestamp = this.getCurrentTimeInSeconds(); - if (!this.lastTimestamp) { - this.lastTimestamp = timestamp; - return; - } - const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; - this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); - this.lastTimestamp = timestamp; - } - updateClientSendingRate(response) { - let calculatedRate; - this.updateMeasuredRate(); - if ((0, service_error_classification_1.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); + 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; } - 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; - } + 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"); } - getPrecise(num) { - return parseFloat(num.toFixed(8)); + clone() { + const cloned = new HttpRequest({ + ...this, + headers: { ...this.headers }, + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; } } -exports.DefaultRateLimiter = DefaultRateLimiter; +exports.HttpRequest = HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param, + }; + }, {}); +} /***/ }), -/***/ 48361: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6322: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StandardRetryStrategy = void 0; -const config_1 = __nccwpck_require__(93435); -const constants_1 = __nccwpck_require__(66302); -const defaultRetryBackoffStrategy_1 = __nccwpck_require__(21337); -const defaultRetryToken_1 = __nccwpck_require__(1127); -class StandardRetryStrategy { - constructor(maxAttempts) { - this.maxAttempts = maxAttempts; - this.mode = config_1.RETRY_MODES.STANDARD; - this.capacity = constants_1.INITIAL_RETRY_TOKENS; - this.retryBackoffStrategy = (0, defaultRetryBackoffStrategy_1.getDefaultRetryBackoffStrategy)(); - this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; - } - async acquireInitialRetryToken(retryTokenScope) { - return (0, defaultRetryToken_1.createDefaultRetryToken)({ - retryDelay: constants_1.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" ? constants_1.THROTTLING_RETRY_DELAY_BASE : constants_1.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 (0, defaultRetryToken_1.createDefaultRetryToken)({ - retryDelay, - retryCount: token.getRetryCount() + 1, - retryCost: capacityCost, - }); - } - throw new Error("No retry token available"); - } - recordSuccess(token) { - var _a; - this.capacity = Math.max(constants_1.INITIAL_RETRY_TOKENS, this.capacity + ((_a = token.getRetryCost()) !== null && _a !== void 0 ? _a : constants_1.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 ${config_1.DEFAULT_MAX_ATTEMPTS}`); - return config_1.DEFAULT_MAX_ATTEMPTS; - } - } - shouldRetry(tokenToRenew, errorInfo, maxAttempts) { - const attempts = tokenToRenew.getRetryCount() + 1; - return (attempts < maxAttempts && - this.capacity >= this.getCapacityCost(errorInfo.errorType) && - this.isRetryableError(errorInfo.errorType)); - } - getCapacityCost(errorType) { - return errorType === "TRANSIENT" ? constants_1.TIMEOUT_RETRY_COST : constants_1.RETRY_COST; +exports.HttpResponse = void 0; +class HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; } - isRetryableError(errorType) { - return errorType === "THROTTLING" || errorType === "TRANSIENT"; + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; } } -exports.StandardRetryStrategy = StandardRetryStrategy; +exports.HttpResponse = HttpResponse; /***/ }), -/***/ 93435: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4418: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_RETRY_MODE = exports.DEFAULT_MAX_ATTEMPTS = exports.RETRY_MODES = void 0; -var RETRY_MODES; -(function (RETRY_MODES) { - RETRY_MODES["STANDARD"] = "standard"; - RETRY_MODES["ADAPTIVE"] = "adaptive"; -})(RETRY_MODES = exports.RETRY_MODES || (exports.RETRY_MODES = {})); -exports.DEFAULT_MAX_ATTEMPTS = 3; -exports.DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD; +const tslib_1 = __nccwpck_require__(4351); +tslib_1.__exportStar(__nccwpck_require__(9179), exports); +tslib_1.__exportStar(__nccwpck_require__(9242), exports); +tslib_1.__exportStar(__nccwpck_require__(3206), exports); +tslib_1.__exportStar(__nccwpck_require__(8746), exports); +tslib_1.__exportStar(__nccwpck_require__(6322), exports); +tslib_1.__exportStar(__nccwpck_require__(1466), exports); +tslib_1.__exportStar(__nccwpck_require__(9135), exports); /***/ }), -/***/ 66302: +/***/ 1466: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.REQUEST_HEADER = exports.INVOCATION_ID_HEADER = exports.NO_RETRY_INCREMENT = exports.TIMEOUT_RETRY_COST = exports.RETRY_COST = exports.INITIAL_RETRY_TOKENS = exports.THROTTLING_RETRY_DELAY_BASE = exports.MAXIMUM_RETRY_DELAY = exports.DEFAULT_RETRY_DELAY_BASE = void 0; -exports.DEFAULT_RETRY_DELAY_BASE = 100; -exports.MAXIMUM_RETRY_DELAY = 20 * 1000; -exports.THROTTLING_RETRY_DELAY_BASE = 500; -exports.INITIAL_RETRY_TOKENS = 500; -exports.RETRY_COST = 5; -exports.TIMEOUT_RETRY_COST = 10; -exports.NO_RETRY_INCREMENT = 1; -exports.INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; -exports.REQUEST_HEADER = "amz-sdk-request"; +exports.isValidHostname = void 0; +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +exports.isValidHostname = isValidHostname; /***/ }), -/***/ 21337: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 9135: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getDefaultRetryBackoffStrategy = void 0; -const constants_1 = __nccwpck_require__(66302); -const getDefaultRetryBackoffStrategy = () => { - let delayBase = constants_1.DEFAULT_RETRY_DELAY_BASE; - const computeNextBackoffDelay = (attempts) => { - return Math.floor(Math.min(constants_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); - }; - const setDelayBase = (delay) => { - delayBase = delay; - }; - return { - computeNextBackoffDelay, - setDelayBase, - }; -}; -exports.getDefaultRetryBackoffStrategy = getDefaultRetryBackoffStrategy; /***/ }), -/***/ 1127: +/***/ 8031: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createDefaultRetryToken = void 0; -const constants_1 = __nccwpck_require__(66302); -const createDefaultRetryToken = ({ retryDelay, retryCount, retryCost, }) => { - const getRetryCount = () => retryCount; - const getRetryDelay = () => Math.min(constants_1.MAXIMUM_RETRY_DELAY, retryDelay); - const getRetryCost = () => retryCost; - return { - getRetryCount, - getRetryDelay, - getRetryCost, - }; -}; -exports.createDefaultRetryToken = createDefaultRetryToken; +exports.buildQueryString = void 0; +const util_uri_escape_1 = __nccwpck_require__(4197); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, util_uri_escape_1.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); + } + } + else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; + } + parts.push(qsEntry); + } + } + return parts.join("&"); +} +exports.buildQueryString = buildQueryString; /***/ }), -/***/ 84902: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(65053), exports); -tslib_1.__exportStar(__nccwpck_require__(25689), exports); -tslib_1.__exportStar(__nccwpck_require__(22234), exports); -tslib_1.__exportStar(__nccwpck_require__(48361), exports); -tslib_1.__exportStar(__nccwpck_require__(93435), exports); -tslib_1.__exportStar(__nccwpck_require__(66302), exports); -tslib_1.__exportStar(__nccwpck_require__(75427), exports); - +/***/ 4769: +/***/ ((module) => { -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 75427: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + parseQueryString: () => parseQueryString +}); +module.exports = __toCommonJS(src_exports); +function parseQueryString(querystring) { + const query = {}; + querystring = querystring.replace(/^\?/, ""); + if (querystring) { + for (const pair of querystring.split("&")) { + let [key, value = null] = pair.split("="); + key = decodeURIComponent(key); + if (value) { + value = decodeURIComponent(value); + } + if (!(key in query)) { + query[key] = value; + } else if (Array.isArray(query[key])) { + query[key].push(value); + } else { + query[key] = [query[key], value]; + } + } + } + return query; +} +__name(parseQueryString, "parseQueryString"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 22094: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 6375: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Uint8ArrayBlobAdapter = void 0; -const transforms_1 = __nccwpck_require__(82098); -class Uint8ArrayBlobAdapter extends Uint8Array { - static fromString(source, encoding = "utf-8") { - switch (typeof source) { - case "string": - return (0, transforms_1.transformFromString)(source, encoding); - default: - throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); - } - } - static mutate(source) { - Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype); - return source; - } - transformToString(encoding = "utf-8") { - return (0, transforms_1.transformToString)(this, encoding); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + isClockSkewCorrectedError: () => isClockSkewCorrectedError, + isClockSkewError: () => isClockSkewError, + isRetryableByTrait: () => isRetryableByTrait, + isServerError: () => isServerError, + isThrottlingError: () => isThrottlingError, + isTransientError: () => isTransientError +}); +module.exports = __toCommonJS(src_exports); + +// src/constants.ts +var CLOCK_SKEW_ERROR_CODES = [ + "AuthFailure", + "InvalidSignatureException", + "RequestExpired", + "RequestInTheFuture", + "RequestTimeTooSkewed", + "SignatureDoesNotMatch" +]; +var THROTTLING_ERROR_CODES = [ + "BandwidthLimitExceeded", + "EC2ThrottledException", + "LimitExceededException", + "PriorRequestNotComplete", + "ProvisionedThroughputExceededException", + "RequestLimitExceeded", + "RequestThrottled", + "RequestThrottledException", + "SlowDown", + "ThrottledException", + "Throttling", + "ThrottlingException", + "TooManyRequestsException", + "TransactionInProgressException" + // DynamoDB +]; +var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; +var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; +var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; + +// src/index.ts +var isRetryableByTrait = /* @__PURE__ */ __name((error) => error.$retryable !== void 0, "isRetryableByTrait"); +var isClockSkewError = /* @__PURE__ */ __name((error) => CLOCK_SKEW_ERROR_CODES.includes(error.name), "isClockSkewError"); +var isClockSkewCorrectedError = /* @__PURE__ */ __name((error) => { + var _a; + return (_a = error.$metadata) == null ? void 0 : _a.clockSkewCorrected; +}, "isClockSkewCorrectedError"); +var isThrottlingError = /* @__PURE__ */ __name((error) => { + var _a, _b; + return ((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) === 429 || THROTTLING_ERROR_CODES.includes(error.name) || ((_b = error.$retryable) == null ? void 0 : _b.throttling) == true; +}, "isThrottlingError"); +var isTransientError = /* @__PURE__ */ __name((error) => { + var _a; + return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0); +}, "isTransientError"); +var isServerError = /* @__PURE__ */ __name((error) => { + var _a; + if (((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) !== void 0) { + const statusCode = error.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) { + return true; } -} -exports.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter; - - -/***/ }), - -/***/ 82098: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return false; + } + return false; +}, "isServerError"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.transformFromString = exports.transformToString = void 0; -const util_base64_1 = __nccwpck_require__(75600); -const util_utf8_1 = __nccwpck_require__(41895); -const Uint8ArrayBlobAdapter_1 = __nccwpck_require__(22094); -function transformToString(payload, encoding = "utf-8") { - if (encoding === "base64") { - return (0, util_base64_1.toBase64)(payload); - } - return (0, util_utf8_1.toUtf8)(payload); -} -exports.transformToString = transformToString; -function transformFromString(str, encoding) { - if (encoding === "base64") { - return Uint8ArrayBlobAdapter_1.Uint8ArrayBlobAdapter.mutate((0, util_base64_1.fromBase64)(str)); - } - return Uint8ArrayBlobAdapter_1.Uint8ArrayBlobAdapter.mutate((0, util_utf8_1.fromUtf8)(str)); -} -exports.transformFromString = transformFromString; /***/ }), -/***/ 23636: +/***/ 8193: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAwsChunkedEncodingStream = void 0; -const stream_1 = __nccwpck_require__(12781); -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.getHomeDir = void 0; +const os_1 = __nccwpck_require__(2037); +const path_1 = __nccwpck_require__(1017); +const homeDirCache = {}; +const getHomeDirCacheKey = () => { + if (process && process.geteuid) { + return `${process.geteuid()}`; + } + return "DEFAULT"; }; -exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; +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; /***/ }), -/***/ 96607: +/***/ 4740: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(22094), exports); -tslib_1.__exportStar(__nccwpck_require__(23636), exports); -tslib_1.__exportStar(__nccwpck_require__(4515), exports); +exports.getSSOTokenFilepath = void 0; +const crypto_1 = __nccwpck_require__(6113); +const path_1 = __nccwpck_require__(1017); +const getHomeDir_1 = __nccwpck_require__(8193); +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`); +}; +exports.getSSOTokenFilepath = getSSOTokenFilepath; /***/ }), -/***/ 4515: +/***/ 9678: /***/ ((__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__(6123); -const util_buffer_from_1 = __nccwpck_require__(31381); -const stream_1 = __nccwpck_require__(12781); -const util_1 = __nccwpck_require__(73837); -const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; -const sdkStreamMixin = (stream) => { - var _a, _b; - if (!(stream instanceof stream_1.Readable)) { - const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; - throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); - } - let transformed = false; - const transformToByteArray = async () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - return await (0, node_http_handler_1.streamCollector)(stream); - }; - return Object.assign(stream, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === undefined || Buffer.isEncoding(encoding)) { - return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); - } - else { - const decoder = new util_1.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 make sure you are using Node.js >= 17.0.0, or polyfill is available."); - } - transformed = true; - return stream_1.Readable.toWeb(stream); - }, - }); +exports.getSSOTokenFromFile = void 0; +const fs_1 = __nccwpck_require__(7147); +const getSSOTokenFilepath_1 = __nccwpck_require__(4740); +const { readFile } = fs_1.promises; +const getSSOTokenFromFile = async (id) => { + const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); + const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); + return JSON.parse(ssoTokenText); }; -exports.sdkStreamMixin = sdkStreamMixin; +exports.getSSOTokenFromFile = getSSOTokenFromFile; /***/ }), -/***/ 67461: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; +/***/ 3507: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR, + DEFAULT_PROFILE: () => DEFAULT_PROFILE, + ENV_PROFILE: () => ENV_PROFILE, + getProfileName: () => getProfileName, + loadSharedConfigFiles: () => loadSharedConfigFiles, + loadSsoSessionData: () => loadSsoSessionData, + parseKnownFiles: () => parseKnownFiles +}); +module.exports = __toCommonJS(src_exports); +__reExport(src_exports, __nccwpck_require__(8193), module.exports); + +// src/getProfileName.ts +var ENV_PROFILE = "AWS_PROFILE"; +var DEFAULT_PROFILE = "default"; +var getProfileName = /* @__PURE__ */ __name((init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE, "getProfileName"); + +// src/index.ts +__reExport(src_exports, __nccwpck_require__(4740), module.exports); +__reExport(src_exports, __nccwpck_require__(9678), module.exports); + +// src/getConfigData.ts +var import_types = __nccwpck_require__(2370); +var getConfigData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + if (indexOfSeparator === -1) { + return false; + } + return Object.values(import_types.IniSectionType).includes(key.substring(0, indexOfSeparator)); +}).reduce( + (acc, [key, value]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + const updatedKey = key.substring(0, indexOfSeparator) === import_types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; + acc[updatedKey] = value; + return acc; + }, + { + // Populate default profile, if present. + ...data.default && { default: data.default } + } +), "getConfigData"); + +// src/getConfigFilepath.ts +var import_path = __nccwpck_require__(1017); +var import_getHomeDir = __nccwpck_require__(8193); +var ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; +var getConfigFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CONFIG_PATH] || (0, import_path.join)((0, import_getHomeDir.getHomeDir)(), ".aws", "config"), "getConfigFilepath"); + +// src/getCredentialsFilepath.ts + +var import_getHomeDir2 = __nccwpck_require__(8193); +var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; +var getCredentialsFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CREDENTIALS_PATH] || (0, import_path.join)((0, import_getHomeDir2.getHomeDir)(), ".aws", "credentials"), "getCredentialsFilepath"); + +// src/parseIni.ts + +var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; +var profileNameBlockList = ["__proto__", "profile __proto__"]; +var parseIni = /* @__PURE__ */ __name((iniData) => { + const map = {}; + let currentSection; + let currentSubSection; + for (const iniLine of iniData.split(/\r?\n/)) { + const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); + const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; + if (isSection) { + currentSection = void 0; + currentSubSection = void 0; + const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); + const matches = prefixKeyRegex.exec(sectionName); + if (matches) { + const [, prefix, , name] = matches; + if (Object.values(import_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 = void 0; + } + map[currentSection] = map[currentSection] || {}; + const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; + map[currentSection][key] = value; + } + } + } + } + return map; +}, "parseIni"); + +// src/loadSharedConfigFiles.ts +var import_slurpFile = __nccwpck_require__(9155); +var swallowError = /* @__PURE__ */ __name(() => ({}), "swallowError"); +var CONFIG_PREFIX_SEPARATOR = "."; +var loadSharedConfigFiles = /* @__PURE__ */ __name(async (init = {}) => { + const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; + const parsedFiles = await Promise.all([ + (0, import_slurpFile.slurpFile)(configFilepath, { + ignoreCache: init.ignoreCache + }).then(parseIni).then(getConfigData).catch(swallowError), + (0, import_slurpFile.slurpFile)(filepath, { + ignoreCache: init.ignoreCache + }).then(parseIni).catch(swallowError) + ]); + return { + configFile: parsedFiles[0], + credentialsFile: parsedFiles[1] + }; +}, "loadSharedConfigFiles"); -/***/ }), +// src/getSsoSessionData.ts -/***/ 47813: -/***/ ((__unused_webpack_module, exports) => { +var getSsoSessionData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => key.startsWith(import_types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.split(CONFIG_PREFIX_SEPARATOR)[1]]: value }), {}), "getSsoSessionData"); -"use strict"; +// src/loadSsoSessionData.ts +var import_slurpFile2 = __nccwpck_require__(9155); +var swallowError2 = /* @__PURE__ */ __name(() => ({}), "swallowError"); +var loadSsoSessionData = /* @__PURE__ */ __name(async (init = {}) => (0, import_slurpFile2.slurpFile)(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2), "loadSsoSessionData"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -const getTransformedHeaders = (headers) => { - const transformedHeaders = {}; - for (const name of Object.keys(headers)) { - const headerValues = headers[name]; - transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; +// src/mergeConfigFiles.ts +var mergeConfigFiles = /* @__PURE__ */ __name((...files) => { + const merged = {}; + for (const file of files) { + for (const [key, values] of Object.entries(file)) { + if (merged[key] !== void 0) { + Object.assign(merged[key], values); + } else { + merged[key] = values; + } } - return transformedHeaders; -}; -exports.getTransformedHeaders = getTransformedHeaders; - - -/***/ }), + } + return merged; +}, "mergeConfigFiles"); -/***/ 6123: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/parseKnownFiles.ts +var parseKnownFiles = /* @__PURE__ */ __name(async (init) => { + const parsedFiles = await loadSharedConfigFiles(init); + return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); +}, "parseKnownFiles"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(24687), exports); -tslib_1.__exportStar(__nccwpck_require__(68609), exports); -tslib_1.__exportStar(__nccwpck_require__(87527), exports); /***/ }), -/***/ 24687: +/***/ 9155: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; -const protocol_http_1 = __nccwpck_require__(73070); -const querystring_builder_1 = __nccwpck_require__(1205); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(67461); -const get_transformed_headers_1 = __nccwpck_require__(47813); -const set_connection_timeout_1 = __nccwpck_require__(79679); -const set_socket_keep_alive_1 = __nccwpck_require__(83861); -const set_socket_timeout_1 = __nccwpck_require__(67954); -const write_request_body_1 = __nccwpck_require__(7389); -exports.DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - var _a, _b; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - auth, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - }); - } - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; +exports.slurpFile = void 0; +const fs_1 = __nccwpck_require__(7147); +const { readFile } = fs_1.promises; +const filePromisesHash = {}; +const slurpFile = (path, options) => { + if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) { + filePromisesHash[path] = readFile(path, "utf8"); } -} -exports.NodeHttpHandler = NodeHttpHandler; + return filePromisesHash[path]; +}; +exports.slurpFile = slurpFile; /***/ }), -/***/ 48920: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionManager = void 0; -const tslib_1 = __nccwpck_require__(4351); -const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); -const node_http2_connection_pool_1 = __nccwpck_require__(4735); -class NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const 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_1.default.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 node_http2_connection_pool_1.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) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); +/***/ 2370: +/***/ ((module) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; } -} -exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -/***/ }), +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ 4735: -/***/ ((__unused_webpack_module, exports) => { +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -"use strict"; +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionPool = void 0; -class NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions !== null && sessions !== void 0 ? sessions : []; - } - poll() { - if (this.sessions.length > 0) { - return this.sessions.shift(); - } - } - offerLast(session) { - this.sessions.push(session); - } - contains(session) { - return this.sessions.includes(session); +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 1528: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + SignatureV4: () => SignatureV4, + clearCredentialCache: () => clearCredentialCache, + createScope: () => createScope, + getCanonicalHeaders: () => getCanonicalHeaders, + getCanonicalQuery: () => getCanonicalQuery, + getPayloadHash: () => getPayloadHash, + getSigningKey: () => getSigningKey, + moveHeadersToQuery: () => moveHeadersToQuery, + prepareRequest: () => prepareRequest +}); +module.exports = __toCommonJS(src_exports); + +// src/SignatureV4.ts +var import_eventstream_codec = __nccwpck_require__(6459); + +var import_util_middleware = __nccwpck_require__(2390); +var import_util_utf83 = __nccwpck_require__(1895); + +// src/constants.ts +var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; +var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; +var AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; +var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; +var EXPIRES_QUERY_PARAM = "X-Amz-Expires"; +var SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; +var TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; +var AUTH_HEADER = "authorization"; +var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); +var DATE_HEADER = "date"; +var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; +var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); +var SHA256_HEADER = "x-amz-content-sha256"; +var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); +var ALWAYS_UNSIGNABLE_HEADERS = { + authorization: true, + "cache-control": true, + connection: true, + expect: true, + from: true, + "keep-alive": true, + "max-forwards": true, + pragma: true, + referer: true, + te: true, + trailer: true, + "transfer-encoding": true, + upgrade: true, + "user-agent": true, + "x-amzn-trace-id": true +}; +var PROXY_HEADER_PATTERN = /^proxy-/; +var SEC_HEADER_PATTERN = /^sec-/; +var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; +var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; +var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; +var MAX_CACHE_SIZE = 50; +var KEY_TYPE_IDENTIFIER = "aws4_request"; +var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; + +// src/credentialDerivation.ts +var import_util_hex_encoding = __nccwpck_require__(5364); +var import_util_utf8 = __nccwpck_require__(1895); +var signingKeyCache = {}; +var cacheQueue = []; +var createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope"); +var getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => { + const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); + const cacheKey = `${shortDate}:${region}:${service}:${(0, import_util_hex_encoding.toHex)(credsHash)}:${credentials.sessionToken}`; + if (cacheKey in signingKeyCache) { + return signingKeyCache[cacheKey]; + } + cacheQueue.push(cacheKey); + while (cacheQueue.length > MAX_CACHE_SIZE) { + delete signingKeyCache[cacheQueue.shift()]; + } + let key = `AWS4${credentials.secretAccessKey}`; + for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { + key = await hmac(sha256Constructor, key, signable); + } + return signingKeyCache[cacheKey] = key; +}, "getSigningKey"); +var clearCredentialCache = /* @__PURE__ */ __name(() => { + cacheQueue.length = 0; + Object.keys(signingKeyCache).forEach((cacheKey) => { + delete signingKeyCache[cacheKey]; + }); +}, "clearCredentialCache"); +var hmac = /* @__PURE__ */ __name((ctor, secret, data) => { + const hash = new ctor(secret); + hash.update((0, import_util_utf8.toUint8Array)(data)); + return hash.digest(); +}, "hmac"); + +// src/getCanonicalHeaders.ts +var getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => { + const canonical = {}; + for (const headerName of Object.keys(headers).sort()) { + if (headers[headerName] == void 0) { + continue; } - remove(session) { - this.sessions = this.sessions.filter((s) => s !== session); + const canonicalHeaderName = headerName.toLowerCase(); + if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || (unsignableHeaders == null ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) { + if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) { + continue; + } } - [Symbol.iterator]() { - return this.sessions[Symbol.iterator](); + canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); + } + return canonical; +}, "getCanonicalHeaders"); + +// src/getCanonicalQuery.ts +var import_util_uri_escape = __nccwpck_require__(9617); +var getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query).sort()) { + if (key.toLowerCase() === SIGNATURE_HEADER) { + continue; } - destroy(connection) { - for (const session of this.sessions) { - if (session === connection) { - if (!session.destroyed) { - session.destroy(); - } - } - } + keys.push(key); + const value = query[key]; + if (typeof value === "string") { + serialized[key] = `${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value)}`; + } else if (Array.isArray(value)) { + serialized[key] = value.slice(0).reduce( + (encoded, value2) => encoded.concat([`${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value2)}`]), + [] + ).sort().join("&"); } -} -exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; - + } + return keys.map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); +}, "getCanonicalQuery"); -/***/ }), +// src/getPayloadHash.ts +var import_is_array_buffer = __nccwpck_require__(780); -/***/ 68609: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var import_util_utf82 = __nccwpck_require__(1895); +var getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => { + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase() === SHA256_HEADER) { + return headers[headerName]; + } + } + if (body == void 0) { + return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + } else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, import_is_array_buffer.isArrayBuffer)(body)) { + const hashCtor = new hashConstructor(); + hashCtor.update((0, import_util_utf82.toUint8Array)(body)); + return (0, import_util_hex_encoding.toHex)(await hashCtor.digest()); + } + return UNSIGNED_PAYLOAD; +}, "getPayloadHash"); -"use strict"; +// src/headerUtil.ts +var hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; + } + } + return false; +}, "hasHeader"); + +// src/cloneRequest.ts +var cloneRequest = /* @__PURE__ */ __name(({ headers, query, ...rest }) => ({ + ...rest, + headers: { ...headers }, + query: query ? cloneQuery(query) : void 0 +}), "cloneRequest"); +var cloneQuery = /* @__PURE__ */ __name((query) => Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; +}, {}), "cloneQuery"); + +// src/moveHeadersToQuery.ts +var moveHeadersToQuery = /* @__PURE__ */ __name((request, options = {}) => { + var _a; + const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : cloneRequest(request); + for (const name of Object.keys(headers)) { + const lname = name.toLowerCase(); + if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) == null ? void 0 : _a.has(lname))) { + query[name] = headers[name]; + delete headers[name]; + } + } + return { + ...request, + headers, + query + }; +}, "moveHeadersToQuery"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(73070); -const querystring_builder_1 = __nccwpck_require__(1205); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(47813); -const node_http2_connection_manager_1 = __nccwpck_require__(48920); -const write_request_body_1 = __nccwpck_require__(7389); -class NodeHttp2Handler { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((opts) => { - resolve(opts || {}); - }) - .catch(reject); - } - else { - resolve(options || {}); - } - }); +// src/prepareRequest.ts +var prepareRequest = /* @__PURE__ */ __name((request) => { + request = typeof request.clone === "function" ? request.clone() : cloneRequest(request); + for (const headerName of Object.keys(request.headers)) { + if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { + delete request.headers[headerName]; } - destroy() { - this.connectionManager.destroy(); + } + return request; +}, "prepareRequest"); + +// src/utilDate.ts +var iso8601 = /* @__PURE__ */ __name((time) => toDate(time).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601"); +var toDate = /* @__PURE__ */ __name((time) => { + if (typeof time === "number") { + return new Date(time * 1e3); + } + if (typeof time === "string") { + if (Number(time)) { + return new Date(Number(time) * 1e3); } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } + return new Date(time); + } + return time; +}, "toDate"); + +// src/SignatureV4.ts +var _SignatureV4 = class _SignatureV4 { + constructor({ + applyChecksum, + credentials, + region, + service, + sha256, + uriEscapePath = true + }) { + this.headerMarshaller = new import_eventstream_codec.HeaderMarshaller(import_util_utf83.toUtf8, import_util_utf83.fromUtf8); + this.service = service; + this.sha256 = sha256; + this.uriEscapePath = uriEscapePath; + this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; + this.regionProvider = (0, import_util_middleware.normalizeProvider)(region); + this.credentialProvider = (0, import_util_middleware.normalizeProvider)(credentials); + } + async presign(originalRequest, options = {}) { + const { + signingDate = /* @__PURE__ */ new Date(), + expiresIn = 3600, + unsignableHeaders, + unhoistableHeaders, + signableHeaders, + signingRegion, + signingService + } = options; + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const { longDate, shortDate } = formatDate(signingDate); + if (expiresIn > MAX_PRESIGNED_TTL) { + return Promise.reject( + "Signature version 4 presigned URLs must have an expiration date less than one week in the future" + ); + } + const scope = createScope(shortDate, region, signingService ?? this.service); + const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders }); + 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] = 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; + } + async sign(toSign, options) { + if (typeof toSign === "string") { + return this.signString(toSign, options); + } else if (toSign.headers && toSign.payload) { + return this.signEvent(toSign, options); + } else if (toSign.message) { + return this.signMessage(toSign, options); + } else { + return this.signRequest(toSign, options); + } + } + async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) { + const region = signingRegion ?? await this.regionProvider(); + const { shortDate, longDate } = formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256); + const hash = new this.sha256(); + hash.update(headers); + const hashedHeaders = (0, import_util_hex_encoding.toHex)(await hash.digest()); + const stringToSign = [ + EVENT_ALGORITHM_IDENTIFIER, + longDate, + scope, + priorSignature, + hashedHeaders, + hashedPayload + ].join("\n"); + return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); + } + async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) { + const promise = this.signEvent( + { + headers: this.headerMarshaller.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 = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const { shortDate } = formatDate(signingDate); + const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); + hash.update((0, import_util_utf83.toUint8Array)(stringToSign)); + return (0, import_util_hex_encoding.toHex)(await hash.digest()); + } + async signRequest(requestToSign, { + signingDate = /* @__PURE__ */ new Date(), + signableHeaders, + unsignableHeaders, + signingRegion, + signingService + } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const request = prepareRequest(requestToSign); + const { longDate, shortDate } = 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=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; + return request; + } + 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) { + const hash = new this.sha256(); + hash.update((0, import_util_utf83.toUint8Array)(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${ALGORITHM_IDENTIFIER} +${longDate} +${credentialScope} +${(0, import_util_hex_encoding.toHex)(hashedRequest)}`; + } + getCanonicalPath({ path }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path.split("/")) { + if ((pathSegment == null ? void 0 : pathSegment.length) === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); + } else { + normalizedPathSegments.push(pathSegment); } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a, _b, _c; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal === null || abortSignal === void 0 ? void 0 : 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 = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - 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 = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); - }); + } + const normalizedPath = `${(path == null ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path == null ? void 0 : path.endsWith("/")) ? "/" : ""}`; + const doubleEncoded = encodeURIComponent(normalizedPath); + return doubleEncoded.replace(/%2F/g, "/"); + } + return path; + } + async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { + const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); + const hash = new this.sha256(await keyPromise); + hash.update((0, import_util_utf83.toUint8Array)(stringToSign)); + return (0, import_util_hex_encoding.toHex)(await hash.digest()); + } + getSigningKey(credentials, region, shortDate, service) { + return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); + } + validateResolvedCredentials(credentials) { + if (typeof credentials !== "object" || // @ts-expect-error: Property 'accessKeyId' does not exist on type 'object'.ts(2339) + typeof credentials.accessKeyId !== "string" || // @ts-expect-error: Property 'secretAccessKey' does not exist on type 'object'.ts(2339) + typeof credentials.secretAccessKey !== "string") { + throw new Error("Resolved credential object is not valid"); + } + } +}; +__name(_SignatureV4, "SignatureV4"); +var SignatureV4 = _SignatureV4; +var formatDate = /* @__PURE__ */ __name((now) => { + const longDate = iso8601(now).replace(/[\-:]/g, ""); + return { + longDate, + shortDate: longDate.slice(0, 8) + }; +}, "formatDate"); +var getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(headers).sort().join(";"), "getCanonicalHeaderList"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 9617: +/***/ ((module) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath +}); +module.exports = __toCommonJS(src_exports); + +// src/escape-uri.ts +var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) +), "escapeUri"); +var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); + +// src/escape-uri-path.ts +var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 3570: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Client: () => Client, + Command: () => Command, + LazyJsonString: () => LazyJsonString, + NoOpLogger: () => NoOpLogger, + SENSITIVE_STRING: () => SENSITIVE_STRING, + ServiceException: () => ServiceException, + StringWrapper: () => StringWrapper, + _json: () => _json, + collectBody: () => collectBody, + convertMap: () => convertMap, + createAggregatedClient: () => createAggregatedClient, + dateToUtcString: () => dateToUtcString, + decorateServiceException: () => decorateServiceException, + emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion, + expectBoolean: () => expectBoolean, + expectByte: () => expectByte, + expectFloat32: () => expectFloat32, + expectInt: () => expectInt, + expectInt32: () => expectInt32, + expectLong: () => expectLong, + expectNonNull: () => expectNonNull, + expectNumber: () => expectNumber, + expectObject: () => expectObject, + expectShort: () => expectShort, + expectString: () => expectString, + expectUnion: () => expectUnion, + extendedEncodeURIComponent: () => extendedEncodeURIComponent, + getArrayIfSingleItem: () => getArrayIfSingleItem, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + getDefaultExtensionConfiguration: () => getDefaultExtensionConfiguration, + getValueFromTextNode: () => getValueFromTextNode, + handleFloat: () => handleFloat, + limitedParseDouble: () => limitedParseDouble, + limitedParseFloat: () => limitedParseFloat, + limitedParseFloat32: () => limitedParseFloat32, + loadConfigsForDefaultMode: () => loadConfigsForDefaultMode, + logger: () => logger, + map: () => map, + parseBoolean: () => parseBoolean, + parseEpochTimestamp: () => parseEpochTimestamp, + parseRfc3339DateTime: () => parseRfc3339DateTime, + parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime: () => parseRfc7231DateTime, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig, + resolvedPath: () => resolvedPath, + serializeFloat: () => serializeFloat, + splitEvery: () => splitEvery, + strictParseByte: () => strictParseByte, + strictParseDouble: () => strictParseDouble, + strictParseFloat: () => strictParseFloat, + strictParseFloat32: () => strictParseFloat32, + strictParseInt: () => strictParseInt, + strictParseInt32: () => strictParseInt32, + strictParseLong: () => strictParseLong, + strictParseShort: () => strictParseShort, + take: () => take, + throwDefaultError: () => throwDefaultError, + withBaseException: () => withBaseException +}); +module.exports = __toCommonJS(src_exports); + +// src/NoOpLogger.ts +var _NoOpLogger = class _NoOpLogger { + trace() { + } + debug() { + } + info() { + } + warn() { + } + error() { + } +}; +__name(_NoOpLogger, "NoOpLogger"); +var NoOpLogger = _NoOpLogger; + +// src/client.ts +var import_middleware_stack = __nccwpck_require__(7911); +var _Client = class _Client { + constructor(config) { + this.middlewareStack = (0, import_middleware_stack.constructStack)(); + this.config = config; + } + send(command, optionsOrCb, cb) { + const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0; + const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; + const handler = command.resolveMiddleware(this.middlewareStack, this.config, options); + if (callback) { + handler(command).then( + (result) => callback(null, result.output), + (err) => callback(err) + ).catch( + // prevent any errors thrown in the callback from triggering an + // unhandled promise rejection + () => { + } + ); + } else { + return handler(command).then((result) => result.output); } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; + } + destroy() { + if (this.config.requestHandler.destroy) + this.config.requestHandler.destroy(); + } +}; +__name(_Client, "Client"); +var Client = _Client; + +// src/collect-stream-body.ts +var import_util_stream = __nccwpck_require__(6607); +var collectBody = /* @__PURE__ */ __name(async (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody); + } + if (!streamBody) { + return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); + } + const fromContext = context.streamCollector(streamBody); + return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext); +}, "collectBody"); + +// src/command.ts + +var import_types = __nccwpck_require__(9185); +var _Command = class _Command { + constructor() { + this.middlewareStack = (0, import_middleware_stack.constructStack)(); + } + /** + * Factory for Command ClassBuilder. + * @internal + */ + static classBuilder() { + return new ClassBuilder(); + } + /** + * @internal + */ + resolveMiddlewareWithContext(clientStack, configuration, options, { + middlewareFn, + clientName, + commandName, + inputFilterSensitiveLog, + outputFilterSensitiveLog, + smithyContext, + additionalContext, + CommandCtor + }) { + for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { + this.middlewareStack.use(mw); + } + const stack = clientStack.concat(this.middlewareStack); + const { logger: logger2 } = configuration; + const handlerExecutionContext = { + logger: logger2, + clientName, + commandName, + inputFilterSensitiveLog, + outputFilterSensitiveLog, + [import_types.SMITHY_CONTEXT_KEY]: { + ...smithyContext + }, + ...additionalContext + }; + const { requestHandler } = configuration; + return stack.resolve( + (request) => requestHandler.handle(request.request, options || {}), + handlerExecutionContext + ); + } +}; +__name(_Command, "Command"); +var Command = _Command; +var _ClassBuilder = class _ClassBuilder { + constructor() { + this._init = () => { + }; + this._ep = {}; + this._middlewareFn = () => []; + this._commandName = ""; + this._clientName = ""; + this._additionalContext = {}; + this._smithyContext = {}; + this._inputFilterSensitiveLog = (_) => _; + this._outputFilterSensitiveLog = (_) => _; + this._serializer = null; + this._deserializer = null; + } + /** + * Optional init callback. + */ + init(cb) { + this._init = cb; + } + /** + * Set the endpoint parameter instructions. + */ + ep(endpointParameterInstructions) { + this._ep = endpointParameterInstructions; + return this; + } + /** + * Add any number of middleware. + */ + m(middlewareSupplier) { + this._middlewareFn = middlewareSupplier; + return this; + } + /** + * Set the initial handler execution context Smithy field. + */ + s(service, operation, smithyContext = {}) { + this._smithyContext = { + service, + operation, + ...smithyContext + }; + return this; + } + /** + * Set the initial handler execution context. + */ + c(additionalContext = {}) { + this._additionalContext = additionalContext; + return this; + } + /** + * Set constant string identifiers for the operation. + */ + n(clientName, commandName) { + this._clientName = clientName; + this._commandName = commandName; + return this; + } + /** + * Set the input and output sensistive log filters. + */ + f(inputFilter = (_) => _, outputFilter = (_) => _) { + this._inputFilterSensitiveLog = inputFilter; + this._outputFilterSensitiveLog = outputFilter; + return this; + } + /** + * Sets the serializer. + */ + ser(serializer) { + this._serializer = serializer; + return this; + } + /** + * Sets the deserializer. + */ + de(deserializer) { + this._deserializer = deserializer; + return this; + } + /** + * @returns a Command class with the classBuilder properties. + */ + build() { + var _a; + const closure = this; + let CommandRef; + return CommandRef = (_a = class extends Command { + /** + * @public + */ + constructor(input) { + super(); + this.input = input; + /** + * @internal + */ + // @ts-ignore used in middlewareFn closure. + this.serialize = closure._serializer; + /** + * @internal + */ + // @ts-ignore used in middlewareFn closure. + this.deserialize = closure._deserializer; + closure._init(this); + } + /** + * @public + */ + static getEndpointParameterInstructions() { + return closure._ep; + } + /** + * @internal + */ + resolveMiddleware(stack, configuration, options) { + return this.resolveMiddlewareWithContext(stack, configuration, options, { + CommandCtor: CommandRef, + middlewareFn: closure._middlewareFn, + clientName: closure._clientName, + commandName: closure._commandName, + inputFilterSensitiveLog: closure._inputFilterSensitiveLog, + outputFilterSensitiveLog: closure._outputFilterSensitiveLog, + smithyContext: closure._smithyContext, + additionalContext: closure._additionalContext }); + } + }, __name(_a, "CommandRef"), _a); + } +}; +__name(_ClassBuilder, "ClassBuilder"); +var ClassBuilder = _ClassBuilder; + +// src/constants.ts +var SENSITIVE_STRING = "***SensitiveInformation***"; + +// src/create-aggregated-client.ts +var createAggregatedClient = /* @__PURE__ */ __name((commands, Client2) => { + for (const command of Object.keys(commands)) { + const CommandCtor = commands[command]; + const methodImpl = /* @__PURE__ */ __name(async function(args, optionsOrCb, cb) { + const command2 = new CommandCtor(args); + if (typeof optionsOrCb === "function") { + this.send(command2, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expected http options but got ${typeof optionsOrCb}`); + this.send(command2, optionsOrCb || {}, cb); + } else { + return this.send(command2, optionsOrCb); + } + }, "methodImpl"); + const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); + Client2.prototype[methodName] = methodImpl; + } +}, "createAggregatedClient"); + +// src/parse-utils.ts +var parseBoolean = /* @__PURE__ */ __name((value) => { + switch (value) { + case "true": + return true; + case "false": + return false; + default: + throw new Error(`Unable to parse boolean value "${value}"`); + } +}, "parseBoolean"); +var expectBoolean = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "number") { + if (value === 0 || value === 1) { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; + if (value === 0) { + return false; } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } + if (value === 1) { + return true; } -} -exports.NodeHttp2Handler = NodeHttp2Handler; - - -/***/ }), + } + if (typeof value === "string") { + const lower = value.toLowerCase(); + if (lower === "false" || lower === "true") { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (lower === "false") { + return false; + } + if (lower === "true") { + return true; + } + } + if (typeof value === "boolean") { + return value; + } + throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); +}, "expectBoolean"); +var expectNumber = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "string") { + const parsed = parseFloat(value); + if (!Number.isNaN(parsed)) { + if (String(parsed) !== String(value)) { + logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); + } + return parsed; + } + } + if (typeof value === "number") { + return value; + } + throw new TypeError(`Expected number, got ${typeof value}: ${value}`); +}, "expectNumber"); +var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); +var expectFloat32 = /* @__PURE__ */ __name((value) => { + const expected = expectNumber(value); + if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { + if (Math.abs(expected) > MAX_FLOAT) { + throw new TypeError(`Expected 32-bit float, got ${value}`); + } + } + return expected; +}, "expectFloat32"); +var expectLong = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (Number.isInteger(value) && !Number.isNaN(value)) { + return value; + } + throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); +}, "expectLong"); +var expectInt = expectLong; +var expectInt32 = /* @__PURE__ */ __name((value) => expectSizedInt(value, 32), "expectInt32"); +var expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), "expectShort"); +var expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), "expectByte"); +var expectSizedInt = /* @__PURE__ */ __name((value, size) => { + const expected = expectLong(value); + if (expected !== void 0 && castInt(expected, size) !== expected) { + throw new TypeError(`Expected ${size}-bit integer, got ${value}`); + } + return expected; +}, "expectSizedInt"); +var castInt = /* @__PURE__ */ __name((value, size) => { + switch (size) { + case 32: + return Int32Array.of(value)[0]; + case 16: + return Int16Array.of(value)[0]; + case 8: + return Int8Array.of(value)[0]; + } +}, "castInt"); +var expectNonNull = /* @__PURE__ */ __name((value, location) => { + if (value === null || value === void 0) { + if (location) { + throw new TypeError(`Expected a non-null value for ${location}`); + } + throw new TypeError("Expected a non-null value"); + } + return value; +}, "expectNonNull"); +var expectObject = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "object" && !Array.isArray(value)) { + return value; + } + const receivedType = Array.isArray(value) ? "array" : typeof value; + throw new TypeError(`Expected object, got ${receivedType}: ${value}`); +}, "expectObject"); +var expectString = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "string") { + return value; + } + if (["boolean", "number", "bigint"].includes(typeof value)) { + logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); + return String(value); + } + throw new TypeError(`Expected string, got ${typeof value}: ${value}`); +}, "expectString"); +var expectUnion = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + const asObject = expectObject(value); + const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k); + if (setKeys.length === 0) { + throw new TypeError(`Unions must have exactly one non-null member. None were found.`); + } + if (setKeys.length > 1) { + throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); + } + return asObject; +}, "expectUnion"); +var strictParseDouble = /* @__PURE__ */ __name((value) => { + if (typeof value == "string") { + return expectNumber(parseNumber(value)); + } + return expectNumber(value); +}, "strictParseDouble"); +var strictParseFloat = strictParseDouble; +var strictParseFloat32 = /* @__PURE__ */ __name((value) => { + if (typeof value == "string") { + return expectFloat32(parseNumber(value)); + } + return expectFloat32(value); +}, "strictParseFloat32"); +var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; +var parseNumber = /* @__PURE__ */ __name((value) => { + const matches = value.match(NUMBER_REGEX); + if (matches === null || matches[0].length !== value.length) { + throw new TypeError(`Expected real number, got implicit NaN`); + } + return parseFloat(value); +}, "parseNumber"); +var limitedParseDouble = /* @__PURE__ */ __name((value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectNumber(value); +}, "limitedParseDouble"); +var handleFloat = limitedParseDouble; +var limitedParseFloat = limitedParseDouble; +var limitedParseFloat32 = /* @__PURE__ */ __name((value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectFloat32(value); +}, "limitedParseFloat32"); +var parseFloatString = /* @__PURE__ */ __name((value) => { + switch (value) { + case "NaN": + return NaN; + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + default: + throw new Error(`Unable to parse float value: ${value}`); + } +}, "parseFloatString"); +var strictParseLong = /* @__PURE__ */ __name((value) => { + if (typeof value === "string") { + return expectLong(parseNumber(value)); + } + return expectLong(value); +}, "strictParseLong"); +var strictParseInt = strictParseLong; +var strictParseInt32 = /* @__PURE__ */ __name((value) => { + if (typeof value === "string") { + return expectInt32(parseNumber(value)); + } + return expectInt32(value); +}, "strictParseInt32"); +var strictParseShort = /* @__PURE__ */ __name((value) => { + if (typeof value === "string") { + return expectShort(parseNumber(value)); + } + return expectShort(value); +}, "strictParseShort"); +var strictParseByte = /* @__PURE__ */ __name((value) => { + if (typeof value === "string") { + return expectByte(parseNumber(value)); + } + return expectByte(value); +}, "strictParseByte"); +var stackTraceWarning = /* @__PURE__ */ __name((message) => { + return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n"); +}, "stackTraceWarning"); +var logger = { + warn: console.warn +}; + +// src/date-utils.ts +var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; +var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +function dateToUtcString(date) { + const year = date.getUTCFullYear(); + const month = date.getUTCMonth(); + const dayOfWeek = date.getUTCDay(); + const dayOfMonthInt = date.getUTCDate(); + const hoursInt = date.getUTCHours(); + const minutesInt = date.getUTCMinutes(); + const secondsInt = date.getUTCSeconds(); + const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; + const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; + const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; + const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; + return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; +} +__name(dateToUtcString, "dateToUtcString"); +var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); +var parseRfc3339DateTime = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; + const year = strictParseShort(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); +}, "parseRfc3339DateTime"); +var RFC3339_WITH_OFFSET = new RegExp( + /^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/ +); +var parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339_WITH_OFFSET.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; + const year = strictParseShort(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); + if (offsetStr.toUpperCase() != "Z") { + date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr)); + } + return date; +}, "parseRfc3339DateTimeWithOffset"); +var IMF_FIXDATE = new RegExp( + /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/ +); +var RFC_850_DATE = new RegExp( + /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/ +); +var ASC_TIME = new RegExp( + /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/ +); +var parseRfc7231DateTime = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC-7231 date-times must be expressed as strings"); + } + let match = IMF_FIXDATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return buildDate( + strictParseShort(stripLeadingZeroes(yearStr)), + parseMonthByShortName(monthStr), + parseDateValue(dayStr, "day", 1, 31), + { hours, minutes, seconds, fractionalMilliseconds } + ); + } + match = RFC_850_DATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return adjustRfc850Year( + buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { + hours, + minutes, + seconds, + fractionalMilliseconds + }) + ); + } + match = ASC_TIME.exec(value); + if (match) { + const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; + return buildDate( + strictParseShort(stripLeadingZeroes(yearStr)), + parseMonthByShortName(monthStr), + parseDateValue(dayStr.trimLeft(), "day", 1, 31), + { hours, minutes, seconds, fractionalMilliseconds } + ); + } + throw new TypeError("Invalid RFC-7231 date-time value"); +}, "parseRfc7231DateTime"); +var parseEpochTimestamp = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return void 0; + } + let valueAsDouble; + if (typeof value === "number") { + valueAsDouble = value; + } else if (typeof value === "string") { + valueAsDouble = strictParseDouble(value); + } else { + throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); + } + if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { + throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); + } + return new Date(Math.round(valueAsDouble * 1e3)); +}, "parseEpochTimestamp"); +var buildDate = /* @__PURE__ */ __name((year, month, day, time) => { + const adjustedMonth = month - 1; + validateDayOfMonth(year, adjustedMonth, day); + return new Date( + Date.UTC( + year, + adjustedMonth, + day, + parseDateValue(time.hours, "hour", 0, 23), + parseDateValue(time.minutes, "minute", 0, 59), + // seconds can go up to 60 for leap seconds + parseDateValue(time.seconds, "seconds", 0, 60), + parseMilliseconds(time.fractionalMilliseconds) + ) + ); +}, "buildDate"); +var parseTwoDigitYear = /* @__PURE__ */ __name((value) => { + const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear(); + const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); + if (valueInThisCentury < thisYear) { + return valueInThisCentury + 100; + } + return valueInThisCentury; +}, "parseTwoDigitYear"); +var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3; +var adjustRfc850Year = /* @__PURE__ */ __name((input) => { + if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) { + return new Date( + Date.UTC( + input.getUTCFullYear() - 100, + input.getUTCMonth(), + input.getUTCDate(), + input.getUTCHours(), + input.getUTCMinutes(), + input.getUTCSeconds(), + input.getUTCMilliseconds() + ) + ); + } + return input; +}, "adjustRfc850Year"); +var parseMonthByShortName = /* @__PURE__ */ __name((value) => { + const monthIdx = MONTHS.indexOf(value); + if (monthIdx < 0) { + throw new TypeError(`Invalid month: ${value}`); + } + return monthIdx + 1; +}, "parseMonthByShortName"); +var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +var validateDayOfMonth = /* @__PURE__ */ __name((year, month, day) => { + let maxDays = DAYS_IN_MONTH[month]; + if (month === 1 && isLeapYear(year)) { + maxDays = 29; + } + if (day > maxDays) { + throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); + } +}, "validateDayOfMonth"); +var isLeapYear = /* @__PURE__ */ __name((year) => { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +}, "isLeapYear"); +var parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => { + const dateVal = strictParseByte(stripLeadingZeroes(value)); + if (dateVal < lower || dateVal > upper) { + throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); + } + return dateVal; +}, "parseDateValue"); +var parseMilliseconds = /* @__PURE__ */ __name((value) => { + if (value === null || value === void 0) { + return 0; + } + return strictParseFloat32("0." + value) * 1e3; +}, "parseMilliseconds"); +var parseOffsetToMilliseconds = /* @__PURE__ */ __name((value) => { + const directionStr = value[0]; + let direction = 1; + if (directionStr == "+") { + direction = 1; + } else if (directionStr == "-") { + direction = -1; + } else { + throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); + } + const hour = Number(value.substring(1, 3)); + const minute = Number(value.substring(4, 6)); + return direction * (hour * 60 + minute) * 60 * 1e3; +}, "parseOffsetToMilliseconds"); +var stripLeadingZeroes = /* @__PURE__ */ __name((value) => { + let idx = 0; + while (idx < value.length - 1 && value.charAt(idx) === "0") { + idx++; + } + if (idx === 0) { + return value; + } + return value.slice(idx); +}, "stripLeadingZeroes"); + +// src/exceptions.ts +var _ServiceException = class _ServiceException extends Error { + constructor(options) { + super(options.message); + Object.setPrototypeOf(this, _ServiceException.prototype); + this.name = options.name; + this.$fault = options.$fault; + this.$metadata = options.$metadata; + } +}; +__name(_ServiceException, "ServiceException"); +var ServiceException = _ServiceException; +var decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => { + Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => { + if (exception[k] == void 0 || exception[k] === "") { + exception[k] = v; + } + }); + const message = exception.message || exception.Message || "UnknownError"; + exception.message = message; + delete exception.Message; + return exception; +}, "decorateServiceException"); + +// src/default-error-handler.ts +var throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => { + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0; + const response = new exceptionCtor({ + name: (parsedBody == null ? void 0 : parsedBody.code) || (parsedBody == null ? void 0 : parsedBody.Code) || errorCode || statusCode || "UnknownError", + $fault: "client", + $metadata + }); + throw decorateServiceException(response, parsedBody); +}, "throwDefaultError"); +var withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => { + return ({ output, parsedBody, errorCode }) => { + throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); + }; +}, "withBaseException"); +var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] +}), "deserializeMetadata"); + +// src/defaults-mode.ts +var loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => { + switch (mode) { + case "standard": + return { + retryMode: "standard", + connectionTimeout: 3100 + }; + case "in-region": + return { + retryMode: "standard", + connectionTimeout: 1100 + }; + case "cross-region": + return { + retryMode: "standard", + connectionTimeout: 3100 + }; + case "mobile": + return { + retryMode: "standard", + connectionTimeout: 3e4 + }; + default: + return {}; + } +}, "loadConfigsForDefaultMode"); -/***/ 79679: -/***/ ((__unused_webpack_module, exports) => { +// src/emitWarningIfUnsupportedVersion.ts +var warningEmitted = false; +var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => { + if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 14) { + warningEmitted = true; + } +}, "emitWarningIfUnsupportedVersion"); -"use strict"; +// src/extensions/checksum.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + for (const id in import_types.AlgorithmId) { + const algorithmId = import_types.AlgorithmId[id]; + if (runtimeConfig[algorithmId] === void 0) { + continue; } - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - else { - clearTimeout(timeoutId); - } + checksumAlgorithms.push({ + algorithmId: () => algorithmId, + checksumConstructor: () => runtimeConfig[algorithmId] }); -}; -exports.setConnectionTimeout = setConnectionTimeout; + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); +// src/extensions/retry.ts +var getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let _retryStrategy = runtimeConfig.retryStrategy; + return { + setRetryStrategy(retryStrategy) { + _retryStrategy = retryStrategy; + }, + retryStrategy() { + return _retryStrategy; + } + }; +}, "getRetryConfiguration"); +var resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => { + const runtimeConfig = {}; + runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); + return runtimeConfig; +}, "resolveRetryRuntimeConfig"); + +// src/extensions/defaultExtensionConfiguration.ts +var getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig), + ...getRetryConfiguration(runtimeConfig) + }; +}, "getDefaultExtensionConfiguration"); +var getDefaultClientConfiguration = getDefaultExtensionConfiguration; +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config), + ...resolveRetryRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -/***/ }), +// src/extended-encode-uri-component.ts +function extendedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} +__name(extendedEncodeURIComponent, "extendedEncodeURIComponent"); -/***/ 83861: -/***/ ((__unused_webpack_module, exports) => { +// src/get-array-if-single-item.ts +var getArrayIfSingleItem = /* @__PURE__ */ __name((mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray], "getArrayIfSingleItem"); -"use strict"; +// src/get-value-from-text-node.ts +var getValueFromTextNode = /* @__PURE__ */ __name((obj) => { + const textNodeName = "#text"; + for (const key in obj) { + if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) { + obj[key] = obj[key][textNodeName]; + } else if (typeof obj[key] === "object" && obj[key] !== null) { + obj[key] = getValueFromTextNode(obj[key]); + } + } + return obj; +}, "getValueFromTextNode"); + +// src/lazy-json.ts +var StringWrapper = /* @__PURE__ */ __name(function() { + const Class = Object.getPrototypeOf(this).constructor; + const Constructor = Function.bind.apply(String, [null, ...arguments]); + const instance = new Constructor(); + Object.setPrototypeOf(instance, Class.prototype); + return instance; +}, "StringWrapper"); +StringWrapper.prototype = Object.create(String.prototype, { + constructor: { + value: StringWrapper, + enumerable: false, + writable: true, + configurable: true + } +}); +Object.setPrototypeOf(StringWrapper, String); +var _LazyJsonString = class _LazyJsonString extends StringWrapper { + deserializeJSON() { + return JSON.parse(super.toString()); + } + toJSON() { + return super.toString(); + } + static fromObject(object) { + if (object instanceof _LazyJsonString) { + return object; + } else if (object instanceof String || typeof object === "string") { + return new _LazyJsonString(object); + } + return new _LazyJsonString(JSON.stringify(object)); + } +}; +__name(_LazyJsonString, "LazyJsonString"); +var LazyJsonString = _LazyJsonString; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketKeepAlive = void 0; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; +// src/object-mapping.ts +function map(arg0, arg1, arg2) { + let target; + let filter; + let instructions; + if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { + target = {}; + instructions = arg0; + } else { + target = arg0; + if (typeof arg1 === "function") { + filter = arg1; + instructions = arg2; + return mapWithFilter(target, filter, instructions); + } else { + instructions = arg1; + } + } + for (const key of Object.keys(instructions)) { + if (!Array.isArray(instructions[key])) { + target[key] = instructions[key]; + continue; + } + applyInstruction(target, null, instructions, key); + } + return target; +} +__name(map, "map"); +var convertMap = /* @__PURE__ */ __name((target) => { + const output = {}; + for (const [k, v] of Object.entries(target || {})) { + output[k] = [, v]; + } + return output; +}, "convertMap"); +var take = /* @__PURE__ */ __name((source, instructions) => { + const out = {}; + for (const key in instructions) { + applyInstruction(out, source, instructions, key); + } + return out; +}, "take"); +var mapWithFilter = /* @__PURE__ */ __name((target, filter, instructions) => { + return map( + target, + Object.entries(instructions).reduce( + (_instructions, [key, value]) => { + if (Array.isArray(value)) { + _instructions[key] = value; + } else { + if (typeof value === "function") { + _instructions[key] = [filter, value()]; + } else { + _instructions[key] = [filter, value]; + } + } + return _instructions; + }, + {} + ) + ); +}, "mapWithFilter"); +var applyInstruction = /* @__PURE__ */ __name((target, source, instructions, targetKey) => { + if (source !== null) { + let instruction = instructions[targetKey]; + if (typeof instruction === "function") { + instruction = [, instruction]; + } + const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; + if (typeof filter2 === "function" && filter2(source[sourceKey]) || typeof filter2 !== "function" && !!filter2) { + target[targetKey] = valueFn(source[sourceKey]); + } + return; + } + let [filter, value] = instructions[targetKey]; + if (typeof value === "function") { + let _value; + const defaultFilterPassed = filter === void 0 && (_value = value()) != null; + const customFilterPassed = typeof filter === "function" && !!filter(void 0) || typeof filter !== "function" && !!filter; + if (defaultFilterPassed) { + target[targetKey] = _value; + } else if (customFilterPassed) { + target[targetKey] = value(); + } + } else { + const defaultFilterPassed = filter === void 0 && value != null; + const customFilterPassed = typeof filter === "function" && !!filter(value) || typeof filter !== "function" && !!filter; + if (defaultFilterPassed || customFilterPassed) { + target[targetKey] = value; } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); -}; -exports.setSocketKeepAlive = setSocketKeepAlive; + } +}, "applyInstruction"); +var nonNullish = /* @__PURE__ */ __name((_) => _ != null, "nonNullish"); +var pass = /* @__PURE__ */ __name((_) => _, "pass"); + +// src/resolve-path.ts +var resolvedPath = /* @__PURE__ */ __name((resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { + if (input != null && input[memberName] !== void 0) { + const labelValue = labelValueProvider(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: " + memberName + "."); + } + resolvedPath2 = resolvedPath2.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 resolvedPath2; +}, "resolvedPath"); +// src/ser-utils.ts +var serializeFloat = /* @__PURE__ */ __name((value) => { + if (value !== value) { + return "NaN"; + } + switch (value) { + case Infinity: + return "Infinity"; + case -Infinity: + return "-Infinity"; + default: + return value; + } +}, "serializeFloat"); -/***/ }), +// src/serde-json.ts +var _json = /* @__PURE__ */ __name((obj) => { + if (obj == null) { + return {}; + } + if (Array.isArray(obj)) { + return obj.filter((_) => _ != null).map(_json); + } + if (typeof obj === "object") { + const target = {}; + for (const key of Object.keys(obj)) { + if (obj[key] == null) { + continue; + } + target[key] = _json(obj[key]); + } + return target; + } + return obj; +}, "_json"); -/***/ 67954: -/***/ ((__unused_webpack_module, exports) => { +// src/split-every.ts +function splitEvery(value, delimiter, numDelimiters) { + if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { + throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); + } + const segments = value.split(delimiter); + if (numDelimiters === 1) { + return segments; + } + const compoundSegments = []; + let currentSegment = ""; + for (let i = 0; i < segments.length; i++) { + if (currentSegment === "") { + currentSegment = segments[i]; + } else { + currentSegment += delimiter + segments[i]; + } + if ((i + 1) % numDelimiters === 0) { + compoundSegments.push(currentSegment); + currentSegment = ""; + } + } + if (currentSegment !== "") { + compoundSegments.push(currentSegment); + } + return compoundSegments; +} +__name(splitEvery, "splitEvery"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); -}; -exports.setSocketTimeout = setSocketTimeout; /***/ }), -/***/ 36206: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 9185: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; } -} -exports.Collector = Collector; + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -/***/ }), +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ 87527: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -"use strict"; +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); + +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(36206); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.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); - }); -}); -exports.streamCollector = streamCollector; /***/ }), -/***/ 7389: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4075: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -const MIN_WAIT_TIME = 1000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - var _a; - const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }), - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} /***/ }), -/***/ 43002: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 8960: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(50999); -class Field { - constructor({ name, kind = types_1.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; - } -} -exports.Field = Field; +exports.HttpAuthLocation = void 0; +var HttpAuthLocation; +(function (HttpAuthLocation) { + HttpAuthLocation["HEADER"] = "header"; + HttpAuthLocation["QUERY"] = "query"; +})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); /***/ }), -/***/ 67010: +/***/ 8340: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - 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); - } -} -exports.Fields = Fields; /***/ }), -/***/ 76280: +/***/ 4744: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; /***/ }), -/***/ 33450: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 8270: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(76280), exports); /***/ }), -/***/ 29095: +/***/ 9580: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45220,128 +32873,51 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 22312: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7628: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - 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 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() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(4351); +tslib_1.__exportStar(__nccwpck_require__(9580), exports); +tslib_1.__exportStar(__nccwpck_require__(8398), exports); +tslib_1.__exportStar(__nccwpck_require__(6522), exports); /***/ }), -/***/ 15917: +/***/ 8398: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; /***/ }), -/***/ 73070: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6522: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(33450), exports); -tslib_1.__exportStar(__nccwpck_require__(43002), exports); -tslib_1.__exportStar(__nccwpck_require__(67010), exports); -tslib_1.__exportStar(__nccwpck_require__(29095), exports); -tslib_1.__exportStar(__nccwpck_require__(22312), exports); -tslib_1.__exportStar(__nccwpck_require__(15917), exports); -tslib_1.__exportStar(__nccwpck_require__(11475), exports); -tslib_1.__exportStar(__nccwpck_require__(71805), exports); /***/ }), -/***/ 11475: +/***/ 9035: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; /***/ }), -/***/ 71805: +/***/ 7225: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45351,40 +32927,23 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 1205: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4126: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(3225); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } - } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; +exports.EndpointURLScheme = void 0; +var EndpointURLScheme; +(function (EndpointURLScheme) { + EndpointURLScheme["HTTP"] = "http"; + EndpointURLScheme["HTTPS"] = "https"; +})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); /***/ }), -/***/ 10689: +/***/ 5612: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45394,23 +32953,17 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 42483: +/***/ 3084: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); /***/ }), -/***/ 45621: +/***/ 9843: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45420,7 +32973,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 23408: +/***/ 3799: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45430,17 +32983,23 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 68664: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1550: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(4351); +tslib_1.__exportStar(__nccwpck_require__(5612), exports); +tslib_1.__exportStar(__nccwpck_require__(3084), exports); +tslib_1.__exportStar(__nccwpck_require__(9843), exports); +tslib_1.__exportStar(__nccwpck_require__(7658), exports); +tslib_1.__exportStar(__nccwpck_require__(3799), exports); /***/ }), -/***/ 56179: +/***/ 7658: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45450,7 +33009,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 72394: +/***/ 8508: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45460,21 +33019,23 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 67534: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 8883: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(72394), exports); -tslib_1.__exportStar(__nccwpck_require__(55267), exports); -tslib_1.__exportStar(__nccwpck_require__(80959), exports); +exports.FieldPosition = void 0; +var FieldPosition; +(function (FieldPosition) { + FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; + FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; +})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); /***/ }), -/***/ 55267: +/***/ 7545: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45484,7 +33045,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 80959: +/***/ 9123: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45494,43 +33055,68 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 92055: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8006: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(4351); +tslib_1.__exportStar(__nccwpck_require__(7545), exports); +tslib_1.__exportStar(__nccwpck_require__(9123), exports); /***/ }), -/***/ 9962: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5756: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(4351); +tslib_1.__exportStar(__nccwpck_require__(4075), exports); +tslib_1.__exportStar(__nccwpck_require__(8960), exports); +tslib_1.__exportStar(__nccwpck_require__(8340), exports); +tslib_1.__exportStar(__nccwpck_require__(4744), exports); +tslib_1.__exportStar(__nccwpck_require__(8270), exports); +tslib_1.__exportStar(__nccwpck_require__(7628), exports); +tslib_1.__exportStar(__nccwpck_require__(9035), exports); +tslib_1.__exportStar(__nccwpck_require__(7225), exports); +tslib_1.__exportStar(__nccwpck_require__(4126), exports); +tslib_1.__exportStar(__nccwpck_require__(1550), exports); +tslib_1.__exportStar(__nccwpck_require__(8508), exports); +tslib_1.__exportStar(__nccwpck_require__(8883), exports); +tslib_1.__exportStar(__nccwpck_require__(8006), exports); +tslib_1.__exportStar(__nccwpck_require__(2866), exports); +tslib_1.__exportStar(__nccwpck_require__(7756), exports); +tslib_1.__exportStar(__nccwpck_require__(5489), exports); +tslib_1.__exportStar(__nccwpck_require__(6524), exports); +tslib_1.__exportStar(__nccwpck_require__(4603), exports); +tslib_1.__exportStar(__nccwpck_require__(3752), exports); +tslib_1.__exportStar(__nccwpck_require__(774), exports); +tslib_1.__exportStar(__nccwpck_require__(4089), exports); +tslib_1.__exportStar(__nccwpck_require__(5678), exports); +tslib_1.__exportStar(__nccwpck_require__(9926), exports); +tslib_1.__exportStar(__nccwpck_require__(364), exports); +tslib_1.__exportStar(__nccwpck_require__(6894), exports); +tslib_1.__exportStar(__nccwpck_require__(7887), exports); +tslib_1.__exportStar(__nccwpck_require__(7544), exports); /***/ }), -/***/ 54787: +/***/ 2866: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); /***/ }), -/***/ 45734: +/***/ 7756: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45540,7 +33126,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 87024: +/***/ 5489: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45550,7 +33136,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 46158: +/***/ 6524: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45560,7 +33146,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 67556: +/***/ 4603: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45570,23 +33156,17 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 93283: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3752: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(45734), exports); -tslib_1.__exportStar(__nccwpck_require__(87024), exports); -tslib_1.__exportStar(__nccwpck_require__(46158), exports); -tslib_1.__exportStar(__nccwpck_require__(79392), exports); -tslib_1.__exportStar(__nccwpck_require__(67556), exports); /***/ }), -/***/ 79392: +/***/ 774: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45596,7 +33176,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 27696: +/***/ 4089: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45606,125 +33186,64 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 97028: +/***/ 5678: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; /***/ }), -/***/ 47944: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 9926: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(97028); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; /***/ }), -/***/ 86153: +/***/ 364: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RequestHandlerProtocol = void 0; +var RequestHandlerProtocol; +(function (RequestHandlerProtocol) { + RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; +})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); /***/ }), -/***/ 55310: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6894: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(47944), exports); -tslib_1.__exportStar(__nccwpck_require__(86153), exports); -var checksum_1 = __nccwpck_require__(97028); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); /***/ }), -/***/ 72647: +/***/ 7887: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); /***/ }), -/***/ 25670: +/***/ 7544: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45734,615 +33253,3266 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 35539: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4681: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + parseUrl: () => parseUrl +}); +module.exports = __toCommonJS(src_exports); +var import_querystring_parser = __nccwpck_require__(4769); +var parseUrl = /* @__PURE__ */ __name((url) => { + if (typeof url === "string") { + return parseUrl(new URL(url)); + } + const { hostname, pathname, port, protocol, search } = url; + let query; + if (search) { + query = (0, import_querystring_parser.parseQueryString)(search); + } + return { + hostname, + port: port ? parseInt(port) : void 0, + protocol, + path: pathname, + query + }; +}, "parseUrl"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 305: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromBase64 = void 0; +const util_buffer_from_1 = __nccwpck_require__(1381); +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 (!BASE64_REGEX.exec(input)) { + throw new TypeError(`Invalid base64 string.`); + } + const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); +}; +exports.fromBase64 = fromBase64; + + +/***/ }), + +/***/ 5600: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +module.exports = __toCommonJS(src_exports); +__reExport(src_exports, __nccwpck_require__(305), module.exports); +__reExport(src_exports, __nccwpck_require__(4730), module.exports); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + /***/ }), -/***/ 40701: +/***/ 4730: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(25670), exports); -tslib_1.__exportStar(__nccwpck_require__(35539), exports); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toBase64 = void 0; +const util_buffer_from_1 = __nccwpck_require__(1381); +const toBase64 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); +exports.toBase64 = toBase64; + + +/***/ }), + +/***/ 8075: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + calculateBodyLength: () => calculateBodyLength +}); +module.exports = __toCommonJS(src_exports); + +// src/calculateBodyLength.ts +var import_fs = __nccwpck_require__(7147); +var calculateBodyLength = /* @__PURE__ */ __name((body) => { + if (!body) { + return 0; + } + if (typeof body === "string") { + return Buffer.from(body).length; + } else if (typeof body.byteLength === "number") { + return body.byteLength; + } else if (typeof body.size === "number") { + return body.size; + } else if (typeof body.start === "number" && typeof body.end === "number") { + return body.end + 1 - body.start; + } else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { + return (0, import_fs.lstatSync)(body.path).size; + } else if (typeof body.fd === "number") { + return (0, import_fs.fstatSync)(body.fd).size; + } + throw new Error(`Body Length computation failed for ${body}`); +}, "calculateBodyLength"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 1381: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + fromArrayBuffer: () => fromArrayBuffer, + fromString: () => fromString +}); +module.exports = __toCommonJS(src_exports); +var import_is_array_buffer = __nccwpck_require__(780); +var import_buffer = __nccwpck_require__(4300); +var fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => { + if (!(0, import_is_array_buffer.isArrayBuffer)(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); + } + return import_buffer.Buffer.from(input, offset, length); +}, "fromArrayBuffer"); +var fromString = /* @__PURE__ */ __name((input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + } + return encoding ? import_buffer.Buffer.from(input, encoding) : import_buffer.Buffer.from(input); +}, "fromString"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 3375: +/***/ ((module) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + SelectorType: () => SelectorType, + booleanSelector: () => booleanSelector, + numberSelector: () => numberSelector +}); +module.exports = __toCommonJS(src_exports); + +// src/booleanSelector.ts +var booleanSelector = /* @__PURE__ */ __name((obj, key, type) => { + if (!(key in obj)) + return void 0; + 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]}.`); +}, "booleanSelector"); + +// src/numberSelector.ts +var numberSelector = /* @__PURE__ */ __name((obj, key, type) => { + if (!(key in obj)) + return void 0; + const numberValue = parseInt(obj[key], 10); + if (Number.isNaN(numberValue)) { + throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); + } + return numberValue; +}, "numberSelector"); + +// src/types.ts +var SelectorType = /* @__PURE__ */ ((SelectorType2) => { + SelectorType2["ENV"] = "env"; + SelectorType2["CONFIG"] = "shared config entry"; + return SelectorType2; +})(SelectorType || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 2429: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + resolveDefaultsModeConfig: () => resolveDefaultsModeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/resolveDefaultsModeConfig.ts +var import_config_resolver = __nccwpck_require__(3098); +var import_node_config_provider = __nccwpck_require__(3461); +var import_property_provider = __nccwpck_require__(9721); + +// src/constants.ts +var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; +var AWS_REGION_ENV = "AWS_REGION"; +var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; +var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; +var IMDS_REGION_PATH = "/latest/meta-data/placement/region"; + +// src/defaultsModeConfig.ts +var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; +var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; +var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + return env[AWS_DEFAULTS_MODE_ENV]; + }, + configFileSelector: (profile) => { + return profile[AWS_DEFAULTS_MODE_CONFIG]; + }, + default: "legacy" +}; + +// src/resolveDefaultsModeConfig.ts +var resolveDefaultsModeConfig = /* @__PURE__ */ __name(({ + region = (0, import_node_config_provider.loadConfig)(import_config_resolver.NODE_REGION_CONFIG_OPTIONS), + defaultsMode = (0, import_node_config_provider.loadConfig)(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) +} = {}) => (0, import_property_provider.memoize)(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode == null ? void 0 : mode.toLowerCase()) { + case "auto": + return resolveNodeDefaultsModeAuto(region); + case "in-region": + case "cross-region": + case "mobile": + case "standard": + case "legacy": + return Promise.resolve(mode == null ? void 0 : mode.toLocaleLowerCase()); + case void 0: + return Promise.resolve("legacy"); + default: + throw new Error( + `Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}` + ); + } +}), "resolveDefaultsModeConfig"); +var resolveNodeDefaultsModeAuto = /* @__PURE__ */ __name(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"; + } else { + return "cross-region"; + } + } + return "standard"; +}, "resolveNodeDefaultsModeAuto"); +var inferPhysicalRegion = /* @__PURE__ */ __name(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 (!process.env[ENV_IMDS_DISABLED]) { + try { + const { getInstanceMetadataEndpoint, httpRequest } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(7477))); + const endpoint = await getInstanceMetadataEndpoint(); + return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString(); + } catch (e) { + } + } +}, "inferPhysicalRegion"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); + + + +/***/ }), + +/***/ 5473: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + EndpointError: () => EndpointError, + customEndpointFunctions: () => customEndpointFunctions, + isIpAddress: () => isIpAddress, + isValidHostLabel: () => isValidHostLabel, + resolveEndpoint: () => resolveEndpoint +}); +module.exports = __toCommonJS(src_exports); + +// src/lib/isIpAddress.ts +var IP_V4_REGEX = new RegExp( + `^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$` +); +var isIpAddress = /* @__PURE__ */ __name((value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"), "isIpAddress"); +// src/lib/isValidHostLabel.ts +var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); +var isValidHostLabel = /* @__PURE__ */ __name((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; +}, "isValidHostLabel"); -/***/ }), +// src/utils/customEndpointFunctions.ts +var customEndpointFunctions = {}; -/***/ 50999: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/debug/debugId.ts +var debugId = "endpoints"; -"use strict"; +// src/debug/toDebugString.ts +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); +} +__name(toDebugString, "toDebugString"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(10689), exports); -tslib_1.__exportStar(__nccwpck_require__(42483), exports); -tslib_1.__exportStar(__nccwpck_require__(45621), exports); -tslib_1.__exportStar(__nccwpck_require__(23408), exports); -tslib_1.__exportStar(__nccwpck_require__(68664), exports); -tslib_1.__exportStar(__nccwpck_require__(56179), exports); -tslib_1.__exportStar(__nccwpck_require__(67534), exports); -tslib_1.__exportStar(__nccwpck_require__(92055), exports); -tslib_1.__exportStar(__nccwpck_require__(9962), exports); -tslib_1.__exportStar(__nccwpck_require__(54787), exports); -tslib_1.__exportStar(__nccwpck_require__(93283), exports); -tslib_1.__exportStar(__nccwpck_require__(27696), exports); -tslib_1.__exportStar(__nccwpck_require__(55310), exports); -tslib_1.__exportStar(__nccwpck_require__(72647), exports); -tslib_1.__exportStar(__nccwpck_require__(40701), exports); -tslib_1.__exportStar(__nccwpck_require__(61837), exports); -tslib_1.__exportStar(__nccwpck_require__(28659), exports); -tslib_1.__exportStar(__nccwpck_require__(10724), exports); -tslib_1.__exportStar(__nccwpck_require__(42536), exports); -tslib_1.__exportStar(__nccwpck_require__(34866), exports); -tslib_1.__exportStar(__nccwpck_require__(30184), exports); -tslib_1.__exportStar(__nccwpck_require__(87151), exports); -tslib_1.__exportStar(__nccwpck_require__(93992), exports); -tslib_1.__exportStar(__nccwpck_require__(40497), exports); -tslib_1.__exportStar(__nccwpck_require__(39026), exports); -tslib_1.__exportStar(__nccwpck_require__(42017), exports); -tslib_1.__exportStar(__nccwpck_require__(24996), exports); -tslib_1.__exportStar(__nccwpck_require__(46942), exports); -tslib_1.__exportStar(__nccwpck_require__(49051), exports); -tslib_1.__exportStar(__nccwpck_require__(90891), exports); -tslib_1.__exportStar(__nccwpck_require__(79428), exports); -tslib_1.__exportStar(__nccwpck_require__(89043), exports); -tslib_1.__exportStar(__nccwpck_require__(46863), exports); -tslib_1.__exportStar(__nccwpck_require__(14897), exports); - - -/***/ }), - -/***/ 61837: -/***/ ((__unused_webpack_module, exports) => { +// src/types/EndpointError.ts +var _EndpointError = class _EndpointError extends Error { + constructor(message) { + super(message); + this.name = "EndpointError"; + } +}; +__name(_EndpointError, "EndpointError"); +var EndpointError = _EndpointError; + +// src/lib/booleanEquals.ts +var booleanEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "booleanEquals"); + +// src/lib/getAttrPathList.ts +var getAttrPathList = /* @__PURE__ */ __name((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 ']'`); + } + const arrayIndex = part.slice(squareBracketIndex + 1, -1); + if (Number.isNaN(parseInt(arrayIndex))) { + throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); + } + if (squareBracketIndex !== 0) { + pathList.push(part.slice(0, squareBracketIndex)); + } + pathList.push(arrayIndex); + } else { + pathList.push(part); + } + } + return pathList; +}, "getAttrPathList"); + +// src/lib/getAttr.ts +var getAttr = /* @__PURE__ */ __name((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), "getAttr"); -"use strict"; +// src/lib/isSet.ts +var isSet = /* @__PURE__ */ __name((value) => value != null, "isSet"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/lib/not.ts +var not = /* @__PURE__ */ __name((value) => !value, "not"); +// src/lib/parseURL.ts +var import_types3 = __nccwpck_require__(5323); +var DEFAULT_PORTS = { + [import_types3.EndpointURLScheme.HTTP]: 80, + [import_types3.EndpointURLScheme.HTTPS]: 443 +}; +var parseURL = /* @__PURE__ */ __name((value) => { + const whatwgURL = (() => { + try { + if (value instanceof URL) { + return value; + } + if (typeof value === "object" && "hostname" in value) { + const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value; + const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`); + url.search = Object.entries(query).map(([k, v]) => `${k}=${v}`).join("&"); + return url; + } + return new URL(value); + } 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(import_types3.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 { + scheme, + authority, + path: pathname, + normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, + isIp + }; +}, "parseURL"); -/***/ }), +// src/lib/stringEquals.ts +var stringEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "stringEquals"); -/***/ 28659: -/***/ ((__unused_webpack_module, exports) => { +// src/lib/substring.ts +var substring = /* @__PURE__ */ __name((input, start, stop, reverse) => { + if (start >= stop || input.length < stop) { + return null; + } + if (!reverse) { + return input.substring(start, stop); + } + return input.substring(input.length - stop, input.length - start); +}, "substring"); + +// src/lib/uriEncode.ts +var uriEncode = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`), "uriEncode"); + +// src/utils/endpointFunctions.ts +var endpointFunctions = { + booleanEquals, + getAttr, + isSet, + isValidHostLabel, + not, + parseURL, + stringEquals, + substring, + uriEncode +}; + +// src/utils/evaluateTemplate.ts +var evaluateTemplate = /* @__PURE__ */ __name((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(""); +}, "evaluateTemplate"); + +// src/utils/getReferenceValue.ts +var getReferenceValue = /* @__PURE__ */ __name(({ ref }, options) => { + const referenceRecord = { + ...options.endpointParams, + ...options.referenceRecord + }; + return referenceRecord[ref]; +}, "getReferenceValue"); + +// src/utils/evaluateExpression.ts +var evaluateExpression = /* @__PURE__ */ __name((obj, keyName, options) => { + if (typeof obj === "string") { + return evaluateTemplate(obj, options); + } else if (obj["fn"]) { + return callFunction(obj, options); + } else if (obj["ref"]) { + return getReferenceValue(obj, options); + } + throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); +}, "evaluateExpression"); -"use strict"; +// src/utils/callFunction.ts +var callFunction = /* @__PURE__ */ __name(({ fn, argv }, options) => { + const evaluatedArgs = argv.map( + (arg) => ["boolean", "number"].includes(typeof arg) ? arg : 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); +}, "callFunction"); + +// src/utils/evaluateCondition.ts +var evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options) => { + var _a, _b; + if (assign && assign in options.referenceRecord) { + throw new EndpointError(`'${assign}' is already defined in Reference Record.`); + } + const value = callFunction(fnArgs, options); + (_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, debugId, `evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); + return { + result: value === "" ? true : !!value, + ...assign != null && { toAssign: { name: assign, value } } + }; +}, "evaluateCondition"); + +// src/utils/evaluateConditions.ts +var evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => { + var _a, _b; + 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; + (_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, debugId, `assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); + } + } + return { result: true, referenceRecord: conditionsReferenceRecord }; +}, "evaluateConditions"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; +// src/utils/getEndpointHeaders.ts +var getEndpointHeaders = /* @__PURE__ */ __name((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; + }) + }), + {} +), "getEndpointHeaders"); + +// src/utils/getEndpointProperty.ts +var getEndpointProperty = /* @__PURE__ */ __name((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 getEndpointProperties(property, options); + case "boolean": + return property; + default: + throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); + } +}, "getEndpointProperty"); +// src/utils/getEndpointProperties.ts +var getEndpointProperties = /* @__PURE__ */ __name((properties, options) => Object.entries(properties).reduce( + (acc, [propertyKey, propertyVal]) => ({ + ...acc, + [propertyKey]: getEndpointProperty(propertyVal, options) + }), + {} +), "getEndpointProperties"); + +// src/utils/getEndpointUrl.ts +var getEndpointUrl = /* @__PURE__ */ __name((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; + } + } + throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); +}, "getEndpointUrl"); + +// src/utils/evaluateEndpointRule.ts +var evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options) => { + var _a, _b; + 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; + (_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, debugId, `Resolving endpoint from template: ${toDebugString(endpoint)}`); + return { + ...headers != void 0 && { + headers: getEndpointHeaders(headers, endpointRuleOptions) + }, + ...properties != void 0 && { + properties: getEndpointProperties(properties, endpointRuleOptions) + }, + url: getEndpointUrl(url, endpointRuleOptions) + }; +}, "evaluateEndpointRule"); -/***/ }), +// src/utils/evaluateErrorRule.ts +var evaluateErrorRule = /* @__PURE__ */ __name((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 } + }) + ); +}, "evaluateErrorRule"); -/***/ 10724: -/***/ ((__unused_webpack_module, exports) => { +// src/utils/evaluateTreeRule.ts +var evaluateTreeRule = /* @__PURE__ */ __name((treeRule, options) => { + const { conditions, rules } = treeRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + return evaluateRules(rules, { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord } + }); +}, "evaluateTreeRule"); + +// src/utils/evaluateRules.ts +var evaluateRules = /* @__PURE__ */ __name((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 = evaluateTreeRule(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } else { + throw new EndpointError(`Unknown endpoint rule: ${rule}`); + } + } + throw new EndpointError(`Rules evaluation failed`); +}, "evaluateRules"); + +// src/resolveEndpoint.ts +var resolveEndpoint = /* @__PURE__ */ __name((ruleSetObject, options) => { + var _a, _b, _c, _d, _e; + const { endpointParams, logger } = options; + const { parameters, rules } = ruleSetObject; + (_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${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}'`); + } + } + const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} }); + if ((_c = options.endpointParams) == null ? void 0 : _c.Endpoint) { + try { + const givenEndpoint = new URL(options.endpointParams.Endpoint); + const { protocol, port } = givenEndpoint; + endpoint.url.protocol = protocol; + endpoint.url.port = port; + } catch (e) { + } + } + (_e = (_d = options.logger) == null ? void 0 : _d.debug) == null ? void 0 : _e.call(_d, `${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); + return endpoint; +}, "resolveEndpoint"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 42536: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5323: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 34866: -/***/ ((__unused_webpack_module, exports) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 30184: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5364: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + fromHex: () => fromHex, + toHex: () => toHex +}); +module.exports = __toCommonJS(src_exports); +var SHORT_TO_HEX = {}; +var HEX_TO_SHORT = {}; +for (let i = 0; i < 256; i++) { + let encodedByte = i.toString(16).toLowerCase(); + if (encodedByte.length === 1) { + encodedByte = `0${encodedByte}`; + } + SHORT_TO_HEX[i] = encodedByte; + HEX_TO_SHORT[encodedByte] = i; +} +function fromHex(encoded) { + if (encoded.length % 2 !== 0) { + throw new Error("Hex encoded strings must have an even number length"); + } + const out = new Uint8Array(encoded.length / 2); + for (let i = 0; i < encoded.length; i += 2) { + const encodedByte = encoded.slice(i, i + 2).toLowerCase(); + if (encodedByte in HEX_TO_SHORT) { + out[i / 2] = HEX_TO_SHORT[encodedByte]; + } else { + throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); + } + } + return out; +} +__name(fromHex, "fromHex"); +function toHex(bytes) { + let out = ""; + for (let i = 0; i < bytes.byteLength; i++) { + out += SHORT_TO_HEX[bytes[i]]; + } + return out; +} +__name(toHex, "toHex"); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -/***/ }), -/***/ 87151: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 2390: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ }), +// src/index.ts +var src_exports = {}; +__export(src_exports, { + getSmithyContext: () => getSmithyContext, + normalizeProvider: () => normalizeProvider +}); +module.exports = __toCommonJS(src_exports); -/***/ 93992: -/***/ ((__unused_webpack_module, exports) => { +// src/getSmithyContext.ts +var import_types = __nccwpck_require__(3998); +var getSmithyContext = /* @__PURE__ */ __name((context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {}), "getSmithyContext"); -"use strict"; +// src/normalizeProvider.ts +var normalizeProvider = /* @__PURE__ */ __name((input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; +}, "normalizeProvider"); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 40497: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3998: +/***/ ((module) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); -/***/ }), +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ 39026: -/***/ ((__unused_webpack_module, exports) => { +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -"use strict"; +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 42017: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4902: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AdaptiveRetryStrategy: () => AdaptiveRetryStrategy, + ConfiguredRetryStrategy: () => ConfiguredRetryStrategy, + DEFAULT_MAX_ATTEMPTS: () => DEFAULT_MAX_ATTEMPTS, + DEFAULT_RETRY_DELAY_BASE: () => DEFAULT_RETRY_DELAY_BASE, + DEFAULT_RETRY_MODE: () => DEFAULT_RETRY_MODE, + DefaultRateLimiter: () => DefaultRateLimiter, + INITIAL_RETRY_TOKENS: () => INITIAL_RETRY_TOKENS, + INVOCATION_ID_HEADER: () => INVOCATION_ID_HEADER, + MAXIMUM_RETRY_DELAY: () => MAXIMUM_RETRY_DELAY, + NO_RETRY_INCREMENT: () => NO_RETRY_INCREMENT, + REQUEST_HEADER: () => REQUEST_HEADER, + RETRY_COST: () => RETRY_COST, + RETRY_MODES: () => RETRY_MODES, + StandardRetryStrategy: () => StandardRetryStrategy, + THROTTLING_RETRY_DELAY_BASE: () => THROTTLING_RETRY_DELAY_BASE, + TIMEOUT_RETRY_COST: () => TIMEOUT_RETRY_COST +}); +module.exports = __toCommonJS(src_exports); + +// src/config.ts +var RETRY_MODES = /* @__PURE__ */ ((RETRY_MODES2) => { + RETRY_MODES2["STANDARD"] = "standard"; + RETRY_MODES2["ADAPTIVE"] = "adaptive"; + return RETRY_MODES2; +})(RETRY_MODES || {}); +var DEFAULT_MAX_ATTEMPTS = 3; +var DEFAULT_RETRY_MODE = "standard" /* STANDARD */; + +// src/DefaultRateLimiter.ts +var import_service_error_classification = __nccwpck_require__(6375); +var _DefaultRateLimiter = class _DefaultRateLimiter { + constructor(options) { + // Pre-set state variables + this.currentCapacity = 0; + this.enabled = false; + this.lastMaxRate = 0; + this.measuredTxRate = 0; + this.requestCount = 0; + this.lastTimestamp = 0; + this.timeWindow = 0; + this.beta = (options == null ? void 0 : options.beta) ?? 0.7; + this.minCapacity = (options == null ? void 0 : options.minCapacity) ?? 1; + this.minFillRate = (options == null ? void 0 : options.minFillRate) ?? 0.5; + this.scaleConstant = (options == null ? void 0 : options.scaleConstant) ?? 0.4; + this.smooth = (options == null ? void 0 : options.smooth) ?? 0.8; + const currentTimeInSeconds = this.getCurrentTimeInSeconds(); + this.lastThrottleTime = currentTimeInSeconds; + this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); + this.fillRate = this.minFillRate; + this.maxCapacity = this.minCapacity; + } + getCurrentTimeInSeconds() { + return Date.now() / 1e3; + } + async getSendToken() { + return this.acquireTokenBucket(1); + } + async acquireTokenBucket(amount) { + if (!this.enabled) { + return; + } + this.refillTokenBucket(); + if (amount > this.currentCapacity) { + const delay = (amount - this.currentCapacity) / this.fillRate * 1e3; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + this.currentCapacity = this.currentCapacity - amount; + } + refillTokenBucket() { + const timestamp = this.getCurrentTimeInSeconds(); + if (!this.lastTimestamp) { + this.lastTimestamp = timestamp; + return; + } + const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; + this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); + this.lastTimestamp = timestamp; + } + updateClientSendingRate(response) { + let calculatedRate; + this.updateMeasuredRate(); + if ((0, import_service_error_classification.isThrottlingError)(response)) { + const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); + this.lastMaxRate = rateToUse; + this.calculateTimeWindow(); + this.lastThrottleTime = this.getCurrentTimeInSeconds(); + calculatedRate = this.cubicThrottle(rateToUse); + this.enableTokenBucket(); + } else { + this.calculateTimeWindow(); + calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); + } + const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); + this.updateTokenBucketRate(newRate); + } + calculateTimeWindow() { + this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); + } + cubicThrottle(rateToUse) { + return this.getPrecise(rateToUse * this.beta); + } + cubicSuccess(timestamp) { + return this.getPrecise( + this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate + ); + } + enableTokenBucket() { + this.enabled = true; + } + updateTokenBucketRate(newRate) { + this.refillTokenBucket(); + this.fillRate = Math.max(newRate, this.minFillRate); + this.maxCapacity = Math.max(newRate, this.minCapacity); + this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); + } + updateMeasuredRate() { + const t = this.getCurrentTimeInSeconds(); + const timeBucket = Math.floor(t * 2) / 2; + this.requestCount++; + if (timeBucket > this.lastTxRateBucket) { + const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); + this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); + this.requestCount = 0; + this.lastTxRateBucket = timeBucket; + } + } + getPrecise(num) { + return parseFloat(num.toFixed(8)); + } +}; +__name(_DefaultRateLimiter, "DefaultRateLimiter"); +var DefaultRateLimiter = _DefaultRateLimiter; + +// src/constants.ts +var DEFAULT_RETRY_DELAY_BASE = 100; +var MAXIMUM_RETRY_DELAY = 20 * 1e3; +var THROTTLING_RETRY_DELAY_BASE = 500; +var INITIAL_RETRY_TOKENS = 500; +var RETRY_COST = 5; +var TIMEOUT_RETRY_COST = 10; +var NO_RETRY_INCREMENT = 1; +var INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; +var REQUEST_HEADER = "amz-sdk-request"; + +// src/defaultRetryBackoffStrategy.ts +var getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => { + let delayBase = DEFAULT_RETRY_DELAY_BASE; + const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => { + return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); + }, "computeNextBackoffDelay"); + const setDelayBase = /* @__PURE__ */ __name((delay) => { + delayBase = delay; + }, "setDelayBase"); + return { + computeNextBackoffDelay, + setDelayBase + }; +}, "getDefaultRetryBackoffStrategy"); + +// src/defaultRetryToken.ts +var createDefaultRetryToken = /* @__PURE__ */ __name(({ + retryDelay, + retryCount, + retryCost +}) => { + const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount"); + const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay"); + const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost"); + return { + getRetryCount, + getRetryDelay, + getRetryCost + }; +}, "createDefaultRetryToken"); + +// src/StandardRetryStrategy.ts +var _StandardRetryStrategy = class _StandardRetryStrategy { + constructor(maxAttempts) { + this.maxAttempts = maxAttempts; + this.mode = "standard" /* STANDARD */; + this.capacity = INITIAL_RETRY_TOKENS; + this.retryBackoffStrategy = getDefaultRetryBackoffStrategy(); + 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 + }); + } + throw new Error("No retry token available"); + } + recordSuccess(token) { + this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); + } + /** + * @returns the current available retry capacity. + * + * This number decreases when retries are executed and refills when requests or retries succeed. + */ + getCapacity() { + return this.capacity; + } + async getMaxAttempts() { + try { + return await this.maxAttemptsProvider(); + } catch (error) { + console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); + return DEFAULT_MAX_ATTEMPTS; + } + } + shouldRetry(tokenToRenew, errorInfo, maxAttempts) { + const attempts = tokenToRenew.getRetryCount() + 1; + return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); + } + getCapacityCost(errorType) { + return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; + } + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; + } +}; +__name(_StandardRetryStrategy, "StandardRetryStrategy"); +var StandardRetryStrategy = _StandardRetryStrategy; + +// src/AdaptiveRetryStrategy.ts +var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = "adaptive" /* ADAPTIVE */; + const { rateLimiter } = options ?? {}; + this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); + this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); + } + async acquireInitialRetryToken(retryTokenScope) { + await this.rateLimiter.getSendToken(); + return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + this.rateLimiter.updateClientSendingRate(errorInfo); + return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + } + recordSuccess(token) { + this.rateLimiter.updateClientSendingRate({}); + this.standardRetryStrategy.recordSuccess(token); + } +}; +__name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); +var AdaptiveRetryStrategy = _AdaptiveRetryStrategy; + +// src/ConfiguredRetryStrategy.ts +var _ConfiguredRetryStrategy = class _ConfiguredRetryStrategy extends StandardRetryStrategy { + /** + * @param maxAttempts - the maximum number of retry attempts allowed. + * e.g., if set to 3, then 4 total requests are possible. + * @param computeNextBackoffDelay - a millisecond delay for each retry or a function that takes the retry attempt + * and returns the delay. + * + * @example exponential backoff. + * ```js + * new Client({ + * retryStrategy: new ConfiguredRetryStrategy(3, (attempt) => attempt ** 2) + * }); + * ``` + * @example constant delay. + * ```js + * new Client({ + * retryStrategy: new ConfiguredRetryStrategy(3, 2000) + * }); + * ``` + */ + constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) { + super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); + if (typeof computeNextBackoffDelay === "number") { + this.computeNextBackoffDelay = () => computeNextBackoffDelay; + } else { + this.computeNextBackoffDelay = computeNextBackoffDelay; + } + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); + return token; + } +}; +__name(_ConfiguredRetryStrategy, "ConfiguredRetryStrategy"); +var ConfiguredRetryStrategy = _ConfiguredRetryStrategy; +// Annotate the CommonJS export names for ESM import in node: + +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 24996: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3636: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getAwsChunkedEncodingStream = void 0; +const stream_1 = __nccwpck_require__(2781); +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; /***/ }), -/***/ 46942: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 6607: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Uint8ArrayBlobAdapter: () => Uint8ArrayBlobAdapter +}); +module.exports = __toCommonJS(src_exports); -/***/ }), +// src/blob/transforms.ts +var import_util_base64 = __nccwpck_require__(5600); +var import_util_utf8 = __nccwpck_require__(1895); +function transformToString(payload, encoding = "utf-8") { + if (encoding === "base64") { + return (0, import_util_base64.toBase64)(payload); + } + return (0, import_util_utf8.toUtf8)(payload); +} +__name(transformToString, "transformToString"); +function transformFromString(str, encoding) { + if (encoding === "base64") { + return Uint8ArrayBlobAdapter.mutate((0, import_util_base64.fromBase64)(str)); + } + return Uint8ArrayBlobAdapter.mutate((0, import_util_utf8.fromUtf8)(str)); +} +__name(transformFromString, "transformFromString"); + +// src/blob/Uint8ArrayBlobAdapter.ts +var _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array { + /** + * @param source - such as a string or Stream. + * @returns a new Uint8ArrayBlobAdapter extending Uint8Array. + */ + static fromString(source, encoding = "utf-8") { + switch (typeof source) { + case "string": + return transformFromString(source, encoding); + default: + throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); + } + } + /** + * @param source - Uint8Array to be mutated. + * @returns the same Uint8Array but with prototype switched to Uint8ArrayBlobAdapter. + */ + static mutate(source) { + Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype); + return source; + } + /** + * @param encoding - default 'utf-8'. + * @returns the blob as string. + */ + transformToString(encoding = "utf-8") { + return transformToString(this, encoding); + } +}; +__name(_Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter"); +var Uint8ArrayBlobAdapter = _Uint8ArrayBlobAdapter; -/***/ 49051: -/***/ ((__unused_webpack_module, exports) => { +// src/index.ts +__reExport(src_exports, __nccwpck_require__(3636), module.exports); +__reExport(src_exports, __nccwpck_require__(4515), module.exports); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); /***/ }), -/***/ 90891: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4515: +/***/ ((__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__(6123); +const util_buffer_from_1 = __nccwpck_require__(1381); +const stream_1 = __nccwpck_require__(2781); +const util_1 = __nccwpck_require__(3837); +const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; +const sdkStreamMixin = (stream) => { + var _a, _b; + if (!(stream instanceof stream_1.Readable)) { + const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; + throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); + } + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + transformed = true; + return await (0, node_http_handler_1.streamCollector)(stream); + }; + return Object.assign(stream, { + transformToByteArray, + transformToString: async (encoding) => { + const buf = await transformToByteArray(); + if (encoding === undefined || Buffer.isEncoding(encoding)) { + return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); + } + else { + const decoder = new util_1.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 make sure you are using Node.js >= 17.0.0, or polyfill is available."); + } + transformed = true; + return stream_1.Readable.toWeb(stream); + }, + }); +}; +exports.sdkStreamMixin = sdkStreamMixin; /***/ }), -/***/ 79428: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6123: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, + NodeHttp2Handler: () => NodeHttp2Handler, + NodeHttpHandler: () => NodeHttpHandler, + streamCollector: () => streamCollector +}); +module.exports = __toCommonJS(src_exports); + +// src/node-http-handler.ts +var import_protocol_http = __nccwpck_require__(3070); +var import_querystring_builder = __nccwpck_require__(1205); +var import_http = __nccwpck_require__(3685); +var import_https = __nccwpck_require__(5687); + +// src/constants.ts +var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + +// src/get-transformed-headers.ts +var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}, "getTransformedHeaders"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/set-connection-timeout.ts +var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject( + Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError" + }) + ); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } else { + clearTimeout(timeoutId); + } + }); +}, "setConnectionTimeout"); +// src/set-socket-keep-alive.ts +var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}, "setSocketKeepAlive"); -/***/ }), +// src/set-socket-timeout.ts +var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}, "setSocketTimeout"); -/***/ 89043: -/***/ ((__unused_webpack_module, exports) => { +// src/write-request-body.ts +var import_stream = __nccwpck_require__(2781); +var MIN_WAIT_TIME = 1e3; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + const headers = request.headers ?? {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }) + ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } +} +__name(writeRequestBody, "writeRequestBody"); +function writeBody(httpRequest, body) { + if (body instanceof import_stream.Readable) { + body.pipe(httpRequest); + } else if (body) { + httpRequest.end(Buffer.from(body)); + } else { + httpRequest.end(); + } +} +__name(writeBody, "writeBody"); + +// src/node-http-handler.ts +var DEFAULT_REQUEST_TIMEOUT = 0; +var _NodeHttpHandler = class _NodeHttpHandler { + constructor(options) { + this.socketWarningTimestamp = 0; + // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286 + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttpHandler(instanceOrOptions); + } + /** + * @internal + * + * @param agent - http(s) agent in use by the NodeHttpHandler instance. + * @returns timestamp of last emitted warning. + */ + static checkSocketUsage(agent, socketWarningTimestamp) { + var _a, _b; + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0; + const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + console.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; + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout ?? socketTimeout, + httpAgent: (() => { + if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") { + return httpAgent; + } + return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") { + return httpsAgent; + } + return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })() + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy(); + (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + let socketCheckTimeoutId; + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + clearTimeout(socketCheckTimeoutId); + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal == null ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; + socketCheckTimeoutId = setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp); + }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)); + const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); + let auth = void 0; + 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}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent, + auth + }; + const requestFunc = isSSL ? import_https.request : import_http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new import_protocol_http.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); + } + }); + setConnectionTimeout(req, reject, this.config.connectionTimeout); + setSocketTimeout(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + setSocketKeepAlive(req, { + // @ts-expect-error keepAlive is not public on httpAgent. + keepAlive: httpAgent.keepAlive, + // @ts-expect-error keepAliveMsecs is not public on httpAgent. + keepAliveMsecs: httpAgent.keepAliveMsecs + }); + } + writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } +}; +__name(_NodeHttpHandler, "NodeHttpHandler"); +var NodeHttpHandler = _NodeHttpHandler; -"use strict"; +// src/node-http2-handler.ts -Object.defineProperty(exports, "__esModule", ({ value: true })); +var import_http22 = __nccwpck_require__(5158); + +// src/node-http2-connection-manager.ts +var import_http2 = __toESM(__nccwpck_require__(5158)); + +// src/node-http2-connection-pool.ts +var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); + } + } + offerLast(session) { + this.sessions.push(session); + } + contains(session) { + return this.sessions.includes(session); + } + remove(session) { + this.sessions = this.sessions.filter((s) => s !== session); + } + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); + } + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); + } + } + } + } +}; +__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); +var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; + +// src/node-http2-connection-manager.ts +var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = /* @__PURE__ */ new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + lease(requestContext, connectionConfiguration) { + const 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 = import_http2.default.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 = /* @__PURE__ */ __name(() => { + session.destroy(); + this.deleteSession(url, session); + }, "destroySessionCb"); + 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; + } + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; + } + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); + } + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } +}; +__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); +var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; + +// src/node-http2-handler.ts +var _NodeHttp2Handler = class _NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + /** + * @returns the input if it is an HttpHandler of any class, + * or instantiates a new instance of this handler. + */ + static create(instanceOrOptions) { + if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new _NodeHttp2Handler(instanceOrOptions); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } + } + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a; + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }, "resolve"); + const reject = /* @__PURE__ */ __name(async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }, "reject"); + if (abortSignal == null ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = 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: (_a = this.config) == null ? void 0 : _a.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = /* @__PURE__ */ __name((err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }, "rejectWithDestroy"); + const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [import_http22.constants.HTTP2_HEADER_PATH]: path, + [import_http22.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new import_protocol_http.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + 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, requestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + /** + * Destroys a session. + * @param session The session to destroy. + */ + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } +}; +__name(_NodeHttp2Handler, "NodeHttp2Handler"); +var NodeHttp2Handler = _NodeHttp2Handler; + +// src/stream-collector/collector.ts -/***/ }), +var _Collector = class _Collector extends import_stream.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +}; +__name(_Collector, "Collector"); +var Collector = _Collector; -/***/ 46863: -/***/ ((__unused_webpack_module, exports) => { +// src/stream-collector/index.ts +var streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}), "streamCollector"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 14897: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3070: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Field: () => Field, + Fields: () => Fields, + HttpRequest: () => HttpRequest, + HttpResponse: () => HttpResponse, + getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, + isValidHostname: () => isValidHostname, + resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); +// src/extensions/httpExtensionConfiguration.ts +var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + } + }; +}, "getHttpHandlerExtensionConfiguration"); +var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; +}, "resolveHttpHandlerRuntimeConfig"); + +// src/Field.ts +var import_types = __nccwpck_require__(999); +var _Field = class _Field { + constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + /** + * Appends a value to the field. + * + * @param value The value to append. + */ + add(value) { + this.values.push(value); + } + /** + * Overwrite existing field values. + * + * @param values The new field values. + */ + set(values) { + this.values = values; + } + /** + * Remove all matching entries from list. + * + * @param value Value to remove. + */ + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + /** + * Get comma-delimited string. + * + * @returns String representation of {@link Field}. + */ + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + /** + * Get string values as a list + * + * @returns Values in {@link Field} as a list. + */ + get() { + return this.values; + } +}; +__name(_Field, "Field"); +var Field = _Field; +// src/Fields.ts +var _Fields = class _Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + /** + * Set entry for a {@link Field} name. The `name` + * attribute will be used to key the collection. + * + * @param field The {@link Field} to set. + */ + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + /** + * Retrieve {@link Field} entry by name. + * + * @param name The name of the {@link Field} entry + * to retrieve + * @returns The {@link Field} if it exists. + */ + getField(name) { + return this.entries[name.toLowerCase()]; + } + /** + * Delete entry from collection. + * + * @param name Name of the entry to delete. + */ + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + /** + * Helper function for retrieving specific types of fields. + * Used to grab all headers or all trailers. + * + * @param kind {@link FieldPosition} of entries to retrieve. + * @returns The {@link Field} entries with the specified + * {@link FieldPosition}. + */ + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } +}; +__name(_Fields, "Fields"); +var Fields = _Fields; + +// src/httpRequest.ts +var _HttpRequest = class _HttpRequest { + 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 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() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +}; +__name(_HttpRequest, "HttpRequest"); +var HttpRequest = _HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +__name(cloneQuery, "cloneQuery"); -/***/ }), +// src/httpResponse.ts +var _HttpResponse = class _HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +}; +__name(_HttpResponse, "HttpResponse"); +var HttpResponse = _HttpResponse; -/***/ 87047: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/isValidHostname.ts +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +__name(isValidHostname, "isValidHostname"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(29491); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; /***/ }), -/***/ 29491: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; - +/***/ 1205: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 3225: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/index.ts +var src_exports = {}; +__export(src_exports, { + buildQueryString: () => buildQueryString +}); +module.exports = __toCommonJS(src_exports); +var import_util_uri_escape = __nccwpck_require__(3225); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, import_util_uri_escape.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; + } + parts.push(qsEntry); + } + } + return parts.join("&"); +} +__name(buildQueryString, "buildQueryString"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(29491), exports); -tslib_1.__exportStar(__nccwpck_require__(87047), exports); /***/ }), -/***/ 26174: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(60010); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; - - -/***/ }), +/***/ 999: +/***/ ((module) => { -/***/ 60010: -/***/ ((__unused_webpack_module, exports) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AlgorithmId: () => AlgorithmId, + EndpointURLScheme: () => EndpointURLScheme, + FieldPosition: () => FieldPosition, + HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, + HttpAuthLocation: () => HttpAuthLocation, + IniSectionType: () => IniSectionType, + RequestHandlerProtocol: () => RequestHandlerProtocol, + SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, + getDefaultClientConfiguration: () => getDefaultClientConfiguration, + resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig +}); +module.exports = __toCommonJS(src_exports); + +// src/auth/auth.ts +var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + return HttpAuthLocation2; +})(HttpAuthLocation || {}); + +// src/auth/HttpApiKeyAuth.ts +var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + return HttpApiKeyAuthLocation2; +})(HttpApiKeyAuthLocation || {}); + +// src/endpoint.ts +var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + return EndpointURLScheme2; +})(EndpointURLScheme || {}); + +// src/extensions/checksum.ts +var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + return AlgorithmId2; +})(AlgorithmId || {}); +var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => "sha256" /* SHA256 */, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => "md5" /* MD5 */, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; +}, "getChecksumConfiguration"); +var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}, "resolveChecksumRuntimeConfig"); -"use strict"; +// src/extensions/defaultClientConfiguration.ts +var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { + return { + ...getChecksumConfiguration(runtimeConfig) + }; +}, "getDefaultClientConfiguration"); +var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { + return { + ...resolveChecksumRuntimeConfig(config) + }; +}, "resolveDefaultRuntimeConfig"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; +// src/http.ts +var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + return FieldPosition2; +})(FieldPosition || {}); +// src/middleware.ts +var SMITHY_CONTEXT_KEY = "__smithy_context"; -/***/ }), +// src/profile.ts +var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + return IniSectionType2; +})(IniSectionType || {}); -/***/ 54197: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/transfer.ts +var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + return RequestHandlerProtocol2; +})(RequestHandlerProtocol || {}); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(60010), exports); -tslib_1.__exportStar(__nccwpck_require__(26174), exports); /***/ }), -/***/ 45917: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 3225: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromUtf8 = void 0; -const util_buffer_from_1 = __nccwpck_require__(31381); -const fromUtf8 = (input) => { - const buf = (0, util_buffer_from_1.fromString)(input, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; }; -exports.fromUtf8 = fromUtf8; - - -/***/ }), - -/***/ 41895: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(45917), exports); -tslib_1.__exportStar(__nccwpck_require__(95470), exports); -tslib_1.__exportStar(__nccwpck_require__(99960), exports); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + escapeUri: () => escapeUri, + escapeUriPath: () => escapeUriPath +}); +module.exports = __toCommonJS(src_exports); -/***/ }), +// src/escape-uri.ts +var escapeUri = /* @__PURE__ */ __name((uri) => ( + // AWS percent-encodes some extra non-standard characters in a URI + encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode) +), "escapeUri"); +var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); -/***/ 95470: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// src/escape-uri-path.ts +var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUint8Array = void 0; -const fromUtf8_1 = __nccwpck_require__(45917); -const toUint8Array = (data) => { - if (typeof data === "string") { - return (0, fromUtf8_1.fromUtf8)(data); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); - } - return new Uint8Array(data); -}; -exports.toUint8Array = toUint8Array; /***/ }), -/***/ 99960: +/***/ 6174: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = void 0; -const util_buffer_from_1 = __nccwpck_require__(31381); -const toUtf8 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); -exports.toUtf8 = toUtf8; +exports.escapeUriPath = void 0; +const escape_uri_1 = __nccwpck_require__(10); +const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); +exports.escapeUriPath = escapeUriPath; /***/ }), -/***/ 76991: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 10: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createWaiter = void 0; -const poller_1 = __nccwpck_require__(39033); -const utils_1 = __nccwpck_require__(26000); -const waiter_1 = __nccwpck_require__(79089); -const abortTimeout = async (abortSignal) => { - return new Promise((resolve) => { - abortSignal.onabort = () => resolve({ state: waiter_1.WaiterState.ABORTED }); - }); -}; -const createWaiter = async (options, input, acceptorChecks) => { - const params = { - ...waiter_1.waiterServiceDefaults, - ...options, - }; - (0, utils_1.validateWaiterOptions)(params); - const exitConditions = [(0, poller_1.runPolling)(params, input, acceptorChecks)]; - if (options.abortController) { - exitConditions.push(abortTimeout(options.abortController.signal)); - } - if (options.abortSignal) { - exitConditions.push(abortTimeout(options.abortSignal)); - } - return Promise.race(exitConditions); -}; -exports.createWaiter = createWaiter; +exports.escapeUri = void 0; +const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); +exports.escapeUri = escapeUri; +const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; /***/ }), -/***/ 78011: +/***/ 4197: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(76991), exports); -tslib_1.__exportStar(__nccwpck_require__(79089), exports); +tslib_1.__exportStar(__nccwpck_require__(10), exports); +tslib_1.__exportStar(__nccwpck_require__(6174), exports); /***/ }), -/***/ 39033: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 1895: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.runPolling = void 0; -const sleep_1 = __nccwpck_require__(62380); -const waiter_1 = __nccwpck_require__(79089); -const exponentialBackoffWithJitter = (minDelay, maxDelay, attemptCeiling, attempt) => { - if (attempt > attemptCeiling) - return maxDelay; - const delay = minDelay * 2 ** (attempt - 1); - return randomInRange(minDelay, delay); -}; -const randomInRange = (min, max) => min + Math.random() * (max - min); -const runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => { - var _a; - const { state, reason } = await acceptorChecks(client, input); - if (state !== waiter_1.WaiterState.RETRY) { - return { state, reason }; - } - let currentAttempt = 1; - const waitUntil = Date.now() + maxWaitTime * 1000; - const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; - while (true) { - if (((_a = abortController === null || abortController === void 0 ? void 0 : abortController.signal) === null || _a === void 0 ? void 0 : _a.aborted) || (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted)) { - return { state: waiter_1.WaiterState.ABORTED }; - } - const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt); - if (Date.now() + delay * 1000 > waitUntil) { - return { state: waiter_1.WaiterState.TIMEOUT }; - } - await (0, sleep_1.sleep)(delay); - const { state, reason } = await acceptorChecks(client, input); - if (state !== waiter_1.WaiterState.RETRY) { - return { state, reason }; - } - currentAttempt += 1; - } +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; }; -exports.runPolling = runPolling; - - -/***/ }), - -/***/ 26000: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4351); -tslib_1.__exportStar(__nccwpck_require__(62380), exports); -tslib_1.__exportStar(__nccwpck_require__(6594), exports); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// src/index.ts +var src_exports = {}; +__export(src_exports, { + fromUtf8: () => fromUtf8, + toUint8Array: () => toUint8Array, + toUtf8: () => toUtf8 +}); +module.exports = __toCommonJS(src_exports); + +// src/fromUtf8.ts +var import_util_buffer_from = __nccwpck_require__(1381); +var fromUtf8 = /* @__PURE__ */ __name((input) => { + const buf = (0, import_util_buffer_from.fromString)(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); +}, "fromUtf8"); + +// src/toUint8Array.ts +var toUint8Array = /* @__PURE__ */ __name((data) => { + if (typeof data === "string") { + return fromUtf8(data); + } + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data); +}, "toUint8Array"); -/***/ }), +// src/toUtf8.ts -/***/ 62380: -/***/ ((__unused_webpack_module, exports) => { +var toUtf8 = /* @__PURE__ */ __name((input) => (0, import_util_buffer_from.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"), "toUtf8"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sleep = void 0; -const sleep = (seconds) => { - return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); -}; -exports.sleep = sleep; /***/ }), -/***/ 6594: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 8011: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateWaiterOptions = void 0; -const validateWaiterOptions = (options) => { - if (options.maxWaitTime < 1) { - throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`); - } - else if (options.minDelay < 1) { - throw new Error(`WaiterConfiguration.minDelay must be greater than 0`); - } - else if (options.maxDelay < 1) { - throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`); - } - else if (options.maxWaitTime <= options.minDelay) { - throw new Error(`WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); - } - else if (options.maxDelay < options.minDelay) { - throw new Error(`WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); - } +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; }; -exports.validateWaiterOptions = validateWaiterOptions; - +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ }), +// src/index.ts +var src_exports = {}; +__export(src_exports, { + WaiterState: () => WaiterState, + checkExceptions: () => checkExceptions, + createWaiter: () => createWaiter, + waiterServiceDefaults: () => waiterServiceDefaults +}); +module.exports = __toCommonJS(src_exports); + +// src/utils/sleep.ts +var sleep = /* @__PURE__ */ __name((seconds) => { + return new Promise((resolve) => setTimeout(resolve, seconds * 1e3)); +}, "sleep"); + +// src/waiter.ts +var waiterServiceDefaults = { + minDelay: 2, + maxDelay: 120 +}; +var WaiterState = /* @__PURE__ */ ((WaiterState2) => { + WaiterState2["ABORTED"] = "ABORTED"; + WaiterState2["FAILURE"] = "FAILURE"; + WaiterState2["SUCCESS"] = "SUCCESS"; + WaiterState2["RETRY"] = "RETRY"; + WaiterState2["TIMEOUT"] = "TIMEOUT"; + return WaiterState2; +})(WaiterState || {}); +var checkExceptions = /* @__PURE__ */ __name((result) => { + if (result.state === "ABORTED" /* ABORTED */) { + const abortError = new Error( + `${JSON.stringify({ + ...result, + reason: "Request was aborted" + })}` + ); + abortError.name = "AbortError"; + throw abortError; + } else if (result.state === "TIMEOUT" /* TIMEOUT */) { + const timeoutError = new Error( + `${JSON.stringify({ + ...result, + reason: "Waiter has timed out" + })}` + ); + timeoutError.name = "TimeoutError"; + throw timeoutError; + } else if (result.state !== "SUCCESS" /* SUCCESS */) { + throw new Error(`${JSON.stringify({ result })}`); + } + return result; +}, "checkExceptions"); + +// src/poller.ts +var exponentialBackoffWithJitter = /* @__PURE__ */ __name((minDelay, maxDelay, attemptCeiling, attempt) => { + if (attempt > attemptCeiling) + return maxDelay; + const delay = minDelay * 2 ** (attempt - 1); + return randomInRange(minDelay, delay); +}, "exponentialBackoffWithJitter"); +var randomInRange = /* @__PURE__ */ __name((min, max) => min + Math.random() * (max - min), "randomInRange"); +var runPolling = /* @__PURE__ */ __name(async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => { + var _a; + const { state, reason } = await acceptorChecks(client, input); + if (state !== "RETRY" /* RETRY */) { + return { state, reason }; + } + let currentAttempt = 1; + const waitUntil = Date.now() + maxWaitTime * 1e3; + const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; + while (true) { + if (((_a = abortController == null ? void 0 : abortController.signal) == null ? void 0 : _a.aborted) || (abortSignal == null ? void 0 : abortSignal.aborted)) { + return { state: "ABORTED" /* ABORTED */ }; + } + const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt); + if (Date.now() + delay * 1e3 > waitUntil) { + return { state: "TIMEOUT" /* TIMEOUT */ }; + } + await sleep(delay); + const { state: state2, reason: reason2 } = await acceptorChecks(client, input); + if (state2 !== "RETRY" /* RETRY */) { + return { state: state2, reason: reason2 }; + } + currentAttempt += 1; + } +}, "runPolling"); + +// src/utils/validate.ts +var validateWaiterOptions = /* @__PURE__ */ __name((options) => { + if (options.maxWaitTime < 1) { + throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`); + } else if (options.minDelay < 1) { + throw new Error(`WaiterConfiguration.minDelay must be greater than 0`); + } else if (options.maxDelay < 1) { + throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`); + } else if (options.maxWaitTime <= options.minDelay) { + throw new Error( + `WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter` + ); + } else if (options.maxDelay < options.minDelay) { + throw new Error( + `WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter` + ); + } +}, "validateWaiterOptions"); -/***/ 79089: -/***/ ((__unused_webpack_module, exports) => { +// src/createWaiter.ts +var abortTimeout = /* @__PURE__ */ __name(async (abortSignal) => { + return new Promise((resolve) => { + abortSignal.onabort = () => resolve({ state: "ABORTED" /* ABORTED */ }); + }); +}, "abortTimeout"); +var createWaiter = /* @__PURE__ */ __name(async (options, input, acceptorChecks) => { + const params = { + ...waiterServiceDefaults, + ...options + }; + validateWaiterOptions(params); + const exitConditions = [runPolling(params, input, acceptorChecks)]; + if (options.abortController) { + exitConditions.push(abortTimeout(options.abortController.signal)); + } + if (options.abortSignal) { + exitConditions.push(abortTimeout(options.abortSignal)); + } + return Promise.race(exitConditions); +}, "createWaiter"); +// Annotate the CommonJS export names for ESM import in node: -"use strict"; +0 && (0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.checkExceptions = exports.WaiterState = exports.waiterServiceDefaults = void 0; -exports.waiterServiceDefaults = { - minDelay: 2, - maxDelay: 120, -}; -var WaiterState; -(function (WaiterState) { - WaiterState["ABORTED"] = "ABORTED"; - WaiterState["FAILURE"] = "FAILURE"; - WaiterState["SUCCESS"] = "SUCCESS"; - WaiterState["RETRY"] = "RETRY"; - WaiterState["TIMEOUT"] = "TIMEOUT"; -})(WaiterState = exports.WaiterState || (exports.WaiterState = {})); -const checkExceptions = (result) => { - if (result.state === WaiterState.ABORTED) { - const abortError = new Error(`${JSON.stringify({ - ...result, - reason: "Request was aborted", - })}`); - abortError.name = "AbortError"; - throw abortError; - } - else if (result.state === WaiterState.TIMEOUT) { - const timeoutError = new Error(`${JSON.stringify({ - ...result, - reason: "Waiter has timed out", - })}`); - timeoutError.name = "TimeoutError"; - throw timeoutError; - } - else if (result.state !== WaiterState.SUCCESS) { - throw new Error(`${JSON.stringify({ result })}`); - } - return result; -}; -exports.checkExceptions = checkExceptions; /***/ }), @@ -46377,8 +36547,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.req = exports.json = exports.toBuffer = void 0; -const http = __importStar(__nccwpck_require__(13685)); -const https = __importStar(__nccwpck_require__(95687)); +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); async function toBuffer(stream) { let length = 0; const chunks = []; @@ -46420,7 +36590,7 @@ exports.req = req; /***/ }), -/***/ 70694: +/***/ 694: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -46453,7 +36623,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Agent = void 0; -const http = __importStar(__nccwpck_require__(13685)); +const http = __importStar(__nccwpck_require__(3685)); __exportStar(__nccwpck_require__(8348), exports); const INTERNAL = Symbol('AgentBaseInternalState'); class Agent extends http.Agent { @@ -46539,7 +36709,7 @@ exports.Agent = Agent; /***/ }), -/***/ 28222: +/***/ 8222: /***/ ((module, exports, __nccwpck_require__) => { /* eslint-env browser */ @@ -46796,7 +36966,7 @@ function localstorage() { } } -module.exports = __nccwpck_require__(46243)(exports); +module.exports = __nccwpck_require__(6243)(exports); const {formatters} = module.exports; @@ -46815,7 +36985,7 @@ formatters.j = function (v) { /***/ }), -/***/ 46243: +/***/ 6243: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -46831,7 +37001,7 @@ function setup(env) { createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; - createDebug.humanize = __nccwpck_require__(80900); + createDebug.humanize = __nccwpck_require__(900); createDebug.destroy = destroy; Object.keys(env).forEach(key => { @@ -47096,7 +37266,7 @@ module.exports = setup; /***/ }), -/***/ 38237: +/***/ 8237: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** @@ -47105,23 +37275,23 @@ module.exports = setup; */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __nccwpck_require__(28222); + module.exports = __nccwpck_require__(8222); } else { - module.exports = __nccwpck_require__(35332); + module.exports = __nccwpck_require__(4874); } /***/ }), -/***/ 35332: +/***/ 4874: /***/ ((module, exports, __nccwpck_require__) => { /** * Module dependencies. */ -const tty = __nccwpck_require__(76224); -const util = __nccwpck_require__(73837); +const tty = __nccwpck_require__(6224); +const util = __nccwpck_require__(3837); /** * This is the Node.js implementation of `debug()`. @@ -47147,7 +37317,7 @@ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __nccwpck_require__(59318); + const supportsColor = __nccwpck_require__(9318); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ @@ -47355,7 +37525,7 @@ function init(debug) { } } -module.exports = __nccwpck_require__(46243)(exports); +module.exports = __nccwpck_require__(6243)(exports); const {formatters} = module.exports; @@ -47383,15 +37553,15 @@ formatters.O = function (v) { /***/ }), -/***/ 12603: +/***/ 2603: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const validator = __nccwpck_require__(61739); -const XMLParser = __nccwpck_require__(42380); -const XMLBuilder = __nccwpck_require__(80660); +const validator = __nccwpck_require__(1739); +const XMLParser = __nccwpck_require__(2380); +const XMLBuilder = __nccwpck_require__(660); module.exports = { XMLParser: XMLParser, @@ -47401,7 +37571,7 @@ module.exports = { /***/ }), -/***/ 38280: +/***/ 8280: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -47481,13 +37651,13 @@ exports.nameRegexp = nameRegexp; /***/ }), -/***/ 61739: +/***/ 1739: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(38280); +const util = __nccwpck_require__(8280); const defaultOptions = { allowBooleanAttributes: false, //A tag can have attributes without any value @@ -47912,13 +38082,13 @@ function getPositionFromMatch(match) { /***/ }), -/***/ 80660: +/***/ 660: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; //parse Empty Node as self closing node -const buildFromOrderedJs = __nccwpck_require__(72462); +const buildFromOrderedJs = __nccwpck_require__(2462); const defaultOptions = { attributeNamePrefix: '@_', @@ -48179,7 +38349,7 @@ module.exports = Builder; /***/ }), -/***/ 72462: +/***/ 2462: /***/ ((module) => { const EOL = "\n"; @@ -48320,7 +38490,7 @@ module.exports = toXml; /***/ 6072: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const util = __nccwpck_require__(38280); +const util = __nccwpck_require__(8280); //TODO: handle comments function readDocType(xmlData, i){ @@ -48476,7 +38646,7 @@ module.exports = readDocType; /***/ }), -/***/ 86993: +/***/ 6993: /***/ ((__unused_webpack_module, exports) => { @@ -48530,17 +38700,17 @@ exports.defaultOptions = defaultOptions; /***/ }), -/***/ 25832: +/***/ 5832: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; ///@ts-check -const util = __nccwpck_require__(38280); +const util = __nccwpck_require__(8280); const xmlNode = __nccwpck_require__(7462); const readDocType = __nccwpck_require__(6072); -const toNumber = __nccwpck_require__(14526); +const toNumber = __nccwpck_require__(4526); const regx = '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)' @@ -49126,13 +39296,13 @@ module.exports = OrderedObjParser; /***/ }), -/***/ 42380: +/***/ 2380: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { buildOptions} = __nccwpck_require__(86993); -const OrderedObjParser = __nccwpck_require__(25832); -const { prettify} = __nccwpck_require__(42882); -const validator = __nccwpck_require__(61739); +const { buildOptions} = __nccwpck_require__(6993); +const OrderedObjParser = __nccwpck_require__(5832); +const { prettify} = __nccwpck_require__(2882); +const validator = __nccwpck_require__(1739); class XMLParser{ @@ -49190,7 +39360,7 @@ module.exports = XMLParser; /***/ }), -/***/ 42882: +/***/ 2882: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -49343,7 +39513,7 @@ module.exports = XmlNode; /***/ }), -/***/ 31621: +/***/ 1621: /***/ ((module) => { "use strict"; @@ -49359,7 +39529,7 @@ module.exports = (flag, argv = process.argv) => { /***/ }), -/***/ 77219: +/***/ 7219: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -49392,11 +39562,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpsProxyAgent = void 0; -const net = __importStar(__nccwpck_require__(41808)); -const tls = __importStar(__nccwpck_require__(24404)); -const assert_1 = __importDefault(__nccwpck_require__(39491)); -const debug_1 = __importDefault(__nccwpck_require__(38237)); -const agent_base_1 = __nccwpck_require__(70694); +const net = __importStar(__nccwpck_require__(1808)); +const tls = __importStar(__nccwpck_require__(4404)); +const assert_1 = __importDefault(__nccwpck_require__(9491)); +const debug_1 = __importDefault(__nccwpck_require__(8237)); +const agent_base_1 = __nccwpck_require__(694); +const url_1 = __nccwpck_require__(7310); const parse_proxy_response_1 = __nccwpck_require__(595); const debug = (0, debug_1.default)('https-proxy-agent'); /** @@ -49415,7 +39586,7 @@ class HttpsProxyAgent extends agent_base_1.Agent { constructor(proxy, opts) { super(opts); this.options = { path: undefined }; - this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy; + this.proxy = typeof proxy === 'string' ? new url_1.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href); // Trim off the brackets from IPv6 addresses @@ -49449,7 +39620,7 @@ class HttpsProxyAgent extends agent_base_1.Agent { const servername = this.connectOpts.servername || this.connectOpts.host; socket = tls.connect({ ...this.connectOpts, - servername: servername && net.isIP(servername) ? undefined : servername + servername: servername && net.isIP(servername) ? undefined : servername, }); } else { @@ -49550,7 +39721,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.parseProxyResponse = void 0; -const debug_1 = __importDefault(__nccwpck_require__(38237)); +const debug_1 = __importDefault(__nccwpck_require__(8237)); const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response'); function parseProxyResponse(socket) { return new Promise((resolve, reject) => { @@ -49648,7 +39819,7 @@ exports.parseProxyResponse = parseProxyResponse; /***/ }), -/***/ 80900: +/***/ 900: /***/ ((module) => { /** @@ -49817,7 +39988,7 @@ function plural(ms, msAbs, n, name) { /***/ }), -/***/ 14526: +/***/ 4526: /***/ ((module) => { const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; @@ -49948,14 +40119,14 @@ module.exports = toNumber /***/ }), -/***/ 59318: +/***/ 9318: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __nccwpck_require__(22037); -const tty = __nccwpck_require__(76224); -const hasFlag = __nccwpck_require__(31621); +const os = __nccwpck_require__(2037); +const tty = __nccwpck_require__(6224); +const hasFlag = __nccwpck_require__(1621); const {env} = process; @@ -50468,27 +40639,27 @@ var __createBinding; /***/ }), -/***/ 74294: +/***/ 4294: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(54219); +module.exports = __nccwpck_require__(4219); /***/ }), -/***/ 54219: +/***/ 4219: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var net = __nccwpck_require__(41808); -var tls = __nccwpck_require__(24404); -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var events = __nccwpck_require__(82361); -var assert = __nccwpck_require__(39491); -var util = __nccwpck_require__(73837); +var net = __nccwpck_require__(1808); +var tls = __nccwpck_require__(4404); +var http = __nccwpck_require__(3685); +var https = __nccwpck_require__(5687); +var events = __nccwpck_require__(2361); +var assert = __nccwpck_require__(9491); +var util = __nccwpck_require__(3837); exports.httpOverHttp = httpOverHttp; @@ -50748,7 +40919,7 @@ exports.debug = debug; // for test /***/ }), -/***/ 75840: +/***/ 5840: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -50812,23 +40983,23 @@ Object.defineProperty(exports, "parse", ({ } })); -var _v = _interopRequireDefault(__nccwpck_require__(78628)); +var _v = _interopRequireDefault(__nccwpck_require__(8628)); -var _v2 = _interopRequireDefault(__nccwpck_require__(86409)); +var _v2 = _interopRequireDefault(__nccwpck_require__(6409)); -var _v3 = _interopRequireDefault(__nccwpck_require__(85122)); +var _v3 = _interopRequireDefault(__nccwpck_require__(5122)); -var _v4 = _interopRequireDefault(__nccwpck_require__(79120)); +var _v4 = _interopRequireDefault(__nccwpck_require__(9120)); -var _nil = _interopRequireDefault(__nccwpck_require__(25332)); +var _nil = _interopRequireDefault(__nccwpck_require__(5332)); -var _version = _interopRequireDefault(__nccwpck_require__(81595)); +var _version = _interopRequireDefault(__nccwpck_require__(1595)); -var _validate = _interopRequireDefault(__nccwpck_require__(66900)); +var _validate = _interopRequireDefault(__nccwpck_require__(6900)); -var _stringify = _interopRequireDefault(__nccwpck_require__(18950)); +var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); -var _parse = _interopRequireDefault(__nccwpck_require__(62746)); +var _parse = _interopRequireDefault(__nccwpck_require__(2746)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -50864,7 +41035,7 @@ exports["default"] = _default; /***/ }), -/***/ 25332: +/***/ 5332: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -50879,7 +41050,7 @@ exports["default"] = _default; /***/ }), -/***/ 62746: +/***/ 2746: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -50890,7 +41061,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(66900)); +var _validate = _interopRequireDefault(__nccwpck_require__(6900)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -50931,7 +41102,7 @@ exports["default"] = _default; /***/ }), -/***/ 40814: +/***/ 814: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -50946,7 +41117,7 @@ exports["default"] = _default; /***/ }), -/***/ 50807: +/***/ 807: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -50977,7 +41148,7 @@ function rng() { /***/ }), -/***/ 85274: +/***/ 5274: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51007,7 +41178,7 @@ exports["default"] = _default; /***/ }), -/***/ 18950: +/***/ 8950: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51018,7 +41189,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(66900)); +var _validate = _interopRequireDefault(__nccwpck_require__(6900)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51053,7 +41224,7 @@ exports["default"] = _default; /***/ }), -/***/ 78628: +/***/ 8628: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51064,9 +41235,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(50807)); +var _rng = _interopRequireDefault(__nccwpck_require__(807)); -var _stringify = _interopRequireDefault(__nccwpck_require__(18950)); +var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51167,7 +41338,7 @@ exports["default"] = _default; /***/ }), -/***/ 86409: +/***/ 6409: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51178,7 +41349,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(65998)); +var _v = _interopRequireDefault(__nccwpck_require__(5998)); var _md = _interopRequireDefault(__nccwpck_require__(4569)); @@ -51190,7 +41361,7 @@ exports["default"] = _default; /***/ }), -/***/ 65998: +/***/ 5998: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51202,9 +41373,9 @@ Object.defineProperty(exports, "__esModule", ({ exports["default"] = _default; exports.URL = exports.DNS = void 0; -var _stringify = _interopRequireDefault(__nccwpck_require__(18950)); +var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); -var _parse = _interopRequireDefault(__nccwpck_require__(62746)); +var _parse = _interopRequireDefault(__nccwpck_require__(2746)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51275,7 +41446,7 @@ function _default(name, version, hashfunc) { /***/ }), -/***/ 85122: +/***/ 5122: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51286,9 +41457,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(50807)); +var _rng = _interopRequireDefault(__nccwpck_require__(807)); -var _stringify = _interopRequireDefault(__nccwpck_require__(18950)); +var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51319,7 +41490,7 @@ exports["default"] = _default; /***/ }), -/***/ 79120: +/***/ 9120: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51330,9 +41501,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(65998)); +var _v = _interopRequireDefault(__nccwpck_require__(5998)); -var _sha = _interopRequireDefault(__nccwpck_require__(85274)); +var _sha = _interopRequireDefault(__nccwpck_require__(5274)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51342,7 +41513,7 @@ exports["default"] = _default; /***/ }), -/***/ 66900: +/***/ 6900: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51353,7 +41524,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _regex = _interopRequireDefault(__nccwpck_require__(40814)); +var _regex = _interopRequireDefault(__nccwpck_require__(814)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51366,7 +41537,7 @@ exports["default"] = _default; /***/ }), -/***/ 81595: +/***/ 1595: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -51377,7 +41548,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(66900)); +var _validate = _interopRequireDefault(__nccwpck_require__(6900)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51394,15 +41565,7 @@ exports["default"] = _default; /***/ }), -/***/ 87578: -/***/ ((module) => { - -module.exports = eval("require")("aws-crt"); - - -/***/ }), - -/***/ 39491: +/***/ 9491: /***/ ((module) => { "use strict"; @@ -51410,7 +41573,7 @@ module.exports = require("assert"); /***/ }), -/***/ 14300: +/***/ 4300: /***/ ((module) => { "use strict"; @@ -51418,7 +41581,7 @@ module.exports = require("buffer"); /***/ }), -/***/ 32081: +/***/ 2081: /***/ ((module) => { "use strict"; @@ -51434,7 +41597,7 @@ module.exports = require("crypto"); /***/ }), -/***/ 82361: +/***/ 2361: /***/ ((module) => { "use strict"; @@ -51442,7 +41605,7 @@ module.exports = require("events"); /***/ }), -/***/ 57147: +/***/ 7147: /***/ ((module) => { "use strict"; @@ -51450,7 +41613,15 @@ module.exports = require("fs"); /***/ }), -/***/ 13685: +/***/ 3292: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs/promises"); + +/***/ }), + +/***/ 3685: /***/ ((module) => { "use strict"; @@ -51458,7 +41629,7 @@ module.exports = require("http"); /***/ }), -/***/ 85158: +/***/ 5158: /***/ ((module) => { "use strict"; @@ -51466,7 +41637,7 @@ module.exports = require("http2"); /***/ }), -/***/ 95687: +/***/ 5687: /***/ ((module) => { "use strict"; @@ -51474,7 +41645,7 @@ module.exports = require("https"); /***/ }), -/***/ 41808: +/***/ 1808: /***/ ((module) => { "use strict"; @@ -51482,7 +41653,7 @@ module.exports = require("net"); /***/ }), -/***/ 22037: +/***/ 2037: /***/ ((module) => { "use strict"; @@ -51490,7 +41661,7 @@ module.exports = require("os"); /***/ }), -/***/ 71017: +/***/ 1017: /***/ ((module) => { "use strict"; @@ -51498,7 +41669,7 @@ module.exports = require("path"); /***/ }), -/***/ 77282: +/***/ 7282: /***/ ((module) => { "use strict"; @@ -51506,7 +41677,7 @@ module.exports = require("process"); /***/ }), -/***/ 12781: +/***/ 2781: /***/ ((module) => { "use strict"; @@ -51514,7 +41685,7 @@ module.exports = require("stream"); /***/ }), -/***/ 71576: +/***/ 1576: /***/ ((module) => { "use strict"; @@ -51522,7 +41693,7 @@ module.exports = require("string_decoder"); /***/ }), -/***/ 39512: +/***/ 9512: /***/ ((module) => { "use strict"; @@ -51530,7 +41701,7 @@ module.exports = require("timers"); /***/ }), -/***/ 24404: +/***/ 4404: /***/ ((module) => { "use strict"; @@ -51538,7 +41709,7 @@ module.exports = require("tls"); /***/ }), -/***/ 76224: +/***/ 6224: /***/ ((module) => { "use strict"; @@ -51546,7 +41717,7 @@ module.exports = require("tty"); /***/ }), -/***/ 57310: +/***/ 7310: /***/ ((module) => { "use strict"; @@ -51554,7 +41725,7 @@ module.exports = require("url"); /***/ }), -/***/ 73837: +/***/ 3837: /***/ ((module) => { "use strict"; @@ -51562,11 +41733,11 @@ module.exports = require("util"); /***/ }), -/***/ 9634: +/***/ 5929: /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"@aws-sdk/client-ecr-public","description":"AWS SDK for JavaScript Ecr Public Client for Node.js, Browser and React Native","version":"3.418.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","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 ecr-public"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.418.0","@aws-sdk/credential-provider-node":"3.418.0","@aws-sdk/middleware-host-header":"3.418.0","@aws-sdk/middleware-logger":"3.418.0","@aws-sdk/middleware-recursion-detection":"3.418.0","@aws-sdk/middleware-signing":"3.418.0","@aws-sdk/middleware-user-agent":"3.418.0","@aws-sdk/region-config-resolver":"3.418.0","@aws-sdk/types":"3.418.0","@aws-sdk/util-endpoints":"3.418.0","@aws-sdk/util-user-agent-browser":"3.418.0","@aws-sdk/util-user-agent-node":"3.418.0","@smithy/config-resolver":"^2.0.10","@smithy/fetch-http-handler":"^2.1.5","@smithy/hash-node":"^2.0.9","@smithy/invalid-dependency":"^2.0.9","@smithy/middleware-content-length":"^2.0.11","@smithy/middleware-endpoint":"^2.0.9","@smithy/middleware-retry":"^2.0.12","@smithy/middleware-serde":"^2.0.9","@smithy/middleware-stack":"^2.0.2","@smithy/node-config-provider":"^2.0.12","@smithy/node-http-handler":"^2.1.5","@smithy/protocol-http":"^3.0.5","@smithy/smithy-client":"^2.1.6","@smithy/types":"^2.3.3","@smithy/url-parser":"^2.0.9","@smithy/util-base64":"^2.0.0","@smithy/util-body-length-browser":"^2.0.0","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.10","@smithy/util-defaults-mode-node":"^2.0.12","@smithy/util-retry":"^2.0.2","@smithy/util-utf8":"^2.0.0","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typedoc":"0.23.23","typescript":"~4.9.5"},"engines":{"node":">=14.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-ecr-public","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-ecr-public"}}'); +module.exports = JSON.parse('{"name":"@aws-sdk/client-ecr-public","description":"AWS SDK for JavaScript Ecr Public Client for Node.js, Browser and React Native","version":"3.523.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-ecr-public","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 ecr-public"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.523.0","@aws-sdk/core":"3.523.0","@aws-sdk/credential-provider-node":"3.523.0","@aws-sdk/middleware-host-header":"3.523.0","@aws-sdk/middleware-logger":"3.523.0","@aws-sdk/middleware-recursion-detection":"3.523.0","@aws-sdk/middleware-user-agent":"3.523.0","@aws-sdk/region-config-resolver":"3.523.0","@aws-sdk/types":"3.523.0","@aws-sdk/util-endpoints":"3.523.0","@aws-sdk/util-user-agent-browser":"3.523.0","@aws-sdk/util-user-agent-node":"3.523.0","@smithy/config-resolver":"^2.1.3","@smithy/core":"^1.3.4","@smithy/fetch-http-handler":"^2.4.3","@smithy/hash-node":"^2.1.3","@smithy/invalid-dependency":"^2.1.3","@smithy/middleware-content-length":"^2.1.3","@smithy/middleware-endpoint":"^2.4.3","@smithy/middleware-retry":"^2.1.3","@smithy/middleware-serde":"^2.1.3","@smithy/middleware-stack":"^2.1.3","@smithy/node-config-provider":"^2.2.3","@smithy/node-http-handler":"^2.4.1","@smithy/protocol-http":"^3.2.1","@smithy/smithy-client":"^2.4.1","@smithy/types":"^2.10.1","@smithy/url-parser":"^2.1.3","@smithy/util-base64":"^2.1.1","@smithy/util-body-length-browser":"^2.1.1","@smithy/util-body-length-node":"^2.2.1","@smithy/util-defaults-mode-browser":"^2.1.3","@smithy/util-defaults-mode-node":"^2.2.2","@smithy/util-endpoints":"^1.1.3","@smithy/util-middleware":"^2.1.3","@smithy/util-retry":"^2.1.3","@smithy/util-utf8":"^2.1.1","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.1.1","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.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-ecr-public","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-ecr-public"}}'); /***/ }), @@ -51574,31 +41745,31 @@ module.exports = JSON.parse('{"name":"@aws-sdk/client-ecr-public","description": /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"@aws-sdk/client-ecr","description":"AWS SDK for JavaScript Ecr Client for Node.js, Browser and React Native","version":"3.418.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","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 ecr"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.418.0","@aws-sdk/credential-provider-node":"3.418.0","@aws-sdk/middleware-host-header":"3.418.0","@aws-sdk/middleware-logger":"3.418.0","@aws-sdk/middleware-recursion-detection":"3.418.0","@aws-sdk/middleware-signing":"3.418.0","@aws-sdk/middleware-user-agent":"3.418.0","@aws-sdk/region-config-resolver":"3.418.0","@aws-sdk/types":"3.418.0","@aws-sdk/util-endpoints":"3.418.0","@aws-sdk/util-user-agent-browser":"3.418.0","@aws-sdk/util-user-agent-node":"3.418.0","@smithy/config-resolver":"^2.0.10","@smithy/fetch-http-handler":"^2.1.5","@smithy/hash-node":"^2.0.9","@smithy/invalid-dependency":"^2.0.9","@smithy/middleware-content-length":"^2.0.11","@smithy/middleware-endpoint":"^2.0.9","@smithy/middleware-retry":"^2.0.12","@smithy/middleware-serde":"^2.0.9","@smithy/middleware-stack":"^2.0.2","@smithy/node-config-provider":"^2.0.12","@smithy/node-http-handler":"^2.1.5","@smithy/protocol-http":"^3.0.5","@smithy/smithy-client":"^2.1.6","@smithy/types":"^2.3.3","@smithy/url-parser":"^2.0.9","@smithy/util-base64":"^2.0.0","@smithy/util-body-length-browser":"^2.0.0","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.10","@smithy/util-defaults-mode-node":"^2.0.12","@smithy/util-retry":"^2.0.2","@smithy/util-utf8":"^2.0.0","@smithy/util-waiter":"^2.0.9","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typedoc":"0.23.23","typescript":"~4.9.5"},"engines":{"node":">=14.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-ecr","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-ecr"}}'); +module.exports = JSON.parse('{"name":"@aws-sdk/client-ecr","description":"AWS SDK for JavaScript Ecr Client for Node.js, Browser and React Native","version":"3.523.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-ecr","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 ecr"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.523.0","@aws-sdk/core":"3.523.0","@aws-sdk/credential-provider-node":"3.523.0","@aws-sdk/middleware-host-header":"3.523.0","@aws-sdk/middleware-logger":"3.523.0","@aws-sdk/middleware-recursion-detection":"3.523.0","@aws-sdk/middleware-user-agent":"3.523.0","@aws-sdk/region-config-resolver":"3.523.0","@aws-sdk/types":"3.523.0","@aws-sdk/util-endpoints":"3.523.0","@aws-sdk/util-user-agent-browser":"3.523.0","@aws-sdk/util-user-agent-node":"3.523.0","@smithy/config-resolver":"^2.1.3","@smithy/core":"^1.3.4","@smithy/fetch-http-handler":"^2.4.3","@smithy/hash-node":"^2.1.3","@smithy/invalid-dependency":"^2.1.3","@smithy/middleware-content-length":"^2.1.3","@smithy/middleware-endpoint":"^2.4.3","@smithy/middleware-retry":"^2.1.3","@smithy/middleware-serde":"^2.1.3","@smithy/middleware-stack":"^2.1.3","@smithy/node-config-provider":"^2.2.3","@smithy/node-http-handler":"^2.4.1","@smithy/protocol-http":"^3.2.1","@smithy/smithy-client":"^2.4.1","@smithy/types":"^2.10.1","@smithy/url-parser":"^2.1.3","@smithy/util-base64":"^2.1.1","@smithy/util-body-length-browser":"^2.1.1","@smithy/util-body-length-node":"^2.2.1","@smithy/util-defaults-mode-browser":"^2.1.3","@smithy/util-defaults-mode-node":"^2.2.2","@smithy/util-endpoints":"^1.1.3","@smithy/util-middleware":"^2.1.3","@smithy/util-retry":"^2.1.3","@smithy/util-utf8":"^2.1.1","@smithy/util-waiter":"^2.1.3","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.1.1","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.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-ecr","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-ecr"}}'); /***/ }), -/***/ 91092: +/***/ 9722: /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"@aws-sdk/client-sso","description":"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native","version":"3.418.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","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":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/middleware-host-header":"3.418.0","@aws-sdk/middleware-logger":"3.418.0","@aws-sdk/middleware-recursion-detection":"3.418.0","@aws-sdk/middleware-user-agent":"3.418.0","@aws-sdk/region-config-resolver":"3.418.0","@aws-sdk/types":"3.418.0","@aws-sdk/util-endpoints":"3.418.0","@aws-sdk/util-user-agent-browser":"3.418.0","@aws-sdk/util-user-agent-node":"3.418.0","@smithy/config-resolver":"^2.0.10","@smithy/fetch-http-handler":"^2.1.5","@smithy/hash-node":"^2.0.9","@smithy/invalid-dependency":"^2.0.9","@smithy/middleware-content-length":"^2.0.11","@smithy/middleware-endpoint":"^2.0.9","@smithy/middleware-retry":"^2.0.12","@smithy/middleware-serde":"^2.0.9","@smithy/middleware-stack":"^2.0.2","@smithy/node-config-provider":"^2.0.12","@smithy/node-http-handler":"^2.1.5","@smithy/protocol-http":"^3.0.5","@smithy/smithy-client":"^2.1.6","@smithy/types":"^2.3.3","@smithy/url-parser":"^2.0.9","@smithy/util-base64":"^2.0.0","@smithy/util-body-length-browser":"^2.0.0","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.10","@smithy/util-defaults-mode-node":"^2.0.12","@smithy/util-retry":"^2.0.2","@smithy/util-utf8":"^2.0.0","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typedoc":"0.23.23","typescript":"~4.9.5"},"engines":{"node":">=14.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"}}'); +module.exports = JSON.parse('{"name":"@aws-sdk/client-sso-oidc","description":"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native","version":"3.523.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-sso-oidc","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-oidc"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.523.0","@aws-sdk/core":"3.523.0","@aws-sdk/middleware-host-header":"3.523.0","@aws-sdk/middleware-logger":"3.523.0","@aws-sdk/middleware-recursion-detection":"3.523.0","@aws-sdk/middleware-user-agent":"3.523.0","@aws-sdk/region-config-resolver":"3.523.0","@aws-sdk/types":"3.523.0","@aws-sdk/util-endpoints":"3.523.0","@aws-sdk/util-user-agent-browser":"3.523.0","@aws-sdk/util-user-agent-node":"3.523.0","@smithy/config-resolver":"^2.1.3","@smithy/core":"^1.3.4","@smithy/fetch-http-handler":"^2.4.3","@smithy/hash-node":"^2.1.3","@smithy/invalid-dependency":"^2.1.3","@smithy/middleware-content-length":"^2.1.3","@smithy/middleware-endpoint":"^2.4.3","@smithy/middleware-retry":"^2.1.3","@smithy/middleware-serde":"^2.1.3","@smithy/middleware-stack":"^2.1.3","@smithy/node-config-provider":"^2.2.3","@smithy/node-http-handler":"^2.4.1","@smithy/protocol-http":"^3.2.1","@smithy/smithy-client":"^2.4.1","@smithy/types":"^2.10.1","@smithy/url-parser":"^2.1.3","@smithy/util-base64":"^2.1.1","@smithy/util-body-length-browser":"^2.1.1","@smithy/util-body-length-node":"^2.2.1","@smithy/util-defaults-mode-browser":"^2.1.3","@smithy/util-defaults-mode-node":"^2.2.2","@smithy/util-endpoints":"^1.1.3","@smithy/util-middleware":"^2.1.3","@smithy/util-retry":"^2.1.3","@smithy/util-utf8":"^2.1.1","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.1.1","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.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","peerDependencies":{"@aws-sdk/credential-provider-node":"^3.523.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-oidc","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sso-oidc"}}'); /***/ }), -/***/ 7947: +/***/ 1092: /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"@aws-sdk/client-sts","description":"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native","version":"3.418.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","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 sts","test":"yarn test:unit","test:unit":"jest"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/credential-provider-node":"3.418.0","@aws-sdk/middleware-host-header":"3.418.0","@aws-sdk/middleware-logger":"3.418.0","@aws-sdk/middleware-recursion-detection":"3.418.0","@aws-sdk/middleware-sdk-sts":"3.418.0","@aws-sdk/middleware-signing":"3.418.0","@aws-sdk/middleware-user-agent":"3.418.0","@aws-sdk/region-config-resolver":"3.418.0","@aws-sdk/types":"3.418.0","@aws-sdk/util-endpoints":"3.418.0","@aws-sdk/util-user-agent-browser":"3.418.0","@aws-sdk/util-user-agent-node":"3.418.0","@smithy/config-resolver":"^2.0.10","@smithy/fetch-http-handler":"^2.1.5","@smithy/hash-node":"^2.0.9","@smithy/invalid-dependency":"^2.0.9","@smithy/middleware-content-length":"^2.0.11","@smithy/middleware-endpoint":"^2.0.9","@smithy/middleware-retry":"^2.0.12","@smithy/middleware-serde":"^2.0.9","@smithy/middleware-stack":"^2.0.2","@smithy/node-config-provider":"^2.0.12","@smithy/node-http-handler":"^2.1.5","@smithy/protocol-http":"^3.0.5","@smithy/smithy-client":"^2.1.6","@smithy/types":"^2.3.3","@smithy/url-parser":"^2.0.9","@smithy/util-base64":"^2.0.0","@smithy/util-body-length-browser":"^2.0.0","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.10","@smithy/util-defaults-mode-node":"^2.0.12","@smithy/util-retry":"^2.0.2","@smithy/util-utf8":"^2.0.0","fast-xml-parser":"4.2.5","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typedoc":"0.23.23","typescript":"~4.9.5"},"engines":{"node":">=14.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-sts","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sts"}}'); +module.exports = JSON.parse('{"name":"@aws-sdk/client-sso","description":"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native","version":"3.523.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":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/core":"3.523.0","@aws-sdk/middleware-host-header":"3.523.0","@aws-sdk/middleware-logger":"3.523.0","@aws-sdk/middleware-recursion-detection":"3.523.0","@aws-sdk/middleware-user-agent":"3.523.0","@aws-sdk/region-config-resolver":"3.523.0","@aws-sdk/types":"3.523.0","@aws-sdk/util-endpoints":"3.523.0","@aws-sdk/util-user-agent-browser":"3.523.0","@aws-sdk/util-user-agent-node":"3.523.0","@smithy/config-resolver":"^2.1.3","@smithy/core":"^1.3.4","@smithy/fetch-http-handler":"^2.4.3","@smithy/hash-node":"^2.1.3","@smithy/invalid-dependency":"^2.1.3","@smithy/middleware-content-length":"^2.1.3","@smithy/middleware-endpoint":"^2.4.3","@smithy/middleware-retry":"^2.1.3","@smithy/middleware-serde":"^2.1.3","@smithy/middleware-stack":"^2.1.3","@smithy/node-config-provider":"^2.2.3","@smithy/node-http-handler":"^2.4.1","@smithy/protocol-http":"^3.2.1","@smithy/smithy-client":"^2.4.1","@smithy/types":"^2.10.1","@smithy/url-parser":"^2.1.3","@smithy/util-base64":"^2.1.1","@smithy/util-body-length-browser":"^2.1.1","@smithy/util-body-length-node":"^2.2.1","@smithy/util-defaults-mode-browser":"^2.1.3","@smithy/util-defaults-mode-node":"^2.2.2","@smithy/util-endpoints":"^1.1.3","@smithy/util-middleware":"^2.1.3","@smithy/util-retry":"^2.1.3","@smithy/util-utf8":"^2.1.1","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.1.1","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.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"}}'); /***/ }), -/***/ 95367: +/***/ 7947: /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"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)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"af-south-1":{"description":"Africa (Cape Town)"},"ap-east-1":{"description":"Asia Pacific (Hong Kong)"},"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)"},"aws-global":{"description":"AWS Standard global region"},"ca-central-1":{"description":"Canada (Central)"},"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)"},"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 China global region"},"cn-north-1":{"description":"China (Beijing)"},"cn-northwest-1":{"description":"China (Ningxia)"}}},{"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 GovCloud (US) global region"},"us-gov-east-1":{"description":"AWS GovCloud (US-East)"},"us-gov-west-1":{"description":"AWS GovCloud (US-West)"}}},{"id":"aws-iso","outputs":{"dnsSuffix":"c2s.ic.gov","dualStackDnsSuffix":"c2s.ic.gov","implicitGlobalRegion":"us-iso-east-1","name":"aws-iso","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-global":{"description":"AWS ISO (US) 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":"sc2s.sgov.gov","implicitGlobalRegion":"us-isob-east-1","name":"aws-iso-b","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-b-global":{"description":"AWS ISOB (US) global region"},"us-isob-east-1":{"description":"US ISOB East (Ohio)"}}},{"id":"aws-iso-e","outputs":{"dnsSuffix":"cloud.adc-e.uk","dualStackDnsSuffix":"cloud.adc-e.uk","implicitGlobalRegion":"eu-isoe-west-1","name":"aws-iso-e","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$","regions":{}},{"id":"aws-iso-f","outputs":{"dnsSuffix":"csp.hci.ic.gov","dualStackDnsSuffix":"csp.hci.ic.gov","implicitGlobalRegion":"us-isof-south-1","name":"aws-iso-f","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$","regions":{}}],"version":"1.1"}'); +module.exports = JSON.parse('{"name":"@aws-sdk/client-sts","description":"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native","version":"3.523.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && 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 sts","test":"yarn test:unit","test:unit":"jest"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/core":"3.523.0","@aws-sdk/middleware-host-header":"3.523.0","@aws-sdk/middleware-logger":"3.523.0","@aws-sdk/middleware-recursion-detection":"3.523.0","@aws-sdk/middleware-user-agent":"3.523.0","@aws-sdk/region-config-resolver":"3.523.0","@aws-sdk/types":"3.523.0","@aws-sdk/util-endpoints":"3.523.0","@aws-sdk/util-user-agent-browser":"3.523.0","@aws-sdk/util-user-agent-node":"3.523.0","@smithy/config-resolver":"^2.1.3","@smithy/core":"^1.3.4","@smithy/fetch-http-handler":"^2.4.3","@smithy/hash-node":"^2.1.3","@smithy/invalid-dependency":"^2.1.3","@smithy/middleware-content-length":"^2.1.3","@smithy/middleware-endpoint":"^2.4.3","@smithy/middleware-retry":"^2.1.3","@smithy/middleware-serde":"^2.1.3","@smithy/middleware-stack":"^2.1.3","@smithy/node-config-provider":"^2.2.3","@smithy/node-http-handler":"^2.4.1","@smithy/protocol-http":"^3.2.1","@smithy/smithy-client":"^2.4.1","@smithy/types":"^2.10.1","@smithy/url-parser":"^2.1.3","@smithy/util-base64":"^2.1.1","@smithy/util-body-length-browser":"^2.1.1","@smithy/util-body-length-node":"^2.2.1","@smithy/util-defaults-mode-browser":"^2.1.3","@smithy/util-defaults-mode-node":"^2.2.2","@smithy/util-endpoints":"^1.1.3","@smithy/util-middleware":"^2.1.3","@smithy/util-retry":"^2.1.3","@smithy/util-utf8":"^2.1.1","fast-xml-parser":"4.2.5","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.1.1","@tsconfig/node14":"1.0.3","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.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","peerDependencies":{"@aws-sdk/credential-provider-node":"^3.523.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-sts","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sts"}}'); /***/ }) @@ -51644,7 +41815,7 @@ module.exports = JSON.parse('{"partitions":[{"id":"aws","outputs":{"dnsSuffix":" /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __nccwpck_require__(32932); +/******/ var __webpack_exports__ = __nccwpck_require__(2932); /******/ module.exports = __webpack_exports__; /******/ /******/ })()