nebutra 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aws-kms-JXNUBFR5.js +1 -0
- package/dist/chunk-224RJRPV.js +5 -0
- package/dist/chunk-2YUF6TO6.js +2 -0
- package/dist/chunk-3T4EOSMQ.js +1 -0
- package/dist/chunk-4AGDXYPL.js +1 -0
- package/dist/chunk-76FD5Z7D.js +23 -0
- package/dist/chunk-AAIUIEEA.js +1 -0
- package/dist/chunk-CHWVD37K.js +1 -0
- package/dist/chunk-EUNES54A.js +1 -0
- package/dist/chunk-FBRPUQSU.js +9 -0
- package/dist/chunk-FSRPMVAS.js +1 -0
- package/dist/chunk-IY2KKEUD.js +1 -0
- package/dist/chunk-M3QJPQWS.js +1 -0
- package/dist/chunk-QSLKOXQ6.js +1 -0
- package/dist/chunk-S4HCBMFP.js +1 -0
- package/dist/chunk-SF4JBB23.js +1 -0
- package/dist/chunk-TX7AAHER.js +1 -0
- package/dist/chunk-U7GFHIC2.js +1 -0
- package/dist/chunk-UU4YUKYZ.js +40 -0
- package/dist/chunk-WI7DO2VU.js +1 -0
- package/dist/chunk-WS6OSFOJ.js +1 -0
- package/dist/chunk-XB6R2VIU.js +1 -0
- package/dist/chunk-YYJUG63O.js +20 -0
- package/dist/chunk-ZCWB3HFB.js +1 -0
- package/dist/credits-BNQN5G4U.js +2613 -0
- package/dist/delegate-AT4FVWBK.js +1 -0
- package/dist/dist-HHAEOWH3.js +1 -0
- package/dist/dist-RKQ2VFAN.js +5 -0
- package/dist/dist-es-27SHBPNL.js +2 -0
- package/dist/dist-es-3AHFNYTD.js +5 -0
- package/dist/dist-es-3MQSPUQV.js +1 -0
- package/dist/dist-es-7VTHVGQ3.js +1 -0
- package/dist/dist-es-JATELSE4.js +1 -0
- package/dist/dist-es-JT6FIF3X.js +1 -0
- package/dist/dist-es-NRANDF25.js +2 -0
- package/dist/event-streams-IPTOYMEP.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +170 -194
- package/dist/loadSso-PT5GF7HH.js +1 -0
- package/dist/local-BUKM6VCO.js +1 -0
- package/dist/logger-LKYUI2MJ.js +1 -0
- package/dist/query_compiler_fast_bg.postgresql-FOSFFKA5.js +2 -0
- package/dist/query_compiler_fast_bg.postgresql.wasm-base64-JU7X67WB.js +1 -0
- package/dist/signin-BWSVHQGQ.js +1 -0
- package/dist/sso-oidc-33SS76HS.js +1 -0
- package/dist/sts-RJ2HDNHF.js +6 -0
- package/package.json +19 -17
- package/LICENSE +0 -676
- package/dist/chunk-I7AUKTXE.js +0 -1
- package/dist/delegate-YL6SAZNF.js +0 -1
- package/dist/logger-KLED6BEE.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-FBRPUQSU.js";import"./chunk-QSLKOXQ6.js";import"./chunk-76FD5Z7D.js";import"./chunk-WS6OSFOJ.js";import"./chunk-U7GFHIC2.js";import"./chunk-YYJUG63O.js";import"./chunk-224RJRPV.js";import"./chunk-CHWVD37K.js";import"./chunk-XB6R2VIU.js";import"./chunk-M3QJPQWS.js";import"./chunk-3T4EOSMQ.js";import"./chunk-IY2KKEUD.js";import"./chunk-ZCWB3HFB.js";import"./chunk-WI7DO2VU.js";import"./chunk-TX7AAHER.js";import"./chunk-FSRPMVAS.js";export{a as AWSKMSProvider};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{b as H,c as W,d as J}from"./chunk-XB6R2VIU.js";var $=class{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;let r=t;return typeof r.statusCode=="number"&&typeof r.headers=="object"}};var I=e=>encodeURIComponent(e).replace(/[!'()*]/g,ue),ue=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function Y(e){let t=[];for(let r of Object.keys(e).sort()){let o=e[r];if(r=I(r),Array.isArray(o))for(let n=0,i=o.length;n<i;n++)t.push(`${r}=${I(o[n])}`);else{let n=r;(o||typeof o=="string")&&(n+=`=${I(o)}`),t.push(n)}}return t.join("&")}import{Agent as O,request as ge}from"https";function D(e){let t=e&&typeof e=="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){let n=new Error("Request aborted");return n.name="AbortError",n.cause=t,n}let o=new Error(String(t));return o.name="AbortError",o}let r=new Error("Request aborted");return r.name="AbortError",r}var K=["ECONNRESET","EPIPE","ETIMEDOUT"];var V=e=>{let t={};for(let r of Object.keys(e)){let o=e[r];t[r]=Array.isArray(o)?o.join(","):o}return t};var u={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)};var X=1e3,z=(e,t,r=0)=>{if(!r)return-1;let o=n=>{let i=u.setTimeout(()=>{e.destroy(),t(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${r} ms.`),{name:"TimeoutError"}))},r-n),s=c=>{c?.connecting?c.on("connect",()=>{u.clearTimeout(i)}):u.clearTimeout(i)};e.socket?s(e.socket):e.on("socket",s)};return r<2e3?(o(0),0):u.setTimeout(o.bind(null,X),X)};var G=(e,t,r=0,o,n)=>r?u.setTimeout(()=>{let i=`@smithy/node-http-handler - [${o?"ERROR":"WARN"}] a request has exceeded the configured ${r} ms requestTimeout.`;if(o){let s=Object.assign(new Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});e.destroy(s),t(s)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",n?.warn?.(i)},r):-1;var pe=3e3,Z=(e,{keepAlive:t,keepAliveMsecs:r},o=pe)=>{if(t!==!0)return-1;let n=()=>{e.socket?e.socket.setKeepAlive(t,r||0):e.on("socket",i=>{i.setKeepAlive(t,r||0)})};return o===0?(n(),0):u.setTimeout(n,o)};var Q=3e3,q=(e,t,r=0)=>{let o=n=>{let i=r-n,s=()=>{e.destroy(),t(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${r} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};e.socket?(e.socket.setTimeout(i,s),e.on("close",()=>e.socket?.removeListener("timeout",s))):e.setTimeout(i,s)};return 0<r&&r<6e3?(o(0),0):u.setTimeout(o.bind(null,r===0?0:Q),Q)};import{Readable as me}from"stream";var v=6e3;async function ee(e,t,r=v,o=!1){let n=t.headers??{},i=n.Expect||n.expect,s=-1,c=!0;!o&&i==="100-continue"&&(c=await Promise.race([new Promise(f=>{s=Number(u.setTimeout(()=>f(!0),Math.max(v,r)))}),new Promise(f=>{e.on("continue",()=>{u.clearTimeout(s),f(!0)}),e.on("response",()=>{u.clearTimeout(s),f(!1)}),e.on("error",()=>{u.clearTimeout(s),f(!1)})})])),c&&he(e,t.body)}function he(e,t){if(t instanceof me){t.pipe(e);return}if(t){let r=Buffer.isBuffer(t);if(r||typeof t=="string"){r&&t.byteLength===0?e.end():e.end(t);return}let n=t;if(typeof n=="object"&&n.buffer&&typeof n.byteOffset=="number"&&typeof n.byteLength=="number"){e.end(Buffer.from(n.buffer,n.byteOffset,n.byteLength));return}e.end(Buffer.from(t));return}e.end()}var C,te,re=class e{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(t){return typeof t?.handle=="function"?t:new e(t)}static checkSocketUsage(t,r,o=console){let{sockets:n,requests:i,maxSockets:s}=t;if(typeof s!="number"||s===1/0||Date.now()-15e3<r)return r;if(n&&i)for(let f in n){let a=n[f]?.length??0,m=i[f]?.length??0;if(a>=s&&m>=2*s)return o?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${a} and ${m} 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 r}constructor(t){this.configProvider=new Promise((r,o)=>{typeof t=="function"?t().then(n=>{r(this.resolveDefaultConfig(n))}).catch(o):r(this.resolveDefaultConfig(t))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:r,requestTimeout:o}={}){this.config||(this.config=await this.configProvider);let n=this.config,i=t.protocol==="https:";return!i&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((s,c)=>{let f,a=[],m=async d=>{await f,a.forEach(u.clearTimeout),s(d)},p=async d=>{await f,a.forEach(u.clearTimeout),c(d)};if(r?.aborted){let d=D(r);p(d);return}let g=t.headers??{},x=(g.Expect??g.expect)==="100-continue",T=i?n.httpsAgent:n.httpAgent;x&&!this.externalAgent&&(T=new(i?O:C)({keepAlive:!1,maxSockets:1/0})),a.push(u.setTimeout(()=>{this.socketWarningTimestamp=e.checkSocketUsage(T,this.socketWarningTimestamp,n.logger)},n.socketAcquisitionWarningTimeout??(n.requestTimeout??2e3)+(n.connectionTimeout??1e3)));let P=Y(t.query||{}),L;if(t.username!=null||t.password!=null){let d=t.username??"",y=t.password??"";L=`${d}:${y}`}let M=t.path;P&&(M+=`?${P}`),t.fragment&&(M+=`#${t.fragment}`);let b=t.hostname??"";b[0]==="["&&b.endsWith("]")?b=t.hostname.slice(1,-1):b=t.hostname;let B={headers:t.headers,host:b,method:t.method,path:M,port:t.port,agent:T,auth:L},l=(i?ge:te)(B,d=>{let y=new $({statusCode:d.statusCode||-1,reason:d.statusMessage,headers:V(d.headers),body:d});m({response:y})});if(l.on("error",d=>{K.includes(d.code)?p(Object.assign(d,{name:"TimeoutError"})):p(d)}),r){let d=()=>{l.destroy();let y=D(r);p(y)};if(typeof r.addEventListener=="function"){let y=r;y.addEventListener("abort",d,{once:!0}),l.once("close",()=>y.removeEventListener("abort",d))}else r.onabort=d}let j=o??n.requestTimeout;a.push(z(l,p,n.connectionTimeout)),a.push(G(l,p,j,n.throwOnRequestTimeout,n.logger??console)),a.push(q(l,p,n.socketTimeout));let A=B.agent;typeof A=="object"&&"keepAlive"in A&&a.push(Z(l,{keepAlive:A.keepAlive,keepAliveMsecs:A.keepAliveMsecs})),f=ee(l,t,j,this.externalAgent).catch(d=>(a.forEach(u.clearTimeout),c(d)))})}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(o=>({...o,[t]:r}))}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(t){let{requestTimeout:r,connectionTimeout:o,socketTimeout:n,socketAcquisitionWarningTimeout:i,httpAgent:s,httpsAgent:c,throwOnRequestTimeout:f,logger:a}=t||{},m=!0,p=50;return{connectionTimeout:o,requestTimeout:r,socketTimeout:n,socketAcquisitionWarningTimeout:i,throwOnRequestTimeout:f,httpAgentProvider:async()=>{let{Agent:g,request:x}=await import("http");return te=x,C=g,s instanceof C||typeof s?.destroy=="function"?(this.externalAgent=!0,s):new C({keepAlive:m,maxSockets:p,...s})},httpsAgent:c instanceof O||typeof c?.destroy=="function"?(this.externalAgent=!0,c):new O({keepAlive:m,maxSockets:p,...c}),logger:a}}};import{Writable as le}from"stream";var R=class extends le{bufferedBytes=[];_write(t,r,o){this.bufferedBytes.push(t),o()}};var bt=e=>ye(e)?Te(e):new Promise((t,r)=>{let o=new R;e.pipe(o),e.on("error",n=>{o.end(),r(n)}),o.on("error",r),o.on("finish",function(){let n=new Uint8Array(Buffer.concat(this.bufferedBytes));t(n)})}),ye=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream;async function Te(e){let t=[],r=e.getReader(),o=!1,n=0;for(;!o;){let{done:c,value:f}=await r.read();f&&(t.push(f),n+=f.length),o=c}let i=new Uint8Array(n),s=0;for(let c of t)i.set(c,s),s+=c.length;return i}var k=e=>{if(e!=null){if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Ae.warn(Se(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},Ee=Math.ceil(34028234663852886e22),ne=e=>{let t=k(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>Ee)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},we=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}};var oe=e=>ie(e,16),se=e=>ie(e,8),ie=(e,t)=>{let r=we(e);if(r!==void 0&&xe(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},xe=(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]}};var ce=e=>k(typeof e=="string"?N(e):e);var fe=e=>ne(typeof e=="string"?N(e):e),be=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,N=e=>{let t=e.match(be);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)};var E=e=>oe(typeof e=="string"?N(e):e),ae=e=>se(typeof e=="string"?N(e):e),Se=e=>String(new TypeError(e).stack||e).split(`
|
|
4
|
+
`).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
|
|
5
|
+
`),Ae={warn:console.warn};var $e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],F=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function It(e){let t=e.getUTCFullYear(),r=e.getUTCMonth(),o=e.getUTCDay(),n=e.getUTCDate(),i=e.getUTCHours(),s=e.getUTCMinutes(),c=e.getUTCSeconds(),f=n<10?`0${n}`:`${n}`,a=i<10?`0${i}`:`${i}`,m=s<10?`0${s}`:`${s}`,p=c<10?`0${c}`:`${c}`;return`${$e[o]}, ${f} ${F[r]} ${t} ${a}:${m}:${p} GMT`}var Ie=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ct=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=Ie.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,o,n,i,s,c,f,a]=t,m=E(w(o)),p=h(n,"month",1,12),g=h(i,"day",1,31);return S(m,p,g,{hours:s,minutes:c,seconds:f,fractionalMilliseconds:a})},Ce=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Rt=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=Ce.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,o,n,i,s,c,f,a,m]=t,p=E(w(o)),g=h(n,"month",1,12),x=h(i,"day",1,31),T=S(p,g,x,{hours:s,minutes:c,seconds:f,fractionalMilliseconds:a});return m.toUpperCase()!="Z"&&T.setTime(T.getTime()-Le(m)),T},Re=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$/),Ne=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$/),Me=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})$/),Nt=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=Re.exec(e);if(t){let[r,o,n,i,s,c,f,a]=t;return S(E(w(i)),U(n),h(o,"day",1,31),{hours:s,minutes:c,seconds:f,fractionalMilliseconds:a})}if(t=Ne.exec(e),t){let[r,o,n,i,s,c,f,a]=t;return ke(S(De(i),U(n),h(o,"day",1,31),{hours:s,minutes:c,seconds:f,fractionalMilliseconds:a}))}if(t=Me.exec(e),t){let[r,o,n,i,s,c,f,a]=t;return S(E(w(a)),U(o),h(n.trimLeft(),"day",1,31),{hours:i,minutes:s,seconds:c,fractionalMilliseconds:f})}throw new TypeError("Invalid RFC-7231 date-time value")},Mt=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=ce(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},S=(e,t,r,o)=>{let n=t-1;return Fe(e,n,r),new Date(Date.UTC(e,n,r,h(o.hours,"hour",0,23),h(o.minutes,"minute",0,59),h(o.seconds,"seconds",0,60),Pe(o.fractionalMilliseconds)))},De=e=>{let t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+E(w(e));return r<t?r+100:r},Oe=50*365*24*60*60*1e3,ke=e=>e.getTime()-new Date().getTime()>Oe?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,U=e=>{let t=F.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},Ue=[31,28,31,30,31,30,31,31,30,31,30,31],Fe=(e,t,r)=>{let o=Ue[t];if(t===1&&_e(e)&&(o=29),r>o)throw new TypeError(`Invalid day for ${F[t]} in ${e}: ${r}`)},_e=e=>e%4===0&&(e%100!==0||e%400===0),h=(e,t,r,o)=>{let n=ae(w(e));if(n<r||n>o)throw new TypeError(`${t} must be between ${r} and ${o}, inclusive`);return n},Pe=e=>e==null?0:fe("0."+e)*1e3,Le=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 o=Number(e.substring(1,3)),n=Number(e.substring(4,6));return r*(o*60+n)*60*1e3},w=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)};var Be=/^[A-Za-z0-9+/]*={0,2}$/,kt=e=>{if(e.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Be.exec(e))throw new TypeError("Invalid base64 string.");let t=W(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};var Pt=e=>{let t;if(typeof e=="string"?t=J(e):t=e,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 H(t.buffer,t.byteOffset,t.byteLength).toString("base64")};var de={},_={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),de[e]=t,_[t]=e}function Bt(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){let o=e.slice(r,r+2).toLowerCase();if(o in _)t[r/2]=_[o];else throw new Error(`Cannot decode unrecognized sequence ${o} as hexadecimal`)}return t}function jt(e){let t="";for(let r=0;r<e.byteLength;r++)t+=de[e[r]];return t}export{$ as a,kt as b,Pt as c,I as d,re as e,bt as f,Bt as g,jt as h,It as i,Ct as j,Rt as k,Nt as l,Mt as m};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as d,c as b,f as p,h as y}from"./chunk-224RJRPV.js";import{b as u,e as m}from"./chunk-XB6R2VIU.js";import{Readable as c}from"stream";var w=async e=>typeof Blob=="function"&&e instanceof Blob||e.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):E(e):x(e);async function E(e){let o=await T(e),n=d(o);return new Uint8Array(n)}async function x(e){let o=[],n=e.getReader(),t=!1,r=0;for(;!t;){let{done:f,value:i}=await n.read();i&&(o.push(i),r+=i.length),t=f}let a=new Uint8Array(r),s=0;for(let f of o)a.set(f,s),s+=f.length;return a}function T(e){return new Promise((o,n)=>{let t=new FileReader;t.onloadend=()=>{if(t.readyState!==2)return n(new Error("Reader aborted too early"));let r=t.result??"",a=r.indexOf(","),s=a>-1?a+1:r.length;o(r.substring(s))},t.onabort=()=>n(new Error("Read aborted")),t.onerror=()=>n(t.error),t.readAsDataURL(e)})}var l=e=>typeof ReadableStream=="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream);var h="The stream has already been transformed.",S=e=>{if(!B(e)&&!l(e)){let r=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${r}`)}let o=!1,n=async()=>{if(o)throw new Error(h);return o=!0,await w(e)},t=r=>{if(typeof r.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
2
|
+
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return r.stream()};return Object.assign(e,{transformToByteArray:n,transformToString:async r=>{let a=await n();if(r==="base64")return b(a);if(r==="hex")return y(a);if(r===void 0||r==="utf8"||r==="utf-8")return m(a);if(typeof TextDecoder=="function")return new TextDecoder(r).decode(a);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(o)throw new Error(h);if(o=!0,B(e))return t(e);if(l(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},B=e=>typeof Blob=="function"&&e instanceof Blob;var R="The stream has already been transformed.",I=e=>{if(!(e instanceof c))try{return S(e)}catch{let r=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${r}`)}let o=!1,n=async()=>{if(o)throw new Error(R);return o=!0,await p(e)};return Object.assign(e,{transformToByteArray:n,transformToString:async t=>{let r=await n();return t===void 0||Buffer.isEncoding(t)?u(r.buffer,r.byteOffset,r.byteLength).toString(t):new TextDecoder(t).decode(r)},transformToWebStream:()=>{if(o)throw new Error(R);if(e.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof c.toWeb!="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return o=!0,c.toWeb(e)}})};export{I as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(u,o,r){return u.$source||(u.$source={}),u.$source[o]=r,u}export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,b as h,c as f,d as y,f as n,g as i}from"./chunk-QSLKOXQ6.js";import{a as r}from"./chunk-76FD5Z7D.js";import{randomUUID as E}from"crypto";var k=32,v=class{name="local";masterKey;salt;keyVersion;constructor(e){let t=e.masterKey??g();if(!t)throw new Error("Master key required. Set VAULT_LOCAL_MASTER_KEY or VAULT_MASTER_KEY env var, or pass masterKey in config.");if(this.masterKey=Buffer.from(t,"utf-8"),this.masterKey.length<k)throw new Error(`Vault master key too short: ${this.masterKey.length} bytes, need at least ${k}. Set VAULT_LOCAL_MASTER_KEY / VAULT_MASTER_KEY to a value with at least 32 bytes of entropy.`);this.salt=e.salt??Buffer.from("nebutra-vault","utf-8"),this.keyVersion=e.keyVersion??1,r.debug("[vault:local] Initialized",{keyVersion:this.keyVersion})}buildAad(e,t){return Buffer.from(`v2|tenant=${e??""}|kek=${t}`,"utf-8")}async deriveKek(){let e=Buffer.from(`nebutra-vault-kek-v${this.keyVersion}`,"utf-8");return f(this.masterKey,this.salt,e)}async encrypt(e,t){try{let a=await this.deriveKek(),u=y(32),o=this.buildAad(t?.tenantId,this.keyVersion),s=c(u,a,o),l=c(e,u,o),m={id:t?.id??E(),ciphertext:n(l.ciphertext),encryptedDek:n(s.ciphertext),iv:n(l.iv),authTag:n(l.authTag),dekIv:n(s.iv),dekAuthTag:n(s.authTag),keyVersion:this.keyVersion,envelopeVersion:2,algorithm:"aes-256-gcm",...t?.tenantId!==void 0?{tenantId:t.tenantId}:{},...t?.metadata!==void 0?{metadata:t.metadata}:{},createdAt:new Date().toISOString()};return r.debug("[vault:local] Secret encrypted",{id:m.id,tenantId:t?.tenantId}),m}catch(a){throw r.error("[vault:local] Encryption failed",{error:a}),new Error(`Local vault encryption failed: ${a instanceof Error?a.message:String(a)}`)}}async decrypt(e,t){try{if(t?.tenantId&&e.tenantId&&e.tenantId!==t.tenantId)throw new Error("Tenant ID mismatch");e.keyVersion!==this.keyVersion&&r.warn("[vault:local] Key version mismatch",{secretVersion:e.keyVersion,currentVersion:this.keyVersion});let a=Buffer.from(`nebutra-vault-kek-v${e.keyVersion}`,"utf-8"),u=await f(this.masterKey,this.salt,a),o=e.envelopeVersion===2?this.buildAad(e.tenantId,e.keyVersion):void 0,s;if(e.dekIv&&e.dekAuthTag)s=h(i(e.encryptedDek),u,{iv:i(e.dekIv),authTag:i(e.dekAuthTag)},o);else throw new Error("Encrypted DEK missing IV/authTag \u2014 cannot decrypt. Re-encrypt with current version.");let l=h(i(e.ciphertext),s,{iv:i(e.iv),authTag:i(e.authTag)},o);return r.debug("[vault:local] Secret decrypted",{id:e.id,tenantId:t?.tenantId}),l.toString("utf-8")}catch(a){throw r.error("[vault:local] Decryption failed",{error:a}),new Error(`Local vault decryption failed: ${a instanceof Error?a.message:String(a)}`)}}async rotateKey(e){try{let t=await this.decrypt(e),a=await this.encrypt(t,{id:e.id,...e.tenantId!==void 0?{tenantId:e.tenantId}:{},...e.metadata!==void 0?{metadata:{name:e.metadata.name,type:e.metadata.type,...e.metadata.expiresAt!==void 0?{expiresAt:e.metadata.expiresAt}:{}}}:{}});return a.rotatedAt=new Date().toISOString(),r.debug("[vault:local] Key rotated",{id:e.id}),a}catch(t){throw r.error("[vault:local] Key rotation failed",{error:t}),new Error(`Key rotation failed: ${t instanceof Error?t.message:String(t)}`)}}async rotateKek(){this.keyVersion+=1,r.info("[vault:local] KEK rotated",{newVersion:this.keyVersion})}async generateDek(){return y(32)}async close(){r.debug("[vault:local] Closed")}};function g(){let d=process.env.VAULT_MASTER_KEY,e=process.env.VAULT_LOCAL_MASTER_KEY;if(d&&e&&d!==e)throw new Error("Vault local key mismatch: VAULT_MASTER_KEY and VAULT_LOCAL_MASTER_KEY are both set but differ.");return e??d}export{v as a};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{a as I,b as x,d as mi}from"./chunk-FSRPMVAS.js";var He=x((Ra,fr)=>{"use strict";var ue=e=>e&&typeof e.message=="string",Je=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let r=e.cause();return ue(r)?r:void 0}else return ue(t)?t:void 0},sr=(e,t)=>{if(!ue(e))return"";let r=e.stack||"";if(t.has(e))return r+`
|
|
2
|
+
causes have become circular...`;let n=Je(e);return n?(t.add(e),r+`
|
|
3
|
+
caused by: `+sr(n,t)):r},$i=e=>sr(e,new Set),or=(e,t,r)=>{if(!ue(e))return"";let n=r?"":e.message||"";if(t.has(e))return n+": ...";let i=Je(e);if(i){t.add(e);let s=typeof e.cause=="function";return n+(s?"":": ")+or(i,t,s)}else return n},qi=e=>or(e,new Set);fr.exports={isErrorLike:ue,getErrorCause:Je,stackWithCauses:$i,messageWithCauses:qi}});var Xe=x((Ba,ur)=>{"use strict";var Vi=Symbol("circular-ref-tag"),Se=Symbol("pino-raw-err-ref"),lr=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Se]},set:function(e){this[Se]=e}}});Object.defineProperty(lr,Se,{writable:!0,value:{}});ur.exports={pinoErrProto:lr,pinoErrorSymbols:{seen:Vi,rawSymbol:Se}}});var hr=x((ja,cr)=>{"use strict";cr.exports=Qe;var{messageWithCauses:Wi,stackWithCauses:Mi,isErrorLike:ar}=He(),{pinoErrProto:Fi,pinoErrorSymbols:zi}=Xe(),{seen:Ye}=zi,{toString:Gi}=Object.prototype;function Qe(e){if(!ar(e))return e;e[Ye]=void 0;let t=Object.create(Fi);t.type=Gi.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=Wi(e),t.stack=Mi(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Qe(r)));for(let r in e)if(t[r]===void 0){let n=e[r];ar(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Ye)&&(t[r]=Qe(n)):t[r]=n}return delete e[Ye],t.raw=e,t}});var pr=x(($a,dr)=>{"use strict";dr.exports=we;var{isErrorLike:Ze}=He(),{pinoErrProto:Ki,pinoErrorSymbols:Ui}=Xe(),{seen:be}=Ui,{toString:Ji}=Object.prototype;function we(e){if(!Ze(e))return e;e[be]=void 0;let t=Object.create(Ki);t.type=Ji.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>we(r))),Ze(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,be)&&(t.cause=we(e.cause));for(let r in e)if(t[r]===void 0){let n=e[r];Ze(n)?Object.prototype.hasOwnProperty.call(n,be)||(t[r]=we(n)):t[r]=n}return delete e[be],t.raw=e,t}});var Sr=x((qa,mr)=>{"use strict";mr.exports={mapHttpRequest:Hi,reqSerializer:gr};var et=Symbol("pino-raw-req-ref"),yr=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[et]},set:function(e){this[et]=e}}});Object.defineProperty(yr,et,{writable:!0,value:{}});function gr(e){let t=e.info||e.socket,r=Object.create(yr);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else{let n=e.path;r.url=typeof n=="string"?n:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function Hi(e){return{req:gr(e)}}});var vr=x((Va,_r)=>{"use strict";_r.exports={mapHttpResponse:Xi,resSerializer:wr};var tt=Symbol("pino-raw-res-ref"),br=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[tt]},set:function(e){this[tt]=e}}});Object.defineProperty(br,tt,{writable:!0,value:{}});function wr(e){let t=Object.create(br);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function Xi(e){return{res:wr(e)}}});var nt=x((Wa,xr)=>{"use strict";var rt=hr(),Yi=pr(),_e=Sr(),ve=vr();xr.exports={err:rt,errWithCause:Yi,mapHttpRequest:_e.mapHttpRequest,mapHttpResponse:ve.mapHttpResponse,req:_e.reqSerializer,res:ve.resSerializer,wrapErrorSerializer:function(t){return t===rt?t:function(n){return t(rt(n))}},wrapRequestSerializer:function(t){return t===_e.reqSerializer?t:function(n){return t(_e.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===ve.resSerializer?t:function(n){return t(ve.resSerializer(n))}}}});var it=x((Ma,Er)=>{"use strict";function Qi(e,t){return t}Er.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=Qi;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let s of n)s&&i.push(s.getFileName());return i}});var Nr=x((Fa,Ir)=>{"use strict";function st(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=st(e[r]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=st(e[r]));return t}return e}function Or(e){let t=[],r="",n=!1,i=!1,s="";for(let f=0;f<e.length;f++){let l=e[f];!n&&l==="."?r&&(t.push(r),r=""):l==="["?(r&&(t.push(r),r=""),n=!0):l==="]"&&n?(t.push(r),r="",n=!1,i=!1):(l==='"'||l==="'")&&n?i?l===s?(i=!1,s=""):r+=l:(i=!0,s=l):r+=l}return r&&t.push(r),t}function Ar(e,t,r){let n=e;for(let s=0;s<t.length-1;s++){let f=t[s];if(typeof n!="object"||n===null||!(f in n)||typeof n[f]!="object"||n[f]===null)return!1;n=n[f]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]=r;else if(typeof n=="object"&&n!==null)for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r)}else typeof n=="object"&&n!==null&&i in n&&Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r);return!0}function Tr(e,t){let r=e;for(let i=0;i<t.length-1;i++){let s=t[i];if(typeof r!="object"||r===null||!(s in r)||typeof r[s]!="object"||r[s]===null)return!1;r=r[s]}let n=t[t.length-1];if(n==="*"){if(Array.isArray(r))for(let i=0;i<r.length;i++)r[i]=void 0;else if(typeof r=="object"&&r!==null)for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var xe=Symbol("PATH_NOT_FOUND");function Zi(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null||!(n in r))return xe;r=r[n]}return r}function es(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function ts(e,t,r,n=!1){for(let i of t){let s=Or(i);if(s.includes("*"))Cr(e,s,r,i,n);else if(n)Tr(e,s);else{let f=Zi(e,s);if(f===xe)continue;let l=typeof r=="function"?r(f,s):r;Ar(e,s,l)}}}function Cr(e,t,r,n,i=!1){let s=t.indexOf("*");if(s===t.length-1){let f=t.slice(0,-1),l=e;for(let u of f){if(l==null||typeof l!="object"||l===null)return;l=l[u]}if(Array.isArray(l))if(i)for(let u=0;u<l.length;u++)l[u]=void 0;else for(let u=0;u<l.length;u++){let h=[...f,u.toString()],d=typeof r=="function"?r(l[u],h):r;l[u]=d}else if(typeof l=="object"&&l!==null)if(i){let u=[];for(let h in l)Object.prototype.hasOwnProperty.call(l,h)&&u.push(h);for(let h of u)delete l[h]}else for(let u in l){let h=[...f,u],d=typeof r=="function"?r(l[u],h):r;l[u]=d}}else rs(e,t,r,s,n,i)}function rs(e,t,r,n,i,s=!1){let f=t.slice(0,n),l=t.slice(n+1),u=[];function h(d,a){if(a===f.length){if(Array.isArray(d))for(let g=0;g<d.length;g++)u[a]=g.toString(),h(d[g],a+1);else if(typeof d=="object"&&d!==null)for(let g in d)u[a]=g,h(d[g],a+1)}else if(a<f.length){let g=f[a];d&&typeof d=="object"&&d!==null&&g in d&&(u[a]=g,h(d[g],a+1))}else if(l.includes("*"))Cr(d,l,typeof r=="function"?(p,o)=>{let y=[...u.slice(0,a),...o];return r(p,y)}:r,i,s);else if(s)Tr(d,l);else{let g=typeof r=="function"?r(es(d,l),[...u.slice(0,a),...l]):r;Ar(d,l,g)}}if(f.length===0)h(e,0);else{let d=e;for(let a=0;a<f.length;a++){let g=f[a];if(d==null||typeof d!="object"||d===null)return;d=d[g],u[a]=g}d!=null&&h(d,f.length)}}function ns(e){if(e.length===0)return null;let t=new Map;for(let r of e){let n=Or(r),i=t;for(let s=0;s<n.length;s++){let f=n[s];i.has(f)||i.set(f,new Map),i=i.get(f)}}return t}function is(e,t){if(!t)return e;function r(n,i,s=0){if(!i||i.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let l=[];for(let u=0;u<n.length;u++){let h=u.toString();i.has(h)||i.has("*")?l[u]=r(n[u],i.get(h)||i.get("*")):l[u]=n[u]}return l}let f=Object.create(Object.getPrototypeOf(n));for(let l in n)Object.prototype.hasOwnProperty.call(n,l)&&(i.has(l)||i.has("*")?f[l]=r(n[l],i.get(l)||i.get("*")):f[l]=n[l]);return f}return r(e,t)}function ss(e){if(typeof e!="string")throw new Error("Paths must be (non-empty) strings");if(e==="")throw new Error("Invalid redaction path ()");if(e.includes(".."))throw new Error(`Invalid redaction path (${e})`);if(e.includes(","))throw new Error(`Invalid redaction path (${e})`);let t=0,r=!1,n="";for(let i=0;i<e.length;i++){let s=e[i];if((s==='"'||s==="'")&&t>0)r?s===n&&(r=!1,n=""):(r=!0,n=s);else if(s==="["&&!r)t++;else if(s==="]"&&!r&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function os(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)ss(t)}function fs(e={}){let{paths:t=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:i=!0,remove:s=!1}=e;os(t);let f=ns(t);return function(u){if(i&&(u===null||typeof u!="object")&&(u==null||typeof u!="object"))return n?n(u):u;let h=is(u,f),d=u,a=r;return typeof r=="function"&&(a=r),ts(h,t,a,s),n===!1?(h.restore=function(){return st(d)},h):typeof n=="function"?n(h):JSON.stringify(h)}}Ir.exports=fs});var re=x((za,Pr)=>{"use strict";var ls=Symbol("pino.setLevel"),us=Symbol("pino.getLevel"),as=Symbol("pino.levelVal"),cs=Symbol("pino.levelComp"),hs=Symbol("pino.useLevelLabels"),ds=Symbol("pino.useOnlyCustomLevels"),ps=Symbol("pino.mixin"),ys=Symbol("pino.lsCache"),gs=Symbol("pino.chindings"),ms=Symbol("pino.asJson"),Ss=Symbol("pino.write"),bs=Symbol("pino.redactFmt"),ws=Symbol("pino.time"),_s=Symbol("pino.timeSliceIndex"),vs=Symbol("pino.stream"),xs=Symbol("pino.stringify"),Es=Symbol("pino.stringifySafe"),Os=Symbol("pino.stringifiers"),As=Symbol("pino.end"),Ts=Symbol("pino.formatOpts"),Cs=Symbol("pino.messageKey"),Is=Symbol("pino.errorKey"),Ns=Symbol("pino.nestedKey"),Ps=Symbol("pino.nestedKeyStr"),Ls=Symbol("pino.mixinMergeStrategy"),Ds=Symbol("pino.msgPrefix"),ks=Symbol("pino.wildcardFirst"),Rs=Symbol.for("pino.serializers"),Bs=Symbol.for("pino.formatters"),js=Symbol.for("pino.hooks"),$s=Symbol.for("pino.metadata");Pr.exports={setLevelSym:ls,getLevelSym:us,levelValSym:as,levelCompSym:cs,useLevelLabelsSym:hs,mixinSym:ps,lsCacheSym:ys,chindingsSym:gs,asJsonSym:ms,writeSym:Ss,serializersSym:Rs,redactFmtSym:bs,timeSym:ws,timeSliceIndexSym:_s,streamSym:vs,stringifySym:xs,stringifySafeSym:Es,stringifiersSym:Os,endSym:As,formatOptsSym:Ts,messageKeySym:Cs,errorKeySym:Is,nestedKeySym:Ns,wildcardFirstSym:ks,needsMetadataGsym:$s,useOnlyCustomLevelsSym:ds,formattersSym:Bs,hooksSym:js,nestedKeyStrSym:Ps,mixinMergeStrategySym:Ls,msgPrefixSym:Ds}});var ft=x((Ga,Rr)=>{"use strict";var Lr=Nr(),{redactFmtSym:qs,wildcardFirstSym:Ee}=re(),ot=/[^.[\]]+|\[([^[\]]*?)\]/g,Dr="[Redacted]",kr=!1;function Vs(e,t){let{paths:r,censor:n,remove:i}=Ws(e),s=r.reduce((u,h)=>{ot.lastIndex=0;let d=ot.exec(h),a=ot.exec(h),g=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(g==="*"&&(g=Ee),a===null)return u[g]=null,u;if(u[g]===null)return u;let{index:p}=a,o=`${h.substr(p,h.length-1)}`;return u[g]=u[g]||[],g!==Ee&&u[g].length===0&&u[g].push(...u[Ee]||[]),g===Ee&&Object.keys(u).forEach(function(y){u[y]&&u[y].push(o)}),u[g].push(o),u},{}),f={[qs]:Lr({paths:r,censor:n,serialize:t,strict:kr,remove:i})},l=(...u)=>t(typeof n=="function"?n(...u):n);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((u,h)=>{if(s[h]===null)u[h]=d=>l(d,[h]);else{let d=typeof n=="function"?(a,g)=>n(a,[h,...g]):n;u[h]=Lr({paths:s[h],censor:d,serialize:t,strict:kr,remove:i})}return u},f)}function Ws(e){if(Array.isArray(e))return e={paths:e,censor:Dr},e;let{paths:t,censor:r=Dr,remove:n}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:t,censor:r,remove:n}}Rr.exports=Vs});var $r=x((Ka,jr)=>{"use strict";var Ms=()=>"",Fs=()=>`,"time":${Date.now()}`,zs=()=>`,"time":${Math.round(Date.now()/1e3)}`,Gs=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,Ks=1000000n,Br=1000000000n,Us=BigInt(Date.now())*Ks,Js=process.hrtime.bigint(),Hs=()=>{let e=process.hrtime.bigint()-Js,t=Us+e,r=t/Br,n=t%Br,i=Number(r*1000n+n/1000000n),s=new Date(i),f=s.getUTCFullYear(),l=(s.getUTCMonth()+1).toString().padStart(2,"0"),u=s.getUTCDate().toString().padStart(2,"0"),h=s.getUTCHours().toString().padStart(2,"0"),d=s.getUTCMinutes().toString().padStart(2,"0"),a=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${f}-${l}-${u}T${h}:${d}:${a}.${n.toString().padStart(9,"0")}Z"`};jr.exports={nullTime:Ms,epochTime:Fs,unixTime:zs,isoTime:Gs,isoTimeNano:Hs}});var Vr=x((Ua,qr)=>{"use strict";function Xs(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}qr.exports=Ys;function Ys(e,t,r){var n=r&&r.stringify||Xs,i=1;if(typeof e=="object"&&e!==null){var s=t.length+i;if(s===1)return e;var f=new Array(s);f[0]=n(e);for(var l=1;l<s;l++)f[l]=n(t[l]);return f.join(" ")}if(typeof e!="string")return e;var u=t.length;if(u===0)return e;for(var h="",d=1-i,a=-1,g=e&&e.length||0,p=0;p<g;){if(e.charCodeAt(p)===37&&p+1<g){switch(a=a>-1?a:0,e.charCodeAt(p+1)){case 100:case 102:if(d>=u||t[d]==null)break;a<p&&(h+=e.slice(a,p)),h+=Number(t[d]),a=p+2,p++;break;case 105:if(d>=u||t[d]==null)break;a<p&&(h+=e.slice(a,p)),h+=Math.floor(Number(t[d])),a=p+2,p++;break;case 79:case 111:case 106:if(d>=u||t[d]===void 0)break;a<p&&(h+=e.slice(a,p));var o=typeof t[d];if(o==="string"){h+="'"+t[d]+"'",a=p+2,p++;break}if(o==="function"){h+=t[d].name||"<anonymous>",a=p+2,p++;break}h+=n(t[d]),a=p+2,p++;break;case 115:if(d>=u)break;a<p&&(h+=e.slice(a,p)),h+=String(t[d]),a=p+2,p++;break;case 37:a<p&&(h+=e.slice(a,p)),h+="%",a=p+2,p++,d--;break}++d}++p}return a===-1?e:(a<g&&(h+=e.slice(a)),h)}});var ut=x((Ja,lt)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r))},e=new Int32Array(new SharedArrayBuffer(4));lt.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(t);for(;n>Date.now(););};lt.exports=e}});var Jr=x((Ha,Ur)=>{"use strict";var A=I("fs"),Qs=I("events"),Zs=I("util").inherits,Wr=I("path"),ct=ut(),eo=I("assert"),Oe=100,Ae=Buffer.allocUnsafe(0),to=16*1024,Mr="buffer",Fr="utf8",[ro,no]=(process.versions.node||"0.0").split(".").map(Number),io=ro>=22&&no>=7;function zr(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(s,f){if(s){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",s)}):t.emit("error",s);return}let l=t._reopening;t.fd=f,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():l&&process.nextTick(()=>t.emit("drain")))}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&A.mkdirSync(Wr.dirname(e),{recursive:!0});let s=A.openSync(e,n,i);r(null,s)}catch(s){throw r(s),s}else t.mkdir?A.mkdir(Wr.dirname(e),{recursive:!0},s=>{if(s)return r(s);A.open(e,n,i,r)}):A.open(e,n,i,r)}function q(e){if(!(this instanceof q))return new q(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:s,periodicFlush:f,sync:l,append:u=!0,mkdir:h,retryEAGAIN:d,fsync:a,contentMode:g,mode:p}=e||{};t=t||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=s||to,this._periodicFlush=f||0,this._periodicFlushTimer=void 0,this.sync=l||!1,this.writable=!0,this._fsync=a||!1,this.append=u||!1,this.mode=p,this.retryEAGAIN=d||(()=>!0),this.mkdir=h||!1;let o,y;if(g===Mr)this._writingBuf=Ae,this.write=fo,this.flush=uo,this.flushSync=co,this._actualWrite=po,o=()=>A.writeSync(this.fd,this._writingBuf),y=()=>A.write(this.fd,this._writingBuf,this.release);else if(g===void 0||g===Fr)this._writingBuf="",this.write=oo,this.flush=lo,this.flushSync=ao,this._actualWrite=ho,o=()=>Buffer.isBuffer(this._writingBuf)?A.writeSync(this.fd,this._writingBuf):A.writeSync(this.fd,this._writingBuf,"utf8"),y=()=>Buffer.isBuffer(this._writingBuf)?A.write(this.fd,this._writingBuf,this.release):A.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${Fr}" and "${Mr}", but passed ${g}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")zr(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(m,b)=>{if(m){if((m.code==="EAGAIN"||m.code==="EBUSY")&&this.retryEAGAIN(m,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{ct(Oe),this.release(void 0,0)}catch(_){this.release(_)}else setTimeout(y,Oe);else this._writing=!1,this.emit("error",m);return}this.emit("write",b);let w=at(this._writingBuf,this._len,b);if(this._len=w.len,this._writingBuf=w.writingBuf,this._writingBuf.length){if(!this.sync){y();return}try{do{let _=o(),O=at(this._writingBuf,this._len,_);this._len=O.len,this._writingBuf=O.writingBuf}while(this._writingBuf.length)}catch(_){this.release(_);return}}this._fsync&&A.fsyncSync(this.fd);let S=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):S>this.minLength?this._actualWrite():this._ending?S>0?this._actualWrite():(this._writing=!1,Te(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(so,this)):this.emit("drain"))},this.on("newListener",function(m){m==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function at(e,t,r){return typeof e=="string"&&(e=Buffer.from(e)),t=Math.max(t-r,0),e=e.subarray(r),{writingBuf:e,len:t}}function so(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}Zs(q,Qs);function Gr(e,t){return e.length===0?Ae:e.length===1?e[0]:Buffer.concat(e,t)}function oo(e){if(this.destroyed)throw new Error("SonicBoom destroyed");e=""+e;let t=Buffer.byteLength(e),r=this._len+t,n=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(n.length===0||Buffer.byteLength(n[n.length-1])+t>this.maxWrite?n.push(e):n[n.length-1]+=e,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function fo(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs,n=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||n[n.length-1]+e.length>this.maxWrite?(r.push([e]),n.push(e.length)):(r[r.length-1].push(e),n[n.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Kr(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{A.fsync(this.fd,n=>{this._flushPending=!1,e(n)})}catch(n){e(n)}this.off("error",r)},r=n=>{this._flushPending=!1,e(n),this.off("drain",t)};this.once("drain",t),this.once("error",r)}function lo(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&Kr.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function uo(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&Kr.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}q.prototype.reopen=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&A.close(t,r=>{if(r)return this.emit("error",r)})}),zr(this.file,this)};q.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():Te(this)))};function ao(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let e="";for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?A.writeSync(this.fd,e):A.writeSync(this.fd,e,"utf8"),r=at(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;ct(Oe)}}try{A.fsyncSync(this.fd)}catch{}}function co(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=Ae);let e=Ae;for(;this._bufs.length||e.length;){e.length<=0&&(e=Gr(this._bufs[0],this._lens[0]));try{let t=A.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;ct(Oe)}}}q.prototype.destroy=function(){this.destroyed||Te(this)};function ho(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?A.writeSync(this.fd,this._writingBuf):A.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else A.write(this.fd,this._writingBuf,e)}function po(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:Gr(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=A.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else io&&(this._writingBuf=Buffer.from(this._writingBuf)),A.write(this.fd,this._writingBuf,e)}function Te(e){if(e.fd===-1){e.once("ready",Te.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],eo(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{A.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?A.close(e.fd,r):r()}function r(n){if(n){e.emit("error",n);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}q.SonicBoom=q;q.default=q;Ur.exports=q});var ht=x((Xa,Zr)=>{"use strict";var V={exit:[],beforeExit:[]},Hr={exit:mo,beforeExit:So},ne;function yo(){ne===void 0&&(ne=new FinalizationRegistry(bo))}function go(e){V[e].length>0||process.on(e,Hr[e])}function Xr(e){V[e].length>0||(process.removeListener(e,Hr[e]),V.exit.length===0&&V.beforeExit.length===0&&(ne=void 0))}function mo(){Yr("exit")}function So(){Yr("beforeExit")}function Yr(e){for(let t of V[e]){let r=t.deref(),n=t.fn;r!==void 0&&n(r,e)}V[e]=[]}function bo(e){for(let t of["exit","beforeExit"]){let r=V[t].indexOf(e);V[t].splice(r,r+1),Xr(t)}}function Qr(e,t,r){if(t===void 0)throw new Error("the object can't be undefined");go(e);let n=new WeakRef(t);n.fn=r,yo(),ne.register(t,n),V[e].push(n)}function wo(e,t){Qr("exit",e,t)}function _o(e,t){Qr("beforeExit",e,t)}function vo(e){if(ne!==void 0){ne.unregister(e);for(let t of["exit","beforeExit"])V[t]=V[t].filter(r=>{let n=r.deref();return n&&n!==e}),Xr(t)}}Zr.exports={register:wo,registerBeforeExit:_o,unregister:vo}});var en=x((Ya,xo)=>{xo.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var rn=x((Qa,tn)=>{"use strict";function Eo(e,t,r,n,i){let s=n===1/0?1/0:Date.now()+n,f=()=>{let l=Atomics.load(e,t);if(l===r){i(null,"ok");return}if(s!==1/0&&Date.now()>s){i(null,"timed-out");return}let u=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),h=Atomics.waitAsync(e,t,l,u);h.async?h.value.then(f):setImmediate(f)};f()}function Oo(e,t,r,n,i){let s=n===1/0?1/0:Date.now()+n,f=()=>{if(Atomics.load(e,t)!==r){i(null,"ok");return}if(s!==1/0&&Date.now()>s){i(null,"timed-out");return}let u=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),h=Atomics.waitAsync(e,t,r,u);h.async?h.value.then(f):setImmediate(f)};f()}tn.exports={wait:Eo,waitDiff:Oo}});var sn=x((Za,nn)=>{"use strict";nn.exports={WRITE_INDEX:4,READ_INDEX:8}});var an=x((ec,un)=>{"use strict";var{version:Ao}=en(),{EventEmitter:To}=I("events"),{Worker:Co}=I("worker_threads"),{join:Io}=I("path"),{pathToFileURL:No}=I("url"),{wait:Po}=rn(),{WRITE_INDEX:R,READ_INDEX:k}=sn(),Lo=I("buffer"),Do=I("assert"),c=Symbol("kImpl"),ko=Lo.constants.MAX_STRING_LENGTH,ae=class{constructor(t){this._value=t}deref(){return this._value}},Ie=class{register(){}unregister(){}},Ro=process.env.NODE_V8_COVERAGE?Ie:global.FinalizationRegistry||Ie,Bo=process.env.NODE_V8_COVERAGE?ae:global.WeakRef||ae,on=new Ro(e=>{e.exited||e.terminate()});function jo(e,t){let{filename:r,workerData:n}=t,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||Io(__dirname,"lib","worker.js"),f=new Co(s,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:No(r).href,dataBuf:e[c].dataBuf,stateBuf:e[c].stateBuf,workerData:{$context:{threadStreamVersion:Ao},...n}}});return f.stream=new ae(e),f.on("message",$o),f.on("exit",ln),on.register(e,f),f}function fn(e){Do(!e[c].sync),e[c].needDrain&&(e[c].needDrain=!1,e.emit("drain"))}function Ce(e){let t=Atomics.load(e[c].state,R),r=e[c].data.length-t;if(r>0){if(e[c].buf.length===0){e[c].flushing=!1,e[c].ending?mt(e):e[c].needDrain&&process.nextTick(fn,e);return}let n=e[c].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[c].buf=e[c].buf.slice(r),Ne(e,n,Ce.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[c].state,k,0),Atomics.store(e[c].state,R,0),Atomics.notify(e[c].state,k);i>e[c].data.length;)r=r/2,n=e[c].buf.slice(0,r),i=Buffer.byteLength(n);e[c].buf=e[c].buf.slice(r),Ne(e,n,Ce.bind(null,e))}})}else if(r===0){if(t===0&&e[c].buf.length===0)return;e.flush(()=>{Atomics.store(e[c].state,k,0),Atomics.store(e[c].state,R,0),Atomics.notify(e[c].state,k),Ce(e)})}else W(e,new Error("overwritten"))}function $o(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new Bo(t),t.flush(()=>{t[c].ready=!0,t.emit("ready")});break;case"ERROR":W(t,e.err);break;case"EVENT":Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case"WARNING":process.emitWarning(e.err);break;default:W(t,new Error("this should not happen: "+e.code))}}function ln(e){let t=this.stream.deref();t!==void 0&&(on.unregister(t),t.worker.exited=!0,t.worker.off("exit",ln),W(t,e!==0?new Error("the worker thread exited"):null))}var pt=class extends To{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[c]={},this[c].stateBuf=new SharedArrayBuffer(128),this[c].state=new Int32Array(this[c].stateBuf),this[c].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[c].data=Buffer.from(this[c].dataBuf),this[c].sync=t.sync||!1,this[c].ending=!1,this[c].ended=!1,this[c].needDrain=!1,this[c].destroyed=!1,this[c].flushing=!1,this[c].ready=!1,this[c].finished=!1,this[c].errored=null,this[c].closed=!1,this[c].buf="",this.worker=jo(this,t),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(t){if(this[c].destroyed)return yt(this,new Error("the worker has exited")),!1;if(this[c].ending)return yt(this,new Error("the worker is ending")),!1;if(this[c].flushing&&this[c].buf.length+t.length>=ko)try{dt(this),this[c].flushing=!0}catch(r){return W(this,r),!1}if(this[c].buf+=t,this[c].sync)try{return dt(this),!0}catch(r){return W(this,r),!1}return this[c].flushing||(this[c].flushing=!0,setImmediate(Ce,this)),this[c].needDrain=this[c].data.length-this[c].buf.length-Atomics.load(this[c].state,R)<=0,!this[c].needDrain}end(){this[c].destroyed||(this[c].ending=!0,mt(this))}flush(t){if(this[c].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[c].state,R);Po(this[c].state,k,r,1/0,(n,i)=>{if(n){W(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[c].destroyed||(dt(this),gt(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[c].ready}get destroyed(){return this[c].destroyed}get closed(){return this[c].closed}get writable(){return!this[c].destroyed&&!this[c].ending}get writableEnded(){return this[c].ending}get writableFinished(){return this[c].finished}get writableNeedDrain(){return this[c].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[c].errored}};function yt(e,t){setImmediate(()=>{e.emit("error",t)})}function W(e,t){e[c].destroyed||(e[c].destroyed=!0,t&&(e[c].errored=t,yt(e,t)),e.worker.exited?setImmediate(()=>{e[c].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[c].closed=!0,e.emit("close")}))}function Ne(e,t,r){let n=Atomics.load(e[c].state,R),i=Buffer.byteLength(t);return e[c].data.write(t,n),Atomics.store(e[c].state,R,n+i),Atomics.notify(e[c].state,R),r(),!0}function mt(e){if(!(e[c].ended||!e[c].ending||e[c].flushing)){e[c].ended=!0;try{e.flushSync();let t=Atomics.load(e[c].state,k);Atomics.store(e[c].state,R,-1),Atomics.notify(e[c].state,R);let r=0;for(;t!==-1;){if(Atomics.wait(e[c].state,k,t,1e3),t=Atomics.load(e[c].state,k),t===-2){W(e,new Error("end() failed"));return}if(++r===10){W(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[c].finished=!0,e.emit("finish")})}catch(t){W(e,t)}}}function dt(e){let t=()=>{e[c].ending?mt(e):e[c].needDrain&&process.nextTick(fn,e)};for(e[c].flushing=!1;e[c].buf.length!==0;){let r=Atomics.load(e[c].state,R),n=e[c].data.length-r;if(n===0){gt(e),Atomics.store(e[c].state,k,0),Atomics.store(e[c].state,R,0),Atomics.notify(e[c].state,k);continue}else if(n<0)throw new Error("overwritten");let i=e[c].buf.slice(0,n),s=Buffer.byteLength(i);if(s<=n)e[c].buf=e[c].buf.slice(n),Ne(e,i,t);else{for(gt(e),Atomics.store(e[c].state,k,0),Atomics.store(e[c].state,R,0),Atomics.notify(e[c].state,k);s>e[c].buf.length;)n=n/2,i=e[c].buf.slice(0,n),s=Buffer.byteLength(i);e[c].buf=e[c].buf.slice(n),Ne(e,i,t)}}}function gt(e){if(e[c].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[c].state,R),r=0;for(;;){let n=Atomics.load(e[c].state,k);if(n===-2)throw Error("_flushSync failed");if(n!==t)Atomics.wait(e[c].state,k,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}un.exports=pt});var wt=x((tc,dn)=>{"use strict";var{createRequire:qo}=I("module"),{existsSync:Vo}=I("fs"),Wo=it(),{join:St,isAbsolute:hn,sep:Mo}=I("path"),{fileURLToPath:Fo}=I("url"),zo=ut(),bt=ht(),Go=an();function Ko(e){bt.register(e,Yo),bt.registerBeforeExit(e,Qo),e.on("close",function(){bt.unregister(e)})}function Uo(){let e=process.execArgv;for(let t=0;t<e.length;t++){let r=e[t];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function Jo(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let r=[],n=!1;for(let i=0;i<t.length;i++){let s=t[i];if(s==="--require"||s==="-r"||s==="--import"){let f=t[i+1];if(f&&cn(f)){n=!0,i++;continue}r.push(s),f&&(r.push(f),i++);continue}if(s.startsWith("--require=")||s.startsWith("-r=")||s.startsWith("--import=")){let f=s.slice(s.indexOf("=")+1);if(cn(f)){n=!0;continue}}r.push(s)}return n?r.join(" "):e}function cn(e){let t=Ho(e);if(!t)return!1;let r=t;if(r.startsWith("file://"))try{r=Fo(r)}catch{return!1}return hn(r)&&!Vo(r)}function Ho(e){let t=e[0],r=e[e.length-1];return t==='"'&&r==='"'||t==="'"&&r==="'"?e.slice(1,-1):e}function Xo(e,t,r,n,i){if(!r.execArgv&&Uo()&&I.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let u=Jo(process.env.NODE_OPTIONS);u!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:u}})}r={...r,name:i};let s=new Go({filename:e,workerData:t,workerOpts:r,sync:n});s.on("ready",f),s.on("close",function(){process.removeListener("exit",l)}),process.on("exit",l);function f(){process.removeListener("exit",l),s.unref(),r.autoEnd!==!1&&Ko(s)}function l(){s.closed||(s.flushSync(),zo(100),s.end())}return s}function Yo(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function Qo(e){e.flushSync()}function Zo(e){let{pipeline:t,targets:r,levels:n,dedupe:i,worker:s={},caller:f=Wo(),sync:l=!1}=e,u={...e.options},h=typeof f=="string"?[f]:f,d=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),a=e.target;if(a&&r)throw new Error("only one of target or targets can be specified");r?(a=d["pino-worker"]||St(__dirname,"worker.js"),u.targets=r.filter(o=>o.target).map(o=>({...o,target:p(o.target)})),u.pipelines=r.filter(o=>o.pipeline).map(o=>o.pipeline.map(y=>({...y,level:o.level,target:p(y.target)})))):t&&(a=d["pino-worker"]||St(__dirname,"worker.js"),u.pipelines=[t.map(o=>({...o,target:p(o.target)}))]),n&&(u.levels=n),i&&(u.dedupe=i),u.pinoWillSendConfig=!0;let g=r||t?"pino.transport":a;return Xo(p(a),u,s,l,g);function p(o){if(o=d[o]||o,hn(o)||o.indexOf("file://")===0)return o;if(o==="pino/file")return St(__dirname,"..","file.js");let y;for(let m of h)try{let b=m==="node:repl"?process.cwd()+Mo:m;y=qo(b).resolve(o);break}catch{continue}if(!y)throw new Error(`unable to determine transport target for "${o}"`);return y}}dn.exports=Zo});var De=x((nc,An)=>{"use strict";var ef=I("diagnostics_channel"),pn=Vr(),{mapHttpRequest:tf,mapHttpResponse:rf}=nt(),vt=Jr(),yn=ht(),{lsCacheSym:nf,chindingsSym:wn,writeSym:gn,serializersSym:_n,formatOptsSym:mn,endSym:sf,stringifiersSym:vn,stringifySym:xn,stringifySafeSym:xt,wildcardFirstSym:En,nestedKeySym:of,formattersSym:On,messageKeySym:ff,errorKeySym:lf,nestedKeyStrSym:uf,msgPrefixSym:Pe}=re(),{isMainThread:af}=I("worker_threads"),cf=wt(),[hf]=process.versions.node.split(".").map(e=>Number(e)),Sn=ef.tracingChannel("pino_asJson"),_t=hf>=25?e=>JSON.stringify(e):pf;function ie(){}function df(e,t){if(!t)return r;return function(...i){t.call(this,i,r,e)};function r(n,...i){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=tf(n):typeof n.setHeader=="function"&&(n=rf(n)));let f;s===null&&i.length===0?f=[null]:(s=i.shift(),f=i),typeof this[Pe]=="string"&&s!==void 0&&s!==null&&(s=this[Pe]+s),this[gn](n,pn(s,f,this[mn]),e)}else{let s=n===void 0?i.shift():n;typeof this[Pe]=="string"&&s!==void 0&&s!==null&&(s=this[Pe]+s),this[gn](null,pn(s,i,this[mn]),e)}}}function pf(e){let t="",r=0,n=!1,i=255,s=e.length;if(s>100)return JSON.stringify(e);for(var f=0;f<s&&i>=32;f++)i=e.charCodeAt(f),(i===34||i===92)&&(t+=e.slice(r,f)+"\\",r=f,n=!0);return n?t+=e.slice(r):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function yf(e,t,r,n){if(Sn.hasSubscribers===!1)return bn.call(this,e,t,r,n);let i={instance:this,arguments};return Sn.traceSync(bn,i,this,e,t,r,n)}function bn(e,t,r,n){let i=this[xn],s=this[xt],f=this[vn],l=this[sf],u=this[wn],h=this[_n],d=this[On],a=this[ff],g=this[lf],p=this[nf][r]+n;p=p+u;let o;d.log&&(e=d.log(e));let y=f[En],m="";for(let w in e)if(o=e[w],Object.prototype.hasOwnProperty.call(e,w)&&o!==void 0){h[w]?o=h[w](o):w===g&&h.err&&(o=h.err(o));let S=f[w]||y;switch(typeof o){case"undefined":case"function":continue;case"number":Number.isFinite(o)===!1&&(o=null);case"boolean":S&&(o=S(o));break;case"string":o=(S||_t)(o);break;default:o=(S||i)(o,s)}if(o===void 0)continue;let _=_t(w);m+=","+_+":"+o}let b="";if(t!==void 0){o=h[a]?h[a](t):t;let w=f[a]||y;switch(typeof o){case"function":break;case"number":Number.isFinite(o)===!1&&(o=null);case"boolean":w&&(o=w(o)),b=',"'+a+'":'+o;break;case"string":o=(w||_t)(o),b=',"'+a+'":'+o;break;default:o=(w||i)(o,s),b=',"'+a+'":'+o}}return this[of]&&m?p+this[uf]+m.slice(1)+"}"+b+l:p+m+b+l}function gf(e,t){let r,n=e[wn],i=e[xn],s=e[xt],f=e[vn],l=f[En],u=e[_n],h=e[On].bindings;t=h(t);for(let d in t)if(r=t[d],((d.length<5||d!=="level"&&d!=="serializers"&&d!=="formatters"&&d!=="customLevels")&&t.hasOwnProperty(d)&&r!==void 0)===!0){if(r=u[d]?u[d](r):r,r=(f[d]||l||i)(r,s),r===void 0)continue;n+=',"'+d+'":'+r}return n}function mf(e){return e.write!==e.constructor.prototype.write}function Le(e){let t=new vt(e);return t.on("error",r),!e.sync&&af&&(yn.register(t,Sf),t.on("close",function(){yn.unregister(t)})),t;function r(n){if(n.code==="EPIPE"){t.write=ie,t.end=ie,t.flushSync=ie,t.destroy=ie;return}t.removeListener("error",r),t.emit("error",n)}}function Sf(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function bf(e){return function(r,n,i={},s){if(typeof i=="string")s=Le({dest:i}),i={};else if(typeof s=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");s=Le({dest:s})}else if(i instanceof vt||i.writable||i._writableState)s=i,i={};else if(i.transport){if(i.transport instanceof vt||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let u;i.customLevels&&(u=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),s=cf({caller:n,...i.transport,levels:u})}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),i.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:f,onChild:l}=i;return f===!1&&(i.level="silent"),l||(i.onChild=ie),s||(mf(process.stdout)?s=process.stdout:s=Le({fd:process.stdout.fd||1})),{opts:i,stream:s}}}function wf(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[xt])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function _f(e,t,r){return{level:e,bindings:t,log:r}}function vf(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}An.exports={noop:ie,buildSafeSonicBoom:Le,asChindings:gf,asJson:yf,genLog:df,createArgsNormalizer:bf,stringify:wf,buildFormatters:_f,normalizeDestFileDescriptor:vf}});var ke=x((ic,Tn)=>{"use strict";var xf={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Ef={ASC:"ASC",DESC:"DESC"};Tn.exports={DEFAULT_LEVELS:xf,SORTING_ORDER:Ef}});var At=x((sc,Pn)=>{"use strict";var{lsCacheSym:Of,levelValSym:Et,useOnlyCustomLevelsSym:Af,streamSym:Tf,formattersSym:Cf,hooksSym:If,levelCompSym:Cn}=re(),{noop:Nf,genLog:J}=De(),{DEFAULT_LEVELS:M,SORTING_ORDER:In}=ke(),Nn={fatal:e=>{let t=J(M.fatal,e);return function(...r){let n=this[Tf];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:e=>J(M.error,e),warn:e=>J(M.warn,e),info:e=>J(M.info,e),debug:e=>J(M.debug,e),trace:e=>J(M.trace,e)},Ot=Object.keys(M).reduce((e,t)=>(e[M[t]]=t,e),{}),Pf=Object.keys(Ot).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function Lf(e){let t=e[Cf].level,{labels:r}=e.levels,n={};for(let i in r){let s=t(r[i],Number(i));n[i]=JSON.stringify(s).slice(0,-1)}return e[Of]=n,e}function Df(e,t){if(t)return!1;switch(e){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function kf(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let n=this[Et],i=this[Et]=r[e],s=this[Af],f=this[Cn],l=this[If].logMethod;for(let u in r){if(f(r[u],i)===!1){this[u]=Nf;continue}this[u]=Df(u,s)?Nn[u](l):J(r[u],l)}this.emit("level-change",e,i,t[n],n,this)}function Rf(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function Bf(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&this[Cn](r,this[Et])}function jf(e,t,r){return e===In.DESC?t<=r:t>=r}function $f(e){return typeof e=="string"?jf.bind(null,e):e}function qf(e=null,t=!1){let r=e?Object.keys(e).reduce((s,f)=>(s[e[f]]=f,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:Ot,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:M,e);return{labels:n,values:i}}function Vf(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(s=>t[s]),r?[]:Object.keys(Ot).map(s=>+s),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:M,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function Wf(e,t){let{labels:r,values:n}=e;for(let i in t){if(i in n)throw Error("levels cannot be overridden");if(t[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}function Mf(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(In).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}Pn.exports={initialLsCache:Pf,genLsCache:Lf,levelMethods:Nn,getLevel:Rf,setLevel:kf,isLevelEnabled:Bf,mappings:qf,assertNoLevelCollisions:Wf,assertDefaultLevelFound:Vf,genLevelComparison:$f,assertLevelComparison:Mf}});var Tt=x((oc,Ln)=>{"use strict";Ln.exports={version:"10.3.1"}});var Vn=x((lc,qn)=>{"use strict";var{EventEmitter:Ff}=I("events"),{lsCacheSym:zf,levelValSym:Gf,setLevelSym:It,getLevelSym:Dn,chindingsSym:Be,mixinSym:Kf,asJsonSym:Rn,writeSym:Uf,mixinMergeStrategySym:Jf,timeSym:Hf,timeSliceIndexSym:Xf,streamSym:Bn,serializersSym:H,formattersSym:ce,errorKeySym:Yf,messageKeySym:Qf,useOnlyCustomLevelsSym:Zf,needsMetadataGsym:el,redactFmtSym:tl,stringifySym:rl,formatOptsSym:nl,stringifiersSym:il,msgPrefixSym:Nt,hooksSym:sl}=re(),{getLevel:ol,setLevel:fl,isLevelEnabled:ll,mappings:ul,initialLsCache:al,genLsCache:cl,assertNoLevelCollisions:hl}=At(),{asChindings:Pt,asJson:dl,buildFormatters:Ct,stringify:kn,noop:jn}=De(),{version:pl}=Tt(),yl=ft(),gl=class{},$n={constructor:gl,child:ml,bindings:Sl,setBindings:bl,flush:vl,isLevelEnabled:ll,version:pl,get level(){return this[Dn]()},set level(e){this[It](e)},get levelVal(){return this[Gf]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[Nt]},get[Symbol.toStringTag](){return"Pino"},[zf]:al,[Uf]:_l,[Rn]:dl,[Dn]:ol,[It]:fl};Object.setPrototypeOf($n,Ff.prototype);qn.exports=function(){return Object.create($n)};var Re=e=>e;function ml(e,t){if(!e)throw Error("missing bindings for child Pino");let r=this[H],n=this[ce],i=Object.create(this);if(t==null)return i[ce].bindings!==Re&&(i[ce]=Ct(n.level,Re,n.log)),i[Be]=Pt(i,e),this.onChild!==jn&&this.onChild(i),i;if(t.hasOwnProperty("serializers")===!0){i[H]=Object.create(null);for(let h in r)i[H][h]=r[h];let l=Object.getOwnPropertySymbols(r);for(var s=0;s<l.length;s++){let h=l[s];i[H][h]=r[h]}for(let h in t.serializers)i[H][h]=t.serializers[h];let u=Object.getOwnPropertySymbols(t.serializers);for(var f=0;f<u.length;f++){let h=u[f];i[H][h]=t.serializers[h]}}else i[H]=r;if(t.hasOwnProperty("formatters")){let{level:l,bindings:u,log:h}=t.formatters;i[ce]=Ct(l||n.level,u||Re,h||n.log)}else i[ce]=Ct(n.level,Re,n.log);if(t.hasOwnProperty("customLevels")===!0&&(hl(this.levels,t.customLevels),i.levels=ul(t.customLevels,i[Zf]),cl(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let l=yl(i.redact,kn),u={stringify:l[tl]};i[rl]=kn,i[il]=l,i[nl]=u}if(typeof t.msgPrefix=="string"&&(i[Nt]=(this[Nt]||"")+t.msgPrefix),i[Be]=Pt(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty("customLevels")){let l=t.level||this.level;i[It](l)}return this.onChild(i),i}function Sl(){let t=`{${this[Be].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function bl(e){let t=Pt(this,e);this[Be]=t}function wl(e,t){return Object.assign(t,e)}function _l(e,t,r){let n=this[Hf](),i=this[Kf],s=this[Yf],f=this[Qf],l=this[Jf]||wl,u,h=this[sl].streamWrite;e==null?u={}:e instanceof Error?(u={[s]:e},t===void 0&&(t=e.message)):(u=e,t===void 0&&e[f]===void 0&&e[s]&&(t=e[s].message)),i&&(u=l(u,i(u,r,this)));let d=this[Rn](u,t,r,n),a=this[Bn];a[el]===!0&&(a.lastLevel=r,a.lastObj=u,a.lastMsg=t,a.lastTime=n.slice(this[Xf]),a.lastLogger=this),a.write(h?h(d):d)}function vl(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[Bn];typeof t.flush=="function"?t.flush(e||jn):e&&e()}});var zn=x((Rt,Fn)=>{"use strict";var{hasOwnProperty:he}=Object.prototype,Y=kt();Y.configure=kt;Y.stringify=Y;Y.default=Y;Rt.stringify=Y;Rt.configure=kt;Fn.exports=Y;var xl=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function K(e){return e.length<5e3&&!xl.test(e)?`"${e}"`:JSON.stringify(e)}function Lt(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var El=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Dt(e){return El.call(e)!==void 0&&e.length!==0}function Wn(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let s=1;s<r;s++)i+=`${t}"${s}":${n}${e[s]}`;return i}function Ol(e){if(he.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Al(e){let t;if(he.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function Tl(e,t){let r;if(he.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Mn(e,t){let r;if(he.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function X(e){return e===1?"1 item":`${e} items`}function Cl(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function Il(e){if(he.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function kt(e){e={...e};let t=Il(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=Ol(e),n=Tl(e,"bigint"),i=Al(e),s=typeof i=="function"?i:void 0,f=Mn(e,"maximumDepth"),l=Mn(e,"maximumBreadth");function u(p,o,y,m,b,w){let S=o[p];switch(typeof S=="object"&&S!==null&&typeof S.toJSON=="function"&&(S=S.toJSON(p)),S=m.call(o,p,S),typeof S){case"string":return K(S);case"object":{if(S===null)return"null";if(y.indexOf(S)!==-1)return r;let _="",O=",",C=w;if(Array.isArray(S)){if(S.length===0)return"[]";if(f<y.length+1)return'"[Array]"';y.push(S),b!==""&&(w+=b,_+=`
|
|
4
|
+
${w}`,O=`,
|
|
5
|
+
${w}`);let P=Math.min(S.length,l),B=0;for(;B<P-1;B++){let U=u(String(B),S,y,m,b,w);_+=U!==void 0?U:"null",_+=O}let j=u(String(B),S,y,m,b,w);if(_+=j!==void 0?j:"null",S.length-1>l){let U=S.length-l-1;_+=`${O}"... ${X(U)} not stringified"`}return b!==""&&(_+=`
|
|
6
|
+
${C}`),y.pop(),`[${_}]`}let E=Object.keys(S),T=E.length;if(T===0)return"{}";if(f<y.length+1)return'"[Object]"';let v="",N="";b!==""&&(w+=b,O=`,
|
|
7
|
+
${w}`,v=" ");let D=Math.min(T,l);i&&!Dt(S)&&(E=Lt(E,s)),y.push(S);for(let P=0;P<D;P++){let B=E[P],j=u(B,S,y,m,b,w);j!==void 0&&(_+=`${N}${K(B)}:${v}${j}`,N=O)}if(T>l){let P=T-l;_+=`${N}"...":${v}"${X(P)} not stringified"`,N=O}return b!==""&&N.length>1&&(_=`
|
|
8
|
+
${w}${_}
|
|
9
|
+
${C}`),y.pop(),`{${_}}`}case"number":return isFinite(S)?String(S):t?t(S):"null";case"boolean":return S===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(S);default:return t?t(S):void 0}}function h(p,o,y,m,b,w){switch(typeof o=="object"&&o!==null&&typeof o.toJSON=="function"&&(o=o.toJSON(p)),typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(y.indexOf(o)!==-1)return r;let S=w,_="",O=",";if(Array.isArray(o)){if(o.length===0)return"[]";if(f<y.length+1)return'"[Array]"';y.push(o),b!==""&&(w+=b,_+=`
|
|
10
|
+
${w}`,O=`,
|
|
11
|
+
${w}`);let T=Math.min(o.length,l),v=0;for(;v<T-1;v++){let D=h(String(v),o[v],y,m,b,w);_+=D!==void 0?D:"null",_+=O}let N=h(String(v),o[v],y,m,b,w);if(_+=N!==void 0?N:"null",o.length-1>l){let D=o.length-l-1;_+=`${O}"... ${X(D)} not stringified"`}return b!==""&&(_+=`
|
|
12
|
+
${S}`),y.pop(),`[${_}]`}y.push(o);let C="";b!==""&&(w+=b,O=`,
|
|
13
|
+
${w}`,C=" ");let E="";for(let T of m){let v=h(T,o[T],y,m,b,w);v!==void 0&&(_+=`${E}${K(T)}:${C}${v}`,E=O)}return b!==""&&E.length>1&&(_=`
|
|
14
|
+
${w}${_}
|
|
15
|
+
${S}`),y.pop(),`{${_}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(o);default:return t?t(o):void 0}}function d(p,o,y,m,b){switch(typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(typeof o.toJSON=="function"){if(o=o.toJSON(p),typeof o!="object")return d(p,o,y,m,b);if(o===null)return"null"}if(y.indexOf(o)!==-1)return r;let w=b;if(Array.isArray(o)){if(o.length===0)return"[]";if(f<y.length+1)return'"[Array]"';y.push(o),b+=m;let v=`
|
|
16
|
+
${b}`,N=`,
|
|
17
|
+
${b}`,D=Math.min(o.length,l),P=0;for(;P<D-1;P++){let j=d(String(P),o[P],y,m,b);v+=j!==void 0?j:"null",v+=N}let B=d(String(P),o[P],y,m,b);if(v+=B!==void 0?B:"null",o.length-1>l){let j=o.length-l-1;v+=`${N}"... ${X(j)} not stringified"`}return v+=`
|
|
18
|
+
${w}`,y.pop(),`[${v}]`}let S=Object.keys(o),_=S.length;if(_===0)return"{}";if(f<y.length+1)return'"[Object]"';b+=m;let O=`,
|
|
19
|
+
${b}`,C="",E="",T=Math.min(_,l);Dt(o)&&(C+=Wn(o,O,l),S=S.slice(o.length),T-=o.length,E=O),i&&(S=Lt(S,s)),y.push(o);for(let v=0;v<T;v++){let N=S[v],D=d(N,o[N],y,m,b);D!==void 0&&(C+=`${E}${K(N)}: ${D}`,E=O)}if(_>l){let v=_-l;C+=`${E}"...": "${X(v)} not stringified"`,E=O}return E!==""&&(C=`
|
|
20
|
+
${b}${C}
|
|
21
|
+
${w}`),y.pop(),`{${C}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(o);default:return t?t(o):void 0}}function a(p,o,y){switch(typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(typeof o.toJSON=="function"){if(o=o.toJSON(p),typeof o!="object")return a(p,o,y);if(o===null)return"null"}if(y.indexOf(o)!==-1)return r;let m="",b=o.length!==void 0;if(b&&Array.isArray(o)){if(o.length===0)return"[]";if(f<y.length+1)return'"[Array]"';y.push(o);let C=Math.min(o.length,l),E=0;for(;E<C-1;E++){let v=a(String(E),o[E],y);m+=v!==void 0?v:"null",m+=","}let T=a(String(E),o[E],y);if(m+=T!==void 0?T:"null",o.length-1>l){let v=o.length-l-1;m+=`,"... ${X(v)} not stringified"`}return y.pop(),`[${m}]`}let w=Object.keys(o),S=w.length;if(S===0)return"{}";if(f<y.length+1)return'"[Object]"';let _="",O=Math.min(S,l);b&&Dt(o)&&(m+=Wn(o,",",l),w=w.slice(o.length),O-=o.length,_=","),i&&(w=Lt(w,s)),y.push(o);for(let C=0;C<O;C++){let E=w[C],T=a(E,o[E],y);T!==void 0&&(m+=`${_}${K(E)}:${T}`,_=",")}if(S>l){let C=S-l;m+=`${_}"...":"${X(C)} not stringified"`}return y.pop(),`{${m}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(o);default:return t?t(o):void 0}}function g(p,o,y){if(arguments.length>1){let m="";if(typeof y=="number"?m=" ".repeat(Math.min(y,10)):typeof y=="string"&&(m=y.slice(0,10)),o!=null){if(typeof o=="function")return u("",{"":p},[],o,m,"");if(Array.isArray(o))return h("",p,[],Cl(o),m,"")}if(m.length!==0)return d("",p,[],m,"")}return a("",p,[])}return g}});var Jn=x((uc,Un)=>{"use strict";var Bt=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Kn}=ke(),Nl=Kn.info;function Pl(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create(Kn);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(a=>{r[a]=t.levels[a]});let n={write:i,add:l,remove:u,emit:s,flushSync:f,end:h,minLevel:0,lastId:0,streams:[],clone:d,[Bt]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(l,n):l.call(n,e),e=null,n;function i(a){let g,p=this.lastLevel,{streams:o}=this,y=0,m;for(let b=Ll(o.length,t.dedupe);kl(b,o.length,t.dedupe);b=Dl(b,t.dedupe))if(g=o[b],g.level<=p){if(y!==0&&y!==g.level)break;if(m=g.stream,m[Bt]){let{lastTime:w,lastMsg:S,lastObj:_,lastLogger:O}=this;m.lastLevel=p,m.lastTime=w,m.lastMsg=S,m.lastObj=_,m.lastLogger=O}m.write(a),t.dedupe&&(y=g.level)}else if(!t.dedupe)break}function s(...a){for(let{stream:g}of this.streams)typeof g.emit=="function"&&g.emit(...a)}function f(){for(let{stream:a}of this.streams)typeof a.flushSync=="function"&&a.flushSync()}function l(a){if(!a)return n;let g=typeof a.write=="function"||a.stream,p=a.write?a:a.stream;if(!g)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:o,streamLevels:y}=this,m;typeof a.levelVal=="number"?m=a.levelVal:typeof a.level=="string"?m=y[a.level]:typeof a.level=="number"?m=a.level:m=Nl;let b={stream:p,level:m,levelVal:void 0,id:++n.lastId};return o.unshift(b),o.sort(Gn),this.minLevel=o[0].level,n}function u(a){let{streams:g}=this,p=g.findIndex(o=>o.id===a);return p>=0&&(g.splice(p,1),g.sort(Gn),this.minLevel=g.length>0?g[0].level:-1),n}function h(){for(let{stream:a}of this.streams)typeof a.flushSync=="function"&&a.flushSync(),a.end()}function d(a){let g=new Array(this.streams.length);for(let p=0;p<g.length;p++)g[p]={level:a,stream:this.streams[p].stream};return{write:i,add:l,remove:u,minLevel:a,streams:g,clone:d,emit:s,flushSync:f,[Bt]:!0}}}function Gn(e,t){return e.level-t.level}function Ll(e,t){return t?e-1:0}function Dl(e,t){return t?e-1:e+1}function kl(e,t,r){return r?e>=0:e<t}Un.exports=Pl});var li=x((ac,$)=>{"use strict";var Rl=I("os"),ri=nt(),Bl=it(),jl=ft(),ni=$r(),$l=Vn(),ii=re(),{configure:ql}=zn(),{assertDefaultLevelFound:Vl,mappings:si,genLsCache:Wl,genLevelComparison:Ml,assertLevelComparison:Fl}=At(),{DEFAULT_LEVELS:oi,SORTING_ORDER:zl}=ke(),{createArgsNormalizer:Gl,asChindings:Kl,buildSafeSonicBoom:Hn,buildFormatters:Ul,stringify:jt,normalizeDestFileDescriptor:Xn,noop:Jl}=De(),{version:Hl}=Tt(),{chindingsSym:Yn,redactFmtSym:Xl,serializersSym:Qn,timeSym:Yl,timeSliceIndexSym:Ql,streamSym:Zl,stringifySym:Zn,stringifySafeSym:$t,stringifiersSym:ei,setLevelSym:eu,endSym:tu,formatOptsSym:ru,messageKeySym:nu,errorKeySym:iu,nestedKeySym:su,mixinSym:ou,levelCompSym:fu,useOnlyCustomLevelsSym:lu,formattersSym:ti,hooksSym:uu,nestedKeyStrSym:au,mixinMergeStrategySym:cu,msgPrefixSym:hu}=ii,{epochTime:fi,nullTime:du}=ni,{pid:pu}=process,yu=Rl.hostname(),gu=ri.err,mu={level:"info",levelComparison:zl.ASC,levels:oi,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:pu,hostname:yu},serializers:Object.assign(Object.create(null),{err:gu}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:fi,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Su=Gl(mu),bu=Object.assign(Object.create(null),ri);function qt(...e){let t={},{opts:r,stream:n}=Su(t,Bl(),...e);r.level&&typeof r.level=="string"&&oi[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:i,crlf:s,serializers:f,timestamp:l,messageKey:u,errorKey:h,nestedKey:d,base:a,name:g,level:p,customLevels:o,levelComparison:y,mixin:m,mixinMergeStrategy:b,useOnlyCustomLevels:w,formatters:S,hooks:_,depthLimit:O,edgeLimit:C,onChild:E,msgPrefix:T}=r,v=ql({maximumDepth:O,maximumBreadth:C}),N=Ul(S.level,S.bindings,S.log),D=jt.bind({[$t]:v}),P=i?jl(i,D):{},B=i?{stringify:P[Xl]}:{stringify:D},j="}"+(s?`\r
|
|
22
|
+
`:`
|
|
23
|
+
`),U=Kl.bind(null,{[Yn]:"",[Qn]:f,[ei]:P,[Zn]:jt,[$t]:v,[ti]:N}),$e="";a!==null&&(g===void 0?$e=U(a):$e=U(Object.assign({},a,{name:g})));let Wt=l instanceof Function?l:l?fi:du,yi=Wt().indexOf(":")+1;if(w&&!o)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(m&&typeof m!="function")throw Error(`Unknown mixin type "${typeof m}" - expected "function"`);if(T&&typeof T!="string")throw Error(`Unknown msgPrefix type "${typeof T}" - expected "string"`);Vl(p,o,w);let Mt=si(o,w);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:Mt,messageKey:u,errorKey:h}}),Fl(y);let gi=Ml(y);return Object.assign(t,{levels:Mt,[fu]:gi,[lu]:w,[Zl]:n,[Yl]:Wt,[Ql]:yi,[Zn]:jt,[$t]:v,[ei]:P,[tu]:j,[ru]:B,[nu]:u,[iu]:h,[su]:d,[au]:d?`,${JSON.stringify(d)}:{`:"",[Qn]:f,[ou]:m,[cu]:b,[Yn]:$e,[ti]:N,[uu]:_,silent:Jl,onChild:E,[hu]:T}),Object.setPrototypeOf(t,$l()),Wl(t),t[eu](p),t}$.exports=qt;$.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=Xn(e.dest||process.stdout.fd),Hn(e)):Hn({dest:Xn(e),minLength:0});$.exports.transport=wt();$.exports.multistream=Jn();$.exports.levels=si();$.exports.stdSerializers=bu;$.exports.stdTimeFunctions=Object.assign({},ni);$.exports.symbols=ii;$.exports.version=Hl;$.exports.default=qt;$.exports.pino=qt});var Ft=typeof globalThis=="object"?globalThis:global;var F="1.9.0";var zt=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Si(e){var t=new Set([e]),r=new Set,n=e.match(zt);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(u){return u===e};function s(l){return r.add(l),!1}function f(l){return t.add(l),!0}return function(u){if(t.has(u))return!0;if(r.has(u))return!1;var h=u.match(zt);if(!h)return s(u);var d={major:+h[1],minor:+h[2],patch:+h[3],prerelease:h[4]};return d.prerelease!=null||i.major!==d.major?s(u):i.major===0?i.minor===d.minor&&i.patch<=d.patch?f(u):s(u):i.minor<=d.minor?f(u):s(u)}}var Gt=Si(F);var bi=F.split(".")[0],se=Symbol.for("opentelemetry.js.api."+bi),oe=Ft;function Q(e,t,r,n){var i;n===void 0&&(n=!1);var s=oe[se]=(i=oe[se])!==null&&i!==void 0?i:{version:F};if(!n&&s[e]){var f=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(f.stack||f.message),!1}if(s.version!==F){var f=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+F);return r.error(f.stack||f.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+F+"."),!0}function z(e){var t,r,n=(t=oe[se])===null||t===void 0?void 0:t.version;if(!(!n||!Gt(n)))return(r=oe[se])===null||r===void 0?void 0:r[e]}function Z(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+F+".");var r=oe[se];r&&delete r[e]}var wi=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],f;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){f={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(f)throw f.error}}return s},_i=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},Kt=(function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return fe("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return fe("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return fe("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return fe("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return fe("verbose",this._namespace,t)},e})();function fe(e,t,r){var n=z("diag");if(n)return r.unshift(t),n[e].apply(n,_i([],wi(r),!1))}var L;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(L||(L={}));function Ut(e,t){e<L.NONE?e=L.NONE:e>L.ALL&&(e=L.ALL),t=t||{};function r(n,i){var s=t[n];return typeof s=="function"&&e>=i?s.bind(t):function(){}}return{error:r("error",L.ERROR),warn:r("warn",L.WARN),info:r("info",L.INFO),debug:r("debug",L.DEBUG),verbose:r("verbose",L.VERBOSE)}}var vi=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],f;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){f={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(f)throw f.error}}return s},xi=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},Ei="diag",ee=(function(){function e(){function t(i){return function(){for(var s=[],f=0;f<arguments.length;f++)s[f]=arguments[f];var l=z("diag");if(l)return l[i].apply(l,xi([],vi(s),!1))}}var r=this,n=function(i,s){var f,l,u;if(s===void 0&&(s={logLevel:L.INFO}),i===r){var h=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((f=h.stack)!==null&&f!==void 0?f:h.message),!1}typeof s=="number"&&(s={logLevel:s});var d=z("diag"),a=Ut((l=s.logLevel)!==null&&l!==void 0?l:L.INFO,i);if(d&&!s.suppressOverrideMessage){var g=(u=new Error().stack)!==null&&u!==void 0?u:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+g),a.warn("Current logger will overwrite one already registered from "+g)}return Q("diag",a,r,!0)};r.setLogger=n,r.disable=function(){Z(Ei,r)},r.createComponentLogger=function(i){return new Kt(i)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function Jt(e){return Symbol.for(e)}var Oi=(function(){function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var s=new e(r._currentContext);return s._currentContext.set(n,i),s},r.deleteValue=function(n){var i=new e(r._currentContext);return i._currentContext.delete(n),i}}return e})(),Ht=new Oi;var Ai=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],f;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){f={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(f)throw f.error}}return s},Ti=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},Xt=(function(){function e(){}return e.prototype.active=function(){return Ht},e.prototype.with=function(t,r,n){for(var i=[],s=3;s<arguments.length;s++)i[s-3]=arguments[s];return r.call.apply(r,Ti([n],Ai(i),!1))},e.prototype.bind=function(t,r){return r},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e})();var Ci=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],f;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){f={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(f)throw f.error}}return s},Ii=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},qe="context",Ni=new Xt,te=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return Q(qe,t,ee.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,r,n){for(var i,s=[],f=3;f<arguments.length;f++)s[f-3]=arguments[f];return(i=this._getContextManager()).with.apply(i,Ii([t,r,n],Ci(s),!1))},e.prototype.bind=function(t,r){return this._getContextManager().bind(t,r)},e.prototype._getContextManager=function(){return z(qe)||Ni},e.prototype.disable=function(){this._getContextManager().disable(),Z(qe,ee.instance())},e})();var de;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(de||(de={}));var Ve="0000000000000000",We="00000000000000000000000000000000",Yt={traceId:We,spanId:Ve,traceFlags:de.NONE};var G=(function(){function e(t){t===void 0&&(t=Yt),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,r){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,r){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,r){},e})();var Me=Jt("OpenTelemetry Context Key SPAN");function pe(e){return e.getValue(Me)||void 0}function Qt(){return pe(te.getInstance().active())}function le(e,t){return e.setValue(Me,t)}function Zt(e){return e.deleteValue(Me)}function er(e,t){return le(e,new G(t))}function ye(e){var t;return(t=pe(e))===null||t===void 0?void 0:t.spanContext()}var Pi=/^([0-9a-f]{32})$/i,Li=/^[0-9a-f]{16}$/i;function Di(e){return Pi.test(e)&&e!==We}function ki(e){return Li.test(e)&&e!==Ve}function ge(e){return Di(e.traceId)&&ki(e.spanId)}function tr(e){return new G(e)}var Fe=te.getInstance(),me=(function(){function e(){}return e.prototype.startSpan=function(t,r,n){n===void 0&&(n=Fe.active());var i=!!r?.root;if(i)return new G;var s=n&&ye(n);return Ri(s)&&ge(s)?new G(s):new G},e.prototype.startActiveSpan=function(t,r,n,i){var s,f,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,f=n,l=i);var u=f??Fe.active(),h=this.startSpan(t,s,u),d=le(u,h);return Fe.with(d,l,void 0,h)}},e})();function Ri(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var Bi=new me,rr=(function(){function e(t,r,n,i){this._provider=t,this.name=r,this.version=n,this.options=i}return e.prototype.startSpan=function(t,r,n){return this._getTracer().startSpan(t,r,n)},e.prototype.startActiveSpan=function(t,r,n,i){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Bi},e})();var nr=(function(){function e(){}return e.prototype.getTracer=function(t,r,n){return new me},e})();var ji=new nr,ze=(function(){function e(){}return e.prototype.getTracer=function(t,r,n){var i;return(i=this.getDelegateTracer(t,r,n))!==null&&i!==void 0?i:new rr(this,t,r,n)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:ji},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(t,r,n)},e})();var Ge=te.getInstance();var Ke="trace",ir=(function(){function e(){this._proxyTracerProvider=new ze,this.wrapSpanContext=tr,this.isSpanContextValid=ge,this.deleteSpan=Zt,this.getSpan=pe,this.getActiveSpan=Qt,this.getSpanContext=ye,this.setSpan=le,this.setSpanContext=er}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var r=Q(Ke,this._proxyTracerProvider,ee.instance());return r&&this._proxyTracerProvider.setDelegate(t),r},e.prototype.getTracerProvider=function(){return z(Ke)||this._proxyTracerProvider},e.prototype.getTracer=function(t,r){return this.getTracerProvider().getTracer(t,r)},e.prototype.disable=function(){Z(Ke,ee.instance()),this._proxyTracerProvider=new ze},e})();var Ue=ir.getInstance();var ci=mi(li(),1),Vt=null,ui=!1;async function hi(){if(Vt)return Vt;if(ui||(ui=!0,process.env.LOGGER_SENTRY_ENABLED!=="true")||!process.env.SENTRY_DSN||typeof globalThis<"u"&&"window"in globalThis)return null;try{let t=await new Function("p","return import(p)")("@sentry/node").catch(()=>null);if(t&&typeof t.captureException=="function")return Vt=t,t}catch{}return null}function di(){return process.env.LOGGER_SENTRY_ENABLED==="true"&&!!process.env.SENTRY_DSN}function wu(e,t,r){di()&&hi().then(n=>{if(!n)return;let i=t instanceof Error?t:new Error(e);n.captureException(i,{extra:{logMessage:e,...r??{}}})})}function _u(e,t){di()&&hi().then(r=>{r&&r.addBreadcrumb({category:"logger",level:"warning",message:e,...t?{data:t}:{}})})}var ai=process.env.NODE_ENV==="development",vu=process.env.NODE_ENV==="test",xu=["password","token","secret","apiKey","api_key","authorization","cookie","accessToken","access_token","refreshToken","refresh_token","privateKey","private_key","creditCard","cardNumber"],Eu=(0,ci.default)({redact:{paths:xu,censor:"[REDACTED]"},...vu?{level:"silent"}:{level:process.env.LOG_LEVEL??(ai?"debug":"info"),...ai?{transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"SYS:HH:MM:ss"}}}:{}}});function Ou(e){return e==null?{}:e instanceof Error?{err:{message:e.message,stack:e.stack,name:e.name}}:{err:e}}function je(){try{let t=Ue.getSpan(Ge.active())?.spanContext().traceId;return t&&t!=="00000000000000000000000000000000"?t:void 0}catch{return}}function pi(e){return{debug(t,r){let n=je();e.debug({...r,...n?{traceId:n}:{}},t)},info(t,r){let n=je();e.info({...r,...n?{traceId:n}:{}},t)},warn(t,r){let n=je();e.warn({...r,...n?{traceId:n}:{}},t),_u(t,r)},error(t,r,n){let i=je();e.error({...Ou(r),...n,...i?{traceId:i}:{}},t),wu(t,r,n)},child(t){return pi(e.child(t))}}}var Au=pi(Eu);export{Au as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var y=(i,n,p)=>{for(let[e,c]of Object.entries(i)){let r=async function(s,t,a){let f=new c(s);if(typeof t=="function")this.send(f,t);else if(typeof a=="function"){if(typeof t!="object")throw new Error(`Expected http options but got ${typeof t}`);this.send(f,t||{},a)}else return this.send(f,t)},o=(e[0].toLowerCase()+e.slice(1)).replace(/Command$/,"");n.prototype[o]=r}let{paginators:m={},waiters:d={}}=p??{};for(let[e,c]of Object.entries(m))n.prototype[e]===void 0&&(n.prototype[e]=function(r={},o,...s){return c({...o,client:this},r,...s)});for(let[e,c]of Object.entries(d))n.prototype[e]===void 0&&(n.prototype[e]=async function(r={},o,...s){let t=o;return typeof o=="number"&&(t={maxWaitTime:o}),c({...t,client:this},r,...s)})};export{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=class t{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;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 r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=c(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}};function c(t){return Object.keys(t).reduce((e,r)=>{let h=t[r];return{...e,[r]:Array.isArray(h)?[...h]:h}},{})}export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as J,b as F}from"./chunk-U7GFHIC2.js";import{a as D}from"./chunk-2YUF6TO6.js";import{a as H,b as q,c as O}from"./chunk-SF4JBB23.js";import{N as U,j as z,m as I,n as g,p as $,q as Q,s as T,t as V,u as v}from"./chunk-YYJUG63O.js";import{c as B,i as j}from"./chunk-224RJRPV.js";import{a as N}from"./chunk-CHWVD37K.js";import{d as R,e as k}from"./chunk-XB6R2VIU.js";function W(b){return(b.includes(",")||b.includes('"'))&&(b=`"${b.replace(/"/g,'\\"')}"`),b}function Z(b,i,t){if(t<=0||!Number.isInteger(t))throw new Error("Invalid number of delimiters ("+t+") for splitEvery.");let e=b.split(i);if(t===1)return e;let r=[],o="";for(let s=0;s<e.length;s++)o===""?o=e[s]:o+=i+e[s],(s+1)%t===0&&(r.push(o),o="");return o!==""&&r.push(o),r}var x=class extends V{async serializeRequest(i,t,e){let r={...t??{}},o=this.serializer,s={},h={},c=await e.endpoint(),d=g.of(i?.input),S=[],p=[],y=!1,m,n=new N({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:s,headers:h,body:void 0});if(c){this.updateServiceEndpoint(n,c),this.setHostPrefix(n,i,r);let a=I(i.traits);if(a.http){n.method=a.http[0];let[f,l]=a.http[1].split("?");n.path=="/"?n.path=f:n.path+=f;let u=new URLSearchParams(l??"");Object.assign(s,Object.fromEntries(u))}}for(let[a,f]of d.structIterator()){let l=f.getMergedTraits()??{},u=r[a];if(u==null&&!f.isIdempotencyToken()){if(l.httpLabel&&(n.path.includes(`{${a}+}`)||n.path.includes(`{${a}}`)))throw new Error(`No value provided for input HTTP label: ${a}.`);continue}if(l.httpPayload)f.isStreaming()?f.isStructSchema()?r[a]&&(m=await this.serializeEventStream({eventStream:r[a],requestSchema:d})):m=u:(o.write(f,u),m=o.flush()),delete r[a];else if(l.httpLabel){o.write(f,u);let w=o.flush();n.path.includes(`{${a}+}`)?n.path=n.path.replace(`{${a}+}`,w.split("/").map(H).join("/")):n.path.includes(`{${a}}`)&&(n.path=n.path.replace(`{${a}}`,H(w))),delete r[a]}else if(l.httpHeader)o.write(f,u),h[l.httpHeader.toLowerCase()]=String(o.flush()),delete r[a];else if(typeof l.httpPrefixHeaders=="string"){for(let[w,P]of Object.entries(u)){let L=l.httpPrefixHeaders+w;o.write([f.getValueSchema(),{httpHeader:L}],P),h[L.toLowerCase()]=o.flush()}delete r[a]}else l.httpQuery||l.httpQueryParams?(this.serializeQuery(f,u,s),delete r[a]):(y=!0,S.push(a),p.push(f))}if(y&&r){let[a,f]=(d.getName(!0)??"#Unknown").split("#"),l=d.getSchema()[6],u=[3,a,f,d.getMergedTraits(),S,p,void 0];l?u[6]=l:u.pop(),o.write(u,r),m=o.flush()}return n.headers=h,n.query=s,n.body=m,n}serializeQuery(i,t,e){let r=this.serializer,o=i.getMergedTraits();if(o.httpQueryParams){for(let[s,h]of Object.entries(t))if(!(s in e)){let c=i.getValueSchema();Object.assign(c.getMergedTraits(),{...o,httpQuery:s,httpQueryParams:void 0}),this.serializeQuery(c,h,e)}return}if(i.isListSchema()){let s=!!i.getMergedTraits().sparse,h=[];for(let c of t){r.write([i.getValueSchema(),o],c);let d=r.flush();(s||d!==void 0)&&h.push(d)}e[o.httpQuery]=h}else r.write([i,o],t),e[o.httpQuery]=r.flush()}async deserializeResponse(i,t,e){let r=this.deserializer,o=g.of(i.output),s={};if(e.statusCode>=300){let c=await z(e.body,t);throw c.byteLength>0&&Object.assign(s,await r.read(15,c)),await this.handleError(i,t,e,s,this.deserializeMetadata(e)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in e.headers){let d=e.headers[c];delete e.headers[c],e.headers[c.toLowerCase()]=d}let h=await this.deserializeHttpMessage(o,t,e,s);if(h.length){let c=await z(e.body,t);if(c.byteLength>0){let d=await r.read(o,c);for(let S of h)d[S]!=null&&(s[S]=d[S])}}else h.discardResponseBody&&await z(e.body,t);return s.$metadata=this.deserializeMetadata(e),s}async deserializeHttpMessage(i,t,e,r,o){let s;r instanceof Set?s=o:s=r;let h=!0,c=this.deserializer,d=g.of(i),S=[];for(let[p,y]of d.structIterator()){let m=y.getMemberTraits();if(m.httpPayload){if(h=!1,y.isStreaming())y.isStructSchema()?s[p]=await this.deserializeEventStream({response:e,responseSchema:d}):s[p]=D(e.body);else if(e.body){let a=await z(e.body,t);a.byteLength>0&&(s[p]=await c.read(y,a))}}else if(m.httpHeader){let n=String(m.httpHeader).toLowerCase(),a=e.headers[n];if(a!=null)if(y.isListSchema()){let f=y.getValueSchema();f.getMergedTraits().httpHeader=n;let l;f.isTimestampSchema()&&f.getSchema()===4?l=Z(a,",",2):l=q(a);let u=[];for(let w of l)u.push(await c.read(f,w.trim()));s[p]=u}else s[p]=await c.read(y,a)}else if(m.httpPrefixHeaders!==void 0){s[p]={};for(let[n,a]of Object.entries(e.headers))if(n.startsWith(m.httpPrefixHeaders)){let f=y.getValueSchema();f.getMergedTraits().httpHeader=n,s[p][n.slice(m.httpPrefixHeaders.length)]=await c.read(f,a)}}else m.httpResponseCode?s[p]=e.statusCode:S.push(p)}return S.discardResponseBody=h,S}};var M=class extends T{codecDeserializer;stringDeserializer;constructor(i,t){super(),this.codecDeserializer=i,this.stringDeserializer=new O(t)}setSerdeContext(i){this.stringDeserializer.setSerdeContext(i),this.codecDeserializer.setSerdeContext(i),this.serdeContext=i}read(i,t){let e=g.of(i),r=e.getMergedTraits(),o=this.serdeContext?.utf8Encoder??k;if(r.httpHeader||r.httpResponseCode)return this.stringDeserializer.read(e,o(t));if(r.httpPayload){if(e.isBlobSchema()){let s=this.serdeContext?.utf8Decoder??R;return typeof t=="string"?s(t):t}else if(e.isStringSchema())return"byteLength"in t?o(t):t}return this.codecDeserializer.read(e,t)}};var E=class extends T{settings;stringBuffer="";constructor(i){super(),this.settings=i}write(i,t){let e=g.of(i);switch(typeof t){case"object":if(t===null){this.stringBuffer="null";return}if(e.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${e.getName(!0)}`);switch(v(e,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=j(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(e.isBlobSchema()&&"byteLength"in t){this.stringBuffer=(this.serdeContext?.base64Encoder??B)(t);return}if(e.isListSchema()&&Array.isArray(t)){let s="";for(let h of t){this.write([e.getValueSchema(),e.getMergedTraits()],h);let c=this.flush(),d=e.getValueSchema().isTimestampSchema()?c:W(c);s!==""&&(s+=", "),s+=d}this.stringBuffer=s;return}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":let r=e.getMergedTraits().mediaType,o=t;if(r&&((r==="application/json"||r.endsWith("+json"))&&(o=Q.from(o)),e.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??B)(o.toString());return}this.stringBuffer=t;break;default:e.isIdempotencyToken()?this.stringBuffer=$():this.stringBuffer=String(t)}}flush(){let i=this.stringBuffer;return this.stringBuffer="",i}};var C=class{codecSerializer;stringSerializer;buffer;constructor(i,t,e=new E(t)){this.codecSerializer=i,this.stringSerializer=e}setSerdeContext(i){this.codecSerializer.setSerdeContext(i),this.stringSerializer.setSerdeContext(i)}write(i,t){let e=g.of(i),r=e.getMergedTraits();if(r.httpHeader||r.httpLabel||r.httpQuery){this.stringSerializer.write(e,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(e,t)}flush(){if(this.buffer!==void 0){let i=this.buffer;return this.buffer=void 0,i}return this.codecSerializer.flush()}};var A=class extends x{serializer;deserializer;codec;mixin=new U;constructor({defaultNamespace:i,errorTypeRegistries:t}){super({defaultNamespace:i,errorTypeRegistries:t});let e={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new F(e),this.serializer=new C(this.codec.createSerializer(),e),this.deserializer=new M(this.codec.createDeserializer(),e)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(i){this.codec.setSerdeContext(i),super.setSerdeContext(i)}async serializeRequest(i,t,e){let r=await super.serializeRequest(i,t,e),o=g.of(i.input);if(!r.headers["content-type"]){let s=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);s&&(r.headers["content-type"]=s)}return r.body==null&&r.headers["content-type"]===this.getDefaultContentType()&&(r.body="{}"),r}async deserializeResponse(i,t,e){let r=await super.deserializeResponse(i,t,e),o=g.of(i.output);for(let[s,h]of o.structIterator())h.getMemberTraits().httpPayload&&!(s in r)&&(r[s]=null);return r}async handleError(i,t,e,r,o){let s=J(e,r)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,s,this.options.defaultNamespace);let{errorSchema:h,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,e,r,o),d=g.of(h),S=r.message??r.Message??"UnknownError",p=this.compositeErrorRegistry.getErrorCtor(h)??Error,y=new p(S);await this.deserializeHttpMessage(h,t,e,r);let m={};for(let[n,a]of d.structIterator()){let f=a.getMergedTraits().jsonName??n;m[n]=this.codec.createDeserializer().readObject(a,r[f])}throw this.mixin.decorateServiceException(Object.assign(y,c,{$fault:d.getMergedTraits().error,message:S},m),r)}getDefaultContentType(){return"application/json"}};export{A as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as Ne,b as qe,f as C,g as h}from"./chunk-QSLKOXQ6.js";import{a as E}from"./chunk-76FD5Z7D.js";import{a as it}from"./chunk-WS6OSFOJ.js";import{a as Pt,b as It}from"./chunk-U7GFHIC2.js";import{$ as Lt,A as dt,B as yt,C as mt,D as xt,E as Rt,F as vt,G as k,H as Kt,I as ft,J as gt,K as St,L as _t,M as Ct,N as ht,Q as $t,R as Dt,S as At,T as kt,U as Mt,V as bt,W as Ot,X as wt,Y as M,Z as Tt,_ as Ut,a as Xe,aa as Nt,b as Ve,ba as qt,c as Fe,ca as Ht,d as He,da as jt,e as je,ea as Wt,f as We,fa as zt,g as Ge,ga as Bt,h as ze,ha as Qt,i as Be,ia as Yt,k as ot,l as nt,n as st,o as Te,v as at,w as ct,x as pt,y as lt,z as ut}from"./chunk-YYJUG63O.js";import{b as Qe,c as Ze,e as et,f as tt}from"./chunk-224RJRPV.js";import{d as Ye,e as Je}from"./chunk-XB6R2VIU.js";import{a as Xt,b as Vt,g as Ft}from"./chunk-M3QJPQWS.js";import{a as rt,c as f}from"./chunk-IY2KKEUD.js";import{a as Et}from"./chunk-ZCWB3HFB.js";import{a as Gt}from"./chunk-WI7DO2VU.js";import{b as S}from"./chunk-TX7AAHER.js";import{randomUUID as is}from"crypto";var b=class extends it{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,errorTypeRegistries:o,serviceTarget:s,awsQueryCompatible:r,jsonCodec:y}){super({defaultNamespace:t,errorTypeRegistries:o}),this.serviceTarget=s,this.codec=y??new It({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!r,this.mixin=new ht(this.awsQueryCompatible)}async serializeRequest(t,o,s){let r=await super.serializeRequest(t,o,s);return r.path.endsWith("/")||(r.path+="/"),Object.assign(r.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${t.name}`}),this.awsQueryCompatible&&(r.headers["x-amzn-query-mode"]="true"),(ot(t.input)==="unit"||!r.body)&&(r.body="{}"),r}getPayloadCodec(){return this.codec}async handleError(t,o,s,r,y){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,s);let m=Pt(s,r)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,m,this.options.defaultNamespace);let{errorSchema:x,errorMetadata:g}=await this.mixin.getErrorSchemaOrThrowBaseException(m,this.options.defaultNamespace,s,r,y,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),D=st.of(x),A=r.message??r.Message??"UnknownError",be=this.compositeErrorRegistry.getErrorCtor(x)??Error,Ho=new be(A),Oe={};for(let[we,jo]of D.structIterator())r[we]!=null&&(Oe[we]=this.codec.createDeserializer().readObject(jo,r[we]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,Oe),this.mixin.decorateServiceException(Object.assign(Ho,g,{$fault:D.getMergedTraits().error,message:A},Oe),r)}};var O=class extends b{constructor({defaultNamespace:t,errorTypeRegistries:o,serviceTarget:s,awsQueryCompatible:r,jsonCodec:y}){super({defaultNamespace:t,errorTypeRegistries:o,serviceTarget:s,awsQueryCompatible:r,jsonCodec:y})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}};var Jt=async(e,t,o)=>({operation:We(t).operation,region:await Ge(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Wo(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"kms",region:e.region},propertiesExtractor:(t,o)=>({signingProperties:{config:t,context:o}})}}var Zt=e=>{let t=[];switch(e.operation){default:t.push(Wo(e))}return t},eo=e=>{let t=Rt(e);return Object.assign(t,{authSchemePreference:Ge(e.authSchemePreference??[])})};var to=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"kms"}),w={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var oo={name:"@aws-sdk/client-kms",description:"AWS SDK for JavaScript Kms Client for Node.js, Browser and React Native",version:"3.1019.0",scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline client-kms","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo kms","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts --mode development","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.973.25","@aws-sdk/credential-provider-node":"^3.972.27","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.9","@aws-sdk/middleware-user-agent":"^3.972.26","@aws-sdk/region-config-resolver":"^3.972.10","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.12","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-utf8":"^4.2.2",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3"},engines:{node:">=20.0.0"},typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kms",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-kms"}};var ro="AWS_EC2_METADATA_DISABLED",no=async e=>{let{ENV_CMDS_FULL_URI:t,ENV_CMDS_RELATIVE_URI:o,fromContainerMetadata:s,fromInstanceMetadata:r}=await import("./dist-es-NRANDF25.js");if(process.env[o]||process.env[t]){e.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:y}=await import("./dist-es-3AHFNYTD.js");return Et(y(e),s(e))}return process.env[ro]&&process.env[ro]!=="false"?async()=>{throw new S("EC2 Instance Metadata Service access disabled",{logger:e.logger})}:(e.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),r(e))};function so(e,t){let o=Bo(e),s,r,y,m=async x=>{if(x?.forceRefresh)return await o(x);if(y?.expiration&&y?.expiration?.getTime()<Date.now()&&(y=void 0),s)await s;else if(!y||t?.(y))if(y)r||(r=o(x).then(g=>{y=g}).finally(()=>{r=void 0}));else return s=o(x).then(g=>{y=g}).finally(()=>{s=void 0}),m(x);return y};return m}var Bo=e=>async t=>{let o;for(let s of e)try{return await s(t)}catch(r){if(o=r,r?.tryNextLink)continue;throw r}throw o};var io=!1,ao=(e={})=>so([async()=>{if(e.profile??process.env[Gt])throw process.env[Xt]&&process.env[Vt]&&(io||((e.logger?.warn&&e.logger?.constructor?.name!=="NoOpLogger"?e.logger.warn.bind(e.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
2
|
+
Multiple credential sources detected:
|
|
3
|
+
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
4
|
+
This SDK will proceed with the AWS_PROFILE value.
|
|
5
|
+
|
|
6
|
+
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
7
|
+
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
8
|
+
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
9
|
+
`),io=!0)),new S("AWS_PROFILE is set, skipping fromEnv provider.",{logger:e.logger,tryNextLink:!0});return e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),Ft(e)()},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:o,ssoAccountId:s,ssoRegion:r,ssoRoleName:y,ssoSession:m}=e;if(!o&&!s&&!r&&!y&&!m)throw new S("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:e.logger});let{fromSSO:x}=await import("./dist-es-27SHBPNL.js");return x(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:o}=await import("./dist-es-7VTHVGQ3.js");return o(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:o}=await import("./dist-es-3MQSPUQV.js");return o(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:o}=await import("./dist-es-JT6FIF3X.js");return o(e)(t)},async()=>(e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await no(e))()),async()=>{throw new S("Could not load credentials from any providers",{tryNextLink:!1,logger:e.logger})}],Qo);var Qo=e=>e?.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5;var vo="required";var v="argv";var co="isSet",I="booleanEquals",_="error",P="endpoint",K="tree",Ue="PartitionResult",po={[vo]:!1,type:"string"},lo={[vo]:!0,default:!1,type:"boolean"},uo={ref:"Endpoint"},Ko={fn:I,[v]:[{ref:"UseFIPS"},!0]},fo={fn:I,[v]:[{ref:"UseDualStack"},!0]},R={},yo={fn:"getAttr",[v]:[{ref:Ue},"supportsFIPS"]},mo={fn:I,[v]:[!0,{fn:"getAttr",[v]:[{ref:Ue},"supportsDualStack"]}]},xo=[Ko],Eo=[fo],Ro=[{ref:"Region"}],Yo={version:"1.0",parameters:{Region:po,UseDualStack:lo,UseFIPS:lo,Endpoint:po},rules:[{conditions:[{fn:co,[v]:[uo]}],rules:[{conditions:xo,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:_},{conditions:Eo,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:_},{endpoint:{url:uo,properties:R,headers:R},type:P}],type:K},{conditions:[{fn:co,[v]:Ro}],rules:[{conditions:[{fn:"aws.partition",[v]:Ro,assign:Ue}],rules:[{conditions:[Ko,fo],rules:[{conditions:[{fn:I,[v]:[!0,yo]},mo],rules:[{endpoint:{url:"https://kms-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:R,headers:R},type:P}],type:K},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:_}],type:K},{conditions:xo,rules:[{conditions:[{fn:I,[v]:[yo,!0]}],rules:[{endpoint:{url:"https://kms-fips.{Region}.{PartitionResult#dnsSuffix}",properties:R,headers:R},type:P}],type:K},{error:"FIPS is enabled but this partition does not support FIPS",type:_}],type:K},{conditions:Eo,rules:[{conditions:[mo],rules:[{endpoint:{url:"https://kms.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:R,headers:R},type:P}],type:K},{error:"DualStack is enabled but this partition does not support DualStack",type:_}],type:K},{endpoint:{url:"https://kms.{Region}.{PartitionResult#dnsSuffix}",properties:R,headers:R},type:P}],type:K}],type:K},{error:"Invalid Configuration: Missing Region",type:_}]},go=Yo;var Jo=new pt({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),So=(e,t={})=>Jo.get(e,()=>ut(go,{endpointParams:e,logger:t.logger}));lt.aws=dt;var i=class e extends Kt{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};var G=class e extends i{name="AlreadyExistsException";$fault="client";constructor(t){super({name:"AlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},T=class e extends i{name="DependencyTimeoutException";$fault="server";constructor(t){super({name:"DependencyTimeoutException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype)}},U=class e extends i{name="InvalidArnException";$fault="client";constructor(t){super({name:"InvalidArnException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},L=class e extends i{name="KMSInternalException";$fault="server";constructor(t){super({name:"KMSInternalException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype)}},N=class e extends i{name="KMSInvalidStateException";$fault="client";constructor(t){super({name:"KMSInvalidStateException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},q=class e extends i{name="NotFoundException";$fault="client";constructor(t){super({name:"NotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},X=class e extends i{name="CloudHsmClusterInUseException";$fault="client";constructor(t){super({name:"CloudHsmClusterInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},V=class e extends i{name="CloudHsmClusterInvalidConfigurationException";$fault="client";constructor(t){super({name:"CloudHsmClusterInvalidConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},F=class e extends i{name="CloudHsmClusterNotActiveException";$fault="client";constructor(t){super({name:"CloudHsmClusterNotActiveException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},H=class e extends i{name="CloudHsmClusterNotFoundException";$fault="client";constructor(t){super({name:"CloudHsmClusterNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},j=class e extends i{name="CloudHsmClusterNotRelatedException";$fault="client";constructor(t){super({name:"CloudHsmClusterNotRelatedException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},W=class e extends i{name="ConflictException";$fault="client";constructor(t){super({name:"ConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},z=class e extends i{name="CustomKeyStoreInvalidStateException";$fault="client";constructor(t){super({name:"CustomKeyStoreInvalidStateException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},B=class e extends i{name="CustomKeyStoreNotFoundException";$fault="client";constructor(t){super({name:"CustomKeyStoreNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Q=class e extends i{name="InvalidAliasNameException";$fault="client";constructor(t){super({name:"InvalidAliasNameException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Y=class e extends i{name="LimitExceededException";$fault="client";constructor(t){super({name:"LimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},J=class e extends i{name="CustomKeyStoreNameInUseException";$fault="client";constructor(t){super({name:"CustomKeyStoreNameInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Z=class e extends i{name="IncorrectTrustAnchorException";$fault="client";constructor(t){super({name:"IncorrectTrustAnchorException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ee=class e extends i{name="XksProxyIncorrectAuthenticationCredentialException";$fault="client";constructor(t){super({name:"XksProxyIncorrectAuthenticationCredentialException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},te=class e extends i{name="XksProxyInvalidConfigurationException";$fault="client";constructor(t){super({name:"XksProxyInvalidConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},oe=class e extends i{name="XksProxyInvalidResponseException";$fault="client";constructor(t){super({name:"XksProxyInvalidResponseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},re=class e extends i{name="XksProxyUriEndpointInUseException";$fault="client";constructor(t){super({name:"XksProxyUriEndpointInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ne=class e extends i{name="XksProxyUriInUseException";$fault="client";constructor(t){super({name:"XksProxyUriInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},se=class e extends i{name="XksProxyUriUnreachableException";$fault="client";constructor(t){super({name:"XksProxyUriUnreachableException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ie=class e extends i{name="XksProxyVpcEndpointServiceInUseException";$fault="client";constructor(t){super({name:"XksProxyVpcEndpointServiceInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ae=class e extends i{name="XksProxyVpcEndpointServiceInvalidConfigurationException";$fault="client";constructor(t){super({name:"XksProxyVpcEndpointServiceInvalidConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ce=class e extends i{name="XksProxyVpcEndpointServiceNotFoundException";$fault="client";constructor(t){super({name:"XksProxyVpcEndpointServiceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},pe=class e extends i{name="DisabledException";$fault="client";constructor(t){super({name:"DisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},le=class e extends i{name="DryRunOperationException";$fault="client";constructor(t){super({name:"DryRunOperationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ue=class e extends i{name="InvalidGrantTokenException";$fault="client";constructor(t){super({name:"InvalidGrantTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},de=class e extends i{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ye=class e extends i{name="TagException";$fault="client";constructor(t){super({name:"TagException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},me=class e extends i{name="UnsupportedOperationException";$fault="client";constructor(t){super({name:"UnsupportedOperationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},xe=class e extends i{name="XksKeyAlreadyInUseException";$fault="client";constructor(t){super({name:"XksKeyAlreadyInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ee=class e extends i{name="XksKeyInvalidConfigurationException";$fault="client";constructor(t){super({name:"XksKeyInvalidConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Re=class e extends i{name="XksKeyNotFoundException";$fault="client";constructor(t){super({name:"XksKeyNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ve=class e extends i{name="CustomKeyStoreHasCMKsException";$fault="client";constructor(t){super({name:"CustomKeyStoreHasCMKsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ke=class e extends i{name="IncorrectKeyException";$fault="client";constructor(t){super({name:"IncorrectKeyException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},fe=class e extends i{name="InvalidCiphertextException";$fault="client";constructor(t){super({name:"InvalidCiphertextException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ge=class e extends i{name="InvalidKeyUsageException";$fault="client";constructor(t){super({name:"InvalidKeyUsageException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Se=class e extends i{name="KeyUnavailableException";$fault="server";constructor(t){super({name:"KeyUnavailableException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype)}},_e=class e extends i{name="InvalidMarkerException";$fault="client";constructor(t){super({name:"InvalidMarkerException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ce=class e extends i{name="ExpiredImportTokenException";$fault="client";constructor(t){super({name:"ExpiredImportTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},he=class e extends i{name="IncorrectKeyMaterialException";$fault="client";constructor(t){super({name:"IncorrectKeyMaterialException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Pe=class e extends i{name="InvalidImportTokenException";$fault="client";constructor(t){super({name:"InvalidImportTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ie=class e extends i{name="InvalidGrantIdException";$fault="client";constructor(t){super({name:"InvalidGrantIdException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},$e=class e extends i{name="KMSInvalidMacException";$fault="client";constructor(t){super({name:"KMSInvalidMacException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},De=class e extends i{name="KMSInvalidSignatureException";$fault="client";constructor(t){super({name:"KMSInvalidSignatureException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}};var Zo="AttestationDocument",er="AlreadyExistsException";var _o="CiphertextBlob";var tr="ConflictException";var Co="CiphertextForRecipient";var or="CloudHsmClusterInvalidConfigurationException",rr="CloudHsmClusterInUseException",nr="CloudHsmClusterNotActiveException",sr="CloudHsmClusterNotFoundException",ir="CloudHsmClusterNotRelatedException";var ar="CustomKeyStoreHasCMKsException";var cr="CustomKeyStoreInvalidStateException";var pr="CustomKeyStoreNotFoundException",lr="CustomKeyStoreNameInUseException";var ur="DisabledException";var ho="DryRun",dr="DryRunModifiers",yr="DryRunOperationException",mr="DecryptRequest",xr="DecryptResponse";var Er="DependencyTimeoutException",Rr="Decrypt";var Po="EncryptionAlgorithm";var Io="EncryptionContext";var vr="ExpiredImportTokenException";var Kr="GenerateDataKey";var fr="GenerateDataKeyRequest",gr="GenerateDataKeyResponse";var $o="GrantTokens";var Sr="InvalidArnException",_r="InvalidAliasNameException",Cr="InvalidCiphertextException",hr="InvalidGrantIdException",Pr="InvalidGrantTokenException",Ir="InvalidImportTokenException",$r="IncorrectKeyException";var Dr="IncorrectKeyMaterialException";var Ar="InvalidKeyUsageException",kr="InvalidMarkerException";var Mr="IncorrectTrustAnchorException";var br="KeyEncryptionAlgorithm",Ae="KeyId";var Do="KeyMaterialId";var Or="KMSInternalException",wr="KMSInvalidMacException",Gr="KMSInvalidSignatureException",Tr="KMSInvalidStateException";var Ur="KeySpec";var Lr="KeyUnavailableException";var Nr="LimitExceededException";var qr="MalformedPolicyDocumentException";var Xr="NotFoundException";var Vr="NumberOfBytes";var Fr="PlaintextType";var Ao="Plaintext",ko="Recipient";var Hr="RecipientInfo";var jr="TagException";var Wr="UnsupportedOperationException";var zr="XksKeyAlreadyInUseException";var Br="XksKeyInvalidConfigurationException",Qr="XksKeyNotFoundException";var Yr="XksProxyIncorrectAuthenticationCredentialException",Jr="XksProxyInvalidConfigurationException",Zr="XksProxyInvalidResponseException";var en="XksProxyUriEndpointInUseException",tn="XksProxyUriInUseException";var on="XksProxyUriUnreachableException",rn="XksProxyVpcEndpointServiceInvalidConfigurationException",nn="XksProxyVpcEndpointServiceInUseException";var sn="XksProxyVpcEndpointServiceNotFoundException";var c="awsQueryError",d="client",p="error",l="httpError",u="message",Mo="smithy.ts.sdk.synthetic.com.amazonaws.kms",Le="server",n="com.amazonaws.kms",bo=Te.for(Mo),an=[-3,Mo,"KMSServiceException",0,[],[]];bo.registerError(an,i);var a=Te.for(n),cn=[-3,n,er,{[c]:["AlreadyExists",409],[p]:d,[l]:409},[u],[0]];a.registerError(cn,G);var pn=[-3,n,rr,{[c]:["CloudHsmClusterInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(pn,X);var ln=[-3,n,or,{[c]:["CloudHsmClusterInvalidConfigurationException",400],[p]:d,[l]:400},[u],[0]];a.registerError(ln,V);var un=[-3,n,nr,{[c]:["CloudHsmClusterNotActiveException",400],[p]:d,[l]:400},[u],[0]];a.registerError(un,F);var dn=[-3,n,sr,{[c]:["CloudHsmClusterNotFoundException",400],[p]:d,[l]:400},[u],[0]];a.registerError(dn,H);var yn=[-3,n,ir,{[c]:["CloudHsmClusterNotRelatedException",400],[p]:d,[l]:400},[u],[0]];a.registerError(yn,j);var mn=[-3,n,tr,{[c]:["ConflictException",409],[p]:d,[l]:409},[u],[0]];a.registerError(mn,W);var xn=[-3,n,ar,{[c]:["CustomKeyStoreHasCMKsException",400],[p]:d,[l]:400},[u],[0]];a.registerError(xn,ve);var En=[-3,n,cr,{[c]:["CustomKeyStoreInvalidStateException",400],[p]:d,[l]:400},[u],[0]];a.registerError(En,z);var Rn=[-3,n,lr,{[c]:["CustomKeyStoreNameInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Rn,J);var vn=[-3,n,pr,{[c]:["CustomKeyStoreNotFoundException",400],[p]:d,[l]:400},[u],[0]];a.registerError(vn,B);var Kn=[-3,n,Er,{[c]:["DependencyTimeout",503],[p]:Le,[l]:503},[u],[0]];a.registerError(Kn,T);var fn=[-3,n,ur,{[c]:["Disabled",409],[p]:d,[l]:409},[u],[0]];a.registerError(fn,pe);var gn=[-3,n,yr,{[c]:["DryRunOperation",412],[p]:d,[l]:412},[u],[0]];a.registerError(gn,le);var Sn=[-3,n,vr,{[c]:["ExpiredImportTokenException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Sn,Ce);var _n=[-3,n,$r,{[c]:["IncorrectKeyException",400],[p]:d,[l]:400},[u],[0]];a.registerError(_n,Ke);var Cn=[-3,n,Dr,{[c]:["IncorrectKeyMaterialException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Cn,he);var hn=[-3,n,Mr,{[c]:["IncorrectTrustAnchorException",400],[p]:d,[l]:400},[u],[0]];a.registerError(hn,Z);var Pn=[-3,n,_r,{[c]:["InvalidAliasName",400],[p]:d,[l]:400},[u],[0]];a.registerError(Pn,Q);var In=[-3,n,Sr,{[c]:["InvalidArn",400],[p]:d,[l]:400},[u],[0]];a.registerError(In,U);var $n=[-3,n,Cr,{[c]:["InvalidCiphertext",400],[p]:d,[l]:400},[u],[0]];a.registerError($n,fe);var Dn=[-3,n,hr,{[c]:["InvalidGrantId",400],[p]:d,[l]:400},[u],[0]];a.registerError(Dn,Ie);var An=[-3,n,Pr,{[c]:["InvalidGrantToken",400],[p]:d,[l]:400},[u],[0]];a.registerError(An,ue);var kn=[-3,n,Ir,{[c]:["InvalidImportTokenException",400],[p]:d,[l]:400},[u],[0]];a.registerError(kn,Pe);var Mn=[-3,n,Ar,{[c]:["InvalidKeyUsage",400],[p]:d,[l]:400},[u],[0]];a.registerError(Mn,ge);var bn=[-3,n,kr,{[c]:["InvalidMarker",400],[p]:d,[l]:400},[u],[0]];a.registerError(bn,_e);var On=[-3,n,Lr,{[c]:["KeyUnavailable",500],[p]:Le,[l]:500},[u],[0]];a.registerError(On,Se);var wn=[-3,n,Or,{[c]:["KMSInternal",500],[p]:Le,[l]:500},[u],[0]];a.registerError(wn,L);var Gn=[-3,n,wr,{[c]:["KMSInvalidMac",400],[p]:d,[l]:400},[u],[0]];a.registerError(Gn,$e);var Tn=[-3,n,Gr,{[c]:["KMSInvalidSignature",400],[p]:d,[l]:400},[u],[0]];a.registerError(Tn,De);var Un=[-3,n,Tr,{[c]:["KMSInvalidStateException",409],[p]:d,[l]:409},[u],[0]];a.registerError(Un,N);var Ln=[-3,n,Nr,{[c]:["LimitExceeded",400],[p]:d,[l]:400},[u],[0]];a.registerError(Ln,Y);var Nn=[-3,n,qr,{[c]:["MalformedPolicyDocument",400],[p]:d,[l]:400},[u],[0]];a.registerError(Nn,de);var qn=[-3,n,Xr,{[c]:["NotFound",404],[p]:d,[l]:404},[u],[0]];a.registerError(qn,q);var Xn=[-3,n,jr,{[c]:["TagException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Xn,ye);var Vn=[-3,n,Wr,{[c]:["UnsupportedOperation",400],[p]:d,[l]:400},[u],[0]];a.registerError(Vn,me);var Fn=[-3,n,zr,{[c]:["XksKeyAlreadyInUse",400],[p]:d,[l]:400},[u],[0]];a.registerError(Fn,xe);var Hn=[-3,n,Br,{[c]:["XksKeyInvalidConfiguration",400],[p]:d,[l]:400},[u],[0]];a.registerError(Hn,Ee);var jn=[-3,n,Qr,{[c]:["XksKeyNotFoundException",400],[p]:d,[l]:400},[u],[0]];a.registerError(jn,Re);var Wn=[-3,n,Yr,{[c]:["XksProxyIncorrectAuthenticationCredentialException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Wn,ee);var zn=[-3,n,Jr,{[c]:["XksProxyInvalidConfigurationException",400],[p]:d,[l]:400},[u],[0]];a.registerError(zn,te);var Bn=[-3,n,Zr,{[c]:["XksProxyInvalidResponseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Bn,oe);var Qn=[-3,n,en,{[c]:["XksProxyUriEndpointInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Qn,re);var Yn=[-3,n,tn,{[c]:["XksProxyUriInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Yn,ne);var Jn=[-3,n,on,{[c]:["XksProxyUriUnreachableException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Jn,se);var Zn=[-3,n,nn,{[c]:["XksProxyVpcEndpointServiceInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Zn,ie);var es=[-3,n,rn,{[c]:["XksProxyVpcEndpointServiceInvalidConfigurationException",400],[p]:d,[l]:400},[u],[0]];a.registerError(es,ae);var ts=[-3,n,sn,{[c]:["XksProxyVpcEndpointServiceNotFoundException",400],[p]:d,[l]:400},[u],[0]];a.registerError(ts,ce);var Oo=[bo,a];var wo=[0,n,Fr,8,21];var os=[3,n,mr,0,[_o,Io,$o,Ae,Po,ko,ho,dr],[21,128,64,0,0,()=>Go,2,64]],rs=[3,n,xr,0,[Ae,Ao,Po,Co,Do],[0,[()=>wo,0],0,21,0]];var ns=[3,n,fr,0,[Ae,Io,Vr,Ur,$o,ko,ho],[0,128,1,0,64,()=>Go,2],1],ss=[3,n,gr,0,[_o,Ao,Ae,Co,Do],[21,[()=>wo,0],0,21,0]];var Go=[3,n,Hr,0,[br,Zo],[0,21]];var To=[9,n,Rr,0,()=>os,()=>rs];var Uo=[9,n,Kr,0,()=>ns,()=>ss];var Lo=e=>({apiVersion:"2014-11-01",base64Decoder:e?.base64Decoder??Qe,base64Encoder:e?.base64Encoder??Ze,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??So,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Zt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new mt}],logger:e?.logger??new Ct,protocol:e?.protocol??O,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.kms",errorTypeRegistries:Oo,xmlNamespace:"https://trent.amazonaws.com/doc/2014-11-01/",version:"2014-11-01",serviceTarget:"TrentService"},serviceId:e?.serviceId??"KMS",urlParser:e?.urlParser??rt,utf8Decoder:e?.utf8Decoder??Ye,utf8Encoder:e?.utf8Encoder??Je});var No=e=>{gt(process.version);let t=Bt(e),o=()=>t().then(ft),s=Lo(e);yt(process.version);let r={profile:e?.profile,logger:s.logger};return{...s,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??f(xt,r),bodyLengthChecker:e?.bodyLengthChecker??zt,credentialDefaultProvider:e?.credentialDefaultProvider??ao,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ht({serviceId:s.serviceId,clientVersion:oo.version}),maxAttempts:e?.maxAttempts??f(Ut,e),region:e?.region??f(Mt,{...bt,...r}),requestHandler:et.create(e?.requestHandler??o),retryMode:e?.retryMode??f({...Nt,default:async()=>(await o()).retryMode||$t},e),sha256:e?.sha256??Wt.bind(null,"sha256"),streamCollector:e?.streamCollector??tt,useDualstackEndpoint:e?.useDualstackEndpoint??f(At,r),useFipsEndpoint:e?.useFipsEndpoint??f(kt,r),userAgentAppId:e?.userAgentAppId??f(jt,r)}};var qo=e=>{let t=e.httpAuthSchemes,o=e.httpAuthSchemeProvider,s=e.credentials;return{setHttpAuthScheme(r){let y=t.findIndex(m=>m.schemeId===r.schemeId);y===-1?t.push(r):t.splice(y,1,r)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(r){o=r},httpAuthSchemeProvider(){return o},setCredentials(r){s=r},credentials(){return s}}},Xo=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()});var Vo=(e,t)=>{let o=Object.assign(Qt(e),St(e),Xe(e),qo(e));return t.forEach(s=>s.configure(o)),Object.assign(e,Yt(o),_t(o),Ve(o),Xo(o))};var ke=class extends vt{config;constructor(...[t]){let o=No(t||{});super(o),this.initConfig=o;let s=to(o),r=ct(s),y=Lt(r),m=Ot(y),x=m,g=Tt(x),D=eo(g),A=Vo(D,t?.extensions||[]);this.config=A,this.middlewareStack.use(nt(this.config)),this.middlewareStack.use(Dt(this.config)),this.middlewareStack.use(qt(this.config)),this.middlewareStack.use(wt(this.config)),this.middlewareStack.use(Fe(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(je(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Jt,identityProviderConfigProvider:async be=>new at({"aws.auth#sigv4":be.credentials})})),this.middlewareStack.use(Be(this.config))}destroy(){super.destroy()}};var Me=class extends k.classBuilder().ep(w).m(function(t,o,s,r){return[M(s,t.getEndpointParameterInstructions())]}).s("TrentService","Decrypt",{}).n("KMSClient","DecryptCommand").sc(To).build(){};var $=class extends k.classBuilder().ep(w).m(function(t,o,s,r){return[M(s,t.getEndpointParameterInstructions())]}).s("TrentService","GenerateDataKey",{}).n("KMSClient","GenerateDataKeyCommand").sc(Uo).build(){};var Fo=class{name="aws-kms";client;keyId;keyVersion;constructor(t){let o=t.keyId??process.env.AWS_KMS_KEY_ID??process.env.AWS_KMS_KEY_ARN;if(!o)throw new Error("AWS KMS Key ID or ARN required. Set AWS_KMS_KEY_ID or pass keyId in config.");this.keyId=o,this.keyVersion=t.keyVersion??1;let s=t.region??process.env.AWS_REGION??"us-east-1";this.client=new ke({region:s,...t.credentials&&{credentials:{accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}}}),E.debug("[vault:aws-kms] Initialized",{keyId:o,region:s,keyVersion:this.keyVersion})}async encrypt(t,o){try{let s=await this.client.send(new $({KeyId:this.keyId,KeySpec:"AES_256"})),r=s.Plaintext,y=s.CiphertextBlob;if(!r||!y)throw new Error("AWS KMS GenerateDataKey returned empty DEK");let m=Ne(t,r),x={id:o?.id??is(),ciphertext:C(m.ciphertext),encryptedDek:C(y),iv:C(m.iv),authTag:C(m.authTag),keyVersion:this.keyVersion,algorithm:"aes-256-gcm",...o?.tenantId!==void 0?{tenantId:o.tenantId}:{},metadata:o?.metadata,createdAt:new Date().toISOString()};return E.debug("[vault:aws-kms] Secret encrypted",{id:x.id,tenantId:o?.tenantId}),x}catch(s){throw E.error("[vault:aws-kms] Encryption failed",{error:s}),new Error(`AWS KMS encryption failed: ${s instanceof Error?s.message:String(s)}`)}}async decrypt(t,o){try{if(o?.tenantId&&t.tenantId&&t.tenantId!==o.tenantId)throw new Error("Tenant ID mismatch");let r=(await this.client.send(new Me({CiphertextBlob:h(t.encryptedDek)}))).Plaintext;if(!r)throw new Error("AWS KMS Decrypt returned empty DEK");let y=qe(h(t.ciphertext),r,{iv:h(t.iv),authTag:h(t.authTag)});return E.debug("[vault:aws-kms] Secret decrypted",{id:t.id,tenantId:o?.tenantId}),y.toString("utf-8")}catch(s){throw E.error("[vault:aws-kms] Decryption failed",{error:s}),new Error(`AWS KMS decryption failed: ${s instanceof Error?s.message:String(s)}`)}}async rotateKey(t){try{let o=await this.decrypt(t),s=await this.encrypt(o,{id:t.id,...t.tenantId!==void 0?{tenantId:t.tenantId}:{},metadata:t.metadata});return s.rotatedAt=new Date().toISOString(),E.debug("[vault:aws-kms] Key rotated",{id:t.id}),s}catch(o){throw E.error("[vault:aws-kms] Key rotation failed",{error:o}),new Error(`Key rotation failed: ${o instanceof Error?o.message:String(o)}`)}}async rotateKek(){this.keyVersion+=1,E.info("[vault:aws-kms] KEK rotated",{newVersion:this.keyVersion})}async generateDek(){try{return(await this.client.send(new $({KeyId:this.keyId,KeySpec:"AES_256"}))).Plaintext}catch(t){throw E.error("[vault:aws-kms] DEK generation failed",{error:t}),new Error(`DEK generation failed: ${t instanceof Error?t.message:String(t)}`)}}async close(){this.client.destroy(),E.debug("[vault:aws-kms] Closed")}};export{Fo as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g}from"./chunk-ZCWB3HFB.js";import{b as d,f as u}from"./chunk-WI7DO2VU.js";import{b as a}from"./chunk-TX7AAHER.js";function h(r){let o={};if(r=r.replace(/^\?/,""),r)for(let n of r.split("&")){let[e,t=null]=n.split("=");e=decodeURIComponent(e),t&&(t=decodeURIComponent(t)),e in o?Array.isArray(o[e])?o[e].push(t):o[e]=[o[e],t]:o[e]=t}return o}var F=r=>{if(typeof r=="string")return F(new URL(r));let{hostname:o,pathname:n,port:e,protocol:t,search:i}=r,f;return i&&(f=h(i)),{hostname:o,port:e?parseInt(e):void 0,protocol:t,path:n,query:f}};var y=r=>()=>Promise.resolve(r);var w=(r,o,n)=>{let e,t,i,f=!1,s=async()=>{t||(t=r());try{e=await t,i=!0,f=!1}finally{t=void 0}return e};return o===void 0?async c=>((!i||c?.forceRefresh)&&(e=await s()),e):async c=>((!i||c?.forceRefresh)&&(e=await s()),f?e:n&&!n(e)?(f=!0,e):(o(e)&&await s(),e))};function m(r){try{let o=new Set(Array.from(r.match(/([A-Z_]){3,}/g)??[]));return o.delete("CONFIG"),o.delete("CONFIG_PREFIX_SEPARATOR"),o.delete("ENV"),[...o].join(", ")}catch{return r}}var C=(r,o)=>async()=>{try{let n=r(process.env,o);if(n===void 0)throw new Error;return n}catch(n){throw new a(n.message||`Not found in ENV: ${m(r.toString())}`,{logger:o?.logger})}};var S=(r,{preferredFile:o="config",...n}={})=>async()=>{let e=d(n),{configFile:t,credentialsFile:i}=await u(n),f=i[e]||{},s=t[e]||{},c=o==="config"?{...f,...s}:{...s,...f};try{let p=r(c,o==="config"?t:i);if(p===void 0)throw new Error;return p}catch(l){throw new a(l.message||`Not found in config files w/ profile [${e}]: ${m(r.toString())}`,{logger:n.logger})}};var N=r=>typeof r=="function",v=r=>N(r)?async()=>await r():y(r);var b=({environmentVariableSelector:r,configFileSelector:o,default:n},e={})=>{let{signingName:t,logger:i}=e;return w(g(C(r,{signingName:t,logger:i}),S(o,e),v(n)))};export{F as a,w as b,b as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _}from"./chunk-3T4EOSMQ.js";import{b as S}from"./chunk-TX7AAHER.js";var p="AWS_ACCESS_KEY_ID",A="AWS_SECRET_ACCESS_KEY",C="AWS_SESSION_TOKEN",N="AWS_CREDENTIAL_EXPIRATION",a="AWS_CREDENTIAL_SCOPE",i="AWS_ACCOUNT_ID",v=e=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let o=process.env[p],r=process.env[A],n=process.env[C],s=process.env[N],t=process.env[a],E=process.env[i];if(o&&r){let c={accessKeyId:o,secretAccessKey:r,...n&&{sessionToken:n},...s&&{expiration:new Date(s)},...t&&{credentialScope:t},...E&&{accountId:E}};return _(c,"CREDENTIALS_ENV_VARS","g"),c}throw new S("Unable to find environment variable credentials.",{logger:e?.logger})};export{p as a,A as b,C as c,N as d,a as e,i as f,v as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createCipheriv as h,createDecipheriv as p,hkdf as l,randomBytes as s}from"crypto";var a="aes-256-gcm",c=32,g=12,B=16;function T(e,r,n){if(r.length!==c)throw new Error(`Key must be ${c} bytes, got ${r.length}`);let o=s(g),t=h(a,r,o,{authTagLength:B});n!==void 0&&t.setAAD(n);let f=typeof e=="string"?Buffer.from(e,"utf-8"):e,u=t.update(f);u=Buffer.concat([u,t.final()]);let i=t.getAuthTag();return{ciphertext:u,iv:o,authTag:i}}function A(e,r,n,o){if(r.length!==c)throw new Error(`Key must be ${c} bytes, got ${r.length}`);let t=p(a,r,n.iv);t.setAuthTag(n.authTag),o!==void 0&&t.setAAD(o);let f=t.update(e);return f=Buffer.concat([f,t.final()]),f}function d(e,r,n){let o=typeof e=="string"?Buffer.from(e,"utf-8"):e;return new Promise((t,f)=>{l("sha256",o,r??Buffer.alloc(0),n??Buffer.alloc(0),c,(u,i)=>{u?f(u):t(Buffer.from(i))})})}function x(e=c){return s(e)}function E(){return s(g)}function b(e){return e.toString("base64")}function v(e){return Buffer.from(e,"base64")}export{T as a,A as b,d as c,x as d,E as e,b as f,v as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=class{value;next;constructor(t){this.value=t}},a=class{#e;#t;#i;constructor(){this.clear()}enqueue(t){let i=new f(t);this.#e?(this.#t.next=i,this.#t=i):(this.#e=i,this.#t=i),this.#i++}dequeue(){let t=this.#e;if(t)return this.#e=this.#e.next,this.#i--,this.#e||(this.#t=void 0),t.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#i=0}get size(){return this.#i}*[Symbol.iterator](){let t=this.#e;for(;t;)yield t.value,t=t.next}*drain(){for(;this.#e;)yield this.dequeue()}};function x(e){let t=!1;if(typeof e=="object"&&({concurrency:e,rejectOnClear:t=!1}=e),c(e),typeof t!="boolean")throw new TypeError("Expected `rejectOnClear` to be a boolean");let i=new a,o=0,h=()=>{o<e&&i.size>0&&(o++,i.dequeue().run())},m=()=>{o--,h()},p=async(s,r,u)=>{let n=(async()=>s(...u))();r(n);try{await n}catch{}m()},b=(s,r,u,n)=>{let l={reject:u};new Promise(w=>{l.run=w,i.enqueue(l)}).then(p.bind(void 0,s,r,n)),o<e&&h()},d=(s,...r)=>new Promise((u,n)=>{b(s,u,n,r)});return Object.defineProperties(d,{activeCount:{get:()=>o},pendingCount:{get:()=>i.size},clearQueue:{value(){if(!t){i.clear();return}let s=AbortSignal.abort().reason;for(;i.size>0;)i.dequeue().reject(s)}},concurrency:{get:()=>e,set(s){c(s),e=s,queueMicrotask(()=>{for(;o<e&&i.size>0;)h()})}},map:{async value(s,r){let u=Array.from(s,(n,l)=>this(r,n,l));return Promise.all(u)}}}),d}function c(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as h,q as b,r as w,s as j,u as x}from"./chunk-YYJUG63O.js";import{b as l}from"./chunk-224RJRPV.js";import{e as g}from"./chunk-XB6R2VIU.js";var T=class{async sign(t,i,e){return t}};var q={name:"@aws-sdk/nested-clients",version:"3.996.16",description:"Nested clients for AWS SDK packages.",main:"./dist-cjs/index.js",module:"./dist-es/index.js",types:"./dist-types/index.d.ts",scripts:{build:"yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",lint:"node ../../scripts/validation/submodules-linter.js --pkg nested-clients",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},engines:{node:">=20.0.0"},sideEffects:!1,author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.973.25","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.9","@aws-sdk/middleware-user-agent":"^3.972.26","@aws-sdk/region-config-resolver":"^3.972.10","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.12","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-utf8":"^4.2.2",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3"},typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],browser:{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/submodules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{types:"./dist-types/submodules/cognito-identity/index.d.ts",module:"./dist-es/submodules/cognito-identity/index.js",node:"./dist-cjs/submodules/cognito-identity/index.js",import:"./dist-es/submodules/cognito-identity/index.js",require:"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{types:"./dist-types/submodules/sso/index.d.ts",module:"./dist-es/submodules/sso/index.js",node:"./dist-cjs/submodules/sso/index.js",import:"./dist-es/submodules/sso/index.js",require:"./dist-cjs/submodules/sso/index.js"}}};function z(s){return encodeURIComponent(s).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var C=s=>{let t=s.length,i=[],e=!1,o,r=0;for(let n=0;n<t;++n){let d=s[n];switch(d){case'"':o!=="\\"&&(e=!e);break;case",":e||(i.push(s.slice(r,n)),r=n+1);break;default:}o=d}return i.push(s.slice(r)),i.map(n=>{n=n.trim();let d=n.length;return d<2?n:(n[0]==='"'&&n[d-1]==='"'&&(n=n.slice(1,d-1)),n.replace(/\\"/g,'"'))})};var p="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",f="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",y="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",N="(\\d?\\d)",S="(\\d{4})",U=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),A=new RegExp(`^${p}, ${N} ${f} ${S} ${y} GMT$`),J=new RegExp(`^${p}, ${N}-${f}-(\\d\\d) ${y} GMT$`),v=new RegExp(`^${p} ${f} ( [1-9]|\\d\\d) ${y} ${S}$`),W=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],$=s=>{if(s==null)return;let t=NaN;if(typeof s=="number")t=s;else if(typeof s=="string"){if(!/^-?\d*\.?\d+$/.test(s))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(s)}else typeof s=="object"&&s.tag===1&&(t=s.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1e3))},k=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC3339 timestamps must be strings");let t=U.exec(s);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${s}`);let[,i,e,o,r,n,d,,m,a]=t;u(e,1,12),u(o,1,31),u(r,0,23),u(n,0,59),u(d,0,60);let c=new Date(Date.UTC(Number(i),Number(e)-1,Number(o),Number(r),Number(n),Number(d),Number(m)?Math.round(parseFloat(`0.${m}`)*1e3):0));if(c.setUTCFullYear(Number(i)),a.toUpperCase()!="Z"){let[,F,M,R]=/([+-])(\d\d):(\d\d)/.exec(a)||[void 0,"+",0,0],_=F==="-"?1:-1;c.setTime(c.getTime()+_*(Number(M)*60*60*1e3+Number(R)*60*1e3))}return c},E=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC7231 timestamps must be strings.");let t,i,e,o,r,n,d,m;if((m=A.exec(s))?[,t,i,e,o,r,n,d]=m:(m=J.exec(s))?([,t,i,e,o,r,n,d]=m,e=(Number(e)+1900).toString()):(m=v.exec(s))&&([,i,t,o,r,n,d,e]=m),e&&n){let a=Date.UTC(Number(e),W.indexOf(i),Number(t),Number(o),Number(r),Number(n),d?Math.round(parseFloat(`0.${d}`)*1e3):0);u(t,1,31),u(o,0,23),u(r,0,59),u(n,0,60);let c=new Date(a);return c.setUTCFullYear(Number(e)),c}throw new TypeError(`Invalid RFC7231 date-time value ${s}.`)};function u(s,t,i){let e=Number(s);if(e<t||e>i)throw new Error(`Value ${e} out of range [${t}, ${i}]`)}var D=class extends j{settings;constructor(t){super(),this.settings=t}read(t,i){let e=h.of(t);if(e.isListSchema())return C(i).map(o=>this.read(e.getValueSchema(),o));if(e.isBlobSchema())return(this.serdeContext?.base64Decoder??l)(i);if(e.isTimestampSchema())switch(x(e,this.settings)){case 5:return k(i);case 6:return E(i);case 7:return $(i);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",i),new Date(i)}if(e.isStringSchema()){let o=e.getMergedTraits().mediaType,r=i;if(o)return e.getMergedTraits().httpHeader&&(r=this.base64ToUtf8(r)),(o==="application/json"||o.endsWith("+json"))&&(r=b.from(r)),r}return e.isNumericSchema()?Number(i):e.isBigIntegerSchema()?BigInt(i):e.isBigDecimalSchema()?new w(i,"bigDecimal"):e.isBooleanSchema()?String(i).toLowerCase()==="true":i}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??g)((this.serdeContext?.base64Decoder??l)(t))}};export{z as a,C as b,D as c,T as d,q as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=class s extends Error{name="ProviderError";tryNextLink;constructor(t,e=!0){let u,r=!0;typeof e=="boolean"?(u=void 0,r=e):e!=null&&typeof e=="object"&&(u=e.logger,r=e.tryNextLink??!0),super(t),this.tryNextLink=r,Object.setPrototypeOf(this,s.prototype),u?.debug?.(`@smithy/property-provider ${r?"->":"(!)"} ${t}`)}static from(t,e=!0){return Object.assign(new this(t.message,e),t)}};var i=class s extends o{name="CredentialsProviderError";constructor(t,e=!0){super(t,e),Object.setPrototypeOf(this,s.prototype)}};export{o as a,i as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as S,P as I,j as T,n as y,p as E,q as b,r as p,u as l}from"./chunk-YYJUG63O.js";import{b as j,c as x,i as O,k as M,l as R,m as k}from"./chunk-224RJRPV.js";import{e as C}from"./chunk-XB6R2VIU.js";var J=(h,r)=>T(h,r).then(e=>(r?.utf8Encoder??C)(e));var B=(h,r)=>J(h,r).then(e=>{if(e.length)try{return JSON.parse(e)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:e}),n}return{}});var W=(h,r)=>{let e=(s,t)=>Object.keys(s).find(i=>i.toLowerCase()===t.toLowerCase()),n=s=>{let t=s;return typeof t=="number"&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=e(h.headers,"x-amzn-errortype");if(o!==void 0)return n(h.headers[o]);if(r&&typeof r=="object"){let s=e(r,"code");if(s&&r[s]!==void 0)return n(r[s]);if(r.__type!==void 0)return n(r.__type)}};function D(h,r,e){if(e?.source){let n=e.source;if(typeof r=="number"&&(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER||n!==String(r)))return n.includes(".")?new p(n,"bigDecimal"):BigInt(n)}return r}var w=class extends S{settings;constructor(r){super(),this.settings=r}async read(r,e){return this._read(r,typeof e=="string"?JSON.parse(e,D):await B(e,this.serdeContext))}readObject(r,e){return this._read(r,e)}_read(r,e){let n=e!==null&&typeof e=="object",o=y.of(r);if(n){if(o.isStructSchema()){let t=e,i=o.isUnionSchema(),c={},a,{jsonName:f}=this.settings;f&&(a={});let u;i&&(u=new I(t,c));for(let[m,g]of o.structIterator()){let d=m;f&&(d=g.getMergedTraits().jsonName??d,a[d]=m),i&&u.mark(d),t[d]!=null&&(c[m]=this._read(g,t[d]))}if(i)u.writeUnknown();else if(typeof t.__type=="string")for(let[m,g]of Object.entries(t)){let d=f?a[m]??m:m;d in c||(c[d]=g)}return c}if(Array.isArray(e)&&o.isListSchema()){let t=o.getValueSchema(),i=[];for(let c of e)i.push(this._read(t,c));return i}if(o.isMapSchema()){let t=o.getValueSchema(),i={};for(let[c,a]of Object.entries(e))i[c]=this._read(t,a);return i}}if(o.isBlobSchema()&&typeof e=="string")return j(e);let s=o.getMergedTraits().mediaType;if(o.isStringSchema()&&typeof e=="string"&&s)return s==="application/json"||s.endsWith("+json")?b.from(e):e;if(o.isTimestampSchema()&&e!=null)switch(l(o,this.settings)){case 5:return M(e);case 6:return R(e);case 7:return k(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(o.isBigIntegerSchema()&&(typeof e=="number"||typeof e=="string"))return BigInt(e);if(o.isBigDecimalSchema()&&e!=null){if(e instanceof p)return e;let t=e;return t.type==="bigDecimal"&&"string"in t?new p(t.string,t.type):new p(String(e),"bigDecimal")}if(o.isNumericSchema()&&typeof e=="string"){switch(e){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return e}if(o.isDocumentSchema())if(n){let t=Array.isArray(e)?[]:{};for(let[i,c]of Object.entries(e))c instanceof p?t[i]=c:t[i]=this._read(o,c);return t}else return structuredClone(e);return e}};var A="\u039D",_=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(r,e)=>{if(e instanceof p){let n=`${A+"nv"+this.counter++}_`+e.string;return this.values.set(`"${n}"`,e.string),n}if(typeof e=="bigint"){let n=e.toString(),o=`${A+"b"+this.counter++}_`+n;return this.values.set(`"${o}"`,n),o}return e}}replaceInJson(r){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return r;for(let[e,n]of this.values)r=r.replace(e,n);return r}};var N=class extends S{settings;buffer;useReplacer=!1;rootSchema;constructor(r){super(),this.settings=r}write(r,e){this.rootSchema=y.of(r),this.buffer=this._write(this.rootSchema,e)}writeDiscriminatedDocument(r,e){this.write(r,e),typeof this.buffer=="object"&&(this.buffer.__type=y.of(r).getName(!0))}flush(){let{rootSchema:r,useReplacer:e}=this;if(this.rootSchema=void 0,this.useReplacer=!1,r?.isStructSchema()||r?.isDocumentSchema()){if(!e)return JSON.stringify(this.buffer);let n=new _;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}_write(r,e,n){let o=e!==null&&typeof e=="object",s=y.of(r);if(o){if(s.isStructSchema()){let t=e,i={},{jsonName:c}=this.settings,a;c&&(a={});for(let[f,u]of s.structIterator()){let m=this._write(u,t[f],s);if(m!==void 0){let g=f;c&&(g=u.getMergedTraits().jsonName??f,a[f]=g),i[g]=m}}if(s.isUnionSchema()&&Object.keys(i).length===0){let{$unknown:f}=t;if(Array.isArray(f)){let[u,m]=f;i[u]=this._write(15,m)}}else if(typeof t.__type=="string")for(let[f,u]of Object.entries(t)){let m=c?a[f]??f:f;m in i||(i[m]=this._write(15,u))}return i}if(Array.isArray(e)&&s.isListSchema()){let t=s.getValueSchema(),i=[],c=!!s.getMergedTraits().sparse;for(let a of e)(c||a!=null)&&i.push(this._write(t,a));return i}if(s.isMapSchema()){let t=s.getValueSchema(),i={},c=!!s.getMergedTraits().sparse;for(let[a,f]of Object.entries(e))(c||f!=null)&&(i[a]=this._write(t,f));return i}if(e instanceof Uint8Array&&(s.isBlobSchema()||s.isDocumentSchema()))return s===this.rootSchema?e:(this.serdeContext?.base64Encoder??x)(e);if(e instanceof Date&&(s.isTimestampSchema()||s.isDocumentSchema()))switch(l(s,this.settings)){case 5:return e.toISOString().replace(".000Z","Z");case 6:return O(e);case 7:return e.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",e),e.getTime()/1e3}e instanceof p&&(this.useReplacer=!0)}if(!(e===null&&n?.isStructSchema())){if(s.isStringSchema()){if(typeof e>"u"&&s.isIdempotencyToken())return E();let t=s.getMergedTraits().mediaType;return e!=null&&t&&(t==="application/json"||t.endsWith("+json"))?b.from(e):e}if(typeof e=="number"&&s.isNumericSchema())return Math.abs(e)===1/0||isNaN(e)?String(e):e;if(typeof e=="string"&&s.isBlobSchema())return s===this.rootSchema?e:(this.serdeContext?.base64Encoder??x)(e);if(typeof e=="bigint"&&(this.useReplacer=!0),s.isDocumentSchema())if(o){let t=Array.isArray(e)?[]:{};for(let[i,c]of Object.entries(e))c instanceof p?(this.useReplacer=!0,t[i]=c):t[i]=this._write(s,c);return t}else return structuredClone(e);return e}}};var z=class extends S{settings;constructor(r){super(),this.settings=r}createSerializer(){let r=new N(this.settings);return r.setSerdeContext(this.serdeContext),r}createDeserializer(){let r=new w(this.settings);return r.setSerdeContext(this.serdeContext),r}};export{W as a,z as b};
|