@kya-os/mcp-i 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/149.js +1 -0
- package/dist/189.js +1 -0
- package/dist/261.js +1 -0
- package/dist/28.js +1 -0
- package/dist/295.js +1 -1
- package/dist/460.js +1 -0
- package/dist/570.js +1 -0
- package/dist/634.js +1 -0
- package/dist/647.js +1 -0
- package/dist/67.js +1 -1
- package/dist/739.js +1 -0
- package/dist/742.js +1 -0
- package/dist/904.js +1 -0
- package/dist/938.js +1 -0
- package/dist/runtime/adapter-express.js +1 -7
- package/dist/runtime/adapter-express.js.LICENSE.txt +2 -7
- package/dist/runtime/adapter-nextjs.js +1 -7
- package/dist/runtime/adapter-nextjs.js.LICENSE.txt +1 -188
- package/dist/runtime/http.js +1 -7
- package/dist/runtime/http.js.LICENSE.txt +2 -7
- package/dist/runtime/stdio.js +1 -7
- package/dist/runtime/stdio.js.LICENSE.txt +1 -234
- package/dist/runtime/utils/server.d.ts +0 -17
- package/package.json +3 -3
- package/dist/207.js +0 -1
- package/dist/25.js +0 -1
- package/dist/387.js +0 -1
- package/dist/406.js +0 -1
- package/dist/448.js +0 -1
- package/dist/478.js +0 -1
- package/dist/482.js +0 -1
- package/dist/575.js +0 -1
- package/dist/743.js +0 -1
- package/dist/784.js +0 -1
- package/dist/844.js +0 -1
- package/dist/866.js +0 -1
- package/dist/936.js +0 -1
- package/dist/941.js +0 -1
- package/dist/988.js +0 -1
package/dist/28.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=28,exports.ids=[28,647],exports.modules={51869:(e,s,o)=>{o.d(s,{a:()=>r,v:()=>a});var n=o(79896),t=o(55786);const{readFile:i}=n.promises,r={},a=async e=>{if(r[e])return r[e];const s=(0,t.C)(e),o=await i(s,"utf8");return JSON.parse(o)}},55786:(e,s,o)=>{o.d(s,{C:()=>r});var n=o(76982),t=o(16928),i=o(47741);const r=e=>{const s=(0,n.createHash)("sha1").update(e).digest("hex");return(0,t.join)((0,i.R)(),".aws","sso","cache",`${s}.json`)}},64647:(e,s,o)=>{o.d(s,{fromSSO:()=>N});var n=o(3721),t=o(67789),i=o(98306),r=o(52696),a=o(71997),c=o(40338);const l=e=>Object.entries(e).filter(([e])=>e.startsWith(a.I.SSO_SESSION+c.Q)).reduce((e,[s,o])=>({...e,[s.substring(s.indexOf(c.Q)+1)]:o}),{});var g=o(71052),f=o(31493);const h=()=>({}),p=async(e={})=>(0,f.$H)(e.configFilepath??(0,r.g)()).then(g.A).then(l).catch(h);var d=o(64172),w=o(27637);class u extends w.m{name="TokenProviderError";constructor(e,s=!0){super(e,s),Object.setPrototypeOf(this,u.prototype)}}var S=o(51869);const C="To refresh this SSO session run 'aws sso login' with the corresponding profile.",_=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new u(`Token is expired. ${C}`,!1)},k=(e,s,o=!1)=>{if(void 0===s)throw new u(`Value not present for '${e}' in SSO Token${o?". Cannot refresh":""}. ${C}`,!1)};var y=o(55786),m=o(79896);const{writeFile:T}=m.promises,x=new Date(0),O=(e={})=>async({callerClientConfig:s}={})=>{const n={...e,parentClientConfig:{...s,...e.parentClientConfig}};n.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await(0,i.Y)(n),a=(0,t.Bz)({profile:n.profile??s?.profile}),c=r[a];if(!c)throw new u(`Profile '${a}' could not be found in shared credentials file.`,!1);if(!c.sso_session)throw new u(`Profile '${a}' is missing required property 'sso_session'.`);const l=c.sso_session,g=(await p(n))[l];if(!g)throw new u(`Sso session '${l}' could not be found in shared credentials file.`,!1);for(const e of["sso_start_url","sso_region"])if(!g[e])throw new u(`Sso session '${l}' is missing required property '${e}'.`,!1);g.sso_start_url;const f=g.sso_region;let h;try{h=await(0,S.v)(l)}catch(e){throw new u(`The SSO session token associated with profile=${a} was not found or is invalid. ${C}`,!1)}k("accessToken",h.accessToken),k("expiresAt",h.expiresAt);const{accessToken:d,expiresAt:w}=h,m={token:d,expiration:new Date(w)};if(m.expiration.getTime()-Date.now()>3e5)return m;if(Date.now()-x.getTime()<3e4)return _(m),m;k("clientId",h.clientId,!0),k("clientSecret",h.clientSecret,!0),k("refreshToken",h.refreshToken,!0);try{x.setTime(Date.now());const e=await(async(e,s,n={})=>{const{CreateTokenCommand:t}=await o.e(904).then(o.bind(o,98904)),i=await(async(e,s={})=>{const{SSOOIDCClient:n}=await o.e(904).then(o.bind(o,98904));return new n(Object.assign({},s.clientConfig??{},{region:e??s.clientConfig?.region,logger:s.clientConfig?.logger??s.parentClientConfig?.logger}))})(s,n);return i.send(new t({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))})(h,f,n);k("accessToken",e.accessToken),k("expiresIn",e.expiresIn);const s=new Date(Date.now()+1e3*e.expiresIn);try{await((e,s)=>{const o=(0,y.C)(e),n=JSON.stringify(s,null,2);return T(o,n)})(l,{...h,accessToken:e.accessToken,expiresAt:s.toISOString(),refreshToken:e.refreshToken})}catch(e){}return{token:e.accessToken,expiration:s}}catch(e){return _(m),m}},I=!1,v=async({ssoStartUrl:e,ssoSession:s,ssoAccountId:t,ssoRegion:i,ssoRoleName:r,ssoClient:a,clientConfig:c,parentClientConfig:l,profile:g,filepath:f,configFilepath:h,ignoreCache:p,logger:w})=>{let u;const C="To refresh this SSO session run aws sso login with the corresponding profile.";if(s)try{const e=await O({profile:g,filepath:f,configFilepath:h,ignoreCache:p})();u={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new n.C(e.message,{tryNextLink:I,logger:w})}else try{u=await(0,S.v)(e)}catch(e){throw new n.C(`The SSO session associated with this profile is invalid. ${C}`,{tryNextLink:I,logger:w})}if(new Date(u.expiresAt).getTime()-Date.now()<=0)throw new n.C(`The SSO session associated with this profile has expired. ${C}`,{tryNextLink:I,logger:w});const{accessToken:_}=u,{SSOClient:k,GetRoleCredentialsCommand:y}=await o.e(149).then(o.bind(o,11149)),m=a||new k(Object.assign({},c??{},{logger:c?.logger??l?.logger,region:c?.region??i}));let T;try{T=await m.send(new y({accountId:t,roleName:r,accessToken:_}))}catch(e){throw new n.C(e,{tryNextLink:I,logger:w})}const{roleCredentials:{accessKeyId:x,secretAccessKey:v,sessionToken:N,expiration:$,credentialScope:A,accountId:R}={}}=T;if(!(x&&v&&N&&$))throw new n.C("SSO returns an invalid temporary credential.",{tryNextLink:I,logger:w});const b={accessKeyId:x,secretAccessKey:v,sessionToken:N,expiration:new Date($),...A&&{credentialScope:A},...R&&{accountId:R}};return s?(0,d.g)(b,"CREDENTIALS_SSO","s"):(0,d.g)(b,"CREDENTIALS_SSO_LEGACY","u"),b},N=(e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:o,ssoAccountId:r,ssoRegion:a,ssoRoleName:c,ssoSession:l}=e,{ssoClient:g}=e,f=(0,t.Bz)({profile:e.profile??s?.profile});if(o||r||a||c||l){if(o&&r&&a&&c)return v({ssoStartUrl:o,ssoSession:l,ssoAccountId:r,ssoRegion:a,ssoRoleName:c,ssoClient:g,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:f,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger});throw new n.C('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger})}{const s=(await(0,i.Y)(e))[f];if(!s)throw new n.C(`Profile ${f} was not found.`,{logger:e.logger});if(!(h=s)||"string"!=typeof h.sso_start_url&&"string"!=typeof h.sso_account_id&&"string"!=typeof h.sso_session&&"string"!=typeof h.sso_region&&"string"!=typeof h.sso_role_name)throw new n.C(`Profile ${f} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){const t=(await p(e))[s.sso_session],i=` configurations in profile ${f} and sso-session ${s.sso_session}`;if(a&&a!==t.sso_region)throw new n.C("Conflicting SSO region"+i,{tryNextLink:!1,logger:e.logger});if(o&&o!==t.sso_start_url)throw new n.C("Conflicting SSO start_url"+i,{tryNextLink:!1,logger:e.logger});s.sso_region=t.sso_region,s.sso_start_url=t.sso_start_url}const{sso_start_url:t,sso_account_id:r,sso_region:c,sso_role_name:l,sso_session:d}=((e,s)=>{const{sso_start_url:o,sso_account_id:t,sso_region:i,sso_role_name:r}=e;if(!(o&&t&&i&&r))throw new n.C(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:s});return e})(s,e.logger);return v({ssoStartUrl:t,ssoSession:d,ssoAccountId:r,ssoRegion:c,ssoRoleName:l,ssoClient:g,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:f,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}var h}},98306:(e,s,o)=>{o.d(s,{Y:()=>t});var n=o(40338);const t=async e=>{const s=await(0,n.p)(e);return((...e)=>{const s={};for(const o of e)for(const[e,n]of Object.entries(o))void 0!==s[e]?Object.assign(s[e],n):s[e]=n;return s})(s.configFile,s.credentialsFile)}}};
|