@stacksjs/ts-cloud 0.12.15 → 0.13.0

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.
Files changed (178) hide show
  1. package/dist/aws/index.js +1 -1
  2. package/dist/bin/{chunk-9e22a51n.js → chunk-22c3pk8s.js} +78 -78
  3. package/dist/bin/chunk-2synp9gh.js +1 -0
  4. package/dist/bin/{chunk-ejqhbj1h.js → chunk-2v0qm547.js} +1 -1
  5. package/dist/bin/chunk-4qzpqmhe.js +1 -0
  6. package/dist/bin/chunk-5n3ejway.js +1 -0
  7. package/dist/bin/{chunk-ynr22ma8.js → chunk-7jwxgxxf.js} +1 -1
  8. package/dist/bin/{chunk-gd4w6bht.js → chunk-8bbw6qc2.js} +1 -1
  9. package/dist/bin/{chunk-7a7n6p2m.js → chunk-9jmnmhpy.js} +1 -1
  10. package/dist/bin/{chunk-pt2bz3kr.js → chunk-9qndhwbe.js} +1 -1
  11. package/dist/bin/chunk-9yra64dd.js +1 -0
  12. package/dist/bin/{chunk-ng0949x3.js → chunk-b48j6k55.js} +1 -1
  13. package/dist/bin/{chunk-r1w08y38.js → chunk-bdgkeqv6.js} +1 -1
  14. package/dist/bin/chunk-c82rh7qe.js +1 -0
  15. package/dist/bin/{chunk-zzsdhhmb.js → chunk-d4bb9qg9.js} +1 -1
  16. package/dist/bin/{chunk-pcyywgx7.js → chunk-d6kqbp8q.js} +1 -1
  17. package/dist/bin/{chunk-swete552.js → chunk-dk38j1qr.js} +9 -9
  18. package/dist/bin/{chunk-x42gb7pq.js → chunk-e1cxh9rj.js} +2 -2
  19. package/dist/bin/{chunk-9k60q9qz.js → chunk-edaq5jef.js} +3 -3
  20. package/dist/bin/chunk-fbe5kk6w.js +1 -0
  21. package/dist/bin/{chunk-n7eq4t9a.js → chunk-fbycbnvj.js} +4 -4
  22. package/dist/bin/chunk-fj89173b.js +1 -0
  23. package/dist/bin/{chunk-8tbj9h2a.js → chunk-gxwsq3k0.js} +40 -40
  24. package/dist/bin/{chunk-kc2e193t.js → chunk-hwp5xp1c.js} +63 -63
  25. package/dist/bin/chunk-j3w462ep.js +1 -0
  26. package/dist/bin/chunk-k2zzny51.js +1 -0
  27. package/dist/bin/{chunk-80zkjpfz.js → chunk-k3er0h4j.js} +1 -1
  28. package/dist/bin/chunk-kjatss6s.js +1 -0
  29. package/dist/bin/{chunk-w5hzt11d.js → chunk-kxa4t4wh.js} +2 -2
  30. package/dist/bin/{chunk-raj6j2j5.js → chunk-m5sjzxm3.js} +1 -1
  31. package/dist/bin/{chunk-dhxwmkhz.js → chunk-mcqkjhgp.js} +1 -1
  32. package/dist/bin/{chunk-77qpn2m8.js → chunk-n56c0j1e.js} +4 -4
  33. package/dist/bin/chunk-ntahmgqg.js +1 -0
  34. package/dist/bin/{chunk-57w9nsjk.js → chunk-p197a99s.js} +1 -1
  35. package/dist/bin/{chunk-vymg9ywg.js → chunk-pd8v6bpd.js} +1 -1
  36. package/dist/bin/{chunk-yhxpmk29.js → chunk-pthfzst7.js} +1 -1
  37. package/dist/bin/{chunk-5tsxt28g.js → chunk-ptt8me4h.js} +2 -2
  38. package/dist/bin/{chunk-7xvm2ygt.js → chunk-qmqmnxmm.js} +3 -3
  39. package/dist/bin/{chunk-r1vtnn8w.js → chunk-rzt92fwv.js} +3 -3
  40. package/dist/bin/chunk-t1eft7s7.js +1 -0
  41. package/dist/bin/{chunk-49sthm4q.js → chunk-t7seq21w.js} +1 -1
  42. package/dist/bin/chunk-t8n2961n.js +1 -0
  43. package/dist/bin/{chunk-vesvsvdy.js → chunk-vwzgtsn9.js} +1 -1
  44. package/dist/bin/{chunk-s1j941z1.js → chunk-w0g72e50.js} +1 -1
  45. package/dist/bin/chunk-wb8y7zey.js +1 -0
  46. package/dist/bin/{chunk-n8cwx54p.js → chunk-x4gsw45d.js} +5 -5
  47. package/dist/bin/{chunk-yx1qgp1q.js → chunk-xs62dg7t.js} +2 -2
  48. package/dist/bin/chunk-xtp2zf3j.js +1 -0
  49. package/dist/bin/chunk-xvn07b0e.js +1 -0
  50. package/dist/bin/{chunk-sdwr2tnp.js → chunk-xw9vcdwt.js} +1 -1
  51. package/dist/bin/{chunk-4zbnwt9b.js → chunk-y1r1evt0.js} +1 -1
  52. package/dist/bin/{chunk-c51xp8f7.js → chunk-zs8bfer0.js} +1 -1
  53. package/dist/bin/cli.js +98 -98
  54. package/dist/bin/dashboard-server.js +1 -1
  55. package/dist/chunk-05qawkra.js +1 -0
  56. package/dist/{chunk-jb8em9ba.js → chunk-0g2jkhy5.js} +1 -1
  57. package/dist/chunk-1jx53q5e.js +1 -0
  58. package/dist/{chunk-30h9rgfn.js → chunk-2s65yj3g.js} +4 -4
  59. package/dist/{chunk-x07tpsv0.js → chunk-3k60wm30.js} +5 -5
  60. package/dist/chunk-3qtce4mm.js +1 -0
  61. package/dist/chunk-3tt5em2c.js +1 -0
  62. package/dist/{chunk-hw3p6pth.js → chunk-42kv07cs.js} +1 -1
  63. package/dist/{chunk-wjgnfg6q.js → chunk-65ajja2a.js} +1 -1
  64. package/dist/{chunk-yq3pdbz7.js → chunk-6gtqjsg9.js} +3 -3
  65. package/dist/{chunk-6g81m01r.js → chunk-8s9m8pyb.js} +1 -1
  66. package/dist/{chunk-gd9g0v9w.js → chunk-asmv4fw1.js} +19 -19
  67. package/dist/{chunk-83p688yv.js → chunk-ds92qg3g.js} +4 -4
  68. package/dist/{chunk-6nvn041c.js → chunk-dzqz1sm0.js} +3 -3
  69. package/dist/{chunk-88nxsyry.js → chunk-hyj2ymp1.js} +6 -6
  70. package/dist/chunk-j4ed179k.js +2 -0
  71. package/dist/{chunk-g9mnmddy.js → chunk-m5r0dt28.js} +2 -2
  72. package/dist/{chunk-zftpjxkr.js → chunk-mcfdtg5w.js} +1 -1
  73. package/dist/{chunk-cy6qh4ea.js → chunk-ngdhqwf3.js} +3 -3
  74. package/dist/{chunk-6znnde1s.js → chunk-nhtz2k8d.js} +5 -5
  75. package/dist/{chunk-rbem58rx.js → chunk-nw0tvrrr.js} +1 -1
  76. package/dist/{chunk-hnkw6pde.js → chunk-p9fqsz06.js} +2 -2
  77. package/dist/{chunk-qzwack6w.js → chunk-r4dpn715.js} +7 -7
  78. package/dist/{chunk-678rwkz8.js → chunk-vk513ge7.js} +89 -89
  79. package/dist/{chunk-w495x89g.js → chunk-w5fmaaxa.js} +4 -4
  80. package/dist/chunk-wr7tn9j5.js +1 -0
  81. package/dist/{chunk-a6k322xc.js → chunk-xqx5szta.js} +30 -30
  82. package/dist/{chunk-jvqcw0b4.js → chunk-y13zcbnp.js} +101 -101
  83. package/dist/{chunk-2knc1zyy.js → chunk-ycs26jsj.js} +124 -124
  84. package/dist/{chunk-r5emv4x8.js → chunk-z7v4evbh.js} +2 -2
  85. package/dist/deploy/index.js +1 -1
  86. package/dist/dns/delegate-from-config.d.ts +50 -0
  87. package/dist/dns/delegate-from-config.test.d.ts +1 -0
  88. package/dist/dns/delegation.d.ts +110 -0
  89. package/dist/dns/delegation.test.d.ts +1 -0
  90. package/dist/dns/index.d.ts +4 -0
  91. package/dist/dns/index.js +1 -1
  92. package/dist/drivers/index.js +1 -1
  93. package/dist/drivers/shared/rpx-gateway.d.ts +17 -0
  94. package/dist/index.d.ts +1 -1
  95. package/dist/index.js +49 -49
  96. package/dist/operations/index.js +1 -1
  97. package/dist/protection/index.js +1 -1
  98. package/dist/spend/index.js +1 -1
  99. package/dist/ui/404.html +1 -1
  100. package/dist/ui/accept-invitation.html +1 -1
  101. package/dist/ui/access-denied.html +1 -1
  102. package/dist/ui/account/automation.html +5 -5
  103. package/dist/ui/account/security.html +2 -2
  104. package/dist/ui/applications/compose.html +5 -5
  105. package/dist/ui/applications/new.html +2 -2
  106. package/dist/ui/data/backups.html +6 -6
  107. package/dist/ui/data/services.html +6 -6
  108. package/dist/ui/data/volumes.html +6 -6
  109. package/dist/ui/index.html +5 -5
  110. package/dist/ui/infrastructure/topology.html +6 -6
  111. package/dist/ui/integrations.html +1 -1
  112. package/dist/ui/operations/alerts.html +5 -5
  113. package/dist/ui/operations/configuration.html +6 -6
  114. package/dist/ui/operations/jobs.html +6 -6
  115. package/dist/ui/operations/maintenance.html +5 -5
  116. package/dist/ui/operations/observability.html +6 -6
  117. package/dist/ui/operations/previews.html +6 -6
  118. package/dist/ui/operations/queue.html +6 -6
  119. package/dist/ui/operations/regions.html +5 -5
  120. package/dist/ui/operations/releases.html +6 -6
  121. package/dist/ui/operations/spend.html +6 -6
  122. package/dist/ui/operations/workloads.html +6 -6
  123. package/dist/ui/security.html +2 -2
  124. package/dist/ui/server/actions.html +5 -5
  125. package/dist/ui/server/activity.html +1 -1
  126. package/dist/ui/server/capacity.html +6 -6
  127. package/dist/ui/server/database.html +5 -5
  128. package/dist/ui/server/deployments.html +5 -5
  129. package/dist/ui/server/diagnostics.html +2 -2
  130. package/dist/ui/server/firewall.html +6 -6
  131. package/dist/ui/server/fleet.html +6 -6
  132. package/dist/ui/server/logs.html +6 -6
  133. package/dist/ui/server/metrics.html +5 -5
  134. package/dist/ui/server/security.html +2 -2
  135. package/dist/ui/server/services.html +2 -2
  136. package/dist/ui/server/sites.html +6 -6
  137. package/dist/ui/server/ssh-keys.html +6 -6
  138. package/dist/ui/server/team.html +6 -6
  139. package/dist/ui/server/terminal.html +2 -2
  140. package/dist/ui/serverless/alarms.html +6 -6
  141. package/dist/ui/serverless/assets.html +2 -2
  142. package/dist/ui/serverless/cost.html +2 -2
  143. package/dist/ui/serverless/data.html +6 -6
  144. package/dist/ui/serverless/deployments.html +2 -2
  145. package/dist/ui/serverless/firewall.html +2 -2
  146. package/dist/ui/serverless/functions.html +6 -6
  147. package/dist/ui/serverless/logs.html +6 -6
  148. package/dist/ui/serverless/metrics.html +2 -2
  149. package/dist/ui/serverless/queues.html +5 -5
  150. package/dist/ui/serverless/secrets.html +6 -6
  151. package/dist/ui/serverless/traces.html +6 -6
  152. package/dist/ui/serverless.html +6 -6
  153. package/dist/ui-src/src/charts.ts +1 -1
  154. package/dist/ui-src/src/topology.ts +1 -1
  155. package/package.json +3 -3
  156. package/dist/bin/chunk-1s4dny8d.js +0 -1
  157. package/dist/bin/chunk-4w80w3sm.js +0 -1
  158. package/dist/bin/chunk-4yntpqbe.js +0 -1
  159. package/dist/bin/chunk-7x0hrna6.js +0 -1
  160. package/dist/bin/chunk-971tfc6m.js +0 -1
  161. package/dist/bin/chunk-dpw8x3sr.js +0 -1
  162. package/dist/bin/chunk-h785hw6a.js +0 -1
  163. package/dist/bin/chunk-jyggrdh2.js +0 -1
  164. package/dist/bin/chunk-q524s7cx.js +0 -1
  165. package/dist/bin/chunk-q9gpw6wv.js +0 -1
  166. package/dist/bin/chunk-r6cvc2pr.js +0 -1
  167. package/dist/bin/chunk-rh2sqtew.js +0 -1
  168. package/dist/bin/chunk-tkzpbb7n.js +0 -1
  169. package/dist/bin/chunk-v78r5tx0.js +0 -1
  170. package/dist/bin/chunk-v7f4c62s.js +0 -1
  171. package/dist/bin/chunk-vx649y7t.js +0 -1
  172. package/dist/chunk-6t9tjvpy.js +0 -2
  173. package/dist/chunk-9w32efae.js +0 -1
  174. package/dist/chunk-atny1wp9.js +0 -1
  175. package/dist/chunk-fdexq9e1.js +0 -1
  176. package/dist/chunk-hn2v0b0d.js +0 -1
  177. package/dist/chunk-v46b25w9.js +0 -1
  178. /package/dist/bin/{chunk-bckm6fre.js → chunk-pdw0qjq1.js} +0 -0
@@ -0,0 +1 @@
1
+ import{Xo,Iu,Ru,Qo}from"./chunk-e1cxh9rj.js";import"./chunk-x4gsw45d.js";import"./chunk-gxwsq3k0.js";export{Iu as getComputeDeployHistory,Qo as restoreDatabaseBackup,Xo as rollbackComputeSite,Ru as runComputeRecipe};
@@ -1 +1 @@
1
- import{Wa,oe,Ga,Yl,Mu,ui,Uu,Bu,ks,Fu,ju,Vu,zu,qu,Hu,Wu,Ka,Ja,Ds,xs,ho,Je,A,_s,Xa,V,wr,C,Zl,pi,$s,Os,U,yo,Gu,Ku,Ju,Xu,l,s,Qu,Yu,E,Ls,Ms,Us,Zu,ep,Pe,Bs,So,ed,tp,rp,Le,vt,Xe,Se,B,S,_,Qe,k,td,Tt,pe,Mt,np,rd,be,bo,Me,Ut,mi,ve,vo,Ne,nd,gi,Te,Ee,ee,fi,G,Bt,Et,we,t,To,ip,Qa,Fs,op,sp,ap,cp,js,lp,dp,up,pp,mp,gp,fp,hp,yp,Sp,bp,vp,id,od,sd,ad,cd,ld,dd,Ft,Ya,Za,Cr,hi,Tp,ec,Ep,wp,rn,Cp,Ap,Ip,Rp,Pp,Np,ud,pd,md,gd,fd,Eo,kp,Vs,hd,yd,Sd,tc,Ce,Dp,bd,wt,wo,Ar,vd,rc,Td,Ed,wd,nc,ke,xp,_p,$p,Op,Cd,Lp,Ae,Mp,Up,Bp,ic,oc,Fp,sc,ac,jp,Vp,zp,qp,Hp,Ad,zs,Wp,Gp,Kp,Jp,Xp,Id,Rd,Qp,Yp,Zp,em,tm,rm,nm,im,om,cc,qs,sm,am,cm,lm,lc,dc,uc,dm,pc,um,pm,mm,gm,mc,fm,hm,ym,Sm,bm,vm,Tm,Em,Pd,Nd,kd,Dd,gc,wm,Cm,Am,Im,Rm,Pm,Nm,km,Dm,xd,_d,$d,Od,xm,_m,fc,$m,hc,yc,Sc,bc,Om,Lm,Mm,Um,Ye,yi,Bm,Fm,jm,Vm,zm,qm,Hm,Wm,Ld,Gm,Km,vc,Tc,Jm,Xm,Md,Qm,Ym,Zm,eg,tg,rg,ng,ig,og,sg,ag,cg,lg,dg,ug,pg,mg,gg,fg,hg,yg,Ec,Sg,wc,bg,Cc,vg,Ac,Tg,Ic,Eg,nn,wg,Rc,Cg,Co,Ag,Pc,Ig,Nc,Rg,kc,Pg,Dc,Ng,xc,kg,on,Dg,_c,xg,$c,_g,Oc,$g,Lc,Og,Mc,Lg,Uc,Mg,Bc,Ug,Fc,Bg,jc,Fg,Vc,jg,zc,Vg,qc,zg,Hc,qg,Wc,Hg,Gc,Wg,Kc,Gg,Jc,Kg,Xc,Jg,Qc,Xg,Yc,Qg,Zc,Yg,el,Zg,tl,ef,rl,tf,nl,rf,Ud,Bd,Fd,jd,il,nf,ol,of,sl,sf,al,af,Si,Vd,zd,Ao,Hs,sn,qd,Io,jt,Ws,Gs,Hd,Wd,cl,Gd,Ks,ll,cf,lf,Js,Xs,Qs,dl,Ro,ul,pl,Ys,ml,gl,fl,Kd,Jd,Xd,df,Qd,Yd,uf,Zd,hl,eu,tu,ru,pf,nu,bi,Zs,iu,mf,ou,Po,No,ea,yl,gf,Sl,ff,bl,hf,vl,yf,Tl,Sf}from"./chunk-8tbj9h2a.js";export{Pc as ABTestManager,Me as AI,Td as AWSAPIError,Cc as AWSConfigManager,ip as AWS_PSEUDO_PARAMETERS,Ye as AWS_REGIONS,vo as ApiGateway,To as Arn,ee as AssetHasher,Te as Auth,Ec as BackupManager,sl as BatchProcessingManager,Rc as BlueGreenManager,el as BounceComplaintHandler,Vc as BuildOptimizationManager,Xe as CDN,Xs as CHAIN_HEADER,Ym as COMMON_CROSS_ACCOUNT_ROLES,mi as Cache,Co as CanaryManager,Bc as CertificateManager,wt as CloudError,Qa as CloudFormationBuilder,Sd as CloudFormationClient,bd as CloudFrontClient,Ac as CloudTrailManager,Od as CommandHistory,we as Communication,S as Compute,wo as ConfigurationError,zc as ContainerRegistryManager,Ar as CredentialError,hc as CrossRegionReferenceManager,od as DASHBOARD_ENTRY,sd as DASHBOARD_PORT_BASE,ad as DASHBOARD_PORT_SPAN,id as DASHBOARD_STATE_DIR,Ro as DEFAULT_RECURSION_LIMITS,Ae as DEFAULT_SERVICE_LIMITS,Ka as DEFAULT_STATE_DIR,Js as DEPTH_HEADER,ol as DLQMonitoringManager,Se as DNS,Yc as DNSSECManager,Ut as Database,Lc as DatabaseUserManager,ke as DebugLogger,ed as DependencyGraph,Ee as Deployment,vd as DeploymentError,wc as DisasterRecoveryManager,k as Email,Ud as EmailAdvanced,tl as EmailAnalyticsManager,Bd as EmailHandlers,nl as EmailTemplateManager,Ed as ErrorCodes,il as FIFOQueueManager,ic as FileCache,Qe as FileSystem,t as Fn,yc as GlobalResourceManager,Ic as GuardDutyManager,Ad as HashCache,bl as HealthCheckManager,jc as ImageScanningManager,Mt as JobLoader,iu as LARAVEL_SERVERLESS_BUILD_STEPS,Gc as LambdaConcurrencyManager,Xc as LambdaDLQManager,Kc as LambdaDestinationsManager,Hc as LambdaLayersManager,Jc as LambdaVPCManager,Wc as LambdaVersionsManager,xc as LogsManager,qd as MANAGED_NODE_VERSIONS,Ya as MANAGEMENT_DASHBOARD_SITE_PREFIX,Ne as Messaging,Dc as MetricsManager,_c as MigrationManager,lc as MockCloudFormation,uc as MockDynamoDB,dc as MockS3,gi as Monitoring,vc as MultiAccountManager,fc as MultiRegionManager,Nd as MultiStepProgress,_ as Network,vl as NetworkSecurityManager,Tc as OrganizationManager,ou as PHP_DEFAULT_EXCLUDES,Hd as PHP_LAYER_EXTENSIONS,G as ParameterStore,Oc as PerformanceManager,ve as Permissions,Tt as Phone,Fd as PhoneAdvanced,td as PhoneHandlers,pc as PreviewEnvironmentManager,mc as PreviewNotificationService,Pd as ProgressBar,Nc as ProgressiveDeploymentManager,Xu as Pseudo,pe as Queue,al as QueueManagementManager,Hu as QueuePresets,Md as RECOMMENDED_ACCOUNT_STRUCTURES,Qm as RECOMMENDED_SCPS,xd as REPL,$d as REPLCommandBuilder,_d as REPLContext,Id as RateLimiter,Wu as RealtimePresets,Ys as RecursionGuard,Et as Redirects,Sc as RegionPairManager,vt as Registry,$c as ReplicaManager,Tl as ResourceManagementManager,Zc as Route53ResolverManager,Qc as Route53RoutingManager,tc as S3Client,Ce as S3Error,be as SMS,Ja as STATE_DIR_ENV_VAR,Bt as Search,fi as Secrets,Uc as SecretsManager,Mc as SecretsRotationManager,B as Security,nn as SecurityHubManager,Fc as SecurityScanningManager,rl as SenderReputationManager,qc as ServiceMeshManager,bo as Sftp,jd as SmsAdvanced,rd as SmsHandlers,kd as Spinner,bc as StackDependencyManager,np as StacksIntegration,yl as StaticSiteManager,Le as Storage,Sl as StorageAdvancedManager,on as SyntheticsManager,Qs as TRACE_HEADER,Dd as TaskList,yo as TemplateBuilder,oc as TemplateCache,rc as ValidationError,nd as Workflow,kc as XRayManager,Ig as abTestManager,tp as analyzeStackDiff,Hs as artifactKey,Rm as autocomplete,vg as awsConfigManager,Sg as backupManager,Wp as batch,sf as batchProcessingManager,Cg as blueGreenManager,Zg as bounceComplaintHandler,lf as buildBunRuntimeLayerZip,Fs as buildCloudFormationTemplate,Os as buildMailEnv,cf as buildNodeRuntimeLayerZip,jg as buildOptimizationManager,mf as buildPhpRuntimeLayerZip,Ag as canaryManager,tm as categorizeChanges,Ug as certificateManager,Op as checkIAMPermissions,Qd as checkInvocation,Mp as checkServiceQuotas,Rd as chunk,ju as clearSigningKeyCache,im as cloudConfigSchema,Tg as cloudTrailManager,No as collectPhpAppEntries,Ep as composePresets,Gs as composeServerlessAppTemplate,Vg as containerRegistryManager,dp as createApiBackendPreset,ru as createCliHandler,kp as createCredentialProvider,vp as createDashboardSite,fp as createDataPipelinePreset,nc as createError,js as createExistingStaticFullStackPreset,lp as createFullStackAppPreset,pf as createHandlers,eu as createHttpHandler,pp as createJamstackPreset,Sp as createLaravelPreset,hp as createMLApiPreset,mp as createMicroservicesPreset,dm as createMockAWS,sp as createNodeJsServerPreset,ap as createNodeJsServerlessPreset,wp as createPreset,Yl as createPresignedUrl,Mu as createPresignedUrlAsync,tu as createQueueHandler,gp as createRealtimeAppPreset,Dp as createS3Client,bp as createServerlessLaravelPreset,cp as createServerlessNodePreset,op as createStaticSitePreset,yp as createTraditionalWebAppPreset,up as createWordPressPreset,Si as createZip,Om as crossRegionReferenceManager,Og as databaseUserManager,cc as defaultLocalConfig,wr as deploymentCoexistenceError,cd as deriveManagementDashboardPort,Xa as detectDeploymentTargets,_p as detectMisconfigurations,Wa as detectServiceRegion,Yp as diffTemplates,of as dlqMonitoringManager,Qg as dnssecManager,bg as drManager,ef as emailAnalyticsManager,rf as emailTemplateManager,Zd as eventToRequest,ec as extendPreset,nf as fifoQueueManager,Hp as findChangedFiles,rg as formatAccountStructure,bm as formatBytes,rp as formatDiff,vm as formatDuration,Nm as formatFlagSuggestions,xm as formatHistory,_m as formatHistoryStats,Em as formatKeyValue,Tm as formatList,Sm as formatProgressBar,Ld as formatRegion,Gm as formatRegionList,wm as formatSuggestion,hm as formatTable,ym as formatTree,md as fromEC2Metadata,gd as fromECSMetadata,ud as fromEnvironment,pd as fromSharedCredentials,fd as fromWebIdentity,dl as functionFingerprint,Ks as generateAppImageDockerfile,hg as generateApprovalConfig,Vd as generateBootstrap,mm as generateCleanupWorkflow,gm as generateCostReportWorkflow,eg as generateCrossAccountRoleCF,mg as generateDeploymentConfig,cg as generateDeploymentPipeline,ng as generateDeploymentWorkflow,s as generateLogicalId,pg as generateManualPipeline,ag as generateMatrixWorkflow,gg as generateMultiEnvConfig,lg as generateMultiEnvPipeline,ig as generateMultiEnvWorkflow,og as generatePRPreviewWorkflow,yg as generateParallelConfig,nu as generatePhpFpmConfig,Gd as generatePhpLayerDockerfile,dg as generatePreviewPipeline,pm as generatePreviewWorkflow,l as generateResourceName,fg as generateScheduledConfig,ug as generateScheduledPipeline,sg as generateScheduledWorkflow,yd as getAccountId,Bm as getAllRegions,qm as getClosestRegion,km as getCommandUsage,Am as getContextualHelp,Eo as getCredentials,rm as getDeploymentStrategy,nm as getDiffStats,Zp as getDiffSummary,wd as getErrorDetails,qs as getLocalConfig,cm as getLocalCredentials,am as getLocalEndpoint,lm as getLocalEnvVars,Up as getQuotaUsageSummary,Zm as getRecommendedStructure,yi as getRegion,Km as getRegionStats,jm as getRegionsByCompliance,Fm as getRegionsByLocation,Vm as getRegionsByPricingTier,Cd as getRequiredPermissions,Vu as getSigningKeyCacheSize,Qu as getTimestamp,Lm as globalResourceManager,Eg as guardDutyManager,Ft as hasManagementDashboardSite,jp as hashBuffer,Vp as hashDirectory,sc as hashFile,zp as hashManifest,ac as hashString,hf as healthCheckManager,Fg as imageScanningManager,pl as inspectInvocation,Jd as installRecursionFetch,fl as invocationContext,Cm as isLikelyTypo,sm as isLocalDevelopment,Cr as isManagementDashboardSiteName,zu as isNodeCryptoAvailable,xs as isStateDirConfigured,_s as isStatePath,zm as isValidRegion,qu as isWebCryptoAvailable,Wg as lambdaConcurrencyManager,Jg as lambdaDLQManager,Gg as lambdaDestinationsManager,qg as lambdaLayersManager,Kg as lambdaVPCManager,Hg as lambdaVersionsManager,Zs as laravelServerlessEnvDefaults,kg as logsManager,Zl as mailEnabled,$s as mailFirewallPorts,ui as makeAWSRequest,Bu as makeAWSRequestAsync,Uu as makeAWSRequestOnce,Za as managementDashboardSiteName,rn as mergeInfrastructure,Ng as metricsManager,xg as migrationManager,Jm as multiAccountManager,$m as multiRegionManager,yf as networkSecurityManager,Xm as organizationManager,ea as packagePhpApp,sn as packageServerlessApp,zs as parallel,Gp as parallelMap,Kp as parallelWithRetry,ul as parseChain,Fu as parseJSONResponse,ks as parseXMLResponse,$g as performanceManager,cl as phpLayerBuildStage,Wd as phpLayerPackages,bi as phpRuntimeLayerAssets,um as previewManager,fm as previewNotifications,Qp as processInChunks,Rg as progressiveDeploymentManager,ml as propagationHeaders,af as queueManagementManager,qp as quickHash,gl as recursionBlockedResponse,Mm as regionPairManager,_g as replicaManager,em as requiresReplacement,df as resetRecursionRuntime,uf as resolveApp,C as resolveAppDatabase,U as resolveCloudProvider,Vs as resolveCredentials,ld as resolveDashboardDomain,dd as resolveDashboardDomains,ep as resolveDeployBucketName,V as resolveDeploymentMode,pi as resolveMailService,Tp as resolveManagementDashboardSite,hi as resolveManagementDashboardSites,E as resolveProjectStackName,Ws as resolveQueueNames,jt as resolveQueues,Kd as resolveRecursionConfig,hd as resolveRegion,Pe as resolveServerlessAppStackName,Bs as resolveServerlessArtifactBucketName,So as resolveServerlessAssetBucketName,Io as resolveServerlessRuntime,Us as resolveSiteBucketName,Ms as resolveSiteResourceName,Ls as resolveSiteStackName,A as resolveStatePath,Zu as resolveStorageBucketName,Sf as resourceManagementManager,hl as responseToResult,Yg as route53ResolverManager,Xg as route53RoutingManager,zd as runBuildHooks,Po as runPhpBuildHooks,Yu as sanitizeName,Im as searchCommands,Mg as secretsManager,Lg as secretsRotationManager,wg as securityHubManager,Bg as securityScanningManager,tf as senderReputationManager,Jp as sequence,zg as serviceMeshManager,Ds as setStateDir,Ao as sha256,Xd as sharedRecursionGuard,ll as sharedRuntimeLoop,oe as signRequest,Ga as signRequestAsync,Um as stackDependencyManager,ho as stateDir,Je as statePath,gf as staticSiteManager,ff as storageAdvancedManager,gc as suggestCommand,Pm as suggestFlags,Lp as suggestIAMPolicy,Bp as suggestQuotaIncrease,Wm as suggestRegionPairs,Hm as suggestRegions,Dg as syntheticsManager,Fp as templateCache,tg as validateAccountStructure,om as validateAgainstSchema,Dm as validateCommand,xp as validateConfiguration,$p as validateCredentials,Ju as validateResourceLimits,Gu as validateTemplate,Ku as validateTemplateSize,Pp as withCDN,Rp as withCache,Ip as withDatabase,Yd as withInvocation,Cp as withMonitoring,Np as withQueue,Ap as withSecurity,Xp as withTimeout,Pg as xrayManager};
1
+ import{Wa,oe,Ga,Yl,Mu,ui,Uu,Bu,Ds,Fu,ju,Vu,zu,qu,Hu,Wu,Ka,Ja,ks,xs,ho,Qe,A,_s,Xa,V,wr,C,Zl,pi,$s,Os,U,yo,Gu,Ku,Ju,Xu,l,s,Qu,Yu,E,Ls,Ms,Us,Zu,ep,Pe,Bs,So,ed,tp,rp,Le,vt,Ye,Se,B,S,_,Ze,D,td,Tt,pe,Ut,np,rd,be,bo,Me,Bt,mi,ve,vo,Ne,nd,gi,Te,Ee,ee,fi,G,Ft,Et,we,t,To,ip,Qa,Fs,op,sp,ap,cp,js,lp,dp,up,pp,mp,gp,fp,hp,yp,Sp,bp,vp,id,od,sd,ad,cd,ld,dd,jt,Ya,Za,Cr,hi,Tp,ec,Ep,wp,rn,Cp,Ap,Ip,Rp,Pp,Np,ud,pd,md,gd,fd,Eo,Dp,Vs,hd,yd,Sd,tc,Ce,kp,bd,wt,wo,Ar,vd,rc,Td,Ed,wd,nc,De,xp,_p,$p,Op,Cd,Lp,Ae,Mp,Up,Bp,ic,oc,Fp,sc,ac,jp,Vp,zp,qp,Hp,Ad,zs,Wp,Gp,Kp,Jp,Xp,Id,Rd,Qp,Yp,Zp,em,tm,rm,nm,im,om,cc,qs,sm,am,cm,lm,lc,dc,uc,dm,pc,um,pm,mm,gm,mc,fm,hm,ym,Sm,bm,vm,Tm,Em,Pd,Nd,Dd,kd,gc,wm,Cm,Am,Im,Rm,Pm,Nm,Dm,km,xd,_d,$d,Od,xm,_m,fc,$m,hc,yc,Sc,bc,Om,Lm,Mm,Um,et,yi,Bm,Fm,jm,Vm,zm,qm,Hm,Wm,Ld,Gm,Km,vc,Tc,Jm,Xm,Md,Qm,Ym,Zm,eg,tg,rg,ng,ig,og,sg,ag,cg,lg,dg,ug,pg,mg,gg,fg,hg,yg,Ec,Sg,wc,bg,Cc,vg,Ac,Tg,Ic,Eg,nn,wg,Rc,Cg,Co,Ag,Pc,Ig,Nc,Rg,Dc,Pg,kc,Ng,xc,Dg,on,kg,_c,xg,$c,_g,Oc,$g,Lc,Og,Mc,Lg,Uc,Mg,Bc,Ug,Fc,Bg,jc,Fg,Vc,jg,zc,Vg,qc,zg,Hc,qg,Wc,Hg,Gc,Wg,Kc,Gg,Jc,Kg,Xc,Jg,Qc,Xg,Yc,Qg,Zc,Yg,el,Zg,tl,ef,rl,tf,nl,rf,Ud,Bd,Fd,jd,il,nf,ol,of,sl,sf,al,af,Si,Vd,zd,Ao,Hs,sn,qd,Io,Vt,Ws,Gs,Hd,Wd,cl,Gd,Ks,ll,cf,lf,Js,Xs,Qs,dl,Ro,ul,pl,Ys,ml,gl,fl,Kd,Jd,Xd,df,Qd,Yd,uf,Zd,hl,eu,tu,ru,pf,nu,bi,Zs,iu,mf,ou,Po,No,ea,yl,gf,Sl,ff,bl,hf,vl,yf,Tl,Sf}from"./chunk-gxwsq3k0.js";export{Pc as ABTestManager,Me as AI,Td as AWSAPIError,Cc as AWSConfigManager,ip as AWS_PSEUDO_PARAMETERS,et as AWS_REGIONS,vo as ApiGateway,To as Arn,ee as AssetHasher,Te as Auth,Ec as BackupManager,sl as BatchProcessingManager,Rc as BlueGreenManager,el as BounceComplaintHandler,Vc as BuildOptimizationManager,Ye as CDN,Xs as CHAIN_HEADER,Ym as COMMON_CROSS_ACCOUNT_ROLES,mi as Cache,Co as CanaryManager,Bc as CertificateManager,wt as CloudError,Qa as CloudFormationBuilder,Sd as CloudFormationClient,bd as CloudFrontClient,Ac as CloudTrailManager,Od as CommandHistory,we as Communication,S as Compute,wo as ConfigurationError,zc as ContainerRegistryManager,Ar as CredentialError,hc as CrossRegionReferenceManager,od as DASHBOARD_ENTRY,sd as DASHBOARD_PORT_BASE,ad as DASHBOARD_PORT_SPAN,id as DASHBOARD_STATE_DIR,Ro as DEFAULT_RECURSION_LIMITS,Ae as DEFAULT_SERVICE_LIMITS,Ka as DEFAULT_STATE_DIR,Js as DEPTH_HEADER,ol as DLQMonitoringManager,Se as DNS,Yc as DNSSECManager,Bt as Database,Lc as DatabaseUserManager,De as DebugLogger,ed as DependencyGraph,Ee as Deployment,vd as DeploymentError,wc as DisasterRecoveryManager,D as Email,Ud as EmailAdvanced,tl as EmailAnalyticsManager,Bd as EmailHandlers,nl as EmailTemplateManager,Ed as ErrorCodes,il as FIFOQueueManager,ic as FileCache,Ze as FileSystem,t as Fn,yc as GlobalResourceManager,Ic as GuardDutyManager,Ad as HashCache,bl as HealthCheckManager,jc as ImageScanningManager,Ut as JobLoader,iu as LARAVEL_SERVERLESS_BUILD_STEPS,Gc as LambdaConcurrencyManager,Xc as LambdaDLQManager,Kc as LambdaDestinationsManager,Hc as LambdaLayersManager,Jc as LambdaVPCManager,Wc as LambdaVersionsManager,xc as LogsManager,qd as MANAGED_NODE_VERSIONS,Ya as MANAGEMENT_DASHBOARD_SITE_PREFIX,Ne as Messaging,kc as MetricsManager,_c as MigrationManager,lc as MockCloudFormation,uc as MockDynamoDB,dc as MockS3,gi as Monitoring,vc as MultiAccountManager,fc as MultiRegionManager,Nd as MultiStepProgress,_ as Network,vl as NetworkSecurityManager,Tc as OrganizationManager,ou as PHP_DEFAULT_EXCLUDES,Hd as PHP_LAYER_EXTENSIONS,G as ParameterStore,Oc as PerformanceManager,ve as Permissions,Tt as Phone,Fd as PhoneAdvanced,td as PhoneHandlers,pc as PreviewEnvironmentManager,mc as PreviewNotificationService,Pd as ProgressBar,Nc as ProgressiveDeploymentManager,Xu as Pseudo,pe as Queue,al as QueueManagementManager,Hu as QueuePresets,Md as RECOMMENDED_ACCOUNT_STRUCTURES,Qm as RECOMMENDED_SCPS,xd as REPL,$d as REPLCommandBuilder,_d as REPLContext,Id as RateLimiter,Wu as RealtimePresets,Ys as RecursionGuard,Et as Redirects,Sc as RegionPairManager,vt as Registry,$c as ReplicaManager,Tl as ResourceManagementManager,Zc as Route53ResolverManager,Qc as Route53RoutingManager,tc as S3Client,Ce as S3Error,be as SMS,Ja as STATE_DIR_ENV_VAR,Ft as Search,fi as Secrets,Uc as SecretsManager,Mc as SecretsRotationManager,B as Security,nn as SecurityHubManager,Fc as SecurityScanningManager,rl as SenderReputationManager,qc as ServiceMeshManager,bo as Sftp,jd as SmsAdvanced,rd as SmsHandlers,Dd as Spinner,bc as StackDependencyManager,np as StacksIntegration,yl as StaticSiteManager,Le as Storage,Sl as StorageAdvancedManager,on as SyntheticsManager,Qs as TRACE_HEADER,kd as TaskList,yo as TemplateBuilder,oc as TemplateCache,rc as ValidationError,nd as Workflow,Dc as XRayManager,Ig as abTestManager,tp as analyzeStackDiff,Hs as artifactKey,Rm as autocomplete,vg as awsConfigManager,Sg as backupManager,Wp as batch,sf as batchProcessingManager,Cg as blueGreenManager,Zg as bounceComplaintHandler,lf as buildBunRuntimeLayerZip,Fs as buildCloudFormationTemplate,Os as buildMailEnv,cf as buildNodeRuntimeLayerZip,jg as buildOptimizationManager,mf as buildPhpRuntimeLayerZip,Ag as canaryManager,tm as categorizeChanges,Ug as certificateManager,Op as checkIAMPermissions,Qd as checkInvocation,Mp as checkServiceQuotas,Rd as chunk,ju as clearSigningKeyCache,im as cloudConfigSchema,Tg as cloudTrailManager,No as collectPhpAppEntries,Ep as composePresets,Gs as composeServerlessAppTemplate,Vg as containerRegistryManager,dp as createApiBackendPreset,ru as createCliHandler,Dp as createCredentialProvider,vp as createDashboardSite,fp as createDataPipelinePreset,nc as createError,js as createExistingStaticFullStackPreset,lp as createFullStackAppPreset,pf as createHandlers,eu as createHttpHandler,pp as createJamstackPreset,Sp as createLaravelPreset,hp as createMLApiPreset,mp as createMicroservicesPreset,dm as createMockAWS,sp as createNodeJsServerPreset,ap as createNodeJsServerlessPreset,wp as createPreset,Yl as createPresignedUrl,Mu as createPresignedUrlAsync,tu as createQueueHandler,gp as createRealtimeAppPreset,kp as createS3Client,bp as createServerlessLaravelPreset,cp as createServerlessNodePreset,op as createStaticSitePreset,yp as createTraditionalWebAppPreset,up as createWordPressPreset,Si as createZip,Om as crossRegionReferenceManager,Og as databaseUserManager,cc as defaultLocalConfig,wr as deploymentCoexistenceError,cd as deriveManagementDashboardPort,Xa as detectDeploymentTargets,_p as detectMisconfigurations,Wa as detectServiceRegion,Yp as diffTemplates,of as dlqMonitoringManager,Qg as dnssecManager,bg as drManager,ef as emailAnalyticsManager,rf as emailTemplateManager,Zd as eventToRequest,ec as extendPreset,nf as fifoQueueManager,Hp as findChangedFiles,rg as formatAccountStructure,bm as formatBytes,rp as formatDiff,vm as formatDuration,Nm as formatFlagSuggestions,xm as formatHistory,_m as formatHistoryStats,Em as formatKeyValue,Tm as formatList,Sm as formatProgressBar,Ld as formatRegion,Gm as formatRegionList,wm as formatSuggestion,hm as formatTable,ym as formatTree,md as fromEC2Metadata,gd as fromECSMetadata,ud as fromEnvironment,pd as fromSharedCredentials,fd as fromWebIdentity,dl as functionFingerprint,Ks as generateAppImageDockerfile,hg as generateApprovalConfig,Vd as generateBootstrap,mm as generateCleanupWorkflow,gm as generateCostReportWorkflow,eg as generateCrossAccountRoleCF,mg as generateDeploymentConfig,cg as generateDeploymentPipeline,ng as generateDeploymentWorkflow,s as generateLogicalId,pg as generateManualPipeline,ag as generateMatrixWorkflow,gg as generateMultiEnvConfig,lg as generateMultiEnvPipeline,ig as generateMultiEnvWorkflow,og as generatePRPreviewWorkflow,yg as generateParallelConfig,nu as generatePhpFpmConfig,Gd as generatePhpLayerDockerfile,dg as generatePreviewPipeline,pm as generatePreviewWorkflow,l as generateResourceName,fg as generateScheduledConfig,ug as generateScheduledPipeline,sg as generateScheduledWorkflow,yd as getAccountId,Bm as getAllRegions,qm as getClosestRegion,Dm as getCommandUsage,Am as getContextualHelp,Eo as getCredentials,rm as getDeploymentStrategy,nm as getDiffStats,Zp as getDiffSummary,wd as getErrorDetails,qs as getLocalConfig,cm as getLocalCredentials,am as getLocalEndpoint,lm as getLocalEnvVars,Up as getQuotaUsageSummary,Zm as getRecommendedStructure,yi as getRegion,Km as getRegionStats,jm as getRegionsByCompliance,Fm as getRegionsByLocation,Vm as getRegionsByPricingTier,Cd as getRequiredPermissions,Vu as getSigningKeyCacheSize,Qu as getTimestamp,Lm as globalResourceManager,Eg as guardDutyManager,jt as hasManagementDashboardSite,jp as hashBuffer,Vp as hashDirectory,sc as hashFile,zp as hashManifest,ac as hashString,hf as healthCheckManager,Fg as imageScanningManager,pl as inspectInvocation,Jd as installRecursionFetch,fl as invocationContext,Cm as isLikelyTypo,sm as isLocalDevelopment,Cr as isManagementDashboardSiteName,zu as isNodeCryptoAvailable,xs as isStateDirConfigured,_s as isStatePath,zm as isValidRegion,qu as isWebCryptoAvailable,Wg as lambdaConcurrencyManager,Jg as lambdaDLQManager,Gg as lambdaDestinationsManager,qg as lambdaLayersManager,Kg as lambdaVPCManager,Hg as lambdaVersionsManager,Zs as laravelServerlessEnvDefaults,Dg as logsManager,Zl as mailEnabled,$s as mailFirewallPorts,ui as makeAWSRequest,Bu as makeAWSRequestAsync,Uu as makeAWSRequestOnce,Za as managementDashboardSiteName,rn as mergeInfrastructure,Ng as metricsManager,xg as migrationManager,Jm as multiAccountManager,$m as multiRegionManager,yf as networkSecurityManager,Xm as organizationManager,ea as packagePhpApp,sn as packageServerlessApp,zs as parallel,Gp as parallelMap,Kp as parallelWithRetry,ul as parseChain,Fu as parseJSONResponse,Ds as parseXMLResponse,$g as performanceManager,cl as phpLayerBuildStage,Wd as phpLayerPackages,bi as phpRuntimeLayerAssets,um as previewManager,fm as previewNotifications,Qp as processInChunks,Rg as progressiveDeploymentManager,ml as propagationHeaders,af as queueManagementManager,qp as quickHash,gl as recursionBlockedResponse,Mm as regionPairManager,_g as replicaManager,em as requiresReplacement,df as resetRecursionRuntime,uf as resolveApp,C as resolveAppDatabase,U as resolveCloudProvider,Vs as resolveCredentials,ld as resolveDashboardDomain,dd as resolveDashboardDomains,ep as resolveDeployBucketName,V as resolveDeploymentMode,pi as resolveMailService,Tp as resolveManagementDashboardSite,hi as resolveManagementDashboardSites,E as resolveProjectStackName,Ws as resolveQueueNames,Vt as resolveQueues,Kd as resolveRecursionConfig,hd as resolveRegion,Pe as resolveServerlessAppStackName,Bs as resolveServerlessArtifactBucketName,So as resolveServerlessAssetBucketName,Io as resolveServerlessRuntime,Us as resolveSiteBucketName,Ms as resolveSiteResourceName,Ls as resolveSiteStackName,A as resolveStatePath,Zu as resolveStorageBucketName,Sf as resourceManagementManager,hl as responseToResult,Yg as route53ResolverManager,Xg as route53RoutingManager,zd as runBuildHooks,Po as runPhpBuildHooks,Yu as sanitizeName,Im as searchCommands,Mg as secretsManager,Lg as secretsRotationManager,wg as securityHubManager,Bg as securityScanningManager,tf as senderReputationManager,Jp as sequence,zg as serviceMeshManager,ks as setStateDir,Ao as sha256,Xd as sharedRecursionGuard,ll as sharedRuntimeLoop,oe as signRequest,Ga as signRequestAsync,Um as stackDependencyManager,ho as stateDir,Qe as statePath,gf as staticSiteManager,ff as storageAdvancedManager,gc as suggestCommand,Pm as suggestFlags,Lp as suggestIAMPolicy,Bp as suggestQuotaIncrease,Wm as suggestRegionPairs,Hm as suggestRegions,kg as syntheticsManager,Fp as templateCache,tg as validateAccountStructure,om as validateAgainstSchema,km as validateCommand,xp as validateConfiguration,$p as validateCredentials,Ju as validateResourceLimits,Gu as validateTemplate,Ku as validateTemplateSize,Pp as withCDN,Rp as withCache,Ip as withDatabase,Yd as withInvocation,Cp as withMonitoring,Np as withQueue,Ap as withSecurity,Xp as withTimeout,Pg as xrayManager};
@@ -0,0 +1 @@
1
+ import{v}from"./chunk-pd8v6bpd.js";import"./chunk-pdw0qjq1.js";export{v as CloudFormationClient};
@@ -0,0 +1 @@
1
+ import{Cl,Al,Il,Rl,du,uu}from"./chunk-qmqmnxmm.js";import"./chunk-ptt8me4h.js";import"./chunk-pthfzst7.js";import"./chunk-pd8v6bpd.js";import"./chunk-p197a99s.js";import"./chunk-k3er0h4j.js";import"./chunk-pdw0qjq1.js";export{du as deleteStaticSite,Al as deployStaticSite,uu as deployStaticSiteFull,Cl as generateStaticSiteTemplate,Rl as invalidateCache,Il as uploadStaticFiles};
@@ -1,2 +1,2 @@
1
- import{u}from"./chunk-bckm6fre.js";class bt{client;region;constructor(e="us-east-1",r){this.region=e,this.client=new u(void 0,{profile:r})}async createRepository(e){let r={repositoryName:e.repositoryName};if(e.imageTagMutability)r.imageTagMutability=e.imageTagMutability;if(e.imageScanningConfiguration)r.imageScanningConfiguration=e.imageScanningConfiguration;if(e.encryptionConfiguration)r.encryptionConfiguration=e.encryptionConfiguration;if(e.tags&&e.tags.length>0)r.tags=e.tags;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.CreateRepository","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repository:t.repository?this.parseRepository(t.repository):void 0}}async describeRepositories(e){let r={};if(e?.repositoryNames&&e.repositoryNames.length>0)r.repositoryNames=e.repositoryNames;if(e?.registryId)r.registryId=e.registryId;if(e?.maxResults)r.maxResults=e.maxResults;if(e?.nextToken)r.nextToken=e.nextToken;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DescribeRepositories","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repositories:t.repositories?.map((i)=>this.parseRepository(i)),nextToken:t.nextToken}}async getAuthorizationToken(e){let r={};if(e&&e.length>0)r.registryIds=e;return{authorizationData:(await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})).authorizationData?.map((i)=>({authorizationToken:i.authorizationToken,expiresAt:i.expiresAt,proxyEndpoint:i.proxyEndpoint}))}}async deleteRepository(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;if(e.force!==void 0)r.force=e.force;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DeleteRepository","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repository:t.repository?this.parseRepository(t.repository):void 0}}async describeImages(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;if(e.imageIds&&e.imageIds.length>0)r.imageIds=e.imageIds;if(e.filter)r.filter=e.filter;if(e.maxResults)r.maxResults=e.maxResults;if(e.nextToken)r.nextToken=e.nextToken;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DescribeImages","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{imageDetails:t.imageDetails?.map((i)=>this.parseImageDetail(i)),nextToken:t.nextToken}}async batchDeleteImage(e){let r={repositoryName:e.repositoryName,imageIds:e.imageIds};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{imageIds:t.imageIds,failures:t.failures}}async putLifecyclePolicy(e){let r={repositoryName:e.repositoryName,lifecyclePolicyText:e.lifecyclePolicyText};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,lifecyclePolicyText:t.lifecyclePolicyText}}async getLifecyclePolicy(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,lifecyclePolicyText:t.lifecyclePolicyText,lastEvaluatedAt:t.lastEvaluatedAt}}async setRepositoryPolicy(e){let r={repositoryName:e.repositoryName,policyText:e.policyText};if(e.registryId)r.registryId=e.registryId;if(e.force!==void 0)r.force=e.force;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,policyText:t.policyText}}async getRepositoryPolicy(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,policyText:t.policyText}}async tagResource(e){let r={resourceArn:e.resourceArn,tags:e.tags};await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.TagResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})}async listTagsForResource(e){let r={resourceArn:e};return{tags:(await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.ListTagsForResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})).tags}}createLifecyclePolicyText(e){return JSON.stringify({rules:e.map((r)=>({rulePriority:r.rulePriority,description:r.description,selection:r.selection,action:r.action}))})}async getDockerLoginCommand(){let e=await this.getAuthorizationToken();if(!e.authorizationData?.[0])throw Error("Failed to get authorization token");let r=e.authorizationData[0],t=r.authorizationToken||"",i=r.proxyEndpoint||"";return`echo "${Buffer.from(t,"base64").toString("utf8").split(":")[1]}" | docker login --username AWS --password-stdin ${i}`}getRegistryUri(e){return`${e}.dkr.ecr.${this.region}.amazonaws.com`}parseRepository(e){return{repositoryArn:e.repositoryArn,registryId:e.registryId,repositoryName:e.repositoryName,repositoryUri:e.repositoryUri,createdAt:e.createdAt,imageTagMutability:e.imageTagMutability,imageScanningConfiguration:e.imageScanningConfiguration,encryptionConfiguration:e.encryptionConfiguration}}parseImageDetail(e){return{registryId:e.registryId,repositoryName:e.repositoryName,imageDigest:e.imageDigest,imageTags:e.imageTags,imageSizeInBytes:e.imageSizeInBytes,imagePushedAt:e.imagePushedAt,imageScanStatus:e.imageScanStatus,imageScanFindingsSummary:e.imageScanFindingsSummary}}}
1
+ import{u}from"./chunk-pdw0qjq1.js";class bt{client;region;constructor(e="us-east-1",r){this.region=e,this.client=new u(void 0,{profile:r})}async createRepository(e){let r={repositoryName:e.repositoryName};if(e.imageTagMutability)r.imageTagMutability=e.imageTagMutability;if(e.imageScanningConfiguration)r.imageScanningConfiguration=e.imageScanningConfiguration;if(e.encryptionConfiguration)r.encryptionConfiguration=e.encryptionConfiguration;if(e.tags&&e.tags.length>0)r.tags=e.tags;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.CreateRepository","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repository:t.repository?this.parseRepository(t.repository):void 0}}async describeRepositories(e){let r={};if(e?.repositoryNames&&e.repositoryNames.length>0)r.repositoryNames=e.repositoryNames;if(e?.registryId)r.registryId=e.registryId;if(e?.maxResults)r.maxResults=e.maxResults;if(e?.nextToken)r.nextToken=e.nextToken;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DescribeRepositories","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repositories:t.repositories?.map((i)=>this.parseRepository(i)),nextToken:t.nextToken}}async getAuthorizationToken(e){let r={};if(e&&e.length>0)r.registryIds=e;return{authorizationData:(await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})).authorizationData?.map((i)=>({authorizationToken:i.authorizationToken,expiresAt:i.expiresAt,proxyEndpoint:i.proxyEndpoint}))}}async deleteRepository(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;if(e.force!==void 0)r.force=e.force;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DeleteRepository","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repository:t.repository?this.parseRepository(t.repository):void 0}}async describeImages(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;if(e.imageIds&&e.imageIds.length>0)r.imageIds=e.imageIds;if(e.filter)r.filter=e.filter;if(e.maxResults)r.maxResults=e.maxResults;if(e.nextToken)r.nextToken=e.nextToken;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DescribeImages","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{imageDetails:t.imageDetails?.map((i)=>this.parseImageDetail(i)),nextToken:t.nextToken}}async batchDeleteImage(e){let r={repositoryName:e.repositoryName,imageIds:e.imageIds};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{imageIds:t.imageIds,failures:t.failures}}async putLifecyclePolicy(e){let r={repositoryName:e.repositoryName,lifecyclePolicyText:e.lifecyclePolicyText};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,lifecyclePolicyText:t.lifecyclePolicyText}}async getLifecyclePolicy(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,lifecyclePolicyText:t.lifecyclePolicyText,lastEvaluatedAt:t.lastEvaluatedAt}}async setRepositoryPolicy(e){let r={repositoryName:e.repositoryName,policyText:e.policyText};if(e.registryId)r.registryId=e.registryId;if(e.force!==void 0)r.force=e.force;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,policyText:t.policyText}}async getRepositoryPolicy(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,policyText:t.policyText}}async tagResource(e){let r={resourceArn:e.resourceArn,tags:e.tags};await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.TagResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})}async listTagsForResource(e){let r={resourceArn:e};return{tags:(await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.ListTagsForResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})).tags}}createLifecyclePolicyText(e){return JSON.stringify({rules:e.map((r)=>({rulePriority:r.rulePriority,description:r.description,selection:r.selection,action:r.action}))})}async getDockerLoginCommand(){let e=await this.getAuthorizationToken();if(!e.authorizationData?.[0])throw Error("Failed to get authorization token");let r=e.authorizationData[0],t=r.authorizationToken||"",i=r.proxyEndpoint||"";return`echo "${Buffer.from(t,"base64").toString("utf8").split(":")[1]}" | docker login --username AWS --password-stdin ${i}`}getRegistryUri(e){return`${e}.dkr.ecr.${this.region}.amazonaws.com`}parseRepository(e){return{repositoryArn:e.repositoryArn,registryId:e.registryId,repositoryName:e.repositoryName,repositoryUri:e.repositoryUri,createdAt:e.createdAt,imageTagMutability:e.imageTagMutability,imageScanningConfiguration:e.imageScanningConfiguration,encryptionConfiguration:e.encryptionConfiguration}}parseImageDetail(e){return{registryId:e.registryId,repositoryName:e.repositoryName,imageDigest:e.imageDigest,imageTags:e.imageTags,imageSizeInBytes:e.imageSizeInBytes,imagePushedAt:e.imagePushedAt,imageScanStatus:e.imageScanStatus,imageScanFindingsSummary:e.imageScanFindingsSummary}}}
2
2
  export{bt};
@@ -1,4 +1,4 @@
1
- import{A}from"./chunk-8tbj9h2a.js";var ie=["project:read","config:read","config:write","deployments:read","deployments:create","deployments:cancel","deployments:rollback","runtime:read","runtime:restart","runtime:logs","runtime:terminal","data:read","data:write","data:admin","backups:read","backups:create","backups:restore","secrets:read","secrets:write","fleet:read","fleet:manage","users:read","users:manage","users:transfer-ownership","audit:read","billing:read","billing:manage","security:read","security:manage","security:waive","sources:read","sources:manage","applications:read","applications:manage","automation:read","automation:manage","tags:manage"],K=["project:read","config:read","deployments:read","runtime:read","runtime:logs","data:read","backups:read","security:read","sources:read","applications:read","billing:read"],oe={owner:new Set(ie),admin:new Set(ie.filter((e)=>e!=="users:transfer-ownership")),deployer:new Set([...K,"deployments:create","deployments:cancel","deployments:rollback","sources:manage","applications:manage"]),operator:new Set([...K,"runtime:restart","backups:create","security:manage","sources:manage","applications:manage"]),viewer:new Set(K),auditor:new Set(["project:read","config:read","deployments:read","runtime:read","data:read","backups:read","audit:read","security:read","sources:read","applications:read"])};function Zr(e){return oe[e]}function P(e,t){if(e.type==="organization")return e.id===void 0||e.id===t.organizationId;if(!e.id)return!1;if(e.type==="project")return e.id===t.projectId;if(e.type==="environment")return e.id===t.environmentId;return e.id===t.resourceId}function Z(e){let{membership:t,capability:r,target:i}=e;if(!t||t.status!=="active"||t.organizationId!==i.organizationId)return{allowed:!1,reason:"inactive-membership"};let a=e.grants.filter((s)=>s.organizationId===i.organizationId&&s.membershipId===t.id&&s.capability===r&&P(s.scope,i)),E=a.find((s)=>s.effect==="deny");if(E)return{allowed:!1,reason:"explicit-deny",inheritedFrom:{kind:"grant",id:E.id,scope:E.scope}};let T=a.find((s)=>s.effect==="allow");if(T)return{allowed:!0,reason:"explicit-allow",inheritedFrom:{kind:"grant",id:T.id,scope:T.scope}};if(!P(t.scope,i))return{allowed:!1,reason:"scope-mismatch"};if(Zr(t.roleTemplate).has(r))return{allowed:!0,reason:"role-template",inheritedFrom:{kind:"membership",id:t.id,scope:t.scope}};return{allowed:!1,reason:"missing-capability"}}function en(e){return ie.filter((t)=>Z({...e,capability:t}).allowed)}import{createHash as S,randomBytes as Te}from"node:crypto";import{chmodSync as H,existsSync as ee,mkdirSync as se,statSync as de}from"node:fs";import{dirname as te}from"node:path";import{Database as Ne}from"bun:sqlite";var l=40,j=[{version:1,name:"core_control_plane",sql:`
1
+ import{A}from"./chunk-gxwsq3k0.js";var ie=["project:read","config:read","config:write","deployments:read","deployments:create","deployments:cancel","deployments:rollback","runtime:read","runtime:restart","runtime:logs","runtime:terminal","data:read","data:write","data:admin","backups:read","backups:create","backups:restore","secrets:read","secrets:write","fleet:read","fleet:manage","users:read","users:manage","users:transfer-ownership","audit:read","billing:read","billing:manage","security:read","security:manage","security:waive","sources:read","sources:manage","applications:read","applications:manage","automation:read","automation:manage","tags:manage"],K=["project:read","config:read","deployments:read","runtime:read","runtime:logs","data:read","backups:read","security:read","sources:read","applications:read","billing:read"],oe={owner:new Set(ie),admin:new Set(ie.filter((e)=>e!=="users:transfer-ownership")),deployer:new Set([...K,"deployments:create","deployments:cancel","deployments:rollback","sources:manage","applications:manage"]),operator:new Set([...K,"runtime:restart","backups:create","security:manage","sources:manage","applications:manage"]),viewer:new Set(K),auditor:new Set(["project:read","config:read","deployments:read","runtime:read","data:read","backups:read","audit:read","security:read","sources:read","applications:read"])};function Zr(e){return oe[e]}function P(e,t){if(e.type==="organization")return e.id===void 0||e.id===t.organizationId;if(!e.id)return!1;if(e.type==="project")return e.id===t.projectId;if(e.type==="environment")return e.id===t.environmentId;return e.id===t.resourceId}function Z(e){let{membership:t,capability:r,target:i}=e;if(!t||t.status!=="active"||t.organizationId!==i.organizationId)return{allowed:!1,reason:"inactive-membership"};let a=e.grants.filter((s)=>s.organizationId===i.organizationId&&s.membershipId===t.id&&s.capability===r&&P(s.scope,i)),E=a.find((s)=>s.effect==="deny");if(E)return{allowed:!1,reason:"explicit-deny",inheritedFrom:{kind:"grant",id:E.id,scope:E.scope}};let T=a.find((s)=>s.effect==="allow");if(T)return{allowed:!0,reason:"explicit-allow",inheritedFrom:{kind:"grant",id:T.id,scope:T.scope}};if(!P(t.scope,i))return{allowed:!1,reason:"scope-mismatch"};if(Zr(t.roleTemplate).has(r))return{allowed:!0,reason:"role-template",inheritedFrom:{kind:"membership",id:t.id,scope:t.scope}};return{allowed:!1,reason:"missing-capability"}}function en(e){return ie.filter((t)=>Z({...e,capability:t}).allowed)}import{createHash as S,randomBytes as Te}from"node:crypto";import{chmodSync as H,existsSync as ee,mkdirSync as se,statSync as de}from"node:fs";import{dirname as te}from"node:path";import{Database as Ne}from"bun:sqlite";var l=40,j=[{version:1,name:"core_control_plane",sql:`
2
2
  CREATE TABLE projects (
3
3
  id TEXT PRIMARY KEY,
4
4
  slug TEXT NOT NULL UNIQUE,
@@ -1,4 +1,4 @@
1
- import{u}from"./chunk-bckm6fre.js";class K{client;region;constructor(e="us-east-1"){this.region=e,this.client=new u}async describeInstances(e){let t={Action:"DescribeInstances",Version:"2016-11-15"};if(e?.InstanceIds)e.InstanceIds.forEach((r,a)=>{t[`InstanceId.${a+1}`]=r});if(e?.Filters)e.Filters.forEach((r,a)=>{t[`Filter.${a+1}.Name`]=r.Name,r.Values.forEach((i,c)=>{t[`Filter.${a+1}.Value.${c+1}`]=i})});if(e?.MaxResults)t.MaxResults=String(e.MaxResults);if(e?.NextToken)t.NextToken=e.NextToken;let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()}),n=s.DescribeInstancesResponse||s;return{Reservations:this.parseReservations(n.reservationSet?.item),NextToken:n.nextToken}}async getInstance(e){return(await this.describeInstances({InstanceIds:[e]})).Reservations?.[0]?.Instances?.[0]}async getConsoleOutput(e,t){let s={Action:"GetConsoleOutput",Version:"2016-11-15",InstanceId:e};if(t)s.Latest="true";let n=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(s).toString()}),r=n.GetConsoleOutputResponse||n;return{InstanceId:r.instanceId,Output:r.output,Timestamp:r.timestamp}}async getConsoleOutputDecoded(e,t){let s=await this.getConsoleOutput(e,t?.latest);if(!s.Output)return"No console output available yet";let n=Buffer.from(s.Output,"base64").toString("utf-8");if(t?.tailLines)return n.split(`
1
+ import{u}from"./chunk-pdw0qjq1.js";class K{client;region;constructor(e="us-east-1"){this.region=e,this.client=new u}async describeInstances(e){let t={Action:"DescribeInstances",Version:"2016-11-15"};if(e?.InstanceIds)e.InstanceIds.forEach((r,a)=>{t[`InstanceId.${a+1}`]=r});if(e?.Filters)e.Filters.forEach((r,a)=>{t[`Filter.${a+1}.Name`]=r.Name,r.Values.forEach((i,c)=>{t[`Filter.${a+1}.Value.${c+1}`]=i})});if(e?.MaxResults)t.MaxResults=String(e.MaxResults);if(e?.NextToken)t.NextToken=e.NextToken;let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()}),n=s.DescribeInstancesResponse||s;return{Reservations:this.parseReservations(n.reservationSet?.item),NextToken:n.nextToken}}async getInstance(e){return(await this.describeInstances({InstanceIds:[e]})).Reservations?.[0]?.Instances?.[0]}async getConsoleOutput(e,t){let s={Action:"GetConsoleOutput",Version:"2016-11-15",InstanceId:e};if(t)s.Latest="true";let n=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(s).toString()}),r=n.GetConsoleOutputResponse||n;return{InstanceId:r.instanceId,Output:r.output,Timestamp:r.timestamp}}async getConsoleOutputDecoded(e,t){let s=await this.getConsoleOutput(e,t?.latest);if(!s.Output)return"No console output available yet";let n=Buffer.from(s.Output,"base64").toString("utf-8");if(t?.tailLines)return n.split(`
2
2
  `).slice(-t.tailLines).join(`
3
3
  `);return n}async describeInstanceStatus(e){let t={Action:"DescribeInstanceStatus",Version:"2016-11-15"};if(e?.InstanceIds)e.InstanceIds.forEach((n,r)=>{t[`InstanceId.${r+1}`]=n});if(e?.IncludeAllInstances)t.IncludeAllInstances="true";if(e?.Filters)e.Filters.forEach((n,r)=>{t[`Filter.${r+1}.Name`]=n.Name,n.Values.forEach((a,i)=>{t[`Filter.${r+1}.Value.${i+1}`]=a})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{InstanceStatuses:this.parseArray(s.instanceStatusSet?.item).map((n)=>({InstanceId:n.instanceId,InstanceState:n.instanceState?{Code:Number.parseInt(n.instanceState.code),Name:n.instanceState.name}:void 0,InstanceStatus:n.instanceStatus?{Status:n.instanceStatus.status,Details:this.parseArray(n.instanceStatus.details?.item).map((r)=>({Name:r.name,Status:r.status}))}:void 0,SystemStatus:n.systemStatus?{Status:n.systemStatus.status,Details:this.parseArray(n.systemStatus.details?.item).map((r)=>({Name:r.name,Status:r.status}))}:void 0}))}}async startInstances(e){let t={Action:"StartInstances",Version:"2016-11-15"};e.forEach((n,r)=>{t[`InstanceId.${r+1}`]=n});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{StartingInstances:this.parseArray(s.instancesSet?.item).map((n)=>({InstanceId:n.instanceId,CurrentState:n.currentState?{Name:n.currentState.name}:void 0,PreviousState:n.previousState?{Name:n.previousState.name}:void 0}))}}async stopInstances(e,t){let s={Action:"StopInstances",Version:"2016-11-15"};if(e.forEach((r,a)=>{s[`InstanceId.${a+1}`]=r}),t)s.Force="true";let n=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(s).toString()});return{StoppingInstances:this.parseArray(n.instancesSet?.item).map((r)=>({InstanceId:r.instanceId,CurrentState:r.currentState?{Name:r.currentState.name}:void 0,PreviousState:r.previousState?{Name:r.previousState.name}:void 0}))}}async rebootInstances(e){let t={Action:"RebootInstances",Version:"2016-11-15"};e.forEach((s,n)=>{t[`InstanceId.${n+1}`]=s}),await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})}async terminateInstances(e){let t={Action:"TerminateInstances",Version:"2016-11-15"};e.forEach((n,r)=>{t[`InstanceId.${r+1}`]=n});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{TerminatingInstances:this.parseArray(s.instancesSet?.item).map((n)=>({InstanceId:n.instanceId,CurrentState:n.currentState?{Name:n.currentState.name}:void 0,PreviousState:n.previousState?{Name:n.previousState.name}:void 0}))}}async createImage(e){let t={Action:"CreateImage",Version:"2016-11-15",InstanceId:e.InstanceId,Name:e.Name};if(e.Description)t.Description=e.Description;if(e.NoReboot!==void 0)t.NoReboot=String(e.NoReboot);if(e.TagSpecifications)e.TagSpecifications.forEach((r,a)=>{t[`TagSpecification.${a+1}.ResourceType`]=r.ResourceType,r.Tags.forEach((i,c)=>{t[`TagSpecification.${a+1}.Tag.${c+1}.Key`]=i.Key,t[`TagSpecification.${a+1}.Tag.${c+1}.Value`]=i.Value})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{ImageId:(s.CreateImageResponse||s).imageId}}async deregisterImage(e){await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({Action:"DeregisterImage",Version:"2016-11-15",ImageId:e}).toString()})}async describeVpcs(e){let t={Action:"DescribeVpcs",Version:"2016-11-15"};if(e?.VpcIds)e.VpcIds.forEach((n,r)=>{t[`VpcId.${r+1}`]=n});if(e?.Filters)e.Filters.forEach((n,r)=>{t[`Filter.${r+1}.Name`]=n.Name,n.Values.forEach((a,i)=>{t[`Filter.${r+1}.Value.${i+1}`]=a})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{Vpcs:this.parseArray(s.vpcSet?.item).map((n)=>({VpcId:n.vpcId,CidrBlock:n.cidrBlock,State:n.state,DhcpOptionsId:n.dhcpOptionsId,InstanceTenancy:n.instanceTenancy,IsDefault:n.isDefault==="true",Tags:this.parseTags(n.tagSet?.item)}))}}async describeSubnets(e){let t={Action:"DescribeSubnets",Version:"2016-11-15"};if(e?.SubnetIds)e.SubnetIds.forEach((n,r)=>{t[`SubnetId.${r+1}`]=n});if(e?.Filters)e.Filters.forEach((n,r)=>{t[`Filter.${r+1}.Name`]=n.Name,n.Values.forEach((a,i)=>{t[`Filter.${r+1}.Value.${i+1}`]=a})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{Subnets:this.parseArray(s.subnetSet?.item).map((n)=>({SubnetId:n.subnetId,VpcId:n.vpcId,CidrBlock:n.cidrBlock,AvailabilityZone:n.availabilityZone,AvailableIpAddressCount:Number.parseInt(n.availableIpAddressCount),State:n.state,MapPublicIpOnLaunch:n.mapPublicIpOnLaunch==="true",Tags:this.parseTags(n.tagSet?.item)}))}}async describeSecurityGroups(e){let t={Action:"DescribeSecurityGroups",Version:"2016-11-15"};if(e?.GroupIds)e.GroupIds.forEach((n,r)=>{t[`GroupId.${r+1}`]=n});if(e?.GroupNames)e.GroupNames.forEach((n,r)=>{t[`GroupName.${r+1}`]=n});if(e?.Filters)e.Filters.forEach((n,r)=>{t[`Filter.${r+1}.Name`]=n.Name,n.Values.forEach((a,i)=>{t[`Filter.${r+1}.Value.${i+1}`]=a})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{SecurityGroups:this.parseArray(s.securityGroupInfo?.item).map((n)=>({GroupId:n.groupId,GroupName:n.groupName,Description:n.groupDescription,VpcId:n.vpcId,IpPermissions:this.parseIpPermissions(n.ipPermissions?.item),IpPermissionsEgress:this.parseIpPermissions(n.ipPermissionsEgress?.item),Tags:this.parseTags(n.tagSet?.item)}))}}async describeInternetGateways(e){let t={Action:"DescribeInternetGateways",Version:"2016-11-15"};if(e?.InternetGatewayIds)e.InternetGatewayIds.forEach((n,r)=>{t[`InternetGatewayId.${r+1}`]=n});if(e?.Filters)e.Filters.forEach((n,r)=>{t[`Filter.${r+1}.Name`]=n.Name,n.Values.forEach((a,i)=>{t[`Filter.${r+1}.Value.${i+1}`]=a})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{InternetGateways:this.parseArray(s.internetGatewaySet?.item).map((n)=>({InternetGatewayId:n.internetGatewayId,Attachments:this.parseArray(n.attachmentSet?.item).map((r)=>({VpcId:r.vpcId,State:r.state})),Tags:this.parseTags(n.tagSet?.item)}))}}async describeAddresses(e){let t={Action:"DescribeAddresses",Version:"2016-11-15"};if(e?.AllocationIds)e.AllocationIds.forEach((n,r)=>{t[`AllocationId.${r+1}`]=n});if(e?.PublicIps)e.PublicIps.forEach((n,r)=>{t[`PublicIp.${r+1}`]=n});if(e?.Filters)e.Filters.forEach((n,r)=>{t[`Filter.${r+1}.Name`]=n.Name,n.Values.forEach((a,i)=>{t[`Filter.${r+1}.Value.${i+1}`]=a})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{Addresses:this.parseArray(s.addressesSet?.item).map((n)=>({PublicIp:n.publicIp,AllocationId:n.allocationId,AssociationId:n.associationId,InstanceId:n.instanceId,NetworkInterfaceId:n.networkInterfaceId,PrivateIpAddress:n.privateIpAddress,Domain:n.domain,Tags:this.parseTags(n.tagSet?.item)}))}}async allocateAddress(e){let t={Action:"AllocateAddress",Version:"2016-11-15"};if(e?.Domain)t.Domain=e.Domain;if(e?.TagSpecifications)e.TagSpecifications.forEach((n,r)=>{t[`TagSpecification.${r+1}.ResourceType`]=n.ResourceType,n.Tags.forEach((a,i)=>{t[`TagSpecification.${r+1}.Tag.${i+1}.Key`]=a.Key,t[`TagSpecification.${r+1}.Tag.${i+1}.Value`]=a.Value})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{AllocationId:s.allocationId,PublicIp:s.publicIp,Domain:s.domain}}async associateAddress(e){let t={Action:"AssociateAddress",Version:"2016-11-15"};if(e.AllocationId)t.AllocationId=e.AllocationId;if(e.PublicIp)t.PublicIp=e.PublicIp;if(e.InstanceId)t.InstanceId=e.InstanceId;if(e.NetworkInterfaceId)t.NetworkInterfaceId=e.NetworkInterfaceId;if(e.PrivateIpAddress)t.PrivateIpAddress=e.PrivateIpAddress;if(e.AllowReassociation)t.AllowReassociation="true";return{AssociationId:(await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})).associationId}}async createTags(e){let t={Action:"CreateTags",Version:"2016-11-15"};e.Resources.forEach((s,n)=>{t[`ResourceId.${n+1}`]=s}),e.Tags.forEach((s,n)=>{t[`Tag.${n+1}.Key`]=s.Key,t[`Tag.${n+1}.Value`]=s.Value}),await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})}async waitForInstanceState(e,t,s){let n=s?.maxWaitMs||300000,r=s?.pollIntervalMs||5000,a=Date.now();while(Date.now()-a<n){let i;try{i=await this.getInstance(e)}catch{i=void 0}if(i?.State?.Name===t)return i;await new Promise((c)=>setTimeout(c,r))}return}async createVpc(e){let t={Action:"CreateVpc",Version:"2016-11-15",CidrBlock:e.CidrBlock};if(e.InstanceTenancy)t.InstanceTenancy=e.InstanceTenancy;if(e.TagSpecifications)e.TagSpecifications.forEach((a,i)=>{t[`TagSpecification.${i+1}.ResourceType`]=a.ResourceType,a.Tags.forEach((c,o)=>{t[`TagSpecification.${i+1}.Tag.${o+1}.Key`]=c.Key,t[`TagSpecification.${i+1}.Tag.${o+1}.Value`]=c.Value})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()}),r=(s.CreateVpcResponse||s).vpc;return{Vpc:r?{VpcId:r.vpcId,CidrBlock:r.cidrBlock,State:r.state,DhcpOptionsId:r.dhcpOptionsId,InstanceTenancy:r.instanceTenancy,IsDefault:r.isDefault==="true",Tags:this.parseTags(r.tagSet?.item)}:void 0}}async createSubnet(e){let t={Action:"CreateSubnet",Version:"2016-11-15",VpcId:e.VpcId,CidrBlock:e.CidrBlock};if(e.AvailabilityZone)t.AvailabilityZone=e.AvailabilityZone;if(e.TagSpecifications)e.TagSpecifications.forEach((a,i)=>{t[`TagSpecification.${i+1}.ResourceType`]=a.ResourceType,a.Tags.forEach((c,o)=>{t[`TagSpecification.${i+1}.Tag.${o+1}.Key`]=c.Key,t[`TagSpecification.${i+1}.Tag.${o+1}.Value`]=c.Value})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()}),r=(s.CreateSubnetResponse||s).subnet;return{Subnet:r?{SubnetId:r.subnetId,VpcId:r.vpcId,CidrBlock:r.cidrBlock,AvailabilityZone:r.availabilityZone,AvailableIpAddressCount:r.availableIpAddressCount?Number.parseInt(r.availableIpAddressCount):void 0,State:r.state,MapPublicIpOnLaunch:r.mapPublicIpOnLaunch==="true",Tags:this.parseTags(r.tagSet?.item)}:void 0}}async modifySubnetAttribute(e){let t={Action:"ModifySubnetAttribute",Version:"2016-11-15",SubnetId:e.SubnetId};if(e.MapPublicIpOnLaunch!==void 0)t["MapPublicIpOnLaunch.Value"]=String(e.MapPublicIpOnLaunch.Value);await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})}async createSecurityGroup(e){let t={Action:"CreateSecurityGroup",Version:"2016-11-15",GroupName:e.GroupName,GroupDescription:e.Description};if(e.VpcId)t.VpcId=e.VpcId;if(e.TagSpecifications)e.TagSpecifications.forEach((r,a)=>{t[`TagSpecification.${a+1}.ResourceType`]=r.ResourceType,r.Tags.forEach((i,c)=>{t[`TagSpecification.${a+1}.Tag.${c+1}.Key`]=i.Key,t[`TagSpecification.${a+1}.Tag.${c+1}.Value`]=i.Value})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()});return{GroupId:(s.CreateSecurityGroupResponse||s).groupId}}async authorizeSecurityGroupIngress(e){let t={Action:"AuthorizeSecurityGroupIngress",Version:"2016-11-15",GroupId:e.GroupId};this.encodeIpPermissions(t,e.IpPermissions),await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})}async authorizeSecurityGroupEgress(e){let t={Action:"AuthorizeSecurityGroupEgress",Version:"2016-11-15",GroupId:e.GroupId};this.encodeIpPermissions(t,e.IpPermissions),await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})}async describeRouteTables(e){let t={Action:"DescribeRouteTables",Version:"2016-11-15"};if(e?.RouteTableIds)e.RouteTableIds.forEach((r,a)=>{t[`RouteTableId.${a+1}`]=r});if(e?.Filters)e.Filters.forEach((r,a)=>{t[`Filter.${a+1}.Name`]=r.Name,r.Values.forEach((i,c)=>{t[`Filter.${a+1}.Value.${c+1}`]=i})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()}),n=s.DescribeRouteTablesResponse||s;return{RouteTables:this.parseArray(n.routeTableSet?.item).map((r)=>({RouteTableId:r.routeTableId,VpcId:r.vpcId,Routes:this.parseArray(r.routeSet?.item).map((a)=>({DestinationCidrBlock:a.destinationCidrBlock,GatewayId:a.gatewayId,NatGatewayId:a.natGatewayId,State:a.state})),Associations:this.parseArray(r.associationSet?.item).map((a)=>({RouteTableAssociationId:a.routeTableAssociationId,SubnetId:a.subnetId,Main:a.main==="true"||a.main===!0})),Tags:this.parseTags(r.tagSet?.item)}))}}async deleteVpc(e){let t={Action:"DeleteVpc",Version:"2016-11-15",VpcId:e};await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})}async deleteSubnet(e){let t={Action:"DeleteSubnet",Version:"2016-11-15",SubnetId:e};await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})}async deleteSecurityGroup(e){await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({Action:"DeleteSecurityGroup",Version:"2016-11-15",GroupId:e}).toString()})}async describeNetworkInterfaces(e){let t={Action:"DescribeNetworkInterfaces",Version:"2016-11-15"};if(e?.NetworkInterfaceIds)e.NetworkInterfaceIds.forEach((r,a)=>{t[`NetworkInterfaceId.${a+1}`]=r});if(e?.Filters)e.Filters.forEach((r,a)=>{t[`Filter.${a+1}.Name`]=r.Name,r.Values.forEach((i,c)=>{t[`Filter.${a+1}.Value.${c+1}`]=i})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()}),n=s.DescribeNetworkInterfacesResponse||s;return{NetworkInterfaces:this.parseArray(n.networkInterfaceSet?.item).map((r)=>({NetworkInterfaceId:r.networkInterfaceId,SubnetId:r.subnetId,VpcId:r.vpcId,Status:r.status,Attachment:r.attachment?{AttachmentId:r.attachment.attachmentId,InstanceId:r.attachment.instanceId,Status:r.attachment.status}:void 0}))}}async detachNetworkInterface(e,t){let s={Action:"DetachNetworkInterface",Version:"2016-11-15",AttachmentId:e};if(t)s.Force="true";await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(s).toString()})}async deleteNetworkInterface(e){let t={Action:"DeleteNetworkInterface",Version:"2016-11-15",NetworkInterfaceId:e};await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})}async describeRegions(){let e={Action:"DescribeRegions",Version:"2016-11-15"},t=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(e).toString()}),s=t.DescribeRegionsResponse||t;return{Regions:this.parseArray(s.regionInfo?.item).map((n)=>({RegionName:n.regionName,Endpoint:n.regionEndpoint}))}}async runInstances(e){let t={Action:"RunInstances",Version:"2016-11-15",ImageId:e.ImageId,InstanceType:e.InstanceType,MinCount:String(e.MinCount),MaxCount:String(e.MaxCount)};if(e.SecurityGroupIds)e.SecurityGroupIds.forEach((r,a)=>{t[`SecurityGroupId.${a+1}`]=r});if(e.SubnetId)t.SubnetId=e.SubnetId;if(e.UserData)t.UserData=e.UserData;if(e.IamInstanceProfile){if(e.IamInstanceProfile.Name)t["IamInstanceProfile.Name"]=e.IamInstanceProfile.Name;if(e.IamInstanceProfile.Arn)t["IamInstanceProfile.Arn"]=e.IamInstanceProfile.Arn}if(e.TagSpecifications)e.TagSpecifications.forEach((r,a)=>{t[`TagSpecification.${a+1}.ResourceType`]=r.ResourceType,r.Tags.forEach((i,c)=>{t[`TagSpecification.${a+1}.Tag.${c+1}.Key`]=i.Key,t[`TagSpecification.${a+1}.Tag.${c+1}.Value`]=i.Value})});let s=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()}),n=s.RunInstancesResponse||s;return{Instances:this.parseInstances(n.instancesSet?.item||n.instancesSet)}}encodeIpPermissions(e,t){t.forEach((s,n)=>{let r=`IpPermissions.${n+1}`;if(s.IpProtocol!==void 0)e[`${r}.IpProtocol`]=s.IpProtocol;if(s.FromPort!==void 0)e[`${r}.FromPort`]=String(s.FromPort);if(s.ToPort!==void 0)e[`${r}.ToPort`]=String(s.ToPort);if(s.IpRanges)s.IpRanges.forEach((a,i)=>{if(a.CidrIp)e[`${r}.IpRanges.${i+1}.CidrIp`]=a.CidrIp;if(a.Description)e[`${r}.IpRanges.${i+1}.Description`]=a.Description});if(s.Ipv6Ranges)s.Ipv6Ranges.forEach((a,i)=>{if(a.CidrIpv6)e[`${r}.Ipv6Ranges.${i+1}.CidrIpv6`]=a.CidrIpv6;if(a.Description)e[`${r}.Ipv6Ranges.${i+1}.Description`]=a.Description});if(s.UserIdGroupPairs)s.UserIdGroupPairs.forEach((a,i)=>{if(a.GroupId)e[`${r}.Groups.${i+1}.GroupId`]=a.GroupId;if(a.UserId)e[`${r}.Groups.${i+1}.UserId`]=a.UserId;if(a.Description)e[`${r}.Groups.${i+1}.Description`]=a.Description})})}parseArray(e){if(!e)return[];return Array.isArray(e)?e:[e]}parseFirstIpv6Address(e){for(let t of this.parseArray(e))for(let s of this.parseArray(t?.ipv6AddressesSet?.item))if(s?.ipv6Address)return s.ipv6Address;return}parseTags(e){return this.parseArray(e).map((t)=>({Key:t.key,Value:t.value}))}parseReservations(e){return this.parseArray(e).map((t)=>({ReservationId:t.reservationId,Instances:this.parseInstances(t.instancesSet?.item||t.instancesSet)}))}parseInstances(e){return this.parseArray(e).map((t)=>({InstanceId:t.instanceId,ImageId:t.imageId,InstanceType:t.instanceType,State:t.instanceState?{Code:Number.parseInt(t.instanceState.code),Name:t.instanceState.name}:void 0,PrivateIpAddress:t.privateIpAddress,PublicIpAddress:t.ipAddress,Ipv6Address:this.parseFirstIpv6Address(t.networkInterfaceSet?.item),SubnetId:t.subnetId,VpcId:t.vpcId,SecurityGroups:this.parseArray(t.groupSet?.item).map((s)=>({GroupId:s.groupId,GroupName:s.groupName})),Tags:this.parseTags(t.tagSet?.item),LaunchTime:t.launchTime,Placement:t.placement?{AvailabilityZone:t.placement.availabilityZone,Tenancy:t.placement.tenancy}:void 0,Architecture:t.architecture,RootDeviceType:t.rootDeviceType,RootDeviceName:t.rootDeviceName,BlockDeviceMappings:this.parseArray(t.blockDeviceMapping?.item).map((s)=>({DeviceName:s.deviceName,Ebs:s.ebs?{VolumeId:s.ebs.volumeId,Status:s.ebs.status,AttachTime:s.ebs.attachTime,DeleteOnTermination:s.ebs.deleteOnTermination==="true"}:void 0})),IamInstanceProfile:t.iamInstanceProfile?{Arn:t.iamInstanceProfile.arn,Id:t.iamInstanceProfile.id}:void 0}))}parseIpPermissions(e){return this.parseArray(e).map((t)=>({IpProtocol:t.ipProtocol,FromPort:t.fromPort?Number.parseInt(t.fromPort):void 0,ToPort:t.toPort?Number.parseInt(t.toPort):void 0,IpRanges:this.parseArray(t.ipRanges?.item).map((s)=>({CidrIp:s.cidrIp,Description:s.description})),Ipv6Ranges:this.parseArray(t.ipv6Ranges?.item).map((s)=>({CidrIpv6:s.cidrIpv6,Description:s.description})),UserIdGroupPairs:this.parseArray(t.groups?.item).map((s)=>({GroupId:s.groupId,UserId:s.userId,Description:s.description}))}))}}
4
4
  export{K};
@@ -1 +1 @@
1
- import{to}from"./chunk-f35pte64.js";var su="\x00";function El(t,i){if(t==="*"||t==="**")return!0;let e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\x01").replace(/\*/g,"[^/]*").replace(/\u0001/g,".*");return new RegExp(`^${e}$`).test(i)}function g(t,i){if(t.startsWith("*.")){let e=t.slice(1);return i.endsWith(e)&&i.length>e.length}return t===i}function ta(t,i){if(t.enabled===!1)return!1;if(t.methods?.length&&!t.methods.some((e)=>e.toUpperCase()===i.method.toUpperCase()))return!1;if(t.path&&!El(t.path,i.path))return!1;if(t.host&&!g(t.host,i.host??""))return!1;return!0}function ra(t,i){let e=t.key??{source:"ip"},o=e.fallbackToIp!==!1,r;if(e.source==="ip")r=i.ip;else if(e.source==="global")r="global";else if(e.source==="host")r=i.host??"";else if(e.source==="path")r=i.path;else if(e.source==="header")r=e.name?i.headers?.[e.name.toLowerCase()]:void 0;else if(e.source==="cookie")r=e.name?i.cookies?.[e.name]:void 0;if(!r&&e.source!=="global")r=o?i.ip:"__missing__";return`${t.id}\x00${r}`}class wl{clock;maxTrackedKeys;buckets=new Map;windows=new Map;rules;constructor(t,i=()=>Date.now(),e=1e5){this.clock=i;this.maxTrackedKeys=e;this.rules=[...t].sort((o,r)=>(o.priority??0)-(r.priority??0))}check(t){let i=this.clock(),e=this.rules.filter((n)=>ta(n,t)),o;for(let n of e){let s=this.test(n,t,i);if(s.allowed)continue;if(!o||d(s.action)>d(o.action))o=s}if(o)return o;let r={action:"allow",allowed:!0};for(let n of e){let s=this.consume(n,t,i);if(s.remaining!=null&&(r.remaining??1/0)>s.remaining)r=s}return r}test(t,i,e){let o=ra(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let n=t.burst??t.limit,s=this.buckets.get(o),a=s?Math.min(n,s.tokens+this.refill(t,e-s.updatedAt)):n;if(a>=1)return{action:"allow",allowed:!0};return this.blocked(t,o,0,this.msPerToken(t)*(1-a),e)}let r=(this.windows.get(o)?.hits??[]).filter((n)=>n>e-t.windowMs);if(r.length<t.limit)return{action:"allow",allowed:!0};return this.blocked(t,o,0,r[0]+t.windowMs-e,e)}peek(t){let i=this.clock();for(let e of this.rules){if(!ta(e,t))continue;let o=this.test(e,t,i);if(!o.allowed)return o}return{action:"allow",allowed:!0}}msPerToken(t){return t.windowMs/Math.max(1,t.limit)}refill(t,i){return Math.max(0,i)/this.msPerToken(t)}blocked(t,i,e,o,r){let n=t.action??"deny";return{action:n,allowed:n==="allow"||n==="log",ruleId:t.id,limit:t.limit,remaining:e,retryAfterMs:Math.max(0,Math.ceil(o)),resetAt:r+Math.max(0,o),key:i}}consume(t,i,e){let o=ra(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let l=t.burst??t.limit,u=this.buckets.get(o)??{tokens:l,updatedAt:e},c=Math.min(l,u.tokens+this.refill(t,e-u.updatedAt));if(c<1)return this.buckets.set(o,{tokens:c,updatedAt:e}),this.blocked(t,o,0,this.msPerToken(t)*(1-c),e);return this.evictIfNeeded(this.buckets),this.buckets.set(o,{tokens:c-1,updatedAt:e}),{action:"allow",allowed:!0,ruleId:t.id,limit:l,remaining:Math.floor(c-1),resetAt:e+this.msPerToken(t)*(l-(c-1)),key:o}}let n=this.windows.get(o)??{hits:[]},s=e-t.windowMs,a=n.hits.filter((l)=>l>s);if(a.length>=t.limit)return this.windows.set(o,{hits:a}),this.blocked(t,o,0,a[0]+t.windowMs-e,e);return a.push(e),this.evictIfNeeded(this.windows),this.windows.set(o,{hits:a}),{action:"allow",allowed:!0,ruleId:t.id,limit:t.limit,remaining:t.limit-a.length,resetAt:a[0]+t.windowMs,key:o}}evictIfNeeded(t){if(t.size<this.maxTrackedKeys)return;let i=t.size-this.maxTrackedKeys+1,e=0;for(let o of t.keys())if(t.delete(o),++e>=i)break}sweep(){let t=this.clock(),i=0;for(let[e,o]of this.windows){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n){this.windows.delete(e),i++;continue}if(o.hits.every((s)=>s<=t-n.windowMs))this.windows.delete(e),i++}for(let[e,o]of this.buckets){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n||t-o.updatedAt>n.windowMs*2)this.buckets.delete(e),i++}return i}get trackedKeys(){return this.buckets.size+this.windows.size}}function d(t){return{allow:0,log:1,throttle:2,challenge:3,deny:4}[t]}function au(t){let i={};if(t.limit!=null)i["ratelimit-limit"]=String(t.limit);if(t.remaining!=null)i["ratelimit-remaining"]=String(t.remaining);if(t.resetAt!=null)i["ratelimit-reset"]=String(Math.max(0,Math.ceil((t.resetAt-Date.now())/1000)));if(!t.allowed&&t.retryAfterMs!=null)i["retry-after"]=String(Math.max(1,Math.ceil(t.retryAfterMs/1000)));return i}function cu(){return[{id:"global-ip",limit:600,windowMs:60000,burst:100,key:{source:"ip"},action:"deny",priority:100},{id:"api-ip",limit:120,windowMs:60000,burst:30,path:"/api/**",key:{source:"ip"},action:"deny",priority:50},{id:"auth-ip",limit:10,windowMs:60000,algorithm:"sliding_window",path:"/auth/**",methods:["POST"],key:{source:"ip"},action:"challenge",priority:10}]}var m="protection.controls",Vt=24,an=4,R={ipRules:{allow:[],block:[]}};function p(t,i){if(!t?.enabled)return;return new Date(t.expiresAt).getTime()>i.getTime()?t:void 0}function h(t,i){let e=Number.isFinite(t)?Number(t):i;return Math.min(Vt,Math.max(0.25,e))}var f=500;class zt{controlPlane;options;constructor(t,i={}){this.controlPlane=t;this.options=i}now(){return this.options.now?.()??new Date}read(){let t=this.controlPlane.getSetting(m);if(!t||typeof t!=="object"||Array.isArray(t))return{...R,ipRules:{allow:[],block:[]}};let i=t;return{attackMode:i.attackMode,mitigationPause:i.mitigationPause,ipRules:{allow:Array.isArray(i.ipRules?.allow)?i.ipRules.allow:[],block:Array.isArray(i.ipRules?.block)?i.ipRules.block:[]},updatedAt:i.updatedAt}}write(t){let i={...t,updatedAt:this.now().toISOString()};return this.controlPlane.setSetting(m,i),i}raw(){return this.read()}current(){let t=this.now(),i=this.read();return{attackMode:p(i.attackMode,t),mitigationPause:p(i.mitigationPause,t),ipRules:i.ipRules}}enableAttackMode(t){let i=this.now(),e={enabled:!0,startedAt:i.toISOString(),expiresAt:new Date(i.getTime()+h(t.hours,an)*3600000).toISOString(),reason:t.reason.trim()||"Attack mode enabled by an operator.",actorId:t.actorId};return this.write({...this.read(),attackMode:e}),e}disableAttackMode(){let t=this.read();if(!t.attackMode?.enabled)return!1;return this.write({...t,attackMode:{...t.attackMode,enabled:!1}}),!0}pauseMitigations(t){let i=t.reason.trim();if(!i)throw Error("Pausing mitigations requires a reason: you are liable for the traffic it admits.");let e=this.now(),o={enabled:!0,startedAt:e.toISOString(),expiresAt:new Date(e.getTime()+h(t.hours,Vt)*3600000).toISOString(),reason:i,actorId:t.actorId};return this.write({...this.read(),mitigationPause:o}),o}resumeMitigations(){let t=this.read();if(!t.mitigationPause?.enabled)return!1;return this.write({...t,mitigationPause:{...t.mitigationPause,enabled:!1}}),!0}addIpRule(t,i){let e=i.trim();if(!to(e))throw Error(`Not a valid IP or CIDR: ${i}`);let o=this.read(),r={...o.ipRules,[t]:[...new Set([...o.ipRules[t],e])]};if(r[t].length>f)throw Error(`At most ${f} ${t} rules are supported.`);let n=t==="allow"?"block":"allow";return r[n]=r[n].filter((s)=>s!==e),this.write({...o,ipRules:r}),r}removeIpRule(t,i){let e=this.read(),o={...e.ipRules,[t]:e.ipRules[t].filter((r)=>r!==i.trim())};return this.write({...e,ipRules:o}),o}}function vi(t){if(t.mitigationPause)return{attackMode:!!t.attackMode,mitigationPaused:!0,summary:`Automatic mitigation is paused until ${t.mitigationPause.expiresAt}. All traffic is being served and billed.`,expiresAt:t.mitigationPause.expiresAt};if(t.attackMode)return{attackMode:!0,mitigationPaused:!1,summary:`Attack mode is on until ${t.attackMode.expiresAt}. Every visitor is being challenged.`,expiresAt:t.attackMode.expiresAt};return{attackMode:!1,mitigationPaused:!1,summary:"Protection is in its normal posture."}}function lu(t,i){if(i.mitigationPause)return t.map((e)=>({...e,enabled:!1}));if(!i.attackMode)return[...t];return t.map((e)=>({...e,action:e.action==="deny"?"deny":"challenge",burst:Math.max(1,Math.min(e.burst??e.limit,5))}))}function cn(t,i){let e=[...new Set([...t.allowlist??[],...i.ipRules.allow])],o=[...new Set([...t.blocklist??[],...i.ipRules.block])];if(i.mitigationPause)return{...t,allowlist:e,blocklist:o,monitorOnly:!0};if(!i.attackMode)return{...t,allowlist:e,blocklist:o};let r=t.thresholds??{};return{...t,allowlist:e,blocklist:o,thresholds:{...r,newConnectionsPerSecond:Math.max(1,Math.floor((r.newConnectionsPerSecond??50)/5)),concurrentPerSource:Math.max(1,Math.floor((r.concurrentPerSource??100)/5))}}}function ko(t,i){let e=t?.infrastructure?.compute;if(!e||e.ddos===!1)return t;let o=typeof e.ddos==="object"&&e.ddos!==null?e.ddos:{};return{...t,infrastructure:{...t.infrastructure,compute:{...e,ddos:cn(o,i)}}}}export{su,El,ta,ra,wl,au,cu,Vt,an,zt,vi,lu,cn,ko};
1
+ import{to}from"./chunk-f35pte64.js";var su="\x00";function El(t,i){if(t==="*"||t==="**")return!0;let e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\x01").replace(/\*/g,"[^/]*").replace(/\u0001/g,".*");return new RegExp(`^${e}$`).test(i)}function g(t,i){if(t.startsWith("*.")){let e=t.slice(1);return i.endsWith(e)&&i.length>e.length}return t===i}function ta(t,i){if(t.enabled===!1)return!1;if(t.methods?.length&&!t.methods.some((e)=>e.toUpperCase()===i.method.toUpperCase()))return!1;if(t.path&&!El(t.path,i.path))return!1;if(t.host&&!g(t.host,i.host??""))return!1;return!0}function ra(t,i){let e=t.key??{source:"ip"},o=e.fallbackToIp!==!1,r;if(e.source==="ip")r=i.ip;else if(e.source==="global")r="global";else if(e.source==="host")r=i.host??"";else if(e.source==="path")r=i.path;else if(e.source==="header")r=e.name?i.headers?.[e.name.toLowerCase()]:void 0;else if(e.source==="cookie")r=e.name?i.cookies?.[e.name]:void 0;if(!r&&e.source!=="global")r=o?i.ip:"__missing__";return`${t.id}\x00${r}`}class wl{clock;maxTrackedKeys;buckets=new Map;windows=new Map;rules;constructor(t,i=()=>Date.now(),e=1e5){this.clock=i;this.maxTrackedKeys=e;this.rules=[...t].sort((o,r)=>(o.priority??0)-(r.priority??0))}check(t){let i=this.clock(),e=this.rules.filter((n)=>ta(n,t)),o;for(let n of e){let s=this.test(n,t,i);if(s.allowed)continue;if(!o||d(s.action)>d(o.action))o=s}if(o)return o;let r={action:"allow",allowed:!0};for(let n of e){let s=this.consume(n,t,i);if(s.remaining!=null&&(r.remaining??1/0)>s.remaining)r=s}return r}test(t,i,e){let o=ra(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let n=t.burst??t.limit,s=this.buckets.get(o),a=s?Math.min(n,s.tokens+this.refill(t,e-s.updatedAt)):n;if(a>=1)return{action:"allow",allowed:!0};return this.blocked(t,o,0,this.msPerToken(t)*(1-a),e)}let r=(this.windows.get(o)?.hits??[]).filter((n)=>n>e-t.windowMs);if(r.length<t.limit)return{action:"allow",allowed:!0};return this.blocked(t,o,0,r[0]+t.windowMs-e,e)}peek(t){let i=this.clock();for(let e of this.rules){if(!ta(e,t))continue;let o=this.test(e,t,i);if(!o.allowed)return o}return{action:"allow",allowed:!0}}msPerToken(t){return t.windowMs/Math.max(1,t.limit)}refill(t,i){return Math.max(0,i)/this.msPerToken(t)}blocked(t,i,e,o,r){let n=t.action??"deny";return{action:n,allowed:n==="allow"||n==="log",ruleId:t.id,limit:t.limit,remaining:e,retryAfterMs:Math.max(0,Math.ceil(o)),resetAt:r+Math.max(0,o),key:i}}consume(t,i,e){let o=ra(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let l=t.burst??t.limit,u=this.buckets.get(o)??{tokens:l,updatedAt:e},c=Math.min(l,u.tokens+this.refill(t,e-u.updatedAt));if(c<1)return this.buckets.set(o,{tokens:c,updatedAt:e}),this.blocked(t,o,0,this.msPerToken(t)*(1-c),e);return this.evictIfNeeded(this.buckets),this.buckets.set(o,{tokens:c-1,updatedAt:e}),{action:"allow",allowed:!0,ruleId:t.id,limit:l,remaining:Math.floor(c-1),resetAt:e+this.msPerToken(t)*(l-(c-1)),key:o}}let n=this.windows.get(o)??{hits:[]},s=e-t.windowMs,a=n.hits.filter((l)=>l>s);if(a.length>=t.limit)return this.windows.set(o,{hits:a}),this.blocked(t,o,0,a[0]+t.windowMs-e,e);return a.push(e),this.evictIfNeeded(this.windows),this.windows.set(o,{hits:a}),{action:"allow",allowed:!0,ruleId:t.id,limit:t.limit,remaining:t.limit-a.length,resetAt:a[0]+t.windowMs,key:o}}evictIfNeeded(t){if(t.size<this.maxTrackedKeys)return;let i=t.size-this.maxTrackedKeys+1,e=0;for(let o of t.keys())if(t.delete(o),++e>=i)break}sweep(){let t=this.clock(),i=0;for(let[e,o]of this.windows){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n){this.windows.delete(e),i++;continue}if(o.hits.every((s)=>s<=t-n.windowMs))this.windows.delete(e),i++}for(let[e,o]of this.buckets){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n||t-o.updatedAt>n.windowMs*2)this.buckets.delete(e),i++}return i}get trackedKeys(){return this.buckets.size+this.windows.size}}function d(t){return{allow:0,log:1,throttle:2,challenge:3,deny:4}[t]}function au(t){let i={};if(t.limit!=null)i["ratelimit-limit"]=String(t.limit);if(t.remaining!=null)i["ratelimit-remaining"]=String(t.remaining);if(t.resetAt!=null)i["ratelimit-reset"]=String(Math.max(0,Math.ceil((t.resetAt-Date.now())/1000)));if(!t.allowed&&t.retryAfterMs!=null)i["retry-after"]=String(Math.max(1,Math.ceil(t.retryAfterMs/1000)));return i}function cu(){return[{id:"global-ip",limit:600,windowMs:60000,burst:100,key:{source:"ip"},action:"deny",priority:100},{id:"api-ip",limit:120,windowMs:60000,burst:30,path:"/api/**",key:{source:"ip"},action:"deny",priority:50},{id:"auth-ip",limit:10,windowMs:60000,algorithm:"sliding_window",path:"/auth/**",methods:["POST"],key:{source:"ip"},action:"challenge",priority:10}]}var m="protection.controls",zt=24,an=4,R={ipRules:{allow:[],block:[]}};function p(t,i){if(!t?.enabled)return;return new Date(t.expiresAt).getTime()>i.getTime()?t:void 0}function h(t,i){let e=Number.isFinite(t)?Number(t):i;return Math.min(zt,Math.max(0.25,e))}var f=500;class qt{controlPlane;options;constructor(t,i={}){this.controlPlane=t;this.options=i}now(){return this.options.now?.()??new Date}read(){let t=this.controlPlane.getSetting(m);if(!t||typeof t!=="object"||Array.isArray(t))return{...R,ipRules:{allow:[],block:[]}};let i=t;return{attackMode:i.attackMode,mitigationPause:i.mitigationPause,ipRules:{allow:Array.isArray(i.ipRules?.allow)?i.ipRules.allow:[],block:Array.isArray(i.ipRules?.block)?i.ipRules.block:[]},updatedAt:i.updatedAt}}write(t){let i={...t,updatedAt:this.now().toISOString()};return this.controlPlane.setSetting(m,i),i}raw(){return this.read()}current(){let t=this.now(),i=this.read();return{attackMode:p(i.attackMode,t),mitigationPause:p(i.mitigationPause,t),ipRules:i.ipRules}}enableAttackMode(t){let i=this.now(),e={enabled:!0,startedAt:i.toISOString(),expiresAt:new Date(i.getTime()+h(t.hours,an)*3600000).toISOString(),reason:t.reason.trim()||"Attack mode enabled by an operator.",actorId:t.actorId};return this.write({...this.read(),attackMode:e}),e}disableAttackMode(){let t=this.read();if(!t.attackMode?.enabled)return!1;return this.write({...t,attackMode:{...t.attackMode,enabled:!1}}),!0}pauseMitigations(t){let i=t.reason.trim();if(!i)throw Error("Pausing mitigations requires a reason: you are liable for the traffic it admits.");let e=this.now(),o={enabled:!0,startedAt:e.toISOString(),expiresAt:new Date(e.getTime()+h(t.hours,zt)*3600000).toISOString(),reason:i,actorId:t.actorId};return this.write({...this.read(),mitigationPause:o}),o}resumeMitigations(){let t=this.read();if(!t.mitigationPause?.enabled)return!1;return this.write({...t,mitigationPause:{...t.mitigationPause,enabled:!1}}),!0}addIpRule(t,i){let e=i.trim();if(!to(e))throw Error(`Not a valid IP or CIDR: ${i}`);let o=this.read(),r={...o.ipRules,[t]:[...new Set([...o.ipRules[t],e])]};if(r[t].length>f)throw Error(`At most ${f} ${t} rules are supported.`);let n=t==="allow"?"block":"allow";return r[n]=r[n].filter((s)=>s!==e),this.write({...o,ipRules:r}),r}removeIpRule(t,i){let e=this.read(),o={...e.ipRules,[t]:e.ipRules[t].filter((r)=>r!==i.trim())};return this.write({...e,ipRules:o}),o}}function vi(t){if(t.mitigationPause)return{attackMode:!!t.attackMode,mitigationPaused:!0,summary:`Automatic mitigation is paused until ${t.mitigationPause.expiresAt}. All traffic is being served and billed.`,expiresAt:t.mitigationPause.expiresAt};if(t.attackMode)return{attackMode:!0,mitigationPaused:!1,summary:`Attack mode is on until ${t.attackMode.expiresAt}. Every visitor is being challenged.`,expiresAt:t.attackMode.expiresAt};return{attackMode:!1,mitigationPaused:!1,summary:"Protection is in its normal posture."}}function lu(t,i){if(i.mitigationPause)return t.map((e)=>({...e,enabled:!1}));if(!i.attackMode)return[...t];return t.map((e)=>({...e,action:e.action==="deny"?"deny":"challenge",burst:Math.max(1,Math.min(e.burst??e.limit,5))}))}function cn(t,i){let e=[...new Set([...t.allowlist??[],...i.ipRules.allow])],o=[...new Set([...t.blocklist??[],...i.ipRules.block])];if(i.mitigationPause)return{...t,allowlist:e,blocklist:o,monitorOnly:!0};if(!i.attackMode)return{...t,allowlist:e,blocklist:o};let r=t.thresholds??{};return{...t,allowlist:e,blocklist:o,thresholds:{...r,newConnectionsPerSecond:Math.max(1,Math.floor((r.newConnectionsPerSecond??50)/5)),concurrentPerSource:Math.max(1,Math.floor((r.concurrentPerSource??100)/5))}}}function Do(t,i){let e=t?.infrastructure?.compute;if(!e||e.ddos===!1)return t;let o=typeof e.ddos==="object"&&e.ddos!==null?e.ddos:{};return{...t,infrastructure:{...t.infrastructure,compute:{...e,ddos:cn(o,i)}}}}export{su,El,ta,ra,wl,au,cu,zt,an,qt,vi,lu,cn,Do};
@@ -0,0 +1 @@
1
+ import{w}from"./chunk-pthfzst7.js";import"./chunk-pdw0qjq1.js";export{w as CloudFrontClient};
@@ -1,4 +1,4 @@
1
- import{u}from"./chunk-bckm6fre.js";import{f}from"./chunk-80zkjpfz.js";import{O}from"./chunk-57w9nsjk.js";import{li}from"./chunk-wge61ccr.js";function h(e,t){let s=[`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,c)=>{if(typeof n==="object"&&n!==null)for(let[m,l]of Object.entries(n))s.push(`${a}.member.${c+1}.${m}=${encodeURIComponent(String(l))}`);else s.push(`${a}.member.${c+1}=${encodeURIComponent(String(n))}`)});else if(typeof i==="object"){for(let[n,c]of Object.entries(i))if(c!==void 0&&c!==null)s.push(`${a}.${n}=${encodeURIComponent(String(c))}`)}else s.push(`${a}=${encodeURIComponent(String(i))}`)}return s.join("&")}function r(e,t){let s=new RegExp(`<${t}>([^<]*)</${t}>`),a=e.match(s);return a?a[1]:void 0}function o(e,t,s){let a=new RegExp(`<${t}>([\\s\\S]*?)</${t}>`),i=e.match(a);if(!i)return[];let n=[],c=new RegExp(`<${s}>([\\s\\S]*?)</${s}>`,"g"),m;while((m=c.exec(i[1]))!==null)n.push(m[1]);return n}class Y{client;region;constructor(e="us-east-1",t){this.client=new u(void 0,{profile:t}),this.region=e}async request(e,t={}){let s=h(e,t);return await this.client.request({service:"iam",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})}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),s=this.parseUsers(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Users:s,IsTruncated:a,Marker:i}}async updateUser(e){await this.request("UpdateUser",e)}async deleteUser(e){await this.request("DeleteUser",e)}parseUser(e){return{UserName:r(e,"UserName")||"",UserId:r(e,"UserId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),CreateDate:r(e,"CreateDate"),PasswordLastUsed:r(e,"PasswordLastUsed")}}parseUsers(e){return o(e,"Users","member").map((s)=>({UserName:r(s,"UserName")||"",UserId:r(s,"UserId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),CreateDate:r(s,"CreateDate"),PasswordLastUsed:r(s,"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),s=this.parseGroup(t),a=this.parseUsers(t),i=r(t,"IsTruncated")==="true",n=r(t,"Marker");return{Group:s,Users:a,IsTruncated:i,Marker:n}}async listGroups(e={}){let t=await this.request("ListGroups",e),s=this.parseGroups(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Groups:s,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),s=this.parseGroups(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Groups:s,IsTruncated:a,Marker:i}}parseGroup(e){return{GroupName:r(e,"GroupName")||"",GroupId:r(e,"GroupId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),CreateDate:r(e,"CreateDate")}}parseGroups(e){return o(e,"Groups","member").map((s)=>({GroupName:r(s,"GroupName")||"",GroupId:r(s,"GroupId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),CreateDate:r(s,"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),s=this.parseRoles(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Roles:s,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),s=this.parseTags(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Tags:s,IsTruncated:a,Marker:i}}parseRole(e){return{RoleName:r(e,"RoleName")||"",RoleId:r(e,"RoleId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),CreateDate:r(e,"CreateDate"),AssumeRolePolicyDocument:r(e,"AssumeRolePolicyDocument"),Description:r(e,"Description"),MaxSessionDuration:r(e,"MaxSessionDuration")?Number.parseInt(r(e,"MaxSessionDuration"),10):void 0}}parseRoles(e){return o(e,"Roles","member").map((s)=>({RoleName:r(s,"RoleName")||"",RoleId:r(s,"RoleId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),CreateDate:r(s,"CreateDate"),AssumeRolePolicyDocument:r(s,"AssumeRolePolicyDocument"),Description:r(s,"Description"),MaxSessionDuration:r(s,"MaxSessionDuration")?Number.parseInt(r(s,"MaxSessionDuration"),10):void 0}))}parseTags(e){return o(e,"Tags","member").map((s)=>({Key:r(s,"Key")||"",Value:r(s,"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:r(t,"VersionId")||"",IsDefaultVersion:r(t,"IsDefaultVersion")==="true",CreateDate:r(t,"CreateDate"),Document:r(t,"Document")}}async listPolicies(e={}){let t=await this.request("ListPolicies",e),s=this.parsePolicies(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Policies:s,IsTruncated:a,Marker:i}}async listPolicyVersions(e){let t=await this.request("ListPolicyVersions",e),s=this.parsePolicyVersions(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Versions:s,IsTruncated:a,Marker:i}}async createPolicyVersion(e){let t=await this.request("CreatePolicyVersion",e);return{VersionId:r(t,"VersionId")||"",IsDefaultVersion:r(t,"IsDefaultVersion")==="true",CreateDate:r(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),s=this.parseAttachedPolicies(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{AttachedPolicies:s,IsTruncated:a,Marker:i}}async listAttachedGroupPolicies(e){let t=await this.request("ListAttachedGroupPolicies",e),s=this.parseAttachedPolicies(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{AttachedPolicies:s,IsTruncated:a,Marker:i}}async listAttachedRolePolicies(e){let t=await this.request("ListAttachedRolePolicies",e),s=this.parseAttachedPolicies(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{AttachedPolicies:s,IsTruncated:a,Marker:i}}parsePolicy(e){return{PolicyName:r(e,"PolicyName")||"",PolicyId:r(e,"PolicyId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),DefaultVersionId:r(e,"DefaultVersionId"),AttachmentCount:r(e,"AttachmentCount")?Number.parseInt(r(e,"AttachmentCount"),10):void 0,PermissionsBoundaryUsageCount:r(e,"PermissionsBoundaryUsageCount")?Number.parseInt(r(e,"PermissionsBoundaryUsageCount"),10):void 0,IsAttachable:r(e,"IsAttachable")==="true",Description:r(e,"Description"),CreateDate:r(e,"CreateDate"),UpdateDate:r(e,"UpdateDate")}}parsePolicies(e){return o(e,"Policies","member").map((s)=>({PolicyName:r(s,"PolicyName")||"",PolicyId:r(s,"PolicyId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),DefaultVersionId:r(s,"DefaultVersionId"),AttachmentCount:r(s,"AttachmentCount")?Number.parseInt(r(s,"AttachmentCount"),10):void 0,PermissionsBoundaryUsageCount:r(s,"PermissionsBoundaryUsageCount")?Number.parseInt(r(s,"PermissionsBoundaryUsageCount"),10):void 0,IsAttachable:r(s,"IsAttachable")==="true",Description:r(s,"Description"),CreateDate:r(s,"CreateDate"),UpdateDate:r(s,"UpdateDate")}))}parsePolicyVersions(e){return o(e,"Versions","member").map((s)=>({VersionId:r(s,"VersionId")||"",IsDefaultVersion:r(s,"IsDefaultVersion")==="true",CreateDate:r(s,"CreateDate")}))}parseAttachedPolicies(e){return o(e,"AttachedPolicies","member").map((s)=>({PolicyName:r(s,"PolicyName")||"",PolicyArn:r(s,"PolicyArn")||""}))}async putUserPolicy(e){await this.request("PutUserPolicy",e)}async getUserPolicy(e){let t=await this.request("GetUserPolicy",e);return{UserName:r(t,"UserName")||"",PolicyName:r(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(r(t,"PolicyDocument")||"")}}async deleteUserPolicy(e){await this.request("DeleteUserPolicy",e)}async listUserPolicies(e){let t=await this.request("ListUserPolicies",e),s=o(t,"PolicyNames","member"),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{PolicyNames:s,IsTruncated:a,Marker:i}}async putGroupPolicy(e){await this.request("PutGroupPolicy",e)}async getGroupPolicy(e){let t=await this.request("GetGroupPolicy",e);return{GroupName:r(t,"GroupName")||"",PolicyName:r(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(r(t,"PolicyDocument")||"")}}async deleteGroupPolicy(e){await this.request("DeleteGroupPolicy",e)}async listGroupPolicies(e){let t=await this.request("ListGroupPolicies",e),s=o(t,"PolicyNames","member"),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{PolicyNames:s,IsTruncated:a,Marker:i}}async putRolePolicy(e){await this.request("PutRolePolicy",e)}async getRolePolicy(e){let t=await this.request("GetRolePolicy",e);return{RoleName:r(t,"RoleName")||"",PolicyName:r(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(r(t,"PolicyDocument")||"")}}async deleteRolePolicy(e){await this.request("DeleteRolePolicy",e)}async listRolePolicies(e){let t=await this.request("ListRolePolicies",e),s=o(t,"PolicyNames","member"),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{PolicyNames:s,IsTruncated:a,Marker:i}}async createAccessKey(e={}){let t=await this.request("CreateAccessKey",e);if(typeof t==="object"){let s=t?.CreateAccessKeyResult?.AccessKey||t?.AccessKey;if(s)return{AccessKey:{UserName:s.UserName||"",AccessKeyId:s.AccessKeyId||"",Status:s.Status||"Active",SecretAccessKey:s.SecretAccessKey||"",CreateDate:s.CreateDate}}}return{AccessKey:{UserName:r(t,"UserName")||"",AccessKeyId:r(t,"AccessKeyId")||"",Status:r(t,"Status")||"Active",SecretAccessKey:r(t,"SecretAccessKey")||"",CreateDate:r(t,"CreateDate")}}}async listAccessKeys(e={}){let t=await this.request("ListAccessKeys",e),s=this.parseAccessKeys(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{AccessKeyMetadata:s,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:r(t,"UserName")||"",AccessKeyLastUsed:{LastUsedDate:r(t,"LastUsedDate"),ServiceName:r(t,"ServiceName"),Region:r(t,"Region")}}}parseAccessKeys(e){return o(e,"AccessKeyMetadata","member").map((s)=>({UserName:r(s,"UserName"),AccessKeyId:r(s,"AccessKeyId")||"",Status:r(s,"Status")||"Active",CreateDate:r(s,"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),s=this.parseInstanceProfiles(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{InstanceProfiles:s,IsTruncated:a,Marker:i}}async listInstanceProfilesForRole(e){let t=await this.request("ListInstanceProfilesForRole",e),s=this.parseInstanceProfiles(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{InstanceProfiles:s,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:r(e,"InstanceProfileName")||"",InstanceProfileId:r(e,"InstanceProfileId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),CreateDate:r(e,"CreateDate")}}parseInstanceProfiles(e){return o(e,"InstanceProfiles","member").map((s)=>({InstanceProfileName:r(s,"InstanceProfileName")||"",InstanceProfileId:r(s,"InstanceProfileId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),CreateDate:r(s,"CreateDate")}))}async getAccountPasswordPolicy(){let e=await this.request("GetAccountPasswordPolicy");return{MinimumPasswordLength:r(e,"MinimumPasswordLength")?Number.parseInt(r(e,"MinimumPasswordLength"),10):void 0,RequireSymbols:r(e,"RequireSymbols")==="true",RequireNumbers:r(e,"RequireNumbers")==="true",RequireUppercaseCharacters:r(e,"RequireUppercaseCharacters")==="true",RequireLowercaseCharacters:r(e,"RequireLowercaseCharacters")==="true",AllowUsersToChangePassword:r(e,"AllowUsersToChangePassword")==="true",ExpirePasswords:r(e,"ExpirePasswords")==="true",MaxPasswordAge:r(e,"MaxPasswordAge")?Number.parseInt(r(e,"MaxPasswordAge"),10):void 0,PasswordReusePrevention:r(e,"PasswordReusePrevention")?Number.parseInt(r(e,"PasswordReusePrevention"),10):void 0,HardExpiry:r(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={},s=o(e,"SummaryMap","entry");for(let a of s){let i=r(a,"key"),n=r(a,"value");if(i&&n)t[i]=Number.parseInt(n,10)}return t}async listAccountAliases(){let e=await this.request("ListAccountAliases"),t=o(e,"AccountAliases","member"),s=r(e,"IsTruncated")==="true",a=r(e,"Marker");return{AccountAliases:t,IsTruncated:s,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 s=o(e,"EvaluationResults","member").map((n)=>{let m=o(n,"MatchedStatements","member").map((l)=>({SourcePolicyId:r(l,"SourcePolicyId"),SourcePolicyType:r(l,"SourcePolicyType")}));return{EvalActionName:r(n,"EvalActionName")||"",EvalResourceName:r(n,"EvalResourceName"),EvalDecision:r(n,"EvalDecision")||"",MatchedStatements:m.length>0?m:void 0}}),a=r(e,"IsTruncated")==="true",i=r(e,"Marker");return{EvaluationResults:s,IsTruncated:a,Marker:i}}}class he{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",s=[];if(e?.PageSize)s.push(`PageSize=${e.PageSize}`);if(e?.NextToken)s.push(`NextToken=${encodeURIComponent(e.NextToken)}`);if(s.length>0)t+=`?${s.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",s=[];if(e?.PageSize)s.push(`PageSize=${e.PageSize}`);if(e?.NextToken)s.push(`NextToken=${encodeURIComponent(e.NextToken)}`);if(s.length>0)t+=`?${s.join("&")}`;return await this.client.request({service:"email",region:this.region,method:"GET",path:t,headers:{"Content-Type":"application/json"}})}async getSendStatistics(){return{SendDataPoints:(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"})).GetSendStatisticsResponse?.GetSendStatisticsResult?.SendDataPoints?.member}}async getSendQuota(){let t=(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"})).GetSendQuotaResponse?.GetSendQuotaResult;return{Max24HourSend:t?.Max24HourSend?Number(t.Max24HourSend):void 0,MaxSendRate:t?.MaxSendRate?Number(t.MaxSendRate):void 0,SentLast24Hours:t?.SentLast24Hours?Number(t.SentLast24Hours):void 0}}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],s=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:s})}async sendTemplatedEmail(e){let t=Array.isArray(e.to)?e.to:[e.to],s=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:s})}async getDkimRecords(e){let t=await this.getEmailIdentity(e);if(!t.DkimAttributes?.Tokens)return[];return t.DkimAttributes.Tokens.map((s)=>({name:`${s}._domainkey.${e}`,type:"CNAME",value:`${s}.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,s=30000){for(let a=0;a<t;a++){if(await this.isDomainVerified(e))return!0;await new Promise((n)=>setTimeout(n,s))}return!1}buildFormBody(e){return Object.entries(e).filter(([,s])=>s!==void 0).map(([s,a])=>`${encodeURIComponent(s)}=${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 s=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=s?.ListReceiptRuleSetsResponse?.ListReceiptRuleSetsResult||s?.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})}),s=t?.DescribeReceiptRuleSetResponse?.DescribeReceiptRuleSetResult||t?.DescribeReceiptRuleSetResult,a=s?.Rules?.member;return{Metadata:s?.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((s,a)=>{t[`Rule.Recipients.member.${a+1}`]=s});e.Rule.Actions.forEach((s,a)=>{let i=a+1;if(s.S3Action){if(t[`Rule.Actions.member.${i}.S3Action.BucketName`]=s.S3Action.BucketName,s.S3Action.ObjectKeyPrefix)t[`Rule.Actions.member.${i}.S3Action.ObjectKeyPrefix`]=s.S3Action.ObjectKeyPrefix;if(s.S3Action.KmsKeyArn)t[`Rule.Actions.member.${i}.S3Action.KmsKeyArn`]=s.S3Action.KmsKeyArn}if(s.LambdaAction)t[`Rule.Actions.member.${i}.LambdaAction.FunctionArn`]=s.LambdaAction.FunctionArn,t[`Rule.Actions.member.${i}.LambdaAction.InvocationType`]=s.LambdaAction.InvocationType||"Event";if(s.SNSAction){if(t[`Rule.Actions.member.${i}.SNSAction.TopicArn`]=s.SNSAction.TopicArn,s.SNSAction.Encoding)t[`Rule.Actions.member.${i}.SNSAction.Encoding`]=s.SNSAction.Encoding}if(s.StopAction){if(t[`Rule.Actions.member.${i}.StopAction.Scope`]=s.StopAction.Scope,s.StopAction.TopicArn)t[`Rule.Actions.member.${i}.StopAction.TopicArn`]=s.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 s=t?.Rules?.member;return{Metadata:t?.Metadata,Rules:Array.isArray(s)?s:s?[s]:[]}}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((s,a)=>{t[`Rule.Recipients.member.${a+1}`]=s});e.Rule.Actions.forEach((s,a)=>{let i=a+1;if(s.S3Action){if(t[`Rule.Actions.member.${i}.S3Action.BucketName`]=s.S3Action.BucketName,s.S3Action.ObjectKeyPrefix)t[`Rule.Actions.member.${i}.S3Action.ObjectKeyPrefix`]=s.S3Action.ObjectKeyPrefix;if(s.S3Action.KmsKeyArn)t[`Rule.Actions.member.${i}.S3Action.KmsKeyArn`]=s.S3Action.KmsKeyArn}if(s.LambdaAction)t[`Rule.Actions.member.${i}.LambdaAction.FunctionArn`]=s.LambdaAction.FunctionArn,t[`Rule.Actions.member.${i}.LambdaAction.InvocationType`]=s.LambdaAction.InvocationType||"Event";if(s.SNSAction){if(t[`Rule.Actions.member.${i}.SNSAction.TopicArn`]=s.SNSAction.TopicArn,s.SNSAction.Encoding)t[`Rule.Actions.member.${i}.SNSAction.Encoding`]=s.SNSAction.Encoding}if(s.StopAction){if(t[`Rule.Actions.member.${i}.StopAction.Scope`]=s.StopAction.Scope,s.StopAction.TopicArn)t[`Rule.Actions.member.${i}.StopAction.TopicArn`]=s.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"),s={Action:"SendRawEmail",Version:"2010-12-01",Source:e.source,"RawMessage.Data":t};e.destinations.forEach((n,c)=>{s[`Destinations.member.${c+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(s)});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 za{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 he(this.region),this.s3=new f(this.region),this.iam=new Y(this.region),this.route53=new O(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 s=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:s,to:a,subject:e.subject,text:e.text,html:e.html,replyTo:e.replyTo})).MessageId||""};let i=this.buildRawEmail(e,s,a);return{messageId:(await this.ses.sendEmail({FromEmailAddress:s,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 s=e.fromName?`${e.fromName} <${t}>`:t;return{messageId:(await this.ses.sendTemplatedEmail({from:s,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 s=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:s,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 s=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=[],s=await this.ses.getDkimRecords(e);for(let a of s)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 s=[{S3Action:{BucketName:e.bucketName,ObjectKeyPrefix:e.prefix||"inbox/"}}];if(e.lambdaArn)s.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:s}})}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:s}});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((s)=>({key:s.Key||"",lastModified:s.LastModified||"",size:s.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:s}=await import("./chunk-c51xp8f7.js"),a=new s,i=(d,p)=>{let y={Action:d,Version:"2010-05-08",...p};return Object.entries(y).map(([P,A])=>`${encodeURIComponent(P)}=${encodeURIComponent(A)}`).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}`}}}]},c=`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:c,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 g=this.deriveSmtpPassword(l.SecretAccessKey);return{username:l.AccessKeyId,password:g,server:`email-smtp.${this.region}.amazonaws.com`,port:587}}deriveSmtpPassword(e){let t=li("node:crypto"),s="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`,s=`${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:s,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`,s=`${e.appName}-inbound-email`,a=`${e.appName}-${e.environment}-email`;try{await this.ses.deleteReceiptRule(t,s)}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,s){let a=`----=_Part_${Date.now()}_${Math.random().toString(36).substring(2)}`,i="";if(i+=`From: ${t}\r
1
+ import{u}from"./chunk-pdw0qjq1.js";import{f}from"./chunk-k3er0h4j.js";import{O}from"./chunk-p197a99s.js";import{li}from"./chunk-wge61ccr.js";function h(e,t){let s=[`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,c)=>{if(typeof n==="object"&&n!==null)for(let[m,l]of Object.entries(n))s.push(`${a}.member.${c+1}.${m}=${encodeURIComponent(String(l))}`);else s.push(`${a}.member.${c+1}=${encodeURIComponent(String(n))}`)});else if(typeof i==="object"){for(let[n,c]of Object.entries(i))if(c!==void 0&&c!==null)s.push(`${a}.${n}=${encodeURIComponent(String(c))}`)}else s.push(`${a}=${encodeURIComponent(String(i))}`)}return s.join("&")}function r(e,t){let s=new RegExp(`<${t}>([^<]*)</${t}>`),a=e.match(s);return a?a[1]:void 0}function o(e,t,s){let a=new RegExp(`<${t}>([\\s\\S]*?)</${t}>`),i=e.match(a);if(!i)return[];let n=[],c=new RegExp(`<${s}>([\\s\\S]*?)</${s}>`,"g"),m;while((m=c.exec(i[1]))!==null)n.push(m[1]);return n}class Y{client;region;constructor(e="us-east-1",t){this.client=new u(void 0,{profile:t}),this.region=e}async request(e,t={}){let s=h(e,t);return await this.client.request({service:"iam",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})}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),s=this.parseUsers(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Users:s,IsTruncated:a,Marker:i}}async updateUser(e){await this.request("UpdateUser",e)}async deleteUser(e){await this.request("DeleteUser",e)}parseUser(e){return{UserName:r(e,"UserName")||"",UserId:r(e,"UserId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),CreateDate:r(e,"CreateDate"),PasswordLastUsed:r(e,"PasswordLastUsed")}}parseUsers(e){return o(e,"Users","member").map((s)=>({UserName:r(s,"UserName")||"",UserId:r(s,"UserId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),CreateDate:r(s,"CreateDate"),PasswordLastUsed:r(s,"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),s=this.parseGroup(t),a=this.parseUsers(t),i=r(t,"IsTruncated")==="true",n=r(t,"Marker");return{Group:s,Users:a,IsTruncated:i,Marker:n}}async listGroups(e={}){let t=await this.request("ListGroups",e),s=this.parseGroups(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Groups:s,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),s=this.parseGroups(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Groups:s,IsTruncated:a,Marker:i}}parseGroup(e){return{GroupName:r(e,"GroupName")||"",GroupId:r(e,"GroupId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),CreateDate:r(e,"CreateDate")}}parseGroups(e){return o(e,"Groups","member").map((s)=>({GroupName:r(s,"GroupName")||"",GroupId:r(s,"GroupId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),CreateDate:r(s,"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),s=this.parseRoles(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Roles:s,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),s=this.parseTags(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Tags:s,IsTruncated:a,Marker:i}}parseRole(e){return{RoleName:r(e,"RoleName")||"",RoleId:r(e,"RoleId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),CreateDate:r(e,"CreateDate"),AssumeRolePolicyDocument:r(e,"AssumeRolePolicyDocument"),Description:r(e,"Description"),MaxSessionDuration:r(e,"MaxSessionDuration")?Number.parseInt(r(e,"MaxSessionDuration"),10):void 0}}parseRoles(e){return o(e,"Roles","member").map((s)=>({RoleName:r(s,"RoleName")||"",RoleId:r(s,"RoleId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),CreateDate:r(s,"CreateDate"),AssumeRolePolicyDocument:r(s,"AssumeRolePolicyDocument"),Description:r(s,"Description"),MaxSessionDuration:r(s,"MaxSessionDuration")?Number.parseInt(r(s,"MaxSessionDuration"),10):void 0}))}parseTags(e){return o(e,"Tags","member").map((s)=>({Key:r(s,"Key")||"",Value:r(s,"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:r(t,"VersionId")||"",IsDefaultVersion:r(t,"IsDefaultVersion")==="true",CreateDate:r(t,"CreateDate"),Document:r(t,"Document")}}async listPolicies(e={}){let t=await this.request("ListPolicies",e),s=this.parsePolicies(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Policies:s,IsTruncated:a,Marker:i}}async listPolicyVersions(e){let t=await this.request("ListPolicyVersions",e),s=this.parsePolicyVersions(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{Versions:s,IsTruncated:a,Marker:i}}async createPolicyVersion(e){let t=await this.request("CreatePolicyVersion",e);return{VersionId:r(t,"VersionId")||"",IsDefaultVersion:r(t,"IsDefaultVersion")==="true",CreateDate:r(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),s=this.parseAttachedPolicies(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{AttachedPolicies:s,IsTruncated:a,Marker:i}}async listAttachedGroupPolicies(e){let t=await this.request("ListAttachedGroupPolicies",e),s=this.parseAttachedPolicies(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{AttachedPolicies:s,IsTruncated:a,Marker:i}}async listAttachedRolePolicies(e){let t=await this.request("ListAttachedRolePolicies",e),s=this.parseAttachedPolicies(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{AttachedPolicies:s,IsTruncated:a,Marker:i}}parsePolicy(e){return{PolicyName:r(e,"PolicyName")||"",PolicyId:r(e,"PolicyId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),DefaultVersionId:r(e,"DefaultVersionId"),AttachmentCount:r(e,"AttachmentCount")?Number.parseInt(r(e,"AttachmentCount"),10):void 0,PermissionsBoundaryUsageCount:r(e,"PermissionsBoundaryUsageCount")?Number.parseInt(r(e,"PermissionsBoundaryUsageCount"),10):void 0,IsAttachable:r(e,"IsAttachable")==="true",Description:r(e,"Description"),CreateDate:r(e,"CreateDate"),UpdateDate:r(e,"UpdateDate")}}parsePolicies(e){return o(e,"Policies","member").map((s)=>({PolicyName:r(s,"PolicyName")||"",PolicyId:r(s,"PolicyId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),DefaultVersionId:r(s,"DefaultVersionId"),AttachmentCount:r(s,"AttachmentCount")?Number.parseInt(r(s,"AttachmentCount"),10):void 0,PermissionsBoundaryUsageCount:r(s,"PermissionsBoundaryUsageCount")?Number.parseInt(r(s,"PermissionsBoundaryUsageCount"),10):void 0,IsAttachable:r(s,"IsAttachable")==="true",Description:r(s,"Description"),CreateDate:r(s,"CreateDate"),UpdateDate:r(s,"UpdateDate")}))}parsePolicyVersions(e){return o(e,"Versions","member").map((s)=>({VersionId:r(s,"VersionId")||"",IsDefaultVersion:r(s,"IsDefaultVersion")==="true",CreateDate:r(s,"CreateDate")}))}parseAttachedPolicies(e){return o(e,"AttachedPolicies","member").map((s)=>({PolicyName:r(s,"PolicyName")||"",PolicyArn:r(s,"PolicyArn")||""}))}async putUserPolicy(e){await this.request("PutUserPolicy",e)}async getUserPolicy(e){let t=await this.request("GetUserPolicy",e);return{UserName:r(t,"UserName")||"",PolicyName:r(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(r(t,"PolicyDocument")||"")}}async deleteUserPolicy(e){await this.request("DeleteUserPolicy",e)}async listUserPolicies(e){let t=await this.request("ListUserPolicies",e),s=o(t,"PolicyNames","member"),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{PolicyNames:s,IsTruncated:a,Marker:i}}async putGroupPolicy(e){await this.request("PutGroupPolicy",e)}async getGroupPolicy(e){let t=await this.request("GetGroupPolicy",e);return{GroupName:r(t,"GroupName")||"",PolicyName:r(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(r(t,"PolicyDocument")||"")}}async deleteGroupPolicy(e){await this.request("DeleteGroupPolicy",e)}async listGroupPolicies(e){let t=await this.request("ListGroupPolicies",e),s=o(t,"PolicyNames","member"),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{PolicyNames:s,IsTruncated:a,Marker:i}}async putRolePolicy(e){await this.request("PutRolePolicy",e)}async getRolePolicy(e){let t=await this.request("GetRolePolicy",e);return{RoleName:r(t,"RoleName")||"",PolicyName:r(t,"PolicyName")||"",PolicyDocument:decodeURIComponent(r(t,"PolicyDocument")||"")}}async deleteRolePolicy(e){await this.request("DeleteRolePolicy",e)}async listRolePolicies(e){let t=await this.request("ListRolePolicies",e),s=o(t,"PolicyNames","member"),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{PolicyNames:s,IsTruncated:a,Marker:i}}async createAccessKey(e={}){let t=await this.request("CreateAccessKey",e);if(typeof t==="object"){let s=t?.CreateAccessKeyResult?.AccessKey||t?.AccessKey;if(s)return{AccessKey:{UserName:s.UserName||"",AccessKeyId:s.AccessKeyId||"",Status:s.Status||"Active",SecretAccessKey:s.SecretAccessKey||"",CreateDate:s.CreateDate}}}return{AccessKey:{UserName:r(t,"UserName")||"",AccessKeyId:r(t,"AccessKeyId")||"",Status:r(t,"Status")||"Active",SecretAccessKey:r(t,"SecretAccessKey")||"",CreateDate:r(t,"CreateDate")}}}async listAccessKeys(e={}){let t=await this.request("ListAccessKeys",e),s=this.parseAccessKeys(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{AccessKeyMetadata:s,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:r(t,"UserName")||"",AccessKeyLastUsed:{LastUsedDate:r(t,"LastUsedDate"),ServiceName:r(t,"ServiceName"),Region:r(t,"Region")}}}parseAccessKeys(e){return o(e,"AccessKeyMetadata","member").map((s)=>({UserName:r(s,"UserName"),AccessKeyId:r(s,"AccessKeyId")||"",Status:r(s,"Status")||"Active",CreateDate:r(s,"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),s=this.parseInstanceProfiles(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{InstanceProfiles:s,IsTruncated:a,Marker:i}}async listInstanceProfilesForRole(e){let t=await this.request("ListInstanceProfilesForRole",e),s=this.parseInstanceProfiles(t),a=r(t,"IsTruncated")==="true",i=r(t,"Marker");return{InstanceProfiles:s,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:r(e,"InstanceProfileName")||"",InstanceProfileId:r(e,"InstanceProfileId")||"",Arn:r(e,"Arn")||"",Path:r(e,"Path"),CreateDate:r(e,"CreateDate")}}parseInstanceProfiles(e){return o(e,"InstanceProfiles","member").map((s)=>({InstanceProfileName:r(s,"InstanceProfileName")||"",InstanceProfileId:r(s,"InstanceProfileId")||"",Arn:r(s,"Arn")||"",Path:r(s,"Path"),CreateDate:r(s,"CreateDate")}))}async getAccountPasswordPolicy(){let e=await this.request("GetAccountPasswordPolicy");return{MinimumPasswordLength:r(e,"MinimumPasswordLength")?Number.parseInt(r(e,"MinimumPasswordLength"),10):void 0,RequireSymbols:r(e,"RequireSymbols")==="true",RequireNumbers:r(e,"RequireNumbers")==="true",RequireUppercaseCharacters:r(e,"RequireUppercaseCharacters")==="true",RequireLowercaseCharacters:r(e,"RequireLowercaseCharacters")==="true",AllowUsersToChangePassword:r(e,"AllowUsersToChangePassword")==="true",ExpirePasswords:r(e,"ExpirePasswords")==="true",MaxPasswordAge:r(e,"MaxPasswordAge")?Number.parseInt(r(e,"MaxPasswordAge"),10):void 0,PasswordReusePrevention:r(e,"PasswordReusePrevention")?Number.parseInt(r(e,"PasswordReusePrevention"),10):void 0,HardExpiry:r(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={},s=o(e,"SummaryMap","entry");for(let a of s){let i=r(a,"key"),n=r(a,"value");if(i&&n)t[i]=Number.parseInt(n,10)}return t}async listAccountAliases(){let e=await this.request("ListAccountAliases"),t=o(e,"AccountAliases","member"),s=r(e,"IsTruncated")==="true",a=r(e,"Marker");return{AccountAliases:t,IsTruncated:s,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 s=o(e,"EvaluationResults","member").map((n)=>{let m=o(n,"MatchedStatements","member").map((l)=>({SourcePolicyId:r(l,"SourcePolicyId"),SourcePolicyType:r(l,"SourcePolicyType")}));return{EvalActionName:r(n,"EvalActionName")||"",EvalResourceName:r(n,"EvalResourceName"),EvalDecision:r(n,"EvalDecision")||"",MatchedStatements:m.length>0?m:void 0}}),a=r(e,"IsTruncated")==="true",i=r(e,"Marker");return{EvaluationResults:s,IsTruncated:a,Marker:i}}}class he{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",s=[];if(e?.PageSize)s.push(`PageSize=${e.PageSize}`);if(e?.NextToken)s.push(`NextToken=${encodeURIComponent(e.NextToken)}`);if(s.length>0)t+=`?${s.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",s=[];if(e?.PageSize)s.push(`PageSize=${e.PageSize}`);if(e?.NextToken)s.push(`NextToken=${encodeURIComponent(e.NextToken)}`);if(s.length>0)t+=`?${s.join("&")}`;return await this.client.request({service:"email",region:this.region,method:"GET",path:t,headers:{"Content-Type":"application/json"}})}async getSendStatistics(){return{SendDataPoints:(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"})).GetSendStatisticsResponse?.GetSendStatisticsResult?.SendDataPoints?.member}}async getSendQuota(){let t=(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"})).GetSendQuotaResponse?.GetSendQuotaResult;return{Max24HourSend:t?.Max24HourSend?Number(t.Max24HourSend):void 0,MaxSendRate:t?.MaxSendRate?Number(t.MaxSendRate):void 0,SentLast24Hours:t?.SentLast24Hours?Number(t.SentLast24Hours):void 0}}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],s=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:s})}async sendTemplatedEmail(e){let t=Array.isArray(e.to)?e.to:[e.to],s=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:s})}async getDkimRecords(e){let t=await this.getEmailIdentity(e);if(!t.DkimAttributes?.Tokens)return[];return t.DkimAttributes.Tokens.map((s)=>({name:`${s}._domainkey.${e}`,type:"CNAME",value:`${s}.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,s=30000){for(let a=0;a<t;a++){if(await this.isDomainVerified(e))return!0;await new Promise((n)=>setTimeout(n,s))}return!1}buildFormBody(e){return Object.entries(e).filter(([,s])=>s!==void 0).map(([s,a])=>`${encodeURIComponent(s)}=${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 s=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=s?.ListReceiptRuleSetsResponse?.ListReceiptRuleSetsResult||s?.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})}),s=t?.DescribeReceiptRuleSetResponse?.DescribeReceiptRuleSetResult||t?.DescribeReceiptRuleSetResult,a=s?.Rules?.member;return{Metadata:s?.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((s,a)=>{t[`Rule.Recipients.member.${a+1}`]=s});e.Rule.Actions.forEach((s,a)=>{let i=a+1;if(s.S3Action){if(t[`Rule.Actions.member.${i}.S3Action.BucketName`]=s.S3Action.BucketName,s.S3Action.ObjectKeyPrefix)t[`Rule.Actions.member.${i}.S3Action.ObjectKeyPrefix`]=s.S3Action.ObjectKeyPrefix;if(s.S3Action.KmsKeyArn)t[`Rule.Actions.member.${i}.S3Action.KmsKeyArn`]=s.S3Action.KmsKeyArn}if(s.LambdaAction)t[`Rule.Actions.member.${i}.LambdaAction.FunctionArn`]=s.LambdaAction.FunctionArn,t[`Rule.Actions.member.${i}.LambdaAction.InvocationType`]=s.LambdaAction.InvocationType||"Event";if(s.SNSAction){if(t[`Rule.Actions.member.${i}.SNSAction.TopicArn`]=s.SNSAction.TopicArn,s.SNSAction.Encoding)t[`Rule.Actions.member.${i}.SNSAction.Encoding`]=s.SNSAction.Encoding}if(s.StopAction){if(t[`Rule.Actions.member.${i}.StopAction.Scope`]=s.StopAction.Scope,s.StopAction.TopicArn)t[`Rule.Actions.member.${i}.StopAction.TopicArn`]=s.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 s=t?.Rules?.member;return{Metadata:t?.Metadata,Rules:Array.isArray(s)?s:s?[s]:[]}}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((s,a)=>{t[`Rule.Recipients.member.${a+1}`]=s});e.Rule.Actions.forEach((s,a)=>{let i=a+1;if(s.S3Action){if(t[`Rule.Actions.member.${i}.S3Action.BucketName`]=s.S3Action.BucketName,s.S3Action.ObjectKeyPrefix)t[`Rule.Actions.member.${i}.S3Action.ObjectKeyPrefix`]=s.S3Action.ObjectKeyPrefix;if(s.S3Action.KmsKeyArn)t[`Rule.Actions.member.${i}.S3Action.KmsKeyArn`]=s.S3Action.KmsKeyArn}if(s.LambdaAction)t[`Rule.Actions.member.${i}.LambdaAction.FunctionArn`]=s.LambdaAction.FunctionArn,t[`Rule.Actions.member.${i}.LambdaAction.InvocationType`]=s.LambdaAction.InvocationType||"Event";if(s.SNSAction){if(t[`Rule.Actions.member.${i}.SNSAction.TopicArn`]=s.SNSAction.TopicArn,s.SNSAction.Encoding)t[`Rule.Actions.member.${i}.SNSAction.Encoding`]=s.SNSAction.Encoding}if(s.StopAction){if(t[`Rule.Actions.member.${i}.StopAction.Scope`]=s.StopAction.Scope,s.StopAction.TopicArn)t[`Rule.Actions.member.${i}.StopAction.TopicArn`]=s.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"),s={Action:"SendRawEmail",Version:"2010-12-01",Source:e.source,"RawMessage.Data":t};e.destinations.forEach((n,c)=>{s[`Destinations.member.${c+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(s)});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 za{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 he(this.region),this.s3=new f(this.region),this.iam=new Y(this.region),this.route53=new O(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 s=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:s,to:a,subject:e.subject,text:e.text,html:e.html,replyTo:e.replyTo})).MessageId||""};let i=this.buildRawEmail(e,s,a);return{messageId:(await this.ses.sendEmail({FromEmailAddress:s,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 s=e.fromName?`${e.fromName} <${t}>`:t;return{messageId:(await this.ses.sendTemplatedEmail({from:s,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 s=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:s,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 s=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=[],s=await this.ses.getDkimRecords(e);for(let a of s)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 s=[{S3Action:{BucketName:e.bucketName,ObjectKeyPrefix:e.prefix||"inbox/"}}];if(e.lambdaArn)s.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:s}})}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:s}});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((s)=>({key:s.Key||"",lastModified:s.LastModified||"",size:s.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:s}=await import("./chunk-zs8bfer0.js"),a=new s,i=(d,p)=>{let y={Action:d,Version:"2010-05-08",...p};return Object.entries(y).map(([P,A])=>`${encodeURIComponent(P)}=${encodeURIComponent(A)}`).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}`}}}]},c=`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:c,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 g=this.deriveSmtpPassword(l.SecretAccessKey);return{username:l.AccessKeyId,password:g,server:`email-smtp.${this.region}.amazonaws.com`,port:587}}deriveSmtpPassword(e){let t=li("node:crypto"),s="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`,s=`${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:s,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`,s=`${e.appName}-inbound-email`,a=`${e.appName}-${e.environment}-email`;try{await this.ses.deleteReceiptRule(t,s)}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,s){let a=`----=_Part_${Date.now()}_${Math.random().toString(36).substring(2)}`,i="";if(i+=`From: ${t}\r
2
2
  `,i+=`To: ${s.join(", ")}\r
3
3
  `,e.cc){let n=Array.isArray(e.cc)?e.cc:[e.cc];i+=`Cc: ${n.join(", ")}\r
4
4
  `}if(i+=`Subject: ${e.subject}\r
@@ -1 +1 @@
1
- import{pu,Br,Ri,re,mu,ua,Pl,Lo,gu,fu,hu,pa,Pi,Mo,ma,Fr,rr,yu,Wn,Su,ga,Nl,kl,Uo,fa,ha,nr,Ni,ir,ya,Bo,Gn,Dl,ki,Sa,ba,Di,xl,va,Ta,Ea,wa,Fo,_l,$l,bu,Ol,Ca,xi,Ll,Ml,jo,kt,Vo,zo,qo,Aa,Ul,Ia,Ho,vu,at,Tu,Ra,Dt,Pa,Eu,Na,Bl,wu,J,Fl,Wo,Cu,_i,Kn,Jn,Go,jl,Vl,Au,Ko,Jo}from"./chunk-swete552.js";import"./chunk-gd4w6bht.js";import"./chunk-8tbj9h2a.js";export{jo as AnomalyConfigStore,jl as AwsSpendTransport,Vl as ComputeSpendTransport,Uo as CounterTracker,ga as DEFAULT_METER_MAPPINGS,pa as DEFAULT_PRICE_BOOK,Ni as DEFAULT_THRESHOLDS,kt as DETECTABLE_SIGNALS,Ri as ENFORCEMENT_ACTIONS,Di as ENFORCEMENT_DESCRIPTIONS,re as ENFORCEMENT_SEVERITY,Ul as FOCUS_VERSION,Br as METERS,pu as METER_KEYS,mu as MICRO_CENTS,Dl as MIN_PROJECTION_CONFIDENCE,Bl as RecordingSpendTransport,Ll as SENSITIVITY_THRESHOLDS,Jn as SPEND_CYCLE_SECONDS,Ra as SPEND_GATE_SETTING,Cu as SPEND_LEASE_SETTING,zo as SignalSource,Pa as SpendCapError,Dt as SpendGate,_i as SpendLoopLease,Wo as SpendNotificationRouter,Kn as SpendRunner,at as SpendService,ir as SpendStore,wu as URGENT_SPEND_EVENTS,xl as USER_VISIBLE_ACTIONS,ha as aggregateDeltas,xi as anomalyOptionsForSignal,Eu as assertSpendAllows,rr as budgetWindow,Au as compositeSpendTransport,Na as createEnforcementHandlers,Ol as detectAnomalies,Ca as detectLatestAnomaly,Sa as evaluateBudget,bu as ewma,Nl as findMapping,Pl as findPriceEntry,J as formatCents,Gn as formatTimeToExhaustion,ki as governingLimitCents,Ko as handleSpendRequest,Wn as hourBucket,Su as hourBucketsBetween,wa as isOperationAllowed,Pi as isValidTimeZone,Aa as lookbackHoursForSignal,Fo as median,_l as medianAbsoluteDeviation,ba as mergeDecisions,hu as mergePriceBooks,fa as meterTelemetry,qo as optionsForSignal,Bo as percentOfLimit,va as planEnforcement,yu as previousBudgetWindow,Lo as priceUsage,gu as priceUsageLines,ya as projectSpend,$l as robustZScore,fu as roundCents,Ml as routeMatches,Ta as runEnforcement,nr as scopeKey,Vo as signalDefinition,Fl as spendNotificationText,Jo as spendOpenApiPaths,Go as startSpendLoop,vu as streamFocusJsonl,Ea as strongestActiveAction,ua as tieredMicroCents,Ho as toFocusJsonl,Ia as toFocusRecords,kl as usageDeltaKey,Fr as utcInstantOfLocal,Tu as zeroFill,ma as zoneOffsetMs,Mo as zonedParts};
1
+ import{pu,Br,Ri,re,mu,ua,Pl,Lo,gu,fu,hu,pa,Pi,Mo,ma,Fr,nr,yu,Wn,Su,ga,Nl,Dl,Uo,fa,ha,ir,Ni,or,ya,Bo,Gn,kl,Di,Sa,ba,ki,xl,va,Ta,Ea,wa,Fo,_l,$l,bu,Ol,Ca,xi,Ll,Ml,jo,Dt,Vo,zo,qo,Aa,Ul,Ia,Ho,vu,lt,Tu,Ra,kt,Pa,Eu,Na,Bl,wu,J,Fl,Wo,Cu,_i,Kn,Jn,Go,jl,Vl,Au,Ko,Jo}from"./chunk-dk38j1qr.js";import"./chunk-8bbw6qc2.js";import"./chunk-gxwsq3k0.js";export{jo as AnomalyConfigStore,jl as AwsSpendTransport,Vl as ComputeSpendTransport,Uo as CounterTracker,ga as DEFAULT_METER_MAPPINGS,pa as DEFAULT_PRICE_BOOK,Ni as DEFAULT_THRESHOLDS,Dt as DETECTABLE_SIGNALS,Ri as ENFORCEMENT_ACTIONS,ki as ENFORCEMENT_DESCRIPTIONS,re as ENFORCEMENT_SEVERITY,Ul as FOCUS_VERSION,Br as METERS,pu as METER_KEYS,mu as MICRO_CENTS,kl as MIN_PROJECTION_CONFIDENCE,Bl as RecordingSpendTransport,Ll as SENSITIVITY_THRESHOLDS,Jn as SPEND_CYCLE_SECONDS,Ra as SPEND_GATE_SETTING,Cu as SPEND_LEASE_SETTING,zo as SignalSource,Pa as SpendCapError,kt as SpendGate,_i as SpendLoopLease,Wo as SpendNotificationRouter,Kn as SpendRunner,lt as SpendService,or as SpendStore,wu as URGENT_SPEND_EVENTS,xl as USER_VISIBLE_ACTIONS,ha as aggregateDeltas,xi as anomalyOptionsForSignal,Eu as assertSpendAllows,nr as budgetWindow,Au as compositeSpendTransport,Na as createEnforcementHandlers,Ol as detectAnomalies,Ca as detectLatestAnomaly,Sa as evaluateBudget,bu as ewma,Nl as findMapping,Pl as findPriceEntry,J as formatCents,Gn as formatTimeToExhaustion,Di as governingLimitCents,Ko as handleSpendRequest,Wn as hourBucket,Su as hourBucketsBetween,wa as isOperationAllowed,Pi as isValidTimeZone,Aa as lookbackHoursForSignal,Fo as median,_l as medianAbsoluteDeviation,ba as mergeDecisions,hu as mergePriceBooks,fa as meterTelemetry,qo as optionsForSignal,Bo as percentOfLimit,va as planEnforcement,yu as previousBudgetWindow,Lo as priceUsage,gu as priceUsageLines,ya as projectSpend,$l as robustZScore,fu as roundCents,Ml as routeMatches,Ta as runEnforcement,ir as scopeKey,Vo as signalDefinition,Fl as spendNotificationText,Jo as spendOpenApiPaths,Go as startSpendLoop,vu as streamFocusJsonl,Ea as strongestActiveAction,ua as tieredMicroCents,Ho as toFocusJsonl,Ia as toFocusRecords,Dl as usageDeltaKey,Fr as utcInstantOfLocal,Tu as zeroFill,ma as zoneOffsetMs,Mo as zonedParts};
@@ -0,0 +1 @@
1
+ import{Lu}from"./chunk-vwzgtsn9.js";import"./chunk-7jwxgxxf.js";import"./chunk-n56c0j1e.js";import"./chunk-pdw0qjq1.js";import"./chunk-gxwsq3k0.js";export{Lu as buildAndPushServerlessImage};
@@ -1 +1 @@
1
- import{Jl,La,Xl,no,io,oo,ms}from"./chunk-n7eq4t9a.js";import"./chunk-8tbj9h2a.js";export{Jl as MANAGEMENT_DASHBOARD_SITE,ms as buildManagementDashboardArtifact,La as dashboardCredentialsFile,io as ensureManagementDashboard,oo as managementDashboardSiteNames,Xl as resolveDashboardAuth,no as resolveUiSource};
1
+ import{Jl,La,Xl,no,io,oo,ms}from"./chunk-fbycbnvj.js";import"./chunk-gxwsq3k0.js";export{Jl as MANAGEMENT_DASHBOARD_SITE,ms as buildManagementDashboardArtifact,La as dashboardCredentialsFile,io as ensureManagementDashboard,oo as managementDashboardSiteNames,Xl as resolveDashboardAuth,no as resolveUiSource};
@@ -1,4 +1,4 @@
1
- import{U}from"./chunk-8tbj9h2a.js";function g(t){let e=t.sites||{};for(let r of Object.values(e))if(r?.repository?.url)return{provider:r.repository.provider,branch:r.repository.branch};return}function m(t){let e=t.trim().toLowerCase();if(e.includes("github.com"))return"github";if(e.includes("gitlab.com"))return"gitlab";if(e.includes("bitbucket.org"))return"bitbucket";return}function a(t){return`'${t.replace(/'/g,"'\\''")}'`}function E(t){return t.replace(/'/g,"''")}function _(t,e){let r=["bunx --bun @stacksjs/ts-cloud deploy","--env",a(t)];if(e.site)r.push("--site",a(e.site));if(e.skipDnsVerification)r.push("--skip-dns-verification");return r.push("--yes"),r.join(" ")}function v(t,e="production",r={}){let l=g(t),n=r.provider||l?.provider;if(n!=="github"&&n!=="gitlab"&&n!=="bitbucket")return null;let i=t.environments?.[e],s=i?.deployBranch||l?.branch||"main",u=_(e,r),c=JSON.stringify(s),d=JSON.stringify(e),p=i?.domain?i.domain.startsWith("http")?i.domain:`https://${i.domain}`:void 0,f=p?`
1
+ import{U}from"./chunk-gxwsq3k0.js";function g(t){let e=t.sites||{};for(let r of Object.values(e))if(r?.repository?.url)return{provider:r.repository.provider,branch:r.repository.branch};return}function m(t){let e=t.trim().toLowerCase();if(e.includes("github.com"))return"github";if(e.includes("gitlab.com"))return"gitlab";if(e.includes("bitbucket.org"))return"bitbucket";return}function a(t){return`'${t.replace(/'/g,"'\\''")}'`}function E(t){return t.replace(/'/g,"''")}function _(t,e){let r=["bunx --bun @stacksjs/ts-cloud deploy","--env",a(t)];if(e.site)r.push("--site",a(e.site));if(e.skipDnsVerification)r.push("--skip-dns-verification");return r.push("--yes"),r.join(" ")}function v(t,e="production",r={}){let l=g(t),n=r.provider||l?.provider;if(n!=="github"&&n!=="gitlab"&&n!=="bitbucket")return null;let i=t.environments?.[e],s=i?.deployBranch||l?.branch||"main",u=_(e,r),c=JSON.stringify(s),d=JSON.stringify(e),p=i?.domain?i.domain.startsWith("http")?i.domain:`https://${i.domain}`:void 0,f=p?`
2
2
  url: ${JSON.stringify(p)}`:"",h=r.setup==="pantry"?` - name: Setup Pantry
3
3
  uses: home-lang/pantry/packages/action@main`:` - uses: oven-sh/setup-bun@v2
4
4
  - run: bun install --frozen-lockfile`,y=U(t)==="hetzner"&&!!t.infrastructure?.compute,o=r.sshPrivateKeySecret||"SSH_PRIVATE_KEY";if(!/^[A-Z_][A-Z0-9_]*$/i.test(o))throw Error(`Invalid SSH private key secret name '${o}'`);let b=y?`