@fntio/infra-client
Version:
Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.
2 lines (1 loc) • 3.02 kB
JavaScript
import{F as r,R as i}from"./chunk-FYA6QUPZ.js";function d(o){return String(o?.message??o??"").includes("profile-conflict")}function u(o){return String(o?.message??o??"").includes("profile-foreign")}var s=class o{api=globalThis.infraDesktop;isDesktop=!!this.api?.isDesktop;platform=this.api?.platform==="darwin"||this.api?.platform==="win32"||this.api?.platform==="linux"?this.api.platform:null;passkeyCapable=!this.isDesktop||(this.api?.passkeyCapable??this.platform==="win32");project=this.api?.project??null;visible=i(this.api?.isVisible?.()??!0);constructor(){this.api?.onVisibility?.(e=>this.visible.set(e))}writeCredentials(e){return this.api?this.api.writeCredentials({account:e.accountNumber,role:e.role,profile:e.profile,accessKeyId:e.creds.accessKeyId,secretKey:e.creds.secretKey,sessionToken:e.creds.sessionToken,expiration:e.creds.expiration}):Promise.reject(new Error("Not running in the desktop app"))}openConsole(e){return this.api?this.api.openConsole(e):Promise.reject(new Error("Not running in the desktop app"))}logout(){return this.api?this.api.logout():Promise.reject(new Error("Not running in the desktop app"))}onRenewAll(e){this.api?.onRenewAll?.(e)}onTrayConnect(e){this.api?.onTrayConnect?.(e)}onNetworkChanged(e){this.api?.onNetworkChanged?.(e)}networkSupported=!!this.api?.network;networkLazyKey=this.api?.network?.lazyKey===!0;networkStatus(){return this.api?.network?this.api.network.status():Promise.reject(new Error("Shell has no network support"))}networkConnect(e,t){return this.api?.network?this.api.network.connect(e,t):Promise.reject(new Error("Shell has no network support"))}networkDisconnect(){return this.api?.network?this.api.network.disconnect():Promise.reject(new Error("Shell has no network support"))}probeSupported=typeof this.api?.network?.probe=="function";notifySupported=typeof this.api?.notify=="function";notifyCloseSupported=typeof this.api?.notifyClose=="function";notify(e,t,n){return this.api?.notify?this.api.notify(e,t,n):Promise.reject(new Error("Shell has no notify support"))}notifyClose(e){return this.api?.notifyClose?this.api.notifyClose(e):Promise.resolve(!1)}onOpenRoute(e){this.api?.onOpenRoute?.(e)}onWake(e){this.api?.onWake?.(e)}sessionEnds(e){this.api?.sessionEnds?.(e)}onRenewSignIn(e){this.api?.onRenewSignIn?.(e)}networkProbe(e,t){return this.api?.network?.probe?this.api.network.probe(e,t):Promise.reject(new Error("Shell has no probe support"))}sharesSupported=!!this.api?.shares;shareStart(e){return this.api?.shares?this.api.shares.start(e):Promise.reject(new Error("Shell has no share support"))}shareStop(e){return this.api?.shares?this.api.shares.stop(e):Promise.reject(new Error("Shell has no share support"))}shareList(){return this.api?.shares?this.api.shares.list():Promise.resolve([])}onShareOpen(e){this.api?.shares?.onOpen?.(e)}onSharesChanged(e){this.api?.shares?.onChanged?.(e)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=r({token:o,factory:o.\u0275fac,providedIn:"root"})};export{d as a,u as b,s as c};