@stacksjs/ts-cloud 0.16.44 → 0.16.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aws/index.js +1 -1
- package/dist/bin/{chunk-gn03w47w.js → chunk-01w4zbex.js} +1 -1
- package/dist/bin/{chunk-nmqjmx30.js → chunk-12x968en.js} +1 -1
- package/dist/bin/chunk-1xxmyx0r.js +1 -0
- package/dist/bin/{chunk-kdsgbvep.js → chunk-23m8kbwh.js} +1 -1
- package/dist/bin/{chunk-bj7ashn6.js → chunk-2gqhzn2r.js} +1 -1
- package/dist/bin/chunk-45qr2bd3.js +1 -0
- package/dist/bin/chunk-4nn00brw.js +1 -0
- package/dist/bin/chunk-5f1n5d80.js +1 -0
- package/dist/bin/{chunk-s64d5nw2.js → chunk-5mm6qn6m.js} +1 -1
- package/dist/bin/chunk-5xr76cms.js +1 -0
- package/dist/bin/{chunk-q40k9jvk.js → chunk-65yvjecx.js} +2 -2
- package/dist/bin/{chunk-5amvqed8.js → chunk-6y6g726g.js} +3 -3
- package/dist/bin/{chunk-f64jvh96.js → chunk-7qbxq0be.js} +2 -2
- package/dist/bin/{chunk-8z4wgqkh.js → chunk-cz2wq0tf.js} +1 -1
- package/dist/bin/chunk-d0tmmzy5.js +1 -0
- package/dist/bin/{chunk-7p2va3nj.js → chunk-de69nra4.js} +1 -1
- package/dist/bin/{chunk-tf8qxy9k.js → chunk-dj03v81n.js} +20 -20
- package/dist/bin/chunk-dn1yybdy.js +1 -0
- package/dist/bin/chunk-fqghdpvr.js +1 -0
- package/dist/bin/{chunk-35x7z78g.js → chunk-frzpqsbj.js} +1 -1
- package/dist/bin/chunk-gkdr09xx.js +1 -0
- package/dist/bin/{chunk-xxe9ga9r.js → chunk-gyvkravq.js} +3 -3
- package/dist/bin/{chunk-jaexpxs8.js → chunk-her9ny96.js} +1 -1
- package/dist/bin/{chunk-3hkppc7h.js → chunk-kqxk1pds.js} +1 -1
- package/dist/bin/{chunk-hfnpjy9y.js → chunk-n2c6y0k1.js} +1 -1
- package/dist/bin/{chunk-3v2pd05g.js → chunk-nhqz2j90.js} +1 -1
- package/dist/bin/{chunk-erf79tm2.js → chunk-nmr484r7.js} +21 -21
- package/dist/bin/chunk-pr1dg1km.js +1 -0
- package/dist/bin/{chunk-dkf2kcsc.js → chunk-psvqpztv.js} +3 -3
- package/dist/bin/{chunk-ce1qnjs2.js → chunk-pzj1ac7x.js} +1 -1
- package/dist/bin/{chunk-gngsb689.js → chunk-q4dywv80.js} +2 -2
- package/dist/bin/{chunk-pf9dbm3b.js → chunk-q8b77zgw.js} +1 -1
- package/dist/bin/{chunk-qj6tr7bw.js → chunk-qq1f07te.js} +3 -3
- package/dist/bin/chunk-r1kg6yxp.js +1 -0
- package/dist/bin/{chunk-mgwmt2et.js → chunk-rdkr74y2.js} +2 -2
- package/dist/bin/{chunk-jh1vmant.js → chunk-rgcrsd5m.js} +1 -1
- package/dist/bin/{chunk-t80pxn04.js → chunk-rxy9fa64.js} +6 -6
- package/dist/bin/chunk-t1mmfpn1.js +1 -0
- package/dist/bin/chunk-thph4z3k.js +1 -0
- package/dist/bin/chunk-txykq6f1.js +1 -0
- package/dist/bin/{chunk-2r9tj1ac.js → chunk-v09tfezh.js} +5 -5
- package/dist/bin/{chunk-dryvqne2.js → chunk-v7t6f8aw.js} +2 -2
- package/dist/bin/{chunk-knzje4ka.js → chunk-vjg2fymw.js} +1 -1
- package/dist/bin/chunk-vt3hjh9q.js +1 -0
- package/dist/bin/{chunk-sg8hcdev.js → chunk-w29z877b.js} +1 -1
- package/dist/bin/{chunk-7593hjcq.js → chunk-xdk0gmxt.js} +1 -1
- package/dist/bin/{chunk-fkzp9sg5.js → chunk-xe527q1k.js} +1 -1
- package/dist/bin/{chunk-9eqpnanr.js → chunk-xx9mrcfs.js} +1 -1
- package/dist/bin/{chunk-vjfwnj9z.js → chunk-ym9h629y.js} +4 -4
- package/dist/bin/{chunk-cqc4e8md.js → chunk-yp3a0j9n.js} +1 -1
- package/dist/bin/{chunk-kzpzkdpd.js → chunk-z8k9mcn5.js} +1 -1
- package/dist/bin/chunk-z8scg2vy.js +1 -0
- package/dist/bin/{chunk-pnj95hwr.js → chunk-znd507q9.js} +1 -1
- package/dist/bin/cli.js +98 -98
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/{chunk-8jsf214f.js → chunk-1dbe68z7.js} +5 -5
- package/dist/{chunk-cgcthvq9.js → chunk-2sc0s7pc.js} +5 -5
- package/dist/{chunk-a102vqez.js → chunk-46bazfbh.js} +54 -54
- package/dist/chunk-4t0vj9a4.js +1 -0
- package/dist/{chunk-d02jxsxv.js → chunk-6ea5d30w.js} +1 -1
- package/dist/{chunk-0evxayn1.js → chunk-6rcj3km0.js} +2 -2
- package/dist/{chunk-e4pxs9g6.js → chunk-79snvzcx.js} +2 -2
- package/dist/{chunk-x2pxtfk0.js → chunk-astzz50p.js} +3 -3
- package/dist/chunk-bvzmbksp.js +1 -0
- package/dist/{chunk-ct72f70x.js → chunk-fh7apa5n.js} +1 -1
- package/dist/{chunk-txwnpxzf.js → chunk-j2jex596.js} +24 -24
- package/dist/{chunk-c5jyzyqw.js → chunk-j73ntebp.js} +74 -74
- package/dist/{chunk-bwtxb2hf.js → chunk-jpdpr7k6.js} +1 -1
- package/dist/{chunk-v3w791ze.js → chunk-jzpwfgg1.js} +12 -12
- package/dist/chunk-ksqhsz52.js +1 -0
- package/dist/{chunk-w78e5n94.js → chunk-nryh43p1.js} +3 -3
- package/dist/chunk-p588apka.js +1 -0
- package/dist/{chunk-3s8dtcz8.js → chunk-r86dh7h7.js} +1 -1
- package/dist/{chunk-7eaech9q.js → chunk-rpng90t9.js} +1 -1
- package/dist/chunk-s7q23exe.js +1 -0
- package/dist/{chunk-hm6pwhne.js → chunk-tj852ns1.js} +2 -2
- package/dist/{chunk-gp9tkznp.js → chunk-v1bzy3tp.js} +1 -1
- package/dist/{chunk-97gre81w.js → chunk-vb4t2r4r.js} +1 -1
- package/dist/{chunk-9e4afej1.js → chunk-vjph4eh0.js} +1 -1
- package/dist/{chunk-vkrgf3sv.js → chunk-wb7h8ag4.js} +19 -19
- package/dist/{chunk-j5x0qn7z.js → chunk-wmxw3pe4.js} +2 -2
- package/dist/chunk-x7d93rxb.js +1 -0
- package/dist/{chunk-fwcf0n8f.js → chunk-xxq1ygp9.js} +1 -1
- package/dist/{chunk-varjr6np.js → chunk-xzcpzxtj.js} +1 -1
- package/dist/{chunk-9mv07nz0.js → chunk-ynprwawa.js} +2 -2
- package/dist/{chunk-96vc5w8w.js → chunk-yxzdwe7j.js} +1 -1
- package/dist/{chunk-1w9v8g26.js → chunk-zwkm3pkb.js} +3 -3
- package/dist/deploy/index.js +1 -1
- package/dist/deploy/server-dns.d.ts +12 -1
- package/dist/dns/index.js +1 -1
- package/dist/drivers/factory.d.ts +3 -3
- package/dist/drivers/index.js +1 -1
- package/dist/fly/client.d.ts +153 -0
- package/dist/fly/deploy.d.ts +72 -0
- package/dist/fly/index.d.ts +2 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +26 -26
- package/dist/operations/index.js +1 -1
- package/dist/protection/index.js +1 -1
- package/dist/spend/index.js +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +5 -5
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +6 -6
- package/dist/ui/data/services.html +6 -6
- package/dist/ui/data/volumes.html +5 -5
- package/dist/ui/index.html +6 -6
- package/dist/ui/infrastructure/topology.html +5 -5
- package/dist/ui/integrations.html +2 -2
- package/dist/ui/operations/alerts.html +6 -6
- package/dist/ui/operations/configuration.html +5 -5
- package/dist/ui/operations/jobs.html +6 -6
- package/dist/ui/operations/maintenance.html +5 -5
- package/dist/ui/operations/observability.html +5 -5
- package/dist/ui/operations/previews.html +6 -6
- package/dist/ui/operations/queue.html +6 -6
- package/dist/ui/operations/regions.html +5 -5
- package/dist/ui/operations/releases.html +6 -6
- package/dist/ui/operations/spend.html +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +2 -2
- package/dist/ui/server/actions.html +5 -5
- package/dist/ui/server/activity.html +2 -2
- package/dist/ui/server/capacity.html +6 -6
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +6 -6
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +6 -6
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +6 -6
- package/dist/ui/server/security.html +2 -2
- package/dist/ui/server/services.html +2 -2
- package/dist/ui/server/sites.html +6 -6
- package/dist/ui/server/ssh-keys.html +6 -6
- package/dist/ui/server/team.html +6 -6
- package/dist/ui/server/terminal.html +2 -2
- package/dist/ui/serverless/alarms.html +6 -6
- package/dist/ui/serverless/assets.html +2 -2
- package/dist/ui/serverless/cost.html +2 -2
- package/dist/ui/serverless/data.html +6 -6
- package/dist/ui/serverless/deployments.html +2 -2
- package/dist/ui/serverless/firewall.html +1 -1
- package/dist/ui/serverless/functions.html +5 -5
- package/dist/ui/serverless/logs.html +6 -6
- package/dist/ui/serverless/metrics.html +2 -2
- package/dist/ui/serverless/queues.html +6 -6
- package/dist/ui/serverless/secrets.html +6 -6
- package/dist/ui/serverless/traces.html +6 -6
- package/dist/ui/serverless.html +5 -5
- package/package.json +3 -3
- package/dist/bin/chunk-26rf5dy2.js +0 -1
- package/dist/bin/chunk-5khcwxhn.js +0 -1
- package/dist/bin/chunk-5nc1g18b.js +0 -1
- package/dist/bin/chunk-71ep1g7k.js +0 -1
- package/dist/bin/chunk-7fh7b8r1.js +0 -1
- package/dist/bin/chunk-7nsjehvx.js +0 -1
- package/dist/bin/chunk-bb08ms5q.js +0 -1
- package/dist/bin/chunk-g3a9a8bx.js +0 -1
- package/dist/bin/chunk-jv9qp13h.js +0 -1
- package/dist/bin/chunk-k9ate69x.js +0 -1
- package/dist/bin/chunk-mh3rgn0e.js +0 -1
- package/dist/bin/chunk-nfb3ew1v.js +0 -1
- package/dist/bin/chunk-qgqgdkg0.js +0 -1
- package/dist/bin/chunk-s77kny9g.js +0 -1
- package/dist/bin/chunk-vn05n5z6.js +0 -1
- package/dist/bin/chunk-yxpzm8ce.js +0 -1
- package/dist/chunk-2ns1w1fe.js +0 -1
- package/dist/chunk-c9zjh5bx.js +0 -1
- package/dist/chunk-e9z4gzmg.js +0 -1
- package/dist/chunk-g8zgpxgz.js +0 -1
- package/dist/chunk-mqwdq7w1.js +0 -1
- package/dist/chunk-qjghqymj.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n}from"./chunk-
|
|
1
|
+
import{n}from"./chunk-2sc0s7pc.js";class Br{client;region;constructor(e="us-east-1"){this.region=e,this.client=new n}async describeInstances(e){let t={Action:"DescribeInstances",Version:"2016-11-15"};if(e?.InstanceIds)e.InstanceIds.forEach((s,i)=>{t[`InstanceId.${i+1}`]=s});if(e?.Filters)e.Filters.forEach((s,i)=>{t[`Filter.${i+1}.Name`]=s.Name,s.Values.forEach((o,c)=>{t[`Filter.${i+1}.Value.${c+1}`]=o})});if(e?.MaxResults)t.MaxResults=String(e.MaxResults);if(e?.NextToken)t.NextToken=e.NextToken;let a=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=a.DescribeInstancesResponse||a;return{Reservations:this.parseReservations(r.reservationSet?.item),NextToken:r.nextToken}}async getInstance(e){return(await this.describeInstances({InstanceIds:[e]})).Reservations?.[0]?.Instances?.[0]}async getConsoleOutput(e,t){let a={Action:"GetConsoleOutput",Version:"2016-11-15",InstanceId:e};if(t)a.Latest="true";let r=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a).toString()}),s=r.GetConsoleOutputResponse||r;return{InstanceId:s.instanceId,Output:s.output,Timestamp:s.timestamp}}async getConsoleOutputDecoded(e,t){let a=await this.getConsoleOutput(e,t?.latest);if(!a.Output)return"No console output available yet";let r=Buffer.from(a.Output,"base64").toString("utf-8");if(t?.tailLines)return r.split(`
|
|
2
2
|
`).slice(-t.tailLines).join(`
|
|
3
3
|
`);return r}async describeInstanceStatus(e){let t={Action:"DescribeInstanceStatus",Version:"2016-11-15"};if(e?.InstanceIds)e.InstanceIds.forEach((r,s)=>{t[`InstanceId.${s+1}`]=r});if(e?.IncludeAllInstances)t.IncludeAllInstances="true";if(e?.Filters)e.Filters.forEach((r,s)=>{t[`Filter.${s+1}.Name`]=r.Name,r.Values.forEach((i,o)=>{t[`Filter.${s+1}.Value.${o+1}`]=i})});let a=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(a.instanceStatusSet?.item).map((r)=>({InstanceId:r.instanceId,InstanceState:r.instanceState?{Code:Number.parseInt(r.instanceState.code),Name:r.instanceState.name}:void 0,InstanceStatus:r.instanceStatus?{Status:r.instanceStatus.status,Details:this.parseArray(r.instanceStatus.details?.item).map((s)=>({Name:s.name,Status:s.status}))}:void 0,SystemStatus:r.systemStatus?{Status:r.systemStatus.status,Details:this.parseArray(r.systemStatus.details?.item).map((s)=>({Name:s.name,Status:s.status}))}:void 0}))}}async startInstances(e){let t={Action:"StartInstances",Version:"2016-11-15"};e.forEach((r,s)=>{t[`InstanceId.${s+1}`]=r});let a=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(a.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 stopInstances(e,t){let a={Action:"StopInstances",Version:"2016-11-15"};if(e.forEach((s,i)=>{a[`InstanceId.${i+1}`]=s}),t)a.Force="true";let r=await this.client.request({service:"ec2",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a).toString()});return{StoppingInstances:this.parseArray(r.instancesSet?.item).map((s)=>({InstanceId:s.instanceId,CurrentState:s.currentState?{Name:s.currentState.name}:void 0,PreviousState:s.previousState?{Name:s.previousState.name}:void 0}))}}async rebootInstances(e){let t={Action:"RebootInstances",Version:"2016-11-15"};e.forEach((a,r)=>{t[`InstanceId.${r+1}`]=a}),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((r,s)=>{t[`InstanceId.${s+1}`]=r});let a=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(a.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 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((s,i)=>{t[`TagSpecification.${i+1}.ResourceType`]=s.ResourceType,s.Tags.forEach((o,c)=>{t[`TagSpecification.${i+1}.Tag.${c+1}.Key`]=o.Key,t[`TagSpecification.${i+1}.Tag.${c+1}.Value`]=o.Value})});let a=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:(a.CreateImageResponse||a).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((r,s)=>{t[`VpcId.${s+1}`]=r});if(e?.Filters)e.Filters.forEach((r,s)=>{t[`Filter.${s+1}.Name`]=r.Name,r.Values.forEach((i,o)=>{t[`Filter.${s+1}.Value.${o+1}`]=i})});let a=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(a.vpcSet?.item).map((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)}))}}async describeSubnets(e){let t={Action:"DescribeSubnets",Version:"2016-11-15"};if(e?.SubnetIds)e.SubnetIds.forEach((r,s)=>{t[`SubnetId.${s+1}`]=r});if(e?.Filters)e.Filters.forEach((r,s)=>{t[`Filter.${s+1}.Name`]=r.Name,r.Values.forEach((i,o)=>{t[`Filter.${s+1}.Value.${o+1}`]=i})});let a=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(a.subnetSet?.item).map((r)=>({SubnetId:r.subnetId,VpcId:r.vpcId,CidrBlock:r.cidrBlock,AvailabilityZone:r.availabilityZone,AvailableIpAddressCount:Number.parseInt(r.availableIpAddressCount),State:r.state,MapPublicIpOnLaunch:r.mapPublicIpOnLaunch==="true",Tags:this.parseTags(r.tagSet?.item)}))}}async describeSecurityGroups(e){let t={Action:"DescribeSecurityGroups",Version:"2016-11-15"};if(e?.GroupIds)e.GroupIds.forEach((r,s)=>{t[`GroupId.${s+1}`]=r});if(e?.GroupNames)e.GroupNames.forEach((r,s)=>{t[`GroupName.${s+1}`]=r});if(e?.Filters)e.Filters.forEach((r,s)=>{t[`Filter.${s+1}.Name`]=r.Name,r.Values.forEach((i,o)=>{t[`Filter.${s+1}.Value.${o+1}`]=i})});let a=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(a.securityGroupInfo?.item).map((r)=>({GroupId:r.groupId,GroupName:r.groupName,Description:r.groupDescription,VpcId:r.vpcId,IpPermissions:this.parseIpPermissions(r.ipPermissions?.item),IpPermissionsEgress:this.parseIpPermissions(r.ipPermissionsEgress?.item),Tags:this.parseTags(r.tagSet?.item)}))}}async describeInternetGateways(e){let t={Action:"DescribeInternetGateways",Version:"2016-11-15"};if(e?.InternetGatewayIds)e.InternetGatewayIds.forEach((r,s)=>{t[`InternetGatewayId.${s+1}`]=r});if(e?.Filters)e.Filters.forEach((r,s)=>{t[`Filter.${s+1}.Name`]=r.Name,r.Values.forEach((i,o)=>{t[`Filter.${s+1}.Value.${o+1}`]=i})});let a=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(a.internetGatewaySet?.item).map((r)=>({InternetGatewayId:r.internetGatewayId,Attachments:this.parseArray(r.attachmentSet?.item).map((s)=>({VpcId:s.vpcId,State:s.state})),Tags:this.parseTags(r.tagSet?.item)}))}}async describeAddresses(e){let t={Action:"DescribeAddresses",Version:"2016-11-15"};if(e?.AllocationIds)e.AllocationIds.forEach((r,s)=>{t[`AllocationId.${s+1}`]=r});if(e?.PublicIps)e.PublicIps.forEach((r,s)=>{t[`PublicIp.${s+1}`]=r});if(e?.Filters)e.Filters.forEach((r,s)=>{t[`Filter.${s+1}.Name`]=r.Name,r.Values.forEach((i,o)=>{t[`Filter.${s+1}.Value.${o+1}`]=i})});let a=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(a.addressesSet?.item).map((r)=>({PublicIp:r.publicIp,AllocationId:r.allocationId,AssociationId:r.associationId,InstanceId:r.instanceId,NetworkInterfaceId:r.networkInterfaceId,PrivateIpAddress:r.privateIpAddress,Domain:r.domain,Tags:this.parseTags(r.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((r,s)=>{t[`TagSpecification.${s+1}.ResourceType`]=r.ResourceType,r.Tags.forEach((i,o)=>{t[`TagSpecification.${s+1}.Tag.${o+1}.Key`]=i.Key,t[`TagSpecification.${s+1}.Tag.${o+1}.Value`]=i.Value})});let a=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:a.allocationId,PublicIp:a.publicIp,Domain:a.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((a,r)=>{t[`ResourceId.${r+1}`]=a}),e.Tags.forEach((a,r)=>{t[`Tag.${r+1}.Key`]=a.Key,t[`Tag.${r+1}.Value`]=a.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,a){let r=a?.maxWaitMs||300000,s=a?.pollIntervalMs||5000,i=Date.now();while(Date.now()-i<r){let o;try{o=await this.getInstance(e)}catch{o=void 0}if(o?.State?.Name===t)return o;await new Promise((c)=>setTimeout(c,s))}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((i,o)=>{t[`TagSpecification.${o+1}.ResourceType`]=i.ResourceType,i.Tags.forEach((c,d)=>{t[`TagSpecification.${o+1}.Tag.${d+1}.Key`]=c.Key,t[`TagSpecification.${o+1}.Tag.${d+1}.Value`]=c.Value})});let a=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()}),s=(a.CreateVpcResponse||a).vpc;return{Vpc:s?{VpcId:s.vpcId,CidrBlock:s.cidrBlock,State:s.state,DhcpOptionsId:s.dhcpOptionsId,InstanceTenancy:s.instanceTenancy,IsDefault:s.isDefault==="true",Tags:this.parseTags(s.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((i,o)=>{t[`TagSpecification.${o+1}.ResourceType`]=i.ResourceType,i.Tags.forEach((c,d)=>{t[`TagSpecification.${o+1}.Tag.${d+1}.Key`]=c.Key,t[`TagSpecification.${o+1}.Tag.${d+1}.Value`]=c.Value})});let a=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()}),s=(a.CreateSubnetResponse||a).subnet;return{Subnet:s?{SubnetId:s.subnetId,VpcId:s.vpcId,CidrBlock:s.cidrBlock,AvailabilityZone:s.availabilityZone,AvailableIpAddressCount:s.availableIpAddressCount?Number.parseInt(s.availableIpAddressCount):void 0,State:s.state,MapPublicIpOnLaunch:s.mapPublicIpOnLaunch==="true",Tags:this.parseTags(s.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 importKeyPair(e){let t={Action:"ImportKeyPair",Version:"2016-11-15",KeyName:e.KeyName,PublicKeyMaterial:Buffer.from(e.PublicKeyMaterial.trim()).toString("base64")};e.TagSpecifications?.forEach((s,i)=>{t[`TagSpecification.${i+1}.ResourceType`]=s.ResourceType,s.Tags.forEach((o,c)=>{t[`TagSpecification.${i+1}.Tag.${c+1}.Key`]=o.Key,t[`TagSpecification.${i+1}.Tag.${c+1}.Value`]=o.Value})});let a=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=a.ImportKeyPairResponse||a;return{KeyName:r.keyName,KeyPairId:r.keyPairId,KeyFingerprint:r.keyFingerprint}}async deleteKeyPair(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:"DeleteKeyPair",Version:"2016-11-15",KeyName:e}).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((s,i)=>{t[`TagSpecification.${i+1}.ResourceType`]=s.ResourceType,s.Tags.forEach((o,c)=>{t[`TagSpecification.${i+1}.Tag.${c+1}.Key`]=o.Key,t[`TagSpecification.${i+1}.Tag.${c+1}.Value`]=o.Value})});let a=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:(a.CreateSecurityGroupResponse||a).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((s,i)=>{t[`RouteTableId.${i+1}`]=s});if(e?.Filters)e.Filters.forEach((s,i)=>{t[`Filter.${i+1}.Name`]=s.Name,s.Values.forEach((o,c)=>{t[`Filter.${i+1}.Value.${c+1}`]=o})});let a=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=a.DescribeRouteTablesResponse||a;return{RouteTables:this.parseArray(r.routeTableSet?.item).map((s)=>({RouteTableId:s.routeTableId,VpcId:s.vpcId,Routes:this.parseArray(s.routeSet?.item).map((i)=>({DestinationCidrBlock:i.destinationCidrBlock,GatewayId:i.gatewayId,NatGatewayId:i.natGatewayId,State:i.state})),Associations:this.parseArray(s.associationSet?.item).map((i)=>({RouteTableAssociationId:i.routeTableAssociationId,SubnetId:i.subnetId,Main:i.main==="true"||i.main===!0})),Tags:this.parseTags(s.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((s,i)=>{t[`NetworkInterfaceId.${i+1}`]=s});if(e?.Filters)e.Filters.forEach((s,i)=>{t[`Filter.${i+1}.Name`]=s.Name,s.Values.forEach((o,c)=>{t[`Filter.${i+1}.Value.${c+1}`]=o})});let a=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=a.DescribeNetworkInterfacesResponse||a;return{NetworkInterfaces:this.parseArray(r.networkInterfaceSet?.item).map((s)=>({NetworkInterfaceId:s.networkInterfaceId,SubnetId:s.subnetId,VpcId:s.vpcId,Status:s.status,Attachment:s.attachment?{AttachmentId:s.attachment.attachmentId,InstanceId:s.attachment.instanceId,Status:s.attachment.status}:void 0}))}}async detachNetworkInterface(e,t){let a={Action:"DetachNetworkInterface",Version:"2016-11-15",AttachmentId:e};if(t)a.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(a).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()}),a=t.DescribeRegionsResponse||t;return{Regions:this.parseArray(a.regionInfo?.item).map((r)=>({RegionName:r.regionName,Endpoint:r.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((s,i)=>{t[`SecurityGroupId.${i+1}`]=s});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.KeyName)t.KeyName=e.KeyName;if(e.InstanceInitiatedShutdownBehavior)t.InstanceInitiatedShutdownBehavior=e.InstanceInitiatedShutdownBehavior;if(e.BlockDeviceMappings?.forEach((s,i)=>{let o=`BlockDeviceMapping.${i+1}`;t[`${o}.DeviceName`]=s.DeviceName;let c=s.Ebs;if(!c)return;if(c.VolumeSize!==void 0)t[`${o}.Ebs.VolumeSize`]=String(c.VolumeSize);if(c.VolumeType)t[`${o}.Ebs.VolumeType`]=c.VolumeType;if(c.Iops!==void 0)t[`${o}.Ebs.Iops`]=String(c.Iops);if(c.Throughput!==void 0)t[`${o}.Ebs.Throughput`]=String(c.Throughput);if(c.DeleteOnTermination!==void 0)t[`${o}.Ebs.DeleteOnTermination`]=String(c.DeleteOnTermination);if(c.Encrypted!==void 0)t[`${o}.Ebs.Encrypted`]=String(c.Encrypted)}),e.MetadataOptions?.HttpTokens)t["MetadataOptions.HttpTokens"]=e.MetadataOptions.HttpTokens;if(e.MetadataOptions?.HttpEndpoint)t["MetadataOptions.HttpEndpoint"]=e.MetadataOptions.HttpEndpoint;if(e.TagSpecifications)e.TagSpecifications.forEach((s,i)=>{t[`TagSpecification.${i+1}.ResourceType`]=s.ResourceType,s.Tags.forEach((o,c)=>{t[`TagSpecification.${i+1}.Tag.${c+1}.Key`]=o.Key,t[`TagSpecification.${i+1}.Tag.${c+1}.Value`]=o.Value})});let a=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=a.RunInstancesResponse||a;return{Instances:this.parseInstances(r.instancesSet?.item||r.instancesSet)}}encodeIpPermissions(e,t){t.forEach((a,r)=>{let s=`IpPermissions.${r+1}`;if(a.IpProtocol!==void 0)e[`${s}.IpProtocol`]=a.IpProtocol;if(a.FromPort!==void 0)e[`${s}.FromPort`]=String(a.FromPort);if(a.ToPort!==void 0)e[`${s}.ToPort`]=String(a.ToPort);if(a.IpRanges)a.IpRanges.forEach((i,o)=>{if(i.CidrIp)e[`${s}.IpRanges.${o+1}.CidrIp`]=i.CidrIp;if(i.Description)e[`${s}.IpRanges.${o+1}.Description`]=i.Description});if(a.Ipv6Ranges)a.Ipv6Ranges.forEach((i,o)=>{if(i.CidrIpv6)e[`${s}.Ipv6Ranges.${o+1}.CidrIpv6`]=i.CidrIpv6;if(i.Description)e[`${s}.Ipv6Ranges.${o+1}.Description`]=i.Description});if(a.UserIdGroupPairs)a.UserIdGroupPairs.forEach((i,o)=>{if(i.GroupId)e[`${s}.Groups.${o+1}.GroupId`]=i.GroupId;if(i.UserId)e[`${s}.Groups.${o+1}.UserId`]=i.UserId;if(i.Description)e[`${s}.Groups.${o+1}.Description`]=i.Description})})}parseArray(e){if(!e)return[];return Array.isArray(e)?e:[e]}parseFirstIpv6Address(e){for(let t of this.parseArray(e))for(let a of this.parseArray(t?.ipv6AddressesSet?.item))if(a?.ipv6Address)return a.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((a)=>({GroupId:a.groupId,GroupName:a.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((a)=>({DeviceName:a.deviceName,Ebs:a.ebs?{VolumeId:a.ebs.volumeId,Status:a.ebs.status,AttachTime:a.ebs.attachTime,DeleteOnTermination:a.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((a)=>({CidrIp:a.cidrIp,Description:a.description})),Ipv6Ranges:this.parseArray(t.ipv6Ranges?.item).map((a)=>({CidrIpv6:a.cidrIpv6,Description:a.description})),UserIdGroupPairs:this.parseArray(t.groups?.item).map((a)=>({GroupId:a.groupId,UserId:a.userId,Description:a.description}))}))}}class Re{client;region;constructor(e="us-east-1",t){this.region=e,this.client=new n}async putParameter(e){let t={Name:e.Name,Value:e.Value};if(e.Type)t.Type=e.Type;if(e.Description)t.Description=e.Description;if(e.KeyId)t.KeyId=e.KeyId;if(e.Overwrite!==void 0)t.Overwrite=e.Overwrite;if(e.AllowedPattern)t.AllowedPattern=e.AllowedPattern;if(e.Tags&&e.Tags.length>0)t.Tags=e.Tags;if(e.Tier)t.Tier=e.Tier;if(e.DataType)t.DataType=e.DataType;let a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.PutParameter","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{Version:a.Version,Tier:a.Tier}}async getParameter(e){let t={Name:e.Name};if(e.WithDecryption!==void 0)t.WithDecryption=e.WithDecryption;let a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.GetParameter","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{Parameter:a.Parameter?this.parseParameter(a.Parameter):void 0}}async getParameters(e){let t={Names:e.Names};if(e.WithDecryption!==void 0)t.WithDecryption=e.WithDecryption;let a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.GetParameters","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{Parameters:a.Parameters?.map((r)=>this.parseParameter(r)),InvalidParameters:a.InvalidParameters}}async getParametersByPath(e){let t={Path:e.Path};if(e.Recursive!==void 0)t.Recursive=e.Recursive;if(e.WithDecryption!==void 0)t.WithDecryption=e.WithDecryption;if(e.MaxResults)t.MaxResults=e.MaxResults;if(e.NextToken)t.NextToken=e.NextToken;if(e.ParameterFilters&&e.ParameterFilters.length>0)t.ParameterFilters=e.ParameterFilters;let a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.GetParametersByPath","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{Parameters:a.Parameters?.map((r)=>this.parseParameter(r)),NextToken:a.NextToken}}async deleteParameter(e){let t={Name:e.Name};await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.DeleteParameter","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)})}async deleteParameters(e){let t={Names:e},a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.DeleteParameters","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{DeletedParameters:a.DeletedParameters,InvalidParameters:a.InvalidParameters}}async describeParameters(e){let t={};if(e?.Filters&&e.Filters.length>0)t.Filters=e.Filters;if(e?.ParameterFilters&&e.ParameterFilters.length>0)t.ParameterFilters=e.ParameterFilters;if(e?.MaxResults)t.MaxResults=e.MaxResults;if(e?.NextToken)t.NextToken=e.NextToken;let a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.DescribeParameters","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{Parameters:a.Parameters?.map((r)=>this.parseParameter(r)),NextToken:a.NextToken}}async getParameterHistory(e){let t={Name:e.Name};if(e.WithDecryption!==void 0)t.WithDecryption=e.WithDecryption;if(e.MaxResults)t.MaxResults=e.MaxResults;if(e.NextToken)t.NextToken=e.NextToken;let a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.GetParameterHistory","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{Parameters:a.Parameters?.map((r)=>({Name:r.Name,Type:r.Type,KeyId:r.KeyId,LastModifiedDate:r.LastModifiedDate,LastModifiedUser:r.LastModifiedUser,Description:r.Description,Value:r.Value,Version:r.Version,Labels:r.Labels,Tier:r.Tier})),NextToken:a.NextToken}}async labelParameterVersion(e){let t={Name:e.Name,Labels:e.Labels};if(e.ParameterVersion!==void 0)t.ParameterVersion=e.ParameterVersion;let a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.LabelParameterVersion","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{InvalidLabels:a.InvalidLabels,ParameterVersion:a.ParameterVersion}}async addTagsToResource(e){let t={ResourceType:e.ResourceType,ResourceId:e.ResourceId,Tags:e.Tags};await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.AddTagsToResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)})}async removeTagsFromResource(e){let t={ResourceType:e.ResourceType,ResourceId:e.ResourceId,TagKeys:e.TagKeys};await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.RemoveTagsFromResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)})}async listTagsForResource(e){let t={ResourceType:e.ResourceType,ResourceId:e.ResourceId};return{TagList:(await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.ListTagsForResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)})).TagList}}async setString(e,t,a){return this.putParameter({Name:e,Value:t,Type:"String",Description:a?.description,Overwrite:a?.overwrite??!0,Tags:a?.tags})}async setSecureString(e,t,a){return this.putParameter({Name:e,Value:t,Type:"SecureString",Description:a?.description,Overwrite:a?.overwrite??!0,KeyId:a?.kmsKeyId,Tags:a?.tags})}async getValue(e){return(await this.getParameter({Name:e,WithDecryption:!0})).Parameter?.Value}async getAllByPath(e,t=!0){let a=[],r;do{let s=await this.getParametersByPath({Path:e,Recursive:t,WithDecryption:!0,NextToken:r});if(s.Parameters)a.push(...s.Parameters);r=s.NextToken}while(r);return a}parseParameter(e){return{Name:e.Name,Type:e.Type,Value:e.Value,Version:e.Version,LastModifiedDate:e.LastModifiedDate,ARN:e.ARN,DataType:e.DataType,Description:e.Description,AllowedPattern:e.AllowedPattern,KeyId:e.KeyId,Tier:e.Tier}}async sendCommand(e){if(!e.InstanceIds&&!e.Targets)throw Error("SendCommand requires either InstanceIds or Targets");let t={DocumentName:e.DocumentName};if(e.InstanceIds)t.InstanceIds=e.InstanceIds;if(e.Targets)t.Targets=e.Targets;if(e.Parameters)t.Parameters=e.Parameters;if(e.TimeoutSeconds)t.TimeoutSeconds=e.TimeoutSeconds;if(e.Comment)t.Comment=e.Comment;if(e.OutputS3BucketName)t.OutputS3BucketName=e.OutputS3BucketName;if(e.OutputS3KeyPrefix)t.OutputS3KeyPrefix=e.OutputS3KeyPrefix;let a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.SendCommand","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{CommandId:a.Command?.CommandId,Status:a.Command?.Status,StatusDetails:a.Command?.StatusDetails}}async getCommandInvocation(e){let t={CommandId:e.CommandId,InstanceId:e.InstanceId},a=await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.GetCommandInvocation","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)});return{Status:a.Status,StatusDetails:a.StatusDetails,StandardOutputContent:a.StandardOutputContent,StandardErrorContent:a.StandardErrorContent,ResponseCode:a.ResponseCode}}async runShellCommand(e,t,a){let r=await this.sendCommand({InstanceIds:[e],DocumentName:"AWS-RunShellScript",Parameters:{commands:t},TimeoutSeconds:a?.timeoutSeconds||600});if(!r.CommandId)return{success:!1,error:"Failed to send command"};if(a?.waitForCompletion===!1)return{success:!0,status:"Pending"};let s=a?.pollIntervalMs||2000,i=a?.maxWaitMs||300000,o=Date.now();while(Date.now()-o<i){await new Promise((c)=>setTimeout(c,s));try{let c=await this.getCommandInvocation({CommandId:r.CommandId,InstanceId:e});if(c.Status==="Success")return{success:!0,output:c.StandardOutputContent,error:c.StandardErrorContent,status:c.Status};if(c.Status==="Failed"||c.Status==="Cancelled"||c.Status==="TimedOut")return{success:!1,output:c.StandardOutputContent,error:c.StandardErrorContent||c.StatusDetails,status:c.Status}}catch(c){if(!c.message?.includes("InvocationDoesNotExist"))return{success:!1,error:c.message}}}return{success:!1,error:"Command timed out waiting for completion"}}async listCommandInvocations(e){let t={CommandId:e.CommandId};if(e.Details)t.Details=!0;return((await this.client.request({service:"ssm",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonSSM.ListCommandInvocations","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(t)})).CommandInvocations||[]).map((s)=>({InstanceId:s.InstanceId,Status:s.Status,StatusDetails:s.StatusDetails,StandardOutputContent:s.CommandPlugins?.[0]?.Output,StandardErrorContent:s.CommandPlugins?.[0]?.StandardErrorUrl}))}async sendCommandByTags(e){let t=Object.entries(e.tags).map(([d,g])=>({Key:`tag:${d}`,Values:[g]})),a=await this.sendCommand({Targets:t,DocumentName:"AWS-RunShellScript",Parameters:{commands:e.commands},TimeoutSeconds:e.timeoutSeconds||600,Comment:e.comment});if(!a.CommandId)return{success:!1,instanceCount:0,perInstance:[],error:"Failed to send command"};let r=e.pollIntervalMs||3000,s=e.maxWaitMs||600000,i=Date.now(),o=new Set(["Success","Failed","Cancelled","TimedOut"]),c=[];while(Date.now()-i<s){await new Promise((d)=>setTimeout(d,r));try{if(c=await this.listCommandInvocations({CommandId:a.CommandId,Details:!0}),c.length===0)continue;if(c.every((g)=>o.has(g.Status||""))){let g=c.map((u)=>({instanceId:u.InstanceId,status:u.Status||"Unknown",output:u.StandardOutputContent,error:u.StandardErrorContent||u.StatusDetails})),m=c.every((u)=>u.Status==="Success");return{success:m,instanceCount:c.length,perInstance:g,error:m?void 0:"One or more instances reported a non-success status"}}}catch(d){if(!d.message?.includes("InvocationDoesNotExist"))return{success:!1,instanceCount:0,perInstance:[],error:d.message}}}return{success:!1,instanceCount:c.length,perInstance:c.map((d)=>({instanceId:d.InstanceId,status:d.Status||"Unknown"})),error:"Command timed out waiting for all instances to complete"}}}
|
|
4
4
|
export{Br,Re};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-
|
|
1
|
+
import{n}from"./chunk-2sc0s7pc.js";class $e{client;region;constructor(e="us-east-1",r){this.region=e,this.client=new n(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{$e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as s}from"node:module";var k=Object.create;var{getPrototypeOf:l,defineProperty:f,getOwnPropertyNames:m}=Object;var j=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,
|
|
2
|
-
export{
|
|
1
|
+
import{createRequire as s}from"node:module";var k=Object.create;var{getPrototypeOf:l,defineProperty:f,getOwnPropertyNames:m}=Object;var j=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,cS=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?k(l(a)):{};let d=b||!a||!a.__esModule||!j.call(a,"default")?f(c,"default",{value:a,enumerable:!0}):c;if(a&&typeof a==="object"||typeof a==="function"){for(let e of m(a))if(!j.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0})}if(g)h.set(a,d);return d};var dS=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var sn=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var Xe=s(import.meta.url);
|
|
2
|
+
export{cS,dS,sn,Xe};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{No,tn,bl,nn,Lo,$o}from"./chunk-
|
|
1
|
+
import{No,tn,bl,nn,Lo,$o}from"./chunk-j73ntebp.js";import{$e}from"./chunk-xzcpzxtj.js";import{execFileSync as A}from"node:child_process";import{mkdirSync as k,mkdtempSync as U,rmSync as L,writeFileSync as d}from"node:fs";import{tmpdir as O}from"node:os";import{dirname as j,join as s}from"node:path";var r={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m"};function S(t,e){return`${r[e]}${t}${r.reset}`}function wn(t){console.log(`${r.green}✓${r.reset} ${t}`)}function eg(t){console.error(`${r.red}✗${r.reset} ${t}`)}function Is(t){console.warn(`${r.yellow}⚠${r.reset} ${t}`)}function B(t){console.log(`${r.blue}ℹ${r.reset} ${t}`)}function w(t){console.log(`${r.cyan}→${r.reset} ${t}`)}function bs(t){console.log(`
|
|
2
2
|
${r.bright}${r.cyan}${t}${r.reset}
|
|
3
3
|
`)}var F=!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.BUILDKITE||process.env.CIRCLECI||process.env.GITLAB_CI);function tg(t,e="cyan"){let n=t.split(`
|
|
4
4
|
`),i=Math.max(...n.map((l)=>l.length)),a="─".repeat(i+2);console.log(S(`┌${a}┐`,e)),n.forEach((l)=>{console.log(S(`│ ${l.padEnd(i)} │`,e))}),console.log(S(`└${a}┘`,e))}function R(t,e){for(let n of e){let i=s(t,n.name);k(j(i),{recursive:!0}),d(i,n.data,n.mode?{mode:n.mode}:void 0)}}async function Ya(t){let{app:e,projectRoot:n,region:i,repository:a}=t,l=e.architecture??"x86_64",P=l==="arm64"?"linux/arm64":"linux/amd64",E=e.kind==="php",c=t.onStep??(()=>{}),p=U(s(O(),"tscloud-img-"));try{let f=s(p,"app");k(f,{recursive:!0});let y,v;if(E){Lo({projectRoot:n,app:e,skipBuild:t.skipBuild,onStep:c}),c("staging application tree");let o=$o(n);R(f,o),R(s(p,"runtime"),nn().map((g)=>({name:g.path,data:g.contents,mode:g.mode})));let I=e.handlers?.http??"public/index.php";y={http:I,queue:e.handlers?.queue??I,cli:e.handlers?.cli??I},v=No(o.map((g)=>`${g.name}:${g.data.length}`).join("|"))}else{c("bundling application");let o=await tn({projectRoot:n,app:e,skipBuild:t.skipBuild,onStep:c});d(s(f,"index.mjs"),o.bundle),y=o.handlers,v=o.sha256}let C=v.slice(0,16);d(s(p,"Dockerfile"),bl({kind:e.kind??"node",phpVersion:e.phpVersion,architecture:l}));let x=new $e(i),u;try{u=(await x.describeRepositories({repositoryNames:[a]})).repositories?.[0]?.repositoryUri??""}catch{u=""}if(!u)c(`creating ECR repository ${a}`),u=(await x.createRepository({repositoryName:a,imageScanningConfiguration:{scanOnPush:!0}})).repository?.repositoryUri??"";if(!u)throw Error(`could not resolve ECR repository URI for ${a}`);let m=`${u}:${C}`;c("docker build"),A("docker",["build","--platform",P,"--provenance=false","--sbom=false","-t",m,p],{stdio:"inherit"}),c("ecr auth + push");let h=(await x.getAuthorizationToken()).authorizationData?.[0];if(!h?.authorizationToken||!h.proxyEndpoint)throw Error("failed to get an ECR authorization token");let T=h.proxyEndpoint.replace(/^https?:\/\//,""),b=s(p,".docker");return k(b,{recursive:!0}),d(s(b,"config.json"),JSON.stringify({auths:{[T]:{auth:h.authorizationToken}}})),A("docker",["push",m],{stdio:"inherit",env:{...process.env,DOCKER_CONFIG:b}}),B(`Image: ${m}`),{imageUri:m,tag:C,handlers:y}}finally{L(p,{recursive:!0,force:!0})}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u}from"./chunk-
|
|
1
|
+
import{u}from"./chunk-tj852ns1.js";var pt="/etc/rpx/sites.d",tA={start:3000,end:3999};function g(t){return t.slug?.trim()||"app"}function Kc(t){let r=t.lastIndexOf(":");if(r<0||r===t.length-1)return;let e=t.slice(r+1).trim();if(!/^\d+$/.test(e))return;let n=Number(e);return n>=1&&n<=65535?n:void 0}function bi(t,r={}){let e=r.ignoreSlug?.trim(),n=new Map;for(let o of t){let c=g(o);if(e&&c===e)continue;for(let a of o.proxies??[]){let f=typeof a.from==="string"?[a.from]:a.from??[];for(let i of f){let d=Kc(i);if(d!==void 0&&!n.has(d))n.set(d,c)}}}return n}function Ci(t=pt){return[`for __tsc_fragment in ${t}/*.json; do`,' [ -f "$__tsc_fragment" ] || continue',` base64 < "$__tsc_fragment" | tr -d '\\n'`," printf '\\n'","done"].join(`
|
|
2
2
|
`)}function Ei(t){let r=[];for(let e of t.split(`
|
|
3
|
-
`)){let n=e.trim();if(!n)continue;try{let o=JSON.parse(Buffer.from(n,"base64").toString("utf8"));if(o&&typeof o==="object"&&!Array.isArray(o))r.push(o)}catch{continue}}return r}function
|
|
4
|
-
export{pt,
|
|
3
|
+
`)){let n=e.trim();if(!n)continue;try{let o=JSON.parse(Buffer.from(n,"base64").toString("utf8"));if(o&&typeof o==="object"&&!Array.isArray(o))r.push(o)}catch{continue}}return r}function Sp(t,r,e=tA){let n=[],o=[],c=new Set(r.keys());for(let[a,f]of Object.entries(t.sites??{})){if(!f||u(f)!=="server-app")continue;let i=typeof f.port==="number"?f.port:void 0,d=Math.max(i??e.start,e.start),p;for(let s=d;s<=e.end;s++)if(!c.has(s)){p=s;break}if(p===void 0){let s=i!==void 0?r.get(i):void 0;o.push(`No free port for site '${a}' in ${e.start}-${e.end}${i!==void 0?` (wanted ${i}${s?`, held by '${s}'`:""})`:""}. Widen the range or free a port on the box.`);continue}c.add(p),n.push({site:a,port:p,declared:i,moved:i!==void 0&&p!==i})}return{allocations:n,errors:o}}
|
|
4
|
+
export{pt,tA,Kc,bi,Ci,Ei,Sp};
|
package/dist/deploy/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{An,yn,Nu,ds,ku,Bu,xu,Ba,Ou,_u,
|
|
1
|
+
import{An,yn,Nu,ds,ku,Bu,xu,Ba,Ou,_u,Vf,Lu,C,$u,ls,xe,Mu,Fu,bS,Uu,Qu,Hu,Gu,Vu,qf,CS,ES,vS,jf,zf,TS,wS,Kf,Wf,RS,us,cr,xa,Sn,In,dr,rt,Pt,gs,Jf,bn,qu,ju,Oa,ms,En,fs,Ka}from"../chunk-j2jex596.js";import{Wa,vn,Tn,hs,As,ys,Ss,Ja,Xa}from"../chunk-wmxw3pe4.js";import{Ya}from"../chunk-yxzdwe7j.js";import"../chunk-1dbe68z7.js";import"../chunk-nryh43p1.js";import"../chunk-r86dh7h7.js";import"../chunk-xzcpzxtj.js";import"../chunk-fh7apa5n.js";import"../chunk-v1bzy3tp.js";import"../chunk-vb4t2r4r.js";import{lg,fc,ug,Ce,hc,Un,gg,Ac,Uc,zs,Qc,Gt,fi,Ks}from"../chunk-46bazfbh.js";import"../chunk-xxq1ygp9.js";import"../chunk-vjph4eh0.js";import"../chunk-jpdpr7k6.js";import"../chunk-2sc0s7pc.js";import{pt,tA,Kc,bi,Ci,Ei,Sp}from"../chunk-zwkm3pkb.js";import{_,_r,Lr,Wc,Xs,u,rA,Ip,bp,iI,sI}from"../chunk-tj852ns1.js";import"../chunk-jzpwfgg1.js";import"../chunk-j73ntebp.js";import"../chunk-astzz50p.js";export{tA as DEFAULT_SITE_PORT_RANGE,pt as HOST_SITES_DIR,hc as IPV6_EXCLUDED_HOST_LABELS,Uc as MANAGEMENT_DASHBOARD_SITE,An as addSiteToCloudConfig,Sp as allocateSitePorts,RS as buildAndPushContainerImage,Ya as buildAndPushServerlessImage,cr as buildFunctionEnv,Ci as buildHostSitePortsScript,Ks as buildManagementDashboardArtifact,Pt as buildServerTopology,gs as buildServerlessTopology,Jf as buildTopology,Oa as collectEgressMetrics,lg as collectServerDnsDomains,Wf as createContainerImageDependencies,jf as createExistingStaticFullStackDependencies,qf as createStaticApiOriginDependencies,En as dashboardActions,zs as dashboardCredentialsFile,Mu as dashboardPageRoutes,Gu as deleteFailoverReplicaBuckets,Ja as deleteStaticSite,TS as deployExistingStaticFullStack,xa as deployServerlessApp,sI as deployShipsFiles,Vu as deploySite,CS as deployStaticApiOrigin,As as deployStaticSite,Xa as deployStaticSiteFull,vn as deployStaticSiteWithExternalDns,Tn as deployStaticSiteWithExternalDnsFull,qu as egressReportMetrics,C as ensureDashboardActor,Uu as ensureFailoverReplicaBuckets,fi as ensureManagementDashboard,wS as estimateExistingStaticFullStackMonthlyCost,vS as estimateStaticApiOriginMonthlyCost,ju as fetchEgressReport,zf as generateExistingStaticFullStackTemplate,Wa as generateExternalDnsStaticSiteTemplate,hs as generateStaticSiteTemplate,Qu as grantFailoverReplicaAccess,rA as hasComputeConfigured,Wc as hasProxyUpstream,Kf as hashContainerContext,Un as hostAcceptsIpv6,us as infraEnvFromOutputs,$u as initializeDashboardControlPlane,Ss as invalidateCache,_r as isPhpSite,Ba as isValidHostname,Ce as normalizePublicIpv6,bi as occupiedHostPorts,Ei as parseHostSiteFragments,Kc as parseUpstreamPort,gg as reconcileAddressRecords,Sn as redeployServerlessApp,ug as removeAddressRecords,yn as removeSiteFromCloudConfig,fc as removeStaleServerAddressRecords,Ou as renderAliasesValue,xu as renderEnvValue,_u as renderRedirectsValue,Vf as renderSiteSnippet,ku as renderSslValue,Bu as renderStringValue,fs as resolveDashboardAction,Qc as resolveDashboardAuth,bn as resolveDashboardData,Fu as resolveLegacyDashboardRoute,Lr as resolveProxyUpstreams,Xs as resolveSiteDeployTarget,u as resolveSiteKind,Gt as resolveUiSource,In as rollbackServerlessApp,bS as routesForDashboard,rt as runRemoteCommand,ms as sanitizeCloudConfig,Hu as seedFailoverReplicas,Lu as setAttachToInCloudConfig,dr as setMaintenance,ds as setSitePropertyInCloudConfig,bp as shipsARelease,iI as shipsToBucket,_ as siteInstallBase,Ka as startLocalDashboardServer,ls as synchronizeDashboardUsers,xe as trackDashboardOperation,Nu as updateSiteInCloudConfig,ys as uploadStaticFiles,Ip as validateDeploymentConfig,Ac as verifyAddressRecord,ES as verifyStaticApiOrigin};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DnsProvider } from '../dns/types';
|
|
1
|
+
import type { DnsProvider, DnsRecordResult } from '../dns/types';
|
|
2
2
|
interface ServerSite {
|
|
3
3
|
domain?: string;
|
|
4
4
|
deploy?: string;
|
|
@@ -18,6 +18,17 @@ export declare function collectServerDnsDomains(sites?: Record<string, ServerSit
|
|
|
18
18
|
* dual-stack clients prefer IPv6 and would keep landing on the dead address.
|
|
19
19
|
*/
|
|
20
20
|
export declare function removeStaleServerAddressRecords(provider: DnsProvider, zone: string, hostname: string, desiredAddress: string, recordType?: 'A' | 'AAAA'): Promise<string[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Delete every A and AAAA record for exactly one hostname, as when a preview
|
|
23
|
+
* environment is removed. Records for any other name - the apex, a sibling,
|
|
24
|
+
* a host the hostname is a prefix of - are left alone, matched the same way
|
|
25
|
+
* the stale-record cleanup matches them, so a provider that lists names
|
|
26
|
+
* relative to the zone and one that lists them fully qualified both work.
|
|
27
|
+
*/
|
|
28
|
+
export declare function removeAddressRecords(provider: DnsProvider, zone: string, hostname: string): Promise<{
|
|
29
|
+
removed: DnsRecordResult[];
|
|
30
|
+
warnings: string[];
|
|
31
|
+
}>;
|
|
21
32
|
/**
|
|
22
33
|
* Turn whatever a provider reports as a box's IPv6 into an address an AAAA
|
|
23
34
|
* record can point at.
|
package/dist/dns/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at,le,Me,M,Mt,Ln,Ds,Ps,hr,Ar,$n,yr,Ns,ks,Bs,xs,X,Os,_s,Ls,$s,ue,Ms,Fs,Us,D,pc,Mn,mc}from"../chunk-
|
|
1
|
+
import{at,le,Me,M,Mt,Ln,Ds,Ps,hr,Ar,$n,yr,Ns,ks,Bs,xs,X,Os,_s,Ls,$s,ue,Ms,Fs,Us,D,pc,Mn,mc}from"../chunk-v1bzy3tp.js";import"../chunk-vb4t2r4r.js";import"../chunk-2sc0s7pc.js";export{M as CloudflareProvider,Mn as DnsProviderFactory,Me as GoDaddyProvider,at as PROXIABLE_RECORD_TYPES,le as PorkbunProvider,X as Route53Provider,ue as UnifiedDnsValidator,Bs as applyDeclaredZoneSettings,Ls as applyZoneMigration,D as createDnsProvider,Fs as createGoDaddyValidator,Ms as createPorkbunValidator,Us as createRoute53Validator,yr as delegateZone,Ns as delegateZoneFromConfig,ks as describeDelegation,xs as describeZoneSettings,pc as detectDnsProvider,mc as dnsProviders,Os as exportRoute53Zone,hr as isNameserverRegistrar,Ar as isZoneHost,_s as planZoneMigration,Mt as policyTag,Ln as qualifyName,Ps as reconcileDeclaredRecords,Ds as resolveDeclaredRecords,$n as sameNameservers,$s as verifyZoneParity};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CloudConfig, CloudDriver,
|
|
1
|
+
import type { CloudConfig, CloudDriver, DeployProviderName } from '@ts-cloud/core';
|
|
2
2
|
export interface CreateCloudDriverOptions {
|
|
3
3
|
config: CloudConfig;
|
|
4
|
-
provider?:
|
|
4
|
+
provider?: DeployProviderName;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Create a cloud infrastructure driver from configuration.
|
|
@@ -16,6 +16,6 @@ export declare function createCloudDriver(options: CreateCloudDriverOptions): Cl
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class CloudDriverFactory {
|
|
18
18
|
private drivers;
|
|
19
|
-
getDriver(config: CloudConfig, provider?:
|
|
19
|
+
getDriver(config: CloudConfig, provider?: DeployProviderName): CloudDriver;
|
|
20
20
|
}
|
|
21
21
|
export declare const cloudDrivers: CloudDriverFactory;
|
package/dist/drivers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Qn,Ft,Ir,Ut,Hn,Gn,Vn,qn,
|
|
1
|
+
import{Qn,Ft,Ir,Ut,Hn,Gn,Vn,qn,hg,yc,Y,Er,ph,jn,Sc,Ee,ve,Fe,x,vr,zn,Tr,pe,Ic,Kn,bc,Wn,Cc,wr,mh,fh,Sg,Ig,hh,Ah,yh,Rr,Jn,bg,Gs,Xn,Yn,Zn,ei,ti,Ec,vc,Dr,wc,Ue,Z,Rc,ct,Qe,He,dt,Te,Vs,Dc,Cg,Eg,Pc,vg,lt,ri,Nc,Tg,wg,kc,Pr,we,Bc,Rg,Dg,qs,ni,ut,Pg,Ng,kg,Bg,xg,Og,_g,Lg,$g,ii,si,oi,ai,ci,di,li,Mg,Fg,Nr,O,js,Ug,Qg,Hg,xc,Gg,Vg,Sh,Oc,Ih,bh,qg,jg,Ch,Eh,vh,_c,zg,Th,wh,Rh,ui,gi,pi,mi,Lc,$c,Mc,Fc,Dh,Ws,Hc,hi,Gc,Kg,Wg,Jg,Ph}from"../chunk-46bazfbh.js";import"../chunk-xxq1ygp9.js";import"../chunk-vjph4eh0.js";import"../chunk-jpdpr7k6.js";import"../chunk-2sc0s7pc.js";import"../chunk-tj852ns1.js";import"../chunk-j73ntebp.js";import"../chunk-astzz50p.js";export{Fc as AwsBoxProvisioner,vr as AwsDriver,Hg as BOOT_PARTITION_LABEL,js as CloudDriverFactory,Ig as DEFAULT_HOST_CLEANUP_ESCALATED,Ah as DEFAULT_HOST_CLEANUP_HIGH_WATER_PERCENT,hh as DEFAULT_HOST_CLEANUP_LOW_WATER_PERCENT,Sg as DEFAULT_HOST_CLEANUP_RETENTION,yh as DEFAULT_HOST_CLEANUP_SCHEDULE,Gn as DEFAULT_RPX_CERTS_DIR,Qg as FIRST_BOOT_SCRIPT_PATH,wr as HOST_ARTIFACT_CACHE_DIR,mh as HOST_CLEANUP_SCRIPT_PATH,fh as HOST_CLEANUP_UNIT,Mc as HetznerBoxProvisioner,Dr as HetznerClient,Te as HetznerDriver,Rc as LEGACY_DRIVER_STATE_DIR,Vs as LocalBoxDriver,Wg as MANAGED_CACHE_POLICY_DISABLED,Kg as MANAGED_CACHE_POLICY_OPTIMIZED,Jg as MANAGED_ORIGIN_REQUEST_POLICY_ALL_VIEWER,Dg as RASPBERRY_PI_DEFAULT_SWAP_GB,Cc as REMOTE_SCRIPT_RUNNER,jn as RPX_DIR,Sc as RPX_LAUNCHER_PATH,Ee as RPX_SERVICE_NAME,Bc as SSH_BOOTSTRAP_MARKER_DIR,we as SSH_BOOTSTRAP_VERSION,ut as SSH_DEFAULTS,li as SSH_DEPLOY_STORAGE_PATH,Cg as SSH_INSECURE_HOST_KEY_OPTS,Eg as SSH_KEEPALIVE_OPTS,si as SSH_PREFLIGHT_SCRIPT,Mg as SSH_SKIP_BOOTSTRAP_ENV,Nr as SshDriver,Pr as SystemSshTransport,Lc as UBUNTU_2404_AMI_PARAM,Rh as acquireResizeLock,Ch as applyHetznerHostOptimization,qs as assertArchSupported,Fg as assertSshComputeConfig,Ec as buildAwsArtifactFetch,$c as buildBoxUserData,Ph as buildCloudFrontOriginConfig,xc as buildCloudInitFirstBoot,jg as buildHetznerHostOptimizationScript,Xn as buildHostCleanupDeployScript,bg as buildHostCleanupExecutable,Gs as buildHostCleanupInstallScript,Jn as buildHostCleanupScript,vc as buildLocalArtifactFetch,Y as buildRpxConfig,Fe as buildRpxFragmentRefreshScript,Er as buildRpxLbConfig,ve as buildRpxProvisionScript,vg as buildScpArgsFor,Zn as buildSiteDeployScript,zn as buildSshArgs,Pc as buildSshArgsFor,ni as buildSshBootstrapScript,ei as buildStaticSiteDeployScript,Ug as cloudDrivers,Eh as collectHetznerHostOptimizationReport,Oc as collectHetznerResizeManifest,Dh as createBoxProvisioner,O as createCloudDriver,Hc as deployAllComputeSites,Ws as deploySiteRelease,yc as deriveRouteId,Qn as describeScriptSyntaxError,ct as driverStateDir,Qe as driverStatePath,gi as ensureFirewall,pi as ensureServer,ui as ensureSshKey,ai as evaluatePreflight,Sh as executeHetznerServerResize,wg as findKnownHostKey,di as formatPreflightFindings,Ft as formatSshFailure,qn as gatewayHostnames,x as generateUbuntuAppCloudInit,Vn as hasAutoWwwVariant,Dc as isBoxMode,Vg as isHetznerCapacityError,Hn as isLocalDatabase,Tg as knownHostsLine,Nc as knownHostsToken,hg as normalizeRoutePath,Ue as normalizeSshPublicKey,oi as parsePreflightFacts,Gg as planHetznerServerResize,ci as preflightFailed,Ih as prepareHetznerResize,He as readDriverState,Th as readResizeCheckpoint,ti as releaseTarballTmpPath,hi as reloadRpxGateway,Wn as remoteScriptRunner,ph as renderRpxLauncher,Gc as renewRpxCertificates,_c as resizeCheckpointPath,zg as resizeLockPath,Yn as resolveExecStart,wc as resolveHetznerApiToken,qg as resolveHetznerHostOptimizationPlan,Rr as resolveHostCleanupConfig,xg as resolveSshHostKeyPolicy,Pg as resolveSshHosts,$g as resolveSshLan,kg as resolveSshPort,Bg as resolveSshPrivateKeyPath,_g as resolveSshProfile,Lg as resolveSshPublicIp,ii as resolveSshSettings,Og as resolveSshSudo,Ng as resolveSshUser,ri as scanHostKey,Ic as scpUpload,mi as serverPublicIpv4,Rg as sshBootstrapMarkerPath,Tr as sshExec,pe as sshExecOrThrow,lt as sshHostKeyFingerprint,kc as sshKnownHostsPath,Ut as summarizeRemoteFailures,Ir as surfaceRemoteNotices,vh as verifyHetznerHostOptimization,bh as verifyHetznerResize,bc as waitForCloudInit,Kn as waitForSsh,Z as wrapCloudInitUserData,dt as writeDriverState,wh as writeResizeCheckpoint};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fly.io API client, on the Machines REST API: apps, Machines, leases,
|
|
3
|
+
* volumes, secrets, IP assignments and certificates. Paths and payloads follow
|
|
4
|
+
* Fly's API reference and its own Go client (superfly/fly-go `flaps`), which
|
|
5
|
+
* flyctl itself uses - IP allocation and certificates moved there from the
|
|
6
|
+
* GraphQL API.
|
|
7
|
+
*
|
|
8
|
+
* @see https://docs.fly.io/machines/api/
|
|
9
|
+
*/
|
|
10
|
+
export declare const FLY_MACHINES_API = "https://api.machines.dev/v1";
|
|
11
|
+
export declare class FlyApiError extends Error {
|
|
12
|
+
readonly status: number;
|
|
13
|
+
readonly path: string;
|
|
14
|
+
constructor(message: string, status: number, path: string);
|
|
15
|
+
}
|
|
16
|
+
export interface FlyApp {
|
|
17
|
+
id?: string;
|
|
18
|
+
name: string;
|
|
19
|
+
organization?: {
|
|
20
|
+
slug?: string;
|
|
21
|
+
};
|
|
22
|
+
status?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FlyService {
|
|
25
|
+
protocol: 'tcp' | 'udp';
|
|
26
|
+
internal_port: number;
|
|
27
|
+
ports: Array<{
|
|
28
|
+
port: number;
|
|
29
|
+
handlers: string[];
|
|
30
|
+
force_https?: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
autostop?: 'off' | 'stop' | 'suspend';
|
|
33
|
+
autostart?: boolean;
|
|
34
|
+
min_machines_running?: number;
|
|
35
|
+
checks?: Array<{
|
|
36
|
+
type: 'http' | 'tcp';
|
|
37
|
+
interval?: string;
|
|
38
|
+
timeout?: string;
|
|
39
|
+
grace_period?: string;
|
|
40
|
+
method?: string;
|
|
41
|
+
path?: string;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
export interface FlyMachineConfig {
|
|
45
|
+
image: string;
|
|
46
|
+
env?: Record<string, string>;
|
|
47
|
+
guest?: {
|
|
48
|
+
cpu_kind: 'shared' | 'performance';
|
|
49
|
+
cpus: number;
|
|
50
|
+
memory_mb: number;
|
|
51
|
+
};
|
|
52
|
+
services?: FlyService[];
|
|
53
|
+
mounts?: Array<{
|
|
54
|
+
volume: string;
|
|
55
|
+
path: string;
|
|
56
|
+
}>;
|
|
57
|
+
restart?: {
|
|
58
|
+
policy: 'no' | 'always' | 'on-failure';
|
|
59
|
+
max_retries?: number;
|
|
60
|
+
};
|
|
61
|
+
metadata?: Record<string, string>;
|
|
62
|
+
}
|
|
63
|
+
export interface FlyMachine {
|
|
64
|
+
id: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
state: string;
|
|
67
|
+
region: string;
|
|
68
|
+
instance_id?: string;
|
|
69
|
+
config: FlyMachineConfig;
|
|
70
|
+
}
|
|
71
|
+
export interface FlyVolume {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
region: string;
|
|
75
|
+
size_gb: number;
|
|
76
|
+
attached_machine_id?: string | null;
|
|
77
|
+
state?: string;
|
|
78
|
+
}
|
|
79
|
+
export type FlyIpType = 'v4' | 'v6' | 'shared_v4' | 'private_v6';
|
|
80
|
+
export interface FlyIpAssignment {
|
|
81
|
+
ip: string;
|
|
82
|
+
region?: string;
|
|
83
|
+
shared?: boolean;
|
|
84
|
+
egress?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/** The kind of a listed address, read as fly-go reads it. */
|
|
87
|
+
export declare function flyIpType(assignment: FlyIpAssignment): FlyIpType;
|
|
88
|
+
export interface FlyCertificate {
|
|
89
|
+
hostname: string;
|
|
90
|
+
configured?: boolean;
|
|
91
|
+
status?: string;
|
|
92
|
+
/** The records the hostname needs for the certificate to be issued. */
|
|
93
|
+
dns_requirements?: {
|
|
94
|
+
a?: string[];
|
|
95
|
+
aaaa?: string[];
|
|
96
|
+
cname?: string;
|
|
97
|
+
acme_challenge?: {
|
|
98
|
+
name: string;
|
|
99
|
+
target: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface FlyClientOptions {
|
|
104
|
+
/** `FLY_API_TOKEN`: a deploy or org token. */
|
|
105
|
+
token: string;
|
|
106
|
+
fetch?: typeof fetch;
|
|
107
|
+
}
|
|
108
|
+
export declare class FlyClient {
|
|
109
|
+
private readonly token;
|
|
110
|
+
private readonly fetch;
|
|
111
|
+
constructor(options: FlyClientOptions);
|
|
112
|
+
private rest;
|
|
113
|
+
/** The app, or null when there is none by that name. */
|
|
114
|
+
getApp(name: string): Promise<FlyApp | null>;
|
|
115
|
+
createApp(name: string, org: string): Promise<FlyApp>;
|
|
116
|
+
listMachines(app: string): Promise<FlyMachine[]>;
|
|
117
|
+
createMachine(app: string, input: {
|
|
118
|
+
region: string;
|
|
119
|
+
config: FlyMachineConfig;
|
|
120
|
+
name?: string;
|
|
121
|
+
min_secrets_version?: number;
|
|
122
|
+
}): Promise<FlyMachine>;
|
|
123
|
+
/** Update a Machine's config. `nonce` is the lease the update is made under. */
|
|
124
|
+
updateMachine(app: string, id: string, input: {
|
|
125
|
+
config: FlyMachineConfig;
|
|
126
|
+
min_secrets_version?: number;
|
|
127
|
+
}, nonce: string): Promise<FlyMachine>;
|
|
128
|
+
/** Take a Machine's lease, so no other deploy updates it meanwhile. Returns the nonce. */
|
|
129
|
+
acquireLease(app: string, id: string, ttlSeconds?: number): Promise<string>;
|
|
130
|
+
releaseLease(app: string, id: string, nonce: string): Promise<void>;
|
|
131
|
+
/** Wait for a Machine to reach a state, up to `timeoutSeconds` (Fly allows up to 60 per call). */
|
|
132
|
+
waitForState(app: string, id: string, state: 'started' | 'stopped', options?: {
|
|
133
|
+
instanceId?: string;
|
|
134
|
+
timeoutSeconds?: number;
|
|
135
|
+
}): Promise<void>;
|
|
136
|
+
listVolumes(app: string): Promise<FlyVolume[]>;
|
|
137
|
+
createVolume(app: string, input: {
|
|
138
|
+
name: string;
|
|
139
|
+
region: string;
|
|
140
|
+
size_gb: number;
|
|
141
|
+
}): Promise<FlyVolume>;
|
|
142
|
+
/**
|
|
143
|
+
* Set secrets, leaving the app's others alone. Returns the secrets version,
|
|
144
|
+
* which a Machine created or updated after it must be given as
|
|
145
|
+
* `min_secrets_version` to be sure of seeing them.
|
|
146
|
+
*/
|
|
147
|
+
setSecrets(app: string, values: Record<string, string>): Promise<number>;
|
|
148
|
+
listIpAssignments(app: string): Promise<FlyIpAssignment[]>;
|
|
149
|
+
/** Assign an address. A shared IPv4 is the organization's, shared with its other apps. */
|
|
150
|
+
assignIp(app: string, type: 'v6' | 'shared_v4' | 'v4'): Promise<FlyIpAssignment>;
|
|
151
|
+
/** Request a Let's Encrypt certificate for a custom hostname, or report the one requested before. */
|
|
152
|
+
requestCertificate(app: string, hostname: string): Promise<FlyCertificate>;
|
|
153
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { CloudConfig } from '@ts-cloud/core';
|
|
2
|
+
import type { FlyCertificate, FlyClient, FlyIpAssignment, FlyMachineConfig } from './client';
|
|
3
|
+
/**
|
|
4
|
+
* Deploy an app to Fly.io Machines (stacksjs/stacks#1044).
|
|
5
|
+
*
|
|
6
|
+
* A Fly app runs a container image on Machines: there is no box to provision
|
|
7
|
+
* and nothing to reach over SSH. A deploy converges the app on the config:
|
|
8
|
+
*
|
|
9
|
+
* 1. the app exists in the organization
|
|
10
|
+
* 2. the app's secrets are set, and their version noted, so every Machine
|
|
11
|
+
* started or updated after this sees them
|
|
12
|
+
* 3. it has a dedicated IPv6 and a shared IPv4, so `<app>.fly.dev` answers
|
|
13
|
+
* 4. each configured region runs `count` Machines on the new image: an
|
|
14
|
+
* existing one is updated in place under its lease and waited on before
|
|
15
|
+
* the next, so a rollout that fails stops with the rest still serving; a
|
|
16
|
+
* missing one is created, with its own volume when one is configured
|
|
17
|
+
* 5. each custom hostname has a certificate requested
|
|
18
|
+
*
|
|
19
|
+
* It never destroys anything. Machines beyond the configured count, or in a
|
|
20
|
+
* region no longer configured, are reported, not removed: a Machine can hold
|
|
21
|
+
* the only copy of a volume's data.
|
|
22
|
+
*/
|
|
23
|
+
export interface FlyDeployOptions {
|
|
24
|
+
app: string;
|
|
25
|
+
org: string;
|
|
26
|
+
/** The image to run, already pushed: `registry.fly.io/<app>:<tag>`. */
|
|
27
|
+
image: string;
|
|
28
|
+
regions: string[];
|
|
29
|
+
count: number;
|
|
30
|
+
internalPort: number;
|
|
31
|
+
healthPath: string;
|
|
32
|
+
vm: {
|
|
33
|
+
cpuKind: 'shared' | 'performance';
|
|
34
|
+
cpus: number;
|
|
35
|
+
memoryMb: number;
|
|
36
|
+
};
|
|
37
|
+
volume?: {
|
|
38
|
+
name: string;
|
|
39
|
+
sizeGb: number;
|
|
40
|
+
path: string;
|
|
41
|
+
};
|
|
42
|
+
autoStop: boolean;
|
|
43
|
+
/** Plain environment, visible in the Machine config. */
|
|
44
|
+
env: Record<string, string>;
|
|
45
|
+
/** Set as Fly secrets: encrypted at rest and never in the Machine config. */
|
|
46
|
+
secrets: Record<string, string>;
|
|
47
|
+
hostnames: string[];
|
|
48
|
+
/** The release this deploy is of (a commit sha), recorded on each Machine. */
|
|
49
|
+
release: string;
|
|
50
|
+
}
|
|
51
|
+
export interface FlyDeployResult {
|
|
52
|
+
app: string;
|
|
53
|
+
url: string;
|
|
54
|
+
createdApp: boolean;
|
|
55
|
+
created: string[];
|
|
56
|
+
updated: string[];
|
|
57
|
+
/** Machines the config no longer accounts for, left running. */
|
|
58
|
+
untouched: string[];
|
|
59
|
+
ips: FlyIpAssignment[];
|
|
60
|
+
certificates: FlyCertificate[];
|
|
61
|
+
}
|
|
62
|
+
/** The deploy options a `cloud.provider: 'fly'` config describes, defaults filled in. */
|
|
63
|
+
export declare function flyDeployOptions(config: CloudConfig, input: {
|
|
64
|
+
environment: string;
|
|
65
|
+
image: string;
|
|
66
|
+
release: string;
|
|
67
|
+
env?: Record<string, string>;
|
|
68
|
+
secrets?: Record<string, string>;
|
|
69
|
+
}): FlyDeployOptions;
|
|
70
|
+
/** The Machine config a deploy runs, before any volume is attached. */
|
|
71
|
+
export declare function flyMachineConfig(options: FlyDeployOptions): FlyMachineConfig;
|
|
72
|
+
export declare function deployToFly(client: FlyClient, options: FlyDeployOptions, log?: (line: string) => void): Promise<FlyDeployResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './api';
|
|
|
6
6
|
export * from './control-plane';
|
|
7
7
|
export * from './security';
|
|
8
8
|
export * from './preview';
|
|
9
|
+
export * from './fly';
|
|
9
10
|
export * from './compose';
|
|
10
11
|
export * from './release';
|
|
11
12
|
export * from './runtime';
|
|
@@ -35,7 +36,7 @@ export { keyMatchesFilters, migrateObjectStorage, remapKey } from './object-stor
|
|
|
35
36
|
export type { MigrateEndpoint, MigrateError, MigrateOptions, MigratePlanItem, MigrateProgress, MigrateResult, MigrateVerification, } from './object-storage/migrate';
|
|
36
37
|
export * from './ssl';
|
|
37
38
|
export { deployStaticSite, deployStaticSiteFull, uploadStaticFiles, invalidateCache, deleteStaticSite, generateStaticSiteTemplate, deleteFailoverReplicaBuckets, ensureFailoverReplicaBuckets, grantFailoverReplicaAccess, seedFailoverReplicas, deployStaticSiteWithExternalDns, deployStaticSiteWithExternalDnsFull, generateExternalDnsStaticSiteTemplate, deploySite, hasProxyUpstream, resolveProxyUpstreams, resolveSiteDeployTarget, resolveSiteKind, shipsARelease, siteInstallBase, validateDeploymentConfig, addSiteToCloudConfig, allocateSitePorts, buildHostSitePortsScript, HOST_SITES_DIR, occupiedHostPorts, parseHostSiteFragments, parseUpstreamPort, removeSiteFromCloudConfig, setAttachToInCloudConfig, setSitePropertyInCloudConfig, updateSiteInCloudConfig, buildAndPushServerlessImage, buildFunctionEnv, deployServerlessApp, infraEnvFromOutputs, redeployServerlessApp, rollbackServerlessApp, runRemoteCommand, setMaintenance, buildManagementDashboardArtifact, dashboardCredentialsFile, ensureManagementDashboard, MANAGEMENT_DASHBOARD_SITE, resolveDashboardAuth, resolveUiSource, } from './deploy';
|
|
38
|
-
export { collectServerDnsDomains, hostAcceptsIpv6, IPV6_EXCLUDED_HOST_LABELS, normalizePublicIpv6, reconcileAddressRecords, removeStaleServerAddressRecords, verifyAddressRecord, } from './deploy/server-dns';
|
|
39
|
+
export { collectServerDnsDomains, hostAcceptsIpv6, IPV6_EXCLUDED_HOST_LABELS, normalizePublicIpv6, reconcileAddressRecords, removeAddressRecords, removeStaleServerAddressRecords, verifyAddressRecord, } from './deploy/server-dns';
|
|
39
40
|
export type { AddressRecordReport } from './deploy/server-dns';
|
|
40
41
|
export * from './cdn';
|
|
41
42
|
export type { EnsureDashboardLogger, ResolvedDashboardAuth, StaticSiteConfig, DeployResult, UploadOptions, ExternalDnsStaticSiteConfig, ExternalDnsDeployResult, DeploySiteConfig, DeploySiteResult, StaticSiteDnsProvider, SiteDeployKind, DeploymentValidationResult, BuildImageOptions, BuiltImage, CodeSource, DeployServerlessOptions, ResolvedContext, } from './deploy';
|