@stacksjs/buddy 0.64.3 → 0.64.5

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.
Files changed (47) hide show
  1. package/dist/{chunk-nnneyqej.js → chunk-0aqj22dq.js} +3 -3
  2. package/dist/{chunk-nnneyqej.js.map → chunk-0aqj22dq.js.map} +1 -1
  3. package/dist/chunk-4b0aba5k.js +5 -0
  4. package/dist/{chunk-0bcq9pbj.js.map → chunk-4b0aba5k.js.map} +2 -2
  5. package/dist/{chunk-agapayce.js → chunk-5eg9jpdw.js} +3 -3
  6. package/dist/{chunk-agapayce.js.map → chunk-5eg9jpdw.js.map} +1 -1
  7. package/dist/{chunk-gqfh2x89.js → chunk-6a30kt0n.js} +3 -3
  8. package/dist/{chunk-gqfh2x89.js.map → chunk-6a30kt0n.js.map} +1 -1
  9. package/dist/{chunk-cpn7yy6s.js → chunk-6qhap62a.js} +3 -3
  10. package/dist/{chunk-cpn7yy6s.js.map → chunk-6qhap62a.js.map} +1 -1
  11. package/dist/{chunk-59vbpar7.js → chunk-89jmvbwz.js} +3 -3
  12. package/dist/{chunk-59vbpar7.js.map → chunk-89jmvbwz.js.map} +1 -1
  13. package/dist/{chunk-pj6d7hvk.js → chunk-953dm442.js} +3 -3
  14. package/dist/{chunk-pj6d7hvk.js.map → chunk-953dm442.js.map} +1 -1
  15. package/dist/{chunk-1mphypxn.js → chunk-9f43d1kt.js} +3 -3
  16. package/dist/{chunk-1mphypxn.js.map → chunk-9f43d1kt.js.map} +1 -1
  17. package/dist/chunk-a365bfhw.js +6 -0
  18. package/dist/{chunk-a6jhzhht.js.map → chunk-a365bfhw.js.map} +4 -13
  19. package/dist/{chunk-5bf9sq7t.js → chunk-b6hb11ta.js} +3 -3
  20. package/dist/{chunk-5bf9sq7t.js.map → chunk-b6hb11ta.js.map} +1 -1
  21. package/dist/chunk-gc8bvwm2.js +5 -0
  22. package/dist/{chunk-nw65c3yh.js.map → chunk-gc8bvwm2.js.map} +2 -2
  23. package/dist/{chunk-t49ytmk0.js → chunk-kkb03h19.js} +3 -3
  24. package/dist/{chunk-t49ytmk0.js.map → chunk-kkb03h19.js.map} +1 -1
  25. package/dist/{chunk-vc4pnt6y.js → chunk-knp3sj60.js} +4 -4
  26. package/dist/{chunk-vc4pnt6y.js.map → chunk-knp3sj60.js.map} +1 -1
  27. package/dist/chunk-p9n9dek4.js +21 -0
  28. package/dist/{chunk-v1w6bgfy.js.map → chunk-p9n9dek4.js.map} +15 -6
  29. package/dist/{chunk-ac1gbd0g.js → chunk-pe71p33y.js} +4 -4
  30. package/dist/{chunk-ac1gbd0g.js.map → chunk-pe71p33y.js.map} +1 -1
  31. package/dist/chunk-qkk1z4t3.js +5 -0
  32. package/dist/{chunk-a1sxtbv1.js.map → chunk-qkk1z4t3.js.map} +2 -2
  33. package/dist/chunk-s03s5x4g.js +7 -0
  34. package/dist/{chunk-pf356ggx.js.map → chunk-s03s5x4g.js.map} +3 -3
  35. package/dist/{chunk-zpm61fm8.js → chunk-yxrf386g.js} +3 -3
  36. package/dist/{chunk-zpm61fm8.js.map → chunk-yxrf386g.js.map} +1 -1
  37. package/dist/cli.js +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/stacks +0 -0
  40. package/package.json +1 -1
  41. package/src/commands/generate.ts +21 -1
  42. package/dist/chunk-0bcq9pbj.js +0 -5
  43. package/dist/chunk-a1sxtbv1.js +0 -5
  44. package/dist/chunk-a6jhzhht.js +0 -6
  45. package/dist/chunk-nw65c3yh.js +0 -5
  46. package/dist/chunk-pf356ggx.js +0 -7
  47. package/dist/chunk-v1w6bgfy.js +0 -21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-wmfxrbxe.js";import"./chunk-5bf9sq7t.js";import{pb as z,qb as B}from"./chunk-ac1gbd0g.js";import{rb as K,sb as y}from"./chunk-agapayce.js";import"./chunk-59vbpar7.js";import{parse as p}from"url";import{Buffer as M}from"buffer";import{request as k}from"http";function E(c){return new Promise((I,x)=>{const T=k({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new K("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new K("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{const{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new K("Error response received from instance metadata service"),{statusCode:O})),T.destroy();const $=[];N.on("data",(w)=>{$.push(w)}),N.on("end",()=>{I(M.concat($)),T.destroy()})}),T.end()})}var _=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",D=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var hc=1000,Yc=0,G=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var m=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var X="AWS_CONTAINER_CREDENTIALS_FULL_URI",Z="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",b="AWS_CONTAINER_AUTHORIZATION_TOKEN",mc=(c={})=>{const{timeout:I,maxRetries:x}=G(c);return()=>m(async()=>{const T=await s({logger:c.logger}),N=JSON.parse(await C(I,T));if(!_(N))throw new y("Invalid response received from instance metadata service.",{logger:c.logger});return D(N)},x)},C=async(c,I)=>{if(process.env[b])I.headers={...I.headers,Authorization:process.env[b]};return(await E({...I,timeout:c})).toString()},a="169.254.170.2",n={localhost:!0,"127.0.0.1":!0},o={"http:":!0,"https:":!0},s=async({logger:c})=>{if(process.env[Z])return{hostname:a,path:process.env[Z]};if(process.env[X]){const I=p(process.env[X]);if(!I.hostname||!(I.hostname in n))throw new y(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in o))throw new y(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new y(`The container metadata credential provider cannot be used unless the ${Z} or ${X} environment variable is set`,{tryNextLink:!1,logger:c})};class Q extends y{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,Q.prototype)}}var J;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(J||(J={}));var H={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0};var u;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(u||(u={}));var g="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",l="ec2_metadata_service_endpoint_mode",q={environmentVariableSelector:(c)=>c[g],configFileSelector:(c)=>c[l],default:u.IPv4};var v=async()=>B(await r()||await d()),r=async()=>z(H)(),d=async()=>{const c=await z(q)();switch(c){case u.IPv4:return J.IPv4;case u.IPv6:return J.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(u)}`)}};var L=(c,I)=>{const x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(T)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var U=(c,I={})=>{const x=I?.logger||console;let T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=L(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=L(T,x);else throw O}return T=N,N}};var P="/latest/meta-data/iam/security-credentials/",e="/latest/api/token",W="AWS_EC2_METADATA_V1_DISABLED",t="ec2_metadata_v1_disabled",F="x-aws-ec2-metadata-token",oc=(c={})=>U(i(c),{logger:c.logger}),i=(c={})=>{let I=!1;const{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=G(c),$=async(w,j)=>{if(I||j.headers?.[F]==null){let h=!1,Y=!1;const R=await z({environmentVariableSelector:(S)=>{const A=S[W];if(Y=!!A&&A!=="false",A===void 0)throw new y(`${W} not set in env, checking config file next.`,{logger:c.logger});return Y},configFileSelector:(S)=>{const A=S[t];return h=!!A&&A!=="false",h},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||R){const S=[];if(c.ec2MetadataV1Disabled)S.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(h)S.push(`config file profile (${t})`);if(Y)S.push(`process environment variable (${W})`);throw new Q(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${S.join(", ")}].`)}}const V=(await m(async()=>{let h;try{h=await Ic(j)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)).trim();return m(async()=>{let h;try{h=await Tc(V,j,c)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)};return async()=>{const w=await v();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),$(O,{...w,timeout:N});else{let j;try{j=(await cc({...w,timeout:N})).toString()}catch(f){if(f?.statusCode===400)throw Object.assign(f,{message:"EC2 Metadata token request returned error"});else if(f.message==="TimeoutError"||[403,404,405].includes(f.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),$(O,{...w,timeout:N})}return $(O,{...w,headers:{[F]:j},timeout:N})}}},cc=async(c)=>E({...c,path:e,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Ic=async(c)=>(await E({...c,path:P})).toString(),Tc=async(c,I,x)=>{const T=JSON.parse((await E({...I,path:P+c})).toString());if(!_(T))throw new y("Invalid response received from instance metadata service.",{logger:x.logger});return D(T)};export{G as providerConfigFromInit,E as httpRequest,v as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,mc as fromContainerMetadata,J as Endpoint,Z as ENV_CMDS_RELATIVE_URI,X as ENV_CMDS_FULL_URI,b as ENV_CMDS_AUTH_TOKEN,hc as DEFAULT_TIMEOUT,Yc as DEFAULT_MAX_RETRIES};
2
+ import"./chunk-wmfxrbxe.js";import"./chunk-b6hb11ta.js";import{ib as z,jb as B}from"./chunk-pe71p33y.js";import{kb as K,lb as y}from"./chunk-5eg9jpdw.js";import"./chunk-89jmvbwz.js";import{parse as p}from"url";import{Buffer as M}from"buffer";import{request as k}from"http";function E(c){return new Promise((I,x)=>{const T=k({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new K("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new K("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{const{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new K("Error response received from instance metadata service"),{statusCode:O})),T.destroy();const $=[];N.on("data",(w)=>{$.push(w)}),N.on("end",()=>{I(M.concat($)),T.destroy()})}),T.end()})}var _=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",D=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var hc=1000,Yc=0,G=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var m=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var X="AWS_CONTAINER_CREDENTIALS_FULL_URI",Z="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",b="AWS_CONTAINER_AUTHORIZATION_TOKEN",mc=(c={})=>{const{timeout:I,maxRetries:x}=G(c);return()=>m(async()=>{const T=await s({logger:c.logger}),N=JSON.parse(await C(I,T));if(!_(N))throw new y("Invalid response received from instance metadata service.",{logger:c.logger});return D(N)},x)},C=async(c,I)=>{if(process.env[b])I.headers={...I.headers,Authorization:process.env[b]};return(await E({...I,timeout:c})).toString()},a="169.254.170.2",n={localhost:!0,"127.0.0.1":!0},o={"http:":!0,"https:":!0},s=async({logger:c})=>{if(process.env[Z])return{hostname:a,path:process.env[Z]};if(process.env[X]){const I=p(process.env[X]);if(!I.hostname||!(I.hostname in n))throw new y(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in o))throw new y(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new y(`The container metadata credential provider cannot be used unless the ${Z} or ${X} environment variable is set`,{tryNextLink:!1,logger:c})};class Q extends y{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,Q.prototype)}}var J;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(J||(J={}));var H={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0};var u;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(u||(u={}));var g="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",l="ec2_metadata_service_endpoint_mode",q={environmentVariableSelector:(c)=>c[g],configFileSelector:(c)=>c[l],default:u.IPv4};var v=async()=>B(await r()||await d()),r=async()=>z(H)(),d=async()=>{const c=await z(q)();switch(c){case u.IPv4:return J.IPv4;case u.IPv6:return J.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(u)}`)}};var L=(c,I)=>{const x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(T)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var U=(c,I={})=>{const x=I?.logger||console;let T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=L(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=L(T,x);else throw O}return T=N,N}};var P="/latest/meta-data/iam/security-credentials/",e="/latest/api/token",W="AWS_EC2_METADATA_V1_DISABLED",t="ec2_metadata_v1_disabled",F="x-aws-ec2-metadata-token",oc=(c={})=>U(i(c),{logger:c.logger}),i=(c={})=>{let I=!1;const{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=G(c),$=async(w,j)=>{if(I||j.headers?.[F]==null){let h=!1,Y=!1;const R=await z({environmentVariableSelector:(S)=>{const A=S[W];if(Y=!!A&&A!=="false",A===void 0)throw new y(`${W} not set in env, checking config file next.`,{logger:c.logger});return Y},configFileSelector:(S)=>{const A=S[t];return h=!!A&&A!=="false",h},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||R){const S=[];if(c.ec2MetadataV1Disabled)S.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(h)S.push(`config file profile (${t})`);if(Y)S.push(`process environment variable (${W})`);throw new Q(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${S.join(", ")}].`)}}const V=(await m(async()=>{let h;try{h=await Ic(j)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)).trim();return m(async()=>{let h;try{h=await Tc(V,j,c)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)};return async()=>{const w=await v();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),$(O,{...w,timeout:N});else{let j;try{j=(await cc({...w,timeout:N})).toString()}catch(f){if(f?.statusCode===400)throw Object.assign(f,{message:"EC2 Metadata token request returned error"});else if(f.message==="TimeoutError"||[403,404,405].includes(f.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),$(O,{...w,timeout:N})}return $(O,{...w,headers:{[F]:j},timeout:N})}}},cc=async(c)=>E({...c,path:e,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Ic=async(c)=>(await E({...c,path:P})).toString(),Tc=async(c,I,x)=>{const T=JSON.parse((await E({...I,path:P+c})).toString());if(!_(T))throw new y("Invalid response received from instance metadata service.",{logger:x.logger});return D(T)};export{G as providerConfigFromInit,E as httpRequest,v as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,mc as fromContainerMetadata,J as Endpoint,Z as ENV_CMDS_RELATIVE_URI,X as ENV_CMDS_FULL_URI,b as ENV_CMDS_AUTH_TOKEN,hc as DEFAULT_TIMEOUT,Yc as DEFAULT_MAX_RETRIES};
3
3
 
4
- //# debugId=7D8D1113576B131264756E2164756E21
5
- //# sourceMappingURL=chunk-zpm61fm8.js.map
4
+ //# debugId=BE1A6877D120ECBE64756E2164756E21
5
+ //# sourceMappingURL=chunk-yxrf386g.js.map
@@ -18,6 +18,6 @@
18
18
  "import { loadConfig } from \"@smithy/node-config-provider\";\nimport { CredentialsProviderError } from \"@smithy/property-provider\";\nimport { InstanceMetadataV1FallbackError } from \"./error/InstanceMetadataV1FallbackError\";\nimport { httpRequest } from \"./remoteProvider/httpRequest\";\nimport { fromImdsCredentials, isImdsCredentials } from \"./remoteProvider/ImdsCredentials\";\nimport { providerConfigFromInit } from \"./remoteProvider/RemoteProviderInit\";\nimport { retry } from \"./remoteProvider/retry\";\nimport { getInstanceMetadataEndpoint } from \"./utils/getInstanceMetadataEndpoint\";\nimport { staticStabilityProvider } from \"./utils/staticStabilityProvider\";\nconst IMDS_PATH = \"/latest/meta-data/iam/security-credentials/\";\nconst IMDS_TOKEN_PATH = \"/latest/api/token\";\nconst AWS_EC2_METADATA_V1_DISABLED = \"AWS_EC2_METADATA_V1_DISABLED\";\nconst PROFILE_AWS_EC2_METADATA_V1_DISABLED = \"ec2_metadata_v1_disabled\";\nconst X_AWS_EC2_METADATA_TOKEN = \"x-aws-ec2-metadata-token\";\nexport const fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger });\nconst getInstanceMetadataProvider = (init = {}) => {\n let disableFetchToken = false;\n const { logger, profile } = init;\n const { timeout, maxRetries } = providerConfigFromInit(init);\n const getCredentials = async (maxRetries, options) => {\n const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;\n if (isImdsV1Fallback) {\n let fallbackBlockedFromProfile = false;\n let fallbackBlockedFromProcessEnv = false;\n const configValue = await loadConfig({\n environmentVariableSelector: (env) => {\n const envValue = env[AWS_EC2_METADATA_V1_DISABLED];\n fallbackBlockedFromProcessEnv = !!envValue && envValue !== \"false\";\n if (envValue === undefined) {\n throw new CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger });\n }\n return fallbackBlockedFromProcessEnv;\n },\n configFileSelector: (profile) => {\n const profileValue = profile[PROFILE_AWS_EC2_METADATA_V1_DISABLED];\n fallbackBlockedFromProfile = !!profileValue && profileValue !== \"false\";\n return fallbackBlockedFromProfile;\n },\n default: false,\n }, {\n profile,\n })();\n if (init.ec2MetadataV1Disabled || configValue) {\n const causes = [];\n if (init.ec2MetadataV1Disabled)\n causes.push(\"credential provider initialization (runtime option ec2MetadataV1Disabled)\");\n if (fallbackBlockedFromProfile)\n causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);\n if (fallbackBlockedFromProcessEnv)\n causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);\n throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(\", \")}].`);\n }\n }\n const imdsProfile = (await retry(async () => {\n let profile;\n try {\n profile = await getProfile(options);\n }\n catch (err) {\n if (err.statusCode === 401) {\n disableFetchToken = false;\n }\n throw err;\n }\n return profile;\n }, maxRetries)).trim();\n return retry(async () => {\n let creds;\n try {\n creds = await getCredentialsFromProfile(imdsProfile, options, init);\n }\n catch (err) {\n if (err.statusCode === 401) {\n disableFetchToken = false;\n }\n throw err;\n }\n return creds;\n }, maxRetries);\n };\n return async () => {\n const endpoint = await getInstanceMetadataEndpoint();\n if (disableFetchToken) {\n logger?.debug(\"AWS SDK Instance Metadata\", \"using v1 fallback (no token fetch)\");\n return getCredentials(maxRetries, { ...endpoint, timeout });\n }\n else {\n let token;\n try {\n token = (await getMetadataToken({ ...endpoint, timeout })).toString();\n }\n catch (error) {\n if (error?.statusCode === 400) {\n throw Object.assign(error, {\n message: \"EC2 Metadata token request returned error\",\n });\n }\n else if (error.message === \"TimeoutError\" || [403, 404, 405].includes(error.statusCode)) {\n disableFetchToken = true;\n }\n logger?.debug(\"AWS SDK Instance Metadata\", \"using v1 fallback (initial)\");\n return getCredentials(maxRetries, { ...endpoint, timeout });\n }\n return getCredentials(maxRetries, {\n ...endpoint,\n headers: {\n [X_AWS_EC2_METADATA_TOKEN]: token,\n },\n timeout,\n });\n }\n };\n};\nconst getMetadataToken = async (options) => httpRequest({\n ...options,\n path: IMDS_TOKEN_PATH,\n method: \"PUT\",\n headers: {\n \"x-aws-ec2-metadata-token-ttl-seconds\": \"21600\",\n },\n});\nconst getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString();\nconst getCredentialsFromProfile = async (profile, options, init) => {\n const credentialsResponse = JSON.parse((await httpRequest({\n ...options,\n path: IMDS_PATH + profile,\n })).toString());\n if (!isImdsCredentials(credentialsResponse)) {\n throw new CredentialsProviderError(\"Invalid response received from instance metadata service.\", {\n logger: init.logger,\n });\n }\n return fromImdsCredentials(credentialsResponse);\n};\n"
19
19
  ],
20
20
  "mappings": ";8MACA,UAAS,MCAT,WAAS,SACT,kBAAS,aACF,SAAS,CAAW,CAAC,EAAS,CACjC,OAAO,IAAI,QAAQ,CAAC,EAAS,IAAW,CACpC,MAAM,EAAM,EAAQ,CAChB,OAAQ,SACL,EACH,SAAU,EAAQ,UAAU,QAAQ,aAAc,IAAI,CAC1D,CAAC,EACD,EAAI,GAAG,QAAS,CAAC,IAAQ,CACrB,EAAO,OAAO,OAAO,IAAI,EAAc,gDAAgD,EAAG,CAAG,CAAC,EAC9F,EAAI,QAAQ,EACf,EACD,EAAI,GAAG,UAAW,IAAM,CACpB,EAAO,IAAI,EAAc,6CAA6C,CAAC,EACvE,EAAI,QAAQ,EACf,EACD,EAAI,GAAG,WAAY,CAAC,IAAQ,CACxB,MAAQ,aAAa,KAAQ,EAC7B,GAAI,EAAa,KAAO,KAAO,EAC3B,EAAO,OAAO,OAAO,IAAI,EAAc,wDAAwD,EAAG,CAAE,YAAW,CAAC,CAAC,EACjH,EAAI,QAAQ,EAEhB,MAAM,EAAS,CAAC,EAChB,EAAI,GAAG,OAAQ,CAAC,IAAU,CACtB,EAAO,KAAK,CAAK,EACpB,EACD,EAAI,GAAG,MAAO,IAAM,CAChB,EAAQ,EAAO,OAAO,CAAM,CAAC,EAC7B,EAAI,QAAQ,EACf,EACJ,EACD,EAAI,IAAI,EACX,EClCE,IAAM,EAAoB,CAAC,IAAQ,QAAQ,CAAG,UAC1C,IAAQ,iBACR,EAAI,cAAgB,iBACpB,EAAI,kBAAoB,iBACxB,EAAI,QAAU,iBACd,EAAI,aAAe,SACjB,EAAsB,CAAC,KAAW,CAC3C,YAAa,EAAM,YACnB,gBAAiB,EAAM,gBACvB,aAAc,EAAM,MACpB,WAAY,IAAI,KAAK,EAAM,UAAU,KACjC,EAAM,WAAa,CAAE,UAAW,EAAM,SAAU,CACxD,GCZO,IAAM,GAAkB,KAClB,GAAsB,EACtB,EAAyB,EAAG,aADN,EACwC,UAF5C,SAE8E,CAAE,aAAY,SAAQ,GCF5H,IAAM,EAAQ,CAAC,EAAS,IAAe,CAC1C,IAAI,EAAU,EAAQ,EACtB,QAAS,EAAI,EAAG,EAAI,EAAY,IAC5B,EAAU,EAAQ,MAAM,CAAO,EAEnC,OAAO,GJCJ,IAAM,EAAoB,qCACpB,EAAwB,yCACxB,EAAsB,oCACtB,GAAwB,CAAC,EAAO,CAAC,IAAM,CAChD,MAAQ,UAAS,cAAe,EAAuB,CAAI,EAC3D,MAAO,IAAM,EAAM,SAAY,CAC3B,MAAM,EAAiB,MAAM,EAAW,CAAE,OAAQ,EAAK,MAAO,CAAC,EACzD,EAAgB,KAAK,MAAM,MAAM,EAAmB,EAAS,CAAc,CAAC,EAClF,IAAK,EAAkB,CAAa,EAChC,MAAM,IAAI,EAAyB,4DAA6D,CAC5F,OAAQ,EAAK,MACjB,CAAC,EAEL,OAAO,EAAoB,CAAa,GACzC,CAAU,GAEX,EAAqB,MAAO,EAAS,IAAY,CACnD,GAAI,QAAQ,IAAI,GACZ,EAAQ,QAAU,IACX,EAAQ,QACX,cAAe,QAAQ,IAAI,EAC/B,EAMJ,OAJe,MAAM,EAAY,IAC1B,EACH,SACJ,CAAC,GACa,SAAS,GAErB,EAAU,gBACV,EAAmB,CACrB,UAAW,GACX,YAAa,EACjB,EACM,EAAuB,CACzB,QAAS,GACT,SAAU,EACd,EACM,EAAa,OAAS,YAAa,CACrC,GAAI,QAAQ,IAAI,GACZ,MAAO,CACH,SAAU,EACV,KAAM,QAAQ,IAAI,EACtB,EAEJ,GAAI,QAAQ,IAAI,GAAoB,CAChC,MAAM,EAAS,EAAM,QAAQ,IAAI,EAAkB,EACnD,IAAK,EAAO,YAAc,EAAO,YAAY,GACzC,MAAM,IAAI,EAAyB,GAAG,EAAO,8DAA+D,CACxG,YAAa,GACb,QACJ,CAAC,EAEL,IAAK,EAAO,YAAc,EAAO,YAAY,GACzC,MAAM,IAAI,EAAyB,GAAG,EAAO,8DAA+D,CACxG,YAAa,GACb,QACJ,CAAC,EAEL,MAAO,IACA,EACH,KAAM,EAAO,KAAO,SAAS,EAAO,KAAM,EAAE,EAAI,MACpD,EAEJ,MAAM,IAAI,EAAyB,wEACvB,QAA4B,gCAChB,CACpB,YAAa,GACb,QACJ,CAAC,GK1EE,MAAM,UAAwC,CAAyB,CAC1E,WAAW,CAAC,EAAS,EAAc,GAAM,CACrC,MAAM,EAAS,CAAW,EAC1B,KAAK,YAAc,EACnB,KAAK,KAAO,kCACZ,OAAO,eAAe,KAAM,EAAgC,SAAS,EAE7E,CCRO,IAAI,EACX,SAAU,CAAC,EAAU,CACjB,EAAS,KAAU,yBACnB,EAAS,KAAU,2BACpB,IAAa,EAAW,CAAC,EAAE,ECFvB,IAAM,EAA0B,CACnC,4BAA6B,CAAC,IAAQ,EAHT,kCAI7B,mBAAoB,CAAC,IAAY,EAHD,8BAIhC,QAAS,MACb,ECNO,IAAI,EACX,SAAU,CAAC,EAAc,CACrB,EAAa,KAAU,OACvB,EAAa,KAAU,SACxB,IAAiB,EAAe,CAAC,EAAE,ECH/B,IAAM,EAAyB,yCACzB,EAA4B,qCAC5B,EAA+B,CACxC,4BAA6B,CAAC,IAAQ,EAAI,GAC1C,mBAAoB,CAAC,IAAY,EAAQ,GACzC,QAAS,EAAa,IAC1B,ECDO,IAAM,EAA8B,SAAY,EAAU,MAAM,EAAsB,GAAO,MAAM,EAA0B,CAAE,EAChI,EAAwB,SAAY,EAAW,CAAuB,EAAE,EACxE,EAA4B,SAAY,CAC1C,MAAM,EAAe,MAAM,EAAW,CAA4B,EAAE,EACpE,OAAQ,QACC,EAAa,KACd,OAAO,EAAyB,UAC/B,EAAa,KACd,OAAO,EAAyB,aAEhC,MAAM,IAAI,MAAM,8BAA8B,kBAAkC,OAAO,OAAO,CAAY,GAAG,ICblH,IAAM,EAAyC,CAAC,EAAa,IAAW,CAC3E,MAAM,EAJwC,IAK1C,KAAK,MAAM,KAAK,OAAO,EAJiC,GAI0B,EAChF,EAAgB,IAAI,KAAK,KAAK,IAAI,EAAI,EAAkB,IAAI,EAClE,EAAO,KAAK,qJAC+B,IAAI,KAAK,CAAa,yHACrC,EAC5B,MAAM,EAAqB,EAAY,oBAAsB,EAAY,WACzE,MAAO,IACA,KACC,EAAqB,CAAE,oBAAmB,EAAI,CAAC,EACnD,WAAY,CAChB,GCdG,IAAM,EAA0B,CAAC,EAAU,EAAU,CAAC,IAAM,CAC/D,MAAM,EAAS,GAAS,QAAU,QAClC,IAAI,EACJ,MAAO,UAAY,CACf,IAAI,EACJ,GAAI,CAEA,GADA,EAAc,MAAM,EAAS,EACzB,EAAY,YAAc,EAAY,WAAW,QAAQ,EAAI,KAAK,IAAI,EACtE,EAAc,EAAuC,EAAa,CAAM,QAGzE,EAAP,CACI,GAAI,EACA,EAAO,KAAK,4BAA6B,CAAC,EAC1C,EAAc,EAAuC,EAAiB,CAAM,MAG5E,OAAM,EAId,OADA,EAAkB,EACX,ICbf,IAAM,EAAY,8CACZ,EAAkB,oBAClB,EAA+B,+BAC/B,EAAuC,2BACvC,EAA2B,2BACpB,GAAuB,CAAC,EAAO,CAAC,IAAM,EAAwB,EAA4B,CAAI,EAAG,CAAE,OAAQ,EAAK,MAAO,CAAC,EAC/H,EAA8B,CAAC,EAAO,CAAC,IAAM,CAC/C,IAAI,EAAoB,GACxB,MAAQ,SAAQ,WAAY,GACpB,UAAS,cAAe,EAAuB,CAAI,EACrD,EAAiB,MAAO,EAAY,IAAY,CAElD,GADyB,GAAqB,EAAQ,UAAU,IAA6B,KACvE,CAClB,IAAI,EAA6B,GAC7B,EAAgC,GACpC,MAAM,EAAc,MAAM,EAAW,CACjC,4BAA6B,CAAC,IAAQ,CAClC,MAAM,EAAW,EAAI,GAErB,GADA,IAAkC,GAAY,IAAa,QACvD,IAAa,OACb,MAAM,IAAI,EAAyB,GAAG,+CAA2E,CAAE,OAAQ,EAAK,MAAO,CAAC,EAE5I,OAAO,GAEX,mBAAoB,CAAC,IAAY,CAC7B,MAAM,EAAe,EAAQ,GAE7B,OADA,IAA+B,GAAgB,IAAiB,QACzD,GAEX,QAAS,EACb,EAAG,CACC,SACJ,CAAC,EAAE,EACH,GAAI,EAAK,uBAAyB,EAAa,CAC3C,MAAM,EAAS,CAAC,EAChB,GAAI,EAAK,sBACL,EAAO,KAAK,2EAA2E,EAC3F,GAAI,EACA,EAAO,KAAK,wBAAwB,IAAuC,EAC/E,GAAI,EACA,EAAO,KAAK,iCAAiC,IAA+B,EAChF,MAAM,IAAI,EAAgC,6FAA6F,EAAO,KAAK,IAAI,KAAK,GAGpK,MAAM,GAAe,MAAM,EAAM,SAAY,CACzC,IAAI,EACJ,GAAI,CACA,EAAU,MAAM,GAAW,CAAO,QAE/B,EAAP,CACI,GAAI,EAAI,aAAe,IACnB,EAAoB,GAExB,MAAM,EAEV,OAAO,GACR,CAAU,GAAG,KAAK,EACrB,OAAO,EAAM,SAAY,CACrB,IAAI,EACJ,GAAI,CACA,EAAQ,MAAM,GAA0B,EAAa,EAAS,CAAI,QAE/D,EAAP,CACI,GAAI,EAAI,aAAe,IACnB,EAAoB,GAExB,MAAM,EAEV,OAAO,GACR,CAAU,GAEjB,MAAO,UAAY,CACf,MAAM,EAAW,MAAM,EAA4B,EACnD,GAAI,EAEA,OADA,GAAQ,MAAM,4BAA6B,oCAAoC,EACxE,EAAe,EAAY,IAAK,EAAU,SAAQ,CAAC,MAEzD,CACD,IAAI,EACJ,GAAI,CACA,GAAS,MAAM,GAAiB,IAAK,EAAU,SAAQ,CAAC,GAAG,SAAS,QAEjE,EAAP,CACI,GAAI,GAAO,aAAe,IACtB,MAAM,OAAO,OAAO,EAAO,CACvB,QAAS,2CACb,CAAC,UAEI,EAAM,UAAY,gBAAkB,CAAC,IAAK,IAAK,GAAG,EAAE,SAAS,EAAM,UAAU,EAClF,EAAoB,GAGxB,OADA,GAAQ,MAAM,4BAA6B,6BAA6B,EACjE,EAAe,EAAY,IAAK,EAAU,SAAQ,CAAC,EAE9D,OAAO,EAAe,EAAY,IAC3B,EACH,QAAS,EACJ,GAA2B,CAChC,EACA,SACJ,CAAC,KAIP,GAAmB,MAAO,IAAY,EAAY,IACjD,EACH,KAAM,EACN,OAAQ,MACR,QAAS,CACL,uCAAwC,OAC5C,CACJ,CAAC,EACK,GAAa,MAAO,KAAa,MAAM,EAAY,IAAK,EAAS,KAAM,CAAU,CAAC,GAAG,SAAS,EAC9F,GAA4B,MAAO,EAAS,EAAS,IAAS,CAChE,MAAM,EAAsB,KAAK,OAAO,MAAM,EAAY,IACnD,EACH,KAAM,EAAY,CACtB,CAAC,GAAG,SAAS,CAAC,EACd,IAAK,EAAkB,CAAmB,EACtC,MAAM,IAAI,EAAyB,4DAA6D,CAC5F,OAAQ,EAAK,MACjB,CAAC,EAEL,OAAO,EAAoB,CAAmB",
21
- "debugId": "7D8D1113576B131264756E2164756E21",
21
+ "debugId": "BE1A6877D120ECBE64756E2164756E21",
22
22
  "names": []
23
23
  }
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-t49ytmk0.js";import{A,B as D,C as k,D as f,E as j,F as J,I,J as g,L as p,M as a,d as M,e as N,f as O,g as Q,h as R,i as S,k as T,l as U,n as V,o as W,p as X,q as Y,r as Z,s as _,t as $,u as x,v as z,w as C,x as F,y as P,z as h}from"./chunk-pf356ggx.js";import"./chunk-wmfxrbxe.js";import"./chunk-a6jhzhht.js";import"./chunk-v1w6bgfy.js";import"./chunk-5bf9sq7t.js";import"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import"./chunk-vc4pnt6y.js";import"./chunk-59vbpar7.js";import w from"process";import{runAction as m}from"@stacksjs/actions";import{cli as n,log as v}from"@stacksjs/cli";import{Action as l}from"@stacksjs/enums";import{path as L}from"@stacksjs/path";import{fs as i}from"@stacksjs/storage";import{ensureProjectIsInitialized as c}from"@stacksjs/utils";async function t(){const q=n("buddy");if(J(q),z(q),await c())v.debug("Project is initialized");else{v.info("Your `APP_KEY` is not yet set"),v.info("Generating application key...");const B=await m(l.KeyGenerate);if(B.isErr())v.error("Failed to set random application key.",B.error),w.exit()}M(q),N(q),O(q),Q(q),R(q),S(q),U(q),V(q),T(q),W(q),h(q),D(q),X(q),Y(q),Z(q),x(q),_(q),$(q),C(q),F(q),P(q),k(q),f(q),j(q),J(q),I(q),g(q),a(q),A(q),p(q),await e(q),q.help(),q.parse()}async function e(q){const G=L.appPath("Commands"),B=i.readdirSync(G).filter((E)=>E.endsWith(".ts"));for(let E of B){const H=await import(`${G}/${E}`);if(typeof H.default==="function")H.default(q);else console.error(`Expected a default export function in ${E}, but got:`,H.default)}const K=await import(L.listenersPath("Console.ts"));if(typeof K.default==="function")K.default(q)}w.on("uncaughtException",(q)=>{v.debug("uncaughtException"),v.error(q),w.exit(1)});w.on("unhandledRejection",(q)=>{v.debug("unhandledRejection",q),v.error(q),w.exit(1)});await t();
2
+ import"./chunk-kkb03h19.js";import{A,B as D,C as k,D as f,E as j,F as J,I,J as g,L as p,M as a,d as M,e as N,f as O,g as Q,h as R,i as S,k as T,l as U,n as V,o as W,p as X,q as Y,r as Z,s as _,t as $,u as x,v as z,w as C,x as F,y as P,z as h}from"./chunk-s03s5x4g.js";import"./chunk-wmfxrbxe.js";import"./chunk-a365bfhw.js";import"./chunk-p9n9dek4.js";import"./chunk-b6hb11ta.js";import"./chunk-pe71p33y.js";import"./chunk-5eg9jpdw.js";import"./chunk-knp3sj60.js";import"./chunk-89jmvbwz.js";import w from"process";import{runAction as m}from"@stacksjs/actions";import{cli as n,log as v}from"@stacksjs/cli";import{Action as l}from"@stacksjs/enums";import{path as L}from"@stacksjs/path";import{fs as i}from"@stacksjs/storage";import{ensureProjectIsInitialized as c}from"@stacksjs/utils";async function t(){const q=n("buddy");if(J(q),z(q),await c())v.debug("Project is initialized");else{v.info("Your `APP_KEY` is not yet set"),v.info("Generating application key...");const B=await m(l.KeyGenerate);if(B.isErr())v.error("Failed to set random application key.",B.error),w.exit()}M(q),N(q),O(q),Q(q),R(q),S(q),U(q),V(q),T(q),W(q),h(q),D(q),X(q),Y(q),Z(q),x(q),_(q),$(q),C(q),F(q),P(q),k(q),f(q),j(q),J(q),I(q),g(q),a(q),A(q),p(q),await e(q),q.help(),q.parse()}async function e(q){const G=L.appPath("Commands"),B=i.readdirSync(G).filter((E)=>E.endsWith(".ts"));for(let E of B){const H=await import(`${G}/${E}`);if(typeof H.default==="function")H.default(q);else console.error(`Expected a default export function in ${E}, but got:`,H.default)}const K=await import(L.listenersPath("Console.ts"));if(typeof K.default==="function")K.default(q)}w.on("uncaughtException",(q)=>{v.debug("uncaughtException"),v.error(q),w.exit(1)});w.on("unhandledRejection",(q)=>{v.debug("unhandledRejection",q),v.error(q),w.exit(1)});await t();
3
3
 
4
4
  //# debugId=98CD31F4F04EAB8C64756E2164756E21
5
5
  //# sourceMappingURL=cli.js.map
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-t49ytmk0.js";import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,d as e,e as f,f as m,g as p,h as t,i as x,j as a,k as b,l as c,m as d,n as g,o as h,p as i,q as j,r as k,s as l,t as n,u as q,v as s,w as u,x as v,y as w,z as y}from"./chunk-pf356ggx.js";import"./chunk-wmfxrbxe.js";import"./chunk-a6jhzhht.js";import"./chunk-v1w6bgfy.js";import"./chunk-5bf9sq7t.js";import"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import"./chunk-vc4pnt6y.js";import"./chunk-59vbpar7.js";export{L as version,K as upgrade,J as types,I as tinker,H as test,d as startDevelopmentServer,E as setup,D as seed,C as route,B as release,A as projects,z as prepublish,y as ports,w as outdated,F as optimizePkgxDeps,v as migrate,u as make,n as list,l as lint,s as key,q as install,k as http,j as generate,i as fresh,G as ensureEnvIsSet,g as domains,h as dns,c as dev,b as deploy,a as create,x as configure,t as commit,p as cloud,m as clean,f as changelog,e as build};
2
+ import"./chunk-kkb03h19.js";import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,d as e,e as f,f as m,g as p,h as t,i as x,j as a,k as b,l as c,m as d,n as g,o as h,p as i,q as j,r as k,s as l,t as n,u as q,v as s,w as u,x as v,y as w,z as y}from"./chunk-s03s5x4g.js";import"./chunk-wmfxrbxe.js";import"./chunk-a365bfhw.js";import"./chunk-p9n9dek4.js";import"./chunk-b6hb11ta.js";import"./chunk-pe71p33y.js";import"./chunk-5eg9jpdw.js";import"./chunk-knp3sj60.js";import"./chunk-89jmvbwz.js";export{L as version,K as upgrade,J as types,I as tinker,H as test,d as startDevelopmentServer,E as setup,D as seed,C as route,B as release,A as projects,z as prepublish,y as ports,w as outdated,F as optimizePkgxDeps,v as migrate,u as make,n as list,l as lint,s as key,q as install,k as http,j as generate,i as fresh,G as ensureEnvIsSet,g as domains,h as dns,c as dev,b as deploy,a as create,x as configure,t as commit,p as cloud,m as clean,f as changelog,e as build};
3
3
 
4
4
  //# debugId=5D1A1157F85CB69864756E2164756E21
5
5
  //# sourceMappingURL=index.js.map
package/dist/stacks CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.64.3",
4
+ "version": "0.64.5",
5
5
  "description": "Meet Buddy. The Stacks runtime.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -8,9 +8,10 @@ import {
8
8
  generateTypes,
9
9
  generateVsCodeCustomData,
10
10
  generateWebTypes,
11
+ // generateOpenApiSpec,
11
12
  invoke as startGenerationProcess,
12
13
  } from '@stacksjs/actions'
13
- import { log } from '@stacksjs/cli'
14
+ import { intro, log, outro } from '@stacksjs/cli'
14
15
  import { type CLI, ExitCode, type GeneratorOptions } from '@stacksjs/types'
15
16
 
16
17
  export function generate(buddy: CLI) {
@@ -25,6 +26,7 @@ export function generate(buddy: CLI) {
25
26
  componentMeta: 'Generate component meta information',
26
27
  coreSymlink: 'Generate symlink of the core framework to the project root',
27
28
  pkgx: 'Generate the pkgx configuration file',
29
+ openApi: 'Generate the OpenAPI specification',
28
30
  select: 'What are you trying to generate?',
29
31
  project: 'Target a specific project',
30
32
  verbose: 'Enable verbose output',
@@ -39,6 +41,7 @@ export function generate(buddy: CLI) {
39
41
  .option('-i, --ide-helpers', descriptions.ideHelpers)
40
42
  .option('-c, --component-meta', descriptions.componentMeta)
41
43
  .option('-p, --pkgx', descriptions.pkgx)
44
+ .option('-o, --openapi', descriptions.openApi)
42
45
  .option('-p, --project [project]', descriptions.project, { default: false })
43
46
  .option('--core-symlink', descriptions.coreSymlink)
44
47
  .option('--verbose', descriptions.verbose, { default: false })
@@ -135,6 +138,23 @@ export function generate(buddy: CLI) {
135
138
  generatePkgxConfig()
136
139
  })
137
140
 
141
+ buddy
142
+ .command('generate:openapi-spec', descriptions.openApi)
143
+ .alias('generate:openapi')
144
+ .option('-p, --project [project]', descriptions.project, { default: false })
145
+ .option('--verbose', descriptions.verbose, { default: false })
146
+ .action(async (options: GeneratorOptions) => {
147
+ log.debug('Running `buddy generate:openapi-spec` ...', options)
148
+ const perf = await intro('buddy generate:openapi-spec')
149
+
150
+ // await generateOpenApiSpec()
151
+
152
+ outro('Generated OpenAPI specification', {
153
+ startTime: perf,
154
+ useSeconds: true,
155
+ })
156
+ })
157
+
138
158
  buddy.command('generate:migrations', 'Generate Migrations').action((options: GeneratorOptions) => {
139
159
  log.debug('Running `buddy generate:migrations` ...', options)
140
160
  // generateMigrations()
@@ -1,5 +0,0 @@
1
- // @bun
2
- import"./chunk-t49ytmk0.js";import{N as b}from"./chunk-wmfxrbxe.js";import{Aa as pl,Ba as nl,Ca as S0,Da as m0,Ea as eh,P as d0,Q as H0,R as A0,aa as Al,ba as U0,ea as Ll,fa as Rl,ha as jl,ia as al,ja as cl,ka as el,ma as B,na as Hh,oa as t0,ra as L0,ta as S,ua as u,wa as R0,xa as P0,ya as T,za as j0}from"./chunk-a6jhzhht.js";import{$a as K,Ja as k0,Ka as K0,La as F0,Ma as B0,Na as y0,Oa as Ml,Pa as zl,Qa as Nl,Ra as Q0,Sa as bl,Ta as fl,Ua as Gl,Va as Il,Wa as Cl,Xa as Ol,Ya as X0,Za as Xh,_a as Y0,ab as F,bb as Z0,cb as gl,db as xl,eb as $0,fb as il,gb as V0,hb as Gh,ib as ol,jb as ul,kb as tl,lb as h0,mb as J0,nb as D0}from"./chunk-v1w6bgfy.js";import"./chunk-5bf9sq7t.js";import{pb as f,qb as Tl}from"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import{xb as Yh}from"./chunk-vc4pnt6y.js";import"./chunk-59vbpar7.js";var C=b(Xh(),1);var dl=b(Gh(),1);function D3(h){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:h.region},propertiesExtractor:(w,l)=>({signingProperties:{config:w,context:l}})}}function wl(h){return{schemeId:"smithy.api#noAuth"}}var Hl=async(h,w,l)=>{return{operation:Gl(w).operation,region:await Il(h.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Sl=(h)=>{const w=[];switch(h.operation){case"AssumeRoleWithSAML":{w.push(wl(h));break}case"AssumeRoleWithWebIdentity":{w.push(wl(h));break}default:w.push(D3(h))}return w},E3=(h)=>({...h,stsClientCtor:A}),ml=(h)=>{const w=E3(h);return{...dl.resolveAwsSdkSigV4Config(w)}};var Jl=(h)=>{return{...h,useDualstackEndpoint:h.useDualstackEndpoint??!1,useFipsEndpoint:h.useFipsEndpoint??!1,useGlobalEndpoint:h.useGlobalEndpoint??!1,defaultSigningName:"sts"}},D={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 Dl={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",version:"3.637.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts",test:"yarn test:unit","test:unit":"jest"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.637.0","@aws-sdk/core":"3.635.0","@aws-sdk/credential-provider-node":"3.637.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.637.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.637.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.4.0","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.15","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.2.0","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.15","@smithy/util-defaults-mode-node":"^3.0.15","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}};var Ih=b(Gh(),1);var l0=b(Xh(),1);var rl=b(Gh(),1),sl=b(Xh(),1);var El={["required"]:!1,["type"]:"String"},Qh={["required"]:!0,default:!1,["type"]:"Boolean"},Zl={["ref"]:"Endpoint"},kl={["fn"]:"isSet",["argv"]:[{["ref"]:"Region"}]},J={["ref"]:"Region"},Kl={["fn"]:"aws.partition",["argv"]:[J],assign:"PartitionResult"},$l={["ref"]:"UseFIPS"},Ul={["ref"]:"UseDualStack"},E={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"us-east-1"}]},headers:{}},Z={},Fl={conditions:[{["fn"]:"stringEquals",["argv"]:[J,"aws-global"]}],["endpoint"]:E,["type"]:"endpoint"},Vl={["fn"]:"booleanEquals",["argv"]:[$l,!0]},Pl={["fn"]:"booleanEquals",["argv"]:[Ul,!0]},Bl={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},vl={["ref"]:"PartitionResult"},yl={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[vl,"supportsDualStack"]}]},Ql=[{["fn"]:"isSet",["argv"]:[Zl]}],Xl=[Vl],Yl=[Pl],K3={version:"1.0",parameters:{Region:El,UseDualStack:Qh,UseFIPS:Qh,Endpoint:El,UseGlobalEndpoint:Qh},rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},{["fn"]:"not",["argv"]:Ql},kl,Kl,{["fn"]:"booleanEquals",["argv"]:[$l,!1]},{["fn"]:"booleanEquals",["argv"]:[Ul,!1]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-northeast-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-south-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-2"]}],endpoint:E,["type"]:"endpoint"},Fl,{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ca-central-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-central-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-north-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-2"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-3"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"sa-east-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-2"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-2"]}],endpoint:E,["type"]:"endpoint"},{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"{Region}"}]},headers:Z},["type"]:"endpoint"}],["type"]:"tree"},{conditions:Ql,rules:[{conditions:Xl,error:"Invalid Configuration: FIPS and custom endpoint are not supported",["type"]:"error"},{conditions:Yl,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",["type"]:"error"},{endpoint:{url:Zl,properties:Z,headers:Z},["type"]:"endpoint"}],["type"]:"tree"},{conditions:[kl],rules:[{conditions:[Kl],rules:[{conditions:[Vl,Pl],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Bl]},yl],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Z,headers:Z},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",["type"]:"error"}],["type"]:"tree"},{conditions:Xl,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Bl,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[vl,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:Z,headers:Z},["type"]:"endpoint"},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Z,headers:Z},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",["type"]:"error"}],["type"]:"tree"},{conditions:Yl,rules:[{conditions:[yl],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Z,headers:Z},["type"]:"endpoint"}],["type"]:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",["type"]:"error"}],["type"]:"tree"},Fl,{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:Z,headers:Z},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Configuration: Missing Region",["type"]:"error"}]},ql=K3;var Wl=(h,w={})=>{return zl(ql,{endpointParams:h,logger:w.logger})};Ml.aws=Nl;var _l=(h)=>{return{apiVersion:"2011-06-15",base64Decoder:h?.base64Decoder??Ll,base64Encoder:h?.base64Encoder??al,disableHostPrefix:h?.disableHostPrefix??!1,endpointProvider:h?.endpointProvider??Wl,extensions:h?.extensions??[],httpAuthSchemeProvider:h?.httpAuthSchemeProvider??Sl,httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(w)=>w.getIdentityProvider("aws.auth#sigv4"),signer:new rl.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(w)=>w.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new sl.NoAuthSigner}],logger:h?.logger??new Al,serviceId:h?.serviceId??"STS",urlParser:h?.urlParser??Tl,utf8Decoder:h?.utf8Decoder??Rl,utf8Encoder:h?.utf8Encoder??jl}};var w0=(h)=>{nl(process.version);const w=h0(h),l=()=>w().then(pl),G=_l(h);return Ih.emitWarningIfUnsupportedVersion(process.version),{...G,...h,runtime:"node",defaultsMode:w,bodyLengthChecker:h?.bodyLengthChecker??tl,credentialDefaultProvider:h?.credentialDefaultProvider??Yh,defaultUserAgentProvider:h?.defaultUserAgentProvider??ol({serviceId:G.serviceId,clientVersion:Dl.version}),httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(I)=>I.getIdentityProvider("aws.auth#sigv4")||(async(H)=>await Yh(H?.__config||{})()),signer:new Ih.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(I)=>I.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new l0.NoAuthSigner}],maxAttempts:h?.maxAttempts??f(xl),region:h?.region??f(Cl,Ol),requestHandler:cl.create(h?.requestHandler??l),retryMode:h?.retryMode??f({...il,default:async()=>(await l()).retryMode||gl}),sha256:h?.sha256??ul.bind(null,"sha256"),streamCollector:h?.streamCollector??el,useDualstackEndpoint:h?.useDualstackEndpoint??f(bl),useFipsEndpoint:h?.useFipsEndpoint??f(fl)}};var G0=(h)=>{const w=h.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:G}=h;return{setHttpAuthScheme(I){const H=w.findIndex((d)=>d.schemeId===I.schemeId);if(H===-1)w.push(I);else w.splice(H,1,I)},httpAuthSchemes(){return w},setHttpAuthSchemeProvider(I){l=I},httpAuthSchemeProvider(){return l},setCredentials(I){G=I},credentials(){return G}}},I0=(h)=>{return{httpAuthSchemes:h.httpAuthSchemes(),httpAuthSchemeProvider:h.httpAuthSchemeProvider(),credentials:h.credentials()}};var dh=(h)=>h,E0=(h,w)=>{const l={...dh(J0(h)),...dh(S0(h)),...dh(d0(h)),...dh(G0(h))};return w.forEach((G)=>G.configure(l)),{...h,...D0(l),...m0(l),...H0(l),...I0(l)}};class A extends U0{constructor(...[h]){const w=w0(h||{}),l=Jl(w),G=y0(l),I=$0(G),H=X0(I),d=k0(H),Y=Z0(d),M=ml(Y),v=E0(M,h?.extensions||[]);super(v);this.config=v,this.middlewareStack.use(Q0(this.config)),this.middlewareStack.use(V0(this.config)),this.middlewareStack.use(Y0(this.config)),this.middlewareStack.use(K0(this.config)),this.middlewareStack.use(F0(this.config)),this.middlewareStack.use(B0(this.config)),this.middlewareStack.use(C.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Hl,identityProviderConfigProvider:async(n)=>new C.DefaultIdentityProviderConfig({"aws.auth#sigv4":n.credentials})})),this.middlewareStack.use(C.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class X extends P0{constructor(h){super(h);Object.setPrototypeOf(this,X.prototype)}}class Sh extends X{constructor(h){super({name:"ExpiredTokenException",$fault:"client",...h});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,Sh.prototype)}}class mh extends X{constructor(h){super({name:"MalformedPolicyDocumentException",$fault:"client",...h});this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,mh.prototype)}}class Jh extends X{constructor(h){super({name:"PackedPolicyTooLargeException",$fault:"client",...h});this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,Jh.prototype)}}class Dh extends X{constructor(h){super({name:"RegionDisabledException",$fault:"client",...h});this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,Dh.prototype)}}class Eh extends X{constructor(h){super({name:"IDPRejectedClaimException",$fault:"client",...h});this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Eh.prototype)}}class kh extends X{constructor(h){super({name:"InvalidIdentityTokenException",$fault:"client",...h});this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,kh.prototype)}}class Kh extends X{constructor(h){super({name:"IDPCommunicationErrorException",$fault:"client",...h});this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,Kh.prototype)}}class Fh extends X{constructor(h){super({name:"InvalidAuthorizationMessageException",$fault:"client",...h});this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,Fh.prototype)}}var o=(h)=>({...h,...h.SecretAccessKey&&{SecretAccessKey:Hh}}),v0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),q0=(h)=>({...h,...h.SAMLAssertion&&{SAMLAssertion:Hh}}),M0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),z0=(h)=>({...h,...h.WebIdentityToken&&{WebIdentityToken:Hh}}),N0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),W0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),T0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}});var q=b(Gh(),1);var a0=async(h,w)=>{const l=j;let G;return G=_({...U3(h,w),[r]:t3,[s]:a}),R(w,l,"/",void 0,G)},r0=async(h,w)=>{const l=j;let G;return G=_({...V3(h,w),[r]:hw,[s]:a}),R(w,l,"/",void 0,G)},s0=async(h,w)=>{const l=j;let G;return G=_({...P3(h,w),[r]:lw,[s]:a}),R(w,l,"/",void 0,G)},_0=async(h,w)=>{const l=j;let G;return G=_({...v3(h,w),[r]:ww,[s]:a}),R(w,l,"/",void 0,G)},b0=async(h,w)=>{const l=j;let G;return G=_({...q3(h,w),[r]:Gw,[s]:a}),R(w,l,"/",void 0,G)},f0=async(h,w)=>{const l=j;let G;return G=_({...M3(h,w),[r]:Iw,[s]:a}),R(w,l,"/",void 0,G)},C0=async(h,w)=>{const l=j;let G;return G=_({...z3(h,w),[r]:dw,[s]:a}),R(w,l,"/",void 0,G)},O0=async(h,w)=>{const l=j;let G;return G=_({...N3(h,w),[r]:Hw,[s]:a}),R(w,l,"/",void 0,G)},g0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=j3(l.AssumeRoleResult,w),{$metadata:k(h),...G}},x0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=a3(l.AssumeRoleWithSAMLResult,w),{$metadata:k(h),...G}},i0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=r3(l.AssumeRoleWithWebIdentityResult,w),{$metadata:k(h),...G}},c0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=s3(l.DecodeAuthorizationMessageResult,w),{$metadata:k(h),...G}},e0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=f3(l.GetAccessKeyInfoResult,w),{$metadata:k(h),...G}},p0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=C3(l.GetCallerIdentityResult,w),{$metadata:k(h),...G}},n0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=O3(l.GetFederationTokenResult,w),{$metadata:k(h),...G}},o0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=g3(l.GetSessionTokenResult,w),{$metadata:k(h),...G}},L=async(h,w)=>{const l={...h,body:await q.parseXmlErrorBody(h.body,w)},G=Sw(h,l.body);switch(G){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await F3(l,w);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await Y3(l,w);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Z3(l,w);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await $3(l,w);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await y3(l,w);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await X3(l,w);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await B3(l,w);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await Q3(l,w);default:const I=l.body;return u3({output:h,parsedBody:I.Error,errorCode:G})}},F3=async(h,w)=>{const l=h.body,G=_3(l.Error,w),I=new Sh({$metadata:k(h),...G});return T(I,l)},B3=async(h,w)=>{const l=h.body,G=x3(l.Error,w),I=new Kh({$metadata:k(h),...G});return T(I,l)},y3=async(h,w)=>{const l=h.body,G=i3(l.Error,w),I=new Eh({$metadata:k(h),...G});return T(I,l)},Q3=async(h,w)=>{const l=h.body,G=c3(l.Error,w),I=new Fh({$metadata:k(h),...G});return T(I,l)},X3=async(h,w)=>{const l=h.body,G=e3(l.Error,w),I=new kh({$metadata:k(h),...G});return T(I,l)},Y3=async(h,w)=>{const l=h.body,G=p3(l.Error,w),I=new mh({$metadata:k(h),...G});return T(I,l)},Z3=async(h,w)=>{const l=h.body,G=n3(l.Error,w),I=new Jh({$metadata:k(h),...G});return T(I,l)},$3=async(h,w)=>{const l=h.body,G=o3(l.Error,w),I=new Dh({$metadata:k(h),...G});return T(I,l)},U3=(h,w)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[i]!=null)l[i]=h[i];if(h[U]!=null){const G=Bh(h[U],w);if(h[U]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([I,H])=>{const d=`PolicyArns.${I}`;l[d]=H})}if(h[$]!=null)l[$]=h[$];if(h[Q]!=null)l[Q]=h[Q];if(h[e]!=null){const G=u0(h[e],w);if(h[e]?.length===0)l.Tags=[];Object.entries(G).forEach(([I,H])=>{const d=`Tags.${I}`;l[d]=H})}if(h[Oh]!=null){const G=R3(h[Oh],w);if(h[Oh]?.length===0)l.TransitiveTagKeys=[];Object.entries(G).forEach(([I,H])=>{const d=`TransitiveTagKeys.${I}`;l[d]=H})}if(h[Ph]!=null)l[Ph]=h[Ph];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];if(h[P]!=null)l[P]=h[P];if(h[Rh]!=null){const G=A3(h[Rh],w);if(h[Rh]?.length===0)l.ProvidedContexts=[];Object.entries(G).forEach(([I,H])=>{const d=`ProvidedContexts.${I}`;l[d]=H})}return l},V3=(h,w)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[Ah]!=null)l[Ah]=h[Ah];if(h[_h]!=null)l[_h]=h[_h];if(h[U]!=null){const G=Bh(h[U],w);if(h[U]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([I,H])=>{const d=`PolicyArns.${I}`;l[d]=H})}if(h[$]!=null)l[$]=h[$];if(h[Q]!=null)l[Q]=h[Q];return l},P3=(h,w)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[i]!=null)l[i]=h[i];if(h[ih]!=null)l[ih]=h[ih];if(h[jh]!=null)l[jh]=h[jh];if(h[U]!=null){const G=Bh(h[U],w);if(h[U]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([I,H])=>{const d=`PolicyArns.${I}`;l[d]=H})}if(h[$]!=null)l[$]=h[$];if(h[Q]!=null)l[Q]=h[Q];return l},v3=(h,w)=>{const l={};if(h[vh]!=null)l[vh]=h[vh];return l},q3=(h,w)=>{const l={};if(h[O]!=null)l[O]=h[O];return l},M3=(h,w)=>{return{}},z3=(h,w)=>{const l={};if(h[Wh]!=null)l[Wh]=h[Wh];if(h[$]!=null)l[$]=h[$];if(h[U]!=null){const G=Bh(h[U],w);if(h[U]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([I,H])=>{const d=`PolicyArns.${I}`;l[d]=H})}if(h[Q]!=null)l[Q]=h[Q];if(h[e]!=null){const G=u0(h[e],w);if(h[e]?.length===0)l.Tags=[];Object.entries(G).forEach(([I,H])=>{const d=`Tags.${I}`;l[d]=H})}return l},N3=(h,w)=>{const l={};if(h[Q]!=null)l[Q]=h[Q];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];return l},Bh=(h,w)=>{const l={};let G=1;for(let I of h){if(I===null)continue;const H=W3(I,w);Object.entries(H).forEach(([d,Y])=>{l[`member.${G}.${d}`]=Y}),G++}return l},W3=(h,w)=>{const l={};if(h[ch]!=null)l[ch]=h[ch];return l},T3=(h,w)=>{const l={};if(h[Lh]!=null)l[Lh]=h[Lh];if(h[$h]!=null)l[$h]=h[$h];return l},A3=(h,w)=>{const l={};let G=1;for(let I of h){if(I===null)continue;const H=T3(I,w);Object.entries(H).forEach(([d,Y])=>{l[`member.${G}.${d}`]=Y}),G++}return l},L3=(h,w)=>{const l={};if(h[Nh]!=null)l[Nh]=h[Nh];if(h[xh]!=null)l[xh]=h[xh];return l},R3=(h,w)=>{const l={};let G=1;for(let I of h){if(I===null)continue;l[`member.${G}`]=I,G++}return l},u0=(h,w)=>{const l={};let G=1;for(let I of h){if(I===null)continue;const H=L3(I,w);Object.entries(H).forEach(([d,Y])=>{l[`member.${G}.${d}`]=Y}),G++}return l},ph=(h,w)=>{const l={};if(h[Zh]!=null)l[Zh]=S(h[Zh]);if(h[N]!=null)l[N]=S(h[N]);return l},j3=(h,w)=>{const l={};if(h[y]!=null)l[y]=t(h[y],w);if(h[z]!=null)l[z]=ph(h[z],w);if(h[V]!=null)l[V]=u(h[V]);if(h[P]!=null)l[P]=S(h[P]);return l},a3=(h,w)=>{const l={};if(h[y]!=null)l[y]=t(h[y],w);if(h[z]!=null)l[z]=ph(h[z],w);if(h[V]!=null)l[V]=u(h[V]);if(h[rh]!=null)l[rh]=S(h[rh]);if(h[fh]!=null)l[fh]=S(h[fh]);if(h[zh]!=null)l[zh]=S(h[zh]);if(h[x]!=null)l[x]=S(h[x]);if(h[Th]!=null)l[Th]=S(h[Th]);if(h[P]!=null)l[P]=S(h[P]);return l},r3=(h,w)=>{const l={};if(h[y]!=null)l[y]=t(h[y],w);if(h[bh]!=null)l[bh]=S(h[bh]);if(h[z]!=null)l[z]=ph(h[z],w);if(h[V]!=null)l[V]=u(h[V]);if(h[ah]!=null)l[ah]=S(h[ah]);if(h[x]!=null)l[x]=S(h[x]);if(h[P]!=null)l[P]=S(h[P]);return l},t=(h,w)=>{const l={};if(h[O]!=null)l[O]=S(h[O]);if(h[sh]!=null)l[sh]=S(h[sh]);if(h[Ch]!=null)l[Ch]=S(h[Ch]);if(h[Vh]!=null)l[Vh]=L0(R0(h[Vh]));return l},s3=(h,w)=>{const l={};if(h[Uh]!=null)l[Uh]=S(h[Uh]);return l},_3=(h,w)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},b3=(h,w)=>{const l={};if(h[Mh]!=null)l[Mh]=S(h[Mh]);if(h[N]!=null)l[N]=S(h[N]);return l},f3=(h,w)=>{const l={};if(h[g]!=null)l[g]=S(h[g]);return l},C3=(h,w)=>{const l={};if(h[gh]!=null)l[gh]=S(h[gh]);if(h[g]!=null)l[g]=S(h[g]);if(h[N]!=null)l[N]=S(h[N]);return l},O3=(h,w)=>{const l={};if(h[y]!=null)l[y]=t(h[y],w);if(h[qh]!=null)l[qh]=b3(h[qh],w);if(h[V]!=null)l[V]=u(h[V]);return l},g3=(h,w)=>{const l={};if(h[y]!=null)l[y]=t(h[y],w);return l},x3=(h,w)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},i3=(h,w)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},c3=(h,w)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},e3=(h,w)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},p3=(h,w)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},n3=(h,w)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},o3=(h,w)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},k=(h)=>({httpStatusCode:h.statusCode,requestId:h.headers["x-amzn-requestid"]??h.headers["x-amzn-request-id"]??h.headers["x-amz-request-id"],extendedRequestId:h.headers["x-amz-id-2"],cfId:h.headers["x-amz-cf-id"]});var u3=j0(X),R=async(h,w,l,G,I)=>{const{hostname:H,protocol:d="https",port:Y,path:M}=await h.endpoint(),v={protocol:d,hostname:H,port:Y,method:"POST",path:M.endsWith("/")?M.slice(0,-1)+l:M+l,headers:w};if(G!==void 0)v.hostname=G;if(I!==void 0)v.body=I;return new A0(v)},j={"content-type":"application/x-www-form-urlencoded"},a="2011-06-15",r="Action",O="AccessKeyId",t3="AssumeRole",Zh="AssumedRoleId",z="AssumedRoleUser",hw="AssumeRoleWithSAML",lw="AssumeRoleWithWebIdentity",g="Account",N="Arn",x="Audience",y="Credentials",$h="ContextAssertion",ww="DecodeAuthorizationMessage",Uh="DecodedMessage",Q="DurationSeconds",Vh="Expiration",Ph="ExternalId",vh="EncodedMessage",qh="FederatedUser",Mh="FederatedUserId",Gw="GetAccessKeyInfo",Iw="GetCallerIdentity",dw="GetFederationToken",Hw="GetSessionToken",zh="Issuer",Nh="Key",Wh="Name",Th="NameQualifier",$="Policy",U="PolicyArns",Ah="PrincipalArn",Lh="ProviderArn",Rh="ProvidedContexts",jh="ProviderId",V="PackedPolicySize",ah="Provider",W="RoleArn",i="RoleSessionName",rh="Subject",sh="SecretAccessKey",_h="SAMLAssertion",bh="SubjectFromWebIdentityToken",P="SourceIdentity",c="SerialNumber",fh="SubjectType",Ch="SessionToken",e="Tags",p="TokenCode",Oh="TransitiveTagKeys",gh="UserId",s="Version",xh="Value",ih="WebIdentityToken",ch="arn",m="message",_=(h)=>Object.entries(h).map(([w,l])=>eh(w)+"="+eh(l)).join("&"),Sw=(h,w)=>{if(w.Error?.Code!==void 0)return w.Error.Code;if(h.statusCode==404)return"NotFound"};class hh extends B.classBuilder().ep({...D}).m(function(h,w,l,G){return[K(l,this.serialize,this.deserialize),F(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,v0).ser(a0).de(g0).build(){}class nh extends B.classBuilder().ep({...D}).m(function(h,w,l,G){return[K(l,this.serialize,this.deserialize),F(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(q0,M0).ser(r0).de(x0).build(){}class lh extends B.classBuilder().ep({...D}).m(function(h,w,l,G){return[K(l,this.serialize,this.deserialize),F(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(z0,N0).ser(s0).de(i0).build(){}class oh extends B.classBuilder().ep({...D}).m(function(h,w,l,G){return[K(l,this.serialize,this.deserialize),F(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(_0).de(c0).build(){}class uh extends B.classBuilder().ep({...D}).m(function(h,w,l,G){return[K(l,this.serialize,this.deserialize),F(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(b0).de(e0).build(){}class th extends B.classBuilder().ep({...D}).m(function(h,w,l,G){return[K(l,this.serialize,this.deserialize),F(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(f0).de(p0).build(){}class hl extends B.classBuilder().ep({...D}).m(function(h,w,l,G){return[K(l,this.serialize,this.deserialize),F(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,W0).ser(C0).de(n0).build(){}class ll extends B.classBuilder().ep({...D}).m(function(h,w,l,G){return[K(l,this.serialize,this.deserialize),F(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,T0).ser(O0).de(o0).build(){}var mw={AssumeRoleCommand:hh,AssumeRoleWithSAMLCommand:nh,AssumeRoleWithWebIdentityCommand:lh,DecodeAuthorizationMessageCommand:oh,GetAccessKeyInfoCommand:uh,GetCallerIdentityCommand:th,GetFederationTokenCommand:hl,GetSessionTokenCommand:ll};class h3 extends A{}t0(mw,h3);var l3="us-east-1",w3=(h)=>{if(typeof h?.Arn==="string"){const w=h.Arn.split(":");if(w.length>4&&w[4]!=="")return w[4]}return},G3=async(h,w,l)=>{const G=typeof h==="function"?await h():h,I=typeof w==="function"?await w():w;return l?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${G} (provider)`,`${I} (parent client)`,`${l3} (STS default)`),G??I??l3},I3=(h,w)=>{let l,G;return async(I,H)=>{if(G=I,!l){const{logger:v=h?.parentClientConfig?.logger,region:n,requestHandler:wh=h?.parentClientConfig?.requestHandler,credentialProviderLogger:yh}=h,m3=await G3(n,h?.parentClientConfig?.region,yh),J3=!H3(wh);l=new w({credentialDefaultProvider:()=>async()=>G,region:m3,requestHandler:J3?wh:void 0,logger:v})}const{Credentials:d,AssumedRoleUser:Y}=await l.send(new hh(H));if(!d||!d.AccessKeyId||!d.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${H.RoleArn}`);const M=w3(Y);return{accessKeyId:d.AccessKeyId,secretAccessKey:d.SecretAccessKey,sessionToken:d.SessionToken,expiration:d.Expiration,...d.CredentialScope&&{credentialScope:d.CredentialScope},...M&&{accountId:M}}}},d3=(h,w)=>{let l;return async(G)=>{if(!l){const{logger:Y=h?.parentClientConfig?.logger,region:M,requestHandler:v=h?.parentClientConfig?.requestHandler,credentialProviderLogger:n}=h,wh=await G3(M,h?.parentClientConfig?.region,n),yh=!H3(v);l=new w({region:wh,requestHandler:yh?v:void 0,logger:Y})}const{Credentials:I,AssumedRoleUser:H}=await l.send(new lh(G));if(!I||!I.AccessKeyId||!I.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${G.RoleArn}`);const d=w3(H);return{accessKeyId:I.AccessKeyId,secretAccessKey:I.SecretAccessKey,sessionToken:I.SessionToken,expiration:I.Expiration,...I.CredentialScope&&{credentialScope:I.CredentialScope},...d&&{accountId:d}}}};var H3=(h)=>{return h?.metadata?.handlerProtocol==="h2"};var S3=(h,w)=>{if(!w)return h;else return class l extends h{constructor(G){super(G);for(let I of w)this.middlewareStack.use(I)}}},Jw=(h={},w)=>I3(h,S3(A,w)),Dw=(h={},w)=>d3(h,S3(A,w)),jI=(h)=>(w)=>h({roleAssumer:Jw(w),roleAssumerWithWebIdentity:Dw(w),...w});export{Dw as getDefaultRoleAssumerWithWebIdentity,Jw as getDefaultRoleAssumer,jI as decorateDefaultCredentialProvider,U0 as __Client,X as STSServiceException,A as STSClient,h3 as STS,Dh as RegionDisabledException,Jh as PackedPolicyTooLargeException,mh as MalformedPolicyDocumentException,kh as InvalidIdentityTokenException,Fh as InvalidAuthorizationMessageException,Eh as IDPRejectedClaimException,Kh as IDPCommunicationErrorException,T0 as GetSessionTokenResponseFilterSensitiveLog,ll as GetSessionTokenCommand,W0 as GetFederationTokenResponseFilterSensitiveLog,hl as GetFederationTokenCommand,th as GetCallerIdentityCommand,uh as GetAccessKeyInfoCommand,Sh as ExpiredTokenException,oh as DecodeAuthorizationMessageCommand,o as CredentialsFilterSensitiveLog,N0 as AssumeRoleWithWebIdentityResponseFilterSensitiveLog,z0 as AssumeRoleWithWebIdentityRequestFilterSensitiveLog,lh as AssumeRoleWithWebIdentityCommand,M0 as AssumeRoleWithSAMLResponseFilterSensitiveLog,q0 as AssumeRoleWithSAMLRequestFilterSensitiveLog,nh as AssumeRoleWithSAMLCommand,v0 as AssumeRoleResponseFilterSensitiveLog,hh as AssumeRoleCommand,B as $Command};
3
-
4
- //# debugId=5828B1E4DBF1F47A64756E2164756E21
5
- //# sourceMappingURL=chunk-0bcq9pbj.js.map
@@ -1,5 +0,0 @@
1
- // @bun
2
- import"./chunk-t49ytmk0.js";import{N as $}from"./chunk-wmfxrbxe.js";import{Aa as Qe,Ba as Xe,Ca as rr,Da as sr,Ga as y,Ha as o,Ia as I,P as ue,Q as er,aa as je,ba as vr,ea as Fe,fa as De,ha as qe,ia as Ue,ja as Be,ka as Le,ma as S,na as t,oa as Vr,pa as _,qa as b,ra as j,sa as F,ta as h,xa as Sr,ya as a,za as jr}from"./chunk-a6jhzhht.js";import{$a as v,Ja as nr,Ka as or,La as dr,Ma as yr,Na as cr,Oa as Ie,Pa as Re,Qa as Pe,Ra as tr,Sa as Je,Ta as Ve,Ua as ee,Va as re,Wa as We,Xa as fe,Ya as ar,Za as H,_a as mr,ab as E,bb as wr,cb as Ae,db as Ke,eb as kr,fb as Me,gb as Er,hb as q,ib as Ye,jb as Ze,kb as He,lb as Ne,mb as ir,nb as lr}from"./chunk-v1w6bgfy.js";import"./chunk-5bf9sq7t.js";import{pb as R,qb as be}from"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import{xb as Ce}from"./chunk-vc4pnt6y.js";import"./chunk-59vbpar7.js";var P=$(H(),1);var se=$(q(),1);function Mr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}}function Z(e){return{schemeId:"smithy.api#noAuth"}}var ie=async(e,s,r)=>{return{operation:ee(s).operation,region:await re(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},le=(e)=>{const s=[];switch(e.operation){case"CreateToken":{s.push(Z(e));break}case"RegisterClient":{s.push(Z(e));break}case"StartDeviceAuthorization":{s.push(Z(e));break}default:s.push(Mr(e))}return s},he=(e)=>{return{...se.resolveAwsSdkSigV4Config(e)}};var ne=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},k={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var oe={name:"@aws-sdk/client-sso-oidc",description:"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",version:"3.637.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso-oidc","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso-oidc"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.635.0","@aws-sdk/credential-provider-node":"3.637.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.637.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.637.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.4.0","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.15","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.2.0","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.15","@smithy/util-defaults-mode-node":"^3.0.15","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",peerDependencies:{"@aws-sdk/client-sts":"^3.637.0"},browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso-oidc"}};var _e=$(q(),1);var xe=$(q(),1),ze=$(H(),1);var de={["required"]:!1,type:"String"},ye={["required"]:!0,default:!1,type:"Boolean"},ce={["ref"]:"Endpoint"},ve={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},Ee={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},m={},te={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Se={["ref"]:"PartitionResult"},ae={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Se,"supportsDualStack"]}]},me=[ve],we=[Ee],ke=[{["ref"]:"Region"}],Lr={version:"1.0",parameters:{Region:de,UseDualStack:ye,UseFIPS:ye,Endpoint:de},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ce]}],rules:[{conditions:me,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:we,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ce,properties:m,headers:m},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:ke}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:ke,assign:"PartitionResult"}],rules:[{conditions:[ve,Ee],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,te]},ae],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:me,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[te,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Se,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:m,headers:m},type:"endpoint"},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:we,rules:[{conditions:[ae],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},$e=Lr;var Te=(e,s={})=>{return Re($e,{endpointParams:e,logger:s.logger})};Ie.aws=Pe;var Ge=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Fe,base64Encoder:e?.base64Encoder??Ue,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Te,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??le,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new xe.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ze.NoAuthSigner}],logger:e?.logger??new je,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??be,utf8Decoder:e?.utf8Decoder??De,utf8Encoder:e?.utf8Encoder??qe}};var pe=(e)=>{Xe(process.version);const s=Ne(e),r=()=>s().then(Qe),i=Ge(e);return _e.emitWarningIfUnsupportedVersion(process.version),{...i,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??He,credentialDefaultProvider:e?.credentialDefaultProvider??Ce,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ye({serviceId:i.serviceId,clientVersion:oe.version}),maxAttempts:e?.maxAttempts??R(Ke),region:e?.region??R(We,fe),requestHandler:Be.create(e?.requestHandler??r),retryMode:e?.retryMode??R({...Me,default:async()=>(await r()).retryMode||Ae}),sha256:e?.sha256??Ze.bind(null,"sha256"),streamCollector:e?.streamCollector??Le,useDualstackEndpoint:e?.useDualstackEndpoint??R(Je),useFipsEndpoint:e?.useFipsEndpoint??R(Ve)}};var ge=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:r,credentials:i}=e;return{setHttpAuthScheme(l){const n=s.findIndex((T)=>T.schemeId===l.schemeId);if(n===-1)s.push(l);else s.splice(n,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){r=l},httpAuthSchemeProvider(){return r},setCredentials(l){i=l},credentials(){return i}}},Oe=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var U=(e)=>e,hr=(e,s)=>{const r={...U(ir(e)),...U(rr(e)),...U(ue(e)),...U(ge(e))};return s.forEach((i)=>i.configure(r)),{...e,...lr(r),...sr(r),...er(r),...Oe(r)}};class N extends vr{constructor(...[e]){const s=pe(e||{}),r=ne(s),i=cr(r),l=kr(i),n=ar(l),T=nr(n),fr=wr(T),Ar=he(fr),u=hr(Ar,e?.extensions||[]);super(u);this.config=u,this.middlewareStack.use(tr(this.config)),this.middlewareStack.use(Er(this.config)),this.middlewareStack.use(mr(this.config)),this.middlewareStack.use(or(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(yr(this.config)),this.middlewareStack.use(P.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ie,identityProviderConfigProvider:async(Kr)=>new P.DefaultIdentityProviderConfig({"aws.auth#sigv4":Kr.credentials})})),this.middlewareStack.use(P.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class d extends Sr{constructor(e){super(e);Object.setPrototypeOf(this,d.prototype)}}class x extends d{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,x.prototype),this.error=e.error,this.error_description=e.error_description}}class z extends d{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,z.prototype),this.error=e.error,this.error_description=e.error_description}}class G extends d{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,G.prototype),this.error=e.error,this.error_description=e.error_description}}class J extends d{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends d{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends d{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}class f extends d{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,f.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends d{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class K extends d{constructor(e){super({name:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.error_description=e.error_description}}class M extends d{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,M.prototype),this.error=e.error,this.error_description=e.error_description}}class B extends d{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}class L extends d{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Q extends d{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}class X extends d{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}var $r=(e)=>({...e,...e.clientSecret&&{clientSecret:t},...e.refreshToken&&{refreshToken:t},...e.codeVerifier&&{codeVerifier:t}}),Ir=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Rr=(e)=>({...e,...e.refreshToken&&{refreshToken:t},...e.assertion&&{assertion:t},...e.subjectToken&&{subjectToken:t},...e.codeVerifier&&{codeVerifier:t}}),Pr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Tr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}}),br=(e)=>({...e,...e.clientSecret&&{clientSecret:t}});var w=$(q(),1),D=$(H(),1);var Fr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},Dr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");const l=y({[is]:[,"t"]});let n;return n=JSON.stringify(o(e,{assertion:[],clientId:[],code:[],codeVerifier:[],grantType:[],redirectUri:[],refreshToken:[],requestedTokenType:[],scope:(T)=>I(T),subjectToken:[],subjectTokenType:[]})),r.m("POST").h(i).q(l).b(n),r.build()},qr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/client/register");let l;return l=JSON.stringify(o(e,{clientName:[],clientType:[],entitledApplicationArn:[],grantTypes:(n)=>I(n),issuerUrl:[],redirectUris:(n)=>I(n),scopes:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},Ur=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/device_authorization");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],startUrl:[]})),r.m("POST").h(i).b(l),r.build()},xr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=y({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,refreshToken:h,tokenType:h});return Object.assign(r,l),r},zr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=y({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,issuedTokenType:h,refreshToken:h,scope:I,tokenType:h});return Object.assign(r,l),r},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=y({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:_,clientSecret:h,clientSecretExpiresAt:_,tokenEndpoint:h});return Object.assign(r,l),r},Jr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=y({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{deviceCode:h,expiresIn:b,interval:b,userCode:h,verificationUri:h,verificationUriComplete:h});return Object.assign(r,l),r},Y=async(e,s)=>{const r={...e,body:await w.parseJsonErrorBody(e.body,s)},i=w.loadRestJsonErrorCode(e,r.body);switch(i){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Xr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Yr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Zr(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Hr(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Nr(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await pr(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await gr(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ur(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await es(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await rs(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await ss(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await Or(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await _r(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await Cr(r,s);default:const l=r.body;return Qr({output:e,parsedBody:l,errorCode:i})}},Qr=jr(d),Xr=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new x({$metadata:c(e),...r});return a(n,e.body)},Yr=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new z({$metadata:c(e),...r});return a(n,e.body)},Zr=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new G({$metadata:c(e),...r});return a(n,e.body)},Hr=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new J({$metadata:c(e),...r});return a(n,e.body)},Nr=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new V({$metadata:c(e),...r});return a(n,e.body)},_r=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new Q({$metadata:c(e),...r});return a(n,e.body)},pr=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new W({$metadata:c(e),...r});return a(n,e.body)},Cr=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new X({$metadata:c(e),...r});return a(n,e.body)},gr=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new f({$metadata:c(e),...r});return a(n,e.body)},Or=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{endpoint:h,error:h,error_description:h,region:h});Object.assign(r,l);const n=new L({$metadata:c(e),...r});return a(n,e.body)},ur=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new A({$metadata:c(e),...r});return a(n,e.body)},es=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new K({$metadata:c(e),...r});return a(n,e.body)},rs=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new M({$metadata:c(e),...r});return a(n,e.body)},ss=async(e,s)=>{const r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new B({$metadata:c(e),...r});return a(n,e.body)},c=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var is="aws_iam";class p extends S.classBuilder().ep({...k}).m(function(e,s,r,i){return[v(r,this.serialize,this.deserialize),E(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f($r,Ir).ser(Fr).de(xr).build(){}class C extends S.classBuilder().ep({...k}).m(function(e,s,r,i){return[v(r,this.serialize,this.deserialize),E(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Rr,Pr).ser(Dr).de(zr).build(){}class g extends S.classBuilder().ep({...k}).m(function(e,s,r,i){return[v(r,this.serialize,this.deserialize),E(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,Tr).ser(qr).de(Gr).build(){}class O extends S.classBuilder().ep({...k}).m(function(e,s,r,i){return[v(r,this.serialize,this.deserialize),E(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(br,void 0).ser(Ur).de(Jr).build(){}var ls={CreateTokenCommand:p,CreateTokenWithIAMCommand:C,RegisterClientCommand:g,StartDeviceAuthorizationCommand:O};class Wr extends N{}Vr(ls,Wr);export{vr as __Client,B as UnsupportedGrantTypeException,M as UnauthorizedClientException,br as StartDeviceAuthorizationRequestFilterSensitiveLog,O as StartDeviceAuthorizationCommand,K as SlowDownException,d as SSOOIDCServiceException,N as SSOOIDCClient,Wr as SSOOIDC,Tr as RegisterClientResponseFilterSensitiveLog,g as RegisterClientCommand,A as InvalidScopeException,L as InvalidRequestRegionException,f as InvalidRequestException,X as InvalidRedirectUriException,W as InvalidGrantException,Q as InvalidClientMetadataException,V as InvalidClientException,J as InternalServerException,G as ExpiredTokenException,Pr as CreateTokenWithIAMResponseFilterSensitiveLog,Rr as CreateTokenWithIAMRequestFilterSensitiveLog,C as CreateTokenWithIAMCommand,Ir as CreateTokenResponseFilterSensitiveLog,$r as CreateTokenRequestFilterSensitiveLog,p as CreateTokenCommand,z as AuthorizationPendingException,x as AccessDeniedException,S as $Command};
3
-
4
- //# debugId=03F14695C0FDA57964756E2164756E21
5
- //# sourceMappingURL=chunk-a1sxtbv1.js.map
@@ -1,6 +0,0 @@
1
- import{N as F,O as E}from"./chunk-wmfxrbxe.js";import{ob as D}from"./chunk-5bf9sq7t.js";var Zt=E((di,Vt)=>{function jt(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}function Yt(t){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(t)}var{defineProperty:W,getOwnPropertyDescriptor:gr,getOwnPropertyNames:mr}=Object,xr=Object.prototype.hasOwnProperty,S=(t,e)=>W(t,"name",{value:e,configurable:!0}),br=(t,e)=>{for(var r in e)W(t,r,{get:e[r],enumerable:!0})},Er=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of mr(e))if(!xr.call(t,s)&&s!==r)W(t,s,{get:()=>e[s],enumerable:!(n=gr(e,s))||n.enumerable})}return t},Tr=(t)=>Er(W({},"__esModule",{value:!0}),t),Dt={};br(Dt,{Field:()=>Sr,Fields:()=>Ar,HttpRequest:()=>Ir,HttpResponse:()=>Ur,IHttpRequest:()=>zt.HttpRequest,getHttpHandlerExtensionConfiguration:()=>Cr,isValidHostname:()=>Yt,resolveHttpHandlerRuntimeConfig:()=>$r});Vt.exports=Tr(Dt);var Cr=S((t)=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),$r=S((t)=>{return{httpHandler:t.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),zt=D(),Bt=class t{constructor({name:e,kind:r=zt.FieldPosition.HEADER,values:n=[]}){this.name=e,this.kind=r,this.values=n}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter((r)=>r!==e)}toString(){return this.values.map((e)=>e.includes(",")||e.includes(" ")?`"${e}"`:e).join(", ")}get(){return this.values}};S(Bt,"Field");var Sr=Bt,Wt=class t{constructor({fields:e=[],encoding:r="utf-8"}){this.entries={},e.forEach(this.setField.bind(this)),this.encoding=r}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter((r)=>r.kind===e)}};S(Wt,"Fields");var Ar=Wt,kt=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const r=new t({...e,headers:{...e.headers}});if(r.query)r.query=jt(r.query);return r}static isInstance(e){if(!e)return!1;const r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query==="object"&&typeof r.headers==="object"}clone(){return t.clone(this)}};S(kt,"HttpRequest");var Ir=kt;S(jt,"cloneQuery");var Ot=class t{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const r=e;return typeof r.statusCode==="number"&&typeof r.headers==="object"}};S(Ot,"HttpResponse");var Ur=Ot;S(Yt,"isValidHostname")});var Qt=E((li,Pt)=>{var{defineProperty:k,getOwnPropertyDescriptor:Mr,getOwnPropertyNames:Fr}=Object,Nr=Object.prototype.hasOwnProperty,ot=(t,e)=>k(t,"name",{value:e,configurable:!0}),Lr=(t,e)=>{for(var r in e)k(t,r,{get:e[r],enumerable:!0})},Rr=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of Fr(e))if(!Nr.call(t,s)&&s!==r)k(t,s,{get:()=>e[s],enumerable:!(n=Mr(e,s))||n.enumerable})}return t},Dr=(t)=>Rr(k({},"__esModule",{value:!0}),t),Gt={};Lr(Gt,{escapeUri:()=>Ht,escapeUriPath:()=>Br});Pt.exports=Dr(Gt);var Ht=ot((t)=>encodeURIComponent(t).replace(/[!'()*]/g,zr),"escapeUri"),zr=ot((t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Br=ot((t)=>t.split("/").map(Ht).join("/"),"escapeUriPath")});var vt=E((yi,Jt)=>{function Xt(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=it.escapeUri(r),Array.isArray(n))for(let s=0,o=n.length;s<o;s++)e.push(`${r}=${it.escapeUri(n[s])}`);else{let s=r;if(n||typeof n==="string")s+=`=${it.escapeUri(n)}`;e.push(s)}}return e.join("&")}var{defineProperty:j,getOwnPropertyDescriptor:Wr,getOwnPropertyNames:kr}=Object,jr=Object.prototype.hasOwnProperty,Or=(t,e)=>j(t,"name",{value:e,configurable:!0}),Yr=(t,e)=>{for(var r in e)j(t,r,{get:e[r],enumerable:!0})},Vr=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of kr(e))if(!jr.call(t,s)&&s!==r)j(t,s,{get:()=>e[s],enumerable:!(n=Wr(e,s))||n.enumerable})}return t},Zr=(t)=>Vr(j({},"__esModule",{value:!0}),t),Kt={};Yr(Kt,{buildQueryString:()=>Xt});Jt.exports=Zr(Kt);var it=Qt();Or(Xt,"buildQueryString")});var te=E((pi,_t)=>{var{defineProperty:O,getOwnPropertyDescriptor:Gr,getOwnPropertyNames:Hr}=Object,Pr=Object.prototype.hasOwnProperty,Qr=(t,e)=>O(t,"name",{value:e,configurable:!0}),Kr=(t,e)=>{for(var r in e)O(t,r,{get:e[r],enumerable:!0})},Xr=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of Hr(e))if(!Pr.call(t,s)&&s!==r)O(t,s,{get:()=>e[s],enumerable:!(n=Gr(e,s))||n.enumerable})}return t},Jr=(t)=>Xr(O({},"__esModule",{value:!0}),t),qt={};Kr(qt,{isArrayBuffer:()=>vr});_t.exports=Jr(qt);var vr=Qr((t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]","isArrayBuffer")});var V=E((wi,ne)=>{var{defineProperty:Y,getOwnPropertyDescriptor:qr,getOwnPropertyNames:_r}=Object,tn=Object.prototype.hasOwnProperty,ee=(t,e)=>Y(t,"name",{value:e,configurable:!0}),en=(t,e)=>{for(var r in e)Y(t,r,{get:e[r],enumerable:!0})},rn=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of _r(e))if(!tn.call(t,s)&&s!==r)Y(t,s,{get:()=>e[s],enumerable:!(n=qr(e,s))||n.enumerable})}return t},nn=(t)=>rn(Y({},"__esModule",{value:!0}),t),re={};en(re,{fromArrayBuffer:()=>on,fromString:()=>cn});ne.exports=nn(re);var sn=te(),ct=import.meta.require("buffer"),on=ee((t,e=0,r=t.byteLength-e)=>{if(!sn.isArrayBuffer(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return ct.Buffer.from(t,e,r)},"fromArrayBuffer"),cn=ee((t,e)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?ct.Buffer.from(t,e):ct.Buffer.from(t)},"fromString")});var ie=E((se)=>{Object.defineProperty(se,"__esModule",{value:!0});se.fromBase64=void 0;var fn=V(),an=/^[A-Za-z0-9+/]*={0,2}$/,un=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!an.exec(t))throw new TypeError("Invalid base64 string.");const e=fn.fromString(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};se.fromBase64=un});var he=E((mi,ue)=>{var{defineProperty:Z,getOwnPropertyDescriptor:hn,getOwnPropertyNames:dn}=Object,ln=Object.prototype.hasOwnProperty,ft=(t,e)=>Z(t,"name",{value:e,configurable:!0}),yn=(t,e)=>{for(var r in e)Z(t,r,{get:e[r],enumerable:!0})},pn=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of dn(e))if(!ln.call(t,s)&&s!==r)Z(t,s,{get:()=>e[s],enumerable:!(n=hn(e,s))||n.enumerable})}return t},wn=(t)=>pn(Z({},"__esModule",{value:!0}),t),ce={};yn(ce,{fromUtf8:()=>ae,toUint8Array:()=>gn,toUtf8:()=>mn});ue.exports=wn(ce);var fe=V(),ae=ft((t)=>{const e=fe.fromString(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),gn=ft((t)=>{if(typeof t==="string")return ae(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)},"toUint8Array"),mn=ft((t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return fe.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},"toUtf8")});var ye=E((de)=>{Object.defineProperty(de,"__esModule",{value:!0});de.toBase64=void 0;var xn=V(),bn=he(),En=(t)=>{let e;if(typeof t==="string")e=bn.fromUtf8(t);else e=t;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return xn.fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength).toString("base64")};de.toBase64=En});var ge=E((bi,G)=>{var{defineProperty:pe,getOwnPropertyDescriptor:Tn,getOwnPropertyNames:Cn}=Object,$n=Object.prototype.hasOwnProperty,at=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of Cn(e))if(!$n.call(t,s)&&s!==r)pe(t,s,{get:()=>e[s],enumerable:!(n=Tn(e,s))||n.enumerable})}return t},we=(t,e,r)=>(at(t,e,"default"),r&&at(r,e,"default")),Sn=(t)=>at(pe({},"__esModule",{value:!0}),t),ut={};G.exports=Sn(ut);we(ut,ie(),G.exports);we(ut,ye(),G.exports)});var Ae=E((Ei,Se)=>{function be(t=0){return new Promise((e,r)=>{if(t)setTimeout(()=>{const n=new Error(`Request did not complete within ${t} ms`);n.name="TimeoutError",r(n)},t)})}async function Te(t){const e=await $e(t),r=Dn.fromBase64(e);return new Uint8Array(r)}async function Ce(t){const e=[],r=t.getReader();let n=!1,s=0;while(!n){const{done:a,value:y}=await r.read();if(y)e.push(y),s+=y.length;n=a}const o=new Uint8Array(s);let u=0;for(let a of e)o.set(a,u),u+=a.length;return o}function $e(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const s=n.result??"",o=s.indexOf(","),u=o>-1?o+1:s.length;e(s.substring(u))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}var{defineProperty:P,getOwnPropertyDescriptor:An,getOwnPropertyNames:In}=Object,Un=Object.prototype.hasOwnProperty,C=(t,e)=>P(t,"name",{value:e,configurable:!0}),Mn=(t,e)=>{for(var r in e)P(t,r,{get:e[r],enumerable:!0})},Fn=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of In(e))if(!Un.call(t,s)&&s!==r)P(t,s,{get:()=>e[s],enumerable:!(n=An(e,s))||n.enumerable})}return t},Nn=(t)=>Fn(P({},"__esModule",{value:!0}),t),xe={};Mn(xe,{FetchHttpHandler:()=>Rn,keepAliveSupport:()=>H,streamCollector:()=>zn});Se.exports=Nn(xe);var me=Zt(),Ln=vt();C(be,"requestTimeout");var H={supported:void 0},Ee=class t{static create(e){if(typeof(e==null?void 0:e.handle)==="function")return e;return new t(e)}constructor(e){if(typeof e==="function")this.configProvider=e().then((r)=>r||{});else this.config=e??{},this.configProvider=Promise.resolve(this.config);if(H.supported===void 0)H.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(e,{abortSignal:r}={}){if(!this.config)this.config=await this.configProvider;const n=this.config.requestTimeout,s=this.config.keepAlive===!0,o=this.config.credentials;if(r==null?void 0:r.aborted){const i=new Error("Request aborted");return i.name="AbortError",Promise.reject(i)}let u=e.path;const a=Ln.buildQueryString(e.query||{});if(a)u+=`?${a}`;if(e.fragment)u+=`#${e.fragment}`;let y="";if(e.username!=null||e.password!=null){const i=e.username??"",l=e.password??"";y=`${i}:${l}@`}const{port:g,method:x}=e,c=`${e.protocol}//${y}${e.hostname}${g?`:${g}`:""}${u}`,f=x==="GET"||x==="HEAD"?void 0:e.body,h={body:f,headers:new Headers(e.headers),method:x,credentials:o};if(f)h.duplex="half";if(typeof AbortController!=="undefined")h.signal=r;if(H.supported)h.keepalive=s;let w=C(()=>{},"removeSignalEventListener");const p=new Request(c,h),d=[fetch(p).then((i)=>{const l=i.headers,b={};for(let T of l.entries())b[T[0]]=T[1];if(i.body==null)return i.blob().then((T)=>({response:new me.HttpResponse({headers:b,reason:i.statusText,statusCode:i.status,body:T})}));return{response:new me.HttpResponse({headers:b,reason:i.statusText,statusCode:i.status,body:i.body})}}),be(n)];if(r)d.push(new Promise((i,l)=>{const b=C(()=>{const m=new Error("Request aborted");m.name="AbortError",l(m)},"onAbort");if(typeof r.addEventListener==="function"){const m=r;m.addEventListener("abort",b,{once:!0}),w=C(()=>m.removeEventListener("abort",b),"removeSignalEventListener")}else r.onabort=b}));return Promise.race(d).finally(w)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then((n)=>{return n[e]=r,n})}httpHandlerConfigs(){return this.config??{}}};C(Ee,"FetchHttpHandler");var Rn=Ee,Dn=ge(),zn=C((t)=>{if(typeof Blob==="function"&&t instanceof Blob)return Te(t);return Ce(t)},"streamCollector");C(Te,"collectBlob");C(Ce,"collectStream");C($e,"readToBase64")});var Re=E((Ti,Le)=>{function Fe(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2){const n=t.slice(r,r+2).toLowerCase();if(n in ht)e[r/2]=ht[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function Ne(t){let e="";for(let r=0;r<t.byteLength;r++)e+=Me[t[r]];return e}var{defineProperty:Q,getOwnPropertyDescriptor:Bn,getOwnPropertyNames:Wn}=Object,kn=Object.prototype.hasOwnProperty,Ie=(t,e)=>Q(t,"name",{value:e,configurable:!0}),jn=(t,e)=>{for(var r in e)Q(t,r,{get:e[r],enumerable:!0})},On=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of Wn(e))if(!kn.call(t,s)&&s!==r)Q(t,s,{get:()=>e[s],enumerable:!(n=Bn(e,s))||n.enumerable})}return t},Yn=(t)=>On(Q({},"__esModule",{value:!0}),t),Ue={};jn(Ue,{fromHex:()=>Fe,toHex:()=>Ne});Le.exports=Yn(Ue);var Me={},ht={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();if(e.length===1)e=`0${e}`;Me[t]=e,ht[e]=t}Ie(Fe,"fromHex");Ie(Ne,"toHex")});var A=(t,e)=>{const r=[];if(t)r.push(t);if(e)for(let n of e)r.push(n);return r},$=(t,e)=>{return`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`},U=()=>{let t=[],e=[],r=!1;const n=new Set,s=(c)=>c.sort((f,h)=>mt[h.step]-mt[f.step]||xt[h.priority||"normal"]-xt[f.priority||"normal"]),o=(c)=>{let f=!1;const h=(w)=>{const p=A(w.name,w.aliases);if(p.includes(c)){f=!0;for(let d of p)n.delete(d);return!1}return!0};return t=t.filter(h),e=e.filter(h),f},u=(c)=>{let f=!1;const h=(w)=>{if(w.middleware===c){f=!0;for(let p of A(w.name,w.aliases))n.delete(p);return!1}return!0};return t=t.filter(h),e=e.filter(h),f},a=(c)=>{return t.forEach((f)=>{c.add(f.middleware,{...f})}),e.forEach((f)=>{c.addRelativeTo(f.middleware,{...f})}),c.identifyOnResolve?.(x.identifyOnResolve()),c},y=(c)=>{const f=[];return c.before.forEach((h)=>{if(h.before.length===0&&h.after.length===0)f.push(h);else f.push(...y(h))}),f.push(c),c.after.reverse().forEach((h)=>{if(h.before.length===0&&h.after.length===0)f.push(h);else f.push(...y(h))}),f},g=(c=!1)=>{const f=[],h=[],w={};return t.forEach((d)=>{const i={...d,before:[],after:[]};for(let l of A(i.name,i.aliases))w[l]=i;f.push(i)}),e.forEach((d)=>{const i={...d,before:[],after:[]};for(let l of A(i.name,i.aliases))w[l]=i;h.push(i)}),h.forEach((d)=>{if(d.toMiddleware){const i=w[d.toMiddleware];if(i===void 0){if(c)return;throw new Error(`${d.toMiddleware} is not found when adding ${$(d.name,d.aliases)} middleware ${d.relation} ${d.toMiddleware}`)}if(d.relation==="after")i.after.push(d);if(d.relation==="before")i.before.push(d)}}),s(f).map(y).reduce((d,i)=>{return d.push(...i),d},[])},x={add:(c,f={})=>{const{name:h,override:w,aliases:p}=f,d={step:"initialize",priority:"normal",middleware:c,...f},i=A(h,p);if(i.length>0){if(i.some((l)=>n.has(l))){if(!w)throw new Error(`Duplicate middleware name '${$(h,p)}'`);for(let l of i){const b=t.findIndex((T)=>T.name===l||T.aliases?.some((X)=>X===l));if(b===-1)continue;const m=t[b];if(m.step!==d.step||d.priority!==m.priority)throw new Error(`"${$(m.name,m.aliases)}" middleware with ${m.priority} priority in ${m.step} step cannot be overridden by "${$(h,p)}" middleware with ${d.priority} priority in ${d.step} step.`);t.splice(b,1)}}for(let l of i)n.add(l)}t.push(d)},addRelativeTo:(c,f)=>{const{name:h,override:w,aliases:p}=f,d={middleware:c,...f},i=A(h,p);if(i.length>0){if(i.some((l)=>n.has(l))){if(!w)throw new Error(`Duplicate middleware name '${$(h,p)}'`);for(let l of i){const b=e.findIndex((T)=>T.name===l||T.aliases?.some((X)=>X===l));if(b===-1)continue;const m=e[b];if(m.toMiddleware!==d.toMiddleware||m.relation!==d.relation)throw new Error(`"${$(m.name,m.aliases)}" middleware ${m.relation} "${m.toMiddleware}" middleware cannot be overridden by "${$(h,p)}" middleware ${d.relation} "${d.toMiddleware}" middleware.`);e.splice(b,1)}}for(let l of i)n.add(l)}e.push(d)},clone:()=>a(U()),use:(c)=>{c.applyToStack(x)},remove:(c)=>{if(typeof c==="string")return o(c);else return u(c)},removeByTag:(c)=>{let f=!1;const h=(w)=>{const{tags:p,name:d,aliases:i}=w;if(p&&p.includes(c)){const l=A(d,i);for(let b of l)n.delete(b);return f=!0,!1}return!0};return t=t.filter(h),e=e.filter(h),f},concat:(c)=>{const f=a(U());return f.use(c),f.identifyOnResolve(r||f.identifyOnResolve()||(c.identifyOnResolve?.()??!1)),f},applyToStack:a,identify:()=>{return g(!0).map((c)=>{const f=c.step??c.relation+" "+c.toMiddleware;return $(c.name,c.aliases)+" - "+f})},identifyOnResolve(c){if(typeof c==="boolean")r=c;return r},resolve:(c,f)=>{for(let h of g().map((w)=>w.middleware).reverse())c=h(c,f);if(r)console.log(x.identify());return c}};return x},mt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},xt={high:3,normal:2,low:1};class rr{constructor(t){this.middlewareStack=U(),this.config=t}send(t,e,r){const n=typeof e!=="function"?e:void 0,s=typeof e==="function"?e:r,o=t.resolveMiddleware(this.middlewareStack,this.config,n);if(s)o(t).then((u)=>s(null,u.output),(u)=>s(u)).catch(()=>{});else return o(t).then((u)=>u.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}}var bt=F(D(),1);class Et{constructor(){this.middlewareStack=U()}static classBuilder(){return new Tt}resolveMiddlewareWithContext(t,e,r,{middlewareFn:n,clientName:s,commandName:o,inputFilterSensitiveLog:u,outputFilterSensitiveLog:a,smithyContext:y,additionalContext:g,CommandCtor:x}){for(let p of n.bind(this)(x,t,e,r))this.middlewareStack.use(p);const c=t.concat(this.middlewareStack),{logger:f}=e,h={logger:f,clientName:s,commandName:o,inputFilterSensitiveLog:u,outputFilterSensitiveLog:a,[bt.SMITHY_CONTEXT_KEY]:{commandInstance:this,...y},...g},{requestHandler:w}=e;return c.resolve((p)=>w.handle(p.request,r||{}),h)}}class Tt{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(t)=>t,this._outputFilterSensitiveLog=(t)=>t,this._serializer=null,this._deserializer=null}init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,e,r={}){return this._smithyContext={service:t,operation:e,...r},this}c(t={}){return this._additionalContext=t,this}n(t,e){return this._clientName=t,this._commandName=e,this}f(t=(r)=>r,e=(r)=>r){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=e,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){const t=this;let e;return e=class extends Et{static getEndpointParameterInstructions(){return t._ep}constructor(...[r]){super();this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=r??{},t._init(this)}resolveMiddleware(r,n,s){return this.resolveMiddlewareWithContext(r,n,s,{CommandCtor:e,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}var gs=(t)=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},ms=(t)=>{return{httpHandler:t.httpHandler()}};var nr=F(D(),1);function sr(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}class J{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const e=new J({...t,headers:{...t.headers}});if(e.query)e.query=sr(e.query);return e}static isInstance(t){if(!t)return!1;const e=t;return"method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&typeof e.query==="object"&&typeof e.headers==="object"}clone(){return J.clone(this)}}class z{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const e=t;return typeof e.statusCode==="number"&&typeof e.headers==="object"}}var N=(t)=>encodeURIComponent(t).replace(/[!'()*]/g,or),or=(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function v(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=N(r),Array.isArray(n))for(let s=0,o=n.length;s<o;s++)e.push(`${r}=${N(n[s])}`);else{let s=r;if(n||typeof n==="string")s+=`=${N(n)}`;e.push(s)}}return e.join("&")}import{Agent as Ut,request as fr}from"http";import{Agent as Mt,request as ar}from"https";var Ct=["ECONNRESET","EPIPE","ETIMEDOUT"];var q=(t)=>{const e={};for(let r of Object.keys(t)){const n=t[r];e[r]=Array.isArray(n)?n.join(","):n}return e};var $t=(t,e,r=0)=>{if(!r)return;const n=setTimeout(()=>{t.destroy(),e(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r);t.on("socket",(s)=>{if(s.connecting)s.on("connect",()=>{clearTimeout(n)});else clearTimeout(n)})};var St=(t,{keepAlive:e,keepAliveMsecs:r})=>{if(e!==!0)return;t.on("socket",(n)=>{n.setKeepAlive(e,r||0)})};var At=(t,e,r=0)=>{t.setTimeout(r,()=>{t.destroy(),e(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))})};import{Readable as ir}from"stream";async function _(t,e,r=It){const n=e.headers??{},s=n.Expect||n.expect;let o=-1,u=!1;if(s==="100-continue")await Promise.race([new Promise((a)=>{o=Number(setTimeout(a,Math.max(It,r)))}),new Promise((a)=>{t.on("continue",()=>{clearTimeout(o),a()}),t.on("error",()=>{u=!0,clearTimeout(o),a()})})]);if(!u)cr(t,e.body)}function cr(t,e){if(e instanceof ir){e.pipe(t);return}if(e){if(Buffer.isBuffer(e)||typeof e==="string"){t.end(e);return}const r=e;if(typeof r==="object"&&r.buffer&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number"){t.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}t.end(Buffer.from(e));return}t.end()}var It=1000;class tt{static create(t){if(typeof t?.handle==="function")return t;return new tt(t)}static checkSocketUsage(t,e,r=console){const{sockets:n,requests:s,maxSockets:o}=t;if(typeof o!=="number"||o===1/0)return e;const u=15000;if(Date.now()-u<e)return e;if(n&&s)for(let a in n){const y=n[a]?.length??0,g=s[a]?.length??0;if(y>=o&&g>=2*o)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${y} and ${g} additional requests are enqueued.
2
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return e}constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((e,r)=>{if(typeof t==="function")t().then((n)=>{e(this.resolveDefaultConfig(n))}).catch(r);else e(this.resolveDefaultConfig(t))})}resolveDefaultConfig(t){const{requestTimeout:e,connectionTimeout:r,socketTimeout:n,httpAgent:s,httpsAgent:o}=t||{};return{connectionTimeout:r,requestTimeout:e??n,httpAgent:(()=>{if(s instanceof Ut||typeof s?.destroy==="function")return s;return new Ut({keepAlive:!0,maxSockets:50,...s})})(),httpsAgent:(()=>{if(o instanceof Mt||typeof o?.destroy==="function")return o;return new Mt({keepAlive:!0,maxSockets:50,...o})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:e}={}){if(!this.config)this.config=await this.configProvider;let r;return new Promise((n,s)=>{let o=void 0;const u=async(i)=>{await o,clearTimeout(r),n(i)},a=async(i)=>{await o,clearTimeout(r),s(i)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(e?.aborted){const i=new Error("Request aborted");i.name="AbortError",a(i);return}const y=t.protocol==="https:",g=y?this.config.httpsAgent:this.config.httpAgent;r=setTimeout(()=>{this.socketWarningTimestamp=tt.checkSocketUsage(g,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const x=v(t.query||{});let c=void 0;if(t.username!=null||t.password!=null){const i=t.username??"",l=t.password??"";c=`${i}:${l}`}let f=t.path;if(x)f+=`?${x}`;if(t.fragment)f+=`#${t.fragment}`;const h={headers:t.headers,host:t.hostname,method:t.method,path:f,port:t.port,agent:g,auth:c},p=(y?ar:fr)(h,(i)=>{const l=new z({statusCode:i.statusCode||-1,reason:i.statusMessage,headers:q(i.headers),body:i});u({response:l})});if(p.on("error",(i)=>{if(Ct.includes(i.code))a(Object.assign(i,{name:"TimeoutError"}));else a(i)}),$t(p,a,this.config.connectionTimeout),At(p,a,this.config.requestTimeout),e){const i=()=>{p.destroy();const l=new Error("Request aborted");l.name="AbortError",a(l)};if(typeof e.addEventListener==="function"){const l=e;l.addEventListener("abort",i,{once:!0}),p.once("close",()=>l.removeEventListener("abort",i))}else e.onabort=i}const d=h.agent;if(typeof d==="object"&&"keepAlive"in d)St(p,{keepAlive:d.keepAlive,keepAliveMsecs:d.keepAliveMsecs});o=_(p,t,this.config.requestTimeout).catch((i)=>{return clearTimeout(r),s(i)})})}updateHttpClientConfig(t,e){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[t]:e}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as ur}from"stream";class et extends ur{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,e,r){this.bufferedBytes.push(t),r()}}async function dr(t){const e=[],r=t.getReader();let n=!1,s=0;while(!n){const{done:a,value:y}=await r.read();if(y)e.push(y),s+=y.length;n=a}const o=new Uint8Array(s);let u=0;for(let a of e)o.set(a,u),u+=a.length;return o}var Ft=(t)=>{if(hr(t))return dr(t);return new Promise((e,r)=>{const n=new et;t.pipe(n),t.on("error",(s)=>{n.end(),r(s)}),n.on("error",r),n.on("finish",function(){const s=new Uint8Array(Buffer.concat(this.bufferedBytes));e(s)})})},hr=(t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream;var Uo="***SensitiveInformation***";var Fo=(t,e)=>{for(let r of Object.keys(t)){const n=t[r],s=async function(u,a,y){const g=new n(u);if(typeof a==="function")this.send(g,a);else if(typeof y==="function"){if(typeof a!=="object")throw new Error(`Expected http options but got ${typeof a}`);this.send(g,a||{},y)}else return this.send(g,a)},o=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");e.prototype[o]=s}};class Nt extends Error{constructor(t){super(t.message);Object.setPrototypeOf(this,Nt.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}var Lt=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,s])=>{if(t[n]==null||t[n]==="")t[n]=s});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t};class lr{trace(){}debug(){}info(){}warn(){}error(){}}var Rt=(t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]";import{Buffer as rt}from"buffer";var M=(t,e=0,r=t.byteLength-e)=>{if(!Rt(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return rt.from(t,e,r)},B=(t,e)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?rt.from(t,e):rt.from(t)};var yr=/^[A-Za-z0-9+/]*={0,2}$/,pr=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!yr.exec(t))throw new TypeError("Invalid base64 string.");const e=B(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};var L=(t)=>{const e=B(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var Zo=(t)=>{if(typeof t==="string")return L(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)};var nt=(t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return M(t.buffer,t.byteOffset,t.byteLength).toString("utf8")};var st=(t)=>{let e;if(typeof t==="string")e=L(t);else e=t;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return M(e.buffer,e.byteOffset,e.byteLength).toString("base64")};import{Readable as dt}from"stream";import{TextDecoder as Vn}from"util";var Be=F(Ae(),1);var We=F(Re(),1);var R=(t)=>typeof ReadableStream==="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream);var De="The stream has already been transformed.",ke=(t)=>{if(!ze(t)&&!R(t)){const s=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${s}`)}let e=!1;const r=async()=>{if(e)throw new Error(De);return e=!0,await Be.streamCollector(t)},n=(s)=>{if(typeof s.stream!=="function")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 s.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async(s)=>{const o=await r();if(s==="base64")return st(o);else if(s==="hex")return We.toHex(o);else if(s===void 0||s==="utf8"||s==="utf-8")return nt(o);else if(typeof TextDecoder==="function")return new TextDecoder(s).decode(o);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(De);if(e=!0,ze(t))return n(t);else if(R(t))return t;else throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},ze=(t)=>typeof Blob==="function"&&t instanceof Blob;var je="The stream has already been transformed.",Ri=(t)=>{if(!(t instanceof dt))try{return ke(t)}catch(n){const s=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${s}`)}let e=!1;const r=async()=>{if(e)throw new Error(je);return e=!0,await Ft(t)};return Object.assign(t,{transformToByteArray:r,transformToString:async(n)=>{const s=await r();if(n===void 0||Buffer.isEncoding(n))return M(s.buffer,s.byteOffset,s.byteLength).toString(n);else return new Vn(n).decode(s)},transformToWebStream:()=>{if(e)throw new Error(je);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof dt.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return e=!0,dt.toWeb(t)}})};var Zn=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){const e=parseFloat(t);if(!Number.isNaN(e)){if(String(e)!==String(t))Qe.warn(Pe(`Expected number but observed string: ${t}`));return e}}if(typeof t==="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)},Gn=Math.ceil(340282346638528860000000000000000000000),Oe=(t)=>{const e=Zn(t);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0){if(Math.abs(e)>Gn)throw new TypeError(`Expected 32-bit float, got ${t}`)}return e},Hn=(t)=>{if(t===null||t===void 0)return;if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)};var Ye=(t)=>lt(t,32),Ve=(t)=>lt(t,16),Ze=(t)=>lt(t,8),lt=(t,e)=>{const r=Hn(t);if(r!==void 0&&Pn(r,e)!==r)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return r},Pn=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},tc=(t,e)=>{if(t===null||t===void 0){if(e)throw new TypeError(`Expected a non-null value for ${e}`);throw new TypeError("Expected a non-null value")}return t},ec=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;const e=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${e}: ${t}`)},rc=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return Qe.warn(Pe(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)};var Ge=(t)=>{if(typeof t=="string")return Oe(K(t));return Oe(t)},Qn=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,K=(t)=>{const e=t.match(Qn);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var nc=(t)=>{if(typeof t==="string")return Ye(K(t));return Ye(t)},yt=(t)=>{if(typeof t==="string")return Ve(K(t));return Ve(t)},He=(t)=>{if(typeof t==="string")return Ze(K(t));return Ze(t)},Pe=(t)=>{return String(new TypeError(t).stack||t).split("\n").slice(0,5).filter((e)=>!e.includes("stackTraceWarning")).join("\n")},Qe={warn:console.warn};var Kn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Xn=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),cc=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=Xn.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,s,o,u,a,y,g]=e,x=yt(pt(n)),c=I(s,"month",1,12),f=I(o,"day",1,31);return Ke(x,c,f,{hours:u,minutes:a,seconds:y,fractionalMilliseconds:g})},Jn=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),fc=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=Jn.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,s,o,u,a,y,g,x]=e,c=yt(pt(n)),f=I(s,"month",1,12),h=I(o,"day",1,31),w=Ke(c,f,h,{hours:u,minutes:a,seconds:y,fractionalMilliseconds:g});if(x.toUpperCase()!="Z")w.setTime(w.getTime()-es(x));return w},ac=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),uc=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),hc=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);var Ke=(t,e,r,n)=>{const s=e-1;return qn(t,s,r),new Date(Date.UTC(t,s,r,I(n.hours,"hour",0,23),I(n.minutes,"minute",0,59),I(n.seconds,"seconds",0,60),ts(n.fractionalMilliseconds)))};var vn=[31,28,31,30,31,30,31,31,30,31,30,31],qn=(t,e,r)=>{let n=vn[e];if(e===1&&_n(t))n=29;if(r>n)throw new TypeError(`Invalid day for ${Kn[e]} in ${t}: ${r}`)},_n=(t)=>{return t%4===0&&(t%100!==0||t%400===0)},I=(t,e,r,n)=>{const s=He(pt(t));if(s<r||s>n)throw new TypeError(`${e} must be between ${r} and ${n}, inclusive`);return s},ts=(t)=>{if(t===null||t===void 0)return 0;return Ge("0."+t)*1000},es=(t)=>{const e=t[0];let r=1;if(e=="+")r=1;else if(e=="-")r=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(t.substring(1,3)),s=Number(t.substring(4,6));return r*(n*60+s)*60*1000},pt=(t)=>{let e=0;while(e<t.length-1&&t.charAt(e)==="0")e++;if(e===0)return t;return t.slice(e)};var rs=({output:t,parsedBody:e,exceptionCtor:r,errorCode:n})=>{const s=ns(t),o=s.httpStatusCode?s.httpStatusCode+"":void 0,u=new r({name:e?.code||e?.Code||n||o||"UnknownError",$fault:"client",$metadata:s});throw Lt(u,e)},yc=(t)=>{return({output:e,parsedBody:r,errorCode:n})=>{rs({output:e,parsedBody:r,exceptionCtor:t,errorCode:n})}},ns=(t)=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]});var wc=(t)=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var Xe=!1,mc=(t)=>{if(t&&!Xe&&parseInt(t.substring(1,t.indexOf(".")))<16)Xe=!0};var wt=F(D(),1);var Je=(t)=>{const e=[];for(let r in wt.AlgorithmId){const n=wt.AlgorithmId[r];if(t[n]===void 0)continue;e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},ve=(t)=>{const e={};return t.checksumAlgorithms().forEach((r)=>{e[r.algorithmId()]=r.checksumConstructor()}),e};var qe=(t)=>{let e=t.retryStrategy;return{setRetryStrategy(r){e=r},retryStrategy(){return e}}},_e=(t)=>{const e={};return e.retryStrategy=t.retryStrategy(),e};var $c=(t)=>{return{...Je(t),...qe(t)}};var Sc=(t)=>{return{...ve(t),..._e(t)}};function ss(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}var Fc=(t)=>Array.isArray(t)?t:[t];var gt=function(){const t=Object.getPrototypeOf(this).constructor,r=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(r,t.prototype),r};gt.prototype=Object.create(String.prototype,{constructor:{value:gt,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(gt,String);function os(t,e,r){let n,s,o;if(typeof e==="undefined"&&typeof r==="undefined")n={},o=t;else if(n=t,typeof e==="function")return s=e,o=r,is(n,s,o);else o=e;for(let u of Object.keys(o)){if(!Array.isArray(o[u])){n[u]=o[u];continue}tr(n,null,o,u)}return n}var Dc=(t,e)=>{const r={};for(let n in e)tr(r,t,e,n);return r},is=(t,e,r)=>{return os(t,Object.entries(r).reduce((n,[s,o])=>{if(Array.isArray(o))n[s]=o;else if(typeof o==="function")n[s]=[e,o()];else n[s]=[e,o];return n},{}))},tr=(t,e,r,n)=>{if(e!==null){let u=r[n];if(typeof u==="function")u=[,u];const[a=cs,y=fs,g=n]=u;if(typeof a==="function"&&a(e[g])||typeof a!=="function"&&!!a)t[n]=y(e[g]);return}let[s,o]=r[n];if(typeof o==="function"){let u;const a=s===void 0&&(u=o())!=null,y=typeof s==="function"&&!!s(void 0)||typeof s!=="function"&&!!s;if(a)t[n]=u;else if(y)t[n]=o()}else{const u=s===void 0&&o!=null,a=typeof s==="function"&&!!s(o)||typeof s!=="function"&&!!s;if(u||a)t[n]=o}},cs=(t)=>t!=null,fs=(t)=>t;var er=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((e)=>e!=null).map(er);if(typeof t==="object"){const e={};for(let r of Object.keys(t)){if(t[r]==null)continue;e[r]=er(t[r])}return e}return t};export{gs as P,ms as Q,J as R,z as S,Zt as T,te as U,V,he as W,ge as X,Qt as Y,vt as Z,Ae as _,Re as $,lr as aa,rr as ba,M as ca,B as da,pr as ea,L as fa,Zo as ga,nt as ha,st as ia,tt as ja,Ft as ka,Ri as la,Et as ma,Uo as na,Fo as oa,Hn as pa,Ye as qa,tc as ra,ec as sa,rc as ta,nc as ua,cc as va,fc as wa,Nt as xa,Lt as ya,yc as za,wc as Aa,mc as Ba,$c as Ca,Sc as Da,ss as Ea,Fc as Fa,os as Ga,Dc as Ha,er as Ia};
4
-
5
- //# debugId=55372DBB1F0A888064756E2164756E21
6
- //# sourceMappingURL=chunk-a6jhzhht.js.map
@@ -1,5 +0,0 @@
1
- // @bun
2
- import{N as i}from"./chunk-wmfxrbxe.js";import{Aa as xe,Ba as ve,Ca as $e,Da as Pe,Ga as c,Ha as y,Ia as ge,P as Fe,Q as _e,aa as se,ba as je,ea as te,fa as re,ha as ae,ia as ne,ja as we,ka as be,ma as ns,na as k,ra as z,sa as Ne,ta as h,xa as Oe,ya as u,za as fe}from"./chunk-a6jhzhht.js";import{$a as rs,Ja as Le,Ka as Ce,La as Me,Ma as We,Na as Ae,Oa as V,Pa as N,Qa as f,Ra as Ke,Sa as ie,Ta as le,Ua as _,Va as $,Wa as pe,Xa as ye,Ya as Qe,Za as B,_a as Xe,ab as as,bb as Ye,cb as me,db as he,eb as Ze,fb as ue,gb as Te,hb as x,ib as ke,jb as Re,kb as qe,lb as Ee,mb as Je,nb as Ue}from"./chunk-v1w6bgfy.js";import"./chunk-5bf9sq7t.js";import{pb as l,qb as ee}from"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import"./chunk-59vbpar7.js";var p=i(B(),1);var P=i(x(),1);function ls(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(s,t)=>({signingProperties:{config:s,context:t}})}}function b(e){return{schemeId:"smithy.api#noAuth"}}var J=async(e,s,t)=>{return{operation:_(s).operation,region:await $(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},U=(e)=>{const s=[];switch(e.operation){case"GetRoleCredentials":{s.push(b(e));break}case"ListAccountRoles":{s.push(b(e));break}case"ListAccounts":{s.push(b(e));break}case"Logout":{s.push(b(e));break}default:s.push(ls(e))}return s},I=(e)=>{return{...P.resolveAwsSdkSigV4Config(e)}};var L=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},C={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var M={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.637.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.635.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.637.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.637.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.4.0","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.15","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.2.0","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.15","@smithy/util-defaults-mode-node":"^3.0.15","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}};var Se=i(x(),1);var de=i(x(),1),oe=i(B(),1);var W={["required"]:!1,type:"String"},A={["required"]:!0,default:!1,type:"Boolean"},K={["ref"]:"Endpoint"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},H={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},d={},Q={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},O={["ref"]:"PartitionResult"},X={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[O,"supportsDualStack"]}]},Y=[T],Z=[H],j=[{["ref"]:"Region"}],ys={version:"1.0",parameters:{Region:W,UseDualStack:A,UseFIPS:A,Endpoint:W},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[K]}],rules:[{conditions:Y,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:Z,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:K,properties:d,headers:d},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:j}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:j,assign:"PartitionResult"}],rules:[{conditions:[T,H],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Q]},X],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:Y,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Q,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[O,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:d,headers:d},type:"endpoint"},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:Z,rules:[{conditions:[X],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},G=ys;var g=(e,s={})=>{return N(G,{endpointParams:e,logger:s.logger})};V.aws=f;var ce=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??te,base64Encoder:e?.base64Encoder??ne,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??g,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??U,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new de.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new oe.NoAuthSigner}],logger:e?.logger??new se,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??ee,utf8Decoder:e?.utf8Decoder??re,utf8Encoder:e?.utf8Encoder??ae}};var ze=(e)=>{ve(process.version);const s=Ee(e),t=()=>s().then(xe),r=ce(e);return Se.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??qe,defaultUserAgentProvider:e?.defaultUserAgentProvider??ke({serviceId:r.serviceId,clientVersion:M.version}),maxAttempts:e?.maxAttempts??l(he),region:e?.region??l(pe,ye),requestHandler:we.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...ue,default:async()=>(await t()).retryMode||me}),sha256:e?.sha256??Re.bind(null,"sha256"),streamCollector:e?.streamCollector??be,useDualstackEndpoint:e?.useDualstackEndpoint??l(ie),useFipsEndpoint:e?.useFipsEndpoint??l(le)}};var De=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){const n=s.findIndex((D)=>D.schemeId===a.schemeId);if(n===-1)s.push(a);else s.splice(n,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){t=a},httpAuthSchemeProvider(){return t},setCredentials(a){r=a},credentials(){return r}}},Be=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var v=(e)=>e,Ie=(e,s)=>{const t={...v(Je(e)),...v($e(e)),...v(Fe(e)),...v(De(e))};return s.forEach((r)=>r.configure(t)),{...e,...Ue(t),...Pe(t),..._e(t),...Be(t)}};class He extends je{constructor(...[e]){const s=ze(e||{}),t=L(s),r=Ae(t),a=Ze(r),n=Qe(a),D=Le(n),os=Ye(D),cs=I(os),F=Ie(cs,e?.extensions||[]);super(F);this.config=F,this.middlewareStack.use(Ke(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Xe(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:J,identityProviderConfigProvider:async(is)=>new p.DefaultIdentityProviderConfig({"aws.auth#sigv4":is.credentials})})),this.middlewareStack.use(p.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class o extends Oe{constructor(e){super(e);Object.setPrototypeOf(this,o.prototype)}}class R extends o{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,R.prototype)}}class q extends o{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,q.prototype)}}class E extends o{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,E.prototype)}}class S extends o{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}var Ge=(e)=>({...e,...e.accessToken&&{accessToken:k}}),ms=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:k},...e.sessionToken&&{sessionToken:k}}),Ve=(e)=>({...e,...e.roleCredentials&&{roleCredentials:ms(e.roleCredentials)}});var m=i(x(),1),es=i(B(),1);var ss=async(e,s)=>{const t=es.requestBuilder(e,s),r=c({},ks,{[Ds]:e[qs]});t.bp("/federation/credentials");const a=c({[zs]:[,z(e[Ss],"roleName")],[Es]:[,z(e[Rs],"accountId")]});let n;return t.m("GET").h(r).q(a).b(n),t.build()};var ts=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return hs(e,s);const t=c({$metadata:w(e)}),r=z(Ne(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:ge});return Object.assign(t,a),t};var hs=async(e,s)=>{const t={...e,body:await m.parseJsonErrorBody(e.body,s)},r=m.loadRestJsonErrorCode(e,t.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await ws(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await bs(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await xs(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await vs(t,s);default:const a=t.body;return us({output:e,parsedBody:a,errorCode:r})}},us=fe(o),ws=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new R({$metadata:w(e),...t});return u(n,e.body)},bs=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new q({$metadata:w(e),...t});return u(n,e.body)},xs=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new E({$metadata:w(e),...t});return u(n,e.body)},vs=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new S({$metadata:w(e),...t});return u(n,e.body)},w=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var ks=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),Rs="accountId",qs="accessToken",Es="account_id";var Ss="roleName",zs="role_name",Ds="x-amz-sso_bearer_token";class ds extends ns.classBuilder().ep({...C}).m(function(e,s,t,r){return[rs(t,this.serialize,this.deserialize),as(t,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(Ge,Ve).ser(ss).de(ts).build(){}export{He as SSOClient,ds as GetRoleCredentialsCommand};
3
-
4
- //# debugId=2C8740315AA1686664756E2164756E21
5
- //# sourceMappingURL=chunk-nw65c3yh.js.map