@kya-os/mcp-i 1.6.3-canary.clientinfo.20251126124133 → 1.6.4-canary.slugfix.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/387.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=387,exports.ids=[387],exports.modules={35387:(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(84122),r=a(87016),o=a(88816),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(28075);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(71918);!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)}}};
package/dist/406.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=406,exports.ids=[25,406],exports.modules={4987:(e,s,o)=>{o.d(s,{C:()=>r});var n=o(76982),t=o(16928),i=o(51362);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`)}},6721:(e,s,o)=>{o.d(s,{Y:()=>t});var n=o(64549);const t=async e=>{const s=await(0,n.p)(e);return((...e)=>{const s={};for(const o of e)for(const[e,n]of Object.entries(o))void 0!==s[e]?Object.assign(s[e],n):s[e]=n;return s})(s.configFile,s.credentialsFile)}},48440:(e,s,o)=>{o.d(s,{a:()=>i,v:()=>r});var n=o(91943),t=o(4987);const i={},r=async e=>{if(i[e])return i[e];const s=(0,t.C)(e),o=await(0,n.readFile)(s,"utf8");return JSON.parse(o)}},49406:(e,s,o)=>{o.d(s,{fromSSO:()=>v});var n=o(84122),t=o(76682),i=o(6721),r=o(26433),a=o(62022),c=o(45223);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(33939),f=o(71078);const p=()=>({}),d=async(e={})=>(0,f.TA)(e.configFilepath??(0,r.g)()).then(g.A).then(l).catch(p);var h=o(53243),w=o(88816);class u extends w.m{name="TokenProviderError";constructor(e,s=!0){super(e,s),Object.setPrototypeOf(this,u.prototype)}}var S=o(48440);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(4987),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 d(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 p;try{p=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",p.accessToken),k("expiresAt",p.expiresAt);const{accessToken:h,expiresAt:w}=p,y={token:h,expiration:new Date(w)};if(y.expiration.getTime()-Date.now()>3e5)return y;if(Date.now()-x.getTime()<3e4)return _(y),y;k("clientId",p.clientId,!0),k("clientSecret",p.clientSecret,!0),k("refreshToken",p.refreshToken,!0);try{x.setTime(Date.now());const e=await(async(e,s,n={})=>{const{CreateTokenCommand:t}=await Promise.all([o.e(478),o.e(575)]).then(o.bind(o,21575)),i=await(async(e,s={})=>{const{SSOOIDCClient:n}=await Promise.all([o.e(478),o.e(575)]).then(o.bind(o,21575)),t=e=>s.clientConfig?.[e]??s.parentClientConfig?.[e];return new n(Object.assign({},s.clientConfig??{},{region:e??s.clientConfig?.region,logger:t("logger"),userAgentAppId:t("userAgentAppId")}))})(s,n);return i.send(new t({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))})(p,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,{...p,accessToken:e.accessToken,expiresAt:s.toISOString(),refreshToken:e.refreshToken})}catch(e){}return{token:e.accessToken,expiration:s}}catch(e){return _(y),y}},I=!1,A=async({ssoStartUrl:e,ssoSession:s,ssoAccountId:t,ssoRegion:i,ssoRoleName:r,ssoClient:a,clientConfig:c,parentClientConfig:l,profile:g,filepath:f,configFilepath:p,ignoreCache:d,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:p,ignoreCache:d})();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 Promise.all([o.e(478),o.e(936)]).then(o.bind(o,37936)),y=a||new k(Object.assign({},c??{},{logger:c?.logger??l?.logger,region:c?.region??i,userAgentAppId:c?.userAgentAppId??l?.userAgentAppId}));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:A,sessionToken:v,expiration:N,credentialScope:$,accountId:R}={}}=T;if(!(x&&A&&v&&N))throw new n.C("SSO returns an invalid temporary credential.",{tryNextLink:I,logger:w});const b={accessKeyId:x,secretAccessKey:A,sessionToken:v,expiration:new Date(N),...$&&{credentialScope:$},...R&&{accountId:R}};return s?(0,h.g)(b,"CREDENTIALS_SSO","s"):(0,h.g)(b,"CREDENTIALS_SSO_LEGACY","u"),b},v=(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 A({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(!(p=s)||"string"!=typeof p.sso_start_url&&"string"!=typeof p.sso_account_id&&"string"!=typeof p.sso_session&&"string"!=typeof p.sso_region&&"string"!=typeof p.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 d(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:h}=((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 A({ssoStartUrl:t,ssoSession:h,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 p}}};
package/dist/448.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=448,exports.ids=[67,448],exports.modules={4987:(e,r,o)=>{o.d(r,{C:()=>c});var t=o(76982),s=o(16928),n=o(51362);const c=e=>{const r=(0,t.createHash)("sha1").update(e).digest("hex");return(0,s.join)((0,n.R)(),".aws","sso","cache",`${r}.json`)}},6721:(e,r,o)=>{o.d(r,{Y:()=>s});var t=o(64549);const s=async e=>{const r=await(0,t.p)(e);return((...e)=>{const r={};for(const o of e)for(const[e,t]of Object.entries(o))void 0!==r[e]?Object.assign(r[e],t):r[e]=t;return r})(r.configFile,r.credentialsFile)}},48440:(e,r,o)=>{o.d(r,{a:()=>n,v:()=>c});var t=o(91943),s=o(4987);const n={},c=async e=>{if(n[e])return n[e];const r=(0,s.C)(e),o=await(0,t.readFile)(r,"utf8");return JSON.parse(o)}},68448:(e,r,o)=>{o.d(r,{fromProcess:()=>l});var t=o(6721),s=o(76682),n=o(84122),c=o(74692),i=o(35317),a=o(39023),d=o(53243);const l=(e={})=>async({callerClientConfig:r}={})=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const o=await(0,t.Y)(e);return(async(e,r,o)=>{const t=r[e];if(!r[e])throw new n.C(`Profile ${e} could not be found in shared credentials file.`,{logger:o});{const s=t.credential_process;if(void 0===s)throw new n.C(`Profile ${e} did not contain credential_process.`,{logger:o});{const t=(0,a.promisify)(c.Z?.getTokenRecord?.().exec??i.exec);try{const{stdout:o}=await t(s);let n;try{n=JSON.parse(o.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,r,o)=>{if(1!==r.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===r.AccessKeyId||void 0===r.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(r.Expiration){const o=new Date;if(new Date(r.Expiration)<o)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let t=r.AccountId;!t&&o?.[e]?.aws_account_id&&(t=o[e].aws_account_id);const s={accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope},...t&&{accountId:t}};return(0,d.g)(s,"CREDENTIALS_PROCESS","w"),s})(e,n,r)}catch(e){throw new n.C(e.message,{logger:o})}}}})((0,s.Bz)({profile:e.profile??r?.profile}),o,e.logger)}},74692:(e,r,o)=>{o.d(r,{Z:()=>n});var t=o(48440),s=o(71078);const n={getFileRecord:()=>s.Jj,interceptFile(e,r){s.Jj[e]=Promise.resolve(r)},getTokenRecord:()=>t.a,interceptToken(e,r){t.a[e]=r}}}};
package/dist/478.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=478,exports.ids=[478],exports.modules={22371:(e,t,r)=>{r.d(t,{k:()=>x});var s=r(96440),i=r(71407);const a="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",n="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",o="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",d="(\\d{4})",l=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),u=new RegExp(`^${a}, ${c} ${n} ${d} ${o} GMT$`),h=new RegExp(`^${a}, ${c}-${n}-(\\d\\d) ${o} GMT$`),f=new RegExp(`^${a} ${n} ( [1-9]|\\d\\d) ${o} ${d}$`),p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(e,t,r){const s=Number(e);if(s<t||s>r)throw new Error(`Value ${s} out of range [${t}, ${r}]`)}var g=r(74910),w=r(52123),b=r(12544),y=r(2914),S=r(79037),T=r(17735);class x extends S.f{settings;constructor(e){super(),this.settings=e}read(e,t){const r=s.l.of(e);if(r.isListSchema())return(0,i.G)(t).map(e=>this.read(r.getValueSchema(),e));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??b.E)(t);if(r.isTimestampSchema())switch((0,T.V)(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC3339 timestamps must be strings");const t=l.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,s,i,a,n,o,,c,d]=t;m(s,1,12),m(i,1,31),m(a,0,23),m(n,0,59),m(o,0,60);const u=new Date(Date.UTC(Number(r),Number(s)-1,Number(i),Number(a),Number(n),Number(o),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(u.setUTCFullYear(Number(r)),"Z"!=d.toUpperCase()){const[,e,t,r]=/([+-])(\d\d):(\d\d)/.exec(d)||[void 0,"+",0,0],s="-"===e?1:-1;u.setTime(u.getTime()+s*(60*Number(t)*60*1e3+60*Number(r)*1e3))}return u})(t);case 6:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC7231 timestamps must be strings.");let t,r,s,i,a,n,o,c;if((c=u.exec(e))?[,t,r,s,i,a,n,o]=c:(c=h.exec(e))?([,t,r,s,i,a,n,o]=c,s=(Number(s)+1900).toString()):(c=f.exec(e))&&([,r,t,i,a,n,o,s]=c),s&&n){const e=Date.UTC(Number(s),p.indexOf(r),Number(t),Number(i),Number(a),Number(n),o?Math.round(1e3*parseFloat(`0.${o}`)):0);m(t,1,31),m(i,0,23),m(a,0,59),m(n,0,60);const c=new Date(e);return c.setUTCFullYear(Number(s)),c}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)})(t);case 7:return(e=>{if(null==e)return;let t=NaN;if("number"==typeof e)t=e;else if("string"==typeof e){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else"object"==typeof e&&1===e.tag&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*t))})(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(r.isStringSchema()){const e=r.getMergedTraits().mediaType;let s=t;if(e)return r.getMergedTraits().httpHeader&&(s=this.base64ToUtf8(s)),("application/json"===e||e.endsWith("+json"))&&(s=g.A.from(s)),s}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new w.D(t,"bigDecimal"):r.isBooleanSchema()?"true"===String(t).toLowerCase():t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??y.P)((this.serdeContext?.base64Decoder??b.E)(e))}}},27590:(e,t,r)=>{r.d(t,{m:()=>s});class s{async sign(e,t,r){return e}}},56826:(e,t,r)=>{r.d(t,{c:()=>m});var s=r(66391),i=r(25272),a=r(2203),n=r(12544);var o=r(39181),c=r(92278),d=r(2914);const l=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),u="The stream has already been transformed.",h=e=>{if(!f(e)&&!l(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(u);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 s=new FileReader;s.onloadend=()=>{if(2!==s.readyState)return r(new Error("Reader aborted too early"));const e=s.result??"",i=e.indexOf(","),a=i>-1?i+1:e.length;t(e.substring(a))},s.onabort=()=>r(new Error("Read aborted")),s.onerror=()=>r(s.error),s.readAsDataURL(e)})}(e),r=(0,n.E)(t);return new Uint8Array(r)}(e):async function(e){const t=[],r=e.getReader();let s=!1,i=0;for(;!s;){const{done:e,value:a}=await r.read();a&&(t.push(a),i+=a.length),s=e}const a=new Uint8Array(i);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}(e))(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if("base64"===e)return(0,o.n)(t);if("hex"===e)return(0,c.n)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(0,d.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(u);if(t=!0,f(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(l(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},f=e=>"function"==typeof Blob&&e instanceof Blob,p="The stream has already been transformed.",m=e=>{if(!(e instanceof a.Readable))try{return h(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(p);return t=!0,await(0,s.k)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();return void 0===e||Buffer.isEncoding(e)?(0,i.Q)(t.buffer,t.byteOffset,t.byteLength).toString(e):new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw new Error(p);if(null!==e.readableFlowing)throw new Error("The stream has been consumed by other callbacks.");if("function"!=typeof a.Readable.toWeb)throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,a.Readable.toWeb(e)}})}},61210:(e,t,r)=>{function s(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>s})},71407:(e,t,r)=>{r.d(t,{G:()=>s});const s=e=>{const t=e.length,r=[];let s,i=!1,a=0;for(let n=0;n<t;++n){const t=e[n];switch(t){case'"':"\\"!==s&&(i=!i);break;case",":i||(r.push(e.slice(a,n)),a=n+1)}s=t}return r.push(e.slice(a)),r.map(e=>{const t=(e=e.trim()).length;return t<2?e:('"'===e[0]&&'"'===e[t-1]&&(e=e.slice(1,t-1)),e.replace(/\\"/g,'"'))})}},76609:(e,t,r)=>{r.d(t,{Y:()=>D});var s=r(96440),i=r(83623);function a(e,t,r){if(r<=0||!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const s=e.split(t);if(1===r)return s;const i=[];let a="";for(let e=0;e<s.length;e++)""===a?a=s[e]:a+=t+s[e],(e+1)%r===0&&(i.push(a),a="");return""!==a&&i.push(a),i}var n=r(71407),o=r(86880),c=r(56826),d=r(77337),l=r(61210),u=r(52445);class h extends u.t{async serializeRequest(e,t,r){const a={...t??{}},n=this.serializer,c={},d={},u=await r.endpoint(),h=s.l.of(e?.input),f=h.getSchema();let p,m=!1;const g=new o.K({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:c,headers:d,body:void 0});if(u){this.updateServiceEndpoint(g,u),this.setHostPrefix(g,e,a);const t=(0,i.c)(e.traits);if(t.http){g.method=t.http[0];const[e,r]=t.http[1].split("?");"/"==g.path?g.path=e:g.path+=e;const s=new URLSearchParams(r??"");Object.assign(c,Object.fromEntries(s))}}for(const[e,t]of h.structIterator()){const r=t.getMergedTraits()??{},s=a[e];if(null!=s||t.isIdempotencyToken())if(r.httpPayload)t.isStreaming()?t.isStructSchema()?a[e]&&(p=await this.serializeEventStream({eventStream:a[e],requestSchema:h})):p=s:(n.write(t,s),p=n.flush()),delete a[e];else if(r.httpLabel){n.write(t,s);const r=n.flush();g.path.includes(`{${e}+}`)?g.path=g.path.replace(`{${e}+}`,r.split("/").map(l.$).join("/")):g.path.includes(`{${e}}`)&&(g.path=g.path.replace(`{${e}}`,(0,l.$)(r))),delete a[e]}else if(r.httpHeader)n.write(t,s),d[r.httpHeader.toLowerCase()]=String(n.flush()),delete a[e];else if("string"==typeof r.httpPrefixHeaders){for(const[e,i]of Object.entries(s)){const s=r.httpPrefixHeaders+e;n.write([t.getValueSchema(),{httpHeader:s}],i),d[s.toLowerCase()]=n.flush()}delete a[e]}else r.httpQuery||r.httpQueryParams?(this.serializeQuery(t,s,c),delete a[e]):m=!0}return m&&a&&(n.write(f,a),p=n.flush()),g.headers=d,g.query=c,g.body=p,g}serializeQuery(e,t,r){const s=this.serializer,i=e.getMergedTraits();if(i.httpQueryParams){for(const[s,a]of Object.entries(t))if(!(s in r)){const t=e.getValueSchema();Object.assign(t.getMergedTraits(),{...i,httpQuery:s,httpQueryParams:void 0}),this.serializeQuery(t,a,r)}}else if(e.isListSchema()){const a=!!e.getMergedTraits().sparse,n=[];for(const r of t){s.write([e.getValueSchema(),i],r);const t=s.flush();(a||void 0!==t)&&n.push(t)}r[i.httpQuery]=n}else s.write([e,i],t),r[i.httpQuery]=s.flush()}async deserializeResponse(e,t,r){const i=this.deserializer,a=s.l.of(e.output),n={};if(r.statusCode>=300){const s=await(0,d.P)(r.body,t);throw s.byteLength>0&&Object.assign(n,await i.read(15,s)),await this.handleError(e,t,r,n,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const e in r.headers){const t=r.headers[e];delete r.headers[e],r.headers[e.toLowerCase()]=t}const o=await this.deserializeHttpMessage(a,t,r,n);if(o.length){const e=await(0,d.P)(r.body,t);if(e.byteLength>0){const t=await i.read(a,e);for(const e of o)n[e]=t[e]}}else o.discardResponseBody&&await(0,d.P)(r.body,t);return n.$metadata=this.deserializeMetadata(r),n}async deserializeHttpMessage(e,t,r,i,o){let l;l=i instanceof Set?o:i;let u=!0;const h=this.deserializer,f=s.l.of(e),p=[];for(const[e,s]of f.structIterator()){const i=s.getMemberTraits();if(i.httpPayload){if(u=!1,s.isStreaming()){const t=s.isStructSchema();l[e]=t?await this.deserializeEventStream({response:r,responseSchema:f}):(0,c.c)(r.body)}else if(r.body){const i=await(0,d.P)(r.body,t);i.byteLength>0&&(l[e]=await h.read(s,i))}}else if(i.httpHeader){const t=String(i.httpHeader).toLowerCase(),o=r.headers[t];if(null!=o)if(s.isListSchema()){const r=s.getValueSchema();let i;r.getMergedTraits().httpHeader=t,i=r.isTimestampSchema()&&4===r.getSchema()?a(o,",",2):(0,n.G)(o);const c=[];for(const e of i)c.push(await h.read(r,e.trim()));l[e]=c}else l[e]=await h.read(s,o)}else if(void 0!==i.httpPrefixHeaders){l[e]={};for(const[t,a]of Object.entries(r.headers))if(t.startsWith(i.httpPrefixHeaders)){const r=s.getValueSchema();r.getMergedTraits().httpHeader=t,l[e][t.slice(i.httpPrefixHeaders.length)]=await h.read(r,a)}}else i.httpResponseCode?l[e]=r.statusCode:p.push(e)}return p.discardResponseBody=u,p}}var f=r(37882);function p(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}var m=r(74910),g=r(34708),w=r(39181),b=r(79037),y=r(17735);class S extends b.f{settings;stringBuffer="";constructor(e){super(),this.settings=e}write(e,t){const r=s.l.of(e);switch(typeof t){case"object":if(null===t)return void(this.stringBuffer="null");if(r.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch((0,y.V)(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=(0,f.JV)(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in t)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??w.n)(t));if(r.isListSchema()&&Array.isArray(t)){let e="";for(const s of t){this.write([r.getValueSchema(),r.getMergedTraits()],s);const t=this.flush();""!==e&&(e+=", "),e+=r.getValueSchema().isTimestampSchema()?t:p(t)}return void(this.stringBuffer=e)}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":const e=r.getMergedTraits().mediaType;let s=t;if(e&&(("application/json"===e||e.endsWith("+json"))&&(s=m.A.from(s)),r.getMergedTraits().httpHeader))return void(this.stringBuffer=(this.serdeContext?.base64Encoder??w.n)(s.toString()));this.stringBuffer=t;break;default:r.isIdempotencyToken()?this.stringBuffer=(0,g.v4)():this.stringBuffer=String(t)}}flush(){const e=this.stringBuffer;return this.stringBuffer="",e}}class T{codecSerializer;stringSerializer;buffer;constructor(e,t,r=new S(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){const r=s.l.of(e),i=r.getMergedTraits();return i.httpHeader||i.httpLabel||i.httpQuery?(this.stringSerializer.write(r,t),void(this.buffer=this.stringSerializer.flush())):this.codecSerializer.write(r,t)}flush(){if(void 0!==this.buffer){const e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}var x=r(2914),v=r(40935),E=r(22371);class z extends b.f{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new E.k(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){const r=s.l.of(e),i=r.getMergedTraits(),a=this.serdeContext?.utf8Encoder??x.P;if(i.httpHeader||i.httpResponseCode)return this.stringDeserializer.read(r,a(t));if(i.httpPayload){if(r.isBlobSchema()){const e=this.serdeContext?.utf8Decoder??v.a;return"string"==typeof t?e(t):t}if(r.isStringSchema())return"byteLength"in t?a(t):t}return this.codecDeserializer.read(r,t)}}var C=r(38796),B=r(51011),$=r(93501),M=r(22461);class D extends h{serializer;deserializer;codec;mixin=new B.U;constructor({defaultNamespace:e}){super({defaultNamespace:e});const t={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new $.V(t),this.serializer=new T(this.codec.createSerializer(),t),this.deserializer=new z(this.codec.createDeserializer(),t)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,r){const i=await super.serializeRequest(e,t,r),a=s.l.of(e.input);if(!i.headers["content-type"]){const e=this.mixin.resolveRestContentType(this.getDefaultContentType(),a);e&&(i.headers["content-type"]=e)}return null==i.body&&i.headers["content-type"]===this.getDefaultContentType()&&(i.body="{}"),i}async deserializeResponse(e,t,r){const i=await super.deserializeResponse(e,t,r),a=s.l.of(e.output);for(const[e,t]of a.structIterator())t.getMemberTraits().httpPayload&&!(e in i)&&(i[e]=null);return i}async handleError(e,t,r,i,a){const n=(0,M.cJ)(r,i)??"Unknown",{errorSchema:o,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(n,this.options.defaultNamespace,r,i,a),d=s.l.of(o),l=i.message??i.Message??"Unknown",u=new(C.O.for(o[1]).getErrorCtor(o)??Error)(l);await this.deserializeHttpMessage(o,t,r,i);const h={};for(const[e,t]of d.structIterator()){const r=t.getMergedTraits().jsonName??e;h[e]=this.codec.createDeserializer().readObject(t,i[r])}throw this.mixin.decorateServiceException(Object.assign(u,c,{$fault:d.getMergedTraits().error,message:l},h),i)}getDefaultContentType(){return"application/json"}}}};
package/dist/482.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=482,exports.ids=[482],exports.modules={22371:(e,t,r)=>{r.d(t,{k:()=>w});var n=r(96440),s=r(71407);const i="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",o="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",l="(\\d?\\d)",c="(\\d{4})",u=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),d=new RegExp(`^${i}, ${l} ${o} ${c} ${a} GMT$`),h=new RegExp(`^${i}, ${l}-${o}-(\\d\\d) ${a} GMT$`),p=new RegExp(`^${i} ${o} ( [1-9]|\\d\\d) ${a} ${c}$`),g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function f(e,t,r){const n=Number(e);if(n<t||n>r)throw new Error(`Value ${n} out of range [${t}, ${r}]`)}var m=r(74910),y=r(52123),x=r(12544),b=r(2914),E=r(79037),S=r(17735);class w extends E.f{settings;constructor(e){super(),this.settings=e}read(e,t){const r=n.l.of(e);if(r.isListSchema())return(0,s.G)(t).map(e=>this.read(r.getValueSchema(),e));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??x.E)(t);if(r.isTimestampSchema())switch((0,S.V)(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC3339 timestamps must be strings");const t=u.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,n,s,i,o,a,,l,c]=t;f(n,1,12),f(s,1,31),f(i,0,23),f(o,0,59),f(a,0,60);const d=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(i),Number(o),Number(a),Number(l)?Math.round(1e3*parseFloat(`0.${l}`)):0));if(d.setUTCFullYear(Number(r)),"Z"!=c.toUpperCase()){const[,e,t,r]=/([+-])(\d\d):(\d\d)/.exec(c)||[void 0,"+",0,0],n="-"===e?1:-1;d.setTime(d.getTime()+n*(60*Number(t)*60*1e3+60*Number(r)*1e3))}return d})(t);case 6:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC7231 timestamps must be strings.");let t,r,n,s,i,o,a,l;if((l=d.exec(e))?[,t,r,n,s,i,o,a]=l:(l=h.exec(e))?([,t,r,n,s,i,o,a]=l,n=(Number(n)+1900).toString()):(l=p.exec(e))&&([,r,t,s,i,o,a,n]=l),n&&o){const e=Date.UTC(Number(n),g.indexOf(r),Number(t),Number(s),Number(i),Number(o),a?Math.round(1e3*parseFloat(`0.${a}`)):0);f(t,1,31),f(s,0,23),f(i,0,59),f(o,0,60);const l=new Date(e);return l.setUTCFullYear(Number(n)),l}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)})(t);case 7:return(e=>{if(null==e)return;let t=NaN;if("number"==typeof e)t=e;else if("string"==typeof e){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else"object"==typeof e&&1===e.tag&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*t))})(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(r.isStringSchema()){const e=r.getMergedTraits().mediaType;let n=t;if(e)return r.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n)),("application/json"===e||e.endsWith("+json"))&&(n=m.A.from(n)),n}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new y.D(t,"bigDecimal"):r.isBooleanSchema()?"true"===String(t).toLowerCase():t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??b.P)((this.serdeContext?.base64Decoder??x.E)(e))}}},27590:(e,t,r)=>{r.d(t,{m:()=>n});class n{async sign(e,t,r){return e}}},61210:(e,t,r)=>{function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>n})},71407:(e,t,r)=>{r.d(t,{G:()=>n});const n=e=>{const t=e.length,r=[];let n,s=!1,i=0;for(let o=0;o<t;++o){const t=e[o];switch(t){case'"':"\\"!==n&&(s=!s);break;case",":s||(r.push(e.slice(i,o)),i=o+1)}n=t}return r.push(e.slice(i)),r.map(e=>{const t=(e=e.trim()).length;return t<2?e:('"'===e[0]&&'"'===e[t-1]&&(e=e.slice(1,t-1)),e.replace(/\\"/g,'"'))})}},74033:e=>{e.exports={rE:"3.940.0"}},84482:(e,t,r)=>{r.d(t,{getDefaultRoleAssumer:()=>dn,getDefaultRoleAssumerWithWebIdentity:()=>hn});var n=r(53243),s=r(53872),i=r(28075);const o=!1;var a=r(17801),l=r(42829);const c={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 u=r(38796),d=r(60763);class h extends d.T{constructor(e){super(e),Object.setPrototypeOf(this,h.prototype)}}class p extends h{name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,p.prototype)}}class g extends h{name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),Object.setPrototypeOf(this,g.prototype)}}class f extends h{name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),Object.setPrototypeOf(this,f.prototype)}}class m extends h{name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),Object.setPrototypeOf(this,m.prototype)}}class y extends h{name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),Object.setPrototypeOf(this,y.prototype)}}class x extends h{name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,x.prototype)}}class b extends h{name="IDPCommunicationErrorException";$fault="client";constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,b.prototype)}}const E="AssumedRoleUser",S="Credentials",w="DurationSeconds",v="Policy",T="PolicyArns",N="PackedPolicySize",I="RoleArn",A="RoleSessionName",P="SourceIdentity",C="awsQueryError",D="client",k="error",O="httpError",$="message",R="smithy.ts.sdk.synthetic.com.amazonaws.sts",M="com.amazonaws.sts";var F=[0,M,"accessKeySecretType",8,0],j=[0,M,"clientTokenType",8,0],U=[3,M,E,0,["AssumedRoleId","Arn"],[0,0]],V=[3,M,"AssumeRoleRequest",0,[I,A,T,v,w,"Tags","TransitiveTagKeys","ExternalId","SerialNumber","TokenCode",P,"ProvidedContexts"],[0,0,()=>te,0,1,()=>ne,64,0,0,0,0,()=>re]],_=[3,M,"AssumeRoleResponse",0,[S,E,N,P],[[()=>K,0],()=>U,1,0]],L=[3,M,"AssumeRoleWithWebIdentityRequest",0,[I,A,"WebIdentityToken","ProviderId",T,v,w],[0,0,[()=>j,0],0,()=>te,0,1]],z=[3,M,"AssumeRoleWithWebIdentityResponse",0,[S,"SubjectFromWebIdentityToken",E,N,"Provider","Audience",P],[[()=>K,0],0,()=>U,1,0,0,0]],K=[3,M,S,0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[0,[()=>F,0],0,4]],W=[-3,M,"ExpiredTokenException",{[k]:D,[O]:400,[C]:["ExpiredTokenException",400]},[$],[0]];u.O.for(M).registerError(W,p);var B=[-3,M,"IDPCommunicationErrorException",{[k]:D,[O]:400,[C]:["IDPCommunicationError",400]},[$],[0]];u.O.for(M).registerError(B,b);var q=[-3,M,"IDPRejectedClaimException",{[k]:D,[O]:403,[C]:["IDPRejectedClaim",403]},[$],[0]];u.O.for(M).registerError(q,y);var G=[-3,M,"InvalidIdentityTokenException",{[k]:D,[O]:400,[C]:["InvalidIdentityToken",400]},[$],[0]];u.O.for(M).registerError(G,x);var Z=[-3,M,"MalformedPolicyDocumentException",{[k]:D,[O]:400,[C]:["MalformedPolicyDocument",400]},[$],[0]];u.O.for(M).registerError(Z,g);var Y=[-3,M,"PackedPolicyTooLargeException",{[k]:D,[O]:400,[C]:["PackedPolicyTooLarge",400]},[$],[0]];u.O.for(M).registerError(Y,f);var H=[3,M,"PolicyDescriptorType",0,["arn"],[0]],Q=[3,M,"ProvidedContext",0,["ProviderArn","ContextAssertion"],[0,0]],X=[-3,M,"RegionDisabledException",{[k]:D,[O]:403,[C]:["RegionDisabledException",403]},[$],[0]];u.O.for(M).registerError(X,m);var J=[3,M,"Tag",0,["Key","Value"],[0,0]],ee=[-3,R,"STSServiceException",0,[],[]];u.O.for(R).registerError(ee,h);var te=[1,M,"policyDescriptorListType",0,()=>H],re=[1,M,"ProvidedContextsListType",0,()=>Q],ne=[1,M,"tagListType",0,()=>J],se=[9,M,"AssumeRole",0,()=>V,()=>_],ie=[9,M,"AssumeRoleWithWebIdentity",0,()=>L,()=>z];class oe extends(l.u.classBuilder().ep(c).m(function(e,t,r,n){return[(0,a.r)(r,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc(se).build()){}class ae extends(l.u.classBuilder().ep(c).m(function(e,t,r,n){return[(0,a.r)(r,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(ie).build()){}const le=e=>{if("string"==typeof e?.Arn){const t=e.Arn.split(":");if(t.length>4&&""!==t[4])return t[4]}},ce=async(e,t,r,n={})=>{const a="function"==typeof e?await e():e,l="function"==typeof t?await t():t,c=await function(e={}){return(0,i.Z)({...s.GG,default:async()=>(o||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1")},{...s.zH,...e})}(n)();return r?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${a} (credential provider clientConfig)`,`${l} (contextual client)`,`${c} (STS default: AWS_REGION, profile region, or us-east-1)`),a??l??c},ue=e=>"h2"===e?.metadata?.handlerProtocol;var de=r(42355),he=r(79749),pe=r(59537),ge=r(58093),fe=r(90933),me=r(93786),ye=r(85766),xe=r(99522),be=r(62306),Ee=r(83046),Se=r(7317),we=r(55845),ve=r(31965),Te=r(43162),Ne=r(88414),Ie=r(30379),Ae=r(11904),Pe=r(98367);const Ce=async(e,t,r)=>({operation:(0,Ae.u)(t).operation,region:await(0,Pe.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),De=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 ke=r(74033),Oe=r(55343),$e=r(91677),Re=r(83749),Me=r(82112),Fe=r(56564),je=r(92052),Ue=r(77702),Ve=r(27590),_e=r(52989),Le=r(7940),ze=r(66391),Ke=r(55425),We=r(6141),Be=r(4866),qe=r(77337),Ge=r(79931),Ze=r(96440),Ye=r(51011);const He={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,r){return e},captureMetaData:!1},Qe=":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",Xe=new RegExp("^["+Qe+"]["+Qe+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function Je(e,t){const r=[];let n=t.exec(e);for(;n;){const s=[];s.startIndex=t.lastIndex-n[0].length;const i=n.length;for(let e=0;e<i;e++)s.push(n[e]);r.push(s),n=t.exec(e)}return r}const et=function(e){return!(null==Xe.exec(e))};let tt;tt="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class rt{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][tt]={startIndex:t})}static getMetaDataSymbol(){return tt}}function nt(e,t){const r={};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 n=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,n--):n--,0===n)break}else"["===e[t]?s=!0:o+=e[t];else{if(s&&ct(e,"!ENTITY",t)){let n,s;t+=7,[n,s,t]=it(e,t+1),-1===s.indexOf("&")&&(r[n]={regx:RegExp(`&${n};`,"g"),val:s})}else if(s&&ct(e,"!ELEMENT",t)){t+=8;const{index:r}=lt(e,t+1);t=r}else if(s&&ct(e,"!ATTLIST",t))t+=8;else if(s&&ct(e,"!NOTATION",t)){t+=9;const{index:r}=ot(e,t+1);t=r}else{if(!ct(e,"!--",t))throw new Error("Invalid DOCTYPE");i=!0}n++,o=""}if(0!==n)throw new Error("Unclosed DOCTYPE")}return{entities:r,i:t}}const st=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function it(e,t){t=st(e,t);let r="";for(;t<e.length&&!/\s/.test(e[t])&&'"'!==e[t]&&"'"!==e[t];)r+=e[t],t++;if(ut(r),t=st(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 n="";return[t,n]=at(e,t,"entity"),[r,n,--t]}function ot(e,t){t=st(e,t);let r="";for(;t<e.length&&!/\s/.test(e[t]);)r+=e[t],t++;ut(r),t=st(e,t);const n=e.substring(t,t+6).toUpperCase();if("SYSTEM"!==n&&"PUBLIC"!==n)throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);t+=n.length,t=st(e,t);let s=null,i=null;if("PUBLIC"===n)[t,s]=at(e,t,"publicIdentifier"),'"'!==e[t=st(e,t)]&&"'"!==e[t]||([t,i]=at(e,t,"systemIdentifier"));else if("SYSTEM"===n&&([t,i]=at(e,t,"systemIdentifier"),!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:s,systemIdentifier:i,index:--t}}function at(e,t,r){let n="";const s=e[t];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(t++;t<e.length&&e[t]!==s;)n+=e[t],t++;if(e[t]!==s)throw new Error(`Unterminated ${r} value`);return[++t,n]}function lt(e,t){t=st(e,t);let r="";for(;t<e.length&&!/\s/.test(e[t]);)r+=e[t],t++;if(!ut(r))throw new Error(`Invalid element name: "${r}"`);let n="";if("E"===e[t=st(e,t)]&&ct(e,"MPTY",t))t+=4;else if("A"===e[t]&&ct(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];)n+=e[t],t++;if(")"!==e[t])throw new Error("Unterminated content model")}return{elementName:r,contentModel:n.trim(),index:t}}function ct(e,t,r){for(let n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function ut(e){if(et(e))return e;throw new Error(`Invalid entity name ${e}`)}const dt=/^[-+]?0x[a-fA-F0-9]+$/,ht=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,pt={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const gt=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;class ft{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=mt,this.parseXml=St,this.parseTextData=yt,this.resolveNameSpace=xt,this.buildAttributesMap=Et,this.isItStopNode=Nt,this.replaceEntitiesValue=vt,this.readStopNodeData=Pt,this.saveTextToParentTag=Tt,this.addChild=wt,this.ignoreAttributesFn="function"==typeof(t=this.options.ignoreAttributes)?t:Array.isArray(t)?e=>{for(const r of t){if("string"==typeof r&&e===r)return!0;if(r instanceof RegExp&&r.test(e))return!0}}:()=>!1}}function mt(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}function yt(e,t,r,n,s,i,o){if(void 0!==e&&(this.options.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const n=this.options.tagValueProcessor(t,e,r,s,i);return null==n?e:typeof n!=typeof e||n!==e?n:this.options.trimValues||e.trim()===e?Ct(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function xt(e){if(this.options.removeNSPrefix){const t=e.split(":"),r="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=r+t[1])}return e}const bt=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Et(e,t,r){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const r=Je(e,bt),n=r.length,s={};for(let e=0;e<n;e++){const n=this.resolveNameSpace(r[e][1]);if(this.ignoreAttributesFn(n,t))continue;let i=r[e][4],o=this.options.attributeNamePrefix+n;if(n.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(n,i,t);s[o]=null==e?i:typeof e!=typeof i||e!==i?e:Ct(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 St=function(e){e=e.replace(/\r\n?/g,"\n");const t=new rt("!xml");let r=t,n="",s="";for(let i=0;i<e.length;i++)if("<"===e[i])if("/"===e[i+1]){const t=It(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)),r&&(n=this.saveTextToParentTag(n,r,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),r=this.tagsNodeStack.pop(),n="",i=t}else if("?"===e[i+1]){let t=At(e,i,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,s),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new rt(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,s,t.tagName)),this.addChild(r,e,s,i)}i=t.closeIndex+1}else if("!--"===e.substr(i+1,3)){const t=It(e,"--\x3e",i+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(i+4,t-2);n=this.saveTextToParentTag(n,r,s),r.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}i=t}else if("!D"===e.substr(i+1,2)){const t=nt(e,i);this.docTypeEntities=t.entities,i=t.i}else if("!["===e.substr(i+1,2)){const t=It(e,"]]>",i,"CDATA is not closed.")-2,o=e.substring(i+9,t);n=this.saveTextToParentTag(n,r,s);let a=this.parseTextData(o,r.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):r.add(this.options.textNodeName,a),i=t+2}else{let o=At(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)),r&&n&&"!xml"!==r.tagname&&(n=this.saveTextToParentTag(n,r,s,!1));const h=r;h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(r=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==t.tagname&&(s+=s?"."+a:a);const p=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 r=this.readStopNodeData(e,l,d+1);if(!r)throw new Error(`Unexpected end of ${l}`);i=r.i,t=r.tagContent}const n=new rt(a);a!==c&&u&&(n[":@"]=this.buildAttributesMap(c,s,a)),t&&(t=this.parseTextData(t,a,s,!0,u,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),n.add(this.options.textNodeName,t),this.addChild(r,n,s,p)}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 rt(a);a!==c&&u&&(e[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(r,e,s,p),s=s.substr(0,s.lastIndexOf("."))}else{const e=new rt(a);this.tagsNodeStack.push(r),a!==c&&u&&(e[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(r,e,s,p),r=e}n="",i=d}}else n+=e[i];return t.child};function wt(e,t,r,n){this.options.captureMetaData||(n=void 0);const s=this.options.updateTag(t.tagname,r,t[":@"]);!1===s||("string"==typeof s?(t.tagname=s,e.addChild(t,n)):e.addChild(t,n))}const vt=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(let t in this.lastEntities){const r=this.lastEntities[t];e=e.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const r=this.htmlEntities[t];e=e.replace(r.regex,r.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Tt(e,t,r,n){return e&&(void 0===n&&(n=0===t.child.length),void 0!==(e=this.parseTextData(e,t.tagname,r,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,n))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function Nt(e,t,r){const n="*."+r;for(const r in e){const s=e[r];if(n===s||t===s)return!0}return!1}function It(e,t,r,n){const s=e.indexOf(t,r);if(-1===s)throw new Error(n);return s+t.length-1}function At(e,t,r,n=">"){const s=function(e,t,r=">"){let n,s="";for(let i=t;i<e.length;i++){let t=e[i];if(n)t===n&&(n="");else if('"'===t||"'"===t)n=t;else if(t===r[0]){if(!r[1])return{data:s,index:i};if(e[i+1]===r[1])return{data:s,index:i}}else"\t"===t&&(t=" ");s+=t}}(e,t+1,n);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(r){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 Pt(e,t,r){const n=r;let s=1;for(;r<e.length;r++)if("<"===e[r])if("/"===e[r+1]){const i=It(e,">",r,`${t} is not closed`);if(e.substring(r+2,i).trim()===t&&(s--,0===s))return{tagContent:e.substring(n,r),i};r=i}else if("?"===e[r+1])r=It(e,"?>",r+1,"StopNode is not closed.");else if("!--"===e.substr(r+1,3))r=It(e,"--\x3e",r+3,"StopNode is not closed.");else if("!["===e.substr(r+1,2))r=It(e,"]]>",r,"StopNode is not closed.")-2;else{const n=At(e,r,">");n&&((n&&n.tagName)===t&&"/"!==n.tagExp[n.tagExp.length-1]&&s++,r=n.closeIndex)}}function Ct(e,t,r){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&function(e,t={}){if(t=Object.assign({},pt,t),!e||"string"!=typeof e)return e;let r=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(r))return e;if("0"===e)return 0;if(t.hex&&dt.test(r))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")}(r);if(-1!==r.search(/.+[eE].+/))return function(e,t,r){if(!r.eNotation)return e;const n=t.match(gt);if(n){let s=n[1]||"";const i=-1===n[3].indexOf("e")?"E":"e",o=n[2],a=s?e[o.length+1]===i:e[o.length]===i;return o.length>1&&a?e:1!==o.length||!n[3].startsWith(`.${i}`)&&n[3][0]!==i?r.leadingZeros&&!a?(t=(n[1]||"")+n[3],Number(t)):e:Number(t)}return e}(e,r,t);{const s=ht.exec(r);if(s){const i=s[1]||"",o=s[2];let a=(n=s[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substring(0,n.length-1)),n):n;const l=i?"."===e[o.length+1]:"."===e[o.length];if(!t.leadingZeros&&(o.length>1||1===o.length&&!l))return e;{const n=Number(r),s=String(n);if(0===n)return n;if(-1!==s.search(/[eE]/))return t.eNotation?n:e;if(-1!==r.indexOf("."))return"0"===s||s===a||s===`${i}${a}`?n:e;let l=o?a:r;return o?l===s||i+l===s?n:e:l===s||l===i+s?n:e}}return e}var n}(e,r)}return function(e){return void 0!==e}(e)?e:""}const Dt=rt.getMetaDataSymbol();function kt(e,t){return Ot(e,t)}function Ot(e,t,r){let n;const s={};for(let i=0;i<e.length;i++){const o=e[i],a=$t(o);let l="";if(l=void 0===r?a:r+"."+a,a===t.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){let e=Ot(o[a],t,l);const r=Mt(e,t);void 0!==o[Dt]&&(e[Dt]=o[Dt]),o[":@"]?Rt(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,r)?s[a]=[e]:s[a]=e}}}return"string"==typeof n?n.length>0&&(s[t.textNodeName]=n):void 0!==n&&(s[t.textNodeName]=n),s}function $t(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const r=t[e];if(":@"!==r)return r}}function Rt(e,t,r,n){if(t){const s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){const i=s[o];n.isArray(i,r+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function Mt(e,t){const{textNodeName:r}=t,n=Object.keys(e).length;return 0===n||!(1!==n||!e[r]&&"boolean"!=typeof e[r]&&0!==e[r])}const Ft={allowBooleanAttributes:!1,unpairedTags:[]};function jt(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Ut(e,t){const r=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const n=e.substr(r,t-r);if(t>5&&"xml"===n)return Wt("InvalidXml","XML declaration allowed only at the start of the document.",Gt(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function Vt(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 r=1;for(t+=8;t<e.length;t++)if("<"===e[t])r++;else if(">"===e[t]&&(r--,0===r))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 _t(e,t){let r="",n="",s=!1;for(;t<e.length;t++){if('"'===e[t]||"'"===e[t])""===n?n=e[t]:n!==e[t]||(n="");else if(">"===e[t]&&""===n){s=!0;break}r+=e[t]}return""===n&&{value:r,index:t,tagClosed:s}}const Lt=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function zt(e,t){const r=Je(e,Lt),n={};for(let e=0;e<r.length;e++){if(0===r[e][1].length)return Wt("InvalidAttr","Attribute '"+r[e][2]+"' has no space in starting.",Zt(r[e]));if(void 0!==r[e][3]&&void 0===r[e][4])return Wt("InvalidAttr","Attribute '"+r[e][2]+"' is without value.",Zt(r[e]));if(void 0===r[e][3]&&!t.allowBooleanAttributes)return Wt("InvalidAttr","boolean attribute '"+r[e][2]+"' is not allowed.",Zt(r[e]));const s=r[e][2];if(!Bt(s))return Wt("InvalidAttr","Attribute '"+s+"' is an invalid name.",Zt(r[e]));if(n.hasOwnProperty(s))return Wt("InvalidAttr","Attribute '"+s+"' is repeated.",Zt(r[e]));n[s]=1}return!0}function Kt(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let r=/\d/;for("x"===e[t]&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(r))break}return-1}(e,++t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(";"===e[t])break;return-1}return t}function Wt(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function Bt(e){return et(e)}function qt(e){return et(e)}function Gt(e,t){const r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function Zt(e){return e.startIndex+e[1].length}const Yt=new class{constructor(e){this.externalEntities={},this.options=function(e){return Object.assign({},He,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 r=function(e,t){t=Object.assign({},Ft,t);const r=[];let n=!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=Ut(e,i),i.err)return i}else{if("<"!==e[i]){if(jt(e[i]))continue;return Wt("InvalidChar","char '"+e[i]+"' is not expected.",Gt(e,i))}{let o=i;if(i++,"!"===e[i]){i=Vt(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--),!qt(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Wt("InvalidTag",t,Gt(e,i))}const c=_t(e,i);if(!1===c)return Wt("InvalidAttr","Attributes for '"+l+"' have open quote.",Gt(e,i));let u=c.value;if(i=c.index,"/"===u[u.length-1]){const r=i-u.length;u=u.substring(0,u.length-1);const s=zt(u,t);if(!0!==s)return Wt(s.err.code,s.err.msg,Gt(e,r+s.err.line));n=!0}else if(a){if(!c.tagClosed)return Wt("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Gt(e,i));if(u.trim().length>0)return Wt("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Gt(e,o));if(0===r.length)return Wt("InvalidTag","Closing tag '"+l+"' has not been opened.",Gt(e,o));{const t=r.pop();if(l!==t.tagName){let r=Gt(e,t.tagStartPos);return Wt("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+r.line+", col "+r.col+") instead of closing tag '"+l+"'.",Gt(e,o))}0==r.length&&(s=!0)}}else{const a=zt(u,t);if(!0!==a)return Wt(a.err.code,a.err.msg,Gt(e,i-u.length+a.err.line));if(!0===s)return Wt("InvalidXml","Multiple possible root nodes found.",Gt(e,i));-1!==t.unpairedTags.indexOf(l)||r.push({tagName:l,tagStartPos:o}),n=!0}for(i++;i<e.length;i++)if("<"===e[i]){if("!"===e[i+1]){i++,i=Vt(e,i);continue}if("?"!==e[i+1])break;if(i=Ut(e,++i),i.err)return i}else if("&"===e[i]){const t=Kt(e,i);if(-1==t)return Wt("InvalidChar","char '&' is not expected.",Gt(e,i));i=t}else if(!0===s&&!jt(e[i]))return Wt("InvalidXml","Extra text at the end",Gt(e,i));"<"===e[i]&&i--}}}return n?1==r.length?Wt("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Gt(e,r[0].tagStartPos)):!(r.length>0)||Wt("InvalidXml","Invalid '"+JSON.stringify(r.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Wt("InvalidXml","Start tag expected.",1)}(e,t);if(!0!==r)throw Error(`${r.err.msg}:${r.err.line}:${r.err.col}`)}const r=new ft(this.options);r.addExternalEntities(this.externalEntities);const n=r.parseXml(e);return this.options.preserveOrder||void 0===n?n:kt(n,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 '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return rt.getMetaDataSymbol()}}({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});Yt.addEntity("#xD","\r"),Yt.addEntity("#10","\n");var Ht=r(22371);const Qt=e=>{const t="#text";for(const r in e)e.hasOwnProperty(r)&&void 0!==e[r][t]?e[r]=e[r][t]:"object"==typeof e[r]&&null!==e[r]&&(e[r]=Qt(e[r]));return e};var Xt=r(2914),Jt=r(57007);class er extends Jt.B{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new Ht.k(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,t,r){const n=Ze.l.of(e),s=n.getMemberSchemas();if(n.isStructSchema()&&n.isMemberSchema()&&Object.values(s).find(e=>!!e.getMemberTraits().eventPayload)){const e={},r=Object.keys(s)[0];return s[r].isBlobSchema()?e[r]=t:e[r]=this.read(s[r],t),e}const i=(this.serdeContext?.utf8Encoder??Xt.P)(t),o=this.parseXml(i);return this.readSchema(e,r?o[r]:o)}readSchema(e,t){const r=Ze.l.of(e);if(r.isUnitSchema())return;const n=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(t))return this.readSchema(r,[t]);if(null==t)return t;if("object"==typeof t){const e=!!n.sparse,s=!!n.xmlFlattened;if(r.isListSchema()){const n=r.getValueSchema(),i=[],o=n.getMergedTraits().xmlName??"member",a=s?t:(t[0]??t)[o],l=Array.isArray(a)?a:[a];for(const t of l)(null!=t||e)&&i.push(this.readSchema(n,t));return i}const i={};if(r.isMapSchema()){const n=r.getKeySchema(),o=r.getValueSchema();let a;a=s?Array.isArray(t)?t:[t]:Array.isArray(t.entry)?t.entry:[t.entry];const l=n.getMergedTraits().xmlName??"key",c=o.getMergedTraits().xmlName??"value";for(const t of a){const r=t[l],n=t[c];(null!=n||e)&&(i[r]=this.readSchema(o,n))}return i}if(r.isStructSchema()){for(const[e,n]of r.structIterator()){const r=n.getMergedTraits(),s=r.httpPayload?r.xmlName??n.getName():n.getMemberTraits().xmlName??e;null!=t[s]&&(i[e]=this.readSchema(n,t[s]))}return i}if(r.isDocumentSchema())return t;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,t)}parseXml(e){if(e.length){let r;try{t=e,r=Yt.parse(t,!0)}catch(t){throw t&&"object"==typeof t&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}const n="#text",s=Object.keys(r)[0],i=r[s];return i[n]&&(i[s]=i[n],delete i[n]),Qt(i)}var t;return{}}}var tr=r(17735),rr=r(61210),nr=r(34708),sr=r(52123),ir=r(37882),or=r(39181),ar=r(98893);class lr extends Jt.B{settings;buffer;constructor(e){super(),this.settings=e}write(e,t,r=""){void 0===this.buffer&&(this.buffer="");const n=Ze.l.of(e);if(r&&!r.endsWith(".")&&(r+="."),n.isBlobSchema())("string"==typeof t||t instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??or.n)(t)));else if(n.isBooleanSchema()||n.isNumericSchema()||n.isStringSchema())null!=t?(this.writeKey(r),this.writeValue(String(t))):n.isIdempotencyToken()&&(this.writeKey(r),this.writeValue((0,nr.v4)()));else if(n.isBigIntegerSchema())null!=t&&(this.writeKey(r),this.writeValue(String(t)));else if(n.isBigDecimalSchema())null!=t&&(this.writeKey(r),this.writeValue(t instanceof sr.D?t.string:String(t)));else if(n.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(r),(0,tr.V)(n,this.settings)){case 5:this.writeValue(t.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue((0,ir.JV)(t));break;case 7:this.writeValue(String(t.getTime()/1e3))}}else{if(n.isDocumentSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unsupported document type ${n.getName(!0)}`);if(n.isListSchema()){if(Array.isArray(t))if(0===t.length)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else{const e=n.getValueSchema(),s=this.settings.flattenLists||n.getMergedTraits().xmlFlattened;let i=1;for(const n of t){if(null==n)continue;const t=this.getKey("member",e.getMergedTraits().xmlName),o=s?`${r}${i}`:`${r}${t}.${i}`;this.write(e,n,o),++i}}}else if(n.isMapSchema()){if(t&&"object"==typeof t){const e=n.getKeySchema(),s=n.getValueSchema(),i=n.getMergedTraits().xmlFlattened;let o=1;for(const[n,a]of Object.entries(t)){if(null==a)continue;const t=this.getKey("key",e.getMergedTraits().xmlName),l=i?`${r}${o}.${t}`:`${r}entry.${o}.${t}`,c=this.getKey("value",s.getMergedTraits().xmlName),u=i?`${r}${o}.${c}`:`${r}entry.${o}.${c}`;this.write(e,n,l),this.write(s,a,u),++o}}}else if(n.isStructSchema()){if(t&&"object"==typeof t)for(const[e,s]of(0,ar.R)(n,t)){if(null==t[e]&&!s.isIdempotencyToken())continue;const n=`${r}${this.getKey(e,s.getMergedTraits().xmlName)}`;this.write(s,t[e],n)}}else if(!n.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${n.getName(!0)}`)}}flush(){if(void 0===this.buffer)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const e=this.buffer;return delete this.buffer,e}getKey(e,t){const r=t??e;return this.settings.capitalizeKeys?r[0].toUpperCase()+r.slice(1):r}writeKey(e){e.endsWith(".")&&(e=e.slice(0,e.length-1)),this.buffer+=`&${(0,rr.$)(e)}=`}writeValue(e){this.buffer+=(0,rr.$)(e)}}class cr extends Be.M{options;serializer;deserializer;mixin=new Ye.U;constructor(e){super({defaultNamespace:e.defaultNamespace}),this.options=e;const t={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new lr(t),this.deserializer=new er(t)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,t,r){const n=await super.serializeRequest(e,t,r);n.path.endsWith("/")||(n.path+="/"),Object.assign(n.headers,{"content-type":"application/x-www-form-urlencoded"}),"unit"!==(0,Ge.L)(e.input)&&n.body||(n.body="");const s=e.name.split("#")[1]??e.name;return n.body=`Action=${s}&Version=${this.options.version}`+n.body,n.body.endsWith("&")&&(n.body=n.body.slice(-1)),n}async deserializeResponse(e,t,r){const n=this.deserializer,s=Ze.l.of(e.output),i={};if(r.statusCode>=300){const s=await(0,qe.P)(r.body,t);s.byteLength>0&&Object.assign(i,await n.read(15,s)),await this.handleError(e,t,r,i,this.deserializeMetadata(r))}for(const e in r.headers){const t=r.headers[e];delete r.headers[e],r.headers[e.toLowerCase()]=t}const o=e.name.split("#")[1]??e.name,a=s.isStructSchema()&&this.useNestedResult()?o+"Result":void 0,l=await(0,qe.P)(r.body,t);return l.byteLength>0&&Object.assign(i,await n.read(s,l,a)),{$metadata:this.deserializeMetadata(r),...i}}useNestedResult(){return!0}async handleError(e,t,r,n,s){const i=this.loadQueryErrorCode(r,n)??"Unknown",o=this.loadQueryError(n),a=this.loadQueryErrorMessage(n);o.message=a,o.Error={Type:o.Type,Code:o.Code,Message:a};const{errorSchema:l,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,r,o,s,(e,t)=>{try{return e.getSchema(t)}catch(r){return e.find(e=>Ze.l.of(e).getMergedTraits().awsQueryError?.[0]===t)}}),d=Ze.l.of(l),h=new(u.O.for(l[1]).getErrorCtor(l)??Error)(a),p={Error:o.Error};for(const[e,t]of d.structIterator()){const r=t.getMergedTraits().xmlName??e,s=o[r]??n[r];p[e]=this.deserializer.readSchema(t,s)}throw this.mixin.decorateServiceException(Object.assign(h,c,{$fault:d.getMergedTraits().error,message:a},p),n)}loadQueryErrorCode(e,t){const r=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;return void 0!==r?r:404==e.statusCode?"NotFound":void 0}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){const t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}var ur=r(17209),dr=r(71918),hr=r(12544),pr=r(40935),gr=r(99609),fr=r(21954),mr=r(92385),yr=r(97979);const xr="required",br="type",Er="fn",Sr="argv",wr="ref",vr=!1,Tr=!0,Nr="booleanEquals",Ir="stringEquals",Ar="sigv4",Pr="us-east-1",Cr="endpoint",Dr="https://sts.{Region}.{PartitionResult#dnsSuffix}",kr="tree",Or="error",$r="getAttr",Rr={[xr]:!1,[br]:"string"},Mr={[xr]:!0,default:!1,[br]:"boolean"},Fr={[wr]:"Endpoint"},jr={[Er]:"isSet",[Sr]:[{[wr]:"Region"}]},Ur={[wr]:"Region"},Vr={[Er]:"aws.partition",[Sr]:[Ur],assign:"PartitionResult"},_r={[wr]:"UseFIPS"},Lr={[wr]:"UseDualStack"},zr={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Ar,signingName:"sts",signingRegion:Pr}]},headers:{}},Kr={},Wr={conditions:[{[Er]:Ir,[Sr]:[Ur,"aws-global"]}],[Cr]:zr,[br]:Cr},Br={[Er]:Nr,[Sr]:[_r,!0]},qr={[Er]:Nr,[Sr]:[Lr,!0]},Gr={[Er]:$r,[Sr]:[{[wr]:"PartitionResult"},"supportsFIPS"]},Zr={[wr]:"PartitionResult"},Yr={[Er]:Nr,[Sr]:[!0,{[Er]:$r,[Sr]:[Zr,"supportsDualStack"]}]},Hr=[{[Er]:"isSet",[Sr]:[Fr]}],Qr=[Br],Xr=[qr],Jr={version:"1.0",parameters:{Region:Rr,UseDualStack:Mr,UseFIPS:Mr,Endpoint:Rr,UseGlobalEndpoint:Mr},rules:[{conditions:[{[Er]:Nr,[Sr]:[{[wr]:"UseGlobalEndpoint"},Tr]},{[Er]:"not",[Sr]:Hr},jr,Vr,{[Er]:Nr,[Sr]:[_r,vr]},{[Er]:Nr,[Sr]:[Lr,vr]}],rules:[{conditions:[{[Er]:Ir,[Sr]:[Ur,"ap-northeast-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"ap-south-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"ap-southeast-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"ap-southeast-2"]}],endpoint:zr,[br]:Cr},Wr,{conditions:[{[Er]:Ir,[Sr]:[Ur,"ca-central-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"eu-central-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"eu-north-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"eu-west-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"eu-west-2"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"eu-west-3"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"sa-east-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,Pr]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"us-east-2"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"us-west-1"]}],endpoint:zr,[br]:Cr},{conditions:[{[Er]:Ir,[Sr]:[Ur,"us-west-2"]}],endpoint:zr,[br]:Cr},{endpoint:{url:Dr,properties:{authSchemes:[{name:Ar,signingName:"sts",signingRegion:"{Region}"}]},headers:Kr},[br]:Cr}],[br]:kr},{conditions:Hr,rules:[{conditions:Qr,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[br]:Or},{conditions:Xr,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[br]:Or},{endpoint:{url:Fr,properties:Kr,headers:Kr},[br]:Cr}],[br]:kr},{conditions:[jr],rules:[{conditions:[Vr],rules:[{conditions:[Br,qr],rules:[{conditions:[{[Er]:Nr,[Sr]:[Tr,Gr]},Yr],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Kr,headers:Kr},[br]:Cr}],[br]:kr},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[br]:Or}],[br]:kr},{conditions:Qr,rules:[{conditions:[{[Er]:Nr,[Sr]:[Gr,Tr]}],rules:[{conditions:[{[Er]:Ir,[Sr]:[{[Er]:$r,[Sr]:[Zr,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:Kr,headers:Kr},[br]:Cr},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Kr,headers:Kr},[br]:Cr}],[br]:kr},{error:"FIPS is enabled but this partition does not support FIPS",[br]:Or}],[br]:kr},{conditions:Xr,rules:[{conditions:[Yr],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Kr,headers:Kr},[br]:Cr}],[br]:kr},{error:"DualStack is enabled but this partition does not support DualStack",[br]:Or}],[br]:kr},Wr,{endpoint:{url:Dr,properties:Kr,headers:Kr},[br]:Cr}],[br]:kr}],[br]:kr},{error:"Invalid Configuration: Missing Region",[br]:Or}]},en=new fr.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),tn=(e,t={})=>en.get(e,()=>(0,mr.s)(Jr,{endpointParams:e,logger:t.logger}));yr.m.aws=gr.UF;var rn=r(74783),nn=r(85397),sn=r(56602);var on=r(79532),an=r(81355),ln=r(91415);class cn extends Ne.K{config;constructor(...[e]){const t=(e=>{(0,sn.I)(process.version);const t=(0,nn.I)(e),r=()=>t().then(rn.l),n=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??hr.E,base64Encoder:e?.base64Encoder??or.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??tn,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??De,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Re.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ve.m}],logger:e?.logger??new ur.N,protocol:e?.protocol??new cr({defaultNamespace:"com.amazonaws.sts",xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15"}),serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??dr.D,utf8Decoder:e?.utf8Decoder??pr.a,utf8Encoder:e?.utf8Encoder??Xt.P}))(e);(0,Oe.I)(process.version);const o={profile:e?.profile,logger:n.logger};return{...n,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,i.Z)($e.$,o),bodyLengthChecker:e?.bodyLengthChecker??Ke.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,Me.pf)({serviceId:n.serviceId,clientVersion:ke.rE}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4")||(async t=>await e.credentialDefaultProvider(t?.__config||{})()),signer:new Re.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ve.m}],maxAttempts:e?.maxAttempts??(0,i.Z)(ve.qs,e),region:e?.region??(0,i.Z)(s.GG,{...s.zH,...o}),requestHandler:Le.$.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,i.Z)({...ve.kN,default:async()=>(await r()).retryMode||We.L0},e),sha256:e?.sha256??_e.V.bind(null,"sha256"),streamCollector:e?.streamCollector??ze.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,i.Z)(je.e$,o),useFipsEndpoint:e?.useFipsEndpoint??(0,i.Z)(Ue.Ko,o),userAgentAppId:e?.userAgentAppId??(0,i.Z)(Fe.hV,o)}})(e||{});super(t),this.initConfig=t;const r=(n=t,Object.assign(n,{useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,useGlobalEndpoint:n.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var n;const o=(0,ge.D)(r),a=(0,ve.$z)(o),l=(0,me.T)(a),c=(0,de.OV)(l),u=((e,t)=>{const r=Object.assign((0,on.R)(e),(0,ln.xA)(e),(0,an.e)(e),(e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,n=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){n=e},credentials:()=>n}})(e));return t.forEach(e=>e.configure(r)),Object.assign(e,(0,on.$)(r),(0,ln.uv)(r),(0,an.j)(r),{httpAuthSchemes:(n=r).httpAuthSchemes(),httpAuthSchemeProvider:n.httpAuthSchemeProvider(),credentials:n.credentials()});var n})((e=>{const t=(r=e,Object.assign(r,{stsClientCtor:cn}));var r;const n=(0,Ie.h)(t);return Object.assign(n,{authSchemePreference:(0,Pe.t)(e.authSchemePreference??[])})})((0,we.C)(c)),e?.extensions||[]);this.config=u,this.middlewareStack.use((0,Ee.wq)(this.config)),this.middlewareStack.use((0,fe.sM)(this.config)),this.middlewareStack.use((0,Te.ey)(this.config)),this.middlewareStack.use((0,Se.vK)(this.config)),this.middlewareStack.use((0,de.TC)(this.config)),this.middlewareStack.use((0,he.Y7)(this.config)),this.middlewareStack.use((0,pe.n)(this.config)),this.middlewareStack.use((0,ye.w)(this.config,{httpAuthSchemeParametersProvider:Ce,identityProviderConfigProvider:async e=>new xe.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,be.l)(this.config))}destroy(){super.destroy()}}const un=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,dn=(e={},t)=>((e,t)=>{let r,s;return async(i,o)=>{if(s=i,!r){const{logger:n=e?.parentClientConfig?.logger,profile:i=e?.parentClientConfig?.profile,region:o,requestHandler:a=e?.parentClientConfig?.requestHandler,credentialProviderLogger:l,userAgentAppId:c=e?.parentClientConfig?.userAgentAppId}=e,u=await ce(o,e?.parentClientConfig?.region,l,{logger:n,profile:i}),d=!ue(a);r=new t({...e,userAgentAppId:c,profile:i,credentialDefaultProvider:()=>async()=>s,region:u,requestHandler:d?a:void 0,logger:n})}const{Credentials:a,AssumedRoleUser:l}=await r.send(new oe(o));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);const c=le(l),u={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...c&&{accountId:c}};return(0,n.g)(u,"CREDENTIALS_STS_ASSUME_ROLE","i"),u}})(e,un(cn,t)),hn=(e={},t)=>((e,t)=>{let r;return async s=>{if(!r){const{logger:n=e?.parentClientConfig?.logger,profile:s=e?.parentClientConfig?.profile,region:i,requestHandler:o=e?.parentClientConfig?.requestHandler,credentialProviderLogger:a,userAgentAppId:l=e?.parentClientConfig?.userAgentAppId}=e,c=await ce(i,e?.parentClientConfig?.region,a,{logger:n,profile:s}),u=!ue(o);r=new t({...e,userAgentAppId:l,profile:s,region:c,requestHandler:u?o:void 0,logger:n})}const{Credentials:i,AssumedRoleUser:o}=await r.send(new ae(s));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);const a=le(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,n.g)(l,"RESOLVED_ACCOUNT_ID","T"),(0,n.g)(l,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),l}})(e,un(cn,t))}};
package/dist/575.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=575,exports.ids=[575],exports.modules={21575:(e,r,t)=>{t.d(r,{CreateTokenCommand:()=>Pr,SSOOIDCClient:()=>_e});var o=t(42355),i=t(79749),n=t(59537),s=t(58093),a=t(90933),c=t(93786),p=t(85766),d=t(99522),u=t(62306),l=t(83046),h=t(7317),f=t(55845),m=t(31965),g=t(43162),v=t(88414),y=t(30379),S=t(11904),E=t(98367);const x=async(e,r,t)=>({operation:(0,S.u)(r).operation,region:await(0,E.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),P=e=>{const r=[];return"CreateToken"===e.operation?r.push({schemeId:"smithy.api#noAuth"}):r.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}(e)),r},I={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var O=t(74033),k=t(55343),b=t(91677),w=t(82112),C=t(56564),A=t(53872),_=t(92052),D=t(77702),$=t(52989),T=t(28075),R=t(7940),U=t(66391),j=t(55425),F=t(6141),z=t(83749),q=t(76609),G=t(27590),H=t(17209),V=t(71918),Z=t(12544),M=t(39181),N=t(40935),K=t(2914),L=t(99609),Y=t(21954),B=t(92385),W=t(97979);const J="required",Q="fn",X="argv",ee="ref",re=!0,te="isSet",oe="booleanEquals",ie="error",ne="endpoint",se="tree",ae="PartitionResult",ce="getAttr",pe={[J]:!1,type:"string"},de={[J]:!0,default:!1,type:"boolean"},ue={[ee]:"Endpoint"},le={[Q]:oe,[X]:[{[ee]:"UseFIPS"},!0]},he={[Q]:oe,[X]:[{[ee]:"UseDualStack"},!0]},fe={},me={[Q]:ce,[X]:[{[ee]:ae},"supportsFIPS"]},ge={[ee]:ae},ve={[Q]:oe,[X]:[!0,{[Q]:ce,[X]:[ge,"supportsDualStack"]}]},ye=[le],Se=[he],Ee=[{[ee]:"Region"}],xe={version:"1.0",parameters:{Region:pe,UseDualStack:de,UseFIPS:de,Endpoint:pe},rules:[{conditions:[{[Q]:te,[X]:[ue]}],rules:[{conditions:ye,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:ie},{conditions:Se,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:ie},{endpoint:{url:ue,properties:fe,headers:fe},type:ne}],type:se},{conditions:[{[Q]:te,[X]:Ee}],rules:[{conditions:[{[Q]:"aws.partition",[X]:Ee,assign:ae}],rules:[{conditions:[le,he],rules:[{conditions:[{[Q]:oe,[X]:[re,me]},ve],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:fe,headers:fe},type:ne}],type:se},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:ie}],type:se},{conditions:ye,rules:[{conditions:[{[Q]:oe,[X]:[me,re]}],rules:[{conditions:[{[Q]:"stringEquals",[X]:[{[Q]:ce,[X]:[ge,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:fe,headers:fe},type:ne},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:fe,headers:fe},type:ne}],type:se},{error:"FIPS is enabled but this partition does not support FIPS",type:ie}],type:se},{conditions:Se,rules:[{conditions:[ve],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:fe,headers:fe},type:ne}],type:se},{error:"DualStack is enabled but this partition does not support DualStack",type:ie}],type:se},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:fe,headers:fe},type:ne}],type:se}],type:se},{error:"Invalid Configuration: Missing Region",type:ie}]},Pe=new Y.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Ie=(e,r={})=>Pe.get(e,()=>(0,B.s)(xe,{endpointParams:e,logger:r.logger}));W.m.aws=L.UF;var Oe=t(74783),ke=t(85397),be=t(56602);var we=t(79532),Ce=t(81355),Ae=t(91415);class _e extends v.K{config;constructor(...[e]){const r=(e=>{(0,be.I)(process.version);const r=(0,ke.I)(e),t=()=>r().then(Oe.l),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Z.E,base64Encoder:e?.base64Encoder??M.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ie,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??P,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new z.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new G.m}],logger:e?.logger??new H.N,protocol:e?.protocol??new q.Y({defaultNamespace:"com.amazonaws.ssooidc"}),serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??V.D,utf8Decoder:e?.utf8Decoder??N.a,utf8Encoder:e?.utf8Encoder??K.P}))(e);(0,k.I)(process.version);const i={profile:e?.profile,logger:o.logger};return{...o,...e,runtime:"node",defaultsMode:r,authSchemePreference:e?.authSchemePreference??(0,T.Z)(b.$,i),bodyLengthChecker:e?.bodyLengthChecker??j.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,w.pf)({serviceId:o.serviceId,clientVersion:O.rE}),maxAttempts:e?.maxAttempts??(0,T.Z)(m.qs,e),region:e?.region??(0,T.Z)(A.GG,{...A.zH,...i}),requestHandler:R.$.create(e?.requestHandler??t),retryMode:e?.retryMode??(0,T.Z)({...m.kN,default:async()=>(await t()).retryMode||F.L0},e),sha256:e?.sha256??$.V.bind(null,"sha256"),streamCollector:e?.streamCollector??U.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,T.Z)(_.e$,i),useFipsEndpoint:e?.useFipsEndpoint??(0,T.Z)(D.Ko,i),userAgentAppId:e?.userAgentAppId??(0,T.Z)(C.hV,i)}})(e||{});super(r),this.initConfig=r;const t=(v=r,Object.assign(v,{useDualstackEndpoint:v.useDualstackEndpoint??!1,useFipsEndpoint:v.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}));var v;const S=(0,s.D)(t),I=(0,m.$z)(S),L=(0,c.T)(I),Y=(0,o.OV)(L),B=((e,r)=>{const t=Object.assign((0,we.R)(e),(0,Ae.xA)(e),(0,Ce.e)(e),(e=>{const r=e.httpAuthSchemes;let t=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const t=r.findIndex(r=>r.schemeId===e.schemeId);-1===t?r.push(e):r.splice(t,1,e)},httpAuthSchemes:()=>r,setHttpAuthSchemeProvider(e){t=e},httpAuthSchemeProvider:()=>t,setCredentials(e){o=e},credentials:()=>o}})(e));return r.forEach(e=>e.configure(t)),Object.assign(e,(0,we.$)(t),(0,Ae.uv)(t),(0,Ce.j)(t),{httpAuthSchemes:(o=t).httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()});var o})((e=>{const r=(0,y.h)(e);return Object.assign(r,{authSchemePreference:(0,E.t)(e.authSchemePreference??[])})})((0,f.C)(Y)),e?.extensions||[]);this.config=B,this.middlewareStack.use((0,l.wq)(this.config)),this.middlewareStack.use((0,a.sM)(this.config)),this.middlewareStack.use((0,g.ey)(this.config)),this.middlewareStack.use((0,h.vK)(this.config)),this.middlewareStack.use((0,o.TC)(this.config)),this.middlewareStack.use((0,i.Y7)(this.config)),this.middlewareStack.use((0,n.n)(this.config)),this.middlewareStack.use((0,p.w)(this.config,{httpAuthSchemeParametersProvider:x,identityProviderConfigProvider:async e=>new d.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,u.l)(this.config))}destroy(){super.destroy()}}var De=t(17801),$e=t(42829),Te=t(38796),Re=t(60763);class Ue extends Re.T{constructor(e){super(e),Object.setPrototypeOf(this,Ue.prototype)}}class je extends Ue{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,je.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class Fe extends Ue{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),Object.setPrototypeOf(this,Fe.prototype),this.error=e.error,this.error_description=e.error_description}}class ze extends Ue{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,ze.prototype),this.error=e.error,this.error_description=e.error_description}}class qe extends Ue{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,qe.prototype),this.error=e.error,this.error_description=e.error_description}}class Ge extends Ue{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),Object.setPrototypeOf(this,Ge.prototype),this.error=e.error,this.error_description=e.error_description}}class He extends Ue{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),Object.setPrototypeOf(this,He.prototype),this.error=e.error,this.error_description=e.error_description}}class Ve extends Ue{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,Ve.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class Ze extends Ue{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),Object.setPrototypeOf(this,Ze.prototype),this.error=e.error,this.error_description=e.error_description}}class Me extends Ue{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e}),Object.setPrototypeOf(this,Me.prototype),this.error=e.error,this.error_description=e.error_description}}class Ne extends Ue{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 Ke extends Ue{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Ke.prototype),this.error=e.error,this.error_description=e.error_description}}const Le="client",Ye="error",Be="error_description",We="http",Je="httpError",Qe="reason",Xe="refreshToken",er="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",rr="com.amazonaws.ssooidc";var tr=[0,rr,"AccessToken",8,0],or=[0,rr,"ClientSecret",8,0],ir=[0,rr,"CodeVerifier",8,0],nr=[0,rr,"IdToken",8,0],sr=[0,rr,"RefreshToken",8,0],ar=[-3,rr,"AccessDeniedException",{[Ye]:Le,[Je]:400},[Ye,Qe,Be],[0,0,0]];Te.O.for(rr).registerError(ar,je);var cr=[-3,rr,"AuthorizationPendingException",{[Ye]:Le,[Je]:400},[Ye,Be],[0,0]];Te.O.for(rr).registerError(cr,Fe);var pr=[3,rr,"CreateTokenRequest",0,["clientId","clientSecret","grantType","deviceCode","code",Xe,"scope","redirectUri","codeVerifier"],[0,[()=>or,0],0,0,0,[()=>sr,0],64,0,[()=>ir,0]]],dr=[3,rr,"CreateTokenResponse",0,["accessToken","tokenType","expiresIn",Xe,"idToken"],[[()=>tr,0],0,1,[()=>sr,0],[()=>nr,0]]],ur=[-3,rr,"ExpiredTokenException",{[Ye]:Le,[Je]:400},[Ye,Be],[0,0]];Te.O.for(rr).registerError(ur,ze);var lr=[-3,rr,"InternalServerException",{[Ye]:"server",[Je]:500},[Ye,Be],[0,0]];Te.O.for(rr).registerError(lr,qe);var hr=[-3,rr,"InvalidClientException",{[Ye]:Le,[Je]:401},[Ye,Be],[0,0]];Te.O.for(rr).registerError(hr,Ge);var fr=[-3,rr,"InvalidGrantException",{[Ye]:Le,[Je]:400},[Ye,Be],[0,0]];Te.O.for(rr).registerError(fr,He);var mr=[-3,rr,"InvalidRequestException",{[Ye]:Le,[Je]:400},[Ye,Qe,Be],[0,0,0]];Te.O.for(rr).registerError(mr,Ve);var gr=[-3,rr,"InvalidScopeException",{[Ye]:Le,[Je]:400},[Ye,Be],[0,0]];Te.O.for(rr).registerError(gr,Ze);var vr=[-3,rr,"SlowDownException",{[Ye]:Le,[Je]:400},[Ye,Be],[0,0]];Te.O.for(rr).registerError(vr,Me);var yr=[-3,rr,"UnauthorizedClientException",{[Ye]:Le,[Je]:400},[Ye,Be],[0,0]];Te.O.for(rr).registerError(yr,Ne);var Sr=[-3,rr,"UnsupportedGrantTypeException",{[Ye]:Le,[Je]:400},[Ye,Be],[0,0]];Te.O.for(rr).registerError(Sr,Ke);var Er=[-3,er,"SSOOIDCServiceException",0,[],[]];Te.O.for(er).registerError(Er,Ue);var xr=[9,rr,"CreateToken",{[We]:["POST","/token",200]},()=>pr,()=>dr];class Pr extends($e.u.classBuilder().ep(I).m(function(e,r,t,o){return[(0,De.r)(t,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(xr).build()){}},74033:e=>{e.exports={rE:"3.940.0"}}};
package/dist/67.js CHANGED
@@ -1 +1 @@
1
- "use strict";exports.id=67,exports.ids=[67],exports.modules={76067:(s,r,e)=>{e.d(r,{fromEnv:()=>o.sF});var o=e(14132)}};
1
+ "use strict";exports.id=67,exports.ids=[67],exports.modules={4987:(e,r,o)=>{o.d(r,{C:()=>n});var t=o(76982),s=o(16928),c=o(51362);const n=e=>{const r=(0,t.createHash)("sha1").update(e).digest("hex");return(0,s.join)((0,c.R)(),".aws","sso","cache",`${r}.json`)}},48440:(e,r,o)=>{o.d(r,{a:()=>c,v:()=>n});var t=o(91943),s=o(4987);const c={},n=async e=>{if(c[e])return c[e];const r=(0,s.C)(e),o=await(0,t.readFile)(r,"utf8");return JSON.parse(o)}},68448:(e,r,o)=>{o.d(r,{fromProcess:()=>l});var t=o(6721),s=o(76682),c=o(84122),n=o(74692),i=o(35317),a=o(39023),d=o(53243);const l=(e={})=>async({callerClientConfig:r}={})=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const o=await(0,t.Y)(e);return(async(e,r,o)=>{const t=r[e];if(!r[e])throw new c.C(`Profile ${e} could not be found in shared credentials file.`,{logger:o});{const s=t.credential_process;if(void 0===s)throw new c.C(`Profile ${e} did not contain credential_process.`,{logger:o});{const t=(0,a.promisify)(n.Z?.getTokenRecord?.().exec??i.exec);try{const{stdout:o}=await t(s);let c;try{c=JSON.parse(o.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,r,o)=>{if(1!==r.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===r.AccessKeyId||void 0===r.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(r.Expiration){const o=new Date;if(new Date(r.Expiration)<o)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let t=r.AccountId;!t&&o?.[e]?.aws_account_id&&(t=o[e].aws_account_id);const s={accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope},...t&&{accountId:t}};return(0,d.g)(s,"CREDENTIALS_PROCESS","w"),s})(e,c,r)}catch(e){throw new c.C(e.message,{logger:o})}}}})((0,s.Bz)({profile:e.profile??r?.profile}),o,e.logger)}},74692:(e,r,o)=>{o.d(r,{Z:()=>c});var t=o(48440),s=o(71078);const c={getFileRecord:()=>s.Jj,interceptFile(e,r){s.Jj[e]=Promise.resolve(r)},getTokenRecord:()=>t.a,interceptToken(e,r){t.a[e]=r}}}};
package/dist/743.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=743,exports.ids=[743],exports.modules={17743:(e,t,r)=>{r.d(t,{CreateOAuth2TokenCommand:()=>St,SigninClient:()=>Re});var s=r(42355),n=r(79749),o=r(59537),i=r(58093),a=r(90933),c=r(93786),p=r(85766),u=r(99522),d=r(62306),h=r(83046),l=r(7317),g=r(55845),m=r(31965),f=r(43162),y=r(88414),S=r(30379),v=r(11904),P=r(98367);const k=async(e,t,r)=>({operation:(0,v.u)(t).operation,region:await(0,P.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),E=e=>{const t=[];return"CreateOAuth2Token"===e.operation?t.push({schemeId:"smithy.api#noAuth"}):t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t},A={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var I=r(74033),x=r(55343),w=r(91677),b=r(82112),O=r(56564),D=r(53872),R=r(92052),C=r(77702),T=r(52989),F=r(28075),U=r(7940),$=r(66391),q=r(55425),j=r(6141),z=r(83749),M=r(76609),V=r(27590),H=r(17209),Z=r(71918),K=r(12544),N=r(39181),B=r(40935),L=r(2914),G=r(99609),Y=r(21954),J=r(92385),Q=r(97979);const W="required",X="fn",_="argv",ee="ref",te=!0,re="isSet",se="booleanEquals",ne="error",oe="endpoint",ie="tree",ae="PartitionResult",ce="stringEquals",pe={[W]:!0,default:!1,type:"boolean"},ue={[W]:!1,type:"string"},de={[ee]:"Endpoint"},he={[X]:se,[_]:[{[ee]:"UseFIPS"},!0]},le={[X]:se,[_]:[{[ee]:"UseDualStack"},!0]},ge={},me={[X]:"getAttr",[_]:[{[ee]:ae},"name"]},fe={[X]:se,[_]:[{[ee]:"UseFIPS"},!1]},ye={[X]:se,[_]:[{[ee]:"UseDualStack"},!1]},Se={[X]:"getAttr",[_]:[{[ee]:ae},"supportsFIPS"]},ve={[X]:se,[_]:[!0,{[X]:"getAttr",[_]:[{[ee]:ae},"supportsDualStack"]}]},Pe=[{[ee]:"Region"}],ke={version:"1.0",parameters:{UseDualStack:pe,UseFIPS:pe,Endpoint:ue,Region:ue},rules:[{conditions:[{[X]:re,[_]:[de]}],rules:[{conditions:[he],error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:ne},{rules:[{conditions:[le],error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:ne},{endpoint:{url:de,properties:ge,headers:ge},type:oe}],type:ie}],type:ie},{rules:[{conditions:[{[X]:re,[_]:Pe}],rules:[{conditions:[{[X]:"aws.partition",[_]:Pe,assign:ae}],rules:[{conditions:[{[X]:ce,[_]:[me,"aws"]},fe,ye],endpoint:{url:"https://{Region}.signin.aws.amazon.com",properties:ge,headers:ge},type:oe},{conditions:[{[X]:ce,[_]:[me,"aws-cn"]},fe,ye],endpoint:{url:"https://{Region}.signin.amazonaws.cn",properties:ge,headers:ge},type:oe},{conditions:[{[X]:ce,[_]:[me,"aws-us-gov"]},fe,ye],endpoint:{url:"https://{Region}.signin.amazonaws-us-gov.com",properties:ge,headers:ge},type:oe},{conditions:[he,le],rules:[{conditions:[{[X]:se,[_]:[te,Se]},ve],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ge,headers:ge},type:oe}],type:ie},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:ne}],type:ie},{conditions:[he,ye],rules:[{conditions:[{[X]:se,[_]:[Se,te]}],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",properties:ge,headers:ge},type:oe}],type:ie},{error:"FIPS is enabled but this partition does not support FIPS",type:ne}],type:ie},{conditions:[fe,le],rules:[{conditions:[ve],rules:[{endpoint:{url:"https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ge,headers:ge},type:oe}],type:ie},{error:"DualStack is enabled but this partition does not support DualStack",type:ne}],type:ie},{endpoint:{url:"https://signin.{Region}.{PartitionResult#dnsSuffix}",properties:ge,headers:ge},type:oe}],type:ie}],type:ie},{error:"Invalid Configuration: Missing Region",type:ne}],type:ie}]},Ee=new Y.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Ae=(e,t={})=>Ee.get(e,()=>(0,J.s)(ke,{endpointParams:e,logger:t.logger}));Q.m.aws=G.UF;var Ie=r(74783),xe=r(85397),we=r(56602);var be=r(79532),Oe=r(81355),De=r(91415);class Re extends y.K{config;constructor(...[e]){const t=(e=>{(0,we.I)(process.version);const t=(0,xe.I)(e),r=()=>t().then(Ie.l),s=(e=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??K.E,base64Encoder:e?.base64Encoder??N.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ae,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??E,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new z.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new V.m}],logger:e?.logger??new H.N,protocol:e?.protocol??new M.Y({defaultNamespace:"com.amazonaws.signin"}),serviceId:e?.serviceId??"Signin",urlParser:e?.urlParser??Z.D,utf8Decoder:e?.utf8Decoder??B.a,utf8Encoder:e?.utf8Encoder??L.P}))(e);(0,x.I)(process.version);const n={profile:e?.profile,logger:s.logger};return{...s,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,F.Z)(w.$,n),bodyLengthChecker:e?.bodyLengthChecker??q.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,b.pf)({serviceId:s.serviceId,clientVersion:I.rE}),maxAttempts:e?.maxAttempts??(0,F.Z)(m.qs,e),region:e?.region??(0,F.Z)(D.GG,{...D.zH,...n}),requestHandler:U.$.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,F.Z)({...m.kN,default:async()=>(await r()).retryMode||j.L0},e),sha256:e?.sha256??T.V.bind(null,"sha256"),streamCollector:e?.streamCollector??$.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,F.Z)(R.e$,n),useFipsEndpoint:e?.useFipsEndpoint??(0,F.Z)(C.Ko,n),userAgentAppId:e?.userAgentAppId??(0,F.Z)(O.hV,n)}})(e||{});super(t),this.initConfig=t;const r=(y=t,Object.assign(y,{useDualstackEndpoint:y.useDualstackEndpoint??!1,useFipsEndpoint:y.useFipsEndpoint??!1,defaultSigningName:"signin"}));var y;const v=(0,i.D)(r),A=(0,m.$z)(v),G=(0,c.T)(A),Y=(0,s.OV)(G),J=((e,t)=>{const r=Object.assign((0,be.R)(e),(0,De.xA)(e),(0,Oe.e)(e),(e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,s=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){s=e},credentials:()=>s}})(e));return t.forEach(e=>e.configure(r)),Object.assign(e,(0,be.$)(r),(0,De.uv)(r),(0,Oe.j)(r),{httpAuthSchemes:(s=r).httpAuthSchemes(),httpAuthSchemeProvider:s.httpAuthSchemeProvider(),credentials:s.credentials()});var s})((e=>{const t=(0,S.h)(e);return Object.assign(t,{authSchemePreference:(0,P.t)(e.authSchemePreference??[])})})((0,g.C)(Y)),e?.extensions||[]);this.config=J,this.middlewareStack.use((0,h.wq)(this.config)),this.middlewareStack.use((0,a.sM)(this.config)),this.middlewareStack.use((0,f.ey)(this.config)),this.middlewareStack.use((0,l.vK)(this.config)),this.middlewareStack.use((0,s.TC)(this.config)),this.middlewareStack.use((0,n.Y7)(this.config)),this.middlewareStack.use((0,o.n)(this.config)),this.middlewareStack.use((0,p.w)(this.config,{httpAuthSchemeParametersProvider:k,identityProviderConfigProvider:async e=>new u.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,d.l)(this.config))}destroy(){super.destroy()}}var Ce=r(17801),Te=r(42829),Fe=r(38796),Ue=r(60763);class $e extends Ue.T{constructor(e){super(e),Object.setPrototypeOf(this,$e.prototype)}}class qe extends $e{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,qe.prototype),this.error=e.error}}class je extends $e{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,je.prototype),this.error=e.error}}class ze extends $e{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e}),Object.setPrototypeOf(this,ze.prototype),this.error=e.error}}class Me extends $e{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,Me.prototype),this.error=e.error}}const Ve="accessKeyId",He="accessToken",Ze="client",Ke="clientId",Ne="codeVerifier",Be="error",Le="expiresIn",Ge="grantType",Ye="http",Je="httpError",Qe="idToken",We="jsonName",Xe="message",_e="refreshToken",et="redirectUri",tt="secretAccessKey",rt="sessionToken",st="smithy.ts.sdk.synthetic.com.amazonaws.signin",nt="tokenType",ot="com.amazonaws.signin";var it=[0,ot,"RefreshToken",8,0],at=[-3,ot,"AccessDeniedException",{[Be]:Ze},[Be,Xe],[0,0]];Fe.O.for(ot).registerError(at,qe);var ct=[3,ot,"AccessToken",8,[Ve,tt,rt],[[0,{[We]:Ve}],[0,{[We]:tt}],[0,{[We]:rt}]]],pt=[3,ot,"CreateOAuth2TokenRequest",0,["tokenInput"],[[()=>ut,16]]],ut=[3,ot,"CreateOAuth2TokenRequestBody",0,[Ke,Ge,"code",et,Ne,_e],[[0,{[We]:Ke}],[0,{[We]:Ge}],0,[0,{[We]:et}],[0,{[We]:Ne}],[()=>it,{[We]:_e}]]],dt=[3,ot,"CreateOAuth2TokenResponse",0,["tokenOutput"],[[()=>ht,16]]],ht=[3,ot,"CreateOAuth2TokenResponseBody",0,[He,nt,Le,_e,Qe],[[()=>ct,{[We]:He}],[0,{[We]:nt}],[1,{[We]:Le}],[()=>it,{[We]:_e}],[0,{[We]:Qe}]]],lt=[-3,ot,"InternalServerException",{[Be]:"server",[Je]:500},[Be,Xe],[0,0]];Fe.O.for(ot).registerError(lt,je);var gt=[-3,ot,"TooManyRequestsError",{[Be]:Ze,[Je]:429},[Be,Xe],[0,0]];Fe.O.for(ot).registerError(gt,ze);var mt=[-3,ot,"ValidationException",{[Be]:Ze,[Je]:400},[Be,Xe],[0,0]];Fe.O.for(ot).registerError(mt,Me);var ft=[-3,st,"SigninServiceException",0,[],[]];Fe.O.for(st).registerError(ft,$e);var yt=[9,ot,"CreateOAuth2Token",{[Ye]:["POST","/v1/token",200]},()=>pt,()=>dt];class St extends(Te.u.classBuilder().ep(A).m(function(e,t,r,s){return[(0,Ce.r)(r,e.getEndpointParameterInstructions())]}).s("Signin","CreateOAuth2Token",{}).n("SigninClient","CreateOAuth2TokenCommand").sc(yt).build()){}},74033:e=>{e.exports={rE:"3.940.0"}}};
package/dist/784.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=784,exports.ids=[784],exports.modules={6721:(e,t,n)=>{n.d(t,{Y:()=>o});var r=n(64549);const o=async e=>{const t=await(0,r.p)(e);return((...e)=>{const t={};for(const n of e)for(const[e,r]of Object.entries(n))void 0!==t[e]?Object.assign(t[e],r):t[e]=r;return t})(t.configFile,t.credentialsFile)}},85784:(e,t,n)=>{n.d(t,{fromIni:()=>k});var r=n(6721),o=n(76682),s=n(84122),i=n(53243),a=n(76896);const c=e=>(0,i.g)(e,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),l=e=>!e.role_arn&&!!e.credential_source;var g=n(86880),d=n(71078),f=n(77598),u=n(73024),p=n(48161),h=n(76760);class _{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=3e5;constructor(e,t,n){this.profileData=e,this.init=t,this.callerClientConfig=n}async loadCredentials(){const e=await this.loadToken();if(!e)throw new s.C(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});const t=e.accessToken,n=Date.now();return new Date(t.expiresAt).getTime()-n<=_.REFRESH_THRESHOLD?this.refresh(e):{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,accountId:t.accountId,expiration:new Date(t.expiresAt)}}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}async refresh(e){const{SigninClient:t,CreateOAuth2TokenCommand:r}=await Promise.all([n.e(478),n.e(743)]).then(n.bind(n,17743)),{logger:o,userAgentAppId:i}=this.callerClientConfig??{},a=(e=>"h2"===e?.metadata?.handlerProtocol)(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,c=new t({credentials:{accessKeyId:"",secretAccessKey:""},region:this.profileData.region??await(this.callerClientConfig?.region?.())??process.env.AWS_REGION,requestHandler:a,logger:o,userAgentAppId:i,...this.init?.clientConfig});this.createDPoPInterceptor(c.middlewareStack);const l={tokenInput:{clientId:e.clientId,refreshToken:e.refreshToken,grantType:"refresh_token"}};try{const t=await c.send(new r(l)),{accessKeyId:n,secretAccessKey:o,sessionToken:i}=t.tokenOutput?.accessToken??{},{refreshToken:a,expiresIn:g}=t.tokenOutput??{};if(!(n&&o&&i&&a))throw new s.C("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});const d=1e3*(g??900),f=new Date(Date.now()+d),u={...e,accessToken:{...e.accessToken,accessKeyId:n,secretAccessKey:o,sessionToken:i,expiresAt:f.toISOString()},refreshToken:a};await this.saveToken(u);const p=u.accessToken;return{accessKeyId:p.accessKeyId,secretAccessKey:p.secretAccessKey,sessionToken:p.sessionToken,accountId:p.accountId,expiration:f}}catch(e){if("AccessDeniedException"===e.name){let t;switch(e.error){case"TOKEN_EXPIRED":t="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":t="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":t="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:t=`Failed to refresh token: ${String(e)}. Please re-authenticate using \`aws login\``}throw new s.C(t,{logger:this.logger,tryNextLink:!1})}throw new s.C(`Failed to refresh token: ${String(e)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){const e=this.getTokenFilePath();try{let t;try{t=await(0,d.TA)(e,{ignoreCache:this.init?.ignoreCache})}catch{t=await u.promises.readFile(e,"utf8")}const n=JSON.parse(t),r=["accessToken","clientId","refreshToken","dpopKey"].filter(e=>!n[e]);if(n.accessToken?.accountId||r.push("accountId"),r.length>0)throw new s.C(`Token validation failed, missing fields: ${r.join(", ")}`,{logger:this.logger,tryNextLink:!1});return n}catch(t){throw new s.C(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){const t=this.getTokenFilePath(),n=(0,h.dirname)(t);try{await u.promises.mkdir(n,{recursive:!0})}catch(e){}await u.promises.writeFile(t,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){const e=process.env.AWS_LOGIN_CACHE_DIRECTORY??(0,h.join)((0,p.homedir)(),".aws","login","cache"),t=Buffer.from(this.loginSession,"utf8"),n=(0,f.createHash)("sha256").update(t).digest("hex");return(0,h.join)(e,`${n}.json`)}derToRawSignature(e){let t=2;if(2!==e[t])throw new Error("Invalid DER signature");t++;const n=e[t++];let r=e.subarray(t,t+n);if(t+=n,2!==e[t])throw new Error("Invalid DER signature");t++;const o=e[t++];let s=e.subarray(t,t+o);r=0===r[0]?r.subarray(1):r,s=0===s[0]?s.subarray(1):s;const i=Buffer.concat([Buffer.alloc(32-r.length),r]),a=Buffer.concat([Buffer.alloc(32-s.length),s]);return Buffer.concat([i,a])}createDPoPInterceptor(e){e.add(e=>async t=>{if(g.K.isInstance(t.request)){const e=t.request,n=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}${e.path}`,r=await this.generateDpop(e.method,n);e.headers={...e.headers,DPoP:r}}return e(t)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",t){const n=await this.loadToken();try{const r=(0,f.createPrivateKey)({key:n.dpopKey,format:"pem",type:"sec1"}),o=(0,f.createPublicKey)(r).export({format:"der",type:"spki"});let s=-1;for(let e=0;e<o.length;e++)if(4===o[e]){s=e;break}const i=o.slice(s+1,s+33),a=o.slice(s+33,s+65),c={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:i.toString("base64url"),y:a.toString("base64url")}},l={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1e3)},g=`${Buffer.from(JSON.stringify(c)).toString("base64url")}.${Buffer.from(JSON.stringify(l)).toString("base64url")}`,d=(0,f.sign)("sha256",Buffer.from(g),r);return`${g}.${this.derToRawSignature(d).toString("base64url")}`}catch(e){throw new s.C(`Failed to generate Dpop proof: ${e instanceof Error?e.message:String(e)}`,{logger:this.logger,tryNextLink:!1})}}}const y=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.aws_access_key_id&&"string"==typeof e.aws_secret_access_key&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,w=async(e,t)=>{t?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");const n={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return(0,i.g)(n,"CREDENTIALS_PROFILE","n")},C=async(e,t,g,d={},f=!1)=>{const u=t[e];if(Object.keys(d).length>0&&y(u))return w(u,g);if(f||((e,{profile:t="default",logger:n}={})=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.role_arn&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(((e,{profile:t,logger:n})=>{const r="string"==typeof e.source_profile&&void 0===e.credential_source;return r&&n?.debug?.(` ${t} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),r})(e,{profile:t,logger:n})||((e,{profile:t,logger:n})=>{const r="string"==typeof e.credential_source&&void 0===e.source_profile;return r&&n?.debug?.(` ${t} isCredentialSourceProfile credential_source=${e.credential_source}`),r})(e,{profile:t,logger:n})))(u,{profile:e,logger:g.logger}))return(async(e,t,r,g={},d)=>{r.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const f=t[e],{source_profile:u,region:p}=f;if(!r.roleAssumer){const{getDefaultRoleAssumer:e}=await n.e(482).then(n.bind(n,84482));r.roleAssumer=e({...r.clientConfig,credentialProviderLogger:r.logger,parentClientConfig:{...r?.parentClientConfig,region:p??r?.parentClientConfig?.region}},r.clientPlugins)}if(u&&u in g)throw new s.C(`Detected a cycle attempting to resolve credentials for profile ${(0,o.Bz)(r)}. Profiles visited: `+Object.keys(g).join(", "),{logger:r.logger});r.logger?.debug("@aws-sdk/credential-provider-ini - finding credential resolver using "+(u?`source_profile=[${u}]`:`profile=[${e}]`));const h=u?d(u,t,r,{...g,[u]:!0},l(t[u]??{})):(await((e,t,r)=>{const o={EcsContainer:async e=>{const{fromHttp:t}=await n.e(866).then(n.bind(n,57866)),{fromContainerMetadata:o}=await n.e(387).then(n.bind(n,35387));return r?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>(0,a.c)(t(e??{}),o(e))().then(c)},Ec2InstanceMetadata:async e=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:t}=await n.e(387).then(n.bind(n,35387));return async()=>t(e)().then(c)},Environment:async e=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:t}=await n.e(844).then(n.bind(n,84844));return async()=>t(e)().then(c)}};if(e in o)return o[e];throw new s.C(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:r})})(f.credential_source,e,r.logger)(r))();if(l(f))return h.then(e=>(0,i.g)(e,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));{const t={RoleArn:f.role_arn,RoleSessionName:f.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:f.external_id,DurationSeconds:parseInt(f.duration_seconds||"3600",10)},{mfa_serial:n}=f;if(n){if(!r.mfaCodeProvider)throw new s.C(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:r.logger,tryNextLink:!1});t.SerialNumber=n,t.TokenCode=await r.mfaCodeProvider(n)}const o=await h;return r.roleAssumer(o,t).then(e=>(0,i.g)(e,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}})(e,t,g,d,C);if(y(u))return w(u,g);if(p=u,Boolean(p)&&"object"==typeof p&&"string"==typeof p.web_identity_token_file&&"string"==typeof p.role_arn&&["undefined","string"].indexOf(typeof p.role_session_name)>-1)return(async(e,t)=>n.e(988).then(n.bind(n,48988)).then(({fromTokenFile:n})=>n({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity,logger:t.logger,parentClientConfig:t.parentClientConfig})().then(e=>(0,i.g)(e,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q"))))(u,g);var p;if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.credential_process)(u))return(async(e,t)=>n.e(67).then(n.bind(n,68448)).then(({fromProcess:n})=>n({...e,profile:t})().then(e=>(0,i.g)(e,"CREDENTIALS_PROFILE_PROCESS","v"))))(g,e);if((e=>e&&("string"==typeof e.sso_start_url||"string"==typeof e.sso_account_id||"string"==typeof e.sso_session||"string"==typeof e.sso_region||"string"==typeof e.sso_role_name))(u))return await(async(e,t,r={})=>{const{fromSSO:o}=await n.e(25).then(n.bind(n,49406));return o({profile:e,logger:r.logger,parentClientConfig:r.parentClientConfig,clientConfig:r.clientConfig})().then(e=>t.sso_session?(0,i.g)(e,"CREDENTIALS_PROFILE_SSO","r"):(0,i.g)(e,"CREDENTIALS_PROFILE_SSO_LEGACY","t"))})(e,u,g);if((e=>Boolean(e&&e.login_session))(u))return(async(e,t)=>{const n=await(a={...t,profile:e},async({callerClientConfig:e}={})=>{a?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");const t=await(0,r.Y)(a||{}),n=(0,o.Bz)({profile:a?.profile??e?.profile}),c=t[n];if(!c?.login_session)throw new s.C(`Profile ${n} does not contain login_session.`,{tryNextLink:!0,logger:a?.logger});const l=new _(c,a,e),g=await l.loadCredentials();return(0,i.g)(g,"CREDENTIALS_LOGIN","AD")})();var a;return(0,i.g)(n,"CREDENTIALS_PROFILE_LOGIN","AC")})(e,g);throw new s.C(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:g.logger})},k=(e={})=>async({callerClientConfig:t}={})=>{const n={...e,parentClientConfig:{...t,...e.parentClientConfig}};n.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const s=await(0,r.Y)(n);return C((0,o.Bz)({profile:e.profile??t?.profile}),s,n)}}};
package/dist/844.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=844,exports.ids=[844],exports.modules={84844:(s,r,e)=>{e.d(r,{fromEnv:()=>o.sF});var o=e(78487)}};
package/dist/866.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=866,exports.ids=[866],exports.modules={56826:(e,t,r)=>{r.d(t,{c:()=>p});var o=r(66391),n=r(25272),a=r(2203),s=r(12544);var i=r(39181),c=r(92278),l=r(2914);const d=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),u="The stream has already been transformed.",f=e=>{if(!h(e)&&!d(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(u);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,s.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,i.n)(t);if("hex"===e)return(0,c.n)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(0,l.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(u);if(t=!0,h(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(d(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},h=e=>"function"==typeof Blob&&e instanceof Blob,w="The stream has already been transformed.",p=e=>{if(!(e instanceof a.Readable))try{return f(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(w);return t=!0,await(0,o.k)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();return void 0===e||Buffer.isEncoding(e)?(0,n.Q)(t.buffer,t.byteOffset,t.byteLength).toString(e):new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw new Error(w);if(null!==e.readableFlowing)throw new Error("The stream has been consumed by other callbacks.");if("function"!=typeof a.Readable.toWeb)throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,a.Readable.toWeb(e)}})}},57866:(e,t,r)=>{r.d(t,{fromHttp:()=>u});var o=r(53243),n=r(7940),a=r(84122),s=r(91943),i=r.n(s),c=r(86880),l=r(37882),d=r(56826);const u=(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,u=e.awsContainerAuthorizationToken??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN,f=e.awsContainerAuthorizationTokenFile??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE,h="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?.warn?e.logger.warn.bind(e.logger):console.warn;if(r&&s&&(h("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),h("awsContainerCredentialsFullUri will take precedence.")),u&&f&&(h("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),h("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 w=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})}})(w,e.logger);const p=n.$.create({requestTimeout:e.timeout??1e3,connectionTimeout:e.timeout??1e3});return m=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})}(w);u?t.headers.Authorization=u:f&&(t.headers.Authorization=(await i().readFile(f)).toString());try{return async function(e,t){const r=(0,d.c)(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 p.handle(t)).response).then(e=>(0,o.g)(e,"CREDENTIALS_HTTP","z"))}catch(t){throw new a.C(String(t),{logger:e.logger})}},g=e.maxRetries??3,y=e.timeout??1e3,async()=>{for(let e=0;e<g;++e)try{return await m()}catch(e){await new Promise(e=>setTimeout(e,y))}return await m()};var m,g,y}}};
package/dist/936.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=936,exports.ids=[936],exports.modules={37936:(e,t,s)=>{s.d(t,{GetRoleCredentialsCommand:()=>T,SSOClient:()=>it});var r=s(17801),o=s(42829);const n={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var i=s(38796),a=s(60763);class c extends a.T{constructor(e){super(e),Object.setPrototypeOf(this,c.prototype)}}class p extends c{name="InvalidRequestException";$fault="client";constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,p.prototype)}}class d extends c{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,d.prototype)}}class u extends c{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,u.prototype)}}class l extends c{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,l.prototype)}}const h="client",m="error",g="http",f="httpError",y="httpHeader",S="httpQuery",v="message",P="smithy.ts.sdk.synthetic.com.amazonaws.sso",E="com.amazonaws.sso";var x=[0,E,"AccessTokenType",8,0],I=[0,E,"SecretAccessKeyType",8,0],k=[0,E,"SessionTokenType",8,0],w=[3,E,"GetRoleCredentialsRequest",0,["roleName","accountId","accessToken"],[[0,{[S]:"role_name"}],[0,{[S]:"account_id"}],[()=>x,{[y]:"x-amz-sso_bearer_token"}]]],R=[3,E,"GetRoleCredentialsResponse",0,["roleCredentials"],[[()=>C,0]]],b=[-3,E,"InvalidRequestException",{[m]:h,[f]:400},[v],[0]];i.O.for(E).registerError(b,p);var A=[-3,E,"ResourceNotFoundException",{[m]:h,[f]:404},[v],[0]];i.O.for(E).registerError(A,d);var C=[3,E,"RoleCredentials",0,["accessKeyId","secretAccessKey","sessionToken","expiration"],[0,[()=>I,0],[()=>k,0],1]],O=[-3,E,"TooManyRequestsException",{[m]:h,[f]:429},[v],[0]];i.O.for(E).registerError(O,u);var D=[-3,E,"UnauthorizedException",{[m]:h,[f]:401},[v],[0]];i.O.for(E).registerError(D,l);var F=[-3,P,"SSOServiceException",0,[],[]];i.O.for(P).registerError(F,c);var q=[9,E,"GetRoleCredentials",{[g]:["GET","/federation/credentials",200]},()=>w,()=>R];class T extends(o.u.classBuilder().ep(n).m(function(e,t,s,o){return[(0,r.r)(s,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").sc(q).build()){}var U=s(42355),$=s(79749),z=s(59537),j=s(58093),G=s(90933),M=s(93786),H=s(85766),N=s(99522),Z=s(62306),K=s(83046),L=s(7317),V=s(55845),_=s(31965),B=s(43162),Y=s(88414),Q=s(30379),W=s(11904),J=s(98367);const X=async(e,t,s)=>({operation:(0,W.u)(t).operation,region:await(0,J.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),ee=e=>{const t=[];switch(e.operation){case"GetRoleCredentials":case"ListAccountRoles":case"ListAccounts":case"Logout":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t};var te=s(55343),se=s(91677),re=s(82112),oe=s(56564),ne=s(53872),ie=s(92052),ae=s(77702),ce=s(52989),pe=s(28075),de=s(7940),ue=s(66391),le=s(55425),he=s(6141),me=s(83749),ge=s(76609),fe=s(27590),ye=s(17209),Se=s(71918),ve=s(12544),Pe=s(39181),Ee=s(40935),xe=s(2914),Ie=s(99609),ke=s(21954),we=s(92385),Re=s(97979);const be="required",Ae="fn",Ce="argv",Oe="ref",De=!0,Fe="isSet",qe="booleanEquals",Te="error",Ue="endpoint",$e="tree",ze="PartitionResult",je="getAttr",Ge={[be]:!1,type:"string"},Me={[be]:!0,default:!1,type:"boolean"},He={[Oe]:"Endpoint"},Ne={[Ae]:qe,[Ce]:[{[Oe]:"UseFIPS"},!0]},Ze={[Ae]:qe,[Ce]:[{[Oe]:"UseDualStack"},!0]},Ke={},Le={[Ae]:je,[Ce]:[{[Oe]:ze},"supportsFIPS"]},Ve={[Oe]:ze},_e={[Ae]:qe,[Ce]:[!0,{[Ae]:je,[Ce]:[Ve,"supportsDualStack"]}]},Be=[Ne],Ye=[Ze],Qe=[{[Oe]:"Region"}],We={version:"1.0",parameters:{Region:Ge,UseDualStack:Me,UseFIPS:Me,Endpoint:Ge},rules:[{conditions:[{[Ae]:Fe,[Ce]:[He]}],rules:[{conditions:Be,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:Te},{conditions:Ye,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:Te},{endpoint:{url:He,properties:Ke,headers:Ke},type:Ue}],type:$e},{conditions:[{[Ae]:Fe,[Ce]:Qe}],rules:[{conditions:[{[Ae]:"aws.partition",[Ce]:Qe,assign:ze}],rules:[{conditions:[Ne,Ze],rules:[{conditions:[{[Ae]:qe,[Ce]:[De,Le]},_e],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Ke,headers:Ke},type:Ue}],type:$e},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:Te}],type:$e},{conditions:Be,rules:[{conditions:[{[Ae]:qe,[Ce]:[Le,De]}],rules:[{conditions:[{[Ae]:"stringEquals",[Ce]:[{[Ae]:je,[Ce]:[Ve,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:Ke,headers:Ke},type:Ue},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Ke,headers:Ke},type:Ue}],type:$e},{error:"FIPS is enabled but this partition does not support FIPS",type:Te}],type:$e},{conditions:Ye,rules:[{conditions:[_e],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Ke,headers:Ke},type:Ue}],type:$e},{error:"DualStack is enabled but this partition does not support DualStack",type:Te}],type:$e},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:Ke,headers:Ke},type:Ue}],type:$e}],type:$e},{error:"Invalid Configuration: Missing Region",type:Te}]},Je=new ke.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Xe=(e,t={})=>Je.get(e,()=>(0,we.s)(We,{endpointParams:e,logger:t.logger}));Re.m.aws=Ie.UF;var et=s(74783),tt=s(85397),st=s(56602);var rt=s(79532),ot=s(81355),nt=s(91415);class it extends Y.K{config;constructor(...[e]){const t=(e=>{(0,st.I)(process.version);const t=(0,tt.I)(e),s=()=>t().then(et.l),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ve.E,base64Encoder:e?.base64Encoder??Pe.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Xe,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??ee,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new me.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new fe.m}],logger:e?.logger??new ye.N,protocol:e?.protocol??new ge.Y({defaultNamespace:"com.amazonaws.sso"}),serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??Se.D,utf8Decoder:e?.utf8Decoder??Ee.a,utf8Encoder:e?.utf8Encoder??xe.P}))(e);(0,te.I)(process.version);const o={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,pe.Z)(se.$,o),bodyLengthChecker:e?.bodyLengthChecker??le.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,re.pf)({serviceId:r.serviceId,clientVersion:"3.940.0"}),maxAttempts:e?.maxAttempts??(0,pe.Z)(_.qs,e),region:e?.region??(0,pe.Z)(ne.GG,{...ne.zH,...o}),requestHandler:de.$.create(e?.requestHandler??s),retryMode:e?.retryMode??(0,pe.Z)({..._.kN,default:async()=>(await s()).retryMode||he.L0},e),sha256:e?.sha256??ce.V.bind(null,"sha256"),streamCollector:e?.streamCollector??ue.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,pe.Z)(ie.e$,o),useFipsEndpoint:e?.useFipsEndpoint??(0,pe.Z)(ae.Ko,o),userAgentAppId:e?.userAgentAppId??(0,pe.Z)(oe.hV,o)}})(e||{});super(t),this.initConfig=t;const s=(r=t,Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}));var r;const o=(0,j.D)(s),n=(0,_.$z)(o),i=(0,M.T)(n),a=(0,U.OV)(i),c=((e,t)=>{const s=Object.assign((0,rt.R)(e),(0,nt.xA)(e),(0,ot.e)(e),(e=>{const t=e.httpAuthSchemes;let s=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const s=t.findIndex(t=>t.schemeId===e.schemeId);-1===s?t.push(e):t.splice(s,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){s=e},httpAuthSchemeProvider:()=>s,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(s)),Object.assign(e,(0,rt.$)(s),(0,nt.uv)(s),(0,ot.j)(s),{httpAuthSchemes:(r=s).httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()});var r})((e=>{const t=(0,Q.h)(e);return Object.assign(t,{authSchemePreference:(0,J.t)(e.authSchemePreference??[])})})((0,V.C)(a)),e?.extensions||[]);this.config=c,this.middlewareStack.use((0,K.wq)(this.config)),this.middlewareStack.use((0,G.sM)(this.config)),this.middlewareStack.use((0,B.ey)(this.config)),this.middlewareStack.use((0,L.vK)(this.config)),this.middlewareStack.use((0,U.TC)(this.config)),this.middlewareStack.use((0,$.Y7)(this.config)),this.middlewareStack.use((0,z.n)(this.config)),this.middlewareStack.use((0,H.w)(this.config,{httpAuthSchemeParametersProvider:X,identityProviderConfigProvider:async e=>new N.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,Z.l)(this.config))}destroy(){super.destroy()}}}};
package/dist/941.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=941,exports.ids=[941],exports.modules={79941:(e,t,r)=>{r.d(t,{EventStreamSerde:()=>n});var i=r(2914),s=r(40935);class n{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:e,serializer:t,deserializer:r,serdeContext:i,defaultContentType:s}){this.marshaller=e,this.serializer=t,this.deserializer=r,this.serdeContext=i,this.defaultContentType=s}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r}){const i=this.marshaller,s=t.getEventStreamMember(),n=t.getMemberSchema(s),a=this.serializer,o=this.defaultContentType,l=Symbol("initialRequestMarker"),c={async*[Symbol.asyncIterator](){if(r){const e={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:o}};a.write(t,r);const i=a.flush();yield{[l]:!0,headers:e,body:i}}for await(const t of e)yield t}};return i.serialize(c,e=>{if(e[l])return{headers:e.headers,body:e.body};const t=Object.keys(e).find(e=>"__type"!==e)??"",{additionalHeaders:r,body:i,eventType:s,explicitPayloadContentType:a}=this.writeEventBody(t,n,e);return{headers:{":event-type":{type:"string",value:s},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:a??o},...r},body:i}})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r}){const s=this.marshaller,n=t.getEventStreamMember(),a=t.getMemberSchema(n).getMemberSchemas(),o=Symbol("initialResponseMarker"),l=s.deserialize(e.body,async e=>{const r=Object.keys(e).find(e=>"__type"!==e)??"",s=e[r].body;if("initial-response"===r){const e=await this.deserializer.read(t,s);return delete e[n],{[o]:!0,...e}}if(r in a){const t=a[r];if(t.isStructSchema()){const n={};let a=!1;for(const[o,l]of t.structIterator()){const{eventHeader:t,eventPayload:c}=l.getMergedTraits();if(a=a||Boolean(t||c),c)l.isBlobSchema()?n[o]=s:l.isStringSchema()?n[o]=(this.serdeContext?.utf8Encoder??i.P)(s):l.isStructSchema()&&(n[o]=await this.deserializer.read(l,s));else if(t){const t=e[r].headers[o]?.value;null!=t&&(l.isNumericSchema()?n[o]=t&&"object"==typeof t&&"bytes"in t?BigInt(t.toString()):Number(t):n[o]=t)}}if(a)return{[r]:n}}return{[r]:await this.deserializer.read(t,s)}}return{$unknown:e}}),c=l[Symbol.asyncIterator](),d=await c.next();if(d.done)return l;if(d.value?.[o]){if(!t)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[e,t]of Object.entries(d.value))r[e]=t}return{async*[Symbol.asyncIterator](){for(d?.value?.[o]||(yield d.value);;){const{done:e,value:t}=await c.next();if(e)break;yield t}}}}writeEventBody(e,t,r){const i=this.serializer;let n,a=e,o=null;const l={};if(t.getSchema()[4].includes(e)){const s=t.getMemberSchema(e);if(!s.isStructSchema())throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");for(const[t,i]of s.structIterator()){const{eventHeader:s,eventPayload:n}=i.getMergedTraits();if(n){o=t;break}if(s){const s=r[e][t];let n="binary";i.isNumericSchema()?n=(-2)**31<=s&&s<=2**31-1?"integer":"long":i.isTimestampSchema()?n="timestamp":i.isStringSchema()?n="string":i.isBooleanSchema()&&(n="boolean"),null!=s&&(l[t]={type:n,value:s},delete r[e][t])}}if(null!==o){const t=s.getMemberSchema(o);t.isBlobSchema()?n="application/octet-stream":t.isStringSchema()&&(n="text/plain"),i.write(t,r[e][o])}else i.write(s,r[e])}else{const[t,s]=r[e];a=t,i.write(15,s)}const c=i.flush();return{body:"string"==typeof c?(this.serdeContext?.utf8Decoder??s.a)(c):c,eventType:a,explicitPayloadContentType:n,additionalHeaders:l}}}}};
package/dist/988.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";exports.id=988,exports.ids=[988],exports.modules={4987:(e,n,o)=>{o.d(n,{C:()=>s});var r=o(76982),t=o(16928),i=o(51362);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`)}},48440:(e,n,o)=>{o.d(n,{a:()=>i,v:()=>s});var r=o(91943),t=o(4987);const i={},s=async e=>{if(i[e])return i[e];const n=(0,t.C)(e),o=await(0,r.readFile)(n,"utf8");return JSON.parse(o)}},48988:(e,n,o)=>{o.d(n,{fromTokenFile:()=>d});var r=o(53243),t=o(84122),i=o(74692),s=o(79896);const a="AWS_WEB_IDENTITY_TOKEN_FILE",d=(e={})=>async n=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const d=e?.webIdentityTokenFile??process.env[a],c=e?.roleArn??process.env.AWS_ROLE_ARN,l=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!d||!c)throw new t.C("Web identity configuration not specified",{logger:e.logger});const g=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(482).then(o.bind(o,84482));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?.()[d]??(0,s.readFileSync)(d,{encoding:"ascii"}),roleArn:c,roleSessionName:l})(n);return d===process.env[a]&&(0,r.g)(g,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h"),g}},74692:(e,n,o)=>{o.d(n,{Z:()=>i});var r=o(48440),t=o(71078);const i={getFileRecord:()=>t.Jj,interceptFile(e,n){t.Jj[e]=Promise.resolve(n)},getTokenRecord:()=>r.a,interceptToken(e,n){r.a[e]=n}}}};
@@ -11,6 +11,15 @@ exports.enableMCPIdentityCLI = enableMCPIdentityCLI;
11
11
  const identity_1 = require("../runtime/identity");
12
12
  const did_helpers_1 = require("@kya-os/mcp-i-core/utils/did-helpers");
13
13
  const kta_registration_1 = require("./kta-registration");
14
+ /**
15
+ * Generate a unique agent name to prevent slug collisions during registration.
16
+ * Uses timestamp + random suffix for uniqueness.
17
+ */
18
+ function generateUniqueName() {
19
+ const uniqueSuffix = Date.now().toString(36) + Math.random().toString(36).substring(2, 7);
20
+ const projectName = process.env.npm_package_name || "mcpi-agent";
21
+ return `${projectName}-${uniqueSuffix}`;
22
+ }
14
23
  /**
15
24
  * Enable MCP Identity for CLI
16
25
  *
@@ -58,7 +67,7 @@ async function enableMCPIdentityCLI(options = {}) {
58
67
  did: identity.did,
59
68
  publicKey: identity.publicKey,
60
69
  kid: identity.kid,
61
- name: name || "My Agent",
70
+ name: name || generateUniqueName(),
62
71
  description: description || "XMCP-I agent with identity features",
63
72
  repository,
64
73
  endpoint,