@integration-app/membrane-cli
Version:
CLI tool for importing and exporting Integration.app workspace data
2 lines (1 loc) • 16.9 kB
JavaScript
var pe=Object.defineProperty;var o=(e,t)=>pe(e,"name",{value:t,configurable:!0});import{v as le,w as z,x as ue,y as he,z as me,A as ge,B as xe,D as Ee,F as ye,t as Se,G as fe,J as _e,K as Pe,L as Ie,M as ve,O as we,Q as Ce,u as E,R as be,S as Oe,N as Ae,T as De,U as ke,V as Re,W as Te,X as Ne,Y as $e,Z as Ue,_ as ze,$ as Fe,a0 as He,a1 as je,a2 as Ge,a3 as qe,a4 as Me,a5 as Be,a6 as Le,a7 as Ve,a8 as Je,a9 as F,aa as We,ab as Ye,ac as Ke,ad as Xe,ae as Qe,af as Ze,ag as et,ah as tt,ai as rt,aj as ot,ak as nt,al as st,am as it,an as at,ao as ct,ap as y,as as dt,av as d,aq as p,at as pt,au as lt,ax as a,aC as ut,aw as ht,ay as g,az as H,aA as mt,aB as gt,aD as xt}from"./index-DSLX1GoQ.js";import"buffer";import"stream";import"node:stream";import"http";import"https";import"http2";import"os";import"path";import"crypto";import{p as Et}from"./package-IbndiEXA.js";import{N as yt}from"./noAuth-DwiTe3rT.js";import{_ as St,p as ft,a as _t,l as Pt}from"./parseJsonBody-DKy4VydB.js";import"fs";import"url";import"chalk";import"commander";import"inquirer";import"node:fs";import"node:path";import"js-yaml";import"@integration-app/sdk";import"zod";import"jsonwebtoken";import"events";import"constants";import"util";import"assert";import"node:url";import"node:fs/promises";import"node:events";import"node:string_decoder";import"zlib";import"form-data";import"async_hooks";import"process";import"js-convert-case";import"@anthropic-ai/sdk";const It=o(async(e,t,r)=>({operation:ue(t).operation,region:await z(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),"defaultSSOOIDCHttpAuthSchemeParametersProvider");function vt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:o((t,r)=>({signingProperties:{config:t,context:r}}),"propertiesExtractor")}}o(vt,"createAwsAuthSigv4HttpAuthOption");function wt(e){return{schemeId:"smithy.api#noAuth"}}o(wt,"createSmithyApiNoAuthHttpAuthOption");const Ct=o(e=>{const t=[];switch(e.operation){case"CreateToken":{t.push(wt());break}default:t.push(vt(e))}return t},"defaultSSOOIDCHttpAuthSchemeProvider"),bt=o(e=>{const t=le(e);return Object.assign(t,{authSchemePreference:z(e.authSchemePreference??[])})},"resolveHttpAuthSchemeConfig"),Ot=o(e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),"resolveClientEndpointParameters"),At={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},j="required",l="fn",u="argv",S="ref",G=!0,q="isSet",P="booleanEquals",f="error",_="endpoint",x="tree",$="PartitionResult",U="getAttr",M={[j]:!1,type:"String"},B={[j]:!0,default:!1,type:"Boolean"},L={[S]:"Endpoint"},V={[l]:P,[u]:[{[S]:"UseFIPS"},!0]},J={[l]:P,[u]:[{[S]:"UseDualStack"},!0]},h={},W={[l]:U,[u]:[{[S]:$},"supportsFIPS"]},Y={[S]:$},K={[l]:P,[u]:[!0,{[l]:U,[u]:[Y,"supportsDualStack"]}]},X=[V],Q=[J],Z=[{[S]:"Region"}],Dt={parameters:{Region:M,UseDualStack:B,UseFIPS:B,Endpoint:M},rules:[{conditions:[{[l]:q,[u]:[L]}],rules:[{conditions:X,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{conditions:Q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:L,properties:h,headers:h},type:_}],type:x},{conditions:[{[l]:q,[u]:Z}],rules:[{conditions:[{[l]:"aws.partition",[u]:Z,assign:$}],rules:[{conditions:[V,J],rules:[{conditions:[{[l]:P,[u]:[G,W]},K],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:h,headers:h},type:_}],type:x},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}],type:x},{conditions:X,rules:[{conditions:[{[l]:P,[u]:[W,G]}],rules:[{conditions:[{[l]:"stringEquals",[u]:[{[l]:U,[u]:[Y,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:h,headers:h},type:_},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:h,headers:h},type:_}],type:x},{error:"FIPS is enabled but this partition does not support FIPS",type:f}],type:x},{conditions:Q,rules:[{conditions:[K],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:h,headers:h},type:_}],type:x},{error:"DualStack is enabled but this partition does not support DualStack",type:f}],type:x},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:h,headers:h},type:_}],type:x}],type:x},{error:"Invalid Configuration: Missing Region",type:f}]},kt=Dt,Rt=new he({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Tt=o((e,t={})=>Rt.get(e,()=>me(kt,{endpointParams:e,logger:t.logger})),"defaultEndpointResolver");xe.aws=ge;const Nt=o(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Ie,base64Encoder:e?.base64Encoder??Pe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Tt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Ct,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:o(t=>t.getIdentityProvider("aws.auth#sigv4"),"identityProvider"),signer:new _e},{schemeId:"smithy.api#noAuth",identityProvider:o(t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),"identityProvider"),signer:new yt}],logger:e?.logger??new fe,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Se,utf8Decoder:e?.utf8Decoder??ye,utf8Encoder:e?.utf8Encoder??Ee}),"getRuntimeConfig$1"),$t=o(e=>{ve(process.version);const t=we(e),r=o(()=>t().then(Ge),"defaultConfigProvider"),s=Nt(e);Ce(process.version);const n={profile:e?.profile,logger:s.logger};return{...s,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??E(je,n),bodyLengthChecker:e?.bodyLengthChecker??ke,defaultUserAgentProvider:e?.defaultUserAgentProvider??De({serviceId:s.serviceId,clientVersion:Et.version}),maxAttempts:e?.maxAttempts??E(He,e),region:e?.region??E(Fe,{...ze,...n}),requestHandler:Ae.create(e?.requestHandler??r),retryMode:e?.retryMode??E({...$e,default:o(async()=>(await r()).retryMode||Ue,"default")},e),sha256:e?.sha256??Oe.bind(null,"sha256"),streamCollector:e?.streamCollector??be,useDualstackEndpoint:e?.useDualstackEndpoint??E(Ne,n),useFipsEndpoint:e?.useFipsEndpoint??E(Te,n),userAgentAppId:e?.userAgentAppId??E(Re,n)}},"getRuntimeConfig"),Ut=o(e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,s=e.credentials;return{setHttpAuthScheme(n){const i=t.findIndex(N=>N.schemeId===n.schemeId);i===-1?t.push(n):t.splice(i,1,n)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(n){r=n},httpAuthSchemeProvider(){return r},setCredentials(n){s=n},credentials(){return s}}},"getHttpAuthExtensionConfiguration"),zt=o(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),"resolveHttpAuthRuntimeConfig"),Ft=o((e,t)=>{const r=Object.assign(qe(e),Me(e),Be(e),Ut(e));return t.forEach(s=>s.configure(r)),Object.assign(e,Le(r),Ve(r),Je(r),zt(r))},"resolveRuntimeExtensions");class ee extends F{static{o(this,"SSOOIDCClient")}config;constructor(...[t]){const r=$t(t||{});super(r),this.initConfig=r;const s=Ot(r),n=We(s),i=Ye(n),N=Ke(i),se=Qe(N),ie=Xe(se),ae=bt(ie),ce=Ft(ae,t?.extensions||[]);this.config=ce,this.middlewareStack.use(Ze(this.config)),this.middlewareStack.use(et(this.config)),this.middlewareStack.use(tt(this.config)),this.middlewareStack.use(rt(this.config)),this.middlewareStack.use(ot(this.config)),this.middlewareStack.use(nt(this.config)),this.middlewareStack.use(st(this.config,{httpAuthSchemeParametersProvider:It,identityProviderConfigProvider:o(async de=>new it({"aws.auth#sigv4":de.credentials}),"identityProviderConfigProvider")})),this.middlewareStack.use(at(this.config))}destroy(){super.destroy()}}class c extends ct{static{o(this,"SSOOIDCServiceException")}constructor(t){super(t),Object.setPrototypeOf(this,c.prototype)}}class I extends c{static{o(this,"AccessDeniedException")}name="AccessDeniedException";$fault="client";error;error_description;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t}),Object.setPrototypeOf(this,I.prototype),this.error=t.error,this.error_description=t.error_description}}class v extends c{static{o(this,"AuthorizationPendingException")}name="AuthorizationPendingException";$fault="client";error;error_description;constructor(t){super({name:"AuthorizationPendingException",$fault:"client",...t}),Object.setPrototypeOf(this,v.prototype),this.error=t.error,this.error_description=t.error_description}}const te=o(e=>({...e,...e.clientSecret&&{clientSecret:y},...e.refreshToken&&{refreshToken:y},...e.codeVerifier&&{codeVerifier:y}}),"CreateTokenRequestFilterSensitiveLog"),re=o(e=>({...e,...e.accessToken&&{accessToken:y},...e.refreshToken&&{refreshToken:y},...e.idToken&&{idToken:y}}),"CreateTokenResponseFilterSensitiveLog");class w extends c{static{o(this,"ExpiredTokenException")}name="ExpiredTokenException";$fault="client";error;error_description;constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,w.prototype),this.error=t.error,this.error_description=t.error_description}}class C extends c{static{o(this,"InternalServerException")}name="InternalServerException";$fault="server";error;error_description;constructor(t){super({name:"InternalServerException",$fault:"server",...t}),Object.setPrototypeOf(this,C.prototype),this.error=t.error,this.error_description=t.error_description}}class b extends c{static{o(this,"InvalidClientException")}name="InvalidClientException";$fault="client";error;error_description;constructor(t){super({name:"InvalidClientException",$fault:"client",...t}),Object.setPrototypeOf(this,b.prototype),this.error=t.error,this.error_description=t.error_description}}class O extends c{static{o(this,"InvalidGrantException")}name="InvalidGrantException";$fault="client";error;error_description;constructor(t){super({name:"InvalidGrantException",$fault:"client",...t}),Object.setPrototypeOf(this,O.prototype),this.error=t.error,this.error_description=t.error_description}}class A extends c{static{o(this,"InvalidRequestException")}name="InvalidRequestException";$fault="client";error;error_description;constructor(t){super({name:"InvalidRequestException",$fault:"client",...t}),Object.setPrototypeOf(this,A.prototype),this.error=t.error,this.error_description=t.error_description}}class D extends c{static{o(this,"InvalidScopeException")}name="InvalidScopeException";$fault="client";error;error_description;constructor(t){super({name:"InvalidScopeException",$fault:"client",...t}),Object.setPrototypeOf(this,D.prototype),this.error=t.error,this.error_description=t.error_description}}class k extends c{static{o(this,"SlowDownException")}name="SlowDownException";$fault="client";error;error_description;constructor(t){super({name:"SlowDownException",$fault:"client",...t}),Object.setPrototypeOf(this,k.prototype),this.error=t.error,this.error_description=t.error_description}}class R extends c{static{o(this,"UnauthorizedClientException")}name="UnauthorizedClientException";$fault="client";error;error_description;constructor(t){super({name:"UnauthorizedClientException",$fault:"client",...t}),Object.setPrototypeOf(this,R.prototype),this.error=t.error,this.error_description=t.error_description}}class T extends c{static{o(this,"UnsupportedGrantTypeException")}name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(t){super({name:"UnsupportedGrantTypeException",$fault:"client",...t}),Object.setPrototypeOf(this,T.prototype),this.error=t.error,this.error_description=t.error_description}}const Ht=o(async(e,t)=>{const r=dt(e,t),s={"content-type":"application/json"};r.bp("/token");let n;return n=JSON.stringify(d(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:o(i=>St(i),"scope")})),r.m("POST").h(s).b(n),r.build()},"se_CreateTokenCommand"),jt=o(async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return Gt(e,t);const r=p({$metadata:m(e)}),s=pt(lt(await ft(e.body,t)),"body"),n=d(s,{accessToken:a,expiresIn:ut,idToken:a,refreshToken:a,tokenType:a});return Object.assign(r,n),r},"de_CreateTokenCommand"),Gt=o(async(e,t)=>{const r={...e,body:await _t(e.body,t)},s=Pt(e,r.body);switch(s){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Mt(r);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Bt(r);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Lt(r);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Vt(r);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Jt(r);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Wt(r);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await Yt(r);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await Kt(r);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await Xt(r);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await Qt(r);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await Zt(r);default:const n=r.body;return qt({output:e,parsedBody:n,errorCode:s})}},"de_CommandError"),qt=ht(c),Mt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new I({$metadata:m(e),...r});return g(i,e.body)},"de_AccessDeniedExceptionRes"),Bt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new v({$metadata:m(e),...r});return g(i,e.body)},"de_AuthorizationPendingExceptionRes"),Lt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new w({$metadata:m(e),...r});return g(i,e.body)},"de_ExpiredTokenExceptionRes"),Vt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new C({$metadata:m(e),...r});return g(i,e.body)},"de_InternalServerExceptionRes"),Jt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new b({$metadata:m(e),...r});return g(i,e.body)},"de_InvalidClientExceptionRes"),Wt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new O({$metadata:m(e),...r});return g(i,e.body)},"de_InvalidGrantExceptionRes"),Yt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new A({$metadata:m(e),...r});return g(i,e.body)},"de_InvalidRequestExceptionRes"),Kt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new D({$metadata:m(e),...r});return g(i,e.body)},"de_InvalidScopeExceptionRes"),Xt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new k({$metadata:m(e),...r});return g(i,e.body)},"de_SlowDownExceptionRes"),Qt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new R({$metadata:m(e),...r});return g(i,e.body)},"de_UnauthorizedClientExceptionRes"),Zt=o(async(e,t)=>{const r=p({}),s=e.body,n=d(s,{error:a,error_description:a});Object.assign(r,n);const i=new T({$metadata:m(e),...r});return g(i,e.body)},"de_UnsupportedGrantTypeExceptionRes"),m=o(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"]}),"deserializeMetadata");class oe extends H.classBuilder().ep(At).m(function(t,r,s,n){return[mt(s,this.serialize,this.deserialize),gt(s,t.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(te,re).ser(Ht).de(jt).build(){static{o(this,"CreateTokenCommand")}}const er={CreateTokenCommand:oe};class ne extends ee{static{o(this,"SSOOIDC")}}xt(er,ne);export{H as $Command,I as AccessDeniedException,v as AuthorizationPendingException,oe as CreateTokenCommand,te as CreateTokenRequestFilterSensitiveLog,re as CreateTokenResponseFilterSensitiveLog,w as ExpiredTokenException,C as InternalServerException,b as InvalidClientException,O as InvalidGrantException,A as InvalidRequestException,D as InvalidScopeException,ne as SSOOIDC,ee as SSOOIDCClient,c as SSOOIDCServiceException,k as SlowDownException,R as UnauthorizedClientException,T as UnsupportedGrantTypeException,F as __Client};