tunnelcake 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/public/assets/index-2FUaMbWY.js +64 -0
- package/dist/public/assets/index-B47yacxU.css +1 -0
- package/dist/public/favicon.svg +9 -0
- package/dist/public/index.html +25 -0
- package/dist/public/opengraph.jpg +0 -0
- package/dist/public/robots.txt +2 -0
- package/dist/server/index.mjs +58725 -0
- package/dist/server/index.mjs.map +7 -0
- package/dist/server/pino-file.mjs +4350 -0
- package/dist/server/pino-file.mjs.map +7 -0
- package/dist/server/pino-pretty.mjs +3312 -0
- package/dist/server/pino-pretty.mjs.map +7 -0
- package/dist/server/pino-worker.mjs +4706 -0
- package/dist/server/pino-worker.mjs.map +7 -0
- package/dist/server/thread-stream-worker.mjs +228 -0
- package/dist/server/thread-stream-worker.mjs.map +7 -0
- package/launch.mjs +134 -0
- package/package.json +24 -0
|
@@ -0,0 +1,3312 @@
|
|
|
1
|
+
import { createRequire as __bannerCrReq } from 'node:module';
|
|
2
|
+
import __bannerPath from 'node:path';
|
|
3
|
+
import __bannerUrl from 'node:url';
|
|
4
|
+
|
|
5
|
+
globalThis.require = __bannerCrReq(import.meta.url);
|
|
6
|
+
globalThis.__filename = __bannerUrl.fileURLToPath(import.meta.url);
|
|
7
|
+
globalThis.__dirname = __bannerPath.dirname(globalThis.__filename);
|
|
8
|
+
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
|
+
}) : x)(function(x) {
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
+
});
|
|
16
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.cjs
|
|
21
|
+
var require_colorette = __commonJS({
|
|
22
|
+
"../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.cjs"(exports) {
|
|
23
|
+
"use strict";
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
var tty = __require("tty");
|
|
26
|
+
function _interopNamespace(e) {
|
|
27
|
+
if (e && e.__esModule) return e;
|
|
28
|
+
var n = /* @__PURE__ */ Object.create(null);
|
|
29
|
+
if (e) {
|
|
30
|
+
Object.keys(e).forEach(function(k) {
|
|
31
|
+
if (k !== "default") {
|
|
32
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
33
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function() {
|
|
36
|
+
return e[k];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
n["default"] = e;
|
|
43
|
+
return Object.freeze(n);
|
|
44
|
+
}
|
|
45
|
+
var tty__namespace = /* @__PURE__ */ _interopNamespace(tty);
|
|
46
|
+
var {
|
|
47
|
+
env = {},
|
|
48
|
+
argv = [],
|
|
49
|
+
platform = ""
|
|
50
|
+
} = typeof process === "undefined" ? {} : process;
|
|
51
|
+
var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
52
|
+
var isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
53
|
+
var isWindows = platform === "win32";
|
|
54
|
+
var isDumbTerminal = env.TERM === "dumb";
|
|
55
|
+
var isCompatibleTerminal = tty__namespace && tty__namespace.isatty && tty__namespace.isatty(1) && env.TERM && !isDumbTerminal;
|
|
56
|
+
var isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
57
|
+
var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
58
|
+
var replaceClose = (index, string, close, replace, head = string.substring(0, index) + replace, tail = string.substring(index + close.length), next = tail.indexOf(close)) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
59
|
+
var clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
60
|
+
var filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === void 0) ? clearBleed(
|
|
61
|
+
("" + string).indexOf(close, at),
|
|
62
|
+
string,
|
|
63
|
+
open,
|
|
64
|
+
close,
|
|
65
|
+
replace
|
|
66
|
+
) : "";
|
|
67
|
+
var init = (open, close, replace) => filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
68
|
+
var colors = {
|
|
69
|
+
reset: init(0, 0),
|
|
70
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
71
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
72
|
+
italic: init(3, 23),
|
|
73
|
+
underline: init(4, 24),
|
|
74
|
+
inverse: init(7, 27),
|
|
75
|
+
hidden: init(8, 28),
|
|
76
|
+
strikethrough: init(9, 29),
|
|
77
|
+
black: init(30, 39),
|
|
78
|
+
red: init(31, 39),
|
|
79
|
+
green: init(32, 39),
|
|
80
|
+
yellow: init(33, 39),
|
|
81
|
+
blue: init(34, 39),
|
|
82
|
+
magenta: init(35, 39),
|
|
83
|
+
cyan: init(36, 39),
|
|
84
|
+
white: init(37, 39),
|
|
85
|
+
gray: init(90, 39),
|
|
86
|
+
bgBlack: init(40, 49),
|
|
87
|
+
bgRed: init(41, 49),
|
|
88
|
+
bgGreen: init(42, 49),
|
|
89
|
+
bgYellow: init(43, 49),
|
|
90
|
+
bgBlue: init(44, 49),
|
|
91
|
+
bgMagenta: init(45, 49),
|
|
92
|
+
bgCyan: init(46, 49),
|
|
93
|
+
bgWhite: init(47, 49),
|
|
94
|
+
blackBright: init(90, 39),
|
|
95
|
+
redBright: init(91, 39),
|
|
96
|
+
greenBright: init(92, 39),
|
|
97
|
+
yellowBright: init(93, 39),
|
|
98
|
+
blueBright: init(94, 39),
|
|
99
|
+
magentaBright: init(95, 39),
|
|
100
|
+
cyanBright: init(96, 39),
|
|
101
|
+
whiteBright: init(97, 39),
|
|
102
|
+
bgBlackBright: init(100, 49),
|
|
103
|
+
bgRedBright: init(101, 49),
|
|
104
|
+
bgGreenBright: init(102, 49),
|
|
105
|
+
bgYellowBright: init(103, 49),
|
|
106
|
+
bgBlueBright: init(104, 49),
|
|
107
|
+
bgMagentaBright: init(105, 49),
|
|
108
|
+
bgCyanBright: init(106, 49),
|
|
109
|
+
bgWhiteBright: init(107, 49)
|
|
110
|
+
};
|
|
111
|
+
var createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors : Object.keys(colors).reduce(
|
|
112
|
+
(colors2, key) => ({ ...colors2, [key]: String }),
|
|
113
|
+
{}
|
|
114
|
+
);
|
|
115
|
+
var {
|
|
116
|
+
reset,
|
|
117
|
+
bold,
|
|
118
|
+
dim,
|
|
119
|
+
italic,
|
|
120
|
+
underline,
|
|
121
|
+
inverse,
|
|
122
|
+
hidden,
|
|
123
|
+
strikethrough,
|
|
124
|
+
black,
|
|
125
|
+
red,
|
|
126
|
+
green,
|
|
127
|
+
yellow,
|
|
128
|
+
blue,
|
|
129
|
+
magenta,
|
|
130
|
+
cyan,
|
|
131
|
+
white,
|
|
132
|
+
gray,
|
|
133
|
+
bgBlack,
|
|
134
|
+
bgRed,
|
|
135
|
+
bgGreen,
|
|
136
|
+
bgYellow,
|
|
137
|
+
bgBlue,
|
|
138
|
+
bgMagenta,
|
|
139
|
+
bgCyan,
|
|
140
|
+
bgWhite,
|
|
141
|
+
blackBright,
|
|
142
|
+
redBright,
|
|
143
|
+
greenBright,
|
|
144
|
+
yellowBright,
|
|
145
|
+
blueBright,
|
|
146
|
+
magentaBright,
|
|
147
|
+
cyanBright,
|
|
148
|
+
whiteBright,
|
|
149
|
+
bgBlackBright,
|
|
150
|
+
bgRedBright,
|
|
151
|
+
bgGreenBright,
|
|
152
|
+
bgYellowBright,
|
|
153
|
+
bgBlueBright,
|
|
154
|
+
bgMagentaBright,
|
|
155
|
+
bgCyanBright,
|
|
156
|
+
bgWhiteBright
|
|
157
|
+
} = createColors();
|
|
158
|
+
exports.bgBlack = bgBlack;
|
|
159
|
+
exports.bgBlackBright = bgBlackBright;
|
|
160
|
+
exports.bgBlue = bgBlue;
|
|
161
|
+
exports.bgBlueBright = bgBlueBright;
|
|
162
|
+
exports.bgCyan = bgCyan;
|
|
163
|
+
exports.bgCyanBright = bgCyanBright;
|
|
164
|
+
exports.bgGreen = bgGreen;
|
|
165
|
+
exports.bgGreenBright = bgGreenBright;
|
|
166
|
+
exports.bgMagenta = bgMagenta;
|
|
167
|
+
exports.bgMagentaBright = bgMagentaBright;
|
|
168
|
+
exports.bgRed = bgRed;
|
|
169
|
+
exports.bgRedBright = bgRedBright;
|
|
170
|
+
exports.bgWhite = bgWhite;
|
|
171
|
+
exports.bgWhiteBright = bgWhiteBright;
|
|
172
|
+
exports.bgYellow = bgYellow;
|
|
173
|
+
exports.bgYellowBright = bgYellowBright;
|
|
174
|
+
exports.black = black;
|
|
175
|
+
exports.blackBright = blackBright;
|
|
176
|
+
exports.blue = blue;
|
|
177
|
+
exports.blueBright = blueBright;
|
|
178
|
+
exports.bold = bold;
|
|
179
|
+
exports.createColors = createColors;
|
|
180
|
+
exports.cyan = cyan;
|
|
181
|
+
exports.cyanBright = cyanBright;
|
|
182
|
+
exports.dim = dim;
|
|
183
|
+
exports.gray = gray;
|
|
184
|
+
exports.green = green;
|
|
185
|
+
exports.greenBright = greenBright;
|
|
186
|
+
exports.hidden = hidden;
|
|
187
|
+
exports.inverse = inverse;
|
|
188
|
+
exports.isColorSupported = isColorSupported;
|
|
189
|
+
exports.italic = italic;
|
|
190
|
+
exports.magenta = magenta;
|
|
191
|
+
exports.magentaBright = magentaBright;
|
|
192
|
+
exports.red = red;
|
|
193
|
+
exports.redBright = redBright;
|
|
194
|
+
exports.reset = reset;
|
|
195
|
+
exports.strikethrough = strikethrough;
|
|
196
|
+
exports.underline = underline;
|
|
197
|
+
exports.white = white;
|
|
198
|
+
exports.whiteBright = whiteBright;
|
|
199
|
+
exports.yellow = yellow;
|
|
200
|
+
exports.yellowBright = yellowBright;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// ../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
|
|
205
|
+
var require_wrappy = __commonJS({
|
|
206
|
+
"../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module) {
|
|
207
|
+
module.exports = wrappy;
|
|
208
|
+
function wrappy(fn, cb) {
|
|
209
|
+
if (fn && cb) return wrappy(fn)(cb);
|
|
210
|
+
if (typeof fn !== "function")
|
|
211
|
+
throw new TypeError("need wrapper function");
|
|
212
|
+
Object.keys(fn).forEach(function(k) {
|
|
213
|
+
wrapper[k] = fn[k];
|
|
214
|
+
});
|
|
215
|
+
return wrapper;
|
|
216
|
+
function wrapper() {
|
|
217
|
+
var args = new Array(arguments.length);
|
|
218
|
+
for (var i = 0; i < args.length; i++) {
|
|
219
|
+
args[i] = arguments[i];
|
|
220
|
+
}
|
|
221
|
+
var ret = fn.apply(this, args);
|
|
222
|
+
var cb2 = args[args.length - 1];
|
|
223
|
+
if (typeof ret === "function" && ret !== cb2) {
|
|
224
|
+
Object.keys(cb2).forEach(function(k) {
|
|
225
|
+
ret[k] = cb2[k];
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return ret;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// ../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
|
|
235
|
+
var require_once = __commonJS({
|
|
236
|
+
"../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module) {
|
|
237
|
+
var wrappy = require_wrappy();
|
|
238
|
+
module.exports = wrappy(once);
|
|
239
|
+
module.exports.strict = wrappy(onceStrict);
|
|
240
|
+
once.proto = once(function() {
|
|
241
|
+
Object.defineProperty(Function.prototype, "once", {
|
|
242
|
+
value: function() {
|
|
243
|
+
return once(this);
|
|
244
|
+
},
|
|
245
|
+
configurable: true
|
|
246
|
+
});
|
|
247
|
+
Object.defineProperty(Function.prototype, "onceStrict", {
|
|
248
|
+
value: function() {
|
|
249
|
+
return onceStrict(this);
|
|
250
|
+
},
|
|
251
|
+
configurable: true
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
function once(fn) {
|
|
255
|
+
var f = function() {
|
|
256
|
+
if (f.called) return f.value;
|
|
257
|
+
f.called = true;
|
|
258
|
+
return f.value = fn.apply(this, arguments);
|
|
259
|
+
};
|
|
260
|
+
f.called = false;
|
|
261
|
+
return f;
|
|
262
|
+
}
|
|
263
|
+
function onceStrict(fn) {
|
|
264
|
+
var f = function() {
|
|
265
|
+
if (f.called)
|
|
266
|
+
throw new Error(f.onceError);
|
|
267
|
+
f.called = true;
|
|
268
|
+
return f.value = fn.apply(this, arguments);
|
|
269
|
+
};
|
|
270
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
271
|
+
f.onceError = name + " shouldn't be called more than once";
|
|
272
|
+
f.called = false;
|
|
273
|
+
return f;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
// ../../node_modules/.pnpm/end-of-stream@1.4.5/node_modules/end-of-stream/index.js
|
|
279
|
+
var require_end_of_stream = __commonJS({
|
|
280
|
+
"../../node_modules/.pnpm/end-of-stream@1.4.5/node_modules/end-of-stream/index.js"(exports, module) {
|
|
281
|
+
var once = require_once();
|
|
282
|
+
var noop = function() {
|
|
283
|
+
};
|
|
284
|
+
var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process);
|
|
285
|
+
var isRequest = function(stream) {
|
|
286
|
+
return stream.setHeader && typeof stream.abort === "function";
|
|
287
|
+
};
|
|
288
|
+
var isChildProcess = function(stream) {
|
|
289
|
+
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3;
|
|
290
|
+
};
|
|
291
|
+
var eos = function(stream, opts, callback) {
|
|
292
|
+
if (typeof opts === "function") return eos(stream, null, opts);
|
|
293
|
+
if (!opts) opts = {};
|
|
294
|
+
callback = once(callback || noop);
|
|
295
|
+
var ws = stream._writableState;
|
|
296
|
+
var rs = stream._readableState;
|
|
297
|
+
var readable = opts.readable || opts.readable !== false && stream.readable;
|
|
298
|
+
var writable = opts.writable || opts.writable !== false && stream.writable;
|
|
299
|
+
var cancelled = false;
|
|
300
|
+
var onlegacyfinish = function() {
|
|
301
|
+
if (!stream.writable) onfinish();
|
|
302
|
+
};
|
|
303
|
+
var onfinish = function() {
|
|
304
|
+
writable = false;
|
|
305
|
+
if (!readable) callback.call(stream);
|
|
306
|
+
};
|
|
307
|
+
var onend = function() {
|
|
308
|
+
readable = false;
|
|
309
|
+
if (!writable) callback.call(stream);
|
|
310
|
+
};
|
|
311
|
+
var onexit = function(exitCode) {
|
|
312
|
+
callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null);
|
|
313
|
+
};
|
|
314
|
+
var onerror = function(err) {
|
|
315
|
+
callback.call(stream, err);
|
|
316
|
+
};
|
|
317
|
+
var onclose = function() {
|
|
318
|
+
qnt(onclosenexttick);
|
|
319
|
+
};
|
|
320
|
+
var onclosenexttick = function() {
|
|
321
|
+
if (cancelled) return;
|
|
322
|
+
if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error("premature close"));
|
|
323
|
+
if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error("premature close"));
|
|
324
|
+
};
|
|
325
|
+
var onrequest = function() {
|
|
326
|
+
stream.req.on("finish", onfinish);
|
|
327
|
+
};
|
|
328
|
+
if (isRequest(stream)) {
|
|
329
|
+
stream.on("complete", onfinish);
|
|
330
|
+
stream.on("abort", onclose);
|
|
331
|
+
if (stream.req) onrequest();
|
|
332
|
+
else stream.on("request", onrequest);
|
|
333
|
+
} else if (writable && !ws) {
|
|
334
|
+
stream.on("end", onlegacyfinish);
|
|
335
|
+
stream.on("close", onlegacyfinish);
|
|
336
|
+
}
|
|
337
|
+
if (isChildProcess(stream)) stream.on("exit", onexit);
|
|
338
|
+
stream.on("end", onend);
|
|
339
|
+
stream.on("finish", onfinish);
|
|
340
|
+
if (opts.error !== false) stream.on("error", onerror);
|
|
341
|
+
stream.on("close", onclose);
|
|
342
|
+
return function() {
|
|
343
|
+
cancelled = true;
|
|
344
|
+
stream.removeListener("complete", onfinish);
|
|
345
|
+
stream.removeListener("abort", onclose);
|
|
346
|
+
stream.removeListener("request", onrequest);
|
|
347
|
+
if (stream.req) stream.req.removeListener("finish", onfinish);
|
|
348
|
+
stream.removeListener("end", onlegacyfinish);
|
|
349
|
+
stream.removeListener("close", onlegacyfinish);
|
|
350
|
+
stream.removeListener("finish", onfinish);
|
|
351
|
+
stream.removeListener("exit", onexit);
|
|
352
|
+
stream.removeListener("end", onend);
|
|
353
|
+
stream.removeListener("error", onerror);
|
|
354
|
+
stream.removeListener("close", onclose);
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
module.exports = eos;
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
// ../../node_modules/.pnpm/pump@3.0.4/node_modules/pump/index.js
|
|
362
|
+
var require_pump = __commonJS({
|
|
363
|
+
"../../node_modules/.pnpm/pump@3.0.4/node_modules/pump/index.js"(exports, module) {
|
|
364
|
+
var once = require_once();
|
|
365
|
+
var eos = require_end_of_stream();
|
|
366
|
+
var fs;
|
|
367
|
+
try {
|
|
368
|
+
fs = __require("fs");
|
|
369
|
+
} catch (e) {
|
|
370
|
+
}
|
|
371
|
+
var noop = function() {
|
|
372
|
+
};
|
|
373
|
+
var ancient = typeof process === "undefined" ? false : /^v?\.0/.test(process.version);
|
|
374
|
+
var isFn = function(fn) {
|
|
375
|
+
return typeof fn === "function";
|
|
376
|
+
};
|
|
377
|
+
var isFS = function(stream) {
|
|
378
|
+
if (!ancient) return false;
|
|
379
|
+
if (!fs) return false;
|
|
380
|
+
return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close);
|
|
381
|
+
};
|
|
382
|
+
var isRequest = function(stream) {
|
|
383
|
+
return stream.setHeader && isFn(stream.abort);
|
|
384
|
+
};
|
|
385
|
+
var destroyer = function(stream, reading, writing, callback) {
|
|
386
|
+
callback = once(callback);
|
|
387
|
+
var closed = false;
|
|
388
|
+
stream.on("close", function() {
|
|
389
|
+
closed = true;
|
|
390
|
+
});
|
|
391
|
+
eos(stream, { readable: reading, writable: writing }, function(err) {
|
|
392
|
+
if (err) return callback(err);
|
|
393
|
+
closed = true;
|
|
394
|
+
callback();
|
|
395
|
+
});
|
|
396
|
+
var destroyed = false;
|
|
397
|
+
return function(err) {
|
|
398
|
+
if (closed) return;
|
|
399
|
+
if (destroyed) return;
|
|
400
|
+
destroyed = true;
|
|
401
|
+
if (isFS(stream)) return stream.close(noop);
|
|
402
|
+
if (isRequest(stream)) return stream.abort();
|
|
403
|
+
if (isFn(stream.destroy)) return stream.destroy();
|
|
404
|
+
callback(err || new Error("stream was destroyed"));
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
var call = function(fn) {
|
|
408
|
+
fn();
|
|
409
|
+
};
|
|
410
|
+
var pipe = function(from, to) {
|
|
411
|
+
return from.pipe(to);
|
|
412
|
+
};
|
|
413
|
+
var pump = function() {
|
|
414
|
+
var streams = Array.prototype.slice.call(arguments);
|
|
415
|
+
var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop;
|
|
416
|
+
if (Array.isArray(streams[0])) streams = streams[0];
|
|
417
|
+
if (streams.length < 2) throw new Error("pump requires two streams per minimum");
|
|
418
|
+
var error;
|
|
419
|
+
var destroys = streams.map(function(stream, i) {
|
|
420
|
+
var reading = i < streams.length - 1;
|
|
421
|
+
var writing = i > 0;
|
|
422
|
+
return destroyer(stream, reading, writing, function(err) {
|
|
423
|
+
if (!error) error = err;
|
|
424
|
+
if (err) destroys.forEach(call);
|
|
425
|
+
if (reading) return;
|
|
426
|
+
destroys.forEach(call);
|
|
427
|
+
callback(error);
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
return streams.reduce(pipe);
|
|
431
|
+
};
|
|
432
|
+
module.exports = pump;
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// ../../node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js
|
|
437
|
+
var require_split2 = __commonJS({
|
|
438
|
+
"../../node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js"(exports, module) {
|
|
439
|
+
"use strict";
|
|
440
|
+
var { Transform } = __require("stream");
|
|
441
|
+
var { StringDecoder } = __require("string_decoder");
|
|
442
|
+
var kLast = /* @__PURE__ */ Symbol("last");
|
|
443
|
+
var kDecoder = /* @__PURE__ */ Symbol("decoder");
|
|
444
|
+
function transform(chunk, enc, cb) {
|
|
445
|
+
let list;
|
|
446
|
+
if (this.overflow) {
|
|
447
|
+
const buf = this[kDecoder].write(chunk);
|
|
448
|
+
list = buf.split(this.matcher);
|
|
449
|
+
if (list.length === 1) return cb();
|
|
450
|
+
list.shift();
|
|
451
|
+
this.overflow = false;
|
|
452
|
+
} else {
|
|
453
|
+
this[kLast] += this[kDecoder].write(chunk);
|
|
454
|
+
list = this[kLast].split(this.matcher);
|
|
455
|
+
}
|
|
456
|
+
this[kLast] = list.pop();
|
|
457
|
+
for (let i = 0; i < list.length; i++) {
|
|
458
|
+
try {
|
|
459
|
+
push(this, this.mapper(list[i]));
|
|
460
|
+
} catch (error) {
|
|
461
|
+
return cb(error);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
this.overflow = this[kLast].length > this.maxLength;
|
|
465
|
+
if (this.overflow && !this.skipOverflow) {
|
|
466
|
+
cb(new Error("maximum buffer reached"));
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
cb();
|
|
470
|
+
}
|
|
471
|
+
function flush(cb) {
|
|
472
|
+
this[kLast] += this[kDecoder].end();
|
|
473
|
+
if (this[kLast]) {
|
|
474
|
+
try {
|
|
475
|
+
push(this, this.mapper(this[kLast]));
|
|
476
|
+
} catch (error) {
|
|
477
|
+
return cb(error);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
cb();
|
|
481
|
+
}
|
|
482
|
+
function push(self, val) {
|
|
483
|
+
if (val !== void 0) {
|
|
484
|
+
self.push(val);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function noop(incoming) {
|
|
488
|
+
return incoming;
|
|
489
|
+
}
|
|
490
|
+
function split(matcher, mapper, options) {
|
|
491
|
+
matcher = matcher || /\r?\n/;
|
|
492
|
+
mapper = mapper || noop;
|
|
493
|
+
options = options || {};
|
|
494
|
+
switch (arguments.length) {
|
|
495
|
+
case 1:
|
|
496
|
+
if (typeof matcher === "function") {
|
|
497
|
+
mapper = matcher;
|
|
498
|
+
matcher = /\r?\n/;
|
|
499
|
+
} else if (typeof matcher === "object" && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
|
|
500
|
+
options = matcher;
|
|
501
|
+
matcher = /\r?\n/;
|
|
502
|
+
}
|
|
503
|
+
break;
|
|
504
|
+
case 2:
|
|
505
|
+
if (typeof matcher === "function") {
|
|
506
|
+
options = mapper;
|
|
507
|
+
mapper = matcher;
|
|
508
|
+
matcher = /\r?\n/;
|
|
509
|
+
} else if (typeof mapper === "object") {
|
|
510
|
+
options = mapper;
|
|
511
|
+
mapper = noop;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
options = Object.assign({}, options);
|
|
515
|
+
options.autoDestroy = true;
|
|
516
|
+
options.transform = transform;
|
|
517
|
+
options.flush = flush;
|
|
518
|
+
options.readableObjectMode = true;
|
|
519
|
+
const stream = new Transform(options);
|
|
520
|
+
stream[kLast] = "";
|
|
521
|
+
stream[kDecoder] = new StringDecoder("utf8");
|
|
522
|
+
stream.matcher = matcher;
|
|
523
|
+
stream.mapper = mapper;
|
|
524
|
+
stream.maxLength = options.maxLength;
|
|
525
|
+
stream.skipOverflow = options.skipOverflow || false;
|
|
526
|
+
stream.overflow = false;
|
|
527
|
+
stream._destroy = function(err, cb) {
|
|
528
|
+
this._writableState.errorEmitted = false;
|
|
529
|
+
cb(err);
|
|
530
|
+
};
|
|
531
|
+
return stream;
|
|
532
|
+
}
|
|
533
|
+
module.exports = split;
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
// ../../node_modules/.pnpm/pino-abstract-transport@3.0.0/node_modules/pino-abstract-transport/index.js
|
|
538
|
+
var require_pino_abstract_transport = __commonJS({
|
|
539
|
+
"../../node_modules/.pnpm/pino-abstract-transport@3.0.0/node_modules/pino-abstract-transport/index.js"(exports, module) {
|
|
540
|
+
"use strict";
|
|
541
|
+
var metadata = /* @__PURE__ */ Symbol.for("pino.metadata");
|
|
542
|
+
var split = require_split2();
|
|
543
|
+
var { Duplex } = __require("stream");
|
|
544
|
+
var { parentPort, workerData } = __require("worker_threads");
|
|
545
|
+
function createDeferred() {
|
|
546
|
+
let resolve;
|
|
547
|
+
let reject;
|
|
548
|
+
const promise = new Promise((_resolve, _reject) => {
|
|
549
|
+
resolve = _resolve;
|
|
550
|
+
reject = _reject;
|
|
551
|
+
});
|
|
552
|
+
promise.resolve = resolve;
|
|
553
|
+
promise.reject = reject;
|
|
554
|
+
return promise;
|
|
555
|
+
}
|
|
556
|
+
module.exports = function build(fn, opts = {}) {
|
|
557
|
+
const waitForConfig = opts.expectPinoConfig === true && workerData?.workerData?.pinoWillSendConfig === true;
|
|
558
|
+
const parseLines = opts.parse === "lines";
|
|
559
|
+
const parseLine = typeof opts.parseLine === "function" ? opts.parseLine : JSON.parse;
|
|
560
|
+
const close = opts.close || defaultClose;
|
|
561
|
+
const stream = split(function(line) {
|
|
562
|
+
let value;
|
|
563
|
+
try {
|
|
564
|
+
value = parseLine(line);
|
|
565
|
+
} catch (error) {
|
|
566
|
+
this.emit("unknown", line, error);
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
if (value === null) {
|
|
570
|
+
this.emit("unknown", line, "Null value ignored");
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
if (typeof value !== "object") {
|
|
574
|
+
value = {
|
|
575
|
+
data: value,
|
|
576
|
+
time: Date.now()
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
if (stream[metadata]) {
|
|
580
|
+
stream.lastTime = value.time;
|
|
581
|
+
stream.lastLevel = value.level;
|
|
582
|
+
stream.lastObj = value;
|
|
583
|
+
}
|
|
584
|
+
if (parseLines) {
|
|
585
|
+
return line;
|
|
586
|
+
}
|
|
587
|
+
return value;
|
|
588
|
+
}, { autoDestroy: true });
|
|
589
|
+
stream._destroy = function(err, cb) {
|
|
590
|
+
const promise = close(err, cb);
|
|
591
|
+
if (promise && typeof promise.then === "function") {
|
|
592
|
+
promise.then(cb, cb);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
if (opts.expectPinoConfig === true && workerData?.workerData?.pinoWillSendConfig !== true) {
|
|
596
|
+
setImmediate(() => {
|
|
597
|
+
stream.emit("error", new Error("This transport is not compatible with the current version of pino. Please upgrade pino to the latest version."));
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
if (opts.metadata !== false) {
|
|
601
|
+
stream[metadata] = true;
|
|
602
|
+
stream.lastTime = 0;
|
|
603
|
+
stream.lastLevel = 0;
|
|
604
|
+
stream.lastObj = null;
|
|
605
|
+
}
|
|
606
|
+
if (waitForConfig) {
|
|
607
|
+
let pinoConfig = {};
|
|
608
|
+
const configReceived = createDeferred();
|
|
609
|
+
parentPort.on("message", function handleMessage(message) {
|
|
610
|
+
if (message.code === "PINO_CONFIG") {
|
|
611
|
+
pinoConfig = message.config;
|
|
612
|
+
configReceived.resolve();
|
|
613
|
+
parentPort.off("message", handleMessage);
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
Object.defineProperties(stream, {
|
|
617
|
+
levels: {
|
|
618
|
+
get() {
|
|
619
|
+
return pinoConfig.levels;
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
messageKey: {
|
|
623
|
+
get() {
|
|
624
|
+
return pinoConfig.messageKey;
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
errorKey: {
|
|
628
|
+
get() {
|
|
629
|
+
return pinoConfig.errorKey;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
return configReceived.then(finish);
|
|
634
|
+
}
|
|
635
|
+
return finish();
|
|
636
|
+
function finish() {
|
|
637
|
+
let res = fn(stream);
|
|
638
|
+
if (res && typeof res.catch === "function") {
|
|
639
|
+
res.catch((err) => {
|
|
640
|
+
stream.destroy(err);
|
|
641
|
+
});
|
|
642
|
+
res = null;
|
|
643
|
+
} else if (opts.enablePipelining && res) {
|
|
644
|
+
return Duplex.from({ writable: stream, readable: res });
|
|
645
|
+
}
|
|
646
|
+
return stream;
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
function defaultClose(err, cb) {
|
|
650
|
+
process.nextTick(cb, err);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/constants.js
|
|
656
|
+
var require_constants = __commonJS({
|
|
657
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/constants.js"(exports, module) {
|
|
658
|
+
"use strict";
|
|
659
|
+
module.exports = {
|
|
660
|
+
DATE_FORMAT: "yyyy-mm-dd HH:MM:ss.l o",
|
|
661
|
+
DATE_FORMAT_SIMPLE: "HH:MM:ss.l",
|
|
662
|
+
/**
|
|
663
|
+
* @type {K_ERROR_LIKE_KEYS}
|
|
664
|
+
*/
|
|
665
|
+
ERROR_LIKE_KEYS: ["err", "error"],
|
|
666
|
+
MESSAGE_KEY: "msg",
|
|
667
|
+
LEVEL_KEY: "level",
|
|
668
|
+
LEVEL_LABEL: "levelLabel",
|
|
669
|
+
TIMESTAMP_KEY: "time",
|
|
670
|
+
LEVELS: {
|
|
671
|
+
default: "USERLVL",
|
|
672
|
+
60: "FATAL",
|
|
673
|
+
50: "ERROR",
|
|
674
|
+
40: "WARN",
|
|
675
|
+
30: "INFO",
|
|
676
|
+
20: "DEBUG",
|
|
677
|
+
10: "TRACE"
|
|
678
|
+
},
|
|
679
|
+
LEVEL_NAMES: {
|
|
680
|
+
fatal: 60,
|
|
681
|
+
error: 50,
|
|
682
|
+
warn: 40,
|
|
683
|
+
info: 30,
|
|
684
|
+
debug: 20,
|
|
685
|
+
trace: 10
|
|
686
|
+
},
|
|
687
|
+
// Object keys that probably came from a logger like Pino or Bunyan.
|
|
688
|
+
LOGGER_KEYS: [
|
|
689
|
+
"pid",
|
|
690
|
+
"hostname",
|
|
691
|
+
"name",
|
|
692
|
+
"level",
|
|
693
|
+
"time",
|
|
694
|
+
"timestamp",
|
|
695
|
+
"caller"
|
|
696
|
+
]
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/get-level-label-data.js
|
|
702
|
+
var require_get_level_label_data = __commonJS({
|
|
703
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/get-level-label-data.js"(exports, module) {
|
|
704
|
+
"use strict";
|
|
705
|
+
module.exports = getLevelLabelData;
|
|
706
|
+
var { LEVELS, LEVEL_NAMES } = require_constants();
|
|
707
|
+
function getLevelLabelData(useOnlyCustomProps, customLevels, customLevelNames) {
|
|
708
|
+
const levels = useOnlyCustomProps ? customLevels || LEVELS : Object.assign({}, LEVELS, customLevels);
|
|
709
|
+
const levelNames = useOnlyCustomProps ? customLevelNames || LEVEL_NAMES : Object.assign({}, LEVEL_NAMES, customLevelNames);
|
|
710
|
+
return function(level) {
|
|
711
|
+
let levelNum = "default";
|
|
712
|
+
if (Number.isInteger(+level)) {
|
|
713
|
+
levelNum = Object.prototype.hasOwnProperty.call(levels, level) ? level : levelNum;
|
|
714
|
+
} else {
|
|
715
|
+
levelNum = Object.prototype.hasOwnProperty.call(levelNames, level.toLowerCase()) ? levelNames[level.toLowerCase()] : levelNum;
|
|
716
|
+
}
|
|
717
|
+
return [levels[levelNum], levelNum];
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/colors.js
|
|
724
|
+
var require_colors = __commonJS({
|
|
725
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/colors.js"(exports, module) {
|
|
726
|
+
"use strict";
|
|
727
|
+
var nocolor = (input) => input;
|
|
728
|
+
var plain = {
|
|
729
|
+
default: nocolor,
|
|
730
|
+
60: nocolor,
|
|
731
|
+
50: nocolor,
|
|
732
|
+
40: nocolor,
|
|
733
|
+
30: nocolor,
|
|
734
|
+
20: nocolor,
|
|
735
|
+
10: nocolor,
|
|
736
|
+
message: nocolor,
|
|
737
|
+
greyMessage: nocolor,
|
|
738
|
+
property: nocolor
|
|
739
|
+
};
|
|
740
|
+
var { createColors } = require_colorette();
|
|
741
|
+
var getLevelLabelData = require_get_level_label_data();
|
|
742
|
+
var availableColors = createColors({ useColor: true });
|
|
743
|
+
var { white, bgRed, red, yellow, green, blue, gray, cyan, magenta } = availableColors;
|
|
744
|
+
var colored = {
|
|
745
|
+
default: white,
|
|
746
|
+
60: bgRed,
|
|
747
|
+
50: red,
|
|
748
|
+
40: yellow,
|
|
749
|
+
30: green,
|
|
750
|
+
20: blue,
|
|
751
|
+
10: gray,
|
|
752
|
+
message: cyan,
|
|
753
|
+
greyMessage: gray,
|
|
754
|
+
property: magenta
|
|
755
|
+
};
|
|
756
|
+
function resolveCustomColoredColorizer(customColors) {
|
|
757
|
+
return customColors.reduce(
|
|
758
|
+
function(agg, [level, color]) {
|
|
759
|
+
agg[level] = typeof availableColors[color] === "function" ? availableColors[color] : white;
|
|
760
|
+
return agg;
|
|
761
|
+
},
|
|
762
|
+
{ default: white, message: cyan, greyMessage: gray, property: magenta }
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
function colorizeLevel(useOnlyCustomProps) {
|
|
766
|
+
return function(level, colorizer, { customLevels, customLevelNames } = {}) {
|
|
767
|
+
const [levelStr, levelNum] = getLevelLabelData(useOnlyCustomProps, customLevels, customLevelNames)(level);
|
|
768
|
+
return Object.prototype.hasOwnProperty.call(colorizer, levelNum) ? colorizer[levelNum](levelStr) : colorizer.default(levelStr);
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
function plainColorizer(useOnlyCustomProps) {
|
|
772
|
+
const newPlainColorizer = colorizeLevel(useOnlyCustomProps);
|
|
773
|
+
const customColoredColorizer = function(level, opts) {
|
|
774
|
+
return newPlainColorizer(level, plain, opts);
|
|
775
|
+
};
|
|
776
|
+
customColoredColorizer.message = plain.message;
|
|
777
|
+
customColoredColorizer.greyMessage = plain.greyMessage;
|
|
778
|
+
customColoredColorizer.property = plain.property;
|
|
779
|
+
customColoredColorizer.colors = createColors({ useColor: false });
|
|
780
|
+
return customColoredColorizer;
|
|
781
|
+
}
|
|
782
|
+
function coloredColorizer(useOnlyCustomProps) {
|
|
783
|
+
const newColoredColorizer = colorizeLevel(useOnlyCustomProps);
|
|
784
|
+
const customColoredColorizer = function(level, opts) {
|
|
785
|
+
return newColoredColorizer(level, colored, opts);
|
|
786
|
+
};
|
|
787
|
+
customColoredColorizer.message = colored.message;
|
|
788
|
+
customColoredColorizer.property = colored.property;
|
|
789
|
+
customColoredColorizer.greyMessage = colored.greyMessage;
|
|
790
|
+
customColoredColorizer.colors = availableColors;
|
|
791
|
+
return customColoredColorizer;
|
|
792
|
+
}
|
|
793
|
+
function customColoredColorizerFactory(customColors, useOnlyCustomProps) {
|
|
794
|
+
const onlyCustomColored = resolveCustomColoredColorizer(customColors);
|
|
795
|
+
const customColored = useOnlyCustomProps ? onlyCustomColored : Object.assign({}, colored, onlyCustomColored);
|
|
796
|
+
const colorizeLevelCustom = colorizeLevel(useOnlyCustomProps);
|
|
797
|
+
const customColoredColorizer = function(level, opts) {
|
|
798
|
+
return colorizeLevelCustom(level, customColored, opts);
|
|
799
|
+
};
|
|
800
|
+
customColoredColorizer.colors = availableColors;
|
|
801
|
+
customColoredColorizer.message = customColoredColorizer.message || customColored.message;
|
|
802
|
+
customColoredColorizer.property = customColoredColorizer.property || customColored.property;
|
|
803
|
+
customColoredColorizer.greyMessage = customColoredColorizer.greyMessage || customColored.greyMessage;
|
|
804
|
+
return customColoredColorizer;
|
|
805
|
+
}
|
|
806
|
+
module.exports = function getColorizer(useColors = false, customColors, useOnlyCustomProps) {
|
|
807
|
+
if (useColors && customColors !== void 0) {
|
|
808
|
+
return customColoredColorizerFactory(customColors, useOnlyCustomProps);
|
|
809
|
+
} else if (useColors) {
|
|
810
|
+
return coloredColorizer(useOnlyCustomProps);
|
|
811
|
+
}
|
|
812
|
+
return plainColorizer(useOnlyCustomProps);
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
|
|
817
|
+
// ../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js
|
|
818
|
+
var require_atomic_sleep = __commonJS({
|
|
819
|
+
"../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js"(exports, module) {
|
|
820
|
+
"use strict";
|
|
821
|
+
if (typeof SharedArrayBuffer !== "undefined" && typeof Atomics !== "undefined") {
|
|
822
|
+
let sleep = function(ms) {
|
|
823
|
+
const valid = ms > 0 && ms < Infinity;
|
|
824
|
+
if (valid === false) {
|
|
825
|
+
if (typeof ms !== "number" && typeof ms !== "bigint") {
|
|
826
|
+
throw TypeError("sleep: ms must be a number");
|
|
827
|
+
}
|
|
828
|
+
throw RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");
|
|
829
|
+
}
|
|
830
|
+
Atomics.wait(nil, 0, 0, Number(ms));
|
|
831
|
+
};
|
|
832
|
+
const nil = new Int32Array(new SharedArrayBuffer(4));
|
|
833
|
+
module.exports = sleep;
|
|
834
|
+
} else {
|
|
835
|
+
let sleep = function(ms) {
|
|
836
|
+
const valid = ms > 0 && ms < Infinity;
|
|
837
|
+
if (valid === false) {
|
|
838
|
+
if (typeof ms !== "number" && typeof ms !== "bigint") {
|
|
839
|
+
throw TypeError("sleep: ms must be a number");
|
|
840
|
+
}
|
|
841
|
+
throw RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");
|
|
842
|
+
}
|
|
843
|
+
const target = Date.now() + Number(ms);
|
|
844
|
+
while (target > Date.now()) {
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
module.exports = sleep;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
// ../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js
|
|
853
|
+
var require_sonic_boom = __commonJS({
|
|
854
|
+
"../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js"(exports, module) {
|
|
855
|
+
"use strict";
|
|
856
|
+
var fs = __require("fs");
|
|
857
|
+
var EventEmitter = __require("events");
|
|
858
|
+
var inherits = __require("util").inherits;
|
|
859
|
+
var path = __require("path");
|
|
860
|
+
var sleep = require_atomic_sleep();
|
|
861
|
+
var assert = __require("assert");
|
|
862
|
+
var BUSY_WRITE_TIMEOUT = 100;
|
|
863
|
+
var kEmptyBuffer = Buffer.allocUnsafe(0);
|
|
864
|
+
var MAX_WRITE = 16 * 1024;
|
|
865
|
+
var kContentModeBuffer = "buffer";
|
|
866
|
+
var kContentModeUtf8 = "utf8";
|
|
867
|
+
var [major, minor] = (process.versions.node || "0.0").split(".").map(Number);
|
|
868
|
+
var kCopyBuffer = major >= 22 && minor >= 7;
|
|
869
|
+
function openFile(file, sonic) {
|
|
870
|
+
sonic._opening = true;
|
|
871
|
+
sonic._writing = true;
|
|
872
|
+
sonic._asyncDrainScheduled = false;
|
|
873
|
+
function fileOpened(err, fd) {
|
|
874
|
+
if (err) {
|
|
875
|
+
sonic._reopening = false;
|
|
876
|
+
sonic._writing = false;
|
|
877
|
+
sonic._opening = false;
|
|
878
|
+
if (sonic.sync) {
|
|
879
|
+
process.nextTick(() => {
|
|
880
|
+
if (sonic.listenerCount("error") > 0) {
|
|
881
|
+
sonic.emit("error", err);
|
|
882
|
+
}
|
|
883
|
+
});
|
|
884
|
+
} else {
|
|
885
|
+
sonic.emit("error", err);
|
|
886
|
+
}
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
const reopening = sonic._reopening;
|
|
890
|
+
sonic.fd = fd;
|
|
891
|
+
sonic.file = file;
|
|
892
|
+
sonic._reopening = false;
|
|
893
|
+
sonic._opening = false;
|
|
894
|
+
sonic._writing = false;
|
|
895
|
+
if (sonic.sync) {
|
|
896
|
+
process.nextTick(() => sonic.emit("ready"));
|
|
897
|
+
} else {
|
|
898
|
+
sonic.emit("ready");
|
|
899
|
+
}
|
|
900
|
+
if (sonic.destroyed) {
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
if (!sonic._writing && sonic._len > sonic.minLength || sonic._flushPending) {
|
|
904
|
+
sonic._actualWrite();
|
|
905
|
+
} else if (reopening) {
|
|
906
|
+
process.nextTick(() => sonic.emit("drain"));
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
const flags = sonic.append ? "a" : "w";
|
|
910
|
+
const mode = sonic.mode;
|
|
911
|
+
if (sonic.sync) {
|
|
912
|
+
try {
|
|
913
|
+
if (sonic.mkdir) fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
914
|
+
const fd = fs.openSync(file, flags, mode);
|
|
915
|
+
fileOpened(null, fd);
|
|
916
|
+
} catch (err) {
|
|
917
|
+
fileOpened(err);
|
|
918
|
+
throw err;
|
|
919
|
+
}
|
|
920
|
+
} else if (sonic.mkdir) {
|
|
921
|
+
fs.mkdir(path.dirname(file), { recursive: true }, (err) => {
|
|
922
|
+
if (err) return fileOpened(err);
|
|
923
|
+
fs.open(file, flags, mode, fileOpened);
|
|
924
|
+
});
|
|
925
|
+
} else {
|
|
926
|
+
fs.open(file, flags, mode, fileOpened);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
function SonicBoom(opts) {
|
|
930
|
+
if (!(this instanceof SonicBoom)) {
|
|
931
|
+
return new SonicBoom(opts);
|
|
932
|
+
}
|
|
933
|
+
let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir, retryEAGAIN, fsync, contentMode, mode } = opts || {};
|
|
934
|
+
fd = fd || dest;
|
|
935
|
+
this._len = 0;
|
|
936
|
+
this.fd = -1;
|
|
937
|
+
this._bufs = [];
|
|
938
|
+
this._lens = [];
|
|
939
|
+
this._writing = false;
|
|
940
|
+
this._ending = false;
|
|
941
|
+
this._reopening = false;
|
|
942
|
+
this._asyncDrainScheduled = false;
|
|
943
|
+
this._flushPending = false;
|
|
944
|
+
this._hwm = Math.max(minLength || 0, 16387);
|
|
945
|
+
this.file = null;
|
|
946
|
+
this.destroyed = false;
|
|
947
|
+
this.minLength = minLength || 0;
|
|
948
|
+
this.maxLength = maxLength || 0;
|
|
949
|
+
this.maxWrite = maxWrite || MAX_WRITE;
|
|
950
|
+
this._periodicFlush = periodicFlush || 0;
|
|
951
|
+
this._periodicFlushTimer = void 0;
|
|
952
|
+
this.sync = sync || false;
|
|
953
|
+
this.writable = true;
|
|
954
|
+
this._fsync = fsync || false;
|
|
955
|
+
this.append = append || false;
|
|
956
|
+
this.mode = mode;
|
|
957
|
+
this.retryEAGAIN = retryEAGAIN || (() => true);
|
|
958
|
+
this.mkdir = mkdir || false;
|
|
959
|
+
let fsWriteSync;
|
|
960
|
+
let fsWrite;
|
|
961
|
+
if (contentMode === kContentModeBuffer) {
|
|
962
|
+
this._writingBuf = kEmptyBuffer;
|
|
963
|
+
this.write = writeBuffer;
|
|
964
|
+
this.flush = flushBuffer;
|
|
965
|
+
this.flushSync = flushBufferSync;
|
|
966
|
+
this._actualWrite = actualWriteBuffer;
|
|
967
|
+
fsWriteSync = () => fs.writeSync(this.fd, this._writingBuf);
|
|
968
|
+
fsWrite = () => fs.write(this.fd, this._writingBuf, this.release);
|
|
969
|
+
} else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
|
|
970
|
+
this._writingBuf = "";
|
|
971
|
+
this.write = write;
|
|
972
|
+
this.flush = flush;
|
|
973
|
+
this.flushSync = flushSync;
|
|
974
|
+
this._actualWrite = actualWrite;
|
|
975
|
+
fsWriteSync = () => {
|
|
976
|
+
if (Buffer.isBuffer(this._writingBuf)) {
|
|
977
|
+
return fs.writeSync(this.fd, this._writingBuf);
|
|
978
|
+
}
|
|
979
|
+
return fs.writeSync(this.fd, this._writingBuf, "utf8");
|
|
980
|
+
};
|
|
981
|
+
fsWrite = () => {
|
|
982
|
+
if (Buffer.isBuffer(this._writingBuf)) {
|
|
983
|
+
return fs.write(this.fd, this._writingBuf, this.release);
|
|
984
|
+
}
|
|
985
|
+
return fs.write(this.fd, this._writingBuf, "utf8", this.release);
|
|
986
|
+
};
|
|
987
|
+
} else {
|
|
988
|
+
throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
|
|
989
|
+
}
|
|
990
|
+
if (typeof fd === "number") {
|
|
991
|
+
this.fd = fd;
|
|
992
|
+
process.nextTick(() => this.emit("ready"));
|
|
993
|
+
} else if (typeof fd === "string") {
|
|
994
|
+
openFile(fd, this);
|
|
995
|
+
} else {
|
|
996
|
+
throw new Error("SonicBoom supports only file descriptors and files");
|
|
997
|
+
}
|
|
998
|
+
if (this.minLength >= this.maxWrite) {
|
|
999
|
+
throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);
|
|
1000
|
+
}
|
|
1001
|
+
this.release = (err, n) => {
|
|
1002
|
+
if (err) {
|
|
1003
|
+
if ((err.code === "EAGAIN" || err.code === "EBUSY") && this.retryEAGAIN(err, this._writingBuf.length, this._len - this._writingBuf.length)) {
|
|
1004
|
+
if (this.sync) {
|
|
1005
|
+
try {
|
|
1006
|
+
sleep(BUSY_WRITE_TIMEOUT);
|
|
1007
|
+
this.release(void 0, 0);
|
|
1008
|
+
} catch (err2) {
|
|
1009
|
+
this.release(err2);
|
|
1010
|
+
}
|
|
1011
|
+
} else {
|
|
1012
|
+
setTimeout(fsWrite, BUSY_WRITE_TIMEOUT);
|
|
1013
|
+
}
|
|
1014
|
+
} else {
|
|
1015
|
+
this._writing = false;
|
|
1016
|
+
this.emit("error", err);
|
|
1017
|
+
}
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
this.emit("write", n);
|
|
1021
|
+
const releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n);
|
|
1022
|
+
this._len = releasedBufObj.len;
|
|
1023
|
+
this._writingBuf = releasedBufObj.writingBuf;
|
|
1024
|
+
if (this._writingBuf.length) {
|
|
1025
|
+
if (!this.sync) {
|
|
1026
|
+
fsWrite();
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
try {
|
|
1030
|
+
do {
|
|
1031
|
+
const n2 = fsWriteSync();
|
|
1032
|
+
const releasedBufObj2 = releaseWritingBuf(this._writingBuf, this._len, n2);
|
|
1033
|
+
this._len = releasedBufObj2.len;
|
|
1034
|
+
this._writingBuf = releasedBufObj2.writingBuf;
|
|
1035
|
+
} while (this._writingBuf.length);
|
|
1036
|
+
} catch (err2) {
|
|
1037
|
+
this.release(err2);
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
if (this._fsync) {
|
|
1042
|
+
fs.fsyncSync(this.fd);
|
|
1043
|
+
}
|
|
1044
|
+
const len = this._len;
|
|
1045
|
+
if (this._reopening) {
|
|
1046
|
+
this._writing = false;
|
|
1047
|
+
this._reopening = false;
|
|
1048
|
+
this.reopen();
|
|
1049
|
+
} else if (len > this.minLength) {
|
|
1050
|
+
this._actualWrite();
|
|
1051
|
+
} else if (this._ending) {
|
|
1052
|
+
if (len > 0) {
|
|
1053
|
+
this._actualWrite();
|
|
1054
|
+
} else {
|
|
1055
|
+
this._writing = false;
|
|
1056
|
+
actualClose(this);
|
|
1057
|
+
}
|
|
1058
|
+
} else {
|
|
1059
|
+
this._writing = false;
|
|
1060
|
+
if (this.sync) {
|
|
1061
|
+
if (!this._asyncDrainScheduled) {
|
|
1062
|
+
this._asyncDrainScheduled = true;
|
|
1063
|
+
process.nextTick(emitDrain, this);
|
|
1064
|
+
}
|
|
1065
|
+
} else {
|
|
1066
|
+
this.emit("drain");
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
this.on("newListener", function(name) {
|
|
1071
|
+
if (name === "drain") {
|
|
1072
|
+
this._asyncDrainScheduled = false;
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
if (this._periodicFlush !== 0) {
|
|
1076
|
+
this._periodicFlushTimer = setInterval(() => this.flush(null), this._periodicFlush);
|
|
1077
|
+
this._periodicFlushTimer.unref();
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function releaseWritingBuf(writingBuf, len, n) {
|
|
1081
|
+
if (typeof writingBuf === "string") {
|
|
1082
|
+
writingBuf = Buffer.from(writingBuf);
|
|
1083
|
+
}
|
|
1084
|
+
len = Math.max(len - n, 0);
|
|
1085
|
+
writingBuf = writingBuf.subarray(n);
|
|
1086
|
+
return { writingBuf, len };
|
|
1087
|
+
}
|
|
1088
|
+
function emitDrain(sonic) {
|
|
1089
|
+
const hasListeners = sonic.listenerCount("drain") > 0;
|
|
1090
|
+
if (!hasListeners) return;
|
|
1091
|
+
sonic._asyncDrainScheduled = false;
|
|
1092
|
+
sonic.emit("drain");
|
|
1093
|
+
}
|
|
1094
|
+
inherits(SonicBoom, EventEmitter);
|
|
1095
|
+
function mergeBuf(bufs, len) {
|
|
1096
|
+
if (bufs.length === 0) {
|
|
1097
|
+
return kEmptyBuffer;
|
|
1098
|
+
}
|
|
1099
|
+
if (bufs.length === 1) {
|
|
1100
|
+
return bufs[0];
|
|
1101
|
+
}
|
|
1102
|
+
return Buffer.concat(bufs, len);
|
|
1103
|
+
}
|
|
1104
|
+
function write(data) {
|
|
1105
|
+
if (this.destroyed) {
|
|
1106
|
+
throw new Error("SonicBoom destroyed");
|
|
1107
|
+
}
|
|
1108
|
+
data = "" + data;
|
|
1109
|
+
const dataLen = Buffer.byteLength(data);
|
|
1110
|
+
const len = this._len + dataLen;
|
|
1111
|
+
const bufs = this._bufs;
|
|
1112
|
+
if (this.maxLength && len > this.maxLength) {
|
|
1113
|
+
this.emit("drop", data);
|
|
1114
|
+
return this._len < this._hwm;
|
|
1115
|
+
}
|
|
1116
|
+
if (bufs.length === 0 || Buffer.byteLength(bufs[bufs.length - 1]) + dataLen > this.maxWrite) {
|
|
1117
|
+
bufs.push(data);
|
|
1118
|
+
} else {
|
|
1119
|
+
bufs[bufs.length - 1] += data;
|
|
1120
|
+
}
|
|
1121
|
+
this._len = len;
|
|
1122
|
+
if (!this._writing && this._len >= this.minLength) {
|
|
1123
|
+
this._actualWrite();
|
|
1124
|
+
}
|
|
1125
|
+
return this._len < this._hwm;
|
|
1126
|
+
}
|
|
1127
|
+
function writeBuffer(data) {
|
|
1128
|
+
if (this.destroyed) {
|
|
1129
|
+
throw new Error("SonicBoom destroyed");
|
|
1130
|
+
}
|
|
1131
|
+
const len = this._len + data.length;
|
|
1132
|
+
const bufs = this._bufs;
|
|
1133
|
+
const lens = this._lens;
|
|
1134
|
+
if (this.maxLength && len > this.maxLength) {
|
|
1135
|
+
this.emit("drop", data);
|
|
1136
|
+
return this._len < this._hwm;
|
|
1137
|
+
}
|
|
1138
|
+
if (bufs.length === 0 || lens[lens.length - 1] + data.length > this.maxWrite) {
|
|
1139
|
+
bufs.push([data]);
|
|
1140
|
+
lens.push(data.length);
|
|
1141
|
+
} else {
|
|
1142
|
+
bufs[bufs.length - 1].push(data);
|
|
1143
|
+
lens[lens.length - 1] += data.length;
|
|
1144
|
+
}
|
|
1145
|
+
this._len = len;
|
|
1146
|
+
if (!this._writing && this._len >= this.minLength) {
|
|
1147
|
+
this._actualWrite();
|
|
1148
|
+
}
|
|
1149
|
+
return this._len < this._hwm;
|
|
1150
|
+
}
|
|
1151
|
+
function callFlushCallbackOnDrain(cb) {
|
|
1152
|
+
this._flushPending = true;
|
|
1153
|
+
const onDrain = () => {
|
|
1154
|
+
if (!this._fsync) {
|
|
1155
|
+
try {
|
|
1156
|
+
fs.fsync(this.fd, (err) => {
|
|
1157
|
+
this._flushPending = false;
|
|
1158
|
+
cb(err);
|
|
1159
|
+
});
|
|
1160
|
+
} catch (err) {
|
|
1161
|
+
cb(err);
|
|
1162
|
+
}
|
|
1163
|
+
} else {
|
|
1164
|
+
this._flushPending = false;
|
|
1165
|
+
cb();
|
|
1166
|
+
}
|
|
1167
|
+
this.off("error", onError);
|
|
1168
|
+
};
|
|
1169
|
+
const onError = (err) => {
|
|
1170
|
+
this._flushPending = false;
|
|
1171
|
+
cb(err);
|
|
1172
|
+
this.off("drain", onDrain);
|
|
1173
|
+
};
|
|
1174
|
+
this.once("drain", onDrain);
|
|
1175
|
+
this.once("error", onError);
|
|
1176
|
+
}
|
|
1177
|
+
function flush(cb) {
|
|
1178
|
+
if (cb != null && typeof cb !== "function") {
|
|
1179
|
+
throw new Error("flush cb must be a function");
|
|
1180
|
+
}
|
|
1181
|
+
if (this.destroyed) {
|
|
1182
|
+
const error = new Error("SonicBoom destroyed");
|
|
1183
|
+
if (cb) {
|
|
1184
|
+
cb(error);
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
throw error;
|
|
1188
|
+
}
|
|
1189
|
+
if (this.minLength <= 0) {
|
|
1190
|
+
cb?.();
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
if (cb) {
|
|
1194
|
+
callFlushCallbackOnDrain.call(this, cb);
|
|
1195
|
+
}
|
|
1196
|
+
if (this._writing) {
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
if (this._bufs.length === 0) {
|
|
1200
|
+
this._bufs.push("");
|
|
1201
|
+
}
|
|
1202
|
+
this._actualWrite();
|
|
1203
|
+
}
|
|
1204
|
+
function flushBuffer(cb) {
|
|
1205
|
+
if (cb != null && typeof cb !== "function") {
|
|
1206
|
+
throw new Error("flush cb must be a function");
|
|
1207
|
+
}
|
|
1208
|
+
if (this.destroyed) {
|
|
1209
|
+
const error = new Error("SonicBoom destroyed");
|
|
1210
|
+
if (cb) {
|
|
1211
|
+
cb(error);
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
throw error;
|
|
1215
|
+
}
|
|
1216
|
+
if (this.minLength <= 0) {
|
|
1217
|
+
cb?.();
|
|
1218
|
+
return;
|
|
1219
|
+
}
|
|
1220
|
+
if (cb) {
|
|
1221
|
+
callFlushCallbackOnDrain.call(this, cb);
|
|
1222
|
+
}
|
|
1223
|
+
if (this._writing) {
|
|
1224
|
+
return;
|
|
1225
|
+
}
|
|
1226
|
+
if (this._bufs.length === 0) {
|
|
1227
|
+
this._bufs.push([]);
|
|
1228
|
+
this._lens.push(0);
|
|
1229
|
+
}
|
|
1230
|
+
this._actualWrite();
|
|
1231
|
+
}
|
|
1232
|
+
SonicBoom.prototype.reopen = function(file) {
|
|
1233
|
+
if (this.destroyed) {
|
|
1234
|
+
throw new Error("SonicBoom destroyed");
|
|
1235
|
+
}
|
|
1236
|
+
if (this._opening) {
|
|
1237
|
+
this.once("ready", () => {
|
|
1238
|
+
this.reopen(file);
|
|
1239
|
+
});
|
|
1240
|
+
return;
|
|
1241
|
+
}
|
|
1242
|
+
if (this._ending) {
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
if (!this.file) {
|
|
1246
|
+
throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");
|
|
1247
|
+
}
|
|
1248
|
+
if (file) {
|
|
1249
|
+
this.file = file;
|
|
1250
|
+
}
|
|
1251
|
+
this._reopening = true;
|
|
1252
|
+
if (this._writing) {
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
const fd = this.fd;
|
|
1256
|
+
this.once("ready", () => {
|
|
1257
|
+
if (fd !== this.fd) {
|
|
1258
|
+
fs.close(fd, (err) => {
|
|
1259
|
+
if (err) {
|
|
1260
|
+
return this.emit("error", err);
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
openFile(this.file, this);
|
|
1266
|
+
};
|
|
1267
|
+
SonicBoom.prototype.end = function() {
|
|
1268
|
+
if (this.destroyed) {
|
|
1269
|
+
throw new Error("SonicBoom destroyed");
|
|
1270
|
+
}
|
|
1271
|
+
if (this._opening) {
|
|
1272
|
+
this.once("ready", () => {
|
|
1273
|
+
this.end();
|
|
1274
|
+
});
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
if (this._ending) {
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
this._ending = true;
|
|
1281
|
+
if (this._writing) {
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
if (this._len > 0 && this.fd >= 0) {
|
|
1285
|
+
this._actualWrite();
|
|
1286
|
+
} else {
|
|
1287
|
+
actualClose(this);
|
|
1288
|
+
}
|
|
1289
|
+
};
|
|
1290
|
+
function flushSync() {
|
|
1291
|
+
if (this.destroyed) {
|
|
1292
|
+
throw new Error("SonicBoom destroyed");
|
|
1293
|
+
}
|
|
1294
|
+
if (this.fd < 0) {
|
|
1295
|
+
throw new Error("sonic boom is not ready yet");
|
|
1296
|
+
}
|
|
1297
|
+
if (!this._writing && this._writingBuf.length > 0) {
|
|
1298
|
+
this._bufs.unshift(this._writingBuf);
|
|
1299
|
+
this._writingBuf = "";
|
|
1300
|
+
}
|
|
1301
|
+
let buf = "";
|
|
1302
|
+
while (this._bufs.length || buf.length) {
|
|
1303
|
+
if (buf.length <= 0) {
|
|
1304
|
+
buf = this._bufs[0];
|
|
1305
|
+
}
|
|
1306
|
+
try {
|
|
1307
|
+
const n = Buffer.isBuffer(buf) ? fs.writeSync(this.fd, buf) : fs.writeSync(this.fd, buf, "utf8");
|
|
1308
|
+
const releasedBufObj = releaseWritingBuf(buf, this._len, n);
|
|
1309
|
+
buf = releasedBufObj.writingBuf;
|
|
1310
|
+
this._len = releasedBufObj.len;
|
|
1311
|
+
if (buf.length <= 0) {
|
|
1312
|
+
this._bufs.shift();
|
|
1313
|
+
}
|
|
1314
|
+
} catch (err) {
|
|
1315
|
+
const shouldRetry = err.code === "EAGAIN" || err.code === "EBUSY";
|
|
1316
|
+
if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
|
|
1317
|
+
throw err;
|
|
1318
|
+
}
|
|
1319
|
+
sleep(BUSY_WRITE_TIMEOUT);
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
try {
|
|
1323
|
+
fs.fsyncSync(this.fd);
|
|
1324
|
+
} catch {
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
function flushBufferSync() {
|
|
1328
|
+
if (this.destroyed) {
|
|
1329
|
+
throw new Error("SonicBoom destroyed");
|
|
1330
|
+
}
|
|
1331
|
+
if (this.fd < 0) {
|
|
1332
|
+
throw new Error("sonic boom is not ready yet");
|
|
1333
|
+
}
|
|
1334
|
+
if (!this._writing && this._writingBuf.length > 0) {
|
|
1335
|
+
this._bufs.unshift([this._writingBuf]);
|
|
1336
|
+
this._writingBuf = kEmptyBuffer;
|
|
1337
|
+
}
|
|
1338
|
+
let buf = kEmptyBuffer;
|
|
1339
|
+
while (this._bufs.length || buf.length) {
|
|
1340
|
+
if (buf.length <= 0) {
|
|
1341
|
+
buf = mergeBuf(this._bufs[0], this._lens[0]);
|
|
1342
|
+
}
|
|
1343
|
+
try {
|
|
1344
|
+
const n = fs.writeSync(this.fd, buf);
|
|
1345
|
+
buf = buf.subarray(n);
|
|
1346
|
+
this._len = Math.max(this._len - n, 0);
|
|
1347
|
+
if (buf.length <= 0) {
|
|
1348
|
+
this._bufs.shift();
|
|
1349
|
+
this._lens.shift();
|
|
1350
|
+
}
|
|
1351
|
+
} catch (err) {
|
|
1352
|
+
const shouldRetry = err.code === "EAGAIN" || err.code === "EBUSY";
|
|
1353
|
+
if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
|
|
1354
|
+
throw err;
|
|
1355
|
+
}
|
|
1356
|
+
sleep(BUSY_WRITE_TIMEOUT);
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
SonicBoom.prototype.destroy = function() {
|
|
1361
|
+
if (this.destroyed) {
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1364
|
+
actualClose(this);
|
|
1365
|
+
};
|
|
1366
|
+
function actualWrite() {
|
|
1367
|
+
const release = this.release;
|
|
1368
|
+
this._writing = true;
|
|
1369
|
+
this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
|
|
1370
|
+
if (this.sync) {
|
|
1371
|
+
try {
|
|
1372
|
+
const written = Buffer.isBuffer(this._writingBuf) ? fs.writeSync(this.fd, this._writingBuf) : fs.writeSync(this.fd, this._writingBuf, "utf8");
|
|
1373
|
+
release(null, written);
|
|
1374
|
+
} catch (err) {
|
|
1375
|
+
release(err);
|
|
1376
|
+
}
|
|
1377
|
+
} else {
|
|
1378
|
+
fs.write(this.fd, this._writingBuf, release);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
function actualWriteBuffer() {
|
|
1382
|
+
const release = this.release;
|
|
1383
|
+
this._writing = true;
|
|
1384
|
+
this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
|
|
1385
|
+
if (this.sync) {
|
|
1386
|
+
try {
|
|
1387
|
+
const written = fs.writeSync(this.fd, this._writingBuf);
|
|
1388
|
+
release(null, written);
|
|
1389
|
+
} catch (err) {
|
|
1390
|
+
release(err);
|
|
1391
|
+
}
|
|
1392
|
+
} else {
|
|
1393
|
+
if (kCopyBuffer) {
|
|
1394
|
+
this._writingBuf = Buffer.from(this._writingBuf);
|
|
1395
|
+
}
|
|
1396
|
+
fs.write(this.fd, this._writingBuf, release);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
function actualClose(sonic) {
|
|
1400
|
+
if (sonic.fd === -1) {
|
|
1401
|
+
sonic.once("ready", actualClose.bind(null, sonic));
|
|
1402
|
+
return;
|
|
1403
|
+
}
|
|
1404
|
+
if (sonic._periodicFlushTimer !== void 0) {
|
|
1405
|
+
clearInterval(sonic._periodicFlushTimer);
|
|
1406
|
+
}
|
|
1407
|
+
sonic.destroyed = true;
|
|
1408
|
+
sonic._bufs = [];
|
|
1409
|
+
sonic._lens = [];
|
|
1410
|
+
assert(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
|
|
1411
|
+
try {
|
|
1412
|
+
fs.fsync(sonic.fd, closeWrapped);
|
|
1413
|
+
} catch {
|
|
1414
|
+
}
|
|
1415
|
+
function closeWrapped() {
|
|
1416
|
+
if (sonic.fd !== 1 && sonic.fd !== 2) {
|
|
1417
|
+
fs.close(sonic.fd, done);
|
|
1418
|
+
} else {
|
|
1419
|
+
done();
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
function done(err) {
|
|
1423
|
+
if (err) {
|
|
1424
|
+
sonic.emit("error", err);
|
|
1425
|
+
return;
|
|
1426
|
+
}
|
|
1427
|
+
if (sonic._ending && !sonic._writing) {
|
|
1428
|
+
sonic.emit("finish");
|
|
1429
|
+
}
|
|
1430
|
+
sonic.emit("close");
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
SonicBoom.SonicBoom = SonicBoom;
|
|
1434
|
+
SonicBoom.default = SonicBoom;
|
|
1435
|
+
module.exports = SonicBoom;
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
|
|
1439
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/noop.js
|
|
1440
|
+
var require_noop = __commonJS({
|
|
1441
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/noop.js"(exports, module) {
|
|
1442
|
+
"use strict";
|
|
1443
|
+
module.exports = function noop() {
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
});
|
|
1447
|
+
|
|
1448
|
+
// ../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js
|
|
1449
|
+
var require_on_exit_leak_free = __commonJS({
|
|
1450
|
+
"../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js"(exports, module) {
|
|
1451
|
+
"use strict";
|
|
1452
|
+
var refs = {
|
|
1453
|
+
exit: [],
|
|
1454
|
+
beforeExit: []
|
|
1455
|
+
};
|
|
1456
|
+
var functions = {
|
|
1457
|
+
exit: onExit,
|
|
1458
|
+
beforeExit: onBeforeExit
|
|
1459
|
+
};
|
|
1460
|
+
var registry;
|
|
1461
|
+
function ensureRegistry() {
|
|
1462
|
+
if (registry === void 0) {
|
|
1463
|
+
registry = new FinalizationRegistry(clear);
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
function install(event) {
|
|
1467
|
+
if (refs[event].length > 0) {
|
|
1468
|
+
return;
|
|
1469
|
+
}
|
|
1470
|
+
process.on(event, functions[event]);
|
|
1471
|
+
}
|
|
1472
|
+
function uninstall(event) {
|
|
1473
|
+
if (refs[event].length > 0) {
|
|
1474
|
+
return;
|
|
1475
|
+
}
|
|
1476
|
+
process.removeListener(event, functions[event]);
|
|
1477
|
+
if (refs.exit.length === 0 && refs.beforeExit.length === 0) {
|
|
1478
|
+
registry = void 0;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
function onExit() {
|
|
1482
|
+
callRefs("exit");
|
|
1483
|
+
}
|
|
1484
|
+
function onBeforeExit() {
|
|
1485
|
+
callRefs("beforeExit");
|
|
1486
|
+
}
|
|
1487
|
+
function callRefs(event) {
|
|
1488
|
+
for (const ref of refs[event]) {
|
|
1489
|
+
const obj = ref.deref();
|
|
1490
|
+
const fn = ref.fn;
|
|
1491
|
+
if (obj !== void 0) {
|
|
1492
|
+
fn(obj, event);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
refs[event] = [];
|
|
1496
|
+
}
|
|
1497
|
+
function clear(ref) {
|
|
1498
|
+
for (const event of ["exit", "beforeExit"]) {
|
|
1499
|
+
const index = refs[event].indexOf(ref);
|
|
1500
|
+
refs[event].splice(index, index + 1);
|
|
1501
|
+
uninstall(event);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
function _register(event, obj, fn) {
|
|
1505
|
+
if (obj === void 0) {
|
|
1506
|
+
throw new Error("the object can't be undefined");
|
|
1507
|
+
}
|
|
1508
|
+
install(event);
|
|
1509
|
+
const ref = new WeakRef(obj);
|
|
1510
|
+
ref.fn = fn;
|
|
1511
|
+
ensureRegistry();
|
|
1512
|
+
registry.register(obj, ref);
|
|
1513
|
+
refs[event].push(ref);
|
|
1514
|
+
}
|
|
1515
|
+
function register(obj, fn) {
|
|
1516
|
+
_register("exit", obj, fn);
|
|
1517
|
+
}
|
|
1518
|
+
function registerBeforeExit(obj, fn) {
|
|
1519
|
+
_register("beforeExit", obj, fn);
|
|
1520
|
+
}
|
|
1521
|
+
function unregister(obj) {
|
|
1522
|
+
if (registry === void 0) {
|
|
1523
|
+
return;
|
|
1524
|
+
}
|
|
1525
|
+
registry.unregister(obj);
|
|
1526
|
+
for (const event of ["exit", "beforeExit"]) {
|
|
1527
|
+
refs[event] = refs[event].filter((ref) => {
|
|
1528
|
+
const _obj = ref.deref();
|
|
1529
|
+
return _obj && _obj !== obj;
|
|
1530
|
+
});
|
|
1531
|
+
uninstall(event);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
module.exports = {
|
|
1535
|
+
register,
|
|
1536
|
+
registerBeforeExit,
|
|
1537
|
+
unregister
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
|
|
1542
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js
|
|
1543
|
+
var require_build_safe_sonic_boom = __commonJS({
|
|
1544
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js"(exports, module) {
|
|
1545
|
+
"use strict";
|
|
1546
|
+
module.exports = buildSafeSonicBoom;
|
|
1547
|
+
var { isMainThread } = __require("node:worker_threads");
|
|
1548
|
+
var SonicBoom = require_sonic_boom();
|
|
1549
|
+
var noop = require_noop();
|
|
1550
|
+
function buildSafeSonicBoom(opts) {
|
|
1551
|
+
const stream = new SonicBoom(opts);
|
|
1552
|
+
stream.on("error", filterBrokenPipe);
|
|
1553
|
+
if (!opts.sync && isMainThread) {
|
|
1554
|
+
setupOnExit(stream);
|
|
1555
|
+
}
|
|
1556
|
+
return stream;
|
|
1557
|
+
function filterBrokenPipe(err) {
|
|
1558
|
+
if (err.code === "EPIPE") {
|
|
1559
|
+
stream.write = noop;
|
|
1560
|
+
stream.end = noop;
|
|
1561
|
+
stream.flushSync = noop;
|
|
1562
|
+
stream.destroy = noop;
|
|
1563
|
+
return;
|
|
1564
|
+
}
|
|
1565
|
+
stream.removeListener("error", filterBrokenPipe);
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
function setupOnExit(stream) {
|
|
1569
|
+
if (global.WeakRef && global.WeakMap && global.FinalizationRegistry) {
|
|
1570
|
+
const onExit = require_on_exit_leak_free();
|
|
1571
|
+
onExit.register(stream, autoEnd);
|
|
1572
|
+
stream.on("close", function() {
|
|
1573
|
+
onExit.unregister(stream);
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
function autoEnd(stream, eventName) {
|
|
1578
|
+
if (stream.destroyed) {
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
if (eventName === "beforeExit") {
|
|
1582
|
+
stream.flush();
|
|
1583
|
+
stream.on("drain", function() {
|
|
1584
|
+
stream.end();
|
|
1585
|
+
});
|
|
1586
|
+
} else {
|
|
1587
|
+
stream.flushSync();
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
});
|
|
1592
|
+
|
|
1593
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/is-valid-date.js
|
|
1594
|
+
var require_is_valid_date = __commonJS({
|
|
1595
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/is-valid-date.js"(exports, module) {
|
|
1596
|
+
"use strict";
|
|
1597
|
+
module.exports = isValidDate;
|
|
1598
|
+
function isValidDate(date) {
|
|
1599
|
+
return date instanceof Date && !Number.isNaN(date.getTime());
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
});
|
|
1603
|
+
|
|
1604
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/create-date.js
|
|
1605
|
+
var require_create_date = __commonJS({
|
|
1606
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/create-date.js"(exports, module) {
|
|
1607
|
+
"use strict";
|
|
1608
|
+
module.exports = createDate;
|
|
1609
|
+
var isValidDate = require_is_valid_date();
|
|
1610
|
+
function createDate(epoch) {
|
|
1611
|
+
let date = new Date(epoch);
|
|
1612
|
+
if (isValidDate(date)) {
|
|
1613
|
+
return date;
|
|
1614
|
+
}
|
|
1615
|
+
date = /* @__PURE__ */ new Date(+epoch);
|
|
1616
|
+
return date;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
|
|
1621
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/split-property-key.js
|
|
1622
|
+
var require_split_property_key = __commonJS({
|
|
1623
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/split-property-key.js"(exports, module) {
|
|
1624
|
+
"use strict";
|
|
1625
|
+
module.exports = splitPropertyKey;
|
|
1626
|
+
function splitPropertyKey(key) {
|
|
1627
|
+
const result = [];
|
|
1628
|
+
let backslash = false;
|
|
1629
|
+
let segment = "";
|
|
1630
|
+
for (let i = 0; i < key.length; i++) {
|
|
1631
|
+
const c = key.charAt(i);
|
|
1632
|
+
if (c === "\\") {
|
|
1633
|
+
backslash = true;
|
|
1634
|
+
continue;
|
|
1635
|
+
}
|
|
1636
|
+
if (backslash) {
|
|
1637
|
+
backslash = false;
|
|
1638
|
+
segment += c;
|
|
1639
|
+
continue;
|
|
1640
|
+
}
|
|
1641
|
+
if (c === ".") {
|
|
1642
|
+
result.push(segment);
|
|
1643
|
+
segment = "";
|
|
1644
|
+
continue;
|
|
1645
|
+
}
|
|
1646
|
+
segment += c;
|
|
1647
|
+
}
|
|
1648
|
+
if (segment.length) {
|
|
1649
|
+
result.push(segment);
|
|
1650
|
+
}
|
|
1651
|
+
return result;
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
});
|
|
1655
|
+
|
|
1656
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/get-property-value.js
|
|
1657
|
+
var require_get_property_value = __commonJS({
|
|
1658
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/get-property-value.js"(exports, module) {
|
|
1659
|
+
"use strict";
|
|
1660
|
+
module.exports = getPropertyValue;
|
|
1661
|
+
var splitPropertyKey = require_split_property_key();
|
|
1662
|
+
function getPropertyValue(obj, property) {
|
|
1663
|
+
const props = Array.isArray(property) ? property : splitPropertyKey(property);
|
|
1664
|
+
for (const prop of props) {
|
|
1665
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop)) {
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
obj = obj[prop];
|
|
1669
|
+
}
|
|
1670
|
+
return obj;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
|
|
1675
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/delete-log-property.js
|
|
1676
|
+
var require_delete_log_property = __commonJS({
|
|
1677
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/delete-log-property.js"(exports, module) {
|
|
1678
|
+
"use strict";
|
|
1679
|
+
module.exports = deleteLogProperty;
|
|
1680
|
+
var getPropertyValue = require_get_property_value();
|
|
1681
|
+
var splitPropertyKey = require_split_property_key();
|
|
1682
|
+
function deleteLogProperty(log, property) {
|
|
1683
|
+
const props = splitPropertyKey(property);
|
|
1684
|
+
const propToDelete = props.pop();
|
|
1685
|
+
log = getPropertyValue(log, props);
|
|
1686
|
+
if (log !== null && typeof log === "object" && Object.prototype.hasOwnProperty.call(log, propToDelete)) {
|
|
1687
|
+
delete log[propToDelete];
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
|
|
1693
|
+
// ../../node_modules/.pnpm/fast-copy@4.0.3/node_modules/fast-copy/dist/cjs/index.cjs
|
|
1694
|
+
var require_cjs = __commonJS({
|
|
1695
|
+
"../../node_modules/.pnpm/fast-copy@4.0.3/node_modules/fast-copy/dist/cjs/index.cjs"(exports) {
|
|
1696
|
+
"use strict";
|
|
1697
|
+
var toStringFunction = Function.prototype.toString;
|
|
1698
|
+
var toStringObject = Object.prototype.toString;
|
|
1699
|
+
function getCleanClone(prototype) {
|
|
1700
|
+
if (!prototype) {
|
|
1701
|
+
return /* @__PURE__ */ Object.create(null);
|
|
1702
|
+
}
|
|
1703
|
+
const Constructor = prototype.constructor;
|
|
1704
|
+
if (Constructor === Object) {
|
|
1705
|
+
return prototype === Object.prototype ? {} : Object.create(prototype);
|
|
1706
|
+
}
|
|
1707
|
+
if (Constructor && ~toStringFunction.call(Constructor).indexOf("[native code]")) {
|
|
1708
|
+
try {
|
|
1709
|
+
return new Constructor();
|
|
1710
|
+
} catch (_a) {
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
return Object.create(prototype);
|
|
1714
|
+
}
|
|
1715
|
+
function getTag(value) {
|
|
1716
|
+
const stringTag = value[Symbol.toStringTag];
|
|
1717
|
+
if (stringTag) {
|
|
1718
|
+
return stringTag;
|
|
1719
|
+
}
|
|
1720
|
+
const type = toStringObject.call(value);
|
|
1721
|
+
return type.substring(8, type.length - 1);
|
|
1722
|
+
}
|
|
1723
|
+
var { hasOwnProperty, propertyIsEnumerable } = Object.prototype;
|
|
1724
|
+
function copyOwnDescriptor(original, clone, property, state) {
|
|
1725
|
+
const ownDescriptor = Object.getOwnPropertyDescriptor(original, property) || {
|
|
1726
|
+
configurable: true,
|
|
1727
|
+
enumerable: true,
|
|
1728
|
+
value: original[property],
|
|
1729
|
+
writable: true
|
|
1730
|
+
};
|
|
1731
|
+
const descriptor = ownDescriptor.get || ownDescriptor.set ? ownDescriptor : {
|
|
1732
|
+
configurable: ownDescriptor.configurable,
|
|
1733
|
+
enumerable: ownDescriptor.enumerable,
|
|
1734
|
+
value: state.copier(ownDescriptor.value, state),
|
|
1735
|
+
writable: ownDescriptor.writable
|
|
1736
|
+
};
|
|
1737
|
+
try {
|
|
1738
|
+
Object.defineProperty(clone, property, descriptor);
|
|
1739
|
+
} catch (_a) {
|
|
1740
|
+
clone[property] = descriptor.get ? descriptor.get() : descriptor.value;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
function copyOwnPropertiesStrict(value, clone, state) {
|
|
1744
|
+
const names = Object.getOwnPropertyNames(value);
|
|
1745
|
+
for (let index = 0; index < names.length; ++index) {
|
|
1746
|
+
copyOwnDescriptor(value, clone, names[index], state);
|
|
1747
|
+
}
|
|
1748
|
+
const symbols = Object.getOwnPropertySymbols(value);
|
|
1749
|
+
for (let index = 0; index < symbols.length; ++index) {
|
|
1750
|
+
copyOwnDescriptor(value, clone, symbols[index], state);
|
|
1751
|
+
}
|
|
1752
|
+
return clone;
|
|
1753
|
+
}
|
|
1754
|
+
function copyArrayLoose(array, state) {
|
|
1755
|
+
const clone = new state.Constructor();
|
|
1756
|
+
state.cache.set(array, clone);
|
|
1757
|
+
for (let index = 0; index < array.length; ++index) {
|
|
1758
|
+
clone[index] = state.copier(array[index], state);
|
|
1759
|
+
}
|
|
1760
|
+
return clone;
|
|
1761
|
+
}
|
|
1762
|
+
function copyArrayStrict(array, state) {
|
|
1763
|
+
const clone = new state.Constructor();
|
|
1764
|
+
state.cache.set(array, clone);
|
|
1765
|
+
return copyOwnPropertiesStrict(array, clone, state);
|
|
1766
|
+
}
|
|
1767
|
+
function copyArrayBuffer(arrayBuffer, _state) {
|
|
1768
|
+
return arrayBuffer.slice(0);
|
|
1769
|
+
}
|
|
1770
|
+
function copyBlob(blob, _state) {
|
|
1771
|
+
return blob.slice(0, blob.size, blob.type);
|
|
1772
|
+
}
|
|
1773
|
+
function copyDataView(dataView, state) {
|
|
1774
|
+
return new state.Constructor(copyArrayBuffer(dataView.buffer));
|
|
1775
|
+
}
|
|
1776
|
+
function copyDate(date, state) {
|
|
1777
|
+
return new state.Constructor(date.getTime());
|
|
1778
|
+
}
|
|
1779
|
+
function copyMapLoose(map, state) {
|
|
1780
|
+
const clone = new state.Constructor();
|
|
1781
|
+
state.cache.set(map, clone);
|
|
1782
|
+
map.forEach((value, key) => {
|
|
1783
|
+
clone.set(key, state.copier(value, state));
|
|
1784
|
+
});
|
|
1785
|
+
return clone;
|
|
1786
|
+
}
|
|
1787
|
+
function copyMapStrict(map, state) {
|
|
1788
|
+
return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
|
|
1789
|
+
}
|
|
1790
|
+
function copyObjectLoose(object, state) {
|
|
1791
|
+
const clone = getCleanClone(state.prototype);
|
|
1792
|
+
state.cache.set(object, clone);
|
|
1793
|
+
for (const key in object) {
|
|
1794
|
+
if (hasOwnProperty.call(object, key)) {
|
|
1795
|
+
clone[key] = state.copier(object[key], state);
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
const symbols = Object.getOwnPropertySymbols(object);
|
|
1799
|
+
for (let index = 0; index < symbols.length; ++index) {
|
|
1800
|
+
const symbol = symbols[index];
|
|
1801
|
+
if (propertyIsEnumerable.call(object, symbol)) {
|
|
1802
|
+
clone[symbol] = state.copier(object[symbol], state);
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
return clone;
|
|
1806
|
+
}
|
|
1807
|
+
function copyObjectStrict(object, state) {
|
|
1808
|
+
const clone = getCleanClone(state.prototype);
|
|
1809
|
+
state.cache.set(object, clone);
|
|
1810
|
+
return copyOwnPropertiesStrict(object, clone, state);
|
|
1811
|
+
}
|
|
1812
|
+
function copyPrimitiveWrapper(primitiveObject, state) {
|
|
1813
|
+
return new state.Constructor(primitiveObject.valueOf());
|
|
1814
|
+
}
|
|
1815
|
+
function copyRegExp(regExp, state) {
|
|
1816
|
+
const clone = new state.Constructor(regExp.source, regExp.flags);
|
|
1817
|
+
clone.lastIndex = regExp.lastIndex;
|
|
1818
|
+
return clone;
|
|
1819
|
+
}
|
|
1820
|
+
function copySelf(value, _state) {
|
|
1821
|
+
return value;
|
|
1822
|
+
}
|
|
1823
|
+
function copySetLoose(set, state) {
|
|
1824
|
+
const clone = new state.Constructor();
|
|
1825
|
+
state.cache.set(set, clone);
|
|
1826
|
+
set.forEach((value) => {
|
|
1827
|
+
clone.add(state.copier(value, state));
|
|
1828
|
+
});
|
|
1829
|
+
return clone;
|
|
1830
|
+
}
|
|
1831
|
+
function copySetStrict(set, state) {
|
|
1832
|
+
return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
|
|
1833
|
+
}
|
|
1834
|
+
function createDefaultCache() {
|
|
1835
|
+
return /* @__PURE__ */ new WeakMap();
|
|
1836
|
+
}
|
|
1837
|
+
function getOptions({ createCache: createCacheOverride, methods: methodsOverride, strict }) {
|
|
1838
|
+
const defaultMethods = {
|
|
1839
|
+
array: strict ? copyArrayStrict : copyArrayLoose,
|
|
1840
|
+
arrayBuffer: copyArrayBuffer,
|
|
1841
|
+
asyncGenerator: copySelf,
|
|
1842
|
+
blob: copyBlob,
|
|
1843
|
+
dataView: copyDataView,
|
|
1844
|
+
date: copyDate,
|
|
1845
|
+
error: copySelf,
|
|
1846
|
+
generator: copySelf,
|
|
1847
|
+
map: strict ? copyMapStrict : copyMapLoose,
|
|
1848
|
+
object: strict ? copyObjectStrict : copyObjectLoose,
|
|
1849
|
+
regExp: copyRegExp,
|
|
1850
|
+
set: strict ? copySetStrict : copySetLoose
|
|
1851
|
+
};
|
|
1852
|
+
const methods = methodsOverride ? Object.assign(defaultMethods, methodsOverride) : defaultMethods;
|
|
1853
|
+
const copiers = getTagSpecificCopiers(methods);
|
|
1854
|
+
const createCache = createCacheOverride || createDefaultCache;
|
|
1855
|
+
if (!copiers.Object || !copiers.Array) {
|
|
1856
|
+
throw new Error("An object and array copier must be provided.");
|
|
1857
|
+
}
|
|
1858
|
+
return { createCache, copiers, methods, strict: Boolean(strict) };
|
|
1859
|
+
}
|
|
1860
|
+
function getTagSpecificCopiers(methods) {
|
|
1861
|
+
return {
|
|
1862
|
+
Arguments: methods.object,
|
|
1863
|
+
Array: methods.array,
|
|
1864
|
+
ArrayBuffer: methods.arrayBuffer,
|
|
1865
|
+
AsyncGenerator: methods.asyncGenerator,
|
|
1866
|
+
BigInt64Array: methods.arrayBuffer,
|
|
1867
|
+
BigUint64Array: methods.arrayBuffer,
|
|
1868
|
+
Blob: methods.blob,
|
|
1869
|
+
Boolean: copyPrimitiveWrapper,
|
|
1870
|
+
DataView: methods.dataView,
|
|
1871
|
+
Date: methods.date,
|
|
1872
|
+
Error: methods.error,
|
|
1873
|
+
Float32Array: methods.arrayBuffer,
|
|
1874
|
+
Float64Array: methods.arrayBuffer,
|
|
1875
|
+
Generator: methods.generator,
|
|
1876
|
+
Int8Array: methods.arrayBuffer,
|
|
1877
|
+
Int16Array: methods.arrayBuffer,
|
|
1878
|
+
Int32Array: methods.arrayBuffer,
|
|
1879
|
+
Map: methods.map,
|
|
1880
|
+
Number: copyPrimitiveWrapper,
|
|
1881
|
+
Object: methods.object,
|
|
1882
|
+
Promise: copySelf,
|
|
1883
|
+
RegExp: methods.regExp,
|
|
1884
|
+
Set: methods.set,
|
|
1885
|
+
String: copyPrimitiveWrapper,
|
|
1886
|
+
WeakMap: copySelf,
|
|
1887
|
+
WeakSet: copySelf,
|
|
1888
|
+
Uint8Array: methods.arrayBuffer,
|
|
1889
|
+
Uint8ClampedArray: methods.arrayBuffer,
|
|
1890
|
+
Uint16Array: methods.arrayBuffer,
|
|
1891
|
+
Uint32Array: methods.arrayBuffer
|
|
1892
|
+
};
|
|
1893
|
+
}
|
|
1894
|
+
function createCopier(options = {}) {
|
|
1895
|
+
const { createCache, copiers } = getOptions(options);
|
|
1896
|
+
const { Array: copyArray, Object: copyObject } = copiers;
|
|
1897
|
+
function copier(value, state) {
|
|
1898
|
+
state.prototype = state.Constructor = void 0;
|
|
1899
|
+
if (!value || typeof value !== "object") {
|
|
1900
|
+
return value;
|
|
1901
|
+
}
|
|
1902
|
+
if (state.cache.has(value)) {
|
|
1903
|
+
return state.cache.get(value);
|
|
1904
|
+
}
|
|
1905
|
+
state.prototype = Object.getPrototypeOf(value);
|
|
1906
|
+
state.Constructor = state.prototype && state.prototype.constructor;
|
|
1907
|
+
if (!state.Constructor || state.Constructor === Object) {
|
|
1908
|
+
return copyObject(value, state);
|
|
1909
|
+
}
|
|
1910
|
+
if (Array.isArray(value)) {
|
|
1911
|
+
return copyArray(value, state);
|
|
1912
|
+
}
|
|
1913
|
+
const tagSpecificCopier = copiers[getTag(value)];
|
|
1914
|
+
if (tagSpecificCopier) {
|
|
1915
|
+
return tagSpecificCopier(value, state);
|
|
1916
|
+
}
|
|
1917
|
+
return typeof value.then === "function" ? value : copyObject(value, state);
|
|
1918
|
+
}
|
|
1919
|
+
return function copy2(value) {
|
|
1920
|
+
return copier(value, {
|
|
1921
|
+
Constructor: void 0,
|
|
1922
|
+
cache: createCache(),
|
|
1923
|
+
copier,
|
|
1924
|
+
prototype: void 0
|
|
1925
|
+
});
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
var copyStrict = createCopier({ strict: true });
|
|
1929
|
+
var copy = createCopier();
|
|
1930
|
+
exports.copy = copy;
|
|
1931
|
+
exports.copyStrict = copyStrict;
|
|
1932
|
+
exports.createCopier = createCopier;
|
|
1933
|
+
}
|
|
1934
|
+
});
|
|
1935
|
+
|
|
1936
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/filter-log.js
|
|
1937
|
+
var require_filter_log = __commonJS({
|
|
1938
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/filter-log.js"(exports, module) {
|
|
1939
|
+
"use strict";
|
|
1940
|
+
module.exports = filterLog;
|
|
1941
|
+
var { createCopier } = require_cjs();
|
|
1942
|
+
var fastCopy = createCopier({});
|
|
1943
|
+
var deleteLogProperty = require_delete_log_property();
|
|
1944
|
+
function filterLog({ log, context }) {
|
|
1945
|
+
const { ignoreKeys, includeKeys } = context;
|
|
1946
|
+
const logCopy = fastCopy(log);
|
|
1947
|
+
if (includeKeys) {
|
|
1948
|
+
const logIncluded = {};
|
|
1949
|
+
includeKeys.forEach((key) => {
|
|
1950
|
+
logIncluded[key] = logCopy[key];
|
|
1951
|
+
});
|
|
1952
|
+
return logIncluded;
|
|
1953
|
+
}
|
|
1954
|
+
ignoreKeys.forEach((ignoreKey) => {
|
|
1955
|
+
deleteLogProperty(logCopy, ignoreKey);
|
|
1956
|
+
});
|
|
1957
|
+
return logCopy;
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1961
|
+
|
|
1962
|
+
// ../../node_modules/.pnpm/dateformat@4.6.3/node_modules/dateformat/lib/dateformat.js
|
|
1963
|
+
var require_dateformat = __commonJS({
|
|
1964
|
+
"../../node_modules/.pnpm/dateformat@4.6.3/node_modules/dateformat/lib/dateformat.js"(exports, module) {
|
|
1965
|
+
"use strict";
|
|
1966
|
+
function _typeof(obj) {
|
|
1967
|
+
"@babel/helpers - typeof";
|
|
1968
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
1969
|
+
_typeof = function _typeof2(obj2) {
|
|
1970
|
+
return typeof obj2;
|
|
1971
|
+
};
|
|
1972
|
+
} else {
|
|
1973
|
+
_typeof = function _typeof2(obj2) {
|
|
1974
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1977
|
+
return _typeof(obj);
|
|
1978
|
+
}
|
|
1979
|
+
(function(global2) {
|
|
1980
|
+
var _arguments = arguments;
|
|
1981
|
+
var dateFormat = /* @__PURE__ */ (function() {
|
|
1982
|
+
var token = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g;
|
|
1983
|
+
var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
|
|
1984
|
+
var timezoneClip = /[^-+\dA-Z]/g;
|
|
1985
|
+
return function(date, mask, utc, gmt) {
|
|
1986
|
+
if (_arguments.length === 1 && kindOf(date) === "string" && !/\d/.test(date)) {
|
|
1987
|
+
mask = date;
|
|
1988
|
+
date = void 0;
|
|
1989
|
+
}
|
|
1990
|
+
date = date || date === 0 ? date : /* @__PURE__ */ new Date();
|
|
1991
|
+
if (!(date instanceof Date)) {
|
|
1992
|
+
date = new Date(date);
|
|
1993
|
+
}
|
|
1994
|
+
if (isNaN(date)) {
|
|
1995
|
+
throw TypeError("Invalid date");
|
|
1996
|
+
}
|
|
1997
|
+
mask = String(dateFormat.masks[mask] || mask || dateFormat.masks["default"]);
|
|
1998
|
+
var maskSlice = mask.slice(0, 4);
|
|
1999
|
+
if (maskSlice === "UTC:" || maskSlice === "GMT:") {
|
|
2000
|
+
mask = mask.slice(4);
|
|
2001
|
+
utc = true;
|
|
2002
|
+
if (maskSlice === "GMT:") {
|
|
2003
|
+
gmt = true;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
var _ = function _2() {
|
|
2007
|
+
return utc ? "getUTC" : "get";
|
|
2008
|
+
};
|
|
2009
|
+
var _d = function d() {
|
|
2010
|
+
return date[_() + "Date"]();
|
|
2011
|
+
};
|
|
2012
|
+
var D = function D2() {
|
|
2013
|
+
return date[_() + "Day"]();
|
|
2014
|
+
};
|
|
2015
|
+
var _m = function m() {
|
|
2016
|
+
return date[_() + "Month"]();
|
|
2017
|
+
};
|
|
2018
|
+
var y = function y2() {
|
|
2019
|
+
return date[_() + "FullYear"]();
|
|
2020
|
+
};
|
|
2021
|
+
var _H = function H() {
|
|
2022
|
+
return date[_() + "Hours"]();
|
|
2023
|
+
};
|
|
2024
|
+
var _M = function M() {
|
|
2025
|
+
return date[_() + "Minutes"]();
|
|
2026
|
+
};
|
|
2027
|
+
var _s = function s() {
|
|
2028
|
+
return date[_() + "Seconds"]();
|
|
2029
|
+
};
|
|
2030
|
+
var _L = function L() {
|
|
2031
|
+
return date[_() + "Milliseconds"]();
|
|
2032
|
+
};
|
|
2033
|
+
var _o = function o() {
|
|
2034
|
+
return utc ? 0 : date.getTimezoneOffset();
|
|
2035
|
+
};
|
|
2036
|
+
var _W = function W() {
|
|
2037
|
+
return getWeek(date);
|
|
2038
|
+
};
|
|
2039
|
+
var _N = function N() {
|
|
2040
|
+
return getDayOfWeek(date);
|
|
2041
|
+
};
|
|
2042
|
+
var flags = { d: function d() {
|
|
2043
|
+
return _d();
|
|
2044
|
+
}, dd: function dd() {
|
|
2045
|
+
return pad(_d());
|
|
2046
|
+
}, ddd: function ddd() {
|
|
2047
|
+
return dateFormat.i18n.dayNames[D()];
|
|
2048
|
+
}, DDD: function DDD() {
|
|
2049
|
+
return getDayName({ y: y(), m: _m(), d: _d(), _: _(), dayName: dateFormat.i18n.dayNames[D()], short: true });
|
|
2050
|
+
}, dddd: function dddd() {
|
|
2051
|
+
return dateFormat.i18n.dayNames[D() + 7];
|
|
2052
|
+
}, DDDD: function DDDD() {
|
|
2053
|
+
return getDayName({ y: y(), m: _m(), d: _d(), _: _(), dayName: dateFormat.i18n.dayNames[D() + 7] });
|
|
2054
|
+
}, m: function m() {
|
|
2055
|
+
return _m() + 1;
|
|
2056
|
+
}, mm: function mm() {
|
|
2057
|
+
return pad(_m() + 1);
|
|
2058
|
+
}, mmm: function mmm() {
|
|
2059
|
+
return dateFormat.i18n.monthNames[_m()];
|
|
2060
|
+
}, mmmm: function mmmm() {
|
|
2061
|
+
return dateFormat.i18n.monthNames[_m() + 12];
|
|
2062
|
+
}, yy: function yy() {
|
|
2063
|
+
return String(y()).slice(2);
|
|
2064
|
+
}, yyyy: function yyyy() {
|
|
2065
|
+
return pad(y(), 4);
|
|
2066
|
+
}, h: function h() {
|
|
2067
|
+
return _H() % 12 || 12;
|
|
2068
|
+
}, hh: function hh() {
|
|
2069
|
+
return pad(_H() % 12 || 12);
|
|
2070
|
+
}, H: function H() {
|
|
2071
|
+
return _H();
|
|
2072
|
+
}, HH: function HH() {
|
|
2073
|
+
return pad(_H());
|
|
2074
|
+
}, M: function M() {
|
|
2075
|
+
return _M();
|
|
2076
|
+
}, MM: function MM() {
|
|
2077
|
+
return pad(_M());
|
|
2078
|
+
}, s: function s() {
|
|
2079
|
+
return _s();
|
|
2080
|
+
}, ss: function ss() {
|
|
2081
|
+
return pad(_s());
|
|
2082
|
+
}, l: function l() {
|
|
2083
|
+
return pad(_L(), 3);
|
|
2084
|
+
}, L: function L() {
|
|
2085
|
+
return pad(Math.floor(_L() / 10));
|
|
2086
|
+
}, t: function t() {
|
|
2087
|
+
return _H() < 12 ? dateFormat.i18n.timeNames[0] : dateFormat.i18n.timeNames[1];
|
|
2088
|
+
}, tt: function tt() {
|
|
2089
|
+
return _H() < 12 ? dateFormat.i18n.timeNames[2] : dateFormat.i18n.timeNames[3];
|
|
2090
|
+
}, T: function T() {
|
|
2091
|
+
return _H() < 12 ? dateFormat.i18n.timeNames[4] : dateFormat.i18n.timeNames[5];
|
|
2092
|
+
}, TT: function TT() {
|
|
2093
|
+
return _H() < 12 ? dateFormat.i18n.timeNames[6] : dateFormat.i18n.timeNames[7];
|
|
2094
|
+
}, Z: function Z() {
|
|
2095
|
+
return gmt ? "GMT" : utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, "").replace(/GMT\+0000/g, "UTC");
|
|
2096
|
+
}, o: function o() {
|
|
2097
|
+
return (_o() > 0 ? "-" : "+") + pad(Math.floor(Math.abs(_o()) / 60) * 100 + Math.abs(_o()) % 60, 4);
|
|
2098
|
+
}, p: function p() {
|
|
2099
|
+
return (_o() > 0 ? "-" : "+") + pad(Math.floor(Math.abs(_o()) / 60), 2) + ":" + pad(Math.floor(Math.abs(_o()) % 60), 2);
|
|
2100
|
+
}, S: function S() {
|
|
2101
|
+
return ["th", "st", "nd", "rd"][_d() % 10 > 3 ? 0 : (_d() % 100 - _d() % 10 != 10) * _d() % 10];
|
|
2102
|
+
}, W: function W() {
|
|
2103
|
+
return _W();
|
|
2104
|
+
}, WW: function WW() {
|
|
2105
|
+
return pad(_W());
|
|
2106
|
+
}, N: function N() {
|
|
2107
|
+
return _N();
|
|
2108
|
+
} };
|
|
2109
|
+
return mask.replace(token, function(match) {
|
|
2110
|
+
if (match in flags) {
|
|
2111
|
+
return flags[match]();
|
|
2112
|
+
}
|
|
2113
|
+
return match.slice(1, match.length - 1);
|
|
2114
|
+
});
|
|
2115
|
+
};
|
|
2116
|
+
})();
|
|
2117
|
+
dateFormat.masks = { default: "ddd mmm dd yyyy HH:MM:ss", shortDate: "m/d/yy", paddedShortDate: "mm/dd/yyyy", mediumDate: "mmm d, yyyy", longDate: "mmmm d, yyyy", fullDate: "dddd, mmmm d, yyyy", shortTime: "h:MM TT", mediumTime: "h:MM:ss TT", longTime: "h:MM:ss TT Z", isoDate: "yyyy-mm-dd", isoTime: "HH:MM:ss", isoDateTime: "yyyy-mm-dd'T'HH:MM:sso", isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'", expiresHeaderFormat: "ddd, dd mmm yyyy HH:MM:ss Z" };
|
|
2118
|
+
dateFormat.i18n = { dayNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], timeNames: ["a", "p", "am", "pm", "A", "P", "AM", "PM"] };
|
|
2119
|
+
var pad = function pad2(val, len) {
|
|
2120
|
+
val = String(val);
|
|
2121
|
+
len = len || 2;
|
|
2122
|
+
while (val.length < len) {
|
|
2123
|
+
val = "0" + val;
|
|
2124
|
+
}
|
|
2125
|
+
return val;
|
|
2126
|
+
};
|
|
2127
|
+
var getDayName = function getDayName2(_ref) {
|
|
2128
|
+
var y = _ref.y, m = _ref.m, d = _ref.d, _ = _ref._, dayName = _ref.dayName, _ref$short = _ref["short"], _short = _ref$short === void 0 ? false : _ref$short;
|
|
2129
|
+
var today = /* @__PURE__ */ new Date();
|
|
2130
|
+
var yesterday = /* @__PURE__ */ new Date();
|
|
2131
|
+
yesterday.setDate(yesterday[_ + "Date"]() - 1);
|
|
2132
|
+
var tomorrow = /* @__PURE__ */ new Date();
|
|
2133
|
+
tomorrow.setDate(tomorrow[_ + "Date"]() + 1);
|
|
2134
|
+
var today_d = function today_d2() {
|
|
2135
|
+
return today[_ + "Date"]();
|
|
2136
|
+
};
|
|
2137
|
+
var today_m = function today_m2() {
|
|
2138
|
+
return today[_ + "Month"]();
|
|
2139
|
+
};
|
|
2140
|
+
var today_y = function today_y2() {
|
|
2141
|
+
return today[_ + "FullYear"]();
|
|
2142
|
+
};
|
|
2143
|
+
var yesterday_d = function yesterday_d2() {
|
|
2144
|
+
return yesterday[_ + "Date"]();
|
|
2145
|
+
};
|
|
2146
|
+
var yesterday_m = function yesterday_m2() {
|
|
2147
|
+
return yesterday[_ + "Month"]();
|
|
2148
|
+
};
|
|
2149
|
+
var yesterday_y = function yesterday_y2() {
|
|
2150
|
+
return yesterday[_ + "FullYear"]();
|
|
2151
|
+
};
|
|
2152
|
+
var tomorrow_d = function tomorrow_d2() {
|
|
2153
|
+
return tomorrow[_ + "Date"]();
|
|
2154
|
+
};
|
|
2155
|
+
var tomorrow_m = function tomorrow_m2() {
|
|
2156
|
+
return tomorrow[_ + "Month"]();
|
|
2157
|
+
};
|
|
2158
|
+
var tomorrow_y = function tomorrow_y2() {
|
|
2159
|
+
return tomorrow[_ + "FullYear"]();
|
|
2160
|
+
};
|
|
2161
|
+
if (today_y() === y && today_m() === m && today_d() === d) {
|
|
2162
|
+
return _short ? "Tdy" : "Today";
|
|
2163
|
+
} else if (yesterday_y() === y && yesterday_m() === m && yesterday_d() === d) {
|
|
2164
|
+
return _short ? "Ysd" : "Yesterday";
|
|
2165
|
+
} else if (tomorrow_y() === y && tomorrow_m() === m && tomorrow_d() === d) {
|
|
2166
|
+
return _short ? "Tmw" : "Tomorrow";
|
|
2167
|
+
}
|
|
2168
|
+
return dayName;
|
|
2169
|
+
};
|
|
2170
|
+
var getWeek = function getWeek2(date) {
|
|
2171
|
+
var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
2172
|
+
targetThursday.setDate(targetThursday.getDate() - (targetThursday.getDay() + 6) % 7 + 3);
|
|
2173
|
+
var firstThursday = new Date(targetThursday.getFullYear(), 0, 4);
|
|
2174
|
+
firstThursday.setDate(firstThursday.getDate() - (firstThursday.getDay() + 6) % 7 + 3);
|
|
2175
|
+
var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset();
|
|
2176
|
+
targetThursday.setHours(targetThursday.getHours() - ds);
|
|
2177
|
+
var weekDiff = (targetThursday - firstThursday) / (864e5 * 7);
|
|
2178
|
+
return 1 + Math.floor(weekDiff);
|
|
2179
|
+
};
|
|
2180
|
+
var getDayOfWeek = function getDayOfWeek2(date) {
|
|
2181
|
+
var dow = date.getDay();
|
|
2182
|
+
if (dow === 0) {
|
|
2183
|
+
dow = 7;
|
|
2184
|
+
}
|
|
2185
|
+
return dow;
|
|
2186
|
+
};
|
|
2187
|
+
var kindOf = function kindOf2(val) {
|
|
2188
|
+
if (val === null) {
|
|
2189
|
+
return "null";
|
|
2190
|
+
}
|
|
2191
|
+
if (val === void 0) {
|
|
2192
|
+
return "undefined";
|
|
2193
|
+
}
|
|
2194
|
+
if (_typeof(val) !== "object") {
|
|
2195
|
+
return _typeof(val);
|
|
2196
|
+
}
|
|
2197
|
+
if (Array.isArray(val)) {
|
|
2198
|
+
return "array";
|
|
2199
|
+
}
|
|
2200
|
+
return {}.toString.call(val).slice(8, -1).toLowerCase();
|
|
2201
|
+
};
|
|
2202
|
+
if (typeof define === "function" && define.amd) {
|
|
2203
|
+
define(function() {
|
|
2204
|
+
return dateFormat;
|
|
2205
|
+
});
|
|
2206
|
+
} else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object") {
|
|
2207
|
+
module.exports = dateFormat;
|
|
2208
|
+
} else {
|
|
2209
|
+
global2.dateFormat = dateFormat;
|
|
2210
|
+
}
|
|
2211
|
+
})(void 0);
|
|
2212
|
+
}
|
|
2213
|
+
});
|
|
2214
|
+
|
|
2215
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/format-time.js
|
|
2216
|
+
var require_format_time = __commonJS({
|
|
2217
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/format-time.js"(exports, module) {
|
|
2218
|
+
"use strict";
|
|
2219
|
+
module.exports = formatTime;
|
|
2220
|
+
var {
|
|
2221
|
+
DATE_FORMAT,
|
|
2222
|
+
DATE_FORMAT_SIMPLE
|
|
2223
|
+
} = require_constants();
|
|
2224
|
+
var dateformat = require_dateformat();
|
|
2225
|
+
var createDate = require_create_date();
|
|
2226
|
+
var isValidDate = require_is_valid_date();
|
|
2227
|
+
function formatTime(epoch, translateTime = false) {
|
|
2228
|
+
if (translateTime === false) {
|
|
2229
|
+
return epoch;
|
|
2230
|
+
}
|
|
2231
|
+
const instant = createDate(epoch);
|
|
2232
|
+
if (!isValidDate(instant)) {
|
|
2233
|
+
return epoch;
|
|
2234
|
+
}
|
|
2235
|
+
if (translateTime === true) {
|
|
2236
|
+
return dateformat(instant, DATE_FORMAT_SIMPLE);
|
|
2237
|
+
}
|
|
2238
|
+
const upperFormat = translateTime.toUpperCase();
|
|
2239
|
+
if (upperFormat === "SYS:STANDARD") {
|
|
2240
|
+
return dateformat(instant, DATE_FORMAT);
|
|
2241
|
+
}
|
|
2242
|
+
const prefix = upperFormat.substr(0, 4);
|
|
2243
|
+
if (prefix === "SYS:" || prefix === "UTC:") {
|
|
2244
|
+
if (prefix === "UTC:") {
|
|
2245
|
+
return dateformat(instant, translateTime);
|
|
2246
|
+
}
|
|
2247
|
+
return dateformat(instant, translateTime.slice(4));
|
|
2248
|
+
}
|
|
2249
|
+
return dateformat(instant, `UTC:${translateTime}`);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
});
|
|
2253
|
+
|
|
2254
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.js
|
|
2255
|
+
var require_handle_custom_levels_names_opts = __commonJS({
|
|
2256
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.js"(exports, module) {
|
|
2257
|
+
"use strict";
|
|
2258
|
+
module.exports = handleCustomLevelsNamesOpts;
|
|
2259
|
+
function handleCustomLevelsNamesOpts(cLevels) {
|
|
2260
|
+
if (!cLevels) return {};
|
|
2261
|
+
if (typeof cLevels === "string") {
|
|
2262
|
+
return cLevels.split(",").reduce((agg, value, idx) => {
|
|
2263
|
+
const [levelName, levelNum = idx] = value.split(":");
|
|
2264
|
+
agg[levelName.toLowerCase()] = levelNum;
|
|
2265
|
+
return agg;
|
|
2266
|
+
}, {});
|
|
2267
|
+
} else if (Object.prototype.toString.call(cLevels) === "[object Object]") {
|
|
2268
|
+
return Object.keys(cLevels).reduce((agg, levelName) => {
|
|
2269
|
+
agg[levelName.toLowerCase()] = cLevels[levelName];
|
|
2270
|
+
return agg;
|
|
2271
|
+
}, {});
|
|
2272
|
+
} else {
|
|
2273
|
+
return {};
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
});
|
|
2278
|
+
|
|
2279
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.js
|
|
2280
|
+
var require_handle_custom_levels_opts = __commonJS({
|
|
2281
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.js"(exports, module) {
|
|
2282
|
+
"use strict";
|
|
2283
|
+
module.exports = handleCustomLevelsOpts;
|
|
2284
|
+
function handleCustomLevelsOpts(cLevels) {
|
|
2285
|
+
if (!cLevels) return {};
|
|
2286
|
+
if (typeof cLevels === "string") {
|
|
2287
|
+
return cLevels.split(",").reduce(
|
|
2288
|
+
(agg, value, idx) => {
|
|
2289
|
+
const [levelName, levelNum = idx] = value.split(":");
|
|
2290
|
+
agg[levelNum] = levelName.toUpperCase();
|
|
2291
|
+
return agg;
|
|
2292
|
+
},
|
|
2293
|
+
{ default: "USERLVL" }
|
|
2294
|
+
);
|
|
2295
|
+
} else if (Object.prototype.toString.call(cLevels) === "[object Object]") {
|
|
2296
|
+
return Object.keys(cLevels).reduce((agg, levelName) => {
|
|
2297
|
+
agg[cLevels[levelName]] = levelName.toUpperCase();
|
|
2298
|
+
return agg;
|
|
2299
|
+
}, { default: "USERLVL" });
|
|
2300
|
+
} else {
|
|
2301
|
+
return {};
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
});
|
|
2306
|
+
|
|
2307
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/interpret-conditionals.js
|
|
2308
|
+
var require_interpret_conditionals = __commonJS({
|
|
2309
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/interpret-conditionals.js"(exports, module) {
|
|
2310
|
+
"use strict";
|
|
2311
|
+
module.exports = interpretConditionals;
|
|
2312
|
+
var getPropertyValue = require_get_property_value();
|
|
2313
|
+
function interpretConditionals(messageFormat, log) {
|
|
2314
|
+
messageFormat = messageFormat.replace(/{if (.*?)}(.*?){end}/g, replacer);
|
|
2315
|
+
messageFormat = messageFormat.replace(/{if (.*?)}/g, "");
|
|
2316
|
+
messageFormat = messageFormat.replace(/{end}/g, "");
|
|
2317
|
+
return messageFormat.replace(/\s+/g, " ").trim();
|
|
2318
|
+
function replacer(_, key, value) {
|
|
2319
|
+
const propertyValue = getPropertyValue(log, key);
|
|
2320
|
+
if (propertyValue && value.includes(key)) {
|
|
2321
|
+
return value.replace(new RegExp("{" + key + "}", "g"), propertyValue);
|
|
2322
|
+
} else {
|
|
2323
|
+
return "";
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
});
|
|
2329
|
+
|
|
2330
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/is-object.js
|
|
2331
|
+
var require_is_object = __commonJS({
|
|
2332
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/is-object.js"(exports, module) {
|
|
2333
|
+
"use strict";
|
|
2334
|
+
module.exports = isObject;
|
|
2335
|
+
function isObject(input) {
|
|
2336
|
+
return Object.prototype.toString.apply(input) === "[object Object]";
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
});
|
|
2340
|
+
|
|
2341
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.js
|
|
2342
|
+
var require_join_lines_with_indentation = __commonJS({
|
|
2343
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.js"(exports, module) {
|
|
2344
|
+
"use strict";
|
|
2345
|
+
module.exports = joinLinesWithIndentation;
|
|
2346
|
+
function joinLinesWithIndentation({ input, ident = " ", eol = "\n" }) {
|
|
2347
|
+
const lines = input.split(/\r?\n/);
|
|
2348
|
+
for (let i = 1; i < lines.length; i += 1) {
|
|
2349
|
+
lines[i] = ident + lines[i];
|
|
2350
|
+
}
|
|
2351
|
+
return lines.join(eol);
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
2355
|
+
|
|
2356
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/parse-factory-options.js
|
|
2357
|
+
var require_parse_factory_options = __commonJS({
|
|
2358
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/parse-factory-options.js"(exports, module) {
|
|
2359
|
+
"use strict";
|
|
2360
|
+
module.exports = parseFactoryOptions;
|
|
2361
|
+
var {
|
|
2362
|
+
LEVEL_NAMES
|
|
2363
|
+
} = require_constants();
|
|
2364
|
+
var colors = require_colors();
|
|
2365
|
+
var handleCustomLevelsOpts = require_handle_custom_levels_opts();
|
|
2366
|
+
var handleCustomLevelsNamesOpts = require_handle_custom_levels_names_opts();
|
|
2367
|
+
var handleLevelLabelData = require_get_level_label_data();
|
|
2368
|
+
function parseFactoryOptions(options) {
|
|
2369
|
+
const EOL = options.crlf ? "\r\n" : "\n";
|
|
2370
|
+
const IDENT = " ";
|
|
2371
|
+
const {
|
|
2372
|
+
customPrettifiers,
|
|
2373
|
+
errorLikeObjectKeys,
|
|
2374
|
+
hideObject,
|
|
2375
|
+
levelFirst,
|
|
2376
|
+
levelKey,
|
|
2377
|
+
levelLabel,
|
|
2378
|
+
messageFormat,
|
|
2379
|
+
messageKey,
|
|
2380
|
+
minimumLevel,
|
|
2381
|
+
singleLine,
|
|
2382
|
+
timestampKey,
|
|
2383
|
+
translateTime
|
|
2384
|
+
} = options;
|
|
2385
|
+
const errorProps = options.errorProps.split(",");
|
|
2386
|
+
const useOnlyCustomProps = typeof options.useOnlyCustomProps === "boolean" ? options.useOnlyCustomProps : options.useOnlyCustomProps === "true";
|
|
2387
|
+
const customLevels = handleCustomLevelsOpts(options.customLevels);
|
|
2388
|
+
const customLevelNames = handleCustomLevelsNamesOpts(options.customLevels);
|
|
2389
|
+
const getLevelLabelData = handleLevelLabelData(useOnlyCustomProps, customLevels, customLevelNames);
|
|
2390
|
+
let customColors;
|
|
2391
|
+
if (options.customColors) {
|
|
2392
|
+
if (typeof options.customColors === "string") {
|
|
2393
|
+
customColors = options.customColors.split(",").reduce((agg, value) => {
|
|
2394
|
+
const [level, color] = value.split(":");
|
|
2395
|
+
const condition = useOnlyCustomProps ? options.customLevels : customLevelNames[level] !== void 0;
|
|
2396
|
+
const levelNum = condition ? customLevelNames[level] : LEVEL_NAMES[level];
|
|
2397
|
+
const colorIdx = levelNum !== void 0 ? levelNum : level;
|
|
2398
|
+
agg.push([colorIdx, color]);
|
|
2399
|
+
return agg;
|
|
2400
|
+
}, []);
|
|
2401
|
+
} else if (typeof options.customColors === "object") {
|
|
2402
|
+
customColors = Object.keys(options.customColors).reduce((agg, value) => {
|
|
2403
|
+
const [level, color] = [value, options.customColors[value]];
|
|
2404
|
+
const condition = useOnlyCustomProps ? options.customLevels : customLevelNames[level] !== void 0;
|
|
2405
|
+
const levelNum = condition ? customLevelNames[level] : LEVEL_NAMES[level];
|
|
2406
|
+
const colorIdx = levelNum !== void 0 ? levelNum : level;
|
|
2407
|
+
agg.push([colorIdx, color]);
|
|
2408
|
+
return agg;
|
|
2409
|
+
}, []);
|
|
2410
|
+
} else {
|
|
2411
|
+
throw new Error("options.customColors must be of type string or object.");
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
const customProperties = { customLevels, customLevelNames };
|
|
2415
|
+
if (useOnlyCustomProps === true && !options.customLevels) {
|
|
2416
|
+
customProperties.customLevels = void 0;
|
|
2417
|
+
customProperties.customLevelNames = void 0;
|
|
2418
|
+
}
|
|
2419
|
+
const includeKeys = options.include !== void 0 ? new Set(options.include.split(",")) : void 0;
|
|
2420
|
+
const ignoreKeys = !includeKeys && options.ignore ? new Set(options.ignore.split(",")) : void 0;
|
|
2421
|
+
const colorizer = colors(options.colorize, customColors, useOnlyCustomProps);
|
|
2422
|
+
const objectColorizer = options.colorizeObjects ? colorizer : colors(false, [], false);
|
|
2423
|
+
return {
|
|
2424
|
+
EOL,
|
|
2425
|
+
IDENT,
|
|
2426
|
+
colorizer,
|
|
2427
|
+
customColors,
|
|
2428
|
+
customLevelNames,
|
|
2429
|
+
customLevels,
|
|
2430
|
+
customPrettifiers,
|
|
2431
|
+
customProperties,
|
|
2432
|
+
errorLikeObjectKeys,
|
|
2433
|
+
errorProps,
|
|
2434
|
+
getLevelLabelData,
|
|
2435
|
+
hideObject,
|
|
2436
|
+
ignoreKeys,
|
|
2437
|
+
includeKeys,
|
|
2438
|
+
levelFirst,
|
|
2439
|
+
levelKey,
|
|
2440
|
+
levelLabel,
|
|
2441
|
+
messageFormat,
|
|
2442
|
+
messageKey,
|
|
2443
|
+
minimumLevel,
|
|
2444
|
+
objectColorizer,
|
|
2445
|
+
singleLine,
|
|
2446
|
+
timestampKey,
|
|
2447
|
+
translateTime,
|
|
2448
|
+
useOnlyCustomProps
|
|
2449
|
+
};
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
});
|
|
2453
|
+
|
|
2454
|
+
// ../../node_modules/.pnpm/fast-safe-stringify@2.1.1/node_modules/fast-safe-stringify/index.js
|
|
2455
|
+
var require_fast_safe_stringify = __commonJS({
|
|
2456
|
+
"../../node_modules/.pnpm/fast-safe-stringify@2.1.1/node_modules/fast-safe-stringify/index.js"(exports, module) {
|
|
2457
|
+
module.exports = stringify;
|
|
2458
|
+
stringify.default = stringify;
|
|
2459
|
+
stringify.stable = deterministicStringify;
|
|
2460
|
+
stringify.stableStringify = deterministicStringify;
|
|
2461
|
+
var LIMIT_REPLACE_NODE = "[...]";
|
|
2462
|
+
var CIRCULAR_REPLACE_NODE = "[Circular]";
|
|
2463
|
+
var arr = [];
|
|
2464
|
+
var replacerStack = [];
|
|
2465
|
+
function defaultOptions() {
|
|
2466
|
+
return {
|
|
2467
|
+
depthLimit: Number.MAX_SAFE_INTEGER,
|
|
2468
|
+
edgesLimit: Number.MAX_SAFE_INTEGER
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
function stringify(obj, replacer, spacer, options) {
|
|
2472
|
+
if (typeof options === "undefined") {
|
|
2473
|
+
options = defaultOptions();
|
|
2474
|
+
}
|
|
2475
|
+
decirc(obj, "", 0, [], void 0, 0, options);
|
|
2476
|
+
var res;
|
|
2477
|
+
try {
|
|
2478
|
+
if (replacerStack.length === 0) {
|
|
2479
|
+
res = JSON.stringify(obj, replacer, spacer);
|
|
2480
|
+
} else {
|
|
2481
|
+
res = JSON.stringify(obj, replaceGetterValues(replacer), spacer);
|
|
2482
|
+
}
|
|
2483
|
+
} catch (_) {
|
|
2484
|
+
return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
|
|
2485
|
+
} finally {
|
|
2486
|
+
while (arr.length !== 0) {
|
|
2487
|
+
var part = arr.pop();
|
|
2488
|
+
if (part.length === 4) {
|
|
2489
|
+
Object.defineProperty(part[0], part[1], part[3]);
|
|
2490
|
+
} else {
|
|
2491
|
+
part[0][part[1]] = part[2];
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
return res;
|
|
2496
|
+
}
|
|
2497
|
+
function setReplace(replace, val, k, parent) {
|
|
2498
|
+
var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k);
|
|
2499
|
+
if (propertyDescriptor.get !== void 0) {
|
|
2500
|
+
if (propertyDescriptor.configurable) {
|
|
2501
|
+
Object.defineProperty(parent, k, { value: replace });
|
|
2502
|
+
arr.push([parent, k, val, propertyDescriptor]);
|
|
2503
|
+
} else {
|
|
2504
|
+
replacerStack.push([val, k, replace]);
|
|
2505
|
+
}
|
|
2506
|
+
} else {
|
|
2507
|
+
parent[k] = replace;
|
|
2508
|
+
arr.push([parent, k, val]);
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
function decirc(val, k, edgeIndex, stack, parent, depth, options) {
|
|
2512
|
+
depth += 1;
|
|
2513
|
+
var i;
|
|
2514
|
+
if (typeof val === "object" && val !== null) {
|
|
2515
|
+
for (i = 0; i < stack.length; i++) {
|
|
2516
|
+
if (stack[i] === val) {
|
|
2517
|
+
setReplace(CIRCULAR_REPLACE_NODE, val, k, parent);
|
|
2518
|
+
return;
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
if (typeof options.depthLimit !== "undefined" && depth > options.depthLimit) {
|
|
2522
|
+
setReplace(LIMIT_REPLACE_NODE, val, k, parent);
|
|
2523
|
+
return;
|
|
2524
|
+
}
|
|
2525
|
+
if (typeof options.edgesLimit !== "undefined" && edgeIndex + 1 > options.edgesLimit) {
|
|
2526
|
+
setReplace(LIMIT_REPLACE_NODE, val, k, parent);
|
|
2527
|
+
return;
|
|
2528
|
+
}
|
|
2529
|
+
stack.push(val);
|
|
2530
|
+
if (Array.isArray(val)) {
|
|
2531
|
+
for (i = 0; i < val.length; i++) {
|
|
2532
|
+
decirc(val[i], i, i, stack, val, depth, options);
|
|
2533
|
+
}
|
|
2534
|
+
} else {
|
|
2535
|
+
var keys = Object.keys(val);
|
|
2536
|
+
for (i = 0; i < keys.length; i++) {
|
|
2537
|
+
var key = keys[i];
|
|
2538
|
+
decirc(val[key], key, i, stack, val, depth, options);
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
stack.pop();
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
function compareFunction(a, b) {
|
|
2545
|
+
if (a < b) {
|
|
2546
|
+
return -1;
|
|
2547
|
+
}
|
|
2548
|
+
if (a > b) {
|
|
2549
|
+
return 1;
|
|
2550
|
+
}
|
|
2551
|
+
return 0;
|
|
2552
|
+
}
|
|
2553
|
+
function deterministicStringify(obj, replacer, spacer, options) {
|
|
2554
|
+
if (typeof options === "undefined") {
|
|
2555
|
+
options = defaultOptions();
|
|
2556
|
+
}
|
|
2557
|
+
var tmp = deterministicDecirc(obj, "", 0, [], void 0, 0, options) || obj;
|
|
2558
|
+
var res;
|
|
2559
|
+
try {
|
|
2560
|
+
if (replacerStack.length === 0) {
|
|
2561
|
+
res = JSON.stringify(tmp, replacer, spacer);
|
|
2562
|
+
} else {
|
|
2563
|
+
res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer);
|
|
2564
|
+
}
|
|
2565
|
+
} catch (_) {
|
|
2566
|
+
return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
|
|
2567
|
+
} finally {
|
|
2568
|
+
while (arr.length !== 0) {
|
|
2569
|
+
var part = arr.pop();
|
|
2570
|
+
if (part.length === 4) {
|
|
2571
|
+
Object.defineProperty(part[0], part[1], part[3]);
|
|
2572
|
+
} else {
|
|
2573
|
+
part[0][part[1]] = part[2];
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
return res;
|
|
2578
|
+
}
|
|
2579
|
+
function deterministicDecirc(val, k, edgeIndex, stack, parent, depth, options) {
|
|
2580
|
+
depth += 1;
|
|
2581
|
+
var i;
|
|
2582
|
+
if (typeof val === "object" && val !== null) {
|
|
2583
|
+
for (i = 0; i < stack.length; i++) {
|
|
2584
|
+
if (stack[i] === val) {
|
|
2585
|
+
setReplace(CIRCULAR_REPLACE_NODE, val, k, parent);
|
|
2586
|
+
return;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
try {
|
|
2590
|
+
if (typeof val.toJSON === "function") {
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2593
|
+
} catch (_) {
|
|
2594
|
+
return;
|
|
2595
|
+
}
|
|
2596
|
+
if (typeof options.depthLimit !== "undefined" && depth > options.depthLimit) {
|
|
2597
|
+
setReplace(LIMIT_REPLACE_NODE, val, k, parent);
|
|
2598
|
+
return;
|
|
2599
|
+
}
|
|
2600
|
+
if (typeof options.edgesLimit !== "undefined" && edgeIndex + 1 > options.edgesLimit) {
|
|
2601
|
+
setReplace(LIMIT_REPLACE_NODE, val, k, parent);
|
|
2602
|
+
return;
|
|
2603
|
+
}
|
|
2604
|
+
stack.push(val);
|
|
2605
|
+
if (Array.isArray(val)) {
|
|
2606
|
+
for (i = 0; i < val.length; i++) {
|
|
2607
|
+
deterministicDecirc(val[i], i, i, stack, val, depth, options);
|
|
2608
|
+
}
|
|
2609
|
+
} else {
|
|
2610
|
+
var tmp = {};
|
|
2611
|
+
var keys = Object.keys(val).sort(compareFunction);
|
|
2612
|
+
for (i = 0; i < keys.length; i++) {
|
|
2613
|
+
var key = keys[i];
|
|
2614
|
+
deterministicDecirc(val[key], key, i, stack, val, depth, options);
|
|
2615
|
+
tmp[key] = val[key];
|
|
2616
|
+
}
|
|
2617
|
+
if (typeof parent !== "undefined") {
|
|
2618
|
+
arr.push([parent, k, val]);
|
|
2619
|
+
parent[k] = tmp;
|
|
2620
|
+
} else {
|
|
2621
|
+
return tmp;
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
stack.pop();
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
function replaceGetterValues(replacer) {
|
|
2628
|
+
replacer = typeof replacer !== "undefined" ? replacer : function(k, v) {
|
|
2629
|
+
return v;
|
|
2630
|
+
};
|
|
2631
|
+
return function(key, val) {
|
|
2632
|
+
if (replacerStack.length > 0) {
|
|
2633
|
+
for (var i = 0; i < replacerStack.length; i++) {
|
|
2634
|
+
var part = replacerStack[i];
|
|
2635
|
+
if (part[1] === key && part[0] === val) {
|
|
2636
|
+
val = part[2];
|
|
2637
|
+
replacerStack.splice(i, 1);
|
|
2638
|
+
break;
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
return replacer.call(this, key, val);
|
|
2643
|
+
};
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
});
|
|
2647
|
+
|
|
2648
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-error.js
|
|
2649
|
+
var require_prettify_error = __commonJS({
|
|
2650
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-error.js"(exports, module) {
|
|
2651
|
+
"use strict";
|
|
2652
|
+
module.exports = prettifyError;
|
|
2653
|
+
var joinLinesWithIndentation = require_join_lines_with_indentation();
|
|
2654
|
+
function prettifyError({ keyName, lines, eol, ident }) {
|
|
2655
|
+
let result = "";
|
|
2656
|
+
const joinedLines = joinLinesWithIndentation({ input: lines, ident, eol });
|
|
2657
|
+
const splitLines = `${ident}${keyName}: ${joinedLines}${eol}`.split(eol);
|
|
2658
|
+
for (let j = 0; j < splitLines.length; j += 1) {
|
|
2659
|
+
if (j !== 0) result += eol;
|
|
2660
|
+
const line = splitLines[j];
|
|
2661
|
+
if (/^\s*"stack"/.test(line)) {
|
|
2662
|
+
const matches = /^(\s*"stack":)\s*(".*"),?$/.exec(line);
|
|
2663
|
+
if (matches && matches.length === 3) {
|
|
2664
|
+
const indentSize = /^\s*/.exec(line)[0].length + 4;
|
|
2665
|
+
const indentation = " ".repeat(indentSize);
|
|
2666
|
+
const stackMessage = matches[2];
|
|
2667
|
+
result += matches[1] + eol + indentation + JSON.parse(stackMessage).replace(/\n/g, eol + indentation);
|
|
2668
|
+
} else {
|
|
2669
|
+
result += line;
|
|
2670
|
+
}
|
|
2671
|
+
} else {
|
|
2672
|
+
result += line;
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
return result;
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
});
|
|
2679
|
+
|
|
2680
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-object.js
|
|
2681
|
+
var require_prettify_object = __commonJS({
|
|
2682
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-object.js"(exports, module) {
|
|
2683
|
+
"use strict";
|
|
2684
|
+
module.exports = prettifyObject;
|
|
2685
|
+
var {
|
|
2686
|
+
LOGGER_KEYS
|
|
2687
|
+
} = require_constants();
|
|
2688
|
+
var stringifySafe = require_fast_safe_stringify();
|
|
2689
|
+
var joinLinesWithIndentation = require_join_lines_with_indentation();
|
|
2690
|
+
var prettifyError = require_prettify_error();
|
|
2691
|
+
function prettifyObject({
|
|
2692
|
+
log,
|
|
2693
|
+
excludeLoggerKeys = true,
|
|
2694
|
+
skipKeys = [],
|
|
2695
|
+
context
|
|
2696
|
+
}) {
|
|
2697
|
+
const {
|
|
2698
|
+
EOL: eol,
|
|
2699
|
+
IDENT: ident,
|
|
2700
|
+
customPrettifiers,
|
|
2701
|
+
errorLikeObjectKeys: errorLikeKeys,
|
|
2702
|
+
objectColorizer,
|
|
2703
|
+
singleLine,
|
|
2704
|
+
colorizer
|
|
2705
|
+
} = context;
|
|
2706
|
+
const keysToIgnore = [].concat(skipKeys);
|
|
2707
|
+
if (excludeLoggerKeys === true) Array.prototype.push.apply(keysToIgnore, LOGGER_KEYS);
|
|
2708
|
+
let result = "";
|
|
2709
|
+
const { plain, errors } = Object.entries(log).reduce(({ plain: plain2, errors: errors2 }, [k, v]) => {
|
|
2710
|
+
if (keysToIgnore.includes(k) === false) {
|
|
2711
|
+
const pretty = typeof customPrettifiers[k] === "function" ? customPrettifiers[k](v, k, log, { colors: colorizer.colors }) : v;
|
|
2712
|
+
if (errorLikeKeys.includes(k)) {
|
|
2713
|
+
errors2[k] = pretty;
|
|
2714
|
+
} else {
|
|
2715
|
+
plain2[k] = pretty;
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
return { plain: plain2, errors: errors2 };
|
|
2719
|
+
}, { plain: {}, errors: {} });
|
|
2720
|
+
if (singleLine) {
|
|
2721
|
+
if (Object.keys(plain).length > 0) {
|
|
2722
|
+
result += objectColorizer.greyMessage(stringifySafe(plain));
|
|
2723
|
+
}
|
|
2724
|
+
result += eol;
|
|
2725
|
+
result = result.replace(/\\\\/gi, "\\");
|
|
2726
|
+
} else {
|
|
2727
|
+
Object.entries(plain).forEach(([keyName, keyValue]) => {
|
|
2728
|
+
let lines = typeof customPrettifiers[keyName] === "function" ? keyValue : stringifySafe(keyValue, null, 2);
|
|
2729
|
+
if (lines === void 0) return;
|
|
2730
|
+
lines = lines.replace(/\\\\/gi, "\\");
|
|
2731
|
+
const joinedLines = joinLinesWithIndentation({ input: lines, ident, eol });
|
|
2732
|
+
result += `${ident}${objectColorizer.property(keyName)}:${joinedLines.startsWith(eol) ? "" : " "}${joinedLines}${eol}`;
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
Object.entries(errors).forEach(([keyName, keyValue]) => {
|
|
2736
|
+
const lines = typeof customPrettifiers[keyName] === "function" ? keyValue : stringifySafe(keyValue, null, 2);
|
|
2737
|
+
if (lines === void 0) return;
|
|
2738
|
+
result += prettifyError({ keyName, lines, eol, ident });
|
|
2739
|
+
});
|
|
2740
|
+
return result;
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
});
|
|
2744
|
+
|
|
2745
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-error-log.js
|
|
2746
|
+
var require_prettify_error_log = __commonJS({
|
|
2747
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-error-log.js"(exports, module) {
|
|
2748
|
+
"use strict";
|
|
2749
|
+
module.exports = prettifyErrorLog;
|
|
2750
|
+
var {
|
|
2751
|
+
LOGGER_KEYS
|
|
2752
|
+
} = require_constants();
|
|
2753
|
+
var isObject = require_is_object();
|
|
2754
|
+
var joinLinesWithIndentation = require_join_lines_with_indentation();
|
|
2755
|
+
var prettifyObject = require_prettify_object();
|
|
2756
|
+
function prettifyErrorLog({ log, context }) {
|
|
2757
|
+
const {
|
|
2758
|
+
EOL: eol,
|
|
2759
|
+
IDENT: ident,
|
|
2760
|
+
errorProps: errorProperties,
|
|
2761
|
+
messageKey
|
|
2762
|
+
} = context;
|
|
2763
|
+
const stack = log.stack;
|
|
2764
|
+
const joinedLines = joinLinesWithIndentation({ input: stack, ident, eol });
|
|
2765
|
+
let result = `${ident}${joinedLines}${eol}`;
|
|
2766
|
+
if (errorProperties.length > 0) {
|
|
2767
|
+
const excludeProperties = LOGGER_KEYS.concat(messageKey, "type", "stack");
|
|
2768
|
+
let propertiesToPrint;
|
|
2769
|
+
if (errorProperties[0] === "*") {
|
|
2770
|
+
propertiesToPrint = Object.keys(log).filter((k) => excludeProperties.includes(k) === false);
|
|
2771
|
+
} else {
|
|
2772
|
+
propertiesToPrint = errorProperties.filter((k) => excludeProperties.includes(k) === false);
|
|
2773
|
+
}
|
|
2774
|
+
for (let i = 0; i < propertiesToPrint.length; i += 1) {
|
|
2775
|
+
const key = propertiesToPrint[i];
|
|
2776
|
+
if (key in log === false) continue;
|
|
2777
|
+
if (isObject(log[key])) {
|
|
2778
|
+
const prettifiedObject = prettifyObject({
|
|
2779
|
+
log: log[key],
|
|
2780
|
+
excludeLoggerKeys: false,
|
|
2781
|
+
context: {
|
|
2782
|
+
...context,
|
|
2783
|
+
IDENT: ident + ident
|
|
2784
|
+
}
|
|
2785
|
+
});
|
|
2786
|
+
result = `${result}${ident}${key}: {${eol}${prettifiedObject}${ident}}${eol}`;
|
|
2787
|
+
continue;
|
|
2788
|
+
}
|
|
2789
|
+
result = `${result}${ident}${key}: ${log[key]}${eol}`;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
return result;
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
});
|
|
2796
|
+
|
|
2797
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-level.js
|
|
2798
|
+
var require_prettify_level = __commonJS({
|
|
2799
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-level.js"(exports, module) {
|
|
2800
|
+
"use strict";
|
|
2801
|
+
module.exports = prettifyLevel;
|
|
2802
|
+
var getPropertyValue = require_get_property_value();
|
|
2803
|
+
function prettifyLevel({ log, context }) {
|
|
2804
|
+
const {
|
|
2805
|
+
colorizer,
|
|
2806
|
+
customLevels,
|
|
2807
|
+
customLevelNames,
|
|
2808
|
+
levelKey,
|
|
2809
|
+
getLevelLabelData
|
|
2810
|
+
} = context;
|
|
2811
|
+
const prettifier = context.customPrettifiers?.level;
|
|
2812
|
+
const output = getPropertyValue(log, levelKey);
|
|
2813
|
+
if (output === void 0) return void 0;
|
|
2814
|
+
const labelColorized = colorizer(output, { customLevels, customLevelNames });
|
|
2815
|
+
if (prettifier) {
|
|
2816
|
+
const [label] = getLevelLabelData(output);
|
|
2817
|
+
return prettifier(output, levelKey, log, { label, labelColorized, colors: colorizer.colors });
|
|
2818
|
+
}
|
|
2819
|
+
return labelColorized;
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2823
|
+
|
|
2824
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-message.js
|
|
2825
|
+
var require_prettify_message = __commonJS({
|
|
2826
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-message.js"(exports, module) {
|
|
2827
|
+
"use strict";
|
|
2828
|
+
module.exports = prettifyMessage;
|
|
2829
|
+
var {
|
|
2830
|
+
LEVELS
|
|
2831
|
+
} = require_constants();
|
|
2832
|
+
var getPropertyValue = require_get_property_value();
|
|
2833
|
+
var interpretConditionals = require_interpret_conditionals();
|
|
2834
|
+
function prettifyMessage({ log, context }) {
|
|
2835
|
+
const {
|
|
2836
|
+
colorizer,
|
|
2837
|
+
customLevels,
|
|
2838
|
+
levelKey,
|
|
2839
|
+
levelLabel,
|
|
2840
|
+
messageFormat,
|
|
2841
|
+
messageKey,
|
|
2842
|
+
useOnlyCustomProps
|
|
2843
|
+
} = context;
|
|
2844
|
+
if (messageFormat && typeof messageFormat === "string") {
|
|
2845
|
+
const parsedMessageFormat = interpretConditionals(messageFormat, log);
|
|
2846
|
+
const message = String(parsedMessageFormat).replace(
|
|
2847
|
+
/{([^{}]+)}/g,
|
|
2848
|
+
function(match, p1) {
|
|
2849
|
+
let level;
|
|
2850
|
+
if (p1 === levelLabel && (level = getPropertyValue(log, levelKey)) !== void 0) {
|
|
2851
|
+
const condition = useOnlyCustomProps ? customLevels === void 0 : customLevels[level] === void 0;
|
|
2852
|
+
return condition ? LEVELS[level] : customLevels[level];
|
|
2853
|
+
}
|
|
2854
|
+
const value = getPropertyValue(log, p1);
|
|
2855
|
+
return value !== void 0 ? value : "";
|
|
2856
|
+
}
|
|
2857
|
+
);
|
|
2858
|
+
return colorizer.message(message);
|
|
2859
|
+
}
|
|
2860
|
+
if (messageFormat && typeof messageFormat === "function") {
|
|
2861
|
+
const msg = messageFormat(log, messageKey, levelLabel, { colors: colorizer.colors });
|
|
2862
|
+
return colorizer.message(msg);
|
|
2863
|
+
}
|
|
2864
|
+
if (messageKey in log === false) return void 0;
|
|
2865
|
+
if (typeof log[messageKey] !== "string" && typeof log[messageKey] !== "number" && typeof log[messageKey] !== "boolean") return void 0;
|
|
2866
|
+
return colorizer.message(log[messageKey]);
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
});
|
|
2870
|
+
|
|
2871
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-metadata.js
|
|
2872
|
+
var require_prettify_metadata = __commonJS({
|
|
2873
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-metadata.js"(exports, module) {
|
|
2874
|
+
"use strict";
|
|
2875
|
+
module.exports = prettifyMetadata;
|
|
2876
|
+
function prettifyMetadata({ log, context }) {
|
|
2877
|
+
const { customPrettifiers: prettifiers, colorizer } = context;
|
|
2878
|
+
let line = "";
|
|
2879
|
+
if (log.name || log.pid || log.hostname) {
|
|
2880
|
+
line += "(";
|
|
2881
|
+
if (log.name) {
|
|
2882
|
+
line += prettifiers.name ? prettifiers.name(log.name, "name", log, { colors: colorizer.colors }) : log.name;
|
|
2883
|
+
}
|
|
2884
|
+
if (log.pid) {
|
|
2885
|
+
const prettyPid = prettifiers.pid ? prettifiers.pid(log.pid, "pid", log, { colors: colorizer.colors }) : log.pid;
|
|
2886
|
+
if (log.name && log.pid) {
|
|
2887
|
+
line += "/" + prettyPid;
|
|
2888
|
+
} else {
|
|
2889
|
+
line += prettyPid;
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
if (log.hostname) {
|
|
2893
|
+
const prettyHostname = prettifiers.hostname ? prettifiers.hostname(log.hostname, "hostname", log, { colors: colorizer.colors }) : log.hostname;
|
|
2894
|
+
line += `${line === "(" ? "on" : " on"} ${prettyHostname}`;
|
|
2895
|
+
}
|
|
2896
|
+
line += ")";
|
|
2897
|
+
}
|
|
2898
|
+
if (log.caller) {
|
|
2899
|
+
const prettyCaller = prettifiers.caller ? prettifiers.caller(log.caller, "caller", log, { colors: colorizer.colors }) : log.caller;
|
|
2900
|
+
line += `${line === "" ? "" : " "}<${prettyCaller}>`;
|
|
2901
|
+
}
|
|
2902
|
+
if (line === "") {
|
|
2903
|
+
return void 0;
|
|
2904
|
+
} else {
|
|
2905
|
+
return line;
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
});
|
|
2910
|
+
|
|
2911
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-time.js
|
|
2912
|
+
var require_prettify_time = __commonJS({
|
|
2913
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-time.js"(exports, module) {
|
|
2914
|
+
"use strict";
|
|
2915
|
+
module.exports = prettifyTime;
|
|
2916
|
+
var formatTime = require_format_time();
|
|
2917
|
+
function prettifyTime({ log, context }) {
|
|
2918
|
+
const {
|
|
2919
|
+
timestampKey,
|
|
2920
|
+
translateTime: translateFormat
|
|
2921
|
+
} = context;
|
|
2922
|
+
const prettifier = context.customPrettifiers?.time;
|
|
2923
|
+
let time = null;
|
|
2924
|
+
if (timestampKey in log) {
|
|
2925
|
+
time = log[timestampKey];
|
|
2926
|
+
} else if ("timestamp" in log) {
|
|
2927
|
+
time = log.timestamp;
|
|
2928
|
+
}
|
|
2929
|
+
if (time === null) return void 0;
|
|
2930
|
+
const output = translateFormat ? formatTime(time, translateFormat) : time;
|
|
2931
|
+
return prettifier ? prettifier(output) : `[${output}]`;
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
});
|
|
2935
|
+
|
|
2936
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/index.js
|
|
2937
|
+
var require_utils = __commonJS({
|
|
2938
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/index.js"(exports, module) {
|
|
2939
|
+
"use strict";
|
|
2940
|
+
module.exports = {
|
|
2941
|
+
buildSafeSonicBoom: require_build_safe_sonic_boom(),
|
|
2942
|
+
createDate: require_create_date(),
|
|
2943
|
+
deleteLogProperty: require_delete_log_property(),
|
|
2944
|
+
filterLog: require_filter_log(),
|
|
2945
|
+
formatTime: require_format_time(),
|
|
2946
|
+
getPropertyValue: require_get_property_value(),
|
|
2947
|
+
handleCustomLevelsNamesOpts: require_handle_custom_levels_names_opts(),
|
|
2948
|
+
handleCustomLevelsOpts: require_handle_custom_levels_opts(),
|
|
2949
|
+
interpretConditionals: require_interpret_conditionals(),
|
|
2950
|
+
isObject: require_is_object(),
|
|
2951
|
+
isValidDate: require_is_valid_date(),
|
|
2952
|
+
joinLinesWithIndentation: require_join_lines_with_indentation(),
|
|
2953
|
+
noop: require_noop(),
|
|
2954
|
+
parseFactoryOptions: require_parse_factory_options(),
|
|
2955
|
+
prettifyErrorLog: require_prettify_error_log(),
|
|
2956
|
+
prettifyError: require_prettify_error(),
|
|
2957
|
+
prettifyLevel: require_prettify_level(),
|
|
2958
|
+
prettifyMessage: require_prettify_message(),
|
|
2959
|
+
prettifyMetadata: require_prettify_metadata(),
|
|
2960
|
+
prettifyObject: require_prettify_object(),
|
|
2961
|
+
prettifyTime: require_prettify_time(),
|
|
2962
|
+
splitPropertyKey: require_split_property_key(),
|
|
2963
|
+
getLevelLabelData: require_get_level_label_data()
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
});
|
|
2967
|
+
|
|
2968
|
+
// ../../node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.js
|
|
2969
|
+
var require_secure_json_parse = __commonJS({
|
|
2970
|
+
"../../node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.js"(exports, module) {
|
|
2971
|
+
"use strict";
|
|
2972
|
+
var hasBuffer = typeof Buffer !== "undefined";
|
|
2973
|
+
var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
2974
|
+
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
2975
|
+
function _parse(text, reviver, options) {
|
|
2976
|
+
if (options == null) {
|
|
2977
|
+
if (reviver !== null && typeof reviver === "object") {
|
|
2978
|
+
options = reviver;
|
|
2979
|
+
reviver = void 0;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
if (hasBuffer && Buffer.isBuffer(text)) {
|
|
2983
|
+
text = text.toString();
|
|
2984
|
+
}
|
|
2985
|
+
if (text && text.charCodeAt(0) === 65279) {
|
|
2986
|
+
text = text.slice(1);
|
|
2987
|
+
}
|
|
2988
|
+
const obj = JSON.parse(text, reviver);
|
|
2989
|
+
if (obj === null || typeof obj !== "object") {
|
|
2990
|
+
return obj;
|
|
2991
|
+
}
|
|
2992
|
+
const protoAction = options && options.protoAction || "error";
|
|
2993
|
+
const constructorAction = options && options.constructorAction || "error";
|
|
2994
|
+
if (protoAction === "ignore" && constructorAction === "ignore") {
|
|
2995
|
+
return obj;
|
|
2996
|
+
}
|
|
2997
|
+
if (protoAction !== "ignore" && constructorAction !== "ignore") {
|
|
2998
|
+
if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) {
|
|
2999
|
+
return obj;
|
|
3000
|
+
}
|
|
3001
|
+
} else if (protoAction !== "ignore" && constructorAction === "ignore") {
|
|
3002
|
+
if (suspectProtoRx.test(text) === false) {
|
|
3003
|
+
return obj;
|
|
3004
|
+
}
|
|
3005
|
+
} else {
|
|
3006
|
+
if (suspectConstructorRx.test(text) === false) {
|
|
3007
|
+
return obj;
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
return filter(obj, { protoAction, constructorAction, safe: options && options.safe });
|
|
3011
|
+
}
|
|
3012
|
+
function filter(obj, { protoAction = "error", constructorAction = "error", safe } = {}) {
|
|
3013
|
+
let next = [obj];
|
|
3014
|
+
while (next.length) {
|
|
3015
|
+
const nodes = next;
|
|
3016
|
+
next = [];
|
|
3017
|
+
for (const node of nodes) {
|
|
3018
|
+
if (protoAction !== "ignore" && Object.prototype.hasOwnProperty.call(node, "__proto__")) {
|
|
3019
|
+
if (safe === true) {
|
|
3020
|
+
return null;
|
|
3021
|
+
} else if (protoAction === "error") {
|
|
3022
|
+
throw new SyntaxError("Object contains forbidden prototype property");
|
|
3023
|
+
}
|
|
3024
|
+
delete node.__proto__;
|
|
3025
|
+
}
|
|
3026
|
+
if (constructorAction !== "ignore" && Object.prototype.hasOwnProperty.call(node, "constructor") && node.constructor !== null && typeof node.constructor === "object" && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) {
|
|
3027
|
+
if (safe === true) {
|
|
3028
|
+
return null;
|
|
3029
|
+
} else if (constructorAction === "error") {
|
|
3030
|
+
throw new SyntaxError("Object contains forbidden prototype property");
|
|
3031
|
+
}
|
|
3032
|
+
delete node.constructor;
|
|
3033
|
+
}
|
|
3034
|
+
for (const key in node) {
|
|
3035
|
+
const value = node[key];
|
|
3036
|
+
if (value && typeof value === "object") {
|
|
3037
|
+
next.push(value);
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
return obj;
|
|
3043
|
+
}
|
|
3044
|
+
function parse(text, reviver, options) {
|
|
3045
|
+
const { stackTraceLimit } = Error;
|
|
3046
|
+
Error.stackTraceLimit = 0;
|
|
3047
|
+
try {
|
|
3048
|
+
return _parse(text, reviver, options);
|
|
3049
|
+
} finally {
|
|
3050
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
function safeParse(text, reviver) {
|
|
3054
|
+
const { stackTraceLimit } = Error;
|
|
3055
|
+
Error.stackTraceLimit = 0;
|
|
3056
|
+
try {
|
|
3057
|
+
return _parse(text, reviver, { safe: true });
|
|
3058
|
+
} catch {
|
|
3059
|
+
return void 0;
|
|
3060
|
+
} finally {
|
|
3061
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
module.exports = parse;
|
|
3065
|
+
module.exports.default = parse;
|
|
3066
|
+
module.exports.parse = parse;
|
|
3067
|
+
module.exports.safeParse = safeParse;
|
|
3068
|
+
module.exports.scan = filter;
|
|
3069
|
+
}
|
|
3070
|
+
});
|
|
3071
|
+
|
|
3072
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/pretty.js
|
|
3073
|
+
var require_pretty = __commonJS({
|
|
3074
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/pretty.js"(exports, module) {
|
|
3075
|
+
"use strict";
|
|
3076
|
+
module.exports = pretty;
|
|
3077
|
+
var sjs = require_secure_json_parse();
|
|
3078
|
+
var isObject = require_is_object();
|
|
3079
|
+
var prettifyErrorLog = require_prettify_error_log();
|
|
3080
|
+
var prettifyLevel = require_prettify_level();
|
|
3081
|
+
var prettifyMessage = require_prettify_message();
|
|
3082
|
+
var prettifyMetadata = require_prettify_metadata();
|
|
3083
|
+
var prettifyObject = require_prettify_object();
|
|
3084
|
+
var prettifyTime = require_prettify_time();
|
|
3085
|
+
var filterLog = require_filter_log();
|
|
3086
|
+
var {
|
|
3087
|
+
LEVELS,
|
|
3088
|
+
LEVEL_KEY,
|
|
3089
|
+
LEVEL_NAMES
|
|
3090
|
+
} = require_constants();
|
|
3091
|
+
var jsonParser = (input) => {
|
|
3092
|
+
try {
|
|
3093
|
+
return { value: sjs.parse(input, { protoAction: "remove" }) };
|
|
3094
|
+
} catch (err) {
|
|
3095
|
+
return { err };
|
|
3096
|
+
}
|
|
3097
|
+
};
|
|
3098
|
+
function pretty(inputData) {
|
|
3099
|
+
let log;
|
|
3100
|
+
if (!isObject(inputData)) {
|
|
3101
|
+
const parsed = jsonParser(inputData);
|
|
3102
|
+
if (parsed.err || !isObject(parsed.value)) {
|
|
3103
|
+
return inputData + this.EOL;
|
|
3104
|
+
}
|
|
3105
|
+
log = parsed.value;
|
|
3106
|
+
} else {
|
|
3107
|
+
log = inputData;
|
|
3108
|
+
}
|
|
3109
|
+
if (this.minimumLevel) {
|
|
3110
|
+
let condition;
|
|
3111
|
+
if (this.useOnlyCustomProps) {
|
|
3112
|
+
condition = this.customLevels;
|
|
3113
|
+
} else {
|
|
3114
|
+
condition = this.customLevelNames[this.minimumLevel] !== void 0;
|
|
3115
|
+
}
|
|
3116
|
+
let minimum;
|
|
3117
|
+
if (condition) {
|
|
3118
|
+
minimum = this.customLevelNames[this.minimumLevel];
|
|
3119
|
+
} else {
|
|
3120
|
+
minimum = LEVEL_NAMES[this.minimumLevel];
|
|
3121
|
+
}
|
|
3122
|
+
if (!minimum) {
|
|
3123
|
+
minimum = typeof this.minimumLevel === "string" ? LEVEL_NAMES[this.minimumLevel] : LEVEL_NAMES[LEVELS[this.minimumLevel].toLowerCase()];
|
|
3124
|
+
}
|
|
3125
|
+
const level = log[this.levelKey === void 0 ? LEVEL_KEY : this.levelKey];
|
|
3126
|
+
if (level < minimum) return;
|
|
3127
|
+
}
|
|
3128
|
+
const prettifiedMessage = prettifyMessage({ log, context: this.context });
|
|
3129
|
+
if (this.ignoreKeys || this.includeKeys) {
|
|
3130
|
+
log = filterLog({ log, context: this.context });
|
|
3131
|
+
}
|
|
3132
|
+
const prettifiedLevel = prettifyLevel({
|
|
3133
|
+
log,
|
|
3134
|
+
context: {
|
|
3135
|
+
...this.context,
|
|
3136
|
+
// This is odd. The colorizer ends up relying on the value of
|
|
3137
|
+
// `customProperties` instead of the original `customLevels` and
|
|
3138
|
+
// `customLevelNames`.
|
|
3139
|
+
...this.context.customProperties
|
|
3140
|
+
}
|
|
3141
|
+
});
|
|
3142
|
+
const prettifiedMetadata = prettifyMetadata({ log, context: this.context });
|
|
3143
|
+
const prettifiedTime = prettifyTime({ log, context: this.context });
|
|
3144
|
+
let line = "";
|
|
3145
|
+
if (this.levelFirst && prettifiedLevel) {
|
|
3146
|
+
line = `${prettifiedLevel}`;
|
|
3147
|
+
}
|
|
3148
|
+
if (prettifiedTime && line === "") {
|
|
3149
|
+
line = `${prettifiedTime}`;
|
|
3150
|
+
} else if (prettifiedTime) {
|
|
3151
|
+
line = `${line} ${prettifiedTime}`;
|
|
3152
|
+
}
|
|
3153
|
+
if (!this.levelFirst && prettifiedLevel) {
|
|
3154
|
+
if (line.length > 0) {
|
|
3155
|
+
line = `${line} ${prettifiedLevel}`;
|
|
3156
|
+
} else {
|
|
3157
|
+
line = prettifiedLevel;
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
if (prettifiedMetadata) {
|
|
3161
|
+
if (line.length > 0) {
|
|
3162
|
+
line = `${line} ${prettifiedMetadata}:`;
|
|
3163
|
+
} else {
|
|
3164
|
+
line = prettifiedMetadata;
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
if (line.endsWith(":") === false && line !== "") {
|
|
3168
|
+
line += ":";
|
|
3169
|
+
}
|
|
3170
|
+
if (prettifiedMessage !== void 0) {
|
|
3171
|
+
if (line.length > 0) {
|
|
3172
|
+
line = `${line} ${prettifiedMessage}`;
|
|
3173
|
+
} else {
|
|
3174
|
+
line = prettifiedMessage;
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
if (line.length > 0 && !this.singleLine) {
|
|
3178
|
+
line += this.EOL;
|
|
3179
|
+
}
|
|
3180
|
+
if (log.type === "Error" && typeof log.stack === "string") {
|
|
3181
|
+
const prettifiedErrorLog = prettifyErrorLog({ log, context: this.context });
|
|
3182
|
+
if (this.singleLine) line += this.EOL;
|
|
3183
|
+
line += prettifiedErrorLog;
|
|
3184
|
+
} else if (this.hideObject === false) {
|
|
3185
|
+
const skipKeys = [
|
|
3186
|
+
this.messageKey,
|
|
3187
|
+
this.levelKey,
|
|
3188
|
+
this.timestampKey
|
|
3189
|
+
].map((key) => key.replaceAll(/\\/g, "")).filter((key) => {
|
|
3190
|
+
return typeof log[key] === "string" || typeof log[key] === "number" || typeof log[key] === "boolean";
|
|
3191
|
+
});
|
|
3192
|
+
const prettifiedObject = prettifyObject({
|
|
3193
|
+
log,
|
|
3194
|
+
skipKeys,
|
|
3195
|
+
context: this.context
|
|
3196
|
+
});
|
|
3197
|
+
if (this.singleLine && !/^\s$/.test(prettifiedObject)) {
|
|
3198
|
+
line += " ";
|
|
3199
|
+
}
|
|
3200
|
+
line += prettifiedObject;
|
|
3201
|
+
}
|
|
3202
|
+
return line;
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
3205
|
+
});
|
|
3206
|
+
|
|
3207
|
+
// ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/index.js
|
|
3208
|
+
var require_pino_pretty = __commonJS({
|
|
3209
|
+
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/index.js"(exports, module) {
|
|
3210
|
+
var { isColorSupported } = require_colorette();
|
|
3211
|
+
var pump = require_pump();
|
|
3212
|
+
var { Transform } = __require("node:stream");
|
|
3213
|
+
var abstractTransport = require_pino_abstract_transport();
|
|
3214
|
+
var colors = require_colors();
|
|
3215
|
+
var {
|
|
3216
|
+
ERROR_LIKE_KEYS,
|
|
3217
|
+
LEVEL_KEY,
|
|
3218
|
+
LEVEL_LABEL,
|
|
3219
|
+
MESSAGE_KEY,
|
|
3220
|
+
TIMESTAMP_KEY
|
|
3221
|
+
} = require_constants();
|
|
3222
|
+
var {
|
|
3223
|
+
buildSafeSonicBoom,
|
|
3224
|
+
parseFactoryOptions
|
|
3225
|
+
} = require_utils();
|
|
3226
|
+
var pretty = require_pretty();
|
|
3227
|
+
var defaultOptions = {
|
|
3228
|
+
colorize: isColorSupported,
|
|
3229
|
+
colorizeObjects: true,
|
|
3230
|
+
crlf: false,
|
|
3231
|
+
customColors: null,
|
|
3232
|
+
customLevels: null,
|
|
3233
|
+
customPrettifiers: {},
|
|
3234
|
+
errorLikeObjectKeys: ERROR_LIKE_KEYS,
|
|
3235
|
+
errorProps: "",
|
|
3236
|
+
hideObject: false,
|
|
3237
|
+
ignore: "hostname",
|
|
3238
|
+
include: void 0,
|
|
3239
|
+
levelFirst: false,
|
|
3240
|
+
levelKey: LEVEL_KEY,
|
|
3241
|
+
levelLabel: LEVEL_LABEL,
|
|
3242
|
+
messageFormat: null,
|
|
3243
|
+
messageKey: MESSAGE_KEY,
|
|
3244
|
+
minimumLevel: void 0,
|
|
3245
|
+
outputStream: process.stdout,
|
|
3246
|
+
singleLine: false,
|
|
3247
|
+
timestampKey: TIMESTAMP_KEY,
|
|
3248
|
+
translateTime: true,
|
|
3249
|
+
useOnlyCustomProps: true
|
|
3250
|
+
};
|
|
3251
|
+
function prettyFactory(options) {
|
|
3252
|
+
const context = parseFactoryOptions(Object.assign({}, defaultOptions, options));
|
|
3253
|
+
return pretty.bind({ ...context, context });
|
|
3254
|
+
}
|
|
3255
|
+
function build(opts = {}) {
|
|
3256
|
+
let pretty2 = prettyFactory(opts);
|
|
3257
|
+
let destination;
|
|
3258
|
+
return abstractTransport(function(source) {
|
|
3259
|
+
source.on("message", function pinoConfigListener(message) {
|
|
3260
|
+
if (!message || message.code !== "PINO_CONFIG") return;
|
|
3261
|
+
Object.assign(opts, {
|
|
3262
|
+
messageKey: message.config.messageKey,
|
|
3263
|
+
errorLikeObjectKeys: Array.from(/* @__PURE__ */ new Set([...opts.errorLikeObjectKeys || ERROR_LIKE_KEYS, message.config.errorKey])),
|
|
3264
|
+
customLevels: message.config.levels.values
|
|
3265
|
+
});
|
|
3266
|
+
pretty2 = prettyFactory(opts);
|
|
3267
|
+
source.off("message", pinoConfigListener);
|
|
3268
|
+
});
|
|
3269
|
+
const stream = new Transform({
|
|
3270
|
+
objectMode: true,
|
|
3271
|
+
autoDestroy: true,
|
|
3272
|
+
transform(chunk, enc, cb) {
|
|
3273
|
+
const line = pretty2(chunk);
|
|
3274
|
+
cb(null, line);
|
|
3275
|
+
}
|
|
3276
|
+
});
|
|
3277
|
+
if (typeof opts.destination === "object" && typeof opts.destination.write === "function") {
|
|
3278
|
+
destination = opts.destination;
|
|
3279
|
+
} else {
|
|
3280
|
+
destination = buildSafeSonicBoom({
|
|
3281
|
+
dest: opts.destination || 1,
|
|
3282
|
+
append: opts.append,
|
|
3283
|
+
mkdir: opts.mkdir,
|
|
3284
|
+
sync: opts.sync
|
|
3285
|
+
// by default sonic will be async
|
|
3286
|
+
});
|
|
3287
|
+
}
|
|
3288
|
+
source.on("unknown", function(line) {
|
|
3289
|
+
destination.write(line + "\n");
|
|
3290
|
+
});
|
|
3291
|
+
pump(source, stream, destination);
|
|
3292
|
+
return stream;
|
|
3293
|
+
}, {
|
|
3294
|
+
parse: "lines",
|
|
3295
|
+
close(err, cb) {
|
|
3296
|
+
destination.on("close", () => {
|
|
3297
|
+
cb(err);
|
|
3298
|
+
});
|
|
3299
|
+
}
|
|
3300
|
+
});
|
|
3301
|
+
}
|
|
3302
|
+
module.exports = build;
|
|
3303
|
+
module.exports.build = build;
|
|
3304
|
+
module.exports.PinoPretty = build;
|
|
3305
|
+
module.exports.prettyFactory = prettyFactory;
|
|
3306
|
+
module.exports.colorizerFactory = colors;
|
|
3307
|
+
module.exports.isColorSupported = isColorSupported;
|
|
3308
|
+
module.exports.default = build;
|
|
3309
|
+
}
|
|
3310
|
+
});
|
|
3311
|
+
export default require_pino_pretty();
|
|
3312
|
+
//# sourceMappingURL=pino-pretty.mjs.map
|