@stacksjs/ts-cloud 0.12.9 → 0.12.11
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/aws/sms-voice.d.ts +35 -0
- package/dist/bin/{chunk-tfbs8k8v.js → chunk-0x8szp53.js} +1 -1
- package/dist/bin/chunk-1hggd7yz.js +1 -0
- package/dist/bin/{chunk-rtecnmts.js → chunk-2pevjm25.js} +2 -2
- package/dist/bin/{chunk-0zwknfwp.js → chunk-2tsg6e8j.js} +1 -1
- package/dist/{chunk-c8cadhgc.js → bin/chunk-3f27aa5r.js} +2 -2
- package/dist/bin/{chunk-dz1ec589.js → chunk-3g80gjw6.js} +2 -2
- package/dist/bin/chunk-40j9hgzc.js +1 -0
- package/dist/bin/{chunk-82mj52xr.js → chunk-48eb4z0c.js} +1 -1
- package/dist/bin/chunk-4gqfdr7t.js +1 -0
- package/dist/{chunk-pb47hr0h.js → bin/chunk-5gx38418.js} +1 -1
- package/dist/bin/chunk-5jv4cpky.js +1 -0
- package/dist/bin/chunk-5kxm5mx7.js +1 -0
- package/dist/bin/{chunk-my3ewh3a.js → chunk-5rhvcgzt.js} +2 -2
- package/dist/bin/{chunk-mcr0r4at.js → chunk-8223r1xn.js} +2 -2
- package/dist/bin/{chunk-4q6tad44.js → chunk-84703zpq.js} +91 -91
- package/dist/bin/{chunk-3aph4c1w.js → chunk-9edyzdm0.js} +1 -1
- package/dist/bin/{chunk-xhwqpgwq.js → chunk-9xbsmz1f.js} +1 -1
- package/dist/bin/{chunk-mfrf9q4b.js → chunk-a8t3c4qe.js} +1 -1
- package/dist/bin/chunk-aghy01we.js +1 -0
- package/dist/{chunk-w2ddj42w.js → bin/chunk-akwfvn5k.js} +1 -1
- package/dist/bin/chunk-asvz121j.js +1 -0
- package/dist/bin/{chunk-6tfwm33r.js → chunk-b0xtsv8k.js} +3 -3
- package/dist/bin/chunk-bcpdj01b.js +1 -0
- package/dist/bin/{chunk-btsyjhk7.js → chunk-bj4ft4qc.js} +2 -2
- package/dist/bin/chunk-da49my09.js +1 -0
- package/dist/bin/{chunk-hq9x489e.js → chunk-dep2n31v.js} +1 -1
- package/dist/bin/{chunk-b4wt9jcg.js → chunk-ewxf62t8.js} +2 -2
- package/dist/bin/{chunk-e2bybahr.js → chunk-f42gqn6c.js} +1 -1
- package/dist/bin/{chunk-s4yzes15.js → chunk-fc6r1ack.js} +1 -1
- package/dist/bin/{chunk-vj2dp0nh.js → chunk-ftcjjf76.js} +6 -6
- package/dist/bin/chunk-g76sry03.js +1 -0
- package/dist/bin/{chunk-e5ab5twy.js → chunk-hv3w2qy1.js} +2 -2
- package/dist/bin/{chunk-9a88fp00.js → chunk-hwdfky19.js} +2 -2
- package/dist/bin/chunk-j02d6qmn.js +1 -0
- package/dist/bin/{chunk-8ewncfce.js → chunk-j2cb8we4.js} +1 -1
- package/dist/bin/chunk-kmz8vb77.js +1 -0
- package/dist/bin/{chunk-0thy7q96.js → chunk-kyr5rasx.js} +74 -75
- package/dist/bin/{chunk-ja1vjdn1.js → chunk-mhrtx0p1.js} +1 -1
- package/dist/bin/{chunk-w32xv8n4.js → chunk-nc9pp87y.js} +2 -2
- package/dist/bin/{chunk-xk08030d.js → chunk-ncrnbcsa.js} +2 -2
- package/dist/bin/chunk-py1hyeb2.js +1 -0
- package/dist/bin/{chunk-q5cmfpzt.js → chunk-qa06sft7.js} +1 -1
- package/dist/bin/{chunk-azymqbcy.js → chunk-qr0xck72.js} +1 -1
- package/dist/bin/chunk-r85ahkwq.js +1 -0
- package/dist/bin/{chunk-ehc63fvs.js → chunk-re15e6p4.js} +1 -1
- package/dist/bin/chunk-t6y3pkm8.js +1 -0
- package/dist/bin/{chunk-c0bdafbx.js → chunk-tfmx17he.js} +1 -1
- package/dist/bin/chunk-vfcchrby.js +1 -0
- package/dist/bin/chunk-vmdh41kp.js +1 -0
- package/dist/bin/{chunk-cd0ps58j.js → chunk-vrc7eemq.js} +1 -1
- package/dist/bin/{chunk-d7ke90zt.js → chunk-vsd7670h.js} +1 -1
- package/dist/bin/{chunk-kg61p5hw.js → chunk-vwqn3yx6.js} +2 -2
- package/dist/bin/{chunk-71t1gmsq.js → chunk-vxbnjz78.js} +1 -1
- package/dist/bin/chunk-w8s8vgdj.js +1 -0
- package/dist/bin/chunk-yq9vetf8.js +698 -0
- package/dist/bin/{chunk-zpe64t4r.js → chunk-zrgd65r8.js} +1 -1
- package/dist/bin/cli.js +143 -143
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/{chunk-fgfm7cfm.js → chunk-0a4tqwm9.js} +89 -90
- package/dist/{chunk-982rye5b.js → chunk-2ybcnrte.js} +1 -1
- package/dist/chunk-4884der5.js +1 -0
- package/dist/{bin/chunk-9kf0np8j.js → chunk-4wdxsnn2.js} +1 -1
- package/dist/{bin/chunk-xkfrqqcs.js → chunk-5hhyyhjt.js} +1 -1
- package/dist/chunk-5zkacdw1.js +1 -0
- package/dist/{chunk-557qj7q9.js → chunk-6cxb8d6y.js} +2 -2
- package/dist/chunk-6f68caq0.js +1 -0
- package/dist/{chunk-2qm3rw8b.js → chunk-7z50g5xz.js} +2 -2
- package/dist/chunk-8fh4m5ge.js +1 -0
- package/dist/chunk-97pb7wb1.js +1 -0
- package/dist/{chunk-a368cs92.js → chunk-ac87ds1k.js} +1 -1
- package/dist/{chunk-qrte4gy2.js → chunk-dndxwssj.js} +1 -1
- package/dist/{bin/chunk-a7w13qfm.js → chunk-ess6vxfj.js} +2 -2
- package/dist/chunk-fvpkxznh.js +558 -0
- package/dist/{chunk-rg7d67xk.js → chunk-j06r5rwv.js} +1 -1
- package/dist/{chunk-70v77sqv.js → chunk-j1g67djb.js} +2 -2
- package/dist/{chunk-fbwpm0zm.js → chunk-k8x8mrkr.js} +1 -1
- package/dist/{chunk-82gezmen.js → chunk-mnmz8t7q.js} +1 -1
- package/dist/{chunk-7j100g7w.js → chunk-n1fyryha.js} +1 -1
- package/dist/{chunk-c1hr34a5.js → chunk-n1hg0jxs.js} +2 -2
- package/dist/{chunk-bcffjsnj.js → chunk-n5xmh0ma.js} +1 -1
- package/dist/chunk-q22qfwsc.js +22 -0
- package/dist/{chunk-5hkq5081.js → chunk-q9a1z53k.js} +2 -2
- package/dist/{chunk-fsssdd5k.js → chunk-r8t25tbm.js} +91 -91
- package/dist/{chunk-2k0mt6j5.js → chunk-whyttetx.js} +1 -1
- package/dist/{chunk-a5213256.js → chunk-yf8stygs.js} +6 -6
- package/dist/{chunk-jphewtbx.js → chunk-ze5x2bpm.js} +1 -1
- package/dist/{chunk-jxrs1219.js → chunk-zh0apedk.js} +2 -2
- package/dist/{chunk-0hw5wjjg.js → chunk-zjyz926j.js} +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/dns/index.js +1 -1
- package/dist/drivers/hetzner/cloud-init.d.ts +14 -1
- package/dist/drivers/hetzner/driver.d.ts +2 -15
- package/dist/drivers/hetzner/state.d.ts +17 -2
- package/dist/drivers/index.d.ts +17 -1
- package/dist/drivers/index.js +1 -1
- package/dist/drivers/local-box/driver.d.ts +1 -1
- package/dist/drivers/shared/compute-provision.d.ts +7 -0
- package/dist/drivers/shared/driver-state.d.ts +68 -0
- package/dist/drivers/shared/remote-exec.d.ts +10 -1
- package/dist/drivers/shared/remote-failure.d.ts +41 -0
- package/dist/drivers/shared/ssh-transport.d.ts +121 -0
- package/dist/drivers/ssh/bootstrap.d.ts +61 -0
- package/dist/drivers/ssh/config.d.ts +86 -0
- package/dist/drivers/ssh/config.test.d.ts +1 -0
- package/dist/drivers/ssh/driver.d.ts +107 -0
- package/dist/drivers/ssh/factory-wiring.test.d.ts +1 -0
- package/dist/drivers/ssh/first-boot.d.ts +38 -0
- package/dist/drivers/ssh/preflight.d.ts +76 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +7 -7
- package/dist/operations/index.js +1 -1
- package/dist/operations/inventory.d.ts +46 -1
- package/dist/protection/index.js +1 -1
- package/dist/push/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 +2 -2
- package/dist/ui/account/automation.html +6 -6
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +6 -6
- package/dist/ui/data/services.html +6 -6
- package/dist/ui/data/volumes.html +6 -6
- package/dist/ui/index.html +6 -6
- package/dist/ui/infrastructure/topology.html +6 -6
- package/dist/ui/integrations.html +2 -2
- package/dist/ui/operations/alerts.html +6 -6
- package/dist/ui/operations/configuration.html +6 -6
- package/dist/ui/operations/jobs.html +6 -6
- package/dist/ui/operations/maintenance.html +5 -5
- package/dist/ui/operations/observability.html +6 -6
- package/dist/ui/operations/previews.html +6 -6
- package/dist/ui/operations/queue.html +6 -6
- package/dist/ui/operations/regions.html +5 -5
- package/dist/ui/operations/releases.html +5 -5
- package/dist/ui/operations/spend.html +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +1 -1
- package/dist/ui/server/actions.html +6 -6
- package/dist/ui/server/activity.html +1 -1
- package/dist/ui/server/capacity.html +6 -6
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +5 -5
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +5 -5
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +5 -5
- 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 +2 -2
- package/dist/ui/serverless/functions.html +6 -6
- 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 +6 -6
- package/dist/ui-src/src/charts.ts +1 -1
- package/dist/ui-src/src/topology.ts +1 -1
- package/package.json +3 -3
- package/dist/bin/chunk-04dkwaqp.js +0 -1
- package/dist/bin/chunk-5nkqza92.js +0 -1
- package/dist/bin/chunk-64vczwwt.js +0 -1
- package/dist/bin/chunk-7g2ahkse.js +0 -1
- package/dist/bin/chunk-aw8bhggq.js +0 -594
- package/dist/bin/chunk-cxt74wsj.js +0 -1
- package/dist/bin/chunk-djg4zyqk.js +0 -1
- package/dist/bin/chunk-dkaz333b.js +0 -1
- package/dist/bin/chunk-edvvx3hg.js +0 -1
- package/dist/bin/chunk-f06c5np9.js +0 -1
- package/dist/bin/chunk-gq8794k6.js +0 -1
- package/dist/bin/chunk-k3120rx6.js +0 -1
- package/dist/bin/chunk-nw3d4k52.js +0 -1
- package/dist/bin/chunk-p70bc9yr.js +0 -1
- package/dist/bin/chunk-sg1g92cf.js +0 -1
- package/dist/bin/chunk-tvz9c388.js +0 -1
- package/dist/bin/chunk-y1h63vpm.js +0 -1
- package/dist/bin/chunk-zdt2rjk6.js +0 -1
- package/dist/bin/chunk-zh2d4704.js +0 -1
- package/dist/chunk-1bj94sc2.js +0 -1
- package/dist/chunk-3swnmwfc.js +0 -454
- package/dist/chunk-5pbtmy2k.js +0 -1
- package/dist/chunk-7sc8t7v1.js +0 -1
- package/dist/chunk-gny5s4kp.js +0 -1
- package/dist/chunk-qpjcd415.js +0 -22
- package/dist/chunk-xkw7h4pw.js +0 -1
package/dist/chunk-5pbtmy2k.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{vi as a,wi as b,xi as c,yi as d}from"./chunk-a368cs92.js";import"./chunk-0hw5wjjg.js";export{b as AWSClient,c as buildQueryParams,d as detectCredentialSource,a as resolveS3Endpoint};
|
package/dist/chunk-7sc8t7v1.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Sf as a,Tf as b}from"./chunk-82gezmen.js";import"./chunk-982rye5b.js";import"./chunk-70v77sqv.js";import"./chunk-a368cs92.js";import"./chunk-0hw5wjjg.js";export{a as EmailClient,b as email};
|
package/dist/chunk-gny5s4kp.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{he as a}from"./chunk-2k0mt6j5.js";import"./chunk-jphewtbx.js";import"./chunk-a368cs92.js";import"./chunk-fsssdd5k.js";import"./chunk-0hw5wjjg.js";export{a as buildAndPushServerlessImage};
|
package/dist/chunk-qpjcd415.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{rj as g,uj as b,vj as f,wj as y}from"./chunk-2qm3rw8b.js";function C(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(t,e="/var/www"){let r=`${e}/${t}-`;return["set -u",`for TS_CLOUD_DIR in ${r}*; do`,' [ -d "$TS_CLOUD_DIR" ] || continue',' [ -d "$TS_CLOUD_DIR/releases" ] || continue',` TS_CLOUD_SITE="\${TS_CLOUD_DIR#${r}}"`," TS_CLOUD_ACTIVE=no",` for TS_CLOUD_UNIT in $(ls /etc/systemd/system/ 2>/dev/null | grep -E "^${C(t)}-$TS_CLOUD_SITE[-@.]" || true); do`,' systemctl is-active "$TS_CLOUD_UNIT" >/dev/null 2>&1 && TS_CLOUD_ACTIVE=yes'," done",' TS_CLOUD_SIZE="$(du -sh "$TS_CLOUD_DIR" 2>/dev/null | cut -f1)"',' echo "site:$TS_CLOUD_SITE:$TS_CLOUD_ACTIVE:${TS_CLOUD_SIZE:-?}"',"done","exit 0"]}function tt(t){if(!t)return[];let e=[];for(let r of t.split(`
|
|
2
|
-
`)){let n=r.trim();if(!n.startsWith("site:"))continue;let[,o,s,i]=n.split(":");if(!o||s!=="no")continue;e.push({name:o,size:i||"?"})}return e}function et(t,e,r){let n=t.map((s)=>` ${e}-${s.name} (${s.size})`).join(`
|
|
3
|
-
`),o=t.length===1?"it":"them";return`This server still holds ${t.length} site tree${t.length===1?"":"s"} with nothing running for ${o}:
|
|
4
|
-
${n}
|
|
5
|
-
`+"A site moved off this box keeps its files here on purpose — they are the rollback, and they are what makes "+`the move reversible until this server is destroyed. Destroying it now discards that.
|
|
6
|
-
Verify the site is serving from its new home first, then re-run with ${r} to destroy it anyway.`}var D="ts-cloud/project",T="ts-cloud/environment",R="ts-cloud/role";function d(t){return typeof t==="string"&&t.trim()?t.trim():void 0}function it(t){let e={};for(let[r,n]of Object.entries(t?.labels??{}))if(typeof n==="string")e[r]=n;return{id:String(t?.id??""),name:d(t?.name)??"(unnamed)",status:d(t?.status)??"unknown",ipv4:d(t?.public_net?.ipv4?.ip)??d(t?.ipv4),ipv6:d(t?.public_net?.ipv6?.ip)??d(t?.ipv6),type:d(t?.server_type?.name)??d(t?.type),location:d(t?.datacenter?.location?.name)??d(t?.datacenter?.name)??d(t?.location),labels:e,project:d(e[D]),environment:d(e[T]),role:d(e[R])}}function E(t){return t.slug?.trim()||"app"}function _(t){let e=[];for(let r of t){let n=E(r);for(let o of r.proxies??[]){let s=d(o?.to);if(!s)continue;e.push({slug:n,host:s,path:d(o?.path)??"/",...j(o)})}}return e.sort((r,n)=>r.slug.localeCompare(n.slug)||r.host.localeCompare(n.host)||r.path.localeCompare(n.path))}function j(t){let e=t?.from;if(typeof e==="string"&&e.trim())return{target:e.trim(),kind:"app"};if(Array.isArray(e)&&e.length>0)return{target:e.filter((o)=>typeof o==="string").join(", "),kind:"app"};let r=t?.static;if(typeof r==="string"&&r.trim())return{target:r.trim(),kind:"static"};if(r&&typeof r==="object"&&d(r.dir))return{target:d(r.dir),kind:"static"};let n=typeof t?.redirect==="string"?d(t.redirect):d(t?.redirect?.to);if(n)return{target:n,kind:"redirect"};return{target:"(no upstream)",kind:"unknown"}}function I(t){let e=new Map;for(let r of t){let n=e.get(r.slug);if(n)n.push(r);else e.set(r.slug,[r])}return[...e.entries()].map(([r,n])=>({slug:r,routes:n})).sort((r,n)=>n.routes.length-r.routes.length||r.slug.localeCompare(n.slug))}async function st(t,e,r=g){if(!t.ipv4)return{server:t.name,routes:[],unavailable:"no public IPv4 address to reach it on"};if(t.status!=="running")return{server:t.name,ip:t.ipv4,routes:[],unavailable:`server is ${t.status}`};try{let n=await e(t.ipv4,f(r));if(n.code!==0){let o=n.stderr.trim().split(`
|
|
7
|
-
`)[0]||`remote command exited ${n.code}`;return{server:t.name,ip:t.ipv4,routes:[],unavailable:o}}return{server:t.name,ip:t.ipv4,routes:_(y(n.stdout))}}catch(n){let o=n instanceof Error?n.message.split(`
|
|
8
|
-
`)[0]:String(n);return{server:t.name,ip:t.ipv4,routes:[],unavailable:o}}}function u(t,e){let r=e==="/"?"/":e.replace(/\/+$/,"");return`${t.toLowerCase()}${r||"/"}`}function ot(t,e,r){let n=new Set(e.filter((a)=>a.slug===r).map((a)=>u(a.host,a.path))),o=[],s=[],i=[];for(let a of t)if(a.loopbackOnly)i.push(a);else if(a.domain&&n.has(u(a.domain,a.path)))o.push(a);else s.push(a);return{present:o,absent:s,loopback:i,foreign:e.filter((a)=>a.slug!==r)}}function H(t,e,r){let n=new Set;for(let o of e)for(let s of o.routes)if(s.slug===r)n.add(u(s.host,s.path));return t.filter((o)=>!o.loopbackOnly&&o.domain!==void 0&&!n.has(u(o.domain,o.path)))}function at(t){let{slug:e,servers:r,probes:n,declared:o}=t,s=[];if(s.push(r.length===0?"No servers found.":`${r.length} server${r.length===1?"":"s"}:`),r.length>0)s.push("");let i=new Map(n.map((a)=>[a.server,a]));for(let a of r){let p=[a.ipv4,a.type,a.location,a.status].filter(Boolean);s.push(` ${a.name} ${p.join(" ")}`),s.push(` ${A(a)}`);let c=i.get(a.name);if(!c)s.push(" not probed, so co-tenants on this box are not listed");else if(c.unavailable)s.push(` could not read ${g}: ${c.unavailable}`);else s.push(...L(c,e));s.push("")}return s.push(...N(t)),s}function A(t){if(!t.project)return"no ts-cloud labels: provisioned outside ts-cloud, or by a version that did not label boxes";let e=[t.environment,t.role&&`role ${t.role}`].filter(Boolean).join(", ");return`owned by '${t.project}'${e?` (${e})`:""}`}function L(t,e){let r=I(t.routes);if(r.length===0)return[` serves nothing: ${g} is empty or absent`];let n=[` serves ${t.routes.length} route${t.routes.length===1?"":"s"} for ${r.length} project${r.length===1?"":"s"}:`];for(let o of r){n.push(` ${o.slug}${o.slug===e?" (this project)":""}`);for(let s of o.routes)n.push(` ${s.host}${s.path==="/"?"/":s.path} -> ${U(s)}`)}return n}function U(t){if(t.kind==="redirect")return`redirect to ${t.target}`;if(t.kind==="static")return`static ${t.target}`;return t.target}function N(t){let{slug:e,declared:r,probes:n,servers:o}=t;if(r.length===0)return[`This project ('${e}') declares no sites.`];let s=[`This project ('${e}') declares ${r.length} site${r.length===1?"":"s"}: `+r.map((c)=>c.name).join(", ")],i=r.filter((c)=>c.loopbackOnly);if(i.length>0)s.push(` ${i.length} with no domain, so the gateway never routes ${i.length===1?"it":"them"} (reached through another site's proxy): ${i.map((c)=>c.name).join(", ")}`);let a=n.filter((c)=>!c.unavailable);if(a.length===0)return s.push(" Nothing to reconcile them against: no box reported what it serves."),s;let p=H(r,a,e);if(s.push(` ${r.length-i.length-p.length} routed by a box above`),p.length>0){s.push(` ${p.length} not routed by any box above: ${p.map((k)=>k.name).join(", ")}`);let c=n.length-a.length,m=o.length-n.length;if(c>0)s.push(` Either they were never deployed, or they are on one of the ${c} server${c===1?"":"s"} that could not be read.`);else if(m>0)s.push(` Either they were never deployed, or they are on one of the ${m} server${m===1?"":"s"} this run did not probe.`);else s.push(" Either they were never deployed, or they are on a server this listing did not cover.")}return s}async function lt(t){let e=[];for(let r of t.steps)try{e.push({step:r,state:await r.satisfied()?"satisfied":"pending"})}catch(n){e.push({step:r,state:"unknown",reason:n instanceof Error?n.message:String(n)})}return e}function v(t){return t.filter((e)=>e.state!=="satisfied")}function M(t){return v(t).some((e)=>e.step.destructive===!0)}function dt(t,e){let r=v(e),n=[`${t.operation} ${t.target}`];if(r.length===0)return n.push(" Nothing to do — every step is already satisfied."),n;for(let{step:s,state:i,reason:a}of e){let p=i==="satisfied"?"ok ":i==="unknown"?"? ":"→ ",c=[s.destructive?"DESTRUCTIVE":"",i==="satisfied"?"already done":""].filter(Boolean);if(n.push(` ${p}${s.title}${c.length>0?` [${c.join(", ")}]`:""}`),s.change)n.push(` ${s.change.from} → ${s.change.to}`);if(a)n.push(` could not check: ${a}`)}let o=r.filter((s)=>s.step.destructive).length;return n.push(` ${r.length} step(s) would run`+(o>0?`, ${o} irreversible — re-run with --confirm ${t.target}`:"")),n}async function pt(t,e,r={}){let n={operation:t.operation,target:t.target,steps:[],success:!0};if(M(e)&&r.confirm!==t.target)throw Error(`${t.operation} includes an irreversible step. Re-run with --confirm ${t.target} to authorize it.`);for(let{step:o,state:s}of e){if(s==="satisfied"){n.steps.push({id:o.id,title:o.title,state:"skipped"}),r.log?.(`skip ${o.title} (already done)`);continue}r.audit?.({operation:t.operation,target:t.target,step:o.id,state:"started"});try{await o.apply(),n.steps.push({id:o.id,title:o.title,state:"applied"}),r.log?.(`done ${o.title}`),r.audit?.({operation:t.operation,target:t.target,step:o.id,state:"applied"})}catch(i){let a=i instanceof Error?i.message:String(i);return n.steps.push({id:o.id,title:o.title,state:"failed",error:a}),n.success=!1,r.log?.(`FAIL ${o.title}: ${a}`),r.audit?.({operation:t.operation,target:t.target,step:o.id,state:"failed",error:a}),n}}return n}function z(t){if(t.length===0)throw Error("A server name cannot be empty.");if(t.length>253)throw Error(`'${t}' is longer than the 253 characters a hostname allows.`);for(let e of t.split(".")){if(e.length===0)throw Error(`'${t}' has an empty label — a hostname cannot contain '..'.`);if(e.length>63)throw Error(`'${e}' is longer than the 63 characters a hostname label allows.`);if(!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(e))throw Error(`'${e}' is not a valid hostname label. Use letters, digits and hyphens, not starting or ending with a hyphen.`)}}async function gt(t,e,r){if(z(e),t===e)throw Error(`'${t}' is already named that.`);if((await r.takenNames()).some((s)=>s===e&&s!==t))throw Error(`'${e}' is already taken. Server names have to be unique within a provider project.`);let o=[];if(r.providerName&&r.renameProvider){let{providerName:s,renameProvider:i}=r;o.push({id:"provider",title:"Rename the server at the provider",change:{from:t,to:e},satisfied:async()=>await s()===e,apply:()=>i(e)})}if(r.stateName&&r.writeStateName){let{stateName:s,writeStateName:i}=r;o.push({id:"state-pin",title:"Update the recorded name in the local driver state",change:{from:t,to:e},satisfied:async()=>{let a=await s();return a===void 0||a===e},apply:()=>i(e)})}if(r.remoteHostname&&r.setRemoteHostname){let{remoteHostname:s,setRemoteHostname:i}=r;o.push({id:"hostname",title:"Set the hostname on the box",change:{from:t,to:e},satisfied:async()=>await s()===e,apply:()=>i(e)})}return o.push({id:"inventory",title:"Rename the fleet inventory record",change:{from:t,to:e},satisfied:async()=>r.inventoryName()===e,apply:async()=>{await r.renameInventory(e)}}),{operation:"server:rename",target:t,steps:o}}function ht(t){let e=`'${t.replace(/'/g,`'"'"'`)}'`;return["set -eu",'TS_CLOUD_OLD="$(hostname)"',`hostnamectl set-hostname ${e} 2>/dev/null || { echo ${e} > /etc/hostname && hostname ${e}; }`,'if grep -q "^127.0.1.1" /etc/hosts; then',` TS_CLOUD_HOSTS="$(sed -E "s/^127\\.0\\.1\\.1.*/127.0.1.1\\t${t}/" /etc/hosts)"`,` printf '%s\\n' "$TS_CLOUD_HOSTS" > /etc/hosts`,"else",` printf '127.0.1.1\\t%s\\n' ${e} >> /etc/hosts`,"fi",'printf "%s -> %s\\n" "$TS_CLOUD_OLD" "$(hostname)"'].join(`
|
|
9
|
-
`)}function $t(t,e,r){let n=e.trim();if(!n)return{problem:"No server named."};let[o,...s]=t.filter((c)=>c.name===n);if(o&&s.length===0)return{server:o};let i=t.filter((c)=>c.project===n);if(i.length>1&&r)i=i.filter((c)=>!c.environment||c.environment===r);let[a,...p]=i;if(a&&p.length===0)return{server:a};if(i.length>1)return{problem:`'${n}' owns ${i.length} servers (${i.map((c)=>c.name).join(", ")}). Name one of them, or narrow it by environment.`};return{problem:`No server matched '${n}'. Nothing is named that, and no box carries the label ts-cloud/project=${n}.`}}function yt(t,e){let r=[];if(!e.project)r.push(`'${e.name}' carries no ts-cloud/project label, so it is not a box ts-cloud provisioned. Attaching to it would deploy into a host nothing manages.`);else if(e.project===t)r.push(`This project's slug is '${t}', which is also the slug that owns '${e.name}'. A tenant deploy owns the gateway fragment named after its slug, so attaching would overwrite '${e.project}'s own fragment and take its sites down. Change this project's slug first.`);if(e.status!=="running")r.push(`'${e.name}' is ${e.status}, so what it serves could not be read.`);if(!e.ipv4)r.push(`'${e.name}' has no public IPv4 address, so it cannot be reached to check what it serves.`);return r}function S(t,e){let r=e==="/"?"/":e.replace(/\/+$/,"");return`${t.toLowerCase()}${r||"/"}`}function vt(t,e,r){let n=[],o=b(r.filter((i)=>i.kind==="app").map((i)=>({slug:i.slug,proxies:[{from:i.target.split(",").map((a)=>a.trim())}]})),{ignoreSlug:t}),s=new Map;for(let i of r)if(i.slug!==t)s.set(S(i.host,i.path),i.slug);for(let i of e){if(i.port!==void 0){let a=o.get(i.port);if(a)n.push({kind:"port",site:i.name,detail:`port ${i.port}`,heldBy:a})}if(i.domain){let a=s.get(S(i.domain,i.path));if(a)n.push({kind:"route",site:i.name,detail:`${i.domain}${i.path==="/"?"/":i.path}`,heldBy:a})}}return n}function St(t){return t.registryRead&&t.conflicts.length===0}function bt(t){let{slug:e,owner:r,server:n,declared:o,conflicts:s}=t,i=[];i.push(`Attach '${e}' to '${n.name}' (${n.ipv4??"no IPv4"}), owned by '${r}'.`,""),i.push(` ${o.length} site${o.length===1?"":"s"} would deploy onto this box:`);for(let a of o){let p=a.loopbackOnly?`loopback only${a.port?` on :${a.port}`:""}`:`${a.domain}${a.path==="/"?"/":a.path}${a.port?` on :${a.port}`:""}`;i.push(` ${a.name} ${p} -> ${a.installBase??"(install path unresolved)"}`)}if(i.push(""),!t.registryRead)i.push(` Could not read what '${n.name}' already serves: ${t.registryProblem??"unknown reason"}`),i.push(" So this attach is UNCHECKED: a port or hostname already taken by another"),i.push(" project would not error, it would serve that project's site from your domain.");else if(s.length>0){i.push(` ${s.length} conflict${s.length===1?"":"s"} with what the box already serves:`);for(let a of s)i.push(` site '${a.site}' wants ${a.detail}, held by '${a.heldBy}'`);i.push(""),i.push(" Two services on one port do not error: the kernel load-balances, and each"),i.push(" domain serves the other's site about half the time. Pick free ports and"),i.push(" hostnames, then re-run.")}else i.push(` No conflicts with what '${n.name}' already serves.`);return i}function h(t,e){return`/tmp/ts-cloud-move-${t}-${e}.tar.gz`}function w(t,e){return`${t}-${e}*.service`}function l(t){return`'${t.split("'").join("'\\''")}'`}function B(t,e){return["set -eu",`for unit in $(ls /etc/systemd/system/ 2>/dev/null | grep -E ${l(x(t,e))} || true); do`,' systemctl stop "$unit" 2>/dev/null || true',"done"].join(`
|
|
10
|
-
`)}function x(t,e){return`^${t}-${e}-((queue|daemon)-.*|scheduler)\\.service$`}function W(t,e){return O(x(t,e))}function O(t){return[`ls /etc/systemd/system/ 2>/dev/null | grep -E ${l(t)} | while read -r unit; do`,' systemctl is-active "$unit" >/dev/null 2>&1 && echo "active:$unit" || true',"done"].join(`
|
|
11
|
-
`)}function F(t){return!t.split(`
|
|
12
|
-
`).some((e)=>e.trim().startsWith("active:"))}function V(t,e,r){let n=h(t,e);return["set -eu",`test -d ${l(r)} || { echo "no site tree at ${r}" >&2; exit 1; }`,`rm -f ${l(n)}`,`tar czf ${l(n)} -C "$(dirname ${l(r)})" "$(basename ${l(r)})" -C /etc/systemd/system $(cd /etc/systemd/system && ls ${w(t,e)} 2>/dev/null | tr '\\n' ' ')`,`sha256sum ${l(n)} | cut -d' ' -f1`].join(`
|
|
13
|
-
`)}function q(t,e,r){let n=h(t,e);return["set -eu",`test -f ${l(n)} || { echo "archive not staged at ${n}" >&2; exit 1; }`,`mkdir -p "$(dirname ${l(r)})"`,`tar xzf ${l(n)} -C "$(dirname ${l(r)})" "$(basename ${l(r)})"`,`tar xzf ${l(n)} -C /etc/systemd/system --wildcards ${l(w(t,e))} 2>/dev/null || true`,"systemctl daemon-reload",`systemctl enable ${t}-${e}.service 2>/dev/null || true`,`systemctl restart ${t}-${e}.service`,`rm -f ${l(n)}`].join(`
|
|
14
|
-
`)}function G(t,e,r){return[`test -d ${l(r)} && echo tree:present || echo tree:absent`,`systemctl is-active ${t}-${e}.service >/dev/null 2>&1 && echo unit:active || echo unit:inactive`].join(`
|
|
15
|
-
`)}function K(t){return t.includes("tree:present")&&t.includes("unit:active")}function Z(t,e="/",r=10){let n=`http://127.0.0.1:${t}${e.startsWith("/")?e:`/${e}`}`;return["set -eu",`for i in $(seq 1 ${r}); do`,` if curl -fsS -o /dev/null --max-time 5 ${l(n)}; then echo healthy; exit 0; fi`," sleep 3","done",`echo "no healthy response from ${n}" >&2`,"exit 1"].join(`
|
|
16
|
-
`)}function J(t,e){return["set -eu",`for unit in $(ls /etc/systemd/system/ 2>/dev/null | grep -E ${l(P(t,e))} || true); do`,' systemctl disable --now "$unit" 2>/dev/null || true',"done",`rm -f /etc/rpx/sites.d/${t}.json 2>/dev/null || true`,"systemctl reload rpx-gateway.service 2>/dev/null || systemctl restart rpx-gateway.service 2>/dev/null || true"].join(`
|
|
17
|
-
`)}function P(t,e){return`^${t}-${e}[-@.]`}function Q(t,e){return O(P(t,e))}function X(t){return!t.split(`
|
|
18
|
-
`).some((e)=>e.trim().startsWith("active:"))}function xt(t,e){return`/tmp/ts-cloud-move-${t}-${e}-certs.tar.gz`}function Ot(t,e){return["set -u",...e.map((r)=>`if [ -s ${l(`${t}/${r}.crt`)} ]; then echo "cert:${r}:$(sha256sum ${l(`${t}/${r}.crt`)} | cut -d' ' -f1)"; else echo "cert:${r}:absent"; fi`)].join(`
|
|
19
|
-
`)}function Pt(t){let e=new Map;for(let r of t.split(`
|
|
20
|
-
`)){let n=r.trim();if(!n.startsWith("cert:"))continue;let[,o,s]=n.split(":");if(o&&s)e.set(o,s)}return e}function kt(t,e){for(let[r,n]of t){if(n==="absent")continue;if(e.get(r)!==n)return!1}return!0}function Ct(t,e,r){let n=e.flatMap((o)=>[`${o}.crt`,`${o}.key`]);return["set -eu",`rm -f ${l(r)}`,`cd ${l(t)} 2>/dev/null || { echo "no certs dir at ${t}" >&2; exit 0; }`,`TS_CLOUD_CERTS="$(ls ${n.map(l).join(" ")} 2>/dev/null | tr '\\n' ' ' || true)"`,'[ -n "$TS_CLOUD_CERTS" ] || { echo "no certificates to carry"; exit 0; }',`tar czf ${l(r)} $TS_CLOUD_CERTS`].join(`
|
|
21
|
-
`)}function Dt(t,e){return["set -eu",`[ -s ${l(e)} ] || { echo "no certificate archive staged"; exit 0; }`,`mkdir -p ${l(t)}`,`tar xzf ${l(e)} -C ${l(t)}`,`chmod 600 ${l(t)}/*.key 2>/dev/null || true`,`rm -f ${l(e)}`].join(`
|
|
22
|
-
`)}async function Tt(t,e){let{slug:r,siteName:n,appBase:o,from:s,to:i,targetAddress:a}=t;if(s===i)throw Error(`'${n}' is already on ${i}.`);if(t.database&&!e.database)throw Error(`'${n}' uses the on-box database '${t.database.name}', which lives in the engine's own data directory rather than in the site tree, and this move has no way to carry it. Moving the site without it would cut traffic over to an empty database.`);if(t.database&&e.database&&await e.database.targetHasData())throw Error(`${i} already has a database named '${t.database.name}' with tables in it. Restoring this site's dump over it would destroy that data. Rename or drop it on the target first, or point this project at a different database name.`);let p=[{id:"pause-workers",title:`Stop background work on ${s} so the snapshot is consistent`,satisfied:async()=>F(await e.runOnSource(W(r,n))),apply:async()=>{await e.runOnSource(B(r,n))}},...e.database?[{id:"database-dump",title:`Dump the '${t.database?.name}' database on ${s}`,satisfied:async()=>!1,apply:()=>e.database.dump()}]:[],{id:"snapshot",title:`Archive the site's tree and units on ${s}`,change:{from:`${s}:${o}`,to:h(r,n)},satisfied:async()=>!1,apply:async()=>{await e.runOnSource(V(r,n,o))}},{id:"transfer",title:`Carry the archive to ${i}`,change:{from:s,to:i},satisfied:()=>e.archiveStaged(),apply:()=>e.transferArchive()},...e.database?[{id:"database-transfer",title:`Carry the database dump to ${i}`,change:{from:s,to:i},satisfied:()=>e.database.dumpStaged(),apply:()=>e.database.transferDump()},{id:"database-restore",title:`Create and load '${t.database?.name}' on ${i}`,satisfied:async()=>!1,apply:()=>e.database.restore()}]:[],{id:"restore",title:`Unpack the site on ${i} and start it`,change:{from:h(r,n),to:`${i}:${o}`},satisfied:async()=>K(await e.runOnTarget(G(r,n,o))),apply:async()=>{await e.runOnTarget(q(r,n,o))}}];if(t.port!=null){let{port:c}=t;p.push({id:"health",title:`Wait for the site to answer on ${i} (127.0.0.1:${c})`,satisfied:async()=>!1,apply:async()=>{await e.runOnTarget(Z(c,t.healthCheckPath??"/"))}})}return p.push(...e.certificates?[{id:"certificates",title:`Carry the site's TLS material to ${i}`,satisfied:()=>e.certificates.inPlace(),apply:()=>e.certificates.carry()}]:[],{id:"gateway",title:`Route the site on ${i}`,satisfied:()=>e.targetRoutesSite(),apply:()=>e.refreshTargetGateway()},{id:"dns",title:`Point DNS at ${i}`,change:{from:`${s}`,to:a},satisfied:async()=>await e.publishedAddress()===a,apply:async()=>{let c=await e.cutoverDns();if(c.length>0)throw Error(c.join("; "))}},{id:"drain-source",title:`Stop the site on ${s}, leaving its files in place`,satisfied:async()=>X(await e.runOnSource(Q(r,n))),apply:async()=>{await e.runOnSource(J(r,n))}}),{operation:"site:move",target:n,steps:p}}export{Y as zi,tt as Ai,et as Bi,D as Ci,T as Di,R as Ei,it as Fi,_ as Gi,I as Hi,st as Ii,ot as Ji,H as Ki,at as Li,lt as Mi,v as Ni,M as Oi,dt as Pi,pt as Qi,z as Ri,gt as Si,ht as Ti,$t as Ui,yt as Vi,vt as Wi,St as Xi,bt as Yi,h as Zi,w as _i,B as $i,W as aj,F as bj,V as cj,q as dj,G as ej,K as fj,Z as gj,J as hj,Q as ij,X as jj,xt as kj,Ot as lj,Pt as mj,kt as nj,Ct as oj,Dt as pj,Tt as qj};
|
package/dist/chunk-xkw7h4pw.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Wf as a}from"./chunk-fbwpm0zm.js";import"./chunk-a368cs92.js";import"./chunk-0hw5wjjg.js";export{a as RDSClient};
|