@stacksjs/ts-cloud 0.11.1 → 0.11.3
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-6vjrts39.js → chunk-0zwknfwp.js} +1 -1
- package/dist/bin/chunk-104xrc2w.js +1 -0
- package/dist/bin/{chunk-jce28gnz.js → chunk-3aph4c1w.js} +2 -2
- package/dist/bin/{chunk-4a97kbk1.js → chunk-4q6tad44.js} +2 -2
- package/dist/bin/{chunk-md2k3n21.js → chunk-4xhj37nj.js} +1 -1
- package/dist/bin/{chunk-ftse39wf.js → chunk-56wvjysz.js} +2 -2
- package/dist/bin/chunk-5nkqza92.js +1 -0
- package/dist/bin/chunk-64vczwwt.js +1 -0
- package/dist/bin/{chunk-y3rm37z1.js → chunk-6tfwm33r.js} +3 -3
- package/dist/bin/chunk-7g2ahkse.js +1 -0
- package/dist/bin/{chunk-9rsn48qg.js → chunk-81hmza39.js} +2 -2
- package/dist/bin/{chunk-gskbezam.js → chunk-82mj52xr.js} +2 -2
- package/dist/bin/{chunk-mwgxyc0z.js → chunk-8khgprf6.js} +1 -1
- package/dist/bin/{chunk-mbnwt3r5.js → chunk-9a88fp00.js} +2 -2
- package/dist/bin/{chunk-21gggxvf.js → chunk-a7w13qfm.js} +2 -2
- package/dist/bin/{chunk-wzepfqf4.js → chunk-b0e39tpv.js} +6 -6
- package/dist/bin/{chunk-r6x7beew.js → chunk-b4wt9jcg.js} +2 -2
- package/dist/bin/{chunk-4a85nk2q.js → chunk-btsyjhk7.js} +2 -2
- package/dist/bin/{chunk-nmkm1f68.js → chunk-c0bdafbx.js} +2 -2
- package/dist/bin/{chunk-67jsyn0g.js → chunk-cbsys5v8.js} +2 -2
- package/dist/bin/{chunk-kbtrr0c3.js → chunk-cd0ps58j.js} +1 -1
- package/dist/bin/{chunk-fpcghdr3.js → chunk-cq9mca3h.js} +3 -3
- package/dist/bin/{chunk-9mydnqr6.js → chunk-d7ke90zt.js} +2 -2
- package/dist/bin/chunk-djg4zyqk.js +1 -0
- package/dist/bin/chunk-dkaz333b.js +1 -0
- package/dist/bin/{chunk-ww770qpn.js → chunk-dz1ec589.js} +2 -2
- package/dist/bin/{chunk-xev7qr2h.js → chunk-e2bybahr.js} +2 -2
- package/dist/bin/{chunk-dbv8w56s.js → chunk-e5ab5twy.js} +2 -2
- package/dist/bin/chunk-edvvx3hg.js +1 -0
- package/dist/bin/{chunk-ks4ewy1s.js → chunk-ehc63fvs.js} +1 -1
- package/dist/bin/chunk-f06c5np9.js +1 -0
- package/dist/bin/{chunk-nkpf91d3.js → chunk-g0fm1xcs.js} +1 -1
- package/dist/bin/chunk-gq8794k6.js +1 -0
- package/dist/bin/{chunk-4vdv41nh.js → chunk-hq9x489e.js} +1 -1
- package/dist/bin/{chunk-0y89hs67.js → chunk-ja1vjdn1.js} +1 -1
- package/dist/bin/{chunk-zwwnt4x1.js → chunk-k3120rx6.js} +1 -1
- package/dist/bin/{chunk-q182t9ba.js → chunk-kg61p5hw.js} +3 -3
- package/dist/bin/chunk-m189194f.js +1 -0
- package/dist/bin/{chunk-hej39dwr.js → chunk-mcr0r4at.js} +2 -2
- package/dist/bin/chunk-mfrf9q4b.js +2 -0
- package/dist/bin/{chunk-4kbhbfq8.js → chunk-my3ewh3a.js} +2 -2
- package/dist/bin/chunk-nw3d4k52.js +1 -0
- package/dist/bin/chunk-p70bc9yr.js +1 -0
- package/dist/bin/{chunk-neampxq1.js → chunk-r6b3pq31.js} +2 -2
- package/dist/bin/{chunk-c1j9v7ee.js → chunk-s4yzes15.js} +2 -2
- package/dist/bin/{chunk-41yqpdv7.js → chunk-sj5csg49.js} +1 -1
- package/dist/bin/chunk-tvz9c388.js +1 -0
- package/dist/bin/{chunk-e1bfd1yv.js → chunk-w32xv8n4.js} +2 -2
- package/dist/bin/chunk-wkx799z2.js +1 -0
- package/dist/bin/{chunk-nyc2jxd8.js → chunk-xhwqpgwq.js} +1 -1
- package/dist/bin/{chunk-zejwh9cy.js → chunk-xk08030d.js} +2 -2
- package/dist/bin/chunk-y1h63vpm.js +1 -0
- package/dist/bin/chunk-zdt2rjk6.js +1 -0
- package/dist/bin/chunk-zh2d4704.js +1 -0
- package/dist/bin/{chunk-35xstvnq.js → chunk-znnawt0k.js} +1 -1
- package/dist/bin/{chunk-26cj89s6.js → chunk-zpe64t4r.js} +1 -1
- package/dist/bin/{chunk-a2t1e5yb.js → chunk-zsf6pccz.js} +1 -1
- package/dist/bin/cli.js +237 -237
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/cdn/cloudflare-settings.d.ts +16 -0
- package/dist/cdn/cloudflare.d.ts +20 -0
- package/dist/{chunk-2m09t0c0.js → chunk-6v4k9ekm.js} +2 -2
- package/dist/{chunk-rcxq9aaa.js → chunk-7pff0rv9.js} +1 -1
- package/dist/chunk-hwan3cev.js +2 -0
- package/dist/{chunk-mch30cyc.js → chunk-m4vqpkpp.js} +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/dns/cloudflare.d.ts +17 -0
- package/dist/dns/godaddy.d.ts +19 -1
- package/dist/dns/index.js +1 -1
- package/dist/dns/zone-migration.d.ts +0 -8
- package/dist/index.js +16 -16
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +5 -5
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +6 -6
- package/dist/ui/data/services.html +5 -5
- package/dist/ui/data/volumes.html +6 -6
- package/dist/ui/index.html +6 -6
- package/dist/ui/infrastructure/topology.html +5 -5
- package/dist/ui/integrations.html +1 -1
- package/dist/ui/operations/alerts.html +5 -5
- 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 +1 -1
- package/dist/ui/server/actions.html +6 -6
- package/dist/ui/server/activity.html +1 -1
- package/dist/ui/server/capacity.html +5 -5
- package/dist/ui/server/database.html +5 -5
- package/dist/ui/server/deployments.html +5 -5
- package/dist/ui/server/diagnostics.html +1 -1
- package/dist/ui/server/firewall.html +5 -5
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +5 -5
- package/dist/ui/server/security.html +2 -2
- package/dist/ui/server/services.html +1 -1
- package/dist/ui/server/sites.html +6 -6
- package/dist/ui/server/ssh-keys.html +6 -6
- package/dist/ui/server/team.html +6 -6
- package/dist/ui/server/terminal.html +2 -2
- package/dist/ui/serverless/alarms.html +6 -6
- package/dist/ui/serverless/assets.html +2 -2
- package/dist/ui/serverless/cost.html +2 -2
- package/dist/ui/serverless/data.html +6 -6
- package/dist/ui/serverless/deployments.html +2 -2
- package/dist/ui/serverless/firewall.html +1 -1
- package/dist/ui/serverless/functions.html +6 -6
- package/dist/ui/serverless/logs.html +6 -6
- package/dist/ui/serverless/metrics.html +1 -1
- package/dist/ui/serverless/queues.html +6 -6
- package/dist/ui/serverless/secrets.html +5 -5
- package/dist/ui/serverless/traces.html +6 -6
- package/dist/ui/serverless.html +5 -5
- package/package.json +3 -3
- package/dist/bin/chunk-0djsffn6.js +0 -1
- package/dist/bin/chunk-0t3sev1j.js +0 -1
- package/dist/bin/chunk-6tct7e89.js +0 -1
- package/dist/bin/chunk-7v5ff3vc.js +0 -1
- package/dist/bin/chunk-80nra92y.js +0 -1
- package/dist/bin/chunk-akbfefwq.js +0 -1
- package/dist/bin/chunk-b704nznp.js +0 -1
- package/dist/bin/chunk-cjz36ths.js +0 -1
- package/dist/bin/chunk-cxd5cevb.js +0 -2
- package/dist/bin/chunk-dxchg0g1.js +0 -1
- package/dist/bin/chunk-g0ewbkbq.js +0 -1
- package/dist/bin/chunk-gvs85t2j.js +0 -1
- package/dist/bin/chunk-khrye4x9.js +0 -1
- package/dist/bin/chunk-memfxrcn.js +0 -1
- package/dist/bin/chunk-pqr8jqnd.js +0 -1
- package/dist/bin/chunk-rfqk5xym.js +0 -1
- package/dist/bin/chunk-wy20ztb6.js +0 -1
- package/dist/bin/chunk-xcqmwphz.js +0 -1
- package/dist/chunk-qtp90j44.js +0 -2
package/dist/aws/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$d as ea,$e as eb,Ae as Fa,Be as Ga,Ce as Ha,De as Ia,Ee as Ja,Fe as Ka,Ge as La,He as Ma,Ie as Na,Jd as k,Je as Oa,Kd as l,Ke as Pa,Ld as m,Le as Qa,Md as n,Me as Ra,Nd as o,Ne as Sa,Od as p,Oe as Ta,Pd as q,Pe as Ua,Qd as r,Qe as Va,Rd as t,Re as Wa,Sd as w,Se as Xa,Td as V,Te as Ya,Ud as X,Ue as Za,Vd as Y,Ve as _a,Wd as Z,We as $a,Xd as _,Xe as ab,Yd as aa,Ye as bb,Zd as ba,Ze as cb,_d as ca,_e as db,ae as fa,af as fb,be as ga,bf as gb,ce as ha,cf as hb,de as ia,df as ib,ee as ja,ef as jb,fe as ka,ff as kb,ge as la,gf as lb,he as ma,hf as mb,ie as na,if as nb,je as oa,jf as ob,ke as pa,kf as pb,le as qa,lf as qb,me as ra,mf as rb,ne as sa,nf as sb,oe as ta,pe as ua,qe as va,re as wa,se as xa,te as ya,ue as za,ve as Aa,we as Ba,xe as Ca,ye as Da,ze as Ea}from"../chunk-h1rc94df.js";import{of as e,pf as h,qf as i,rf as j}from"../chunk-nnqxmh7f.js";import{sf as v}from"../chunk-q2njk4hx.js";import{tf as U}from"../chunk-ky5c6t5y.js";import{uf as da}from"../chunk-t0kh8haz.js";import{Af as B,Bf as C,Cf as D,Df as E,Ef as F,Ff as G,Gf as H,Hf as I,If as J,Jf as K,Kf as L,Lf as M,Mf as N,Nf as O,Of as P,Pf as Q,Qf as R,Rf as S,Sf as T,vf as x,wf as y,xf as z,zf as A}from"../chunk-
|
|
1
|
+
import{$d as ea,$e as eb,Ae as Fa,Be as Ga,Ce as Ha,De as Ia,Ee as Ja,Fe as Ka,Ge as La,He as Ma,Ie as Na,Jd as k,Je as Oa,Kd as l,Ke as Pa,Ld as m,Le as Qa,Md as n,Me as Ra,Nd as o,Ne as Sa,Od as p,Oe as Ta,Pd as q,Pe as Ua,Qd as r,Qe as Va,Rd as t,Re as Wa,Sd as w,Se as Xa,Td as V,Te as Ya,Ud as X,Ue as Za,Vd as Y,Ve as _a,Wd as Z,We as $a,Xd as _,Xe as ab,Yd as aa,Ye as bb,Zd as ba,Ze as cb,_d as ca,_e as db,ae as fa,af as fb,be as ga,bf as gb,ce as ha,cf as hb,de as ia,df as ib,ee as ja,ef as jb,fe as ka,ff as kb,ge as la,gf as lb,he as ma,hf as mb,ie as na,if as nb,je as oa,jf as ob,ke as pa,kf as pb,le as qa,lf as qb,me as ra,mf as rb,ne as sa,nf as sb,oe as ta,pe as ua,qe as va,re as wa,se as xa,te as ya,ue as za,ve as Aa,we as Ba,xe as Ca,ye as Da,ze as Ea}from"../chunk-h1rc94df.js";import{of as e,pf as h,qf as i,rf as j}from"../chunk-nnqxmh7f.js";import{sf as v}from"../chunk-q2njk4hx.js";import{tf as U}from"../chunk-ky5c6t5y.js";import{uf as da}from"../chunk-t0kh8haz.js";import{Af as B,Bf as C,Cf as D,Df as E,Ef as F,Ff as G,Gf as H,Hf as I,If as J,Jf as K,Kf as L,Lf as M,Mf as N,Nf as O,Of as P,Pf as Q,Qf as R,Rf as S,Sf as T,vf as x,wf as y,xf as z,zf as A}from"../chunk-hwan3cev.js";import{Tf as f}from"../chunk-qjk1v1gs.js";import{Sh as u,Th as W}from"../chunk-hbhxk5a0.js";import{Uh as s}from"../chunk-8e0az001.js";import{Wh as g}from"../chunk-p6vszgc2.js";import{Xh as a,Yh as b,Zh as c,_h as d}from"../chunk-gk58959n.js";import"../chunk-spx89gaw.js";export{S as ACMClient,T as ACMDnsValidator,b as AWSClient,Wa as ApplicationAutoScalingClient,l as AwsBackupClient,ka as BedrockAgentClient,ja as BedrockAgentRuntimeClient,ia as BedrockClient,ha as BedrockRuntimeClient,s as CloudFormationClient,v as CloudFrontClient,aa as CloudWatchLogsClient,A as CloudflareProvider,pa as ComprehendClient,ba as ConnectClient,t as CostExplorerClient,Q as DnsProviderFactory,ea as DynamoDBClient,u as EC2Client,U as ECRClient,V as ECSClient,sb as EFSClient,ca as ELBv2Client,Ua as ElastiCacheClient,i as EmailClient,Ta as EventBridgeClient,z as GoDaddyProvider,e as IAMClient,Xa as ImapServer,Qa as KendraClient,_ as LambdaClient,fa as OpenSearchClient,x as PROXIABLE_RECORD_TYPES,Ka as PersonalizeClient,Ma as PersonalizeEventsClient,La as PersonalizeRuntimeClient,Ca as PollyClient,y as PorkbunProvider,da as RDSClient,ua as RekognitionClient,f as Route53Client,w as Route53DomainsClient,F as Route53Provider,g as S3Client,h as SESClient,Y as SNSClient,Z as SQSClient,W as SSMClient,k as STSClient,Va as SchedulerClient,X as SecretsManagerClient,$a as SmsClient,Za as SmtpServer,nb as SupportClient,ob as SupportTemplates,ya as TextractClient,ga as TranscribeClient,Ga as TranslateClient,K as UnifiedDnsValidator,jb as VoiceClient,qa as analyzeSentiment,I as applyZoneMigration,c as buildQueryParams,na as completeWithClaude,ta as containsPii,wa as countFacesInS3Image,db as createDeliveryReceiptHandler,O as createDnsProvider,M as createGoDaddyValidator,r as createObjectStorageClient,L as createPorkbunValidator,lb as createRecordingHandler,N as createRoute53Validator,Fa as createSSML,bb as createScheduledSmsHandler,cb as createSmsClient,ab as createSmsInboxHandler,rb as createSmsInfrastructure,mb as createVoiceClient,kb as createVoicemailHandler,d as detectCredentialSource,P as detectDnsProvider,va as detectLabelsFromS3,sa as detectLanguage,R as dnsProviders,j as email,G as exportRoute53Zone,ra as extractEntities,Aa as extractFormsFromS3,Ba as extractTablesFromS3,za as extractTextFromS3,fb as formatPhoneNumber,oa as generateEmbeddings,hb as getCountryCode,Na as getRecommendations,Oa as getSimilarItems,qb as getSmsInfrastructureStatus,xa as isContentSafe,ib as isSamePhoneNumber,gb as isValidPhoneNumber,n as keyMatchesFilters,ma as listClaudeModels,Ja as listLanguages,Ea as listVoices,o as migrateObjectStorage,eb as normalizePhoneNumber,H as planZoneMigration,B as policyTag,p as providerEndpoint,C as qualifyName,E as reconcileDeclaredRecords,m as remapKey,la as requestModelAccess,D as resolveDeclaredRecords,q as resolveObjectStorage,a as resolveS3Endpoint,Sa as retrieveForRag,Ra as search,pb as setupSmsInfrastructure,Ya as startImapServer,_a as startSmtpServer,Da as textToSpeech,Pa as trackEvent,Ha as translate,Ia as translateToMultiple,J as verifyZoneParity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Jd as a,Kd as b,Ld as c,Md as d,Nd as e,Od as f,Pd as g,Qd as h,Rd as i,Sd as j,Td as k,Ud as l,Vd as m,Wd as n,Xd as o,Yd as p,Zd as q}from"./chunk-kg61p5hw.js";import"./chunk-c0bdafbx.js";import"./chunk-a7w13qfm.js";import"./chunk-btsyjhk7.js";import"./chunk-6tfwm33r.js";import"./chunk-ja1vjdn1.js";import"./chunk-4q6tad44.js";import"./chunk-ehc63fvs.js";export{e as assertEnvWithinLimit,d as buildFunctionEnv,f as deployServerlessApp,m as getCommandRecord,c as infraEnvFromOutputs,l as listCommandHistory,g as redeployServerlessApp,b as resolveSecrets,a as resolveServerlessFunctions,q as restoreServerlessDatabase,h as rollbackServerlessApp,k as runAndRecordCommand,n as runDbQuery,j as runRemoteCommand,p as scaleServerlessDatabase,o as serverlessInfo,i as setMaintenance};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ad as d,xd as a,yd as b,zd as c}from"./chunk-81hmza39.js";import"./chunk-56wvjysz.js";import"./chunk-4q6tad44.js";import"./chunk-ehc63fvs.js";export{b as getComputeDeployHistory,d as restoreDatabaseBackup,a as rollbackComputeSite,c as runComputeRecipe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ch as l,dh as a}from"./chunk-0y89hs67.js";class g{client;region;constructor(e="us-east-1"){this.region=e,this.client=new l}async describeDBInstances(e){let r={Action:"DescribeDBInstances",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((o,c)=>{r[`Filters.Filter.${c+1}.Name`]=o.Name,o.Values.forEach((u,d)=>{r[`Filters.Filter.${c+1}.Values.Value.${d+1}`]=u})});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBInstancesResult||n,s=i.DBInstances?.DBInstance||[];if(!Array.isArray(s))s=s?[s]:[];return{DBInstances:s,Marker:i.Marker}}async describeDBInstance(e){return(await this.describeDBInstances({DBInstanceIdentifier:e})).DBInstances?.[0]}async describeDBClusters(e){let r={Action:"DescribeDBClusters",Version:"2014-10-31"};if(e?.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((o,c)=>{r[`Filters.Filter.${c+1}.Name`]=o.Name,o.Values.forEach((u,d)=>{r[`Filters.Filter.${c+1}.Values.Value.${d+1}`]=u})});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBClustersResult||n,s=i.DBClusters?.DBCluster||[];if(!Array.isArray(s))s=s?[s]:[];return{DBClusters:s,Marker:i.Marker}}async describeDBSnapshots(e){let r={Action:"DescribeDBSnapshots",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;if(e?.SnapshotType)r.SnapshotType=e.SnapshotType;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBSnapshotsResult||n,s=i.DBSnapshots?.DBSnapshot||[];if(!Array.isArray(s))s=s?[s]:[];return{DBSnapshots:s,Marker:i.Marker}}async describeDBSubnetGroups(e){let r={Action:"DescribeDBSubnetGroups",Version:"2014-10-31"};if(e?.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBSubnetGroupsResult||n,s=i.DBSubnetGroups?.DBSubnetGroup||[];if(!Array.isArray(s))s=s?[s]:[];return{DBSubnetGroups:s,Marker:i.Marker}}async createDBInstance(e){let r={Action:"CreateDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBInstanceClass:e.DBInstanceClass,Engine:e.Engine};if(e.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DBName)r.DBName=e.DBName;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.LicenseModel)r.LicenseModel=e.LicenseModel;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.StorageType)r.StorageType=e.StorageType;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.CreateDBInstanceResult||n).DBInstance}}async createDBCluster(e){let r={Action:"CreateDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DatabaseName)r.DatabaseName=e.DatabaseName;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;e.VpcSecurityGroupIds?.forEach((i,s)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${s+1}`]=i});let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.CreateDBClusterResult||t).DBCluster}}async deleteDBInstance(e){let r={Action:"DeleteDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.SkipFinalSnapshot!==void 0)r.SkipFinalSnapshot=e.SkipFinalSnapshot;if(e.FinalDBSnapshotIdentifier)r.FinalDBSnapshotIdentifier=e.FinalDBSnapshotIdentifier;if(e.DeleteAutomatedBackups!==void 0)r.DeleteAutomatedBackups=e.DeleteAutomatedBackups;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.DeleteDBInstanceResult||n).DBInstance}}async modifyDBInstance(e){let r={Action:"ModifyDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.ModifyDBInstanceResult||n).DBInstance}}async modifyDBCluster(e){let r={Action:"ModifyDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier};if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBCluster:(n.ModifyDBClusterResult||n).DBCluster}}async rebootDBCluster(e){let r={Action:"FailoverDBCluster",Version:"2014-10-31",DBClusterIdentifier:e},t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.FailoverDBClusterResult||t).DBCluster}}async createDBClusterSnapshot(e,r){let t={Action:"CreateDBClusterSnapshot",Version:"2014-10-31",DBClusterIdentifier:e,DBClusterSnapshotIdentifier:r};return this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(t)).toString()})}async describeDBClusterSnapshots(e={}){let r={Action:"DescribeDBClusterSnapshots",Version:"2014-10-31",...e},t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()}),n=t.DescribeDBClusterSnapshotsResult||t,i=n.DBClusterSnapshots?.DBClusterSnapshot??n.DBClusterSnapshots??[];return{DBClusterSnapshots:Array.isArray(i)?i:[i]}}async deleteDBClusterSnapshot(e){await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a({Action:"DeleteDBClusterSnapshot",Version:"2014-10-31",DBClusterSnapshotIdentifier:e})).toString()})}async deleteDBCluster(e,r){let t={Action:"DeleteDBCluster",Version:"2014-10-31",DBClusterIdentifier:e,SkipFinalSnapshot:!r};if(r)t.FinalDBSnapshotIdentifier=r;let n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(t)).toString()});return{DBCluster:(n.DeleteDBClusterResult||n).DBCluster}}async restoreDBClusterToPointInTime(e){let r={Action:"RestoreDBClusterToPointInTime",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SourceDBClusterIdentifier:e.SourceDBClusterIdentifier};if(e.RestoreToTime)r.RestoreToTime=e.RestoreToTime.toISOString();if(e.UseLatestRestorableTime)r.UseLatestRestorableTime=!0;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBCluster:(n.RestoreDBClusterToPointInTimeResult||n).DBCluster}}async restoreDBClusterFromSnapshot(e){let r={Action:"RestoreDBClusterFromSnapshot",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SnapshotIdentifier:e.SnapshotIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds?.forEach((i,s)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${s+1}`]=i}),e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.RestoreDBClusterFromSnapshotResult||t).DBCluster}}async startDBInstance(e){let t=new URLSearchParams(a({Action:"StartDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e})).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.StartDBInstanceResult||n).DBInstance}}async stopDBInstance(e){let r={Action:"StopDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.StopDBInstanceResult||n).DBInstance}}async rebootDBInstance(e){let r={Action:"RebootDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.ForceFailover!==void 0)r.ForceFailover=e.ForceFailover;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.RebootDBInstanceResult||n).DBInstance}}async createDBSnapshot(e){let r={Action:"CreateDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBSnapshot:(n.CreateDBSnapshotResult||n).DBSnapshot}}async deleteDBSnapshot(e){let t=new URLSearchParams(a({Action:"DeleteDBSnapshot",Version:"2014-10-31",DBSnapshotIdentifier:e})).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBSnapshot:(n.DeleteDBSnapshotResult||n).DBSnapshot}}async restoreDBInstanceFromDBSnapshot(e){let r={Action:"RestoreDBInstanceFromDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.Port)r.Port=e.Port;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.RestoreDBInstanceFromDBSnapshotResult||n).DBInstance}}async waitForDBInstanceAvailable(e,r=60,t=30000){for(let n=0;n<r;n++){let i=await this.describeDBInstance(e);if(i?.DBInstanceStatus==="available")return i;if(["deleted","failed","incompatible-restore","incompatible-parameters"].includes(i?.DBInstanceStatus||""))throw Error(`DB instance ${e} is in terminal state: ${i?.DBInstanceStatus}`);await new Promise((s)=>setTimeout(s,t))}throw Error(`Timeout waiting for DB instance ${e} to become available`)}async waitForDBInstanceDeleted(e,r=60,t=30000){for(let n=0;n<r;n++)try{let i=await this.describeDBInstance(e);if(i?.DBInstanceStatus==="deleting"){await new Promise((s)=>setTimeout(s,t));continue}throw Error(`DB instance ${e} is in state: ${i?.DBInstanceStatus}`)}catch(i){if(i.code==="DBInstanceNotFound"||i.code==="DBInstanceNotFoundFault")return;throw i}throw Error(`Timeout waiting for DB instance ${e} to be deleted`)}}
|
|
2
|
-
export{g as
|
|
1
|
+
import{dh as l,eh as a}from"./chunk-ja1vjdn1.js";class g{client;region;constructor(e="us-east-1"){this.region=e,this.client=new l}async describeDBInstances(e){let r={Action:"DescribeDBInstances",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((o,c)=>{r[`Filters.Filter.${c+1}.Name`]=o.Name,o.Values.forEach((u,d)=>{r[`Filters.Filter.${c+1}.Values.Value.${d+1}`]=u})});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBInstancesResult||n,s=i.DBInstances?.DBInstance||[];if(!Array.isArray(s))s=s?[s]:[];return{DBInstances:s,Marker:i.Marker}}async describeDBInstance(e){return(await this.describeDBInstances({DBInstanceIdentifier:e})).DBInstances?.[0]}async describeDBClusters(e){let r={Action:"DescribeDBClusters",Version:"2014-10-31"};if(e?.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((o,c)=>{r[`Filters.Filter.${c+1}.Name`]=o.Name,o.Values.forEach((u,d)=>{r[`Filters.Filter.${c+1}.Values.Value.${d+1}`]=u})});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBClustersResult||n,s=i.DBClusters?.DBCluster||[];if(!Array.isArray(s))s=s?[s]:[];return{DBClusters:s,Marker:i.Marker}}async describeDBSnapshots(e){let r={Action:"DescribeDBSnapshots",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;if(e?.SnapshotType)r.SnapshotType=e.SnapshotType;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBSnapshotsResult||n,s=i.DBSnapshots?.DBSnapshot||[];if(!Array.isArray(s))s=s?[s]:[];return{DBSnapshots:s,Marker:i.Marker}}async describeDBSubnetGroups(e){let r={Action:"DescribeDBSubnetGroups",Version:"2014-10-31"};if(e?.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBSubnetGroupsResult||n,s=i.DBSubnetGroups?.DBSubnetGroup||[];if(!Array.isArray(s))s=s?[s]:[];return{DBSubnetGroups:s,Marker:i.Marker}}async createDBInstance(e){let r={Action:"CreateDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBInstanceClass:e.DBInstanceClass,Engine:e.Engine};if(e.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DBName)r.DBName=e.DBName;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.LicenseModel)r.LicenseModel=e.LicenseModel;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.StorageType)r.StorageType=e.StorageType;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.CreateDBInstanceResult||n).DBInstance}}async createDBCluster(e){let r={Action:"CreateDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DatabaseName)r.DatabaseName=e.DatabaseName;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;e.VpcSecurityGroupIds?.forEach((i,s)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${s+1}`]=i});let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.CreateDBClusterResult||t).DBCluster}}async deleteDBInstance(e){let r={Action:"DeleteDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.SkipFinalSnapshot!==void 0)r.SkipFinalSnapshot=e.SkipFinalSnapshot;if(e.FinalDBSnapshotIdentifier)r.FinalDBSnapshotIdentifier=e.FinalDBSnapshotIdentifier;if(e.DeleteAutomatedBackups!==void 0)r.DeleteAutomatedBackups=e.DeleteAutomatedBackups;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.DeleteDBInstanceResult||n).DBInstance}}async modifyDBInstance(e){let r={Action:"ModifyDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.ModifyDBInstanceResult||n).DBInstance}}async modifyDBCluster(e){let r={Action:"ModifyDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier};if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBCluster:(n.ModifyDBClusterResult||n).DBCluster}}async rebootDBCluster(e){let r={Action:"FailoverDBCluster",Version:"2014-10-31",DBClusterIdentifier:e},t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.FailoverDBClusterResult||t).DBCluster}}async createDBClusterSnapshot(e,r){let t={Action:"CreateDBClusterSnapshot",Version:"2014-10-31",DBClusterIdentifier:e,DBClusterSnapshotIdentifier:r};return this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(t)).toString()})}async describeDBClusterSnapshots(e={}){let r={Action:"DescribeDBClusterSnapshots",Version:"2014-10-31",...e},t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()}),n=t.DescribeDBClusterSnapshotsResult||t,i=n.DBClusterSnapshots?.DBClusterSnapshot??n.DBClusterSnapshots??[];return{DBClusterSnapshots:Array.isArray(i)?i:[i]}}async deleteDBClusterSnapshot(e){await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a({Action:"DeleteDBClusterSnapshot",Version:"2014-10-31",DBClusterSnapshotIdentifier:e})).toString()})}async deleteDBCluster(e,r){let t={Action:"DeleteDBCluster",Version:"2014-10-31",DBClusterIdentifier:e,SkipFinalSnapshot:!r};if(r)t.FinalDBSnapshotIdentifier=r;let n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(t)).toString()});return{DBCluster:(n.DeleteDBClusterResult||n).DBCluster}}async restoreDBClusterToPointInTime(e){let r={Action:"RestoreDBClusterToPointInTime",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SourceDBClusterIdentifier:e.SourceDBClusterIdentifier};if(e.RestoreToTime)r.RestoreToTime=e.RestoreToTime.toISOString();if(e.UseLatestRestorableTime)r.UseLatestRestorableTime=!0;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBCluster:(n.RestoreDBClusterToPointInTimeResult||n).DBCluster}}async restoreDBClusterFromSnapshot(e){let r={Action:"RestoreDBClusterFromSnapshot",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SnapshotIdentifier:e.SnapshotIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds?.forEach((i,s)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${s+1}`]=i}),e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.RestoreDBClusterFromSnapshotResult||t).DBCluster}}async startDBInstance(e){let t=new URLSearchParams(a({Action:"StartDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e})).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.StartDBInstanceResult||n).DBInstance}}async stopDBInstance(e){let r={Action:"StopDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.StopDBInstanceResult||n).DBInstance}}async rebootDBInstance(e){let r={Action:"RebootDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.ForceFailover!==void 0)r.ForceFailover=e.ForceFailover;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.RebootDBInstanceResult||n).DBInstance}}async createDBSnapshot(e){let r={Action:"CreateDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBSnapshot:(n.CreateDBSnapshotResult||n).DBSnapshot}}async deleteDBSnapshot(e){let t=new URLSearchParams(a({Action:"DeleteDBSnapshot",Version:"2014-10-31",DBSnapshotIdentifier:e})).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBSnapshot:(n.DeleteDBSnapshotResult||n).DBSnapshot}}async restoreDBInstanceFromDBSnapshot(e){let r={Action:"RestoreDBInstanceFromDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.Port)r.Port=e.Port;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.RestoreDBInstanceFromDBSnapshotResult||n).DBInstance}}async waitForDBInstanceAvailable(e,r=60,t=30000){for(let n=0;n<r;n++){let i=await this.describeDBInstance(e);if(i?.DBInstanceStatus==="available")return i;if(["deleted","failed","incompatible-restore","incompatible-parameters"].includes(i?.DBInstanceStatus||""))throw Error(`DB instance ${e} is in terminal state: ${i?.DBInstanceStatus}`);await new Promise((s)=>setTimeout(s,t))}throw Error(`Timeout waiting for DB instance ${e} to become available`)}async waitForDBInstanceDeleted(e,r=60,t=30000){for(let n=0;n<r;n++)try{let i=await this.describeDBInstance(e);if(i?.DBInstanceStatus==="deleting"){await new Promise((s)=>setTimeout(s,t));continue}throw Error(`DB instance ${e} is in state: ${i?.DBInstanceStatus}`)}catch(i){if(i.code==="DBInstanceNotFound"||i.code==="DBInstanceNotFoundFault")return;throw i}throw Error(`Timeout waiting for DB instance ${e} to be deleted`)}}
|
|
2
|
+
export{g as gd};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{op as ye}from"./chunk-ehc63fvs.js";import{createRequire as Bn}from"node:module";import{isAbsolute as Vt,join as At,relative as Xn}from"node:path";import{existsSync as Ke,readdirSync as Ci}from"node:fs";import{join as Ae}from"node:path";import{createHash as Wi}from"node:crypto";import{copyFileSync as Gi,existsSync as xt,readdirSync as Fi,readFileSync as ot,statSync as Vi,writeFileSync as ct}from"node:fs";import{basename as Ui,dirname as ya,extname as fa,join as He}from"node:path";import{existsSync as tr,readFileSync as Yt}from"node:fs";import{homedir as ar}from"node:os";import{join as rr}from"node:path";import{createHash as sr}from"node:crypto";import{existsSync as ut,mkdirSync as uo,readdirSync as wa,readFileSync as Ea,unlinkSync as qe,writeFileSync as mo}from"node:fs";import{join as Bt}from"node:path";import{createHash as Xt}from"node:crypto";import{createReadStream as po,readdirSync as go,statSync as Tt}from"node:fs";import{join as ho,relative as yo}from"node:path";import{deflateRawSync as Uo}from"node:zlib";import{execSync as Qo}from"node:child_process";import{createHash as Jo}from"node:crypto";import{cpSync as Yo,mkdtempSync as Zo,rmSync as Xo,writeFileSync as ec}from"node:fs";import{tmpdir as tc}from"node:os";import{dirname as ac,isAbsolute as rc,join as Le,resolve as nc}from"node:path";import{fileURLToPath as ic}from"node:url";import{execFileSync as Nt}from"node:child_process";import{mkdtempSync as yn,readFileSync as Dt,rmSync as fn}from"node:fs";import{tmpdir as Sn}from"node:os";import{dirname as yc,join as ve}from"node:path";import{fileURLToPath as fc}from"node:url";import{AsyncLocalStorage as bc}from"node:async_hooks";import{createHash as Ac}from"node:crypto";import{readFileSync as Fc}from"node:fs";import{dirname as Vc,join as Pn}from"node:path";import{fileURLToPath as Uc}from"node:url";import{execFileSync as dt}from"node:child_process";import{existsSync as Hc,mkdirSync as qc,mkdtempSync as zc,readdirSync as Qc,readFileSync as Jc,rmSync as Yc,statSync as In,writeFileSync as Zc}from"node:fs";import{tmpdir as Xc}from"node:os";import{join as Me,relative as el}from"node:path";import{execSync as tl}from"node:child_process";import{createHash as al}from"node:crypto";import{readdirSync as rl,readFileSync as nl,statSync as Nn}from"node:fs";import{join as il,relative as Dn,resolve as ha}from"node:path";var _n=Object.defineProperty,Wn=(e)=>e;function Gn(e,t){this[e]=Wn.bind(null,t)}var De=(e,t)=>{for(var a in t)_n(e,a,{get:t[a],enumerable:!0,configurable:!0,set:Gn.bind(t,a)})},Fn=(e,t)=>()=>(e&&(t=e(e=0)),t),Vn=Bn(import.meta.url),La={};De(La,{clearSigningKeyCache:()=>Qn,createPresignedUrl:()=>Ma,createPresignedUrlAsync:()=>Kn,detectServiceRegion:()=>qt,getSigningKeyCacheSize:()=>Jn,isNodeCryptoAvailable:()=>Yn,isWebCryptoAvailable:()=>Zn,makeAWSRequest:()=>_e,makeAWSRequestAsync:()=>qn,makeAWSRequestOnce:()=>Hn,parseJSONResponse:()=>zn,parseXMLResponse:()=>mt,signRequest:()=>K,signRequestAsync:()=>zt});function qt(e){let t=typeof e==="string"?new URL(e):e,{hostname:a,pathname:r}=t;if(a.endsWith(".on.aws")){let o=a.match(/^[^.]+\.lambda-url\.([^.]+)\.on\.aws$/);if(o)return{service:"lambda",region:o[1]};return{service:"",region:""}}if(a.endsWith(".r2.cloudflarestorage.com"))return{service:"s3",region:"auto"};if(a.endsWith(".backblazeb2.com")){let o=a.match(/^(?:[^.]+\.)?s3\.([^.]+)\.backblazeb2\.com$/);if(o)return{service:"s3",region:o[1]};return{service:"",region:""}}let n=a.replace("dualstack.","").match(/([^.]+)\.(?:([^.]+)\.)?amazonaws\.com(?:\.cn)?$/);if(!n)return{service:"",region:""};let i=n[1],s=n[2]||"";if(s==="us-gov")s="us-gov-west-1";else if(s==="s3"||s==="s3-accelerate")s="us-east-1",i="s3";else if(i==="iot")if(a.startsWith("iot."))i="execute-api";else if(a.startsWith("data.jobs.iot."))i="iot-jobs-data";else i=r==="/mqtt"?"iotdevicegateway":"iotdata";else if(i==="autoscaling");else if(!s&&i.startsWith("s3-"))s=i.slice(3).replace(/^fips-|^external-1/,""),i="s3";else if(i.endsWith("-fips"))i=i.slice(0,-5);else if(s&&/-\d$/.test(i)&&!/-\d$/.test(s))[i,s]=[s,i];return i=Va[i]||i,{service:i,region:s||"us-east-1"}}function K(e){let{method:t,url:a,body:r="",accessKeyId:n,secretAccessKey:i,sessionToken:s,signQuery:o=!1,expiresIn:c=86400,datetime:l}=e,u=new URL(a),m=u.hostname,p=qt(u),g=e.service||p.service,h=e.region||p.region;if(!g)throw Error("Could not detect service from URL. Please provide service explicitly.");if(!h)throw Error("Could not detect region from URL. Please provide region explicitly.");let y=l||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),b=y.substring(0,8),T=[b,h,g,"aws4_request"].join("/"),w="AWS4-HMAC-SHA256";if(o)return Un({urlObj:u,method:t,body:r,accessKeyId:n,secretAccessKey:i,sessionToken:s,service:g,region:h,timestamp:y,date:b,credentialScope:T,algorithm:w,expiresIn:c,cache:e.cache});let S=u.pathname||"/",E=Et(u.searchParams),v={host:m,"x-amz-date":y,...e.headers};if(s)v["x-amz-security-token"]=s;let P=Object.keys(v).some((we)=>we.toLowerCase()==="content-type");if(r&&!P)v["content-type"]="application/x-amz-json-1.0";if(g==="s3"&&!v["x-amz-content-sha256"])v["x-amz-content-sha256"]=Xe(r);let N=xa(v),I=Oa(v),D=v["x-amz-content-sha256"]||Xe(r),L=[t,Pt(S),E,N,I,D].join(`
|
|
2
2
|
`),O=Xe(L),ce=[w,y,T,O].join(`
|
|
3
3
|
`),j=e.cache??ke,ae=_a(i,b,h,g,ce,j),F=[`${w} Credential=${n}/${T}`,`SignedHeaders=${I}`,`Signature=${ae}`].join(", ");return v.authorization=F,{url:a,method:t,headers:v,body:r||void 0}}async function zt(e){let{method:t,url:a,body:r="",accessKeyId:n,secretAccessKey:i,sessionToken:s,signQuery:o=!1,expiresIn:c=86400,datetime:l}=e,u=new URL(a),m=u.hostname,p=qt(u),g=e.service||p.service,h=e.region||p.region;if(!g)throw Error("Could not detect service from URL. Please provide service explicitly.");if(!h)throw Error("Could not detect region from URL. Please provide region explicitly.");let y=l||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),b=y.substring(0,8),T=[b,h,g,"aws4_request"].join("/"),w="AWS4-HMAC-SHA256";if(o)return jn({urlObj:u,method:t,body:r,accessKeyId:n,secretAccessKey:i,sessionToken:s,service:g,region:h,timestamp:y,date:b,credentialScope:T,algorithm:w,expiresIn:c,cache:e.cache});let S=u.pathname||"/",E=Et(u.searchParams),v={host:m,"x-amz-date":y,...e.headers};if(s)v["x-amz-security-token"]=s;let P=Object.keys(v).some((Fe)=>Fe.toLowerCase()==="content-type");if(r&&!P)v["content-type"]="application/x-amz-json-1.0";let N=await ft(r);if(g==="s3"&&!v["x-amz-content-sha256"])v["x-amz-content-sha256"]=N;let I=xa(v),D=Oa(v),L=v["x-amz-content-sha256"]||N,O=[t,Pt(S),E,I,D,L].join(`
|
|
4
4
|
`),ce=await ft(O),j=[w,y,T,ce].join(`
|
|
@@ -7361,4 +7361,4 @@ decorate_workers_output = no
|
|
|
7361
7361
|
php_admin_value[error_log] = /dev/stderr
|
|
7362
7362
|
php_admin_flag[log_errors] = on
|
|
7363
7363
|
clear_env = no
|
|
7364
|
-
`}function jc(){return Pn(Vc(Uc(import.meta.url)),"runtime-assets")}function $a(){let e=jc(),t=(a)=>Fc(Pn(e,a),"utf-8");return[{path:"bootstrap",contents:t("bootstrap"),mode:493},{path:"tscloud/runtime.php",contents:t("runtime.php"),mode:420},{path:"tscloud/octane-runtime.php",contents:t("octane-runtime.php"),mode:420},{path:"tscloud/cli-runtime.php",contents:t("cli-runtime.php"),mode:420},{path:"tscloud/fastcgi-client.php",contents:t("fastcgi-client.php"),mode:420},{path:"tscloud/php-fpm.conf",contents:Gc(),mode:420}]}function $p(e={}){let t=e.cacheDriver??"dynamodb";return{APP_ENV:"production",LOG_CHANNEL:"stderr",CACHE_STORE:t,CACHE_DRIVER:t,SESSION_DRIVER:t,QUEUE_CONNECTION:"sqs",FILESYSTEM_DISK:"s3",VIEW_COMPILED_PATH:"/tmp/storage/framework/views",APP_SERVICES_CACHE:"/tmp/bootstrap/cache/services.php",APP_PACKAGES_CACHE:"/tmp/bootstrap/cache/packages.php",APP_CONFIG_CACHE:"/tmp/bootstrap/cache/config.php",APP_ROUTES_CACHE:"/tmp/bootstrap/cache/routes.php",APP_EVENTS_CACHE:"/tmp/bootstrap/cache/events.php"}}var Kc=["composer install --no-dev --optimize-autoloader --no-interaction","php artisan config:cache","php artisan route:cache","php artisan event:cache","php artisan view:cache"];function*Rn(e){for(let t of Qc(e)){let a=Me(e,t);if(In(a).isDirectory())yield*Rn(a);else yield a}}function Bp(e={}){let t=e.architecture??"x86_64",a=e.platform??(t==="arm64"?"linux/arm64":"linux/amd64"),r=e.onStep??(()=>{}),n=zc(Me(Xc(),"tscloud-php-layer-")),i="tscloud-php-layer:build";try{Zc(Me(n,"Dockerfile"),hc(e)),r("Building PHP runtime image (docker)"),dt("docker",["build","--platform",a,"-t","tscloud-php-layer:build",n],{stdio:"inherit"}),r("Extracting /opt/php from image");let s=dt("docker",["create","--platform",a,"tscloud-php-layer:build"],{encoding:"utf-8"}).trim(),o=Me(n,"opt");qc(o,{recursive:!0});try{dt("docker",["cp",`${s}:/opt/php`,Me(o,"php")],{stdio:"inherit"})}finally{dt("docker",["rm",s],{stdio:"ignore"})}if(!Hc(Me(o,"php","bin","php")))throw Error("layer build produced no /opt/php/bin/php");let c=[];for(let m of Rn(o)){let p=el(o,m).replace(/\\/g,"/"),g=In(m).mode&73?493:420;c.push({name:p,data:Jc(m),mode:g})}r("Injecting runtime assets");let l=new Set($a().map((m)=>m.path)),u=c.filter((m)=>!l.has(m.name));for(let m of $a())u.push({name:m.path,data:m.contents,mode:m.mode});return r("Packaging layer ZIP"),{zip:nt(u),architecture:t,fileCount:u.length}}finally{Yc(n,{recursive:!0,force:!0})}}var sl=[".git",".github","node_modules","tests","storage/logs","storage/framework/cache","storage/framework/sessions","storage/framework/views",".env",".env.local",".vapor",".ts-cloud","dist-lambda"];function ol(e,t){return t.some((a)=>e===a||e.startsWith(`${a}/`))}function*kn(e,t,a){for(let r of rl(e)){let n=il(e,r),i=Dn(t,n).replace(/\\/g,"/");if(ol(i,a))continue;if(Nn(n).isDirectory())yield*kn(n,t,a);else yield n}}function cl(e){if(e.skipBuild)return;let t=ha(e.projectRoot??process.cwd()),a=e.app.build??Kc;for(let r of a)e.onStep?.(`build: ${r}`),tl(r,{stdio:"inherit",cwd:t})}function ll(e,t=[]){let a=ha(e),r=[...sl,It(),...t],n=[];for(let i of kn(a,a,r)){let s=Dn(a,i).replace(/\\/g,"/"),o=(Nn(i).mode&73)!==0;n.push({name:s,data:nl(i),mode:o?493:420})}return n}function Vp(e){let t=ha(e.projectRoot??process.cwd());cl(e),e.onStep?.("packaging application tree");let a=ll(t,e.exclude);if(!a.length)throw Error(`No files to package under ${t}`);let r=nt(a),n=e.app.handlers?.http??"public/index.php";return{zip:r,sha256:al("sha256").update(r).digest("hex"),handlers:{http:n,queue:e.app.handlers?.queue??n,cli:e.app.handlers?.cli??n},fileCount:a.length}}class $n{optimizations=new Map;imageConfigs=new Map;ssgConfigs=new Map;prerenderConfigs=new Map;counter=0;createAssetOptimization(e){let t=`asset-opt-${Date.now()}-${this.counter++}`,a={id:t,...e};return this.optimizations.set(t,a),a}createImageOptimization(e){let t=`image-opt-${Date.now()}-${this.counter++}`,a={id:t,...e};return this.imageConfigs.set(t,a),a}createSSGConfig(e){let t=`ssg-${Date.now()}-${this.counter++}`,a={id:t,...e};return this.ssgConfigs.set(t,a),a}createPrerenderConfig(e){let t=`prerender-${Date.now()}-${this.counter++}`,a={id:t,...e};return this.prerenderConfigs.set(t,a),a}listOptimizations(){return Array.from(this.optimizations.values())}listImageConfigs(){return Array.from(this.imageConfigs.values())}clear(){this.optimizations.clear(),this.imageConfigs.clear(),this.ssgConfigs.clear(),this.prerenderConfigs.clear()}}var Up=new $n;class Ln{policies=new Map;versioningConfigs=new Map;replicationRules=new Map;tieringConfigs=new Map;objectLocks=new Map;transferAcceleration=new Map;accessPoints=new Map;glacierConfigs=new Map;inventories=new Map;batchOps=new Map;eventNotifications=new Map;counter=0;createLifecyclePolicy(e,t){let a=`lifecycle-${Date.now()}-${this.counter++}`,r={id:a,transitions:e,expiration:t};return this.policies.set(a,r),r}enableVersioning(e=!1){let t=`versioning-${Date.now()}-${this.counter++}`,a={id:t,enabled:!0,mfaDelete:e};return this.versioningConfigs.set(t,a),a}createReplicationRule(e,t,a){let r=`replication-${Date.now()}-${this.counter++}`,n={id:r,sourceRegion:e,destRegion:t,destBucket:a};return this.replicationRules.set(r,n),n}createIntelligentTiering(e,t){let a=`tiering-${Date.now()}-${this.counter++}`,r={id:a,archiveDays:e,deepArchiveDays:t};return this.tieringConfigs.set(a,r),r}enableObjectLock(e){let t=`object-lock-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,mode:e.mode||"COMPLIANCE",retentionDays:e.retentionDays,retentionYears:e.retentionYears,legalHoldEnabled:e.legalHoldEnabled||!1};return this.objectLocks.set(t,a),a}enableTransferAcceleration(e){let t=`transfer-accel-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e,enabled:!0,endpoint:`${e}.s3-accelerate.amazonaws.com`};return this.transferAcceleration.set(t,a),a}createAccessPoint(e){let t=`access-point-${Date.now()}-${this.counter++}`,a={id:t,name:e.name,bucketName:e.bucketName,vpcId:e.vpcId,publicAccessBlock:e.publicAccessBlock!==!1,policy:e.policy};return this.accessPoints.set(t,a),a}createGlacierArchive(e){let t=`glacier-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,archiveType:e.archiveType,transitionDays:e.transitionDays,restoreConfig:e.restoreTier?{tier:e.restoreTier,days:e.restoreDays||7}:void 0};return this.glacierConfigs.set(t,a),a}createInventory(e){let t=`inventory-${Date.now()}-${this.counter++}`,a={id:t,sourceBucket:e.sourceBucket,destinationBucket:e.destinationBucket,schedule:e.schedule||"Daily",format:e.format||"CSV",includedFields:e.includedFields||["Size","LastModifiedDate","StorageClass","ETag"],prefix:e.prefix};return this.inventories.set(t,a),a}createBatchOperation(e){let t=`batch-op-${Date.now()}-${this.counter++}`,a={id:t,operation:e.operation,manifestBucket:e.manifestBucket,manifestKey:e.manifestKey,priority:e.priority||10,status:"pending"};return this.batchOps.set(t,a),a}executeBatchOperation(e){let t=this.batchOps.get(e);if(!t)throw Error(`Batch operation not found: ${e}`);return t.status="in_progress",t.totalObjects=1000,t.processedObjects=0,t}getBatchOperationStatus(e){return this.batchOps.get(e)}createLambdaNotification(e){let t=`event-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,events:e.events,destination:{type:"Lambda",arn:e.lambdaArn},filter:e.prefix||e.suffix?{prefix:e.prefix,suffix:e.suffix}:void 0};return this.eventNotifications.set(t,a),a}createSQSNotification(e){let t=`event-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,events:e.events,destination:{type:"SQS",arn:e.queueArn},filter:e.prefix||e.suffix?{prefix:e.prefix,suffix:e.suffix}:void 0};return this.eventNotifications.set(t,a),a}createSNSNotification(e){let t=`event-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,events:e.events,destination:{type:"SNS",arn:e.topicArn},filter:e.prefix||e.suffix?{prefix:e.prefix,suffix:e.suffix}:void 0};return this.eventNotifications.set(t,a),a}generateObjectLockCF(e){let t={ObjectLockEnabled:"Enabled",ObjectLockConfiguration:{ObjectLockEnabled:"Enabled",Rule:{DefaultRetention:{Mode:e.mode}}}};if(e.retentionDays)t.ObjectLockConfiguration.Rule.DefaultRetention.Days=e.retentionDays;if(e.retentionYears)t.ObjectLockConfiguration.Rule.DefaultRetention.Years=e.retentionYears;return t}generateTransferAccelerationCF(e){return{AccelerateConfiguration:{AccelerationStatus:e.enabled?"Enabled":"Suspended"}}}generateAccessPointCF(e){return{Type:"AWS::S3::AccessPoint",Properties:{Name:e.name,Bucket:e.bucketName,...e.vpcId&&{VpcConfiguration:{VpcId:e.vpcId}},PublicAccessBlockConfiguration:e.publicAccessBlock?{BlockPublicAcls:!0,BlockPublicPolicy:!0,IgnorePublicAcls:!0,RestrictPublicBuckets:!0}:void 0,...e.policy&&{Policy:e.policy}}}}generateInventoryCF(e){return{Type:"AWS::S3::Bucket",Properties:{InventoryConfigurations:[{Id:e.id,Destination:{BucketArn:`arn:aws:s3:::${e.destinationBucket}`,Format:e.format},Enabled:!0,IncludedObjectVersions:"Current",OptionalFields:e.includedFields,ScheduleFrequency:e.schedule,...e.prefix&&{Prefix:e.prefix}}]}}}generateEventNotificationCF(e){let t=e.destination.type==="Lambda"?"LambdaConfigurations":e.destination.type==="SQS"?"QueueConfigurations":"TopicConfigurations",a=e.destination.type==="Lambda"?"Function":e.destination.type==="SQS"?"Queue":"Topic",r={Event:e.events[0],[a]:e.destination.arn};if(e.filter)r.Filter={S3Key:{Rules:[...e.filter.prefix?[{Name:"prefix",Value:e.filter.prefix}]:[],...e.filter.suffix?[{Name:"suffix",Value:e.filter.suffix}]:[]]}};return{NotificationConfiguration:{[t]:[r]}}}clear(){this.policies.clear(),this.versioningConfigs.clear(),this.replicationRules.clear(),this.tieringConfigs.clear(),this.objectLocks.clear(),this.transferAcceleration.clear(),this.accessPoints.clear(),this.glacierConfigs.clear(),this.inventories.clear(),this.batchOps.clear(),this.eventNotifications.clear()}}var jp=new Ln;class Mn{checks=new Map;synthetics=new Map;uptimeTrackers=new Map;counter=0;createHealthCheck(e,t=30,a=10){let r=`health-${Date.now()}-${this.counter++}`,n={id:r,url:e,interval:t,timeout:a,status:"healthy"};return this.checks.set(r,n),n}createSyntheticMonitor(e,t,a,r){let n=`synthetic-${Date.now()}-${this.counter++}`,i={id:n,name:e,script:t,frequency:a,locations:r};return this.synthetics.set(n,i),i}trackUptime(e,t,a){let r=`uptime-${Date.now()}-${this.counter++}`,n=t/(t+a)*100,i={id:r,resource:e,uptime:t,downtime:a,availability:n};return this.uptimeTrackers.set(r,i),i}clear(){this.checks.clear(),this.synthetics.clear(),this.uptimeTrackers.clear()}}var Kp=new Mn;class xn{wafRules=new Map;shieldProtections=new Map;securityGroups=new Map;nacls=new Map;counter=0;createWAFRule(e,t,a,r){let n=`waf-${Date.now()}-${this.counter++}`,i={id:n,name:e,priority:t,action:a,conditions:r};return this.wafRules.set(n,i),i}enableShield(e,t="standard"){let a=`shield-${Date.now()}-${this.counter++}`,r={id:a,resourceArn:e,protectionType:t};return this.shieldProtections.set(a,r),r}createSecurityGroup(e,t,a){let r=`sg-${Date.now()}-${this.counter++}`,n={id:r,name:e,vpcId:t,rules:a};return this.securityGroups.set(r,n),n}createNACL(e,t){let a=`nacl-${Date.now()}-${this.counter++}`,r={id:a,vpcId:e,rules:t};return this.nacls.set(a,r),r}clear(){this.wafRules.clear(),this.shieldProtections.clear(),this.securityGroups.clear(),this.nacls.clear()}}var Hp=new xn;class On{strategies=new Map;allocations=new Map;groups=new Map;counter=0;createTaggingStrategy(e,t){let a=`tagging-${Date.now()}-${this.counter++}`,r={id:a,tags:e,resources:t};return this.strategies.set(a,r),r}createCostAllocation(e,t){let a=`cost-${Date.now()}-${this.counter++}`,r={id:a,tagKey:e,allocations:t};return this.allocations.set(a,r),r}createResourceGroup(e,t,a){let r=`group-${Date.now()}-${this.counter++}`,n={id:r,name:e,query:{resourceTypeFilters:t,tagFilters:a}};return this.groups.set(r,n),n}clear(){this.strategies.clear(),this.allocations.clear(),this.groups.clear()}}var qp=new On;export{qt as fh,K as gh,zt as hh,Ma as ih,Kn as jh,_e as kh,Hn as lh,qn as mh,mt as nh,zn as oh,Qn as ph,Jn as qh,Yn as rh,Zn as sh,dl as th,ml as uh,Ua as vh,ei as wh,gl as xh,It as yh,ti as zh,ai as Ah,hl as Bh,Ka as Ch,yl as Dh,fl as Eh,Sl as Fh,ni as Gh,bl as Hh,Al as Ih,Cl as Jh,Tl as Kh,oi as Lh,vl as Mh,wl as Nh,El as Oh,Pl as Ph,A as Qh,f as Rh,Il as Sh,Rl as Th,Nl as Uh,Dl as Vh,kl as Wh,$l as Xh,Ll as Yh,Ml as Zh,xl as _h,Ol as $h,fi as ai,Si as bi,Bl as ci,_l as di,Pe as ei,pe as fi,ne as gi,q as hi,G as ii,k as ji,B as ki,ze as li,_ as mi,Ti as ni,ge as oi,se as pi,Te as qi,Fl as ri,Ri as si,z as ti,xi as ui,pt as vi,Ut as wi,Oi as xi,ie as yi,Bi as zi,ee as Ai,_i as Bi,Ja as Ci,Q as Di,J as Ei,U as Fi,Qe as Gi,W as Hi,Je as Ii,gt as Ji,Y as Ki,d as Li,Ct as Mi,Kl as Ni,Ya as Oi,Hl as Pi,ql as Qi,zl as Ri,Ql as Si,Jl as Ti,Yl as Ui,Zl as Vi,Xl as Wi,eu as Xi,tu as Yi,au as Zi,ru as _i,nu as $i,iu as aj,su as bj,ou as cj,cu as dj,lu as ej,Rs as fj,Ns as gj,$s as hj,Ls as ij,Ms as jj,xs as kj,Os as lj,Bs as mj,er as nj,Aa as oj,_s as pj,Ws as qj,uu as rj,Ca as sj,du as tj,mu as uj,Ge as vj,pu as wj,gu as xj,hu as yj,yu as zj,fu as Aj,Su as Bj,Gs as Cj,Fs as Dj,Us as Ej,js as Fj,Ks as Gj,Rt as Hj,Tu as Ij,Zt as Jj,Hs as Kj,qs as Lj,zs as Mj,nr as Nj,Z as Oj,vu as Pj,no as Qj,fe as Rj,ht as Sj,Ie as Tj,io as Uj,ir as Vj,so as Wj,oo as Xj,co as Yj,va as Zj,te as _j,wu as $j,Eu as ak,Pu as bk,Iu as ck,lo as dk,Ru as ek,H as fk,Nu as gk,Du as hk,ku as ik,or as jk,cr as kk,xu as lk,lr as mk,ur as nk,Wu as ok,Gu as pk,Fu as qk,Vu as rk,Uu as sk,fo as tk,ea as uk,ju as vk,Ku as wk,Hu as xk,qu as yk,zu as zk,So as Ak,bo as Bk,Qu as Ck,Ju as Dk,Yu as Ek,Zu as Fk,Xu as Gk,ed as Hk,td as Ik,ad as Jk,rd as Kk,mr as Lk,ta as Mk,nd as Nk,id as Ok,sd as Pk,od as Qk,pr as Rk,gr as Sk,hr as Tk,cd as Uk,yr as Vk,ld as Wk,ud as Xk,dd as Yk,md as Zk,fr as _k,pd as $k,gd as al,hd as bl,yd as cl,fd as dl,Sd as el,bd as fl,Ad as gl,vo as hl,wo as il,Eo as jl,Po as kl,br as ll,Cd as ml,Td as nl,vd as ol,wd as pl,Ed as ql,Pd as rl,Id as sl,Rd as tl,Nd as ul,No as vl,Do as wl,ko as xl,$o as yl,Dd as zl,kd as Al,Ar as Bl,$d as Cl,Cr as Dl,Tr as El,vr as Fl,wr as Gl,Ld as Hl,Md as Il,xd as Jl,Od as Kl,oe as Ll,Ze as Ml,Bd as Nl,_d as Ol,Wd as Pl,Gd as Ql,Fd as Rl,Vd as Sl,Ud as Tl,jd as Ul,xo as Vl,Kd as Wl,Hd as Xl,Er as Yl,Pr as Zl,qd as _l,zd as $l,Oo as am,Qd as bm,Jd as cm,Yd as dm,Zd as em,Xd as fm,em as gm,tm as hm,am as im,rm as jm,nm as km,im as lm,sm as mm,om as nm,cm as om,lm as pm,um as qm,dm as rm,mm as sm,pm as tm,gm as um,hm as vm,Ir as wm,ym as xm,Rr as ym,fm as zm,Nr as Am,Sm as Bm,Dr as Cm,bm as Dm,kr as Em,Am as Fm,xe as Gm,Cm as Hm,$r as Im,Tm as Jm,vt as Km,vm as Lm,Lr as Mm,wm as Nm,Mr as Om,Em as Pm,xr as Qm,Pm as Rm,Or as Sm,Im as Tm,Br as Um,Rm as Vm,Oe as Wm,Nm as Xm,_r as Ym,Dm as Zm,Wr as _m,km as $m,Gr as an,$m as bn,Fr as cn,Lm as dn,Vr as en,Mm as fn,Ur as gn,xm as hn,jr as in,Om as jn,Kr as kn,Bm as ln,Hr as mn,_m as nn,qr as on,Wm as pn,zr as qn,Gm as rn,Qr as sn,Fm as tn,Jr as un,Vm as vn,Yr as wn,Um as xn,Zr as yn,jm as zn,Xr as An,Km as Bn,en as Cn,Hm as Dn,tn as En,qm as Fn,an as Gn,zm as Hn,rn as In,Qm as Jn,nn as Kn,Jm as Ln,sn as Mn,Ym as Nn,on as On,Zm as Pn,cn as Qn,Xm as Rn,ln as Sn,ep as Tn,Bo as Un,_o as Vn,Fo as Wn,Vo as Xn,un as Yn,tp as Zn,dn as _n,ap as $n,mn as ao,rp as bo,pn as co,np as do,nt as eo,zo as fo,cc as go,lc as ho,mp as io,pp as jo,uc as ko,mc as lo,gn as mo,gp as no,hp as oo,pc as po,gc as qo,hn as ro,hc as so,yp as to,An as uo,Tp as vo,vp as wo,Ia as xo,Ra as yo,Na as zo,Cc as Ao,ga as Bo,Tc as Co,vc as Do,wn as Eo,wc as Fo,Ec as Go,En as Ho,Ic as Io,Rc as Jo,Nc as Ko,Pp as Lo,Dc as Mo,kc as No,Ip as Oo,xc as Po,ka as Qo,Oc as Ro,_c as So,Wc as To,Rp as Uo,Gc as Vo,$a as Wo,$p as Xo,Kc as Yo,Bp as Zo,sl as _o,cl as $o,ll as ap,Vp as bp,$n as cp,Up as dp,Ln as ep,jp as fp,Mn as gp,Kp as hp,xn as ip,Hp as jp,On as kp,qp as lp};
|
|
7364
|
+
`}function jc(){return Pn(Vc(Uc(import.meta.url)),"runtime-assets")}function $a(){let e=jc(),t=(a)=>Fc(Pn(e,a),"utf-8");return[{path:"bootstrap",contents:t("bootstrap"),mode:493},{path:"tscloud/runtime.php",contents:t("runtime.php"),mode:420},{path:"tscloud/octane-runtime.php",contents:t("octane-runtime.php"),mode:420},{path:"tscloud/cli-runtime.php",contents:t("cli-runtime.php"),mode:420},{path:"tscloud/fastcgi-client.php",contents:t("fastcgi-client.php"),mode:420},{path:"tscloud/php-fpm.conf",contents:Gc(),mode:420}]}function $p(e={}){let t=e.cacheDriver??"dynamodb";return{APP_ENV:"production",LOG_CHANNEL:"stderr",CACHE_STORE:t,CACHE_DRIVER:t,SESSION_DRIVER:t,QUEUE_CONNECTION:"sqs",FILESYSTEM_DISK:"s3",VIEW_COMPILED_PATH:"/tmp/storage/framework/views",APP_SERVICES_CACHE:"/tmp/bootstrap/cache/services.php",APP_PACKAGES_CACHE:"/tmp/bootstrap/cache/packages.php",APP_CONFIG_CACHE:"/tmp/bootstrap/cache/config.php",APP_ROUTES_CACHE:"/tmp/bootstrap/cache/routes.php",APP_EVENTS_CACHE:"/tmp/bootstrap/cache/events.php"}}var Kc=["composer install --no-dev --optimize-autoloader --no-interaction","php artisan config:cache","php artisan route:cache","php artisan event:cache","php artisan view:cache"];function*Rn(e){for(let t of Qc(e)){let a=Me(e,t);if(In(a).isDirectory())yield*Rn(a);else yield a}}function Bp(e={}){let t=e.architecture??"x86_64",a=e.platform??(t==="arm64"?"linux/arm64":"linux/amd64"),r=e.onStep??(()=>{}),n=zc(Me(Xc(),"tscloud-php-layer-")),i="tscloud-php-layer:build";try{Zc(Me(n,"Dockerfile"),hc(e)),r("Building PHP runtime image (docker)"),dt("docker",["build","--platform",a,"-t","tscloud-php-layer:build",n],{stdio:"inherit"}),r("Extracting /opt/php from image");let s=dt("docker",["create","--platform",a,"tscloud-php-layer:build"],{encoding:"utf-8"}).trim(),o=Me(n,"opt");qc(o,{recursive:!0});try{dt("docker",["cp",`${s}:/opt/php`,Me(o,"php")],{stdio:"inherit"})}finally{dt("docker",["rm",s],{stdio:"ignore"})}if(!Hc(Me(o,"php","bin","php")))throw Error("layer build produced no /opt/php/bin/php");let c=[];for(let m of Rn(o)){let p=el(o,m).replace(/\\/g,"/"),g=In(m).mode&73?493:420;c.push({name:p,data:Jc(m),mode:g})}r("Injecting runtime assets");let l=new Set($a().map((m)=>m.path)),u=c.filter((m)=>!l.has(m.name));for(let m of $a())u.push({name:m.path,data:m.contents,mode:m.mode});return r("Packaging layer ZIP"),{zip:nt(u),architecture:t,fileCount:u.length}}finally{Yc(n,{recursive:!0,force:!0})}}var sl=[".git",".github","node_modules","tests","storage/logs","storage/framework/cache","storage/framework/sessions","storage/framework/views",".env",".env.local",".vapor",".ts-cloud","dist-lambda"];function ol(e,t){return t.some((a)=>e===a||e.startsWith(`${a}/`))}function*kn(e,t,a){for(let r of rl(e)){let n=il(e,r),i=Dn(t,n).replace(/\\/g,"/");if(ol(i,a))continue;if(Nn(n).isDirectory())yield*kn(n,t,a);else yield n}}function cl(e){if(e.skipBuild)return;let t=ha(e.projectRoot??process.cwd()),a=e.app.build??Kc;for(let r of a)e.onStep?.(`build: ${r}`),tl(r,{stdio:"inherit",cwd:t})}function ll(e,t=[]){let a=ha(e),r=[...sl,It(),...t],n=[];for(let i of kn(a,a,r)){let s=Dn(a,i).replace(/\\/g,"/"),o=(Nn(i).mode&73)!==0;n.push({name:s,data:nl(i),mode:o?493:420})}return n}function Vp(e){let t=ha(e.projectRoot??process.cwd());cl(e),e.onStep?.("packaging application tree");let a=ll(t,e.exclude);if(!a.length)throw Error(`No files to package under ${t}`);let r=nt(a),n=e.app.handlers?.http??"public/index.php";return{zip:r,sha256:al("sha256").update(r).digest("hex"),handlers:{http:n,queue:e.app.handlers?.queue??n,cli:e.app.handlers?.cli??n},fileCount:a.length}}class $n{optimizations=new Map;imageConfigs=new Map;ssgConfigs=new Map;prerenderConfigs=new Map;counter=0;createAssetOptimization(e){let t=`asset-opt-${Date.now()}-${this.counter++}`,a={id:t,...e};return this.optimizations.set(t,a),a}createImageOptimization(e){let t=`image-opt-${Date.now()}-${this.counter++}`,a={id:t,...e};return this.imageConfigs.set(t,a),a}createSSGConfig(e){let t=`ssg-${Date.now()}-${this.counter++}`,a={id:t,...e};return this.ssgConfigs.set(t,a),a}createPrerenderConfig(e){let t=`prerender-${Date.now()}-${this.counter++}`,a={id:t,...e};return this.prerenderConfigs.set(t,a),a}listOptimizations(){return Array.from(this.optimizations.values())}listImageConfigs(){return Array.from(this.imageConfigs.values())}clear(){this.optimizations.clear(),this.imageConfigs.clear(),this.ssgConfigs.clear(),this.prerenderConfigs.clear()}}var Up=new $n;class Ln{policies=new Map;versioningConfigs=new Map;replicationRules=new Map;tieringConfigs=new Map;objectLocks=new Map;transferAcceleration=new Map;accessPoints=new Map;glacierConfigs=new Map;inventories=new Map;batchOps=new Map;eventNotifications=new Map;counter=0;createLifecyclePolicy(e,t){let a=`lifecycle-${Date.now()}-${this.counter++}`,r={id:a,transitions:e,expiration:t};return this.policies.set(a,r),r}enableVersioning(e=!1){let t=`versioning-${Date.now()}-${this.counter++}`,a={id:t,enabled:!0,mfaDelete:e};return this.versioningConfigs.set(t,a),a}createReplicationRule(e,t,a){let r=`replication-${Date.now()}-${this.counter++}`,n={id:r,sourceRegion:e,destRegion:t,destBucket:a};return this.replicationRules.set(r,n),n}createIntelligentTiering(e,t){let a=`tiering-${Date.now()}-${this.counter++}`,r={id:a,archiveDays:e,deepArchiveDays:t};return this.tieringConfigs.set(a,r),r}enableObjectLock(e){let t=`object-lock-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,mode:e.mode||"COMPLIANCE",retentionDays:e.retentionDays,retentionYears:e.retentionYears,legalHoldEnabled:e.legalHoldEnabled||!1};return this.objectLocks.set(t,a),a}enableTransferAcceleration(e){let t=`transfer-accel-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e,enabled:!0,endpoint:`${e}.s3-accelerate.amazonaws.com`};return this.transferAcceleration.set(t,a),a}createAccessPoint(e){let t=`access-point-${Date.now()}-${this.counter++}`,a={id:t,name:e.name,bucketName:e.bucketName,vpcId:e.vpcId,publicAccessBlock:e.publicAccessBlock!==!1,policy:e.policy};return this.accessPoints.set(t,a),a}createGlacierArchive(e){let t=`glacier-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,archiveType:e.archiveType,transitionDays:e.transitionDays,restoreConfig:e.restoreTier?{tier:e.restoreTier,days:e.restoreDays||7}:void 0};return this.glacierConfigs.set(t,a),a}createInventory(e){let t=`inventory-${Date.now()}-${this.counter++}`,a={id:t,sourceBucket:e.sourceBucket,destinationBucket:e.destinationBucket,schedule:e.schedule||"Daily",format:e.format||"CSV",includedFields:e.includedFields||["Size","LastModifiedDate","StorageClass","ETag"],prefix:e.prefix};return this.inventories.set(t,a),a}createBatchOperation(e){let t=`batch-op-${Date.now()}-${this.counter++}`,a={id:t,operation:e.operation,manifestBucket:e.manifestBucket,manifestKey:e.manifestKey,priority:e.priority||10,status:"pending"};return this.batchOps.set(t,a),a}executeBatchOperation(e){let t=this.batchOps.get(e);if(!t)throw Error(`Batch operation not found: ${e}`);return t.status="in_progress",t.totalObjects=1000,t.processedObjects=0,t}getBatchOperationStatus(e){return this.batchOps.get(e)}createLambdaNotification(e){let t=`event-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,events:e.events,destination:{type:"Lambda",arn:e.lambdaArn},filter:e.prefix||e.suffix?{prefix:e.prefix,suffix:e.suffix}:void 0};return this.eventNotifications.set(t,a),a}createSQSNotification(e){let t=`event-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,events:e.events,destination:{type:"SQS",arn:e.queueArn},filter:e.prefix||e.suffix?{prefix:e.prefix,suffix:e.suffix}:void 0};return this.eventNotifications.set(t,a),a}createSNSNotification(e){let t=`event-${Date.now()}-${this.counter++}`,a={id:t,bucketName:e.bucketName,events:e.events,destination:{type:"SNS",arn:e.topicArn},filter:e.prefix||e.suffix?{prefix:e.prefix,suffix:e.suffix}:void 0};return this.eventNotifications.set(t,a),a}generateObjectLockCF(e){let t={ObjectLockEnabled:"Enabled",ObjectLockConfiguration:{ObjectLockEnabled:"Enabled",Rule:{DefaultRetention:{Mode:e.mode}}}};if(e.retentionDays)t.ObjectLockConfiguration.Rule.DefaultRetention.Days=e.retentionDays;if(e.retentionYears)t.ObjectLockConfiguration.Rule.DefaultRetention.Years=e.retentionYears;return t}generateTransferAccelerationCF(e){return{AccelerateConfiguration:{AccelerationStatus:e.enabled?"Enabled":"Suspended"}}}generateAccessPointCF(e){return{Type:"AWS::S3::AccessPoint",Properties:{Name:e.name,Bucket:e.bucketName,...e.vpcId&&{VpcConfiguration:{VpcId:e.vpcId}},PublicAccessBlockConfiguration:e.publicAccessBlock?{BlockPublicAcls:!0,BlockPublicPolicy:!0,IgnorePublicAcls:!0,RestrictPublicBuckets:!0}:void 0,...e.policy&&{Policy:e.policy}}}}generateInventoryCF(e){return{Type:"AWS::S3::Bucket",Properties:{InventoryConfigurations:[{Id:e.id,Destination:{BucketArn:`arn:aws:s3:::${e.destinationBucket}`,Format:e.format},Enabled:!0,IncludedObjectVersions:"Current",OptionalFields:e.includedFields,ScheduleFrequency:e.schedule,...e.prefix&&{Prefix:e.prefix}}]}}}generateEventNotificationCF(e){let t=e.destination.type==="Lambda"?"LambdaConfigurations":e.destination.type==="SQS"?"QueueConfigurations":"TopicConfigurations",a=e.destination.type==="Lambda"?"Function":e.destination.type==="SQS"?"Queue":"Topic",r={Event:e.events[0],[a]:e.destination.arn};if(e.filter)r.Filter={S3Key:{Rules:[...e.filter.prefix?[{Name:"prefix",Value:e.filter.prefix}]:[],...e.filter.suffix?[{Name:"suffix",Value:e.filter.suffix}]:[]]}};return{NotificationConfiguration:{[t]:[r]}}}clear(){this.policies.clear(),this.versioningConfigs.clear(),this.replicationRules.clear(),this.tieringConfigs.clear(),this.objectLocks.clear(),this.transferAcceleration.clear(),this.accessPoints.clear(),this.glacierConfigs.clear(),this.inventories.clear(),this.batchOps.clear(),this.eventNotifications.clear()}}var jp=new Ln;class Mn{checks=new Map;synthetics=new Map;uptimeTrackers=new Map;counter=0;createHealthCheck(e,t=30,a=10){let r=`health-${Date.now()}-${this.counter++}`,n={id:r,url:e,interval:t,timeout:a,status:"healthy"};return this.checks.set(r,n),n}createSyntheticMonitor(e,t,a,r){let n=`synthetic-${Date.now()}-${this.counter++}`,i={id:n,name:e,script:t,frequency:a,locations:r};return this.synthetics.set(n,i),i}trackUptime(e,t,a){let r=`uptime-${Date.now()}-${this.counter++}`,n=t/(t+a)*100,i={id:r,resource:e,uptime:t,downtime:a,availability:n};return this.uptimeTrackers.set(r,i),i}clear(){this.checks.clear(),this.synthetics.clear(),this.uptimeTrackers.clear()}}var Kp=new Mn;class xn{wafRules=new Map;shieldProtections=new Map;securityGroups=new Map;nacls=new Map;counter=0;createWAFRule(e,t,a,r){let n=`waf-${Date.now()}-${this.counter++}`,i={id:n,name:e,priority:t,action:a,conditions:r};return this.wafRules.set(n,i),i}enableShield(e,t="standard"){let a=`shield-${Date.now()}-${this.counter++}`,r={id:a,resourceArn:e,protectionType:t};return this.shieldProtections.set(a,r),r}createSecurityGroup(e,t,a){let r=`sg-${Date.now()}-${this.counter++}`,n={id:r,name:e,vpcId:t,rules:a};return this.securityGroups.set(r,n),n}createNACL(e,t){let a=`nacl-${Date.now()}-${this.counter++}`,r={id:a,vpcId:e,rules:t};return this.nacls.set(a,r),r}clear(){this.wafRules.clear(),this.shieldProtections.clear(),this.securityGroups.clear(),this.nacls.clear()}}var Hp=new xn;class On{strategies=new Map;allocations=new Map;groups=new Map;counter=0;createTaggingStrategy(e,t){let a=`tagging-${Date.now()}-${this.counter++}`,r={id:a,tags:e,resources:t};return this.strategies.set(a,r),r}createCostAllocation(e,t){let a=`cost-${Date.now()}-${this.counter++}`,r={id:a,tagKey:e,allocations:t};return this.allocations.set(a,r),r}createResourceGroup(e,t,a){let r=`group-${Date.now()}-${this.counter++}`,n={id:r,name:e,query:{resourceTypeFilters:t,tagFilters:a}};return this.groups.set(r,n),n}clear(){this.strategies.clear(),this.allocations.clear(),this.groups.clear()}}var qp=new On;export{qt as gh,K as hh,zt as ih,Ma as jh,Kn as kh,_e as lh,Hn as mh,qn as nh,mt as oh,zn as ph,Qn as qh,Jn as rh,Yn as sh,Zn as th,dl as uh,ml as vh,Ua as wh,ei as xh,gl as yh,It as zh,ti as Ah,ai as Bh,hl as Ch,Ka as Dh,yl as Eh,fl as Fh,Sl as Gh,ni as Hh,bl as Ih,Al as Jh,Cl as Kh,Tl as Lh,oi as Mh,vl as Nh,wl as Oh,El as Ph,Pl as Qh,A as Rh,f as Sh,Il as Th,Rl as Uh,Nl as Vh,Dl as Wh,kl as Xh,$l as Yh,Ll as Zh,Ml as _h,xl as $h,Ol as ai,fi as bi,Si as ci,Bl as di,_l as ei,Pe as fi,pe as gi,ne as hi,q as ii,G as ji,k as ki,B as li,ze as mi,_ as ni,Ti as oi,ge as pi,se as qi,Te as ri,Fl as si,Ri as ti,z as ui,xi as vi,pt as wi,Ut as xi,Oi as yi,ie as zi,Bi as Ai,ee as Bi,_i as Ci,Ja as Di,Q as Ei,J as Fi,U as Gi,Qe as Hi,W as Ii,Je as Ji,gt as Ki,Y as Li,d as Mi,Ct as Ni,Kl as Oi,Ya as Pi,Hl as Qi,ql as Ri,zl as Si,Ql as Ti,Jl as Ui,Yl as Vi,Zl as Wi,Xl as Xi,eu as Yi,tu as Zi,au as _i,ru as $i,nu as aj,iu as bj,su as cj,ou as dj,cu as ej,lu as fj,Rs as gj,Ns as hj,$s as ij,Ls as jj,Ms as kj,xs as lj,Os as mj,Bs as nj,er as oj,Aa as pj,_s as qj,Ws as rj,uu as sj,Ca as tj,du as uj,mu as vj,Ge as wj,pu as xj,gu as yj,hu as zj,yu as Aj,fu as Bj,Su as Cj,Gs as Dj,Fs as Ej,Us as Fj,js as Gj,Ks as Hj,Rt as Ij,Tu as Jj,Zt as Kj,Hs as Lj,qs as Mj,zs as Nj,nr as Oj,Z as Pj,vu as Qj,no as Rj,fe as Sj,ht as Tj,Ie as Uj,io as Vj,ir as Wj,so as Xj,oo as Yj,co as Zj,va as _j,te as $j,wu as ak,Eu as bk,Pu as ck,Iu as dk,lo as ek,Ru as fk,H as gk,Nu as hk,Du as ik,ku as jk,or as kk,cr as lk,xu as mk,lr as nk,ur as ok,Wu as pk,Gu as qk,Fu as rk,Vu as sk,Uu as tk,fo as uk,ea as vk,ju as wk,Ku as xk,Hu as yk,qu as zk,zu as Ak,So as Bk,bo as Ck,Qu as Dk,Ju as Ek,Yu as Fk,Zu as Gk,Xu as Hk,ed as Ik,td as Jk,ad as Kk,rd as Lk,mr as Mk,ta as Nk,nd as Ok,id as Pk,sd as Qk,od as Rk,pr as Sk,gr as Tk,hr as Uk,cd as Vk,yr as Wk,ld as Xk,ud as Yk,dd as Zk,md as _k,fr as $k,pd as al,gd as bl,hd as cl,yd as dl,fd as el,Sd as fl,bd as gl,Ad as hl,vo as il,wo as jl,Eo as kl,Po as ll,br as ml,Cd as nl,Td as ol,vd as pl,wd as ql,Ed as rl,Pd as sl,Id as tl,Rd as ul,Nd as vl,No as wl,Do as xl,ko as yl,$o as zl,Dd as Al,kd as Bl,Ar as Cl,$d as Dl,Cr as El,Tr as Fl,vr as Gl,wr as Hl,Ld as Il,Md as Jl,xd as Kl,Od as Ll,oe as Ml,Ze as Nl,Bd as Ol,_d as Pl,Wd as Ql,Gd as Rl,Fd as Sl,Vd as Tl,Ud as Ul,jd as Vl,xo as Wl,Kd as Xl,Hd as Yl,Er as Zl,Pr as _l,qd as $l,zd as am,Oo as bm,Qd as cm,Jd as dm,Yd as em,Zd as fm,Xd as gm,em as hm,tm as im,am as jm,rm as km,nm as lm,im as mm,sm as nm,om,cm as pm,lm as qm,um as rm,dm as sm,mm as tm,pm as um,gm as vm,hm as wm,Ir as xm,ym,Rr as zm,fm as Am,Nr as Bm,Sm as Cm,Dr as Dm,bm as Em,kr as Fm,Am as Gm,xe as Hm,Cm as Im,$r as Jm,Tm as Km,vt as Lm,vm as Mm,Lr as Nm,wm as Om,Mr as Pm,Em as Qm,xr as Rm,Pm as Sm,Or as Tm,Im as Um,Br as Vm,Rm as Wm,Oe as Xm,Nm as Ym,_r as Zm,Dm as _m,Wr as $m,km as an,Gr as bn,$m as cn,Fr as dn,Lm as en,Vr as fn,Mm as gn,Ur as hn,xm as in,jr as jn,Om as kn,Kr as ln,Bm as mn,Hr as nn,_m as on,qr as pn,Wm as qn,zr as rn,Gm as sn,Qr as tn,Fm as un,Jr as vn,Vm as wn,Yr as xn,Um as yn,Zr as zn,jm as An,Xr as Bn,Km as Cn,en as Dn,Hm as En,tn as Fn,qm as Gn,an as Hn,zm as In,rn as Jn,Qm as Kn,nn as Ln,Jm as Mn,sn as Nn,Ym as On,on as Pn,Zm as Qn,cn as Rn,Xm as Sn,ln as Tn,ep as Un,Bo as Vn,_o as Wn,Fo as Xn,Vo as Yn,un as Zn,tp as _n,dn as $n,ap as ao,mn as bo,rp as co,pn as do,np as eo,nt as fo,zo as go,cc as ho,lc as io,mp as jo,pp as ko,uc as lo,mc as mo,gn as no,gp as oo,hp as po,pc as qo,gc as ro,hn as so,hc as to,yp as uo,An as vo,Tp as wo,vp as xo,Ia as yo,Ra as zo,Na as Ao,Cc as Bo,ga as Co,Tc as Do,vc as Eo,wn as Fo,wc as Go,Ec as Ho,En as Io,Ic as Jo,Rc as Ko,Nc as Lo,Pp as Mo,Dc as No,kc as Oo,Ip as Po,xc as Qo,ka as Ro,Oc as So,_c as To,Wc as Uo,Rp as Vo,Gc as Wo,$a as Xo,$p as Yo,Kc as Zo,Bp as _o,sl as $o,cl as ap,ll as bp,Vp as cp,$n as dp,Up as ep,Ln as fp,jp as gp,Mn as hp,Kp as ip,xn as jp,Hp as kp,On as lp,qp as mp};
|
|
@@ -34,4 +34,4 @@ fi
|
|
|
34
34
|
mv "${s}.new" "${s}"
|
|
35
35
|
echo "ts-cloud: WAF config installed (mode: ${n.mode})"
|
|
36
36
|
`}function _(e,r){return e.map((t)=>({projectId:r.projectId,environmentId:r.environmentId,resourceId:r.resourceId,kind:"event",source:"zig-waf",name:t.action==="blocked"?"waf.blocked":"waf.matched",timestamp:t.timestamp,value:1,host:t.host,pathTemplate:t.path,method:t.method,attributes:{ruleId:t.ruleId??null,anomalyScore:t.anomalyScore,action:t.action,messages:t.messages.slice(0,5)}}))}
|
|
37
|
-
export{l as
|
|
37
|
+
export{l as Ye,g as Ze,R as _e,v as $e,I as af,_ as bf};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Eh as re,Fh as ne}from"./chunk-4q6tad44.js";function it(e,t){return`/var/www/${e}-${t}`}var Ee=new Set(["laravel","php","statamic","wordpress"]);function se(e){return e.type!=null&&Ee.has(e.type)}function Pe(e){let t=e.proxyTo;if(t==null)return[];return(Array.isArray(t)?t:[t]).map((n)=>String(n).trim()).filter((n)=>n.length>0)}function be(e){return Pe(e).length>0}function oe(e){if(e.deploy)return e.deploy;if(se(e))return"server";if(e.start)return"server";return"bucket"}function M(e){if(e.redirect)return"redirect";if(be(e))return"proxy";if(se(e))return"server-php";if(oe(e)==="bucket")return"bucket";return e.start?"server-app":"server-static"}function Ce(e){return e.infrastructure?.compute!=null||Boolean(e.cloud?.attachTo?.trim())}function at(e,t={}){let r=[],n=[],i=e.sites||{},s=Ce(e),c=ne(e);if(c)r.push(c);let d=new Map;for(let[l,o]of Object.entries(i)){if(!o)continue;let S=oe(o),E=M(o);if(E==="redirect"){if(!o.domain)r.push(`Site '${l}' is a redirect site but has no \`domain\` to redirect from.`);if(!(typeof o.redirect==="string"?o.redirect:o.redirect?.to))r.push(`Site '${l}' is a redirect site but has no redirect target (\`redirect\` / \`redirect.to\`).`);if(!s)r.push(`Site '${l}' is a redirect site but no \`infrastructure.compute\` is configured to host the gateway that serves the redirect.`);let a=[];if(o.start)a.push("start");if(o.root)a.push("root");if(o.proxyTo)a.push("proxyTo");if(a.length>0)n.push(`Site '${l}' is a redirect site but also sets ${a.join(", ")}. These are ignored.`);continue}if(E==="proxy"){if(!o.domain)r.push(`Site '${l}' is a proxy site but has no \`domain\` to route from.`);if(!s)r.push(`Site '${l}' is a proxy site but no \`infrastructure.compute\` is configured to host the gateway that forwards it.`);let p=[];if(o.start)p.push("start");if(o.root)p.push("root");if(typeof o.port==="number")p.push("port");if(o.build)p.push("build");if(o.preStart&&o.preStart.length>0)p.push("preStart");if(p.length>0)n.push(`Site '${l}' sets \`proxyTo\`, so ts-cloud ships and supervises nothing for it. ${p.join(", ")} ${p.length===1?"is":"are"} ignored — remove ${p.length===1?"it":"them"}, or drop \`proxyTo\` to let ts-cloud own the service.`);continue}if(S==="server"&&!o.start&&!o.root){r.push(`Site '${l}' sets deploy:'server' but declares neither \`start\` (dynamic app) nor \`root\` (static site to serve). Add one.`);continue}if(E==="server-php"){if(!s)r.push(`Site '${l}' is a PHP site (type:'${o.type}') but no \`infrastructure.compute\` is configured. Add a server (infrastructure.compute) with PHP provisioning.`);if(!o.repository?.url)r.push(`Site '${l}' is a PHP site (type:'${o.type}') but has no \`repository.url\` to clone. PHP sites deploy via git.`)}else if(E==="server-app"){if(!s)r.push(`Site '${l}' deploys to a server (deploy:'server'${o.deploy?"":" inferred from `start`"}) but no \`infrastructure.compute\` is configured. Set deploy:'bucket' or add a server (infrastructure.compute).`);if(typeof o.port==="number"){let p=t.occupiedPorts?.get(o.port);if(p)r.push(`Site '${l}' wants port ${o.port}, which project '${p}' already serves on this box. Attached projects share one port namespace. Give '${l}' a free port, or let the attach allocate one.`);let a=d.get(o.port);if(a)r.push(`Sites '${a}' and '${l}' both use port ${o.port}. Server apps sharing a box must use distinct ports.`);else d.set(o.port,l)}}else if(E==="server-static"){if(!o.root)r.push(`Site '${l}' is a server static site (deploy:'server', no \`start\`) but has no \`root\` directory to serve.`);if(!s)r.push(`Site '${l}' deploys to a server (deploy:'server') but no \`infrastructure.compute\` is configured. Set deploy:'bucket' or add a server (infrastructure.compute).`)}else{if(!o.root)r.push(`Site '${l}' deploys to a bucket but has no \`root\` directory to upload.`);let p=[];if(o.start)p.push("start");if(typeof o.port==="number")p.push("port");if(o.preStart&&o.preStart.length>0)p.push("preStart");if(p.length>0)n.push(`Site '${l}' deploys to a bucket but sets server-only field(s): ${p.join(", ")}. These are ignored. Set deploy:'server' to use them.`)}}return{errors:r,warnings:n}}function ct(e){let t=M(e);return t!=="bucket"&&t!=="redirect"&&t!=="proxy"}function lt(e){return M(e)==="bucket"}function pt(e,t){if(re(e)==="serverless")return!0;let r=Object.entries(e.sites??{}).filter(([,i])=>i!=null),n=t?r.filter(([i])=>i===t):r;if(n.length===0)return!0;return!n.every(([,i])=>{let s=M(i);return s==="redirect"||s==="proxy"})}var U={php:"php.net",nginx:"nginx.org",composer:"getcomposer.org",mysql:"mysql.com",mariadb:"mariadb.com/server",postgres:"postgresql.org",vitess:"vitess.io",etcd:"etcd.io",redis:"redis.io",memcached:"memcached.org",meilisearch:"meilisearch.com",mail:"github.com/mail-os/mail",git:"git-scm.com",certbot:"certbot.eff.org",bun:"bun.sh",node:"nodejs.org",deno:"deno.land"};var R="/opt/pantry";function V(e){return`'${e.split("'").join("'\\''")}'`}function dt(e={}){return["export DEBIAN_FRONTEND=noninteractive","export PANTRY_SERVICE_SCOPE=system","export PANTRY_INSTALL_DIR=/usr/local/bin",e.version?`export PANTRY_VERSION=${V(e.version)}`:'export PANTRY_VERSION="${PANTRY_VERSION:-latest}"',"command -v curl >/dev/null 2>&1 || (apt-get update -y && apt-get install -y curl ca-certificates)","command -v unzip >/dev/null 2>&1 || (apt-get update -y && apt-get install -y unzip)",'OS=$(uname -s | tr \'[:upper:]\' \'[:lower:]\'); ARCH=$(uname -m); case "$ARCH" in x86_64|amd64) ARCH=x64 ;; arm64|aarch64) ARCH=arm64 ;; esac; ZIP="pantry-${OS}-${ARCH}.zip"; if [ "${PANTRY_VERSION:-latest}" = latest ]; then REL=\'latest/download\'; else REL="download/v${PANTRY_VERSION}"; fi; TMP=$(mktemp -d); curl -fsSL -o "${TMP}/${ZIP}" "https://github.com/pantry-pm/pantry/releases/${REL}/${ZIP}"; unzip -o "${TMP}/${ZIP}" -d /usr/local/bin; chmod +x /usr/local/bin/pantry; rm -rf "${TMP}"','export PATH="/usr/local/bin:$PATH"',"mkdir -p /opt/pantry"]}function G(){return'eval "$(cd /opt/pantry && pantry env 2>/dev/null)" || true'}function D(e){if(e.length===0)return[];return[`(cd /opt/pantry && pantry install ${[...new Set(e)].map(V).join(" ")})`]}function ie(e){return[...new Set(e)].flatMap((t)=>[`(cd /opt/pantry && pantry start ${V(t)})`,`(cd /opt/pantry && pantry enable ${V(t)})`])}var g="/etc/mail",h="mail-server",F="mail",Y=`${R}/pantry/.bin`;function T(e){return`'${String(e).split("'").join("'\\''")}'`}function P(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`}function Re(e){return[e.version?`${U.mail}@${e.version}`:U.mail]}function K(e,t){return`${g}/dkim/${t}.${e.dkim.selector}.pem`}function De(e){let t=["# Generated by ts-cloud. Edits are overwritten on the next deploy —","# change `services.mail` in the cloud config instead.","","[server]",`host = ${P(e.bindAddress)}`,`port = ${e.ports.smtp}`,`hostname = ${P(e.hostname)}`];if(e.domains.length>0)t.push(`local_domains = ${P(e.domains.join(", "))}`);if(e.mode==="catcher")t.push("catch_all = true");if(t.push(`max_message_size = ${e.maxMessageSize}`,"","[tls]",`enabled = ${e.tls.enabled}`),e.tls.certPath)t.push(`cert_path = ${P(e.tls.certPath)}`);if(e.tls.keyPath)t.push(`key_path = ${P(e.tls.keyPath)}`);if(t.push("","[auth]",`enabled = ${e.mode==="server"}`,"","[antispam]",`dnsbl = ${e.spam.dnsbl}`,`greylist = ${e.spam.greylist}`,`spam_filter = ${e.spam.enabled}`,`junk_score = ${e.spam.junkScore}`,`reject_score = ${e.spam.rejectScore}`,"","[dkim]",`rotation_enabled = ${e.dkim.enabled&&e.dkim.rotate}`,`rotation_interval_days = ${e.dkim.rotateIntervalDays}`,"","[acme]",`enabled = ${e.tls.acme}`),e.tls.acmeEmail)t.push(`email = ${P(e.tls.acmeEmail)}`);if(t.push("","[webhook]",`enabled = ${!!e.webhookUrl}`),e.webhookUrl)t.push(`url = ${P(e.webhookUrl)}`);return t.push(""),t.join(`
|
|
2
2
|
`)}function Oe(e){let t=["# Generated by ts-cloud. See /etc/mail/config.toml for the rest.",`SMTP_DB_PATH=${e.storagePath}/mail.db`,`SMTP_DELIVERY_METHOD=${e.delivery==="ses"?"ses":"direct"}`];if(e.delivery==="ses")t.push(`SMTP_SES_REGION=${e.sesRegion}`);if(e.ports.submission)t.push(`SUBMISSION_PORT=${e.ports.submission}`);if(e.ports.submissions)t.push(`SMTPS_PORT=${e.ports.submissions}`);if(e.ports.imap)t.push("IMAP_ENABLED=1",`IMAP_PORT=${e.ports.imap}`);if(e.webmail.enabled)t.push("SMTP_ENABLE_WEBMAIL=true",`SMTP_WEBMAIL_PORT=${e.webmail.port}`,`SMTP_WEBMAIL_SECURE_COOKIES=${e.tls.enabled}`);if(e.tls.requireForAuth)t.push("SMTP_REQUIRE_TLS_FOR_AUTH=true");if(e.dkim.enabled&&e.domains.length>0){let[r,...n]=e.domains;if(t.push(`DKIM_DOMAIN=${r}`,`DKIM_SELECTOR=${e.dkim.selector}`,`DKIM_PRIVATE_KEY_PATH=${K(e,r)}`),n.length>0){let i=n.map((s)=>`${s}:${e.dkim.selector}:${K(e,s)}`);t.push(`DKIM_EXTRA_KEYS=${i.join(",")}`)}}return t.push(""),t.join(`
|
|
3
3
|
`)}function Ae(e){let t=[e.ports.smtp,e.ports.submission,e.ports.submissions,e.ports.imap,e.ports.imaps].some((r)=>typeof r==="number"&&r<1024);return["[Unit]","Description=Mail server (SMTP/IMAP + webmail)","After=network-online.target","Wants=network-online.target","","[Service]","Type=simple",`User=${h}`,`Group=${h}`,`WorkingDirectory=${e.storagePath}`,`EnvironmentFile=${g}/mail.env`,`Environment="PATH=${Y}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"`,`ExecStart=${Y}/mail serve --config ${g}/config.toml`,"Restart=always","RestartSec=5","LimitNOFILE=65536",...t?["AmbientCapabilities=CAP_NET_BIND_SERVICE","CapabilityBoundingSet=CAP_NET_BIND_SERVICE"]:[],"NoNewPrivileges=true","PrivateTmp=true","ProtectSystem=strict","ProtectHome=true","ProtectKernelTunables=true","ProtectKernelModules=true","ProtectControlGroups=true",`ReadWritePaths=${e.storagePath} ${g}`,"","[Install]","WantedBy=multi-user.target",""].join(`
|
|
4
4
|
`)}function Le(e){if(!e.dkim.enabled||e.domains.length===0)return[];let t=[`mkdir -p ${g}/dkim`];for(let r of e.domains){let n=K(e,r);t.push(`if [ ! -f ${T(n)} ]; then openssl genrsa -out ${T(n)} 2048; fi`,`chmod 0600 ${T(n)}`,`echo "DKIM ${e.dkim.selector}._domainkey.${r} IN TXT v=DKIM1; k=rsa; p=$(openssl rsa -in ${T(n)} -pubout -outform PEM 2>/dev/null | grep -v '^-----' | tr -d '\\n')"`)}return t.push(`chown -R ${h}:${h} ${g}/dkim`),t}function Ue(e){if(e.accounts.length===0)return[];let t=(r)=>`runuser -u ${h} -- env SMTP_DB_PATH=${T(`${e.storagePath}/mail.db`)} ${Y}/mail user:local ${r} || true`;return e.accounts.flatMap((r)=>[t(`create ${T(r.address)} ${T(r.password)} ${T(r.address)}`),t(`change-password ${T(r.address)} ${T(r.password)}`)])}function ae(e){if(!e.enabled)return[];return[...D(Re(e)),`id -u ${h} >/dev/null 2>&1 || useradd --system --no-create-home --shell /usr/sbin/nologin ${h}`,`mkdir -p ${e.storagePath} ${g}`,`chown -R ${h}:${h} ${e.storagePath}`,`cat > ${g}/config.toml <<'TS_CLOUD_MAIL_CONF_EOF'`,De(e),"TS_CLOUD_MAIL_CONF_EOF",`cat > ${g}/mail.env <<'TS_CLOUD_MAIL_ENV_EOF'`,Oe(e),"TS_CLOUD_MAIL_ENV_EOF",`chmod 0640 ${g}/mail.env`,`chown root:${h} ${g}/mail.env`,...Le(e),`cat > /etc/systemd/system/${F}.service <<'TS_CLOUD_MAIL_UNIT_EOF'`,Ae(e),"TS_CLOUD_MAIL_UNIT_EOF","systemctl daemon-reload",`systemctl enable ${F}`,`systemctl restart ${F}`,...Ue(e)]}var _=`${R}/pantry/.bin`,z=15306,j=15991,w=15999,ce=16101,q=2379,v="/var/lib/vitess",X=100;function Ie(e){return e===!0||typeof e==="object"&&e!==null}function xe(e){return typeof e==="object"&&e!==null?e:{}}function f(e){return`'${String(e).split("'").join("'\\''")}'`}function ke(e){let r=[e.version?`vitess.io@${e.version}`:"vitess.io"];if(e.mode!=="combo"&&!e.etcdEndpoint)r.push("etcd.io");return r.push("mysql.com@8.0.43"),r}var m="vitess",Ne=`${_}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`,de="/usr/local/lib/vitess",Q=new Map;function W(e){return`${de}/${e}.sh`}function O(e,t){return Q.set(e,Me(t)),`/bin/sh ${W(e)}`}function le(){let e=[`mkdir -p ${de}`];for(let[t,r]of Q)e.push(`cat > ${W(t)} <<'TS_CLOUD_VITESS_LAUNCHER_EOF'`,r,"TS_CLOUD_VITESS_LAUNCHER_EOF",`chmod 0755 ${W(t)}`);return e}function Me(e){return["#!/bin/sh","set -e",`cd ${R}`,`PANTRY_ENV="$(pantry env 2>/dev/null | grep -E '^(export [A-Za-z_]|[A-Za-z_][A-Za-z0-9_]*=)' || true)"`,'if [ -n "$PANTRY_ENV" ]; then eval "$PANTRY_ENV"; fi',`VT_MYSQL_ROOT="$(dirname "$(dirname "$(readlink -f ${_}/mysqld 2>/dev/null)")")"`,`VTROOT="$(dirname "$(dirname "$(readlink -f ${_}/mysqlctld 2>/dev/null)")")"`,"export VT_MYSQL_ROOT VTROOT",'LD_LIBRARY_PATH="$VT_MYSQL_ROOT/lib:$VTROOT/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"',"export LD_LIBRARY_PATH",`exec ${e.join(" ")}`].join(`
|
|
@@ -6,4 +6,4 @@ import{Dh as re,Eh as ne}from"./chunk-4a97kbk1.js";function it(e,t){return`/var/
|
|
|
6
6
|
`)}function pe(e,t){return[`cat > /etc/systemd/system/${e}.service <<'TS_CLOUD_VITESS_UNIT_EOF'`,t,"TS_CLOUD_VITESS_UNIT_EOF"]}function Ve(e){let t=e.cell??"zone1",r=e.vtgatePort??z,i=`${((e.keyspaces?.length)?e.keyspaces:[{name:"app"}]).map((s)=>{let c=(s.sharded?["-80","80-"]:["0"]).map((d)=>`shards:{name:"${d}"}`).join(" ");return`keyspaces:{name:"${s.name}" ${c}}`}).join(" ")} cells:"${t}"`;return A({description:"Vitess (vtcombo, single-process development stack)",execStart:O("vtcombo",[`${_}/vtcombo`,`--cell ${t}`,`--proto-topo ${f(i)}`,`--mysql-server-port ${r}`,"--mysql-server-bind-address 127.0.0.1","--mysql-auth-server-impl none","--start-mysql",`--port ${j}`,`--grpc-port ${w}`])})}function we(){return A({description:"etcd (Vitess topology store)",execStart:O("etcd",[`${_}/etcd`,`--data-dir ${v}/etcd`,`--listen-client-urls http://127.0.0.1:${q}`,`--advertise-client-urls http://127.0.0.1:${q}`]),execStartPre:[`+/bin/mkdir -p ${v}/etcd`,`+/bin/chown ${m}:${m} ${v}/etcd`]})}function J(e){return["--topo-implementation etcd2",`--topo-global-server-address ${e.etcdEndpoint??`http://127.0.0.1:${q}`}`,"--topo-global-root /vitess/global"]}function qe(e){let t=!e.etcdEndpoint;return A({description:"Vitess vtctld (control plane)",after:t?["vitess-etcd.service"]:[],requires:t?["vitess-etcd.service"]:[],execStart:O("vtctld",[`${_}/vtctld`,...J(e),`--cell ${e.cell??"zone1"}`,"--service-map grpc-vtctl,grpc-vtctld",`--grpc-port ${w}`,`--port ${w+1}`])})}function Be(e,t,r){let n=e.cell??"zone1";return A({description:`Vitess vttablet (${t}/${r})`,after:["vitess-vtctld.service","vitess-mysqlctld.service"],requires:["vitess-mysqlctld.service"],execStart:O("vttablet",[`${_}/vttablet`,...J(e),`--tablet-path ${n}-${String(X).padStart(10,"0")}`,`--init-keyspace ${t}`,`--init-shard ${r}`,"--init-tablet-type replica",`--service-map ${f("grpc-queryservice,grpc-tabletmanager,grpc-updatestream")}`,`--port ${ce}`,`--grpc-port ${ce+1}`,`--db-port ${e.mysqlPort??3306}`,`--mycnf-mysql-port ${e.mysqlPort??3306}`])})}function He(e){return A({description:"Vitess mysqlctld (managed mysqld)",execStart:O("mysqlctld",[`${_}/mysqlctld`,`--tablet-uid ${X}`,`--mysql-port ${e.mysqlPort??3306}`,'--init-db-sql-file "$VTROOT/config/init_db.sql"',"--wait-time 2m"]),execStartPre:[`+/bin/mkdir -p ${v}`,`+/bin/chown ${m}:${m} ${v}`]})}var $e="/etc/vitess/auth.json",I="/var/lib/vitess/vtgate-auth.sha256";function Ge(e){let t=e.username??"vitess",r=e.password??"";return["mkdir -p /etc/vitess",'VTESS_AUTH_TMP="$(mktemp)"',`cat > "$VTESS_AUTH_TMP" <<'TS_CLOUD_VITESS_AUTH_EOF'`,JSON.stringify({[t]:[{Password:r,UserData:t}]}),"TS_CLOUD_VITESS_AUTH_EOF",`VTESS_VTGATE_AUTH_SHA="$(sha256sum "$VTESS_AUTH_TMP" | awk '{print $1}')"`,"VTESS_VTGATE_AUTH_CHANGED=1",`if [ -f ${I} ] && [ "$(cat ${I})" = "$VTESS_VTGATE_AUTH_SHA" ]; then VTESS_VTGATE_AUTH_CHANGED=0; fi`,`install -o ${m} -g ${m} -m 0600 "$VTESS_AUTH_TMP" ${$e}`,'rm -f "$VTESS_AUTH_TMP"']}function Fe(e){let t=e.cell??"zone1";return A({description:"Vitess vtgate (query router)",after:["vitess-vtctld.service"],execStart:O("vtgate",[`${_}/vtgate`,...J(e),`--cell ${t}`,`--cells-to-watch ${t}`,"--tablet-types-to-wait PRIMARY,REPLICA",`--service-map ${f("grpc-vtgateservice")}`,`--mysql-server-port ${e.vtgatePort??z}`,`--mysql-server-bind-address ${e.bindAddress??"127.0.0.1"}`,"--mysql-auth-server-impl static",`--mysql-auth-server-static-file ${$e}`,`--port ${j}`,`--grpc-port ${j+1}`])})}function Ye(e){let t=e.cell??"zone1",r=e.etcdEndpoint??`http://127.0.0.1:${q}`,n=`${_}/vtctldclient --server 127.0.0.1:${w}`,i=[`for i in $(seq 1 30); do ${n} GetCellInfoNames >/dev/null 2>&1 && break; sleep 2; done`,`if ! ${n} GetCellInfoNames 2>/dev/null | grep -qx ${f(t)}; then`,` ${n} AddCellInfo --root ${f(`/vitess/${t}`)} --server-address ${f(r)} ${f(t)}`,"fi"];for(let s of e.keyspaces??[]){let c=s.sharded?" --sharded":"";i.push(`if ! ${n} GetKeyspace ${f(s.name)} >/dev/null 2>&1; then`,` ${n} CreateKeyspace${c} ${f(s.name)}`,"fi");let d=`${t}-${String(X).padStart(10,"0")}`;for(let l of s.sharded?["-80","80-"]:["0"]){let o=`${s.name}/${l}`;i.push("for i in $(seq 1 90); do",` if ${n} GetShard ${f(o)} 2>/dev/null | grep -q '"is_primary_serving": *true'; then break; fi`,` ${n} PlannedReparentShard ${f(o)} --new-primary ${f(d)} >/dev/null 2>&1 && break`,` ${n} InitShardPrimary --force ${f(o)} ${f(d)} >/dev/null 2>&1 && break`," sleep 2","done",`if ! ${n} GetShard ${f(o)} 2>/dev/null | grep -q '"is_primary_serving": *true'; then`,` echo "no primary could be elected for ${o}" >&2; exit 1`,"fi")}i.push(`${n} RebuildKeyspaceGraph ${f(s.name)} >/dev/null`)}return i}function ue(e){let t=e.vtgatePort??z;return["for i in $(seq 1 60); do",` if (cd ${R} && eval "$(pantry env 2>/dev/null)"; MYSQL_PWD=${f(e.password??"")} ${_}/mysql -h 127.0.0.1 -P ${t} -u ${f(e.username??"vitess")} --connect-timeout=2 -e 'SHOW KEYSPACES') >/dev/null 2>&1; then`,` echo "vtgate is serving on ${t}"; exit 0`," fi"," sleep 2","done",`echo "vtgate did not become ready on port ${t}" >&2`,"exit 1"]}function fe(e){if(!Ie(e))return[];let t=xe(e),r=t.mode==="combo";Q.clear();let n=[...D(ke(t)),`VT_MYSQL_LIB="$(dirname "$(dirname "$(readlink -f ${_}/mysqld)")")/lib"`,'if [ -d "$VT_MYSQL_LIB" ]; then',` printf '%s\\n' "$VT_MYSQL_LIB" > /etc/ld.so.conf.d/vitess-mysql.conf`," ldconfig","else",' echo "mysqld library directory not found under $VT_MYSQL_LIB" >&2; exit 1',"fi",`id -u ${m} >/dev/null 2>&1 || useradd --system --home-dir ${v} --shell /usr/sbin/nologin ${m}`,`mkdir -p ${v}`,`chown -R ${m}:${m} ${v}`];if(r)return n.push(...pe("vitess-vtcombo",Ve(t)),...le(),"systemctl daemon-reload","systemctl enable --now vitess-vtcombo.service",...ue(t)),n;n.push(...Ge(t));let i=[];if(!t.etcdEndpoint)i.push(["vitess-etcd",we()]);i.push(["vitess-vtctld",qe(t)],["vitess-mysqlctld",He(t)],["vitess-vtgate",Fe(t)]);for(let s of t.keyspaces??[])for(let c of s.sharded?["-80","80-"]:["0"])i.push([`vitess-vttablet-${s.name}-${c.replace(/-/g,"x")}`,Be(t,s.name,c)]);for(let[s,c]of i)n.push(...pe(s,c));n.push(...le()),n.push("systemctl daemon-reload");for(let[s]of i)n.push(`systemctl enable --now ${s}.service`);return n.push(`if [ "$VTESS_VTGATE_AUTH_CHANGED" = 1 ]; then systemctl restart vitess-vtgate.service; printf '%s\\n' "$VTESS_VTGATE_AUTH_SHA" > ${I}; chown ${m}:${m} ${I}; chmod 0600 ${I}; fi`,...Ye(t),...ue(t)),n}var Ke=new Set(["singlestore","vitess"]);function me(e){if(e?.engine&&Ke.has(e.engine))return!1;return!e?.host||e.host==="127.0.0.1"||e.host==="localhost"}function Z(e,t="psql"){let r=e?.port??5432;if(me(e))return`${t} -p ${r} -U postgres`;let n=e?.username||"postgres";return`${e?.password?`PGPASSWORD='${e.password.replace(/'/g,"'\\''")}' `:""}${t} -h ${e.host} -p ${r} -U ${n} -w`}function y(e){return e===!0||typeof e==="object"&&e!=null}function je(e){let t=[],r=[];if(y(e.mysql))t.push(typeof e.mysql==="object"&&e.mysql.version?`mysql.com@${e.mysql.version}`:"mysql.com@8.0.43"),r.push("mysql");else if(y(e.mariadb))t.push(U.mariadb),r.push("mariadb");if(y(e.postgres))t.push("postgresql.org"),r.push("postgres");if(y(e.redis))t.push("redis.io"),r.push("redis");if(y(e.memcached))t.push("memcached.org"),r.push("memcached");if(y(e.meilisearch))t.push("meilisearch.com"),r.push("meilisearch");return{packages:t,services:r}}function vt(e={},t={}){let r=je(e),n=fe(e.vitess),i=t.mail?ae(t.mail):[];if(r.packages.length===0)return[...n,...i];return[...D(r.packages),...ie(r.services),...n,...i]}function yt(e,t={}){if(!e?.name)return[];if(!me(e))return[];let r=e.name,n=e.username||r,i=e.password||"",s=y(t.postgres)||e.engine==="postgres",c=y(t.mariadb)||e.engine==="mariadb",d=y(t.mysql)||e.engine==="mysql";if(s&&!d&&!c){let a=(u)=>`"${u.replace(/"/g,'""')}"`,C=(u)=>`'${u.replace(/'/g,"''")}'`,L=(u,N)=>["DO $$ BEGIN",` IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = ${C(u)}) THEN`,` CREATE ROLE ${a(u)} LOGIN PASSWORD ${C(N)};`," ELSE",` ALTER ROLE ${a(u)} LOGIN PASSWORD ${C(N)};`," END IF;","END $$;"],x=(u)=>{let N=u.databases&&u.databases.length>0?u.databases:[r],B=[];for(let H of N)if(u.access==="readonly")B.push(`GRANT CONNECT ON DATABASE ${a(H)} TO ${a(u.username)};`,`\\connect ${a(H)}`,`GRANT USAGE ON SCHEMA public TO ${a(u.username)};`,`GRANT SELECT ON ALL TABLES IN SCHEMA public TO ${a(u.username)};`,`ALTER DEFAULT PRIVILEGES FOR ROLE ${a(n)} IN SCHEMA public GRANT SELECT ON TABLES TO ${a(u.username)};`,"\\connect postgres");else B.push(`GRANT ALL PRIVILEGES ON DATABASE ${a(H)} TO ${a(u.username)};`);return B},k=e.users||[],ye=e.port??5432;return[G(),`for i in $(seq 1 30); do pg_isready -p ${ye} -q && break; sleep 2; done`,`${Z(e)} <<'TS_CLOUD_PG_EOF'`,...L(n,i),`SELECT 'CREATE DATABASE ${a(r)} OWNER ${a(n)}' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = ${C(r)})\\gexec`,...k.flatMap((u)=>[...L(u.username,u.password),...x(u)]),"TS_CLOUD_PG_EOF"]}let l=c?"/var/lib/pantry/mariadb/mariadbd.sock":"/var/lib/pantry/mysql/mysqld.sock",o=(a)=>a.replace(/`/g,"``"),S=(a)=>a.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),E=(a)=>{let C=a.databases&&a.databases.length>0?a.databases:[r],L=a.access==="readonly"?"SELECT":"ALL PRIVILEGES",x=[`CREATE USER IF NOT EXISTS '${S(a.username)}'@'%' IDENTIFIED BY '${S(a.password)}';`,`CREATE USER IF NOT EXISTS '${S(a.username)}'@'localhost' IDENTIFIED BY '${S(a.password)}';`,`ALTER USER '${S(a.username)}'@'%' IDENTIFIED BY '${S(a.password)}';`,`ALTER USER '${S(a.username)}'@'localhost' IDENTIFIED BY '${S(a.password)}';`];for(let k of C)x.push(`GRANT ${L} ON \`${o(k)}\`.* TO '${S(a.username)}'@'%';`,`GRANT ${L} ON \`${o(k)}\`.* TO '${S(a.username)}'@'localhost';`);return x},p=e.users||[];return[G(),`for i in $(seq 1 30); do mysqladmin --socket=${l} -u root ping 2>/dev/null | grep -q alive && break; sleep 2; done`,`mysql --socket=${l} -u root <<'TS_CLOUD_SQL_EOF'`,`CREATE DATABASE IF NOT EXISTS \`${o(r)}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;`,...E({username:n,password:i}),...p.flatMap(E),"FLUSH PRIVILEGES;","TS_CLOUD_SQL_EOF"]}function Et(e){if(!e?.name)return{};let t=e.engine==="singlestore",r=e.engine==="vitess",n=e.engine==="postgres"?"pgsql":t?"singlestore":r?"vitess":"mysql",i=e.port??(e.engine==="postgres"?5432:r?15306:3306),s={DB_CONNECTION:n,DB_HOST:e.host||"127.0.0.1",DB_PORT:String(i),DB_DATABASE:e.name};if(e.username)s.DB_USERNAME=e.username;if(e.password)s.DB_PASSWORD=e.password;if((t||r)&&e.ssl!==!1)s.DB_SSL="true";return s}var te="/var/backups/ts-cloud",We="/etc/ts-cloud/backups.config.ts",Se="/etc/cron.d/ts-cloud-backups",ee="/usr/local/bin/ts-cloud-backup.sh";function ze(e){if(!e.name)return null;let t=e.host||"127.0.0.1",r=e.engine==="postgres",n=r?"postgresql":"mysql",i=e.port??(r?5432:3306),s=(c)=>c.replace(/\\/g,"\\\\").replace(/'/g,"\\'");return[" {",` type: '${n}',`,` name: '${s(e.name)}',`," connection: {",` hostname: '${s(t)}',`,` port: ${i},`,` database: '${s(e.name)}',`,` username: '${s(e.username||e.name)}',`,` password: '${s(e.password||"")}',`," ssl: false,"," },"," includeSchema: true,"," includeData: true,"," },"].join(`
|
|
7
7
|
`)}function Xe(e,t){let r=e?ze(e):null,n=t.bucket?[" destinations: ["," {"," type: 's3',",` bucket: '${t.bucket}',`," prefix: 'db-backups',",...t.endpoint?[` endpoint: '${t.endpoint}',`]:[]," optional: false,"," },"," ],"]:[];return["import type { BackupConfig } from 'ts-backups'","","const config: BackupConfig = {"," verbose: true,",` outputPath: '${te}',`," retention: {",` count: ${t.retentionCount??5},`,` maxAge: ${t.retentionDays??30},`," },"," databases: [",...r?[r]:[]," ],",...n,"}","","export default config",""].join(`
|
|
8
8
|
`)}function Ct(e){let{database:t,backups:r}=e;if(!r.enabled)return[];let n=r.schedule||"0 2 * * *",i=Xe(t,r);return["export DEBIAN_FRONTEND=noninteractive",`mkdir -p /etc/ts-cloud ${te}`,"command -v bun >/dev/null 2>&1 || (curl -fsSL https://bun.sh/install | bash && ln -sf /root/.bun/bin/bun /usr/local/bin/bun)","bun add -g ts-backups || true",`cat > ${We} <<'TS_CLOUD_BACKUP_CFG_EOF'`,i.replace(/\n$/,""),"TS_CLOUD_BACKUP_CFG_EOF",`cat > ${ee} <<'TS_CLOUD_BACKUP_RUN_EOF'`,"#!/bin/bash","set -uo pipefail",'export PATH="/root/.bun/bin:/usr/local/bin:$PATH"','notify() { [ -x /usr/local/bin/ts-cloud-notify ] && /usr/local/bin/ts-cloud-notify "$1" || true; }',"cd /etc/ts-cloud",'if ! ts-backups backup --config /etc/ts-cloud/backups.config.ts; then notify "❌ ts-cloud backup failed"; exit 1; fi',"TS_CLOUD_BACKUP_RUN_EOF",`chmod +x ${ee}`,`cat > ${Se} <<'TS_CLOUD_BACKUP_CRON_EOF'`,`${n} root ${ee} >> /var/log/ts-cloud-backup.log 2>&1`,"TS_CLOUD_BACKUP_CRON_EOF",`chmod 644 ${Se}`]}function Qe(e){return e==="mariadb"?"/var/lib/pantry/mariadb/mariadbd.sock":"/var/lib/pantry/mysql/mysqld.sock"}function Rt(e,t={}){if(!e?.name)return[];let r=e.name,n=e.engine==="postgres",i=t.from?`TS_CLOUD_DUMP="${t.from}"`:`TS_CLOUD_DUMP="$(find ${te} -type f -name '*${r}*.sql' -o -type f -name '*${r}*.sql.gz' 2>/dev/null | xargs -r ls -1t 2>/dev/null | head -1)"`,s=n?`${Z(e)} -d "${r}"`:`mysql --socket=${Qe(e.engine)} -u root "${r}"`;return["set -uo pipefail",'eval "$(cd /opt/pantry && pantry env 2>/dev/null)" || true',i,'[ -n "$TS_CLOUD_DUMP" ] && [ -f "$TS_CLOUD_DUMP" ] || { echo "no backup dump found to restore" >&2; exit 1; }','echo "[ts-cloud] restoring '+r+' from $TS_CLOUD_DUMP"',`case "$TS_CLOUD_DUMP" in *.gz) gunzip -c "$TS_CLOUD_DUMP" ;; *) cat "$TS_CLOUD_DUMP" ;; esac | ${s}`,'echo "restore complete"']}var ge=["storage",".env"],Ot=4;function b(e){return`${e.replace(/\/+$/,"")}/.ts-cloud`}function Je(e){return`${b(e)}/deploy-history.log`}function Ze(e,t){return`${b(e)}/deploys/${t}.log`}function Te(e){return`${b(e)}/shared-paths`}function At(e,t){let r=e.replace(/\/+$/,"");return{base:r,releases:`${r}/releases`,shared:`${r}/shared`,current:`${r}/current`,release:`${r}/releases/${t}`}}function he(e){let t=e.split("/").pop()||e;if(t===".env"||t.startsWith(".env."))return!0;return/\.[a-z0-9]+$/i.test(t)}function et(e){return typeof e==="string"?e:e.path}function Lt(e){let t=new Map;for(let r of e)t.set(et(r),r);return[...t.values()]}function ve(e,t){if(typeof t==="string")return{path:t,target:`${e.shared}/${t}`,seed:!0};return{path:t.path,target:t.target??`${e.shared}/${t.path}`,seed:t.seed!==!1}}function tt(e){return["ts_cloud_adopt_shared() {",' TS_CLOUD_SP="$1"',' TS_CLOUD_DST="$2"',` TS_CLOUD_SRC="${e.current}/$TS_CLOUD_SP"`,' if [ -e "$TS_CLOUD_DST" ]; then return 0; fi',' if [ -L "$TS_CLOUD_SRC" ] || [ ! -e "$TS_CLOUD_SRC" ]; then return 0; fi',' mkdir -p "$(dirname "$TS_CLOUD_DST")"',' cp -a "$TS_CLOUD_SRC" "$TS_CLOUD_DST"'," for TS_CLOUD_SIDECAR in -wal -shm; do",' if [ -f "$TS_CLOUD_SRC$TS_CLOUD_SIDECAR" ]; then cp -a "$TS_CLOUD_SRC$TS_CLOUD_SIDECAR" "$TS_CLOUD_DST$TS_CLOUD_SIDECAR"; fi'," done",' echo "[ts-cloud] adopted $TS_CLOUD_SP from the live release into shared/ — it now survives deploys"'," return 0","}"]}function Ut(e,t=ge){let r=[`mkdir -p ${e.releases} ${e.shared}`,...tt(e)],n=t.map((s)=>ve(e,s));for(let{path:s,target:c,seed:d}of n){if(!d)continue;if(r.push(`ts_cloud_adopt_shared '${s}' '${c}'`),he(s))r.push(`mkdir -p "$(dirname ${c})"`,`touch ${c}`);else if(s==="storage")r.push(`mkdir -p ${c}/app/public`,`mkdir -p ${c}/framework/cache/data`,`mkdir -p ${c}/framework/sessions`,`mkdir -p ${c}/framework/testing`,`mkdir -p ${c}/framework/views`,`mkdir -p ${c}/logs`);else r.push(`mkdir -p ${c}`)}let i=Te(e.base);return r.push(`mkdir -p ${b(e.base)}`,`cat > ${i} <<'TS_CLOUD_SHARED_PATHS_EOF'`,...n.map((s)=>`${s.path} ${s.target}`),"TS_CLOUD_SHARED_PATHS_EOF"),r}function It(e,t=900){let r=`${b(e.base)}/deploy.lock`;return[`mkdir -p "$(dirname ${r})"`,`exec 9>${r}`,`flock -w ${t} 9 || { echo "[ts-cloud] another deploy of this site has held the lock for ${t}s — refusing to race it" >&2; exit 1; }`]}function xt(e){let t=`${e.release}.incoming`;return[`rm -rf ${t}`,`mkdir -p ${t}`,...rt(e),'if [ "$TS_CLOUD_IS_LIVE" = "yes" ]; then',` TS_CLOUD_STAGED=${t}`,"else",` rm -rf ${e.release}`,` mkdir -p ${e.release}`,` rmdir ${t}`,` TS_CLOUD_STAGED=${e.release}`,"fi"]}function kt(e){let t=`TS_CLOUD_TRAP_LIVE="$(readlink -f ${e.current} 2>/dev/null || true)"`,r=`TS_CLOUD_TRAP_TARGET="$(readlink -f ${e.release} 2>/dev/null || echo ${e.release})"`;return`trap '${`if [ $? -ne 0 ]; then ${t}; ${r}; [ "$TS_CLOUD_TRAP_LIVE" = "$TS_CLOUD_TRAP_TARGET" ] || rm -rf ${e.release}; fi`}' EXIT`}function rt(e){return[`TS_CLOUD_LIVE_PATH="$(readlink -f ${e.current} 2>/dev/null || true)"`,`TS_CLOUD_RELEASE_PATH="$(readlink -f ${e.release} 2>/dev/null || echo ${e.release})"`,'if [ -n "$TS_CLOUD_LIVE_PATH" ] && [ "$TS_CLOUD_LIVE_PATH" = "$TS_CLOUD_RELEASE_PATH" ]; then TS_CLOUD_IS_LIVE=yes; else TS_CLOUD_IS_LIVE=no; fi']}function Nt(e){let t=`${e.release}.incoming`;return[`if [ "$TS_CLOUD_STAGED" = "${t}" ]; then`,` rm -rf ${e.release}.previous`,` mv ${e.release} ${e.release}.previous`,` mv ${t} ${e.release}`,` rm -rf ${e.release}.previous`,"fi"]}function nt(e,t){return[`if [ -f ${e} ] && [ ! -L ${e} ] && [ -s ${e} ] && [ ! -s ${t} ]; then`,` cp -a ${e} ${t}`,` echo "[ts-cloud] seeded shared/ from the release's own copy of the file"`,"fi"]}function Mt(e,t=ge){let r=[];for(let n of t){let{path:i,target:s,seed:c}=ve(e,n),d=`${e.release}/${i}`,l=[`rm -rf ${d}`,`mkdir -p "$(dirname ${d})"`,`ln -sfn ${s} ${d}`];if(c){if(i!==".env"&&he(i))r.push(...nt(d,s));r.push(...l);continue}r.push(`if [ -e ${s} ]; then`,...l.map((o)=>` ${o}`),"fi")}return r}function _e(e,t){let r=Te(e.base);return[`if [ -f ${r} ]; then`,' while IFS="\t" read -r TS_CLOUD_SP TS_CLOUD_TGT; do',' [ -n "$TS_CLOUD_SP" ] || continue',` [ -n "$TS_CLOUD_TGT" ] || TS_CLOUD_TGT="${e.shared}/$TS_CLOUD_SP"`,' [ -e "$TS_CLOUD_TGT" ] || continue',` rm -rf ${t}/"$TS_CLOUD_SP"`,` mkdir -p "$(dirname ${t}/"$TS_CLOUD_SP")"`,` ln -sfn "$TS_CLOUD_TGT" ${t}/"$TS_CLOUD_SP"`,` done < ${r}`,"fi"]}function Vt(e){return[`ln -sfn ${e.release} ${e.current}.tmp`,`mv -Tf ${e.current}.tmp ${e.current}`]}function wt(e,t={}){let r=t.to?[`[ -d ${e.releases}/${t.to} ] || { echo "rollback target ${e.releases}/${t.to} not found" >&2; exit 1; }`,..._e(e,`${e.releases}/${t.to}`),`ln -sfn ${e.releases}/${t.to} ${e.current}.tmp`,`mv -Tf ${e.current}.tmp ${e.current}`]:[`TS_CLOUD_CURRENT=$(readlink -f ${e.current} 2>/dev/null || true)`,`TS_CLOUD_PREV=$(ls -1dt ${e.releases}/*/ 2>/dev/null | sed 's#/$##' | while read -r r; do [ "$(readlink -f "$r")" != "$TS_CLOUD_CURRENT" ] && { echo "$r"; break; }; done)`,'[ -n "$TS_CLOUD_PREV" ] || { echo "no previous release to roll back to" >&2; exit 1; }',..._e(e,'"$TS_CLOUD_PREV"'),`ln -sfn "$TS_CLOUD_PREV" ${e.current}.tmp`,`mv -Tf ${e.current}.tmp ${e.current}`,'echo "rolled back to $TS_CLOUD_PREV"'];if(!t.unitBase)return r;let n=t.unitBase;return[...r,`TS_CLOUD_RB_ID=$(basename "$(readlink -f ${e.current})")`,`if [ -f /etc/systemd/system/${n}@.service ]; then systemctl start "${n}@\${TS_CLOUD_RB_ID}.service"; sleep 2; systemctl is-active --quiet "${n}@\${TS_CLOUD_RB_ID}.service" || { echo "rolled-back release failed to start" >&2; exit 1; }; systemctl enable "${n}@\${TS_CLOUD_RB_ID}.service" 2>/dev/null || true; systemctl list-units --plain --no-legend --type=service "${n}@*.service" 2>/dev/null | awk '{print $1}' | { grep -v "^${n}@\${TS_CLOUD_RB_ID}.service$" || true; } | while read -r TS_CLOUD_U; do systemctl stop "$TS_CLOUD_U" 2>/dev/null || true; systemctl disable "$TS_CLOUD_U" 2>/dev/null || true; done; elif [ -f /etc/systemd/system/${n}.service ]; then systemctl restart ${n}.service; fi`]}function qt(e,t=4){let r=Math.max(1,t);return[`TS_CLOUD_CURRENT=$(readlink -f ${e.current} 2>/dev/null || true)`,`ls -1dt ${e.releases}/*/ 2>/dev/null | sed 's#/$##' | tail -n +${r+1} | while read -r TS_CLOUD_OLD; do`,' [ "$(readlink -f "$TS_CLOUD_OLD")" = "$TS_CLOUD_CURRENT" ] || rm -rf "$TS_CLOUD_OLD"',"done"]}function st(e){return`${b(e)}/owner`}function Bt(e,t){let r=st(e);return[`if [ -f "${r}" ]; then`,` TS_CLOUD_OWNER=$(cat "${r}")`,` if [ "$TS_CLOUD_OWNER" != "${t}" ]; then`,` echo "[ts-cloud] REFUSING deploy: ${e} belongs to project '$TS_CLOUD_OWNER', not '${t}'. Another project on this box derives the same site key — give one of them a distinct site name/domain, or remove ${r} to transfer ownership." >&2`," exit 1"," fi","else",` mkdir -p "$(dirname "${r}")"`,` printf '%s\\n' "${t}" > "${r}"`,"fi"]}function Ht(e,t){let r=b(e),n=Ze(e,t.releaseId),i=Je(e),s=Math.max(1,t.keepLogs??20),c=t.commit||"",d=t.branch||"";return[`mkdir -p ${r}/deploys`,`exec > >(tee -a ${n}) 2>&1`,`echo "[ts-cloud] deploy ${t.releaseId} commit=${c} branch=${d} starting $(date -u +%Y-%m-%dT%H:%M:%SZ)"`,"ts_cloud_record_deploy() {"," TS_CLOUD_RC=$?",' if [ "$TS_CLOUD_RC" -eq 0 ]; then TS_CLOUD_ST=success; else TS_CLOUD_ST=failed; fi',` printf '%s\\t%s\\t%s\\t%s\\trc=%s\\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "${t.releaseId}" "${c}" "$TS_CLOUD_ST" "$TS_CLOUD_RC" >> ${i}`,"}","trap ts_cloud_record_deploy EXIT",`ls -1t ${r}/deploys/*.log 2>/dev/null | tail -n +${s+1} | while read -r TS_CLOUD_OLDLOG; do rm -f "$TS_CLOUD_OLDLOG"; done`]}
|
|
9
|
-
export{it as
|
|
9
|
+
export{it as vf,se as wf,Pe as xf,M as yf,Ce as zf,at as Af,ct as Bf,lt as Cf,pt as Df,R as Ef,dt as Ff,G as Gf,D as Hf,ie as If,fe as Jf,me as Kf,Z as Lf,vt as Mf,yt as Nf,Et as Of,ee as Pf,Ct as Qf,Rt as Rf,ge as Sf,Ot as Tf,Je as Uf,At as Vf,et as Wf,Lt as Xf,Ut as Yf,It as Zf,xt as _f,kt as $f,Nt as ag,Mt as bg,Vt as cg,wt as dg,qt as eg,Bt as fg,Ht as gg};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mg as a,ng as b}from"./chunk-my3ewh3a.js";import"./chunk-e5ab5twy.js";import"./chunk-btsyjhk7.js";import"./chunk-ja1vjdn1.js";import"./chunk-ehc63fvs.js";export{a as EmailClient,b as email};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{wd as a}from"./chunk-82mj52xr.js";import"./chunk-ja1vjdn1.js";import"./chunk-ehc63fvs.js";export{a as CloudFrontClient};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{np as v,op as l}from"./chunk-ehc63fvs.js";var F={};v(F,{ProgressBar:()=>y,Spinner:()=>x,box:()=>R,checkAwsCli:()=>T,checkAwsCredentials:()=>L,colorize:()=>a,colors:()=>r,confirm:()=>A,error:()=>f,formatBytes:()=>P,formatDuration:()=>M,getAwsAccountId:()=>E,getAwsRegions:()=>k,header:()=>I,info:()=>b,prompt:()=>h,select:()=>C,step:()=>B,success:()=>m,table:()=>S,warn:()=>d,warning:()=>w});var r={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m"};function a(t,e){return`${r[e]}${t}${r.reset}`}function m(t){console.log(`${r.green}✓${r.reset} ${t}`)}function f(t){console.error(`${r.red}✗${r.reset} ${t}`)}function d(t){console.warn(`${r.yellow}⚠${r.reset} ${t}`)}var w=d;function b(t){console.log(`${r.blue}ℹ${r.reset} ${t}`)}function B(t){console.log(`${r.cyan}→${r.reset} ${t}`)}function I(t){console.log(`
|
|
2
2
|
${r.bright}${r.cyan}${t}${r.reset}
|
|
3
3
|
`)}var g=!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.BUILDKITE||process.env.CIRCLECI||process.env.GITLAB_CI);class x{frames=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];interval=null;currentFrame=0;message;constructor(t){this.message=t}get text(){return this.message}set text(t){if(this.message=t,g&&this.interval)console.log(` ${t}`)}start(){if(g){console.log(` ${this.message}`),this.interval=!0;return}this.interval=setInterval(()=>{process.stdout.write(`\r${r.cyan}${this.frames[this.currentFrame]}${r.reset} ${this.message}`),this.currentFrame=(this.currentFrame+1)%this.frames.length},80)}succeed(t){this.stop(),m(t||this.message)}fail(t){this.stop(),f(t||this.message)}warn(t){this.stop(),w(t||this.message)}stop(){if(this.interval){if(!g)process.stdout.write("\r");if(typeof this.interval==="object")clearInterval(this.interval);this.interval=null}}}class y{total;current=0;width=40;constructor(t){this.total=t}update(t){this.current=t,this.render()}increment(){this.current++,this.render()}render(){let t=Math.floor(this.current/this.total*100),e=Math.floor(this.current/this.total*this.width),n=this.width-e,s=`${"█".repeat(e)}${"░".repeat(n)}`;if(process.stdout.write(`\r${r.cyan}${s}${r.reset} ${t}% (${this.current}/${this.total})`),this.current>=this.total)process.stdout.write(`
|
|
4
4
|
`)}}async function h(t,e){let s=(await import("node:readline")).createInterface({input:process.stdin,output:process.stdout});return new Promise((i)=>{let o=e?`${r.cyan}?${r.reset} ${t} ${r.gray}(${e})${r.reset}: `:`${r.cyan}?${r.reset} ${t}: `;s.question(o,(c)=>{s.close(),i(c||e||"")})})}async function A(t,e=!1){let n=await h(`${t} (y/n)`,e?"y":"n");return n.toLowerCase()==="y"||n.toLowerCase()==="yes"}async function C(t,e){console.log(`${r.cyan}?${r.reset} ${t}`),e.forEach((i,o)=>{console.log(` ${r.gray}${o+1}.${r.reset} ${i}`)});let n=await h("Select","1"),s=Number.parseInt(n)-1;if(s>=0&&s<e.length)return e[s];return e[0]}function S(t,e){let n=t.map((i,o)=>{let c=Math.max(...e.map((u)=>(u[o]||"").length));return Math.max(i.length,c)}),s=t.map((i,o)=>i.padEnd(n[o])).join(" ");console.log(a(s,"bright")),console.log(a("─".repeat(s.length),"gray")),e.forEach((i)=>{let o=i.map((c,u)=>(c||"").padEnd(n[u])).join(" ");console.log(o)})}function P(t){if(t===0)return"0 B";let e=1024,n=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(t)/Math.log(e));return`${Number.parseFloat((t/e**s).toFixed(2))} ${n[s]}`}function M(t){if(t<1000)return`${t}ms`;let e=Math.floor(t/1000);if(e<60)return`${e}s`;let n=Math.floor(e/60),s=e%60;if(n<60)return`${n}m ${s}s`;let i=Math.floor(n/60),o=n%60;return`${i}h ${o}m`}function R(t,e="cyan"){let n=t.split(`
|
|
5
|
-
`),s=Math.max(...n.map((o)=>o.length)),i="─".repeat(s+2);console.log(a(`┌${i}┐`,e)),n.forEach((o)=>{console.log(a(`│ ${o.padEnd(s)} │`,e))}),console.log(a(`└${i}┘`,e))}async function T(){return!0}async function L(){try{let{AWSClient:t}=await import("./chunk-
|
|
6
|
-
export{r as
|
|
5
|
+
`),s=Math.max(...n.map((o)=>o.length)),i="─".repeat(s+2);console.log(a(`┌${i}┐`,e)),n.forEach((o)=>{console.log(a(`│ ${o.padEnd(s)} │`,e))}),console.log(a(`└${i}┘`,e))}async function T(){return!0}async function L(){try{let{AWSClient:t}=await import("./chunk-edvvx3hg.js");return await new t().request({service:"sts",region:"us-east-1",method:"POST",path:"/",body:new URLSearchParams({Action:"GetCallerIdentity",Version:"2011-06-15"}).toString()}),!0}catch{return!1}}async function E(){try{let{AWSClient:t}=await import("./chunk-edvvx3hg.js"),n=await new t().request({service:"sts",region:"us-east-1",method:"POST",path:"/",body:new URLSearchParams({Action:"GetCallerIdentity",Version:"2011-06-15"}).toString()});return n.Account||n.GetCallerIdentityResult?.Account||null}catch{return null}}async function k(){try{let{AWSClient:t}=await import("./chunk-edvvx3hg.js"),n=await new t().request({service:"ec2",region:"us-east-1",method:"POST",path:"/",body:new URLSearchParams({Action:"DescribeRegions",Version:"2016-11-15"}).toString()}),s=[];if(n.regionInfo){let i=Array.isArray(n.regionInfo)?n.regionInfo:[n.regionInfo];s.push(...i.map((o)=>o.regionName))}return s.length>0?s:p()}catch{return p()}}function p(){return["us-east-1","us-east-2","us-west-1","us-west-2","eu-west-1","eu-central-1","ap-southeast-1","ap-northeast-1"]}
|
|
6
|
+
export{r as Jg,a as Kg,m as Lg,f as Mg,d as Ng,w as Og,b as Pg,B as Qg,I as Rg,x as Sg,h as Tg,A as Ug,C as Vg,S as Wg,P as Xg,R as Yg,T as Zg,L as _g,E as $g,k as ah,F as bh};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Hd as a}from"./chunk-d7ke90zt.js";import"./chunk-ja1vjdn1.js";import"./chunk-ehc63fvs.js";export{a as SQSClient};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ef as l,Rf as g,Uf as f,Vf as d,dg as C,vf as m}from"./chunk-56wvjysz.js";function R(e){return`'${e.split("'").join("'\\''")}'`}function p(e){let r=e.user||"root",s=e.script.join(`
|
|
2
2
|
`),t=r==="root"?'bash -l "$TS_CLOUD_RECIPE"':`runuser -l ${R(r)} -c "bash $TS_CLOUD_RECIPE"`;return["set -uo pipefail",`echo "__TS_CLOUD_RECIPE_BEGIN__ ${e.name} (user=${r})"`,"TS_CLOUD_RECIPE=$(mktemp)",`cat > "$TS_CLOUD_RECIPE" <<'TS_CLOUD_RECIPE_EOF'`,s,"TS_CLOUD_RECIPE_EOF",'chmod +r "$TS_CLOUD_RECIPE"',t,"TS_CLOUD_RC=$?",'rm -f "$TS_CLOUD_RECIPE"',`echo "__TS_CLOUD_RECIPE_END__ ${e.name} exit=$TS_CLOUD_RC"`,"exit $TS_CLOUD_RC"]}var c={info:()=>{},warn:()=>{},error:()=>{},step:()=>{},success:()=>{}};async function i(e){return await e.driver.findComputeTargets({slug:e.slug,environment:e.environment,role:e.role||"app"})}async function y(e,r){let s=e.logger||c,t=await i(e);if(t.length===0)return{success:!1,error:`No '${e.role||"app"}' servers found for ${e.slug}/${e.environment}.`};let n=m(e.slug,r.siteName),u=d(n,r.to||"unused"),o=["set -uo pipefail",...C(u,{...r.to?{to:r.to}:{},unitBase:`${e.slug}-${r.siteName}`}),`(cd ${l} && pantry restart php-fpm) 2>/dev/null || true`,`(cd ${u.current} && eval "$(cd ${l} && pantry env 2>/dev/null)" && php artisan queue:restart) 2>/dev/null || true`];s.step(`Rolling back ${r.siteName}${r.to?` to ${r.to}`:" to the previous release"} on ${t.length} server(s)...`);let a=await e.driver.runRemoteDeploy({targets:t,commands:o,comment:`ts-cloud rollback ${e.slug}/${r.siteName}`,tags:{Project:e.slug,Environment:e.environment,Role:e.role||"app"}});if(!a.success)s.error(`Rollback failed: ${a.error||"unknown error"}`);else s.success(`Rolled back ${r.siteName}.`);return{success:a.success,error:a.error,perInstance:a.perInstance}}async function h(e,r){let s=await i(e);if(s.length===0)return{success:!1,error:`No '${e.role||"app"}' servers found for ${e.slug}/${e.environment}.`};let t=f(m(e.slug,r.siteName)),n=Math.max(1,r.limit??20),u=[`[ -f ${t} ] && tail -n ${n} ${t} || echo "no deploy history for ${r.siteName}"`],o=await e.driver.runRemoteDeploy({targets:s,commands:u,comment:`ts-cloud deploy:history ${e.slug}/${r.siteName}`,tags:{Project:e.slug,Environment:e.environment,Role:e.role||"app"}});return{success:o.success,error:o.error,perInstance:o.perInstance}}async function I(e,r){let s=e.logger||c,t=await i(e);if(t.length===0)return{success:!1,error:`No '${e.role||"app"}' servers found for ${e.slug}/${e.environment}.`};s.step(`Running recipe '${r.name}' as ${r.user||"root"} on ${t.length} server(s)...`);let n=await e.driver.runRemoteDeploy({targets:t,commands:p({name:r.name,script:r.script,user:r.user}),comment:`ts-cloud recipe ${r.name}`,tags:{Project:e.slug,Environment:e.environment,Role:e.role||"app"}});if(!n.success)s.error(`Recipe '${r.name}' failed: ${n.error||"unknown error"}`);else s.success(`Recipe '${r.name}' completed.`);return{success:n.success,error:n.error,perInstance:n.perInstance}}async function P(e,r){let s=e.logger||c;if(!r.database?.name)return{success:!1,error:"No appDatabase configured to restore."};let t=await i(e);if(t.length===0)return{success:!1,error:`No '${e.role||"app"}' servers found for ${e.slug}/${e.environment}.`};s.step(`Restoring database '${r.database.name}'${r.from?` from ${r.from}`:" from the latest backup"} on ${t.length} server(s)...`);let n=await e.driver.runRemoteDeploy({targets:t,commands:g(r.database,{from:r.from}),comment:`ts-cloud db:restore ${e.slug}/${r.database.name}`,tags:{Project:e.slug,Environment:e.environment,Role:e.role||"app"}});if(!n.success)s.error(`Restore failed: ${n.error||"unknown error"}`);else s.success(`Restored ${r.database.name}.`);return{success:n.success,error:n.error,perInstance:n.perInstance}}
|
|
3
|
-
export{y as
|
|
3
|
+
export{y as xd,h as yd,I as zd,P as Ad};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dh as T}from"./chunk-ja1vjdn1.js";class A{client;constructor(e,i){this.client=i??new T(void 0,{profile:e})}collectionItems(e,i){let t=e?.Items??e?.[i];if(!t)return[];if(Array.isArray(t))return t;let n=t[i]??t.Item;if(n===void 0)return typeof t==="object"&&(t.Id||t.PathPattern)?[t]:[];return Array.isArray(n)?n:[n]}validateExistingOriginInput(e,i){if(!/^[A-Z0-9]{8,32}$/.test(e))throw Error("CloudFront distribution ID is invalid");if(!/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/.test(i.id))throw Error("CloudFront origin ID is invalid");if(!/^(?=.{1,253}$)(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?$/.test(i.domainName))throw Error("CloudFront origin must be a hostname without a scheme or path");let t=i.pathPattern.startsWith("/")?i.pathPattern:`/${i.pathPattern}`;if(t==="/"||t==="/*"||!/^\/[A-Za-z0-9_.*?~!$&'()+,;=:@%/-]{1,255}$/.test(t))throw Error("CloudFront path pattern must be a non-default absolute pattern");if(i.originPath&&(!i.originPath.startsWith("/")||i.originPath.includes("..")))throw Error("CloudFront origin path must be absolute and traversal-free");if(Object.entries(i.customHeaders??{}).some(([n,s])=>!/^[A-Za-z0-9-]{1,64}$/.test(n)||!s||s.length>1024))throw Error("CloudFront custom origin headers are invalid");return{...i,pathPattern:t}}async upsertExistingDistributionOrigin(e,i){let t=this.validateExistingOriginInput(e,i),n=await this.client.request({service:"cloudfront",region:"us-east-1",method:"GET",path:`/2020-05-31/distribution/${e}/config`,returnHeaders:!0}),s=n.headers?.etag||n.headers?.ETag||n.ETag||"",r=n.body?.DistributionConfig||n.DistributionConfig||n.body;if(!r||r.Enabled===void 0||!s)throw Error("Failed to read an ETag-protected CloudFront distribution config");let o=this.collectionItems(r.Origins,"Origin"),a=this.collectionItems(r.CacheBehaviors,"CacheBehavior"),u=o.find((f)=>String(f.Id)===t.id),c=a.find((f)=>String(f.PathPattern)===t.pathPattern);if(u&&String(u.DomainName)!==t.domainName&&!t.replaceExisting)throw Error(`Origin ${t.id} already targets ${u.DomainName}; pass replaceExisting only after reviewing the live config`);if(c&&String(c.TargetOriginId)!==t.id&&!t.replaceExisting)throw Error(`Path ${t.pathPattern} already targets ${c.TargetOriginId}; pass replaceExisting only after reviewing the live config`);let g={Id:t.id,DomainName:t.domainName,OriginPath:t.originPath??"",CustomHeaders:{Quantity:Object.keys(t.customHeaders??{}).length,...Object.keys(t.customHeaders??{}).length?{Items:{OriginCustomHeader:Object.entries(t.customHeaders).map(([f,I])=>({HeaderName:f,HeaderValue:I}))}}:{}},CustomOriginConfig:{HTTPPort:80,HTTPSPort:443,OriginProtocolPolicy:t.protocolPolicy??"https-only",OriginSslProtocols:{Quantity:1,Items:{SslProtocol:["TLSv1.2"]}},OriginReadTimeout:30,OriginKeepaliveTimeout:5},ConnectionAttempts:3,ConnectionTimeout:10,...t.originAccessControlId?{OriginAccessControlId:t.originAccessControlId}:{}},m=["GET","HEAD","OPTIONS","PUT","POST","PATCH","DELETE"],d={PathPattern:t.pathPattern,TargetOriginId:t.id,ViewerProtocolPolicy:"redirect-to-https",Compress:!0,CachePolicyId:"4135ea2d-6df8-44a3-9df3-4b5a84be39ad",OriginRequestPolicyId:"b689b0a8-53d0-40ab-baf2-68738e2966ac",AllowedMethods:{Quantity:m.length,Items:{Method:m},CachedMethods:{Quantity:2,Items:{Method:["GET","HEAD"]}}},SmoothStreaming:!1,FieldLevelEncryptionId:"",TrustedSigners:{Enabled:!1,Quantity:0},TrustedKeyGroups:{Enabled:!1,Quantity:0},LambdaFunctionAssociations:{Quantity:0},FunctionAssociations:{Quantity:0}},h=u?o.map((f)=>String(f.Id)===t.id?g:f):[...o,g],l=c?a.map((f)=>String(f.PathPattern)===t.pathPattern?d:f):[...a,d],y=JSON.stringify(o)!==JSON.stringify(h)||JSON.stringify(a)!==JSON.stringify(l);if(!y||t.dryRun)return{distributionId:e,originId:t.id,domainName:t.domainName,pathPattern:t.pathPattern,changed:y,applied:!1,etag:s};r.Origins={Quantity:h.length,Items:{Origin:h}},r.CacheBehaviors={Quantity:l.length,...l.length?{Items:{CacheBehavior:l}}:{}};let C=await this.client.request({service:"cloudfront",region:"us-east-1",method:"PUT",path:`/2020-05-31/distribution/${e}/config`,body:this.buildDistributionConfigXml(r),headers:{"Content-Type":"application/xml","If-Match":s}});return{distributionId:e,originId:t.id,domainName:t.domainName,pathPattern:t.pathPattern,changed:!0,applied:!0,etag:C.ETag||C.headers?.etag||""}}async removeExistingDistributionOrigin(e,i){let t=this.validateExistingOriginInput(e,i),n=await this.client.request({service:"cloudfront",region:"us-east-1",method:"GET",path:`/2020-05-31/distribution/${e}/config`,returnHeaders:!0}),s=n.headers?.etag||n.headers?.ETag||n.ETag||"",r=n.body?.DistributionConfig||n.DistributionConfig||n.body;if(!r||r.Enabled===void 0||!s)throw Error("Failed to read an ETag-protected CloudFront distribution config");let o=this.collectionItems(r.Origins,"Origin"),a=this.collectionItems(r.CacheBehaviors,"CacheBehavior"),u=o.find((l)=>String(l.Id)===t.id),c=a.find((l)=>String(l.PathPattern)===t.pathPattern);if(u&&String(u.DomainName)!==t.domainName)throw Error(`Origin ${t.id} no longer targets ${t.domainName}; refusing ambiguous removal`);if(c&&String(c.TargetOriginId)!==t.id)throw Error(`Path ${t.pathPattern} no longer targets ${t.id}; refusing ambiguous removal`);if(!c)return{distributionId:e,originId:t.id,domainName:t.domainName,pathPattern:t.pathPattern,changed:!1,applied:!1,originRemoved:!1,etag:s};let g=a.filter((l)=>String(l.PathPattern)!==t.pathPattern),m=String(r.DefaultCacheBehavior?.TargetOriginId)===t.id||g.some((l)=>String(l.TargetOriginId)===t.id),d=m?o:o.filter((l)=>String(l.Id)!==t.id);if(t.dryRun)return{distributionId:e,originId:t.id,domainName:t.domainName,pathPattern:t.pathPattern,changed:!0,applied:!1,originRemoved:!m&&!!u,etag:s};r.Origins={Quantity:d.length,Items:{Origin:d}},r.CacheBehaviors={Quantity:g.length,...g.length?{Items:{CacheBehavior:g}}:{}};let h=await this.client.request({service:"cloudfront",region:"us-east-1",method:"PUT",path:`/2020-05-31/distribution/${e}/config`,body:this.buildDistributionConfigXml(r),headers:{"Content-Type":"application/xml","If-Match":s}});return{distributionId:e,originId:t.id,domainName:t.domainName,pathPattern:t.pathPattern,changed:!0,applied:!0,originRemoved:!m&&!!u,etag:h.ETag||h.headers?.etag||""}}async createInvalidation(e){let i=e.callerReference||Date.now().toString(),t=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<InvalidationBatch>
|
|
3
3
|
<Paths>
|
|
4
4
|
<Quantity>${e.paths.length}</Quantity>
|
|
@@ -138,4 +138,4 @@ ${Object.entries(e).filter(([r])=>!r.startsWith("@_")).map(([r,o])=>s(r,o," ","
|
|
|
138
138
|
</Items>
|
|
139
139
|
</CustomErrorResponses>`}
|
|
140
140
|
</DistributionConfig>`,p=await this.client.request({service:"cloudfront",region:"us-east-1",method:"POST",path:"/2020-05-31/distribution",body:I,headers:{"Content-Type":"application/xml"},returnHeaders:!0}),b=p.body?.Distribution||p.Distribution||p.body||p;return{Id:b.Id,ARN:b.ARN,DomainName:b.DomainName,Status:b.Status,ETag:p.headers?.etag||p.ETag||""}}async createMediaDistributionForS3(e){return this.createDistributionForS3({...e,defaultRootObject:"",mediaDelivery:!0,comment:e.comment??`Media distribution for ${e.bucketName}`})}async listPublicKeys(){let e=await this.client.request({service:"cloudfront",region:"us-east-1",method:"GET",path:"/2020-05-31/public-key"});return this.collectionItems(e.PublicKeyList??e,"PublicKeySummary").map((t)=>({Id:String(t.Id),Name:String(t.Name),Comment:t.Comment?String(t.Comment):void 0}))}async createPublicKey(e){if(!/^[A-Za-z0-9_-]{1,128}$/.test(e.name))throw TypeError("CloudFront public key name is invalid");if(!e.encodedKey.includes("BEGIN PUBLIC KEY"))throw TypeError("CloudFront public key must be PEM encoded");let i=(s)=>s.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">"),t=await this.client.request({service:"cloudfront",region:"us-east-1",method:"POST",path:"/2020-05-31/public-key",headers:{"Content-Type":"application/xml"},body:`<PublicKeyConfig xmlns="http://cloudfront.amazonaws.com/doc/2020-05-31/"><CallerReference>${i(e.callerReference??`${Date.now()}-${e.name}`)}</CallerReference><Name>${i(e.name)}</Name><EncodedKey>${i(e.encodedKey)}</EncodedKey><Comment>${i(e.comment??"")}</Comment></PublicKeyConfig>`}),n=t.PublicKey??t;return{Id:String(n.Id),Name:String(n.PublicKeyConfig?.Name??e.name),EncodedKey:String(n.PublicKeyConfig?.EncodedKey??e.encodedKey),Comment:String(n.PublicKeyConfig?.Comment??e.comment??"")}}async listKeyGroups(){let e=await this.client.request({service:"cloudfront",region:"us-east-1",method:"GET",path:"/2020-05-31/key-group"});return this.collectionItems(e.KeyGroupList??e,"KeyGroupSummary").map((t)=>({Id:String(t.KeyGroup?.Id??t.Id),Name:String(t.KeyGroup?.KeyGroupConfig?.Name??t.KeyGroupConfig?.Name??t.Name),Items:this.collectionItems(t.KeyGroup?.KeyGroupConfig?.Items??t.KeyGroupConfig?.Items??t.Items,"Item").map(String),Comment:t.KeyGroup?.KeyGroupConfig?.Comment??t.KeyGroupConfig?.Comment??t.Comment}))}async createKeyGroup(e){if(!/^[A-Za-z0-9_-]{1,128}$/.test(e.name))throw TypeError("CloudFront key group name is invalid");let i=[...new Set(e.publicKeyIds)];if(i.length===0)throw TypeError("CloudFront key group requires at least one public key");let t=(o)=>o.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">"),n=i.map((o)=>`<Item>${t(o)}</Item>`).join(""),s=await this.client.request({service:"cloudfront",region:"us-east-1",method:"POST",path:"/2020-05-31/key-group",headers:{"Content-Type":"application/xml"},body:`<KeyGroupConfig xmlns="http://cloudfront.amazonaws.com/doc/2020-05-31/"><Name>${t(e.name)}</Name><Items>${n}</Items><Comment>${t(e.comment??"")}</Comment></KeyGroupConfig>`}),r=s.KeyGroup??s;return{Id:String(r.Id),Name:String(r.KeyGroupConfig?.Name??e.name),Items:i,Comment:String(r.KeyGroupConfig?.Comment??e.comment??"")}}static getS3BucketPolicyForCloudFront(e,i){return{Version:"2012-10-17",Statement:[{Sid:"AllowCloudFrontServicePrincipal",Effect:"Allow",Principal:{Service:"cloudfront.amazonaws.com"},Action:"s3:GetObject",Resource:`arn:aws:s3:::${e}/*`,Condition:{StringEquals:{"AWS:SourceArn":i}}}]}}async waitForDistributionDeployed(e,i=60){for(let t=0;t<i;t++){if((await this.getDistribution(e)).Status==="Deployed")return!0;await new Promise((s)=>setTimeout(s,30000))}return!1}async disableDistribution(e){let i=await this.client.request({service:"cloudfront",region:"us-east-1",method:"GET",path:`/2020-05-31/distribution/${e}/config`,returnHeaders:!0}),t=i.headers?.etag||i.headers?.ETag||"",n=i.body?.DistributionConfig||(i.body?.Enabled!==void 0?i.body:void 0)||i.DistributionConfig;if(!n||n.Enabled===void 0)throw Error("Failed to get current distribution config");n.Enabled=!1;let s=this.buildDistributionConfigXml(n),r=await this.client.request({service:"cloudfront",region:"us-east-1",method:"PUT",path:`/2020-05-31/distribution/${e}/config`,body:s,headers:{"Content-Type":"application/xml","If-Match":t},returnHeaders:!0});return{ETag:r.headers?.etag||r.headers?.ETag||r.ETag||""}}async deleteDistribution(e,i){let t=i||"";if(!t){let n=await this.client.request({service:"cloudfront",region:"us-east-1",method:"GET",path:`/2020-05-31/distribution/${e}`,returnHeaders:!0});t=n.headers?.etag||n.headers?.ETag||""}await this.client.request({service:"cloudfront",region:"us-east-1",method:"DELETE",path:`/2020-05-31/distribution/${e}`,headers:{"If-Match":t}})}async waitForDistributionDisabled(e,i=60){for(let t=0;t<i;t++){let n=await this.getDistribution(e);if(n.Status==="Deployed"&&!n.Enabled)return!0;await new Promise((s)=>setTimeout(s,30000))}return!1}async removeAlias(e,i){let t=await this.client.request({service:"cloudfront",region:"us-east-1",method:"GET",path:`/2020-05-31/distribution/${e}/config`,returnHeaders:!0}),n=t.headers?.etag||t.headers?.ETag||"",s=t.body?.DistributionConfig||(t.body?.Enabled!==void 0?t.body:void 0)||t.DistributionConfig;if(!s||s.Enabled===void 0)throw Error("Failed to get current distribution config");let r=[];if(s.Aliases?.Items){if(Array.isArray(s.Aliases.Items))r=s.Aliases.Items;else if(typeof s.Aliases.Items==="object"){let c=s.Aliases.Items.CNAME;if(typeof c==="string")r=[c];else if(Array.isArray(c))r=c}}if(r.length===0)throw Error("Distribution has no aliases to remove");let o=r.filter((c)=>c!==i);if(o.length===r.length)throw Error(`Alias ${i} not found in distribution`);if(s.Aliases.Quantity=o.length,s.Aliases.Items=o.length>0?o:void 0,o.length===0)s.ViewerCertificate={CloudFrontDefaultCertificate:!0,MinimumProtocolVersion:"TLSv1.2_2021"};let a=this.buildDistributionConfigXml(s),u=await this.client.request({service:"cloudfront",region:"us-east-1",method:"PUT",path:`/2020-05-31/distribution/${e}/config`,body:a,headers:{"Content-Type":"application/xml","If-Match":n},returnHeaders:!0});return{ETag:u.headers?.etag||u.headers?.ETag||u.ETag||""}}}
|
|
141
|
-
export{A as
|
|
141
|
+
export{A as wd};
|
|
@@ -41,4 +41,4 @@ fi
|
|
|
41
41
|
systemctl enable nftables >/dev/null 2>&1 || true
|
|
42
42
|
echo "ts-cloud: L3/L4 mitigation active"
|
|
43
43
|
`}var b=["off","monitor","rate_limit","challenge","lockdown"];function D(e,t=[]){let n=[],s=Math.max(1,e.baselineRequestsPerSecond),a=e.requestsPerSecond/s,l=0,i=(g,v)=>{n.push(v),l=Math.max(l,b.indexOf(g))},c=a>=3;if(c)i("monitor",`Traffic is ${a.toFixed(1)}x the baseline.`);let p=e.topSourceShare>=0.25,u=e.errorRate>=0.25,o=(e.suspiciousAgentShare??0)>=0.5,r=e.uniqueSources>0&&e.requestsPerSecond/e.uniqueSources>=50;if(c&&p)i("rate_limit",`One source accounts for ${(e.topSourceShare*100).toFixed(0)}% of traffic.`);if(c&&r)i("rate_limit","Request rate per unique source is far above what a browser produces.");if(c&&u)i("challenge",`Error rate is ${(e.errorRate*100).toFixed(0)}% under load.`);if(c&&o)i("challenge","Most requests carry no recognisable browser agent.");if(a>=20&&(p||u||o||r))i("lockdown",`Traffic is ${a.toFixed(0)}x the baseline with attack-shaped characteristics.`);if(!c&&e.topSourceShare>=0.6&&e.requestsPerSecond>s)i("rate_limit","A single source dominates traffic without an overall surge.");let d=b[l],m={off:1,monitor:1,rate_limit:0.5,challenge:0.25,lockdown:0.1}[d];return{level:d,reasons:n,rateLimitFactor:m,challengeEnabled:d==="challenge"||d==="lockdown",staticOnly:d==="lockdown",banCandidates:d==="off"||d==="monitor"?[]:f(t)}}function T(e,t){return Math.max(1,Math.floor(e*t.rateLimitFactor))}
|
|
44
|
-
export{_ as
|
|
44
|
+
export{_ as cf,S as df,k as ef,x as ff,P as gf,C as hf,D as if,T as jf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{a as
|
|
1
|
+
import{dh as s}from"./chunk-ja1vjdn1.js";class a{client;region;constructor(e="us-east-1",r){this.region=e,this.client=new s(void 0,{profile:r})}async createRepository(e){let r={repositoryName:e.repositoryName};if(e.imageTagMutability)r.imageTagMutability=e.imageTagMutability;if(e.imageScanningConfiguration)r.imageScanningConfiguration=e.imageScanningConfiguration;if(e.encryptionConfiguration)r.encryptionConfiguration=e.encryptionConfiguration;if(e.tags&&e.tags.length>0)r.tags=e.tags;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.CreateRepository","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repository:t.repository?this.parseRepository(t.repository):void 0}}async describeRepositories(e){let r={};if(e?.repositoryNames&&e.repositoryNames.length>0)r.repositoryNames=e.repositoryNames;if(e?.registryId)r.registryId=e.registryId;if(e?.maxResults)r.maxResults=e.maxResults;if(e?.nextToken)r.nextToken=e.nextToken;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DescribeRepositories","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repositories:t.repositories?.map((i)=>this.parseRepository(i)),nextToken:t.nextToken}}async getAuthorizationToken(e){let r={};if(e&&e.length>0)r.registryIds=e;return{authorizationData:(await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})).authorizationData?.map((i)=>({authorizationToken:i.authorizationToken,expiresAt:i.expiresAt,proxyEndpoint:i.proxyEndpoint}))}}async deleteRepository(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;if(e.force!==void 0)r.force=e.force;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DeleteRepository","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{repository:t.repository?this.parseRepository(t.repository):void 0}}async describeImages(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;if(e.imageIds&&e.imageIds.length>0)r.imageIds=e.imageIds;if(e.filter)r.filter=e.filter;if(e.maxResults)r.maxResults=e.maxResults;if(e.nextToken)r.nextToken=e.nextToken;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.DescribeImages","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{imageDetails:t.imageDetails?.map((i)=>this.parseImageDetail(i)),nextToken:t.nextToken}}async batchDeleteImage(e){let r={repositoryName:e.repositoryName,imageIds:e.imageIds};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{imageIds:t.imageIds,failures:t.failures}}async putLifecyclePolicy(e){let r={repositoryName:e.repositoryName,lifecyclePolicyText:e.lifecyclePolicyText};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,lifecyclePolicyText:t.lifecyclePolicyText}}async getLifecyclePolicy(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,lifecyclePolicyText:t.lifecyclePolicyText,lastEvaluatedAt:t.lastEvaluatedAt}}async setRepositoryPolicy(e){let r={repositoryName:e.repositoryName,policyText:e.policyText};if(e.registryId)r.registryId=e.registryId;if(e.force!==void 0)r.force=e.force;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,policyText:t.policyText}}async getRepositoryPolicy(e){let r={repositoryName:e.repositoryName};if(e.registryId)r.registryId=e.registryId;let t=await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)});return{registryId:t.registryId,repositoryName:t.repositoryName,policyText:t.policyText}}async tagResource(e){let r={resourceArn:e.resourceArn,tags:e.tags};await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.TagResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})}async listTagsForResource(e){let r={resourceArn:e};return{tags:(await this.client.request({service:"ecr",region:this.region,method:"POST",path:"/",headers:{"X-Amz-Target":"AmazonEC2ContainerRegistry_V20150921.ListTagsForResource","Content-Type":"application/x-amz-json-1.1"},body:JSON.stringify(r)})).tags}}createLifecyclePolicyText(e){return JSON.stringify({rules:e.map((r)=>({rulePriority:r.rulePriority,description:r.description,selection:r.selection,action:r.action}))})}async getDockerLoginCommand(){let e=await this.getAuthorizationToken();if(!e.authorizationData?.[0])throw Error("Failed to get authorization token");let r=e.authorizationData[0],t=r.authorizationToken||"",i=r.proxyEndpoint||"";return`echo "${Buffer.from(t,"base64").toString("utf8").split(":")[1]}" | docker login --username AWS --password-stdin ${i}`}getRegistryUri(e){return`${e}.dkr.ecr.${this.region}.amazonaws.com`}parseRepository(e){return{repositoryArn:e.repositoryArn,registryId:e.registryId,repositoryName:e.repositoryName,repositoryUri:e.repositoryUri,createdAt:e.createdAt,imageTagMutability:e.imageTagMutability,imageScanningConfiguration:e.imageScanningConfiguration,encryptionConfiguration:e.encryptionConfiguration}}parseImageDetail(e){return{registryId:e.registryId,repositoryName:e.repositoryName,imageDigest:e.imageDigest,imageTags:e.imageTags,imageSizeInBytes:e.imageSizeInBytes,imagePushedAt:e.imagePushedAt,imageScanStatus:e.imageScanStatus,imageScanFindingsSummary:e.imageScanFindingsSummary}}}
|
|
2
|
+
export{a as Ig};
|