@stacksjs/ts-cloud 0.16.67 → 0.16.69
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-vcs8wtay.js → chunk-17ewx21n.js} +11 -11
- package/dist/bin/{chunk-6rvejkny.js → chunk-1cb0r1j3.js} +1 -1
- package/dist/bin/{chunk-shxqbkrz.js → chunk-1tk64amh.js} +1 -1
- package/dist/bin/{chunk-jq4xyf7y.js → chunk-2247xk4n.js} +1 -1
- package/dist/bin/{chunk-sb29jzvd.js → chunk-370pghhq.js} +113 -113
- package/dist/bin/{chunk-yec39wzh.js → chunk-37xeqae4.js} +1 -1
- package/dist/bin/{chunk-bzjr9jwn.js → chunk-43a60zkj.js} +1 -1
- package/dist/bin/chunk-4vz5erjz.js +1 -0
- package/dist/bin/{chunk-f4v7nm9a.js → chunk-55j0x82p.js} +5 -5
- package/dist/bin/{chunk-7pxqdq44.js → chunk-5fde4d44.js} +1 -1
- package/dist/bin/{chunk-qjh516ah.js → chunk-5gf0je0v.js} +11 -11
- package/dist/bin/{chunk-245rppy4.js → chunk-5t1ky9re.js} +1 -1
- package/dist/bin/{chunk-pyxmdv8d.js → chunk-6cyr6gcg.js} +1 -1
- package/dist/bin/chunk-6rwewb7j.js +1 -0
- package/dist/bin/{chunk-xkcvfpd0.js → chunk-6tqzgm9z.js} +4 -4
- package/dist/bin/chunk-7d83f6sn.js +1 -0
- package/dist/bin/chunk-7v68hpgc.js +2 -0
- package/dist/bin/{chunk-djqrnrpx.js → chunk-7y56qyrj.js} +1 -1
- package/dist/bin/{chunk-jyfm20f3.js → chunk-8escxm7h.js} +1 -1
- package/dist/bin/{chunk-kwfbth5c.js → chunk-b0r8a5h5.js} +3 -3
- package/dist/bin/{chunk-6stcmq7g.js → chunk-bkvxzenb.js} +1 -1
- package/dist/bin/{chunk-0h1ae217.js → chunk-d28q9ath.js} +1 -1
- package/dist/bin/chunk-dmm1p4bs.js +1 -0
- package/dist/bin/chunk-dycx66c7.js +1 -0
- package/dist/bin/{chunk-9vjg754g.js → chunk-e4c7ba0g.js} +1 -1
- package/dist/bin/chunk-fjx816tt.js +1 -0
- package/dist/bin/chunk-fm6paqft.js +1 -0
- package/dist/bin/{chunk-p801tzxz.js → chunk-gga18c4g.js} +1 -1
- package/dist/bin/{chunk-er5zfr54.js → chunk-gmy8p7nr.js} +1 -1
- package/dist/bin/chunk-h5ccvped.js +1 -0
- package/dist/bin/chunk-h9h9dn0r.js +1 -0
- package/dist/bin/chunk-ht6s2cwm.js +1 -0
- package/dist/bin/{chunk-vwgpwjwh.js → chunk-jrxb5sg4.js} +2 -2
- package/dist/bin/{chunk-g47h6fg3.js → chunk-krt80e8w.js} +2 -2
- package/dist/bin/{chunk-vf5w5aed.js → chunk-m60wwxz1.js} +6 -6
- package/dist/bin/{chunk-yc1n2h5w.js → chunk-mjbd4pbz.js} +2 -2
- package/dist/bin/chunk-ncr1dwdt.js +1 -0
- package/dist/bin/{chunk-5zp3s61y.js → chunk-nxsx69p4.js} +2 -2
- package/dist/bin/chunk-nzhpva7z.js +1 -0
- package/dist/bin/chunk-p40tvp17.js +1 -0
- package/dist/bin/{chunk-k20dxfrh.js → chunk-pgbtdsj2.js} +2 -2
- package/dist/bin/{chunk-a68bhc0s.js → chunk-pr96tp0s.js} +2 -2
- package/dist/bin/chunk-qe8zh9kn.js +1 -0
- package/dist/bin/{chunk-qascek4k.js → chunk-qjxd8f5m.js} +3 -3
- package/dist/bin/{chunk-pxm3w8a3.js → chunk-qka0e661.js} +5 -5
- package/dist/bin/{chunk-n80ewf4z.js → chunk-rgnmxfvp.js} +1 -1
- package/dist/bin/{chunk-sz45s7mw.js → chunk-sn1zde06.js} +1 -1
- package/dist/bin/{chunk-2mdh3syn.js → chunk-sv7n9ape.js} +2 -2
- package/dist/bin/{chunk-mn0rzykt.js → chunk-szagab6z.js} +99 -99
- package/dist/bin/chunk-t6zpvaqr.js +1 -0
- package/dist/bin/{chunk-34r2fwwn.js → chunk-tdv5rwjv.js} +1 -1
- package/dist/bin/{chunk-dbtm1j98.js → chunk-v5js5pz6.js} +170 -170
- package/dist/bin/chunk-vrn0akcn.js +1 -0
- package/dist/bin/{chunk-nxsa7efz.js → chunk-w2eezm9z.js} +2 -2
- package/dist/bin/{chunk-h2f4f194.js → chunk-wjn2bpdb.js} +1 -1
- package/dist/bin/chunk-x00efaxm.js +1 -0
- package/dist/bin/{chunk-gvk2af4h.js → chunk-x40sd2m9.js} +2 -2
- package/dist/bin/chunk-zred4827.js +1 -0
- package/dist/bin/{chunk-jwby10he.js → chunk-zz9nj5kn.js} +3 -3
- package/dist/bin/cli.js +83 -83
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/{chunk-y9589qef.js → chunk-040rbk7k.js} +35 -35
- package/dist/{chunk-bkkwtcnf.js → chunk-17bmm7sx.js} +70 -70
- package/dist/{chunk-9w5ncn9s.js → chunk-1wc2zfct.js} +3 -3
- package/dist/{chunk-axcxfz8p.js → chunk-1yj07hbw.js} +2 -2
- package/dist/{chunk-0kemzwpg.js → chunk-41fwhvp7.js} +1 -1
- package/dist/chunk-426k7fgf.js +1 -0
- package/dist/chunk-4b0ynr9y.js +1 -0
- package/dist/{chunk-a92gvctb.js → chunk-a07kew2q.js} +6 -6
- package/dist/{chunk-0dfyn0bv.js → chunk-c61x369p.js} +85 -85
- package/dist/chunk-emkp3dsp.js +1 -0
- package/dist/{chunk-pymc2aad.js → chunk-h360gwrf.js} +2 -2
- package/dist/{chunk-7mpbjr6c.js → chunk-h5yx54ks.js} +3 -3
- package/dist/{chunk-q4408fwg.js → chunk-hvttzk9q.js} +2 -2
- package/dist/{chunk-q8vvwmka.js → chunk-je8tky8z.js} +1 -1
- package/dist/{chunk-03eny26f.js → chunk-kbr9nc8y.js} +2 -2
- package/dist/{chunk-3ca6cb1s.js → chunk-p21vbrgk.js} +1 -1
- package/dist/chunk-pcagajw1.js +1 -0
- package/dist/{chunk-83fy36fn.js → chunk-qb25wesa.js} +2 -2
- package/dist/{chunk-hk1frmnn.js → chunk-qrpy0h2n.js} +1 -1
- package/dist/{chunk-xd67tr7p.js → chunk-s4wz0csj.js} +1 -1
- package/dist/chunk-sybwn2y6.js +1 -0
- package/dist/{chunk-r49ynkag.js → chunk-t8fbwcdk.js} +1 -1
- package/dist/{chunk-qgtydqpj.js → chunk-tb8azghz.js} +23 -23
- package/dist/{chunk-pah2r8a0.js → chunk-tq7nsdnd.js} +4 -4
- package/dist/{chunk-0860mm00.js → chunk-v0s8vpa3.js} +1 -1
- package/dist/{chunk-tngsyawj.js → chunk-xyem7g21.js} +1 -1
- package/dist/{chunk-zgfzc46r.js → chunk-yh9tmx00.js} +3 -3
- package/dist/{chunk-1t3rjvf9.js → chunk-z585dfjz.js} +12 -12
- package/dist/deploy/index.js +1 -1
- package/dist/dns/index.js +1 -1
- package/dist/drivers/index.js +1 -1
- package/dist/index.js +8 -8
- package/dist/mail/index.js +2 -2
- package/dist/object-storage/index.d.ts +6 -4
- package/dist/object-storage/migrate.d.ts +3 -1
- package/dist/operations/index.js +1 -1
- package/dist/protection/index.js +1 -1
- package/dist/spend/index.js +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +5 -5
- package/dist/ui/account/security.html +1 -1
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +6 -6
- package/dist/ui/data/services.html +6 -6
- package/dist/ui/data/volumes.html +6 -6
- package/dist/ui/index.html +6 -6
- package/dist/ui/infrastructure/topology.html +5 -5
- package/dist/ui/integrations.html +2 -2
- package/dist/ui/operations/alerts.html +6 -6
- package/dist/ui/operations/configuration.html +5 -5
- package/dist/ui/operations/jobs.html +5 -5
- package/dist/ui/operations/maintenance.html +6 -6
- package/dist/ui/operations/observability.html +6 -6
- package/dist/ui/operations/previews.html +6 -6
- package/dist/ui/operations/queue.html +5 -5
- package/dist/ui/operations/regions.html +6 -6
- package/dist/ui/operations/releases.html +6 -6
- package/dist/ui/operations/spend.html +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +2 -2
- package/dist/ui/server/actions.html +6 -6
- package/dist/ui/server/activity.html +2 -2
- package/dist/ui/server/capacity.html +5 -5
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +6 -6
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +6 -6
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +6 -6
- package/dist/ui/server/security.html +2 -2
- package/dist/ui/server/services.html +2 -2
- package/dist/ui/server/sites.html +5 -5
- package/dist/ui/server/ssh-keys.html +5 -5
- 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 +1 -1
- 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 +2 -2
- package/dist/ui/serverless/queues.html +6 -6
- package/dist/ui/serverless/secrets.html +6 -6
- package/dist/ui/serverless/traces.html +6 -6
- package/dist/ui/serverless.html +6 -6
- package/package.json +3 -3
- package/dist/bin/chunk-2r9748kw.js +0 -1
- package/dist/bin/chunk-483ppsv0.js +0 -1
- package/dist/bin/chunk-9fn41ztz.js +0 -1
- package/dist/bin/chunk-af8511dv.js +0 -1
- package/dist/bin/chunk-asvxjh7p.js +0 -1
- package/dist/bin/chunk-bphzq12c.js +0 -1
- package/dist/bin/chunk-c6tt4fj9.js +0 -1
- package/dist/bin/chunk-c6yrhzw5.js +0 -1
- package/dist/bin/chunk-cf2teb1b.js +0 -1
- package/dist/bin/chunk-dhb1xs5a.js +0 -1
- package/dist/bin/chunk-dwahpsj4.js +0 -1
- package/dist/bin/chunk-evbh466n.js +0 -1
- package/dist/bin/chunk-j9yq3b4d.js +0 -2
- package/dist/bin/chunk-n54ssj0h.js +0 -1
- package/dist/bin/chunk-nj4eg5vt.js +0 -1
- package/dist/bin/chunk-p6c2d6em.js +0 -1
- package/dist/bin/chunk-va3yvvs0.js +0 -1
- package/dist/bin/chunk-vy27rc50.js +0 -1
- package/dist/bin/chunk-y815amx5.js +0 -1
- package/dist/chunk-0c48hvb8.js +0 -1
- package/dist/chunk-8crqfe8x.js +0 -1
- package/dist/chunk-949tycxj.js +0 -1
- package/dist/chunk-s3pe89wj.js +0 -1
- package/dist/chunk-wxjd9gyb.js +0 -1
package/dist/aws/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Te,
|
|
1
|
+
import{Te,vr,Os,_s,Cg,Ac,yc,Ls,$s,Sc,lt,re,ut,pe,T,we,Mn,Ic,Ue,bc,Un,Eg,wh,Ms,Fs,Qn,Hn,Rh,Dh,YS,ZS,eI,tI,Ht,rI,nI,iI,sI,Gt,Ph,kh,Nh,Vt,Bh,xh,Oh,Gn,oI,aI,cI,Tr,dI,lI,uI,Cc,Ec,vg,gI,pI,mI,wr,_h,Lh,Rr,gt,Vn,vc,Tg,fI,wg,hI,qt,yI,SI,II,bI,fe,CI,EI,vI,TI,Dr,wI,RI,DI,qn,Tc,wc,Rg,Dg,Rc,Pr}from"../chunk-a07kew2q.js";import{Re,pt,jn,$h}from"../chunk-kbr9nc8y.js";import{Dc,Qe,I}from"../chunk-t8fbwcdk.js";import{He}from"../chunk-p21vbrgk.js";import{ne}from"../chunk-xyem7g21.js";import{mt,he,Ge,H,Wt,Kn,Us,Qs,kr,Nr,Wn,Br,Hs,Gs,Vs,qs,ie,js,zs,Ks,Ws,Ae,Js,Xs,Ys,N,Nc,Jn,Bc,ye,xr}from"../chunk-hvttzk9q.js";import{b}from"../chunk-je8tky8z.js";import{Vr,Be}from"../chunk-1yj07hbw.js";import{A}from"../chunk-41fwhvp7.js";import{o}from"../chunk-z585dfjz.js";import{Ke,vp,Tp,Ni,n,u,eA}from"../chunk-1wc2zfct.js";export{ye as ACMClient,xr as ACMDnsValidator,n as AWSClient,vc as ApplicationAutoScalingClient,vr as AwsBackupClient,Dh as BedrockAgentClient,Rh as BedrockAgentRuntimeClient,Hn as BedrockClient,Qn as BedrockRuntimeClient,A as CloudFormationClient,I as CloudFrontClient,we as CloudWatchLogsClient,H as CloudflareProvider,Ht as ComprehendClient,Mn as ConnectClient,$s as CostExplorerClient,Jn as DnsProviderFactory,Ue as DynamoDBClient,Vr as EC2Client,He as ECRClient,lt as ECSClient,Pr as EFSClient,Ic as ELBv2Client,gt as ElastiCacheClient,jn as EmailClient,Rr as EventBridgeClient,Ge as GoDaddyProvider,Re as IAMClient,Tg as ImapServer,wr as KendraClient,T as LambdaClient,bc as OpenSearchClient,mt as PROXIABLE_RECORD_TYPES,Cc as PersonalizeClient,vg as PersonalizeEventsClient,Ec as PersonalizeRuntimeClient,Gn as PollyClient,he as PorkbunProvider,ne as RDSClient,Gt as RekognitionClient,b as Route53Client,Sc as Route53DomainsClient,ie as Route53Provider,o as S3Client,pt as SESClient,ut as SNSClient,pe as SQSClient,Be as SSMClient,Te as STSClient,Vn as SchedulerClient,re as SecretsManagerClient,qt as SmsClient,Rc as SmsVoiceClient,wg as SmtpServer,qn as SupportClient,Tc as SupportTemplates,Vt as TextractClient,Un as TranscribeClient,Tr as TranslateClient,Ae as UnifiedDnsValidator,Dr as VoiceClient,rI as analyzeSentiment,Vs as applyDeclaredZoneSettings,Ks as applyZoneMigration,u as buildQueryParams,Tp as canonicalUriFor,Ni as coerceXmlValues,eI as completeWithClaude,Dc as configOrigins,sI as containsPii,kh as countFacesInS3Image,Eg as crc32,bI as createDeliveryReceiptHandler,N as createDnsProvider,Xs as createGoDaddyValidator,Ls as createObjectStorageClient,Js as createPorkbunValidator,RI as createRecordingHandler,Ys as createRoute53Validator,cI as createSSML,SI as createScheduledSmsHandler,II as createSmsClient,yI as createSmsInboxHandler,Dg as createSmsInfrastructure,DI as createVoiceClient,wI as createVoicemailHandler,Ms as decodeEventStream,wh as decodeEventStreamMessage,Br as delegateZone,Hs as delegateZoneFromConfig,Gs as describeDelegation,qs as describeZoneSettings,eA as detectCredentialSource,Nc as detectDnsProvider,Ph as detectLabelsFromS3,iI as detectLanguage,Bc as dnsProviders,$h as email,Fs as eventStreamError,js as exportRoute53Zone,nI as extractEntities,xh as extractFormsFromS3,Oh as extractTablesFromS3,Bh as extractTextFromS3,CI as formatPhoneNumber,tI as generateEmbeddings,vI as getCountryCode,gI as getRecommendations,pI as getSimilarItems,Rg as getSmsInfrastructureStatus,Nh as isContentSafe,kr as isNameserverRegistrar,TI as isSamePhoneNumber,EI as isValidPhoneNumber,Nr as isZoneHost,_s as keyMatchesFilters,ZS as listClaudeModels,uI as listLanguages,aI as listVoices,Cg as migrateObjectStorage,fe as normalizePhoneNumber,zs as planZoneMigration,Wt as policyTag,Ac as providerEndpoint,Kn as qualifyName,Qs as reconcileDeclaredRecords,Os as remapKey,YS as requestModelAccess,Us as resolveDeclaredRecords,yc as resolveObjectStorage,Ke as resolveS3Endpoint,Lh as retrieveForRag,Qe as s3OriginBucket,Wn as sameNameservers,_h as search,wc as setupSmsInfrastructure,vp as signingNameFor,fI as startImapServer,hI as startSmtpServer,oI as textToSpeech,mI as trackEvent,dI as translate,lI as translateToMultiple,Ws as verifyZoneParity};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)){let h=u.trim();if(!h||h.startsWith("#")||h.startsWith(";"))continue;let m=h.match(/^\[([^\]]+)\]$/);if(m){if(a===e&&l&&d)return{accessKeyId:l,secretAccessKey:d,sessionToken:y};a=m[1],l=void 0,d=void 0,y=void 0;continue}if(a===e){let[b,...S]=h.split("="),f=S.join("=").trim();switch(b.trim().toLowerCase()){case"aws_access_key_id":l=f;break;case"aws_secret_access_key":d=f;break;case"aws_session_token":y=f;break}}}if(a===e&&l&&d)return{accessKeyId:l,secretAccessKey:d,sessionToken:y};return null}function U(e){let{buffer:t,byteOffset:s,byteLength:i}=e;if(t instanceof ArrayBuffer)return t.slice(s,s+i);let n=new ArrayBuffer(i);return new Uint8Array(n).set(new Uint8Array(e)),n}function j(e,t){let s=e?.[t]??e;if(s===null||typeof s!=="object"||Array.isArray(s))return s;let i={...s};return delete i["@_xmlns"],i}class g{client;region;explicitProfile;endpoint;endpointProtocol="https";forcePathStyle;explicitCredentials;constructor(e="us-east-1",t,s){let i=typeof e==="string"?s:e,n=typeof e==="string"?e:e.region??"us-east-1",r=typeof e==="string"?t:e.profile,o=i?.endpoint?
|
|
1
|
+
import{Jt,p}from"./chunk-b0r8a5h5.js";import{Gr}from"./chunk-7v68hpgc.js";import*as c from"node:crypto";import{readFileSync as B}from"node:fs";import{readdir as L}from"node:fs/promises";import{join as z}from"node:path";function Rt(e){if(e){let i=D(e);if(!i)throw Error(`AWS profile '${e}' not found in ~/.aws/credentials`);return i}let t=process.env.AWS_ACCESS_KEY_ID,s=process.env.AWS_SECRET_ACCESS_KEY;if(t&&s)return{accessKeyId:t,secretAccessKey:s,sessionToken:process.env.AWS_SESSION_TOKEN};return D(process.env.AWS_PROFILE||"default")??{accessKeyId:"",secretAccessKey:""}}function D(e){let{existsSync:t,readFileSync:s}=Gr("node:fs"),{homedir:i}=Gr("node:os"),{join:n}=Gr("node:path"),r=process.env.AWS_SHARED_CREDENTIALS_FILE||n(i(),".aws","credentials");if(!t(r))return null;let o=s(r,"utf-8"),a=null,l,d,y;for(let u of o.split(`
|
|
2
|
+
`)){let h=u.trim();if(!h||h.startsWith("#")||h.startsWith(";"))continue;let m=h.match(/^\[([^\]]+)\]$/);if(m){if(a===e&&l&&d)return{accessKeyId:l,secretAccessKey:d,sessionToken:y};a=m[1],l=void 0,d=void 0,y=void 0;continue}if(a===e){let[b,...S]=h.split("="),f=S.join("=").trim();switch(b.trim().toLowerCase()){case"aws_access_key_id":l=f;break;case"aws_secret_access_key":d=f;break;case"aws_session_token":y=f;break}}}if(a===e&&l&&d)return{accessKeyId:l,secretAccessKey:d,sessionToken:y};return null}function U(e){let{buffer:t,byteOffset:s,byteLength:i}=e;if(t instanceof ArrayBuffer)return t.slice(s,s+i);let n=new ArrayBuffer(i);return new Uint8Array(n).set(new Uint8Array(e)),n}function j(e,t){let s=e?.[t]??e;if(s===null||typeof s!=="object"||Array.isArray(s))return s;let i={...s};return delete i["@_xmlns"],i}class g{client;region;explicitProfile;endpoint;endpointProtocol="https";forcePathStyle;explicitCredentials;constructor(e="us-east-1",t,s){let i=typeof e==="string"?s:e,n=typeof e==="string"?e:e.region??"us-east-1",r=typeof e==="string"?t:e.profile,o=i?.endpoint?Jt({region:n,path:"/",endpoint:i.endpoint}):void 0;this.region=n,this.explicitProfile=r,this.endpoint=o?.host,this.endpointProtocol=o?.protocol??"https",this.forcePathStyle=i?.forcePathStyle,this.explicitCredentials=i?.credentials,this.client=new p(i?.credentials,{profile:r,endpoint:i?.endpoint,forcePathStyle:i?.forcePathStyle})}getCredentials(){if(this.explicitCredentials?.accessKeyId&&this.explicitCredentials.secretAccessKey)return this.explicitCredentials;let e=Rt(this.explicitProfile);if(e.accessKeyId&&e.secretAccessKey)return e;throw Error("S3 credentials not found. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (or pass explicit credentials/profile), or configure ~/.aws/credentials.")}s3BaseHost(){return this.endpoint||`s3.${this.region}.amazonaws.com`}s3VirtualHost(e){return this.forcePathStyle?this.s3BaseHost():`${e}.${this.s3BaseHost()}`}objectPath(e,t){return this.forcePathStyle?`/${e}/${t}`:`/${t}`}objectUrl(e,t){return`${this.endpointProtocol}://${this.s3VirtualHost(e)}${this.objectPath(e,t)}`}async listBuckets(){let e=await this.client.request({service:"s3",region:this.region,method:"GET",path:"/"}),t=[],i=(e?.ListAllMyBucketsResult??e)?.Buckets?.Bucket;if(i){let n=Array.isArray(i)?i:[i];for(let r of n)t.push({Name:r.Name,CreationDate:r.CreationDate})}return{Buckets:t}}async createBucket(e,t){let s={};if(t?.acl)s["x-amz-acl"]=t.acl;let i;if(this.region!=="us-east-1"&&!this.endpoint)i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
3
|
<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
4
4
|
<LocationConstraint>${this.region}</LocationConstraint>
|
|
5
5
|
</CreateBucketConfiguration>`,s["Content-Type"]="application/xml";await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,headers:s,body:i})}async deleteBucket(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`})}async emptyAndDeleteBucket(e){let t=!0;while(t){let s=await this.listAllObjects({bucket:e});if(s.length===0){t=!1;break}let i=s.map((n)=>n.Key);for(let n=0;n<i.length;n+=1000){let r=i.slice(n,n+1000);await this.deleteObjects(e,r)}}await this.deleteBucket(e)}async listAllObjects(e){let t=[],s;do{let i={"list-type":"2","max-keys":"1000"};if(e.prefix)i.prefix=e.prefix;if(s)i["continuation-token"]=s;let n=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e.bucket}`,queryParams:i}),r=n?.ListBucketResult??n,o=r?.Contents;if(o){let l=Array.isArray(o)?o:[o];for(let d of l)t.push({Key:d.Key,LastModified:d.LastModified||"",Size:Number.parseInt(d.Size||"0"),ETag:d.ETag})}let a=r?.IsTruncated;s=a==="true"||a===!0?r?.NextContinuationToken:void 0}while(s);return t}async list(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e.bucket}`}),s=[],n=(t?.ListBucketResult??t)?.Contents;if(n){let r=Array.isArray(n)?n:[n];for(let o of r){if(e.prefix&&!o.Key?.startsWith(e.prefix))continue;if(s.push({Key:o.Key||"",LastModified:o.LastModified||"",Size:Number.parseInt(o.Size||"0"),ETag:o.ETag}),e.maxKeys&&s.length>=e.maxKeys)break}}return s}async putObject(e){let t={};if(e.acl)t["x-amz-acl"]=e.acl;if(e.cacheControl)t["Cache-Control"]=e.cacheControl;if(e.contentType)t["Content-Type"]=e.contentType;if(e.metadata)for(let[n,r]of Object.entries(e.metadata))t[`x-amz-meta-${n}`]=r;let s=e.key.split("/").map((n)=>encodeURIComponent(n)).join("/"),i=e.body instanceof Uint8Array&&!Buffer.isBuffer(e.body)?Buffer.from(e.body):e.body;if(Buffer.isBuffer(i)||i instanceof Uint8Array){let n=Buffer.isBuffer(i)?i:Buffer.from(i),{accessKeyId:r,secretAccessKey:o,sessionToken:a}=this.getCredentials(),l=this.s3VirtualHost(e.bucket),d=this.objectPath(e.bucket,s),y=this.objectUrl(e.bucket,s),u=new Date,h=u.toISOString().replace(/[:-]|\.\d{3}/g,""),m=u.toISOString().slice(0,10).replace(/-/g,""),b=c.createHash("sha256").update(n).digest("hex"),S={host:l,"x-amz-date":h,"x-amz-content-sha256":b,...t};if(a)S["x-amz-security-token"]=a;let f=Object.keys(S).sort().map((P)=>`${P.toLowerCase()}:${S[P].trim()}
|
|
6
6
|
`).join(""),x=Object.keys(S).sort().map((P)=>P.toLowerCase()).join(";"),C=["PUT",d,"",f,x,b].join(`
|
|
7
7
|
`),w="AWS4-HMAC-SHA256",T=`${m}/${this.region}/s3/aws4_request`,q=[w,h,T,c.createHash("sha256").update(C).digest("hex")].join(`
|
|
8
|
-
`),I=c.createHmac("sha256",`AWS4${o}`).update(m).digest(),
|
|
8
|
+
`),I=c.createHmac("sha256",`AWS4${o}`).update(m).digest(),R=c.createHmac("sha256",I).update(this.region).digest(),H=c.createHmac("sha256",R).update("s3").digest(),E=c.createHmac("sha256",H).update("aws4_request").digest(),v=c.createHmac("sha256",E).update(q).digest("hex"),A=`${w} Credential=${r}/${T}, SignedHeaders=${x}, Signature=${v}`,k=await fetch(y,{method:"PUT",headers:{...S,Authorization:A},body:U(n)});if(!k.ok){let P=await k.text();throw Error(`S3 PUT failed: ${k.status} ${P}`)}return}await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${s}`,bucket:e.bucket,headers:t,body:e.body})}async getObject(e,t){let s=t.split("/").map((n)=>encodeURIComponent(n)).join("/");return await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${s}`,bucket:e,rawResponse:!0})}async getObjectBytes(e,t){let{accessKeyId:s,secretAccessKey:i,sessionToken:n}=this.getCredentials(),r=this.s3VirtualHost(e),o=t.split("/").map((P)=>encodeURIComponent(P)).join("/"),a=this.objectPath(e,o),l=this.objectUrl(e,o),d=new Date,y=d.toISOString().replace(/[:-]|\.\d{3}/g,""),u=d.toISOString().slice(0,10).replace(/-/g,""),h=c.createHash("sha256").update("").digest("hex"),m={host:r,"x-amz-date":y,"x-amz-content-sha256":h};if(n)m["x-amz-security-token"]=n;let b=Object.keys(m).sort().map((P)=>`${P.toLowerCase()}:${m[P].trim()}
|
|
9
9
|
`).join(""),S=Object.keys(m).sort().map((P)=>P.toLowerCase()).join(";"),f=["GET",a,"",b,S,h].join(`
|
|
10
10
|
`),x="AWS4-HMAC-SHA256",C=`${u}/${this.region}/s3/aws4_request`,w=[x,y,C,c.createHash("sha256").update(f).digest("hex")].join(`
|
|
11
|
-
`),T=c.createHmac("sha256",`AWS4${i}`).update(u).digest(),q=c.createHmac("sha256",T).update(this.region).digest(),I=c.createHmac("sha256",q).update("s3").digest(),
|
|
11
|
+
`),T=c.createHmac("sha256",`AWS4${i}`).update(u).digest(),q=c.createHmac("sha256",T).update(this.region).digest(),I=c.createHmac("sha256",q).update("s3").digest(),R=c.createHmac("sha256",I).update("aws4_request").digest(),H=c.createHmac("sha256",R).update(w).digest("hex"),E=`${x} Credential=${s}/${C}, SignedHeaders=${S}, Signature=${H}`,v=await fetch(l,{method:"GET",headers:{...m,Authorization:E}});if(!v.ok){let P=await v.text();throw Error(`S3 GET failed: ${v.status} ${P}`)}let A=await v.arrayBuffer(),k=v.headers.get("content-length");return{body:new Uint8Array(A),contentType:v.headers.get("content-type")??void 0,contentLength:k?Number.parseInt(k,10):void 0}}async copyObject(e){let t=(i)=>i.split("/").map((n)=>encodeURIComponent(n)).join("/"),s={"x-amz-copy-source":`/${e.sourceBucket}/${t(e.sourceKey)}`};if(e.metadataDirective)s["x-amz-metadata-directive"]=e.metadataDirective;if(e.contentType)s["Content-Type"]=e.contentType;if(e.metadata)for(let[i,n]of Object.entries(e.metadata))s[`x-amz-meta-${i}`]=n;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e.destinationBucket}/${t(e.destinationKey)}`,headers:s})}async deleteObject(e,t){let s=t.split("/").map((i)=>encodeURIComponent(i)).join("/");await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${s}`,bucket:e})}async deleteObjects(e,t){let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
12
12
|
<Delete>
|
|
13
13
|
${t.map((n)=>`<Object><Key>${n}</Key></Object>`).join(`
|
|
14
14
|
`)}
|
|
15
15
|
</Delete>`,i=c.createHash("md5").update(s).digest("base64");await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${e}`,queryParams:{delete:""},body:s,headers:{"Content-Type":"application/xml","Content-MD5":i}})}async bucketExists(e){try{return await this.client.request({service:"s3",region:this.region,method:"HEAD",path:`/${e}`}),!0}catch{return!1}}async copy(e){let t=B(e.source);await this.putObject({bucket:e.bucket,key:e.key,body:t,acl:e.acl,cacheControl:e.cacheControl,contentType:e.contentType,metadata:e.metadata})}async sync(e){let t=await this.listFilesRecursive(e.source);for(let s of t){if(e.exclude&&e.exclude.some((r)=>s.includes(r)))continue;if(e.include&&!e.include.some((r)=>s.includes(r)))continue;let i=s.substring(e.source.length+1),n=e.prefix?`${e.prefix}/${i}`:i;if(!e.dryRun){let r=B(s);await this.putObject({bucket:e.bucket,key:n,body:r,acl:e.acl,cacheControl:e.cacheControl,contentType:e.contentType,metadata:e.metadata})}}}async delete(e,t){await this.deleteObject(e,t)}async deletePrefix(e,t){let i=(await this.list({bucket:e,prefix:t})).map((n)=>n.Key);if(i.length>0)await this.deleteObjects(e,i)}async getBucketSize(e,t){return(await this.list({bucket:e,prefix:t})).reduce((i,n)=>i+n.Size,0)}async listFilesRecursive(e){let t=[],s=await L(e,{withFileTypes:!0});for(let i of s){let n=z(e,i.name);if(i.isDirectory()){let r=await this.listFilesRecursive(n);t.push(...r)}else t.push(n)}return t}async putBucketPolicy(e,t){let{accessKeyId:s,secretAccessKey:i,sessionToken:n}=this.getCredentials(),r=this.s3BaseHost(),o=typeof t==="string"?t:JSON.stringify(t),a=new Date,l=a.toISOString().replace(/[:-]|\.\d{3}/g,""),d=a.toISOString().slice(0,10).replace(/-/g,""),y=c.createHash("sha256").update(o).digest("hex"),u="/"+e,h="policy=",m={host:r,"x-amz-date":l,"x-amz-content-sha256":y,"content-type":"application/json"};if(n)m["x-amz-security-token"]=n;let b=Object.keys(m).sort().map((k)=>`${k.toLowerCase()}:${m[k].trim()}
|
|
16
16
|
`).join(""),S=Object.keys(m).sort().map((k)=>k.toLowerCase()).join(";"),f=["PUT",u,"policy=",b,S,y].join(`
|
|
17
17
|
`),x="AWS4-HMAC-SHA256",C=`${d}/${this.region}/s3/aws4_request`,w=[x,l,C,c.createHash("sha256").update(f).digest("hex")].join(`
|
|
18
|
-
`),T=c.createHmac("sha256","AWS4"+i).update(d).digest(),q=c.createHmac("sha256",T).update(this.region).digest(),I=c.createHmac("sha256",q).update("s3").digest(),
|
|
18
|
+
`),T=c.createHmac("sha256","AWS4"+i).update(d).digest(),q=c.createHmac("sha256",T).update(this.region).digest(),I=c.createHmac("sha256",q).update("s3").digest(),R=c.createHmac("sha256",I).update("aws4_request").digest(),H=c.createHmac("sha256",R).update(w).digest("hex"),E=`${x} Credential=${s}/${C}, SignedHeaders=${S}, Signature=${H}`,v=`${this.endpointProtocol}://${r}${u}?policy=`,A=await fetch(v,{method:"PUT",headers:{...m,Authorization:E},body:o});if(!A.ok){let k=await A.text();throw Error(`Failed to put bucket policy: ${A.status} ${k}`)}}async getBucketPolicy(e){let{accessKeyId:t,secretAccessKey:s,sessionToken:i}=this.getCredentials(),n=this.s3BaseHost(),r=new Date,o=r.toISOString().replace(/[:-]|\.\d{3}/g,""),a=r.toISOString().slice(0,10).replace(/-/g,""),l=c.createHash("sha256").update("").digest("hex"),d="/"+e,y="policy=",u={host:n,"x-amz-date":o,"x-amz-content-sha256":l};if(i)u["x-amz-security-token"]=i;let h=Object.keys(u).sort().map((A)=>`${A.toLowerCase()}:${u[A].trim()}
|
|
19
19
|
`).join(""),m=Object.keys(u).sort().map((A)=>A.toLowerCase()).join(";"),b=["GET",d,"policy=",h,m,l].join(`
|
|
20
20
|
`),S="AWS4-HMAC-SHA256",f=`${a}/${this.region}/s3/aws4_request`,x=[S,o,f,c.createHash("sha256").update(b).digest("hex")].join(`
|
|
21
|
-
`),C=c.createHmac("sha256","AWS4"+s).update(a).digest(),w=c.createHmac("sha256",C).update(this.region).digest(),T=c.createHmac("sha256",w).update("s3").digest(),q=c.createHmac("sha256",T).update("aws4_request").digest(),I=c.createHmac("sha256",q).update(x).digest("hex"),
|
|
21
|
+
`),C=c.createHmac("sha256","AWS4"+s).update(a).digest(),w=c.createHmac("sha256",C).update(this.region).digest(),T=c.createHmac("sha256",w).update("s3").digest(),q=c.createHmac("sha256",T).update("aws4_request").digest(),I=c.createHmac("sha256",q).update(x).digest("hex"),R=`${S} Credential=${t}/${f}, SignedHeaders=${m}, Signature=${I}`,H=`${this.endpointProtocol}://${n}${d}?policy=`,E=await fetch(H,{method:"GET",headers:{...u,Authorization:R}});if(E.status===404)return null;if(!E.ok){let A=await E.text();throw Error(`Failed to get bucket policy: ${E.status} ${A}`)}let v=await E.text();return JSON.parse(v)}async deleteBucketPolicy(e){await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${e}`,queryParams:{policy:""}})}async headBucket(e){try{return{exists:!0,region:(await this.client.request({service:"s3",region:this.region,method:"HEAD",path:`/${e}`,returnHeaders:!0}))?.headers?.["x-amz-bucket-region"]}}catch(t){if(t.statusCode===404)return{exists:!1};throw t}}async headObject(e,t){try{let s=await this.client.request({service:"s3",region:this.region,method:"HEAD",path:`/${e}/${t.split("/").map((i)=>encodeURIComponent(i)).join("/")}`,returnHeaders:!0});return{ContentLength:s?.headers?.["content-length"]?parseInt(s.headers["content-length"]):void 0,ContentType:s?.headers?.["content-type"],ETag:s?.headers?.etag,LastModified:s?.headers?.["last-modified"]}}catch(s){if(s.statusCode===404)return null;throw s}}async getObjectBuffer(e,t){let s=await this.getObjectBytes(e,t);return Buffer.from(s.body)}async getObjectJson(e,t){let s=await this.getObject(e,t);return JSON.parse(s)}async putObjectJson(e,t,s,i){await this.putObject({bucket:e,key:t,body:JSON.stringify(s),contentType:"application/json",...i})}async getBucketVersioning(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{versioning:""}});return{Status:(t?.VersioningConfiguration??t)?.Status}}async putBucketVersioning(e,t){let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
22
22
|
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
23
23
|
<Status>${t}</Status>
|
|
24
24
|
</VersioningConfiguration>`;await this.client.request({service:"s3",region:this.region,method:"PUT",path:`/${e}`,queryParams:{versioning:""},headers:{"Content-Type":"application/xml"},body:s})}async getBucketLifecycleConfiguration(e){try{let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${e}`,queryParams:{lifecycle:""}});return j(t,"LifecycleConfiguration")}catch(t){if(t.statusCode===404)return null;throw t}}async putBucketLifecycleConfiguration(e,t){let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -64,10 +64,10 @@ import{Mi,p}from"./chunk-kwfbth5c.js";import{Hr}from"./chunk-j9yq3b4d.js";import
|
|
|
64
64
|
host:${o}
|
|
65
65
|
`,"content-type;host","UNSIGNED-PAYLOAD"].join(`
|
|
66
66
|
`),S=["AWS4-HMAC-SHA256",l,y,c.createHash("sha256").update(b).digest("hex")].join(`
|
|
67
|
-
`),f=c.createHmac("sha256",`AWS4${r}`).update(d).digest(),x=c.createHmac("sha256",f).update(this.region).digest(),C=c.createHmac("sha256",x).update("s3").digest(),w=c.createHmac("sha256",C).update("aws4_request").digest(),T=c.createHmac("sha256",w).update(S).digest("hex");return m.append("X-Amz-Signature",T),`${this.endpointProtocol}://${o}${this.objectPath(e,h)}?${m.toString()}`}async createMultipartUpload(e,t,s){let i={};if(s?.contentType)i["Content-Type"]=s.contentType;if(s?.metadata)for(let[a,l]of Object.entries(s.metadata))i[`x-amz-meta-${a}`]=l;let n=t.split("/").map((a)=>encodeURIComponent(a)).join("/"),r=await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${n}`,bucket:e,queryParams:{uploads:""},headers:i});return{UploadId:(r?.InitiateMultipartUploadResult??r)?.UploadId}}async uploadPart(e,t,s,i,n){let{accessKeyId:r,secretAccessKey:o,sessionToken:a}=this.getCredentials(),l=this.s3VirtualHost(e),d=t.split("/").map((
|
|
68
|
-
`).join(""),C=Object.keys(f).sort().map((
|
|
67
|
+
`),f=c.createHmac("sha256",`AWS4${r}`).update(d).digest(),x=c.createHmac("sha256",f).update(this.region).digest(),C=c.createHmac("sha256",x).update("s3").digest(),w=c.createHmac("sha256",C).update("aws4_request").digest(),T=c.createHmac("sha256",w).update(S).digest("hex");return m.append("X-Amz-Signature",T),`${this.endpointProtocol}://${o}${this.objectPath(e,h)}?${m.toString()}`}async createMultipartUpload(e,t,s){let i={};if(s?.contentType)i["Content-Type"]=s.contentType;if(s?.metadata)for(let[a,l]of Object.entries(s.metadata))i[`x-amz-meta-${a}`]=l;let n=t.split("/").map((a)=>encodeURIComponent(a)).join("/"),r=await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${n}`,bucket:e,queryParams:{uploads:""},headers:i});return{UploadId:(r?.InitiateMultipartUploadResult??r)?.UploadId}}async uploadPart(e,t,s,i,n){let{accessKeyId:r,secretAccessKey:o,sessionToken:a}=this.getCredentials(),l=this.s3VirtualHost(e),d=t.split("/").map((K)=>encodeURIComponent(K)).join("/"),y=this.objectPath(e,d),u=`${this.objectUrl(e,d)}?partNumber=${i}&uploadId=${encodeURIComponent(s)}`,h=new Date,m=h.toISOString().replace(/[:-]|\.\d{3}/g,""),b=h.toISOString().slice(0,10).replace(/-/g,""),S=c.createHash("sha256").update(n).digest("hex"),f={host:l,"x-amz-date":m,"x-amz-content-sha256":S};if(a)f["x-amz-security-token"]=a;let x=Object.keys(f).sort().map((K)=>`${K.toLowerCase()}:${f[K].trim()}
|
|
68
|
+
`).join(""),C=Object.keys(f).sort().map((K)=>K.toLowerCase()).join(";"),w=["PUT",y,`partNumber=${i}&uploadId=${encodeURIComponent(s)}`,x,C,S].join(`
|
|
69
69
|
`),T="AWS4-HMAC-SHA256",q=`${b}/${this.region}/s3/aws4_request`,I=[T,m,q,c.createHash("sha256").update(w).digest("hex")].join(`
|
|
70
|
-
`),
|
|
70
|
+
`),R=c.createHmac("sha256",`AWS4${o}`).update(b).digest(),H=c.createHmac("sha256",R).update(this.region).digest(),E=c.createHmac("sha256",H).update("s3").digest(),v=c.createHmac("sha256",E).update("aws4_request").digest(),A=c.createHmac("sha256",v).update(I).digest("hex"),k=`${T} Credential=${r}/${q}, SignedHeaders=${C}, Signature=${A}`,P=await fetch(u,{method:"PUT",headers:{...f,Authorization:k},body:U(n)});if(!P.ok){let K=await P.text();throw Error(`Upload part failed: ${P.status} ${K}`)}return{ETag:P.headers.get("etag")||""}}async completeMultipartUpload(e,t,s,i){let n=t.split("/").map((a)=>encodeURIComponent(a)).join("/"),o=`<?xml version="1.0" encoding="UTF-8"?>
|
|
71
71
|
<CompleteMultipartUpload>${i.sort((a,l)=>a.PartNumber-l.PartNumber).map((a)=>`<Part><PartNumber>${a.PartNumber}</PartNumber><ETag>${a.ETag}</ETag></Part>`).join("")}</CompleteMultipartUpload>`;await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${n}`,bucket:e,queryParams:{uploadId:s},headers:{"Content-Type":"application/xml"},body:o})}async abortMultipartUpload(e,t,s){let i=t.split("/").map((n)=>encodeURIComponent(n)).join("/");await this.client.request({service:"s3",region:this.region,method:"DELETE",path:`/${i}`,bucket:e,queryParams:{uploadId:s}})}async listMultipartUploads(e){let t=await this.client.request({service:"s3",region:this.region,method:"GET",path:"/",bucket:e,queryParams:{uploads:""}}),s=(t?.ListMultipartUploadsResult??t)?.Upload;if(!s)return[];return(Array.isArray(s)?s:[s]).map((n)=>({Key:n.Key,UploadId:n.UploadId,Initiated:n.Initiated}))}async restoreObject(e,t,s,i="Standard"){let n=`<?xml version="1.0" encoding="UTF-8"?>
|
|
72
72
|
<RestoreRequest>
|
|
73
73
|
<Days>${s}</Days>
|
|
@@ -80,10 +80,10 @@ host:${o}
|
|
|
80
80
|
<ExpressionType>SQL</ExpressionType>
|
|
81
81
|
<InputSerialization>${r}</InputSerialization>
|
|
82
82
|
<OutputSerialization>${o}</OutputSerialization>
|
|
83
|
-
</SelectObjectContentRequest>`;return await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${e}/${t}`,queryParams:{select:"","select-type":"2"},headers:{"Content-Type":"application/xml"},body:a,rawResponse:!0})}async getSignedUrl(e){let{bucket:t,key:s,expiresIn:i=3600,operation:n="getObject"}=e,{accessKeyId:r,secretAccessKey:o,sessionToken:a}=this.getCredentials(),l=new Date,d=l.toISOString().replace(/[:-]|\.\d{3}/g,""),y=l.toISOString().slice(0,10).replace(/-/g,""),u=this.s3VirtualHost(t),h=n==="putObject"?"PUT":"GET",m="AWS4-HMAC-SHA256",b=`${y}/${this.region}/s3/aws4_request`,f={"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":`${r}/${b}`,"X-Amz-Date":d,"X-Amz-Expires":i.toString(),"X-Amz-SignedHeaders":"host"};if(a)f["X-Amz-Security-Token"]=a;let C=Object.keys(f).sort().map((
|
|
83
|
+
</SelectObjectContentRequest>`;return await this.client.request({service:"s3",region:this.region,method:"POST",path:`/${e}/${t}`,queryParams:{select:"","select-type":"2"},headers:{"Content-Type":"application/xml"},body:a,rawResponse:!0})}async getSignedUrl(e){let{bucket:t,key:s,expiresIn:i=3600,operation:n="getObject"}=e,{accessKeyId:r,secretAccessKey:o,sessionToken:a}=this.getCredentials(),l=new Date,d=l.toISOString().replace(/[:-]|\.\d{3}/g,""),y=l.toISOString().slice(0,10).replace(/-/g,""),u=this.s3VirtualHost(t),h=n==="putObject"?"PUT":"GET",m="AWS4-HMAC-SHA256",b=`${y}/${this.region}/s3/aws4_request`,f={"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":`${r}/${b}`,"X-Amz-Date":d,"X-Amz-Expires":i.toString(),"X-Amz-SignedHeaders":"host"};if(a)f["X-Amz-Security-Token"]=a;let C=Object.keys(f).sort().map((O)=>`${encodeURIComponent(O)}=${encodeURIComponent(f[O])}`).join("&"),w=s.split("/").map((O)=>encodeURIComponent(O)).join("/"),T=this.objectPath(t,w),q=`host:${u}
|
|
84
84
|
`,H=[h,T,C,q,"host","UNSIGNED-PAYLOAD"].join(`
|
|
85
85
|
`),E=["AWS4-HMAC-SHA256",d,b,c.createHash("sha256").update(H).digest("hex")].join(`
|
|
86
|
-
`),v=c.createHmac("sha256",`AWS4${o}`).update(y).digest(),A=c.createHmac("sha256",v).update(this.region).digest(),k=c.createHmac("sha256",A).update("s3").digest(),P=c.createHmac("sha256",k).update("aws4_request").digest(),
|
|
86
|
+
`),v=c.createHmac("sha256",`AWS4${o}`).update(y).digest(),A=c.createHmac("sha256",v).update(this.region).digest(),k=c.createHmac("sha256",A).update("s3").digest(),P=c.createHmac("sha256",k).update("aws4_request").digest(),K=c.createHmac("sha256",P).update(E).digest("hex");return`${this.endpointProtocol}://${u}${T}?${C}&X-Amz-Signature=${K}`}async listObjects(e){let{bucket:t,prefix:s,delimiter:i,maxKeys:n=1000,continuationToken:r}=e,o={"list-type":"2","max-keys":n.toString()};if(s)o.prefix=s;if(i)o.delimiter=i;if(r)o["continuation-token"]=r;let a=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${t}`,queryParams:o}),l=[],d=a?.ListBucketResult??a;if(d?.Contents){let u=Array.isArray(d.Contents)?d.Contents:[d.Contents];for(let h of u)l.push({Key:String(h.Key??""),LastModified:h.LastModified||"",Size:Number.parseInt(h.Size||"0"),ETag:h.ETag})}let y=[];if(d?.CommonPrefixes){let u=Array.isArray(d.CommonPrefixes)?d.CommonPrefixes:[d.CommonPrefixes];for(let h of u)if(h?.Prefix!==void 0&&h.Prefix!=="")y.push(String(h.Prefix))}return{objects:l,commonPrefixes:y,nextContinuationToken:d?.NextContinuationToken}}async emptyBucket(e){let t=0,s=await this.listAllObjects({bucket:e});if(s.length>0)for(let i=0;i<s.length;i+=1000){let r=s.slice(i,i+1000).map((o)=>o.Key);await this.deleteObjects(e,r),t+=r.length}try{let i,n;do{let r=await this.listObjectVersions({bucket:e,keyMarker:i,versionIdMarker:n,maxKeys:1000}),o=[];if(r.versions)for(let a of r.versions)o.push({Key:a.Key,VersionId:a.VersionId});if(r.deleteMarkers)for(let a of r.deleteMarkers)o.push({Key:a.Key,VersionId:a.VersionId});if(o.length>0)await this.deleteObjectVersions(e,o),t+=o.length;i=r.nextKeyMarker,n=r.nextVersionIdMarker}while(i)}catch{}return{deletedCount:t}}async listObjectVersions(e){let{bucket:t,prefix:s,keyMarker:i,versionIdMarker:n,maxKeys:r=1000}=e,o={versions:"","max-keys":r.toString()};if(s)o.prefix=s;if(i)o["key-marker"]=i;if(n)o["version-id-marker"]=n;let a=await this.client.request({service:"s3",region:this.region,method:"GET",path:`/${t}`,queryParams:o}),l=[],d=[];if(a.Version){let y=Array.isArray(a.Version)?a.Version:[a.Version];for(let u of y)l.push({Key:u.Key,VersionId:u.VersionId,IsLatest:u.IsLatest==="true"})}if(a.DeleteMarker){let y=Array.isArray(a.DeleteMarker)?a.DeleteMarker:[a.DeleteMarker];for(let u of y)d.push({Key:u.Key,VersionId:u.VersionId,IsLatest:u.IsLatest==="true"})}return{versions:l,deleteMarkers:d,nextKeyMarker:a.NextKeyMarker,nextVersionIdMarker:a.NextVersionIdMarker}}async deleteObjectVersions(e,t){let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
87
87
|
<Delete>
|
|
88
88
|
<Quiet>true</Quiet>
|
|
89
89
|
${t.map((n)=>`<Object><Key>${n.Key}</Key>${n.VersionId?`<VersionId>${n.VersionId}</VersionId>`:""}</Object>`).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ns,
|
|
1
|
+
import{ns,Dn,Za,kn,os,ss}from"./chunk-v5js5pz6.js";import{e}from"./chunk-qka0e661.js";import{Ct}from"./chunk-8escxm7h.js";import{execFileSync as C}from"node:child_process";import{mkdirSync as w,mkdtempSync as I,rmSync as U,writeFileSync as g}from"node:fs";import{tmpdir as j}from"node:os";import{dirname as O,join as o}from"node:path";function E(s,t){for(let r of t){let d=o(s,r.name);w(O(d),{recursive:!0}),g(d,r.data,r.mode?{mode:r.mode}:void 0)}}async function Vp(s){let{app:t,projectRoot:r,region:d,repository:u}=s,x=t.architecture??"x86_64",R=x==="arm64"?"linux/arm64":"linux/amd64",b=t.kind==="php",n=s.onStep??(()=>{}),a=I(o(j(),"tscloud-img-"));try{let h=o(a,"app");w(h,{recursive:!0});let f,y;if(b){os({projectRoot:r,app:t,skipBuild:s.skipBuild,onStep:n}),n("staging application tree");let i=ss(r);E(h,i),E(o(a,"runtime"),kn().map((c)=>({name:c.path,data:c.contents,mode:c.mode})));let v=t.handlers?.http??"public/index.php";f={http:v,queue:t.handlers?.queue??v,cli:t.handlers?.cli??v},y=ns(i.map((c)=>`${c.name}:${c.data.length}`).join("|"))}else{n("bundling application");let i=await Dn({projectRoot:r,app:t,skipBuild:s.skipBuild,onStep:n});g(o(h,"index.mjs"),i.bundle),f=i.handlers,y=i.sha256}let B=y.slice(0,16);g(o(a,"Dockerfile"),Za({kind:t.kind??"node",phpVersion:t.phpVersion,architecture:x}));let k=new Ct(d),p;try{p=(await k.describeRepositories({repositoryNames:[u]})).repositories?.[0]?.repositoryUri??""}catch{p=""}if(!p)n(`creating ECR repository ${u}`),p=(await k.createRepository({repositoryName:u,imageScanningConfiguration:{scanOnPush:!0}})).repository?.repositoryUri??"";if(!p)throw Error(`could not resolve ECR repository URI for ${u}`);let l=`${p}:${B}`;n("docker build"),C("docker",["build","--platform",R,"--provenance=false","--sbom=false","-t",l,a],{stdio:"inherit"}),n("ecr auth + push");let m=(await k.getAuthorizationToken()).authorizationData?.[0];if(!m?.authorizationToken||!m.proxyEndpoint)throw Error("failed to get an ECR authorization token");let A=m.proxyEndpoint.replace(/^https?:\/\//,""),S=o(a,".docker");return w(S,{recursive:!0}),g(o(S,"config.json"),JSON.stringify({auths:{[A]:{auth:m.authorizationToken}}})),C("docker",["push",l],{stdio:"inherit",env:{...process.env,DOCKER_CONFIG:S}}),e(`Image: ${l}`),{imageUri:l,tag:B,handlers:f}}finally{U(a,{recursive:!0,force:!0})}}
|
|
2
2
|
export{Vp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Xp,
|
|
1
|
+
import{Xp,mn,fo,ae,Qp,Ic,Nd,Ts,Yp,Zp,em,Pc,ho,Es,Dc,gn,wr,tm,Ai,rm,kc,xd,_d,ws,Nc,xc,Ar,yo,Rr,_c,As,Ri,Od,bo,Oc,$c,So,$d,Lc,Mc,Uc,Fc,Rs,Ld,Md,nm,Ud,Bc,vo,Fd,Bd,Is,jt,Ps,Ds,ks,jc,jd,Vc,Ns,im,vt,om,zc,Vt,Hc,sm,Gc,Vd,am,ee,zd,xs,cm,Co,Ii,Pi,_s,Hd,Gd,lm,Os,$s}from"./chunk-5gf0je0v.js";import"./chunk-55j0x82p.js";import"./chunk-v5js5pz6.js";import"./chunk-mjbd4pbz.js";export{Is as AnomalyConfigStore,Hd as AwsSpendTransport,Gd as ComputeSpendTransport,ws as CounterTracker,kc as DEFAULT_METER_MAPPINGS,Pc as DEFAULT_PRICE_BOOK,yo as DEFAULT_THRESHOLDS,jt as DETECTABLE_SIGNALS,fo as ENFORCEMENT_ACTIONS,So as ENFORCEMENT_DESCRIPTIONS,ae as ENFORCEMENT_SEVERITY,jd as FOCUS_VERSION,mn as METERS,Xp as METER_KEYS,Qp as MICRO_CENTS,Od as MIN_PROJECTION_CONFIDENCE,Vd as RecordingSpendTransport,Fd as SENSITIVITY_THRESHOLDS,Pi as SPEND_CYCLE_SECONDS,zc as SPEND_GATE_SETTING,cm as SPEND_LEASE_SETTING,Ds as SignalSource,Hc as SpendCapError,Vt as SpendGate,Co as SpendLoopLease,xs as SpendNotificationRouter,Ii as SpendRunner,vt as SpendService,Rr as SpendStore,am as URGENT_SPEND_EVENTS,$d as USER_VISIBLE_ACTIONS,xc as aggregateDeltas,vo as anomalyOptionsForSignal,sm as assertSpendAllows,wr as budgetWindow,lm as compositeSpendTransport,Gc as createEnforcementHandlers,Ud as detectAnomalies,Bc as detectLatestAnomaly,Oc as evaluateBudget,nm as ewma,xd as findMapping,Nd as findPriceEntry,ee as formatCents,Ri as formatTimeToExhaustion,bo as governingLimitCents,Os as handleSpendRequest,Ai as hourBucket,rm as hourBucketsBetween,Fc as isOperationAllowed,ho as isValidTimeZone,jc as lookbackHoursForSignal,Rs as median,Ld as medianAbsoluteDeviation,$c as mergeDecisions,em as mergePriceBooks,Nc as meterTelemetry,ks as optionsForSignal,As as percentOfLimit,Lc as planEnforcement,tm as previousBudgetWindow,Ts as priceUsage,Yp as priceUsageLines,_c as projectSpend,Md as robustZScore,Zp as roundCents,Bd as routeMatches,Mc as runEnforcement,Ar as scopeKey,Ps as signalDefinition,zd as spendNotificationText,$s as spendOpenApiPaths,_s as startSpendLoop,im as streamFocusJsonl,Uc as strongestActiveAction,Ic as tieredMicroCents,Ns as toFocusJsonl,Vc as toFocusRecords,_d as usageDeltaKey,gn as utcInstantOfLocal,om as zeroFill,Dc as zoneOffsetMs,Es as zonedParts};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p}from"./chunk-
|
|
1
|
+
import{p}from"./chunk-b0r8a5h5.js";class mt{client;region;constructor(t="us-east-1",e){this.region=t,this.client=new p(void 0,{profile:e})}async getCallerIdentity(){let t=await this.client.request({service:"sts",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"Action=GetCallerIdentity&Version=2011-06-15"});if(typeof t==="string"){let n=t.match(/<Account>(\d+)<\/Account>/),r=t.match(/<UserId>([^<]+)<\/UserId>/),i=t.match(/<Arn>([^<]+)<\/Arn>/);return{Account:n?.[1],UserId:r?.[1],Arn:i?.[1]}}let e=t?.GetCallerIdentityResponse?.GetCallerIdentityResult||t?.GetCallerIdentityResult;if(e)return{Account:String(e.Account),UserId:e.UserId,Arn:e.Arn};if(t?.Account)return{Account:String(t.Account),UserId:t.UserId,Arn:t.Arn};return{Account:void 0,UserId:void 0,Arn:void 0}}}
|
|
2
2
|
export{mt};
|