@stacksjs/ts-cloud 0.12.12 → 0.12.13

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 (233) hide show
  1. package/dist/aws/index.js +1 -1
  2. package/dist/bin/chunk-0vsxpmfj.js +3 -0
  3. package/dist/bin/chunk-12e9v1dw.js +3 -0
  4. package/dist/bin/chunk-13dhcjjb.js +60 -0
  5. package/dist/bin/chunk-1fj5gk6r.js +725 -0
  6. package/dist/bin/chunk-1j2sja1j.js +1 -0
  7. package/dist/bin/chunk-1s4dny8d.js +1 -0
  8. package/dist/bin/chunk-2hpnd4g4.js +1 -0
  9. package/dist/bin/chunk-49sthm4q.js +2 -0
  10. package/dist/bin/chunk-4yntpqbe.js +1 -0
  11. package/dist/bin/chunk-4zbnwt9b.js +2 -0
  12. package/dist/bin/chunk-55kmbzr5.js +1 -0
  13. package/dist/{chunk-2ybcnrte.js → bin/chunk-57w9nsjk.js} +3 -3
  14. package/dist/bin/chunk-5gehfky4.js +2 -0
  15. package/dist/bin/chunk-6xw0r4gn.js +7364 -0
  16. package/dist/bin/chunk-6zk2n3wk.js +511 -0
  17. package/dist/bin/{chunk-wcem4cqb.js → chunk-7a7n6p2m.js} +2 -2
  18. package/dist/bin/chunk-7h6h8yxm.js +6 -0
  19. package/dist/bin/chunk-7x0hrna6.js +1 -0
  20. package/dist/bin/{chunk-e2dnxp8d.js → chunk-80zkjpfz.js} +29 -29
  21. package/dist/bin/chunk-84tvv3x1.js +1 -0
  22. package/dist/bin/chunk-94cfdvrn.js +2 -0
  23. package/dist/bin/chunk-96xtj5j6.js +1 -0
  24. package/dist/bin/chunk-9jfjzycs.js +111 -0
  25. package/dist/{chunk-ac87ds1k.js → bin/chunk-bckm6fre.js} +6 -6
  26. package/dist/bin/chunk-bnv8yd9w.js +6 -0
  27. package/dist/bin/chunk-c51xp8f7.js +1 -0
  28. package/dist/bin/chunk-d5qhwtkg.js +9 -0
  29. package/dist/bin/chunk-d7r6mhyv.js +34 -0
  30. package/dist/bin/chunk-de88yqwy.js +1 -0
  31. package/dist/bin/chunk-dh2qmxw9.js +1 -0
  32. package/dist/bin/chunk-dhxwmkhz.js +2 -0
  33. package/dist/bin/chunk-f35pte64.js +44 -0
  34. package/dist/bin/{chunk-jxd3j00s.js → chunk-gj5jkhfr.js} +13 -13
  35. package/dist/bin/chunk-jcyrm5q0.js +2 -0
  36. package/dist/bin/chunk-jh1593zx.js +1 -0
  37. package/dist/bin/chunk-nnkhrm4n.js +8 -0
  38. package/dist/bin/chunk-p36ns96s.js +1 -0
  39. package/dist/bin/{chunk-t5ngva49.js → chunk-p9hd27k4.js} +8 -8
  40. package/dist/bin/chunk-qz3za76g.js +1 -0
  41. package/dist/bin/chunk-r6cvc2pr.js +1 -0
  42. package/dist/bin/chunk-rh2sqtew.js +1 -0
  43. package/dist/bin/chunk-rxwecjgc.js +1 -0
  44. package/dist/bin/chunk-tkzpbb7n.js +1 -0
  45. package/dist/bin/chunk-vx649y7t.js +1 -0
  46. package/dist/bin/chunk-vymg9ywg.js +2 -0
  47. package/dist/bin/chunk-w7k5rvmw.js +1 -0
  48. package/dist/bin/chunk-wge61ccr.js +2 -0
  49. package/dist/bin/chunk-wvhqjr80.js +2 -0
  50. package/dist/bin/chunk-x5x9dzk7.js +3 -0
  51. package/dist/bin/chunk-xaafj6kf.js +1 -0
  52. package/dist/bin/chunk-xgepx8yx.js +1 -0
  53. package/dist/bin/{chunk-t7rcfwqc.js → chunk-yhxpmk29.js} +32 -32
  54. package/dist/bin/chunk-ymbwekjm.js +1 -0
  55. package/dist/bin/chunk-yn34zgr2.js +1 -0
  56. package/dist/bin/chunk-ynr22ma8.js +2 -0
  57. package/dist/bin/chunk-yt8rgkqt.js +2 -0
  58. package/dist/bin/chunk-z2ez8wn9.js +37 -0
  59. package/dist/bin/cli.js +428 -428
  60. package/dist/bin/dashboard-server.js +1 -1
  61. package/dist/chunk-13d54txj.js +44 -0
  62. package/dist/chunk-1kp3y2s7.js +1 -0
  63. package/dist/chunk-1n3ckctd.js +7355 -0
  64. package/dist/chunk-30h9rgfn.js +6 -0
  65. package/dist/chunk-3kapcdpn.js +92 -0
  66. package/dist/chunk-3qp10j0j.js +5 -0
  67. package/dist/chunk-6g81m01r.js +141 -0
  68. package/dist/{chunk-6cxb8d6y.js → chunk-6nvn041c.js} +3 -3
  69. package/dist/chunk-7by4rm7y.js +1 -0
  70. package/dist/chunk-7ww65b66.js +709 -0
  71. package/dist/chunk-9c29rnk3.js +22 -0
  72. package/dist/chunk-9w32efae.js +1 -0
  73. package/dist/chunk-e0919h5g.js +2 -0
  74. package/dist/{chunk-dndxwssj.js → chunk-e7ds04wb.js} +2 -2
  75. package/dist/chunk-edqhhcg9.js +4 -0
  76. package/dist/chunk-ej4sm2tw.js +60 -0
  77. package/dist/chunk-emg3shmb.js +2 -0
  78. package/dist/chunk-fdexq9e1.js +1 -0
  79. package/dist/chunk-g8fpsdyq.js +37 -0
  80. package/dist/chunk-jb8em9ba.js +2 -0
  81. package/dist/chunk-n688m5fp.js +1 -0
  82. package/dist/chunk-r5emv4x8.js +2 -0
  83. package/dist/{chunk-q9a1z53k.js → chunk-sct6mdgc.js} +51 -51
  84. package/dist/chunk-thpce63q.js +34 -0
  85. package/dist/chunk-tnjae324.js +585 -0
  86. package/dist/{bin/chunk-m9r5jype.js → chunk-wjgnfg6q.js} +6 -6
  87. package/dist/chunk-wpqj98h8.js +2 -0
  88. package/dist/chunk-wrnhbb13.js +1 -0
  89. package/dist/chunk-zftpjxkr.js +2 -0
  90. package/dist/chunk-zmyv76f0.js +114 -0
  91. package/dist/deploy/index.js +1 -1
  92. package/dist/dns/index.js +1 -1
  93. package/dist/drivers/index.d.ts +1 -0
  94. package/dist/drivers/index.js +1 -1
  95. package/dist/index.d.ts +1 -1
  96. package/dist/index.js +91 -91
  97. package/dist/operations/index.js +1 -1
  98. package/dist/protection/index.js +1 -1
  99. package/dist/push/index.js +1 -1
  100. package/dist/spend/index.js +1 -1
  101. package/dist/ui/404.html +1 -1
  102. package/dist/ui/accept-invitation.html +1 -1
  103. package/dist/ui/access-denied.html +1 -1
  104. package/dist/ui/account/automation.html +5 -5
  105. package/dist/ui/account/security.html +1 -1
  106. package/dist/ui/applications/compose.html +6 -6
  107. package/dist/ui/applications/new.html +1 -1
  108. package/dist/ui/data/backups.html +6 -6
  109. package/dist/ui/data/services.html +7 -7
  110. package/dist/ui/data/volumes.html +5 -5
  111. package/dist/ui/index.html +6 -6
  112. package/dist/ui/infrastructure/topology.html +9 -9
  113. package/dist/ui/integrations.html +2 -2
  114. package/dist/ui/operations/alerts.html +6 -6
  115. package/dist/ui/operations/configuration.html +5 -5
  116. package/dist/ui/operations/jobs.html +6 -6
  117. package/dist/ui/operations/maintenance.html +5 -5
  118. package/dist/ui/operations/observability.html +6 -6
  119. package/dist/ui/operations/previews.html +6 -6
  120. package/dist/ui/operations/queue.html +6 -6
  121. package/dist/ui/operations/regions.html +5 -5
  122. package/dist/ui/operations/releases.html +6 -6
  123. package/dist/ui/operations/spend.html +6 -6
  124. package/dist/ui/operations/workloads.html +10 -10
  125. package/dist/ui/security.html +2 -2
  126. package/dist/ui/server/actions.html +6 -6
  127. package/dist/ui/server/activity.html +2 -2
  128. package/dist/ui/server/capacity.html +6 -6
  129. package/dist/ui/server/database.html +6 -6
  130. package/dist/ui/server/deployments.html +5 -5
  131. package/dist/ui/server/diagnostics.html +2 -2
  132. package/dist/ui/server/firewall.html +6 -6
  133. package/dist/ui/server/fleet.html +6 -6
  134. package/dist/ui/server/logs.html +5 -5
  135. package/dist/ui/server/metrics.html +5 -5
  136. package/dist/ui/server/security.html +2 -2
  137. package/dist/ui/server/services.html +2 -2
  138. package/dist/ui/server/sites.html +17 -17
  139. package/dist/ui/server/ssh-keys.html +5 -5
  140. package/dist/ui/server/team.html +5 -5
  141. package/dist/ui/server/terminal.html +2 -2
  142. package/dist/ui/serverless/alarms.html +6 -6
  143. package/dist/ui/serverless/assets.html +2 -2
  144. package/dist/ui/serverless/cost.html +2 -2
  145. package/dist/ui/serverless/data.html +6 -6
  146. package/dist/ui/serverless/deployments.html +2 -2
  147. package/dist/ui/serverless/firewall.html +2 -2
  148. package/dist/ui/serverless/functions.html +6 -6
  149. package/dist/ui/serverless/logs.html +6 -6
  150. package/dist/ui/serverless/metrics.html +2 -2
  151. package/dist/ui/serverless/queues.html +6 -6
  152. package/dist/ui/serverless/secrets.html +6 -6
  153. package/dist/ui/serverless/traces.html +6 -6
  154. package/dist/ui/serverless.html +6 -6
  155. package/dist/ui-src/src/charts.ts +1141 -1294
  156. package/dist/ui-src/src/topology.ts +3 -3
  157. package/package.json +3 -3
  158. package/dist/bin/chunk-0b49jjgr.js +0 -2
  159. package/dist/bin/chunk-0xnnkeb1.js +0 -1
  160. package/dist/bin/chunk-227jmf2b.js +0 -2
  161. package/dist/bin/chunk-2nyyg44g.js +0 -1
  162. package/dist/bin/chunk-2ztr119n.js +0 -3
  163. package/dist/bin/chunk-43xj5cny.js +0 -1
  164. package/dist/bin/chunk-5w6y9pmz.js +0 -1
  165. package/dist/bin/chunk-5x4rdx8k.js +0 -37
  166. package/dist/bin/chunk-6zc6a6t3.js +0 -725
  167. package/dist/bin/chunk-7aagqqr9.js +0 -1
  168. package/dist/bin/chunk-85qrgshq.js +0 -44
  169. package/dist/bin/chunk-8zk8msx0.js +0 -2
  170. package/dist/bin/chunk-9j83q0r4.js +0 -1
  171. package/dist/bin/chunk-9nhqbes6.js +0 -60
  172. package/dist/bin/chunk-a4js49mx.js +0 -1
  173. package/dist/bin/chunk-a9e0hvwe.js +0 -6
  174. package/dist/bin/chunk-a9tgxf2h.js +0 -1
  175. package/dist/bin/chunk-aahrv359.js +0 -1
  176. package/dist/bin/chunk-bfx23be3.js +0 -1
  177. package/dist/bin/chunk-bpps61am.js +0 -111
  178. package/dist/bin/chunk-bzth6d1s.js +0 -6
  179. package/dist/bin/chunk-ca3taw2m.js +0 -1
  180. package/dist/bin/chunk-cgzp0328.js +0 -1
  181. package/dist/bin/chunk-d2aaef9v.js +0 -1
  182. package/dist/bin/chunk-e0z2t4mf.js +0 -6
  183. package/dist/bin/chunk-empfsmdk.js +0 -2
  184. package/dist/bin/chunk-er3mww4m.js +0 -1
  185. package/dist/bin/chunk-fmp5bv0j.js +0 -3
  186. package/dist/bin/chunk-g3kp5ddx.js +0 -1
  187. package/dist/bin/chunk-grepda40.js +0 -1
  188. package/dist/bin/chunk-h6xqtypj.js +0 -2
  189. package/dist/bin/chunk-hwk9ahms.js +0 -2
  190. package/dist/bin/chunk-k1xw3zbm.js +0 -34
  191. package/dist/bin/chunk-m07s5esk.js +0 -2
  192. package/dist/bin/chunk-n20kbxwb.js +0 -7364
  193. package/dist/bin/chunk-n2fnav53.js +0 -3
  194. package/dist/bin/chunk-nv211m42.js +0 -8
  195. package/dist/bin/chunk-psgjy3z4.js +0 -1
  196. package/dist/bin/chunk-qmnr82da.js +0 -1
  197. package/dist/bin/chunk-qqpb82ty.js +0 -2
  198. package/dist/bin/chunk-rqc8btkj.js +0 -2
  199. package/dist/bin/chunk-rs85xvt7.js +0 -1
  200. package/dist/bin/chunk-sj5csg49.js +0 -2
  201. package/dist/bin/chunk-tjgy10zm.js +0 -9
  202. package/dist/bin/chunk-v0beqdna.js +0 -1
  203. package/dist/bin/chunk-vf2s3tba.js +0 -1
  204. package/dist/bin/chunk-vzkfjrx2.js +0 -511
  205. package/dist/bin/chunk-wsh5ervz.js +0 -1
  206. package/dist/bin/chunk-xenhbdmr.js +0 -1
  207. package/dist/bin/chunk-xrdpxwbf.js +0 -1
  208. package/dist/bin/chunk-y68m9bx7.js +0 -2
  209. package/dist/chunk-4884der5.js +0 -1
  210. package/dist/chunk-4wdxsnn2.js +0 -44
  211. package/dist/chunk-5hhyyhjt.js +0 -1
  212. package/dist/chunk-5zkacdw1.js +0 -1
  213. package/dist/chunk-6f68caq0.js +0 -1
  214. package/dist/chunk-7z50g5xz.js +0 -4
  215. package/dist/chunk-8fh4m5ge.js +0 -1
  216. package/dist/chunk-97pb7wb1.js +0 -1
  217. package/dist/chunk-ea7tn8nn.js +0 -709
  218. package/dist/chunk-ess6vxfj.js +0 -2
  219. package/dist/chunk-j06r5rwv.js +0 -2
  220. package/dist/chunk-j1g67djb.js +0 -92
  221. package/dist/chunk-k8x8mrkr.js +0 -2
  222. package/dist/chunk-mnmz8t7q.js +0 -34
  223. package/dist/chunk-n1fyryha.js +0 -141
  224. package/dist/chunk-n1hg0jxs.js +0 -2
  225. package/dist/chunk-n5xmh0ma.js +0 -37
  226. package/dist/chunk-q22qfwsc.js +0 -22
  227. package/dist/chunk-r8t25tbm.js +0 -7355
  228. package/dist/chunk-t8hzekmk.js +0 -585
  229. package/dist/chunk-whyttetx.js +0 -5
  230. package/dist/chunk-yf8stygs.js +0 -114
  231. package/dist/chunk-ze5x2bpm.js +0 -2
  232. package/dist/chunk-zh0apedk.js +0 -60
  233. package/dist/chunk-zjyz926j.js +0 -2
@@ -0,0 +1 @@
1
+ import{_o}from"./chunk-94cfdvrn.js";export{_o as encodeDashboardPayload};
@@ -0,0 +1 @@
1
+ import{F}from"./chunk-dhxwmkhz.js";import"./chunk-bckm6fre.js";export{F as SQSClient};
@@ -0,0 +1 @@
1
+ import{hr,qa,Ha,St,yr,Sr,br,vr,Qr}from"./chunk-nnkhrm4n.js";import"./chunk-gj5jkhfr.js";import"./chunk-6xw0r4gn.js";export{yr as AwsSecretsManagerConfigurationBackend,Sr as AwsSsmConfigurationBackend,vr as ConfigurationService,hr as ConfigurationStore,br as ExternalConfigurationBackend,St as LocalEncryptedConfigurationBackend,qa as parseDotenv,Ha as serializeDotenv,Qr as synchronizeConfiguredConfiguration};
@@ -0,0 +1,2 @@
1
+ import{u,N}from"./chunk-bckm6fre.js";class le{client;region;constructor(e="us-east-1"){this.region=e,this.client=new u}async describeDBInstances(e){let r={Action:"DescribeDBInstances",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((a,o)=>{r[`Filters.Filter.${o+1}.Name`]=a.Name,a.Values.forEach((c,d)=>{r[`Filters.Filter.${o+1}.Values.Value.${d+1}`]=c})});let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBInstancesResult||n,s=i.DBInstances?.DBInstance||[];if(!Array.isArray(s))s=s?[s]:[];return{DBInstances:s,Marker:i.Marker}}async describeDBInstance(e){return(await this.describeDBInstances({DBInstanceIdentifier:e})).DBInstances?.[0]}async describeDBClusters(e){let r={Action:"DescribeDBClusters",Version:"2014-10-31"};if(e?.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((a,o)=>{r[`Filters.Filter.${o+1}.Name`]=a.Name,a.Values.forEach((c,d)=>{r[`Filters.Filter.${o+1}.Values.Value.${d+1}`]=c})});let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBClustersResult||n,s=i.DBClusters?.DBCluster||[];if(!Array.isArray(s))s=s?[s]:[];return{DBClusters:s,Marker:i.Marker}}async describeDBSnapshots(e){let r={Action:"DescribeDBSnapshots",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;if(e?.SnapshotType)r.SnapshotType=e.SnapshotType;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBSnapshotsResult||n,s=i.DBSnapshots?.DBSnapshot||[];if(!Array.isArray(s))s=s?[s]:[];return{DBSnapshots:s,Marker:i.Marker}}async describeDBSubnetGroups(e){let r={Action:"DescribeDBSubnetGroups",Version:"2014-10-31"};if(e?.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBSubnetGroupsResult||n,s=i.DBSubnetGroups?.DBSubnetGroup||[];if(!Array.isArray(s))s=s?[s]:[];return{DBSubnetGroups:s,Marker:i.Marker}}async createDBInstance(e){let r={Action:"CreateDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBInstanceClass:e.DBInstanceClass,Engine:e.Engine};if(e.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DBName)r.DBName=e.DBName;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.LicenseModel)r.LicenseModel=e.LicenseModel;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.StorageType)r.StorageType=e.StorageType;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,a)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${a+1}`]=s});if(e.Tags)e.Tags.forEach((s,a)=>{r[`Tags.Tag.${a+1}.Key`]=s.Key,r[`Tags.Tag.${a+1}.Value`]=s.Value});let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.CreateDBInstanceResult||n).DBInstance}}async createDBCluster(e){let r={Action:"CreateDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DatabaseName)r.DatabaseName=e.DatabaseName;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;e.VpcSecurityGroupIds?.forEach((i,s)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${s+1}`]=i});let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(N(r)).toString()});return{DBCluster:(t.CreateDBClusterResult||t).DBCluster}}async deleteDBInstance(e){let r={Action:"DeleteDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.SkipFinalSnapshot!==void 0)r.SkipFinalSnapshot=e.SkipFinalSnapshot;if(e.FinalDBSnapshotIdentifier)r.FinalDBSnapshotIdentifier=e.FinalDBSnapshotIdentifier;if(e.DeleteAutomatedBackups!==void 0)r.DeleteAutomatedBackups=e.DeleteAutomatedBackups;let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.DeleteDBInstanceResult||n).DBInstance}}async modifyDBInstance(e){let r={Action:"ModifyDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,a)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${a+1}`]=s});let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.ModifyDBInstanceResult||n).DBInstance}}async modifyDBCluster(e){let r={Action:"ModifyDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier};if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBCluster:(n.ModifyDBClusterResult||n).DBCluster}}async rebootDBCluster(e){let r={Action:"FailoverDBCluster",Version:"2014-10-31",DBClusterIdentifier:e},t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(N(r)).toString()});return{DBCluster:(t.FailoverDBClusterResult||t).DBCluster}}async createDBClusterSnapshot(e,r){let t={Action:"CreateDBClusterSnapshot",Version:"2014-10-31",DBClusterIdentifier:e,DBClusterSnapshotIdentifier:r};return this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(N(t)).toString()})}async describeDBClusterSnapshots(e={}){let r={Action:"DescribeDBClusterSnapshots",Version:"2014-10-31",...e},t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(N(r)).toString()}),n=t.DescribeDBClusterSnapshotsResult||t,i=n.DBClusterSnapshots?.DBClusterSnapshot??n.DBClusterSnapshots??[];return{DBClusterSnapshots:Array.isArray(i)?i:[i]}}async deleteDBClusterSnapshot(e){await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(N({Action:"DeleteDBClusterSnapshot",Version:"2014-10-31",DBClusterSnapshotIdentifier:e})).toString()})}async deleteDBCluster(e,r){let t={Action:"DeleteDBCluster",Version:"2014-10-31",DBClusterIdentifier:e,SkipFinalSnapshot:!r};if(r)t.FinalDBSnapshotIdentifier=r;let n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(N(t)).toString()});return{DBCluster:(n.DeleteDBClusterResult||n).DBCluster}}async restoreDBClusterToPointInTime(e){let r={Action:"RestoreDBClusterToPointInTime",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SourceDBClusterIdentifier:e.SourceDBClusterIdentifier};if(e.RestoreToTime)r.RestoreToTime=e.RestoreToTime.toISOString();if(e.UseLatestRestorableTime)r.UseLatestRestorableTime=!0;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,a)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${a+1}`]=s});let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBCluster:(n.RestoreDBClusterToPointInTimeResult||n).DBCluster}}async restoreDBClusterFromSnapshot(e){let r={Action:"RestoreDBClusterFromSnapshot",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SnapshotIdentifier:e.SnapshotIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds?.forEach((i,s)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${s+1}`]=i}),e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(N(r)).toString()});return{DBCluster:(t.RestoreDBClusterFromSnapshotResult||t).DBCluster}}async startDBInstance(e){let t=new URLSearchParams(N({Action:"StartDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e})).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.StartDBInstanceResult||n).DBInstance}}async stopDBInstance(e){let r={Action:"StopDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.StopDBInstanceResult||n).DBInstance}}async rebootDBInstance(e){let r={Action:"RebootDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.ForceFailover!==void 0)r.ForceFailover=e.ForceFailover;let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.RebootDBInstanceResult||n).DBInstance}}async createDBSnapshot(e){let r={Action:"CreateDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.Tags)e.Tags.forEach((s,a)=>{r[`Tags.Tag.${a+1}.Key`]=s.Key,r[`Tags.Tag.${a+1}.Value`]=s.Value});let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBSnapshot:(n.CreateDBSnapshotResult||n).DBSnapshot}}async deleteDBSnapshot(e){let t=new URLSearchParams(N({Action:"DeleteDBSnapshot",Version:"2014-10-31",DBSnapshotIdentifier:e})).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBSnapshot:(n.DeleteDBSnapshotResult||n).DBSnapshot}}async restoreDBInstanceFromDBSnapshot(e){let r={Action:"RestoreDBInstanceFromDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.Port)r.Port=e.Port;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,a)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${a+1}`]=s});if(e.Tags)e.Tags.forEach((s,a)=>{r[`Tags.Tag.${a+1}.Key`]=s.Key,r[`Tags.Tag.${a+1}.Value`]=s.Value});let t=new URLSearchParams(N(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.RestoreDBInstanceFromDBSnapshotResult||n).DBInstance}}async waitForDBInstanceAvailable(e,r=60,t=30000){for(let n=0;n<r;n++){let i=await this.describeDBInstance(e);if(i?.DBInstanceStatus==="available")return i;if(["deleted","failed","incompatible-restore","incompatible-parameters"].includes(i?.DBInstanceStatus||""))throw Error(`DB instance ${e} is in terminal state: ${i?.DBInstanceStatus}`);await new Promise((s)=>setTimeout(s,t))}throw Error(`Timeout waiting for DB instance ${e} to become available`)}async waitForDBInstanceDeleted(e,r=60,t=30000){for(let n=0;n<r;n++)try{let i=await this.describeDBInstance(e);if(i?.DBInstanceStatus==="deleting"){await new Promise((s)=>setTimeout(s,t));continue}throw Error(`DB instance ${e} is in state: ${i?.DBInstanceStatus}`)}catch(i){if(i.code==="DBInstanceNotFound"||i.code==="DBInstanceNotFoundFault")return;throw i}throw Error(`Timeout waiting for DB instance ${e} to be deleted`)}}
2
+ export{le};
@@ -0,0 +1 @@
1
+ import{v}from"./chunk-vymg9ywg.js";import"./chunk-bckm6fre.js";export{v as CloudFormationClient};
@@ -0,0 +1,2 @@
1
+ import{u}from"./chunk-bckm6fre.js";import{deflateRawSync as y}from"zlib";function d(n,e){let t=typeof e==="string"?Buffer.from(e,"utf-8"):e,i=y(t),r=f(t),s=new Date,l=(s.getHours()<<11|s.getMinutes()<<5|s.getSeconds()>>1)&65535,c=(s.getFullYear()-1980<<9|s.getMonth()+1<<5|s.getDate())&65535,m=Buffer.from(n,"utf-8"),a=Buffer.alloc(30+m.length);a.writeUInt32LE(67324752,0),a.writeUInt16LE(20,4),a.writeUInt16LE(0,6),a.writeUInt16LE(8,8),a.writeUInt16LE(l,10),a.writeUInt16LE(c,12),a.writeUInt32LE(r,14),a.writeUInt32LE(i.length,18),a.writeUInt32LE(t.length,22),a.writeUInt16LE(m.length,26),a.writeUInt16LE(0,28),m.copy(a,30);let o=Buffer.alloc(46+m.length);o.writeUInt32LE(33639248,0),o.writeUInt16LE(20,4),o.writeUInt16LE(20,6),o.writeUInt16LE(0,8),o.writeUInt16LE(8,10),o.writeUInt16LE(l,12),o.writeUInt16LE(c,14),o.writeUInt32LE(r,16),o.writeUInt32LE(i.length,20),o.writeUInt32LE(t.length,24),o.writeUInt16LE(m.length,28),o.writeUInt16LE(0,30),o.writeUInt16LE(0,32),o.writeUInt16LE(0,34),o.writeUInt16LE(0,36),o.writeUInt32LE(0,38),o.writeUInt32LE(0,42),m.copy(o,46);let p=a.length+i.length,h=o.length,g=Buffer.alloc(22);return g.writeUInt32LE(101010256,0),g.writeUInt16LE(0,4),g.writeUInt16LE(0,6),g.writeUInt16LE(1,8),g.writeUInt16LE(1,10),g.writeUInt32LE(h,12),g.writeUInt32LE(p,16),g.writeUInt16LE(0,20),Buffer.concat([a,i,o,g])}function f(n){let e=[];for(let i=0;i<256;i++){let r=i;for(let s=0;s<8;s++)r=r&1?3988292384^r>>>1:r>>>1;e[i]=r}let t=4294967295;for(let i=0;i<n.length;i++)t=e[(t^n[i])&255]^t>>>8;return(t^4294967295)>>>0}class R{client;region;constructor(n="us-east-1",e){this.region=n,this.client=new u(void 0,{profile:e})}async createFunction(n){return await this.client.request({service:"lambda",region:this.region,method:"POST",path:"/2015-03-31/functions",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async getFunction(n){return await this.client.request({service:"lambda",region:this.region,method:"GET",path:`/2015-03-31/functions/${encodeURIComponent(n)}`,headers:{"Content-Type":"application/json"}})}async updateFunctionCode(n){let{FunctionName:e,...t}=n;return await this.client.request({service:"lambda",region:this.region,method:"PUT",path:`/2015-03-31/functions/${encodeURIComponent(e)}/code`,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async updateFunctionCodeInline(n,e,t="index.js"){let i=d(t,e);return this.updateFunctionCode({FunctionName:n,ZipFile:i.toString("base64")})}async updateFunctionConfiguration(n){let{FunctionName:e,...t}=n;return await this.client.request({service:"lambda",region:this.region,method:"PUT",path:`/2015-03-31/functions/${encodeURIComponent(e)}/configuration`,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async deleteFunction(n){await this.client.request({service:"lambda",region:this.region,method:"DELETE",path:`/2015-03-31/functions/${encodeURIComponent(n)}`,headers:{"Content-Type":"application/json"}})}async invoke(n){let{FunctionName:e,InvocationType:t="RequestResponse",Payload:i,LogType:r}=n,s={"Content-Type":"application/json","X-Amz-Invocation-Type":t};if(r)s["X-Amz-Log-Type"]=r;let l=i?typeof i==="string"?i:JSON.stringify(i):void 0,c=await this.client.request({service:"lambda",region:this.region,method:"POST",path:`/2015-03-31/functions/${encodeURIComponent(e)}/invocations`,headers:s,body:l,returnHeaders:!0});return{StatusCode:c.statusCode||200,FunctionError:c.headers?.["x-amz-function-error"],LogResult:c.headers?.["x-amz-log-result"],Payload:typeof c.body==="string"?c.body:JSON.stringify(c.body),ExecutedVersion:c.headers?.["x-amz-executed-version"]}}async listFunctions(n){let e={};if(n?.MaxItems)e.MaxItems=String(n.MaxItems);if(n?.Marker)e.Marker=n.Marker;if(n?.FunctionVersion)e.FunctionVersion=n.FunctionVersion;return await this.client.request({service:"lambda",region:this.region,method:"GET",path:"/2015-03-31/functions",queryParams:Object.keys(e).length>0?e:void 0,headers:{"Content-Type":"application/json"}})}async addPermission(n){let{FunctionName:e,...t}=n;return await this.client.request({service:"lambda",region:this.region,method:"POST",path:`/2015-03-31/functions/${encodeURIComponent(e)}/policy`,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async removePermission(n,e){await this.client.request({service:"lambda",region:this.region,method:"DELETE",path:`/2015-03-31/functions/${encodeURIComponent(n)}/policy/${encodeURIComponent(e)}`,headers:{"Content-Type":"application/json"}})}async publishVersion(n){let{FunctionName:e,...t}=n;return await this.client.request({service:"lambda",region:this.region,method:"POST",path:`/2015-03-31/functions/${encodeURIComponent(e)}/versions`,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async createAlias(n){let{FunctionName:e,...t}=n;return await this.client.request({service:"lambda",region:this.region,method:"POST",path:`/2015-03-31/functions/${encodeURIComponent(e)}/aliases`,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async updateAlias(n){let{FunctionName:e,Name:t,...i}=n;return this.client.request({service:"lambda",region:this.region,method:"PUT",path:`/2015-03-31/functions/${encodeURIComponent(e)}/aliases/${encodeURIComponent(t)}`,headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}async getAlias(n,e){try{return await this.client.request({service:"lambda",region:this.region,method:"GET",path:`/2015-03-31/functions/${encodeURIComponent(n)}/aliases/${encodeURIComponent(e)}`})}catch(t){if(/ResourceNotFound/i.test(String(t?.message)))return null;throw t}}async getProvisionedConcurrencyConfig(n,e){try{return await this.client.request({service:"lambda",region:this.region,method:"GET",path:`/2019-09-30/functions/${encodeURIComponent(n)}/provisioned-concurrency`,queryParams:{Qualifier:e}})}catch(t){if(/ProvisionedConcurrencyConfigNotFound|ResourceNotFound/i.test(String(t?.message)))return null;throw t}}async putProvisionedConcurrencyConfig(n){let{FunctionName:e,Qualifier:t,ProvisionedConcurrentExecutions:i}=n;return this.client.request({service:"lambda",region:this.region,method:"PUT",path:`/2019-09-30/functions/${encodeURIComponent(e)}/provisioned-concurrency`,queryParams:{Qualifier:t},headers:{"Content-Type":"application/json"},body:JSON.stringify({ProvisionedConcurrentExecutions:i})})}async getFunctionConcurrency(n){try{return(await this.client.request({service:"lambda",region:this.region,method:"GET",path:`/2019-10-31/functions/${encodeURIComponent(n)}/concurrency`}))?.ReservedConcurrentExecutions??null}catch(e){if(/ResourceNotFound|ProvisionedConcurrencyConfigNotFound/i.test(String(e?.message)))return null;throw e}}async putFunctionConcurrency(n,e){await this.client.request({service:"lambda",region:this.region,method:"PUT",path:`/2019-10-31/functions/${encodeURIComponent(n)}/concurrency`,headers:{"Content-Type":"application/json"},body:JSON.stringify({ReservedConcurrentExecutions:e})})}async deleteFunctionConcurrency(n){await this.client.request({service:"lambda",region:this.region,method:"DELETE",path:`/2019-10-31/functions/${encodeURIComponent(n)}/concurrency`})}async deleteProvisionedConcurrencyConfig(n,e){await this.client.request({service:"lambda",region:this.region,method:"DELETE",path:`/2019-09-30/functions/${encodeURIComponent(n)}/provisioned-concurrency`,queryParams:{Qualifier:e}})}async waitForFunctionActive(n,e=60){let t=Date.now(),i=e*1000;while(Date.now()-t<i)try{let r=await this.getFunction(n),s=r.Configuration?.State;if(s==="Active")return r.Configuration;if(s==="Failed")throw Error(`Function ${n} failed: ${r.Configuration?.StateReason}`);await new Promise((l)=>setTimeout(l,2000))}catch(r){if(r.code==="ResourceNotFoundException"){await new Promise((s)=>setTimeout(s,2000));continue}throw r}throw Error(`Timeout waiting for function ${n} to become active`)}async functionExists(n){try{return await this.getFunction(n),!0}catch(e){if(e.code==="ResourceNotFoundException"||e.statusCode===404)return!1;throw e}}async createFunctionUrl(n){let{FunctionName:e,...t}=n;return await this.client.request({service:"lambda",region:this.region,method:"POST",path:`/2021-10-31/functions/${encodeURIComponent(e)}/url`,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async getFunctionUrl(n){try{return await this.client.request({service:"lambda",region:this.region,method:"GET",path:`/2021-10-31/functions/${encodeURIComponent(n)}/url`,headers:{"Content-Type":"application/json"}})}catch(e){if(e.statusCode===404)return null;throw e}}async deleteFunctionUrl(n){await this.client.request({service:"lambda",region:this.region,method:"DELETE",path:`/2021-10-31/functions/${encodeURIComponent(n)}/url`,headers:{"Content-Type":"application/json"}})}async createFunctionWithCode(n){let{Code:e,Filename:t="index.js",...i}=n,r=d(t,e);return this.createFunction({...i,Code:{ZipFile:r.toString("base64")}})}async addFunctionUrlPermission(n){return this.addPermission({FunctionName:n,StatementId:"FunctionURLAllowPublicAccess",Action:"lambda:InvokeFunctionUrl",Principal:"*",FunctionUrlAuthType:"NONE"})}async publishLayerVersion(n){let{LayerName:e,...t}=n;return await this.client.request({service:"lambda",region:this.region,method:"POST",path:`/2018-10-31/layers/${encodeURIComponent(e)}/versions`,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async listLayerVersions(n,e){let t={};if(e?.CompatibleRuntime)t.CompatibleRuntime=e.CompatibleRuntime;if(e?.CompatibleArchitecture)t.CompatibleArchitecture=e.CompatibleArchitecture;if(e?.MaxItems)t.MaxItems=String(e.MaxItems);if(e?.Marker)t.Marker=e.Marker;return await this.client.request({service:"lambda",region:this.region,method:"GET",path:`/2018-10-31/layers/${encodeURIComponent(n)}/versions`,queryParams:Object.keys(t).length>0?t:void 0,headers:{"Content-Type":"application/json"}})}async getLayerVersion(n,e){return await this.client.request({service:"lambda",region:this.region,method:"GET",path:`/2018-10-31/layers/${encodeURIComponent(n)}/versions/${e}`,headers:{"Content-Type":"application/json"}})}async addLayerVersionPermission(n){let{LayerName:e,VersionNumber:t,...i}=n;return await this.client.request({service:"lambda",region:this.region,method:"POST",path:`/2018-10-31/layers/${encodeURIComponent(e)}/versions/${t}/policy`,headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}async deleteLayerVersion(n,e){await this.client.request({service:"lambda",region:this.region,method:"DELETE",path:`/2018-10-31/layers/${encodeURIComponent(n)}/versions/${e}`,headers:{"Content-Type":"application/json"}})}}
2
+ export{R};
@@ -0,0 +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,sn=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,sn)*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 an(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:an(o,i)}}}}export{su,El,ta,ra,wl,au,cu,Vt,sn,zt,vi,lu,an,ko};
@@ -1,4 +1,4 @@
1
- import{tj as a}from"./chunk-ac87ds1k.js";class d{client;region;constructor(e="us-east-1"){this.region=e,this.client=new a}async createHostedZone(e){let t=e.CallerReference||`${Date.now()}-${Math.random().toString(36).slice(2)}`,o=`<?xml version="1.0" encoding="UTF-8"?>
1
+ import{u}from"./chunk-bckm6fre.js";class O{client;region;constructor(e="us-east-1"){this.region=e,this.client=new u}async createHostedZone(e){let t=e.CallerReference||`${Date.now()}-${Math.random().toString(36).slice(2)}`,o=`<?xml version="1.0" encoding="UTF-8"?>
2
2
  <CreateHostedZoneRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
3
3
  <Name>${e.Name}</Name>
4
4
  <CallerReference>${t}</CallerReference>`;if(e.HostedZoneConfig){if(o+=`
@@ -46,5 +46,5 @@ import{tj as a}from"./chunk-ac87ds1k.js";class d{client;region;constructor(e="us
46
46
  </Change>`}o+=`
47
47
  </Changes>
48
48
  </ChangeBatch>
49
- </ChangeResourceRecordSetsRequest>`;let n=await this.client.request({service:"route53",region:this.region,method:"POST",path:`/2013-04-01/hostedzone/${t}/rrset`,headers:{"content-type":"application/xml"},body:o});return this.parseChangeResourceRecordSetsResponse(n)}escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}parseCreateHostedZoneResponse(e){let t=e.CreateHostedZoneResponse||e;return{HostedZone:this.parseHostedZone(t.HostedZone),ChangeInfo:{Id:t.ChangeInfo?.Id||"",Status:t.ChangeInfo?.Status||"",SubmittedAt:t.ChangeInfo?.SubmittedAt||""},DelegationSet:this.parseDelegationSet(t.DelegationSet),Location:t.Location||""}}parseListHostedZonesResponse(e){let t=e.ListHostedZonesResponse||e.ListHostedZonesByNameResponse||e,o=t.HostedZones?.HostedZone||t.HostedZones||[];if(!Array.isArray(o))o=o?[o]:[];return{HostedZones:o.map((n)=>this.parseHostedZone(n)),IsTruncated:t.IsTruncated==="true"||t.IsTruncated===!0,MaxItems:t.MaxItems||"100",Marker:t.Marker,NextMarker:t.NextMarker}}parseGetHostedZoneResponse(e){let t=e.GetHostedZoneResponse||e;return{HostedZone:this.parseHostedZone(t.HostedZone),DelegationSet:this.parseDelegationSet(t.DelegationSet),VPCs:t.VPCs?.VPC?Array.isArray(t.VPCs.VPC)?t.VPCs.VPC:[t.VPCs.VPC]:void 0}}parseListResourceRecordSetsResponse(e){let t=e.ListResourceRecordSetsResponse||e,o=t.ResourceRecordSets?.ResourceRecordSet||t.ResourceRecordSets||[];if(!Array.isArray(o))o=o?[o]:[];return{ResourceRecordSets:o.map((n)=>this.parseResourceRecordSet(n)),IsTruncated:t.IsTruncated==="true"||t.IsTruncated===!0,MaxItems:t.MaxItems||"100",NextRecordName:t.NextRecordName,NextRecordType:t.NextRecordType,NextRecordIdentifier:t.NextRecordIdentifier}}parseChangeResourceRecordSetsResponse(e){let t=e.ChangeResourceRecordSetsResponse||e;return{ChangeInfo:{Id:t.ChangeInfo?.Id||"",Status:t.ChangeInfo?.Status||"",SubmittedAt:t.ChangeInfo?.SubmittedAt||"",Comment:t.ChangeInfo?.Comment}}}parseHostedZone(e){if(!e)return{Id:"",Name:""};return{Id:e.Id||"",Name:e.Name||"",CallerReference:e.CallerReference,Config:e.Config?{Comment:e.Config.Comment,PrivateZone:e.Config.PrivateZone==="true"||e.Config.PrivateZone===!0}:void 0,ResourceRecordSetCount:e.ResourceRecordSetCount?Number(e.ResourceRecordSetCount):void 0}}parseDelegationSet(e){if(!e)return{NameServers:[]};let t=e.NameServers?.NameServer||e.NameServers||[];if(!Array.isArray(t))t=t?[t]:[];return{Id:e.Id,CallerReference:e.CallerReference,NameServers:t}}parseResourceRecordSet(e){if(!e)return{Name:"",Type:""};let t=e.ResourceRecords?.ResourceRecord||e.ResourceRecords||[];if(!Array.isArray(t))t=t?[t]:[];return{Name:e.Name||"",Type:e.Type||"",TTL:e.TTL?Number(e.TTL):void 0,ResourceRecords:t.map((o)=>({Value:o.Value||o})),AliasTarget:e.AliasTarget?{HostedZoneId:e.AliasTarget.HostedZoneId,DNSName:e.AliasTarget.DNSName,EvaluateTargetHealth:e.AliasTarget.EvaluateTargetHealth==="true"||e.AliasTarget.EvaluateTargetHealth===!0}:void 0,SetIdentifier:e.SetIdentifier,Weight:e.Weight?Number(e.Weight):void 0,Region:e.Region,GeoLocation:e.GeoLocation,Failover:e.Failover,HealthCheckId:e.HealthCheckId}}async findHostedZoneByName(e){let t=e.endsWith(".")?e:`${e}.`;return(await this.listHostedZonesByName({DNSName:t})).HostedZones.find((s)=>s.Name===t)||null}async createARecord(e){let t=Array.isArray(e.Value)?e.Value:[e.Value];return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:"A",TTL:e.TTL||300,ResourceRecords:t.map((o)=>({Value:o}))}}]}})}async createCnameRecord(e){return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:"CNAME",TTL:e.TTL||300,ResourceRecords:[{Value:e.Value}]}}]}})}async createAliasRecord(e){return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:e.Type||"A",AliasTarget:{HostedZoneId:e.TargetHostedZoneId,DNSName:e.TargetDNSName,EvaluateTargetHealth:e.EvaluateTargetHealth??!1}}}]}})}async createTxtRecord(e){let o=(Array.isArray(e.Value)?e.Value:[e.Value]).map((n)=>{if(!n.startsWith('"'))return`"${n}"`;return n});return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:"TXT",TTL:e.TTL||300,ResourceRecords:o.map((n)=>({Value:n}))}}]}})}async createMxRecord(e){return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:"MX",TTL:e.TTL||300,ResourceRecords:e.Values.map((t)=>({Value:`${t.priority} ${t.mailServer}`}))}}]}})}async deleteRecord(e){return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"DELETE",ResourceRecordSet:e.RecordSet}]}})}async waitForChange(e,t=60,o=5000){let n=e.replace("/change/","");for(let s=0;s<t;s++){let r=await this.client.request({service:"route53",region:this.region,method:"GET",path:`/2013-04-01/change/${n}`});if((r.GetChangeResponse?.ChangeInfo?.Status||r.ChangeInfo?.Status)==="INSYNC")return!0;await new Promise((i)=>setTimeout(i,o))}return!1}async findOrCreateHostedZone(e){let t=e.domainName.endsWith(".")?e.domainName:`${e.domainName}.`,o=await this.findHostedZoneByName(t);if(o){let s=await this.getHostedZone({Id:o.Id});return{hostedZone:o,nameServers:s.DelegationSet.NameServers,isNew:!1}}let n=await this.createHostedZone({Name:t,HostedZoneConfig:{Comment:e.comment||`Hosted zone for ${e.domainName}`,PrivateZone:e.privateZone},VPC:e.vpc});return{hostedZone:n.HostedZone,nameServers:n.DelegationSet.NameServers,isNew:!0}}static getRootDomain(e){let t=e.replace(/\.$/,"").split(".");if(t.length<=2)return e;return t.slice(-2).join(".")}async findHostedZoneForDomain(e){let o=e.replace(/\.$/,"").split(".");for(let n=0;n<o.length-1;n++){let s=o.slice(n).join("."),r=await this.findHostedZoneByName(s);if(r)return r}return null}async ensureHostedZone(e){let t=await this.findOrCreateHostedZone({domainName:e.domainName,comment:e.comment});return{hostedZoneId:t.hostedZone.Id.replace("/hostedzone/",""),nameServers:t.nameServers,isNew:t.isNew,action:t.isNew?"created":"found"}}async setupDomainDns(e){let{domain:t,createIfNotExists:o=!0}=e,n=await this.findHostedZoneByName(t);if(n){let r=await this.getHostedZone({Id:n.Id});return{success:!0,hostedZoneId:n.Id.replace("/hostedzone/",""),nameServers:r.DelegationSet.NameServers,isNew:!1,message:`Found existing hosted zone for ${t}`}}if(!o)return{success:!1,hostedZoneId:null,nameServers:[],isNew:!1,message:`No hosted zone found for ${t} and createIfNotExists is false`};let s=await this.createHostedZone({Name:t,HostedZoneConfig:{Comment:`Created automatically by ts-cloud for ${t}`}});return{success:!0,hostedZoneId:s.HostedZone.Id.replace("/hostedzone/",""),nameServers:s.DelegationSet.NameServers,isNew:!0,message:`Created new hosted zone for ${t}. Please update your domain registrar with these name servers: ${s.DelegationSet.NameServers.join(", ")}`}}static CloudFrontHostedZoneId="Z2FDTNDATAQYW2";static S3WebsiteHostedZoneIds={"us-east-1":"Z3AQBSTGFYJSTF","us-east-2":"Z2O1EMRO9K5GLX","us-west-1":"Z2F56UZL2M1ACD","us-west-2":"Z3BJ6K6RIION7M","ap-east-1":"ZNB98KWMFR0R6","ap-south-1":"Z11RGJOFQNVJUP","ap-northeast-1":"Z2M4EHUR26P7ZW","ap-northeast-2":"Z3W03O7B5YMIYP","ap-northeast-3":"Z2YQB5RD63NC85","ap-southeast-1":"Z3O0J2DXBE1FTB","ap-southeast-2":"Z1WCIGYICN2BYD","ca-central-1":"Z1QDHH18159H29","eu-central-1":"Z21DNDUVLTQW6Q","eu-west-1":"Z1BKCTXD74EZPE","eu-west-2":"Z3GKZC51ZF0DB4","eu-west-3":"Z3R1K369G5AVDG","eu-north-1":"Z3BAZG2TWCNX0D","sa-east-1":"Z7KQH4QJS55SO"};static ALBHostedZoneIds={"us-east-1":"Z35SXDOTRQ7X7K","us-east-2":"Z3AADJGX6KTTL2","us-west-1":"Z368ELLRRE2KJ0","us-west-2":"Z1H1FL5HABSF5","ap-east-1":"Z3DQVH9N71FHZ0","ap-south-1":"ZP97RAFLXTNZK","ap-northeast-1":"Z14GRHDCWA56QT","ap-northeast-2":"ZWKZPGTI48KDX","ap-northeast-3":"Z5LXEBD8Y73MNV","ap-southeast-1":"Z1LMS91P8CMLE5","ap-southeast-2":"Z1GM3OXH4ZPM65","ca-central-1":"ZQSVJUPU6J1EY","eu-central-1":"Z215JYRZR1TBD5","eu-west-1":"Z32O12XQLNTSW2","eu-west-2":"ZHURV8PSTC4K8","eu-west-3":"Z3Q77PNBQS71R4","eu-north-1":"Z23TAZ6LKFMNIO","sa-east-1":"Z2P70J7HTTTPLU"};static APIGatewayHostedZoneIds={"us-east-1":"Z1UJRXOUMOOFQ8","us-east-2":"ZOJJZC49E0EPZ","us-west-1":"Z2MUQ32089INYE","us-west-2":"Z2OJLYMUO9EFXC","ap-east-1":"Z3FD1VL90ND7K5","ap-south-1":"Z3VO1THU9YC4UR","ap-northeast-1":"Z1YSHQZHG15GKL","ap-northeast-2":"Z20JF4UZKIW1U8","ap-northeast-3":"Z2YQB5RD63NC85","ap-southeast-1":"ZL327KTPIQFUL","ap-southeast-2":"Z2RPCDW04V8134","ca-central-1":"Z19DQILCV0OWEC","eu-central-1":"Z1U9ULNL0V5AJ3","eu-west-1":"ZLY8HYME6SFDD","eu-west-2":"ZJ5UAJN8Y3Z2Q","eu-west-3":"Z3KY65QIEKYHQQ","eu-north-1":"Z3UWIKFBOOGXPP","sa-east-1":"ZCMLWB8V5SYIT"}}
50
- export{d as tg};
49
+ </ChangeResourceRecordSetsRequest>`;let n=await this.client.request({service:"route53",region:this.region,method:"POST",path:`/2013-04-01/hostedzone/${t}/rrset`,headers:{"content-type":"application/xml"},body:o});return this.parseChangeResourceRecordSetsResponse(n)}escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}parseCreateHostedZoneResponse(e){let t=e.CreateHostedZoneResponse||e;return{HostedZone:this.parseHostedZone(t.HostedZone),ChangeInfo:{Id:t.ChangeInfo?.Id||"",Status:t.ChangeInfo?.Status||"",SubmittedAt:t.ChangeInfo?.SubmittedAt||""},DelegationSet:this.parseDelegationSet(t.DelegationSet),Location:t.Location||""}}parseListHostedZonesResponse(e){let t=e.ListHostedZonesResponse||e.ListHostedZonesByNameResponse||e,o=t.HostedZones?.HostedZone||t.HostedZones||[];if(!Array.isArray(o))o=o?[o]:[];return{HostedZones:o.map((n)=>this.parseHostedZone(n)),IsTruncated:t.IsTruncated==="true"||t.IsTruncated===!0,MaxItems:t.MaxItems||"100",Marker:t.Marker,NextMarker:t.NextMarker}}parseGetHostedZoneResponse(e){let t=e.GetHostedZoneResponse||e;return{HostedZone:this.parseHostedZone(t.HostedZone),DelegationSet:this.parseDelegationSet(t.DelegationSet),VPCs:t.VPCs?.VPC?Array.isArray(t.VPCs.VPC)?t.VPCs.VPC:[t.VPCs.VPC]:void 0}}parseListResourceRecordSetsResponse(e){let t=e.ListResourceRecordSetsResponse||e,o=t.ResourceRecordSets?.ResourceRecordSet||t.ResourceRecordSets||[];if(!Array.isArray(o))o=o?[o]:[];return{ResourceRecordSets:o.map((n)=>this.parseResourceRecordSet(n)),IsTruncated:t.IsTruncated==="true"||t.IsTruncated===!0,MaxItems:t.MaxItems||"100",NextRecordName:t.NextRecordName,NextRecordType:t.NextRecordType,NextRecordIdentifier:t.NextRecordIdentifier}}parseChangeResourceRecordSetsResponse(e){let t=e.ChangeResourceRecordSetsResponse||e;return{ChangeInfo:{Id:t.ChangeInfo?.Id||"",Status:t.ChangeInfo?.Status||"",SubmittedAt:t.ChangeInfo?.SubmittedAt||"",Comment:t.ChangeInfo?.Comment}}}parseHostedZone(e){if(!e)return{Id:"",Name:""};return{Id:e.Id||"",Name:e.Name||"",CallerReference:e.CallerReference,Config:e.Config?{Comment:e.Config.Comment,PrivateZone:e.Config.PrivateZone==="true"||e.Config.PrivateZone===!0}:void 0,ResourceRecordSetCount:e.ResourceRecordSetCount?Number(e.ResourceRecordSetCount):void 0}}parseDelegationSet(e){if(!e)return{NameServers:[]};let t=e.NameServers?.NameServer||e.NameServers||[];if(!Array.isArray(t))t=t?[t]:[];return{Id:e.Id,CallerReference:e.CallerReference,NameServers:t}}parseResourceRecordSet(e){if(!e)return{Name:"",Type:""};let t=e.ResourceRecords?.ResourceRecord||e.ResourceRecords||[];if(!Array.isArray(t))t=t?[t]:[];return{Name:e.Name||"",Type:e.Type||"",TTL:e.TTL?Number(e.TTL):void 0,ResourceRecords:t.map((o)=>({Value:o.Value||o})),AliasTarget:e.AliasTarget?{HostedZoneId:e.AliasTarget.HostedZoneId,DNSName:e.AliasTarget.DNSName,EvaluateTargetHealth:e.AliasTarget.EvaluateTargetHealth==="true"||e.AliasTarget.EvaluateTargetHealth===!0}:void 0,SetIdentifier:e.SetIdentifier,Weight:e.Weight?Number(e.Weight):void 0,Region:e.Region,GeoLocation:e.GeoLocation,Failover:e.Failover,HealthCheckId:e.HealthCheckId}}async findHostedZoneByName(e){let t=e.endsWith(".")?e:`${e}.`;return(await this.listHostedZonesByName({DNSName:t})).HostedZones.find((s)=>s.Name===t)||null}async createARecord(e){let t=Array.isArray(e.Value)?e.Value:[e.Value];return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:"A",TTL:e.TTL||300,ResourceRecords:t.map((o)=>({Value:o}))}}]}})}async createCnameRecord(e){return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:"CNAME",TTL:e.TTL||300,ResourceRecords:[{Value:e.Value}]}}]}})}async createAliasRecord(e){return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:e.Type||"A",AliasTarget:{HostedZoneId:e.TargetHostedZoneId,DNSName:e.TargetDNSName,EvaluateTargetHealth:e.EvaluateTargetHealth??!1}}}]}})}async createTxtRecord(e){let o=(Array.isArray(e.Value)?e.Value:[e.Value]).map((n)=>{if(!n.startsWith('"'))return`"${n}"`;return n});return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:"TXT",TTL:e.TTL||300,ResourceRecords:o.map((n)=>({Value:n}))}}]}})}async createMxRecord(e){return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:e.Name,Type:"MX",TTL:e.TTL||300,ResourceRecords:e.Values.map((t)=>({Value:`${t.priority} ${t.mailServer}`}))}}]}})}async deleteRecord(e){return this.changeResourceRecordSets({HostedZoneId:e.HostedZoneId,ChangeBatch:{Changes:[{Action:"DELETE",ResourceRecordSet:e.RecordSet}]}})}async waitForChange(e,t=60,o=5000){let n=e.replace("/change/","");for(let s=0;s<t;s++){let r=await this.client.request({service:"route53",region:this.region,method:"GET",path:`/2013-04-01/change/${n}`});if((r.GetChangeResponse?.ChangeInfo?.Status||r.ChangeInfo?.Status)==="INSYNC")return!0;await new Promise((a)=>setTimeout(a,o))}return!1}async findOrCreateHostedZone(e){let t=e.domainName.endsWith(".")?e.domainName:`${e.domainName}.`,o=await this.findHostedZoneByName(t);if(o){let s=await this.getHostedZone({Id:o.Id});return{hostedZone:o,nameServers:s.DelegationSet.NameServers,isNew:!1}}let n=await this.createHostedZone({Name:t,HostedZoneConfig:{Comment:e.comment||`Hosted zone for ${e.domainName}`,PrivateZone:e.privateZone},VPC:e.vpc});return{hostedZone:n.HostedZone,nameServers:n.DelegationSet.NameServers,isNew:!0}}static getRootDomain(e){let t=e.replace(/\.$/,"").split(".");if(t.length<=2)return e;return t.slice(-2).join(".")}async findHostedZoneForDomain(e){let o=e.replace(/\.$/,"").split(".");for(let n=0;n<o.length-1;n++){let s=o.slice(n).join("."),r=await this.findHostedZoneByName(s);if(r)return r}return null}async ensureHostedZone(e){let t=await this.findOrCreateHostedZone({domainName:e.domainName,comment:e.comment});return{hostedZoneId:t.hostedZone.Id.replace("/hostedzone/",""),nameServers:t.nameServers,isNew:t.isNew,action:t.isNew?"created":"found"}}async setupDomainDns(e){let{domain:t,createIfNotExists:o=!0}=e,n=await this.findHostedZoneByName(t);if(n){let r=await this.getHostedZone({Id:n.Id});return{success:!0,hostedZoneId:n.Id.replace("/hostedzone/",""),nameServers:r.DelegationSet.NameServers,isNew:!1,message:`Found existing hosted zone for ${t}`}}if(!o)return{success:!1,hostedZoneId:null,nameServers:[],isNew:!1,message:`No hosted zone found for ${t} and createIfNotExists is false`};let s=await this.createHostedZone({Name:t,HostedZoneConfig:{Comment:`Created automatically by ts-cloud for ${t}`}});return{success:!0,hostedZoneId:s.HostedZone.Id.replace("/hostedzone/",""),nameServers:s.DelegationSet.NameServers,isNew:!0,message:`Created new hosted zone for ${t}. Please update your domain registrar with these name servers: ${s.DelegationSet.NameServers.join(", ")}`}}static CloudFrontHostedZoneId="Z2FDTNDATAQYW2";static S3WebsiteHostedZoneIds={"us-east-1":"Z3AQBSTGFYJSTF","us-east-2":"Z2O1EMRO9K5GLX","us-west-1":"Z2F56UZL2M1ACD","us-west-2":"Z3BJ6K6RIION7M","ap-east-1":"ZNB98KWMFR0R6","ap-south-1":"Z11RGJOFQNVJUP","ap-northeast-1":"Z2M4EHUR26P7ZW","ap-northeast-2":"Z3W03O7B5YMIYP","ap-northeast-3":"Z2YQB5RD63NC85","ap-southeast-1":"Z3O0J2DXBE1FTB","ap-southeast-2":"Z1WCIGYICN2BYD","ca-central-1":"Z1QDHH18159H29","eu-central-1":"Z21DNDUVLTQW6Q","eu-west-1":"Z1BKCTXD74EZPE","eu-west-2":"Z3GKZC51ZF0DB4","eu-west-3":"Z3R1K369G5AVDG","eu-north-1":"Z3BAZG2TWCNX0D","sa-east-1":"Z7KQH4QJS55SO"};static ALBHostedZoneIds={"us-east-1":"Z35SXDOTRQ7X7K","us-east-2":"Z3AADJGX6KTTL2","us-west-1":"Z368ELLRRE2KJ0","us-west-2":"Z1H1FL5HABSF5","ap-east-1":"Z3DQVH9N71FHZ0","ap-south-1":"ZP97RAFLXTNZK","ap-northeast-1":"Z14GRHDCWA56QT","ap-northeast-2":"ZWKZPGTI48KDX","ap-northeast-3":"Z5LXEBD8Y73MNV","ap-southeast-1":"Z1LMS91P8CMLE5","ap-southeast-2":"Z1GM3OXH4ZPM65","ca-central-1":"ZQSVJUPU6J1EY","eu-central-1":"Z215JYRZR1TBD5","eu-west-1":"Z32O12XQLNTSW2","eu-west-2":"ZHURV8PSTC4K8","eu-west-3":"Z3Q77PNBQS71R4","eu-north-1":"Z23TAZ6LKFMNIO","sa-east-1":"Z2P70J7HTTTPLU"};static APIGatewayHostedZoneIds={"us-east-1":"Z1UJRXOUMOOFQ8","us-east-2":"ZOJJZC49E0EPZ","us-west-1":"Z2MUQ32089INYE","us-west-2":"Z2OJLYMUO9EFXC","ap-east-1":"Z3FD1VL90ND7K5","ap-south-1":"Z3VO1THU9YC4UR","ap-northeast-1":"Z1YSHQZHG15GKL","ap-northeast-2":"Z20JF4UZKIW1U8","ap-northeast-3":"Z2YQB5RD63NC85","ap-southeast-1":"ZL327KTPIQFUL","ap-southeast-2":"Z2RPCDW04V8134","ca-central-1":"Z19DQILCV0OWEC","eu-central-1":"Z1U9ULNL0V5AJ3","eu-west-1":"ZLY8HYME6SFDD","eu-west-2":"ZJ5UAJN8Y3Z2Q","eu-west-3":"Z3KY65QIEKYHQQ","eu-north-1":"Z3UWIKFBOOGXPP","sa-east-1":"ZCMLWB8V5SYIT"}}
50
+ export{O};
@@ -0,0 +1,2 @@
1
+ var M=[{index:0,id:"clients",label:"Clients"},{index:1,id:"dns",label:"DNS & TLS"},{index:2,id:"edge",label:"Edge"},{index:3,id:"routing",label:"Routing"},{index:4,id:"apps",label:"Applications"},{index:5,id:"runtime",label:"Background runtime"},{index:6,id:"data",label:"Data services"},{index:7,id:"durability",label:"Durability"}],N=[{index:0,id:"clients",label:"Clients"},{index:1,id:"dns",label:"DNS & TLS"},{index:2,id:"edge",label:"Edge"},{index:3,id:"entry",label:"Entry points"},{index:4,id:"compute",label:"Compute"},{index:5,id:"messaging",label:"Messaging & pooling"},{index:6,id:"data",label:"Data services"},{index:7,id:"durability",label:"Durability"}],P=[{match:/^redis/,kind:"cache",label:"Redis"},{match:/^(?:mysql|mariadb)/,kind:"database",label:"MySQL"},{match:/^postgres/,kind:"database",label:"PostgreSQL"},{match:/^meilisearch/,kind:"database",label:"Meilisearch"},{match:/^vitess|^vtgate/,kind:"database",label:"Vitess"},{match:/^memcached/,kind:"cache",label:"Memcached"}],j=/^(?:rpx-gateway|nginx|caddy|traefik|haproxy)$/;function e(n,u=""){let a=n==null?"":String(n).trim();return a&&a!=="-"&&a!=="—"?a:u}function F(n){return Array.isArray(n)?n.length:0}function h(n){let u=e(n).toLowerCase();if(!u)return"unknown";if(["running","live","active","available","success","ok","healthy","enabled"].includes(u))return"ok";if(["failed","stopped","unreachable","error","critical","disabled"].includes(u))return"bad";if(["configured","creating","pending","degraded","shadowed","warn","unknown"].includes(u))return"warn";return"warn"}function r(n,u,a){if(a.has(u.source)&&a.has(u.target))n.push(u)}function Xr(n,u={}){let a=[],o=[],q=[],f=n.server??{},c=Array.isArray(n.sites)?n.sites:[],L=Array.isArray(n.services)?n.services:[],k=Array.isArray(n.workers)?n.workers:[],m=n.security??{},C=!!n._serverReachable&&!n.metricsUnavailable,T="box";if(!C)q.push("The compute box could not be probed, so live service state is missing; the shape comes from your cloud config.");a.push({id:"internet",label:"Internet",kind:"internet",layer:0,status:"ok",sub:"Public traffic",facts:[],external:!0});let i=[...new Set(c.map((t)=>e(t.domain)||e(t.route).split("/")[0]).filter((t)=>t&&t!=="internal"&&t!=="loopback"))],E=Array.isArray(m.tlsCertificates)?m.tlsCertificates:[],g=E.filter((t)=>Number(t?.daysRemaining??999)<21).length;a.push({id:"dns",label:i.length===1?i[0]:"Public domains",kind:"dns",layer:1,status:g?"warn":i.length?"ok":"unknown",sub:i.length>1?`${i.length} domains`:"DNS & certificates",facts:[{label:"Domains",value:i.length?i.slice(0,6).join(", "):"none resolved"},{label:"Certificates",value:E.length?`${E.length} issued`:"none reported"},...g?[{label:"Expiring",value:`${g} within 21 days`}]:[]],href:"/server/security",external:!0});let v=m.firewall??{},w=Array.isArray(m.ports)?m.ports:[];a.push({id:"firewall",label:"Host firewall",kind:"firewall",layer:2,status:h(v.status),sub:e(v.summary,"Inbound filtering"),facts:[{label:"State",value:e(v.status,"unknown")},{label:"Open ports",value:w.length?w.map((t)=>e(t.listen)).join(", "):"not reported"}],href:"/server/firewall",group:"box"});let y=L.find((t)=>j.test(e(t.name)));a.push({id:"proxy",label:e(y?.name,"Reverse proxy"),kind:"proxy",layer:3,status:y?h(y.status):"unknown",sub:"TLS termination & routing",facts:[{label:"Service",value:e(y?.name,"not detected")},{label:"State",value:e(y?.status,C?"not running":"not probed")},{label:"Routes",value:`${c.length} site${c.length===1?"":"s"}`}],href:"/server/services",group:"box"});for(let t of c){let d=`site:${e(t.name)}`;if(!e(t.name))continue;a.push({id:d,label:e(t.name),kind:"site",layer:4,status:h(t.status),sub:e(t.runtime,"runtime"),facts:[{label:"Route",value:e(t.route,"internal")},{label:"Runtime",value:e(t.runtime,"unknown")},{label:"Delivery",value:e(t.deploy,"unknown")},{label:"TLS",value:e(t.tls,"unknown")},...t.responseMs!=null?[{label:"Response",value:`${Math.round(Number(t.responseMs))} ms`}]:[],...t.httpStatus!=null?[{label:"HTTP",value:String(t.httpStatus)}]:[]],href:"/server/sites",group:"box"})}for(let t of k){let d=`worker:${e(t.name)}`;if(!e(t.name))continue;a.push({id:d,label:e(t.name),kind:"worker",layer:5,status:h(t.status),sub:`${Number(t.processes??1)} process${Number(t.processes??1)===1?"":"es"}`,facts:[{label:"Processes",value:String(t.processes??1)},{label:"State",value:e(t.status,"unknown")},...e(t.site)?[{label:"Site",value:e(t.site)}]:[]],href:"/operations/jobs",group:"box"})}let A=n.serverScheduler??{};if(A.enabled)a.push({id:"scheduler",label:"Scheduler",kind:"scheduler",layer:5,status:"ok",sub:"Cron dispatch",facts:[{label:"Last run",value:e(A.lastRun,"unknown")}],href:"/operations/jobs",group:"box"});let l=L.map((t)=>{let d=e(t.name),s=P.find((p)=>p.match.test(d));return s?{service:t,name:d,...s}:null}).filter((t)=>!!t);for(let t of l)a.push({id:`data:${t.name}`,label:t.label,kind:t.kind,layer:6,status:h(t.service.status),sub:t.name,facts:[{label:"Unit",value:t.name},{label:"State",value:e(t.service.status,"unknown")}],href:"/data/services",group:"box"});let x=n.backup??{};if(x.enabled)a.push({id:"backup",label:"Backups",kind:"backup",layer:7,status:"ok",sub:e(x.destination,"destination"),facts:[{label:"Destination",value:e(x.destination,"unknown")},{label:"Schedule",value:e(x.schedule,"unknown")},{label:"Retention",value:`${x.retention??0} copies`},{label:"Last run",value:e(x.last,"unknown")}],href:"/data/backups"});let b=new Set(a.map((t)=>t.id));r(o,{source:"internet",target:"dns",flow:"request",label:"https"},b),r(o,{source:"dns",target:"firewall",flow:"request",label:"443/80"},b),r(o,{source:"firewall",target:"proxy",flow:"request"},b);for(let t of c){let d=`site:${e(t.name)}`;r(o,{source:"proxy",target:d,flow:"request",label:e(t.path)||void 0,status:h(t.status)},b)}for(let t of k){let d=`worker:${e(t.name)}`,s=`site:${e(t.site)}`;if(b.has(s))r(o,{source:s,target:d,flow:"async",label:"queue"},b);else r(o,{source:"proxy",target:d,flow:"async",label:"queue"},b)}for(let t of k)r(o,{source:"scheduler",target:`worker:${e(t.name)}`,flow:"async",label:"dispatch"},b);let D=[...c.map((t)=>`site:${e(t.name)}`),...k.map((t)=>`worker:${e(t.name)}`)];for(let t of l)for(let d of D)r(o,{source:d,target:`data:${t.name}`,flow:"data",label:"localhost"},b);if(l.length&&D.length)q.push("Data-service edges show co-location on the box: every process on it can reach localhost. They are not a declared per-site binding.");for(let t of l)r(o,{source:`data:${t.name}`,target:"backup",flow:"backup",label:"snapshot"},b);for(let t of c)r(o,{source:`site:${e(t.name)}`,target:"backup",flow:"backup"},b);return{mode:"server",project:e(u.project)||e(n.project?.name)||e(f.name,"project"),environment:e(u.environment)||e(n.environment,"production"),provider:e(f.provider,"unknown"),region:e(f.region,"unknown"),generatedAt:new Date().toISOString(),layers:M,groups:[{id:"box",label:e(f.name,"App server"),sub:[e(f.provider),e(f.region),e(f.ip)].filter(Boolean).join(" · ")}],nodes:a,links:o,notes:q}}function Va(n,u={}){let a=[],o=[],q=[],f=n.app??{},c=Array.isArray(n.functions)?n.functions:[],L=Array.isArray(n.queues)?n.queues:[],k=n.metrics??{};if(!c.length)q.push("No Lambda functions were read for this environment, so the compute layer is empty rather than assumed.");a.push({id:"internet",label:"Internet",kind:"internet",layer:0,status:"ok",sub:"Public traffic",facts:[],external:!0});let m=e(f.url),C=m.replace(/^https?:\/\//,"").split("/")[0];a.push({id:"dns",label:C||"Application domain",kind:"dns",layer:1,status:C?"ok":"unknown",sub:"DNS & certificates",facts:[{label:"Endpoint",value:m||"not resolved"}],external:!0});let T=n.waf;if(T)a.push({id:"waf",label:"WAF",kind:"waf",layer:2,status:h(T.status??"active"),sub:e(T.scope,"Managed rules"),facts:[{label:"Web ACL",value:e(T.name,"unnamed")},...T.blocked!=null?[{label:"Blocked (24h)",value:String(T.blocked)}]:[],{label:"Rules",value:String(F(n.wafRules))}],href:"/serverless/firewall"});let i=n.assetsInfo;if(i)a.push({id:"cdn",label:"Asset CDN",kind:"cdn",layer:2,status:"ok",sub:e(i.cdn,"CloudFront"),facts:[{label:"Distribution",value:e(i.cdn,"unknown")},{label:"Custom domain",value:e(i.customDomain,"none")}],href:"/serverless/assets"}),a.push({id:"assets",label:"Asset bucket",kind:"storage",layer:6,status:"ok",sub:e(i.bucket,"S3"),facts:[{label:"Bucket",value:e(i.bucket,"unknown")},...i.files?[{label:"Objects",value:String(i.files)}]:[],...i.sizeMb?[{label:"Size",value:`${i.sizeMb} MB`}]:[]],href:"/serverless/assets"});let E=c.find((s)=>e(s.key).startsWith("http"));a.push({id:"gateway",label:"HTTP entry point",kind:"gateway",layer:3,status:E?"ok":"unknown",sub:"Function URL / API Gateway",facts:[{label:"Endpoint",value:m||"not resolved"},{label:"Invocations (24h)",value:String(k.invocations??0)},...k.errorRatePct!=null?[{label:"Error rate",value:`${k.errorRatePct}%`}]:[]],href:"/serverless/metrics"});for(let s of c){let p=`fn:${e(s.name)}`;if(!e(s.name))continue;let S=Number(s.errors??0),R=Number(s.invocations??0);a.push({id:p,label:e(s.key,e(s.name)),kind:"function",layer:4,status:S>0?R&&S/R>0.02?"bad":"warn":R?"ok":"idle",sub:e(s.runtime,"lambda"),facts:[{label:"Function",value:e(s.name)},{label:"Memory",value:`${s.memory??0} MB`},{label:"Timeout",value:`${s.timeout??0}s`},{label:"Invocations (24h)",value:String(R)},{label:"Errors (24h)",value:String(S)},{label:"p95",value:`${s.p95??0} ms`},...s.provisioned?[{label:"Provisioned",value:e(s.provisioned)}]:[]],href:"/serverless/functions"})}for(let s of L){let p=`queue:${e(s.name)}`;if(!e(s.name))continue;let S=Number(s.dlq??0);a.push({id:p,label:e(s.name),kind:"queue",layer:5,status:S>0?"bad":Number(s.visible??0)>0?"warn":"ok",sub:"SQS",facts:[{label:"Visible",value:String(s.visible??0)},{label:"In flight",value:String(s.inFlight??0)},{label:"Processed (24h)",value:String(s.processed??0)},{label:"Dead letter",value:String(S)}],href:"/serverless/queues"})}let g=n.aurora;if(g)a.push({id:"database",label:"Aurora Serverless",kind:"database",layer:6,status:h(g.status),sub:e(g.engine,"aurora"),facts:[{label:"Cluster",value:e(g.id,"unknown")},{label:"Capacity",value:`${g.currentAcu??0} ACU (${g.minAcu??0}–${g.maxAcu??0})`},{label:"Connections",value:String(g.connections??0)}],href:"/serverless/data"});let v=n.proxy;if(v)a.push({id:"rds-proxy",label:"RDS Proxy",kind:"database",layer:5,status:h(v.status),sub:"Connection pooling",facts:[{label:"Proxy",value:e(v.name,"unknown")},{label:"Endpoint",value:e(v.endpoint,"unknown")},{label:"Pooled",value:String(v.pooledConns??0)}],href:"/serverless/data"});let w=n.redis;if(w)a.push({id:"cache",label:"ElastiCache",kind:"cache",layer:6,status:h(w.status),sub:e(w.node,"redis"),facts:[{label:"Group",value:e(w.id,"unknown")},{label:"Hit rate",value:`${w.hitRate??0}%`}],href:"/serverless/data"});let y=n.efs;if(y)a.push({id:"efs",label:"EFS",kind:"filesystem",layer:6,status:h(y.status),sub:e(y.mount,"/mnt/local"),facts:[{label:"File system",value:e(y.id,"unknown")},{label:"Mount",value:e(y.mount,"unknown")},{label:"Size",value:`${y.sizeMb??0} MB`}],href:"/data/volumes"});let A=n.scheduler??{};if(A.enabled)a.push({id:"scheduler",label:"Scheduler",kind:"scheduler",layer:3,status:"ok",sub:e(A.expression,"rate(1 minute)"),facts:[{label:"Expression",value:e(A.expression,"unknown")},{label:"Last run",value:e(A.lastRun,"unknown")}],href:"/operations/jobs"});let l=new Set(a.map((s)=>s.id)),x=l.has("waf")?"waf":"gateway";r(o,{source:"internet",target:"dns",flow:"request",label:"https"},l),r(o,{source:"dns",target:x,flow:"request"},l),r(o,{source:"dns",target:"cdn",flow:"request",label:"assets"},l),r(o,{source:"waf",target:"gateway",flow:"request",label:"allowed"},l),r(o,{source:"cdn",target:"assets",flow:"data",label:"origin"},l);let b=c.filter((s)=>e(s.key).startsWith("http")),D=c.filter((s)=>e(s.key).startsWith("queue")),t=c.filter((s)=>e(s.key).startsWith("cli"));for(let s of b)r(o,{source:"gateway",target:`fn:${e(s.name)}`,flow:"request",label:"invoke"},l);for(let s of t)r(o,{source:"scheduler",target:`fn:${e(s.name)}`,flow:"async",label:"schedule"},l);for(let s of L){for(let p of b)r(o,{source:`fn:${e(p.name)}`,target:`queue:${e(s.name)}`,flow:"async",label:"publish"},l);for(let p of D)r(o,{source:`queue:${e(s.name)}`,target:`fn:${e(p.name)}`,flow:"async",label:"consume"},l)}let d=["rds-proxy","database","cache","efs","assets"];for(let s of c){let p=`fn:${e(s.name)}`;if(l.has("rds-proxy"))r(o,{source:p,target:"rds-proxy",flow:"data",label:"pooled"},l);else r(o,{source:p,target:"database",flow:"data",label:"sql"},l);for(let S of d.filter((R)=>R!=="rds-proxy"&&R!=="database"))r(o,{source:p,target:S,flow:"data"},l)}return r(o,{source:"rds-proxy",target:"database",flow:"data",label:"sql"},l),{mode:"serverless",project:e(u.project)||e(f.name,"application"),environment:e(u.environment)||e(f.env,"production"),provider:"aws",region:e(f.region,"unknown"),generatedAt:new Date().toISOString(),layers:N,groups:[],nodes:a,links:o,notes:q}}
2
+ export{Xr,Va};