@kya-os/mcp-i 1.6.3 → 1.6.4
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.
- package/dist/207.js +1 -0
- package/dist/25.js +1 -0
- package/dist/295.js +1 -1
- package/dist/387.js +1 -0
- package/dist/406.js +1 -0
- package/dist/448.js +1 -0
- package/dist/478.js +1 -0
- package/dist/482.js +1 -0
- package/dist/575.js +1 -0
- package/dist/67.js +1 -1
- package/dist/743.js +1 -0
- package/dist/784.js +1 -0
- package/dist/844.js +1 -0
- package/dist/866.js +1 -0
- package/dist/936.js +1 -0
- package/dist/941.js +1 -0
- package/dist/988.js +1 -0
- package/dist/runtime/adapter-express.js +7 -1
- package/dist/runtime/adapter-express.js.LICENSE.txt +7 -2
- package/dist/runtime/adapter-nextjs.js +7 -1
- package/dist/runtime/adapter-nextjs.js.LICENSE.txt +188 -1
- package/dist/runtime/http.js +7 -1
- package/dist/runtime/http.js.LICENSE.txt +7 -2
- package/dist/runtime/stdio.js +7 -1
- package/dist/runtime/stdio.js.LICENSE.txt +234 -1
- package/dist/runtime/utils/server.d.ts +17 -0
- package/package.json +3 -3
- package/dist/149.js +0 -1
- package/dist/189.js +0 -1
- package/dist/261.js +0 -1
- package/dist/28.js +0 -1
- package/dist/460.js +0 -1
- package/dist/570.js +0 -1
- package/dist/634.js +0 -1
- package/dist/647.js +0 -1
- package/dist/739.js +0 -1
- package/dist/742.js +0 -1
- package/dist/904.js +0 -1
- package/dist/938.js +0 -1
package/dist/634.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=634,exports.ids=[634],exports.modules={81634:(e,t,r)=>{r.d(t,{fromHttp:()=>E});var o=r(64172),n=r(41911),a=r(3721),s=r(91943),i=r.n(s),c=r(32141),l=r(72358),d=r(46553),u=r(25272),f=r(2203),h=r(69367);var w=r(19506),p=r(92278),m=r(2914);const g=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),y="The stream has already been transformed.",b=e=>{if(!T(e)&&!g(e))throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${e?.__proto__?.constructor?.name||e}`);let t=!1;const r=async()=>{if(t)throw new Error(y);return t=!0,await(async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,r)=>{const o=new FileReader;o.onloadend=()=>{if(2!==o.readyState)return r(new Error("Reader aborted too early"));const e=o.result??"",n=e.indexOf(","),a=n>-1?n+1:e.length;t(e.substring(a))},o.onabort=()=>r(new Error("Read aborted")),o.onerror=()=>r(o.error),o.readAsDataURL(e)})}(e),r=(0,h.E)(t);return new Uint8Array(r)}(e):async function(e){const t=[],r=e.getReader();let o=!1,n=0;for(;!o;){const{done:e,value:a}=await r.read();a&&(t.push(a),n+=a.length),o=e}const a=new Uint8Array(n);let s=0;for(const e of t)a.set(e,s),s+=e.length;return a}(e))(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if("base64"===e)return(0,w.n)(t);if("hex"===e)return(0,p.n)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(0,m.P)(t);if("function"==typeof TextDecoder)return new TextDecoder(e).decode(t);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(y);if(t=!0,T(e))return(e=>{if("function"!=typeof e.stream)throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return e.stream()})(e);if(g(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},T=e=>"function"==typeof Blob&&e instanceof Blob,A="The stream has already been transformed.";const E=(e={})=>{let t;e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");const r=e.awsContainerCredentialsRelativeUri??process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,s=e.awsContainerCredentialsFullUri??process.env.AWS_CONTAINER_CREDENTIALS_FULL_URI,h=e.awsContainerAuthorizationToken??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN,w=e.awsContainerAuthorizationTokenFile??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE,p="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?.warn?e.logger.warn.bind(e.logger):console.warn;if(r&&s&&(p("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),p("awsContainerCredentialsFullUri will take precedence.")),h&&w&&(p("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),p("awsContainerAuthorizationToken will take precedence.")),s)t=s;else{if(!r)throw new a.C("No HTTP credential provider host provided.\nSet AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.",{logger:e.logger});t=`http://169.254.170.2${r}`}const m=new URL(t);((e,t)=>{if("https:"!==e.protocol&&"169.254.170.2"!==e.hostname&&"169.254.170.23"!==e.hostname&&"[fd00:ec2::23]"!==e.hostname){if(e.hostname.includes("[")){if("[::1]"===e.hostname||"[0000:0000:0000:0000:0000:0000:0000:0001]"===e.hostname)return}else{if("localhost"===e.hostname)return;const t=e.hostname.split("."),r=e=>{const t=parseInt(e,10);return 0<=t&&t<=255};if("127"===t[0]&&r(t[1])&&r(t[2])&&r(t[3])&&4===t.length)return}throw new a.C("URL not accepted. It must either be HTTPS or match one of the following:\n - loopback CIDR 127.0.0.0/8 or [::1/128]\n - ECS container host 169.254.170.2\n - EKS container host 169.254.170.23 or [fd00:ec2::23]",{logger:t})}})(m,e.logger);const g=n.$.create({requestTimeout:e.timeout??1e3,connectionTimeout:e.timeout??1e3});return y=async()=>{const t=function(e){return new c.K({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((e,[t,r])=>(e[t]=r,e),{}),fragment:e.hash})}(m);h?t.headers.Authorization=h:w&&(t.headers.Authorization=(await i().readFile(w)).toString());try{return async function(e,t){const r=(e=>{if(!(e instanceof f.Readable))try{return b(e)}catch(t){throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(A);return t=!0,await(0,d.k)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();return void 0===e||Buffer.isEncoding(e)?(0,u.Q)(t.buffer,t.byteOffset,t.byteLength).toString(e):new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw new Error(A);if(null!==e.readableFlowing)throw new Error("The stream has been consumed by other callbacks.");if("function"!=typeof f.Readable.toWeb)throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,f.Readable.toWeb(e)}})})(e.body),o=await r.transformToString();if(200===e.statusCode){const e=JSON.parse(o);if("string"!=typeof e.AccessKeyId||"string"!=typeof e.SecretAccessKey||"string"!=typeof e.Token||"string"!=typeof e.Expiration)throw new a.C("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:t});return{accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:(0,l.EI)(e.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let r={};try{r=JSON.parse(o)}catch(e){}throw Object.assign(new a.C(`Server responded with status: ${e.statusCode}`,{logger:t}),{Code:r.Code,Message:r.Message})}throw new a.C(`Server responded with status: ${e.statusCode}`,{logger:t})}((await g.handle(t)).response).then(e=>(0,o.g)(e,"CREDENTIALS_HTTP","z"))}catch(t){throw new a.C(String(t),{logger:e.logger})}},T=e.maxRetries??3,E=e.timeout??1e3,async()=>{for(let e=0;e<T;++e)try{return await y()}catch(e){await new Promise(e=>setTimeout(e,E))}return await y()};var y,T,E}}};
|
package/dist/647.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=647,exports.ids=[647],exports.modules={51869:(e,s,o)=>{o.d(s,{a:()=>r,v:()=>a});var n=o(79896),t=o(55786);const{readFile:i}=n.promises,r={},a=async e=>{if(r[e])return r[e];const s=(0,t.C)(e),o=await i(s,"utf8");return JSON.parse(o)}},55786:(e,s,o)=>{o.d(s,{C:()=>r});var n=o(76982),t=o(16928),i=o(47741);const r=e=>{const s=(0,n.createHash)("sha1").update(e).digest("hex");return(0,t.join)((0,i.R)(),".aws","sso","cache",`${s}.json`)}},64647:(e,s,o)=>{o.d(s,{fromSSO:()=>$});var n=o(3721),t=o(67789),i=o(98306),r=o(52696),a=o(71997),c=o(40338);const l=e=>Object.entries(e).filter(([e])=>e.startsWith(a.I.SSO_SESSION+c.Q)).reduce((e,[s,o])=>({...e,[s.substring(s.indexOf(c.Q)+1)]:o}),{});var g=o(71052),f=o(31493);const h=()=>({}),p=async(e={})=>(0,f.$H)(e.configFilepath??(0,r.g)()).then(g.A).then(l).catch(h);var d=o(64172),w=o(27637);class u extends w.m{name="TokenProviderError";constructor(e,s=!0){super(e,s),Object.setPrototypeOf(this,u.prototype)}}var S=o(51869);const C="To refresh this SSO session run 'aws sso login' with the corresponding profile.",_=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new u(`Token is expired. ${C}`,!1)},k=(e,s,o=!1)=>{if(void 0===s)throw new u(`Value not present for '${e}' in SSO Token${o?". Cannot refresh":""}. ${C}`,!1)};var m=o(55786),y=o(79896);const{writeFile:T}=y.promises,x=new Date(0),O=(e={})=>async({callerClientConfig:s}={})=>{const n={...e,parentClientConfig:{...s,...e.parentClientConfig}};n.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await(0,i.Y)(n),a=(0,t.Bz)({profile:n.profile??s?.profile}),c=r[a];if(!c)throw new u(`Profile '${a}' could not be found in shared credentials file.`,!1);if(!c.sso_session)throw new u(`Profile '${a}' is missing required property 'sso_session'.`);const l=c.sso_session,g=(await p(n))[l];if(!g)throw new u(`Sso session '${l}' could not be found in shared credentials file.`,!1);for(const e of["sso_start_url","sso_region"])if(!g[e])throw new u(`Sso session '${l}' is missing required property '${e}'.`,!1);g.sso_start_url;const f=g.sso_region;let h;try{h=await(0,S.v)(l)}catch(e){throw new u(`The SSO session token associated with profile=${a} was not found or is invalid. ${C}`,!1)}k("accessToken",h.accessToken),k("expiresAt",h.expiresAt);const{accessToken:d,expiresAt:w}=h,y={token:d,expiration:new Date(w)};if(y.expiration.getTime()-Date.now()>3e5)return y;if(Date.now()-x.getTime()<3e4)return _(y),y;k("clientId",h.clientId,!0),k("clientSecret",h.clientSecret,!0),k("refreshToken",h.refreshToken,!0);try{x.setTime(Date.now());const e=await(async(e,s,n={})=>{const{CreateTokenCommand:t}=await o.e(904).then(o.bind(o,98904)),i=await(async(e,s={})=>{const{SSOOIDCClient:n}=await o.e(904).then(o.bind(o,98904));return new n(Object.assign({},s.clientConfig??{},{region:e??s.clientConfig?.region,logger:s.clientConfig?.logger??s.parentClientConfig?.logger}))})(s,n);return i.send(new t({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))})(h,f,n);k("accessToken",e.accessToken),k("expiresIn",e.expiresIn);const s=new Date(Date.now()+1e3*e.expiresIn);try{await((e,s)=>{const o=(0,m.C)(e),n=JSON.stringify(s,null,2);return T(o,n)})(l,{...h,accessToken:e.accessToken,expiresAt:s.toISOString(),refreshToken:e.refreshToken})}catch(e){}return{token:e.accessToken,expiration:s}}catch(e){return _(y),y}},I=!1,N=async({ssoStartUrl:e,ssoSession:s,ssoAccountId:t,ssoRegion:i,ssoRoleName:r,ssoClient:a,clientConfig:c,parentClientConfig:l,profile:g,filepath:f,configFilepath:h,ignoreCache:p,logger:w})=>{let u;const C="To refresh this SSO session run aws sso login with the corresponding profile.";if(s)try{const e=await O({profile:g,filepath:f,configFilepath:h,ignoreCache:p})();u={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new n.C(e.message,{tryNextLink:I,logger:w})}else try{u=await(0,S.v)(e)}catch(e){throw new n.C(`The SSO session associated with this profile is invalid. ${C}`,{tryNextLink:I,logger:w})}if(new Date(u.expiresAt).getTime()-Date.now()<=0)throw new n.C(`The SSO session associated with this profile has expired. ${C}`,{tryNextLink:I,logger:w});const{accessToken:_}=u,{SSOClient:k,GetRoleCredentialsCommand:m}=await o.e(149).then(o.bind(o,11149)),y=a||new k(Object.assign({},c??{},{logger:c?.logger??l?.logger,region:c?.region??i}));let T;try{T=await y.send(new m({accountId:t,roleName:r,accessToken:_}))}catch(e){throw new n.C(e,{tryNextLink:I,logger:w})}const{roleCredentials:{accessKeyId:x,secretAccessKey:N,sessionToken:$,expiration:v,credentialScope:A,accountId:R}={}}=T;if(!(x&&N&&$&&v))throw new n.C("SSO returns an invalid temporary credential.",{tryNextLink:I,logger:w});const D={accessKeyId:x,secretAccessKey:N,sessionToken:$,expiration:new Date(v),...A&&{credentialScope:A},...R&&{accountId:R}};return s?(0,d.g)(D,"CREDENTIALS_SSO","s"):(0,d.g)(D,"CREDENTIALS_SSO_LEGACY","u"),D},$=(e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:o,ssoAccountId:r,ssoRegion:a,ssoRoleName:c,ssoSession:l}=e,{ssoClient:g}=e,f=(0,t.Bz)({profile:e.profile??s?.profile});if(o||r||a||c||l){if(o&&r&&a&&c)return N({ssoStartUrl:o,ssoSession:l,ssoAccountId:r,ssoRegion:a,ssoRoleName:c,ssoClient:g,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:f,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger});throw new n.C('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger})}{const s=(await(0,i.Y)(e))[f];if(!s)throw new n.C(`Profile ${f} was not found.`,{logger:e.logger});if(!(h=s)||"string"!=typeof h.sso_start_url&&"string"!=typeof h.sso_account_id&&"string"!=typeof h.sso_session&&"string"!=typeof h.sso_region&&"string"!=typeof h.sso_role_name)throw new n.C(`Profile ${f} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){const t=(await p(e))[s.sso_session],i=` configurations in profile ${f} and sso-session ${s.sso_session}`;if(a&&a!==t.sso_region)throw new n.C("Conflicting SSO region"+i,{tryNextLink:!1,logger:e.logger});if(o&&o!==t.sso_start_url)throw new n.C("Conflicting SSO start_url"+i,{tryNextLink:!1,logger:e.logger});s.sso_region=t.sso_region,s.sso_start_url=t.sso_start_url}const{sso_start_url:t,sso_account_id:r,sso_region:c,sso_role_name:l,sso_session:d}=((e,s)=>{const{sso_start_url:o,sso_account_id:t,sso_region:i,sso_role_name:r}=e;if(!(o&&t&&i&&r))throw new n.C(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:s});return e})(s,e.logger);return N({ssoStartUrl:t,ssoSession:d,ssoAccountId:r,ssoRegion:c,ssoRoleName:l,ssoClient:g,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:f,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}var h}}};
|
package/dist/739.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=739,exports.ids=[739],exports.modules={37481:(e,n,o)=>{o.d(n,{Z:()=>i});var r=o(51869),t=o(31493);const i={getFileRecord:()=>t.Jj,interceptFile(e,n){t.Jj[e]=Promise.resolve(n)},getTokenRecord:()=>r.a,interceptToken(e,n){r.a[e]=n}}},51869:(e,n,o)=>{o.d(n,{a:()=>s,v:()=>a});var r=o(79896),t=o(55786);const{readFile:i}=r.promises,s={},a=async e=>{if(s[e])return s[e];const n=(0,t.C)(e),o=await i(n,"utf8");return JSON.parse(o)}},55786:(e,n,o)=>{o.d(n,{C:()=>s});var r=o(76982),t=o(16928),i=o(47741);const s=e=>{const n=(0,r.createHash)("sha1").update(e).digest("hex");return(0,t.join)((0,i.R)(),".aws","sso","cache",`${n}.json`)}},70739:(e,n,o)=>{o.d(n,{fromTokenFile:()=>d});var r=o(64172),t=o(3721),i=o(37481),s=o(79896);const a="AWS_WEB_IDENTITY_TOKEN_FILE",d=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const n=e?.webIdentityTokenFile??process.env[a],d=e?.roleArn??process.env.AWS_ROLE_ARN,c=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!n||!d)throw new t.C("Web identity configuration not specified",{logger:e.logger});const l=await(e=>async n=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:r,roleSessionName:t,webIdentityToken:i,providerId:s,policyArns:a,policy:d,durationSeconds:c}=e;let{roleAssumerWithWebIdentity:l}=e;if(!l){const{getDefaultRoleAssumerWithWebIdentity:r}=await o.e(742).then(o.bind(o,86742));l=r({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...n?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return l({RoleArn:r,RoleSessionName:t??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:s,PolicyArns:a,Policy:d,DurationSeconds:c})})({...e,webIdentityToken:i.Z?.getTokenRecord?.()[n]??(0,s.readFileSync)(n,{encoding:"ascii"}),roleArn:d,roleSessionName:c})();return n===process.env[a]&&(0,r.g)(l,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h"),l}}};
|
package/dist/742.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=742,exports.ids=[742],exports.modules={10602:(e,t,n)=>{n.d(t,{$:()=>r});const r="***SensitiveInformation***"},31305:(e,t,n)=>{n.d(t,{m:()=>r});class r{async sign(e,t,n){return e}}},37579:(e,t,n)=>{function r(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}n.d(t,{$:()=>r})},64548:e=>{e.exports={rE:"3.901.0"}},86742:(e,t,n)=>{n.d(t,{getDefaultRoleAssumer:()=>Wr,getDefaultRoleAssumerWithWebIdentity:()=>Lr});var r=n(64172),s=n(66403),i=n(53340),o=n(3594);const a={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var l=n(10602),c=n(92309);class u extends c.T{constructor(e){super(e),Object.setPrototypeOf(this,u.prototype)}}const d=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:l.$}}),p=e=>({...e,...e.Credentials&&{Credentials:d(e.Credentials)}});class h extends u{name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,h.prototype)}}class g extends u{name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),Object.setPrototypeOf(this,g.prototype)}}class f extends u{name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),Object.setPrototypeOf(this,f.prototype)}}class m extends u{name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),Object.setPrototypeOf(this,m.prototype)}}class x extends u{name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),Object.setPrototypeOf(this,x.prototype)}}class b extends u{name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,b.prototype)}}const y=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:l.$}}),E=e=>({...e,...e.Credentials&&{Credentials:d(e.Credentials)}});class v extends u{name="IDPCommunicationErrorException";$fault="client";constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,v.prototype)}}const w={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},S=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",I=new RegExp("^["+S+"]["+S+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function P(e,t){const n=[];let r=t.exec(e);for(;r;){const s=[];s.startIndex=t.lastIndex-r[0].length;const i=r.length;for(let e=0;e<i;e++)s.push(r[e]);n.push(s),r=t.exec(e)}return n}const A=function(e){return!(null==I.exec(e))};let T;T="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class N{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),void 0!==t&&(this.child[this.child.length-1][T]={startIndex:t})}static getMetaDataSymbol(){return T}}function C(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let r=1,s=!1,i=!1,o="";for(;t<e.length;t++)if("<"!==e[t]||i)if(">"===e[t]){if(i?"-"===e[t-1]&&"-"===e[t-2]&&(i=!1,r--):r--,0===r)break}else"["===e[t]?s=!0:o+=e[t];else{if(s&&M(e,"!ENTITY",t)){let r,s;t+=7,[r,s,t]=k(e,t+1),-1===s.indexOf("&")&&(n[r]={regx:RegExp(`&${r};`,"g"),val:s})}else if(s&&M(e,"!ELEMENT",t)){t+=8;const{index:n}=R(e,t+1);t=n}else if(s&&M(e,"!ATTLIST",t))t+=8;else if(s&&M(e,"!NOTATION",t)){t+=9;const{index:n}=D(e,t+1);t=n}else{if(!M(e,"!--",t))throw new Error("Invalid DOCTYPE");i=!0}r++,o=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}}const O=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function k(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t])&&'"'!==e[t]&&"'"!==e[t];)n+=e[t],t++;if(j(n),t=O(e,t),"SYSTEM"===e.substring(t,t+6).toUpperCase())throw new Error("External entities are not supported");if("%"===e[t])throw new Error("Parameter entities are not supported");let r="";return[t,r]=$(e,t,"entity"),[n,r,--t]}function D(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;j(n),t=O(e,t);const r=e.substring(t,t+6).toUpperCase();if("SYSTEM"!==r&&"PUBLIC"!==r)throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);t+=r.length,t=O(e,t);let s=null,i=null;if("PUBLIC"===r)[t,s]=$(e,t,"publicIdentifier"),'"'!==e[t=O(e,t)]&&"'"!==e[t]||([t,i]=$(e,t,"systemIdentifier"));else if("SYSTEM"===r&&([t,i]=$(e,t,"systemIdentifier"),!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:s,systemIdentifier:i,index:--t}}function $(e,t,n){let r="";const s=e[t];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(t++;t<e.length&&e[t]!==s;)r+=e[t],t++;if(e[t]!==s)throw new Error(`Unterminated ${n} value`);return[++t,r]}function R(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!j(n))throw new Error(`Invalid element name: "${n}"`);let r="";if("E"===e[t=O(e,t)]&&M(e,"MPTY",t))t+=4;else if("A"===e[t]&&M(e,"NY",t))t+=2;else{if("("!==e[t])throw new Error(`Invalid Element Expression, found "${e[t]}"`);for(t++;t<e.length&&")"!==e[t];)r+=e[t],t++;if(")"!==e[t])throw new Error("Unterminated content model")}return{elementName:n,contentModel:r.trim(),index:t}}function M(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function j(e){if(A(e))return e;throw new Error(`Invalid entity name ${e}`)}const F=/^[-+]?0x[a-fA-F0-9]+$/,K=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,_={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const U=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;class V{constructor(e){var t;this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,16))}},this.addExternalEntities=W,this.parseXml=Y,this.parseTextData=L,this.resolveNameSpace=z,this.buildAttributesMap=B,this.isItStopNode=X,this.replaceEntitiesValue=G,this.readStopNodeData=ee,this.saveTextToParentTag=Z,this.addChild=H,this.ignoreAttributesFn="function"==typeof(t=this.options.ignoreAttributes)?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}}function W(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function L(e,t,n,r,s,i,o){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,s,i);return null==r?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?te(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function z(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const q=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function B(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=P(e,q),r=n.length,s={};for(let e=0;e<r;e++){const r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let i=n[e][4],o=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==i){this.options.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i);const e=this.options.attributeValueProcessor(r,i,t);s[o]=null==e?i:typeof e!=typeof i||e!==i?e:te(i,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[o]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=s,e}return s}}const Y=function(e){e=e.replace(/\r\n?/g,"\n");const t=new N("!xml");let n=t,r="",s="";for(let i=0;i<e.length;i++)if("<"===e[i])if("/"===e[i+1]){const t=J(e,">",i,"Closing Tag is not closed.");let o=e.substring(i+2,t).trim();if(this.options.removeNSPrefix){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(r=this.saveTextToParentTag(r,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),r="",i=t}else if("?"===e[i+1]){let t=Q(e,i,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,s),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new N(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,s,t.tagName)),this.addChild(n,e,s,i)}i=t.closeIndex+1}else if("!--"===e.substr(i+1,3)){const t=J(e,"--\x3e",i+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(i+4,t-2);r=this.saveTextToParentTag(r,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}i=t}else if("!D"===e.substr(i+1,2)){const t=C(e,i);this.docTypeEntities=t.entities,i=t.i}else if("!["===e.substr(i+1,2)){const t=J(e,"]]>",i,"CDATA is not closed.")-2,o=e.substring(i+9,t);r=this.saveTextToParentTag(r,n,s);let a=this.parseTextData(o,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,a),i=t+2}else{let o=Q(e,i,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let c=o.tagExp,u=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,s,!1));const p=n;p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==t.tagname&&(s+=s?"."+a:a);const h=i;if(this.isItStopNode(this.options.stopNodes,s,a)){let t="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),c=a):c=c.substr(0,c.length-1),i=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))i=o.closeIndex;else{const n=this.readStopNodeData(e,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);i=n.i,t=n.tagContent}const r=new N(a);a!==c&&u&&(r[":@"]=this.buildAttributesMap(c,s,a)),t&&(t=this.parseTextData(t,a,s,!0,u,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(n,r,s,h)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const e=new N(a);a!==c&&u&&(e[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(n,e,s,h),s=s.substr(0,s.lastIndexOf("."))}else{const e=new N(a);this.tagsNodeStack.push(n),a!==c&&u&&(e[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(n,e,s,h),n=e}r="",i=d}}else r+=e[i];return t.child};function H(e,t,n,r){this.options.captureMetaData||(r=void 0);const s=this.options.updateTag(t.tagname,n,t[":@"]);!1===s||("string"==typeof s?(t.tagname=s,e.addChild(t,r)):e.addChild(t,r))}const G=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Z(e,t,n,r){return e&&(void 0===r&&(r=0===t.child.length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function X(e,t,n){const r="*."+n;for(const n in e){const s=e[n];if(r===s||t===s)return!0}return!1}function J(e,t,n,r){const s=e.indexOf(t,n);if(-1===s)throw new Error(r);return s+t.length-1}function Q(e,t,n,r=">"){const s=function(e,t,n=">"){let r,s="";for(let i=t;i<e.length;i++){let t=e[i];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:s,index:i};if(e[i+1]===n[1])return{data:s,index:i}}else"\t"===t&&(t=" ");s+=t}}(e,t+1,r);if(!s)return;let i=s.data;const o=s.index,a=i.search(/\s/);let l=i,c=!0;-1!==a&&(l=i.substring(0,a),i=i.substring(a+1).trimStart());const u=l;if(n){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),c=l!==s.data.substr(e+1))}return{tagName:l,tagExp:i,closeIndex:o,attrExpPresent:c,rawTagName:u}}function ee(e,t,n){const r=n;let s=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const i=J(e,">",n,`${t} is not closed`);if(e.substring(n+2,i).trim()===t&&(s--,0===s))return{tagContent:e.substring(r,n),i};n=i}else if("?"===e[n+1])n=J(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=J(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=J(e,"]]>",n,"StopNode is not closed.")-2;else{const r=Q(e,n,">");r&&((r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&s++,n=r.closeIndex)}}function te(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&function(e,t={}){if(t=Object.assign({},_,t),!e||"string"!=typeof e)return e;let n=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(n))return e;if("0"===e)return 0;if(t.hex&&F.test(n))return function(e){if(parseInt)return parseInt(e,16);if(Number.parseInt)return Number.parseInt(e,16);if(window&&window.parseInt)return window.parseInt(e,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n);if(-1!==n.search(/.+[eE].+/))return function(e,t,n){if(!n.eNotation)return e;const r=t.match(U);if(r){let s=r[1]||"";const i=-1===r[3].indexOf("e")?"E":"e",o=r[2],a=s?e[o.length+1]===i:e[o.length]===i;return o.length>1&&a?e:1!==o.length||!r[3].startsWith(`.${i}`)&&r[3][0]!==i?n.leadingZeros&&!a?(t=(r[1]||"")+r[3],Number(t)):e:Number(t)}return e}(e,n,t);{const s=K.exec(n);if(s){const i=s[1]||"",o=s[2];let a=(r=s[3])&&-1!==r.indexOf(".")?("."===(r=r.replace(/0+$/,""))?r="0":"."===r[0]?r="0"+r:"."===r[r.length-1]&&(r=r.substring(0,r.length-1)),r):r;const l=i?"."===e[o.length+1]:"."===e[o.length];if(!t.leadingZeros&&(o.length>1||1===o.length&&!l))return e;{const r=Number(n),s=String(r);if(0===r)return r;if(-1!==s.search(/[eE]/))return t.eNotation?r:e;if(-1!==n.indexOf("."))return"0"===s||s===a||s===`${i}${a}`?r:e;let l=o?a:n;return o?l===s||i+l===s?r:e:l===s||l===i+s?r:e}}return e}var r}(e,n)}return function(e){return void 0!==e}(e)?e:""}const ne=N.getMetaDataSymbol();function re(e,t){return se(e,t)}function se(e,t,n){let r;const s={};for(let i=0;i<e.length;i++){const o=e[i],a=ie(o);let l="";if(l=void 0===n?a:n+"."+a,a===t.textNodeName)void 0===r?r=o[a]:r+=""+o[a];else{if(void 0===a)continue;if(o[a]){let e=se(o[a],t,l);const n=ae(e,t);void 0!==o[ne]&&(e[ne]=o[ne]),o[":@"]?oe(e,o[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(e)):t.isArray(a,l,n)?s[a]=[e]:s[a]=e}}}return"string"==typeof r?r.length>0&&(s[t.textNodeName]=r):void 0!==r&&(s[t.textNodeName]=r),s}function ie(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function oe(e,t,n,r){if(t){const s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){const i=s[o];r.isArray(i,n+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function ae(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return 0===r||!(1!==r||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}const le={allowBooleanAttributes:!1,unpairedTags:[]};function ce(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function ue(e,t){const n=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const r=e.substr(n,t-n);if(t>5&&"xml"===r)return me("InvalidXml","XML declaration allowed only at the start of the document.",ye(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function de(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}function pe(e,t){let n="",r="",s=!1;for(;t<e.length;t++){if('"'===e[t]||"'"===e[t])""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){s=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:s}}const he=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function ge(e,t){const n=P(e,he),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return me("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Ee(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return me("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Ee(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return me("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Ee(n[e]));const s=n[e][2];if(!xe(s))return me("InvalidAttr","Attribute '"+s+"' is an invalid name.",Ee(n[e]));if(r.hasOwnProperty(s))return me("InvalidAttr","Attribute '"+s+"' is repeated.",Ee(n[e]));r[s]=1}return!0}function fe(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function me(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function xe(e){return A(e)}function be(e){return A(e)}function ye(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ee(e){return e.startIndex+e[1].length}const ve=new class{constructor(e){this.externalEntities={},this.options=function(e){return Object.assign({},w,e)}(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=function(e,t){t=Object.assign({},le,t);const n=[];let r=!1,s=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let i=0;i<e.length;i++)if("<"===e[i]&&"?"===e[i+1]){if(i+=2,i=ue(e,i),i.err)return i}else{if("<"!==e[i]){if(ce(e[i]))continue;return me("InvalidChar","char '"+e[i]+"' is not expected.",ye(e,i))}{let o=i;if(i++,"!"===e[i]){i=de(e,i);continue}{let a=!1;"/"===e[i]&&(a=!0,i++);let l="";for(;i<e.length&&">"!==e[i]&&" "!==e[i]&&"\t"!==e[i]&&"\n"!==e[i]&&"\r"!==e[i];i++)l+=e[i];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),i--),!be(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",me("InvalidTag",t,ye(e,i))}const c=pe(e,i);if(!1===c)return me("InvalidAttr","Attributes for '"+l+"' have open quote.",ye(e,i));let u=c.value;if(i=c.index,"/"===u[u.length-1]){const n=i-u.length;u=u.substring(0,u.length-1);const s=ge(u,t);if(!0!==s)return me(s.err.code,s.err.msg,ye(e,n+s.err.line));r=!0}else if(a){if(!c.tagClosed)return me("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",ye(e,i));if(u.trim().length>0)return me("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",ye(e,o));if(0===n.length)return me("InvalidTag","Closing tag '"+l+"' has not been opened.",ye(e,o));{const t=n.pop();if(l!==t.tagName){let n=ye(e,t.tagStartPos);return me("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",ye(e,o))}0==n.length&&(s=!0)}}else{const a=ge(u,t);if(!0!==a)return me(a.err.code,a.err.msg,ye(e,i-u.length+a.err.line));if(!0===s)return me("InvalidXml","Multiple possible root nodes found.",ye(e,i));-1!==t.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:o}),r=!0}for(i++;i<e.length;i++)if("<"===e[i]){if("!"===e[i+1]){i++,i=de(e,i);continue}if("?"!==e[i+1])break;if(i=ue(e,++i),i.err)return i}else if("&"===e[i]){const t=fe(e,i);if(-1==t)return me("InvalidChar","char '&' is not expected.",ye(e,i));i=t}else if(!0===s&&!ce(e[i]))return me("InvalidXml","Extra text at the end",ye(e,i));"<"===e[i]&&i--}}}return r?1==n.length?me("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",ye(e,n[0].tagStartPos)):!(n.length>0)||me("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):me("InvalidXml","Start tag expected.",1)}(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new V(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:re(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return N.getMetaDataSymbol()}}({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});ve.addEntity("#xD","\r"),ve.addEntity("#10","\n");const we=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n][t]?e[n]=e[n][t]:"object"==typeof e[n]&&null!==e[n]&&(e[n]=we(e[n]));return e};var Se=n(64754);const Ie=(e,t)=>(0,Se.w)(e,t).then(e=>{if(e.length){let n;try{t=e,n=ve.parse(t,!0)}catch(t){throw t&&"object"==typeof t&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}const r="#text",s=Object.keys(n)[0],i=n[s];return i[r]&&(i[s]=i[r],delete i[r]),we(i)}var t;return{}}),Pe=async(e,t)=>{const n=await Ie(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n};var Ae=n(32141),Te=n(86343),Ne=n(72358),Ce=n(63976),Oe=n(37579);const ke=async(e,t)=>{const n=pt;let r;return r=Zt({...Le(e,t),[gt]:mt,[qt]:ht}),dt(t,n,"/",void 0,r)},De=async(e,t)=>{const n=pt;let r;return r=Zt({...ze(e,t),[gt]:yt,[qt]:ht}),dt(t,n,"/",void 0,r)},$e=async(e,t)=>{if(e.statusCode>=300)return Me(e,t);const n=await Ie(e.body,t);let r={};return r=Qe(n.AssumeRoleResult,t),{$metadata:ct(e),...r}},Re=async(e,t)=>{if(e.statusCode>=300)return Me(e,t);const n=await Ie(e.body,t);let r={};return r=et(n.AssumeRoleWithWebIdentityResult,t),{$metadata:ct(e),...r}},Me=async(e,t)=>{const n={...e,body:await Pe(e.body,t)},r=Xt(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await je(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await Ue(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Ve(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await We(n,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await Fe(n,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Ke(n,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await _e(n,t);default:const s=n.body;return ut({output:e,parsedBody:s.Error,errorCode:r})}},je=async(e,t)=>{const n=e.body,r=nt(n.Error,t),s=new h({$metadata:ct(e),...r});return(0,c.M)(s,n)},Fe=async(e,t)=>{const n=e.body,r=rt(n.Error,t),s=new v({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ke=async(e,t)=>{const n=e.body,r=st(n.Error,t),s=new x({$metadata:ct(e),...r});return(0,c.M)(s,n)},_e=async(e,t)=>{const n=e.body,r=it(n.Error,t),s=new b({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ue=async(e,t)=>{const n=e.body,r=ot(n.Error,t),s=new g({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ve=async(e,t)=>{const n=e.body,r=at(n.Error,t),s=new f({$metadata:ct(e),...r});return(0,c.M)(s,n)},We=async(e,t)=>{const n=e.body,r=lt(n.Error,t),s=new m({$metadata:ct(e),...r});return(0,c.M)(s,n)},Le=(e,t)=>{const n={};if(null!=e[Mt]&&(n[Mt]=e[Mt]),null!=e[jt]&&(n[jt]=e[jt]),null!=e[Ct]){const r=qe(e[Ct],t);0===e[Ct]?.length&&(n.PolicyArns=[]),Object.entries(r).forEach(([e,t])=>{n[`PolicyArns.${e}`]=t})}if(null!=e[Nt]&&(n[Nt]=e[Nt]),null!=e[It]&&(n[It]=e[It]),null!=e[Wt]){const r=Xe(e[Wt],t);0===e[Wt]?.length&&(n.Tags=[]),Object.entries(r).forEach(([e,t])=>{n[`Tags.${e}`]=t})}if(null!=e[zt]){const r=Ze(e[zt],t);0===e[zt]?.length&&(n.TransitiveTagKeys=[]),Object.entries(r).forEach(([e,t])=>{n[`TransitiveTagKeys.${e}`]=t})}if(null!=e[At]&&(n[At]=e[At]),null!=e[Ut]&&(n[Ut]=e[Ut]),null!=e[Lt]&&(n[Lt]=e[Lt]),null!=e[_t]&&(n[_t]=e[_t]),null!=e[kt]){const r=He(e[kt],t);0===e[kt]?.length&&(n.ProvidedContexts=[]),Object.entries(r).forEach(([e,t])=>{n[`ProvidedContexts.${e}`]=t})}return n},ze=(e,t)=>{const n={};if(null!=e[Mt]&&(n[Mt]=e[Mt]),null!=e[jt]&&(n[jt]=e[jt]),null!=e[Yt]&&(n[Yt]=e[Yt]),null!=e[Dt]&&(n[Dt]=e[Dt]),null!=e[Ct]){const r=qe(e[Ct],t);0===e[Ct]?.length&&(n.PolicyArns=[]),Object.entries(r).forEach(([e,t])=>{n[`PolicyArns.${e}`]=t})}return null!=e[Nt]&&(n[Nt]=e[Nt]),null!=e[It]&&(n[It]=e[It]),n},qe=(e,t)=>{const n={};let r=1;for(const s of e){if(null===s)continue;const e=Be(s,t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Be=(e,t)=>{const n={};return null!=e[Ht]&&(n[Ht]=e[Ht]),n},Ye=(e,t)=>{const n={};return null!=e[Ot]&&(n[Ot]=e[Ot]),null!=e[St]&&(n[St]=e[St]),n},He=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=Ye(t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Ge=(e,t)=>{const n={};return null!=e[Tt]&&(n[Tt]=e[Tt]),null!=e[Bt]&&(n[Bt]=e[Bt]),n},Ze=(e,t)=>{const n={};let r=1;for(const t of e)null!==t&&(n[`member.${r}`]=t,r++);return n},Xe=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=Ge(t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Je=(e,t)=>{const n={};return null!=e[xt]&&(n[xt]=(0,Te.lK)(e[xt])),null!=e[Et]&&(n[Et]=(0,Te.lK)(e[Et])),n},Qe=(e,t)=>{const n={};return null!=e[wt]&&(n[wt]=tt(e[wt],t)),null!=e[bt]&&(n[bt]=Je(e[bt])),null!=e[$t]&&(n[$t]=(0,Te.xW)(e[$t])),null!=e[_t]&&(n[_t]=(0,Te.lK)(e[_t])),n},et=(e,t)=>{const n={};return null!=e[wt]&&(n[wt]=tt(e[wt],t)),null!=e[Kt]&&(n[Kt]=(0,Te.lK)(e[Kt])),null!=e[bt]&&(n[bt]=Je(e[bt])),null!=e[$t]&&(n[$t]=(0,Te.xW)(e[$t])),null!=e[Rt]&&(n[Rt]=(0,Te.lK)(e[Rt])),null!=e[vt]&&(n[vt]=(0,Te.lK)(e[vt])),null!=e[_t]&&(n[_t]=(0,Te.lK)(e[_t])),n},tt=(e,t)=>{const n={};return null!=e[ft]&&(n[ft]=(0,Te.lK)(e[ft])),null!=e[Ft]&&(n[Ft]=(0,Te.lK)(e[Ft])),null!=e[Vt]&&(n[Vt]=(0,Te.lK)(e[Vt])),null!=e[Pt]&&(n[Pt]=(0,Te.Y0)((0,Ne.t_)(e[Pt]))),n},nt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},rt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},st=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},it=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},ot=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},at=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},lt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},ct=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),ut=(0,Ce.j)(u),dt=async(e,t,n,r,s)=>{const{hostname:i,protocol:o="https",port:a,path:l}=await e.endpoint(),c={protocol:o,hostname:i,port:a,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+n:l+n,headers:t};return void 0!==r&&(c.hostname=r),void 0!==s&&(c.body=s),new Ae.K(c)},pt={"content-type":"application/x-www-form-urlencoded"},ht="2011-06-15",gt="Action",ft="AccessKeyId",mt="AssumeRole",xt="AssumedRoleId",bt="AssumedRoleUser",yt="AssumeRoleWithWebIdentity",Et="Arn",vt="Audience",wt="Credentials",St="ContextAssertion",It="DurationSeconds",Pt="Expiration",At="ExternalId",Tt="Key",Nt="Policy",Ct="PolicyArns",Ot="ProviderArn",kt="ProvidedContexts",Dt="ProviderId",$t="PackedPolicySize",Rt="Provider",Mt="RoleArn",jt="RoleSessionName",Ft="SecretAccessKey",Kt="SubjectFromWebIdentityToken",_t="SourceIdentity",Ut="SerialNumber",Vt="SessionToken",Wt="Tags",Lt="TokenCode",zt="TransitiveTagKeys",qt="Version",Bt="Value",Yt="WebIdentityToken",Ht="arn",Gt="message",Zt=e=>Object.entries(e).map(([e,t])=>(0,Oe.$)(e)+"="+(0,Oe.$)(t)).join("&"),Xt=(e,t)=>void 0!==t.Error?.Code?t.Error.Code:404==e.statusCode?"NotFound":void 0;class Jt extends(o.u.classBuilder().ep(a).m(function(e,t,n,r){return[(0,i.TM)(n,this.serialize,this.deserialize),(0,s.r)(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,p).ser(ke).de($e).build()){}class Qt extends(o.u.classBuilder().ep(a).m(function(e,t,n,r){return[(0,i.TM)(n,this.serialize,this.deserialize),(0,s.r)(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(y,E).ser(De).de(Re).build()){}const en="us-east-1",tn=e=>{if("string"==typeof e?.Arn){const t=e.Arn.split(":");if(t.length>4&&""!==t[4])return t[4]}},nn=async(e,t,n)=>{const r="function"==typeof e?await e():e,s="function"==typeof t?await t():t;return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${r} (provider)`,`${s} (parent client)`,`${en} (STS default)`),r??s??en},rn=e=>"h2"===e?.metadata?.handlerProtocol;var sn=n(67317),on=n(27847),an=n(33182),ln=n(67868),cn=n(4518),un=n(20459),dn=n(23369),pn=n(83007),hn=n(58001),gn=n(88244),fn=n(79244),mn=n(74499),xn=n(29163),bn=n(8928),yn=n(27792),En=n(80835),vn=n(6670);const wn=async(e,t,n)=>({operation:(0,En.u)(t).operation,region:await(0,vn.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Sn=e=>{const t=[];return"AssumeRoleWithWebIdentity"===e.operation?t.push({schemeId:"smithy.api#noAuth"}):t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t};var In=n(64548),Pn=n(21674),An=n(61008),Tn=n(57180),Nn=n(4425),Cn=n(34767),On=n(91968),kn=n(28164),Dn=n(41942),$n=n(31305),Rn=n(13820),Mn=n(43316),jn=n(41911),Fn=n(46553),Kn=n(31680),_n=n(88468),Un=n(96527),Vn=n(72804),Wn=n(69367),Ln=n(19506),zn=n(40935),qn=n(2914),Bn=n(56771),Yn=n(2257),Hn=n(63305),Gn=n(37867);const Zn="required",Xn="type",Jn="fn",Qn="argv",er="ref",tr=!1,nr=!0,rr="booleanEquals",sr="stringEquals",ir="sigv4",or="us-east-1",ar="endpoint",lr="https://sts.{Region}.{PartitionResult#dnsSuffix}",cr="tree",ur="error",dr="getAttr",pr={[Zn]:!1,[Xn]:"String"},hr={[Zn]:!0,default:!1,[Xn]:"Boolean"},gr={[er]:"Endpoint"},fr={[Jn]:"isSet",[Qn]:[{[er]:"Region"}]},mr={[er]:"Region"},xr={[Jn]:"aws.partition",[Qn]:[mr],assign:"PartitionResult"},br={[er]:"UseFIPS"},yr={[er]:"UseDualStack"},Er={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:ir,signingName:"sts",signingRegion:or}]},headers:{}},vr={},wr={conditions:[{[Jn]:sr,[Qn]:[mr,"aws-global"]}],[ar]:Er,[Xn]:ar},Sr={[Jn]:rr,[Qn]:[br,!0]},Ir={[Jn]:rr,[Qn]:[yr,!0]},Pr={[Jn]:dr,[Qn]:[{[er]:"PartitionResult"},"supportsFIPS"]},Ar={[er]:"PartitionResult"},Tr={[Jn]:rr,[Qn]:[!0,{[Jn]:dr,[Qn]:[Ar,"supportsDualStack"]}]},Nr=[{[Jn]:"isSet",[Qn]:[gr]}],Cr=[Sr],Or=[Ir],kr={version:"1.0",parameters:{Region:pr,UseDualStack:hr,UseFIPS:hr,Endpoint:pr,UseGlobalEndpoint:hr},rules:[{conditions:[{[Jn]:rr,[Qn]:[{[er]:"UseGlobalEndpoint"},nr]},{[Jn]:"not",[Qn]:Nr},fr,xr,{[Jn]:rr,[Qn]:[br,tr]},{[Jn]:rr,[Qn]:[yr,tr]}],rules:[{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-northeast-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-south-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-southeast-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-southeast-2"]}],endpoint:Er,[Xn]:ar},wr,{conditions:[{[Jn]:sr,[Qn]:[mr,"ca-central-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-central-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-north-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-2"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-3"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"sa-east-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,or]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-east-2"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-west-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-west-2"]}],endpoint:Er,[Xn]:ar},{endpoint:{url:lr,properties:{authSchemes:[{name:ir,signingName:"sts",signingRegion:"{Region}"}]},headers:vr},[Xn]:ar}],[Xn]:cr},{conditions:Nr,rules:[{conditions:Cr,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Xn]:ur},{conditions:Or,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Xn]:ur},{endpoint:{url:gr,properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{conditions:[fr],rules:[{conditions:[xr],rules:[{conditions:[Sr,Ir],rules:[{conditions:[{[Jn]:rr,[Qn]:[nr,Pr]},Tr],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Xn]:ur}],[Xn]:cr},{conditions:Cr,rules:[{conditions:[{[Jn]:rr,[Qn]:[Pr,nr]}],rules:[{conditions:[{[Jn]:sr,[Qn]:[{[Jn]:dr,[Qn]:[Ar,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:vr,headers:vr},[Xn]:ar},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"FIPS is enabled but this partition does not support FIPS",[Xn]:ur}],[Xn]:cr},{conditions:Or,rules:[{conditions:[Tr],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"DualStack is enabled but this partition does not support DualStack",[Xn]:ur}],[Xn]:cr},wr,{endpoint:{url:lr,properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr}],[Xn]:cr},{error:"Invalid Configuration: Missing Region",[Xn]:ur}]},Dr=new Yn.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),$r=(e,t={})=>Dr.get(e,()=>(0,Hn.s)(kr,{endpointParams:e,logger:t.logger}));Gn.m.aws=Bn.UF;var Rr=n(72617),Mr=n(70758),jr=n(97252);var Fr=n(96374),Kr=n(59326),_r=n(61701);class Ur extends bn.K{config;constructor(...[e]){const t=(e=>{(0,jr.I)(process.version);const t=(0,Mr.I)(e),n=()=>t().then(Rr.l),r=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??Wn.E,base64Encoder:e?.base64Encoder??Ln.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??$r,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Sn,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Tn.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new $n.m}],logger:e?.logger??new Un.N,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??Vn.D,utf8Decoder:e?.utf8Decoder??zn.a,utf8Encoder:e?.utf8Encoder??qn.P}))(e);(0,Pn.I)(process.version);const s={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,Mn.Z)(An.$,s),bodyLengthChecker:e?.bodyLengthChecker??Kn.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,Nn.pf)({serviceId:r.serviceId,clientVersion:In.rE}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4")||(async t=>await e.credentialDefaultProvider(t?.__config||{})()),signer:new Tn.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new $n.m}],maxAttempts:e?.maxAttempts??(0,Mn.Z)(mn.qs,e),region:e?.region??(0,Mn.Z)(On.GG,{...On.zH,...s}),requestHandler:jn.$.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,Mn.Z)({...mn.kN,default:async()=>(await n()).retryMode||_n.L0},e),sha256:e?.sha256??Rn.V.bind(null,"sha256"),streamCollector:e?.streamCollector??Fn.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,Mn.Z)(kn.e$,s),useFipsEndpoint:e?.useFipsEndpoint??(0,Mn.Z)(Dn.Ko,s),userAgentAppId:e?.userAgentAppId??(0,Mn.Z)(Cn.hV,s)}})(e||{});super(t),this.initConfig=t;const n=(r=t,Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var r;const s=(0,ln.D)(n),i=(0,mn.$z)(s),o=(0,un.T)(i),a=(0,sn.OV)(o),l=((e,t)=>{const n=Object.assign((0,Fr.R)(e),(0,_r.xA)(e),(0,Kr.e)(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,Fr.$)(n),(0,_r.uv)(n),(0,Kr.j)(n),{httpAuthSchemes:(r=n).httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()});var r})((e=>{const t=(n=e,Object.assign(n,{stsClientCtor:Ur}));var n;const r=(0,yn.h)(t);return Object.assign(r,{authSchemePreference:(0,vn.t)(e.authSchemePreference??[])})})((0,fn.C)(a)),e?.extensions||[]);this.config=l,this.middlewareStack.use((0,cn.sM)(this.config)),this.middlewareStack.use((0,xn.ey)(this.config)),this.middlewareStack.use((0,gn.vK)(this.config)),this.middlewareStack.use((0,sn.TC)(this.config)),this.middlewareStack.use((0,on.Y7)(this.config)),this.middlewareStack.use((0,an.n)(this.config)),this.middlewareStack.use((0,dn.w)(this.config,{httpAuthSchemeParametersProvider:wn,identityProviderConfigProvider:async e=>new pn.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,hn.l)(this.config))}destroy(){super.destroy()}}const Vr=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,Wr=(e={},t)=>((e,t)=>{let n,s;return async(i,o)=>{if(s=i,!n){const{logger:r=e?.parentClientConfig?.logger,region:i,requestHandler:o=e?.parentClientConfig?.requestHandler,credentialProviderLogger:a}=e,l=await nn(i,e?.parentClientConfig?.region,a),c=!rn(o);n=new t({profile:e?.parentClientConfig?.profile,credentialDefaultProvider:()=>async()=>s,region:l,requestHandler:c?o:void 0,logger:r})}const{Credentials:a,AssumedRoleUser:l}=await n.send(new Jt(o));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);const c=tn(l),u={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...c&&{accountId:c}};return(0,r.g)(u,"CREDENTIALS_STS_ASSUME_ROLE","i"),u}})(e,Vr(Ur,t)),Lr=(e={},t)=>((e,t)=>{let n;return async s=>{if(!n){const{logger:r=e?.parentClientConfig?.logger,region:s,requestHandler:i=e?.parentClientConfig?.requestHandler,credentialProviderLogger:o}=e,a=await nn(s,e?.parentClientConfig?.region,o),l=!rn(i);n=new t({profile:e?.parentClientConfig?.profile,region:a,requestHandler:l?i:void 0,logger:r})}const{Credentials:i,AssumedRoleUser:o}=await n.send(new Qt(s));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);const a=tn(o),l={accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,...i.CredentialScope&&{credentialScope:i.CredentialScope},...a&&{accountId:a}};return a&&(0,r.g)(l,"RESOLVED_ACCOUNT_ID","T"),(0,r.g)(l,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),l}})(e,Vr(Ur,t))}};
|
package/dist/904.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=904,exports.ids=[904],exports.modules={10602:(e,t,r)=>{r.d(t,{$:()=>o});const o="***SensitiveInformation***"},31305:(e,t,r)=>{r.d(t,{m:()=>o});class o{async sign(e,t,r){return e}}},37579:(e,t,r)=>{function o(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>o})},64548:e=>{e.exports={rE:"3.901.0"}},65875:(e,t,r)=>{r.d(t,{l:()=>n});var o=r(32141),s=r(37579);function n(e,t){return new i(e,t)}class i{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){const{hostname:e,protocol:t="https",port:r,path:s}=await this.context.endpoint();this.path=s;for(const e of this.resolvePathStack)e(this.path);return new o.K({protocol:t,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push(t=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,r,o){return this.resolvePathStack.push(n=>{this.path=((e,t,r,o,n,i)=>{if(null==t||void 0===t[r])throw new Error("No value provided for input HTTP label: "+r+".");{const t=o();if(t.length<=0)throw new Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(n,i?t.split("/").map(e=>(0,s.$)(e)).join("/"):(0,s.$)(t))}return e})(n,this.input,e,t,r,o)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}},98904:(e,t,r)=>{r.d(t,{CreateTokenCommand:()=>ft,SSOOIDCClient:()=>$e});var o=r(67317),s=r(27847),n=r(33182),i=r(67868),a=r(4518),c=r(20459),d=r(23369),p=r(83007),u=r(58001),h=r(88244),l=r(79244),m=r(74499),y=r(29163),f=r(8928),g=r(27792),x=r(80835),b=r(6670);const w=async(e,t,r)=>({operation:(0,x.u)(t).operation,region:await(0,b.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),S=e=>{const t=[];return"CreateToken"===e.operation?t.push({schemeId:"smithy.api#noAuth"}):t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t},v={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var E=r(64548),P=r(21674),I=r(61008),k=r(4425),O=r(34767),$=r(91968),T=r(28164),j=r(41942),_=r(13820),C=r(43316),A=r(41911),D=r(46553),K=r(31680),z=r(88468),R=r(57180),U=r(31305),q=r(96527),M=r(72804),F=r(69367),G=r(19506),H=r(40935),V=r(2914),Z=r(56771),N=r(2257),B=r(63305),L=r(37867);const Y="required",J="fn",W="argv",X="ref",Q=!0,ee="isSet",te="booleanEquals",re="error",oe="endpoint",se="tree",ne="PartitionResult",ie="getAttr",ae={[Y]:!1,type:"String"},ce={[Y]:!0,default:!1,type:"Boolean"},de={[X]:"Endpoint"},pe={[J]:te,[W]:[{[X]:"UseFIPS"},!0]},ue={[J]:te,[W]:[{[X]:"UseDualStack"},!0]},he={},le={[J]:ie,[W]:[{[X]:ne},"supportsFIPS"]},me={[X]:ne},ye={[J]:te,[W]:[!0,{[J]:ie,[W]:[me,"supportsDualStack"]}]},fe=[pe],ge=[ue],xe=[{[X]:"Region"}],be={version:"1.0",parameters:{Region:ae,UseDualStack:ce,UseFIPS:ce,Endpoint:ae},rules:[{conditions:[{[J]:ee,[W]:[de]}],rules:[{conditions:fe,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:re},{conditions:ge,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:re},{endpoint:{url:de,properties:he,headers:he},type:oe}],type:se},{conditions:[{[J]:ee,[W]:xe}],rules:[{conditions:[{[J]:"aws.partition",[W]:xe,assign:ne}],rules:[{conditions:[pe,ue],rules:[{conditions:[{[J]:te,[W]:[Q,le]},ye],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:re}],type:se},{conditions:fe,rules:[{conditions:[{[J]:te,[W]:[le,Q]}],rules:[{conditions:[{[J]:"stringEquals",[W]:[{[J]:ie,[W]:[me,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:he,headers:he},type:oe},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"FIPS is enabled but this partition does not support FIPS",type:re}],type:se},{conditions:ge,rules:[{conditions:[ye],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"DualStack is enabled but this partition does not support DualStack",type:re}],type:se},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:he,headers:he},type:oe}],type:se}],type:se},{error:"Invalid Configuration: Missing Region",type:re}]},we=new N.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Se=(e,t={})=>we.get(e,()=>(0,B.s)(be,{endpointParams:e,logger:t.logger}));L.m.aws=Z.UF;var ve=r(72617),Ee=r(70758),Pe=r(97252);var Ie=r(96374),ke=r(59326),Oe=r(61701);class $e extends f.K{config;constructor(...[e]){const t=(e=>{(0,Pe.I)(process.version);const t=(0,Ee.I)(e),r=()=>t().then(ve.l),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??F.E,base64Encoder:e?.base64Encoder??G.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Se,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??S,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new R.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new U.m}],logger:e?.logger??new q.N,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??M.D,utf8Decoder:e?.utf8Decoder??H.a,utf8Encoder:e?.utf8Encoder??V.P}))(e);(0,P.I)(process.version);const s={profile:e?.profile,logger:o.logger};return{...o,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,C.Z)(I.$,s),bodyLengthChecker:e?.bodyLengthChecker??K.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,k.pf)({serviceId:o.serviceId,clientVersion:E.rE}),maxAttempts:e?.maxAttempts??(0,C.Z)(m.qs,e),region:e?.region??(0,C.Z)($.GG,{...$.zH,...s}),requestHandler:A.$.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,C.Z)({...m.kN,default:async()=>(await r()).retryMode||z.L0},e),sha256:e?.sha256??_.V.bind(null,"sha256"),streamCollector:e?.streamCollector??D.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,C.Z)(T.e$,s),useFipsEndpoint:e?.useFipsEndpoint??(0,C.Z)(j.Ko,s),userAgentAppId:e?.userAgentAppId??(0,C.Z)(O.hV,s)}})(e||{});super(t),this.initConfig=t;const r=(f=t,Object.assign(f,{useDualstackEndpoint:f.useDualstackEndpoint??!1,useFipsEndpoint:f.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}));var f;const x=(0,i.D)(r),v=(0,m.$z)(x),Z=(0,c.T)(v),N=(0,o.OV)(Z),B=((e,t)=>{const r=Object.assign((0,Ie.R)(e),(0,Oe.xA)(e),(0,ke.e)(e),(e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const r=t.findIndex(t=>t.schemeId===e.schemeId);-1===r?t.push(e):t.splice(r,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){r=e},httpAuthSchemeProvider:()=>r,setCredentials(e){o=e},credentials:()=>o}})(e));return t.forEach(e=>e.configure(r)),Object.assign(e,(0,Ie.$)(r),(0,Oe.uv)(r),(0,ke.j)(r),{httpAuthSchemes:(o=r).httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()});var o})((e=>{const t=(0,g.h)(e);return Object.assign(t,{authSchemePreference:(0,b.t)(e.authSchemePreference??[])})})((0,l.C)(N)),e?.extensions||[]);this.config=B,this.middlewareStack.use((0,a.sM)(this.config)),this.middlewareStack.use((0,y.ey)(this.config)),this.middlewareStack.use((0,h.vK)(this.config)),this.middlewareStack.use((0,o.TC)(this.config)),this.middlewareStack.use((0,s.Y7)(this.config)),this.middlewareStack.use((0,n.n)(this.config)),this.middlewareStack.use((0,d.w)(this.config,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:async e=>new p.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,u.l)(this.config))}destroy(){super.destroy()}}var Te=r(66403),je=r(53340),_e=r(3594),Ce=r(10602),Ae=r(92309);class De extends Ae.T{constructor(e){super(e),Object.setPrototypeOf(this,De.prototype)}}class Ke extends De{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,Ke.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class ze extends De{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),Object.setPrototypeOf(this,ze.prototype),this.error=e.error,this.error_description=e.error_description}}const Re=e=>({...e,...e.clientSecret&&{clientSecret:Ce.$},...e.refreshToken&&{refreshToken:Ce.$},...e.codeVerifier&&{codeVerifier:Ce.$}}),Ue=e=>({...e,...e.accessToken&&{accessToken:Ce.$},...e.refreshToken&&{refreshToken:Ce.$},...e.idToken&&{idToken:Ce.$}});class qe extends De{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,qe.prototype),this.error=e.error,this.error_description=e.error_description}}class Me extends De{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,Me.prototype),this.error=e.error,this.error_description=e.error_description}}class Fe extends De{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),Object.setPrototypeOf(this,Fe.prototype),this.error=e.error,this.error_description=e.error_description}}class Ge extends De{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),Object.setPrototypeOf(this,Ge.prototype),this.error=e.error,this.error_description=e.error_description}}class He extends De{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,He.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class Ve extends De{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),Object.setPrototypeOf(this,Ve.prototype),this.error=e.error,this.error_description=e.error_description}}class Ze extends De{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e}),Object.setPrototypeOf(this,Ze.prototype),this.error=e.error,this.error_description=e.error_description}}class Ne extends De{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),Object.setPrototypeOf(this,Ne.prototype),this.error=e.error,this.error_description=e.error_description}}class Be extends De{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Be.prototype),this.error=e.error,this.error_description=e.error_description}}var Le=r(46071),Ye=r(65875),Je=r(93907),We=r(10001),Xe=r(86343),Qe=r(63976);const et=async(e,t)=>{const r=(0,Ye.l)(e,t);let o;return r.bp("/token"),o=JSON.stringify((0,Je.s)(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>(0,We.S)(e)})),r.m("POST").h({"content-type":"application/json"}).b(o),r.build()},tt=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return rt(e,t);const r=(0,Je.Tj)({$metadata:yt(e)}),o=(0,Xe.Y0)((0,Xe.Xk)(await(0,Le.Y2)(e.body,t)),"body"),s=(0,Je.s)(o,{accessToken:Xe.lK,expiresIn:Xe.ET,idToken:Xe.lK,refreshToken:Xe.lK,tokenType:Xe.lK});return Object.assign(r,s),r},rt=async(e,t)=>{const r={...e,body:await(0,Le.CG)(e.body,t)},o=(0,Le.cJ)(e,r.body);switch(o){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await st(r,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await nt(r,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await it(r,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await at(r,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await ct(r,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await dt(r,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await pt(r,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ut(r,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await ht(r,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await lt(r,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await mt(r,t);default:const s=r.body;return ot({output:e,parsedBody:s,errorCode:o})}},ot=(0,Qe.j)(De),st=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK,reason:Xe.lK});Object.assign(r,s);const n=new Ke({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},nt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new ze({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},it=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new qe({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},at=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Me({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ct=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Fe({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},dt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ge({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},pt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK,reason:Xe.lK});Object.assign(r,s);const n=new He({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ut=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ve({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ht=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ze({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},lt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ne({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},mt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Be({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},yt=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});class ft extends(_e.u.classBuilder().ep(v).m(function(e,t,r,o){return[(0,je.TM)(r,this.serialize,this.deserialize),(0,Te.r)(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Re,Ue).ser(et).de(tt).build()){}}};
|
package/dist/938.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=938,exports.ids=[938],exports.modules={14938:(e,t,a)=>{a.d(t,{ENV_CMDS_FULL_URI:()=>m,ENV_CMDS_RELATIVE_URI:()=>g,fromContainerMetadata:()=>h,fromInstanceMetadata:()=>L,getInstanceMetadataEndpoint:()=>T,httpRequest:()=>c});var n=a(3721),r=a(87016),o=a(27637),s=a(20181),i=a(58611);function c(e){return new Promise((t,a)=>{const n=(0,i.request)({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});n.on("error",e=>{a(Object.assign(new o.m("Unable to connect to instance metadata service"),e)),n.destroy()}),n.on("timeout",()=>{a(new o.m("TimeoutError from instance metadata service")),n.destroy()}),n.on("response",e=>{const{statusCode:r=400}=e;(r<200||300<=r)&&(a(Object.assign(new o.m("Error response received from instance metadata service"),{statusCode:r})),n.destroy());const i=[];e.on("data",e=>{i.push(e)}),e.on("end",()=>{t(s.Buffer.concat(i)),n.destroy()})}),n.end()})}const l=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.AccessKeyId&&"string"==typeof e.SecretAccessKey&&"string"==typeof e.Token&&"string"==typeof e.Expiration,d=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration),...e.AccountId&&{accountId:e.AccountId}}),u=({maxRetries:e=0,timeout:t=1e3})=>({maxRetries:e,timeout:t}),p=(e,t)=>{let a=e();for(let n=0;n<t;n++)a=a.catch(e);return a},m="AWS_CONTAINER_CREDENTIALS_FULL_URI",g="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",f="AWS_CONTAINER_AUTHORIZATION_TOKEN",h=(e={})=>{const{timeout:t,maxRetries:a}=u(e);return()=>p(async()=>{const a=await I({logger:e.logger}),r=JSON.parse(await v(t,a));if(!l(r))throw new n.C("Invalid response received from instance metadata service.",{logger:e.logger});return d(r)},a)},v=async(e,t)=>(process.env[f]&&(t.headers={...t.headers,Authorization:process.env[f]}),(await c({...t,timeout:e})).toString()),w={localhost:!0,"127.0.0.1":!0},y={"http:":!0,"https:":!0},I=async({logger:e})=>{if(process.env[g])return{hostname:"169.254.170.2",path:process.env[g]};if(process.env[m]){const t=(0,r.parse)(process.env[m]);if(!t.hostname||!(t.hostname in w))throw new n.C(`${t.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!t.protocol||!(t.protocol in y))throw new n.C(`${t.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{...t,port:t.port?parseInt(t.port,10):void 0}}throw new n.C(`The container metadata credential provider cannot be used unless the ${g} or ${m} environment variable is set`,{tryNextLink:!1,logger:e})};var E=a(43316);class _ extends n.C{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(e,t=!0){super(e,t),this.tryNextLink=t,Object.setPrototypeOf(this,_.prototype)}}var A,S=a(72804);!function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"}(A||(A={}));const C={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var b;!function(e){e.IPv4="IPv4",e.IPv6="IPv6"}(b||(b={}));const x={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:b.IPv4},T=async()=>(0,S.D)(await D()||await N()),D=async()=>(0,E.Z)(C)(),N=async()=>{const e=await(0,E.Z)(x)();switch(e){case b.IPv4:return A.IPv4;case b.IPv6:return A.IPv6;default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(b)}`)}},k=(e,t)=>{const a=300+Math.floor(300*Math.random()),n=new Date(Date.now()+1e3*a);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(n)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const r=e.originalExpiration??e.expiration;return{...e,...r?{originalExpiration:r}:{},expiration:n}},M="/latest/meta-data/iam/security-credentials/",R="AWS_EC2_METADATA_V1_DISABLED",O="ec2_metadata_v1_disabled",P="x-aws-ec2-metadata-token",L=(e={})=>((e,t={})=>{const a=t?.logger||console;let n;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=k(t,a))}catch(e){if(!n)throw e;a.warn("Credential renew failed: ",e),t=k(n,a)}return n=t,t}})(V(e),{logger:e.logger}),V=(e={})=>{let t=!1;const{logger:a,profile:r}=e,{timeout:o,maxRetries:s}=u(e),i=async(a,o)=>{if(t||null==o.headers?.[P]){let t=!1,a=!1;const o=await(0,E.Z)({environmentVariableSelector:t=>{const r=t[R];if(a=!!r&&"false"!==r,void 0===r)throw new n.C(`${R} not set in env, checking config file next.`,{logger:e.logger});return a},configFileSelector:e=>{const a=e[O];return t=!!a&&"false"!==a,t},default:!1},{profile:r})();if(e.ec2MetadataV1Disabled||o){const n=[];throw e.ec2MetadataV1Disabled&&n.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"),t&&n.push(`config file profile (${O})`),a&&n.push(`process environment variable (${R})`),new _(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${n.join(", ")}].`)}}const s=(await p(async()=>{let e;try{e=await K(o)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e},a)).trim();return p(async()=>{let a;try{a=await U(s,o,e)}catch(e){throw 401===e.statusCode&&(t=!1),e}return a},a)};return async()=>{const e=await T();if(t)return a?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),i(s,{...e,timeout:o});{let n;try{n=(await $({...e,timeout:o})).toString()}catch(n){if(400===n?.statusCode)throw Object.assign(n,{message:"EC2 Metadata token request returned error"});return("TimeoutError"===n.message||[403,404,405].includes(n.statusCode))&&(t=!0),a?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),i(s,{...e,timeout:o})}return i(s,{...e,headers:{[P]:n},timeout:o})}}},$=async e=>c({...e,path:"/latest/api/token",method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),K=async e=>(await c({...e,path:M})).toString(),U=async(e,t,a)=>{const r=JSON.parse((await c({...t,path:M+e})).toString());if(!l(r))throw new n.C("Invalid response received from instance metadata service.",{logger:a.logger});return d(r)}}};
|