@stacksjs/ts-cloud 0.12.16 → 0.13.1
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-9wjgxjqp.js → chunk-22c3pk8s.js} +48 -48
- package/dist/bin/chunk-2ahgpy3j.js +2 -0
- package/dist/bin/chunk-2synp9gh.js +1 -0
- package/dist/bin/{chunk-zhpzxnpg.js → chunk-2v0qm547.js} +1 -1
- package/dist/bin/{chunk-52wgrpe8.js → chunk-88ysj8n5.js} +1 -1
- package/dist/bin/{chunk-6tty6sjf.js → chunk-8bbw6qc2.js} +1 -1
- package/dist/bin/{chunk-2shtky1g.js → chunk-9qndhwbe.js} +1 -1
- package/dist/bin/{chunk-a76krpa1.js → chunk-bdgkeqv6.js} +1 -1
- package/dist/bin/chunk-c82rh7qe.js +1 -0
- package/dist/bin/{chunk-e3d9m062.js → chunk-d4bb9qg9.js} +1 -1
- package/dist/bin/{chunk-tpjepvwa.js → chunk-d6kqbp8q.js} +1 -1
- package/dist/bin/{chunk-a8rn2wym.js → chunk-dk38j1qr.js} +9 -9
- package/dist/bin/{chunk-9vrnrxay.js → chunk-e1cxh9rj.js} +2 -2
- package/dist/bin/{chunk-9k60q9qz.js → chunk-edaq5jef.js} +3 -3
- package/dist/bin/{chunk-srw2jmh3.js → chunk-fbycbnvj.js} +4 -4
- package/dist/bin/chunk-fj89173b.js +1 -0
- package/dist/bin/{chunk-xyk8qe2c.js → chunk-gxwsq3k0.js} +21 -21
- package/dist/bin/{chunk-ebdybz7x.js → chunk-hwp5xp1c.js} +35 -35
- package/dist/bin/{chunk-ndbtr4mb.js → chunk-jee6msvx.js} +3 -3
- package/dist/bin/chunk-kjatss6s.js +1 -0
- package/dist/bin/{chunk-mekcw1zn.js → chunk-kxa4t4wh.js} +2 -2
- package/dist/bin/{chunk-8sxb2rr0.js → chunk-m5sjzxm3.js} +1 -1
- package/dist/bin/{chunk-7xszcdqn.js → chunk-n56c0j1e.js} +4 -4
- package/dist/bin/{chunk-be7rhw60.js → chunk-rzt92fwv.js} +3 -3
- package/dist/bin/{chunk-zav02r6k.js → chunk-vwzgtsn9.js} +1 -1
- package/dist/bin/{chunk-dvm4n8m8.js → chunk-w0g72e50.js} +1 -1
- package/dist/bin/chunk-wb8y7zey.js +1 -0
- package/dist/bin/{chunk-y24gfke7.js → chunk-x4gsw45d.js} +5 -5
- package/dist/bin/{chunk-hzj5r6b7.js → chunk-xs62dg7t.js} +2 -2
- package/dist/bin/{chunk-k7w2ztw9.js → chunk-xtp2zf3j.js} +1 -1
- package/dist/bin/{chunk-5qann9n2.js → chunk-xw9vcdwt.js} +1 -1
- package/dist/bin/{chunk-3zq0wkz2.js → chunk-y671cgz5.js} +1 -1
- package/dist/bin/cli.js +76 -76
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/chunk-05qawkra.js +1 -0
- package/dist/{chunk-qszktnnz.js → chunk-0g2jkhy5.js} +1 -1
- package/dist/{chunk-crpjqnjb.js → chunk-2s65yj3g.js} +4 -4
- package/dist/chunk-3qtce4mm.js +1 -0
- package/dist/chunk-3tt5em2c.js +1 -0
- package/dist/{chunk-hw3p6pth.js → chunk-42kv07cs.js} +1 -1
- package/dist/{chunk-nr1bdzwy.js → chunk-65ajja2a.js} +1 -1
- package/dist/{chunk-rtg6nw3n.js → chunk-6gtqjsg9.js} +3 -3
- package/dist/{chunk-a7v15116.js → chunk-8s9m8pyb.js} +1 -1
- package/dist/chunk-a1p70h5d.js +2 -0
- package/dist/{chunk-j9rv5m58.js → chunk-asmv4fw1.js} +19 -19
- package/dist/{chunk-a6zymyfs.js → chunk-ds92qg3g.js} +4 -4
- package/dist/{chunk-93mgdgd5.js → chunk-dzqz1sm0.js} +3 -3
- package/dist/{chunk-wz57brcf.js → chunk-hyj2ymp1.js} +6 -6
- package/dist/{chunk-1zz5n6q8.js → chunk-j7vsrx9g.js} +5 -5
- package/dist/chunk-jdq95b4h.js +1 -0
- package/dist/{chunk-wxv3ypt5.js → chunk-m5r0dt28.js} +2 -2
- package/dist/{chunk-bga3mw5f.js → chunk-mcfdtg5w.js} +1 -1
- package/dist/{chunk-4ywy6dp5.js → chunk-ngdhqwf3.js} +3 -3
- package/dist/{chunk-6znnde1s.js → chunk-nhtz2k8d.js} +5 -5
- package/dist/{chunk-kazw813q.js → chunk-nw0tvrrr.js} +1 -1
- package/dist/{chunk-d1tv3wx0.js → chunk-p9fqsz06.js} +2 -2
- package/dist/{chunk-qzwack6w.js → chunk-r4dpn715.js} +7 -7
- package/dist/{chunk-ajq92t46.js → chunk-t5tvt2r3.js} +124 -124
- package/dist/{chunk-jk7ecnmc.js → chunk-vk513ge7.js} +78 -78
- package/dist/{chunk-mherymtx.js → chunk-w5fmaaxa.js} +4 -4
- package/dist/chunk-wr7tn9j5.js +1 -0
- package/dist/{chunk-7hjsnwcv.js → chunk-xqx5szta.js} +27 -27
- package/dist/{chunk-thghrpf9.js → chunk-y13zcbnp.js} +101 -101
- package/dist/{chunk-bgrre2px.js → chunk-z7v4evbh.js} +2 -2
- package/dist/deploy/index.js +1 -1
- package/dist/dns/delegate-from-config.d.ts +50 -0
- package/dist/dns/delegate-from-config.test.d.ts +1 -0
- package/dist/dns/delegation.d.ts +110 -0
- package/dist/dns/delegation.test.d.ts +1 -0
- package/dist/dns/index.d.ts +4 -0
- package/dist/dns/index.js +1 -1
- package/dist/dns/porkbun-nameservers.test.d.ts +1 -0
- package/dist/drivers/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +49 -49
- package/dist/operations/index.js +1 -1
- package/dist/protection/index.js +1 -1
- package/dist/spend/index.js +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +6 -6
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +1 -1
- 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 +5 -5
- 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 +6 -6
- package/dist/ui/operations/spend.html +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +2 -2
- package/dist/ui/server/actions.html +6 -6
- package/dist/ui/server/activity.html +1 -1
- package/dist/ui/server/capacity.html +6 -6
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +6 -6
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +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 +5 -5
- 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 +5 -5
- package/package.json +3 -3
- package/dist/bin/chunk-005sxfmc.js +0 -1
- package/dist/bin/chunk-4vgbynq6.js +0 -1
- package/dist/bin/chunk-bwvnfc74.js +0 -1
- package/dist/bin/chunk-cy4wwpnf.js +0 -1
- package/dist/bin/chunk-dxfsq94k.js +0 -2
- package/dist/bin/chunk-dy10cmt9.js +0 -1
- package/dist/chunk-8fcrgq31.js +0 -1
- package/dist/chunk-8msfne57.js +0 -2
- package/dist/chunk-eadp23eh.js +0 -1
- package/dist/chunk-jpbgr1wg.js +0 -1
- package/dist/chunk-w7710vzg.js +0 -1
- package/dist/chunk-xfdpxsbc.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{u}from"./chunk-pdw0qjq1.js";import{O}from"./chunk-p197a99s.js";var D=new Set(["A","AAAA","CNAME"]);function P(e,t=""){return e===408||e===409||e===425||e===429||e>=500||/rate limit|temporar|timed? ?out|try again/i.test(t)}async function v(e,t){let r=t?.headers.get("retry-after"),n=r===null||r===void 0?void 0:Number(r)*1000,s=Number.isFinite(n)?Math.max(0,n):Math.min(1000*2**(e-1),30000);await new Promise((o)=>setTimeout(o,s))}class ze{name="porkbun";apiKey;secretKey;requestTimeoutMs;constructor(e,t,r=15000){this.apiKey=e,this.secretKey=t,this.requestTimeoutMs=r}async request(e,t={}){let r;for(let n=1;n<=8;n+=1){let s,o=new AbortController,i=setTimeout(()=>{o.abort(Error(`Porkbun API request timed out after ${this.requestTimeoutMs}ms`))},this.requestTimeoutMs);try{s=await fetch(`https://api.porkbun.com/api/json/v3${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apikey:this.apiKey,secretapikey:this.secretKey,...t}),signal:o.signal})}catch(c){if(r=c,n===8)throw c;await v(n);continue}finally{clearTimeout(i)}if(!s.ok){if(r=Error(`Porkbun API error: ${s.status} ${s.statusText}`),!P(s.status)||n===8)throw r;await v(n,s);continue}let a=await s.json();if(a.status==="ERROR"){if(r=Error(`Porkbun API error: ${a.message||"Unknown error"}`),!P(0,a.message)||n===8)throw r;await v(n,s);continue}return a}throw r}getSubdomain(e,t){let r=e.replace(/\.$/,""),n=t.replace(/\.$/,"");if(r===n)return"";if(r.endsWith(`.${n}`))return r.slice(0,-(n.length+1));return r}getRootDomain(e){let t=e.replace(/\.$/,"").split(".");if(t.length>=2)return t.slice(-2).join(".");return e}static ADDRESS_TYPES=new Set(["A","AAAA"]);async clearConflictingAliases(e,t){if(!ze.ADDRESS_TYPES.has(t.type))return[];let r=this.getRootDomain(e),n=this.getSubdomain(t.name,r),s=await this.listRecords(e);if(!s.success)return[`could not list records to clear ALIAS/CNAME conflicts: ${s.message??"unknown provider error"}`];let o=[];for(let i of s.records){if(i.type!=="ALIAS"&&i.type!=="CNAME")continue;if(this.getSubdomain(i.name,r)!==n)continue;let a=await this.deleteRecord(e,i);if(!a.success)o.push(`could not remove conflicting ${i.type} on ${i.name}: ${a.message??"unknown provider error"}`)}return o}async addressRecordExists(e,t){let r=this.getRootDomain(e),n=this.getSubdomain(t.name,r),s=await this.listRecords(e);if(!s.success)return!0;return s.records.some((o)=>o.type===t.type&&this.getSubdomain(o.name,r)===n&&o.content===t.content)}async createRecord(e,t){try{let r=this.getRootDomain(e),n=this.getSubdomain(t.name,r),s={type:t.type,content:t.content,ttl:String(t.ttl||600)};if(n)s.name=n;if((t.type==="MX"||t.type==="SRV")&&t.priority!==void 0)s.prio=String(t.priority);if(t.type==="SRV"&&t.weight!==void 0&&t.port!==void 0)s.content=`${t.weight} ${t.port} ${t.content}`;let o=await this.clearConflictingAliases(e,t),i=await this.request(`/dns/create/${r}`,s);if(ze.ADDRESS_TYPES.has(t.type)&&!await this.addressRecordExists(e,t))return{success:!1,message:`Porkbun reported success but no ${t.type} record for ${t.name} exists${o.length>0?` (${o.join("; ")})`:""}. A conflicting ALIAS/CNAME on the same name silently voids the write.`};return{success:!0,id:i.id?.toString(),message:"Record created successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async upsertRecord(e,t){try{let r=this.getRootDomain(e),n=this.getSubdomain(t.name,r),s=await this.listRecords(e,t.type);if(s.success){let o=s.records.find((i)=>this.getSubdomain(i.name,r)===n&&i.type===t.type);if(o?.id){let i={type:t.type,content:t.content,ttl:String(t.ttl||600)};if(n)i.name=n;if((t.type==="MX"||t.type==="SRV")&&t.priority!==void 0)i.prio=String(t.priority);if(t.type==="SRV"&&t.weight!==void 0&&t.port!==void 0)i.content=`${t.weight} ${t.port} ${t.content}`;return await this.request(`/dns/edit/${r}/${o.id}`,i),{success:!0,id:o.id,message:"Record updated successfully"}}}return this.createRecord(e,t)}catch(r){return this.createRecord(e,t)}}async deleteRecord(e,t){try{let r=this.getRootDomain(e);if("id"in t&&t.id)return await this.request(`/dns/delete/${r}/${t.id}`),{success:!0,message:"Record deleted successfully"};let n=this.getSubdomain(t.name,r),s=await this.listRecords(e);if(!s.success)return{success:!1,message:"Failed to list records"};let o=s.records.find((i)=>this.getSubdomain(i.name,r)===n&&i.type===t.type&&i.content===t.content);if(!o?.id)return{success:!1,message:"Record not found"};return await this.request(`/dns/delete/${r}/${o.id}`),{success:!0,message:"Record deleted successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async listRecords(e,t){try{let r=this.getRootDomain(e),n=`/dns/retrieve/${r}`;if(t)n=`/dns/retrieveByNameType/${r}/${t}`;return{success:!0,records:((await this.request(n)).records||[]).map((i)=>({id:i.id,name:i.name||r,type:i.type,content:i.content,ttl:Number.parseInt(i.ttl,10),priority:i.prio?Number.parseInt(i.prio,10):void 0}))}}catch(r){return{success:!1,records:[],message:r instanceof Error?r.message:"Unknown error"}}}async canManageDomain(e){try{let t=this.getRootDomain(e);return await this.request(`/dns/retrieve/${t}`),!0}catch{return!1}}async listDomains(){try{return((await this.request("/domain/listAll")).domains||[]).map((t)=>t.domain)}catch{return[]}}async getNameServers(e){try{let t=this.getRootDomain(e);return(await this.request(`/domain/getNs/${t}`)).ns||[]}catch{return[]}}async updateNameServers(e,t){try{let r=this.getRootDomain(e);return await this.request(`/domain/updateNs/${r}`,{ns:t}),!0}catch{return!1}}}class xt{name="godaddy";apiKey;apiSecret;baseUrl;constructor(e,t="",r="production"){this.apiKey=e,this.apiSecret=t,this.baseUrl=r==="ote"?"https://api.ote-godaddy.com":"https://api.godaddy.com"}authorization(){if(!this.apiSecret||this.apiKey.startsWith("gd_pat_"))return`Bearer ${this.apiKey}`;return`sso-key ${this.apiKey}:${this.apiSecret}`}async request(e,t,r){let n=`${this.baseUrl}${t}`,s={Authorization:this.authorization(),"Content-Type":"application/json",Accept:"application/json"},o={method:e,headers:s};if(r)o.body=JSON.stringify(r);let i=await fetch(n,o);if(i.status===204)return{};if(i.ok){let c=await i.text();if(c)return JSON.parse(c);return{}}let a=`GoDaddy API error: ${i.status} ${i.statusText}`;try{let c=await i.json();if(c.message)a=`GoDaddy API error: ${c.message}`;if(c.fields)a+=` - Fields: ${JSON.stringify(c.fields)}`}catch{}throw Error(a)}getSubdomain(e,t){let r=e.replace(/\.$/,""),n=t.replace(/\.$/,"");if(r===n)return"@";if(r.endsWith(`.${n}`))return r.slice(0,-(n.length+1));return r}getRootDomain(e){let t=e.replace(/\.$/,"").split(".");if(t.length>=2)return t.slice(-2).join(".");return e}toGoDaddyRecord(e,t){let r=this.getRootDomain(t),n=this.getSubdomain(e.name,r),s={type:e.type,name:n,data:e.content,ttl:e.ttl||600};if(e.type==="MX"&&e.priority!==void 0)s.priority=e.priority;return s}fromGoDaddyRecord(e,t){let r=this.getRootDomain(t),n=e.name;if(n==="@")n=r;else if(!n.endsWith(r))n=`${n}.${r}`;return{name:n,type:e.type,content:e.data,ttl:e.ttl,priority:e.priority}}async createRecord(e,t){try{let r=this.getRootDomain(e),n=this.toGoDaddyRecord(t,e);return await this.request("PATCH",`/v1/domains/${r}/records`,[n]),{success:!0,message:"Record created successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async upsertRecord(e,t){try{let r=this.getRootDomain(e),n=this.toGoDaddyRecord(t,e);return await this.request("PUT",`/v1/domains/${r}/records/${t.type}/${n.name}`,[n]),{success:!0,message:"Record upserted successfully"}}catch(r){return this.createRecord(e,t)}}async deleteRecord(e,t){try{let r=this.getRootDomain(e),n=this.getSubdomain(t.name,r),s=await this.request("GET",`/v1/domains/${r}/records/${t.type}/${n}`),o=s.filter((i)=>i.data!==t.content);if(o.length===s.length)return{success:!1,message:"Record not found"};if(o.length===0)try{await this.request("DELETE",`/v1/domains/${r}/records/${t.type}/${n}`)}catch{}else await this.request("PUT",`/v1/domains/${r}/records/${t.type}/${n}`,o);return{success:!0,message:"Record deleted successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async listRecords(e,t){try{let r=this.getRootDomain(e),n=`/v1/domains/${r}/records`;if(t)n=`/v1/domains/${r}/records/${t}`;return{success:!0,records:(await this.request("GET",n)).map((o)=>this.fromGoDaddyRecord(o,e))}}catch(r){return{success:!1,records:[],message:r instanceof Error?r.message:"Unknown error"}}}async canManageDomain(e){try{let t=this.getRootDomain(e);return await this.request("GET",`/v1/domains/${t}`),!0}catch{return!1}}async listDomains(){try{return(await this.request("GET","/v1/domains")).map((t)=>t.domain)}catch{return[]}}async getDomainDetails(e){try{let t=this.getRootDomain(e),r=await this.request("GET",`/v1/domains/${t}`);return{domain:r.domain,status:r.status,nameServers:r.nameServers,expires:r.expires}}catch{return null}}async getNameServers(e){return(await this.getDomainDetails(e))?.nameServers??[]}async updateNameServers(e,t){try{let r=this.getRootDomain(e);return await this.request("PATCH",`/v1/domains/${r}`,{nameServers:t}),!0}catch{return!1}}async checkDomainAvailability(e){try{let t=await this.request("GET",`/v1/domains/available?domain=${encodeURIComponent(e)}`);return{available:t.available,price:t.price,currency:t.currency}}catch{return{available:!1}}}}var b="https://api.cloudflare.com/client/v4",w="[ts-cloud]";class qe{name="cloudflare";apiToken;zoneCache=new Map;configuredZoneId;accountId;configuredZoneName;constructor(e,t={}){this.apiToken=e,this.configuredZoneId=t.zoneId,this.accountId=t.accountId}async request(e,t,r){let n=`${b}${t}`,s={Authorization:`Bearer ${this.apiToken}`,"Content-Type":"application/json"},o={method:e,headers:s};if(r)o.body=JSON.stringify(r);let a=await(await fetch(n,o)).json();if(!a.success){let c=a.errors.map((d)=>d.message).join(", ");throw Error(`Cloudflare API error: ${c}`)}return a}getRootDomain(e){let t=e.replace(/\.$/,"").split(".");if(t.length>=2)return t.slice(-2).join(".");return e}async resolveZone(e){let t=e.replace(/\.$/,"").toLowerCase();if(this.configuredZoneId){let i=await this.resolveConfiguredZoneName();if(i&&(t===i||t.endsWith(`.${i}`)))return{id:this.configuredZoneId,name:i}}let r=this.getRootDomain(t),n=this.zoneCache.get(r);if(n)return{id:n,name:r};let s=await this.request("GET",`/zones?name=${encodeURIComponent(r)}`);if(!s.result||s.result.length===0)throw Error(`Zone not found for domain: ${r}. `+"If the API token is scoped to a single zone, set its zone id (CLOUDFLARE_ZONE_ID) — "+"zone lookup by name needs account-wide Zone:Read.");let o=s.result[0].id;return this.zoneCache.set(r,o),{id:o,name:s.result[0].name||r}}async resolveConfiguredZoneName(){if(!this.configuredZoneId)return;if(this.configuredZoneName)return this.configuredZoneName;try{let t=(await this.request("GET",`/zones/${this.configuredZoneId}`)).result?.name?.toLowerCase();if(!t)return;return this.configuredZoneName=t,this.zoneCache.set(t,this.configuredZoneId),t}catch{return}}async getZoneId(e){return(await this.resolveZone(e)).id}getFullRecordName(e,t){let r=e.replace(/\.$/,"");if(!r||r===t||r==="@")return t;if(r.endsWith(`.${t}`))return r;return`${r}.${t}`}toCloudflareRecord(e,t,r){let n={type:e.type,name:this.getFullRecordName(e.name,t),content:e.content||e.value||"",ttl:e.ttl||1},s=r??e.proxied;if(s!==void 0&&D.has(e.type)){if(n.proxied=s,s)n.ttl=1}if(e.type==="MX"&&e.priority!==void 0)n.priority=e.priority;if(e.type==="SRV"){let o=I(e);if(o)n.data=o,delete n.content,delete n.priority;else if(e.priority!==void 0)n.priority=e.priority}return n}fromCloudflareRecord(e){return{id:e.id,name:e.name,type:e.type,content:e.content,ttl:e.ttl,priority:e.priority,proxied:e.proxied}}async createRecord(e,t){try{let r=await this.resolveZone(e),n=this.toCloudflareRecord(t,r.name);return{success:!0,id:(await this.request("POST",`/zones/${r.id}/dns_records`,n)).result.id,message:"Record created successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async upsertRecord(e,t){try{let r=await this.resolveZone(e),n=this.getFullRecordName(t.name,r.name),o=(await this.request("GET",`/zones/${r.id}/dns_records?type=${t.type}&name=${encodeURIComponent(n)}`)).result?.[0],i=t.proxied??o?.proxied,a=this.toCloudflareRecord(t,r.name,i);if(o)return{success:!0,id:(await this.request("PUT",`/zones/${r.id}/dns_records/${o.id}`,a)).result.id,message:"Record updated successfully"};return{success:!0,id:(await this.request("POST",`/zones/${r.id}/dns_records`,a)).result.id,message:"Record created successfully"}}catch(r){return this.createRecord(e,t)}}async deleteRecord(e,t){try{let r=await this.resolveZone(e),n=r.id,s=this.getFullRecordName(t.name,r.name),o=await this.request("GET",`/zones/${n}/dns_records?type=${t.type}&name=${encodeURIComponent(s)}`);if(!o.result||o.result.length===0)return{success:!1,message:"Record not found"};let i=o.result.find((a)=>a.content===t.content);if(!i)return{success:!1,message:"Record with matching content not found"};return await this.request("DELETE",`/zones/${n}/dns_records/${i.id}`),{success:!0,message:"Record deleted successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async listRecords(e,t){try{let n=`/zones/${await this.getZoneId(e)}/dns_records?per_page=100`;if(t)n+=`&type=${t}`;let s=[],o=1,i=!0;while(i){let a=await this.request("GET",`${n}&page=${o}`);if(s.push(...a.result||[]),a.result_info)i=o<a.result_info.total_pages,o++;else i=!1}return{success:!0,records:s.map((a)=>this.fromCloudflareRecord(a))}}catch(r){return{success:!1,records:[],message:r instanceof Error?r.message:"Unknown error"}}}async canManageDomain(e){try{return await this.getZoneId(e),!0}catch{return!1}}async listDomains(){try{let e=[],t=1,r=!0;while(r){let n=await this.request("GET",`/zones?per_page=50&page=${t}`);if(e.push(...n.result||[]),n.result_info)r=t<n.result_info.total_pages,t++;else r=!1}return e.map((n)=>n.name)}catch{return[]}}async createZone(e,t={}){let r=e.replace(/\.$/,"").toLowerCase(),n=t.accountId??this.accountId;if(!n)throw Error(`Cannot create zone ${r}: no Cloudflare account id. Set CLOUDFLARE_ACCOUNT_ID, or pass accountId.`);let s=await this.getZoneDetails(r);if(s)return{...s,created:!1};try{let i=(await this.request("POST","/zones",{name:r,account:{id:n},jump_start:t.jumpStart??!1})).result;return this.zoneCache.set(i.name,i.id),{id:i.id,name:i.name,status:i.status,nameServers:i.name_servers??[],created:!0}}catch(o){let i=o instanceof Error?o.message:String(o);if(!/already exists|1061/i.test(i))throw o;let a=await this.getZoneDetails(r);if(!a)throw o;return{...a,created:!1}}}async getZoneDetails(e){try{let t=await this.getZoneId(e),r=await this.request("GET",`/zones/${t}`);return{id:r.result.id,name:r.result.name,status:r.result.status,nameServers:r.result.name_servers,paused:r.result.paused}}catch{return null}}async listEdgeCertificateHosts(e){try{let t=await this.getZoneId(e),r=await this.request("GET",`/zones/${t}/ssl/certificate_packs?per_page=50`),n=new Set;for(let s of r.result||[]){if(s.status!=="active")continue;for(let o of s.hosts||[])n.add(o.toLowerCase())}return[...n]}catch{return null}}async purgeCache(e,t){try{let r=await this.getZoneId(e),n={};if(t?.purgeEverything)n.purge_everything=!0;else{if(t?.files)n.files=t.files;if(t?.tags)n.tags=t.tags;if(t?.hosts)n.hosts=t.hosts}if(Object.keys(n).length===0)n.purge_everything=!0;return await this.request("POST",`/zones/${r}/purge_cache`,n),!0}catch{return!1}}async getRecordProxyStatus(e,t){try{let r=await this.resolveZone(e),n=r.id,s=this.getFullRecordName(t.name,r.name),o=await this.request("GET",`/zones/${n}/dns_records?type=${t.type}&name=${encodeURIComponent(s)}`);if(o.result&&o.result.length>0)return o.result.find((a)=>a.content===t.content)?.proxied??null;return null}catch{return null}}async setRecordProxyStatus(e,t,r){try{let n=await this.resolveZone(e),s=n.id,o=this.getFullRecordName(t.name,n.name),i=await this.request("GET",`/zones/${s}/dns_records?type=${t.type}&name=${encodeURIComponent(o)}`);if(!i.result||i.result.length===0)return!1;let a=i.result.find((c)=>c.content===t.content);if(!a)return!1;return await this.request("PATCH",`/zones/${s}/dns_records/${a.id}`,{proxied:r}),!0}catch{return!1}}async zoneIdFor(e){return this.getZoneId(e)}get account(){return this.accountId}async getZoneSettings(e){let t=await this.getZoneId(e),r=await this.request("GET",`/zones/${t}/settings`),n={};for(let s of r.result||[])n[s.id]=s.value;return n}async applyZoneSettings(e,t){let r=await this.getZoneId(e),n=await this.getZoneSettings(e).catch(()=>({})),s=[],o=[];for(let[i,a]of Object.entries(t)){if(a===void 0)continue;let c=n[i];if(c!==void 0&&A(c,a))continue;try{await this.request("PATCH",`/zones/${r}/settings/${i}`,{value:a}),s.push({id:i,from:c,to:a})}catch(d){o.push({id:i,error:d instanceof Error?d.message:String(d)})}}return{changed:s,failed:o}}async getPhaseRules(e,t){let r=await this.getZoneId(e);try{return(await this.request("GET",`/zones/${r}/rulesets/phases/${t}/entrypoint`)).result?.rules||[]}catch{return[]}}async putManagedPhaseRules(e,t,r){try{let n=await this.getZoneId(e),o=(await this.getPhaseRules(e,t)).filter((c)=>!(c.description||"").startsWith(w)),i=r.map((c)=>({...c,description:c.description?.startsWith(w)?c.description:`${w} ${c.description||t}`})),a=[...o,...i].map(({id:c,...d})=>d);return await this.request("PUT",`/zones/${n}/rulesets/phases/${t}/entrypoint`,{rules:a}),{success:!0}}catch(n){return{success:!1,message:n instanceof Error?n.message:String(n)}}}}function A(e,t){if(e===t)return!0;if(typeof e!==typeof t||e===null||t===null)return!1;if(typeof e!=="object")return!1;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;return e.every((s,o)=>A(s,t[o]))}let r=e,n=t;return Object.keys(n).every((s)=>A(r[s],n[s]))}function I(e){let t=(e.content||e.value||"").trim();if(e.weight!==void 0&&e.port!==void 0&&e.priority!==void 0&&t)return{priority:e.priority,weight:e.weight,port:e.port,target:N(t)};let r=t.split(/\s+/);if(r.length<4)return null;let[n,s,o]=r.slice(0,3).map(Number);if(![n,s,o].every(Number.isFinite))return null;return{priority:n,weight:s,port:o,target:N(r.slice(3).join(" "))}}function N(e){return e.replace(/\.$/,"")}var E=new Set(["A","AAAA","CNAME","ALIAS"]);function h(e){let t=e.trim().replace(/^"|"$/g,"").toLowerCase();if(t.startsWith("v=spf1"))return"v=spf1";if(t.startsWith("v=dmarc1"))return"v=dmarc1";return}function f(e){return e.trim().replace(/^"(.*)"$/s,"$1")}function R(e){return e.replace(/\.$/,"").toLowerCase()}function S(e,t){let r=R(t),n=(e??"@").trim();if(!n||n==="@")return r;let s=R(n);if(s===r||s.endsWith(`.${r}`))return s;return`${s}.${r}`}function Oi(e,t){return e.map((r)=>({...r,name:S(r.name,t),proxied:r.proxied??!1}))}function x(e,t){if(e.type!==t.type)return!1;if(R(e.name)!==R(t.name))return!1;if(E.has(t.type))return!0;if(t.type==="TXT"){let r=h(t.content);if(r)return h(f(e.content))===r;return f(e.content)===f(t.content)}return f(e.content)===f(t.content)}function k(e,t){if(f(e.content)!==f(t.content))return!1;if(t.priority!==void 0&&e.priority!==t.priority)return!1;if(t.proxied!==void 0&&e.proxied!==void 0&&e.proxied!==t.proxied)return!1;return!0}async function Li(e){let{provider:t,zone:r,records:n}=e,s={outcomes:[],warnings:[]};if(n.length===0)return s;let o=await t.listRecords(r);if(!o.success)return s.warnings.push(`could not list ${r}: ${o.message||"unknown provider error"} — records not reconciled`),s;let i=o.records;for(let a of n){let c=i.filter((l)=>x(l,a));if(c.length>0&&c.every((l)=>k(l,a))){s.outcomes.push({record:a,action:"unchanged"});continue}let d={name:a.name,type:a.type,content:a.content,ttl:a.ttl??3600,...a.priority!==void 0?{priority:a.priority}:{},...a.proxied!==void 0?{proxied:a.proxied}:{}},m=a.type==="TXT"&&h(a.content)!==void 0;if(m)for(let l of c){let C=await t.deleteRecord(r,{name:l.name,type:l.type,content:l.content});if(!C.success)s.warnings.push(`could not remove superseded ${l.type} at ${l.name}: ${C.message||"unknown error"}`)}let p=m||c.length===0?await t.createRecord(r,d):await t.upsertRecord(r,d);if(p.success)s.outcomes.push({record:a,action:c.length>0?"updated":"created"});else s.outcomes.push({record:a,action:"failed",message:p.message})}for(let a of["MX"]){let c=new Set(n.filter((d)=>d.type===a).map((d)=>R(d.name)));for(let d of c){let m=new Set(n.filter((l)=>l.type===a&&R(l.name)===d).map((l)=>f(l.content).toLowerCase())),p=i.filter((l)=>l.type===a&&R(l.name)===d&&!m.has(f(l.content).toLowerCase()));for(let l of p)s.warnings.push(`${d} has an undeclared ${a} record (${l.content}) alongside the declared one — mail will be split between them. Remove it at the provider if it is stale.`)}}return s}class jr{name="route53";client;hostedZoneCache=new Map;providedHostedZoneId;constructor(e="us-east-1",t){this.client=new O(e),this.providedHostedZoneId=t}getRootDomain(e){let t=e.replace(/\.$/,"").split(".");if(t.length>=2)return t.slice(-2).join(".");return e}async getHostedZoneId(e){if(this.providedHostedZoneId)return this.providedHostedZoneId;let t=this.getRootDomain(e),r=this.hostedZoneCache.get(t);if(r)return r;let n=await this.client.findHostedZoneForDomain(e);if(n){let s=n.Id.replace("/hostedzone/","");return this.hostedZoneCache.set(t,s),s}return null}normalizeName(e,t){let r=e.replace(/\.$/,""),n=t.replace(/\.$/,"");if(!n||n==="@")return`${r}.`;if(n===r||n.endsWith(`.${r}`))return`${n}.`;return`${n}.${r}.`}async createRecord(e,t){try{let r=await this.getHostedZoneId(e);if(!r)return{success:!1,message:`No hosted zone found for domain: ${e}`};let n=this.normalizeName(e,t.name),s=t.content;if(t.type==="TXT"&&!s.startsWith('"'))s=`"${s}"`;if(t.type==="MX"&&t.priority!==void 0)s=`${t.priority} ${s}`;return{success:!0,id:(await this.client.changeResourceRecordSets({HostedZoneId:r,ChangeBatch:{Comment:"Created by ts-cloud DNS provider",Changes:[{Action:"CREATE",ResourceRecordSet:{Name:n,Type:t.type,TTL:t.ttl||300,ResourceRecords:[{Value:s}]}}]}})).ChangeInfo?.Id,message:"Record created successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async upsertRecord(e,t){try{let r=await this.getHostedZoneId(e);if(!r)return{success:!1,message:`No hosted zone found for domain: ${e}`};let n=this.normalizeName(e,t.name),s=t.content;if(t.type==="TXT"&&!s.startsWith('"'))s=`"${s}"`;if(t.type==="MX"&&t.priority!==void 0)s=`${t.priority} ${s}`;return{success:!0,id:(await this.client.changeResourceRecordSets({HostedZoneId:r,ChangeBatch:{Comment:"Upserted by ts-cloud DNS provider",Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:n,Type:t.type,TTL:t.ttl||300,ResourceRecords:[{Value:s}]}}]}})).ChangeInfo?.Id,message:"Record upserted successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async deleteRecord(e,t){try{let r=await this.getHostedZoneId(e);if(!r)return{success:!1,message:`No hosted zone found for domain: ${e}`};let n=this.normalizeName(e,t.name),s=t.content;if(t.type==="TXT"&&!s.startsWith('"'))s=`"${s}"`;if(t.type==="MX"&&t.priority!==void 0)s=`${t.priority} ${s}`;return await this.client.changeResourceRecordSets({HostedZoneId:r,ChangeBatch:{Comment:"Deleted by ts-cloud DNS provider",Changes:[{Action:"DELETE",ResourceRecordSet:{Name:n,Type:t.type,TTL:t.ttl||300,ResourceRecords:[{Value:s}]}}]}}),{success:!0,message:"Record deleted successfully"}}catch(r){return{success:!1,message:r instanceof Error?r.message:"Unknown error"}}}async listRecords(e,t){try{let r=await this.getHostedZoneId(e);if(!r)return{success:!1,records:[],message:`No hosted zone found for domain: ${e}`};let n=await this.client.listResourceRecordSets({HostedZoneId:r,StartRecordType:t}),s=[];for(let o of n.ResourceRecordSets){if(t&&o.Type!==t)continue;if(o.AliasTarget)continue;for(let i of o.ResourceRecords||[]){let a=i.Value,c;if(o.Type==="MX"){let d=a.split(" ");if(d.length>=2)c=Number.parseInt(d[0],10),a=d.slice(1).join(" ")}if(o.Type==="TXT"&&a.startsWith('"')&&a.endsWith('"'))a=a.slice(1,-1);s.push({name:o.Name.replace(/\.$/,""),type:o.Type,content:a,ttl:o.TTL,priority:c})}}return{success:!0,records:s}}catch(r){return{success:!1,records:[],message:r instanceof Error?r.message:"Unknown error"}}}async canManageDomain(e){return await this.getHostedZoneId(e)!==null}async listDomains(){try{return(await this.client.listHostedZones()).HostedZones.map((t)=>t.Name.replace(/\.$/,""))}catch{return[]}}getRoute53Client(){return this.client}async createAliasRecord(e){try{let t=await this.getHostedZoneId(e.domain);if(!t)return{success:!1,message:`No hosted zone found for domain: ${e.domain}`};return{success:!0,id:(await this.client.createAliasRecord({HostedZoneId:t,Name:this.normalizeName(e.domain,e.name),TargetHostedZoneId:e.targetHostedZoneId,TargetDNSName:e.targetDnsName,EvaluateTargetHealth:e.evaluateTargetHealth,Type:e.type})).ChangeInfo?.Id,message:"Alias record created successfully"}}catch(t){return{success:!1,message:t instanceof Error?t.message:"Unknown error"}}}async createCloudFrontAlias(e){return this.createAliasRecord({domain:e.domain,name:e.name,targetHostedZoneId:O.CloudFrontHostedZoneId,targetDnsName:e.cloudFrontDomainName,evaluateTargetHealth:!1})}async createAlbAlias(e){let t=O.ALBHostedZoneIds[e.region];if(!t)return{success:!1,message:`Unknown region for ALB: ${e.region}`};return this.createAliasRecord({domain:e.domain,name:e.name,targetHostedZoneId:t,targetDnsName:e.albDnsName,evaluateTargetHealth:!0})}}async function Mi(e,t){let r=[],n,s;for(;;){let o=await e.listResourceRecordSets({HostedZoneId:t,StartRecordName:n,StartRecordType:s,MaxItems:"100"});if(r.push(...o.ResourceRecordSets),!o.IsTruncated)break;if(n=o.NextRecordName,s=o.NextRecordType,!n)break}return r}function g(e){return e.replace(/\.$/,"").toLowerCase()}function T(e){return e.replace(/\.$/,"")}function y(e){if(e.type==="SRV"&&e.weight!==void 0&&e.port!==void 0)return`${e.weight} ${e.port} ${T(e.content)}`;return T(e.content)}function M(e){let t=e.match(/"(?:[^"\\]|\\.)*"/g);if(!t)return e;return t.map((r)=>r.slice(1,-1).replace(/\\(.)/g,"$1")).join("")}function Ui(e,t){let r=g(t),n=[],s=[],o=[],i=new Set;for(let a of e){let c=g(a.Name),d=a.Type;if(d==="SOA"||d==="NS"&&c===r){s.push({name:c,type:d,reason:"owned by the destination provider"});continue}if(a.SetIdentifier){s.push({name:c,type:d,reason:`routing policy record (SetIdentifier=${a.SetIdentifier}) has no equivalent — recreate by hand`}),o.push(`${d} ${c} is part of a Route53 routing policy and was NOT migrated`);continue}if(a.AliasTarget){if(i.has(c))continue;i.add(c);let m=g(a.AliasTarget.DNSName);if(n.push({name:c,type:"CNAME",content:m,ttl:300,translatedFrom:`${d} ALIAS → ${m}`}),a.AliasTarget.EvaluateTargetHealth)o.push(`${c} was an ALIAS with health evaluation enabled; the CNAME that replaces it has no health check`);continue}for(let m of a.ResourceRecords||[]){let p=z(c,d,m.Value,a.TTL);if("reason"in p){s.push({name:c,type:d,reason:p.reason}),o.push(`${d} ${c}: ${p.reason}`);continue}n.push(p)}}return{zone:r,records:n,skipped:s,warnings:o}}function z(e,t,r,n){let s={name:e,ttl:n};switch(t){case"A":case"AAAA":case"CNAME":case"PTR":return{...s,type:t==="PTR"?"CNAME":t,content:g(r)};case"TXT":return{...s,type:"TXT",content:M(r)};case"MX":{let[o,...i]=r.trim().split(/\s+/);if(!i.length)return{reason:`malformed MX value "${r}"`};return{...s,type:"MX",content:g(i.join(" ")),priority:Number(o)}}case"SRV":{let o=r.trim().split(/\s+/);if(o.length<4)return{reason:`malformed SRV value "${r}"`};let[i,a,c]=o.slice(0,3).map(Number);return{...s,type:"SRV",content:g(o.slice(3).join(" ")),priority:i,weight:a,port:c}}case"NS":return{...s,type:"NS",content:g(r)};case"CAA":return{...s,type:"CAA",content:r.trim()};default:return{reason:`unsupported record type ${t}`}}}var U=new Set(["TXT","MX","SRV","NS","CAA"]);async function Bi(e,t){let r=[],n=[],s=new Set;try{let o=await e.listRecords(t.zone);for(let i of o.records||[])s.add(`${g(i.name)}|${i.type}|${y(i)}`)}catch{}for(let o of t.records){let i={...o,proxied:!1},a=`${g(o.name)}|${o.type}|${y(o)}`;if(!U.has(o.type)){let d=await e.upsertRecord(t.zone,i);if(d.success)r.push(o);else n.push({record:o,message:d.message||"unknown provider error"});continue}if(s.has(a)){r.push(o);continue}let c=await e.createRecord(t.zone,i);if(c.success)s.add(a),r.push(o);else n.push({record:o,message:c.message||"unknown provider error"})}return{applied:r,failed:n}}async function Fi(e,t){let r=await e.listRecords(t.zone),n=[],s=[],o=new Map;for(let i of r.records||[]){let a=`${g(i.name)}|${i.type}`,c=o.get(a)??[];c.push(y(i)),o.set(a,c)}for(let i of t.records){let a=o.get(`${g(i.name)}|${i.type}`),c=y(i);if(a?.some((d)=>d===c))n.push(i);else s.push({record:i,found:a?.join(", ")})}return{matched:n,missing:s,ok:s.length===0}}class _t{acm;dnsProvider;constructor(e,t="us-east-1"){if(this.acm=new q(t),"provider"in e)this.dnsProvider=L(e);else this.dnsProvider=e}getProvider(){return this.dnsProvider}async requestAndValidate(e){let{domainName:t,subjectAlternativeNames:r=[],waitForValidation:n=!1,maxWaitMinutes:s=30}=e,{CertificateArn:o}=await this.acm.requestCertificate({DomainName:t,SubjectAlternativeNames:r.length>0?[t,...r]:void 0,ValidationMethod:"DNS"});await this.waitForValidationOptions(o);let i=await this.acm.getDnsValidationRecords(o);for(let c of i){let d=await this.dnsProvider.upsertRecord(t,{name:c.recordName,type:c.recordType,content:c.recordValue,ttl:300});if(!d.success)console.warn(`Failed to create validation record for ${c.domainName}: ${d.message}`)}let a="pending";if(n)a=(await this.acm.waitForCertificateValidation(o,s*2,30000))?.Status==="ISSUED"?"issued":"failed";return{certificateArn:o,validationRecords:i.map((c)=>({domainName:c.domainName,recordName:c.recordName,recordType:c.recordType,recordValue:c.recordValue})),isNew:!0,status:a}}async createValidationRecords(e){let{certificateArn:t,domain:r}=e,n=[],s=await this.acm.getDnsValidationRecords(t);for(let o of s){let i=await this.dnsProvider.upsertRecord(r,{name:o.recordName,type:o.recordType,content:o.recordValue,ttl:300});if(!i.success)n.push(`Failed to create record for ${o.domainName}: ${i.message}`)}return{success:n.length===0,records:s.map((o)=>({domainName:o.domainName,recordName:o.recordName,recordType:o.recordType,recordValue:o.recordValue})),errors:n}}async deleteValidationRecords(e){let{certificateArn:t,domain:r}=e,n=[],s=await this.acm.getDnsValidationRecords(t);for(let o of s){let i=await this.dnsProvider.deleteRecord(r,{name:o.recordName,type:o.recordType,content:o.recordValue});if(!i.success)n.push(`Failed to delete record for ${o.domainName}: ${i.message}`)}return{success:n.length===0,errors:n}}async findOrCreateCertificate(e){let{domainName:t,subjectAlternativeNames:r=[],waitForValidation:n=!0,maxWaitMinutes:s}=e,o=await this.acm.findCertificateByDomain(t);if(o&&o.Status==="ISSUED"){let i=o.SubjectAlternativeNames||[o.DomainName],a=i.some((d)=>d===`*.${t}`);if(r.every((d)=>i.includes(d)||a))return{certificateArn:o.CertificateArn,validationRecords:[],isNew:!1,status:"issued"};console.log("Existing certificate doesn't cover all required SANs, requesting new certificate...")}return this.requestAndValidate({domainName:t,subjectAlternativeNames:r,waitForValidation:n,maxWaitMinutes:s})}async requestCertificateWithCommonSans(e){let{domainName:t,includeWww:r=!0,includeWildcard:n=!1,additionalSans:s=[],waitForValidation:o=!1}=e,i=[];if(r)i.push(`www.${t}`);if(n)i.push(`*.${t}`);return i.push(...s),this.requestAndValidate({domainName:t,subjectAlternativeNames:i,waitForValidation:o})}async waitForValidationOptions(e,t=30){for(let r=0;r<t;r++){let n=await this.acm.describeCertificate({CertificateArn:e});if(n.DomainValidationOptions&&n.DomainValidationOptions.length>0&&n.DomainValidationOptions[0].ResourceRecord)return;await new Promise((s)=>setTimeout(s,2000))}throw Error("Timeout waiting for DNS validation options")}async getCertificateStatus(e){let t=await this.acm.describeCertificate({CertificateArn:e});return{status:t.Status,domainValidations:(t.DomainValidationOptions||[]).map((r)=>({domain:r.DomainName,status:r.ValidationStatus||"UNKNOWN"}))}}}function L(e){switch(e.provider){case"route53":return new jr(e.region,e.hostedZoneId);case"porkbun":return new ze(e.apiKey,e.secretKey);case"godaddy":return new xt(e.apiKey,e.apiSecret,e.environment);case"cloudflare":return new qe(e.apiToken,{zoneId:e.zoneId,accountId:e.accountId});default:throw Error(`Unknown DNS provider: ${e.provider}`)}}class Xn{providers=new Map;configs=[];addConfig(e){return this.configs.push(e),this}addRoute53(e,t){return this.configs.push({provider:"route53",region:e,hostedZoneId:t}),this}addPorkbun(e,t){return this.configs.push({provider:"porkbun",apiKey:e,secretKey:t}),this}addGoDaddy(e,t,r){return this.configs.push({provider:"godaddy",apiKey:e,apiSecret:t,environment:r}),this}addCloudflare(e,t={}){return this.configs.push({provider:"cloudflare",apiToken:e,zoneId:t.zoneId,accountId:t.accountId}),this}loadFromEnv(){if(process.env.AWS_ACCESS_KEY_ID||process.env.AWS_REGION)this.addRoute53(process.env.AWS_REGION);let e=process.env.PORKBUN_API_KEY,t=process.env.PORKBUN_SECRET_KEY;if(e&&t)this.addPorkbun(e,t);let r=process.env.GODADDY_API_KEY,n=process.env.GODADDY_API_SECRET;if(r&&n){let o=process.env.GODADDY_ENVIRONMENT;this.addGoDaddy(r,n,o)}let s=process.env.CLOUDFLARE_API_TOKEN;if(s)this.addCloudflare(s,{zoneId:process.env.CLOUDFLARE_ZONE_ID,accountId:process.env.CLOUDFLARE_ACCOUNT_ID});return this}getProvider(e){let t=this.providers.get(e);if(t)return t;let r=this.configs.find((s)=>s.provider===e);if(!r)return null;let n=L(r);return this.providers.set(e,n),n}async getProviderForDomain(e){for(let t of this.configs){let r=L(t);if(await r.canManageDomain(e))return r}return null}getAllProviders(){return this.configs.map((e)=>L(e))}}var ye=new Xn;class q{client;region;constructor(e="us-east-1"){this.client=new u,this.region=e}async requestCertificate(e){let t={DomainName:e.DomainName,ValidationMethod:e.ValidationMethod||"DNS"};if(e.SubjectAlternativeNames)t.SubjectAlternativeNames=e.SubjectAlternativeNames;return{CertificateArn:(await this.client.request({service:"acm",region:this.region,method:"POST",path:"/",headers:{"content-type":"application/x-amz-json-1.1","x-amz-target":"CertificateManager.RequestCertificate"},body:JSON.stringify(t)})).CertificateArn||""}}async describeCertificate(e){let r=(await this.client.request({service:"acm",region:this.region,method:"POST",path:"/",headers:{"content-type":"application/x-amz-json-1.1","x-amz-target":"CertificateManager.DescribeCertificate"},body:JSON.stringify({CertificateArn:e.CertificateArn})})).Certificate||{};return{CertificateArn:r.CertificateArn||"",DomainName:r.DomainName||"",SubjectAlternativeNames:r.SubjectAlternativeNames,Status:r.Status||"PENDING_VALIDATION",Type:r.Type,DomainValidationOptions:r.DomainValidationOptions?.map((n)=>({DomainName:n.DomainName,ValidationDomain:n.ValidationDomain,ValidationStatus:n.ValidationStatus,ResourceRecord:n.ResourceRecord?{Name:n.ResourceRecord.Name,Type:n.ResourceRecord.Type,Value:n.ResourceRecord.Value}:void 0,ValidationMethod:n.ValidationMethod})),CreatedAt:r.CreatedAt,IssuedAt:r.IssuedAt,NotBefore:r.NotBefore,NotAfter:r.NotAfter}}async listCertificates(e){let t={};if(e?.CertificateStatuses)t.CertificateStatuses=e.CertificateStatuses;if(e?.MaxItems)t.MaxItems=e.MaxItems;if(e?.NextToken)t.NextToken=e.NextToken;let r=await this.client.request({service:"acm",region:this.region,method:"POST",path:"/",headers:{"content-type":"application/x-amz-json-1.1","x-amz-target":"CertificateManager.ListCertificates"},body:JSON.stringify(t)});return{CertificateSummaryList:(r.CertificateSummaryList||[]).map((n)=>({CertificateArn:n.CertificateArn,DomainName:n.DomainName})),NextToken:r.NextToken}}async deleteCertificate(e){await this.client.request({service:"acm",region:this.region,method:"POST",path:"/",headers:{"content-type":"application/x-amz-json-1.1","x-amz-target":"CertificateManager.DeleteCertificate"},body:JSON.stringify({CertificateArn:e.CertificateArn})})}async listTagsForCertificate(e){return{Tags:(await this.client.request({service:"acm",region:this.region,method:"POST",path:"/",headers:{"content-type":"application/x-amz-json-1.1","x-amz-target":"CertificateManager.ListTagsForCertificate"},body:JSON.stringify({CertificateArn:e.CertificateArn})})).Tags||[]}}async addTagsToCertificate(e){await this.client.request({service:"acm",region:this.region,method:"POST",path:"/",headers:{"content-type":"application/x-amz-json-1.1","x-amz-target":"CertificateManager.AddTagsToCertificate"},body:JSON.stringify({CertificateArn:e.CertificateArn,Tags:e.Tags})})}async resendValidationEmail(e){await this.client.request({service:"acm",region:this.region,method:"POST",path:"/",headers:{"content-type":"application/x-amz-json-1.1","x-amz-target":"CertificateManager.ResendValidationEmail"},body:JSON.stringify({CertificateArn:e.CertificateArn,Domain:e.Domain,ValidationDomain:e.ValidationDomain})})}async findCertificateByDomain(e){let r=(await this.listCertificates({CertificateStatuses:["ISSUED"]})).CertificateSummaryList.find((n)=>n.DomainName===e||n.DomainName===`*.${e.split(".").slice(1).join(".")}`);if(!r)return null;return this.describeCertificate({CertificateArn:r.CertificateArn})}async waitForCertificateValidation(e,t=60,r=30000){for(let n=0;n<t;n++){let s=await this.describeCertificate({CertificateArn:e});if(s.Status==="ISSUED")return s;if(s.Status==="FAILED"||s.Status==="VALIDATION_TIMED_OUT")return null;await new Promise((o)=>setTimeout(o,r))}return null}async getDnsValidationRecords(e){let t=await this.describeCertificate({CertificateArn:e});if(!t.DomainValidationOptions)return[];return t.DomainValidationOptions.filter((r)=>r.ResourceRecord&&r.ValidationMethod==="DNS").map((r)=>({domainName:r.DomainName,recordName:r.ResourceRecord.Name,recordType:r.ResourceRecord.Type,recordValue:r.ResourceRecord.Value}))}async requestCertificateWithSans(e){let t=new Set;if(t.add(e.DomainName),e.IncludeWww!==!1)t.add(`www.${e.DomainName}`);if(e.IncludeWildcard)t.add(`*.${e.DomainName}`);if(e.AdditionalSans)for(let r of e.AdditionalSans)t.add(r);return this.requestCertificate({DomainName:e.DomainName,SubjectAlternativeNames:Array.from(t),ValidationMethod:"DNS"})}async isCertificateValidForDomain(e,t){let r=await this.describeCertificate({CertificateArn:e});if(r.Status!=="ISSUED")return!1;if(r.DomainName===t)return!0;if(r.DomainName?.startsWith("*.")){let n=r.DomainName.slice(2),s=t.split("."),o=n.split(".");if(s.slice(-o.length).join(".")===n)return!0}if(r.SubjectAlternativeNames)for(let n of r.SubjectAlternativeNames){if(n===t)return!0;if(n.startsWith("*.")){let s=n.slice(2),o=t.split("."),i=s.split(".");if(o.slice(-i.length).join(".")===s)return!0}}return!1}}class ji{acm;route53;dnsProvider;constructor(e="us-east-1",t){if(this.acm=new q(e),this.route53=new O,t&&t.provider!=="route53")this.dnsProvider=L(t)}async requestAndValidate(e){let{domainName:t,hostedZoneId:r,subjectAlternativeNames:n=[],waitForValidation:s=!1,maxWaitMinutes:o=30}=e;if(!this.dnsProvider&&!r)throw Error("Either hostedZoneId or external DNS provider configuration is required");let{CertificateArn:i}=await this.acm.requestCertificate({DomainName:t,SubjectAlternativeNames:n.length>0?[t,...n]:void 0,ValidationMethod:"DNS"});await this.waitForValidationOptions(i);let a=await this.acm.getDnsValidationRecords(i);if(this.dnsProvider)for(let c of a){let d=await this.dnsProvider.upsertRecord(t,{name:c.recordName,type:c.recordType,content:c.recordValue,ttl:300});if(!d.success)console.warn(`Failed to create validation record for ${c.domainName}: ${d.message}`)}else if(r)for(let c of a)await this.route53.changeResourceRecordSets({HostedZoneId:r,ChangeBatch:{Comment:`ACM DNS validation for ${c.domainName}`,Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:c.recordName,Type:c.recordType,TTL:300,ResourceRecords:[{Value:c.recordValue}]}}]}});if(s){if(!await this.acm.waitForCertificateValidation(i,o*2,30000))throw Error(`Certificate validation timed out after ${o} minutes`)}return{certificateArn:i,validationRecords:a}}async waitForValidationOptions(e,t=30){for(let r=0;r<t;r++){let n=await this.acm.describeCertificate({CertificateArn:e});if(n.DomainValidationOptions&&n.DomainValidationOptions.length>0&&n.DomainValidationOptions[0].ResourceRecord)return;await new Promise((s)=>setTimeout(s,2000))}throw Error("Timeout waiting for DNS validation options")}async createValidationRecords(e){let{certificateArn:t,hostedZoneId:r,domain:n}=e;if(!this.dnsProvider&&!r)throw Error("Either hostedZoneId or external DNS provider configuration is required");let s=await this.acm.getDnsValidationRecords(t),o=[];if(this.dnsProvider){let i=n||s[0]?.domainName;for(let a of s){let c=await this.dnsProvider.upsertRecord(i,{name:a.recordName,type:a.recordType,content:a.recordValue,ttl:300});o.push({...a,changeId:c.success?c.id:void 0})}}else if(r)for(let i of s){let a=await this.route53.changeResourceRecordSets({HostedZoneId:r,ChangeBatch:{Comment:`ACM DNS validation for ${i.domainName}`,Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:i.recordName,Type:i.recordType,TTL:300,ResourceRecords:[{Value:i.recordValue}]}}]}});o.push({...i,changeId:a.ChangeInfo?.Id})}return o}async deleteValidationRecords(e){let{certificateArn:t,hostedZoneId:r,domain:n}=e,s=await this.acm.getDnsValidationRecords(t);if(this.dnsProvider){let o=n||s[0]?.domainName;for(let i of s)try{await this.dnsProvider.deleteRecord(o,{name:i.recordName,type:i.recordType,content:i.recordValue})}catch{}}else if(r)for(let o of s)try{await this.route53.changeResourceRecordSets({HostedZoneId:r,ChangeBatch:{Comment:`Cleanup ACM DNS validation for ${o.domainName}`,Changes:[{Action:"DELETE",ResourceRecordSet:{Name:o.recordName,Type:o.recordType,TTL:300,ResourceRecords:[{Value:o.recordValue}]}}]}})}catch{}}async findOrCreateCertificate(e){let{domainName:t,hostedZoneId:r,subjectAlternativeNames:n,waitForValidation:s=!0}=e;if(!this.dnsProvider&&!r)throw Error("Either hostedZoneId or external DNS provider configuration is required");let o=await this.acm.findCertificateByDomain(t);if(o&&o.Status==="ISSUED")return{certificateArn:o.CertificateArn,isNew:!1};let{certificateArn:i}=await this.requestAndValidate({domainName:t,hostedZoneId:r,subjectAlternativeNames:n,waitForValidation:s});return{certificateArn:i,isNew:!0}}hasExternalDnsProvider(){return this.dnsProvider!==void 0}getDnsProviderName(){return this.dnsProvider?.name||"route53"}}
|
|
2
|
+
export{ze,xt,qe,Oi,Li,jr,Mi,Ui,Bi,Fi,q,ji,_t,L,Xn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Xo,Iu,Ru,Qo}from"./chunk-e1cxh9rj.js";import"./chunk-x4gsw45d.js";import"./chunk-gxwsq3k0.js";export{Iu as getComputeDeployHistory,Qo as restoreDatabaseBackup,Xo as rollbackComputeSite,Ru as runComputeRecipe};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Wa,oe,Ga,Yl,Mu,ui,Uu,Bu,Ds,Fu,ju,Vu,zu,qu,Hu,Wu,Ka,Ja,ks,xs,ho,Je,A,_s,Xa,V,wr,C,Zl,pi,$s,Os,U,yo,Gu,Ku,Ju,Xu,l,s,Qu,Yu,E,Ls,Ms,Us,Zu,ep,Pe,Bs,So,ed,tp,rp,Le,vt,Xe,Se,B,S,_,Qe,D,td,Tt,pe,Mt,np,rd,be,bo,Me,Ut,mi,ve,vo,Ne,nd,gi,Te,Ee,ee,fi,G,Bt,Et,we,t,To,ip,Qa,Fs,op,sp,ap,cp,js,lp,dp,up,pp,mp,gp,fp,hp,yp,Sp,bp,vp,id,od,sd,ad,cd,ld,dd,Ft,Ya,Za,Cr,hi,Tp,ec,Ep,wp,rn,Cp,Ap,Ip,Rp,Pp,Np,ud,pd,md,gd,fd,Eo,Dp,Vs,hd,yd,Sd,tc,Ce,kp,bd,wt,wo,Ar,vd,rc,Td,Ed,wd,nc,De,xp,_p,$p,Op,Cd,Lp,Ae,Mp,Up,Bp,ic,oc,Fp,sc,ac,jp,Vp,zp,qp,Hp,Ad,zs,Wp,Gp,Kp,Jp,Xp,Id,Rd,Qp,Yp,Zp,em,tm,rm,nm,im,om,cc,qs,sm,am,cm,lm,lc,dc,uc,dm,pc,um,pm,mm,gm,mc,fm,hm,ym,Sm,bm,vm,Tm,Em,Pd,Nd,Dd,kd,gc,wm,Cm,Am,Im,Rm,Pm,Nm,Dm,km,xd,_d,$d,Od,xm,_m,fc,$m,hc,yc,Sc,bc,Om,Lm,Mm,Um,Ye,yi,Bm,Fm,jm,Vm,zm,qm,Hm,Wm,Ld,Gm,Km,vc,Tc,Jm,Xm,Md,Qm,Ym,Zm,eg,tg,rg,ng,ig,og,sg,ag,cg,lg,dg,ug,pg,mg,gg,fg,hg,yg,Ec,Sg,wc,bg,Cc,vg,Ac,Tg,Ic,Eg,nn,wg,Rc,Cg,Co,Ag,Pc,Ig,Nc,Rg,Dc,Pg,kc,Ng,xc,Dg,on,kg,_c,xg,$c,_g,Oc,$g,Lc,Og,Mc,Lg,Uc,Mg,Bc,Ug,Fc,Bg,jc,Fg,Vc,jg,zc,Vg,qc,zg,Hc,qg,Wc,Hg,Gc,Wg,Kc,Gg,Jc,Kg,Xc,Jg,Qc,Xg,Yc,Qg,Zc,Yg,el,Zg,tl,ef,rl,tf,nl,rf,Ud,Bd,Fd,jd,il,nf,ol,of,sl,sf,al,af,Si,Vd,zd,Ao,Hs,sn,qd,Io,jt,Ws,Gs,Hd,Wd,cl,Gd,Ks,ll,cf,lf,Js,Xs,Qs,dl,Ro,ul,pl,Ys,ml,gl,fl,Kd,Jd,Xd,df,Qd,Yd,uf,Zd,hl,eu,tu,ru,pf,nu,bi,Zs,iu,mf,ou,Po,No,ea,yl,gf,Sl,ff,bl,hf,vl,yf,Tl,Sf}from"./chunk-xyk8qe2c.js";export{Pc as ABTestManager,Me as AI,Td as AWSAPIError,Cc as AWSConfigManager,ip as AWS_PSEUDO_PARAMETERS,Ye as AWS_REGIONS,vo as ApiGateway,To as Arn,ee as AssetHasher,Te as Auth,Ec as BackupManager,sl as BatchProcessingManager,Rc as BlueGreenManager,el as BounceComplaintHandler,Vc as BuildOptimizationManager,Xe as CDN,Xs as CHAIN_HEADER,Ym as COMMON_CROSS_ACCOUNT_ROLES,mi as Cache,Co as CanaryManager,Bc as CertificateManager,wt as CloudError,Qa as CloudFormationBuilder,Sd as CloudFormationClient,bd as CloudFrontClient,Ac as CloudTrailManager,Od as CommandHistory,we as Communication,S as Compute,wo as ConfigurationError,zc as ContainerRegistryManager,Ar as CredentialError,hc as CrossRegionReferenceManager,od as DASHBOARD_ENTRY,sd as DASHBOARD_PORT_BASE,ad as DASHBOARD_PORT_SPAN,id as DASHBOARD_STATE_DIR,Ro as DEFAULT_RECURSION_LIMITS,Ae as DEFAULT_SERVICE_LIMITS,Ka as DEFAULT_STATE_DIR,Js as DEPTH_HEADER,ol as DLQMonitoringManager,Se as DNS,Yc as DNSSECManager,Ut as Database,Lc as DatabaseUserManager,De as DebugLogger,ed as DependencyGraph,Ee as Deployment,vd as DeploymentError,wc as DisasterRecoveryManager,D as Email,Ud as EmailAdvanced,tl as EmailAnalyticsManager,Bd as EmailHandlers,nl as EmailTemplateManager,Ed as ErrorCodes,il as FIFOQueueManager,ic as FileCache,Qe as FileSystem,t as Fn,yc as GlobalResourceManager,Ic as GuardDutyManager,Ad as HashCache,bl as HealthCheckManager,jc as ImageScanningManager,Mt as JobLoader,iu as LARAVEL_SERVERLESS_BUILD_STEPS,Gc as LambdaConcurrencyManager,Xc as LambdaDLQManager,Kc as LambdaDestinationsManager,Hc as LambdaLayersManager,Jc as LambdaVPCManager,Wc as LambdaVersionsManager,xc as LogsManager,qd as MANAGED_NODE_VERSIONS,Ya as MANAGEMENT_DASHBOARD_SITE_PREFIX,Ne as Messaging,kc as MetricsManager,_c as MigrationManager,lc as MockCloudFormation,uc as MockDynamoDB,dc as MockS3,gi as Monitoring,vc as MultiAccountManager,fc as MultiRegionManager,Nd as MultiStepProgress,_ as Network,vl as NetworkSecurityManager,Tc as OrganizationManager,ou as PHP_DEFAULT_EXCLUDES,Hd as PHP_LAYER_EXTENSIONS,G as ParameterStore,Oc as PerformanceManager,ve as Permissions,Tt as Phone,Fd as PhoneAdvanced,td as PhoneHandlers,pc as PreviewEnvironmentManager,mc as PreviewNotificationService,Pd as ProgressBar,Nc as ProgressiveDeploymentManager,Xu as Pseudo,pe as Queue,al as QueueManagementManager,Hu as QueuePresets,Md as RECOMMENDED_ACCOUNT_STRUCTURES,Qm as RECOMMENDED_SCPS,xd as REPL,$d as REPLCommandBuilder,_d as REPLContext,Id as RateLimiter,Wu as RealtimePresets,Ys as RecursionGuard,Et as Redirects,Sc as RegionPairManager,vt as Registry,$c as ReplicaManager,Tl as ResourceManagementManager,Zc as Route53ResolverManager,Qc as Route53RoutingManager,tc as S3Client,Ce as S3Error,be as SMS,Ja as STATE_DIR_ENV_VAR,Bt as Search,fi as Secrets,Uc as SecretsManager,Mc as SecretsRotationManager,B as Security,nn as SecurityHubManager,Fc as SecurityScanningManager,rl as SenderReputationManager,qc as ServiceMeshManager,bo as Sftp,jd as SmsAdvanced,rd as SmsHandlers,Dd as Spinner,bc as StackDependencyManager,np as StacksIntegration,yl as StaticSiteManager,Le as Storage,Sl as StorageAdvancedManager,on as SyntheticsManager,Qs as TRACE_HEADER,kd as TaskList,yo as TemplateBuilder,oc as TemplateCache,rc as ValidationError,nd as Workflow,Dc as XRayManager,Ig as abTestManager,tp as analyzeStackDiff,Hs as artifactKey,Rm as autocomplete,vg as awsConfigManager,Sg as backupManager,Wp as batch,sf as batchProcessingManager,Cg as blueGreenManager,Zg as bounceComplaintHandler,lf as buildBunRuntimeLayerZip,Fs as buildCloudFormationTemplate,Os as buildMailEnv,cf as buildNodeRuntimeLayerZip,jg as buildOptimizationManager,mf as buildPhpRuntimeLayerZip,Ag as canaryManager,tm as categorizeChanges,Ug as certificateManager,Op as checkIAMPermissions,Qd as checkInvocation,Mp as checkServiceQuotas,Rd as chunk,ju as clearSigningKeyCache,im as cloudConfigSchema,Tg as cloudTrailManager,No as collectPhpAppEntries,Ep as composePresets,Gs as composeServerlessAppTemplate,Vg as containerRegistryManager,dp as createApiBackendPreset,ru as createCliHandler,Dp as createCredentialProvider,vp as createDashboardSite,fp as createDataPipelinePreset,nc as createError,js as createExistingStaticFullStackPreset,lp as createFullStackAppPreset,pf as createHandlers,eu as createHttpHandler,pp as createJamstackPreset,Sp as createLaravelPreset,hp as createMLApiPreset,mp as createMicroservicesPreset,dm as createMockAWS,sp as createNodeJsServerPreset,ap as createNodeJsServerlessPreset,wp as createPreset,Yl as createPresignedUrl,Mu as createPresignedUrlAsync,tu as createQueueHandler,gp as createRealtimeAppPreset,kp as createS3Client,bp as createServerlessLaravelPreset,cp as createServerlessNodePreset,op as createStaticSitePreset,yp as createTraditionalWebAppPreset,up as createWordPressPreset,Si as createZip,Om as crossRegionReferenceManager,Og as databaseUserManager,cc as defaultLocalConfig,wr as deploymentCoexistenceError,cd as deriveManagementDashboardPort,Xa as detectDeploymentTargets,_p as detectMisconfigurations,Wa as detectServiceRegion,Yp as diffTemplates,of as dlqMonitoringManager,Qg as dnssecManager,bg as drManager,ef as emailAnalyticsManager,rf as emailTemplateManager,Zd as eventToRequest,ec as extendPreset,nf as fifoQueueManager,Hp as findChangedFiles,rg as formatAccountStructure,bm as formatBytes,rp as formatDiff,vm as formatDuration,Nm as formatFlagSuggestions,xm as formatHistory,_m as formatHistoryStats,Em as formatKeyValue,Tm as formatList,Sm as formatProgressBar,Ld as formatRegion,Gm as formatRegionList,wm as formatSuggestion,hm as formatTable,ym as formatTree,md as fromEC2Metadata,gd as fromECSMetadata,ud as fromEnvironment,pd as fromSharedCredentials,fd as fromWebIdentity,dl as functionFingerprint,Ks as generateAppImageDockerfile,hg as generateApprovalConfig,Vd as generateBootstrap,mm as generateCleanupWorkflow,gm as generateCostReportWorkflow,eg as generateCrossAccountRoleCF,mg as generateDeploymentConfig,cg as generateDeploymentPipeline,ng as generateDeploymentWorkflow,s as generateLogicalId,pg as generateManualPipeline,ag as generateMatrixWorkflow,gg as generateMultiEnvConfig,lg as generateMultiEnvPipeline,ig as generateMultiEnvWorkflow,og as generatePRPreviewWorkflow,yg as generateParallelConfig,nu as generatePhpFpmConfig,Gd as generatePhpLayerDockerfile,dg as generatePreviewPipeline,pm as generatePreviewWorkflow,l as generateResourceName,fg as generateScheduledConfig,ug as generateScheduledPipeline,sg as generateScheduledWorkflow,yd as getAccountId,Bm as getAllRegions,qm as getClosestRegion,Dm as getCommandUsage,Am as getContextualHelp,Eo as getCredentials,rm as getDeploymentStrategy,nm as getDiffStats,Zp as getDiffSummary,wd as getErrorDetails,qs as getLocalConfig,cm as getLocalCredentials,am as getLocalEndpoint,lm as getLocalEnvVars,Up as getQuotaUsageSummary,Zm as getRecommendedStructure,yi as getRegion,Km as getRegionStats,jm as getRegionsByCompliance,Fm as getRegionsByLocation,Vm as getRegionsByPricingTier,Cd as getRequiredPermissions,Vu as getSigningKeyCacheSize,Qu as getTimestamp,Lm as globalResourceManager,Eg as guardDutyManager,Ft as hasManagementDashboardSite,jp as hashBuffer,Vp as hashDirectory,sc as hashFile,zp as hashManifest,ac as hashString,hf as healthCheckManager,Fg as imageScanningManager,pl as inspectInvocation,Jd as installRecursionFetch,fl as invocationContext,Cm as isLikelyTypo,sm as isLocalDevelopment,Cr as isManagementDashboardSiteName,zu as isNodeCryptoAvailable,xs as isStateDirConfigured,_s as isStatePath,zm as isValidRegion,qu as isWebCryptoAvailable,Wg as lambdaConcurrencyManager,Jg as lambdaDLQManager,Gg as lambdaDestinationsManager,qg as lambdaLayersManager,Kg as lambdaVPCManager,Hg as lambdaVersionsManager,Zs as laravelServerlessEnvDefaults,Dg as logsManager,Zl as mailEnabled,$s as mailFirewallPorts,ui as makeAWSRequest,Bu as makeAWSRequestAsync,Uu as makeAWSRequestOnce,Za as managementDashboardSiteName,rn as mergeInfrastructure,Ng as metricsManager,xg as migrationManager,Jm as multiAccountManager,$m as multiRegionManager,yf as networkSecurityManager,Xm as organizationManager,ea as packagePhpApp,sn as packageServerlessApp,zs as parallel,Gp as parallelMap,Kp as parallelWithRetry,ul as parseChain,Fu as parseJSONResponse,Ds as parseXMLResponse,$g as performanceManager,cl as phpLayerBuildStage,Wd as phpLayerPackages,bi as phpRuntimeLayerAssets,um as previewManager,fm as previewNotifications,Qp as processInChunks,Rg as progressiveDeploymentManager,ml as propagationHeaders,af as queueManagementManager,qp as quickHash,gl as recursionBlockedResponse,Mm as regionPairManager,_g as replicaManager,em as requiresReplacement,df as resetRecursionRuntime,uf as resolveApp,C as resolveAppDatabase,U as resolveCloudProvider,Vs as resolveCredentials,ld as resolveDashboardDomain,dd as resolveDashboardDomains,ep as resolveDeployBucketName,V as resolveDeploymentMode,pi as resolveMailService,Tp as resolveManagementDashboardSite,hi as resolveManagementDashboardSites,E as resolveProjectStackName,Ws as resolveQueueNames,jt as resolveQueues,Kd as resolveRecursionConfig,hd as resolveRegion,Pe as resolveServerlessAppStackName,Bs as resolveServerlessArtifactBucketName,So as resolveServerlessAssetBucketName,Io as resolveServerlessRuntime,Us as resolveSiteBucketName,Ms as resolveSiteResourceName,Ls as resolveSiteStackName,A as resolveStatePath,Zu as resolveStorageBucketName,Sf as resourceManagementManager,hl as responseToResult,Yg as route53ResolverManager,Xg as route53RoutingManager,zd as runBuildHooks,Po as runPhpBuildHooks,Yu as sanitizeName,Im as searchCommands,Mg as secretsManager,Lg as secretsRotationManager,wg as securityHubManager,Bg as securityScanningManager,tf as senderReputationManager,Jp as sequence,zg as serviceMeshManager,ks as setStateDir,Ao as sha256,Xd as sharedRecursionGuard,ll as sharedRuntimeLoop,oe as signRequest,Ga as signRequestAsync,Um as stackDependencyManager,ho as stateDir,Je as statePath,gf as staticSiteManager,ff as storageAdvancedManager,gc as suggestCommand,Pm as suggestFlags,Lp as suggestIAMPolicy,Bp as suggestQuotaIncrease,Wm as suggestRegionPairs,Hm as suggestRegions,kg as syntheticsManager,Fp as templateCache,tg as validateAccountStructure,om as validateAgainstSchema,km as validateCommand,xp as validateConfiguration,$p as validateCredentials,Ju as validateResourceLimits,Gu as validateTemplate,Ku as validateTemplateSize,Pp as withCDN,Rp as withCache,Ip as withDatabase,Yd as withInvocation,Cp as withMonitoring,Np as withQueue,Ap as withSecurity,Xp as withTimeout,Pg as xrayManager};
|
|
1
|
+
import{Wa,oe,Ga,Yl,Mu,ui,Uu,Bu,Ds,Fu,ju,Vu,zu,qu,Hu,Wu,Ka,Ja,ks,xs,ho,Qe,A,_s,Xa,V,wr,C,Zl,pi,$s,Os,U,yo,Gu,Ku,Ju,Xu,l,s,Qu,Yu,E,Ls,Ms,Us,Zu,ep,Pe,Bs,So,ed,tp,rp,Le,vt,Ye,Se,B,S,_,Ze,D,td,Tt,pe,Ut,np,rd,be,bo,Me,Bt,mi,ve,vo,Ne,nd,gi,Te,Ee,ee,fi,G,Ft,Et,we,t,To,ip,Qa,Fs,op,sp,ap,cp,js,lp,dp,up,pp,mp,gp,fp,hp,yp,Sp,bp,vp,id,od,sd,ad,cd,ld,dd,jt,Ya,Za,Cr,hi,Tp,ec,Ep,wp,rn,Cp,Ap,Ip,Rp,Pp,Np,ud,pd,md,gd,fd,Eo,Dp,Vs,hd,yd,Sd,tc,Ce,kp,bd,wt,wo,Ar,vd,rc,Td,Ed,wd,nc,De,xp,_p,$p,Op,Cd,Lp,Ae,Mp,Up,Bp,ic,oc,Fp,sc,ac,jp,Vp,zp,qp,Hp,Ad,zs,Wp,Gp,Kp,Jp,Xp,Id,Rd,Qp,Yp,Zp,em,tm,rm,nm,im,om,cc,qs,sm,am,cm,lm,lc,dc,uc,dm,pc,um,pm,mm,gm,mc,fm,hm,ym,Sm,bm,vm,Tm,Em,Pd,Nd,Dd,kd,gc,wm,Cm,Am,Im,Rm,Pm,Nm,Dm,km,xd,_d,$d,Od,xm,_m,fc,$m,hc,yc,Sc,bc,Om,Lm,Mm,Um,et,yi,Bm,Fm,jm,Vm,zm,qm,Hm,Wm,Ld,Gm,Km,vc,Tc,Jm,Xm,Md,Qm,Ym,Zm,eg,tg,rg,ng,ig,og,sg,ag,cg,lg,dg,ug,pg,mg,gg,fg,hg,yg,Ec,Sg,wc,bg,Cc,vg,Ac,Tg,Ic,Eg,nn,wg,Rc,Cg,Co,Ag,Pc,Ig,Nc,Rg,Dc,Pg,kc,Ng,xc,Dg,on,kg,_c,xg,$c,_g,Oc,$g,Lc,Og,Mc,Lg,Uc,Mg,Bc,Ug,Fc,Bg,jc,Fg,Vc,jg,zc,Vg,qc,zg,Hc,qg,Wc,Hg,Gc,Wg,Kc,Gg,Jc,Kg,Xc,Jg,Qc,Xg,Yc,Qg,Zc,Yg,el,Zg,tl,ef,rl,tf,nl,rf,Ud,Bd,Fd,jd,il,nf,ol,of,sl,sf,al,af,Si,Vd,zd,Ao,Hs,sn,qd,Io,Vt,Ws,Gs,Hd,Wd,cl,Gd,Ks,ll,cf,lf,Js,Xs,Qs,dl,Ro,ul,pl,Ys,ml,gl,fl,Kd,Jd,Xd,df,Qd,Yd,uf,Zd,hl,eu,tu,ru,pf,nu,bi,Zs,iu,mf,ou,Po,No,ea,yl,gf,Sl,ff,bl,hf,vl,yf,Tl,Sf}from"./chunk-gxwsq3k0.js";export{Pc as ABTestManager,Me as AI,Td as AWSAPIError,Cc as AWSConfigManager,ip as AWS_PSEUDO_PARAMETERS,et as AWS_REGIONS,vo as ApiGateway,To as Arn,ee as AssetHasher,Te as Auth,Ec as BackupManager,sl as BatchProcessingManager,Rc as BlueGreenManager,el as BounceComplaintHandler,Vc as BuildOptimizationManager,Ye as CDN,Xs as CHAIN_HEADER,Ym as COMMON_CROSS_ACCOUNT_ROLES,mi as Cache,Co as CanaryManager,Bc as CertificateManager,wt as CloudError,Qa as CloudFormationBuilder,Sd as CloudFormationClient,bd as CloudFrontClient,Ac as CloudTrailManager,Od as CommandHistory,we as Communication,S as Compute,wo as ConfigurationError,zc as ContainerRegistryManager,Ar as CredentialError,hc as CrossRegionReferenceManager,od as DASHBOARD_ENTRY,sd as DASHBOARD_PORT_BASE,ad as DASHBOARD_PORT_SPAN,id as DASHBOARD_STATE_DIR,Ro as DEFAULT_RECURSION_LIMITS,Ae as DEFAULT_SERVICE_LIMITS,Ka as DEFAULT_STATE_DIR,Js as DEPTH_HEADER,ol as DLQMonitoringManager,Se as DNS,Yc as DNSSECManager,Bt as Database,Lc as DatabaseUserManager,De as DebugLogger,ed as DependencyGraph,Ee as Deployment,vd as DeploymentError,wc as DisasterRecoveryManager,D as Email,Ud as EmailAdvanced,tl as EmailAnalyticsManager,Bd as EmailHandlers,nl as EmailTemplateManager,Ed as ErrorCodes,il as FIFOQueueManager,ic as FileCache,Ze as FileSystem,t as Fn,yc as GlobalResourceManager,Ic as GuardDutyManager,Ad as HashCache,bl as HealthCheckManager,jc as ImageScanningManager,Ut as JobLoader,iu as LARAVEL_SERVERLESS_BUILD_STEPS,Gc as LambdaConcurrencyManager,Xc as LambdaDLQManager,Kc as LambdaDestinationsManager,Hc as LambdaLayersManager,Jc as LambdaVPCManager,Wc as LambdaVersionsManager,xc as LogsManager,qd as MANAGED_NODE_VERSIONS,Ya as MANAGEMENT_DASHBOARD_SITE_PREFIX,Ne as Messaging,kc as MetricsManager,_c as MigrationManager,lc as MockCloudFormation,uc as MockDynamoDB,dc as MockS3,gi as Monitoring,vc as MultiAccountManager,fc as MultiRegionManager,Nd as MultiStepProgress,_ as Network,vl as NetworkSecurityManager,Tc as OrganizationManager,ou as PHP_DEFAULT_EXCLUDES,Hd as PHP_LAYER_EXTENSIONS,G as ParameterStore,Oc as PerformanceManager,ve as Permissions,Tt as Phone,Fd as PhoneAdvanced,td as PhoneHandlers,pc as PreviewEnvironmentManager,mc as PreviewNotificationService,Pd as ProgressBar,Nc as ProgressiveDeploymentManager,Xu as Pseudo,pe as Queue,al as QueueManagementManager,Hu as QueuePresets,Md as RECOMMENDED_ACCOUNT_STRUCTURES,Qm as RECOMMENDED_SCPS,xd as REPL,$d as REPLCommandBuilder,_d as REPLContext,Id as RateLimiter,Wu as RealtimePresets,Ys as RecursionGuard,Et as Redirects,Sc as RegionPairManager,vt as Registry,$c as ReplicaManager,Tl as ResourceManagementManager,Zc as Route53ResolverManager,Qc as Route53RoutingManager,tc as S3Client,Ce as S3Error,be as SMS,Ja as STATE_DIR_ENV_VAR,Ft as Search,fi as Secrets,Uc as SecretsManager,Mc as SecretsRotationManager,B as Security,nn as SecurityHubManager,Fc as SecurityScanningManager,rl as SenderReputationManager,qc as ServiceMeshManager,bo as Sftp,jd as SmsAdvanced,rd as SmsHandlers,Dd as Spinner,bc as StackDependencyManager,np as StacksIntegration,yl as StaticSiteManager,Le as Storage,Sl as StorageAdvancedManager,on as SyntheticsManager,Qs as TRACE_HEADER,kd as TaskList,yo as TemplateBuilder,oc as TemplateCache,rc as ValidationError,nd as Workflow,Dc as XRayManager,Ig as abTestManager,tp as analyzeStackDiff,Hs as artifactKey,Rm as autocomplete,vg as awsConfigManager,Sg as backupManager,Wp as batch,sf as batchProcessingManager,Cg as blueGreenManager,Zg as bounceComplaintHandler,lf as buildBunRuntimeLayerZip,Fs as buildCloudFormationTemplate,Os as buildMailEnv,cf as buildNodeRuntimeLayerZip,jg as buildOptimizationManager,mf as buildPhpRuntimeLayerZip,Ag as canaryManager,tm as categorizeChanges,Ug as certificateManager,Op as checkIAMPermissions,Qd as checkInvocation,Mp as checkServiceQuotas,Rd as chunk,ju as clearSigningKeyCache,im as cloudConfigSchema,Tg as cloudTrailManager,No as collectPhpAppEntries,Ep as composePresets,Gs as composeServerlessAppTemplate,Vg as containerRegistryManager,dp as createApiBackendPreset,ru as createCliHandler,Dp as createCredentialProvider,vp as createDashboardSite,fp as createDataPipelinePreset,nc as createError,js as createExistingStaticFullStackPreset,lp as createFullStackAppPreset,pf as createHandlers,eu as createHttpHandler,pp as createJamstackPreset,Sp as createLaravelPreset,hp as createMLApiPreset,mp as createMicroservicesPreset,dm as createMockAWS,sp as createNodeJsServerPreset,ap as createNodeJsServerlessPreset,wp as createPreset,Yl as createPresignedUrl,Mu as createPresignedUrlAsync,tu as createQueueHandler,gp as createRealtimeAppPreset,kp as createS3Client,bp as createServerlessLaravelPreset,cp as createServerlessNodePreset,op as createStaticSitePreset,yp as createTraditionalWebAppPreset,up as createWordPressPreset,Si as createZip,Om as crossRegionReferenceManager,Og as databaseUserManager,cc as defaultLocalConfig,wr as deploymentCoexistenceError,cd as deriveManagementDashboardPort,Xa as detectDeploymentTargets,_p as detectMisconfigurations,Wa as detectServiceRegion,Yp as diffTemplates,of as dlqMonitoringManager,Qg as dnssecManager,bg as drManager,ef as emailAnalyticsManager,rf as emailTemplateManager,Zd as eventToRequest,ec as extendPreset,nf as fifoQueueManager,Hp as findChangedFiles,rg as formatAccountStructure,bm as formatBytes,rp as formatDiff,vm as formatDuration,Nm as formatFlagSuggestions,xm as formatHistory,_m as formatHistoryStats,Em as formatKeyValue,Tm as formatList,Sm as formatProgressBar,Ld as formatRegion,Gm as formatRegionList,wm as formatSuggestion,hm as formatTable,ym as formatTree,md as fromEC2Metadata,gd as fromECSMetadata,ud as fromEnvironment,pd as fromSharedCredentials,fd as fromWebIdentity,dl as functionFingerprint,Ks as generateAppImageDockerfile,hg as generateApprovalConfig,Vd as generateBootstrap,mm as generateCleanupWorkflow,gm as generateCostReportWorkflow,eg as generateCrossAccountRoleCF,mg as generateDeploymentConfig,cg as generateDeploymentPipeline,ng as generateDeploymentWorkflow,s as generateLogicalId,pg as generateManualPipeline,ag as generateMatrixWorkflow,gg as generateMultiEnvConfig,lg as generateMultiEnvPipeline,ig as generateMultiEnvWorkflow,og as generatePRPreviewWorkflow,yg as generateParallelConfig,nu as generatePhpFpmConfig,Gd as generatePhpLayerDockerfile,dg as generatePreviewPipeline,pm as generatePreviewWorkflow,l as generateResourceName,fg as generateScheduledConfig,ug as generateScheduledPipeline,sg as generateScheduledWorkflow,yd as getAccountId,Bm as getAllRegions,qm as getClosestRegion,Dm as getCommandUsage,Am as getContextualHelp,Eo as getCredentials,rm as getDeploymentStrategy,nm as getDiffStats,Zp as getDiffSummary,wd as getErrorDetails,qs as getLocalConfig,cm as getLocalCredentials,am as getLocalEndpoint,lm as getLocalEnvVars,Up as getQuotaUsageSummary,Zm as getRecommendedStructure,yi as getRegion,Km as getRegionStats,jm as getRegionsByCompliance,Fm as getRegionsByLocation,Vm as getRegionsByPricingTier,Cd as getRequiredPermissions,Vu as getSigningKeyCacheSize,Qu as getTimestamp,Lm as globalResourceManager,Eg as guardDutyManager,jt as hasManagementDashboardSite,jp as hashBuffer,Vp as hashDirectory,sc as hashFile,zp as hashManifest,ac as hashString,hf as healthCheckManager,Fg as imageScanningManager,pl as inspectInvocation,Jd as installRecursionFetch,fl as invocationContext,Cm as isLikelyTypo,sm as isLocalDevelopment,Cr as isManagementDashboardSiteName,zu as isNodeCryptoAvailable,xs as isStateDirConfigured,_s as isStatePath,zm as isValidRegion,qu as isWebCryptoAvailable,Wg as lambdaConcurrencyManager,Jg as lambdaDLQManager,Gg as lambdaDestinationsManager,qg as lambdaLayersManager,Kg as lambdaVPCManager,Hg as lambdaVersionsManager,Zs as laravelServerlessEnvDefaults,Dg as logsManager,Zl as mailEnabled,$s as mailFirewallPorts,ui as makeAWSRequest,Bu as makeAWSRequestAsync,Uu as makeAWSRequestOnce,Za as managementDashboardSiteName,rn as mergeInfrastructure,Ng as metricsManager,xg as migrationManager,Jm as multiAccountManager,$m as multiRegionManager,yf as networkSecurityManager,Xm as organizationManager,ea as packagePhpApp,sn as packageServerlessApp,zs as parallel,Gp as parallelMap,Kp as parallelWithRetry,ul as parseChain,Fu as parseJSONResponse,Ds as parseXMLResponse,$g as performanceManager,cl as phpLayerBuildStage,Wd as phpLayerPackages,bi as phpRuntimeLayerAssets,um as previewManager,fm as previewNotifications,Qp as processInChunks,Rg as progressiveDeploymentManager,ml as propagationHeaders,af as queueManagementManager,qp as quickHash,gl as recursionBlockedResponse,Mm as regionPairManager,_g as replicaManager,em as requiresReplacement,df as resetRecursionRuntime,uf as resolveApp,C as resolveAppDatabase,U as resolveCloudProvider,Vs as resolveCredentials,ld as resolveDashboardDomain,dd as resolveDashboardDomains,ep as resolveDeployBucketName,V as resolveDeploymentMode,pi as resolveMailService,Tp as resolveManagementDashboardSite,hi as resolveManagementDashboardSites,E as resolveProjectStackName,Ws as resolveQueueNames,Vt as resolveQueues,Kd as resolveRecursionConfig,hd as resolveRegion,Pe as resolveServerlessAppStackName,Bs as resolveServerlessArtifactBucketName,So as resolveServerlessAssetBucketName,Io as resolveServerlessRuntime,Us as resolveSiteBucketName,Ms as resolveSiteResourceName,Ls as resolveSiteStackName,A as resolveStatePath,Zu as resolveStorageBucketName,Sf as resourceManagementManager,hl as responseToResult,Yg as route53ResolverManager,Xg as route53RoutingManager,zd as runBuildHooks,Po as runPhpBuildHooks,Yu as sanitizeName,Im as searchCommands,Mg as secretsManager,Lg as secretsRotationManager,wg as securityHubManager,Bg as securityScanningManager,tf as senderReputationManager,Jp as sequence,zg as serviceMeshManager,ks as setStateDir,Ao as sha256,Xd as sharedRecursionGuard,ll as sharedRuntimeLoop,oe as signRequest,Ga as signRequestAsync,Um as stackDependencyManager,ho as stateDir,Qe as statePath,gf as staticSiteManager,ff as storageAdvancedManager,gc as suggestCommand,Pm as suggestFlags,Lp as suggestIAMPolicy,Bp as suggestQuotaIncrease,Wm as suggestRegionPairs,Hm as suggestRegions,kg as syntheticsManager,Fp as templateCache,tg as validateAccountStructure,om as validateAgainstSchema,km as validateCommand,xp as validateConfiguration,$p as validateCredentials,Ju as validateResourceLimits,Gu as validateTemplate,Ku as validateTemplateSize,Pp as withCDN,Rp as withCache,Ip as withDatabase,Yd as withInvocation,Cp as withMonitoring,Np as withQueue,Ap as withSecurity,Xp as withTimeout,Pg as xrayManager};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q,ji}from"./chunk-
|
|
1
|
+
import{q,ji}from"./chunk-2ahgpy3j.js";import"./chunk-p197a99s.js";import"./chunk-pdw0qjq1.js";export{q as ACMClient,ji as ACMDnsValidator};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A}from"./chunk-
|
|
1
|
+
import{A}from"./chunk-gxwsq3k0.js";var ie=["project:read","config:read","config:write","deployments:read","deployments:create","deployments:cancel","deployments:rollback","runtime:read","runtime:restart","runtime:logs","runtime:terminal","data:read","data:write","data:admin","backups:read","backups:create","backups:restore","secrets:read","secrets:write","fleet:read","fleet:manage","users:read","users:manage","users:transfer-ownership","audit:read","billing:read","billing:manage","security:read","security:manage","security:waive","sources:read","sources:manage","applications:read","applications:manage","automation:read","automation:manage","tags:manage"],K=["project:read","config:read","deployments:read","runtime:read","runtime:logs","data:read","backups:read","security:read","sources:read","applications:read","billing:read"],oe={owner:new Set(ie),admin:new Set(ie.filter((e)=>e!=="users:transfer-ownership")),deployer:new Set([...K,"deployments:create","deployments:cancel","deployments:rollback","sources:manage","applications:manage"]),operator:new Set([...K,"runtime:restart","backups:create","security:manage","sources:manage","applications:manage"]),viewer:new Set(K),auditor:new Set(["project:read","config:read","deployments:read","runtime:read","data:read","backups:read","audit:read","security:read","sources:read","applications:read"])};function Zr(e){return oe[e]}function P(e,t){if(e.type==="organization")return e.id===void 0||e.id===t.organizationId;if(!e.id)return!1;if(e.type==="project")return e.id===t.projectId;if(e.type==="environment")return e.id===t.environmentId;return e.id===t.resourceId}function Z(e){let{membership:t,capability:r,target:i}=e;if(!t||t.status!=="active"||t.organizationId!==i.organizationId)return{allowed:!1,reason:"inactive-membership"};let a=e.grants.filter((s)=>s.organizationId===i.organizationId&&s.membershipId===t.id&&s.capability===r&&P(s.scope,i)),E=a.find((s)=>s.effect==="deny");if(E)return{allowed:!1,reason:"explicit-deny",inheritedFrom:{kind:"grant",id:E.id,scope:E.scope}};let T=a.find((s)=>s.effect==="allow");if(T)return{allowed:!0,reason:"explicit-allow",inheritedFrom:{kind:"grant",id:T.id,scope:T.scope}};if(!P(t.scope,i))return{allowed:!1,reason:"scope-mismatch"};if(Zr(t.roleTemplate).has(r))return{allowed:!0,reason:"role-template",inheritedFrom:{kind:"membership",id:t.id,scope:t.scope}};return{allowed:!1,reason:"missing-capability"}}function en(e){return ie.filter((t)=>Z({...e,capability:t}).allowed)}import{createHash as S,randomBytes as Te}from"node:crypto";import{chmodSync as H,existsSync as ee,mkdirSync as se,statSync as de}from"node:fs";import{dirname as te}from"node:path";import{Database as Ne}from"bun:sqlite";var l=40,j=[{version:1,name:"core_control_plane",sql:`
|
|
2
2
|
CREATE TABLE projects (
|
|
3
3
|
id TEXT PRIMARY KEY,
|
|
4
4
|
slug TEXT NOT NULL UNIQUE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{to}from"./chunk-f35pte64.js";var su="\x00";function El(t,i){if(t==="*"||t==="**")return!0;let e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\x01").replace(/\*/g,"[^/]*").replace(/\u0001/g,".*");return new RegExp(`^${e}$`).test(i)}function g(t,i){if(t.startsWith("*.")){let e=t.slice(1);return i.endsWith(e)&&i.length>e.length}return t===i}function ta(t,i){if(t.enabled===!1)return!1;if(t.methods?.length&&!t.methods.some((e)=>e.toUpperCase()===i.method.toUpperCase()))return!1;if(t.path&&!El(t.path,i.path))return!1;if(t.host&&!g(t.host,i.host??""))return!1;return!0}function ra(t,i){let e=t.key??{source:"ip"},o=e.fallbackToIp!==!1,r;if(e.source==="ip")r=i.ip;else if(e.source==="global")r="global";else if(e.source==="host")r=i.host??"";else if(e.source==="path")r=i.path;else if(e.source==="header")r=e.name?i.headers?.[e.name.toLowerCase()]:void 0;else if(e.source==="cookie")r=e.name?i.cookies?.[e.name]:void 0;if(!r&&e.source!=="global")r=o?i.ip:"__missing__";return`${t.id}\x00${r}`}class wl{clock;maxTrackedKeys;buckets=new Map;windows=new Map;rules;constructor(t,i=()=>Date.now(),e=1e5){this.clock=i;this.maxTrackedKeys=e;this.rules=[...t].sort((o,r)=>(o.priority??0)-(r.priority??0))}check(t){let i=this.clock(),e=this.rules.filter((n)=>ta(n,t)),o;for(let n of e){let s=this.test(n,t,i);if(s.allowed)continue;if(!o||d(s.action)>d(o.action))o=s}if(o)return o;let r={action:"allow",allowed:!0};for(let n of e){let s=this.consume(n,t,i);if(s.remaining!=null&&(r.remaining??1/0)>s.remaining)r=s}return r}test(t,i,e){let o=ra(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let n=t.burst??t.limit,s=this.buckets.get(o),a=s?Math.min(n,s.tokens+this.refill(t,e-s.updatedAt)):n;if(a>=1)return{action:"allow",allowed:!0};return this.blocked(t,o,0,this.msPerToken(t)*(1-a),e)}let r=(this.windows.get(o)?.hits??[]).filter((n)=>n>e-t.windowMs);if(r.length<t.limit)return{action:"allow",allowed:!0};return this.blocked(t,o,0,r[0]+t.windowMs-e,e)}peek(t){let i=this.clock();for(let e of this.rules){if(!ta(e,t))continue;let o=this.test(e,t,i);if(!o.allowed)return o}return{action:"allow",allowed:!0}}msPerToken(t){return t.windowMs/Math.max(1,t.limit)}refill(t,i){return Math.max(0,i)/this.msPerToken(t)}blocked(t,i,e,o,r){let n=t.action??"deny";return{action:n,allowed:n==="allow"||n==="log",ruleId:t.id,limit:t.limit,remaining:e,retryAfterMs:Math.max(0,Math.ceil(o)),resetAt:r+Math.max(0,o),key:i}}consume(t,i,e){let o=ra(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let l=t.burst??t.limit,u=this.buckets.get(o)??{tokens:l,updatedAt:e},c=Math.min(l,u.tokens+this.refill(t,e-u.updatedAt));if(c<1)return this.buckets.set(o,{tokens:c,updatedAt:e}),this.blocked(t,o,0,this.msPerToken(t)*(1-c),e);return this.evictIfNeeded(this.buckets),this.buckets.set(o,{tokens:c-1,updatedAt:e}),{action:"allow",allowed:!0,ruleId:t.id,limit:l,remaining:Math.floor(c-1),resetAt:e+this.msPerToken(t)*(l-(c-1)),key:o}}let n=this.windows.get(o)??{hits:[]},s=e-t.windowMs,a=n.hits.filter((l)=>l>s);if(a.length>=t.limit)return this.windows.set(o,{hits:a}),this.blocked(t,o,0,a[0]+t.windowMs-e,e);return a.push(e),this.evictIfNeeded(this.windows),this.windows.set(o,{hits:a}),{action:"allow",allowed:!0,ruleId:t.id,limit:t.limit,remaining:t.limit-a.length,resetAt:a[0]+t.windowMs,key:o}}evictIfNeeded(t){if(t.size<this.maxTrackedKeys)return;let i=t.size-this.maxTrackedKeys+1,e=0;for(let o of t.keys())if(t.delete(o),++e>=i)break}sweep(){let t=this.clock(),i=0;for(let[e,o]of this.windows){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n){this.windows.delete(e),i++;continue}if(o.hits.every((s)=>s<=t-n.windowMs))this.windows.delete(e),i++}for(let[e,o]of this.buckets){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n||t-o.updatedAt>n.windowMs*2)this.buckets.delete(e),i++}return i}get trackedKeys(){return this.buckets.size+this.windows.size}}function d(t){return{allow:0,log:1,throttle:2,challenge:3,deny:4}[t]}function au(t){let i={};if(t.limit!=null)i["ratelimit-limit"]=String(t.limit);if(t.remaining!=null)i["ratelimit-remaining"]=String(t.remaining);if(t.resetAt!=null)i["ratelimit-reset"]=String(Math.max(0,Math.ceil((t.resetAt-Date.now())/1000)));if(!t.allowed&&t.retryAfterMs!=null)i["retry-after"]=String(Math.max(1,Math.ceil(t.retryAfterMs/1000)));return i}function cu(){return[{id:"global-ip",limit:600,windowMs:60000,burst:100,key:{source:"ip"},action:"deny",priority:100},{id:"api-ip",limit:120,windowMs:60000,burst:30,path:"/api/**",key:{source:"ip"},action:"deny",priority:50},{id:"auth-ip",limit:10,windowMs:60000,algorithm:"sliding_window",path:"/auth/**",methods:["POST"],key:{source:"ip"},action:"challenge",priority:10}]}var m="protection.controls",
|
|
1
|
+
import{to}from"./chunk-f35pte64.js";var su="\x00";function El(t,i){if(t==="*"||t==="**")return!0;let e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\x01").replace(/\*/g,"[^/]*").replace(/\u0001/g,".*");return new RegExp(`^${e}$`).test(i)}function g(t,i){if(t.startsWith("*.")){let e=t.slice(1);return i.endsWith(e)&&i.length>e.length}return t===i}function ta(t,i){if(t.enabled===!1)return!1;if(t.methods?.length&&!t.methods.some((e)=>e.toUpperCase()===i.method.toUpperCase()))return!1;if(t.path&&!El(t.path,i.path))return!1;if(t.host&&!g(t.host,i.host??""))return!1;return!0}function ra(t,i){let e=t.key??{source:"ip"},o=e.fallbackToIp!==!1,r;if(e.source==="ip")r=i.ip;else if(e.source==="global")r="global";else if(e.source==="host")r=i.host??"";else if(e.source==="path")r=i.path;else if(e.source==="header")r=e.name?i.headers?.[e.name.toLowerCase()]:void 0;else if(e.source==="cookie")r=e.name?i.cookies?.[e.name]:void 0;if(!r&&e.source!=="global")r=o?i.ip:"__missing__";return`${t.id}\x00${r}`}class wl{clock;maxTrackedKeys;buckets=new Map;windows=new Map;rules;constructor(t,i=()=>Date.now(),e=1e5){this.clock=i;this.maxTrackedKeys=e;this.rules=[...t].sort((o,r)=>(o.priority??0)-(r.priority??0))}check(t){let i=this.clock(),e=this.rules.filter((n)=>ta(n,t)),o;for(let n of e){let s=this.test(n,t,i);if(s.allowed)continue;if(!o||d(s.action)>d(o.action))o=s}if(o)return o;let r={action:"allow",allowed:!0};for(let n of e){let s=this.consume(n,t,i);if(s.remaining!=null&&(r.remaining??1/0)>s.remaining)r=s}return r}test(t,i,e){let o=ra(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let n=t.burst??t.limit,s=this.buckets.get(o),a=s?Math.min(n,s.tokens+this.refill(t,e-s.updatedAt)):n;if(a>=1)return{action:"allow",allowed:!0};return this.blocked(t,o,0,this.msPerToken(t)*(1-a),e)}let r=(this.windows.get(o)?.hits??[]).filter((n)=>n>e-t.windowMs);if(r.length<t.limit)return{action:"allow",allowed:!0};return this.blocked(t,o,0,r[0]+t.windowMs-e,e)}peek(t){let i=this.clock();for(let e of this.rules){if(!ta(e,t))continue;let o=this.test(e,t,i);if(!o.allowed)return o}return{action:"allow",allowed:!0}}msPerToken(t){return t.windowMs/Math.max(1,t.limit)}refill(t,i){return Math.max(0,i)/this.msPerToken(t)}blocked(t,i,e,o,r){let n=t.action??"deny";return{action:n,allowed:n==="allow"||n==="log",ruleId:t.id,limit:t.limit,remaining:e,retryAfterMs:Math.max(0,Math.ceil(o)),resetAt:r+Math.max(0,o),key:i}}consume(t,i,e){let o=ra(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let l=t.burst??t.limit,u=this.buckets.get(o)??{tokens:l,updatedAt:e},c=Math.min(l,u.tokens+this.refill(t,e-u.updatedAt));if(c<1)return this.buckets.set(o,{tokens:c,updatedAt:e}),this.blocked(t,o,0,this.msPerToken(t)*(1-c),e);return this.evictIfNeeded(this.buckets),this.buckets.set(o,{tokens:c-1,updatedAt:e}),{action:"allow",allowed:!0,ruleId:t.id,limit:l,remaining:Math.floor(c-1),resetAt:e+this.msPerToken(t)*(l-(c-1)),key:o}}let n=this.windows.get(o)??{hits:[]},s=e-t.windowMs,a=n.hits.filter((l)=>l>s);if(a.length>=t.limit)return this.windows.set(o,{hits:a}),this.blocked(t,o,0,a[0]+t.windowMs-e,e);return a.push(e),this.evictIfNeeded(this.windows),this.windows.set(o,{hits:a}),{action:"allow",allowed:!0,ruleId:t.id,limit:t.limit,remaining:t.limit-a.length,resetAt:a[0]+t.windowMs,key:o}}evictIfNeeded(t){if(t.size<this.maxTrackedKeys)return;let i=t.size-this.maxTrackedKeys+1,e=0;for(let o of t.keys())if(t.delete(o),++e>=i)break}sweep(){let t=this.clock(),i=0;for(let[e,o]of this.windows){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n){this.windows.delete(e),i++;continue}if(o.hits.every((s)=>s<=t-n.windowMs))this.windows.delete(e),i++}for(let[e,o]of this.buckets){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n||t-o.updatedAt>n.windowMs*2)this.buckets.delete(e),i++}return i}get trackedKeys(){return this.buckets.size+this.windows.size}}function d(t){return{allow:0,log:1,throttle:2,challenge:3,deny:4}[t]}function au(t){let i={};if(t.limit!=null)i["ratelimit-limit"]=String(t.limit);if(t.remaining!=null)i["ratelimit-remaining"]=String(t.remaining);if(t.resetAt!=null)i["ratelimit-reset"]=String(Math.max(0,Math.ceil((t.resetAt-Date.now())/1000)));if(!t.allowed&&t.retryAfterMs!=null)i["retry-after"]=String(Math.max(1,Math.ceil(t.retryAfterMs/1000)));return i}function cu(){return[{id:"global-ip",limit:600,windowMs:60000,burst:100,key:{source:"ip"},action:"deny",priority:100},{id:"api-ip",limit:120,windowMs:60000,burst:30,path:"/api/**",key:{source:"ip"},action:"deny",priority:50},{id:"auth-ip",limit:10,windowMs:60000,algorithm:"sliding_window",path:"/auth/**",methods:["POST"],key:{source:"ip"},action:"challenge",priority:10}]}var m="protection.controls",zt=24,an=4,R={ipRules:{allow:[],block:[]}};function p(t,i){if(!t?.enabled)return;return new Date(t.expiresAt).getTime()>i.getTime()?t:void 0}function h(t,i){let e=Number.isFinite(t)?Number(t):i;return Math.min(zt,Math.max(0.25,e))}var f=500;class qt{controlPlane;options;constructor(t,i={}){this.controlPlane=t;this.options=i}now(){return this.options.now?.()??new Date}read(){let t=this.controlPlane.getSetting(m);if(!t||typeof t!=="object"||Array.isArray(t))return{...R,ipRules:{allow:[],block:[]}};let i=t;return{attackMode:i.attackMode,mitigationPause:i.mitigationPause,ipRules:{allow:Array.isArray(i.ipRules?.allow)?i.ipRules.allow:[],block:Array.isArray(i.ipRules?.block)?i.ipRules.block:[]},updatedAt:i.updatedAt}}write(t){let i={...t,updatedAt:this.now().toISOString()};return this.controlPlane.setSetting(m,i),i}raw(){return this.read()}current(){let t=this.now(),i=this.read();return{attackMode:p(i.attackMode,t),mitigationPause:p(i.mitigationPause,t),ipRules:i.ipRules}}enableAttackMode(t){let i=this.now(),e={enabled:!0,startedAt:i.toISOString(),expiresAt:new Date(i.getTime()+h(t.hours,an)*3600000).toISOString(),reason:t.reason.trim()||"Attack mode enabled by an operator.",actorId:t.actorId};return this.write({...this.read(),attackMode:e}),e}disableAttackMode(){let t=this.read();if(!t.attackMode?.enabled)return!1;return this.write({...t,attackMode:{...t.attackMode,enabled:!1}}),!0}pauseMitigations(t){let i=t.reason.trim();if(!i)throw Error("Pausing mitigations requires a reason: you are liable for the traffic it admits.");let e=this.now(),o={enabled:!0,startedAt:e.toISOString(),expiresAt:new Date(e.getTime()+h(t.hours,zt)*3600000).toISOString(),reason:i,actorId:t.actorId};return this.write({...this.read(),mitigationPause:o}),o}resumeMitigations(){let t=this.read();if(!t.mitigationPause?.enabled)return!1;return this.write({...t,mitigationPause:{...t.mitigationPause,enabled:!1}}),!0}addIpRule(t,i){let e=i.trim();if(!to(e))throw Error(`Not a valid IP or CIDR: ${i}`);let o=this.read(),r={...o.ipRules,[t]:[...new Set([...o.ipRules[t],e])]};if(r[t].length>f)throw Error(`At most ${f} ${t} rules are supported.`);let n=t==="allow"?"block":"allow";return r[n]=r[n].filter((s)=>s!==e),this.write({...o,ipRules:r}),r}removeIpRule(t,i){let e=this.read(),o={...e.ipRules,[t]:e.ipRules[t].filter((r)=>r!==i.trim())};return this.write({...e,ipRules:o}),o}}function vi(t){if(t.mitigationPause)return{attackMode:!!t.attackMode,mitigationPaused:!0,summary:`Automatic mitigation is paused until ${t.mitigationPause.expiresAt}. All traffic is being served and billed.`,expiresAt:t.mitigationPause.expiresAt};if(t.attackMode)return{attackMode:!0,mitigationPaused:!1,summary:`Attack mode is on until ${t.attackMode.expiresAt}. Every visitor is being challenged.`,expiresAt:t.attackMode.expiresAt};return{attackMode:!1,mitigationPaused:!1,summary:"Protection is in its normal posture."}}function lu(t,i){if(i.mitigationPause)return t.map((e)=>({...e,enabled:!1}));if(!i.attackMode)return[...t];return t.map((e)=>({...e,action:e.action==="deny"?"deny":"challenge",burst:Math.max(1,Math.min(e.burst??e.limit,5))}))}function cn(t,i){let e=[...new Set([...t.allowlist??[],...i.ipRules.allow])],o=[...new Set([...t.blocklist??[],...i.ipRules.block])];if(i.mitigationPause)return{...t,allowlist:e,blocklist:o,monitorOnly:!0};if(!i.attackMode)return{...t,allowlist:e,blocklist:o};let r=t.thresholds??{};return{...t,allowlist:e,blocklist:o,thresholds:{...r,newConnectionsPerSecond:Math.max(1,Math.floor((r.newConnectionsPerSecond??50)/5)),concurrentPerSource:Math.max(1,Math.floor((r.concurrentPerSource??100)/5))}}}function Do(t,i){let e=t?.infrastructure?.compute;if(!e||e.ddos===!1)return t;let o=typeof e.ddos==="object"&&e.ddos!==null?e.ddos:{};return{...t,infrastructure:{...t.infrastructure,compute:{...e,ddos:cn(o,i)}}}}export{su,El,ta,ra,wl,au,cu,zt,an,qt,vi,lu,cn,Do};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pu,Br,Ri,re,mu,ua,Pl,Lo,gu,fu,hu,pa,Pi,Mo,ma,Fr,
|
|
1
|
+
import{pu,Br,Ri,re,mu,ua,Pl,Lo,gu,fu,hu,pa,Pi,Mo,ma,Fr,nr,yu,Wn,Su,ga,Nl,Dl,Uo,fa,ha,ir,Ni,or,ya,Bo,Gn,kl,Di,Sa,ba,ki,xl,va,Ta,Ea,wa,Fo,_l,$l,bu,Ol,Ca,xi,Ll,Ml,jo,Dt,Vo,zo,qo,Aa,Ul,Ia,Ho,vu,lt,Tu,Ra,kt,Pa,Eu,Na,Bl,wu,J,Fl,Wo,Cu,_i,Kn,Jn,Go,jl,Vl,Au,Ko,Jo}from"./chunk-dk38j1qr.js";import"./chunk-8bbw6qc2.js";import"./chunk-gxwsq3k0.js";export{jo as AnomalyConfigStore,jl as AwsSpendTransport,Vl as ComputeSpendTransport,Uo as CounterTracker,ga as DEFAULT_METER_MAPPINGS,pa as DEFAULT_PRICE_BOOK,Ni as DEFAULT_THRESHOLDS,Dt as DETECTABLE_SIGNALS,Ri as ENFORCEMENT_ACTIONS,ki as ENFORCEMENT_DESCRIPTIONS,re as ENFORCEMENT_SEVERITY,Ul as FOCUS_VERSION,Br as METERS,pu as METER_KEYS,mu as MICRO_CENTS,kl as MIN_PROJECTION_CONFIDENCE,Bl as RecordingSpendTransport,Ll as SENSITIVITY_THRESHOLDS,Jn as SPEND_CYCLE_SECONDS,Ra as SPEND_GATE_SETTING,Cu as SPEND_LEASE_SETTING,zo as SignalSource,Pa as SpendCapError,kt as SpendGate,_i as SpendLoopLease,Wo as SpendNotificationRouter,Kn as SpendRunner,lt as SpendService,or as SpendStore,wu as URGENT_SPEND_EVENTS,xl as USER_VISIBLE_ACTIONS,ha as aggregateDeltas,xi as anomalyOptionsForSignal,Eu as assertSpendAllows,nr as budgetWindow,Au as compositeSpendTransport,Na as createEnforcementHandlers,Ol as detectAnomalies,Ca as detectLatestAnomaly,Sa as evaluateBudget,bu as ewma,Nl as findMapping,Pl as findPriceEntry,J as formatCents,Gn as formatTimeToExhaustion,Di as governingLimitCents,Ko as handleSpendRequest,Wn as hourBucket,Su as hourBucketsBetween,wa as isOperationAllowed,Pi as isValidTimeZone,Aa as lookbackHoursForSignal,Fo as median,_l as medianAbsoluteDeviation,ba as mergeDecisions,hu as mergePriceBooks,fa as meterTelemetry,qo as optionsForSignal,Bo as percentOfLimit,va as planEnforcement,yu as previousBudgetWindow,Lo as priceUsage,gu as priceUsageLines,ya as projectSpend,$l as robustZScore,fu as roundCents,Ml as routeMatches,Ta as runEnforcement,ir as scopeKey,Vo as signalDefinition,Fl as spendNotificationText,Jo as spendOpenApiPaths,Go as startSpendLoop,vu as streamFocusJsonl,Ea as strongestActiveAction,ua as tieredMicroCents,Ho as toFocusJsonl,Ia as toFocusRecords,Dl as usageDeltaKey,Fr as utcInstantOfLocal,Tu as zeroFill,ma as zoneOffsetMs,Mo as zonedParts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Lu}from"./chunk-vwzgtsn9.js";import"./chunk-7jwxgxxf.js";import"./chunk-n56c0j1e.js";import"./chunk-pdw0qjq1.js";import"./chunk-gxwsq3k0.js";export{Lu as buildAndPushServerlessImage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jl,La,Xl,no,io,oo,ms}from"./chunk-
|
|
1
|
+
import{Jl,La,Xl,no,io,oo,ms}from"./chunk-fbycbnvj.js";import"./chunk-gxwsq3k0.js";export{Jl as MANAGEMENT_DASHBOARD_SITE,ms as buildManagementDashboardArtifact,La as dashboardCredentialsFile,io as ensureManagementDashboard,oo as managementDashboardSiteNames,Xl as resolveDashboardAuth,no as resolveUiSource};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{U}from"./chunk-
|
|
1
|
+
import{U}from"./chunk-gxwsq3k0.js";function g(t){let e=t.sites||{};for(let r of Object.values(e))if(r?.repository?.url)return{provider:r.repository.provider,branch:r.repository.branch};return}function m(t){let e=t.trim().toLowerCase();if(e.includes("github.com"))return"github";if(e.includes("gitlab.com"))return"gitlab";if(e.includes("bitbucket.org"))return"bitbucket";return}function a(t){return`'${t.replace(/'/g,"'\\''")}'`}function E(t){return t.replace(/'/g,"''")}function _(t,e){let r=["bunx --bun @stacksjs/ts-cloud deploy","--env",a(t)];if(e.site)r.push("--site",a(e.site));if(e.skipDnsVerification)r.push("--skip-dns-verification");return r.push("--yes"),r.join(" ")}function v(t,e="production",r={}){let l=g(t),n=r.provider||l?.provider;if(n!=="github"&&n!=="gitlab"&&n!=="bitbucket")return null;let i=t.environments?.[e],s=i?.deployBranch||l?.branch||"main",u=_(e,r),c=JSON.stringify(s),d=JSON.stringify(e),p=i?.domain?i.domain.startsWith("http")?i.domain:`https://${i.domain}`:void 0,f=p?`
|
|
2
2
|
url: ${JSON.stringify(p)}`:"",h=r.setup==="pantry"?` - name: Setup Pantry
|
|
3
3
|
uses: home-lang/pantry/packages/action@main`:` - uses: oven-sh/setup-bun@v2
|
|
4
4
|
- run: bun install --frozen-lockfile`,y=U(t)==="hetzner"&&!!t.infrastructure?.compute,o=r.sshPrivateKeySecret||"SSH_PRIVATE_KEY";if(!/^[A-Z_][A-Z0-9_]*$/i.test(o))throw Error(`Invalid SSH private key secret name '${o}'`);let b=y?`
|