@visulima/pail 4.0.0-alpha.20 → 4.0.0-alpha.21
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/CHANGELOG.md +16 -0
- package/dist/error.js +2 -2
- package/dist/index.browser.js +19 -19
- package/dist/index.server.js +26 -26
- package/dist/middleware/elysia.d.ts +3 -3
- package/dist/middleware/elysia.js +1 -1
- package/dist/middleware/express.d.ts +3 -3
- package/dist/middleware/express.js +1 -1
- package/dist/middleware/fastify.d.ts +3 -3
- package/dist/middleware/fastify.js +1 -1
- package/dist/middleware/hono.d.ts +3 -3
- package/dist/middleware/hono.js +1 -1
- package/dist/middleware/next/handler.d.ts +3 -3
- package/dist/middleware/next/handler.js +1 -1
- package/dist/middleware/sveltekit.d.ts +3 -3
- package/dist/middleware/sveltekit.js +1 -1
- package/dist/object-tree.js +2 -2
- package/dist/packem_shared/AbstractJsonReporter-CF0KKdQS.js +1 -0
- package/dist/packem_shared/AbstractJsonReporter-CVwjgboT.js +1 -0
- package/dist/packem_shared/JsonReporter-BJFnahby.js +1 -0
- package/dist/packem_shared/JsonReporter-CnLM-d0U.js +2 -0
- package/dist/packem_shared/PrettyReporter-D75CJT0C.js +5 -0
- package/dist/packem_shared/PrettyReporter-D9aBMmxI.js +45 -0
- package/dist/packem_shared/{abstract-json-reporter.d-BAgznjyU.d.ts → abstract-json-reporter.d-Boj5w068.d.ts} +1 -1
- package/dist/packem_shared/abstract-pretty-reporter-zijeSUgy.js +34 -0
- package/dist/packem_shared/{create-middleware-logger.d-CR3o6VDh.d.ts → create-middleware-logger.d-MK7moe4r.d.ts} +2 -2
- package/dist/packem_shared/createPailError-CbU1Ogfa.js +5 -0
- package/dist/packem_shared/headers-D-K_EnkH.js +1 -0
- package/dist/packem_shared/index-COQEZODZ.js +1 -0
- package/dist/packem_shared/pailMiddleware-B5DJoBYl.js +1 -0
- package/dist/packem_shared/storage-DaXAlpiO.js +1 -0
- package/dist/packem_shared/{types.d-BeLumqgD.d.ts → types.d-Ck_RSjLg.d.ts} +1 -1
- package/dist/packem_shared/useLogger-DB34CuU5.js +1 -0
- package/dist/packem_shared/{wide-event.d-gb2-ks5w.d.ts → wide-event.d-DkYD7YVK.d.ts} +1 -1
- package/dist/packem_shared/write-console-log-based-on-level-DDSKGBKj.js +1 -0
- package/dist/packem_shared/write-stream-B6BXco86.js +1 -0
- package/dist/processor/caller/caller-processor.d.ts +1 -1
- package/dist/processor/caller/caller-processor.js +1 -1
- package/dist/processor/environment-processor.d.ts +1 -1
- package/dist/processor/environment-processor.js +1 -1
- package/dist/processor/message-formatter-processor.d.ts +1 -1
- package/dist/processor/message-formatter-processor.js +1 -1
- package/dist/processor/opentelemetry-processor.d.ts +1 -1
- package/dist/processor/opentelemetry-processor.js +1 -1
- package/dist/processor/redact-processor.d.ts +1 -1
- package/dist/processor/redact-processor.js +1 -1
- package/dist/processor/sampling-processor.d.ts +1 -1
- package/dist/processor/sampling-processor.js +1 -1
- package/dist/reporter/file/json-file-reporter.d.ts +2 -2
- package/dist/reporter/file/json-file-reporter.js +2 -2
- package/dist/reporter/http/abstract-http-reporter.d.ts +2 -2
- package/dist/reporter/http/abstract-http-reporter.js +2 -2
- package/dist/reporter/http/http-reporter.d.ts +2 -2
- package/dist/reporter/http/http-reporter.edge-light.js +2 -2
- package/dist/reporter/http/http-reporter.js +1 -1
- package/dist/reporter/json/index.browser.js +1 -1
- package/dist/reporter/json/index.d.ts +2 -2
- package/dist/reporter/json/index.js +1 -1
- package/dist/reporter/pretty/index.browser.js +1 -1
- package/dist/reporter/pretty/index.d.ts +36 -3
- package/dist/reporter/pretty/index.js +1 -1
- package/dist/reporter/simple/simple-reporter.server.js +7 -7
- package/dist/wide-event.d.ts +2 -2
- package/dist/wide-event.js +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/AbstractJsonReporter-D_Pb6kpB.js +0 -1
- package/dist/packem_shared/AbstractJsonReporter-PVC4ONf2.js +0 -1
- package/dist/packem_shared/JsonReporter-BEEmb0W4.js +0 -2
- package/dist/packem_shared/JsonReporter-CE-lw7R0.js +0 -1
- package/dist/packem_shared/PrettyReporter-CDv9n1Fy.js +0 -5
- package/dist/packem_shared/PrettyReporter-CuFxJm_o.js +0 -44
- package/dist/packem_shared/abstract-pretty-reporter-BpyhtAoN.js +0 -33
- package/dist/packem_shared/createPailError-53jAfQ-T.js +0 -5
- package/dist/packem_shared/headers-S8WyX-2m.js +0 -1
- package/dist/packem_shared/index-Dwp5v97D.js +0 -1
- package/dist/packem_shared/pailMiddleware-CWOJRmJq.js +0 -1
- package/dist/packem_shared/storage-DHM1EP2P.js +0 -1
- package/dist/packem_shared/useLogger-qyZrjy4D.js +0 -1
- package/dist/packem_shared/write-console-log-based-on-level-DfD64owL.js +0 -1
- package/dist/packem_shared/write-stream-Dd4_PTcm.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var A=Object.defineProperty;var m=(e,t)=>A(e,"name",{value:t,configurable:!0});var S=Object.defineProperty,D=m((e,t)=>S(e,"name",{value:t,configurable:!0}),"x"),C=Object.defineProperty,$=D((e,t)=>C(e,"name",{value:t,configurable:!0}),"h"),N=Object.defineProperty,g=$((e,t)=>N(e,"name",{value:t,configurable:!0}),"g$1");const p=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),M=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,P=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,j=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,F=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,k=g(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),w=/\s+/,h=g(e=>{p.has(e)&&(e=p.get(e));const t=M.exec(e);if(t)return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)];const r=P.exec(e);if(r)return[Number.parseInt(`${r[1]}${r[1]}`,16),Number.parseInt(`${r[2]}${r[2]}`,16),Number.parseInt(`${r[3]}${r[3]}`,16)];const i=j.exec(e);if(i)return[Math.round(Math.max(0,Math.min(255,Number(i[1])))),Math.round(Math.max(0,Math.min(255,Number(i[2])))),Math.round(Math.max(0,Math.min(255,Number(i[3]))))];const l=F.exec(e);if(l){let a=Number(l[1])%360;a<0&&(a+=360);const f=Math.max(0,Math.min(100,Number(l[2])))/100,n=Math.max(0,Math.min(100,Number(l[3])))/100,c=(1-Math.abs(2*n-1))*f,u=c*(1-Math.abs(a/60%2-1)),o=n-c/2;let d,s,b;return a<60?{0:d,1:s,2:b}=[c,u,0]:a<120?{0:d,1:s,2:b}=[u,c,0]:a<180?{0:d,1:s,2:b}=[0,c,u]:a<240?{0:d,1:s,2:b}=[0,u,c]:a<300?{0:d,1:s,2:b}=[u,0,c]:{0:d,1:s,2:b}=[c,0,u],[Math.round((d+o)*255),Math.round((s+o)*255),Math.round((b+o)*255)]}return null},"parseCssColor"),y=g((e,t)=>e?.[0]===t?.[0]&&e?.[1]===t?.[1]&&e?.[2]===t?.[2],"colorEquals"),L=g(e=>{if(typeof e!="string")return k();const t=k(),r=[];let i=!1,l=null,a=0,f="";for(const n of e){if(n==="(")a+=1;else if(a>0)n===")"&&(a-=1);else if(i){if(n===";"){const c=f.trim();c!==""&&r.push([l,c]),l=null,f="",i=!1;continue}}else if(n===":"){l=f.trim(),f="",i=!0;continue}f+=n}if(i&&a===0){const n=f.trim();n!==""&&r.push([l,n]),l=null,f=""}for(const{0:n,1:c}of r)switch(n){case"background-color":{c!=null&&(t.backgroundColor=c);break}case"color":{c!=null&&(t.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(t.fontStyle="italic");break}case"font-weight":{c==="bold"&&(t.fontWeight=c);break}case"text-decoration":{t.textDecorationColor=null,t.textDecorationLine=[];const u=c.split(w);for(const o of u){const d=h(o);d!=null?t.textDecorationColor=d:["line-through","overline","underline"].includes(o)&&t.textDecorationLine.push(o)}break}case"text-decoration-color":{const u=h(c);u!=null&&(t.textDecorationColor=u);break}case"text-decoration-line":{t.textDecorationLine=[];const u=c.split(w);for(const o of u)["line-through","overline","underline"].includes(o)&&t.textDecorationLine.push(o);break}}return t},"parseCss"),q=g((e,t)=>{t=t??k();let r="";if(!y(e.backgroundColor,t.backgroundColor))if(e.backgroundColor==null)r+="\x1B[49m";else switch(e.backgroundColor){case"black":{r+="\x1B[40m";break}case"blue":{r+="\x1B[44m";break}case"cyan":{r+="\x1B[46m";break}case"green":{r+="\x1B[42m";break}case"magenta":{r+="\x1B[45m";break}case"red":{r+="\x1B[41m";break}case"white":{r+="\x1B[47m";break}case"yellow":{r+="\x1B[43m";break}default:if(Array.isArray(e.backgroundColor)){const{0:i,1:l,2:a}=e.backgroundColor;r+=`\x1B[48;2;${String(i)};${String(l)};${String(a)}m`}else{const i=h(e.backgroundColor);if(i===null)r+="\x1B[49m";else{const{0:l,1:a,2:f}=i;r+=`\x1B[48;2;${String(l)};${String(a)};${String(f)}m`}}}if(!y(e.color,t.color))if(e.color==null)r+="\x1B[39m";else switch(e.color){case"black":{r+="\x1B[30m";break}case"blue":{r+="\x1B[34m";break}case"cyan":{r+="\x1B[36m";break}case"green":{r+="\x1B[32m";break}case"magenta":{r+="\x1B[35m";break}case"red":{r+="\x1B[31m";break}case"white":{r+="\x1B[37m";break}case"yellow":{r+="\x1B[33m";break}default:if(Array.isArray(e.color)){const{0:i,1:l,2:a}=e.color;r+=`\x1B[38;2;${String(i)};${String(l)};${String(a)}m`}else{const i=h(e.color);if(i===null)r+="\x1B[39m";else{const{0:l,1:a,2:f}=i;r+=`\x1B[38;2;${String(l)};${String(a)};${String(f)}m`}}}if(e.fontWeight!==t.fontWeight&&(r+=e.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),e.fontStyle!==t.fontStyle&&(r+=e.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!y(e.textDecorationColor,t.textDecorationColor))if(e.textDecorationColor==null)r+="\x1B[59m";else{const{0:i,1:l,2:a}=e.textDecorationColor;r+=`\x1B[58;2;${String(i)};${String(l)};${String(a)}m`}return e.textDecorationLine.includes("line-through")!==t.textDecorationLine.includes("line-through")&&(r+=e.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),e.textDecorationLine.includes("overline")!==t.textDecorationLine.includes("overline")&&(r+=e.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),e.textDecorationLine.includes("underline")!==t.textDecorationLine.includes("underline")&&(r+=e.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var O=Object.defineProperty,x=$((e,t)=>O(e,"name",{value:t,configurable:!0}),"u");const E=x(e=>{try{return JSON.stringify(e)}catch{return'"[Circular]"'}},"tryStringify"),v="%".codePointAt(0),I="s".codePointAt(0),W="d".codePointAt(0),T="f".codePointAt(0),_="i".codePointAt(0),J="O".codePointAt(0),z="o".codePointAt(0),G="j".codePointAt(0),H="c".codePointAt(0),K=x((e,t=[],r={})=>{if(typeof e!="string"&&typeof e!="object"||e===null)throw new TypeError(`fmt must be a string or object, got ${e===null?"null":typeof e}`);const i=r.stringify??E,l=1;if(typeof e=="object"){const o=t.length+l;if(o===1)return"{}";const d=Array.from({length:o});d[0]=i(e);for(let s=1;s<o;s+=1)d[s]=i(t[s-l]);return d.join(" ")}if(t.length===0)return e;let a="",f=1-l,n=-1,c=!1,u;for(let o=0;o<e.length;){if(e.codePointAt(o)===v&&o+1<e.length){n=n>-1?n:0;const d=e.codePointAt(o+1);if(d===void 0){f+=1;break}switch(d){case H:{if(globalThis.window===void 0){const s=L(t[f]);n<o&&(a+=e.slice(n,o));const b=q(s,u);a+=b,b!==""&&(c=!0,u=s)}n=o+2,o+=1;break}case W:case T:{if(f>=t.length||t[f]==null)break;n<o&&(a+=e.slice(n,o));const s=t[f];a+=(typeof s=="symbol"?Number.NaN:Number(s)).toString(),n=o+2,o+=1;break}case _:{if(f>=t.length||t[f]==null)break;n<o&&(a+=e.slice(n,o));const s=t[f];a+=Math.floor(typeof s=="symbol"?Number.NaN:Number(s)).toString(),n=o+2,o+=1;break}case G:case J:case z:{if(f>=t.length||t[f]===void 0)break;n<o&&(a+=e.slice(n,o));const s=t[f],b=typeof s;if(b==="string"){a+=`'${s}'`,n=o+2,o+=1;break}if(b==="function"){a+=s.name?`[Function: ${s.name}]`:"[Function: <anonymous>]",n=o+2,o+=1;break}a+=i(s),n=o+2,o+=1;break}case v:{n<o&&(a+=e.slice(n,o)),a+="%",n=o+2,o+=1,f-=1;break}case I:{if(f>=t.length)break;n<o&&(a+=e.slice(n,o)),a+=typeof t[f]=="object"?i(t[f]):String(t[f]),n=o+2,o+=1;break}default:typeof r.formatters?.[d]=="function"&&(n<o&&(a+=e.slice(n,o)),a+=r.formatters[d](t[f]),n=o+2,o+=1)}f+=1}o+=1}return n===-1?e:(n<e.length&&(a+=e.slice(n)),c&&(a+="\x1B[0m"),a)},"format"),Q=x((e={})=>{const t={};return typeof e.formatters=="object"&&Object.entries(e.formatters).forEach(([r,i])=>{if(r.length===0)throw new Error(`Formatter %${r} has no characters`);if(r.length>1)throw new Error(`Formatter %${r} has more than one character`);if(typeof i!="function")throw new TypeError(`Formatter for %${r} is not a function`);const l=r.codePointAt(0);if(l===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);t[l]=i}),(r,i=[],l={})=>K(r,i,{...l,formatters:t})},"build");var R=Object.defineProperty,B=m((e,t)=>R(e,"name",{value:t,configurable:!0}),"s");class V{static{m(this,"p")}static{B(this,"MessageFormatterProcessor")}#e;#r;#t;constructor(t={}){this.#r=t.formatters}setStringify(t){this.#e=t}process(t){this.#t===void 0&&(this.#t=Q({formatters:this.#r,stringify:B(i=>this.#e?this.#e(i):JSON.stringify(i),"stringify")}));const r=this.#t;return t.message!==void 0&&(t.message=this.#o(r,t.message,t.context??[])),t}#o(t,r,i=[]){if(typeof r=="string")return t(r,i);if(typeof r=="object"&&r!==null){const l=r,a=Object.keys(l);for(let f=0;f<a.length;f+=1){const n=a[f],c=l[n];(typeof c=="string"||Array.isArray(c)||typeof c=="object")&&(l[n]=this.#o(t,c,i))}}return r}}export{V as default};
|
|
1
|
+
var $=Object.defineProperty,B=(e,t)=>$(e,"name",{value:t,configurable:!0}),v=Object.defineProperty,g=B((e,t)=>v(e,"name",{value:t,configurable:!0}),"g$1");const x=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),A=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,S=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,D=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,C=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,y=g(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),p=/\s+/,m=g(e=>{x.has(e)&&(e=x.get(e));const t=A.exec(e);if(t)return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)];const r=S.exec(e);if(r)return[Number.parseInt(`${r[1]}${r[1]}`,16),Number.parseInt(`${r[2]}${r[2]}`,16),Number.parseInt(`${r[3]}${r[3]}`,16)];const i=D.exec(e);if(i)return[Math.round(Math.max(0,Math.min(255,Number(i[1])))),Math.round(Math.max(0,Math.min(255,Number(i[2])))),Math.round(Math.max(0,Math.min(255,Number(i[3]))))];const l=C.exec(e);if(l){let a=Number(l[1])%360;a<0&&(a+=360);const f=Math.max(0,Math.min(100,Number(l[2])))/100,n=Math.max(0,Math.min(100,Number(l[3])))/100,c=(1-Math.abs(2*n-1))*f,u=c*(1-Math.abs(a/60%2-1)),o=n-c/2;let d,s,b;return a<60?{0:d,1:s,2:b}=[c,u,0]:a<120?{0:d,1:s,2:b}=[u,c,0]:a<180?{0:d,1:s,2:b}=[0,c,u]:a<240?{0:d,1:s,2:b}=[0,u,c]:a<300?{0:d,1:s,2:b}=[u,0,c]:{0:d,1:s,2:b}=[c,0,u],[Math.round((d+o)*255),Math.round((s+o)*255),Math.round((b+o)*255)]}return null},"parseCssColor"),h=g((e,t)=>e?.[0]===t?.[0]&&e?.[1]===t?.[1]&&e?.[2]===t?.[2],"colorEquals"),N=g(e=>{if(typeof e!="string")return y();const t=y(),r=[];let i=!1,l=null,a=0,f="";for(const n of e){if(n==="(")a+=1;else if(a>0)n===")"&&(a-=1);else if(i){if(n===";"){const c=f.trim();c!==""&&r.push([l,c]),l=null,f="",i=!1;continue}}else if(n===":"){l=f.trim(),f="",i=!0;continue}f+=n}if(i&&a===0){const n=f.trim();n!==""&&r.push([l,n]),l=null,f=""}for(const{0:n,1:c}of r)switch(n){case"background-color":{c!=null&&(t.backgroundColor=c);break}case"color":{c!=null&&(t.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(t.fontStyle="italic");break}case"font-weight":{c==="bold"&&(t.fontWeight=c);break}case"text-decoration":{t.textDecorationColor=null,t.textDecorationLine=[];const u=c.split(p);for(const o of u){const d=m(o);d!=null?t.textDecorationColor=d:["line-through","overline","underline"].includes(o)&&t.textDecorationLine.push(o)}break}case"text-decoration-color":{const u=m(c);u!=null&&(t.textDecorationColor=u);break}case"text-decoration-line":{t.textDecorationLine=[];const u=c.split(p);for(const o of u)["line-through","overline","underline"].includes(o)&&t.textDecorationLine.push(o);break}}return t},"parseCss"),M=g((e,t)=>{t=t??y();let r="";if(!h(e.backgroundColor,t.backgroundColor))if(e.backgroundColor==null)r+="\x1B[49m";else switch(e.backgroundColor){case"black":{r+="\x1B[40m";break}case"blue":{r+="\x1B[44m";break}case"cyan":{r+="\x1B[46m";break}case"green":{r+="\x1B[42m";break}case"magenta":{r+="\x1B[45m";break}case"red":{r+="\x1B[41m";break}case"white":{r+="\x1B[47m";break}case"yellow":{r+="\x1B[43m";break}default:if(Array.isArray(e.backgroundColor)){const{0:i,1:l,2:a}=e.backgroundColor;r+=`\x1B[48;2;${String(i)};${String(l)};${String(a)}m`}else{const i=m(e.backgroundColor);if(i===null)r+="\x1B[49m";else{const{0:l,1:a,2:f}=i;r+=`\x1B[48;2;${String(l)};${String(a)};${String(f)}m`}}}if(!h(e.color,t.color))if(e.color==null)r+="\x1B[39m";else switch(e.color){case"black":{r+="\x1B[30m";break}case"blue":{r+="\x1B[34m";break}case"cyan":{r+="\x1B[36m";break}case"green":{r+="\x1B[32m";break}case"magenta":{r+="\x1B[35m";break}case"red":{r+="\x1B[31m";break}case"white":{r+="\x1B[37m";break}case"yellow":{r+="\x1B[33m";break}default:if(Array.isArray(e.color)){const{0:i,1:l,2:a}=e.color;r+=`\x1B[38;2;${String(i)};${String(l)};${String(a)}m`}else{const i=m(e.color);if(i===null)r+="\x1B[39m";else{const{0:l,1:a,2:f}=i;r+=`\x1B[38;2;${String(l)};${String(a)};${String(f)}m`}}}if(e.fontWeight!==t.fontWeight&&(r+=e.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),e.fontStyle!==t.fontStyle&&(r+=e.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!h(e.textDecorationColor,t.textDecorationColor))if(e.textDecorationColor==null)r+="\x1B[59m";else{const{0:i,1:l,2:a}=e.textDecorationColor;r+=`\x1B[58;2;${String(i)};${String(l)};${String(a)}m`}return e.textDecorationLine.includes("line-through")!==t.textDecorationLine.includes("line-through")&&(r+=e.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),e.textDecorationLine.includes("overline")!==t.textDecorationLine.includes("overline")&&(r+=e.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),e.textDecorationLine.includes("underline")!==t.textDecorationLine.includes("underline")&&(r+=e.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var P=Object.defineProperty,k=B((e,t)=>P(e,"name",{value:t,configurable:!0}),"u");const j=k(e=>{try{return JSON.stringify(e)}catch{return'"[Circular]"'}},"tryStringify"),w="%".codePointAt(0),L="s".codePointAt(0),F="d".codePointAt(0),q="f".codePointAt(0),O="i".codePointAt(0),E="O".codePointAt(0),I="o".codePointAt(0),W="j".codePointAt(0),T="c".codePointAt(0),_=k((e,t=[],r={})=>{if(typeof e!="string"&&typeof e!="object"||e===null)throw new TypeError(`fmt must be a string or object, got ${e===null?"null":typeof e}`);const i=r.stringify??j,l=1;if(typeof e=="object"){const o=t.length+l;if(o===1)return"{}";const d=Array.from({length:o});d[0]=i(e);for(let s=1;s<o;s+=1)d[s]=i(t[s-l]);return d.join(" ")}if(t.length===0)return e;let a="",f=1-l,n=-1,c=!1,u;for(let o=0;o<e.length;){if(e.codePointAt(o)===w&&o+1<e.length){n=n>-1?n:0;const d=e.codePointAt(o+1);if(d===void 0){f+=1;break}switch(d){case T:{if(globalThis.window===void 0){const s=N(t[f]);n<o&&(a+=e.slice(n,o));const b=M(s,u);a+=b,b!==""&&(c=!0,u=s)}n=o+2,o+=1;break}case F:case q:{if(f>=t.length||t[f]==null)break;n<o&&(a+=e.slice(n,o));const s=t[f];a+=(typeof s=="symbol"?Number.NaN:Number(s)).toString(),n=o+2,o+=1;break}case O:{if(f>=t.length||t[f]==null)break;n<o&&(a+=e.slice(n,o));const s=t[f];a+=Math.floor(typeof s=="symbol"?Number.NaN:Number(s)).toString(),n=o+2,o+=1;break}case W:case E:case I:{if(f>=t.length||t[f]===void 0)break;n<o&&(a+=e.slice(n,o));const s=t[f],b=typeof s;if(b==="string"){a+=`'${s}'`,n=o+2,o+=1;break}if(b==="function"){a+=s.name?`[Function: ${s.name}]`:"[Function: <anonymous>]",n=o+2,o+=1;break}a+=i(s),n=o+2,o+=1;break}case w:{n<o&&(a+=e.slice(n,o)),a+="%",n=o+2,o+=1,f-=1;break}case L:{if(f>=t.length)break;n<o&&(a+=e.slice(n,o)),a+=typeof t[f]=="object"?i(t[f]):String(t[f]),n=o+2,o+=1;break}default:typeof r.formatters?.[d]=="function"&&(n<o&&(a+=e.slice(n,o)),a+=r.formatters[d](t[f]),n=o+2,o+=1)}f+=1}o+=1}return n===-1?e:(n<e.length&&(a+=e.slice(n)),c&&(a+="\x1B[0m"),a)},"format"),J=k((e={})=>{const t={};return typeof e.formatters=="object"&&Object.entries(e.formatters).forEach(([r,i])=>{if(r.length===0)throw new Error(`Formatter %${r} has no characters`);if(r.length>1)throw new Error(`Formatter %${r} has more than one character`);if(typeof i!="function")throw new TypeError(`Formatter for %${r} is not a function`);const l=r.codePointAt(0);if(l===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);t[l]=i}),(r,i=[],l={})=>_(r,i,{...l,formatters:t})},"build");class z{#e;#r;#t;constructor(t={}){this.#r=t.formatters}setStringify(t){this.#e=t}process(t){this.#t===void 0&&(this.#t=J({formatters:this.#r,stringify:i=>this.#e?this.#e(i):JSON.stringify(i)}));const r=this.#t;return t.message!==void 0&&(t.message=this.#o(r,t.message,t.context??[])),t}#o(t,r,i=[]){if(typeof r=="string")return t(r,i);if(typeof r=="object"&&r!==null){const l=r,a=Object.keys(l);for(let f=0;f<a.length;f+=1){const n=a[f],c=l[n];(typeof c=="string"||Array.isArray(c)||typeof c=="object")&&(l[n]=this.#o(t,c,i))}}return r}}export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{trace as i,context as c,isSpanContextValid as n}from"@opentelemetry/api";class l{#s;#e;#r;#t;constructor(t={}){this.#s=t.traceIdFieldName??"trace_id",this.#e=t.spanIdFieldName??"span_id",this.#r=t.traceFlagsFieldName??"trace_flags",this.#t=t.traceFieldName}process(t){const e=i.getSpan(c.active());if(!e)return t;const s=e.spanContext();if(!n(s))return t;const r={[this.#e]:s.spanId,[this.#r]:`0${s.traceFlags.toString(16)}`,[this.#s]:s.traceId},a=this.#t?{[this.#t]:r}:r;return t.context=[...t.context??[],a],t}}export{l as OpenTelemetryProcessor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{redact as e,standardRules as a}from"@visulima/redact";class n{#t;constructor(t,s){const r=t??a;this.#t=o=>e(o,r,s)}process(t){return t.message=this.#t(t.message),t.context=this.#t(t.context),t.error=this.#t(t.error),t}}export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
class e{#r;#t;constructor(t={}){this.#r=t.head??{},this.#t=t.tail??[]}process(t){const r=t.type.level;return this.#s(r)&&!this.#e(t)?{...t,dropped:!0}:t}#s(t){const r=this.#r[t];return r===void 0?!1:r<=0?!0:r>=100?!1:Math.random()*100>=r}#e(t){for(let r=0;r<this.#t.length;r+=1)if(this.#t[r](t))return!0;return!1}}export{e as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from 'rotating-file-stream';
|
|
2
|
-
import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-
|
|
2
|
+
import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Boj5w068.js";
|
|
3
3
|
import 'safe-stable-stringify';
|
|
4
|
-
import "../../packem_shared/types.d-
|
|
4
|
+
import "../../packem_shared/types.d-Ck_RSjLg.js";
|
|
5
5
|
import '@visulima/colorize';
|
|
6
6
|
import '@visulima/interactive-manager';
|
|
7
7
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
`)}}export{
|
|
1
|
+
import{AbstractJsonReporter as a}from"../../packem_shared/AbstractJsonReporter-CF0KKdQS.js";class r{#t=!0;#s;#e;constructor(t,e){this.#s=t,this.#e=e,this.#s.on("error",s=>{throw s}),this.#s.on("drain",()=>{this.#t=!0}),this.#s.on("finish",()=>{this.#t=!0})}write(t){this.writeStream(t)}end(...t){this.#s.end(...t)}get isReady(){return this.#t}writeStream(t){if(!this.#t){console.warn(`Stream busy: ${this.#e}. Write will be dropped: "${t}"`);return}this.#t=!1,this.#t=this.#s.write(t,()=>{})}}class n{#t;#s;#e;#r;#i;#h;constructor(t,e=!1,s={}){this.#t=t,this.#s=e,this.#r=s;try{this.#i=require("rotating-file-stream").createStream}catch{throw new Error("The 'rotating-file-stream' package is missing. Make sure to install the 'rotating-file-stream' package.")}this.#s||(this.#e=this.#i(this.#t,s),this.#h=new r(this.#e,this.#t))}write(t){if(this.#s){const e=this.#i(this.#t,this.#r),s=new r(e,this.#t);s.write(t),s.end();return}this.#h.write(t)}end(){this.#e!==void 0&&this.#e.end()}}class c extends a{stream;constructor(t){super();const{filePath:e,writeImmediately:s=!1,...h}=t;this.stream=new n(e,s,{compress:"gzip",interval:"1d",size:"10M",...h})}_log(t){this.stream.write(`${t}
|
|
2
|
+
`)}}export{c as JsonFileReporter};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExtendedRfc5424LogLevels, L as LiteralUnion,
|
|
2
|
-
import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-
|
|
1
|
+
import { E as ExtendedRfc5424LogLevels, L as LiteralUnion, a as StringifyAwareReporter } from "../../packem_shared/types.d-Ck_RSjLg.js";
|
|
2
|
+
import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Boj5w068.js";
|
|
3
3
|
import '@visulima/colorize';
|
|
4
4
|
import '@visulima/interactive-manager';
|
|
5
5
|
import 'safe-stable-stringify';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
`,this.batchMode=
|
|
1
|
+
import{createRequire as S}from"node:module";import{AbstractJsonReporter as w}from"../../packem_shared/AbstractJsonReporter-CF0KKdQS.js";const T=S(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=i=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[t,e]=m.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return m.getBuiltinModule(i)}return T(i)},{Buffer:p}=f("node:buffer"),{gzipSync:x}=f("node:zlib"),z=async i=>{const t=globalThis.CompressionStream;if(t){const e=new t("gzip"),s=e.writable.getWriter(),a=e.readable.getReader(),o=new TextEncoder,h=[];await s.write(o.encode(i)),await s.close();let u=!1;for(;!u;){const n=await a.read();u=n.done,n.value&&h.push(n.value)}const c=h.reduce((n,l)=>n+l.length,0),r=new Uint8Array(c);let d=0;for(let n=0;n<h.length;n+=1){const l=h[n];r.set(l,d),d+=l.length}return r}return x(i)};class E extends Error{logData;actualSize;maxSize;constructor(t,e,s,a){super(t),this.name="LogSizeError",this.logData=e,this.actualSize=s,this.maxSize=a}}const b=(i,t)=>i*2**t,y=i=>new Promise(t=>{setTimeout(t,i)}),B=i=>typeof i=="string"?i:new Uint8Array(i.buffer,i.byteOffset,i.byteLength),D=async(i,t,e,s,a,o,h)=>{const u={};i.headers.forEach((d,n)=>{u[n]=d});const c=await i.text(),r={req:{body:a,headers:s,method:e,url:t},res:{body:c,headers:u,status:i.status,statusText:i.statusText}};if(o&&o(r),i.ok)return!1;if(i.status<500&&i.status!==429){const d=new Error(`HTTP ${String(i.status)}: ${i.statusText}`);throw h&&h(d),d}return!0},R=(i,t,e,s,a)=>{if(i.status===429&&t&&s<a){const o=i.headers.get("retry-after");return o?Number.parseInt(o,10)*1e3:b(e,s)}},L=(i,t,e,s)=>{if(i.status>=500&&e<s)return b(t,e)},P=(i,t,e,s,a)=>{const o=R(i,t,e,s,a);return o!==void 0?o:L(i,e,s,a)},N=async(i,t,e,s,a)=>{if(t<e){const o=b(s,t);return await y(o),!0}return a&&a(i),!1},_=async(i,t,e,s,a,o,h,u,c)=>{let r=0;for(;r<=a;)try{const d=B(s),n=await fetch(i,{body:d,headers:e,method:t});if(!await D(n,i,t,e,s,u,c))return;const l=P(n,h,o,r,a);if(l!==void 0){await y(l),r+=1;continue}if(!n.ok){const g=new Error(`HTTP ${String(n.status)}: ${n.statusText}`);throw c&&c(g),g}return}catch(d){if(await N(d,r,a,o,c)){r+=1;continue}throw d}};class Q extends w{url;method;headers;contentType;batchContentType;onError;onDebug;onDebugRequestResponse;payloadTemplate;compression;maxRetries;retryDelay;respectRateLimit;enableBatchSend;batchSize;batchSendTimeout;batchSendDelimiter;batchMode;batchFieldName;maxLogSize;maxPayloadSize;edgeCompat;batchQueue=[];batchTimeout;isProcessingBatch=!1;currentBatchSize=0;constructor(t){if(super(t),this.url=t.url,this.method=t.method??"POST",this.headers=t.headers??{},this.contentType=t.contentType??"application/json",this.batchContentType=t.batchContentType??"application/json",this.onError=t.onError,this.onDebug=t.onDebug,this.onDebugRequestResponse=t.onDebugRequestResponse,this.payloadTemplate=t.payloadTemplate??(e=>JSON.stringify(e)),this.compression=t.compression??!1,this.maxRetries=t.maxRetries??3,this.retryDelay=t.retryDelay??1e3,this.respectRateLimit=t.respectRateLimit??!0,this.enableBatchSend=t.enableBatchSend??!0,this.batchSize=t.batchSize??100,this.batchSendTimeout=t.batchSendTimeout??5e3,this.batchSendDelimiter=t.batchSendDelimiter??`
|
|
2
|
+
`,this.batchMode=t.batchMode??"delimiter",this.batchFieldName=t.batchFieldName,this.batchMode==="field"&&!this.batchFieldName)throw new Error("batchFieldName is required when batchMode is 'field'");this.maxLogSize=t.maxLogSize??1048576,this.maxPayloadSize=t.maxPayloadSize??5242880,this.edgeCompat=t.edgeCompat??!1}_log(t,e){try{const s=JSON.parse(t),a=e,o=s.message,h={logLevel:a,message:o??""};if(s.data)h.data=s.data;else if(s.context)h.data=s.context;else{const r={...s};delete r.message,Object.keys(r).length>0&&(h.data=r)}const u=this.payloadTemplate(h);this.onDebug&&this.onDebug({data:h.data,logLevel:a,message:o});const c=this.edgeCompat||typeof TextEncoder>"u"?p.byteLength(u,"utf8"):new TextEncoder().encode(u).length;if(c>this.maxLogSize){const r=new E(`Log entry exceeds maximum size of ${String(this.maxLogSize)} bytes. Size: ${String(c)} bytes`,{data:h.data,logLevel:a,message:o},c,this.maxLogSize);this.onError&&this.onError(r);return}this.enableBatchSend?this.addToBatch(u,c):this.sendPayload(u).catch(r=>{this.onError&&this.onError(r)})}catch(s){this.onError&&this.onError(s)}}addToBatch(t,e){const s=this.currentBatchSize+e+this.batchSendDelimiter.length,a=this.maxPayloadSize*.9;s>a&&this.batchQueue.length>0&&this.processBatch(),this.batchQueue.push(t),this.currentBatchSize+=e+this.batchSendDelimiter.length,this.batchTimeout??=setTimeout(()=>{this.processBatch()},this.batchSendTimeout),this.batchQueue.length>=this.batchSize&&this.processBatch()}async processBatch(){if(this.isProcessingBatch||this.batchQueue.length===0)return;this.isProcessingBatch=!0,this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=void 0);const t=this.batchQueue.splice(0,this.batchSize);this.currentBatchSize=0;for(let e=0;e<this.batchQueue.length;e+=1){const s=this.batchQueue[e],a=this.edgeCompat||typeof TextEncoder>"u"?p.byteLength(s,"utf8"):new TextEncoder().encode(s).length;this.currentBatchSize+=a+(e<this.batchQueue.length-1?this.batchSendDelimiter.length:0)}try{await this.sendBatch(t)}catch(e){this.onError&&this.onError(e)}finally{this.isProcessingBatch=!1,this.batchQueue.length>0&&this.processBatch()}}async sendBatch(t){let e;switch(this.batchMode){case"array":{const s=t.map(a=>JSON.parse(a));e=JSON.stringify(s);break}case"field":{const s=t.map(o=>JSON.parse(o)),a=this.batchFieldName?{[this.batchFieldName]:s}:{};e=JSON.stringify(a);break}default:{e=t.join(this.batchSendDelimiter);break}}await this.sendPayload(e,this.batchContentType)}async sendPayload(t,e){const s=typeof this.headers=="function"?this.headers():{...this.headers};s["content-type"]??=e??this.contentType;let a=t;if(this.compression&&!this.edgeCompat)try{a=await z(t),s["content-encoding"]="gzip"}catch(o){this.onError&&this.onError(new Error(`Compression failed: ${String(o)}`))}await _(this.url,this.method,s,a,this.maxRetries,this.retryDelay,this.respectRateLimit,this.onDebugRequestResponse,this.onError)}}export{Q as AbstractHttpReporter};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AbstractHttpReporterOptions, AbstractHttpReporter } from "./abstract-http-reporter.js";
|
|
2
|
-
import "../../packem_shared/types.d-
|
|
2
|
+
import "../../packem_shared/types.d-Ck_RSjLg.js";
|
|
3
3
|
import '@visulima/colorize';
|
|
4
4
|
import '@visulima/interactive-manager';
|
|
5
|
-
import "../../packem_shared/abstract-json-reporter.d-
|
|
5
|
+
import "../../packem_shared/abstract-json-reporter.d-Boj5w068.js";
|
|
6
6
|
import 'safe-stable-stringify';
|
|
7
7
|
/**
|
|
8
8
|
* HTTP Reporter.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
`,this.batchMode=
|
|
1
|
+
import{createRequire as P}from"node:module";const E=P(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[t,a]=d.versions.node.split(".").map(Number);if(t>22||t===22&&a>=3||t===20&&a>=16)return d.getBuiltinModule(e)}return E(e)},{Buffer:O}=v("node:buffer"),{gzipSync:z}=v("node:zlib");var N=Object.defineProperty,D=(e,t)=>N(e,"name",{value:t,configurable:!0});const B=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}});var R=Object.defineProperty,f=D((e,t)=>R(e,"name",{value:t,configurable:!0}),"i");const L=f(e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null},"isPlainObject"),p=new WeakSet,x=f(e=>{const t=Object.getOwnPropertyNames(e);for(const a of t){const r=Object.getOwnPropertyDescriptor(e,a);r&&(r.enumerable||Object.defineProperty(e,a,{...r,enumerable:!0}),r.value&&typeof r.value=="object"&&!Array.isArray(r.value)&&(Object.getPrototypeOf(r.value)===Object.prototype||Object.getPrototypeOf(r.value)===null)&&x(r.value))}},"makePropertiesEnumerable"),$=f(e=>{p.add(e);const t=e.toJSON();return p.delete(e),Object.isExtensible(t)&&x(t),t},"toJSON"),g=f((e,t,a,r,s=new Set)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return t.has(e)?"[Circular]":(a+=1,m(e,r,t,a));if(r.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(L(e)){if(s.has(e))return"[Circular]";if(r.maxDepth!==void 0&&r.maxDepth!==Number.POSITIVE_INFINITY&&a+1>=r.maxDepth)return{};a+=1,s.add(e);const o={};for(const i in e)o[i]=g(e[i],t,a,r,s);return s.delete(e),o}try{return e}catch{return"[Not Available]"}},"serializeValue"),m=f((e,t,a,r)=>{if(a.add(e),t.maxDepth===0)return{};if(t.useToJSON&&typeof e.toJSON=="function"&&!p.has(e))return $(e);const s=Object.create(B);if(Object.defineProperty(s,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(s,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(s,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const i=[];for(const n of e.errors){if(!(n instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(a.has(n))return Object.defineProperty(s,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),s;i.push(m(n,t,a,r))}Object.defineProperty(s,"errors",{configurable:!0,enumerable:!0,value:i,writable:!0})}const o=e.cause;if(o!=null)if(o instanceof Error)a.has(o)?Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:m(o,t,a,r),writable:!0});else{const i=g(o,a,r,t);Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:i,writable:!0})}for(const i in e){if(i==="name"||i==="message"||i==="stack"||i==="cause"||i==="errors")continue;const n=e[i],u=g(n,a,r,t);Object.defineProperty(s,i,{configurable:!0,enumerable:!0,value:u,writable:!0})}if(Array.isArray(t.exclude)&&t.exclude.length>0)for(const i of t.exclude)try{delete s[i]}catch{}return s},"_serialize"),w=f((e,t={})=>m(e,{exclude:t.exclude??[],maxDepth:t.maxDepth??Number.POSITIVE_INFINITY,useToJSON:t.useToJSON??!1},new Set,0),"serialize"),T=Symbol("EMPTY");class _{stringify;errorOptions;constructor(t={}){this.errorOptions=t.error??{}}setStringify(t){this.stringify=t}log(t){const{context:a,error:r,file:s,message:o,type:i,...n}=t;if(n.label&&(n.label=n.label.trim()),s&&(n.file=`${s.name??""}:${String(s.line)}${s.column?`:${String(s.column)}`:""}`),n.message=o===T?void 0:o,r&&(n.error=w(r,this.errorOptions)),a){const u=[];for(let c=0;c<a.length;c+=1){const l=a[c];l!==T&&(l instanceof Error?u.push(w(l,this.errorOptions)):u.push(l))}n.context=u}this._log(this.stringify(n),i.level)}}const J=async e=>{const t=globalThis.CompressionStream;if(t){const a=new t("gzip"),r=a.writable.getWriter(),s=a.readable.getReader(),o=new TextEncoder,i=[];await r.write(o.encode(e)),await r.close();let n=!1;for(;!n;){const h=await s.read();n=h.done,h.value&&i.push(h.value)}const u=i.reduce((h,b)=>h+b.length,0),c=new Uint8Array(u);let l=0;for(let h=0;h<i.length;h+=1){const b=i[h];c.set(b,l),l+=b.length}return c}return z(e)};class C extends Error{logData;actualSize;maxSize;constructor(t,a,r,s){super(t),this.name="LogSizeError",this.logData=a,this.actualSize=r,this.maxSize=s}}const y=(e,t)=>e*2**t,j=e=>new Promise(t=>{setTimeout(t,e)}),k=e=>typeof e=="string"?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),A=async(e,t,a,r,s,o,i)=>{const n={};e.headers.forEach((l,h)=>{n[h]=l});const u=await e.text(),c={req:{body:s,headers:r,method:a,url:t},res:{body:u,headers:n,status:e.status,statusText:e.statusText}};if(o&&o(c),e.ok)return!1;if(e.status<500&&e.status!==429){const l=new Error(`HTTP ${String(e.status)}: ${e.statusText}`);throw i&&i(l),l}return!0},I=(e,t,a,r,s)=>{if(e.status===429&&t&&r<s){const o=e.headers.get("retry-after");return o?Number.parseInt(o,10)*1e3:y(a,r)}},F=(e,t,a,r)=>{if(e.status>=500&&a<r)return y(t,a)},M=(e,t,a,r,s)=>{const o=I(e,t,a,r,s);return o!==void 0?o:F(e,a,r,s)},Q=async(e,t,a,r,s)=>{if(t<a){const o=y(r,t);return await j(o),!0}return s&&s(e),!1},q=async(e,t,a,r,s,o,i,n,u)=>{let c=0;for(;c<=s;)try{const l=k(r),h=await fetch(e,{body:l,headers:a,method:t});if(!await A(h,e,t,a,r,n,u))return;const b=M(h,i,o,c,s);if(b!==void 0){await j(b),c+=1;continue}if(!h.ok){const S=new Error(`HTTP ${String(h.status)}: ${h.statusText}`);throw u&&u(S),S}return}catch(l){if(await Q(l,c,s,o,u)){c+=1;continue}throw l}};class Y extends _{url;method;headers;contentType;batchContentType;onError;onDebug;onDebugRequestResponse;payloadTemplate;compression;maxRetries;retryDelay;respectRateLimit;enableBatchSend;batchSize;batchSendTimeout;batchSendDelimiter;batchMode;batchFieldName;maxLogSize;maxPayloadSize;edgeCompat;batchQueue=[];batchTimeout;isProcessingBatch=!1;currentBatchSize=0;constructor(t){if(super(t),this.url=t.url,this.method=t.method??"POST",this.headers=t.headers??{},this.contentType=t.contentType??"application/json",this.batchContentType=t.batchContentType??"application/json",this.onError=t.onError,this.onDebug=t.onDebug,this.onDebugRequestResponse=t.onDebugRequestResponse,this.payloadTemplate=t.payloadTemplate??(a=>JSON.stringify(a)),this.compression=t.compression??!1,this.maxRetries=t.maxRetries??3,this.retryDelay=t.retryDelay??1e3,this.respectRateLimit=t.respectRateLimit??!0,this.enableBatchSend=t.enableBatchSend??!0,this.batchSize=t.batchSize??100,this.batchSendTimeout=t.batchSendTimeout??5e3,this.batchSendDelimiter=t.batchSendDelimiter??`
|
|
2
|
+
`,this.batchMode=t.batchMode??"delimiter",this.batchFieldName=t.batchFieldName,this.batchMode==="field"&&!this.batchFieldName)throw new Error("batchFieldName is required when batchMode is 'field'");this.maxLogSize=t.maxLogSize??1048576,this.maxPayloadSize=t.maxPayloadSize??5242880,this.edgeCompat=t.edgeCompat??!1}_log(t,a){try{const r=JSON.parse(t),s=a,o=r.message,i={logLevel:s,message:o??""};if(r.data)i.data=r.data;else if(r.context)i.data=r.context;else{const c={...r};delete c.message,Object.keys(c).length>0&&(i.data=c)}const n=this.payloadTemplate(i);this.onDebug&&this.onDebug({data:i.data,logLevel:s,message:o});const u=this.edgeCompat||typeof TextEncoder>"u"?O.byteLength(n,"utf8"):new TextEncoder().encode(n).length;if(u>this.maxLogSize){const c=new C(`Log entry exceeds maximum size of ${String(this.maxLogSize)} bytes. Size: ${String(u)} bytes`,{data:i.data,logLevel:s,message:o},u,this.maxLogSize);this.onError&&this.onError(c);return}this.enableBatchSend?this.addToBatch(n,u):this.sendPayload(n).catch(c=>{this.onError&&this.onError(c)})}catch(r){this.onError&&this.onError(r)}}addToBatch(t,a){const r=this.currentBatchSize+a+this.batchSendDelimiter.length,s=this.maxPayloadSize*.9;r>s&&this.batchQueue.length>0&&this.processBatch(),this.batchQueue.push(t),this.currentBatchSize+=a+this.batchSendDelimiter.length,this.batchTimeout??=setTimeout(()=>{this.processBatch()},this.batchSendTimeout),this.batchQueue.length>=this.batchSize&&this.processBatch()}async processBatch(){if(this.isProcessingBatch||this.batchQueue.length===0)return;this.isProcessingBatch=!0,this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=void 0);const t=this.batchQueue.splice(0,this.batchSize);this.currentBatchSize=0;for(let a=0;a<this.batchQueue.length;a+=1){const r=this.batchQueue[a],s=this.edgeCompat||typeof TextEncoder>"u"?O.byteLength(r,"utf8"):new TextEncoder().encode(r).length;this.currentBatchSize+=s+(a<this.batchQueue.length-1?this.batchSendDelimiter.length:0)}try{await this.sendBatch(t)}catch(a){this.onError&&this.onError(a)}finally{this.isProcessingBatch=!1,this.batchQueue.length>0&&this.processBatch()}}async sendBatch(t){let a;switch(this.batchMode){case"array":{const r=t.map(s=>JSON.parse(s));a=JSON.stringify(r);break}case"field":{const r=t.map(o=>JSON.parse(o)),s=this.batchFieldName?{[this.batchFieldName]:r}:{};a=JSON.stringify(s);break}default:{a=t.join(this.batchSendDelimiter);break}}await this.sendPayload(a,this.batchContentType)}async sendPayload(t,a){const r=typeof this.headers=="function"?this.headers():{...this.headers};r["content-type"]??=a??this.contentType;let s=t;if(this.compression&&!this.edgeCompat)try{s=await J(t),r["content-encoding"]="gzip"}catch(o){this.onError&&this.onError(new Error(`Compression failed: ${String(o)}`))}await q(this.url,this.method,r,s,this.maxRetries,this.retryDelay,this.respectRateLimit,this.onDebugRequestResponse,this.onError)}}class U extends Y{constructor(t){super({...t,edgeCompat:!0})}}export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{AbstractHttpReporter as r}from"./abstract-http-reporter.js";class o extends r{constructor(t){super(t)}}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbstractJsonReporter as e}from"../../packem_shared/AbstractJsonReporter-
|
|
1
|
+
import{AbstractJsonReporter as e}from"../../packem_shared/AbstractJsonReporter-CVwjgboT.js";import{default as p}from"../../packem_shared/JsonReporter-BJFnahby.js";export{e as AbstractJsonReporter,p as JsonReporter};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-
|
|
2
|
-
import { E as ExtendedRfc5424LogLevels, L as LiteralUnion,
|
|
1
|
+
import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Boj5w068.js";
|
|
2
|
+
import { E as ExtendedRfc5424LogLevels, L as LiteralUnion, S as StreamAwareReporter } from "../../packem_shared/types.d-Ck_RSjLg.js";
|
|
3
3
|
import 'safe-stable-stringify';
|
|
4
4
|
import '@visulima/colorize';
|
|
5
5
|
import '@visulima/interactive-manager';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbstractJsonReporter as e}from"../../packem_shared/AbstractJsonReporter-
|
|
1
|
+
import{AbstractJsonReporter as e}from"../../packem_shared/AbstractJsonReporter-CF0KKdQS.js";import{default as p}from"../../packem_shared/JsonReporter-CnLM-d0U.js";export{e as AbstractJsonReporter,p as JsonReporter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../../packem_shared/PrettyReporter-
|
|
1
|
+
import{default as t}from"../../packem_shared/PrettyReporter-D75CJT0C.js";export{t as PrettyReporter};
|
|
@@ -1,7 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { L as LiteralUnion, D as DefaultLogTypes, c as LoggerTypesConfig, R as ReadonlyMeta, f as LoggerTypesAwareReporter, E as ExtendedRfc5424LogLevels, I as InteractiveStreamReporter } from "../../packem_shared/types.d-BeLumqgD.js";
|
|
1
|
+
import { L as LiteralUnion, D as DefaultLogTypes, c as LoggerTypesConfig, R as ReadonlyMeta, f as LoggerTypesAwareReporter, E as ExtendedRfc5424LogLevels, I as InteractiveStreamReporter } from "../../packem_shared/types.d-Ck_RSjLg.js";
|
|
3
2
|
import { InteractiveManager } from '@visulima/interactive-manager';
|
|
4
3
|
import '@visulima/colorize';
|
|
4
|
+
type ColorizeMethod = (value: string) => string;
|
|
5
|
+
type CodeFrameOptions = {
|
|
6
|
+
color?: {
|
|
7
|
+
gutter?: ColorizeMethod;
|
|
8
|
+
marker?: ColorizeMethod;
|
|
9
|
+
message?: ColorizeMethod;
|
|
10
|
+
};
|
|
11
|
+
linesAbove?: number;
|
|
12
|
+
linesBelow?: number;
|
|
13
|
+
message?: string;
|
|
14
|
+
prefix?: string;
|
|
15
|
+
showGutter?: boolean;
|
|
16
|
+
showLineNumbers?: boolean;
|
|
17
|
+
tabWidth?: number | false;
|
|
18
|
+
};
|
|
19
|
+
type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
|
|
20
|
+
color: CodeFrameOptions["color"] & {
|
|
21
|
+
fileLine: ColorizeMethod;
|
|
22
|
+
hint: ColorizeMethod;
|
|
23
|
+
method: ColorizeMethod;
|
|
24
|
+
title: ColorizeMethod;
|
|
25
|
+
};
|
|
26
|
+
cwd: string;
|
|
27
|
+
displayShortPath: boolean;
|
|
28
|
+
filterStacktrace: ((line: string) => boolean) | undefined;
|
|
29
|
+
framesMaxLimit: number;
|
|
30
|
+
hideErrorCauseCodeView: boolean;
|
|
31
|
+
hideErrorCodeView: boolean;
|
|
32
|
+
hideErrorErrorsCodeView: boolean;
|
|
33
|
+
hideErrorTitle: boolean;
|
|
34
|
+
hideMessage: boolean;
|
|
35
|
+
indentation: number | " ";
|
|
36
|
+
prefix: string;
|
|
37
|
+
};
|
|
5
38
|
interface Options {
|
|
6
39
|
breakLength: number;
|
|
7
40
|
customInspect: boolean;
|
|
@@ -89,7 +122,7 @@ type PrettyStyleOptions = {
|
|
|
89
122
|
*/
|
|
90
123
|
type PrettyReporterOptions = PrettyStyleOptions & {
|
|
91
124
|
/** Error rendering options */
|
|
92
|
-
error: Partial<Omit<
|
|
125
|
+
error: Partial<Omit<Options$1, "color" | "prefix" | "indentation">>;
|
|
93
126
|
/** Object inspection options */
|
|
94
127
|
inspect: Partial<Options>;
|
|
95
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-
|
|
1
|
+
import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-D9aBMmxI.js";export{t as PrettyReporter};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
`),0):
|
|
3
|
-
`,
|
|
1
|
+
import{createRequire as V}from"node:module";import k from"@visulima/colorize";import{A as O,b as z,r as F,c as G,d as H,g as K,e as g,f as Q,a as U,h as v,U as W,_ as b,i as X}from"../../packem_shared/abstract-pretty-reporter-zijeSUgy.js";const ie=V(import.meta.url),Y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:B,stderr:D}=Y,{bgGrey:Z,bold:I,cyan:J,green:N,greenBright:ee,grey:a,red:x,underline:R,white:te}=k,se=/[\\/]pail[\\/]dist/,_=S=>!se.test(S);class ne extends O{#t;#s;#r;#a=!1;#i;#e;constructor(t={}){const{error:o,inspect:n,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...z,indent:void 0,...n},this.#e={...o,color:{fileLine:N,hint:J,marker:x,message:x,method:ee,title:x}},this.#t=B,this.#s=D}setStdout(t){this.#t=t}setStderr(t){this.#s=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#a=t}log(t){const o=this.formatMessage(t),n=t.type.level,i=["error","trace","warn"].includes(n)?"stderr":"stdout",p=i==="stderr"?this.#s:this.#t;this.#a&&this.#r!==void 0&&p.isTTY?this.#r.update(i,o.split(`
|
|
2
|
+
`),0):F(`${o}
|
|
3
|
+
`,p)}formatMessage(t){const{columns:o}=G();let n=o;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:i,context:p,date:l,error:T,file:c,groups:f,label:d,message:u,prefix:m,repeated:w,scope:y,suffix:$,traceError:j,type:A}=t,{color:M}=this.loggerTypes[A.name],C=M?k[M]:te,h=f.map(()=>" ").join(""),e=[];if(f.length>0&&e.push(`${h+a(`[${f.at(-1)??""}]`)} `),l&&e.push(`${a(this.styles.dateFormatter(typeof l=="string"?new Date(l):l))} `),i)e.push(I(C(i)));else{const s=H(this.loggerTypes);s.length>0&&e.push(a(" ".repeat(s.length)))}const q=K(this.loggerTypes),E=g(q);if(d){const s=g(d),r=Math.max(0,E-s);e.push(`${I(C(Q(d,this.styles)))} `," ".repeat(r))}else e.push(" ".repeat(E+1));w&&e.push(`${Z.white(`[${String(w)}x]`)} `),Array.isArray(y)&&y.length>0&&e.push(`${a(`[${y.join(" > ")}]`)} `),m&&e.push(`${a(`[${this.styles.underline.prefix?R(m):m}]`)} `);const L=g(e.join(""));if(u!==U){const s=typeof u=="string"?u:v(u,this.#i);e.push(h+W(s,{trim:!1,width:n-3,wrapMode:X.STRICT_WIDTH}))}if(p){let s=!1;e.push(...p.map(r=>{if(r instanceof Error)return s=!0,`
|
|
4
4
|
|
|
5
|
-
${
|
|
5
|
+
${b(r,{...this.#e,filterStacktrace:_,prefix:h})}`;if(typeof r=="object")return` ${v(r,this.#i)}`;const P=(s?`
|
|
6
6
|
|
|
7
|
-
`:" ")+String(r);return s=!1,
|
|
7
|
+
`:" ")+String(r);return s=!1,P}))}if(T&&e.push(b(T,{...this.#e,filterStacktrace:_,prefix:h})),j&&e.push(`
|
|
8
8
|
|
|
9
|
-
${
|
|
9
|
+
${b(j,{...this.#e,filterStacktrace:_,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:h})}`),$&&e.push(` ${h}${a(this.styles.underline.suffix?R($):$)}`),c){const s=(c.name??"")+(c.line?`:${String(c.line)}`:""),r=Math.max(0,L-g("Caller: "));e.push(`
|
|
10
10
|
`,a("Caller: ")," ".repeat(r),s,`
|
|
11
|
-
`)}return
|
|
11
|
+
`)}return e.join("")}}export{ne as SimpleReporter};
|
package/dist/wide-event.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { R as RequestLogEntry, S as SerializedError, W as WideEvent, a as WideEventFinishOptions, b as WideEventLevel, c as WideEventOptions, d as createWideEvent } from "./packem_shared/wide-event.d-
|
|
2
|
-
import "./packem_shared/types.d-
|
|
1
|
+
export { R as RequestLogEntry, S as SerializedError, W as WideEvent, a as WideEventFinishOptions, b as WideEventLevel, c as WideEventOptions, d as createWideEvent } from "./packem_shared/wide-event.d-DkYD7YVK.js";
|
|
2
|
+
import "./packem_shared/types.d-Ck_RSjLg.js";
|
|
3
3
|
import 'safe-stable-stringify';
|
|
4
4
|
import '@visulima/colorize';
|
|
5
5
|
import '@visulima/interactive-manager';
|
package/dist/wide-event.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const h={debug:0,error:3,info:1,warn:2},c={debug:"debug",error:"error",info:"info",warn:"warn"},u=(s,t)=>{const e={...s},a=Object.keys(t);for(let i=0;i<a.length;i+=1){const r=a[i],o=t[r],n=e[r];o!==null&&typeof o=="object"&&!Array.isArray(o)&&n!==null&&typeof n=="object"&&!Array.isArray(n)?e[r]=u(n,o):e[r]=o}return e},m=s=>s<1e3?`${String(s)}ms`:`${(s/1e3).toFixed(2)}s`,d=s=>{const t={message:s.message,name:s.name};s.stack&&(t.stack=s.stack);const e=s;return e.status!==void 0?t.status=e.status:e.statusCode!==void 0&&(t.status=e.statusCode),e.data!==void 0&&(t.data=e.data),s.cause instanceof Error&&(t.cause=d(s.cause)),t};class l{name;autoEmit;data;emitted;attachedError;level;pail;requestLogs;service;startTime;status;timestamp;_type;constructor(t){this.name=t.name,this.pail=t.pail,this.data={},this.startTime=performance.now(),this.timestamp=new Date().toISOString(),this.emitted=!1,this.autoEmit=t.autoEmit??!0,this._type=t.type??"info",this.level="info",this.requestLogs=[],this.service=t.service}debug(t,e){return this.addLogEntry("debug",t,e)}emit(t){if(this.emitted)return;this.emitted=!0;const e=Math.round(performance.now()-this.startTime),a=this.attachedError?"error":this.level,i=t??c[a],r={duration:m(e),duration_ms:e,event:this.name,timestamp:this.timestamp,...this.data};this.service&&(r.service=this.service),this.status!==void 0&&(r.status=this.status),this.attachedError&&(r.error=d(this.attachedError)),this.requestLogs.length>0&&(r.requestLogs=this.requestLogs);const o=this.pail[i];o({message:r})}error(t,e,a){return e&&(this.attachedError=e),this.addLogEntry("error",t,a)}finish(t){t?.status!==void 0&&(this.status=t.status),t?.error&&(this.attachedError=t.error),this.emit()}getData(){return this.data}getLevel(){return this.attachedError?"error":this.level}getRequestLogs(){return this.requestLogs}info(t,e){return this.addLogEntry("info",t,e)}set(t){return this.data=u(this.data,t),this}setError(t){return this.attachedError=t,this}setStatus(t){return this.status=t,this}warn(t,e){return this.addLogEntry("warn",t,e)}[Symbol.dispose](){this.autoEmit&&!this.emitted&&this.emit()}addLogEntry(t,e,a){const i={level:t,message:e,timestamp:new Date().toISOString()};return a&&(i.context=a),this.requestLogs.push(i),this.escalateLevel(t),this}escalateLevel(t){(h[t]??0)>(h[this.level]??0)&&(this.level=t)}}const g=s=>new l(s);export{l as WideEvent,g as createWideEvent};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var f=(e,r)=>d(e,"name",{value:r,configurable:!0});import{E as y}from"./constants-DKfCaSUR.js";var j=Object.defineProperty,h=f((e,r)=>j(e,"name",{value:r,configurable:!0}),"f$1"),P=Object.defineProperty,S=h((e,r)=>P(e,"name",{value:r,configurable:!0}),"b");const w=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}});var N=Object.defineProperty,l=S((e,r)=>N(e,"name",{value:r,configurable:!0}),"i");const x=l(e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype||Object.getPrototypeOf(r)===null},"isPlainObject"),m=new WeakSet,g=l(e=>{const r=Object.getOwnPropertyNames(e);for(const a of r){const t=Object.getOwnPropertyDescriptor(e,a);t&&(t.enumerable||Object.defineProperty(e,a,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&g(t.value))}},"makePropertiesEnumerable"),E=l(e=>{m.add(e);const r=e.toJSON();return m.delete(e),Object.isExtensible(r)&&g(r),r},"toJSON"),O=l((e,r,a,t)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(a+=1,b(e,t,r,a));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(x(e)){if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&a+1>=t.maxDepth)return{};a+=1;const o={};for(const i in e)o[i]=O(e[i],r,a,t);return o}try{return e}catch{return"[Not Available]"}},"serializeValue"),b=l((e,r,a,t)=>{if(a.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!m.has(e))return E(e);const o=Object.create(w);if(Object.defineProperty(o,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(o,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(o,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const n=[];for(const u of e.errors){if(!(u instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(a.has(u))return Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),o;n.push(b(u,r,a,t))}Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:n,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)a.has(i)?Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:b(i,r,a,t),writable:!0});else{const n=O(i,a,t,r);Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:n,writable:!0})}for(const n in e){if(n==="name"||n==="message"||n==="stack"||n==="cause"||n==="errors")continue;const u=e[n],c=O(u,a,t,r);Object.defineProperty(o,n,{configurable:!0,enumerable:!0,value:c,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const n of r.exclude)try{delete o[n]}catch{}return o},"_serialize"),v=l((e,r={})=>b(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");var J=Object.defineProperty,A=f((e,r)=>J(e,"name",{value:r,configurable:!0}),"f");class D{static{f(this,"AbstractJsonReporter")}static{A(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:a,error:t,file:o,message:i,type:n,...u}=r;if(u.label&&(u.label=u.label.trim()),o&&(u.file=`${o.name??""}:${String(o.line)}${o.column?`:${String(o.column)}`:""}`),u.message=i===y?void 0:i,t&&(u.error=v(t,this.errorOptions)),a){const c=[];for(let p=0;p<a.length;p+=1){const s=a[p];s!==y&&(s instanceof Error?c.push(v(s,this.errorOptions)):c.push(s))}u.context=c}this._log(this.stringify(u),n.level)}}export{D as AbstractJsonReporter};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var f=(e,r)=>d(e,"name",{value:r,configurable:!0});import{E as y}from"./constants-ep2nsfdy.js";var j=Object.defineProperty,h=f((e,r)=>j(e,"name",{value:r,configurable:!0}),"f$1"),P=Object.defineProperty,S=h((e,r)=>P(e,"name",{value:r,configurable:!0}),"b");const w=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}});var N=Object.defineProperty,l=S((e,r)=>N(e,"name",{value:r,configurable:!0}),"i");const x=l(e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype||Object.getPrototypeOf(r)===null},"isPlainObject"),m=new WeakSet,g=l(e=>{const r=Object.getOwnPropertyNames(e);for(const a of r){const t=Object.getOwnPropertyDescriptor(e,a);t&&(t.enumerable||Object.defineProperty(e,a,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&g(t.value))}},"makePropertiesEnumerable"),E=l(e=>{m.add(e);const r=e.toJSON();return m.delete(e),Object.isExtensible(r)&&g(r),r},"toJSON"),O=l((e,r,a,t)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(a+=1,b(e,t,r,a));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(x(e)){if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&a+1>=t.maxDepth)return{};a+=1;const o={};for(const i in e)o[i]=O(e[i],r,a,t);return o}try{return e}catch{return"[Not Available]"}},"serializeValue"),b=l((e,r,a,t)=>{if(a.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!m.has(e))return E(e);const o=Object.create(w);if(Object.defineProperty(o,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(o,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(o,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const n=[];for(const u of e.errors){if(!(u instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(a.has(u))return Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),o;n.push(b(u,r,a,t))}Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:n,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)a.has(i)?Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:b(i,r,a,t),writable:!0});else{const n=O(i,a,t,r);Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:n,writable:!0})}for(const n in e){if(n==="name"||n==="message"||n==="stack"||n==="cause"||n==="errors")continue;const u=e[n],c=O(u,a,t,r);Object.defineProperty(o,n,{configurable:!0,enumerable:!0,value:c,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const n of r.exclude)try{delete o[n]}catch{}return o},"_serialize"),v=l((e,r={})=>b(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");var J=Object.defineProperty,A=f((e,r)=>J(e,"name",{value:r,configurable:!0}),"f");class D{static{f(this,"AbstractJsonReporter")}static{A(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:a,error:t,file:o,message:i,type:n,...u}=r;if(u.label&&(u.label=u.label.trim()),o&&(u.file=`${o.name??""}:${String(o.line)}${o.column?`:${String(o.column)}`:""}`),u.message=i===y?void 0:i,t&&(u.error=v(t,this.errorOptions)),a){const c=[];for(let p=0;p<a.length;p+=1){const s=a[p];s!==y&&(s instanceof Error?c.push(v(s,this.errorOptions)):c.push(s))}u.context=c}this._log(this.stringify(u),n.level)}}export{D as AbstractJsonReporter};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var i=Object.defineProperty;var s=(t,e)=>i(t,"name",{value:e,configurable:!0});import{createRequire as c}from"node:module";import{i as p}from"./write-stream-Dd4_PTcm.js";import{AbstractJsonReporter as l}from"./AbstractJsonReporter-PVC4ONf2.js";const _=c(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:n,stderr:u}=a;var d=Object.defineProperty,f=s((t,e)=>d(t,"name",{value:e,configurable:!0}),"r");class j extends l{static{s(this,"m")}static{f(this,"JsonReporter")}#e;#t;constructor(e={}){super(e),this.#e=n,this.#t=u}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,r){const o=["error","warn"].includes(r)?this.#t:this.#e;p(`${e}
|
|
2
|
-
`,o)}}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=Object.defineProperty;var t=(e,r)=>s(e,"name",{value:r,configurable:!0});import{AbstractJsonReporter as a}from"./AbstractJsonReporter-D_Pb6kpB.js";import{t as p}from"./write-console-log-based-on-level-DfD64owL.js";var c=Object.defineProperty,n=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"e");class l extends a{static{t(this,"p")}static{n(this,"JsonReporter")}constructor(r={}){super(r)}_log(r,o){p(o)(r)}}export{l as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var E=Object.defineProperty;var c=(r,t)=>E(r,"name",{value:t,configurable:!0});import F,{grey as o,white as w,underline as T,bold as M}from"@visulima/colorize/browser";import{v as a,s as Y}from"./index-Dwp5v97D.js";import{L as _,E as k}from"./constants-DKfCaSUR.js";import{t as C}from"./write-console-log-based-on-level-DfD64owL.js";var D=Object.defineProperty,G=c((r,t)=>D(r,"name",{value:t,configurable:!0}),"r$1");const H=G(r=>{const t=Object.keys(r).map(l=>r[l].badge??"");return t.length===0?"":t.reduce((l,u)=>l.length>u.length?l:u,"")},"getLongestBadge");var U=Object.defineProperty,R=c((r,t)=>U(r,"name",{value:t,configurable:!0}),"o");const q=R(r=>[r.getHours(),r.getMinutes(),r.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class z{static{c(this,"AbstractPrettyReporter")}static{R(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:q,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=_}setLoggerTypes(t){this.loggerTypes=t}}var I=Object.defineProperty,J=c((r,t)=>I(r,"name",{value:t,configurable:!0}),"B");class X extends z{static{c(this,"_")}static{J(this,"PrettyReporter")}constructor(t={}){super({uppercase:{label:!0,...t.uppercase},...t})}log(t){const l=typeof globalThis.window<"u"&&typeof globalThis.document<"u",u=C(t.type.level),{badge:x,context:A,date:g,error:P,groups:y,label:d,message:S,prefix:b,repeated:f,scope:h,suffix:m,type:B}=t,{color:j}=this.loggerTypes[B.name],O=j?F[j]:w,s=[];if(l&&y.length>0){const e=y.map(()=>" ").join(""),i=o(`[${y.at(-1)}]`);s.push(a(e+i[0],i.slice(1)))}if(g){const e=o(this.styles.dateFormatter(typeof g=="string"?new Date(g):g));l?s.push(a(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}if(x){const e=O(x);l?s.push(a(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}else{const e=H(this.loggerTypes);if(e.length>0){const i=o(".".repeat(e.length));l?s.push(a(`${i[0]} `,i.slice(1))):s.push([`${i[0]} `,...i.slice(1)])}}const L=Y(this.loggerTypes);let $;if(f){const e=w(`[${f}x]`);$=l?a(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(d){const e=O(this.#e(d));l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),$&&s.push($);let i=L.length-d.length;if(f?i-=String(f).length+3:i+=1,i>0){const n=o(".".repeat(i));l?s.push(a(n[0],n.slice(1))):s.push([` ${n[0]}`,...n.slice(1)])}}else{const e=o(".".repeat(L.length+1));l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(h)&&h.length>0){const e=o(`[${h.join(" > ")}]`);l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(b){const e=o(`${Array.isArray(h)&&h.length>0?". ":" "}[${this.styles.underline.prefix?T(b):b}] `);l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(S!==k&&s.push(S),A&&s.push(...A),P&&s.push(P,`
|
|
2
|
-
|
|
3
|
-
`),m){const e=o(this.styles.underline.suffix?T(m):m);l?s.push(a(`
|
|
4
|
-
${e[0]}`,e.slice(1))):s.push([`
|
|
5
|
-
${e[0]}`,...e.slice(1)])}if(l)u(...s);else{let e="";const i=[],n=[];for(let v=0;v<s.length;v+=1){const p=s[v];Array.isArray(p)&&p.length>1&&p[0].includes("%c")?(e+=String(p[0]),i.push(...p.slice(1))):n.push(p)}u(`${e}%c`,...i,"",...n)}}#e(t){let l=this.styles.uppercase.label?t.toUpperCase():t;return l=this.styles.underline.label?T(l):l,this.styles.bold.label&&(l=M(l)),l}}export{X as default};
|