@stacksjs/ts-cloud 0.16.23 → 0.16.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aws/client.d.ts +9 -0
- package/dist/aws/index.js +1 -1
- package/dist/bin/chunk-0cwbg3pf.js +1 -0
- package/dist/bin/{chunk-6cfpdb35.js → chunk-0xxc6dy8.js} +7 -7
- package/dist/bin/chunk-19tmmwmt.js +1 -0
- package/dist/bin/{chunk-2tk8egg8.js → chunk-1j9vy88a.js} +1 -1
- package/dist/bin/{chunk-wyanqf91.js → chunk-21jwbrap.js} +2 -2
- package/dist/bin/{chunk-j0zg3mbm.js → chunk-2q27v6vz.js} +1 -1
- package/dist/bin/{chunk-9h7yjtz2.js → chunk-3jjggqfj.js} +3 -3
- package/dist/bin/{chunk-zcabmq4p.js → chunk-3kvz4kyq.js} +3 -3
- package/dist/bin/chunk-4261t3bq.js +1 -0
- package/dist/bin/chunk-4a98nszr.js +1 -0
- package/dist/bin/{chunk-k1eezsj1.js → chunk-4r46kw46.js} +2 -2
- package/dist/bin/chunk-5mk3sxpw.js +34 -0
- package/dist/bin/{chunk-jtnv8nwz.js → chunk-6nm91cfw.js} +1 -1
- package/dist/bin/{chunk-ht6tpmqw.js → chunk-7412q5cz.js} +2 -2
- package/dist/bin/chunk-78tzgf65.js +1 -0
- package/dist/bin/{chunk-h90azajz.js → chunk-82sbpydz.js} +2 -2
- package/dist/bin/{chunk-ht318ydv.js → chunk-8knkt6sd.js} +1 -1
- package/dist/bin/{chunk-65rndjtr.js → chunk-8wnpx6n2.js} +42 -42
- package/dist/bin/{chunk-k052rtd5.js → chunk-9066j2kz.js} +4 -4
- package/dist/bin/{chunk-34kwhmbt.js → chunk-9464wvf2.js} +5 -5
- package/dist/bin/{chunk-cpwk0pbg.js → chunk-9rya3733.js} +65 -65
- package/dist/bin/chunk-ajv4z454.js +1 -0
- package/dist/bin/chunk-aqreqn37.js +1 -0
- package/dist/bin/chunk-cnmngqqg.js +1 -0
- package/dist/bin/chunk-db9zx72q.js +1 -0
- package/dist/bin/{chunk-8vm7tpyv.js → chunk-dh6kj6ce.js} +2 -2
- package/dist/bin/chunk-dhj4786e.js +1 -0
- package/dist/bin/chunk-eh3235zq.js +1 -0
- package/dist/bin/chunk-es4sdbrr.js +1 -0
- package/dist/bin/{chunk-xs6afjat.js → chunk-fdsh3m2q.js} +3 -3
- package/dist/bin/chunk-g0gqwszk.js +1 -0
- package/dist/bin/chunk-gj530nqd.js +1 -0
- package/dist/bin/chunk-h1618tyv.js +1 -0
- package/dist/bin/chunk-hje6rsxj.js +2 -0
- package/dist/bin/chunk-hwqvx1zb.js +1 -0
- package/dist/bin/chunk-ksfr2ya8.js +1 -0
- package/dist/bin/{chunk-f2yhthd1.js → chunk-mdbzfvba.js} +2 -2
- package/dist/bin/chunk-mfer1e5z.js +1 -0
- package/dist/bin/chunk-mh172wt8.js +1 -0
- package/dist/bin/chunk-mrte8smv.js +1 -0
- package/dist/bin/{chunk-90kpnjdm.js → chunk-n5zwm2z4.js} +12 -12
- package/dist/bin/chunk-n8ya6q6d.js +2 -0
- package/dist/bin/{chunk-en7sf83z.js → chunk-ntmnpteh.js} +6 -6
- package/dist/bin/{chunk-f3sd1hpa.js → chunk-nxyhheav.js} +5 -5
- package/dist/bin/chunk-p1cv4n00.js +2 -0
- package/dist/bin/{chunk-t1jpqn4x.js → chunk-q3xwh0r8.js} +6 -6
- package/dist/bin/chunk-s7axkfrs.js +1 -0
- package/dist/bin/{chunk-tyqxz92e.js → chunk-t5gkbppg.js} +105 -105
- package/dist/bin/{chunk-jbpkwxht.js → chunk-td8zgch7.js} +5 -5
- package/dist/bin/{chunk-gzpwf3n4.js → chunk-tnzp96vn.js} +2 -2
- package/dist/bin/{chunk-0r45d0s3.js → chunk-v4e4726j.js} +1 -1
- package/dist/bin/{chunk-33e0t7e5.js → chunk-w23en85y.js} +2 -2
- package/dist/bin/{chunk-21zhm1mk.js → chunk-wsedynyb.js} +6 -6
- package/dist/bin/{chunk-v002yxaf.js → chunk-xss6yj73.js} +2 -2
- package/dist/bin/{chunk-btr6zq53.js → chunk-y4g86dpe.js} +3 -3
- package/dist/bin/{chunk-hqmkfh4a.js → chunk-y6rgvb7r.js} +1 -1
- package/dist/bin/chunk-yavtz60y.js +1 -0
- package/dist/bin/{chunk-yxyvhqhr.js → chunk-z5ycwy38.js} +2 -2
- package/dist/bin/{chunk-gfwkmttt.js → chunk-z96ssb7e.js} +1 -1
- package/dist/bin/chunk-zq02x716.js +1 -0
- package/dist/bin/cli.js +285 -285
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/{chunk-hpq0rrve.js → chunk-08tswmb3.js} +1 -1
- package/dist/{chunk-gm0qysea.js → chunk-0p7ddjt6.js} +10 -10
- package/dist/chunk-2nma0bd8.js +92 -0
- package/dist/chunk-31qham3c.js +1 -0
- package/dist/chunk-3zv0e36t.js +34 -0
- package/dist/{chunk-c836kdrx.js → chunk-49p5cx21.js} +29 -29
- package/dist/{chunk-t7q4awss.js → chunk-5db32a4x.js} +2 -2
- package/dist/{chunk-60fn008g.js → chunk-6e5j40n9.js} +2 -2
- package/dist/chunk-7fbfmpyx.js +1 -0
- package/dist/{chunk-4apkvhsc.js → chunk-7p1653g6.js} +83 -83
- package/dist/{chunk-cpyrhh52.js → chunk-826gp2kd.js} +142 -142
- package/dist/{chunk-92gn9ght.js → chunk-98qx6m9h.js} +19 -19
- package/dist/{chunk-rq0wrpz6.js → chunk-b10n1xy5.js} +4 -4
- package/dist/{chunk-j2w0cvnr.js → chunk-dm6kyz6e.js} +1 -1
- package/dist/chunk-dschvakr.js +1 -0
- package/dist/chunk-e44ajkha.js +5 -0
- package/dist/chunk-e4z4tfh6.js +1 -0
- package/dist/{chunk-bz1hp7es.js → chunk-gvybjt7y.js} +1 -1
- package/dist/{chunk-xassxhvq.js → chunk-h85wqdvr.js} +7 -7
- package/dist/{chunk-nfkdgsgh.js → chunk-jwx5t3vf.js} +11 -11
- package/dist/chunk-kmwnzw91.js +1 -0
- package/dist/{chunk-14zcywnp.js → chunk-q0g0rjn3.js} +2 -2
- package/dist/{chunk-ckwdjb5q.js → chunk-qfqh21rq.js} +5 -5
- package/dist/{chunk-b5xjjz3y.js → chunk-r1730x8g.js} +5 -5
- package/dist/{chunk-g6aev693.js → chunk-rr1qjxyj.js} +1 -1
- package/dist/chunk-rxs4y74z.js +2 -0
- package/dist/{chunk-xkqx98bx.js → chunk-setpnrtg.js} +2 -2
- package/dist/chunk-tvwrthfq.js +2 -0
- package/dist/{chunk-ds2v2xpb.js → chunk-w23wrsa4.js} +123 -123
- package/dist/{chunk-5vxpgw8q.js → chunk-wrpnnrdf.js} +5 -5
- package/dist/{chunk-pdmfmsm9.js → chunk-x9bpm5s1.js} +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/dns/index.js +1 -1
- package/dist/drivers/index.js +1 -1
- package/dist/index.js +43 -43
- package/dist/operations/index.js +1 -1
- package/dist/protection/index.js +1 -1
- package/dist/spend/index.js +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +6 -6
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +6 -6
- package/dist/ui/data/services.html +6 -6
- package/dist/ui/data/volumes.html +6 -6
- package/dist/ui/index.html +5 -5
- package/dist/ui/infrastructure/topology.html +6 -6
- package/dist/ui/integrations.html +2 -2
- package/dist/ui/operations/alerts.html +6 -6
- package/dist/ui/operations/configuration.html +6 -6
- package/dist/ui/operations/jobs.html +6 -6
- package/dist/ui/operations/maintenance.html +6 -6
- package/dist/ui/operations/observability.html +6 -6
- package/dist/ui/operations/previews.html +6 -6
- package/dist/ui/operations/queue.html +6 -6
- package/dist/ui/operations/regions.html +6 -6
- package/dist/ui/operations/releases.html +6 -6
- package/dist/ui/operations/spend.html +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +2 -2
- package/dist/ui/server/actions.html +6 -6
- package/dist/ui/server/activity.html +1 -1
- package/dist/ui/server/capacity.html +6 -6
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +6 -6
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +5 -5
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +6 -6
- package/dist/ui/server/security.html +2 -2
- package/dist/ui/server/services.html +2 -2
- package/dist/ui/server/sites.html +6 -6
- package/dist/ui/server/ssh-keys.html +6 -6
- package/dist/ui/server/team.html +6 -6
- package/dist/ui/server/terminal.html +2 -2
- package/dist/ui/serverless/alarms.html +6 -6
- package/dist/ui/serverless/assets.html +2 -2
- package/dist/ui/serverless/cost.html +2 -2
- package/dist/ui/serverless/data.html +6 -6
- package/dist/ui/serverless/deployments.html +2 -2
- package/dist/ui/serverless/firewall.html +1 -1
- package/dist/ui/serverless/functions.html +6 -6
- package/dist/ui/serverless/logs.html +6 -6
- package/dist/ui/serverless/metrics.html +1 -1
- package/dist/ui/serverless/queues.html +6 -6
- package/dist/ui/serverless/secrets.html +6 -6
- package/dist/ui/serverless/traces.html +6 -6
- package/dist/ui/serverless.html +5 -5
- package/package.json +3 -3
- package/dist/bin/chunk-0d98bem8.js +0 -2
- package/dist/bin/chunk-2g1j00yc.js +0 -1
- package/dist/bin/chunk-4xmhrvfa.js +0 -1
- package/dist/bin/chunk-6crapvp1.js +0 -1
- package/dist/bin/chunk-7b4gf64x.js +0 -1
- package/dist/bin/chunk-818tj49e.js +0 -1
- package/dist/bin/chunk-92qsww97.js +0 -1
- package/dist/bin/chunk-9947rscj.js +0 -1
- package/dist/bin/chunk-cas0bp91.js +0 -2
- package/dist/bin/chunk-cyap08qg.js +0 -1
- package/dist/bin/chunk-dk92s260.js +0 -1
- package/dist/bin/chunk-ejxp74ks.js +0 -1
- package/dist/bin/chunk-gx98tkpf.js +0 -1
- package/dist/bin/chunk-hcdbw9j1.js +0 -1
- package/dist/bin/chunk-hdsgfgnz.js +0 -34
- package/dist/bin/chunk-kay11qc7.js +0 -1
- package/dist/bin/chunk-n28a9a9c.js +0 -1
- package/dist/bin/chunk-n298azax.js +0 -2
- package/dist/bin/chunk-q8w7fa56.js +0 -1
- package/dist/bin/chunk-qdnx952p.js +0 -1
- package/dist/bin/chunk-tr0pkm4p.js +0 -1
- package/dist/bin/chunk-tytvrehe.js +0 -1
- package/dist/bin/chunk-wpp0fa94.js +0 -1
- package/dist/bin/chunk-xzgxwnb7.js +0 -1
- package/dist/bin/chunk-y21yk6zv.js +0 -1
- package/dist/bin/chunk-yt1t5ct8.js +0 -1
- package/dist/bin/chunk-zs8ddeaz.js +0 -1
- package/dist/chunk-01rbgche.js +0 -2
- package/dist/chunk-2hy7ny4k.js +0 -5
- package/dist/chunk-4rb7stp5.js +0 -92
- package/dist/chunk-cwgy9pvc.js +0 -34
- package/dist/chunk-e4qh4c2n.js +0 -1
- package/dist/chunk-pj9z4fjv.js +0 -1
- package/dist/chunk-twhbns31.js +0 -1
- package/dist/chunk-wkg22nj5.js +0 -1
- package/dist/chunk-xtd0s5ep.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{yt,wd,Ts,uo,cp,Es,ws,po,Mt,lp,Cd,dp,up,V,Cs,pp}from"./chunk-btr6zq53.js";import"./chunk-2tk8egg8.js";import"./chunk-9h7yjtz2.js";import"./chunk-0r45d0s3.js";import"./chunk-j0zg3mbm.js";import"./chunk-t1jpqn4x.js";import"./chunk-tyqxz92e.js";export{uo as assertEnvWithinLimit,Ts as buildFunctionEnv,cp as deployServerlessApp,dp as getCommandRecord,wd as infraEnvFromOutputs,Cd as listCommandHistory,Es as redeployServerlessApp,yt as resolveServerlessFunctions,pp as restoreServerlessDatabase,ws as rollbackServerlessApp,lp as runAndRecordCommand,up as runDbQuery,Mt as runRemoteCommand,Cs as scaleServerlessDatabase,V as serverlessInfo,po as setMaintenance};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gi,u,N,Vs}from"./chunk-t1jpqn4x.js";export{u as AWSClient,N as buildQueryParams,Vs as detectCredentialSource,gi as resolveS3Endpoint};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ns,mp,gp,Ds}from"./chunk-xs6afjat.js";import"./chunk-6cfpdb35.js";import"./chunk-tyqxz92e.js";export{mp as getComputeDeployHistory,Ds as restoreDatabaseBackup,Ns as rollbackComputeSite,gp as runComputeRecipe};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W,so}from"./chunk-k1eezsj1.js";import"./chunk-8vm7tpyv.js";import"./chunk-t1jpqn4x.js";export{W as ACMClient,so as ACMDnsValidator};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v}from"./chunk-0r45d0s3.js";import"./chunk-t1jpqn4x.js";export{v as CloudFormationClient};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Td,oc,Ed,ao,co,lo,vs}from"./chunk-k052rtd5.js";import"./chunk-tyqxz92e.js";export{Td as MANAGEMENT_DASHBOARD_SITE,vs as buildManagementDashboardArtifact,oc as dashboardCredentialsFile,co as ensureManagementDashboard,lo as managementDashboardSiteNames,Ed as resolveDashboardAuth,ao as resolveUiSource};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ct}from"./chunk-jtnv8nwz.js";import"./chunk-t1jpqn4x.js";export{ct as STSClient};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Yl,Zl,ed,td,Fu,ju}from"./chunk-jbpkwxht.js";import"./chunk-k1eezsj1.js";import"./chunk-en7sf83z.js";import"./chunk-0r45d0s3.js";import"./chunk-8vm7tpyv.js";import"./chunk-j0zg3mbm.js";import"./chunk-t1jpqn4x.js";export{Fu as deleteStaticSite,Zl as deployStaticSite,ju as deployStaticSiteFull,Yl as generateStaticSiteTemplate,td as invalidateCache,ed as uploadStaticFiles};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g}from"./chunk-j0zg3mbm.js";import"./chunk-t1jpqn4x.js";export{g as S3Client};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{uc,fp}from"./chunk-hdsgfgnz.js";import"./chunk-8vm7tpyv.js";import"./chunk-j0zg3mbm.js";import"./chunk-t1jpqn4x.js";export{uc as EmailClient,fp as email};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ou,Xl,wa,Ca,Ql,Lu,Mu,Gt,un,Kt,Ii,Uu,pn,jo}from"./chunk-ht318ydv.js";import{Xe,hs,ic,oi,ys,sp}from"./chunk-34kwhmbt.js";import{yd,Yi,Sd,bd,vd,yr,ap,Zi}from"./chunk-21zhm1mk.js";import{ya,Sa,ba,Ul,Uo,Bl,Fl,va,jl,Vl}from"./chunk-tyqxz92e.js";export{Sa as CHAIN_HEADER,un as DEFAULT_ATTACK_MODE_HOURS,yd as DEFAULT_DDOS_THRESHOLDS,Uo as DEFAULT_RECURSION_LIMITS,ya as DEPTH_HEADER,Gt as MAX_CONTROL_HOURS,Kt as ProtectionControlStore,Ou as RATE_LIMIT_KEY_SEPARATOR,Ql as RateLimiter,va as RecursionGuard,ba as TRACE_HEADER,pn as applyControlsToDdos,Uu as applyControlsToRateLimits,Zi as applyMitigationFactor,Mu as defaultRateLimitRules,Ii as describePosture,Xe as escapeSecLang,Ul as functionFingerprint,Xl as globMatches,ic as globToRegex,Fl as inspectInvocation,hs as isSafePattern,Yi as isValidCidr,jo as mergeControlsIntoConfig,Bl as parseChain,ap as planMitigation,jl as propagationHeaders,Lu as rateLimitHeaders,Ca as rateLimitKey,Vl as recursionBlockedResponse,yr as renderDdosInstallScript,vd as renderNftablesRuleset,bd as renderSysctlFile,oi as renderWafConfig,ys as renderWafInstallScript,wa as ruleMatches,Sd as sysctlHardening,sp as wafEventTelemetry};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{Ft,u}from"./chunk-t1jpqn4x.js";import{g}from"./chunk-j0zg3mbm.js";import{U}from"./chunk-8vm7tpyv.js";import{_}from"./chunk-cas0bp91.js";import{mi}from"./chunk-yxyvhqhr.js";function R(e,t){let r=[`Action=${e}`,"Version=2010-05-08"];for(let[a,i]of Object.entries(t)){if(i===void 0||i===null)continue;if(Array.isArray(i))i.forEach((n,o)=>{if(typeof n==="object"&&n!==null)for(let[m,l]of Object.entries(n))r.push(`${a}.member.${o+1}.${m}=${encodeURIComponent(String(l))}`);else r.push(`${a}.member.${o+1}=${encodeURIComponent(String(n))}`)});else if(typeof i==="object"){for(let[n,o]of Object.entries(i))if(o!==void 0&&o!==null)r.push(`${a}.${n}=${encodeURIComponent(String(o))}`)}else r.push(`${a}=${encodeURIComponent(String(i))}`)}return r.join("&")}var f=new Ft({ignoreAttributes:!0,parseTagValue:!1,trimValues:!0});function S(e){if(typeof e!=="string"||!e.trim())return{};return f.parse(e)}function s(e,t){let r=[e];while(r.length>0){let a=[];for(let i of r){if(!i||typeof i!=="object")continue;if(Array.isArray(i)){a.push(...i);continue}if(t in i){let n=i[t];return typeof n==="string"?n:void 0}a.push(...Object.values(i))}r=a}return}function c(e,t,r){let a=[e];while(a.length>0){let i=[];for(let n of a){if(!n||typeof n!=="object")continue;if(Array.isArray(n)){i.push(...n);continue}if(t in n){let o=n[t]?.[r];return o===void 0||o===null?[]:Array.isArray(o)?o:[o]}i.push(...Object.values(n))}a=i}return[]}class Z{client;region;constructor(e="us-east-1",t){this.client=new u(void 0,{profile:t}),this.region=e}async request(e,t={}){let r=R(e,t),a=await this.client.request({service:"iam",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r,rawResponse:!0});return S(a)}async createUser(e){let t=await this.request("CreateUser",e);return this.parseUser(t)}async getUser(e={}){let t=await this.request("GetUser",e);return this.parseUser(t)}async listUsers(e={}){let t=await this.request("ListUsers",e),r=this.parseUsers(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{Users:r,IsTruncated:a,Marker:i}}async updateUser(e){await this.request("UpdateUser",e)}async deleteUser(e){await this.request("DeleteUser",e)}parseUser(e){return{UserName:s(e,"UserName")||"",UserId:s(e,"UserId")||"",Arn:s(e,"Arn")||"",Path:s(e,"Path"),CreateDate:s(e,"CreateDate"),PasswordLastUsed:s(e,"PasswordLastUsed")}}parseUsers(e){return c(e,"Users","member").map((r)=>({UserName:s(r,"UserName")||"",UserId:s(r,"UserId")||"",Arn:s(r,"Arn")||"",Path:s(r,"Path"),CreateDate:s(r,"CreateDate"),PasswordLastUsed:s(r,"PasswordLastUsed")}))}async createGroup(e){let t=await this.request("CreateGroup",e);return this.parseGroup(t)}async getGroup(e){let t=await this.request("GetGroup",e),r=this.parseGroup(t),a=this.parseUsers(t),i=s(t,"IsTruncated")==="true",n=s(t,"Marker");return{Group:r,Users:a,IsTruncated:i,Marker:n}}async listGroups(e={}){let t=await this.request("ListGroups",e),r=this.parseGroups(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{Groups:r,IsTruncated:a,Marker:i}}async updateGroup(e){await this.request("UpdateGroup",e)}async deleteGroup(e){await this.request("DeleteGroup",e)}async addUserToGroup(e){await this.request("AddUserToGroup",e)}async removeUserFromGroup(e){await this.request("RemoveUserFromGroup",e)}async listGroupsForUser(e){let t=await this.request("ListGroupsForUser",e),r=this.parseGroups(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{Groups:r,IsTruncated:a,Marker:i}}parseGroup(e){return{GroupName:s(e,"GroupName")||"",GroupId:s(e,"GroupId")||"",Arn:s(e,"Arn")||"",Path:s(e,"Path"),CreateDate:s(e,"CreateDate")}}parseGroups(e){return c(e,"Groups","member").map((r)=>({GroupName:s(r,"GroupName")||"",GroupId:s(r,"GroupId")||"",Arn:s(r,"Arn")||"",Path:s(r,"Path"),CreateDate:s(r,"CreateDate")}))}async createRole(e){let t=await this.request("CreateRole",e);return this.parseRole(t)}async getRole(e){let t=await this.request("GetRole",e);return this.parseRole(t)}async listRoles(e={}){let t=await this.request("ListRoles",e),r=this.parseRoles(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{Roles:r,IsTruncated:a,Marker:i}}async updateRole(e){await this.request("UpdateRole",e)}async updateRoleDescription(e){let t=await this.request("UpdateRoleDescription",e);return this.parseRole(t)}async updateAssumeRolePolicy(e){await this.request("UpdateAssumeRolePolicy",e)}async deleteRole(e){await this.request("DeleteRole",e)}async tagRole(e){await this.request("TagRole",e)}async untagRole(e){await this.request("UntagRole",e)}async listRoleTags(e){let t=await this.request("ListRoleTags",e),r=this.parseTags(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{Tags:r,IsTruncated:a,Marker:i}}parseRole(e){return{RoleName:s(e,"RoleName")||"",RoleId:s(e,"RoleId")||"",Arn:s(e,"Arn")||"",Path:s(e,"Path"),CreateDate:s(e,"CreateDate"),AssumeRolePolicyDocument:s(e,"AssumeRolePolicyDocument"),Description:s(e,"Description"),MaxSessionDuration:s(e,"MaxSessionDuration")?Number.parseInt(s(e,"MaxSessionDuration"),10):void 0}}parseRoles(e){return c(e,"Roles","member").map((r)=>({RoleName:s(r,"RoleName")||"",RoleId:s(r,"RoleId")||"",Arn:s(r,"Arn")||"",Path:s(r,"Path"),CreateDate:s(r,"CreateDate"),AssumeRolePolicyDocument:s(r,"AssumeRolePolicyDocument"),Description:s(r,"Description"),MaxSessionDuration:s(r,"MaxSessionDuration")?Number.parseInt(s(r,"MaxSessionDuration"),10):void 0}))}parseTags(e){return c(e,"Tags","member").map((r)=>({Key:s(r,"Key")||"",Value:s(r,"Value")||""}))}async createPolicy(e){let t=await this.request("CreatePolicy",e);return this.parsePolicy(t)}async getPolicy(e){let t=await this.request("GetPolicy",e);return this.parsePolicy(t)}async getPolicyVersion(e){let t=await this.request("GetPolicyVersion",e);return{VersionId:s(t,"VersionId")||"",IsDefaultVersion:s(t,"IsDefaultVersion")==="true",CreateDate:s(t,"CreateDate"),Document:s(t,"Document")}}async listPolicies(e={}){let t=await this.request("ListPolicies",e),r=this.parsePolicies(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{Policies:r,IsTruncated:a,Marker:i}}async listPolicyVersions(e){let t=await this.request("ListPolicyVersions",e),r=this.parsePolicyVersions(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{Versions:r,IsTruncated:a,Marker:i}}async createPolicyVersion(e){let t=await this.request("CreatePolicyVersion",e);return{VersionId:s(t,"VersionId")||"",IsDefaultVersion:s(t,"IsDefaultVersion")==="true",CreateDate:s(t,"CreateDate")}}async deletePolicyVersion(e){await this.request("DeletePolicyVersion",e)}async setDefaultPolicyVersion(e){await this.request("SetDefaultPolicyVersion",e)}async deletePolicy(e){await this.request("DeletePolicy",e)}async attachUserPolicy(e){await this.request("AttachUserPolicy",e)}async detachUserPolicy(e){await this.request("DetachUserPolicy",e)}async attachGroupPolicy(e){await this.request("AttachGroupPolicy",e)}async detachGroupPolicy(e){await this.request("DetachGroupPolicy",e)}async attachRolePolicy(e){await this.request("AttachRolePolicy",e)}async detachRolePolicy(e){await this.request("DetachRolePolicy",e)}async listAttachedUserPolicies(e){let t=await this.request("ListAttachedUserPolicies",e),r=this.parseAttachedPolicies(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{AttachedPolicies:r,IsTruncated:a,Marker:i}}async listAttachedGroupPolicies(e){let t=await this.request("ListAttachedGroupPolicies",e),r=this.parseAttachedPolicies(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{AttachedPolicies:r,IsTruncated:a,Marker:i}}async listAttachedRolePolicies(e){let t=await this.request("ListAttachedRolePolicies",e),r=this.parseAttachedPolicies(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{AttachedPolicies:r,IsTruncated:a,Marker:i}}parsePolicy(e){return{PolicyName:s(e,"PolicyName")||"",PolicyId:s(e,"PolicyId")||"",Arn:s(e,"Arn")||"",Path:s(e,"Path"),DefaultVersionId:s(e,"DefaultVersionId"),AttachmentCount:s(e,"AttachmentCount")?Number.parseInt(s(e,"AttachmentCount"),10):void 0,PermissionsBoundaryUsageCount:s(e,"PermissionsBoundaryUsageCount")?Number.parseInt(s(e,"PermissionsBoundaryUsageCount"),10):void 0,IsAttachable:s(e,"IsAttachable")==="true",Description:s(e,"Description"),CreateDate:s(e,"CreateDate"),UpdateDate:s(e,"UpdateDate")}}parsePolicies(e){return c(e,"Policies","member").map((r)=>({PolicyName:s(r,"PolicyName")||"",PolicyId:s(r,"PolicyId")||"",Arn:s(r,"Arn")||"",Path:s(r,"Path"),DefaultVersionId:s(r,"DefaultVersionId"),AttachmentCount:s(r,"AttachmentCount")?Number.parseInt(s(r,"AttachmentCount"),10):void 0,PermissionsBoundaryUsageCount:s(r,"PermissionsBoundaryUsageCount")?Number.parseInt(s(r,"PermissionsBoundaryUsageCount"),10):void 0,IsAttachable:s(r,"IsAttachable")==="true",Description:s(r,"Description"),CreateDate:s(r,"CreateDate"),UpdateDate:s(r,"UpdateDate")}))}parsePolicyVersions(e){return c(e,"Versions","member").map((r)=>({VersionId:s(r,"VersionId")||"",IsDefaultVersion:s(r,"IsDefaultVersion")==="true",CreateDate:s(r,"CreateDate")}))}parseAttachedPolicies(e){return c(e,"AttachedPolicies","member").map((r)=>({PolicyName:s(r,"PolicyName")||"",PolicyArn:s(r,"PolicyArn")||""}))}async putUserPolicy(e){await this.request("PutUserPolicy",e)}async getUserPolicy(e){let t=await this.request("GetUserPolicy",e);return{UserName:s(t,"UserName")||"",PolicyName:s(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(s(t,"PolicyDocument")||"")}}async deleteUserPolicy(e){await this.request("DeleteUserPolicy",e)}async listUserPolicies(e){let t=await this.request("ListUserPolicies",e),r=c(t,"PolicyNames","member"),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{PolicyNames:r,IsTruncated:a,Marker:i}}async putGroupPolicy(e){await this.request("PutGroupPolicy",e)}async getGroupPolicy(e){let t=await this.request("GetGroupPolicy",e);return{GroupName:s(t,"GroupName")||"",PolicyName:s(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(s(t,"PolicyDocument")||"")}}async deleteGroupPolicy(e){await this.request("DeleteGroupPolicy",e)}async listGroupPolicies(e){let t=await this.request("ListGroupPolicies",e),r=c(t,"PolicyNames","member"),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{PolicyNames:r,IsTruncated:a,Marker:i}}async putRolePolicy(e){await this.request("PutRolePolicy",e)}async getRolePolicy(e){let t=await this.request("GetRolePolicy",e);return{RoleName:s(t,"RoleName")||"",PolicyName:s(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(s(t,"PolicyDocument")||"")}}async deleteRolePolicy(e){await this.request("DeleteRolePolicy",e)}async listRolePolicies(e){let t=await this.request("ListRolePolicies",e),r=c(t,"PolicyNames","member"),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{PolicyNames:r,IsTruncated:a,Marker:i}}async createAccessKey(e={}){let t=await this.request("CreateAccessKey",e);if(typeof t==="object"){let r=t?.CreateAccessKeyResult?.AccessKey||t?.AccessKey;if(r)return{AccessKey:{UserName:r.UserName||"",AccessKeyId:r.AccessKeyId||"",Status:r.Status||"Active",SecretAccessKey:r.SecretAccessKey||"",CreateDate:r.CreateDate}}}return{AccessKey:{UserName:s(t,"UserName")||"",AccessKeyId:s(t,"AccessKeyId")||"",Status:s(t,"Status")||"Active",SecretAccessKey:s(t,"SecretAccessKey")||"",CreateDate:s(t,"CreateDate")}}}async listAccessKeys(e={}){let t=await this.request("ListAccessKeys",e),r=this.parseAccessKeys(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{AccessKeyMetadata:r,IsTruncated:a,Marker:i}}async updateAccessKey(e){await this.request("UpdateAccessKey",e)}async deleteAccessKey(e){await this.request("DeleteAccessKey",e)}async getAccessKeyLastUsed(e){let t=await this.request("GetAccessKeyLastUsed",e);return{UserName:s(t,"UserName")||"",AccessKeyLastUsed:{LastUsedDate:s(t,"LastUsedDate"),ServiceName:s(t,"ServiceName"),Region:s(t,"Region")}}}parseAccessKeys(e){return c(e,"AccessKeyMetadata","member").map((r)=>({UserName:s(r,"UserName"),AccessKeyId:s(r,"AccessKeyId")||"",Status:s(r,"Status")||"Active",CreateDate:s(r,"CreateDate")}))}async createInstanceProfile(e){let t=await this.request("CreateInstanceProfile",e);return this.parseInstanceProfile(t)}async getInstanceProfile(e){let t=await this.request("GetInstanceProfile",e);return this.parseInstanceProfile(t)}async listInstanceProfiles(e={}){let t=await this.request("ListInstanceProfiles",e),r=this.parseInstanceProfiles(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{InstanceProfiles:r,IsTruncated:a,Marker:i}}async listInstanceProfilesForRole(e){let t=await this.request("ListInstanceProfilesForRole",e),r=this.parseInstanceProfiles(t),a=s(t,"IsTruncated")==="true",i=s(t,"Marker");return{InstanceProfiles:r,IsTruncated:a,Marker:i}}async addRoleToInstanceProfile(e){await this.request("AddRoleToInstanceProfile",e)}async removeRoleFromInstanceProfile(e){await this.request("RemoveRoleFromInstanceProfile",e)}async deleteInstanceProfile(e){await this.request("DeleteInstanceProfile",e)}parseInstanceProfile(e){return{InstanceProfileName:s(e,"InstanceProfileName")||"",InstanceProfileId:s(e,"InstanceProfileId")||"",Arn:s(e,"Arn")||"",Path:s(e,"Path"),CreateDate:s(e,"CreateDate")}}parseInstanceProfiles(e){return c(e,"InstanceProfiles","member").map((r)=>({InstanceProfileName:s(r,"InstanceProfileName")||"",InstanceProfileId:s(r,"InstanceProfileId")||"",Arn:s(r,"Arn")||"",Path:s(r,"Path"),CreateDate:s(r,"CreateDate")}))}async getAccountPasswordPolicy(){let e=await this.request("GetAccountPasswordPolicy");return{MinimumPasswordLength:s(e,"MinimumPasswordLength")?Number.parseInt(s(e,"MinimumPasswordLength"),10):void 0,RequireSymbols:s(e,"RequireSymbols")==="true",RequireNumbers:s(e,"RequireNumbers")==="true",RequireUppercaseCharacters:s(e,"RequireUppercaseCharacters")==="true",RequireLowercaseCharacters:s(e,"RequireLowercaseCharacters")==="true",AllowUsersToChangePassword:s(e,"AllowUsersToChangePassword")==="true",ExpirePasswords:s(e,"ExpirePasswords")==="true",MaxPasswordAge:s(e,"MaxPasswordAge")?Number.parseInt(s(e,"MaxPasswordAge"),10):void 0,PasswordReusePrevention:s(e,"PasswordReusePrevention")?Number.parseInt(s(e,"PasswordReusePrevention"),10):void 0,HardExpiry:s(e,"HardExpiry")==="true"}}async updateAccountPasswordPolicy(e){await this.request("UpdateAccountPasswordPolicy",e)}async deleteAccountPasswordPolicy(){await this.request("DeleteAccountPasswordPolicy")}async getAccountSummary(){let e=await this.request("GetAccountSummary"),t={},r=c(e,"SummaryMap","entry");for(let a of r){let i=s(a,"key"),n=s(a,"value");if(i&&n)t[i]=Number.parseInt(n,10)}return t}async listAccountAliases(){let e=await this.request("ListAccountAliases"),t=c(e,"AccountAliases","member"),r=s(e,"IsTruncated")==="true",a=s(e,"Marker");return{AccountAliases:t,IsTruncated:r,Marker:a}}async createAccountAlias(e){await this.request("CreateAccountAlias",e)}async deleteAccountAlias(e){await this.request("DeleteAccountAlias",e)}async simulatePrincipalPolicy(e){let t=await this.request("SimulatePrincipalPolicy",e);return this.parseSimulationResults(t)}parseSimulationResults(e){let r=c(e,"EvaluationResults","member").map((n)=>{let m=c(n,"MatchedStatements","member").map((l)=>({SourcePolicyId:s(l,"SourcePolicyId"),SourcePolicyType:s(l,"SourcePolicyType")}));return{EvalActionName:s(n,"EvalActionName")||"",EvalResourceName:s(n,"EvalResourceName"),EvalDecision:s(n,"EvalDecision")||"",MatchedStatements:m.length>0?m:void 0}}),a=s(e,"IsTruncated")==="true",i=s(e,"Marker");return{EvaluationResults:r,IsTruncated:a,Marker:i}}}class be{client;region;constructor(e="us-east-1",t){this.region=e,this.client=new u(t)}async createEmailIdentity(e){return await this.client.request({service:"email",region:this.region,method:"POST",path:"/v2/email/identities",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async getEmailIdentity(e){let t=await this.client.request({service:"email",region:this.region,method:"GET",path:`/v2/email/identities/${encodeURIComponent(e)}`,headers:{"Content-Type":"application/json"}});return{IdentityType:t.IdentityType,IdentityName:e,SendingEnabled:t.VerifiedForSendingStatus,VerificationStatus:t.VerificationStatus,DkimAttributes:t.DkimAttributes,MailFromAttributes:t.MailFromAttributes}}async putEmailIdentityMailFromAttributes(e,t){await this.client.request({service:"email",region:this.region,method:"PUT",path:`/v2/email/identities/${encodeURIComponent(e)}/mail-from`,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async listEmailIdentities(e){let t="/v2/email/identities",r=[];if(e?.PageSize)r.push(`PageSize=${e.PageSize}`);if(e?.NextToken)r.push(`NextToken=${encodeURIComponent(e.NextToken)}`);if(r.length>0)t+=`?${r.join("&")}`;let a=await this.client.request({service:"email",region:this.region,method:"GET",path:t,headers:{"Content-Type":"application/json"}});return{EmailIdentities:a.EmailIdentities,NextToken:a.NextToken}}async deleteEmailIdentity(e){await this.client.request({service:"email",region:this.region,method:"DELETE",path:`/v2/email/identities/${encodeURIComponent(e)}`,headers:{"Content-Type":"application/json"}})}async putEmailIdentityDkimAttributes(e){await this.client.request({service:"email",region:this.region,method:"PUT",path:`/v2/email/identities/${encodeURIComponent(e.EmailIdentity)}/dkim`,headers:{"Content-Type":"application/json"},body:JSON.stringify({SigningEnabled:e.SigningEnabled})})}async sendEmail(e){return{MessageId:(await this.client.request({service:"email",region:this.region,method:"POST",path:"/v2/email/outbound-emails",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).MessageId}}async sendBulkEmail(e){return{BulkEmailEntryResults:(await this.client.request({service:"email",region:this.region,method:"POST",path:"/v2/email/outbound-bulk-emails",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).BulkEmailEntryResults}}async createEmailTemplate(e){await this.client.request({service:"email",region:this.region,method:"POST",path:"/v2/email/templates",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async getEmailTemplate(e){return await this.client.request({service:"email",region:this.region,method:"GET",path:`/v2/email/templates/${encodeURIComponent(e)}`,headers:{"Content-Type":"application/json"}})}async deleteEmailTemplate(e){await this.client.request({service:"email",region:this.region,method:"DELETE",path:`/v2/email/templates/${encodeURIComponent(e)}`,headers:{"Content-Type":"application/json"}})}async listEmailTemplates(e){let t="/v2/email/templates",r=[];if(e?.PageSize)r.push(`PageSize=${e.PageSize}`);if(e?.NextToken)r.push(`NextToken=${encodeURIComponent(e.NextToken)}`);if(r.length>0)t+=`?${r.join("&")}`;return await this.client.request({service:"email",region:this.region,method:"GET",path:t,headers:{"Content-Type":"application/json"}})}async getSendStatistics(){let e=await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"Action=GetSendStatistics&Version=2010-12-01"}),t=_(e,"GetSendStatistics")?.SendDataPoints?.member;return{SendDataPoints:t==null?[]:Array.isArray(t)?t:[t]}}async getSendQuota(){let e=await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"Action=GetSendQuota&Version=2010-12-01"}),t=_(e,"GetSendQuota"),r=(a)=>a==null||a===""?void 0:Number(a);return{Max24HourSend:r(t?.Max24HourSend),MaxSendRate:r(t?.MaxSendRate),SentLast24Hours:r(t?.SentLast24Hours)}}async verifyDomain(e){let t=await this.createEmailIdentity({EmailIdentity:e});return{dkimTokens:t.DkimAttributes?.Tokens,verificationStatus:t.DkimAttributes?.Status}}async sendSimpleEmail(e){let t=Array.isArray(e.to)?e.to:[e.to],r=e.replyTo?Array.isArray(e.replyTo)?e.replyTo:[e.replyTo]:void 0,a={};if(e.text)a.Text={Data:e.text};if(e.html)a.Html={Data:e.html};return this.sendEmail({FromEmailAddress:e.from,Destination:{ToAddresses:t},Content:{Simple:{Subject:{Data:e.subject},Body:a}},ReplyToAddresses:r})}async sendTemplatedEmail(e){let t=Array.isArray(e.to)?e.to:[e.to],r=e.replyTo?Array.isArray(e.replyTo)?e.replyTo:[e.replyTo]:void 0;return this.sendEmail({FromEmailAddress:e.from,Destination:{ToAddresses:t},Content:{Template:{TemplateName:e.templateName,TemplateData:JSON.stringify(e.templateData)}},ReplyToAddresses:r})}async getDkimRecords(e){let t=await this.getEmailIdentity(e);if(!t.DkimAttributes?.Tokens)return[];return t.DkimAttributes.Tokens.map((r)=>({name:`${r}._domainkey.${e}`,type:"CNAME",value:`${r}.dkim.amazonses.com`}))}async isDomainVerified(e){try{let t=await this.getEmailIdentity(e);return t.VerificationStatus==="SUCCESS"&&t.SendingEnabled===!0}catch{return!1}}async waitForDomainVerification(e,t=60,r=30000){for(let a=0;a<t;a++){if(await this.isDomainVerified(e))return!0;await new Promise((n)=>setTimeout(n,r))}return!1}buildFormBody(e){return Object.entries(e).filter(([,r])=>r!==void 0).map(([r,a])=>`${encodeURIComponent(r)}=${encodeURIComponent(a)}`).join("&")}async createReceiptRuleSet(e){await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody({Action:"CreateReceiptRuleSet",Version:"2010-12-01",RuleSetName:e})})}async deleteReceiptRuleSet(e){await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody({Action:"DeleteReceiptRuleSet",Version:"2010-12-01",RuleSetName:e})})}async setActiveReceiptRuleSet(e){await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody({Action:"SetActiveReceiptRuleSet",Version:"2010-12-01",RuleSetName:e})})}async listReceiptRuleSets(e){let t={Action:"ListReceiptRuleSets",Version:"2010-12-01"};if(e)t.NextToken=e;let r=await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody(t)}),a=r?.ListReceiptRuleSetsResponse?.ListReceiptRuleSetsResult||r?.ListReceiptRuleSetsResult,i=a?.RuleSets?.member;return{RuleSets:Array.isArray(i)?i:i?[i]:[],NextToken:a?.NextToken}}async describeReceiptRuleSet(e){let t=await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody({Action:"DescribeReceiptRuleSet",Version:"2010-12-01",RuleSetName:e})}),r=t?.DescribeReceiptRuleSetResponse?.DescribeReceiptRuleSetResult||t?.DescribeReceiptRuleSetResult,a=r?.Rules?.member;return{Metadata:r?.Metadata,Rules:Array.isArray(a)?a:a?[a]:[]}}async createReceiptRule(e){let t={Action:"CreateReceiptRule",Version:"2010-12-01",RuleSetName:e.RuleSetName,"Rule.Name":e.Rule.Name,"Rule.Enabled":e.Rule.Enabled!==!1?"true":"false"};if(e.Rule.TlsPolicy)t["Rule.TlsPolicy"]=e.Rule.TlsPolicy;if(e.Rule.ScanEnabled!==void 0)t["Rule.ScanEnabled"]=e.Rule.ScanEnabled?"true":"false";if(e.After)t.After=e.After;if(e.Rule.Recipients)e.Rule.Recipients.forEach((r,a)=>{t[`Rule.Recipients.member.${a+1}`]=r});e.Rule.Actions.forEach((r,a)=>{let i=a+1;if(r.S3Action){if(t[`Rule.Actions.member.${i}.S3Action.BucketName`]=r.S3Action.BucketName,r.S3Action.ObjectKeyPrefix)t[`Rule.Actions.member.${i}.S3Action.ObjectKeyPrefix`]=r.S3Action.ObjectKeyPrefix;if(r.S3Action.KmsKeyArn)t[`Rule.Actions.member.${i}.S3Action.KmsKeyArn`]=r.S3Action.KmsKeyArn}if(r.LambdaAction)t[`Rule.Actions.member.${i}.LambdaAction.FunctionArn`]=r.LambdaAction.FunctionArn,t[`Rule.Actions.member.${i}.LambdaAction.InvocationType`]=r.LambdaAction.InvocationType||"Event";if(r.SNSAction){if(t[`Rule.Actions.member.${i}.SNSAction.TopicArn`]=r.SNSAction.TopicArn,r.SNSAction.Encoding)t[`Rule.Actions.member.${i}.SNSAction.Encoding`]=r.SNSAction.Encoding}if(r.StopAction){if(t[`Rule.Actions.member.${i}.StopAction.Scope`]=r.StopAction.Scope,r.StopAction.TopicArn)t[`Rule.Actions.member.${i}.StopAction.TopicArn`]=r.StopAction.TopicArn}}),await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody(t)})}async deleteReceiptRule(e,t){await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody({Action:"DeleteReceiptRule",Version:"2010-12-01",RuleSetName:e,RuleName:t})})}async receiptRuleSetExists(e){try{return await this.describeReceiptRuleSet(e),!0}catch(t){if(t.code==="RuleSetDoesNotExist"||t.statusCode===400)return!1;throw t}}async getActiveReceiptRuleSet(){let e=await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody({Action:"DescribeActiveReceiptRuleSet",Version:"2010-12-01"})}),t=e?.DescribeActiveReceiptRuleSetResponse?.DescribeActiveReceiptRuleSetResult||e?.DescribeActiveReceiptRuleSetResult;if(!t?.Metadata)return null;let r=t?.Rules?.member;return{Metadata:t?.Metadata,Rules:Array.isArray(r)?r:r?[r]:[]}}async updateReceiptRule(e){let t={Action:"UpdateReceiptRule",Version:"2010-12-01",RuleSetName:e.RuleSetName,"Rule.Name":e.Rule.Name};if(e.Rule.Enabled!==void 0)t["Rule.Enabled"]=e.Rule.Enabled?"true":"false";if(e.Rule.TlsPolicy)t["Rule.TlsPolicy"]=e.Rule.TlsPolicy;if(e.Rule.ScanEnabled!==void 0)t["Rule.ScanEnabled"]=e.Rule.ScanEnabled?"true":"false";if(e.Rule.Recipients)e.Rule.Recipients.forEach((r,a)=>{t[`Rule.Recipients.member.${a+1}`]=r});e.Rule.Actions.forEach((r,a)=>{let i=a+1;if(r.S3Action){if(t[`Rule.Actions.member.${i}.S3Action.BucketName`]=r.S3Action.BucketName,r.S3Action.ObjectKeyPrefix)t[`Rule.Actions.member.${i}.S3Action.ObjectKeyPrefix`]=r.S3Action.ObjectKeyPrefix;if(r.S3Action.KmsKeyArn)t[`Rule.Actions.member.${i}.S3Action.KmsKeyArn`]=r.S3Action.KmsKeyArn}if(r.LambdaAction)t[`Rule.Actions.member.${i}.LambdaAction.FunctionArn`]=r.LambdaAction.FunctionArn,t[`Rule.Actions.member.${i}.LambdaAction.InvocationType`]=r.LambdaAction.InvocationType||"Event";if(r.SNSAction){if(t[`Rule.Actions.member.${i}.SNSAction.TopicArn`]=r.SNSAction.TopicArn,r.SNSAction.Encoding)t[`Rule.Actions.member.${i}.SNSAction.Encoding`]=r.SNSAction.Encoding}if(r.StopAction){if(t[`Rule.Actions.member.${i}.StopAction.Scope`]=r.StopAction.Scope,r.StopAction.TopicArn)t[`Rule.Actions.member.${i}.StopAction.TopicArn`]=r.StopAction.TopicArn}}),await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody(t)})}async sendRawEmail(e){let t=Buffer.from(e.rawMessage).toString("base64"),r={Action:"SendRawEmail",Version:"2010-12-01",Source:e.source,"RawMessage.Data":t};e.destinations.forEach((n,o)=>{r[`Destinations.member.${o+1}`]=n});let a=await this.client.request({service:"ses",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:this.buildFormBody(r)});return{MessageId:(a?.SendRawEmailResponse?.SendRawEmailResult||a?.SendRawEmailResult)?.MessageId}}async getSuppressedDestination(e){try{return(await this.client.request({service:"ses",region:this.region,method:"GET",path:`/v2/email/suppression/addresses/${encodeURIComponent(e)}`}))?.SuppressedDestination||null}catch(t){if(t.message?.includes("404")||t.message?.includes("NotFoundException"))return null;throw t}}async deleteSuppressedDestination(e){await this.client.request({service:"ses",region:this.region,method:"DELETE",path:`/v2/email/suppression/addresses/${encodeURIComponent(e)}`})}}class uc{ses;s3;iam;route53;region;domain;defaultFrom;constructor(e={}){this.region=e.region||"us-east-1",this.domain=e.domain,this.defaultFrom=e.defaultFrom,this.ses=new be(this.region),this.s3=new g(this.region),this.iam=new Z(this.region),this.route53=new U(this.region)}async send(e){let t=e.from||this.defaultFrom;if(!t)throw Error("From address is required. Set defaultFrom in constructor or provide from in options.");let r=e.fromName?`${e.fromName} <${t}>`:t,a=Array.isArray(e.to)?e.to:[e.to];if(!e.attachments||e.attachments.length===0)return{messageId:(await this.ses.sendSimpleEmail({from:r,to:a,subject:e.subject,text:e.text,html:e.html,replyTo:e.replyTo})).MessageId||""};let i=this.buildRawEmail(e,r,a);return{messageId:(await this.ses.sendEmail({FromEmailAddress:r,Destination:{ToAddresses:a,CcAddresses:e.cc?Array.isArray(e.cc)?e.cc:[e.cc]:void 0,BccAddresses:e.bcc?Array.isArray(e.bcc)?e.bcc:[e.bcc]:void 0},Content:{Raw:{Data:Buffer.from(i).toString("base64")}}})).MessageId||""}}async sendTemplate(e){let t=e.from||this.defaultFrom;if(!t)throw Error("From address is required");let r=e.fromName?`${e.fromName} <${t}>`:t;return{messageId:(await this.ses.sendTemplatedEmail({from:r,to:e.to,templateName:e.templateName,templateData:e.templateData,replyTo:e.replyTo})).MessageId||""}}async sendBulk(e){let t=e.from||this.defaultFrom;if(!t)throw Error("From address is required");let r=e.recipients.map((i)=>({Destination:{ToAddresses:Array.isArray(i.to)?i.to:[i.to]},ReplacementEmailContent:i.templateData?{ReplacementTemplate:{ReplacementTemplateData:JSON.stringify(i.templateData)}}:void 0}));return{results:(await this.ses.sendBulkEmail({FromEmailAddress:t,BulkEmailEntries:r,DefaultContent:{Template:{TemplateName:e.templateName,TemplateData:JSON.stringify(e.defaultTemplateData)}}})).BulkEmailEntryResults?.map((i)=>({status:i.Status||"UNKNOWN",messageId:i.MessageId,error:i.Error}))||[]}}async setupDomain(e){let t;try{t=await this.ses.getEmailIdentity(e)}catch{let a=await this.ses.createEmailIdentity({EmailIdentity:e});t={VerificationStatus:a.DkimAttributes?.Status,DkimAttributes:a.DkimAttributes,SendingEnabled:a.VerifiedForSendingStatus}}try{await this.ses.putEmailIdentityDkimAttributes({EmailIdentity:e,SigningEnabled:!0})}catch{}try{await this.ses.putEmailIdentityMailFromAttributes(e,{MailFromDomain:`mail.${e}`,BehaviorOnMxFailure:"USE_DEFAULT_VALUE"})}catch{}let r=await this.ses.getDkimRecords(e);return{domainVerified:t.SendingEnabled===!0,dkimStatus:t.DkimAttributes?.Status||"UNKNOWN",dkimTokens:t.DkimAttributes?.Tokens,mailFromStatus:t.MailFromAttributes?.MailFromDomainStatus}}async getDnsRecords(e){let t=[],r=await this.ses.getDkimRecords(e);for(let a of r)t.push({type:a.type,name:a.name,value:a.value,ttl:1800});return t.push({type:"MX",name:e,value:`inbound-smtp.${this.region}.amazonaws.com`,priority:10,ttl:3600}),t.push({type:"MX",name:`mail.${e}`,value:`feedback-smtp.${this.region}.amazonses.com`,priority:10,ttl:3600}),t.push({type:"TXT",name:`mail.${e}`,value:"v=spf1 include:amazonses.com ~all",ttl:3600}),t.push({type:"TXT",name:`_dmarc.${e}`,value:`v=DMARC1;p=quarantine;pct=25;rua=mailto:dmarcreports@${e}`,ttl:3600}),t}async isDomainReady(e){try{let t=await this.ses.getEmailIdentity(e);return t.SendingEnabled===!0&&t.DkimAttributes?.Status==="SUCCESS"}catch{return!1}}async setupReceiving(e){let t={Version:"2012-10-17",Statement:[{Sid:"AllowSESPuts",Effect:"Allow",Principal:{Service:"ses.amazonaws.com"},Action:"s3:PutObject",Resource:`arn:aws:s3:::${e.bucketName}/*`,Condition:{StringEquals:{"AWS:SourceAccount":e.accountId}}}]};await this.s3.putBucketPolicy(e.bucketName,t);try{await this.ses.createReceiptRuleSet(e.ruleSetName)}catch(a){if(!a.message?.includes("already exists")&&a.code!=="AlreadyExists")throw a}let r=[{S3Action:{BucketName:e.bucketName,ObjectKeyPrefix:e.prefix||"inbox/"}}];if(e.lambdaArn)r.push({LambdaAction:{FunctionArn:e.lambdaArn,InvocationType:"Event"}});try{await this.ses.createReceiptRule({RuleSetName:e.ruleSetName,Rule:{Name:e.ruleName,Enabled:!0,TlsPolicy:"Optional",Recipients:e.recipients||[e.domain],ScanEnabled:e.scanEnabled!==!1,Actions:r}})}catch(a){if(a.message?.includes("already exists"))await this.ses.deleteReceiptRule(e.ruleSetName,e.ruleName),await this.ses.createReceiptRule({RuleSetName:e.ruleSetName,Rule:{Name:e.ruleName,Enabled:!0,TlsPolicy:"Optional",Recipients:e.recipients||[e.domain],ScanEnabled:e.scanEnabled!==!1,Actions:r}});else throw a}await this.ses.setActiveReceiptRuleSet(e.ruleSetName)}async getIncomingEmails(e){return(await this.s3.list({bucket:e.bucket,prefix:e.prefix||"incoming/",maxKeys:e.maxResults||100})).map((r)=>({key:r.Key||"",lastModified:r.LastModified||"",size:r.Size||0}))}async readEmail(e){return await this.s3.getObject(e.bucket,e.key)}async createSmtpCredentials(e){let t=`ses-smtp-${e.username.replace(/[^a-zA-Z0-9]/g,"-")}`,{AWSClient:r}=await import("./chunk-6crapvp1.js"),a=new r,i=(d,y)=>{let P={Action:d,Version:"2010-05-08",...y};return Object.entries(P).map(([A,h])=>`${encodeURIComponent(A)}=${encodeURIComponent(h)}`).join("&")};try{await a.request({service:"iam",region:"us-east-1",method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i("CreateUser",{UserName:t})})}catch(d){if(!d.message?.includes("EntityAlreadyExists"))throw d}let n={Version:"2012-10-17",Statement:[{Effect:"Allow",Action:"ses:SendRawEmail",Resource:"*",Condition:{StringLike:{"ses:FromAddress":`*@${e.domain}`}}}]},o=`ses-smtp-policy-${e.domain.replace(/\./g,"-")}`;try{await a.request({service:"iam",region:"us-east-1",method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i("PutUserPolicy",{UserName:t,PolicyName:o,PolicyDocument:JSON.stringify(n)})})}catch{}let l=(await a.request({service:"iam",region:"us-east-1",method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i("CreateAccessKey",{UserName:t})}))?.CreateAccessKeyResult?.AccessKey;if(!l?.AccessKeyId||!l?.SecretAccessKey)throw Error("Failed to create access key");let p=this.deriveSmtpPassword(l.SecretAccessKey);return{username:l.AccessKeyId,password:p,server:`email-smtp.${this.region}.amazonaws.com`,port:587}}deriveSmtpPassword(e){let t=mi("node:crypto"),r="SendRawEmail",a=Buffer.from([4]),i=t.createHmac("sha256",`AWS4${e}`).update("11111111").digest();return i=t.createHmac("sha256",i).update(this.region).digest(),i=t.createHmac("sha256",i).update("ses").digest(),i=t.createHmac("sha256",i).update("aws4_request").digest(),i=t.createHmac("sha256",i).update("SendRawEmail").digest(),Buffer.concat([a,i]).toString("base64")}async createTemplate(e){await this.ses.createEmailTemplate({TemplateName:e.name,TemplateContent:{Subject:e.subject,Text:e.text,Html:e.html}})}async getTemplate(e){try{let t=await this.ses.getEmailTemplate(e);return{name:t.TemplateName||e,subject:t.TemplateContent?.Subject,text:t.TemplateContent?.Text,html:t.TemplateContent?.Html}}catch{return null}}async deleteTemplate(e){await this.ses.deleteEmailTemplate(e)}async listTemplates(){return(await this.ses.listEmailTemplates()).TemplatesMetadata?.map((t)=>({name:t.TemplateName||"",createdAt:t.CreatedTimestamp}))||[]}async deploy(e){let t=`${e.appName}-${e.environment}-email-rules`,r=`${e.appName}-inbound-email`,a=e.storage?.bucketName||`${e.appName}-${e.environment}-email`,i=await this.setupDomain(e.domain);if(!(await this.s3.listBuckets()).Buckets?.some((l)=>l.Name===a))await this.s3.createBucket(a);await this.setupReceiving({domain:e.domain,ruleSetName:t,ruleName:r,bucketName:a,prefix:e.storage?.prefix||"inbox/",accountId:e.accountId,recipients:e.catchAll?[e.domain]:e.mailboxes,scanEnabled:!0});let m=await this.getDnsRecords(e.domain);return{success:!0,domainVerified:i.domainVerified,dkimStatus:i.dkimStatus,receiptRuleSet:t,storageBucket:a,dnsRecords:m}}async undeploy(e){let t=`${e.appName}-${e.environment}-email-rules`,r=`${e.appName}-inbound-email`,a=`${e.appName}-${e.environment}-email`;try{await this.ses.deleteReceiptRule(t,r)}catch{}try{await this.ses.deleteReceiptRuleSet(t)}catch{}if(e.deleteBucket)try{await this.s3.emptyAndDeleteBucket(a)}catch{}}async getSendingStats(){let e=await this.ses.getSendQuota();return{sentLast24Hours:e.SentLast24Hours||0,maxSendRate:e.MaxSendRate||0,max24HourSend:e.Max24HourSend||0}}buildRawEmail(e,t,r){let a=`----=_Part_${Date.now()}_${Math.random().toString(36).substring(2)}`,i="";if(i+=`From: ${t}\r
|
|
2
|
-
`,i+=`To: ${r.join(", ")}\r
|
|
3
|
-
`,e.cc){let n=Array.isArray(e.cc)?e.cc:[e.cc];i+=`Cc: ${n.join(", ")}\r
|
|
4
|
-
`}if(i+=`Subject: ${e.subject}\r
|
|
5
|
-
`,i+=`MIME-Version: 1.0\r
|
|
6
|
-
`,i+=`Content-Type: multipart/mixed; boundary="${a}"\r
|
|
7
|
-
`,i+=`\r
|
|
8
|
-
`,e.text||e.html)if(i+=`--${a}\r
|
|
9
|
-
`,e.html&&e.text){let n=`----=_Alt_${Date.now()}`;i+=`Content-Type: multipart/alternative; boundary="${n}"\r
|
|
10
|
-
`,i+=`\r
|
|
11
|
-
`,i+=`--${n}\r
|
|
12
|
-
`,i+=`Content-Type: text/plain; charset="UTF-8"\r
|
|
13
|
-
`,i+=`\r
|
|
14
|
-
`,i+=`${e.text}\r
|
|
15
|
-
`,i+=`--${n}\r
|
|
16
|
-
`,i+=`Content-Type: text/html; charset="UTF-8"\r
|
|
17
|
-
`,i+=`\r
|
|
18
|
-
`,i+=`${e.html}\r
|
|
19
|
-
`,i+=`--${n}--\r
|
|
20
|
-
`}else if(e.html)i+=`Content-Type: text/html; charset="UTF-8"\r
|
|
21
|
-
`,i+=`\r
|
|
22
|
-
`,i+=`${e.html}\r
|
|
23
|
-
`;else i+=`Content-Type: text/plain; charset="UTF-8"\r
|
|
24
|
-
`,i+=`\r
|
|
25
|
-
`,i+=`${e.text}\r
|
|
26
|
-
`;if(e.attachments)for(let n of e.attachments)i+=`--${a}\r
|
|
27
|
-
`,i+=`Content-Type: ${n.contentType||"application/octet-stream"}; name="${n.filename}"\r
|
|
28
|
-
`,i+=`Content-Transfer-Encoding: base64\r
|
|
29
|
-
`,i+=`Content-Disposition: attachment; filename="${n.filename}"\r
|
|
30
|
-
`,i+=`\r
|
|
31
|
-
`,i+=`${n.content}\r
|
|
32
|
-
`;return i+=`--${a}--\r
|
|
33
|
-
`,i}}var fp=new uc;
|
|
34
|
-
export{Z,be,uc,fp};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{qn}from"./chunk-zcabmq4p.js";import"./chunk-n298azax.js";import"./chunk-btr6zq53.js";import"./chunk-2tk8egg8.js";import"./chunk-9h7yjtz2.js";import"./chunk-0r45d0s3.js";import"./chunk-j0zg3mbm.js";import"./chunk-t1jpqn4x.js";import"./chunk-tyqxz92e.js";export{qn as resolveDashboardData};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Bu}from"./chunk-f2yhthd1.js";import"./chunk-hqmkfh4a.js";import"./chunk-9h7yjtz2.js";import"./chunk-t1jpqn4x.js";import"./chunk-tyqxz92e.js";export{Bu as buildAndPushServerlessImage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u}from"./chunk-t1jpqn4x.js";import{_,ee}from"./chunk-cas0bp91.js";class j{client;region;constructor(e="us-east-1",i){this.region=e,this.client=new u}async createQueue(e){let t={Action:"CreateQueue",QueueName:e.fifo&&!e.queueName.endsWith(".fifo")?`${e.queueName}.fifo`:e.queueName,Version:"2012-11-05"},s=1;if(e.visibilityTimeout!==void 0)t[`Attribute.${s}.Name`]="VisibilityTimeout",t[`Attribute.${s}.Value`]=e.visibilityTimeout.toString(),s++;if(e.messageRetentionPeriod!==void 0)t[`Attribute.${s}.Name`]="MessageRetentionPeriod",t[`Attribute.${s}.Value`]=e.messageRetentionPeriod.toString(),s++;if(e.delaySeconds!==void 0)t[`Attribute.${s}.Name`]="DelaySeconds",t[`Attribute.${s}.Value`]=e.delaySeconds.toString(),s++;if(e.maxMessageSize!==void 0)t[`Attribute.${s}.Name`]="MaximumMessageSize",t[`Attribute.${s}.Value`]=e.maxMessageSize.toString(),s++;if(e.receiveMessageWaitTime!==void 0)t[`Attribute.${s}.Name`]="ReceiveMessageWaitTimeSeconds",t[`Attribute.${s}.Value`]=e.receiveMessageWaitTime.toString(),s++;if(e.fifo){if(t[`Attribute.${s}.Name`]="FifoQueue",t[`Attribute.${s}.Value`]="true",s++,e.contentBasedDeduplication)t[`Attribute.${s}.Name`]="ContentBasedDeduplication",t[`Attribute.${s}.Value`]="true",s++}if(e.deadLetterTargetArn&&e.maxReceiveCount)t[`Attribute.${s}.Name`]="RedrivePolicy",t[`Attribute.${s}.Value`]=JSON.stringify({deadLetterTargetArn:e.deadLetterTargetArn,maxReceiveCount:e.maxReceiveCount}),s++;if(e.tags&&Object.keys(e.tags).length>0){let a=1;for(let[n,g]of Object.entries(e.tags))t[`Tag.${a}.Key`]=n,t[`Tag.${a}.Value`]=g,a++}let r=await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(t).toString()});return{QueueUrl:r.QueueUrl||r.CreateQueueResult?.QueueUrl}}async listQueues(e){let i={Action:"ListQueues",Version:"2012-11-05"};if(e)i.QueueNamePrefix=e;let t=await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(i).toString()}),s=[];if(t.QueueUrl)s.push(t.QueueUrl);else if(t.ListQueuesResult?.QueueUrl)if(Array.isArray(t.ListQueuesResult.QueueUrl))s.push(...t.ListQueuesResult.QueueUrl);else s.push(t.ListQueuesResult.QueueUrl);return{QueueUrls:s}}async getQueueAttributes(e){let i={Action:"GetQueueAttributes",QueueUrl:e,Version:"2012-11-05","AttributeName.1":"All"},t=await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(i).toString()}),s={};for(let r of ee(_(t,"GetQueueAttributes")?.Attribute))s[r.Name]=String(r.Value);return{Attributes:s}}async getQueueUrl(e){let i={Action:"GetQueueUrl",QueueName:e,Version:"2012-11-05"},t=await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(i).toString()});return{QueueUrl:t.QueueUrl||t.GetQueueUrlResult?.QueueUrl}}async deleteQueue(e){let i={Action:"DeleteQueue",QueueUrl:e,Version:"2012-11-05"};await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(i).toString()})}async purgeQueue(e){let i={Action:"PurgeQueue",QueueUrl:e,Version:"2012-11-05"};await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(i).toString()})}async sendMessage(e){let i={Action:"SendMessage",QueueUrl:e.queueUrl,MessageBody:e.messageBody,Version:"2012-11-05"};if(e.delaySeconds!==void 0)i.DelaySeconds=e.delaySeconds;if(e.messageGroupId)i.MessageGroupId=e.messageGroupId;if(e.messageDeduplicationId)i.MessageDeduplicationId=e.messageDeduplicationId;let t=await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(i).toString()});return{MessageId:t.MessageId||t.SendMessageResult?.MessageId}}async receiveMessages(e){let i={Action:"ReceiveMessage",QueueUrl:e.queueUrl,Version:"2012-11-05"};if(e.maxMessages!==void 0)i.MaxNumberOfMessages=e.maxMessages;if(e.visibilityTimeout!==void 0)i.VisibilityTimeout=e.visibilityTimeout;if(e.waitTimeSeconds!==void 0)i.WaitTimeSeconds=e.waitTimeSeconds;let t=await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(i).toString()}),s=[],r=t.Message||t.ReceiveMessageResult?.Message;if(r)if(Array.isArray(r))s.push(...r.map((a)=>({MessageId:a.MessageId,ReceiptHandle:a.ReceiptHandle,Body:a.Body})));else s.push({MessageId:r.MessageId,ReceiptHandle:r.ReceiptHandle,Body:r.Body});return{Messages:s}}async deleteMessage(e,i){let t={Action:"DeleteMessage",QueueUrl:e,ReceiptHandle:i,Version:"2012-11-05"};await this.client.request({service:"sqs",region:this.region,method:"POST",path:"/",body:new URLSearchParams(t).toString()})}}
|
|
2
|
-
export{j};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Vu,zu,Hu,qu}from"./chunk-gzpwf3n4.js";import"./chunk-j0zg3mbm.js";import"./chunk-t1jpqn4x.js";import"./chunk-tyqxz92e.js";export{qu as deleteFailoverReplicaBuckets,Vu as ensureFailoverReplicaBuckets,zu as grantFailoverReplicaAccess,Hu as seedFailoverReplicas};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Jn}from"./chunk-65rndjtr.js";import"./chunk-33e0t7e5.js";import"./chunk-k052rtd5.js";import"./chunk-0r45d0s3.js";import"./chunk-6cfpdb35.js";import"./chunk-j0zg3mbm.js";import"./chunk-t1jpqn4x.js";import"./chunk-tyqxz92e.js";export{Jn as resolveServerDashboardData};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j}from"./chunk-n298azax.js";import"./chunk-t1jpqn4x.js";export{j as SQSClient};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X}from"./chunk-33e0t7e5.js";import"./chunk-t1jpqn4x.js";export{X as EC2Client};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{me}from"./chunk-0d98bem8.js";import"./chunk-t1jpqn4x.js";export{me as RDSClient};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w}from"./chunk-en7sf83z.js";import"./chunk-t1jpqn4x.js";export{w as CloudFrontClient};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Wu,Xr,Hi,oe,Gu,Ba,rd,rs,Ku,Ju,Xu,Fa,qi,ns,ja,Qr,gr,Qu,ti,Yu,Va,nd,id,is,za,Ha,fr,Wi,hr,qa,os,ri,od,Gi,Wa,Ga,Ki,sd,Ka,Ja,Xa,Qa,ss,ad,cd,Zu,ld,Ya,Ji,dd,ud,as,xt,cs,ls,ds,Za,pd,ec,us,ep,ft,tp,tc,$t,rc,rp,nc,md,np,Y,gd,ps,ip,Xi,ni,ii,ms,fd,hd,op,gs,fs}from"./chunk-90kpnjdm.js";import"./chunk-wyanqf91.js";import"./chunk-tyqxz92e.js";export{as as AnomalyConfigStore,fd as AwsSpendTransport,hd as ComputeSpendTransport,is as CounterTracker,Va as DEFAULT_METER_MAPPINGS,Fa as DEFAULT_PRICE_BOOK,Wi as DEFAULT_THRESHOLDS,xt as DETECTABLE_SIGNALS,Hi as ENFORCEMENT_ACTIONS,Ki as ENFORCEMENT_DESCRIPTIONS,oe as ENFORCEMENT_SEVERITY,pd as FOCUS_VERSION,Xr as METERS,Wu as METER_KEYS,Gu as MICRO_CENTS,od as MIN_PROJECTION_CONFIDENCE,md as RecordingSpendTransport,dd as SENSITIVITY_THRESHOLDS,ii as SPEND_CYCLE_SECONDS,tc as SPEND_GATE_SETTING,ip as SPEND_LEASE_SETTING,ls as SignalSource,rc as SpendCapError,$t as SpendGate,Xi as SpendLoopLease,ps as SpendNotificationRouter,ni as SpendRunner,ft as SpendService,hr as SpendStore,np as URGENT_SPEND_EVENTS,sd as USER_VISIBLE_ACTIONS,Ha as aggregateDeltas,Ji as anomalyOptionsForSignal,rp as assertSpendAllows,gr as budgetWindow,op as compositeSpendTransport,nc as createEnforcementHandlers,ld as detectAnomalies,Ya as detectLatestAnomaly,Wa as evaluateBudget,Zu as ewma,nd as findMapping,rd as findPriceEntry,Y as formatCents,ri as formatTimeToExhaustion,Gi as governingLimitCents,gs as handleSpendRequest,ti as hourBucket,Yu as hourBucketsBetween,Qa as isOperationAllowed,qi as isValidTimeZone,Za as lookbackHoursForSignal,ss as median,ad as medianAbsoluteDeviation,Ga as mergeDecisions,Xu as mergePriceBooks,za as meterTelemetry,ds as optionsForSignal,os as percentOfLimit,Ka as planEnforcement,Qu as previousBudgetWindow,rs as priceUsage,Ku as priceUsageLines,qa as projectSpend,cd as robustZScore,Ju as roundCents,ud as routeMatches,Ja as runEnforcement,fr as scopeKey,cs as signalDefinition,gd as spendNotificationText,fs as spendOpenApiPaths,ms as startSpendLoop,ep as streamFocusJsonl,Xa as strongestActiveAction,Ba as tieredMicroCents,us as toFocusJsonl,ec as toFocusRecords,id as usageDeltaKey,Qr as utcInstantOfLocal,tp as zeroFill,ja as zoneOffsetMs,ns as zonedParts};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gc,ae,fc,Id,hp,fi,yp,Sp,Hs,bp,vp,Tp,Ep,wp,Cp,Ap,hc,yc,qs,Ws,wo,et,A,Gs,Sc,z,Rr,C,Rd,hi,Ks,Js,B,Co,Ip,Rp,Pp,Np,l,s,Dp,kp,E,Xs,Qs,Ys,_p,xp,De,Zs,Ao,Pd,$p,Op,Ue,Et,ea,bc,vc,Lp,Tc,Ec,wc,ta,Cc,jt,Io,yi,Ro,Si,Be,Nd,Po,No,ra,na,ia,oa,sa,aa,ve,F,S,O,tt,D,Dd,wt,ge,Vt,Mp,kd,Te,Do,Fe,zt,bi,Ee,ko,ke,_d,vi,we,Ce,re,Ti,J,Ht,Ct,Ae,t,_o,Up,Ac,ca,Bp,Fp,jp,Vp,la,zp,Hp,qp,Wp,Gp,Kp,Jp,Xp,Qp,Yp,Zp,em,xd,$d,Od,Ld,Md,Ud,Bd,qt,Ic,Rc,Pr,Ei,tm,Pc,rm,nm,an,im,om,sm,am,cm,lm,Fd,jd,Vd,zd,Hd,xo,dm,da,qd,Wd,Gd,Nc,Ie,um,Kd,At,$o,Nr,Jd,Dc,Xd,Qd,Yd,kc,_e,pm,mm,gm,fm,Zd,hm,Re,ym,Sm,bm,_c,xc,vm,$c,Oc,Tm,Em,wm,Cm,Am,eu,ua,Im,Rm,Pm,Nm,Dm,tu,ru,km,_m,xm,$m,Om,Lm,Mm,Um,Bm,Lc,pa,Fm,jm,Vm,zm,Mc,Uc,Bc,Hm,Fc,qm,Wm,Gm,Km,jc,Jm,Xm,Qm,Ym,Zm,eg,tg,rg,nu,iu,ou,su,Vc,ng,ig,og,sg,ag,cg,lg,dg,ug,au,cu,lu,du,pg,mg,zc,gg,Hc,qc,Wc,Gc,fg,hg,yg,Sg,rt,wi,bg,vg,Tg,Eg,wg,Cg,Ag,Ig,uu,Rg,Pg,Kc,Jc,Ng,Dg,pu,kg,_g,xg,$g,Og,Lg,Mg,Ug,Bg,Fg,jg,Vg,zg,Hg,qg,Wg,Gg,Kg,Jg,Xg,Qg,Xc,Yg,Qc,Zg,Yc,ef,Zc,tf,el,rf,cn,nf,tl,of,Oo,sf,rl,af,nl,cf,il,lf,ol,df,sl,uf,ln,pf,al,mf,cl,gf,ll,ff,dl,hf,ul,yf,pl,Sf,ml,bf,gl,vf,fl,Tf,hl,Ef,yl,wf,Sl,Cf,bl,Af,vl,If,Tl,Rf,El,Pf,wl,Nf,Cl,Df,Al,kf,Il,_f,Rl,xf,Pl,$f,Nl,Of,Dl,Lf,kl,Mf,mu,gu,fu,hu,_l,Uf,xl,Bf,$l,Ff,Ol,jf,Ci,yu,Su,Lo,ma,dn,bu,Mo,Wt,ga,fa,vu,Tu,Ll,Eu,ha,Ml,Vf,zf,ya,Sa,ba,Ul,Uo,Bl,Fl,va,jl,Vl,zl,wu,Cu,Au,Hf,Iu,Ru,qf,Pu,Hl,Nu,Du,ku,Wf,_u,Ai,Ta,xu,Gf,$u,Bo,Fo,Ea,ql,Kf,Wl,Jf,Gl,Xf,Kl,Qf,Jl,Yf}from"./chunk-tyqxz92e.js";export{rl as ABTestManager,Fe as AI,Xd as AWSAPIError,Yc as AWSConfigManager,Up as AWS_PSEUDO_PARAMETERS,rt as AWS_REGIONS,ko as ApiGateway,_o as Arn,re as AssetHasher,we as Auth,Xc as BackupManager,$l as BatchProcessingManager,tl as BlueGreenManager,Pl as BounceComplaintHandler,hl as BuildOptimizationManager,Be as CDN,Sa as CHAIN_HEADER,ea as CLOUDFRONT_FAILOVER_STATUS_CODES,_g as COMMON_CROSS_ACCOUNT_ROLES,bi as Cache,Oo as CanaryManager,ml as CertificateManager,At as CloudError,Ac as CloudFormationBuilder,Gd as CloudFormationClient,Kd as CloudFrontClient,Zc as CloudTrailManager,du as CommandHistory,Ae as Communication,S as Compute,$o as ConfigurationError,yl as ContainerRegistryManager,Nr as CredentialError,Hc as CrossRegionReferenceManager,$d as DASHBOARD_ENTRY,Od as DASHBOARD_PORT_BASE,Ld as DASHBOARD_PORT_SPAN,xd as DASHBOARD_STATE_DIR,bc as DEFAULT_FAILOVER_STATUS_CODES,Uo as DEFAULT_RECURSION_LIMITS,Re as DEFAULT_SERVICE_LIMITS,hc as DEFAULT_STATE_DIR,Nd as DEFAULT_STORAGE_FAILOVER_STATUS_CODES,ya as DEPTH_HEADER,xl as DLQMonitoringManager,ve as DNS,Il as DNSSECManager,zt as Database,dl as DatabaseUserManager,_e as DebugLogger,Pd as DependencyGraph,Ce as Deployment,Jd as DeploymentError,Qc as DisasterRecoveryManager,D as Email,mu as EmailAdvanced,Nl as EmailAnalyticsManager,gu as EmailHandlers,kl as EmailTemplateManager,Qd as ErrorCodes,No as FAILOVER_REPLICA_POLICY_SID,_l as FIFOQueueManager,_c as FileCache,tt as FileSystem,t as Fn,qc as GlobalResourceManager,el as GuardDutyManager,eu as HashCache,Gl as HealthCheckManager,fl as ImageScanningManager,Vt as JobLoader,xu as LARAVEL_SERVERLESS_BUILD_STEPS,Tl as LambdaConcurrencyManager,Cl as LambdaDLQManager,El as LambdaDestinationsManager,bl as LambdaLayersManager,wl as LambdaVPCManager,vl as LambdaVersionsManager,sl as LogsManager,bu as MANAGED_NODE_VERSIONS,Ic as MANAGEMENT_DASHBOARD_SITE_PREFIX,ke as Messaging,ol as MetricsManager,al as MigrationManager,Mc as MockCloudFormation,Bc as MockDynamoDB,Uc as MockS3,vi as Monitoring,Kc as MultiAccountManager,zc as MultiRegionManager,iu as MultiStepProgress,O as Network,Kl as NetworkSecurityManager,Ec as ORIGIN_CONNECTION_ATTEMPTS,wc as ORIGIN_CONNECTION_TIMEOUT,vc as ORIGIN_GROUP_ALLOWED_METHODS,Lp as ORIGIN_GROUP_ID_SUFFIX,Tc as ORIGIN_GROUP_SELECTION_CRITERIA,Jc as OrganizationManager,$u as PHP_DEFAULT_EXCLUDES,vu as PHP_LAYER_EXTENSIONS,J as ParameterStore,ll as PerformanceManager,Ee as Permissions,wt as Phone,fu as PhoneAdvanced,Dd as PhoneHandlers,Fc as PreviewEnvironmentManager,jc as PreviewNotificationService,nu as ProgressBar,nl as ProgressiveDeploymentManager,Np as Pseudo,ge as Queue,Ol as QueueManagementManager,Cp as QueuePresets,pu as RECOMMENDED_ACCOUNT_STRUCTURES,kg as RECOMMENDED_SCPS,au as REPL,lu as REPLCommandBuilder,cu as REPLContext,tu as RateLimiter,Ap as RealtimePresets,va as RecursionGuard,Ct as Redirects,Wc as RegionPairManager,Et as Registry,cl as ReplicaManager,Jl as ResourceManagementManager,Rl as Route53ResolverManager,Al as Route53RoutingManager,Nc as S3Client,Ie as S3Error,Te as SMS,yc as STATE_DIR_ENV_VAR,Po as STORAGE_FAILOVER_METADATA_KEY,Ht as Search,Ti as Secrets,pl as SecretsManager,ul as SecretsRotationManager,F as Security,cn as SecurityHubManager,gl as SecurityScanningManager,Dl as SenderReputationManager,Sl as ServiceMeshManager,Do as Sftp,hu as SmsAdvanced,kd as SmsHandlers,ou as Spinner,Gc as StackDependencyManager,Mp as StacksIntegration,ql as StaticSiteManager,Ue as Storage,Wl as StorageAdvancedManager,ln as SyntheticsManager,ba as TRACE_HEADER,su as TaskList,Co as TemplateBuilder,xc as TemplateCache,Dc as ValidationError,_d as Workflow,il as XRayManager,af as abTestManager,$p as analyzeStackDiff,ma as artifactKey,yi as assertOriginGroupMethods,ag as autocomplete,ef as awsConfigManager,Yg as backupManager,Im as batch,Ff as batchProcessingManager,of as blueGreenManager,$f as bounceComplaintHandler,zf as buildBunRuntimeLayerZip,ca as buildCloudFormationTemplate,sa as buildFailoverReplicaPolicyStatement,Js as buildMailEnv,Vf as buildNodeRuntimeLayerZip,Ef as buildOptimizationManager,Cc as buildOriginGroup,Io as buildOriginGroups,Gf as buildPhpRuntimeLayerZip,oa as buildReplicationConfiguration,ia as buildReplicationRole,sf as canaryManager,Om as categorizeChanges,bf as certificateManager,fm as checkIAMPermissions,Iu as checkInvocation,ym as checkServiceQuotas,ru as chunk,vp as clearSigningKeyCache,Um as cloudConfigSchema,tf as cloudTrailManager,Fo as collectPhpAppEntries,rm as composePresets,fa as composeServerlessAppTemplate,wf as containerRegistryManager,Hp as createApiBackendPreset,ku as createCliHandler,dm as createCredentialProvider,em as createDashboardSite,Jp as createDataPipelinePreset,kc as createError,la as createExistingStaticFullStackPreset,zp as createFullStackAppPreset,Wf as createHandlers,Nu as createHttpHandler,Wp as createJamstackPreset,Yp as createLaravelPreset,Xp as createMLApiPreset,Gp as createMicroservicesPreset,Hm as createMockAWS,Fp as createNodeJsServerPreset,jp as createNodeJsServerlessPreset,nm as createPreset,Id as createPresignedUrl,hp as createPresignedUrlAsync,Du as createQueueHandler,Kp as createRealtimeAppPreset,um as createS3Client,Zp as createServerlessLaravelPreset,Vp as createServerlessNodePreset,Bp as createStaticSitePreset,Qp as createTraditionalWebAppPreset,qp as createWordPressPreset,Ci as createZip,fg as crossRegionReferenceManager,hf as databaseUserManager,Lc as defaultLocalConfig,Rr as deploymentCoexistenceError,Md as deriveManagementDashboardPort,Sc as detectDeploymentTargets,mm as detectMisconfigurations,gc as detectServiceRegion,_m as diffTemplates,Bf as dlqMonitoringManager,_f as dnssecManager,Zg as drManager,Of as emailAnalyticsManager,Mf as emailTemplateManager,Pu as eventToRequest,Pc as extendPreset,Uf as fifoQueueManager,Am as findChangedFiles,Lg as formatAccountStructure,Zm as formatBytes,Op as formatDiff,eg as formatDuration,lg as formatFlagSuggestions,pg as formatHistory,mg as formatHistoryStats,rg as formatKeyValue,tg as formatList,Ym as formatProgressBar,uu as formatRegion,Rg as formatRegionList,ng as formatSuggestion,Xm as formatTable,Qm as formatTree,Vd as fromEC2Metadata,zd as fromECSMetadata,Fd as fromEnvironment,jd as fromSharedCredentials,Hd as fromWebIdentity,Ul as functionFingerprint,ha as generateAppImageDockerfile,Xg as generateApprovalConfig,yu as generateBootstrap,Gm as generateCleanupWorkflow,Km as generateCostReportWorkflow,$g as generateCrossAccountRoleCF,Gg as generateDeploymentConfig,Vg as generateDeploymentPipeline,Mg as generateDeploymentWorkflow,s as generateLogicalId,Wg as generateManualPipeline,jg as generateMatrixWorkflow,Kg as generateMultiEnvConfig,zg as generateMultiEnvPipeline,Ug as generateMultiEnvWorkflow,Bg as generatePRPreviewWorkflow,Qg as generateParallelConfig,_u as generatePhpFpmConfig,Eu as generatePhpLayerDockerfile,Hg as generatePreviewPipeline,Wm as generatePreviewWorkflow,l as generateResourceName,Jg as generateScheduledConfig,qg as generateScheduledPipeline,Fg as generateScheduledWorkflow,Wd as getAccountId,bg as getAllRegions,Cg as getClosestRegion,dg as getCommandUsage,og as getContextualHelp,xo as getCredentials,Lm as getDeploymentStrategy,Mm as getDiffStats,xm as getDiffSummary,Yd as getErrorDetails,pa as getLocalConfig,Vm as getLocalCredentials,jm as getLocalEndpoint,zm as getLocalEnvVars,Sm as getQuotaUsageSummary,xg as getRecommendedStructure,wi as getRegion,Pg as getRegionStats,Tg as getRegionsByCompliance,vg as getRegionsByLocation,Eg as getRegionsByPricingTier,Zd as getRequiredPermissions,Tp as getSigningKeyCacheSize,Dp as getTimestamp,hg as globalResourceManager,rf as guardDutyManager,qt as hasManagementDashboardSite,Tm as hashBuffer,Em as hashDirectory,$c as hashFile,wm as hashManifest,Oc as hashString,Xf as healthCheckManager,Tf as imageScanningManager,Fl as inspectInvocation,Cu as installRecursionFetch,zl as invocationContext,ig as isLikelyTypo,Fm as isLocalDevelopment,Pr as isManagementDashboardSiteName,Ep as isNodeCryptoAvailable,Ro as isS3RestEndpoint,Ws as isStateDirConfigured,Gs as isStatePath,wg as isValidRegion,wp as isWebCryptoAvailable,Rf as lambdaConcurrencyManager,Df as lambdaDLQManager,Pf as lambdaDestinationsManager,Af as lambdaLayersManager,Nf as lambdaVPCManager,If as lambdaVersionsManager,Ta as laravelServerlessEnvDefaults,uf as logsManager,Rd as mailEnabled,Ks as mailFirewallPorts,fi as makeAWSRequest,Sp as makeAWSRequestAsync,yp as makeAWSRequestOnce,Rc as managementDashboardSiteName,an as mergeInfrastructure,df as metricsManager,mf as migrationManager,Ng as multiAccountManager,gg as multiRegionManager,Qf as networkSecurityManager,Dg as organizationManager,Ea as packagePhpApp,dn as packageServerlessApp,ua as parallel,Rm as parallelMap,Pm as parallelWithRetry,Bl as parseChain,bp as parseJSONResponse,Hs as parseXMLResponse,ff as performanceManager,Ll as phpLayerBuildStage,Tu as phpLayerPackages,Ai as phpRuntimeLayerAssets,qm as previewManager,Jm as previewNotifications,km as processInChunks,cf as progressiveDeploymentManager,jl as propagationHeaders,jf as queueManagementManager,Cm as quickHash,Vl as recursionBlockedResponse,yg as regionPairManager,gf as replicaManager,$m as requiresReplacement,Hf as resetRecursionRuntime,qf as resolveApp,C as resolveAppDatabase,B as resolveCloudProvider,da as resolveCredentials,Ud as resolveDashboardDomain,Bd as resolveDashboardDomains,xp as resolveDeployBucketName,z as resolveDeploymentMode,ta as resolveFailoverStatusCodes,hi as resolveMailService,tm as resolveManagementDashboardSite,Ei as resolveManagementDashboardSites,jt as resolveOriginConnection,E as resolveProjectStackName,ga as resolveQueueNames,Wt as resolveQueues,wu as resolveRecursionConfig,qd as resolveRegion,De as resolveServerlessAppStackName,Zs as resolveServerlessArtifactBucketName,Ao as resolveServerlessAssetBucketName,Mo as resolveServerlessRuntime,Ys as resolveSiteBucketName,Qs as resolveSiteResourceName,Xs as resolveSiteStackName,A as resolveStatePath,_p as resolveStorageBucketName,ra as resolveStorageFailover,Yf as resourceManagementManager,Hl as responseToResult,xf as route53ResolverManager,kf as route53RoutingManager,Su as runBuildHooks,Bo as runPhpBuildHooks,na as s3RegionalDomain,kp as sanitizeName,sg as searchCommands,Sf as secretsManager,yf as secretsRotationManager,nf as securityHubManager,vf as securityScanningManager,Lf as senderReputationManager,Nm as sequence,Cf as serviceMeshManager,qs as setStateDir,Lo as sha256,Au as sharedRecursionGuard,Ml as sharedRuntimeLoop,ae as signRequest,fc as signRequestAsync,Sg as stackDependencyManager,wo as stateDir,et as statePath,Kf as staticSiteManager,Jf as storageAdvancedManager,aa as storageFailoverReplicasFromTemplate,Vc as suggestCommand,cg as suggestFlags,hm as suggestIAMPolicy,bm as suggestQuotaIncrease,Ig as suggestRegionPairs,Ag as suggestRegions,pf as syntheticsManager,vm as templateCache,Og as validateAccountStructure,Bm as validateAgainstSchema,ug as validateCommand,pm as validateConfiguration,gm as validateCredentials,Si as validateOriginGroups,Pp as validateResourceLimits,Ip as validateTemplate,Rp as validateTemplateSize,cm as withCDN,am as withCache,sm as withDatabase,Ru as withInvocation,im as withMonitoring,lm as withQueue,om as withSecurity,Dm as withTimeout,lf as xrayManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Zo}from"./chunk-ht6tpmqw.js";export{Zo as encodeDashboardPayload};
|
package/dist/chunk-01rbgche.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n,l}from"./chunk-5vxpgw8q.js";class K{client;region;constructor(e="us-east-1"){this.region=e,this.client=new n}async describeDBInstances(e){let r={Action:"DescribeDBInstances",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((o,c)=>{r[`Filters.Filter.${c+1}.Name`]=o.Name,o.Values.forEach((u,d)=>{r[`Filters.Filter.${c+1}.Values.Value.${d+1}`]=u})});let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s}),a=t.DescribeDBInstancesResult||t,i=a.DBInstances?.DBInstance||[];if(!Array.isArray(i))i=i?[i]:[];return{DBInstances:i,Marker:a.Marker}}async describeDBInstance(e){return(await this.describeDBInstances({DBInstanceIdentifier:e})).DBInstances?.[0]}async describeDBClusters(e){let r={Action:"DescribeDBClusters",Version:"2014-10-31"};if(e?.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((o,c)=>{r[`Filters.Filter.${c+1}.Name`]=o.Name,o.Values.forEach((u,d)=>{r[`Filters.Filter.${c+1}.Values.Value.${d+1}`]=u})});let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s}),a=t.DescribeDBClustersResult||t,i=a.DBClusters?.DBCluster||[];if(!Array.isArray(i))i=i?[i]:[];return{DBClusters:i,Marker:a.Marker}}async describeDBSnapshots(e){let r={Action:"DescribeDBSnapshots",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;if(e?.SnapshotType)r.SnapshotType=e.SnapshotType;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s}),a=t.DescribeDBSnapshotsResult||t,i=a.DBSnapshots?.DBSnapshot||[];if(!Array.isArray(i))i=i?[i]:[];return{DBSnapshots:i,Marker:a.Marker}}async describeDBSubnetGroups(e){let r={Action:"DescribeDBSubnetGroups",Version:"2014-10-31"};if(e?.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s}),a=t.DescribeDBSubnetGroupsResult||t,i=a.DBSubnetGroups?.DBSubnetGroup||[];if(!Array.isArray(i))i=i?[i]:[];return{DBSubnetGroups:i,Marker:a.Marker}}async createDBInstance(e){let r={Action:"CreateDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBInstanceClass:e.DBInstanceClass,Engine:e.Engine};if(e.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DBName)r.DBName=e.DBName;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.LicenseModel)r.LicenseModel=e.LicenseModel;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.StorageType)r.StorageType=e.StorageType;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((i,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=i});if(e.Tags)e.Tags.forEach((i,o)=>{r[`Tags.Tag.${o+1}.Key`]=i.Key,r[`Tags.Tag.${o+1}.Value`]=i.Value});let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBInstance:(t.CreateDBInstanceResult||t).DBInstance}}async createDBCluster(e){let r={Action:"CreateDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DatabaseName)r.DatabaseName=e.DatabaseName;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;e.VpcSecurityGroupIds?.forEach((a,i)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${i+1}`]=a});let s=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(l(r)).toString()});return{DBCluster:(s.CreateDBClusterResult||s).DBCluster}}async deleteDBInstance(e){let r={Action:"DeleteDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.SkipFinalSnapshot!==void 0)r.SkipFinalSnapshot=e.SkipFinalSnapshot;if(e.FinalDBSnapshotIdentifier)r.FinalDBSnapshotIdentifier=e.FinalDBSnapshotIdentifier;if(e.DeleteAutomatedBackups!==void 0)r.DeleteAutomatedBackups=e.DeleteAutomatedBackups;let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBInstance:(t.DeleteDBInstanceResult||t).DBInstance}}async modifyDBInstance(e){let r={Action:"ModifyDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((i,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=i});let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBInstance:(t.ModifyDBInstanceResult||t).DBInstance}}async modifyDBCluster(e){let r={Action:"ModifyDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier};if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBCluster:(t.ModifyDBClusterResult||t).DBCluster}}async rebootDBCluster(e){let r={Action:"FailoverDBCluster",Version:"2014-10-31",DBClusterIdentifier:e},s=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(l(r)).toString()});return{DBCluster:(s.FailoverDBClusterResult||s).DBCluster}}async createDBClusterSnapshot(e,r){let s={Action:"CreateDBClusterSnapshot",Version:"2014-10-31",DBClusterIdentifier:e,DBClusterSnapshotIdentifier:r};return this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(l(s)).toString()})}async describeDBClusterSnapshots(e={}){let r={Action:"DescribeDBClusterSnapshots",Version:"2014-10-31",...e},s=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(l(r)).toString()}),t=s.DescribeDBClusterSnapshotsResult||s,a=t.DBClusterSnapshots?.DBClusterSnapshot??t.DBClusterSnapshots??[];return{DBClusterSnapshots:Array.isArray(a)?a:[a]}}async deleteDBClusterSnapshot(e){await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(l({Action:"DeleteDBClusterSnapshot",Version:"2014-10-31",DBClusterSnapshotIdentifier:e})).toString()})}async deleteDBCluster(e,r){let s={Action:"DeleteDBCluster",Version:"2014-10-31",DBClusterIdentifier:e,SkipFinalSnapshot:!r};if(r)s.FinalDBSnapshotIdentifier=r;let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(l(s)).toString()});return{DBCluster:(t.DeleteDBClusterResult||t).DBCluster}}async restoreDBClusterToPointInTime(e){let r={Action:"RestoreDBClusterToPointInTime",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SourceDBClusterIdentifier:e.SourceDBClusterIdentifier};if(e.RestoreToTime)r.RestoreToTime=e.RestoreToTime.toISOString();if(e.UseLatestRestorableTime)r.UseLatestRestorableTime=!0;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((i,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=i});let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBCluster:(t.RestoreDBClusterToPointInTimeResult||t).DBCluster}}async restoreDBClusterFromSnapshot(e){let r={Action:"RestoreDBClusterFromSnapshot",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SnapshotIdentifier:e.SnapshotIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds?.forEach((a,i)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${i+1}`]=a}),e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;let s=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(l(r)).toString()});return{DBCluster:(s.RestoreDBClusterFromSnapshotResult||s).DBCluster}}async startDBInstance(e){let s=new URLSearchParams(l({Action:"StartDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e})).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBInstance:(t.StartDBInstanceResult||t).DBInstance}}async stopDBInstance(e){let r={Action:"StopDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBInstance:(t.StopDBInstanceResult||t).DBInstance}}async rebootDBInstance(e){let r={Action:"RebootDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.ForceFailover!==void 0)r.ForceFailover=e.ForceFailover;let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBInstance:(t.RebootDBInstanceResult||t).DBInstance}}async createDBSnapshot(e){let r={Action:"CreateDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.Tags)e.Tags.forEach((i,o)=>{r[`Tags.Tag.${o+1}.Key`]=i.Key,r[`Tags.Tag.${o+1}.Value`]=i.Value});let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBSnapshot:(t.CreateDBSnapshotResult||t).DBSnapshot}}async deleteDBSnapshot(e){let s=new URLSearchParams(l({Action:"DeleteDBSnapshot",Version:"2014-10-31",DBSnapshotIdentifier:e})).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBSnapshot:(t.DeleteDBSnapshotResult||t).DBSnapshot}}async restoreDBInstanceFromDBSnapshot(e){let r={Action:"RestoreDBInstanceFromDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.Port)r.Port=e.Port;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((i,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=i});if(e.Tags)e.Tags.forEach((i,o)=>{r[`Tags.Tag.${o+1}.Key`]=i.Key,r[`Tags.Tag.${o+1}.Value`]=i.Value});let s=new URLSearchParams(l(r)).toString(),t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});return{DBInstance:(t.RestoreDBInstanceFromDBSnapshotResult||t).DBInstance}}async waitForDBInstanceAvailable(e,r=60,s=30000){for(let t=0;t<r;t++){let a=await this.describeDBInstance(e);if(a?.DBInstanceStatus==="available")return a;if(["deleted","failed","incompatible-restore","incompatible-parameters"].includes(a?.DBInstanceStatus||""))throw Error(`DB instance ${e} is in terminal state: ${a?.DBInstanceStatus}`);await new Promise((i)=>setTimeout(i,s))}throw Error(`Timeout waiting for DB instance ${e} to become available`)}async waitForDBInstanceDeleted(e,r=60,s=30000){for(let t=0;t<r;t++)try{let a=await this.describeDBInstance(e);if(a?.DBInstanceStatus==="deleting"){await new Promise((i)=>setTimeout(i,s));continue}throw Error(`DB instance ${e} is in state: ${a?.DBInstanceStatus}`)}catch(a){if(a.code==="DBInstanceNotFound"||a.code==="DBInstanceNotFoundFault")return;throw a}throw Error(`Timeout waiting for DB instance ${e} to be deleted`)}}
|
|
2
|
-
export{K};
|
package/dist/chunk-2hy7ny4k.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{yo,Kr,Hd,_i,vo,To}from"./chunk-ds2v2xpb.js";import{Le}from"./chunk-j2w0cvnr.js";import{execFileSync as k}from"node:child_process";import{mkdirSync as I,mkdtempSync as M,rmSync as U,writeFileSync as d}from"node:fs";import{tmpdir as L}from"node:os";import{dirname as O,join as s}from"node:path";var r={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m"};function b(t,e){return`${r[e]}${t}${r.reset}`}function fn(t){console.log(`${r.green}✓${r.reset} ${t}`)}function Su(t){console.error(`${r.red}✗${r.reset} ${t}`)}function as(t){console.warn(`${r.yellow}⚠${r.reset} ${t}`)}function N(t){console.log(`${r.blue}ℹ${r.reset} ${t}`)}function T(t){console.log(`${r.cyan}→${r.reset} ${t}`)}function cs(t){console.log(`
|
|
2
|
-
${r.bright}${r.cyan}${t}${r.reset}
|
|
3
|
-
`)}var D=!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.BUILDKITE||process.env.CIRCLECI||process.env.GITLAB_CI);function Cu(t,e="cyan"){let n=t.split(`
|
|
4
|
-
`),i=Math.max(...n.map((l)=>l.length)),a="─".repeat(i+2);console.log(b(`┌${a}┐`,e)),n.forEach((l)=>{console.log(b(`│ ${l.padEnd(i)} │`,e))}),console.log(b(`└${a}┘`,e))}function C(t,e){for(let n of e){let i=s(t,n.name);I(O(i),{recursive:!0}),d(i,n.data,n.mode?{mode:n.mode}:void 0)}}async function Fa(t){let{app:e,projectRoot:n,region:i,repository:a}=t,l=e.architecture??"x86_64",A=l==="arm64"?"linux/arm64":"linux/amd64",R=e.kind==="php",c=t.onStep??(()=>{}),p=M(s(L(),"tscloud-img-"));try{let f=s(p,"app");I(f,{recursive:!0});let y,w;if(R){vo({projectRoot:n,app:e,skipBuild:t.skipBuild,onStep:c}),c("staging application tree");let o=To(n);C(f,o),C(s(p,"runtime"),_i().map((g)=>({name:g.path,data:g.contents,mode:g.mode})));let B=e.handlers?.http??"public/index.php";y={http:B,queue:e.handlers?.queue??B,cli:e.handlers?.cli??B},w=yo(o.map((g)=>`${g.name}:${g.data.length}`).join("|"))}else{c("bundling application");let o=await Kr({projectRoot:n,app:e,skipBuild:t.skipBuild,onStep:c});d(s(f,"index.mjs"),o.bundle),y=o.handlers,w=o.sha256}let S=w.slice(0,16);d(s(p,"Dockerfile"),Hd({kind:e.kind??"node",phpVersion:e.phpVersion,architecture:l}));let v=new Le(i),u;try{u=(await v.describeRepositories({repositoryNames:[a]})).repositories?.[0]?.repositoryUri??""}catch{u=""}if(!u)c(`creating ECR repository ${a}`),u=(await v.createRepository({repositoryName:a,imageScanningConfiguration:{scanOnPush:!0}})).repository?.repositoryUri??"";if(!u)throw Error(`could not resolve ECR repository URI for ${a}`);let m=`${u}:${S}`;c("docker build"),k("docker",["build","--platform",A,"--provenance=false","--sbom=false","-t",m,p],{stdio:"inherit"}),c("ecr auth + push");let h=(await v.getAuthorizationToken()).authorizationData?.[0];if(!h?.authorizationToken||!h.proxyEndpoint)throw Error("failed to get an ECR authorization token");let P=h.proxyEndpoint.replace(/^https?:\/\//,""),x=s(p,".docker");return I(x,{recursive:!0}),d(s(x,"config.json"),JSON.stringify({auths:{[P]:{auth:h.authorizationToken}}})),k("docker",["push",m],{stdio:"inherit",env:{...process.env,DOCKER_CONFIG:x}}),N(`Image: ${m}`),{imageUri:m,tag:S,handlers:y}}finally{U(p,{recursive:!0,force:!0})}}
|
|
5
|
-
export{fn,Su,as,N,T,cs,Cu,Fa};
|
package/dist/chunk-4rb7stp5.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import{Rr,n}from"./chunk-5vxpgw8q.js";import{He}from"./chunk-60fn008g.js";import*as d from"node:crypto";import{readFileSync as U}from"node:fs";import{readdir as z}from"node:fs/promises";import{join as M}from"node:path";function wr(e){if(e){let i=B(e);if(!i)throw Error(`AWS profile '${e}' not found in ~/.aws/credentials`);return i}let t=process.env.AWS_ACCESS_KEY_ID,s=process.env.AWS_SECRET_ACCESS_KEY;if(t&&s)return{accessKeyId:t,secretAccessKey:s,sessionToken:process.env.AWS_SESSION_TOKEN};return B(process.env.AWS_PROFILE||"default")??{accessKeyId:"",secretAccessKey:""}}function B(e){let{existsSync:t,readFileSync:s}=He("node:fs"),{homedir:i}=He("node:os"),{join:r}=He("node:path"),a=process.env.AWS_SHARED_CREDENTIALS_FILE||r(i(),".aws","credentials");if(!t(a))return null;let c=s(a,"utf-8"),g=null,l,u,p;for(let y of c.split(`
|
|
2
|
-
`)){let f=y.trim();if(!f||f.startsWith("#")||f.startsWith(";"))continue;let m=f.match(/^\[([^\]]+)\]$/);if(m){if(g===e&&l&&u)return{accessKeyId:l,secretAccessKey:u,sessionToken:p};g=m[1],l=void 0,u=void 0,p=void 0;continue}if(g===e){let[T,...P]=f.split("="),S=P.join("=").trim();switch(T.trim().toLowerCase()){case"aws_access_key_id":l=S;break;case"aws_secret_access_key":u=S;break;case"aws_session_token":p=S;break}}}if(g===e&&l&&u)return{accessKeyId:l,secretAccessKey:u,sessionToken:p};return null}function L(e){let{buffer:t,byteOffset:s,byteLength:i}=e;if(t instanceof ArrayBuffer)return t.slice(s,s+i);let r=new ArrayBuffer(i);return new Uint8Array(r).set(new Uint8Array(e)),r}function I(e,t){let s=e?.[t]??e;if(s===null||typeof s!=="object"||Array.isArray(s))return s;let i={...s};return delete i["@_xmlns"],i}class o{client;region;explicitProfile;endpoint;endpointProtocol="https";forcePathStyle;explicitCredentials;constructor(e="us-east-1",t,s){let i=typeof e==="string"?s:e,r=typeof e==="string"?e:e.region??"us-east-1",a=typeof e==="string"?t:e.profile,c=i?.endpoint?Rr({region:r,path:"/",endpoint:i.endpoint}):void 0;this.region=r,this.explicitProfile=a,this.endpoint=c?.host,this.endpointProtocol=c?.protocol??"https",this.forcePathStyle=i?.forcePathStyle,this.explicitCredentials=i?.credentials,this.client=new n(i?.credentials,{profile:a,endpoint:i?.endpoint,forcePathStyle:i?.forcePathStyle})}getCredentials(){if(this.explicitCredentials?.accessKeyId&&this.explicitCredentials.secretAccessKey)return this.explicitCredentials;let e=wr(this.explicitProfile);if(e.accessKeyId&&e.secretAccessKey)return e;throw Error("S3 credentials not found. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (or pass explicit credentials/profile), or configure ~/.aws/credentials.")}s3BaseHost(){return this.endpoint||`s3.${this.region}.amazonaws.com`}s3VirtualHost(e){return this.forcePathStyle?this.s3BaseHost():`${e}.${this.s3BaseHost()}`}objectPath(e,t){return this.forcePathStyle?`/${e}/${t}`:`/${t}`}objectUrl(e,t){return`${this.endpointProtocol}://${this.s3VirtualHost(e)}${this.objectPath(e,t)}`}async listBuckets(){let e=await this.client.request({service:"s3",region:this.region,method:"GET",path:"/"}),t=[],i=(e?.ListAllMyBucketsResult??e)?.Buckets?.Bucket;if(i){let r=Array.isArray(i)?i:[i];for(let a of r)t.push({Name:a.Name,CreationDate:a.CreationDate})}return{Buckets:t}}async createBucket(e,t){let s={};if(t?.acl)s["x-amz-acl"]=t.acl;let i;if(this.region!=="us-east-1"&&!this.endpoint)i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
|
-
<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
4
|
-
<LocationConstraint>${this.region}</LocationConstraint>
|
|
5
|
-
</CreateBucketConfiguration>`,s["Content-Type"]="application/xml";await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,headers:s,body:i})}async deleteBucket(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`})}async emptyAndDeleteBucket(e){let t=!0;while(t){let s=await this.listAllObjects({bucket:e});if(s.length===0){t=!1;break}let i=s.map((r)=>r.Key);for(let r=0;r<i.length;r+=1000){let a=i.slice(r,r+1000);await this.deleteObjects(e,a)}}await this.deleteBucket(e)}async listAllObjects(e){let t=[],s;do{let i={"list-type":"2","max-keys":"1000"};if(e.prefix)i.prefix=e.prefix;if(s)i["continuation-token"]=s;let r=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e.bucket}`,queryParams:i}),a=r?.ListBucketResult??r,c=a?.Contents;if(c){let l=Array.isArray(c)?c:[c];for(let u of l)t.push({Key:u.Key,LastModified:u.LastModified||"",Size:Number.parseInt(u.Size||"0"),ETag:u.ETag})}let g=a?.IsTruncated;s=g==="true"||g===!0?a?.NextContinuationToken:void 0}while(s);return t}async list(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e.bucket}`}),s=[],r=(t?.ListBucketResult??t)?.Contents;if(r){let a=Array.isArray(r)?r:[r];for(let c of a){if(e.prefix&&!c.Key?.startsWith(e.prefix))continue;if(s.push({Key:c.Key||"",LastModified:c.LastModified||"",Size:Number.parseInt(c.Size||"0"),ETag:c.ETag}),e.maxKeys&&s.length>=e.maxKeys)break}}return s}async putObject(e){let t={};if(e.acl)t["x-amz-acl"]=e.acl;if(e.cacheControl)t["Cache-Control"]=e.cacheControl;if(e.contentType)t["Content-Type"]=e.contentType;if(e.metadata)for(let[r,a]of Object.entries(e.metadata))t[`x-amz-meta-${r}`]=a;let s=e.key.split("/").map((r)=>encodeURIComponent(r)).join("/"),i=e.body instanceof Uint8Array&&!Buffer.isBuffer(e.body)?Buffer.from(e.body):e.body;if(Buffer.isBuffer(i)||i instanceof Uint8Array){let r=Buffer.isBuffer(i)?i:Buffer.from(i),{accessKeyId:a,secretAccessKey:c,sessionToken:g}=this.getCredentials(),l=this.s3VirtualHost(e.bucket),u=this.objectPath(e.bucket,s),p=this.objectUrl(e.bucket,s),y=new Date,f=y.toISOString().replace(/[:-]|\.\d{3}/g,""),m=y.toISOString().slice(0,10).replace(/-/g,""),T=d.createHash("sha256").update(r).digest("hex"),P={host:l,"x-amz-date":f,"x-amz-content-sha256":T,...t};if(g)P["x-amz-security-token"]=g;let S=Object.keys(P).sort().map((b)=>`${b.toLowerCase()}:${P[b].trim()}
|
|
6
|
-
`).join(""),x=Object.keys(P).sort().map((b)=>b.toLowerCase()).join(";"),A=["PUT",u,"",S,x,T].join(`
|
|
7
|
-
`),v="AWS4-HMAC-SHA256",C=`${m}/${this.region}/s3/aws4_request`,H=[v,f,C,d.createHash("sha256").update(A).digest("hex")].join(`
|
|
8
|
-
`),R=d.createHmac("sha256",`AWS4${c}`).update(m).digest(),K=d.createHmac("sha256",R).update(this.region).digest(),j=d.createHmac("sha256",K).update("s3").digest(),q=d.createHmac("sha256",j).update("aws4_request").digest(),E=d.createHmac("sha256",q).update(H).digest("hex"),k=`${v} Credential=${a}/${C}, SignedHeaders=${x}, Signature=${E}`,w=await fetch(p,{method:"PUT",headers:{...P,Authorization:k},body:L(r)});if(!w.ok){let b=await w.text();throw Error(`S3 PUT failed: ${w.status} ${b}`)}return}await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${s}`,bucket:e.bucket,headers:t,body:e.body})}async getObject(e,t){let s=t.split("/").map((r)=>encodeURIComponent(r)).join("/");return await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${s}`,bucket:e,rawResponse:!0})}async getObjectBytes(e,t){let{accessKeyId:s,secretAccessKey:i,sessionToken:r}=this.getCredentials(),a=this.s3VirtualHost(e),c=t.split("/").map((b)=>encodeURIComponent(b)).join("/"),g=this.objectPath(e,c),l=this.objectUrl(e,c),u=new Date,p=u.toISOString().replace(/[:-]|\.\d{3}/g,""),y=u.toISOString().slice(0,10).replace(/-/g,""),f=d.createHash("sha256").update("").digest("hex"),m={host:a,"x-amz-date":p,"x-amz-content-sha256":f};if(r)m["x-amz-security-token"]=r;let T=Object.keys(m).sort().map((b)=>`${b.toLowerCase()}:${m[b].trim()}
|
|
9
|
-
`).join(""),P=Object.keys(m).sort().map((b)=>b.toLowerCase()).join(";"),S=["GET",g,"",T,P,f].join(`
|
|
10
|
-
`),x="AWS4-HMAC-SHA256",A=`${y}/${this.region}/s3/aws4_request`,v=[x,p,A,d.createHash("sha256").update(S).digest("hex")].join(`
|
|
11
|
-
`),C=d.createHmac("sha256",`AWS4${i}`).update(y).digest(),H=d.createHmac("sha256",C).update(this.region).digest(),R=d.createHmac("sha256",H).update("s3").digest(),K=d.createHmac("sha256",R).update("aws4_request").digest(),j=d.createHmac("sha256",K).update(v).digest("hex"),q=`${x} Credential=${s}/${A}, SignedHeaders=${P}, Signature=${j}`,E=await fetch(l,{method:"GET",headers:{...m,Authorization:q}});if(!E.ok){let b=await E.text();throw Error(`S3 GET failed: ${E.status} ${b}`)}let k=await E.arrayBuffer(),w=E.headers.get("content-length");return{body:new Uint8Array(k),contentType:E.headers.get("content-type")??void 0,contentLength:w?Number.parseInt(w,10):void 0}}async copyObject(e){let t=(i)=>i.split("/").map((r)=>encodeURIComponent(r)).join("/"),s={"x-amz-copy-source":`/${e.sourceBucket}/${t(e.sourceKey)}`};if(e.metadataDirective)s["x-amz-metadata-directive"]=e.metadataDirective;if(e.contentType)s["Content-Type"]=e.contentType;if(e.metadata)for(let[i,r]of Object.entries(e.metadata))s[`x-amz-meta-${i}`]=r;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e.destinationBucket}/${t(e.destinationKey)}`,headers:s})}async deleteObject(e,t){let s=t.split("/").map((i)=>encodeURIComponent(i)).join("/");await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${s}`,bucket:e})}async deleteObjects(e,t){let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
12
|
-
<Delete>
|
|
13
|
-
${t.map((r)=>`<Object><Key>${r}</Key></Object>`).join(`
|
|
14
|
-
`)}
|
|
15
|
-
</Delete>`,i=d.createHash("md5").update(s).digest("base64");await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${e}`,queryParams:{delete:""},body:s,headers:{"Content-Type":"application/xml","Content-MD5":i}})}async bucketExists(e){try{return await this.client.request({service:"s3",region:this.region,method:"HEAD",path:`/${e}`}),!0}catch{return!1}}async copy(e){let t=U(e.source);await this.putObject({bucket:e.bucket,key:e.key,body:t,acl:e.acl,cacheControl:e.cacheControl,contentType:e.contentType,metadata:e.metadata})}async sync(e){let t=await this.listFilesRecursive(e.source);for(let s of t){if(e.exclude&&e.exclude.some((a)=>s.includes(a)))continue;if(e.include&&!e.include.some((a)=>s.includes(a)))continue;let i=s.substring(e.source.length+1),r=e.prefix?`${e.prefix}/${i}`:i;if(!e.dryRun){let a=U(s);await this.putObject({bucket:e.bucket,key:r,body:a,acl:e.acl,cacheControl:e.cacheControl,contentType:e.contentType,metadata:e.metadata})}}}async delete(e,t){await this.deleteObject(e,t)}async deletePrefix(e,t){let i=(await this.list({bucket:e,prefix:t})).map((r)=>r.Key);if(i.length>0)await this.deleteObjects(e,i)}async getBucketSize(e,t){return(await this.list({bucket:e,prefix:t})).reduce((i,r)=>i+r.Size,0)}async listFilesRecursive(e){let t=[],s=await z(e,{withFileTypes:!0});for(let i of s){let r=M(e,i.name);if(i.isDirectory()){let a=await this.listFilesRecursive(r);t.push(...a)}else t.push(r)}return t}async putBucketPolicy(e,t){let{accessKeyId:s,secretAccessKey:i,sessionToken:r}=this.getCredentials(),a=this.s3BaseHost(),c=typeof t==="string"?t:JSON.stringify(t),g=new Date,l=g.toISOString().replace(/[:-]|\.\d{3}/g,""),u=g.toISOString().slice(0,10).replace(/-/g,""),p=d.createHash("sha256").update(c).digest("hex"),y="/"+e,f="policy=",m={host:a,"x-amz-date":l,"x-amz-content-sha256":p,"content-type":"application/json"};if(r)m["x-amz-security-token"]=r;let T=Object.keys(m).sort().map((w)=>`${w.toLowerCase()}:${m[w].trim()}
|
|
16
|
-
`).join(""),P=Object.keys(m).sort().map((w)=>w.toLowerCase()).join(";"),S=["PUT",y,"policy=",T,P,p].join(`
|
|
17
|
-
`),x="AWS4-HMAC-SHA256",A=`${u}/${this.region}/s3/aws4_request`,v=[x,l,A,d.createHash("sha256").update(S).digest("hex")].join(`
|
|
18
|
-
`),C=d.createHmac("sha256","AWS4"+i).update(u).digest(),H=d.createHmac("sha256",C).update(this.region).digest(),R=d.createHmac("sha256",H).update("s3").digest(),K=d.createHmac("sha256",R).update("aws4_request").digest(),j=d.createHmac("sha256",K).update(v).digest("hex"),q=`${x} Credential=${s}/${A}, SignedHeaders=${P}, Signature=${j}`,E=`${this.endpointProtocol}://${a}${y}?policy=`,k=await fetch(E,{method:"PUT",headers:{...m,Authorization:q},body:c});if(!k.ok){let w=await k.text();throw Error(`Failed to put bucket policy: ${k.status} ${w}`)}}async getBucketPolicy(e){let{accessKeyId:t,secretAccessKey:s,sessionToken:i}=this.getCredentials(),r=this.s3BaseHost(),a=new Date,c=a.toISOString().replace(/[:-]|\.\d{3}/g,""),g=a.toISOString().slice(0,10).replace(/-/g,""),l=d.createHash("sha256").update("").digest("hex"),u="/"+e,p="policy=",y={host:r,"x-amz-date":c,"x-amz-content-sha256":l};if(i)y["x-amz-security-token"]=i;let f=Object.keys(y).sort().map((k)=>`${k.toLowerCase()}:${y[k].trim()}
|
|
19
|
-
`).join(""),m=Object.keys(y).sort().map((k)=>k.toLowerCase()).join(";"),T=["GET",u,"policy=",f,m,l].join(`
|
|
20
|
-
`),P="AWS4-HMAC-SHA256",S=`${g}/${this.region}/s3/aws4_request`,x=[P,c,S,d.createHash("sha256").update(T).digest("hex")].join(`
|
|
21
|
-
`),A=d.createHmac("sha256","AWS4"+s).update(g).digest(),v=d.createHmac("sha256",A).update(this.region).digest(),C=d.createHmac("sha256",v).update("s3").digest(),H=d.createHmac("sha256",C).update("aws4_request").digest(),R=d.createHmac("sha256",H).update(x).digest("hex"),K=`${P} Credential=${t}/${S}, SignedHeaders=${m}, Signature=${R}`,j=`${this.endpointProtocol}://${r}${u}?policy=`,q=await fetch(j,{method:"GET",headers:{...y,Authorization:K}});if(q.status===404)return null;if(!q.ok){let k=await q.text();throw Error(`Failed to get bucket policy: ${q.status} ${k}`)}let E=await q.text();return JSON.parse(E)}async deleteBucketPolicy(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{policy:""}})}async headBucket(e){try{return{exists:!0,region:(await this.client.request({service:"s3",region:this.region,method:"HEAD",path:`/${e}`,returnHeaders:!0}))?.headers?.["x-amz-bucket-region"]}}catch(t){if(t.statusCode===404)return{exists:!1};throw t}}async headObject(e,t){try{let s=await this.client.request({service:"s3",region:this.region,method:"HEAD",path:`/${e}/${t}`,returnHeaders:!0});return{ContentLength:s?.headers?.["content-length"]?parseInt(s.headers["content-length"]):void 0,ContentType:s?.headers?.["content-type"],ETag:s?.headers?.etag,LastModified:s?.headers?.["last-modified"]}}catch(s){if(s.statusCode===404)return null;throw s}}async getObjectBuffer(e,t){let s=await this.getObject(e,t);return Buffer.from(s)}async getObjectJson(e,t){let s=await this.getObject(e,t);return JSON.parse(s)}async putObjectJson(e,t,s,i){await this.putObject({bucket:e,key:t,body:JSON.stringify(s),contentType:"application/json",...i})}async getBucketVersioning(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{versioning:""}});return{Status:(t?.VersioningConfiguration??t)?.Status}}async putBucketVersioning(e,t){let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
22
|
-
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
23
|
-
<Status>${t}</Status>
|
|
24
|
-
</VersioningConfiguration>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{versioning:""},headers:{"Content-Type":"application/xml"},body:s})}async getBucketLifecycleConfiguration(e){try{let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{lifecycle:""}});return I(t,"LifecycleConfiguration")}catch(t){if(t.statusCode===404)return null;throw t}}async putBucketLifecycleConfiguration(e,t){let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
25
|
-
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
26
|
-
${t.map((r)=>{let a=`<Rule><ID>${r.ID}</ID><Status>${r.Status}</Status>`;if(r.Filter)a+=`<Filter><Prefix>${r.Filter.Prefix||""}</Prefix></Filter>`;else a+="<Filter><Prefix></Prefix></Filter>";if(r.Expiration){if(r.Expiration.Days)a+=`<Expiration><Days>${r.Expiration.Days}</Days></Expiration>`;else if(r.Expiration.Date)a+=`<Expiration><Date>${r.Expiration.Date}</Date></Expiration>`}if(r.Transitions)for(let c of r.Transitions)a+=`<Transition><Days>${c.Days}</Days><StorageClass>${c.StorageClass}</StorageClass></Transition>`;if(r.NoncurrentVersionExpiration)a+=`<NoncurrentVersionExpiration><NoncurrentDays>${r.NoncurrentVersionExpiration.NoncurrentDays}</NoncurrentDays></NoncurrentVersionExpiration>`;return a+="</Rule>",a}).join("")}
|
|
27
|
-
</LifecycleConfiguration>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{lifecycle:""},headers:{"Content-Type":"application/xml"},body:i})}async deleteBucketLifecycleConfiguration(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{lifecycle:""}})}async getBucketCors(e){try{let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{cors:""}});return I(t,"CORSConfiguration")}catch(t){if(t.statusCode===404)return null;throw t}}async putBucketCors(e,t){let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
28
|
-
<CORSConfiguration>
|
|
29
|
-
${t.map((r)=>{let a="<CORSRule>";for(let c of r.AllowedOrigins)a+=`<AllowedOrigin>${c}</AllowedOrigin>`;for(let c of r.AllowedMethods)a+=`<AllowedMethod>${c}</AllowedMethod>`;if(r.AllowedHeaders)for(let c of r.AllowedHeaders)a+=`<AllowedHeader>${c}</AllowedHeader>`;if(r.ExposeHeaders)for(let c of r.ExposeHeaders)a+=`<ExposeHeader>${c}</ExposeHeader>`;if(r.MaxAgeSeconds)a+=`<MaxAgeSeconds>${r.MaxAgeSeconds}</MaxAgeSeconds>`;return a+="</CORSRule>",a}).join("")}
|
|
30
|
-
</CORSConfiguration>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{cors:""},headers:{"Content-Type":"application/xml"},body:i})}async deleteBucketCors(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{cors:""}})}async getBucketEncryption(e){try{let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{encryption:""}});return I(t,"ServerSideEncryptionConfiguration")}catch(t){if(t.statusCode===404)return null;throw t}}async putBucketEncryption(e,t,s){let i=`<ApplyServerSideEncryptionByDefault><SSEAlgorithm>${t}</SSEAlgorithm>`;if(s)i+=`<KMSMasterKeyID>${s}</KMSMasterKeyID>`;i+="</ApplyServerSideEncryptionByDefault>";let r=`<?xml version="1.0" encoding="UTF-8"?>
|
|
31
|
-
<ServerSideEncryptionConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
32
|
-
<Rule>${i}</Rule>
|
|
33
|
-
</ServerSideEncryptionConfiguration>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{encryption:""},headers:{"Content-Type":"application/xml"},body:r})}async deleteBucketEncryption(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{encryption:""}})}async getBucketTagging(e){try{let s=(await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{tagging:""}}))?.Tagging?.TagSet?.Tag;if(!s)return[];return Array.isArray(s)?s:[s]}catch(t){if(t.statusCode===404)return[];throw t}}async putBucketTagging(e,t){let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
34
|
-
<Tagging>
|
|
35
|
-
<TagSet>${t.map((r)=>`<Tag><Key>${r.Key}</Key><Value>${r.Value}</Value></Tag>`).join("")}</TagSet>
|
|
36
|
-
</Tagging>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{tagging:""},headers:{"Content-Type":"application/xml"},body:i})}async deleteBucketTagging(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{tagging:""}})}async getObjectTagging(e,t){try{let i=(await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}/${t}`,queryParams:{tagging:""}}))?.Tagging?.TagSet?.Tag;if(!i)return[];return Array.isArray(i)?i:[i]}catch(s){if(s.statusCode===404)return[];throw s}}async putObjectTagging(e,t,s){let r=`<?xml version="1.0" encoding="UTF-8"?>
|
|
37
|
-
<Tagging>
|
|
38
|
-
<TagSet>${s.map((a)=>`<Tag><Key>${a.Key}</Key><Value>${a.Value}</Value></Tag>`).join("")}</TagSet>
|
|
39
|
-
</Tagging>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}/${t}`,queryParams:{tagging:""},headers:{"Content-Type":"application/xml"},body:r})}async deleteObjectTagging(e,t){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}/${t}`,queryParams:{tagging:""}})}async getBucketAcl(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{acl:""}});return I(t,"AccessControlPolicy")}async putBucketAcl(e,t){await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{acl:""},headers:{"x-amz-acl":t}})}async getObjectAcl(e,t){let s=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}/${t}`,queryParams:{acl:""}});return I(s,"AccessControlPolicy")}async putObjectAcl(e,t,s){await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}/${t}`,queryParams:{acl:""},headers:{"x-amz-acl":s}})}async getBucketLocation(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{location:""}}),s=I(t,"LocationConstraint");return(typeof s==="string"?s:s?.["#text"])||"us-east-1"}async getBucketLogging(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{logging:""}});return I(t,"BucketLoggingStatus")}async putBucketLogging(e,t,s){let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
40
|
-
<BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
41
|
-
<LoggingEnabled>
|
|
42
|
-
<TargetBucket>${t}</TargetBucket>
|
|
43
|
-
<TargetPrefix>${s}</TargetPrefix>
|
|
44
|
-
</LoggingEnabled>
|
|
45
|
-
</BucketLoggingStatus>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{logging:""},headers:{"Content-Type":"application/xml"},body:i})}async getBucketNotificationConfiguration(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{notification:""}});return I(t,"NotificationConfiguration")}async putBucketNotificationConfiguration(e,t){let s="";if(t.LambdaFunctionConfigurations)for(let r of t.LambdaFunctionConfigurations){if(s+="<CloudFunctionConfiguration>",r.Id)s+=`<Id>${r.Id}</Id>`;s+=`<CloudFunction>${r.LambdaFunctionArn}</CloudFunction>`;for(let a of r.Events)s+=`<Event>${a}</Event>`;if(r.Filter?.Key?.FilterRules){s+="<Filter><S3Key>";for(let a of r.Filter.Key.FilterRules)s+=`<FilterRule><Name>${a.Name}</Name><Value>${a.Value}</Value></FilterRule>`;s+="</S3Key></Filter>"}s+="</CloudFunctionConfiguration>"}if(t.TopicConfigurations)for(let r of t.TopicConfigurations){if(s+="<TopicConfiguration>",r.Id)s+=`<Id>${r.Id}</Id>`;s+=`<Topic>${r.TopicArn}</Topic>`;for(let a of r.Events)s+=`<Event>${a}</Event>`;s+="</TopicConfiguration>"}if(t.QueueConfigurations)for(let r of t.QueueConfigurations){if(s+="<QueueConfiguration>",r.Id)s+=`<Id>${r.Id}</Id>`;s+=`<Queue>${r.QueueArn}</Queue>`;for(let a of r.Events)s+=`<Event>${a}</Event>`;s+="</QueueConfiguration>"}let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
46
|
-
<NotificationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
47
|
-
${s}
|
|
48
|
-
</NotificationConfiguration>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{notification:""},headers:{"Content-Type":"application/xml"},body:i})}async getBucketWebsite(e){try{let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{website:""}});return I(t,"WebsiteConfiguration")}catch(t){if(t.statusCode===404)return null;throw t}}async putBucketWebsite(e,t){let s="";if(t.RedirectAllRequestsTo)s=`<RedirectAllRequestsTo>
|
|
49
|
-
<HostName>${t.RedirectAllRequestsTo.HostName}</HostName>
|
|
50
|
-
${t.RedirectAllRequestsTo.Protocol?`<Protocol>${t.RedirectAllRequestsTo.Protocol}</Protocol>`:""}
|
|
51
|
-
</RedirectAllRequestsTo>`;else if(s=`<IndexDocument><Suffix>${t.IndexDocument}</Suffix></IndexDocument>`,t.ErrorDocument)s+=`<ErrorDocument><Key>${t.ErrorDocument}</Key></ErrorDocument>`;let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
52
|
-
<WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
53
|
-
${s}
|
|
54
|
-
</WebsiteConfiguration>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{website:""},headers:{"Content-Type":"application/xml"},body:i})}async deleteBucketWebsite(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{website:""}})}async getBucketReplication(e){try{let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{replication:""}});return I(t,"ReplicationConfiguration")}catch(t){if(t.statusCode===404)return null;throw t}}async deleteBucketReplication(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{replication:""}})}async getPublicAccessBlock(e){try{let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{publicAccessBlock:""}});return I(t,"PublicAccessBlockConfiguration")}catch(t){if(t.statusCode===404)return null;throw t}}async putPublicAccessBlock(e,t){let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
55
|
-
<PublicAccessBlockConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
56
|
-
<BlockPublicAcls>${t.BlockPublicAcls??!0}</BlockPublicAcls>
|
|
57
|
-
<IgnorePublicAcls>${t.IgnorePublicAcls??!0}</IgnorePublicAcls>
|
|
58
|
-
<BlockPublicPolicy>${t.BlockPublicPolicy??!0}</BlockPublicPolicy>
|
|
59
|
-
<RestrictPublicBuckets>${t.RestrictPublicBuckets??!0}</RestrictPublicBuckets>
|
|
60
|
-
</PublicAccessBlockConfiguration>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{publicAccessBlock:""},headers:{"Content-Type":"application/xml"},body:s})}async deletePublicAccessBlock(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{publicAccessBlock:""}})}generatePresignedGetUrl(e,t,s=3600){let{accessKeyId:i,secretAccessKey:r}=this.getCredentials(),a=this.s3VirtualHost(e),c=new Date,g=c.toISOString().replace(/[:-]|\.\d{3}/g,""),l=c.toISOString().slice(0,10).replace(/-/g,""),u=`${l}/${this.region}/s3/aws4_request`,p=`${i}/${u}`,y=t.split("/").map((C)=>encodeURIComponent(C)).join("/"),f=new URLSearchParams({"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":p,"X-Amz-Date":g,"X-Amz-Expires":s.toString(),"X-Amz-SignedHeaders":"host"}),m=["GET",this.objectPath(e,y),f.toString(),`host:${a}
|
|
61
|
-
`,"host","UNSIGNED-PAYLOAD"].join(`
|
|
62
|
-
`),T=["AWS4-HMAC-SHA256",g,u,d.createHash("sha256").update(m).digest("hex")].join(`
|
|
63
|
-
`),P=d.createHmac("sha256",`AWS4${r}`).update(l).digest(),S=d.createHmac("sha256",P).update(this.region).digest(),x=d.createHmac("sha256",S).update("s3").digest(),A=d.createHmac("sha256",x).update("aws4_request").digest(),v=d.createHmac("sha256",A).update(T).digest("hex");return f.append("X-Amz-Signature",v),`${this.endpointProtocol}://${a}${this.objectPath(e,y)}?${f.toString()}`}generatePresignedPutUrl(e,t,s,i=3600){let{accessKeyId:r,secretAccessKey:a}=this.getCredentials(),c=this.s3VirtualHost(e),g=new Date,l=g.toISOString().replace(/[:-]|\.\d{3}/g,""),u=g.toISOString().slice(0,10).replace(/-/g,""),p=`${u}/${this.region}/s3/aws4_request`,y=`${r}/${p}`,f=t.split("/").map((H)=>encodeURIComponent(H)).join("/"),m=new URLSearchParams({"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":y,"X-Amz-Date":l,"X-Amz-Expires":i.toString(),"X-Amz-SignedHeaders":"content-type;host"}),T=["PUT",this.objectPath(e,f),m.toString(),`content-type:${s}
|
|
64
|
-
host:${c}
|
|
65
|
-
`,"content-type;host","UNSIGNED-PAYLOAD"].join(`
|
|
66
|
-
`),P=["AWS4-HMAC-SHA256",l,p,d.createHash("sha256").update(T).digest("hex")].join(`
|
|
67
|
-
`),S=d.createHmac("sha256",`AWS4${a}`).update(u).digest(),x=d.createHmac("sha256",S).update(this.region).digest(),A=d.createHmac("sha256",x).update("s3").digest(),v=d.createHmac("sha256",A).update("aws4_request").digest(),C=d.createHmac("sha256",v).update(P).digest("hex");return m.append("X-Amz-Signature",C),`${this.endpointProtocol}://${c}${this.objectPath(e,f)}?${m.toString()}`}async createMultipartUpload(e,t,s){let i={};if(s?.contentType)i["Content-Type"]=s.contentType;if(s?.metadata)for(let[g,l]of Object.entries(s.metadata))i[`x-amz-meta-${g}`]=l;let r=t.split("/").map((g)=>encodeURIComponent(g)).join("/"),a=await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${r}`,bucket:e,queryParams:{uploads:""},headers:i});return{UploadId:(a?.InitiateMultipartUploadResult??a)?.UploadId}}async uploadPart(e,t,s,i,r){let{accessKeyId:a,secretAccessKey:c,sessionToken:g}=this.getCredentials(),l=this.s3VirtualHost(e),u=t.split("/").map((O)=>encodeURIComponent(O)).join("/"),p=this.objectPath(e,u),y=`${this.objectUrl(e,u)}?partNumber=${i}&uploadId=${encodeURIComponent(s)}`,f=new Date,m=f.toISOString().replace(/[:-]|\.\d{3}/g,""),T=f.toISOString().slice(0,10).replace(/-/g,""),P=d.createHash("sha256").update(r).digest("hex"),S={host:l,"x-amz-date":m,"x-amz-content-sha256":P};if(g)S["x-amz-security-token"]=g;let x=Object.keys(S).sort().map((O)=>`${O.toLowerCase()}:${S[O].trim()}
|
|
68
|
-
`).join(""),A=Object.keys(S).sort().map((O)=>O.toLowerCase()).join(";"),v=["PUT",p,`partNumber=${i}&uploadId=${encodeURIComponent(s)}`,x,A,P].join(`
|
|
69
|
-
`),C="AWS4-HMAC-SHA256",H=`${T}/${this.region}/s3/aws4_request`,R=[C,m,H,d.createHash("sha256").update(v).digest("hex")].join(`
|
|
70
|
-
`),K=d.createHmac("sha256",`AWS4${c}`).update(T).digest(),j=d.createHmac("sha256",K).update(this.region).digest(),q=d.createHmac("sha256",j).update("s3").digest(),E=d.createHmac("sha256",q).update("aws4_request").digest(),k=d.createHmac("sha256",E).update(R).digest("hex"),w=`${C} Credential=${a}/${H}, SignedHeaders=${A}, Signature=${k}`,b=await fetch(y,{method:"PUT",headers:{...S,Authorization:w},body:L(r)});if(!b.ok){let O=await b.text();throw Error(`Upload part failed: ${b.status} ${O}`)}return{ETag:b.headers.get("etag")||""}}async completeMultipartUpload(e,t,s,i){let r=t.split("/").map((g)=>encodeURIComponent(g)).join("/"),c=`<?xml version="1.0" encoding="UTF-8"?>
|
|
71
|
-
<CompleteMultipartUpload>${i.sort((g,l)=>g.PartNumber-l.PartNumber).map((g)=>`<Part><PartNumber>${g.PartNumber}</PartNumber><ETag>${g.ETag}</ETag></Part>`).join("")}</CompleteMultipartUpload>`;await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${r}`,bucket:e,queryParams:{uploadId:s},headers:{"Content-Type":"application/xml"},body:c})}async abortMultipartUpload(e,t,s){let i=t.split("/").map((r)=>encodeURIComponent(r)).join("/");await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${i}`,bucket:e,queryParams:{uploadId:s}})}async listMultipartUploads(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:"/",bucket:e,queryParams:{uploads:""}}),s=(t?.ListMultipartUploadsResult??t)?.Upload;if(!s)return[];return(Array.isArray(s)?s:[s]).map((r)=>({Key:r.Key,UploadId:r.UploadId,Initiated:r.Initiated}))}async restoreObject(e,t,s,i="Standard"){let r=`<?xml version="1.0" encoding="UTF-8"?>
|
|
72
|
-
<RestoreRequest>
|
|
73
|
-
<Days>${s}</Days>
|
|
74
|
-
<GlacierJobParameters>
|
|
75
|
-
<Tier>${i}</Tier>
|
|
76
|
-
</GlacierJobParameters>
|
|
77
|
-
</RestoreRequest>`;await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${e}/${t}`,queryParams:{restore:""},headers:{"Content-Type":"application/xml"},body:r})}async selectObjectContent(e,t,s,i,r="JSON"){let a="";if(i==="CSV")a="<CSV><FileHeaderInfo>USE</FileHeaderInfo></CSV>";else if(i==="JSON")a="<JSON><Type>DOCUMENT</Type></JSON>";else a="<Parquet/>";let c="";if(r==="CSV")c="<CSV/>";else c="<JSON/>";let g=`<?xml version="1.0" encoding="UTF-8"?>
|
|
78
|
-
<SelectObjectContentRequest>
|
|
79
|
-
<Expression>${s}</Expression>
|
|
80
|
-
<ExpressionType>SQL</ExpressionType>
|
|
81
|
-
<InputSerialization>${a}</InputSerialization>
|
|
82
|
-
<OutputSerialization>${c}</OutputSerialization>
|
|
83
|
-
</SelectObjectContentRequest>`;return await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${e}/${t}`,queryParams:{select:"","select-type":"2"},headers:{"Content-Type":"application/xml"},body:g,rawResponse:!0})}async getSignedUrl(e){let{bucket:t,key:s,expiresIn:i=3600,operation:r="getObject"}=e,{accessKeyId:a,secretAccessKey:c,sessionToken:g}=this.getCredentials(),l=new Date,u=l.toISOString().replace(/[:-]|\.\d{3}/g,""),p=l.toISOString().slice(0,10).replace(/-/g,""),y=this.s3VirtualHost(t),f=r==="putObject"?"PUT":"GET",m="AWS4-HMAC-SHA256",T=`${p}/${this.region}/s3/aws4_request`,S={"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":`${a}/${T}`,"X-Amz-Date":u,"X-Amz-Expires":i.toString(),"X-Amz-SignedHeaders":"host"};if(g)S["X-Amz-Security-Token"]=g;let A=Object.keys(S).sort().map((D)=>`${encodeURIComponent(D)}=${encodeURIComponent(S[D])}`).join("&"),v=s.split("/").map((D)=>encodeURIComponent(D)).join("/"),C=this.objectPath(t,v),H=`host:${y}
|
|
84
|
-
`,j=[f,C,A,H,"host","UNSIGNED-PAYLOAD"].join(`
|
|
85
|
-
`),q=["AWS4-HMAC-SHA256",u,T,d.createHash("sha256").update(j).digest("hex")].join(`
|
|
86
|
-
`),E=d.createHmac("sha256",`AWS4${c}`).update(p).digest(),k=d.createHmac("sha256",E).update(this.region).digest(),w=d.createHmac("sha256",k).update("s3").digest(),b=d.createHmac("sha256",w).update("aws4_request").digest(),O=d.createHmac("sha256",b).update(q).digest("hex");return`${this.endpointProtocol}://${y}${C}?${A}&X-Amz-Signature=${O}`}async listObjects(e){let{bucket:t,prefix:s,maxKeys:i=1000,continuationToken:r}=e,a={"list-type":"2","max-keys":i.toString()};if(s)a.prefix=s;if(r)a["continuation-token"]=r;let c=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${t}`,queryParams:a}),g=[],l=c?.ListBucketResult??c;if(l?.Contents){let u=Array.isArray(l.Contents)?l.Contents:[l.Contents];for(let p of u)g.push({Key:p.Key||"",LastModified:p.LastModified||"",Size:Number.parseInt(p.Size||"0"),ETag:p.ETag})}return{objects:g,nextContinuationToken:l?.NextContinuationToken}}async emptyBucket(e){let t=0,s=await this.listAllObjects({bucket:e});if(s.length>0)for(let i=0;i<s.length;i+=1000){let a=s.slice(i,i+1000).map((c)=>c.Key);await this.deleteObjects(e,a),t+=a.length}try{let i,r;do{let a=await this.listObjectVersions({bucket:e,keyMarker:i,versionIdMarker:r,maxKeys:1000}),c=[];if(a.versions)for(let g of a.versions)c.push({Key:g.Key,VersionId:g.VersionId});if(a.deleteMarkers)for(let g of a.deleteMarkers)c.push({Key:g.Key,VersionId:g.VersionId});if(c.length>0)await this.deleteObjectVersions(e,c),t+=c.length;i=a.nextKeyMarker,r=a.nextVersionIdMarker}while(i)}catch{}return{deletedCount:t}}async listObjectVersions(e){let{bucket:t,prefix:s,keyMarker:i,versionIdMarker:r,maxKeys:a=1000}=e,c={versions:"","max-keys":a.toString()};if(s)c.prefix=s;if(i)c["key-marker"]=i;if(r)c["version-id-marker"]=r;let g=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${t}`,queryParams:c}),l=[],u=[];if(g.Version){let p=Array.isArray(g.Version)?g.Version:[g.Version];for(let y of p)l.push({Key:y.Key,VersionId:y.VersionId,IsLatest:y.IsLatest==="true"})}if(g.DeleteMarker){let p=Array.isArray(g.DeleteMarker)?g.DeleteMarker:[g.DeleteMarker];for(let y of p)u.push({Key:y.Key,VersionId:y.VersionId,IsLatest:y.IsLatest==="true"})}return{versions:l,deleteMarkers:u,nextKeyMarker:g.NextKeyMarker,nextVersionIdMarker:g.NextVersionIdMarker}}async deleteObjectVersions(e,t){let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
87
|
-
<Delete>
|
|
88
|
-
<Quiet>true</Quiet>
|
|
89
|
-
${t.map((r)=>`<Object><Key>${r.Key}</Key>${r.VersionId?`<VersionId>${r.VersionId}</VersionId>`:""}</Object>`).join(`
|
|
90
|
-
`)}
|
|
91
|
-
</Delete>`,i=d.createHash("md5").update(s).digest("base64");await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${e}`,queryParams:{delete:""},body:s,headers:{"Content-Type":"application/xml","Content-MD5":i}})}}function h(e,t){return(e?.[`${t}Response`]??e)?.[`${t}Result`]}function _(e){if(e===void 0||e===null||e==="")return[];return Array.isArray(e)?e:[e]}function kc(e){return e===!0||e==="true"}
|
|
92
|
-
export{wr,o,h,_,kc};
|