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