@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) • 671 B
JavaScript
import{a as c}from"./chunk-J7PZFXOE.js";import{F as s,I as a,R as o}from"./chunk-FYA6QUPZ.js";var l=class i{accountsApi=a(c);inFlight=!1;lastFetched=0;names=o(new Map);ensure(){if(this.inFlight||Date.now()-this.lastFetched<5e3)return;this.inFlight=!0;let e=()=>{this.inFlight=!1,this.lastFetched=Date.now()};this.accountsApi.listAccountNames().subscribe({next:t=>{this.merge(Object.entries(t)),e()},error:e})}label(e){return this.names().get(e)??e}merge(e){this.names.update(t=>{let n=new Map(t);for(let[p,r]of e)r&&n.set(p,r);return n})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=s({token:i,factory:i.\u0275fac,providedIn:"root"})};export{l as a};