UNPKG

failure-lambda

Version:

Failure injection for AWS Lambda - chaos engineering made simple

1,113 lines (1,094 loc) 34.4 kB
#!/usr/bin/env node import { AwsRestJsonProtocol } from "./chunk-ZJL5KTIU.js"; import { AwsSdkSigV4Signer, Client, Command, DEFAULT_RETRY_MODE, DefaultIdentityProviderConfig, EndpointCache, Hash, NODE_APP_ID_CONFIG_OPTIONS, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NoAuthSigner, NoOpLogger, ServiceException, TypeRegistry, calculateBodyLength, createDefaultUserAgentProvider, customEndpointFunctions, emitWarningIfUnsupportedVersion, emitWarningIfUnsupportedVersion2, getAwsRegionExtensionConfiguration, getContentLengthPlugin, getDefaultExtensionConfiguration, getEndpointPlugin, getHostHeaderPlugin, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpHandlerExtensionConfiguration, getHttpSigningPlugin, getLoggerPlugin, getRecursionDetectionPlugin, getRetryPlugin, getSchemaSerdePlugin, getSmithyContext, getUserAgentPlugin, isIpAddress, isValidHostLabel, loadConfigsForDefaultMode, normalizeProvider, resolveAwsRegionExtensionConfiguration, resolveAwsSdkSigV4Config, resolveDefaultRuntimeConfig, resolveDefaultsModeConfig, resolveEndpoint, resolveEndpointConfig, resolveHostHeaderConfig, resolveHttpHandlerRuntimeConfig, resolveRegionConfig, resolveRetryConfig, resolveUserAgentConfig } from "./chunk-762XZWE7.js"; import { loadConfig, parseUrl } from "./chunk-2345QE66.js"; import "./chunk-LILC4PLL.js"; import "./chunk-52D4AVIU.js"; import "./chunk-VSWURCYJ.js"; import { NodeHttpHandler, fromBase64, streamCollector, toBase64 } from "./chunk-W3M6RT2M.js"; import "./chunk-XDZ73E2B.js"; import { fromUtf8, toUtf8 } from "./chunk-VACN7GDP.js"; import "./chunk-S6KKH4HA.js"; import "./chunk-M4AFYEP7.js"; import "./chunk-UT3JLF3M.js"; // node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js var defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => { return { operation: getSmithyContext(context).operation, region: await normalizeProvider(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }; function createAwsAuthSigv4HttpAuthOption(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "awsssoportal", region: authParameters.region }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context } }) }; } function createSmithyApiNoAuthHttpAuthOption(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var defaultSSOHttpAuthSchemeProvider = (authParameters) => { const options = []; switch (authParameters.operation) { case "GetRoleCredentials": { options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); break; } ; case "ListAccountRoles": { options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); break; } ; case "ListAccounts": { options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); break; } ; case "Logout": { options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); break; } ; default: { options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); } } return options; }; var resolveHttpAuthSchemeConfig = (config) => { const config_0 = resolveAwsSdkSigV4Config(config); return Object.assign(config_0, { authSchemePreference: normalizeProvider(config.authSchemePreference ?? []) }); }; // node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js var resolveClientEndpointParameters = (options) => { return Object.assign(options, { useDualstackEndpoint: options.useDualstackEndpoint ?? false, useFipsEndpoint: options.useFipsEndpoint ?? false, defaultSigningName: "awsssoportal" }); }; var commonParams = { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; // node_modules/@aws-sdk/client-sso/package.json var package_default = { name: "@aws-sdk/client-sso", description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", version: "3.993.0", scripts: { build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", "build:cjs": "node ../../scripts/compilation/inline client-sso", "build:es": "tsc -p tsconfig.es.json", "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"', "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo sso", "test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs" }, main: "./dist-cjs/index.js", types: "./dist-types/index.d.ts", module: "./dist-es/index.js", sideEffects: false, dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "^3.973.11", "@aws-sdk/middleware-host-header": "^3.972.3", "@aws-sdk/middleware-logger": "^3.972.3", "@aws-sdk/middleware-recursion-detection": "^3.972.3", "@aws-sdk/middleware-user-agent": "^3.972.11", "@aws-sdk/region-config-resolver": "^3.972.3", "@aws-sdk/types": "^3.973.1", "@aws-sdk/util-endpoints": "3.993.0", "@aws-sdk/util-user-agent-browser": "^3.972.3", "@aws-sdk/util-user-agent-node": "^3.972.9", "@smithy/config-resolver": "^4.4.6", "@smithy/core": "^3.23.2", "@smithy/fetch-http-handler": "^5.3.9", "@smithy/hash-node": "^4.2.8", "@smithy/invalid-dependency": "^4.2.8", "@smithy/middleware-content-length": "^4.2.8", "@smithy/middleware-endpoint": "^4.4.16", "@smithy/middleware-retry": "^4.4.33", "@smithy/middleware-serde": "^4.2.9", "@smithy/middleware-stack": "^4.2.8", "@smithy/node-config-provider": "^4.3.8", "@smithy/node-http-handler": "^4.4.10", "@smithy/protocol-http": "^5.3.8", "@smithy/smithy-client": "^4.11.5", "@smithy/types": "^4.12.0", "@smithy/url-parser": "^4.2.8", "@smithy/util-base64": "^4.3.0", "@smithy/util-body-length-browser": "^4.2.0", "@smithy/util-body-length-node": "^4.2.1", "@smithy/util-defaults-mode-browser": "^4.3.32", "@smithy/util-defaults-mode-node": "^4.2.35", "@smithy/util-endpoints": "^3.2.8", "@smithy/util-middleware": "^4.2.8", "@smithy/util-retry": "^4.2.8", "@smithy/util-utf8": "^4.2.0", tslib: "^2.6.2" }, devDependencies: { "@tsconfig/node20": "20.1.8", "@types/node": "^20.14.8", concurrently: "7.0.0", "downlevel-dts": "0.10.1", premove: "4.0.0", typescript: "~5.8.3" }, engines: { node: ">=20.0.0" }, typesVersions: { "<4.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" } }; // node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { if (allowSubDomains) { for (const label of value.split(".")) { if (!isVirtualHostableS3Bucket(label)) { return false; } } return true; } if (!isValidHostLabel(value)) { return false; } if (value.length < 3 || value.length > 63) { return false; } if (value !== value.toLowerCase()) { return false; } if (isIpAddress(value)) { return false; } return true; }; // node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js var ARN_DELIMITER = ":"; var RESOURCE_DELIMITER = "/"; var parseArn = (value) => { const segments = value.split(ARN_DELIMITER); if (segments.length < 6) return null; const [arn, partition2, service, region, accountId, ...resourcePath] = segments; if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") return null; const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); return { partition: partition2, service, region, accountId, resourceId }; }; // node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints/dist-es/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|mx)\\-\\w+\\-\\d+$", regions: { "af-south-1": { description: "Africa (Cape Town)" }, "ap-east-1": { description: "Asia Pacific (Hong Kong)" }, "ap-east-2": { description: "Asia Pacific (Taipei)" }, "ap-northeast-1": { description: "Asia Pacific (Tokyo)" }, "ap-northeast-2": { description: "Asia Pacific (Seoul)" }, "ap-northeast-3": { description: "Asia Pacific (Osaka)" }, "ap-south-1": { description: "Asia Pacific (Mumbai)" }, "ap-south-2": { description: "Asia Pacific (Hyderabad)" }, "ap-southeast-1": { description: "Asia Pacific (Singapore)" }, "ap-southeast-2": { description: "Asia Pacific (Sydney)" }, "ap-southeast-3": { description: "Asia Pacific (Jakarta)" }, "ap-southeast-4": { description: "Asia Pacific (Melbourne)" }, "ap-southeast-5": { description: "Asia Pacific (Malaysia)" }, "ap-southeast-6": { description: "Asia Pacific (New Zealand)" }, "ap-southeast-7": { description: "Asia Pacific (Thailand)" }, "aws-global": { description: "aws global region" }, "ca-central-1": { description: "Canada (Central)" }, "ca-west-1": { description: "Canada West (Calgary)" }, "eu-central-1": { description: "Europe (Frankfurt)" }, "eu-central-2": { description: "Europe (Zurich)" }, "eu-north-1": { description: "Europe (Stockholm)" }, "eu-south-1": { description: "Europe (Milan)" }, "eu-south-2": { description: "Europe (Spain)" }, "eu-west-1": { description: "Europe (Ireland)" }, "eu-west-2": { description: "Europe (London)" }, "eu-west-3": { description: "Europe (Paris)" }, "il-central-1": { description: "Israel (Tel Aviv)" }, "me-central-1": { description: "Middle East (UAE)" }, "me-south-1": { description: "Middle East (Bahrain)" }, "mx-central-1": { description: "Mexico (Central)" }, "sa-east-1": { description: "South America (Sao Paulo)" }, "us-east-1": { description: "US East (N. Virginia)" }, "us-east-2": { description: "US East (Ohio)" }, "us-west-1": { description: "US West (N. California)" }, "us-west-2": { description: "US West (Oregon)" } } }, { id: "aws-cn", outputs: { dnsSuffix: "amazonaws.com.cn", dualStackDnsSuffix: "api.amazonwebservices.com.cn", implicitGlobalRegion: "cn-northwest-1", name: "aws-cn", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^cn\\-\\w+\\-\\d+$", regions: { "aws-cn-global": { description: "aws-cn global region" }, "cn-north-1": { description: "China (Beijing)" }, "cn-northwest-1": { description: "China (Ningxia)" } } }, { id: "aws-eusc", outputs: { dnsSuffix: "amazonaws.eu", dualStackDnsSuffix: "api.amazonwebservices.eu", implicitGlobalRegion: "eusc-de-east-1", name: "aws-eusc", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", regions: { "eusc-de-east-1": { description: "AWS European Sovereign Cloud (Germany)" } } }, { id: "aws-iso", outputs: { dnsSuffix: "c2s.ic.gov", dualStackDnsSuffix: "api.aws.ic.gov", implicitGlobalRegion: "us-iso-east-1", name: "aws-iso", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", regions: { "aws-iso-global": { description: "aws-iso global region" }, "us-iso-east-1": { description: "US ISO East" }, "us-iso-west-1": { description: "US ISO WEST" } } }, { id: "aws-iso-b", outputs: { dnsSuffix: "sc2s.sgov.gov", dualStackDnsSuffix: "api.aws.scloud", implicitGlobalRegion: "us-isob-east-1", name: "aws-iso-b", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", regions: { "aws-iso-b-global": { description: "aws-iso-b global region" }, "us-isob-east-1": { description: "US ISOB East (Ohio)" }, "us-isob-west-1": { description: "US ISOB West" } } }, { id: "aws-iso-e", outputs: { dnsSuffix: "cloud.adc-e.uk", dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", implicitGlobalRegion: "eu-isoe-west-1", name: "aws-iso-e", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", regions: { "aws-iso-e-global": { description: "aws-iso-e global region" }, "eu-isoe-west-1": { description: "EU ISOE West" } } }, { id: "aws-iso-f", outputs: { dnsSuffix: "csp.hci.ic.gov", dualStackDnsSuffix: "api.aws.hci.ic.gov", implicitGlobalRegion: "us-isof-south-1", name: "aws-iso-f", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", regions: { "aws-iso-f-global": { description: "aws-iso-f global region" }, "us-isof-east-1": { description: "US ISOF EAST" }, "us-isof-south-1": { description: "US ISOF SOUTH" } } }, { id: "aws-us-gov", outputs: { dnsSuffix: "amazonaws.com", dualStackDnsSuffix: "api.aws", implicitGlobalRegion: "us-gov-west-1", name: "aws-us-gov", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", regions: { "aws-us-gov-global": { description: "aws-us-gov global region" }, "us-gov-east-1": { description: "AWS GovCloud (US-East)" }, "us-gov-west-1": { description: "AWS GovCloud (US-West)" } } }], version: "1.1" }; // node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js var selectedPartitionsInfo = partitions_default; var partition = (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 }; }; // node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js var awsEndpointFunctions = { isVirtualHostableS3Bucket, parseArn, partition }; customEndpointFunctions.aws = awsEndpointFunctions; // node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js var u = "required"; var v = "fn"; var w = "argv"; var x = "ref"; var a = true; var b = "isSet"; var c = "booleanEquals"; var d = "error"; var e = "endpoint"; var f = "tree"; var g = "PartitionResult"; var h = "getAttr"; var i = { [u]: false, "type": "string" }; var j = { [u]: true, "default": false, "type": "boolean" }; var k = { [x]: "Endpoint" }; var l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }; var m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }; var n = {}; var o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }; var p = { [x]: g }; var q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }; var r = [l]; var s = [m]; var t = [{ [x]: "Region" }]; var _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; var ruleSet = _data; // node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js var cache = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); var defaultEndpointResolver = (endpointParams, context = {}) => { return cache.get(endpointParams, () => resolveEndpoint(ruleSet, { endpointParams, logger: context.logger })); }; customEndpointFunctions.aws = awsEndpointFunctions; // node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js var SSOServiceException = class _SSOServiceException extends ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, _SSOServiceException.prototype); } }; // node_modules/@aws-sdk/client-sso/dist-es/models/errors.js var InvalidRequestException = class _InvalidRequestException extends SSOServiceException { name = "InvalidRequestException"; $fault = "client"; constructor(opts) { super({ name: "InvalidRequestException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidRequestException.prototype); } }; var ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException { name = "ResourceNotFoundException"; $fault = "client"; constructor(opts) { super({ name: "ResourceNotFoundException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _ResourceNotFoundException.prototype); } }; var TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException { name = "TooManyRequestsException"; $fault = "client"; constructor(opts) { super({ name: "TooManyRequestsException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _TooManyRequestsException.prototype); } }; var UnauthorizedException = class _UnauthorizedException extends SSOServiceException { name = "UnauthorizedException"; $fault = "client"; constructor(opts) { super({ name: "UnauthorizedException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _UnauthorizedException.prototype); } }; // node_modules/@aws-sdk/client-sso/dist-es/schemas/schemas_0.js var _AI = "AccountInfo"; var _ALT = "AccountListType"; var _ATT = "AccessTokenType"; var _GRC = "GetRoleCredentials"; var _GRCR = "GetRoleCredentialsRequest"; var _GRCRe = "GetRoleCredentialsResponse"; var _IRE = "InvalidRequestException"; var _L = "Logout"; var _LA = "ListAccounts"; var _LAR = "ListAccountsRequest"; var _LARR = "ListAccountRolesRequest"; var _LARRi = "ListAccountRolesResponse"; var _LARi = "ListAccountsResponse"; var _LARis = "ListAccountRoles"; var _LR = "LogoutRequest"; var _RC = "RoleCredentials"; var _RI = "RoleInfo"; var _RLT = "RoleListType"; var _RNFE = "ResourceNotFoundException"; var _SAKT = "SecretAccessKeyType"; var _STT = "SessionTokenType"; var _TMRE = "TooManyRequestsException"; var _UE = "UnauthorizedException"; var _aI = "accountId"; var _aKI = "accessKeyId"; var _aL = "accountList"; var _aN = "accountName"; var _aT = "accessToken"; var _ai = "account_id"; var _c = "client"; var _e = "error"; var _eA = "emailAddress"; var _ex = "expiration"; var _h = "http"; var _hE = "httpError"; var _hH = "httpHeader"; var _hQ = "httpQuery"; var _m = "message"; var _mR = "maxResults"; var _mr = "max_result"; var _nT = "nextToken"; var _nt = "next_token"; var _rC = "roleCredentials"; var _rL = "roleList"; var _rN = "roleName"; var _rn = "role_name"; var _s = "smithy.ts.sdk.synthetic.com.amazonaws.sso"; var _sAK = "secretAccessKey"; var _sT = "sessionToken"; var _xasbt = "x-amz-sso_bearer_token"; var n0 = "com.amazonaws.sso"; var _s_registry = TypeRegistry.for(_s); var SSOServiceException$ = [-3, _s, "SSOServiceException", 0, [], []]; _s_registry.registerError(SSOServiceException$, SSOServiceException); var n0_registry = TypeRegistry.for(n0); var InvalidRequestException$ = [ -3, n0, _IRE, { [_e]: _c, [_hE]: 400 }, [_m], [0] ]; n0_registry.registerError(InvalidRequestException$, InvalidRequestException); var ResourceNotFoundException$ = [ -3, n0, _RNFE, { [_e]: _c, [_hE]: 404 }, [_m], [0] ]; n0_registry.registerError(ResourceNotFoundException$, ResourceNotFoundException); var TooManyRequestsException$ = [ -3, n0, _TMRE, { [_e]: _c, [_hE]: 429 }, [_m], [0] ]; n0_registry.registerError(TooManyRequestsException$, TooManyRequestsException); var UnauthorizedException$ = [ -3, n0, _UE, { [_e]: _c, [_hE]: 401 }, [_m], [0] ]; n0_registry.registerError(UnauthorizedException$, UnauthorizedException); var errorTypeRegistries = [ _s_registry, n0_registry ]; var AccessTokenType = [0, n0, _ATT, 8, 0]; var SecretAccessKeyType = [0, n0, _SAKT, 8, 0]; var SessionTokenType = [0, n0, _STT, 8, 0]; var AccountInfo$ = [ 3, n0, _AI, 0, [_aI, _aN, _eA], [0, 0, 0] ]; var GetRoleCredentialsRequest$ = [ 3, n0, _GRCR, 0, [_rN, _aI, _aT], [[0, { [_hQ]: _rn }], [0, { [_hQ]: _ai }], [() => AccessTokenType, { [_hH]: _xasbt }]], 3 ]; var GetRoleCredentialsResponse$ = [ 3, n0, _GRCRe, 0, [_rC], [[() => RoleCredentials$, 0]] ]; var ListAccountRolesRequest$ = [ 3, n0, _LARR, 0, [_aT, _aI, _nT, _mR], [[() => AccessTokenType, { [_hH]: _xasbt }], [0, { [_hQ]: _ai }], [0, { [_hQ]: _nt }], [1, { [_hQ]: _mr }]], 2 ]; var ListAccountRolesResponse$ = [ 3, n0, _LARRi, 0, [_nT, _rL], [0, () => RoleListType] ]; var ListAccountsRequest$ = [ 3, n0, _LAR, 0, [_aT, _nT, _mR], [[() => AccessTokenType, { [_hH]: _xasbt }], [0, { [_hQ]: _nt }], [1, { [_hQ]: _mr }]], 1 ]; var ListAccountsResponse$ = [ 3, n0, _LARi, 0, [_nT, _aL], [0, () => AccountListType] ]; var LogoutRequest$ = [ 3, n0, _LR, 0, [_aT], [[() => AccessTokenType, { [_hH]: _xasbt }]], 1 ]; var RoleCredentials$ = [ 3, n0, _RC, 0, [_aKI, _sAK, _sT, _ex], [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1] ]; var RoleInfo$ = [ 3, n0, _RI, 0, [_rN, _aI], [0, 0] ]; var __Unit = "unit"; var AccountListType = [ 1, n0, _ALT, 0, () => AccountInfo$ ]; var RoleListType = [ 1, n0, _RLT, 0, () => RoleInfo$ ]; var GetRoleCredentials$ = [ 9, n0, _GRC, { [_h]: ["GET", "/federation/credentials", 200] }, () => GetRoleCredentialsRequest$, () => GetRoleCredentialsResponse$ ]; var ListAccountRoles$ = [ 9, n0, _LARis, { [_h]: ["GET", "/assignment/roles", 200] }, () => ListAccountRolesRequest$, () => ListAccountRolesResponse$ ]; var ListAccounts$ = [ 9, n0, _LA, { [_h]: ["GET", "/assignment/accounts", 200] }, () => ListAccountsRequest$, () => ListAccountsResponse$ ]; var Logout$ = [ 9, n0, _L, { [_h]: ["POST", "/logout", 200] }, () => LogoutRequest$, () => __Unit ]; // node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js var getRuntimeConfig = (config) => { return { apiVersion: "2019-06-10", base64Decoder: config?.base64Decoder ?? fromBase64, base64Encoder: config?.base64Encoder ?? toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, extensions: config?.extensions ?? [], httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider, httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), signer: new AwsSdkSigV4Signer() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new NoAuthSigner() } ], logger: config?.logger ?? new NoOpLogger(), protocol: config?.protocol ?? AwsRestJsonProtocol, protocolSettings: config?.protocolSettings ?? { defaultNamespace: "com.amazonaws.sso", errorTypeRegistries, version: "2019-06-10", serviceTarget: "SWBPortalService" }, serviceId: config?.serviceId ?? "SSO", urlParser: config?.urlParser ?? parseUrl, utf8Decoder: config?.utf8Decoder ?? fromUtf8, utf8Encoder: config?.utf8Encoder ?? toUtf8 }; }; // node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js var getRuntimeConfig2 = (config) => { emitWarningIfUnsupportedVersion2(process.version); const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getRuntimeConfig(config); emitWarningIfUnsupportedVersion(process.version); const loaderConfig = { profile: config?.profile, logger: clientSharedValues.logger }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? loadConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) }; }; // node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration = (runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; let _credentials = runtimeConfig.credentials; return { setHttpAuthScheme(httpAuthScheme) { const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); if (index === -1) { _httpAuthSchemes.push(httpAuthScheme); } else { _httpAuthSchemes.splice(index, 1, httpAuthScheme); } }, httpAuthSchemes() { return _httpAuthSchemes; }, setHttpAuthSchemeProvider(httpAuthSchemeProvider) { _httpAuthSchemeProvider = httpAuthSchemeProvider; }, httpAuthSchemeProvider() { return _httpAuthSchemeProvider; }, setCredentials(credentials) { _credentials = credentials; }, credentials() { return _credentials; } }; }; var resolveHttpAuthRuntimeConfig = (config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }; // node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js var resolveRuntimeExtensions = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); extensions.forEach((extension) => extension.configure(extensionConfiguration)); return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); }; // node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js var SSOClient = class extends Client { config; constructor(...[configuration]) { const _config_0 = getRuntimeConfig2(configuration || {}); super(_config_0); this.initConfig = _config_0; const _config_1 = resolveClientEndpointParameters(_config_0); const _config_2 = resolveUserAgentConfig(_config_1); const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveRegionConfig(_config_3); const _config_5 = resolveHostHeaderConfig(_config_4); const _config_6 = resolveEndpointConfig(_config_5); const _config_7 = resolveHttpAuthSchemeConfig(_config_6); const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); this.config = _config_8; this.middlewareStack.use(getSchemaSerdePlugin(this.config)); this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials }) })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); } destroy() { super.destroy(); } }; // node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js var GetRoleCredentialsCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) { return [getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").sc(GetRoleCredentials$).build() { }; export { GetRoleCredentialsCommand, SSOClient }; //# sourceMappingURL=loadSso-FXBXTZC2.js.map