@rharkor/caching-for-turbo 2.3.13 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"998.index.js","mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":[".././node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js",".././node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/auth/httpAuthSchemeProvider.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/endpointResolver.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/ruleset.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/SSOServiceException.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/errors.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.shared.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/schemas/schemas_0.js",".././node_modules/@aws-sdk/token-providers/dist-cjs/index.js"],"sourcesContent":["'use strict';\n\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar client = require('@aws-sdk/core/client');\nvar tokenProviders = require('@aws-sdk/token-providers');\n\nconst isSsoProfile = (arg) => arg &&\n (typeof arg.sso_start_url === \"string\" ||\n typeof arg.sso_account_id === \"string\" ||\n typeof arg.sso_session === \"string\" ||\n typeof arg.sso_region === \"string\" ||\n typeof arg.sso_role_name === \"string\");\n\nconst SHOULD_FAIL_CREDENTIAL_CHAIN = false;\nconst resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger, }) => {\n let token;\n const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;\n if (ssoSession) {\n try {\n const _token = await tokenProviders.fromSso({\n profile,\n filepath,\n configFilepath,\n ignoreCache,\n })();\n token = {\n accessToken: _token.token,\n expiresAt: new Date(_token.expiration).toISOString(),\n };\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(e.message, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n }\n else {\n try {\n token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl);\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n }\n if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {\n throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const { accessToken } = token;\n const { SSOClient, GetRoleCredentialsCommand } = await Promise.resolve().then(function () { return require('./loadSso-BKDNrsal.js'); });\n const sso = ssoClient ||\n new SSOClient(Object.assign({}, clientConfig ?? {}, {\n logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,\n region: clientConfig?.region ?? ssoRegion,\n userAgentAppId: clientConfig?.userAgentAppId ?? callerClientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId,\n }));\n let ssoResp;\n try {\n ssoResp = await sso.send(new GetRoleCredentialsCommand({\n accountId: ssoAccountId,\n roleName: ssoRoleName,\n accessToken,\n }));\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(e, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}, } = ssoResp;\n if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {\n throw new propertyProvider.CredentialsProviderError(\"SSO returns an invalid temporary credential.\", {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const credentials = {\n accessKeyId,\n secretAccessKey,\n sessionToken,\n expiration: new Date(expiration),\n ...(credentialScope && { credentialScope }),\n ...(accountId && { accountId }),\n };\n if (ssoSession) {\n client.setCredentialFeature(credentials, \"CREDENTIALS_SSO\", \"s\");\n }\n else {\n client.setCredentialFeature(credentials, \"CREDENTIALS_SSO_LEGACY\", \"u\");\n }\n return credentials;\n};\n\nconst validateSsoProfile = (profile, logger) => {\n const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;\n if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {\n throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", ` +\n `\"sso_region\", \"sso_role_name\", \"sso_start_url\". Got ${Object.keys(profile).join(\", \")}\\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });\n }\n return profile;\n};\n\nconst fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-sso - fromSSO\");\n const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;\n const { ssoClient } = init;\n const profileName = sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n });\n if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n const profile = profiles[profileName];\n if (!profile) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });\n }\n if (!isSsoProfile(profile)) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {\n logger: init.logger,\n });\n }\n if (profile?.sso_session) {\n const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init);\n const session = ssoSessions[profile.sso_session];\n const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;\n if (ssoRegion && ssoRegion !== session.sso_region) {\n throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {\n tryNextLink: false,\n logger: init.logger,\n });\n }\n if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {\n throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {\n tryNextLink: false,\n logger: init.logger,\n });\n }\n profile.sso_region = session.sso_region;\n profile.sso_start_url = session.sso_start_url;\n }\n const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);\n return resolveSSOCredentials({\n ssoStartUrl: sso_start_url,\n ssoSession: sso_session,\n ssoAccountId: sso_account_id,\n ssoRegion: sso_region,\n ssoRoleName: sso_role_name,\n ssoClient: ssoClient,\n clientConfig: init.clientConfig,\n parentClientConfig: init.parentClientConfig,\n callerClientConfig: init.callerClientConfig,\n profile: profileName,\n filepath: init.filepath,\n configFilepath: init.configFilepath,\n ignoreCache: init.ignoreCache,\n logger: init.logger,\n });\n }\n else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {\n throw new propertyProvider.CredentialsProviderError(\"Incomplete configuration. The fromSSO() argument hash must include \" +\n '\"ssoStartUrl\", \"ssoAccountId\", \"ssoRegion\", \"ssoRoleName\"', { tryNextLink: false, logger: init.logger });\n }\n else {\n return resolveSSOCredentials({\n ssoStartUrl,\n ssoSession,\n ssoAccountId,\n ssoRegion,\n ssoRoleName,\n ssoClient,\n clientConfig: init.clientConfig,\n parentClientConfig: init.parentClientConfig,\n callerClientConfig: init.callerClientConfig,\n profile: profileName,\n filepath: init.filepath,\n configFilepath: init.configFilepath,\n ignoreCache: init.ignoreCache,\n logger: init.logger,\n });\n }\n};\n\nexports.fromSSO = fromSSO;\nexports.isSsoProfile = isSsoProfile;\nexports.validateSsoProfile = validateSsoProfile;\n","'use strict';\n\nvar sso = require('@aws-sdk/nested-clients/sso');\n\n\n\nexports.GetRoleCredentialsCommand = sso.GetRoleCredentialsCommand;\nexports.SSOClient = sso.SSOClient;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0;\nconst httpAuthSchemes_1 = require(\"@aws-sdk/core/httpAuthSchemes\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"awsssoportal\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultSSOHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"GetRoleCredentials\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, httpAuthSchemes_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst u = \"required\", v = \"fn\", w = \"argv\", x = \"ref\";\nconst 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\" }];\nconst _data = {\n version: \"1.0\",\n parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i },\n rules: [\n {\n conditions: [{ [v]: b, [w]: [k] }],\n rules: [\n { conditions: r, error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", type: d },\n { conditions: s, error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", type: d },\n { endpoint: { url: k, properties: n, headers: n }, type: e },\n ],\n type: f,\n },\n {\n conditions: [{ [v]: b, [w]: t }],\n rules: [\n {\n conditions: [{ [v]: \"aws.partition\", [w]: t, assign: g }],\n rules: [\n {\n conditions: [l, m],\n rules: [\n {\n conditions: [{ [v]: c, [w]: [a, o] }, q],\n rules: [\n {\n endpoint: {\n url: \"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\",\n properties: n,\n headers: n,\n },\n type: e,\n },\n ],\n type: f,\n },\n { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", type: d },\n ],\n type: f,\n },\n {\n conditions: r,\n rules: [\n {\n conditions: [{ [v]: c, [w]: [o, a] }],\n rules: [\n {\n conditions: [{ [v]: \"stringEquals\", [w]: [{ [v]: h, [w]: [p, \"name\"] }, \"aws-us-gov\"] }],\n endpoint: { url: \"https://portal.sso.{Region}.amazonaws.com\", properties: n, headers: n },\n type: e,\n },\n {\n endpoint: {\n url: \"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}\",\n properties: n,\n headers: n,\n },\n type: e,\n },\n ],\n type: f,\n },\n { error: \"FIPS is enabled but this partition does not support FIPS\", type: d },\n ],\n type: f,\n },\n {\n conditions: s,\n rules: [\n {\n conditions: [q],\n rules: [\n {\n endpoint: {\n url: \"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}\",\n properties: n,\n headers: n,\n },\n type: e,\n },\n ],\n type: f,\n },\n { error: \"DualStack is enabled but this partition does not support DualStack\", type: d },\n ],\n type: f,\n },\n {\n endpoint: { url: \"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}\", properties: n, headers: n },\n type: e,\n },\n ],\n type: f,\n },\n ],\n type: f,\n },\n { error: \"Invalid Configuration: Missing Region\", type: d },\n ],\n};\nexports.ruleSet = _data;\n","'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\nvar schemas_0 = require('./schemas/schemas_0');\nvar errors = require('./models/errors');\nvar SSOServiceException = require('./models/SSOServiceException');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"awsssoportal\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass SSOClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nclass GetRoleCredentialsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"SWBPortalService\", \"GetRoleCredentials\", {})\n .n(\"SSOClient\", \"GetRoleCredentialsCommand\")\n .sc(schemas_0.GetRoleCredentials$)\n .build() {\n}\n\nconst commands = {\n GetRoleCredentialsCommand,\n};\nclass SSO extends SSOClient {\n}\nsmithyClient.createAggregatedClient(commands, SSO);\n\nexports.$Command = smithyClient.Command;\nexports.__Client = smithyClient.Client;\nexports.SSOServiceException = SSOServiceException.SSOServiceException;\nexports.GetRoleCredentialsCommand = GetRoleCredentialsCommand;\nexports.SSO = SSO;\nexports.SSOClient = SSOClient;\nObject.prototype.hasOwnProperty.call(schemas_0, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: schemas_0['__proto__']\n });\n\nObject.keys(schemas_0).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k];\n});\nObject.prototype.hasOwnProperty.call(errors, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: errors['__proto__']\n });\n\nObject.keys(errors).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k];\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SSOServiceException = exports.__ServiceException = void 0;\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nObject.defineProperty(exports, \"__ServiceException\", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });\nclass SSOServiceException extends smithy_client_1.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, SSOServiceException.prototype);\n }\n}\nexports.SSOServiceException = SSOServiceException;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnauthorizedException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.InvalidRequestException = void 0;\nconst SSOServiceException_1 = require(\"./SSOServiceException\");\nclass InvalidRequestException extends SSOServiceException_1.SSOServiceException {\n name = \"InvalidRequestException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"InvalidRequestException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidRequestException.prototype);\n }\n}\nexports.InvalidRequestException = InvalidRequestException;\nclass ResourceNotFoundException extends SSOServiceException_1.SSOServiceException {\n name = \"ResourceNotFoundException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ResourceNotFoundException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ResourceNotFoundException.prototype);\n }\n}\nexports.ResourceNotFoundException = ResourceNotFoundException;\nclass TooManyRequestsException extends SSOServiceException_1.SSOServiceException {\n name = \"TooManyRequestsException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"TooManyRequestsException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, TooManyRequestsException.prototype);\n }\n}\nexports.TooManyRequestsException = TooManyRequestsException;\nclass UnauthorizedException extends SSOServiceException_1.SSOServiceException {\n name = \"UnauthorizedException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"UnauthorizedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, UnauthorizedException.prototype);\n }\n}\nexports.UnauthorizedException = UnauthorizedException;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../../../package.json\"));\nconst client_1 = require(\"@aws-sdk/core/client\");\nconst httpAuthSchemes_1 = require(\"@aws-sdk/core/httpAuthSchemes\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, client_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(httpAuthSchemes_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst httpAuthSchemes_1 = require(\"@aws-sdk/core/httpAuthSchemes\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_1 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst schemas_0_1 = require(\"./schemas/schemas_0\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2019-06-10\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new httpAuthSchemes_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_1.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ?? protocols_1.AwsRestJsonProtocol,\n protocolSettings: config?.protocolSettings ?? {\n defaultNamespace: \"com.amazonaws.sso\",\n errorTypeRegistries: schemas_0_1.errorTypeRegistries,\n version: \"2019-06-10\",\n serviceTarget: \"SWBPortalService\",\n },\n serviceId: config?.serviceId ?? \"SSO\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GetRoleCredentials$ = exports.RoleCredentials$ = exports.GetRoleCredentialsResponse$ = exports.GetRoleCredentialsRequest$ = exports.errorTypeRegistries = exports.UnauthorizedException$ = exports.TooManyRequestsException$ = exports.ResourceNotFoundException$ = exports.InvalidRequestException$ = exports.SSOServiceException$ = void 0;\nconst _ATT = \"AccessTokenType\";\nconst _GRC = \"GetRoleCredentials\";\nconst _GRCR = \"GetRoleCredentialsRequest\";\nconst _GRCRe = \"GetRoleCredentialsResponse\";\nconst _IRE = \"InvalidRequestException\";\nconst _RC = \"RoleCredentials\";\nconst _RNFE = \"ResourceNotFoundException\";\nconst _SAKT = \"SecretAccessKeyType\";\nconst _STT = \"SessionTokenType\";\nconst _TMRE = \"TooManyRequestsException\";\nconst _UE = \"UnauthorizedException\";\nconst _aI = \"accountId\";\nconst _aKI = \"accessKeyId\";\nconst _aT = \"accessToken\";\nconst _ai = \"account_id\";\nconst _c = \"client\";\nconst _e = \"error\";\nconst _ex = \"expiration\";\nconst _h = \"http\";\nconst _hE = \"httpError\";\nconst _hH = \"httpHeader\";\nconst _hQ = \"httpQuery\";\nconst _m = \"message\";\nconst _rC = \"roleCredentials\";\nconst _rN = \"roleName\";\nconst _rn = \"role_name\";\nconst _s = \"smithy.ts.sdk.synthetic.com.amazonaws.sso\";\nconst _sAK = \"secretAccessKey\";\nconst _sT = \"sessionToken\";\nconst _xasbt = \"x-amz-sso_bearer_token\";\nconst n0 = \"com.amazonaws.sso\";\nconst schema_1 = require(\"@smithy/core/schema\");\nconst errors_1 = require(\"../models/errors\");\nconst SSOServiceException_1 = require(\"../models/SSOServiceException\");\nconst _s_registry = schema_1.TypeRegistry.for(_s);\nexports.SSOServiceException$ = [-3, _s, \"SSOServiceException\", 0, [], []];\n_s_registry.registerError(exports.SSOServiceException$, SSOServiceException_1.SSOServiceException);\nconst n0_registry = schema_1.TypeRegistry.for(n0);\nexports.InvalidRequestException$ = [-3, n0, _IRE, { [_e]: _c, [_hE]: 400 }, [_m], [0]];\nn0_registry.registerError(exports.InvalidRequestException$, errors_1.InvalidRequestException);\nexports.ResourceNotFoundException$ = [-3, n0, _RNFE, { [_e]: _c, [_hE]: 404 }, [_m], [0]];\nn0_registry.registerError(exports.ResourceNotFoundException$, errors_1.ResourceNotFoundException);\nexports.TooManyRequestsException$ = [-3, n0, _TMRE, { [_e]: _c, [_hE]: 429 }, [_m], [0]];\nn0_registry.registerError(exports.TooManyRequestsException$, errors_1.TooManyRequestsException);\nexports.UnauthorizedException$ = [-3, n0, _UE, { [_e]: _c, [_hE]: 401 }, [_m], [0]];\nn0_registry.registerError(exports.UnauthorizedException$, errors_1.UnauthorizedException);\nexports.errorTypeRegistries = [_s_registry, n0_registry];\nvar AccessTokenType = [0, n0, _ATT, 8, 0];\nvar SecretAccessKeyType = [0, n0, _SAKT, 8, 0];\nvar SessionTokenType = [0, n0, _STT, 8, 0];\nexports.GetRoleCredentialsRequest$ = [\n 3,\n n0,\n _GRCR,\n 0,\n [_rN, _aI, _aT],\n [\n [0, { [_hQ]: _rn }],\n [0, { [_hQ]: _ai }],\n [() => AccessTokenType, { [_hH]: _xasbt }],\n ],\n 3,\n];\nexports.GetRoleCredentialsResponse$ = [\n 3,\n n0,\n _GRCRe,\n 0,\n [_rC],\n [[() => exports.RoleCredentials$, 0]],\n];\nexports.RoleCredentials$ = [\n 3,\n n0,\n _RC,\n 0,\n [_aKI, _sAK, _sT, _ex],\n [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1],\n];\nexports.GetRoleCredentials$ = [\n 9,\n n0,\n _GRC,\n { [_h]: [\"GET\", \"/federation/credentials\", 200] },\n () => exports.GetRoleCredentialsRequest$,\n () => exports.GetRoleCredentialsResponse$,\n];\n","'use strict';\n\nvar client = require('@aws-sdk/core/client');\nvar httpAuthSchemes = require('@aws-sdk/core/httpAuthSchemes');\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar node_fs = require('node:fs');\n\nconst fromEnvSigningName = ({ logger, signingName } = {}) => async () => {\n logger?.debug?.(\"@aws-sdk/token-providers - fromEnvSigningName\");\n if (!signingName) {\n throw new propertyProvider.TokenProviderError(\"Please pass 'signingName' to compute environment variable key\", { logger });\n }\n const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName);\n if (!(bearerTokenKey in process.env)) {\n throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger });\n }\n const token = { token: process.env[bearerTokenKey] };\n client.setTokenFeature(token, \"BEARER_SERVICE_ENV_VARS\", \"3\");\n return token;\n};\n\nconst EXPIRE_WINDOW_MS = 5 * 60 * 1000;\nconst REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;\n\nconst getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {\n const { SSOOIDCClient } = await import('@aws-sdk/nested-clients/sso-oidc');\n const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];\n const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {\n region: ssoRegion ?? init.clientConfig?.region,\n logger: coalesce(\"logger\"),\n userAgentAppId: coalesce(\"userAgentAppId\"),\n }));\n return ssoOidcClient;\n};\n\nconst getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {\n const { CreateTokenCommand } = await import('@aws-sdk/nested-clients/sso-oidc');\n const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);\n return ssoOidcClient.send(new CreateTokenCommand({\n clientId: ssoToken.clientId,\n clientSecret: ssoToken.clientSecret,\n refreshToken: ssoToken.refreshToken,\n grantType: \"refresh_token\",\n }));\n};\n\nconst validateTokenExpiry = (token) => {\n if (token.expiration && token.expiration.getTime() < Date.now()) {\n throw new propertyProvider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);\n }\n};\n\nconst validateTokenKey = (key, value, forRefresh = false) => {\n if (typeof value === \"undefined\") {\n throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? \". Cannot refresh\" : \"\"}. ${REFRESH_MESSAGE}`, false);\n }\n};\n\nconst { writeFile } = node_fs.promises;\nconst writeSSOTokenToFile = (id, ssoToken) => {\n const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id);\n const tokenString = JSON.stringify(ssoToken, null, 2);\n return writeFile(tokenFilepath, tokenString);\n};\n\nconst lastRefreshAttemptTime = new Date(0);\nconst fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/token-providers - fromSso\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n const profileName = sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n });\n const profile = profiles[profileName];\n if (!profile) {\n throw new propertyProvider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);\n }\n else if (!profile[\"sso_session\"]) {\n throw new propertyProvider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);\n }\n const ssoSessionName = profile[\"sso_session\"];\n const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init);\n const ssoSession = ssoSessions[ssoSessionName];\n if (!ssoSession) {\n throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);\n }\n for (const ssoSessionRequiredKey of [\"sso_start_url\", \"sso_region\"]) {\n if (!ssoSession[ssoSessionRequiredKey]) {\n throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);\n }\n }\n ssoSession[\"sso_start_url\"];\n const ssoRegion = ssoSession[\"sso_region\"];\n let ssoToken;\n try {\n ssoToken = await sharedIniFileLoader.getSSOTokenFromFile(ssoSessionName);\n }\n catch (e) {\n throw new propertyProvider.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);\n }\n validateTokenKey(\"accessToken\", ssoToken.accessToken);\n validateTokenKey(\"expiresAt\", ssoToken.expiresAt);\n const { accessToken, expiresAt } = ssoToken;\n const existingToken = { token: accessToken, expiration: new Date(expiresAt) };\n if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {\n return existingToken;\n }\n if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {\n validateTokenExpiry(existingToken);\n return existingToken;\n }\n validateTokenKey(\"clientId\", ssoToken.clientId, true);\n validateTokenKey(\"clientSecret\", ssoToken.clientSecret, true);\n validateTokenKey(\"refreshToken\", ssoToken.refreshToken, true);\n try {\n lastRefreshAttemptTime.setTime(Date.now());\n const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig);\n validateTokenKey(\"accessToken\", newSsoOidcToken.accessToken);\n validateTokenKey(\"expiresIn\", newSsoOidcToken.expiresIn);\n const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);\n try {\n await writeSSOTokenToFile(ssoSessionName, {\n ...ssoToken,\n accessToken: newSsoOidcToken.accessToken,\n expiresAt: newTokenExpiration.toISOString(),\n refreshToken: newSsoOidcToken.refreshToken,\n });\n }\n catch (error) {\n }\n return {\n token: newSsoOidcToken.accessToken,\n expiration: newTokenExpiration,\n };\n }\n catch (error) {\n validateTokenExpiry(existingToken);\n return existingToken;\n }\n};\n\nconst fromStatic = ({ token, logger }) => async () => {\n logger?.debug(\"@aws-sdk/token-providers - fromStatic\");\n if (!token || !token.token) {\n throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false);\n }\n return token;\n};\n\nconst nodeProvider = (init = {}) => propertyProvider.memoize(propertyProvider.chain(fromSso(init), async () => {\n throw new propertyProvider.TokenProviderError(\"Could not load token from any providers\", false);\n}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined);\n\nexports.fromEnvSigningName = fromEnvSigningName;\nexports.fromSso = fromSso;\nexports.fromStatic = fromStatic;\nexports.nodeProvider = nodeProvider;\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"998.index.js","mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":[".././node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js",".././node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/auth/httpAuthSchemeProvider.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/bdd.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/endpointResolver.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/SSOServiceException.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/errors.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.shared.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/schemas/schemas_0.js",".././node_modules/@aws-sdk/token-providers/dist-cjs/index.js"],"sourcesContent":["'use strict';\n\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar client = require('@aws-sdk/core/client');\nvar tokenProviders = require('@aws-sdk/token-providers');\n\nconst isSsoProfile = (arg) => arg &&\n (typeof arg.sso_start_url === \"string\" ||\n typeof arg.sso_account_id === \"string\" ||\n typeof arg.sso_session === \"string\" ||\n typeof arg.sso_region === \"string\" ||\n typeof arg.sso_role_name === \"string\");\n\nconst SHOULD_FAIL_CREDENTIAL_CHAIN = false;\nconst resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger, }) => {\n let token;\n const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;\n if (ssoSession) {\n try {\n const _token = await tokenProviders.fromSso({\n profile,\n filepath,\n configFilepath,\n ignoreCache,\n })();\n token = {\n accessToken: _token.token,\n expiresAt: new Date(_token.expiration).toISOString(),\n };\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(e.message, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n }\n else {\n try {\n token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl);\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n }\n if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {\n throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const { accessToken } = token;\n const { SSOClient, GetRoleCredentialsCommand } = await Promise.resolve().then(function () { return require('./loadSso-BKDNrsal.js'); });\n const sso = ssoClient ||\n new SSOClient(Object.assign({}, clientConfig ?? {}, {\n logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,\n region: clientConfig?.region ?? ssoRegion,\n userAgentAppId: clientConfig?.userAgentAppId ?? callerClientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId,\n }));\n let ssoResp;\n try {\n ssoResp = await sso.send(new GetRoleCredentialsCommand({\n accountId: ssoAccountId,\n roleName: ssoRoleName,\n accessToken,\n }));\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(e, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}, } = ssoResp;\n if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {\n throw new propertyProvider.CredentialsProviderError(\"SSO returns an invalid temporary credential.\", {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const credentials = {\n accessKeyId,\n secretAccessKey,\n sessionToken,\n expiration: new Date(expiration),\n ...(credentialScope && { credentialScope }),\n ...(accountId && { accountId }),\n };\n if (ssoSession) {\n client.setCredentialFeature(credentials, \"CREDENTIALS_SSO\", \"s\");\n }\n else {\n client.setCredentialFeature(credentials, \"CREDENTIALS_SSO_LEGACY\", \"u\");\n }\n return credentials;\n};\n\nconst validateSsoProfile = (profile, logger) => {\n const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;\n if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {\n throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", ` +\n `\"sso_region\", \"sso_role_name\", \"sso_start_url\". Got ${Object.keys(profile).join(\", \")}\\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });\n }\n return profile;\n};\n\nconst fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-sso - fromSSO\");\n const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;\n const { ssoClient } = init;\n const profileName = sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n });\n if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n const profile = profiles[profileName];\n if (!profile) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });\n }\n if (!isSsoProfile(profile)) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {\n logger: init.logger,\n });\n }\n if (profile?.sso_session) {\n const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init);\n const session = ssoSessions[profile.sso_session];\n const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;\n if (ssoRegion && ssoRegion !== session.sso_region) {\n throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {\n tryNextLink: false,\n logger: init.logger,\n });\n }\n if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {\n throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {\n tryNextLink: false,\n logger: init.logger,\n });\n }\n profile.sso_region = session.sso_region;\n profile.sso_start_url = session.sso_start_url;\n }\n const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);\n return resolveSSOCredentials({\n ssoStartUrl: sso_start_url,\n ssoSession: sso_session,\n ssoAccountId: sso_account_id,\n ssoRegion: sso_region,\n ssoRoleName: sso_role_name,\n ssoClient: ssoClient,\n clientConfig: init.clientConfig,\n parentClientConfig: init.parentClientConfig,\n callerClientConfig: init.callerClientConfig,\n profile: profileName,\n filepath: init.filepath,\n configFilepath: init.configFilepath,\n ignoreCache: init.ignoreCache,\n logger: init.logger,\n });\n }\n else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {\n throw new propertyProvider.CredentialsProviderError(\"Incomplete configuration. The fromSSO() argument hash must include \" +\n '\"ssoStartUrl\", \"ssoAccountId\", \"ssoRegion\", \"ssoRoleName\"', { tryNextLink: false, logger: init.logger });\n }\n else {\n return resolveSSOCredentials({\n ssoStartUrl,\n ssoSession,\n ssoAccountId,\n ssoRegion,\n ssoRoleName,\n ssoClient,\n clientConfig: init.clientConfig,\n parentClientConfig: init.parentClientConfig,\n callerClientConfig: init.callerClientConfig,\n profile: profileName,\n filepath: init.filepath,\n configFilepath: init.configFilepath,\n ignoreCache: init.ignoreCache,\n logger: init.logger,\n });\n }\n};\n\nexports.fromSSO = fromSSO;\nexports.isSsoProfile = isSsoProfile;\nexports.validateSsoProfile = validateSsoProfile;\n","'use strict';\n\nvar sso = require('@aws-sdk/nested-clients/sso');\n\n\n\nexports.GetRoleCredentialsCommand = sso.GetRoleCredentialsCommand;\nexports.SSOClient = sso.SSOClient;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0;\nconst httpAuthSchemes_1 = require(\"@aws-sdk/core/httpAuthSchemes\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"awsssoportal\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultSSOHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"GetRoleCredentials\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, httpAuthSchemes_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.bdd = void 0;\nconst util_endpoints_1 = require(\"@smithy/util-endpoints\");\nconst k = \"ref\";\nconst a = -1, b = true, c = \"isSet\", d = \"PartitionResult\", e = \"booleanEquals\", f = \"getAttr\", g = { [k]: \"Endpoint\" }, h = { [k]: d }, i = {}, j = [{ [k]: \"Region\" }];\nconst _data = {\n conditions: [\n [c, [g]],\n [c, j],\n [\"aws.partition\", j, d],\n [e, [{ [k]: \"UseFIPS\" }, b]],\n [e, [{ [k]: \"UseDualStack\" }, b]],\n [e, [{ fn: f, argv: [h, \"supportsDualStack\"] }, b]],\n [e, [{ fn: f, argv: [h, \"supportsFIPS\"] }, b]],\n [\"stringEquals\", [{ fn: f, argv: [h, \"name\"] }, \"aws-us-gov\"]],\n ],\n results: [\n [a],\n [a, \"Invalid Configuration: FIPS and custom endpoint are not supported\"],\n [a, \"Invalid Configuration: Dualstack and custom endpoint are not supported\"],\n [g, i],\n [\"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", i],\n [a, \"FIPS and DualStack are enabled, but this partition does not support one or both\"],\n [\"https://portal.sso.{Region}.amazonaws.com\", i],\n [\"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}\", i],\n [a, \"FIPS is enabled but this partition does not support FIPS\"],\n [\"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}\", i],\n [a, \"DualStack is enabled but this partition does not support DualStack\"],\n [\"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}\", i],\n [a, \"Invalid Configuration: Missing Region\"],\n ],\n};\nconst root = 2;\nconst r = 100_000_000;\nconst nodes = new Int32Array([\n -1,\n 1,\n -1,\n 0,\n 13,\n 3,\n 1,\n 4,\n r + 12,\n 2,\n 5,\n r + 12,\n 3,\n 8,\n 6,\n 4,\n 7,\n r + 11,\n 5,\n r + 9,\n r + 10,\n 4,\n 11,\n 9,\n 6,\n 10,\n r + 8,\n 7,\n r + 6,\n r + 7,\n 5,\n 12,\n r + 5,\n 6,\n r + 4,\n r + 5,\n 3,\n r + 1,\n 14,\n 4,\n r + 2,\n r + 3,\n]);\nexports.bdd = util_endpoints_1.BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst bdd_1 = require(\"./bdd\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.decideEndpoint)(bdd_1.bdd, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n","'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\nvar schemas_0 = require('./schemas/schemas_0');\nvar errors = require('./models/errors');\nvar SSOServiceException = require('./models/SSOServiceException');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"awsssoportal\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass SSOClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nclass GetRoleCredentialsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"SWBPortalService\", \"GetRoleCredentials\", {})\n .n(\"SSOClient\", \"GetRoleCredentialsCommand\")\n .sc(schemas_0.GetRoleCredentials$)\n .build() {\n}\n\nconst commands = {\n GetRoleCredentialsCommand,\n};\nclass SSO extends SSOClient {\n}\nsmithyClient.createAggregatedClient(commands, SSO);\n\nexports.$Command = smithyClient.Command;\nexports.__Client = smithyClient.Client;\nexports.SSOServiceException = SSOServiceException.SSOServiceException;\nexports.GetRoleCredentialsCommand = GetRoleCredentialsCommand;\nexports.SSO = SSO;\nexports.SSOClient = SSOClient;\nObject.prototype.hasOwnProperty.call(schemas_0, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: schemas_0['__proto__']\n });\n\nObject.keys(schemas_0).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k];\n});\nObject.prototype.hasOwnProperty.call(errors, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: errors['__proto__']\n });\n\nObject.keys(errors).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k];\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SSOServiceException = exports.__ServiceException = void 0;\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nObject.defineProperty(exports, \"__ServiceException\", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });\nclass SSOServiceException extends smithy_client_1.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, SSOServiceException.prototype);\n }\n}\nexports.SSOServiceException = SSOServiceException;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnauthorizedException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.InvalidRequestException = void 0;\nconst SSOServiceException_1 = require(\"./SSOServiceException\");\nclass InvalidRequestException extends SSOServiceException_1.SSOServiceException {\n name = \"InvalidRequestException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"InvalidRequestException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidRequestException.prototype);\n }\n}\nexports.InvalidRequestException = InvalidRequestException;\nclass ResourceNotFoundException extends SSOServiceException_1.SSOServiceException {\n name = \"ResourceNotFoundException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ResourceNotFoundException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ResourceNotFoundException.prototype);\n }\n}\nexports.ResourceNotFoundException = ResourceNotFoundException;\nclass TooManyRequestsException extends SSOServiceException_1.SSOServiceException {\n name = \"TooManyRequestsException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"TooManyRequestsException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, TooManyRequestsException.prototype);\n }\n}\nexports.TooManyRequestsException = TooManyRequestsException;\nclass UnauthorizedException extends SSOServiceException_1.SSOServiceException {\n name = \"UnauthorizedException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"UnauthorizedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, UnauthorizedException.prototype);\n }\n}\nexports.UnauthorizedException = UnauthorizedException;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../../../package.json\"));\nconst client_1 = require(\"@aws-sdk/core/client\");\nconst httpAuthSchemes_1 = require(\"@aws-sdk/core/httpAuthSchemes\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, client_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(httpAuthSchemes_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst httpAuthSchemes_1 = require(\"@aws-sdk/core/httpAuthSchemes\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_1 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst schemas_0_1 = require(\"./schemas/schemas_0\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2019-06-10\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new httpAuthSchemes_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_1.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ?? protocols_1.AwsRestJsonProtocol,\n protocolSettings: config?.protocolSettings ?? {\n defaultNamespace: \"com.amazonaws.sso\",\n errorTypeRegistries: schemas_0_1.errorTypeRegistries,\n version: \"2019-06-10\",\n serviceTarget: \"SWBPortalService\",\n },\n serviceId: config?.serviceId ?? \"SSO\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GetRoleCredentials$ = exports.RoleCredentials$ = exports.GetRoleCredentialsResponse$ = exports.GetRoleCredentialsRequest$ = exports.errorTypeRegistries = exports.UnauthorizedException$ = exports.TooManyRequestsException$ = exports.ResourceNotFoundException$ = exports.InvalidRequestException$ = exports.SSOServiceException$ = void 0;\nconst _ATT = \"AccessTokenType\";\nconst _GRC = \"GetRoleCredentials\";\nconst _GRCR = \"GetRoleCredentialsRequest\";\nconst _GRCRe = \"GetRoleCredentialsResponse\";\nconst _IRE = \"InvalidRequestException\";\nconst _RC = \"RoleCredentials\";\nconst _RNFE = \"ResourceNotFoundException\";\nconst _SAKT = \"SecretAccessKeyType\";\nconst _STT = \"SessionTokenType\";\nconst _TMRE = \"TooManyRequestsException\";\nconst _UE = \"UnauthorizedException\";\nconst _aI = \"accountId\";\nconst _aKI = \"accessKeyId\";\nconst _aT = \"accessToken\";\nconst _ai = \"account_id\";\nconst _c = \"client\";\nconst _e = \"error\";\nconst _ex = \"expiration\";\nconst _h = \"http\";\nconst _hE = \"httpError\";\nconst _hH = \"httpHeader\";\nconst _hQ = \"httpQuery\";\nconst _m = \"message\";\nconst _rC = \"roleCredentials\";\nconst _rN = \"roleName\";\nconst _rn = \"role_name\";\nconst _s = \"smithy.ts.sdk.synthetic.com.amazonaws.sso\";\nconst _sAK = \"secretAccessKey\";\nconst _sT = \"sessionToken\";\nconst _xasbt = \"x-amz-sso_bearer_token\";\nconst n0 = \"com.amazonaws.sso\";\nconst schema_1 = require(\"@smithy/core/schema\");\nconst errors_1 = require(\"../models/errors\");\nconst SSOServiceException_1 = require(\"../models/SSOServiceException\");\nconst _s_registry = schema_1.TypeRegistry.for(_s);\nexports.SSOServiceException$ = [-3, _s, \"SSOServiceException\", 0, [], []];\n_s_registry.registerError(exports.SSOServiceException$, SSOServiceException_1.SSOServiceException);\nconst n0_registry = schema_1.TypeRegistry.for(n0);\nexports.InvalidRequestException$ = [-3, n0, _IRE, { [_e]: _c, [_hE]: 400 }, [_m], [0]];\nn0_registry.registerError(exports.InvalidRequestException$, errors_1.InvalidRequestException);\nexports.ResourceNotFoundException$ = [-3, n0, _RNFE, { [_e]: _c, [_hE]: 404 }, [_m], [0]];\nn0_registry.registerError(exports.ResourceNotFoundException$, errors_1.ResourceNotFoundException);\nexports.TooManyRequestsException$ = [-3, n0, _TMRE, { [_e]: _c, [_hE]: 429 }, [_m], [0]];\nn0_registry.registerError(exports.TooManyRequestsException$, errors_1.TooManyRequestsException);\nexports.UnauthorizedException$ = [-3, n0, _UE, { [_e]: _c, [_hE]: 401 }, [_m], [0]];\nn0_registry.registerError(exports.UnauthorizedException$, errors_1.UnauthorizedException);\nexports.errorTypeRegistries = [_s_registry, n0_registry];\nvar AccessTokenType = [0, n0, _ATT, 8, 0];\nvar SecretAccessKeyType = [0, n0, _SAKT, 8, 0];\nvar SessionTokenType = [0, n0, _STT, 8, 0];\nexports.GetRoleCredentialsRequest$ = [\n 3,\n n0,\n _GRCR,\n 0,\n [_rN, _aI, _aT],\n [\n [0, { [_hQ]: _rn }],\n [0, { [_hQ]: _ai }],\n [() => AccessTokenType, { [_hH]: _xasbt }],\n ],\n 3,\n];\nexports.GetRoleCredentialsResponse$ = [\n 3,\n n0,\n _GRCRe,\n 0,\n [_rC],\n [[() => exports.RoleCredentials$, 0]],\n];\nexports.RoleCredentials$ = [\n 3,\n n0,\n _RC,\n 0,\n [_aKI, _sAK, _sT, _ex],\n [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1],\n];\nexports.GetRoleCredentials$ = [\n 9,\n n0,\n _GRC,\n { [_h]: [\"GET\", \"/federation/credentials\", 200] },\n () => exports.GetRoleCredentialsRequest$,\n () => exports.GetRoleCredentialsResponse$,\n];\n","'use strict';\n\nvar client = require('@aws-sdk/core/client');\nvar httpAuthSchemes = require('@aws-sdk/core/httpAuthSchemes');\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar node_fs = require('node:fs');\n\nconst fromEnvSigningName = ({ logger, signingName } = {}) => async () => {\n logger?.debug?.(\"@aws-sdk/token-providers - fromEnvSigningName\");\n if (!signingName) {\n throw new propertyProvider.TokenProviderError(\"Please pass 'signingName' to compute environment variable key\", { logger });\n }\n const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName);\n if (!(bearerTokenKey in process.env)) {\n throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger });\n }\n const token = { token: process.env[bearerTokenKey] };\n client.setTokenFeature(token, \"BEARER_SERVICE_ENV_VARS\", \"3\");\n return token;\n};\n\nconst EXPIRE_WINDOW_MS = 5 * 60 * 1000;\nconst REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;\n\nconst getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {\n const { SSOOIDCClient } = await import('@aws-sdk/nested-clients/sso-oidc');\n const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];\n const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {\n region: ssoRegion ?? init.clientConfig?.region,\n logger: coalesce(\"logger\"),\n userAgentAppId: coalesce(\"userAgentAppId\"),\n }));\n return ssoOidcClient;\n};\n\nconst getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {\n const { CreateTokenCommand } = await import('@aws-sdk/nested-clients/sso-oidc');\n const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);\n return ssoOidcClient.send(new CreateTokenCommand({\n clientId: ssoToken.clientId,\n clientSecret: ssoToken.clientSecret,\n refreshToken: ssoToken.refreshToken,\n grantType: \"refresh_token\",\n }));\n};\n\nconst validateTokenExpiry = (token) => {\n if (token.expiration && token.expiration.getTime() < Date.now()) {\n throw new propertyProvider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);\n }\n};\n\nconst validateTokenKey = (key, value, forRefresh = false) => {\n if (typeof value === \"undefined\") {\n throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? \". Cannot refresh\" : \"\"}. ${REFRESH_MESSAGE}`, false);\n }\n};\n\nconst { writeFile } = node_fs.promises;\nconst writeSSOTokenToFile = (id, ssoToken) => {\n const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id);\n const tokenString = JSON.stringify(ssoToken, null, 2);\n return writeFile(tokenFilepath, tokenString);\n};\n\nconst lastRefreshAttemptTime = new Date(0);\nconst fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/token-providers - fromSso\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n const profileName = sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n });\n const profile = profiles[profileName];\n if (!profile) {\n throw new propertyProvider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);\n }\n else if (!profile[\"sso_session\"]) {\n throw new propertyProvider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);\n }\n const ssoSessionName = profile[\"sso_session\"];\n const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init);\n const ssoSession = ssoSessions[ssoSessionName];\n if (!ssoSession) {\n throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);\n }\n for (const ssoSessionRequiredKey of [\"sso_start_url\", \"sso_region\"]) {\n if (!ssoSession[ssoSessionRequiredKey]) {\n throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);\n }\n }\n ssoSession[\"sso_start_url\"];\n const ssoRegion = ssoSession[\"sso_region\"];\n let ssoToken;\n try {\n ssoToken = await sharedIniFileLoader.getSSOTokenFromFile(ssoSessionName);\n }\n catch (e) {\n throw new propertyProvider.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);\n }\n validateTokenKey(\"accessToken\", ssoToken.accessToken);\n validateTokenKey(\"expiresAt\", ssoToken.expiresAt);\n const { accessToken, expiresAt } = ssoToken;\n const existingToken = { token: accessToken, expiration: new Date(expiresAt) };\n if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {\n return existingToken;\n }\n if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {\n validateTokenExpiry(existingToken);\n return existingToken;\n }\n validateTokenKey(\"clientId\", ssoToken.clientId, true);\n validateTokenKey(\"clientSecret\", ssoToken.clientSecret, true);\n validateTokenKey(\"refreshToken\", ssoToken.refreshToken, true);\n try {\n lastRefreshAttemptTime.setTime(Date.now());\n const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig);\n validateTokenKey(\"accessToken\", newSsoOidcToken.accessToken);\n validateTokenKey(\"expiresIn\", newSsoOidcToken.expiresIn);\n const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);\n try {\n await writeSSOTokenToFile(ssoSessionName, {\n ...ssoToken,\n accessToken: newSsoOidcToken.accessToken,\n expiresAt: newTokenExpiration.toISOString(),\n refreshToken: newSsoOidcToken.refreshToken,\n });\n }\n catch (error) {\n }\n return {\n token: newSsoOidcToken.accessToken,\n expiration: newTokenExpiration,\n };\n }\n catch (error) {\n validateTokenExpiry(existingToken);\n return existingToken;\n }\n};\n\nconst fromStatic = ({ token, logger }) => async () => {\n logger?.debug(\"@aws-sdk/token-providers - fromStatic\");\n if (!token || !token.token) {\n throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false);\n }\n return token;\n};\n\nconst nodeProvider = (init = {}) => propertyProvider.memoize(propertyProvider.chain(fromSso(init), async () => {\n throw new propertyProvider.TokenProviderError(\"Could not load token from any providers\", false);\n}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined);\n\nexports.fromEnvSigningName = fromEnvSigningName;\nexports.fromSso = fromSso;\nexports.fromStatic = fromStatic;\nexports.nodeProvider = nodeProvider;\n"],"names":[],"sourceRoot":""}