@integration-app/membrane-cli
Version:
CLI tool for importing and exporting Integration.app workspace data
2 lines (1 loc) • 11.9 kB
JavaScript
var Q=Object.defineProperty;var o=(e,t)=>Q(e,"name",{value:t,configurable:!0});import"os";import"path";import"crypto";import{v as Z,w as D,x as ee,y as te,z as se,A as oe,B as ne,D as ae,F as re,t as ie,G as ce,J as de,K as pe,L as ue,M as le,O as he,Q as me,u,R as ge,S as Se,N as ye,T as fe,U as Ee,V as Pe,W as ve,X as xe,Y as _e,Z as Ie,_ as Re,$ as Ce,a0 as be,a1 as Ae,a2 as we,a3 as Oe,a4 as Ne,a5 as De,a6 as ke,a7 as Fe,a8 as Te,a9 as He,aa as Ue,ab as qe,ac as ze,ad as Ge,ae as Me,af as Le,ag as $e,ah as je,ai as Be,aj as Ve,ak as Je,al as Ke,am as We,an as Ye,ao as Xe,ap as I,aq as l,ar as Qe,as as Ze,at as R,au as et,av as y,aw as tt,ax as P,ay as v,az as st,aA as ot,aB as nt}from"./index-DSLX1GoQ.js";import"buffer";import"stream";import"node:stream";import"http";import"https";import"http2";import{p as at,a as rt,l as it,_ as ct}from"./parseJsonBody-DKy4VydB.js";import{N as dt}from"./noAuth-DwiTe3rT.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 pt=o(async(e,t,s)=>({operation:ee(t).operation,region:await D(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),"defaultSSOHttpAuthSchemeParametersProvider");function ut(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:o((t,s)=>({signingProperties:{config:t,context:s}}),"propertiesExtractor")}}o(ut,"createAwsAuthSigv4HttpAuthOption");function x(e){return{schemeId:"smithy.api#noAuth"}}o(x,"createSmithyApiNoAuthHttpAuthOption");const lt=o(e=>{const t=[];switch(e.operation){case"GetRoleCredentials":{t.push(x());break}case"ListAccountRoles":{t.push(x());break}case"ListAccounts":{t.push(x());break}case"Logout":{t.push(x());break}default:t.push(ut(e))}return t},"defaultSSOHttpAuthSchemeProvider"),ht=o(e=>{const t=Z(e);return Object.assign(t,{authSchemePreference:D(e.authSchemePreference??[])})},"resolveHttpAuthSchemeConfig"),mt=o(e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}),"resolveClientEndpointParameters"),gt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var St="3.840.0",yt={version:St};const k="required",i="fn",c="argv",m="ref",F=!0,T="isSet",f="booleanEquals",g="error",S="endpoint",p="tree",C="PartitionResult",b="getAttr",H={[k]:!1,type:"String"},U={[k]:!0,default:!1,type:"Boolean"},q={[m]:"Endpoint"},z={[i]:f,[c]:[{[m]:"UseFIPS"},!0]},G={[i]:f,[c]:[{[m]:"UseDualStack"},!0]},d={},M={[i]:b,[c]:[{[m]:C},"supportsFIPS"]},L={[m]:C},$={[i]:f,[c]:[!0,{[i]:b,[c]:[L,"supportsDualStack"]}]},j=[z],B=[G],V=[{[m]:"Region"}],ft={parameters:{Region:H,UseDualStack:U,UseFIPS:U,Endpoint:H},rules:[{conditions:[{[i]:T,[c]:[q]}],rules:[{conditions:j,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:g},{conditions:B,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:g},{endpoint:{url:q,properties:d,headers:d},type:S}],type:p},{conditions:[{[i]:T,[c]:V}],rules:[{conditions:[{[i]:"aws.partition",[c]:V,assign:C}],rules:[{conditions:[z,G],rules:[{conditions:[{[i]:f,[c]:[F,M]},$],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:S}],type:p},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:g}],type:p},{conditions:j,rules:[{conditions:[{[i]:f,[c]:[M,F]}],rules:[{conditions:[{[i]:"stringEquals",[c]:[{[i]:b,[c]:[L,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:d,headers:d},type:S},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:S}],type:p},{error:"FIPS is enabled but this partition does not support FIPS",type:g}],type:p},{conditions:B,rules:[{conditions:[$],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:S}],type:p},{error:"DualStack is enabled but this partition does not support DualStack",type:g}],type:p},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:S}],type:p}],type:p},{error:"Invalid Configuration: Missing Region",type:g}]},Et=ft,Pt=new te({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),vt=o((e,t={})=>Pt.get(e,()=>se(Et,{endpointParams:e,logger:t.logger})),"defaultEndpointResolver");ne.aws=oe;const xt=o(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ue,base64Encoder:e?.base64Encoder??pe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??vt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??lt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:o(t=>t.getIdentityProvider("aws.auth#sigv4"),"identityProvider"),signer:new de},{schemeId:"smithy.api#noAuth",identityProvider:o(t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),"identityProvider"),signer:new dt}],logger:e?.logger??new ce,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??ie,utf8Decoder:e?.utf8Decoder??re,utf8Encoder:e?.utf8Encoder??ae}),"getRuntimeConfig$1"),_t=o(e=>{le(process.version);const t=he(e),s=o(()=>t().then(we),"defaultConfigProvider"),a=xt(e);me(process.version);const n={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??u(Ae,n),bodyLengthChecker:e?.bodyLengthChecker??Ee,defaultUserAgentProvider:e?.defaultUserAgentProvider??fe({serviceId:a.serviceId,clientVersion:yt.version}),maxAttempts:e?.maxAttempts??u(be,e),region:e?.region??u(Ce,{...Re,...n}),requestHandler:ye.create(e?.requestHandler??s),retryMode:e?.retryMode??u({..._e,default:o(async()=>(await s()).retryMode||Ie,"default")},e),sha256:e?.sha256??Se.bind(null,"sha256"),streamCollector:e?.streamCollector??ge,useDualstackEndpoint:e?.useDualstackEndpoint??u(xe,n),useFipsEndpoint:e?.useFipsEndpoint??u(ve,n),userAgentAppId:e?.userAgentAppId??u(Pe,n)}},"getRuntimeConfig"),It=o(e=>{const t=e.httpAuthSchemes;let s=e.httpAuthSchemeProvider,a=e.credentials;return{setHttpAuthScheme(n){const r=t.findIndex(_=>_.schemeId===n.schemeId);r===-1?t.push(n):t.splice(r,1,n)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(n){s=n},httpAuthSchemeProvider(){return s},setCredentials(n){a=n},credentials(){return a}}},"getHttpAuthExtensionConfiguration"),Rt=o(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),"resolveHttpAuthRuntimeConfig"),Ct=o((e,t)=>{const s=Object.assign(Oe(e),Ne(e),De(e),It(e));return t.forEach(a=>a.configure(s)),Object.assign(e,ke(s),Fe(s),Te(s),Rt(s))},"resolveRuntimeExtensions");class bt extends He{static{o(this,"SSOClient")}config;constructor(...[t]){const s=_t(t||{});super(s),this.initConfig=s;const a=mt(s),n=Ue(a),r=qe(n),_=ze(r),J=Me(_),K=Ge(J),W=ht(K),Y=Ct(W,t?.extensions||[]);this.config=Y,this.middlewareStack.use(Le(this.config)),this.middlewareStack.use($e(this.config)),this.middlewareStack.use(je(this.config)),this.middlewareStack.use(Be(this.config)),this.middlewareStack.use(Ve(this.config)),this.middlewareStack.use(Je(this.config)),this.middlewareStack.use(Ke(this.config,{httpAuthSchemeParametersProvider:pt,identityProviderConfigProvider:o(async X=>new We({"aws.auth#sigv4":X.credentials}),"identityProviderConfigProvider")})),this.middlewareStack.use(Ye(this.config))}destroy(){super.destroy()}}class h extends Xe{static{o(this,"SSOServiceException")}constructor(t){super(t),Object.setPrototypeOf(this,h.prototype)}}class A extends h{static{o(this,"InvalidRequestException")}name="InvalidRequestException";$fault="client";constructor(t){super({name:"InvalidRequestException",$fault:"client",...t}),Object.setPrototypeOf(this,A.prototype)}}class w extends h{static{o(this,"ResourceNotFoundException")}name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,w.prototype)}}class O extends h{static{o(this,"TooManyRequestsException")}name="TooManyRequestsException";$fault="client";constructor(t){super({name:"TooManyRequestsException",$fault:"client",...t}),Object.setPrototypeOf(this,O.prototype)}}class N extends h{static{o(this,"UnauthorizedException")}name="UnauthorizedException";$fault="client";constructor(t){super({name:"UnauthorizedException",$fault:"client",...t}),Object.setPrototypeOf(this,N.prototype)}}const At=o(e=>({...e,...e.accessToken&&{accessToken:I}}),"GetRoleCredentialsRequestFilterSensitiveLog"),wt=o(e=>({...e,...e.secretAccessKey&&{secretAccessKey:I},...e.sessionToken&&{sessionToken:I}}),"RoleCredentialsFilterSensitiveLog"),Ot=o(e=>({...e,...e.roleCredentials&&{roleCredentials:wt(e.roleCredentials)}}),"GetRoleCredentialsResponseFilterSensitiveLog"),Nt=o(async(e,t)=>{const s=Ze(e,t),a=l({},Qe,{[jt]:e[Gt]});s.bp("/federation/credentials");const n=l({[$t]:[,R(e[Lt],"roleName")],[Mt]:[,R(e[zt],"accountId")]});return s.m("GET").h(a).q(n).b(void 0),s.build()},"se_GetRoleCredentialsCommand"),Dt=o(async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return kt(e,t);const s=l({$metadata:E(e)}),a=R(et(await at(e.body,t)),"body"),n=y(a,{roleCredentials:ct});return Object.assign(s,n),s},"de_GetRoleCredentialsCommand"),kt=o(async(e,t)=>{const s={...e,body:await rt(e.body,t)},a=it(e,s.body);switch(a){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await Tt(s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await Ht(s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await Ut(s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await qt(s);default:const n=s.body;return Ft({output:e,parsedBody:n,errorCode:a})}},"de_CommandError"),Ft=tt(h),Tt=o(async(e,t)=>{const s=l({}),a=e.body,n=y(a,{message:P});Object.assign(s,n);const r=new A({$metadata:E(e),...s});return v(r,e.body)},"de_InvalidRequestExceptionRes"),Ht=o(async(e,t)=>{const s=l({}),a=e.body,n=y(a,{message:P});Object.assign(s,n);const r=new w({$metadata:E(e),...s});return v(r,e.body)},"de_ResourceNotFoundExceptionRes"),Ut=o(async(e,t)=>{const s=l({}),a=e.body,n=y(a,{message:P});Object.assign(s,n);const r=new O({$metadata:E(e),...s});return v(r,e.body)},"de_TooManyRequestsExceptionRes"),qt=o(async(e,t)=>{const s=l({}),a=e.body,n=y(a,{message:P});Object.assign(s,n);const r=new N({$metadata:E(e),...s});return v(r,e.body)},"de_UnauthorizedExceptionRes"),E=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"),zt="accountId",Gt="accessToken",Mt="account_id",Lt="roleName",$t="role_name",jt="x-amz-sso_bearer_token";class Bt extends st.classBuilder().ep(gt).m(function(t,s,a,n){return[ot(a,this.serialize,this.deserialize),nt(a,t.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(At,Ot).ser(Nt).de(Dt).build(){static{o(this,"GetRoleCredentialsCommand")}}export{Bt as GetRoleCredentialsCommand,bt as SSOClient};