@kya-os/mcp-i
Version:
The TypeScript MCP framework with identity features built-in
1 lines • 10.2 kB
JavaScript
;exports.id=283,exports.ids=[283],exports.modules={2445:e=>{e.exports={rE:"3.993.0"}},93283:(e,t,r)=>{r.d(t,{CreateOAuth2TokenCommand:()=>kt,SigninClient:()=>St});var s=r(97040),n=r(74534),o=r(70775),i=r(5572),a=r(61019),c=r(94615),p=r(45326),u=r(9575),d=r(68249),h=r(75279),l=r(10860),g=r(39412),m=r(72084),f=r(10773),y=r(9942),S=r(23870),v=r(45547),P=r(81974);const k=async(e,t,r)=>({operation:(0,v.u)(t).operation,region:await(0,P.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),E=e=>{const t=[];return"CreateOAuth2Token"===e.operation?t.push({schemeId:"smithy.api#noAuth"}):t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t},A={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var I=r(2445),x=r(17479),w=r(96965),b=r(17914),O=r(5882),R=r(96901),D=r(24661),T=r(46109),C=r(5012),F=r(7387),U=r(24176),$=r(64327),q=r(34338),j=r(57815),z=r(55425),M=r(99816),V=r(48828),H=r(17357),Z=r(60688),K=r(14433),N=r(3761),B=r(67933),L=r(12544),G=r(39181),Y=r(40935),J=r(2914),Q=r(2456),W=r(48105),X=r(1034),_=r(7856);const ee="required",te="fn",re="argv",se="ref",ne=!0,oe="isSet",ie="booleanEquals",ae="error",ce="endpoint",pe="tree",ue="PartitionResult",de="stringEquals",he={[ee]:!0,default:!1,type:"boolean"},le={[ee]:!1,type:"string"},ge={[se]:"Endpoint"},me={[te]:ie,[re]:[{[se]:"UseFIPS"},!0]},fe={[te]:ie,[re]:[{[se]:"UseDualStack"},!0]},ye={},Se={[te]:"getAttr",[re]:[{[se]:ue},"name"]},ve={[te]:ie,[re]:[{[se]:"UseFIPS"},!1]},Pe={[te]:ie,[re]:[{[se]:"UseDualStack"},!1]},ke={[te]:"getAttr",[re]:[{[se]:ue},"supportsFIPS"]},Ee={[te]:ie,[re]:[!0,{[te]:"getAttr",[re]:[{[se]:ue},"supportsDualStack"]}]},Ae=[{[se]:"Region"}],Ie={version:"1.0",parameters:{UseDualStack:he,UseFIPS:he,Endpoint:le,Region:le},rules:[{conditions:[{[te]:oe,[re]:[ge]}],rules:[{conditions:[me],error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:ae},{rules:[{conditions:[fe],error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:ae},{endpoint:{url:ge,properties:ye,headers:ye},type:ce}],type:pe}],type:pe},{rules:[{conditions:[{[te]:oe,[re]:Ae}],rules:[{conditions:[{[te]:"aws.partition",[re]:Ae,assign:ue}],rules:[{conditions:[{[te]:de,[re]:[Se,"aws"]},ve,Pe],endpoint:{url:"https://{Region}.signin.aws.amazon.com",properties:ye,headers:ye},type:ce},{conditions:[{[te]:de,[re]:[Se,"aws-cn"]},ve,Pe],endpoint:{url:"https://{Region}.signin.amazonaws.cn",properties:ye,headers:ye},type:ce},{conditions:[{[te]:de,[re]:[Se,"aws-us-gov"]},ve,Pe],endpoint:{url:"https://{Region}.signin.amazonaws-us-gov.com",properties:ye,headers:ye},type:ce},{conditions:[me,fe],rules:[{conditions:[{[te]:ie,[re]:[ne,ke]},Ee],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ye,headers:ye},type:ce}],type:pe},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:ae}],type:pe},{conditions:[me,Pe],rules:[{conditions:[{[te]:ie,[re]:[ke,ne]}],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",properties:ye,headers:ye},type:ce}],type:pe},{error:"FIPS is enabled but this partition does not support FIPS",type:ae}],type:pe},{conditions:[ve,fe],rules:[{conditions:[Ee],rules:[{endpoint:{url:"https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ye,headers:ye},type:ce}],type:pe},{error:"DualStack is enabled but this partition does not support DualStack",type:ae}],type:pe},{endpoint:{url:"https://signin.{Region}.{PartitionResult#dnsSuffix}",properties:ye,headers:ye},type:ce}],type:pe}],type:pe},{error:"Invalid Configuration: Missing Region",type:ae}],type:pe}]},xe=new W.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),we=(e,t={})=>xe.get(e,()=>(0,X.s)(Ie,{endpointParams:e,logger:t.logger}));_.m.aws=Q.UF;var be=r(51453),Oe=r(6723);class Re extends Oe.T{constructor(e){super(e),Object.setPrototypeOf(this,Re.prototype)}}class De extends Re{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,De.prototype),this.error=e.error}}class Te extends Re{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,Te.prototype),this.error=e.error}}class Ce extends Re{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e}),Object.setPrototypeOf(this,Ce.prototype),this.error=e.error}}class Fe extends Re{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,Fe.prototype),this.error=e.error}}const Ue="accessKeyId",$e="accessToken",qe="client",je="clientId",ze="codeVerifier",Me="error",Ve="expiresIn",He="grantType",Ze="http",Ke="httpError",Ne="idToken",Be="jsonName",Le="message",Ge="refreshToken",Ye="redirectUri",Je="smithy.ts.sdk.synthetic.com.amazonaws.signin",Qe="secretAccessKey",We="sessionToken",Xe="tokenType",_e="com.amazonaws.signin",et=be.O.for(Je);var tt=[-3,Je,"SigninServiceException",0,[],[]];et.registerError(tt,Re);const rt=be.O.for(_e);var st=[-3,_e,"AccessDeniedException",{[Me]:qe},[Me,Le],[0,0],2];rt.registerError(st,De);var nt=[-3,_e,"InternalServerException",{[Me]:"server",[Ke]:500},[Me,Le],[0,0],2];rt.registerError(nt,Te);var ot=[-3,_e,"TooManyRequestsError",{[Me]:qe,[Ke]:429},[Me,Le],[0,0],2];rt.registerError(ot,Ce);var it=[-3,_e,"ValidationException",{[Me]:qe,[Ke]:400},[Me,Le],[0,0],2];rt.registerError(it,Fe);const at=[et,rt];var ct=[0,_e,"RefreshToken",8,0],pt=[3,_e,"AccessToken",8,[Ue,Qe,We],[[0,{[Be]:Ue}],[0,{[Be]:Qe}],[0,{[Be]:We}]],3],ut=[3,_e,"CreateOAuth2TokenRequest",0,["tokenInput"],[[()=>dt,16]],1],dt=[3,_e,"CreateOAuth2TokenRequestBody",0,[je,He,"code",Ye,ze,Ge],[[0,{[Be]:je}],[0,{[Be]:He}],0,[0,{[Be]:Ye}],[0,{[Be]:ze}],[()=>ct,{[Be]:Ge}]],2],ht=[3,_e,"CreateOAuth2TokenResponse",0,["tokenOutput"],[[()=>lt,16]],1],lt=[3,_e,"CreateOAuth2TokenResponseBody",0,[$e,Xe,Ve,Ge,Ne],[[()=>pt,{[Be]:$e}],[0,{[Be]:Xe}],[1,{[Be]:Ve}],[()=>ct,{[Be]:Ge}],[0,{[Be]:Ne}]],4],gt=[9,_e,"CreateOAuth2Token",{[Ze]:["POST","/v1/token",200]},()=>ut,()=>ht];var mt=r(93673),ft=r(78646),yt=r(18081);class St extends y.K{config;constructor(...[e]){const t=(e=>{(0,q.I)(process.version);const t=(0,M.I)(e),r=()=>t().then(j.l),s=(e=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??L.E,base64Encoder:e?.base64Encoder??G.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??we,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??E,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new H.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new K.m}],logger:e?.logger??new N.N,protocol:e?.protocol??Z.Y,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:at,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",urlParser:e?.urlParser??B.D,utf8Decoder:e?.utf8Decoder??Y.a,utf8Encoder:e?.utf8Encoder??J.P}))(e);(0,x.I)(process.version);const n={profile:e?.profile,logger:s.logger};return{...s,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,F.Z)(w.$,n),bodyLengthChecker:e?.bodyLengthChecker??z.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,b.pf)({serviceId:s.serviceId,clientVersion:I.rE}),maxAttempts:e?.maxAttempts??(0,F.Z)(m.qs,e),region:e?.region??(0,F.Z)(R.GG,{...R.zH,...n}),requestHandler:U.$.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,F.Z)({...m.kN,default:async()=>(await r()).retryMode||V.L0},e),sha256:e?.sha256??C.V.bind(null,"sha256"),streamCollector:e?.streamCollector??$.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,F.Z)(D.e$,n),useFipsEndpoint:e?.useFipsEndpoint??(0,F.Z)(T.Ko,n),userAgentAppId:e?.userAgentAppId??(0,F.Z)(O.hV,n)}})(e||{});super(t),this.initConfig=t;const r=(y=t,Object.assign(y,{useDualstackEndpoint:y.useDualstackEndpoint??!1,useFipsEndpoint:y.useFipsEndpoint??!1,defaultSigningName:"signin"}));var y;const v=(0,i.D)(r),A=(0,m.$z)(v),Q=(0,c.T)(A),W=(0,s.OV)(Q),X=((e,t)=>{const r=Object.assign((0,mt.R)(e),(0,yt.xA)(e),(0,ft.e)(e),(e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,s=e.credentials;return{setHttpAuthScheme(e){const r=t.findIndex(t=>t.schemeId===e.schemeId);-1===r?t.push(e):t.splice(r,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){r=e},httpAuthSchemeProvider:()=>r,setCredentials(e){s=e},credentials:()=>s}})(e));return t.forEach(e=>e.configure(r)),Object.assign(e,(0,mt.$)(r),(0,yt.uv)(r),(0,ft.j)(r),{httpAuthSchemes:(s=r).httpAuthSchemes(),httpAuthSchemeProvider:s.httpAuthSchemeProvider(),credentials:s.credentials()});var s})((e=>{const t=(0,S.h)(e);return Object.assign(t,{authSchemePreference:(0,P.t)(e.authSchemePreference??[])})})((0,g.C)(W)),e?.extensions||[]);this.config=X,this.middlewareStack.use((0,h.wq)(this.config)),this.middlewareStack.use((0,a.sM)(this.config)),this.middlewareStack.use((0,f.ey)(this.config)),this.middlewareStack.use((0,l.vK)(this.config)),this.middlewareStack.use((0,s.TC)(this.config)),this.middlewareStack.use((0,n.Y7)(this.config)),this.middlewareStack.use((0,o.n)(this.config)),this.middlewareStack.use((0,p.w)(this.config,{httpAuthSchemeParametersProvider:k,identityProviderConfigProvider:async e=>new u.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,d.l)(this.config))}destroy(){super.destroy()}}var vt=r(66686),Pt=r(22869);class kt extends(Pt.u.classBuilder().ep(A).m(function(e,t,r,s){return[(0,vt.r)(r,e.getEndpointParameterInstructions())]}).s("Signin","CreateOAuth2Token",{}).n("SigninClient","CreateOAuth2TokenCommand").sc(gt).build()){}}};