@stacksjs/buddy 0.64.0 → 0.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/chunk-1b3vtfck.js +5 -0
  2. package/dist/chunk-1b3vtfck.js.map +16 -0
  3. package/dist/chunk-57yy5xcz.js +5 -0
  4. package/dist/{chunk-g5tqs4wa.js.map → chunk-57yy5xcz.js.map} +4 -4
  5. package/dist/{chunk-svr5ddhq.js → chunk-8enz17vb.js} +3 -3
  6. package/dist/{chunk-svr5ddhq.js.map → chunk-8enz17vb.js.map} +1 -1
  7. package/dist/{chunk-hd0zdkj9.js → chunk-9ttt4yty.js} +3 -3
  8. package/dist/{chunk-hd0zdkj9.js.map → chunk-9ttt4yty.js.map} +1 -1
  9. package/dist/chunk-agv26t9k.js +5 -0
  10. package/dist/{chunk-f9qdyafb.js.map → chunk-agv26t9k.js.map} +5 -5
  11. package/dist/{chunk-pabnt45p.js → chunk-ahjtrjx9.js} +3 -3
  12. package/dist/{chunk-pabnt45p.js.map → chunk-ahjtrjx9.js.map} +1 -1
  13. package/dist/{chunk-97kwnfsa.js → chunk-akm90kc0.js} +3 -3
  14. package/dist/{chunk-97kwnfsa.js.map → chunk-akm90kc0.js.map} +1 -1
  15. package/dist/{chunk-fcgh2sfr.js → chunk-f0y6y2pa.js} +3 -3
  16. package/dist/{chunk-fcgh2sfr.js.map → chunk-f0y6y2pa.js.map} +1 -1
  17. package/dist/{chunk-47n7wt6x.js → chunk-h26ck86r.js} +4 -4
  18. package/dist/{chunk-47n7wt6x.js.map → chunk-h26ck86r.js.map} +1 -1
  19. package/dist/chunk-h3ygxbt8.js +5 -0
  20. package/dist/{chunk-hj9p7vjp.js.map → chunk-h3ygxbt8.js.map} +4 -4
  21. package/dist/chunk-jj0rek44.js +21 -0
  22. package/dist/{chunk-ehm10xxj.js.map → chunk-jj0rek44.js.map} +14 -10
  23. package/dist/{chunk-gvpcxxae.js → chunk-m4ha2b7x.js} +3 -3
  24. package/dist/{chunk-gvpcxxae.js.map → chunk-m4ha2b7x.js.map} +1 -1
  25. package/dist/chunk-q5cwemad.js +7 -0
  26. package/dist/{chunk-12tkdbmy.js.map → chunk-q5cwemad.js.map} +3 -3
  27. package/dist/chunk-qzys4y28.js +5 -0
  28. package/dist/{chunk-cnvpbb2z.js.map → chunk-qzys4y28.js.map} +4 -4
  29. package/dist/chunk-vv8b2cgh.js +6 -0
  30. package/dist/{chunk-a8vj9csq.js.map → chunk-vv8b2cgh.js.map} +5 -5
  31. package/dist/{chunk-b8124fjs.js → chunk-wrrrgt8g.js} +3 -3
  32. package/dist/{chunk-b8124fjs.js.map → chunk-wrrrgt8g.js.map} +1 -1
  33. package/dist/{chunk-hxzqmyb0.js → chunk-zj93wgdp.js} +3 -3
  34. package/dist/{chunk-hxzqmyb0.js.map → chunk-zj93wgdp.js.map} +1 -1
  35. package/dist/{chunk-463qxvjp.js → chunk-zw6qgfz1.js} +3 -3
  36. package/dist/{chunk-463qxvjp.js.map → chunk-zw6qgfz1.js.map} +1 -1
  37. package/dist/cli.js +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/stacks +0 -0
  40. package/package.json +1 -1
  41. package/src/commands/release.ts +0 -1
  42. package/dist/chunk-12tkdbmy.js +0 -7
  43. package/dist/chunk-a8vj9csq.js +0 -6
  44. package/dist/chunk-cnvpbb2z.js +0 -5
  45. package/dist/chunk-ehm10xxj.js +0 -21
  46. package/dist/chunk-f9qdyafb.js +0 -5
  47. package/dist/chunk-fft99hka.js +0 -4
  48. package/dist/chunk-fft99hka.js.map +0 -16
  49. package/dist/chunk-g5tqs4wa.js +0 -5
  50. package/dist/chunk-hj9p7vjp.js +0 -5
@@ -1,6 +0,0 @@
1
- import{N as O}from"./chunk-wmfxrbxe.js";import{eb as L}from"./chunk-gvpcxxae.js";var T=(e,t)=>{const r=[];if(e)r.push(e);if(t)for(let n of t)r.push(n);return r},E=(e,t)=>{return`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},C=()=>{let e=[],t=[],r=!1;const n=new Set,o=(i)=>i.sort((c,d)=>G[d.step]-G[c.step]||K[d.priority||"normal"]-K[c.priority||"normal"]),s=(i)=>{let c=!1;const d=(y)=>{const m=T(y.name,y.aliases);if(m.includes(i)){c=!0;for(let l of m)n.delete(l);return!1}return!0};return e=e.filter(d),t=t.filter(d),c},u=(i)=>{let c=!1;const d=(y)=>{if(y.middleware===i){c=!0;for(let m of T(y.name,y.aliases))n.delete(m);return!1}return!0};return e=e.filter(d),t=t.filter(d),c},a=(i)=>{return e.forEach((c)=>{i.add(c.middleware,{...c})}),t.forEach((c)=>{i.addRelativeTo(c.middleware,{...c})}),i.identifyOnResolve?.(w.identifyOnResolve()),i},h=(i)=>{const c=[];return i.before.forEach((d)=>{if(d.before.length===0&&d.after.length===0)c.push(d);else c.push(...h(d))}),c.push(i),i.after.reverse().forEach((d)=>{if(d.before.length===0&&d.after.length===0)c.push(d);else c.push(...h(d))}),c},g=(i=!1)=>{const c=[],d=[],y={};return e.forEach((l)=>{const f={...l,before:[],after:[]};for(let p of T(f.name,f.aliases))y[p]=f;c.push(f)}),t.forEach((l)=>{const f={...l,before:[],after:[]};for(let p of T(f.name,f.aliases))y[p]=f;d.push(f)}),d.forEach((l)=>{if(l.toMiddleware){const f=y[l.toMiddleware];if(f===void 0){if(i)return;throw new Error(`${l.toMiddleware} is not found when adding ${E(l.name,l.aliases)} middleware ${l.relation} ${l.toMiddleware}`)}if(l.relation==="after")f.after.push(l);if(l.relation==="before")f.before.push(l)}}),o(c).map(h).reduce((l,f)=>{return l.push(...f),l},[])},w={add:(i,c={})=>{const{name:d,override:y,aliases:m}=c,l={step:"initialize",priority:"normal",middleware:i,...c},f=T(d,m);if(f.length>0){if(f.some((p)=>n.has(p))){if(!y)throw new Error(`Duplicate middleware name '${E(d,m)}'`);for(let p of f){const b=e.findIndex((A)=>A.name===p||A.aliases?.some((F)=>F===p));if(b===-1)continue;const x=e[b];if(x.step!==l.step||l.priority!==x.priority)throw new Error(`"${E(x.name,x.aliases)}" middleware with ${x.priority} priority in ${x.step} step cannot be overridden by "${E(d,m)}" middleware with ${l.priority} priority in ${l.step} step.`);e.splice(b,1)}}for(let p of f)n.add(p)}e.push(l)},addRelativeTo:(i,c)=>{const{name:d,override:y,aliases:m}=c,l={middleware:i,...c},f=T(d,m);if(f.length>0){if(f.some((p)=>n.has(p))){if(!y)throw new Error(`Duplicate middleware name '${E(d,m)}'`);for(let p of f){const b=t.findIndex((A)=>A.name===p||A.aliases?.some((F)=>F===p));if(b===-1)continue;const x=t[b];if(x.toMiddleware!==l.toMiddleware||x.relation!==l.relation)throw new Error(`"${E(x.name,x.aliases)}" middleware ${x.relation} "${x.toMiddleware}" middleware cannot be overridden by "${E(d,m)}" middleware ${l.relation} "${l.toMiddleware}" middleware.`);t.splice(b,1)}}for(let p of f)n.add(p)}t.push(l)},clone:()=>a(C()),use:(i)=>{i.applyToStack(w)},remove:(i)=>{if(typeof i==="string")return s(i);else return u(i)},removeByTag:(i)=>{let c=!1;const d=(y)=>{const{tags:m,name:l,aliases:f}=y;if(m&&m.includes(i)){const p=T(l,f);for(let b of p)n.delete(b);return c=!0,!1}return!0};return e=e.filter(d),t=t.filter(d),c},concat:(i)=>{const c=a(C());return c.use(i),c.identifyOnResolve(r||c.identifyOnResolve()||(i.identifyOnResolve?.()??!1)),c},applyToStack:a,identify:()=>{return g(!0).map((i)=>{const c=i.step??i.relation+" "+i.toMiddleware;return E(i.name,i.aliases)+" - "+c})},identifyOnResolve(i){if(typeof i==="boolean")r=i;return r},resolve:(i,c)=>{for(let d of g().map((y)=>y.middleware).reverse())i=d(i,c);if(r)console.log(w.identify());return i}};return w},G={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},K={high:3,normal:2,low:1};class _e{constructor(e){this.middlewareStack=C(),this.config=e}send(e,t,r){const n=typeof t!=="function"?t:void 0,o=typeof t==="function"?t:r,s=e.resolveMiddleware(this.middlewareStack,this.config,n);if(o)s(e).then((u)=>o(null,u.output),(u)=>o(u)).catch(()=>{});else return s(e).then((u)=>u.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}}var ee=O(L(),1);class te{constructor(){this.middlewareStack=C()}static classBuilder(){return new re}resolveMiddlewareWithContext(e,t,r,{middlewareFn:n,clientName:o,commandName:s,inputFilterSensitiveLog:u,outputFilterSensitiveLog:a,smithyContext:h,additionalContext:g,CommandCtor:w}){for(let m of n.bind(this)(w,e,t,r))this.middlewareStack.use(m);const i=e.concat(this.middlewareStack),{logger:c}=t,d={logger:c,clientName:o,commandName:s,inputFilterSensitiveLog:u,outputFilterSensitiveLog:a,[ee.SMITHY_CONTEXT_KEY]:{commandInstance:this,...h},...g},{requestHandler:y}=t;return i.resolve((m)=>y.handle(m.request,r||{}),d)}}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(){const e=this;let 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 Mt=(e)=>{let t=e.httpHandler;return{setHttpHandler(r){t=r},httpHandler(){return t},updateHttpClientConfig(r,n){t.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},Pt=(e)=>{return{httpHandler:e.httpHandler()}};var De=O(L(),1);function Be(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class _{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){const t=new _({...e,headers:{...e.headers}});if(t.query)t.query=Be(t.query);return t}static isInstance(e){if(!e)return!1;const 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 _.clone(this)}}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;const t=e;return typeof t.statusCode==="number"&&typeof t.headers==="object"}}var k=(e)=>encodeURIComponent(e).replace(/[!'()*]/g,He),He=(e)=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function P(e){const t=[];for(let r of Object.keys(e).sort()){const n=e[r];if(r=k(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)t.push(`${r}=${k(n[o])}`);else{let o=r;if(n||typeof n==="string")o+=`=${k(n)}`;t.push(o)}}return t.join("&")}import{Agent as ae,request as qe}from"http";import{Agent as fe,request as je}from"https";var ne=["ECONNRESET","EPIPE","ETIMEDOUT"];var D=(e)=>{const t={};for(let r of Object.keys(e)){const n=e[r];t[r]=Array.isArray(n)?n.join(","):n}return t};var oe=(e,t,r=0)=>{if(!r)return;const n=setTimeout(()=>{e.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r);e.on("socket",(o)=>{if(o.connecting)o.on("connect",()=>{clearTimeout(n)});else clearTimeout(n)})};var se=(e,{keepAlive:t,keepAliveMsecs:r})=>{if(t!==!0)return;e.on("socket",(n)=>{n.setKeepAlive(t,r||0)})};var ie=(e,t,r=0)=>{e.setTimeout(r,()=>{e.destroy(),t(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))})};import{Readable as ve}from"stream";async function B(e,t,r=ce){const n=t.headers??{},o=n.Expect||n.expect;let s=-1,u=!1;if(o==="100-continue")await Promise.race([new Promise((a)=>{s=Number(setTimeout(a,Math.max(ce,r)))}),new Promise((a)=>{e.on("continue",()=>{clearTimeout(s),a()}),e.on("error",()=>{u=!0,clearTimeout(s),a()})})]);if(!u)ze(e,t.body)}function ze(e,t){if(t instanceof ve){t.pipe(e);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){e.end(t);return}const 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()}var ce=1000;class H{static create(e){if(typeof e?.handle==="function")return e;return new H(e)}static checkSocketUsage(e,t,r=console){const{sockets:n,requests:o,maxSockets:s}=e;if(typeof s!=="number"||s===1/0)return t;const u=15000;if(Date.now()-u<t)return t;if(n&&o)for(let a in n){const h=n[a]?.length??0,g=o[a]?.length??0;if(h>=s&&g>=2*s)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${h} and ${g} 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){const{requestTimeout:t,connectionTimeout:r,socketTimeout:n,httpAgent:o,httpsAgent:s}=e||{};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;let r;return new Promise((n,o)=>{let s=void 0;const u=async(f)=>{await s,clearTimeout(r),n(f)},a=async(f)=>{await s,clearTimeout(r),o(f)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){const f=new Error("Request aborted");f.name="AbortError",a(f);return}const h=e.protocol==="https:",g=h?this.config.httpsAgent:this.config.httpAgent;r=setTimeout(()=>{this.socketWarningTimestamp=H.checkSocketUsage(g,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const w=P(e.query||{});let i=void 0;if(e.username!=null||e.password!=null){const f=e.username??"",p=e.password??"";i=`${f}:${p}`}let c=e.path;if(w)c+=`?${w}`;if(e.fragment)c+=`#${e.fragment}`;const d={headers:e.headers,host:e.hostname,method:e.method,path:c,port:e.port,agent:g,auth:i},m=(h?je:qe)(d,(f)=>{const p=new I({statusCode:f.statusCode||-1,reason:f.statusMessage,headers:D(f.headers),body:f});u({response:p})});if(m.on("error",(f)=>{if(ne.includes(f.code))a(Object.assign(f,{name:"TimeoutError"}));else a(f)}),oe(m,a,this.config.connectionTimeout),ie(m,a,this.config.requestTimeout),t){const f=()=>{m.destroy();const p=new Error("Request aborted");p.name="AbortError",a(p)};if(typeof t.addEventListener==="function"){const p=t;p.addEventListener("abort",f,{once:!0}),m.once("close",()=>p.removeEventListener("abort",f))}else t.onabort=f}const l=d.agent;if(typeof l==="object"&&"keepAlive"in l)se(m,{keepAlive:l.keepAlive,keepAliveMsecs:l.keepAliveMsecs});s=B(m,e,this.config.requestTimeout).catch((f)=>{return clearTimeout(r),o(f)})})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[e]:t}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as We}from"stream";class v extends We{constructor(){super(...arguments);this.bufferedBytes=[]}_write(e,t,r){this.bufferedBytes.push(e),r()}}async function Ye(e){const t=[],r=e.getReader();let n=!1,o=0;while(!n){const{done:a,value:h}=await r.read();if(h)t.push(h),o+=h.length;n=a}const s=new Uint8Array(o);let u=0;for(let a of t)s.set(a,u),u+=a.length;return s}var ue=(e)=>{if(Je(e))return Ye(e);return new Promise((t,r)=>{const n=new v;e.pipe(n),e.on("error",(o)=>{n.end(),r(o)}),n.on("error",r),n.on("finish",function(){const o=new Uint8Array(Buffer.concat(this.bufferedBytes));t(o)})})},Je=(e)=>typeof ReadableStream==="function"&&e instanceof ReadableStream;var Hr="***SensitiveInformation***";var zr=(e,t)=>{for(let r of Object.keys(e)){const n=e[r],o=async function(u,a,h){const g=new n(u);if(typeof a==="function")this.send(g,a);else if(typeof h==="function"){if(typeof a!=="object")throw new Error(`Expected http options but got ${typeof a}`);this.send(g,a||{},h)}else return this.send(g,a)},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});const r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e};class Ve{trace(){}debug(){}info(){}warn(){}error(){}}var he=(e)=>typeof ArrayBuffer==="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]";import{Buffer as z}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 z.from(e,t,r)},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?z.from(e,t):z.from(e)};var Xe=/^[A-Za-z0-9+/]*={0,2}$/,q=(e)=>{if(e.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Xe.exec(e))throw new TypeError("Invalid base64 string.");const t=R(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};var U=(e)=>{const t=R(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var tn=(e)=>{if(typeof e==="string")return U(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 W=(e)=>{let t;if(typeof e==="string")t=U(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 J}from"stream";import{TextDecoder as tt}from"util";async function Qe(e){const t=await Ke(e),r=q(t);return new Uint8Array(r)}async function Ge(e){const t=[],r=e.getReader();let n=!1,o=0;while(!n){const{done:a,value:h}=await r.read();if(h)t.push(h),o+=h.length;n=a}const s=new Uint8Array(o);let u=0;for(let a of t)s.set(a,u),u+=a.length;return s}function Ke(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const o=n.result??"",s=o.indexOf(","),u=s>-1?s+1:o.length;t(o.substring(u))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}var pe=(e)=>{if(typeof Blob==="function"&&e instanceof Blob)return Qe(e);return Ge(e)};function ye(e){let t="";for(let r=0;r<e.byteLength;r++)t+=me[e[r]];return t}var me={},et={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();if(t.length===1)t=`0${t}`;me[e]=t,et[t]=e}var M=(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)&&!M(e)){const o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let t=!1;const 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)=>{const s=await r();if(o==="base64")return W(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(M(e))return e;else throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},we=(e)=>typeof Blob==="function"&&e instanceof Blob;var be="The stream has already been transformed.",Xn=(e)=>{if(!(e instanceof J))try{return xe(e)}catch(n){const o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let t=!1;const r=async()=>{if(t)throw new Error(be);return t=!0,await ue(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async(n)=>{const o=await r();if(n===void 0||Buffer.isEncoding(n))return $(o.buffer,o.byteOffset,o.byteLength).toString(n);else return new tt(n).decode(o)},transformToWebStream:()=>{if(t)throw new Error(be);if(e.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof J.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,J.toWeb(e)}})};var rt=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string"){const t=parseFloat(e);if(!Number.isNaN(t)){if(String(t)!==String(e))ke.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}`)},nt=Math.ceil(340282346638528860000000000000000000000),Ee=(e)=>{const t=rt(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0){if(Math.abs(t)>nt)throw new TypeError(`Expected 32-bit float, got ${e}`)}return t},ot=(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)=>Y(e,32),Se=(e)=>Y(e,16),Ce=(e)=>Y(e,8),Y=(e,t)=>{const r=ot(e);if(r!==void 0&&st(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},st=(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]}},go=(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},wo=(e)=>{if(e===null||e===void 0)return;if(typeof e==="object"&&!Array.isArray(e))return e;const t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},xo=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string")return e;if(["boolean","number","bigint"].includes(typeof e))return ke.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 Ee(N(e));return Ee(e)},it=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,N=(e)=>{const t=e.match(it);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)};var bo=(e)=>{if(typeof e==="string")return Te(N(e));return Te(e)},V=(e)=>{if(typeof e==="string")return Se(N(e));return Se(e)},Ae=(e)=>{if(typeof e==="string")return Ce(N(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")},ke={warn:console.warn};var ct=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],at=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[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");const t=at.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,u,a,h,g]=t,w=V(X(n)),i=S(o,"month",1,12),c=S(s,"day",1,31);return Ue(w,i,c,{hours:u,minutes:a,seconds:h,fractionalMilliseconds:g})},ft=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),$o=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=ft.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,u,a,h,g,w]=t,i=V(X(n)),c=S(o,"month",1,12),d=S(s,"day",1,31),y=Ue(i,c,d,{hours:u,minutes:a,seconds:h,fractionalMilliseconds:g});if(w.toUpperCase()!="Z")y.setTime(y.getTime()-pt(w));return y},Ao=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$/),Io=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$/),ko=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 Ue=(e,t,r,n)=>{const o=t-1;return dt(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),ht(n.fractionalMilliseconds)))};var ut=[31,28,31,30,31,30,31,31,30,31,30,31],dt=(e,t,r)=>{let n=ut[t];if(t===1&&lt(e))n=29;if(r>n)throw new TypeError(`Invalid day for ${ct[t]} in ${e}: ${r}`)},lt=(e)=>{return e%4===0&&(e%100!==0||e%400===0)},S=(e,t,r,n)=>{const o=Ae(X(e));if(o<r||o>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return o},ht=(e)=>{if(e===null||e===void 0)return 0;return $e("0."+e)*1000},pt=(e)=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const n=Number(e.substring(1,3)),o=Number(e.substring(4,6));return r*(n*60+o)*60*1000},X=(e)=>{let t=0;while(t<e.length-1&&e.charAt(t)==="0")t++;if(t===0)return e;return e.slice(t)};var mt=({output:e,parsedBody:t,exceptionCtor:r,errorCode:n})=>{const o=yt(e),s=o.httpStatusCode?o.httpStatusCode+"":void 0,u=new r({name:t?.code||t?.Code||n||s||"UnknownError",$fault:"client",$metadata:o});throw le(u,t)},Po=(e)=>{return({output:t,parsedBody:r,errorCode:n})=>{mt({output:t,parsedBody:r,exceptionCtor:e,errorCode:n})}},yt=(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 No=(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 Me=!1,Oo=(e)=>{if(e&&!Me&&parseInt(e.substring(1,e.indexOf(".")))<16)Me=!0};var Z=O(L(),1);var Pe=(e)=>{const t=[];for(let r in Z.AlgorithmId){const n=Z.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}}},Re=(e)=>{const t={};return e.checksumAlgorithms().forEach((r)=>{t[r.algorithmId()]=r.checksumConstructor()}),t};var Ne=(e)=>{let t=e.retryStrategy;return{setRetryStrategy(r){t=r},retryStrategy(){return t}}},Fe=(e)=>{const t={};return t.retryStrategy=e.retryStrategy(),t};var vo=(e)=>{return{...Pe(e),...Ne(e)}};var zo=(e)=>{return{...Re(e),...Fe(e)}};function gt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var Yo=(e)=>Array.isArray(e)?e:[e];var Q=function(){const e=Object.getPrototypeOf(this).constructor,r=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(r,e.prototype),r};Q.prototype=Object.create(String.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(Q,String);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 u of Object.keys(s)){if(!Array.isArray(s[u])){n[u]=s[u];continue}Oe(n,null,s,u)}return n}var Qo=(e,t)=>{const r={};for(let n in t)Oe(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},{}))},Oe=(e,t,r,n)=>{if(t!==null){let u=r[n];if(typeof u==="function")u=[,u];const[a=bt,h=Et,g=n]=u;if(typeof a==="function"&&a(t[g])||typeof a!=="function"&&!!a)e[n]=h(t[g]);return}let[o,s]=r[n];if(typeof s==="function"){let u;const a=o===void 0&&(u=s())!=null,h=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(a)e[n]=u;else if(h)e[n]=s()}else{const u=o===void 0&&s!=null,a=typeof o==="function"&&!!o(s)||typeof o!=="function"&&!!o;if(u||a)e[n]=s}},bt=(e)=>e!=null,Et=(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"){const t={};for(let r of Object.keys(e)){if(e[r]==null)continue;t[r]=Le(e[r])}return t}return e};export{Mt as P,Pt as Q,_ as R,I as S,Ve as T,_e as U,$ as V,R as W,q as X,U as Y,tn as Z,j as _,W as $,H as aa,ue as ba,Xn as ca,te as da,Hr as ea,zr as fa,ot as ga,Te as ha,go as ia,wo as ja,xo as ka,bo as la,Co as ma,$o as na,de as oa,le as pa,Po as qa,No as ra,Oo as sa,vo as ta,zo as ua,gt as va,Yo as wa,wt as xa,Qo as ya,Le as za};
4
-
5
- //# debugId=DB89EFA14116DF5564756E2164756E21
6
- //# sourceMappingURL=chunk-a8vj9csq.js.map
@@ -1,5 +0,0 @@
1
- // @bun
2
- import{N as r}from"./chunk-wmfxrbxe.js";import"./chunk-gvpcxxae.js";import{fb as d,gb as z}from"./chunk-fft99hka.js";import"./chunk-svr5ddhq.js";import{qb as K,rb as y}from"./chunk-hd0zdkj9.js";import{parse as p}from"url";import{Buffer as M}from"buffer";import{request as k}from"http";function E(c){return new Promise((I,x)=>{const T=k({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new K("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new K("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{const{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new K("Error response received from instance metadata service"),{statusCode:O})),T.destroy();const $=[];N.on("data",(w)=>{$.push(w)}),N.on("end",()=>{I(M.concat($)),T.destroy()})}),T.end()})}var _=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",D=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var Sc=1000,uc=0,G=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var m=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var X="AWS_CONTAINER_CREDENTIALS_FULL_URI",Z="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",b="AWS_CONTAINER_AUTHORIZATION_TOKEN",Kc=(c={})=>{const{timeout:I,maxRetries:x}=G(c);return()=>m(async()=>{const T=await s({logger:c.logger}),N=JSON.parse(await C(I,T));if(!_(N))throw new y("Invalid response received from instance metadata service.",{logger:c.logger});return D(N)},x)},C=async(c,I)=>{if(process.env[b])I.headers={...I.headers,Authorization:process.env[b]};return(await E({...I,timeout:c})).toString()},a="169.254.170.2",n={localhost:!0,"127.0.0.1":!0},o={"http:":!0,"https:":!0},s=async({logger:c})=>{if(process.env[Z])return{hostname:a,path:process.env[Z]};if(process.env[X]){const I=p(process.env[X]);if(!I.hostname||!(I.hostname in n))throw new y(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in o))throw new y(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new y(`The container metadata credential provider cannot be used unless the ${Z} or ${X} environment variable is set`,{tryNextLink:!1,logger:c})};class Q extends y{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,Q.prototype)}}var B=r(d(),1);var J;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(J||(J={}));var H={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0};var u;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(u||(u={}));var g="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",l="ec2_metadata_service_endpoint_mode",q={environmentVariableSelector:(c)=>c[g],configFileSelector:(c)=>c[l],default:u.IPv4};var v=async()=>B.parseUrl(await e()||await i()),e=async()=>z(H)(),i=async()=>{const c=await z(q)();switch(c){case u.IPv4:return J.IPv4;case u.IPv6:return J.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(u)}`)}};var L=(c,I)=>{const x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(T)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var U=(c,I={})=>{const x=I?.logger||console;let T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=L(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=L(T,x);else throw O}return T=N,N}};var P="/latest/meta-data/iam/security-credentials/",cc="/latest/api/token",W="AWS_EC2_METADATA_V1_DISABLED",t="ec2_metadata_v1_disabled",F="x-aws-ec2-metadata-token",sc=(c={})=>U(Ic(c),{logger:c.logger}),Ic=(c={})=>{let I=!1;const{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=G(c),$=async(w,j)=>{if(I||j.headers?.[F]==null){let h=!1,Y=!1;const R=await z({environmentVariableSelector:(S)=>{const A=S[W];if(Y=!!A&&A!=="false",A===void 0)throw new y(`${W} not set in env, checking config file next.`,{logger:c.logger});return Y},configFileSelector:(S)=>{const A=S[t];return h=!!A&&A!=="false",h},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||R){const S=[];if(c.ec2MetadataV1Disabled)S.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(h)S.push(`config file profile (${t})`);if(Y)S.push(`process environment variable (${W})`);throw new Q(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${S.join(", ")}].`)}}const V=(await m(async()=>{let h;try{h=await Nc(j)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)).trim();return m(async()=>{let h;try{h=await xc(V,j,c)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)};return async()=>{const w=await v();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),$(O,{...w,timeout:N});else{let j;try{j=(await Tc({...w,timeout:N})).toString()}catch(f){if(f?.statusCode===400)throw Object.assign(f,{message:"EC2 Metadata token request returned error"});else if(f.message==="TimeoutError"||[403,404,405].includes(f.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),$(O,{...w,timeout:N})}return $(O,{...w,headers:{[F]:j},timeout:N})}}},Tc=async(c)=>E({...c,path:cc,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Nc=async(c)=>(await E({...c,path:P})).toString(),xc=async(c,I,x)=>{const T=JSON.parse((await E({...I,path:P+c})).toString());if(!_(T))throw new y("Invalid response received from instance metadata service.",{logger:x.logger});return D(T)};export{G as providerConfigFromInit,E as httpRequest,v as getInstanceMetadataEndpoint,sc as fromInstanceMetadata,Kc as fromContainerMetadata,J as Endpoint,Z as ENV_CMDS_RELATIVE_URI,X as ENV_CMDS_FULL_URI,b as ENV_CMDS_AUTH_TOKEN,Sc as DEFAULT_TIMEOUT,uc as DEFAULT_MAX_RETRIES};
3
-
4
- //# debugId=29DA0D3BA9F2F32364756E2164756E21
5
- //# sourceMappingURL=chunk-cnvpbb2z.js.map