@stacksjs/buddy 0.67.0 → 0.68.0
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/add.d.ts +4 -0
- package/dist/build.d.ts +4 -0
- package/dist/changelog.d.ts +3 -0
- package/dist/chunk-06g79v9j.js +2 -0
- package/dist/chunk-08bm2xax.js +2 -0
- package/dist/chunk-0enrsn65.js +978 -0
- package/dist/{chunk-ncwfzcsm.js → chunk-0m218zhk.js} +1 -1
- package/dist/chunk-0q0jn0kk.js +6 -0
- package/dist/chunk-0yyhz107.js +2 -0
- package/dist/{chunk-cbtnhpqk.js → chunk-11vhe2za.js} +1 -1
- package/dist/chunk-13143jmy.js +3 -0
- package/dist/chunk-1agj4qty.js +2 -0
- package/dist/chunk-1c4yywmn.js +9 -0
- package/dist/chunk-1e2f0z80.js +2 -0
- package/dist/{chunk-564c63vr.js → chunk-1v13dkfw.js} +1 -1
- package/dist/chunk-20e0mpcw.js +9 -0
- package/dist/{chunk-we57sm1m.js → chunk-25nxsybw.js} +2 -2
- package/dist/chunk-27ksm11g.js +2 -0
- package/dist/{chunk-y2g00ayp.js → chunk-2mhj5ght.js} +1 -1
- package/dist/chunk-2wrs9p57.js +1 -0
- package/dist/chunk-2yj4j69j.js +2 -0
- package/dist/{chunk-pfb4369d.js → chunk-2ymn50ck.js} +1 -1
- package/dist/chunk-3vjfkr7v.js +978 -0
- package/dist/{chunk-3whxjf1k.js → chunk-3wpw5xgd.js} +1 -1
- package/dist/chunk-3y0gapf6.js +2 -0
- package/dist/chunk-4rb5r88h.js +978 -0
- package/dist/chunk-4wb68jfr.js +2 -0
- package/dist/chunk-5ewcj9vd.js +2 -0
- package/dist/chunk-5fm9mfqs.js +2 -0
- package/dist/chunk-5jhkn5by.js +2 -0
- package/dist/chunk-5m9xts4v.js +2 -0
- package/dist/chunk-6sqy7049.js +2 -0
- package/dist/chunk-6yazdvb4.js +2 -0
- package/dist/{chunk-wps8bq6b.js → chunk-746p83dw.js} +1 -1
- package/dist/chunk-76g7tr80.js +2 -0
- package/dist/chunk-7fz1p8p3.js +10 -0
- package/dist/chunk-814adsn3.js +2 -0
- package/dist/chunk-831wk0b3.js +2 -0
- package/dist/chunk-833tanrb.js +2 -0
- package/dist/{chunk-6cscdnf5.js → chunk-8cx90pvv.js} +1 -1
- package/dist/{chunk-5wxk7vka.js → chunk-8gx9at51.js} +1 -1
- package/dist/chunk-91pnyybg.js +9 -0
- package/dist/chunk-99syj1p0.js +2 -0
- package/dist/chunk-9bxh78vd.js +5 -0
- package/dist/chunk-9jaqey2q.js +2 -0
- package/dist/chunk-9tyaew40.js +2 -0
- package/dist/chunk-9zcyq5gh.js +2 -0
- package/dist/chunk-a4g1e1n0.js +2 -0
- package/dist/chunk-a6g2jk1y.js +2 -0
- package/dist/chunk-aaqd43t5.js +2 -0
- package/dist/chunk-adswb3gq.js +2 -0
- package/dist/chunk-atnw2cq3.js +2 -0
- package/dist/chunk-avdharmq.js +2 -0
- package/dist/chunk-b13gbfg3.js +2 -0
- package/dist/{chunk-ycyg22fp.js → chunk-b3wr7cpk.js} +2 -2
- package/dist/chunk-bngyck4v.js +2 -0
- package/dist/chunk-brb5zthb.js +1 -0
- package/dist/chunk-bx2vf8g7.js +5 -0
- package/dist/chunk-c343n0yt.js +2 -0
- package/dist/{chunk-jfs19hhz.js → chunk-cdwpqzrw.js} +1 -1
- package/dist/chunk-cm7bwdk9.js +2 -0
- package/dist/chunk-cs5k02gt.js +1 -0
- package/dist/chunk-cv8f2v27.js +2 -0
- package/dist/chunk-d2dbhn2h.js +2 -0
- package/dist/{chunk-hgzxtrgw.js → chunk-d3awsfqm.js} +2 -2
- package/dist/chunk-d9q17hb8.js +2 -0
- package/dist/chunk-dw62d69f.js +2 -0
- package/dist/chunk-e8p8v7ca.js +978 -0
- package/dist/chunk-ehhrhkwe.js +9 -0
- package/dist/chunk-enhf12a1.js +2 -0
- package/dist/chunk-f0ksrase.js +8 -0
- package/dist/chunk-f2d9w3nr.js +2 -0
- package/dist/chunk-f3y73e4b.js +6 -0
- package/dist/chunk-fe3xb8z9.js +2 -0
- package/dist/chunk-fg5gh4dn.js +2 -0
- package/dist/chunk-fh4rw8kr.js +5 -0
- package/dist/chunk-fxsv4p5c.js +8 -0
- package/dist/chunk-gg80s18j.js +2 -0
- package/dist/chunk-h5saw32v.js +2 -0
- package/dist/chunk-ha75r57f.js +8 -0
- package/dist/chunk-hgrs6wcy.js +2 -0
- package/dist/chunk-hrsat16n.js +8 -0
- package/dist/chunk-hxy5t7tm.js +10 -0
- package/dist/chunk-hzfqtj82.js +2 -0
- package/dist/chunk-j2n86dsz.js +2 -0
- package/dist/chunk-jg68fsnk.js +10 -0
- package/dist/chunk-jhvjhf1j.js +2 -0
- package/dist/chunk-jr4naxsv.js +2 -0
- package/dist/chunk-jtax0mpm.js +2 -0
- package/dist/chunk-k59kbbvm.js +2 -0
- package/dist/chunk-kanz993c.js +2 -0
- package/dist/chunk-kg9abatp.js +2 -0
- package/dist/chunk-kvghsjg7.js +5 -0
- package/dist/chunk-ky8p46ae.js +5 -0
- package/dist/chunk-kzm498bh.js +2 -0
- package/dist/chunk-m4gwjnfh.js +6 -0
- package/dist/chunk-msv6dcc2.js +2 -0
- package/dist/chunk-mxdajhb4.js +10 -0
- package/dist/chunk-mxzjn2gs.js +978 -0
- package/dist/chunk-n1bqkqk7.js +10 -0
- package/dist/chunk-njtyervf.js +1 -0
- package/dist/chunk-nx1598yr.js +2 -0
- package/dist/chunk-p18kqenr.js +1 -0
- package/dist/chunk-p23aswbf.js +2 -0
- package/dist/chunk-p55ntqj0.js +2 -0
- package/dist/chunk-p5va3trj.js +2 -0
- package/dist/chunk-p88bsqtc.js +10 -0
- package/dist/chunk-p9z7f8c8.js +2 -0
- package/dist/chunk-ppkzf21q.js +8 -0
- package/dist/chunk-prqq5zw2.js +2 -0
- package/dist/chunk-pv6hp18q.js +10 -0
- package/dist/chunk-q9ycfthp.js +2 -0
- package/dist/chunk-qhcx6dmf.js +2 -0
- package/dist/chunk-qma4ysd8.js +9 -0
- package/dist/chunk-qqp394c2.js +2 -0
- package/dist/chunk-ra5sfgg4.js +2 -0
- package/dist/chunk-rfd43z7p.js +5 -0
- package/dist/chunk-s2n3hw0a.js +2 -0
- package/dist/chunk-sm7vvfqf.js +2 -0
- package/dist/chunk-sqbdav33.js +2 -0
- package/dist/chunk-sy4d4hnx.js +2 -0
- package/dist/chunk-t0b356bb.js +978 -0
- package/dist/chunk-t9wdnzz4.js +6 -0
- package/dist/chunk-v25g7h01.js +2 -0
- package/dist/chunk-v7zy7xda.js +1 -0
- package/dist/chunk-vg4vfkzk.js +6 -0
- package/dist/chunk-vgcre8jy.js +2 -0
- package/dist/chunk-vqyngnj0.js +9 -0
- package/dist/chunk-w17d2rbd.js +6 -0
- package/dist/chunk-x22v9kvb.js +2 -0
- package/dist/chunk-xacjs4ar.js +6 -0
- package/dist/chunk-xmdbxa8w.js +1 -0
- package/dist/chunk-xy6hjazn.js +978 -0
- package/dist/chunk-y0m35t3m.js +2 -0
- package/dist/chunk-y1tre8v8.js +8 -0
- package/dist/chunk-y50mc7dt.js +2 -0
- package/dist/chunk-y93ke5m6.js +2 -0
- package/dist/chunk-yktee4wv.js +1 -0
- package/dist/chunk-yvmyw2r2.js +2 -0
- package/dist/chunk-z1h35hsa.js +2 -0
- package/dist/chunk-z6xydw90.js +2 -0
- package/dist/chunk-zak32nab.js +2 -0
- package/dist/clean.d.ts +3 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +1 -1
- package/dist/cloud.d.ts +3 -0
- package/dist/commit.d.ts +3 -0
- package/dist/configure.d.ts +4 -0
- package/dist/create.d.ts +8 -0
- package/dist/custom-cli.d.ts +1 -1
- package/dist/deploy.d.ts +7 -0
- package/dist/{commands/dev.d.ts → dev.d.ts} +3 -1
- package/dist/dns.d.ts +18 -0
- package/dist/domains.d.ts +3 -0
- package/dist/fresh.d.ts +3 -0
- package/dist/generate.d.ts +3 -0
- package/dist/http.d.ts +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/install.d.ts +3 -0
- package/dist/key.d.ts +3 -0
- package/dist/lint.d.ts +3 -0
- package/dist/list.d.ts +3 -0
- package/dist/make.d.ts +1 -0
- package/dist/migrate.d.ts +3 -0
- package/dist/outdated.d.ts +3 -0
- package/dist/ports.d.ts +7 -0
- package/dist/prepublish.d.ts +3 -0
- package/dist/projects.d.ts +3 -0
- package/dist/release.d.ts +9 -0
- package/dist/route.d.ts +3 -0
- package/dist/saas.d.ts +3 -0
- package/dist/seed.d.ts +3 -0
- package/dist/setup.d.ts +8 -0
- package/dist/stacks +0 -0
- package/dist/test.d.ts +3 -0
- package/dist/tinker.d.ts +3 -0
- package/dist/types.d.ts +3 -0
- package/dist/upgrade.d.ts +4 -0
- package/dist/version.d.ts +3 -0
- package/package.json +1 -1
- package/dist/chunk-42swmjjw.js +0 -2
- package/dist/chunk-898dh3kh.js +0 -8
- package/dist/chunk-9g2p5d3j.js +0 -2
- package/dist/chunk-bpa4071y.js +0 -2
- package/dist/chunk-f18wwa85.js +0 -827
- package/dist/chunk-g767h9jq.js +0 -3
- package/dist/chunk-hqv9y9k2.js +0 -6
- package/dist/chunk-sgm5999j.js +0 -12
- package/dist/commands/add.d.ts +0 -2
- package/dist/commands/build.d.ts +0 -2
- package/dist/commands/changelog.d.ts +0 -2
- package/dist/commands/clean.d.ts +0 -2
- package/dist/commands/cloud.d.ts +0 -2
- package/dist/commands/commit.d.ts +0 -2
- package/dist/commands/configure.d.ts +0 -2
- package/dist/commands/create.d.ts +0 -2
- package/dist/commands/deploy.d.ts +0 -2
- package/dist/commands/dns.d.ts +0 -2
- package/dist/commands/domains.d.ts +0 -2
- package/dist/commands/fresh.d.ts +0 -2
- package/dist/commands/generate.d.ts +0 -2
- package/dist/commands/http.d.ts +0 -2
- package/dist/commands/index.d.ts +0 -33
- package/dist/commands/install.d.ts +0 -2
- package/dist/commands/key.d.ts +0 -2
- package/dist/commands/lint.d.ts +0 -2
- package/dist/commands/list.d.ts +0 -2
- package/dist/commands/make.d.ts +0 -2
- package/dist/commands/migrate.d.ts +0 -2
- package/dist/commands/outdated.d.ts +0 -2
- package/dist/commands/ports.d.ts +0 -2
- package/dist/commands/prepublish.d.ts +0 -2
- package/dist/commands/projects.d.ts +0 -2
- package/dist/commands/release.d.ts +0 -2
- package/dist/commands/route.d.ts +0 -2
- package/dist/commands/seed.d.ts +0 -2
- package/dist/commands/setup.d.ts +0 -4
- package/dist/commands/test.d.ts +0 -2
- package/dist/commands/tinker.d.ts +0 -2
- package/dist/commands/types.d.ts +0 -2
- package/dist/commands/upgrade.d.ts +0 -2
- package/dist/commands/version.d.ts +0 -2
package/dist/chunk-g767h9jq.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{ob as L}from"./chunk-we57sm1m.js";import{zb as F}from"./chunk-ncwfzcsm.js";var T=(e,t)=>{let r=[];if(e)r.push(e);if(t)for(let n of t)r.push(n);return r},b=(e,t)=>{return`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},C=()=>{let e=[],t=[],r=!1,n=new Set,o=(c)=>c.sort((f,u)=>G[u.step]-G[f.step]||K[u.priority||"normal"]-K[f.priority||"normal"]),s=(c)=>{let f=!1,u=(m)=>{let g=T(m.name,m.aliases);if(g.includes(c)){f=!0;for(let l of g)n.delete(l);return!1}return!0};return e=e.filter(u),t=t.filter(u),f},a=(c)=>{let f=!1,u=(m)=>{if(m.middleware===c){f=!0;for(let g of T(m.name,m.aliases))n.delete(g);return!1}return!0};return e=e.filter(u),t=t.filter(u),f},i=(c)=>{return e.forEach((f)=>{c.add(f.middleware,{...f})}),t.forEach((f)=>{c.addRelativeTo(f.middleware,{...f})}),c.identifyOnResolve?.(x.identifyOnResolve()),c},p=(c)=>{let f=[];return c.before.forEach((u)=>{if(u.before.length===0&&u.after.length===0)f.push(u);else f.push(...p(u))}),f.push(c),c.after.reverse().forEach((u)=>{if(u.before.length===0&&u.after.length===0)f.push(u);else f.push(...p(u))}),f},y=(c=!1)=>{let f=[],u=[],m={};return e.forEach((l)=>{let h={...l,before:[],after:[]};for(let d of T(h.name,h.aliases))m[d]=h;f.push(h)}),t.forEach((l)=>{let h={...l,before:[],after:[]};for(let d of T(h.name,h.aliases))m[d]=h;u.push(h)}),u.forEach((l)=>{if(l.toMiddleware){let h=m[l.toMiddleware];if(h===void 0){if(c)return;throw new Error(`${l.toMiddleware} is not found when adding ${b(l.name,l.aliases)} middleware ${l.relation} ${l.toMiddleware}`)}if(l.relation==="after")h.after.push(l);if(l.relation==="before")h.before.push(l)}}),o(f).map(p).reduce((l,h)=>{return l.push(...h),l},[])},x={add:(c,f={})=>{let{name:u,override:m,aliases:g}=f,l={step:"initialize",priority:"normal",middleware:c,...f},h=T(u,g);if(h.length>0){if(h.some((d)=>n.has(d))){if(!m)throw new Error(`Duplicate middleware name '${b(u,g)}'`);for(let d of h){let w=e.findIndex((A)=>A.name===d||A.aliases?.some((P)=>P===d));if(w===-1)continue;let E=e[w];if(E.step!==l.step||l.priority!==E.priority)throw new Error(`"${b(E.name,E.aliases)}" middleware with ${E.priority} priority in ${E.step} step cannot be overridden by "${b(u,g)}" middleware with ${l.priority} priority in ${l.step} step.`);e.splice(w,1)}}for(let d of h)n.add(d)}e.push(l)},addRelativeTo:(c,f)=>{let{name:u,override:m,aliases:g}=f,l={middleware:c,...f},h=T(u,g);if(h.length>0){if(h.some((d)=>n.has(d))){if(!m)throw new Error(`Duplicate middleware name '${b(u,g)}'`);for(let d of h){let w=t.findIndex((A)=>A.name===d||A.aliases?.some((P)=>P===d));if(w===-1)continue;let E=t[w];if(E.toMiddleware!==l.toMiddleware||E.relation!==l.relation)throw new Error(`"${b(E.name,E.aliases)}" middleware ${E.relation} "${E.toMiddleware}" middleware cannot be overridden by "${b(u,g)}" middleware ${l.relation} "${l.toMiddleware}" middleware.`);t.splice(w,1)}}for(let d of h)n.add(d)}t.push(l)},clone:()=>i(C()),use:(c)=>{c.applyToStack(x)},remove:(c)=>{if(typeof c==="string")return s(c);else return a(c)},removeByTag:(c)=>{let f=!1,u=(m)=>{let{tags:g,name:l,aliases:h}=m;if(g&&g.includes(c)){let d=T(l,h);for(let w of d)n.delete(w);return f=!0,!1}return!0};return e=e.filter(u),t=t.filter(u),f},concat:(c)=>{let f=i(C());return f.use(c),f.identifyOnResolve(r||f.identifyOnResolve()||(c.identifyOnResolve?.()??!1)),f},applyToStack:i,identify:()=>{return y(!0).map((c)=>{let f=c.step??c.relation+" "+c.toMiddleware;return b(c.name,c.aliases)+" - "+f})},identifyOnResolve(c){if(typeof c==="boolean")r=c;return r},resolve:(c,f)=>{for(let u of y().map((m)=>m.middleware).reverse())c=u(c,f);if(r)console.log(x.identify());return c}};return x},G={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},K={high:3,normal:2,low:1};class Oe{constructor(e){this.config=e,this.middlewareStack=C()}send(e,t,r){let n=typeof t!=="function"?t:void 0,o=typeof t==="function"?t:r,s=n===void 0&&this.config.cacheMiddleware===!0,a;if(s){if(!this.handlers)this.handlers=new WeakMap;let i=this.handlers;if(i.has(e.constructor))a=i.get(e.constructor);else a=e.resolveMiddleware(this.middlewareStack,this.config,n),i.set(e.constructor,a)}else delete this.handlers,a=e.resolveMiddleware(this.middlewareStack,this.config,n);if(o)a(e).then((i)=>o(null,i.output),(i)=>o(i)).catch(()=>{});else return a(e).then((i)=>i.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var ee=F(L(),1);class te{constructor(){this.middlewareStack=C()}static classBuilder(){return new re}resolveMiddlewareWithContext(e,t,r,{middlewareFn:n,clientName:o,commandName:s,inputFilterSensitiveLog:a,outputFilterSensitiveLog:i,smithyContext:p,additionalContext:y,CommandCtor:x}){for(let g of n.bind(this)(x,e,t,r))this.middlewareStack.use(g);let c=e.concat(this.middlewareStack),{logger:f}=t,u={logger:f,clientName:o,commandName:s,inputFilterSensitiveLog:a,outputFilterSensitiveLog:i,[ee.SMITHY_CONTEXT_KEY]:{commandInstance:this,...p},...y},{requestHandler:m}=t;return c.resolve((g)=>m.handle(g.request,r||{}),u)}}class re{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(e)=>e,this._outputFilterSensitiveLog=(e)=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,r={}){return this._smithyContext={service:e,operation:t,...r},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=(r)=>r,t=(r)=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){let e=this,t;return t=class extends te{static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super();this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=r??{},e._init(this)}resolveMiddleware(r,n,o){return this.resolveMiddlewareWithContext(r,n,o,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}var Nt=(e)=>{let t=e.httpHandler;return{setHttpHandler(r){t=r},httpHandler(){return t},updateHttpClientConfig(r,n){t.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},Mt=(e)=>{return{httpHandler:e.httpHandler()}};var De=F(L(),1);class O{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let t=new O({...e,headers:{...e.headers}});if(t.query)t.query=He(t.query);return t}static isInstance(e){if(!e)return!1;let t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return O.clone(this)}}function He(e){return Object.keys(e).reduce((t,r)=>{let n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class I{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let t=e;return typeof t.statusCode==="number"&&typeof t.headers==="object"}}var R=(e)=>encodeURIComponent(e).replace(/[!'()*]/g,Be),Be=(e)=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function M(e){let t=[];for(let r of Object.keys(e).sort()){let n=e[r];if(r=R(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)t.push(`${r}=${R(n[o])}`);else{let o=r;if(n||typeof n==="string")o+=`=${R(n)}`;t.push(o)}}return t.join("&")}import{Agent as ae,request as We}from"http";import{Agent as fe,request as je}from"https";var ne=["ECONNRESET","EPIPE","ETIMEDOUT"];var D=(e)=>{let t={};for(let r of Object.keys(e)){let n=e[r];t[r]=Array.isArray(n)?n.join(","):n}return t};var oe=(e,t,r=0)=>{if(!r)return-1;let n=(o)=>{let s=setTimeout(()=>{e.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r-o),a=(i)=>{if(i?.connecting)i.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)};if(e.socket)a(e.socket);else e.on("socket",a)};if(r<2000)return n(0),0;return setTimeout(n.bind(null,1000),1000)};var se=(e,{keepAlive:t,keepAliveMsecs:r},n=3000)=>{if(t!==!0)return-1;let o=()=>{if(e.socket)e.socket.setKeepAlive(t,r||0);else e.on("socket",(s)=>{s.setKeepAlive(t,r||0)})};if(n===0)return o(),0;return setTimeout(o,n)};var ie=(e,t,r=0)=>{let n=(o)=>{e.setTimeout(r-o,()=>{e.destroy(),t(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))})};if(0<r&&r<6000)return n(0),0;return setTimeout(n.bind(null,r===0?0:3000),3000)};import{Readable as ze}from"stream";var ce=1000;async function H(e,t,r=ce){let n=t.headers??{},o=n.Expect||n.expect,s=-1,a=!1;if(o==="100-continue")await Promise.race([new Promise((i)=>{s=Number(setTimeout(i,Math.max(ce,r)))}),new Promise((i)=>{e.on("continue",()=>{clearTimeout(s),i()}),e.on("error",()=>{a=!0,clearTimeout(s),i()})})]);if(!a)ve(e,t.body)}function ve(e,t){if(t instanceof ze){t.pipe(e);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){e.end(t);return}let r=t;if(typeof r==="object"&&r.buffer&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number"){e.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}e.end(Buffer.from(t));return}e.end()}class B{static create(e){if(typeof e?.handle==="function")return e;return new B(e)}static checkSocketUsage(e,t,r=console){let{sockets:n,requests:o,maxSockets:s}=e;if(typeof s!=="number"||s===1/0)return t;let a=15000;if(Date.now()-a<t)return t;if(n&&o)for(let i in n){let p=n[i]?.length??0,y=o[i]?.length??0;if(p>=s&&y>=2*s)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${p} and ${y} additional requests are enqueued.
|
|
2
|
-
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
|
-
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((t,r)=>{if(typeof e==="function")e().then((n)=>{t(this.resolveDefaultConfig(n))}).catch(r);else t(this.resolveDefaultConfig(e))})}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:r,socketTimeout:n,httpAgent:o,httpsAgent:s}=e||{},a=!0,i=50;return{connectionTimeout:r,requestTimeout:t??n,httpAgent:(()=>{if(o instanceof ae||typeof o?.destroy==="function")return o;return new ae({keepAlive:!0,maxSockets:50,...o})})(),httpsAgent:(()=>{if(s instanceof fe||typeof s?.destroy==="function")return s;return new fe({keepAlive:!0,maxSockets:50,...s})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t}={}){if(!this.config)this.config=await this.configProvider;return new Promise((r,n)=>{let o=void 0,s=[],a=async(d)=>{await o,s.forEach(clearTimeout),r(d)},i=async(d)=>{await o,s.forEach(clearTimeout),n(d)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){let d=new Error("Request aborted");d.name="AbortError",i(d);return}let p=e.protocol==="https:",y=p?this.config.httpsAgent:this.config.httpAgent;s.push(setTimeout(()=>{this.socketWarningTimestamp=B.checkSocketUsage(y,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let x=M(e.query||{}),c=void 0;if(e.username!=null||e.password!=null){let d=e.username??"",w=e.password??"";c=`${d}:${w}`}let f=e.path;if(x)f+=`?${x}`;if(e.fragment)f+=`#${e.fragment}`;let u=e.hostname??"";if(u[0]==="["&&u.endsWith("]"))u=e.hostname.slice(1,-1);else u=e.hostname;let m={headers:e.headers,host:u,method:e.method,path:f,port:e.port,agent:y,auth:c},l=(p?je:We)(m,(d)=>{let w=new I({statusCode:d.statusCode||-1,reason:d.statusMessage,headers:D(d.headers),body:d});a({response:w})});if(l.on("error",(d)=>{if(ne.includes(d.code))i(Object.assign(d,{name:"TimeoutError"}));else i(d)}),t){let d=()=>{l.destroy();let w=new Error("Request aborted");w.name="AbortError",i(w)};if(typeof t.addEventListener==="function"){let w=t;w.addEventListener("abort",d,{once:!0}),l.once("close",()=>w.removeEventListener("abort",d))}else t.onabort=d}s.push(oe(l,i,this.config.connectionTimeout)),s.push(ie(l,i,this.config.requestTimeout));let h=m.agent;if(typeof h==="object"&&"keepAlive"in h)s.push(se(l,{keepAlive:h.keepAlive,keepAliveMsecs:h.keepAliveMsecs}));o=H(l,e,this.config.requestTimeout).catch((d)=>{return s.forEach(clearTimeout),n(d)})})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[e]:t}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as qe}from"stream";class z extends qe{constructor(){super(...arguments);this.bufferedBytes=[]}_write(e,t,r){this.bufferedBytes.push(e),r()}}var ue=(e)=>{if(Ve(e))return Je(e);return new Promise((t,r)=>{let n=new z;e.pipe(n),e.on("error",(o)=>{n.end(),r(o)}),n.on("error",r),n.on("finish",function(){let o=new Uint8Array(Buffer.concat(this.bufferedBytes));t(o)})})},Ve=(e)=>typeof ReadableStream==="function"&&e instanceof ReadableStream;async function Je(e){let t=[],r=e.getReader(),n=!1,o=0;while(!n){let{done:i,value:p}=await r.read();if(p)t.push(p),o+=p.length;n=i}let s=new Uint8Array(o),a=0;for(let i of t)s.set(i,a),a+=i.length;return s}var Br="***SensitiveInformation***";var vr=(e,t)=>{for(let r of Object.keys(e)){let n=e[r],o=async function(a,i,p){let y=new n(a);if(typeof i==="function")this.send(y,i);else if(typeof p==="function"){if(typeof i!=="object")throw new Error(`Expected http options but got ${typeof i}`);this.send(y,i||{},p)}else return this.send(y,i)},s=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");t.prototype[s]=o}};class de extends Error{constructor(e){super(e.message);Object.setPrototypeOf(this,de.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}var le=(e,t={})=>{Object.entries(t).filter(([,n])=>n!==void 0).forEach(([n,o])=>{if(e[n]==null||e[n]==="")e[n]=o});let r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e};var he=(e)=>typeof ArrayBuffer==="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]";import{Buffer as v}from"buffer";var $=(e,t=0,r=e.byteLength-t)=>{if(!he(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return v.from(e,t,r)},_=(e,t)=>{if(typeof e!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?v.from(e,t):v.from(e)};var Ye=/^[A-Za-z0-9+/]*={0,2}$/,W=(e)=>{if(e.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Ye.exec(e))throw new TypeError("Invalid base64 string.");let t=_(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};var k=(e)=>{let t=_(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var en=(e)=>{if(typeof e==="string")return k(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)};var j=(e)=>{if(typeof e==="string")return e;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return $(e.buffer,e.byteOffset,e.byteLength).toString("utf8")};var q=(e)=>{let t;if(typeof e==="string")t=k(e);else t=e;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return $(t.buffer,t.byteOffset,t.byteLength).toString("base64")};import{Readable as V}from"stream";import{TextDecoder as et}from"util";var pe=(e)=>{if(typeof Blob==="function"&&e instanceof Blob)return Xe(e);return Ze(e)};async function Xe(e){let t=await Ge(e),r=W(t);return new Uint8Array(r)}async function Ze(e){let t=[],r=e.getReader(),n=!1,o=0;while(!n){let{done:i,value:p}=await r.read();if(p)t.push(p),o+=p.length;n=i}let s=new Uint8Array(o),a=0;for(let i of t)s.set(i,a),a+=i.length;return s}function Ge(e){return new Promise((t,r)=>{let n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));let o=n.result??"",s=o.indexOf(","),a=s>-1?s+1:o.length;t(o.substring(a))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}var me={},Ke={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();if(t.length===1)t=`0${t}`;me[e]=t,Ke[t]=e}function ye(e){let t="";for(let r=0;r<e.byteLength;r++)t+=me[e[r]];return t}var N=(e)=>typeof ReadableStream==="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream);var ge="The stream has already been transformed.",xe=(e)=>{if(!we(e)&&!N(e)){let o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let t=!1,r=async()=>{if(t)throw new Error(ge);return t=!0,await pe(e)},n=(o)=>{if(typeof o.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return o.stream()};return Object.assign(e,{transformToByteArray:r,transformToString:async(o)=>{let s=await r();if(o==="base64")return q(s);else if(o==="hex")return ye(s);else if(o===void 0||o==="utf8"||o==="utf-8")return j(s);else if(typeof TextDecoder==="function")return new TextDecoder(o).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(ge);if(t=!0,we(e))return n(e);else if(N(e))return e;else throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},we=(e)=>typeof Blob==="function"&&e instanceof Blob;var Ee="The stream has already been transformed.",Yn=(e)=>{if(!(e instanceof V))try{return xe(e)}catch(n){let o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let t=!1,r=async()=>{if(t)throw new Error(Ee);return t=!0,await ue(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async(n)=>{let o=await r();if(n===void 0||Buffer.isEncoding(n))return $(o.buffer,o.byteOffset,o.byteLength).toString(n);else return new et(n).decode(o)},transformToWebStream:()=>{if(t)throw new Error(Ee);if(e.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof V.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return t=!0,V.toWeb(e)}})};var tt=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string"){let t=parseFloat(e);if(!Number.isNaN(t)){if(String(t)!==String(e))Re.warn(Ie(`Expected number but observed string: ${e}`));return t}}if(typeof e==="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)},rt=Math.ceil(340282346638528860000000000000000000000),be=(e)=>{let t=tt(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0){if(Math.abs(t)>rt)throw new TypeError(`Expected 32-bit float, got ${e}`)}return t},nt=(e)=>{if(e===null||e===void 0)return;if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)};var Te=(e)=>J(e,32),Se=(e)=>J(e,16),Ce=(e)=>J(e,8),J=(e,t)=>{let r=nt(e);if(r!==void 0&&ot(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},ot=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},yo=(e,t)=>{if(e===null||e===void 0){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return e},go=(e)=>{if(e===null||e===void 0)return;if(typeof e==="object"&&!Array.isArray(e))return e;let t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},wo=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string")return e;if(["boolean","number","bigint"].includes(typeof e))return Re.warn(Ie(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)};var $e=(e)=>{if(typeof e=="string")return be(U(e));return be(e)},st=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,U=(e)=>{let t=e.match(st);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)};var xo=(e)=>{if(typeof e==="string")return Te(U(e));return Te(e)},Y=(e)=>{if(typeof e==="string")return Se(U(e));return Se(e)},Ae=(e)=>{if(typeof e==="string")return Ce(U(e));return Ce(e)},Ie=(e)=>{return String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join("\n")},Re={warn:console.warn};var it=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var ct=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),So=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=ct.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,o,s,a,i,p,y]=t,x=Y(Q(n)),c=S(o,"month",1,12),f=S(s,"day",1,31);return ke(x,c,f,{hours:a,minutes:i,seconds:p,fractionalMilliseconds:y})},at=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Co=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=at.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,o,s,a,i,p,y,x]=t,c=Y(Q(n)),f=S(o,"month",1,12),u=S(s,"day",1,31),m=ke(c,f,u,{hours:a,minutes:i,seconds:p,fractionalMilliseconds:y});if(x.toUpperCase()!="Z")m.setTime(m.getTime()-ht(x));return m},$o=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Ao=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Io=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);var ke=(e,t,r,n)=>{let o=t-1;return ut(e,o,r),new Date(Date.UTC(e,o,r,S(n.hours,"hour",0,23),S(n.minutes,"minute",0,59),S(n.seconds,"seconds",0,60),lt(n.fractionalMilliseconds)))};var ft=[31,28,31,30,31,30,31,31,30,31,30,31],ut=(e,t,r)=>{let n=ft[t];if(t===1&&dt(e))n=29;if(r>n)throw new TypeError(`Invalid day for ${it[t]} in ${e}: ${r}`)},dt=(e)=>{return e%4===0&&(e%100!==0||e%400===0)},S=(e,t,r,n)=>{let o=Ae(Q(e));if(o<r||o>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return o},lt=(e)=>{if(e===null||e===void 0)return 0;return $e("0."+e)*1000},ht=(e)=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);let n=Number(e.substring(1,3)),o=Number(e.substring(4,6));return r*(n*60+o)*60*1000},Q=(e)=>{let t=0;while(t<e.length-1&&e.charAt(t)==="0")t++;if(t===0)return e;return e.slice(t)};var pt=({output:e,parsedBody:t,exceptionCtor:r,errorCode:n})=>{let o=mt(e),s=o.httpStatusCode?o.httpStatusCode+"":void 0,a=new r({name:t?.code||t?.Code||n||s||"UnknownError",$fault:"client",$metadata:o});throw le(a,t)},No=(e)=>{return({output:t,parsedBody:r,errorCode:n})=>{pt({output:t,parsedBody:r,exceptionCtor:e,errorCode:n})}},mt=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var _o=(e)=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var Ne=!1,Po=(e)=>{if(e&&!Ne&&parseInt(e.substring(1,e.indexOf(".")))<16)Ne=!0};function yt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var X=F(L(),1);var Me=(e)=>{let t=[];for(let r in X.AlgorithmId){let n=X.AlgorithmId[r];if(e[n]===void 0)continue;t.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}return{_checksumAlgorithms:t,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},_e=(e)=>{let t={};return e.checksumAlgorithms().forEach((r)=>{t[r.algorithmId()]=r.checksumConstructor()}),t};var Ue=(e)=>{let t=e.retryStrategy;return{setRetryStrategy(r){t=r},retryStrategy(){return t}}},Pe=(e)=>{let t={};return t.retryStrategy=e.retryStrategy(),t};var zo=(e)=>{return{...Me(e),...Ue(e)}};var vo=(e)=>{return{..._e(e),...Pe(e)}};var Vo=(e)=>Array.isArray(e)?e:[e];var Qo=(e)=>{return e!=null};var Z=function(){let e=Object.getPrototypeOf(this).constructor,r=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(r,e.prototype),r};Z.prototype=Object.create(String.prototype,{constructor:{value:Z,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(Z,String);class gt{trace(){}debug(){}info(){}warn(){}error(){}}function wt(e,t,r){let n,o,s;if(typeof t==="undefined"&&typeof r==="undefined")n={},s=e;else if(n=e,typeof t==="function")return o=t,s=r,xt(n,o,s);else s=t;for(let a of Object.keys(s)){if(!Array.isArray(s[a])){n[a]=s[a];continue}Fe(n,null,s,a)}return n}var Ko=(e,t)=>{let r={};for(let n in t)Fe(r,e,t,n);return r},xt=(e,t,r)=>{return wt(e,Object.entries(r).reduce((n,[o,s])=>{if(Array.isArray(s))n[o]=s;else if(typeof s==="function")n[o]=[t,s()];else n[o]=[t,s];return n},{}))},Fe=(e,t,r,n)=>{if(t!==null){let a=r[n];if(typeof a==="function")a=[,a];let[i=Et,p=bt,y=n]=a;if(typeof i==="function"&&i(t[y])||typeof i!=="function"&&!!i)e[n]=p(t[y]);return}let[o,s]=r[n];if(typeof s==="function"){let a,i=o===void 0&&(a=s())!=null,p=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(i)e[n]=a;else if(p)e[n]=s()}else{let a=o===void 0&&s!=null,i=typeof o==="function"&&!!o(s)||typeof o!=="function"&&!!o;if(a||i)e[n]=s}},Et=(e)=>e!=null,bt=(e)=>e;var Le=(e)=>{if(e==null)return{};if(Array.isArray(e))return e.filter((t)=>t!=null).map(Le);if(typeof e==="object"){let t={};for(let r of Object.keys(e)){if(e[r]==null)continue;t[r]=Le(e[r])}return t}return e};export{Nt as ua,Mt as va,O as wa,I as xa,Oe as ya,$ as za,_ as Aa,W as Ba,k as Ca,en as Da,j as Ea,q as Fa,B as Ga,ue as Ha,Yn as Ia,te as Ja,Br as Ka,vr as La,nt as Ma,Te as Na,yo as Oa,go as Pa,wo as Qa,xo as Ra,So as Sa,Co as Ta,de as Ua,le as Va,No as Wa,_o as Xa,Po as Ya,yt as Za,zo as _a,vo as $a,Vo as ab,Qo as bb,gt as cb,wt as db,Ko as eb,Le as fb};
|
package/dist/chunk-hqv9y9k2.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ga as I,Ia as y,Sa as C,wa as d}from"./chunk-g767h9jq.js";import"./chunk-we57sm1m.js";import{sb as u}from"./chunk-898dh3kh.js";import{ub as n}from"./chunk-3whxjf1k.js";import{zb as p}from"./chunk-ncwfzcsm.js";var P=p(u(),1);import A from"fs/promises";var x="169.254.170.2",E="169.254.170.23",R="[fd00:ec2::23]",i=(e,a)=>{if(e.protocol==="https:")return;if(e.hostname===x||e.hostname===E||e.hostname===R)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;let c=e.hostname.split("."),r=(t)=>{let s=parseInt(t,10);return 0<=s&&s<=255};if(c[0]==="127"&&r(c[1])&&r(c[2])&&r(c[3])&&c.length===4)return}throw new n(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
3
|
-
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
4
|
-
- ECS container host 169.254.170.2
|
|
5
|
-
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:a})};function S(e){return new d({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((a,[c,r])=>{return a[c]=r,a},{}),fragment:e.hash})}async function g(e,a){let r=await y(e.body).transformToString();if(e.statusCode===200){let t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new n("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:a});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:C(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new n(`Server responded with status: ${e.statusCode}`,{logger:a}),{Code:t.Code,Message:t.Message})}throw new n(`Server responded with status: ${e.statusCode}`,{logger:a})}var w=(e,a,c)=>{return async()=>{for(let r=0;r<a;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,c))}return await e()}};var O="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",b="http://169.254.170.2",v="AWS_CONTAINER_CREDENTIALS_FULL_URI",_="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",B="AWS_CONTAINER_AUTHORIZATION_TOKEN",D=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let a,c=e.awsContainerCredentialsRelativeUri??process.env[O],r=e.awsContainerCredentialsFullUri??process.env[v],t=e.awsContainerAuthorizationToken??process.env[B],s=e.awsContainerAuthorizationTokenFile??process.env[_],m=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console.warn:e.logger.warn;if(c&&r)m("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),m("awsContainerCredentialsFullUri will take precedence.");if(t&&s)m("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),m("awsContainerAuthorizationToken will take precedence.");if(r)a=r;else if(c)a=`${b}${c}`;else throw new n(`No HTTP credential provider host provided.
|
|
6
|
-
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let h=new URL(a);i(h,e.logger);let K=new I({requestTimeout:e.timeout??1000,connectionTimeout:e.timeout??1000});return w(async()=>{let o=S(h);if(t)o.headers.Authorization=t;else if(s)o.headers.Authorization=(await A.readFile(s)).toString();try{let f=await K.handle(o);return g(f.response).then((T)=>P.setCredentialFeature(T,"CREDENTIALS_HTTP","z"))}catch(f){throw new n(String(f),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000)};export{D as fromHttp};
|