@rife/logger 0.0.5-beta.9 → 0.0.6-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/common.cjs +51 -0
- package/dist/cjs/env.cjs +40 -0
- package/dist/cjs/index.cjs +60 -0
- package/dist/cjs/pino/index.cjs +107 -0
- package/dist/cjs/pino/rotate.cjs +72 -0
- package/dist/cjs/test.cjs +36 -0
- package/dist/cjs/trace.cjs +52 -0
- package/dist/esm/common.mjs +8 -0
- package/dist/esm/env.mjs +5 -0
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/pino/index.mjs +67 -0
- package/dist/esm/pino/rotate.mjs +40 -0
- package/dist/esm/test.mjs +32 -0
- package/dist/esm/trace.mjs +14 -0
- package/dist/worker/pino-file.cjs +3522 -0
- package/dist/worker/pino-pretty.cjs +2856 -0
- package/dist/worker/pino-rotate.cjs +604 -0
- package/dist/worker/pino-worker.cjs +3835 -0
- package/dist/worker/thread-stream.cjs +172 -0
- package/package.json +33 -11
- package/src/common.ts +4 -0
- package/src/env.ts +3 -0
- package/src/index.ts +1 -194
- package/src/pino/index.ts +102 -0
- package/src/pino/rotate.ts +32 -0
- package/src/test.ts +19 -25
- package/src/trace.ts +15 -0
- package/tsconfig.json +12 -12
- package/dist/index.d.ts +0 -54
- package/dist/index.js +0 -131
- package/dist/test.d.ts +0 -1
- package/dist/test.js +0 -22
- package/dist/trace.d.ts +0 -0
- package/dist/trace.js +0 -1
|
@@ -0,0 +1,3835 @@
|
|
|
1
|
+
var __webpack_modules__ = {
|
|
2
|
+
"../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js": function(module1) {
|
|
3
|
+
"use strict";
|
|
4
|
+
if ('undefined' != typeof SharedArrayBuffer && 'undefined' != typeof Atomics) {
|
|
5
|
+
const nil = new Int32Array(new SharedArrayBuffer(4));
|
|
6
|
+
function sleep(ms) {
|
|
7
|
+
const valid = ms > 0 && ms < 1 / 0;
|
|
8
|
+
if (false === valid) {
|
|
9
|
+
if ('number' != typeof ms && 'bigint' != typeof ms) throw TypeError('sleep: ms must be a number');
|
|
10
|
+
throw RangeError('sleep: ms must be a number that is greater than 0 but less than Infinity');
|
|
11
|
+
}
|
|
12
|
+
Atomics.wait(nil, 0, 0, Number(ms));
|
|
13
|
+
}
|
|
14
|
+
module1.exports = sleep;
|
|
15
|
+
} else {
|
|
16
|
+
function sleep1(ms) {
|
|
17
|
+
const valid = ms > 0 && ms < 1 / 0;
|
|
18
|
+
if (false === valid) {
|
|
19
|
+
if ('number' != typeof ms && 'bigint' != typeof ms) throw TypeError('sleep: ms must be a number');
|
|
20
|
+
throw RangeError('sleep: ms must be a number that is greater than 0 but less than Infinity');
|
|
21
|
+
}
|
|
22
|
+
const target = Date.now() + Number(ms);
|
|
23
|
+
while(target > Date.now());
|
|
24
|
+
}
|
|
25
|
+
module1.exports = sleep1;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
29
|
+
"use strict";
|
|
30
|
+
const validator = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/validator.js");
|
|
31
|
+
const parse = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/parse.js");
|
|
32
|
+
const redactor = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/redactor.js");
|
|
33
|
+
const restorer = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/restorer.js");
|
|
34
|
+
const { groupRedact, nestedRedact } = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/modifiers.js");
|
|
35
|
+
const state = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/state.js");
|
|
36
|
+
const rx = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/rx.js");
|
|
37
|
+
const validate = validator();
|
|
38
|
+
const noop = (o)=>o;
|
|
39
|
+
noop.restore = noop;
|
|
40
|
+
const DEFAULT_CENSOR = '[REDACTED]';
|
|
41
|
+
fastRedact.rx = rx;
|
|
42
|
+
fastRedact.validator = validator;
|
|
43
|
+
module1.exports = fastRedact;
|
|
44
|
+
function fastRedact(opts = {}) {
|
|
45
|
+
const paths = Array.from(new Set(opts.paths || []));
|
|
46
|
+
const serialize = 'serialize' in opts ? false === opts.serialize ? opts.serialize : 'function' == typeof opts.serialize ? opts.serialize : JSON.stringify : JSON.stringify;
|
|
47
|
+
const remove = opts.remove;
|
|
48
|
+
if (true === remove && serialize !== JSON.stringify) throw Error('fast-redact – remove option may only be set when serializer is JSON.stringify');
|
|
49
|
+
const censor = true === remove ? void 0 : 'censor' in opts ? opts.censor : DEFAULT_CENSOR;
|
|
50
|
+
const isCensorFct = 'function' == typeof censor;
|
|
51
|
+
const censorFctTakesPath = isCensorFct && censor.length > 1;
|
|
52
|
+
if (0 === paths.length) return serialize || noop;
|
|
53
|
+
validate({
|
|
54
|
+
paths,
|
|
55
|
+
serialize,
|
|
56
|
+
censor
|
|
57
|
+
});
|
|
58
|
+
const { wildcards, wcLen, secret } = parse({
|
|
59
|
+
paths,
|
|
60
|
+
censor
|
|
61
|
+
});
|
|
62
|
+
const compileRestore = restorer();
|
|
63
|
+
const strict = 'strict' in opts ? opts.strict : true;
|
|
64
|
+
return redactor({
|
|
65
|
+
secret,
|
|
66
|
+
wcLen,
|
|
67
|
+
serialize,
|
|
68
|
+
strict,
|
|
69
|
+
isCensorFct,
|
|
70
|
+
censorFctTakesPath
|
|
71
|
+
}, state({
|
|
72
|
+
secret,
|
|
73
|
+
censor,
|
|
74
|
+
compileRestore,
|
|
75
|
+
serialize,
|
|
76
|
+
groupRedact,
|
|
77
|
+
nestedRedact,
|
|
78
|
+
wildcards,
|
|
79
|
+
wcLen
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/modifiers.js": function(module1) {
|
|
84
|
+
"use strict";
|
|
85
|
+
module1.exports = {
|
|
86
|
+
groupRedact,
|
|
87
|
+
groupRestore,
|
|
88
|
+
nestedRedact,
|
|
89
|
+
nestedRestore
|
|
90
|
+
};
|
|
91
|
+
function groupRestore({ keys, values, target }) {
|
|
92
|
+
if (null == target || 'string' == typeof target) return;
|
|
93
|
+
const length = keys.length;
|
|
94
|
+
for(var i = 0; i < length; i++){
|
|
95
|
+
const k = keys[i];
|
|
96
|
+
target[k] = values[i];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function groupRedact(o, path, censor, isCensorFct, censorFctTakesPath) {
|
|
100
|
+
const target = get(o, path);
|
|
101
|
+
if (null == target || 'string' == typeof target) return {
|
|
102
|
+
keys: null,
|
|
103
|
+
values: null,
|
|
104
|
+
target,
|
|
105
|
+
flat: true
|
|
106
|
+
};
|
|
107
|
+
const keys = Object.keys(target);
|
|
108
|
+
const keysLength = keys.length;
|
|
109
|
+
const pathLength = path.length;
|
|
110
|
+
const pathWithKey = censorFctTakesPath ? [
|
|
111
|
+
...path
|
|
112
|
+
] : void 0;
|
|
113
|
+
const values = new Array(keysLength);
|
|
114
|
+
for(var i = 0; i < keysLength; i++){
|
|
115
|
+
const key = keys[i];
|
|
116
|
+
values[i] = target[key];
|
|
117
|
+
if (censorFctTakesPath) {
|
|
118
|
+
pathWithKey[pathLength] = key;
|
|
119
|
+
target[key] = censor(target[key], pathWithKey);
|
|
120
|
+
} else if (isCensorFct) target[key] = censor(target[key]);
|
|
121
|
+
else target[key] = censor;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
keys,
|
|
125
|
+
values,
|
|
126
|
+
target,
|
|
127
|
+
flat: true
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function nestedRestore(instructions) {
|
|
131
|
+
for(let i = 0; i < instructions.length; i++){
|
|
132
|
+
const { target, path, value } = instructions[i];
|
|
133
|
+
let current = target;
|
|
134
|
+
for(let i = path.length - 1; i > 0; i--)current = current[path[i]];
|
|
135
|
+
current[path[0]] = value;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function nestedRedact(store, o, path, ns, censor, isCensorFct, censorFctTakesPath) {
|
|
139
|
+
const target = get(o, path);
|
|
140
|
+
if (null == target) return;
|
|
141
|
+
const keys = Object.keys(target);
|
|
142
|
+
const keysLength = keys.length;
|
|
143
|
+
for(var i = 0; i < keysLength; i++){
|
|
144
|
+
const key = keys[i];
|
|
145
|
+
specialSet(store, target, key, path, ns, censor, isCensorFct, censorFctTakesPath);
|
|
146
|
+
}
|
|
147
|
+
return store;
|
|
148
|
+
}
|
|
149
|
+
function has(obj, prop) {
|
|
150
|
+
return null != obj ? 'hasOwn' in Object ? Object.hasOwn(obj, prop) : Object.prototype.hasOwnProperty.call(obj, prop) : false;
|
|
151
|
+
}
|
|
152
|
+
function specialSet(store, o, k, path, afterPath, censor, isCensorFct, censorFctTakesPath) {
|
|
153
|
+
const afterPathLen = afterPath.length;
|
|
154
|
+
const lastPathIndex = afterPathLen - 1;
|
|
155
|
+
const originalKey = k;
|
|
156
|
+
var i = -1;
|
|
157
|
+
var n1;
|
|
158
|
+
var nv;
|
|
159
|
+
var ov;
|
|
160
|
+
var oov = null;
|
|
161
|
+
var wc = null;
|
|
162
|
+
var kIsWc;
|
|
163
|
+
var wcov;
|
|
164
|
+
var consecutive = false;
|
|
165
|
+
var level = 0;
|
|
166
|
+
var depth = 0;
|
|
167
|
+
var redactPathCurrent = tree();
|
|
168
|
+
ov = n1 = o[k];
|
|
169
|
+
if ('object' != typeof n1) return;
|
|
170
|
+
while(null != n1 && ++i < afterPathLen){
|
|
171
|
+
depth += 1;
|
|
172
|
+
k = afterPath[i];
|
|
173
|
+
if ('*' !== k && !wc && !('object' == typeof n1 && k in n1)) break;
|
|
174
|
+
if ('*' === k) {
|
|
175
|
+
if ('*' === wc) consecutive = true;
|
|
176
|
+
wc = k;
|
|
177
|
+
if (i !== lastPathIndex) continue;
|
|
178
|
+
}
|
|
179
|
+
if (wc) {
|
|
180
|
+
const wcKeys = Object.keys(n1);
|
|
181
|
+
for(var j = 0; j < wcKeys.length; j++){
|
|
182
|
+
const wck = wcKeys[j];
|
|
183
|
+
wcov = n1[wck];
|
|
184
|
+
kIsWc = '*' === k;
|
|
185
|
+
if (consecutive) {
|
|
186
|
+
redactPathCurrent = node(redactPathCurrent, wck, depth);
|
|
187
|
+
level = i;
|
|
188
|
+
ov = iterateNthLevel(wcov, level - 1, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n1, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, o[originalKey], depth + 1);
|
|
189
|
+
} else if (kIsWc || 'object' == typeof wcov && null !== wcov && k in wcov) {
|
|
190
|
+
ov = kIsWc ? wcov : wcov[k];
|
|
191
|
+
nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
|
|
192
|
+
...path,
|
|
193
|
+
originalKey,
|
|
194
|
+
...afterPath
|
|
195
|
+
]) : censor(ov) : censor;
|
|
196
|
+
if (kIsWc) {
|
|
197
|
+
const rv = restoreInstr(node(redactPathCurrent, wck, depth), ov, o[originalKey]);
|
|
198
|
+
store.push(rv);
|
|
199
|
+
n1[wck] = nv;
|
|
200
|
+
} else if (wcov[k] === nv) ;
|
|
201
|
+
else if (void 0 === nv && void 0 !== censor || has(wcov, k) && nv === ov) redactPathCurrent = node(redactPathCurrent, wck, depth);
|
|
202
|
+
else {
|
|
203
|
+
redactPathCurrent = node(redactPathCurrent, wck, depth);
|
|
204
|
+
const rv = restoreInstr(node(redactPathCurrent, k, depth + 1), ov, o[originalKey]);
|
|
205
|
+
store.push(rv);
|
|
206
|
+
wcov[k] = nv;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
wc = null;
|
|
211
|
+
} else {
|
|
212
|
+
ov = n1[k];
|
|
213
|
+
redactPathCurrent = node(redactPathCurrent, k, depth);
|
|
214
|
+
nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
|
|
215
|
+
...path,
|
|
216
|
+
originalKey,
|
|
217
|
+
...afterPath
|
|
218
|
+
]) : censor(ov) : censor;
|
|
219
|
+
if (has(n1, k) && nv === ov || void 0 === nv && void 0 !== censor) ;
|
|
220
|
+
else {
|
|
221
|
+
const rv = restoreInstr(redactPathCurrent, ov, o[originalKey]);
|
|
222
|
+
store.push(rv);
|
|
223
|
+
n1[k] = nv;
|
|
224
|
+
}
|
|
225
|
+
n1 = n1[k];
|
|
226
|
+
}
|
|
227
|
+
if ('object' != typeof n1) break;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function get(o, p) {
|
|
231
|
+
var i = -1;
|
|
232
|
+
var l = p.length;
|
|
233
|
+
var n1 = o;
|
|
234
|
+
while(null != n1 && ++i < l)n1 = n1[p[i]];
|
|
235
|
+
return n1;
|
|
236
|
+
}
|
|
237
|
+
function iterateNthLevel(wcov, level, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n1, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, parent, depth) {
|
|
238
|
+
if (0 === level) {
|
|
239
|
+
if (kIsWc || 'object' == typeof wcov && null !== wcov && k in wcov) {
|
|
240
|
+
ov = kIsWc ? wcov : wcov[k];
|
|
241
|
+
nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
|
|
242
|
+
...path,
|
|
243
|
+
originalKey,
|
|
244
|
+
...afterPath
|
|
245
|
+
]) : censor(ov) : censor;
|
|
246
|
+
if (kIsWc) {
|
|
247
|
+
const rv = restoreInstr(redactPathCurrent, ov, parent);
|
|
248
|
+
store.push(rv);
|
|
249
|
+
n1[wck] = nv;
|
|
250
|
+
} else if (wcov[k] === nv) ;
|
|
251
|
+
else if (void 0 === nv && void 0 !== censor || has(wcov, k) && nv === ov) ;
|
|
252
|
+
else {
|
|
253
|
+
const rv = restoreInstr(node(redactPathCurrent, k, depth + 1), ov, parent);
|
|
254
|
+
store.push(rv);
|
|
255
|
+
wcov[k] = nv;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
for(const key in wcov)if ('object' == typeof wcov[key]) {
|
|
260
|
+
redactPathCurrent = node(redactPathCurrent, key, depth);
|
|
261
|
+
iterateNthLevel(wcov[key], level - 1, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n1, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, parent, depth + 1);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function tree() {
|
|
265
|
+
return {
|
|
266
|
+
parent: null,
|
|
267
|
+
key: null,
|
|
268
|
+
children: [],
|
|
269
|
+
depth: 0
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function node(parent, key, depth) {
|
|
273
|
+
if (parent.depth === depth) return node(parent.parent, key, depth);
|
|
274
|
+
var child = {
|
|
275
|
+
parent,
|
|
276
|
+
key,
|
|
277
|
+
depth,
|
|
278
|
+
children: []
|
|
279
|
+
};
|
|
280
|
+
parent.children.push(child);
|
|
281
|
+
return child;
|
|
282
|
+
}
|
|
283
|
+
function restoreInstr(node, value, target) {
|
|
284
|
+
let current = node;
|
|
285
|
+
const path = [];
|
|
286
|
+
do {
|
|
287
|
+
path.push(current.key);
|
|
288
|
+
current = current.parent;
|
|
289
|
+
}while (null != current.parent);
|
|
290
|
+
return {
|
|
291
|
+
path,
|
|
292
|
+
value,
|
|
293
|
+
target
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/parse.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
298
|
+
"use strict";
|
|
299
|
+
const rx = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/rx.js");
|
|
300
|
+
module1.exports = parse;
|
|
301
|
+
function parse({ paths }) {
|
|
302
|
+
const wildcards = [];
|
|
303
|
+
var wcLen = 0;
|
|
304
|
+
const secret = paths.reduce(function(o, strPath, ix) {
|
|
305
|
+
var path = strPath.match(rx).map((p)=>p.replace(/'|"|`/g, ''));
|
|
306
|
+
const leadingBracket = '[' === strPath[0];
|
|
307
|
+
path = path.map((p)=>{
|
|
308
|
+
if ('[' === p[0]) return p.substr(1, p.length - 2);
|
|
309
|
+
return p;
|
|
310
|
+
});
|
|
311
|
+
const star = path.indexOf('*');
|
|
312
|
+
if (star > -1) {
|
|
313
|
+
const before = path.slice(0, star);
|
|
314
|
+
const beforeStr = before.join('.');
|
|
315
|
+
const after = path.slice(star + 1, path.length);
|
|
316
|
+
const nested = after.length > 0;
|
|
317
|
+
wcLen++;
|
|
318
|
+
wildcards.push({
|
|
319
|
+
before,
|
|
320
|
+
beforeStr,
|
|
321
|
+
after,
|
|
322
|
+
nested
|
|
323
|
+
});
|
|
324
|
+
} else o[strPath] = {
|
|
325
|
+
path: path,
|
|
326
|
+
val: void 0,
|
|
327
|
+
precensored: false,
|
|
328
|
+
circle: '',
|
|
329
|
+
escPath: JSON.stringify(strPath),
|
|
330
|
+
leadingBracket: leadingBracket
|
|
331
|
+
};
|
|
332
|
+
return o;
|
|
333
|
+
}, {});
|
|
334
|
+
return {
|
|
335
|
+
wildcards,
|
|
336
|
+
wcLen,
|
|
337
|
+
secret
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/redactor.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
342
|
+
"use strict";
|
|
343
|
+
const rx = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/rx.js");
|
|
344
|
+
module1.exports = redactor;
|
|
345
|
+
function redactor({ secret, serialize, wcLen, strict, isCensorFct, censorFctTakesPath }, state) {
|
|
346
|
+
const redact = Function('o', `
|
|
347
|
+
if (typeof o !== 'object' || o == null) {
|
|
348
|
+
${strictImpl(strict, serialize)}
|
|
349
|
+
}
|
|
350
|
+
const { censor, secret } = this
|
|
351
|
+
const originalSecret = {}
|
|
352
|
+
const secretKeys = Object.keys(secret)
|
|
353
|
+
for (var i = 0; i < secretKeys.length; i++) {
|
|
354
|
+
originalSecret[secretKeys[i]] = secret[secretKeys[i]]
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
${redactTmpl(secret, isCensorFct, censorFctTakesPath)}
|
|
358
|
+
this.compileRestore()
|
|
359
|
+
${dynamicRedactTmpl(wcLen > 0, isCensorFct, censorFctTakesPath)}
|
|
360
|
+
this.secret = originalSecret
|
|
361
|
+
${resultTmpl(serialize)}
|
|
362
|
+
`).bind(state);
|
|
363
|
+
redact.state = state;
|
|
364
|
+
if (false === serialize) redact.restore = (o)=>state.restore(o);
|
|
365
|
+
return redact;
|
|
366
|
+
}
|
|
367
|
+
function redactTmpl(secret, isCensorFct, censorFctTakesPath) {
|
|
368
|
+
return Object.keys(secret).map((path)=>{
|
|
369
|
+
const { escPath, leadingBracket, path: arrPath } = secret[path];
|
|
370
|
+
const skip = leadingBracket ? 1 : 0;
|
|
371
|
+
const delim = leadingBracket ? '' : '.';
|
|
372
|
+
const hops = [];
|
|
373
|
+
var match;
|
|
374
|
+
while(null !== (match = rx.exec(path))){
|
|
375
|
+
const [, ix] = match;
|
|
376
|
+
const { index, input } = match;
|
|
377
|
+
if (index > skip) hops.push(input.substring(0, index - (ix ? 0 : 1)));
|
|
378
|
+
}
|
|
379
|
+
var existence = hops.map((p)=>`o${delim}${p}`).join(' && ');
|
|
380
|
+
if (0 === existence.length) existence += `o${delim}${path} != null`;
|
|
381
|
+
else existence += ` && o${delim}${path} != null`;
|
|
382
|
+
const circularDetection = `
|
|
383
|
+
switch (true) {
|
|
384
|
+
${hops.reverse().map((p)=>`
|
|
385
|
+
case o${delim}${p} === censor:
|
|
386
|
+
secret[${escPath}].circle = ${JSON.stringify(p)}
|
|
387
|
+
break
|
|
388
|
+
`).join('\n')}
|
|
389
|
+
}
|
|
390
|
+
`;
|
|
391
|
+
const censorArgs = censorFctTakesPath ? `val, ${JSON.stringify(arrPath)}` : "val";
|
|
392
|
+
return `
|
|
393
|
+
if (${existence}) {
|
|
394
|
+
const val = o${delim}${path}
|
|
395
|
+
if (val === censor) {
|
|
396
|
+
secret[${escPath}].precensored = true
|
|
397
|
+
} else {
|
|
398
|
+
secret[${escPath}].val = val
|
|
399
|
+
o${delim}${path} = ${isCensorFct ? `censor(${censorArgs})` : 'censor'}
|
|
400
|
+
${circularDetection}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
`;
|
|
404
|
+
}).join('\n');
|
|
405
|
+
}
|
|
406
|
+
function dynamicRedactTmpl(hasWildcards, isCensorFct, censorFctTakesPath) {
|
|
407
|
+
return true === hasWildcards ? `
|
|
408
|
+
{
|
|
409
|
+
const { wildcards, wcLen, groupRedact, nestedRedact } = this
|
|
410
|
+
for (var i = 0; i < wcLen; i++) {
|
|
411
|
+
const { before, beforeStr, after, nested } = wildcards[i]
|
|
412
|
+
if (nested === true) {
|
|
413
|
+
secret[beforeStr] = secret[beforeStr] || []
|
|
414
|
+
nestedRedact(secret[beforeStr], o, before, after, censor, ${isCensorFct}, ${censorFctTakesPath})
|
|
415
|
+
} else secret[beforeStr] = groupRedact(o, before, censor, ${isCensorFct}, ${censorFctTakesPath})
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
` : '';
|
|
419
|
+
}
|
|
420
|
+
function resultTmpl(serialize) {
|
|
421
|
+
return false === serialize ? "return o" : `
|
|
422
|
+
var s = this.serialize(o)
|
|
423
|
+
this.restore(o)
|
|
424
|
+
return s
|
|
425
|
+
`;
|
|
426
|
+
}
|
|
427
|
+
function strictImpl(strict, serialize) {
|
|
428
|
+
return true === strict ? "throw Error('fast-redact: primitives cannot be redacted')" : false === serialize ? "return o" : "return this.serialize(o)";
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/restorer.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
432
|
+
"use strict";
|
|
433
|
+
const { groupRestore, nestedRestore } = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/modifiers.js");
|
|
434
|
+
module1.exports = restorer;
|
|
435
|
+
function restorer() {
|
|
436
|
+
return function() {
|
|
437
|
+
if (this.restore) {
|
|
438
|
+
this.restore.state.secret = this.secret;
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
const { secret, wcLen } = this;
|
|
442
|
+
const paths = Object.keys(secret);
|
|
443
|
+
const resetters = resetTmpl(secret, paths);
|
|
444
|
+
const hasWildcards = wcLen > 0;
|
|
445
|
+
const state = hasWildcards ? {
|
|
446
|
+
secret,
|
|
447
|
+
groupRestore,
|
|
448
|
+
nestedRestore
|
|
449
|
+
} : {
|
|
450
|
+
secret
|
|
451
|
+
};
|
|
452
|
+
this.restore = Function('o', restoreTmpl(resetters, paths, hasWildcards)).bind(state);
|
|
453
|
+
this.restore.state = state;
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function resetTmpl(secret, paths) {
|
|
457
|
+
return paths.map((path)=>{
|
|
458
|
+
const { circle, escPath, leadingBracket } = secret[path];
|
|
459
|
+
const delim = leadingBracket ? '' : '.';
|
|
460
|
+
const reset = circle ? `o.${circle} = secret[${escPath}].val` : `o${delim}${path} = secret[${escPath}].val`;
|
|
461
|
+
const clear = `secret[${escPath}].val = undefined`;
|
|
462
|
+
return `
|
|
463
|
+
if (secret[${escPath}].val !== undefined) {
|
|
464
|
+
try { ${reset} } catch (e) {}
|
|
465
|
+
${clear}
|
|
466
|
+
}
|
|
467
|
+
`;
|
|
468
|
+
}).join('');
|
|
469
|
+
}
|
|
470
|
+
function restoreTmpl(resetters, paths, hasWildcards) {
|
|
471
|
+
const dynamicReset = true === hasWildcards ? `
|
|
472
|
+
const keys = Object.keys(secret)
|
|
473
|
+
const len = keys.length
|
|
474
|
+
for (var i = len - 1; i >= ${paths.length}; i--) {
|
|
475
|
+
const k = keys[i]
|
|
476
|
+
const o = secret[k]
|
|
477
|
+
if (o) {
|
|
478
|
+
if (o.flat === true) this.groupRestore(o)
|
|
479
|
+
else this.nestedRestore(o)
|
|
480
|
+
secret[k] = null
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
` : '';
|
|
484
|
+
return `
|
|
485
|
+
const secret = this.secret
|
|
486
|
+
${dynamicReset}
|
|
487
|
+
${resetters}
|
|
488
|
+
return o
|
|
489
|
+
`;
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
"../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/rx.js": function(module1) {
|
|
493
|
+
"use strict";
|
|
494
|
+
module1.exports = /[^.[\]]+|\[((?:.)*?)\]/g;
|
|
495
|
+
},
|
|
496
|
+
"../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/state.js": function(module1) {
|
|
497
|
+
"use strict";
|
|
498
|
+
module1.exports = state;
|
|
499
|
+
function state(o) {
|
|
500
|
+
const { secret, censor, compileRestore, serialize, groupRedact, nestedRedact, wildcards, wcLen } = o;
|
|
501
|
+
const builder = [
|
|
502
|
+
{
|
|
503
|
+
secret,
|
|
504
|
+
censor,
|
|
505
|
+
compileRestore
|
|
506
|
+
}
|
|
507
|
+
];
|
|
508
|
+
if (false !== serialize) builder.push({
|
|
509
|
+
serialize
|
|
510
|
+
});
|
|
511
|
+
if (wcLen > 0) builder.push({
|
|
512
|
+
groupRedact,
|
|
513
|
+
nestedRedact,
|
|
514
|
+
wildcards,
|
|
515
|
+
wcLen
|
|
516
|
+
});
|
|
517
|
+
return Object.assign(...builder);
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
"../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/lib/validator.js": function(module1) {
|
|
521
|
+
"use strict";
|
|
522
|
+
module1.exports = validator;
|
|
523
|
+
function validator(opts = {}) {
|
|
524
|
+
const { ERR_PATHS_MUST_BE_STRINGS = ()=>'fast-redact - Paths must be (non-empty) strings', ERR_INVALID_PATH = (s)=>`fast-redact – Invalid path (${s})` } = opts;
|
|
525
|
+
return function({ paths }) {
|
|
526
|
+
paths.forEach((s)=>{
|
|
527
|
+
if ('string' != typeof s) throw Error(ERR_PATHS_MUST_BE_STRINGS());
|
|
528
|
+
try {
|
|
529
|
+
if (/〇/.test(s)) throw Error();
|
|
530
|
+
const expr = ('[' === s[0] ? '' : '.') + s.replace(/^\*/, '〇').replace(/\.\*/g, '.〇').replace(/\[\*\]/g, '[〇]');
|
|
531
|
+
if (/\n|\r|;/.test(expr)) throw Error();
|
|
532
|
+
if (/\/\*/.test(expr)) throw Error();
|
|
533
|
+
Function(`
|
|
534
|
+
'use strict'
|
|
535
|
+
const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
|
|
536
|
+
const 〇 = null;
|
|
537
|
+
o${expr}
|
|
538
|
+
if ([o${expr}].length !== 1) throw Error()`)();
|
|
539
|
+
} catch (e) {
|
|
540
|
+
throw Error(ERR_INVALID_PATH(s));
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
"../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js": function(module1) {
|
|
547
|
+
"use strict";
|
|
548
|
+
const refs = {
|
|
549
|
+
exit: [],
|
|
550
|
+
beforeExit: []
|
|
551
|
+
};
|
|
552
|
+
const functions = {
|
|
553
|
+
exit: onExit,
|
|
554
|
+
beforeExit: onBeforeExit
|
|
555
|
+
};
|
|
556
|
+
let registry;
|
|
557
|
+
function ensureRegistry() {
|
|
558
|
+
if (void 0 === registry) registry = new FinalizationRegistry(clear);
|
|
559
|
+
}
|
|
560
|
+
function install(event) {
|
|
561
|
+
if (refs[event].length > 0) return;
|
|
562
|
+
process.on(event, functions[event]);
|
|
563
|
+
}
|
|
564
|
+
function uninstall(event) {
|
|
565
|
+
if (refs[event].length > 0) return;
|
|
566
|
+
process.removeListener(event, functions[event]);
|
|
567
|
+
if (0 === refs.exit.length && 0 === refs.beforeExit.length) registry = void 0;
|
|
568
|
+
}
|
|
569
|
+
function onExit() {
|
|
570
|
+
callRefs('exit');
|
|
571
|
+
}
|
|
572
|
+
function onBeforeExit() {
|
|
573
|
+
callRefs('beforeExit');
|
|
574
|
+
}
|
|
575
|
+
function callRefs(event) {
|
|
576
|
+
for (const ref of refs[event]){
|
|
577
|
+
const obj = ref.deref();
|
|
578
|
+
const fn = ref.fn;
|
|
579
|
+
if (void 0 !== obj) fn(obj, event);
|
|
580
|
+
}
|
|
581
|
+
refs[event] = [];
|
|
582
|
+
}
|
|
583
|
+
function clear(ref) {
|
|
584
|
+
for (const event of [
|
|
585
|
+
'exit',
|
|
586
|
+
'beforeExit'
|
|
587
|
+
]){
|
|
588
|
+
const index = refs[event].indexOf(ref);
|
|
589
|
+
refs[event].splice(index, index + 1);
|
|
590
|
+
uninstall(event);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function _register(event, obj, fn) {
|
|
594
|
+
if (void 0 === obj) throw new Error('the object can\'t be undefined');
|
|
595
|
+
install(event);
|
|
596
|
+
const ref = new WeakRef(obj);
|
|
597
|
+
ref.fn = fn;
|
|
598
|
+
ensureRegistry();
|
|
599
|
+
registry.register(obj, ref);
|
|
600
|
+
refs[event].push(ref);
|
|
601
|
+
}
|
|
602
|
+
function register(obj, fn) {
|
|
603
|
+
_register('exit', obj, fn);
|
|
604
|
+
}
|
|
605
|
+
function registerBeforeExit(obj, fn) {
|
|
606
|
+
_register('beforeExit', obj, fn);
|
|
607
|
+
}
|
|
608
|
+
function unregister(obj) {
|
|
609
|
+
if (void 0 === registry) return;
|
|
610
|
+
registry.unregister(obj);
|
|
611
|
+
for (const event of [
|
|
612
|
+
'exit',
|
|
613
|
+
'beforeExit'
|
|
614
|
+
]){
|
|
615
|
+
refs[event] = refs[event].filter((ref)=>{
|
|
616
|
+
const _obj = ref.deref();
|
|
617
|
+
return _obj && _obj !== obj;
|
|
618
|
+
});
|
|
619
|
+
uninstall(event);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
module1.exports = {
|
|
623
|
+
register,
|
|
624
|
+
registerBeforeExit,
|
|
625
|
+
unregister
|
|
626
|
+
};
|
|
627
|
+
},
|
|
628
|
+
"../../node_modules/.pnpm/pino-abstract-transport@2.0.0/node_modules/pino-abstract-transport/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
629
|
+
"use strict";
|
|
630
|
+
const metadata = Symbol.for('pino.metadata');
|
|
631
|
+
const split = __webpack_require__("../../node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js");
|
|
632
|
+
const { Duplex } = __webpack_require__("stream");
|
|
633
|
+
const { parentPort, workerData } = __webpack_require__("worker_threads");
|
|
634
|
+
function createDeferred() {
|
|
635
|
+
let resolve;
|
|
636
|
+
let reject;
|
|
637
|
+
const promise = new Promise((_resolve, _reject)=>{
|
|
638
|
+
resolve = _resolve;
|
|
639
|
+
reject = _reject;
|
|
640
|
+
});
|
|
641
|
+
promise.resolve = resolve;
|
|
642
|
+
promise.reject = reject;
|
|
643
|
+
return promise;
|
|
644
|
+
}
|
|
645
|
+
module1.exports = function(fn, opts = {}) {
|
|
646
|
+
const waitForConfig = true === opts.expectPinoConfig && workerData?.workerData?.pinoWillSendConfig === true;
|
|
647
|
+
const parseLines = 'lines' === opts.parse;
|
|
648
|
+
const parseLine = 'function' == typeof opts.parseLine ? opts.parseLine : JSON.parse;
|
|
649
|
+
const close = opts.close || defaultClose;
|
|
650
|
+
const stream = split(function(line) {
|
|
651
|
+
let value;
|
|
652
|
+
try {
|
|
653
|
+
value = parseLine(line);
|
|
654
|
+
} catch (error) {
|
|
655
|
+
this.emit('unknown', line, error);
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
if (null === value) return void this.emit('unknown', line, 'Null value ignored');
|
|
659
|
+
if ('object' != typeof value) value = {
|
|
660
|
+
data: value,
|
|
661
|
+
time: Date.now()
|
|
662
|
+
};
|
|
663
|
+
if (stream[metadata]) {
|
|
664
|
+
stream.lastTime = value.time;
|
|
665
|
+
stream.lastLevel = value.level;
|
|
666
|
+
stream.lastObj = value;
|
|
667
|
+
}
|
|
668
|
+
if (parseLines) return line;
|
|
669
|
+
return value;
|
|
670
|
+
}, {
|
|
671
|
+
autoDestroy: true
|
|
672
|
+
});
|
|
673
|
+
stream._destroy = function(err, cb) {
|
|
674
|
+
const promise = close(err, cb);
|
|
675
|
+
if (promise && 'function' == typeof promise.then) promise.then(cb, cb);
|
|
676
|
+
};
|
|
677
|
+
if (true === opts.expectPinoConfig && workerData?.workerData?.pinoWillSendConfig !== true) setImmediate(()=>{
|
|
678
|
+
stream.emit('error', new Error('This transport is not compatible with the current version of pino. Please upgrade pino to the latest version.'));
|
|
679
|
+
});
|
|
680
|
+
if (false !== opts.metadata) {
|
|
681
|
+
stream[metadata] = true;
|
|
682
|
+
stream.lastTime = 0;
|
|
683
|
+
stream.lastLevel = 0;
|
|
684
|
+
stream.lastObj = null;
|
|
685
|
+
}
|
|
686
|
+
if (waitForConfig) {
|
|
687
|
+
let pinoConfig = {};
|
|
688
|
+
const configReceived = createDeferred();
|
|
689
|
+
parentPort.on('message', function handleMessage(message) {
|
|
690
|
+
if ('PINO_CONFIG' === message.code) {
|
|
691
|
+
pinoConfig = message.config;
|
|
692
|
+
configReceived.resolve();
|
|
693
|
+
parentPort.off('message', handleMessage);
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
Object.defineProperties(stream, {
|
|
697
|
+
levels: {
|
|
698
|
+
get () {
|
|
699
|
+
return pinoConfig.levels;
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
messageKey: {
|
|
703
|
+
get () {
|
|
704
|
+
return pinoConfig.messageKey;
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
errorKey: {
|
|
708
|
+
get () {
|
|
709
|
+
return pinoConfig.errorKey;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
return configReceived.then(finish);
|
|
714
|
+
}
|
|
715
|
+
return finish();
|
|
716
|
+
function finish() {
|
|
717
|
+
let res = fn(stream);
|
|
718
|
+
if (res && 'function' == typeof res.catch) {
|
|
719
|
+
res.catch((err)=>{
|
|
720
|
+
stream.destroy(err);
|
|
721
|
+
});
|
|
722
|
+
res = null;
|
|
723
|
+
} else if (opts.enablePipelining && res) return Duplex.from({
|
|
724
|
+
writable: stream,
|
|
725
|
+
readable: res
|
|
726
|
+
});
|
|
727
|
+
return stream;
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
function defaultClose(err, cb) {
|
|
731
|
+
process.nextTick(cb, err);
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
"../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js": function(module1) {
|
|
735
|
+
"use strict";
|
|
736
|
+
function tryStringify(o) {
|
|
737
|
+
try {
|
|
738
|
+
return JSON.stringify(o);
|
|
739
|
+
} catch (e) {
|
|
740
|
+
return '"[Circular]"';
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
module1.exports = format;
|
|
744
|
+
function format(f, args, opts) {
|
|
745
|
+
var ss = opts && opts.stringify || tryStringify;
|
|
746
|
+
var offset = 1;
|
|
747
|
+
if ('object' == typeof f && null !== f) {
|
|
748
|
+
var len = args.length + offset;
|
|
749
|
+
if (1 === len) return f;
|
|
750
|
+
var objects = new Array(len);
|
|
751
|
+
objects[0] = ss(f);
|
|
752
|
+
for(var index = 1; index < len; index++)objects[index] = ss(args[index]);
|
|
753
|
+
return objects.join(' ');
|
|
754
|
+
}
|
|
755
|
+
if ('string' != typeof f) return f;
|
|
756
|
+
var argLen = args.length;
|
|
757
|
+
if (0 === argLen) return f;
|
|
758
|
+
var str = '';
|
|
759
|
+
var a = 1 - offset;
|
|
760
|
+
var lastPos = -1;
|
|
761
|
+
var flen = f && f.length || 0;
|
|
762
|
+
for(var i = 0; i < flen;){
|
|
763
|
+
if (37 === f.charCodeAt(i) && i + 1 < flen) {
|
|
764
|
+
lastPos = lastPos > -1 ? lastPos : 0;
|
|
765
|
+
switch(f.charCodeAt(i + 1)){
|
|
766
|
+
case 100:
|
|
767
|
+
case 102:
|
|
768
|
+
if (a >= argLen) break;
|
|
769
|
+
if (null == args[a]) break;
|
|
770
|
+
if (lastPos < i) str += f.slice(lastPos, i);
|
|
771
|
+
str += Number(args[a]);
|
|
772
|
+
lastPos = i + 2;
|
|
773
|
+
i++;
|
|
774
|
+
break;
|
|
775
|
+
case 105:
|
|
776
|
+
if (a >= argLen) break;
|
|
777
|
+
if (null == args[a]) break;
|
|
778
|
+
if (lastPos < i) str += f.slice(lastPos, i);
|
|
779
|
+
str += Math.floor(Number(args[a]));
|
|
780
|
+
lastPos = i + 2;
|
|
781
|
+
i++;
|
|
782
|
+
break;
|
|
783
|
+
case 79:
|
|
784
|
+
case 111:
|
|
785
|
+
case 106:
|
|
786
|
+
if (a >= argLen) break;
|
|
787
|
+
if (void 0 === args[a]) break;
|
|
788
|
+
if (lastPos < i) str += f.slice(lastPos, i);
|
|
789
|
+
var type = typeof args[a];
|
|
790
|
+
if ('string' === type) {
|
|
791
|
+
str += '\'' + args[a] + '\'';
|
|
792
|
+
lastPos = i + 2;
|
|
793
|
+
i++;
|
|
794
|
+
break;
|
|
795
|
+
}
|
|
796
|
+
if ('function' === type) {
|
|
797
|
+
str += args[a].name || '<anonymous>';
|
|
798
|
+
lastPos = i + 2;
|
|
799
|
+
i++;
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
802
|
+
str += ss(args[a]);
|
|
803
|
+
lastPos = i + 2;
|
|
804
|
+
i++;
|
|
805
|
+
break;
|
|
806
|
+
case 115:
|
|
807
|
+
if (a >= argLen) break;
|
|
808
|
+
if (lastPos < i) str += f.slice(lastPos, i);
|
|
809
|
+
str += String(args[a]);
|
|
810
|
+
lastPos = i + 2;
|
|
811
|
+
i++;
|
|
812
|
+
break;
|
|
813
|
+
case 37:
|
|
814
|
+
if (lastPos < i) str += f.slice(lastPos, i);
|
|
815
|
+
str += '%';
|
|
816
|
+
lastPos = i + 2;
|
|
817
|
+
i++;
|
|
818
|
+
a--;
|
|
819
|
+
break;
|
|
820
|
+
}
|
|
821
|
+
++a;
|
|
822
|
+
}
|
|
823
|
+
++i;
|
|
824
|
+
}
|
|
825
|
+
if (-1 === lastPos) return f;
|
|
826
|
+
if (lastPos < flen) str += f.slice(lastPos);
|
|
827
|
+
return str;
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
"../../node_modules/.pnpm/real-require@0.2.0/node_modules/real-require/src/index.js": function(module1) {
|
|
831
|
+
const realImport = new Function('modulePath', 'return import(modulePath)');
|
|
832
|
+
function realRequire(modulePath) {
|
|
833
|
+
if ('function' == typeof __non_webpack__require__) return __non_webpack__require__(modulePath);
|
|
834
|
+
return require(modulePath);
|
|
835
|
+
}
|
|
836
|
+
module1.exports = {
|
|
837
|
+
realImport,
|
|
838
|
+
realRequire
|
|
839
|
+
};
|
|
840
|
+
},
|
|
841
|
+
"../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js": function(module1, exports) {
|
|
842
|
+
"use strict";
|
|
843
|
+
const { hasOwnProperty } = Object.prototype;
|
|
844
|
+
const stringify = configure();
|
|
845
|
+
stringify.configure = configure;
|
|
846
|
+
stringify.stringify = stringify;
|
|
847
|
+
stringify.default = stringify;
|
|
848
|
+
exports.stringify = stringify;
|
|
849
|
+
exports.configure = configure;
|
|
850
|
+
module1.exports = stringify;
|
|
851
|
+
const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
|
|
852
|
+
function strEscape(str) {
|
|
853
|
+
if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) return `"${str}"`;
|
|
854
|
+
return JSON.stringify(str);
|
|
855
|
+
}
|
|
856
|
+
function sort(array, comparator) {
|
|
857
|
+
if (array.length > 2e2 || comparator) return array.sort(comparator);
|
|
858
|
+
for(let i = 1; i < array.length; i++){
|
|
859
|
+
const currentValue = array[i];
|
|
860
|
+
let position = i;
|
|
861
|
+
while(0 !== position && array[position - 1] > currentValue){
|
|
862
|
+
array[position] = array[position - 1];
|
|
863
|
+
position--;
|
|
864
|
+
}
|
|
865
|
+
array[position] = currentValue;
|
|
866
|
+
}
|
|
867
|
+
return array;
|
|
868
|
+
}
|
|
869
|
+
const typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array())), Symbol.toStringTag).get;
|
|
870
|
+
function isTypedArrayWithEntries(value) {
|
|
871
|
+
return void 0 !== typedArrayPrototypeGetSymbolToStringTag.call(value) && 0 !== value.length;
|
|
872
|
+
}
|
|
873
|
+
function stringifyTypedArray(array, separator, maximumBreadth) {
|
|
874
|
+
if (array.length < maximumBreadth) maximumBreadth = array.length;
|
|
875
|
+
const whitespace = ',' === separator ? '' : ' ';
|
|
876
|
+
let res = `"0":${whitespace}${array[0]}`;
|
|
877
|
+
for(let i = 1; i < maximumBreadth; i++)res += `${separator}"${i}":${whitespace}${array[i]}`;
|
|
878
|
+
return res;
|
|
879
|
+
}
|
|
880
|
+
function getCircularValueOption(options) {
|
|
881
|
+
if (hasOwnProperty.call(options, 'circularValue')) {
|
|
882
|
+
const circularValue = options.circularValue;
|
|
883
|
+
if ('string' == typeof circularValue) return `"${circularValue}"`;
|
|
884
|
+
if (null == circularValue) return circularValue;
|
|
885
|
+
if (circularValue === Error || circularValue === TypeError) return {
|
|
886
|
+
toString () {
|
|
887
|
+
throw new TypeError('Converting circular structure to JSON');
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
|
|
891
|
+
}
|
|
892
|
+
return '"[Circular]"';
|
|
893
|
+
}
|
|
894
|
+
function getDeterministicOption(options) {
|
|
895
|
+
let value;
|
|
896
|
+
if (hasOwnProperty.call(options, 'deterministic')) {
|
|
897
|
+
value = options.deterministic;
|
|
898
|
+
if ('boolean' != typeof value && 'function' != typeof value) throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
|
|
899
|
+
}
|
|
900
|
+
return void 0 === value ? true : value;
|
|
901
|
+
}
|
|
902
|
+
function getBooleanOption(options, key) {
|
|
903
|
+
let value;
|
|
904
|
+
if (hasOwnProperty.call(options, key)) {
|
|
905
|
+
value = options[key];
|
|
906
|
+
if ('boolean' != typeof value) throw new TypeError(`The "${key}" argument must be of type boolean`);
|
|
907
|
+
}
|
|
908
|
+
return void 0 === value ? true : value;
|
|
909
|
+
}
|
|
910
|
+
function getPositiveIntegerOption(options, key) {
|
|
911
|
+
let value;
|
|
912
|
+
if (hasOwnProperty.call(options, key)) {
|
|
913
|
+
value = options[key];
|
|
914
|
+
if ('number' != typeof value) throw new TypeError(`The "${key}" argument must be of type number`);
|
|
915
|
+
if (!Number.isInteger(value)) throw new TypeError(`The "${key}" argument must be an integer`);
|
|
916
|
+
if (value < 1) throw new RangeError(`The "${key}" argument must be >= 1`);
|
|
917
|
+
}
|
|
918
|
+
return void 0 === value ? 1 / 0 : value;
|
|
919
|
+
}
|
|
920
|
+
function getItemCount(number) {
|
|
921
|
+
if (1 === number) return '1 item';
|
|
922
|
+
return `${number} items`;
|
|
923
|
+
}
|
|
924
|
+
function getUniqueReplacerSet(replacerArray) {
|
|
925
|
+
const replacerSet = new Set();
|
|
926
|
+
for (const value of replacerArray)if ('string' == typeof value || 'number' == typeof value) replacerSet.add(String(value));
|
|
927
|
+
return replacerSet;
|
|
928
|
+
}
|
|
929
|
+
function getStrictOption(options) {
|
|
930
|
+
if (hasOwnProperty.call(options, 'strict')) {
|
|
931
|
+
const value = options.strict;
|
|
932
|
+
if ('boolean' != typeof value) throw new TypeError('The "strict" argument must be of type boolean');
|
|
933
|
+
if (value) return (value)=>{
|
|
934
|
+
let message = `Object can not safely be stringified. Received type ${typeof value}`;
|
|
935
|
+
if ('function' != typeof value) message += ` (${value.toString()})`;
|
|
936
|
+
throw new Error(message);
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function configure(options) {
|
|
941
|
+
options = {
|
|
942
|
+
...options
|
|
943
|
+
};
|
|
944
|
+
const fail = getStrictOption(options);
|
|
945
|
+
if (fail) {
|
|
946
|
+
if (void 0 === options.bigint) options.bigint = false;
|
|
947
|
+
if (!('circularValue' in options)) options.circularValue = Error;
|
|
948
|
+
}
|
|
949
|
+
const circularValue = getCircularValueOption(options);
|
|
950
|
+
const bigint = getBooleanOption(options, 'bigint');
|
|
951
|
+
const deterministic = getDeterministicOption(options);
|
|
952
|
+
const comparator = 'function' == typeof deterministic ? deterministic : void 0;
|
|
953
|
+
const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth');
|
|
954
|
+
const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth');
|
|
955
|
+
function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
|
|
956
|
+
let value = parent[key];
|
|
957
|
+
if ('object' == typeof value && null !== value && 'function' == typeof value.toJSON) value = value.toJSON(key);
|
|
958
|
+
value = replacer.call(parent, key, value);
|
|
959
|
+
switch(typeof value){
|
|
960
|
+
case 'string':
|
|
961
|
+
return strEscape(value);
|
|
962
|
+
case 'object':
|
|
963
|
+
{
|
|
964
|
+
if (null === value) return 'null';
|
|
965
|
+
if (-1 !== stack.indexOf(value)) return circularValue;
|
|
966
|
+
let res = '';
|
|
967
|
+
let join = ',';
|
|
968
|
+
const originalIndentation = indentation;
|
|
969
|
+
if (Array.isArray(value)) {
|
|
970
|
+
if (0 === value.length) return '[]';
|
|
971
|
+
if (maximumDepth < stack.length + 1) return '"[Array]"';
|
|
972
|
+
stack.push(value);
|
|
973
|
+
if ('' !== spacer) {
|
|
974
|
+
indentation += spacer;
|
|
975
|
+
res += `\n${indentation}`;
|
|
976
|
+
join = `,\n${indentation}`;
|
|
977
|
+
}
|
|
978
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
979
|
+
let i = 0;
|
|
980
|
+
for(; i < maximumValuesToStringify - 1; i++){
|
|
981
|
+
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
982
|
+
res += void 0 !== tmp ? tmp : 'null';
|
|
983
|
+
res += join;
|
|
984
|
+
}
|
|
985
|
+
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
986
|
+
res += void 0 !== tmp ? tmp : 'null';
|
|
987
|
+
if (value.length - 1 > maximumBreadth) {
|
|
988
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
989
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
990
|
+
}
|
|
991
|
+
if ('' !== spacer) res += `\n${originalIndentation}`;
|
|
992
|
+
stack.pop();
|
|
993
|
+
return `[${res}]`;
|
|
994
|
+
}
|
|
995
|
+
let keys = Object.keys(value);
|
|
996
|
+
const keyLength = keys.length;
|
|
997
|
+
if (0 === keyLength) return '{}';
|
|
998
|
+
if (maximumDepth < stack.length + 1) return '"[Object]"';
|
|
999
|
+
let whitespace = '';
|
|
1000
|
+
let separator = '';
|
|
1001
|
+
if ('' !== spacer) {
|
|
1002
|
+
indentation += spacer;
|
|
1003
|
+
join = `,\n${indentation}`;
|
|
1004
|
+
whitespace = ' ';
|
|
1005
|
+
}
|
|
1006
|
+
const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
1007
|
+
if (deterministic && !isTypedArrayWithEntries(value)) keys = sort(keys, comparator);
|
|
1008
|
+
stack.push(value);
|
|
1009
|
+
for(let i = 0; i < maximumPropertiesToStringify; i++){
|
|
1010
|
+
const key = keys[i];
|
|
1011
|
+
const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation);
|
|
1012
|
+
if (void 0 !== tmp) {
|
|
1013
|
+
res += `${separator}${strEscape(key)}:${whitespace}${tmp}`;
|
|
1014
|
+
separator = join;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (keyLength > maximumBreadth) {
|
|
1018
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
1019
|
+
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
1020
|
+
separator = join;
|
|
1021
|
+
}
|
|
1022
|
+
if ('' !== spacer && separator.length > 1) res = `\n${indentation}${res}\n${originalIndentation}`;
|
|
1023
|
+
stack.pop();
|
|
1024
|
+
return `{${res}}`;
|
|
1025
|
+
}
|
|
1026
|
+
case 'number':
|
|
1027
|
+
return isFinite(value) ? String(value) : fail ? fail(value) : 'null';
|
|
1028
|
+
case 'boolean':
|
|
1029
|
+
return true === value ? 'true' : 'false';
|
|
1030
|
+
case 'undefined':
|
|
1031
|
+
return;
|
|
1032
|
+
case 'bigint':
|
|
1033
|
+
if (bigint) return String(value);
|
|
1034
|
+
default:
|
|
1035
|
+
return fail ? fail(value) : void 0;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
|
|
1039
|
+
if ('object' == typeof value && null !== value && 'function' == typeof value.toJSON) value = value.toJSON(key);
|
|
1040
|
+
switch(typeof value){
|
|
1041
|
+
case 'string':
|
|
1042
|
+
return strEscape(value);
|
|
1043
|
+
case 'object':
|
|
1044
|
+
{
|
|
1045
|
+
if (null === value) return 'null';
|
|
1046
|
+
if (-1 !== stack.indexOf(value)) return circularValue;
|
|
1047
|
+
const originalIndentation = indentation;
|
|
1048
|
+
let res = '';
|
|
1049
|
+
let join = ',';
|
|
1050
|
+
if (Array.isArray(value)) {
|
|
1051
|
+
if (0 === value.length) return '[]';
|
|
1052
|
+
if (maximumDepth < stack.length + 1) return '"[Array]"';
|
|
1053
|
+
stack.push(value);
|
|
1054
|
+
if ('' !== spacer) {
|
|
1055
|
+
indentation += spacer;
|
|
1056
|
+
res += `\n${indentation}`;
|
|
1057
|
+
join = `,\n${indentation}`;
|
|
1058
|
+
}
|
|
1059
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
1060
|
+
let i = 0;
|
|
1061
|
+
for(; i < maximumValuesToStringify - 1; i++){
|
|
1062
|
+
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
1063
|
+
res += void 0 !== tmp ? tmp : 'null';
|
|
1064
|
+
res += join;
|
|
1065
|
+
}
|
|
1066
|
+
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
1067
|
+
res += void 0 !== tmp ? tmp : 'null';
|
|
1068
|
+
if (value.length - 1 > maximumBreadth) {
|
|
1069
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
1070
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
1071
|
+
}
|
|
1072
|
+
if ('' !== spacer) res += `\n${originalIndentation}`;
|
|
1073
|
+
stack.pop();
|
|
1074
|
+
return `[${res}]`;
|
|
1075
|
+
}
|
|
1076
|
+
stack.push(value);
|
|
1077
|
+
let whitespace = '';
|
|
1078
|
+
if ('' !== spacer) {
|
|
1079
|
+
indentation += spacer;
|
|
1080
|
+
join = `,\n${indentation}`;
|
|
1081
|
+
whitespace = ' ';
|
|
1082
|
+
}
|
|
1083
|
+
let separator = '';
|
|
1084
|
+
for (const key of replacer){
|
|
1085
|
+
const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation);
|
|
1086
|
+
if (void 0 !== tmp) {
|
|
1087
|
+
res += `${separator}${strEscape(key)}:${whitespace}${tmp}`;
|
|
1088
|
+
separator = join;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
if ('' !== spacer && separator.length > 1) res = `\n${indentation}${res}\n${originalIndentation}`;
|
|
1092
|
+
stack.pop();
|
|
1093
|
+
return `{${res}}`;
|
|
1094
|
+
}
|
|
1095
|
+
case 'number':
|
|
1096
|
+
return isFinite(value) ? String(value) : fail ? fail(value) : 'null';
|
|
1097
|
+
case 'boolean':
|
|
1098
|
+
return true === value ? 'true' : 'false';
|
|
1099
|
+
case 'undefined':
|
|
1100
|
+
return;
|
|
1101
|
+
case 'bigint':
|
|
1102
|
+
if (bigint) return String(value);
|
|
1103
|
+
default:
|
|
1104
|
+
return fail ? fail(value) : void 0;
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
function stringifyIndent(key, value, stack, spacer, indentation) {
|
|
1108
|
+
switch(typeof value){
|
|
1109
|
+
case 'string':
|
|
1110
|
+
return strEscape(value);
|
|
1111
|
+
case 'object':
|
|
1112
|
+
{
|
|
1113
|
+
if (null === value) return 'null';
|
|
1114
|
+
if ('function' == typeof value.toJSON) {
|
|
1115
|
+
value = value.toJSON(key);
|
|
1116
|
+
if ('object' != typeof value) return stringifyIndent(key, value, stack, spacer, indentation);
|
|
1117
|
+
if (null === value) return 'null';
|
|
1118
|
+
}
|
|
1119
|
+
if (-1 !== stack.indexOf(value)) return circularValue;
|
|
1120
|
+
const originalIndentation = indentation;
|
|
1121
|
+
if (Array.isArray(value)) {
|
|
1122
|
+
if (0 === value.length) return '[]';
|
|
1123
|
+
if (maximumDepth < stack.length + 1) return '"[Array]"';
|
|
1124
|
+
stack.push(value);
|
|
1125
|
+
indentation += spacer;
|
|
1126
|
+
let res = `\n${indentation}`;
|
|
1127
|
+
const join = `,\n${indentation}`;
|
|
1128
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
1129
|
+
let i = 0;
|
|
1130
|
+
for(; i < maximumValuesToStringify - 1; i++){
|
|
1131
|
+
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
1132
|
+
res += void 0 !== tmp ? tmp : 'null';
|
|
1133
|
+
res += join;
|
|
1134
|
+
}
|
|
1135
|
+
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
1136
|
+
res += void 0 !== tmp ? tmp : 'null';
|
|
1137
|
+
if (value.length - 1 > maximumBreadth) {
|
|
1138
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
1139
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
1140
|
+
}
|
|
1141
|
+
res += `\n${originalIndentation}`;
|
|
1142
|
+
stack.pop();
|
|
1143
|
+
return `[${res}]`;
|
|
1144
|
+
}
|
|
1145
|
+
let keys = Object.keys(value);
|
|
1146
|
+
const keyLength = keys.length;
|
|
1147
|
+
if (0 === keyLength) return '{}';
|
|
1148
|
+
if (maximumDepth < stack.length + 1) return '"[Object]"';
|
|
1149
|
+
indentation += spacer;
|
|
1150
|
+
const join = `,\n${indentation}`;
|
|
1151
|
+
let res = '';
|
|
1152
|
+
let separator = '';
|
|
1153
|
+
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
1154
|
+
if (isTypedArrayWithEntries(value)) {
|
|
1155
|
+
res += stringifyTypedArray(value, join, maximumBreadth);
|
|
1156
|
+
keys = keys.slice(value.length);
|
|
1157
|
+
maximumPropertiesToStringify -= value.length;
|
|
1158
|
+
separator = join;
|
|
1159
|
+
}
|
|
1160
|
+
if (deterministic) keys = sort(keys, comparator);
|
|
1161
|
+
stack.push(value);
|
|
1162
|
+
for(let i = 0; i < maximumPropertiesToStringify; i++){
|
|
1163
|
+
const key = keys[i];
|
|
1164
|
+
const tmp = stringifyIndent(key, value[key], stack, spacer, indentation);
|
|
1165
|
+
if (void 0 !== tmp) {
|
|
1166
|
+
res += `${separator}${strEscape(key)}: ${tmp}`;
|
|
1167
|
+
separator = join;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
if (keyLength > maximumBreadth) {
|
|
1171
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
1172
|
+
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
1173
|
+
separator = join;
|
|
1174
|
+
}
|
|
1175
|
+
if ('' !== separator) res = `\n${indentation}${res}\n${originalIndentation}`;
|
|
1176
|
+
stack.pop();
|
|
1177
|
+
return `{${res}}`;
|
|
1178
|
+
}
|
|
1179
|
+
case 'number':
|
|
1180
|
+
return isFinite(value) ? String(value) : fail ? fail(value) : 'null';
|
|
1181
|
+
case 'boolean':
|
|
1182
|
+
return true === value ? 'true' : 'false';
|
|
1183
|
+
case 'undefined':
|
|
1184
|
+
return;
|
|
1185
|
+
case 'bigint':
|
|
1186
|
+
if (bigint) return String(value);
|
|
1187
|
+
default:
|
|
1188
|
+
return fail ? fail(value) : void 0;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
function stringifySimple(key, value, stack) {
|
|
1192
|
+
switch(typeof value){
|
|
1193
|
+
case 'string':
|
|
1194
|
+
return strEscape(value);
|
|
1195
|
+
case 'object':
|
|
1196
|
+
{
|
|
1197
|
+
if (null === value) return 'null';
|
|
1198
|
+
if ('function' == typeof value.toJSON) {
|
|
1199
|
+
value = value.toJSON(key);
|
|
1200
|
+
if ('object' != typeof value) return stringifySimple(key, value, stack);
|
|
1201
|
+
if (null === value) return 'null';
|
|
1202
|
+
}
|
|
1203
|
+
if (-1 !== stack.indexOf(value)) return circularValue;
|
|
1204
|
+
let res = '';
|
|
1205
|
+
const hasLength = void 0 !== value.length;
|
|
1206
|
+
if (hasLength && Array.isArray(value)) {
|
|
1207
|
+
if (0 === value.length) return '[]';
|
|
1208
|
+
if (maximumDepth < stack.length + 1) return '"[Array]"';
|
|
1209
|
+
stack.push(value);
|
|
1210
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
1211
|
+
let i = 0;
|
|
1212
|
+
for(; i < maximumValuesToStringify - 1; i++){
|
|
1213
|
+
const tmp = stringifySimple(String(i), value[i], stack);
|
|
1214
|
+
res += void 0 !== tmp ? tmp : 'null';
|
|
1215
|
+
res += ',';
|
|
1216
|
+
}
|
|
1217
|
+
const tmp = stringifySimple(String(i), value[i], stack);
|
|
1218
|
+
res += void 0 !== tmp ? tmp : 'null';
|
|
1219
|
+
if (value.length - 1 > maximumBreadth) {
|
|
1220
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
1221
|
+
res += `,"... ${getItemCount(removedKeys)} not stringified"`;
|
|
1222
|
+
}
|
|
1223
|
+
stack.pop();
|
|
1224
|
+
return `[${res}]`;
|
|
1225
|
+
}
|
|
1226
|
+
let keys = Object.keys(value);
|
|
1227
|
+
const keyLength = keys.length;
|
|
1228
|
+
if (0 === keyLength) return '{}';
|
|
1229
|
+
if (maximumDepth < stack.length + 1) return '"[Object]"';
|
|
1230
|
+
let separator = '';
|
|
1231
|
+
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
1232
|
+
if (hasLength && isTypedArrayWithEntries(value)) {
|
|
1233
|
+
res += stringifyTypedArray(value, ',', maximumBreadth);
|
|
1234
|
+
keys = keys.slice(value.length);
|
|
1235
|
+
maximumPropertiesToStringify -= value.length;
|
|
1236
|
+
separator = ',';
|
|
1237
|
+
}
|
|
1238
|
+
if (deterministic) keys = sort(keys, comparator);
|
|
1239
|
+
stack.push(value);
|
|
1240
|
+
for(let i = 0; i < maximumPropertiesToStringify; i++){
|
|
1241
|
+
const key = keys[i];
|
|
1242
|
+
const tmp = stringifySimple(key, value[key], stack);
|
|
1243
|
+
if (void 0 !== tmp) {
|
|
1244
|
+
res += `${separator}${strEscape(key)}:${tmp}`;
|
|
1245
|
+
separator = ',';
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
if (keyLength > maximumBreadth) {
|
|
1249
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
1250
|
+
res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
|
|
1251
|
+
}
|
|
1252
|
+
stack.pop();
|
|
1253
|
+
return `{${res}}`;
|
|
1254
|
+
}
|
|
1255
|
+
case 'number':
|
|
1256
|
+
return isFinite(value) ? String(value) : fail ? fail(value) : 'null';
|
|
1257
|
+
case 'boolean':
|
|
1258
|
+
return true === value ? 'true' : 'false';
|
|
1259
|
+
case 'undefined':
|
|
1260
|
+
return;
|
|
1261
|
+
case 'bigint':
|
|
1262
|
+
if (bigint) return String(value);
|
|
1263
|
+
default:
|
|
1264
|
+
return fail ? fail(value) : void 0;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
function stringify(value, replacer, space) {
|
|
1268
|
+
if (arguments.length > 1) {
|
|
1269
|
+
let spacer = '';
|
|
1270
|
+
if ('number' == typeof space) spacer = ' '.repeat(Math.min(space, 10));
|
|
1271
|
+
else if ('string' == typeof space) spacer = space.slice(0, 10);
|
|
1272
|
+
if (null != replacer) {
|
|
1273
|
+
if ('function' == typeof replacer) return stringifyFnReplacer('', {
|
|
1274
|
+
'': value
|
|
1275
|
+
}, [], replacer, spacer, '');
|
|
1276
|
+
if (Array.isArray(replacer)) return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '');
|
|
1277
|
+
}
|
|
1278
|
+
if (0 !== spacer.length) return stringifyIndent('', value, [], spacer, '');
|
|
1279
|
+
}
|
|
1280
|
+
return stringifySimple('', value, []);
|
|
1281
|
+
}
|
|
1282
|
+
return stringify;
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
"../../node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
1286
|
+
"use strict";
|
|
1287
|
+
const { Transform } = __webpack_require__("stream");
|
|
1288
|
+
const { StringDecoder } = __webpack_require__("string_decoder");
|
|
1289
|
+
const kLast = Symbol('last');
|
|
1290
|
+
const kDecoder = Symbol('decoder');
|
|
1291
|
+
function transform(chunk, enc, cb) {
|
|
1292
|
+
let list;
|
|
1293
|
+
if (this.overflow) {
|
|
1294
|
+
const buf = this[kDecoder].write(chunk);
|
|
1295
|
+
list = buf.split(this.matcher);
|
|
1296
|
+
if (1 === list.length) return cb();
|
|
1297
|
+
list.shift();
|
|
1298
|
+
this.overflow = false;
|
|
1299
|
+
} else {
|
|
1300
|
+
this[kLast] += this[kDecoder].write(chunk);
|
|
1301
|
+
list = this[kLast].split(this.matcher);
|
|
1302
|
+
}
|
|
1303
|
+
this[kLast] = list.pop();
|
|
1304
|
+
for(let i = 0; i < list.length; i++)try {
|
|
1305
|
+
push(this, this.mapper(list[i]));
|
|
1306
|
+
} catch (error) {
|
|
1307
|
+
return cb(error);
|
|
1308
|
+
}
|
|
1309
|
+
this.overflow = this[kLast].length > this.maxLength;
|
|
1310
|
+
if (this.overflow && !this.skipOverflow) return void cb(new Error('maximum buffer reached'));
|
|
1311
|
+
cb();
|
|
1312
|
+
}
|
|
1313
|
+
function flush(cb) {
|
|
1314
|
+
this[kLast] += this[kDecoder].end();
|
|
1315
|
+
if (this[kLast]) try {
|
|
1316
|
+
push(this, this.mapper(this[kLast]));
|
|
1317
|
+
} catch (error) {
|
|
1318
|
+
return cb(error);
|
|
1319
|
+
}
|
|
1320
|
+
cb();
|
|
1321
|
+
}
|
|
1322
|
+
function push(self, val) {
|
|
1323
|
+
if (void 0 !== val) self.push(val);
|
|
1324
|
+
}
|
|
1325
|
+
function noop(incoming) {
|
|
1326
|
+
return incoming;
|
|
1327
|
+
}
|
|
1328
|
+
function split(matcher, mapper, options) {
|
|
1329
|
+
matcher = matcher || /\r?\n/;
|
|
1330
|
+
mapper = mapper || noop;
|
|
1331
|
+
options = options || {};
|
|
1332
|
+
switch(arguments.length){
|
|
1333
|
+
case 1:
|
|
1334
|
+
if ('function' == typeof matcher) {
|
|
1335
|
+
mapper = matcher;
|
|
1336
|
+
matcher = /\r?\n/;
|
|
1337
|
+
} else if ('object' == typeof matcher && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
|
|
1338
|
+
options = matcher;
|
|
1339
|
+
matcher = /\r?\n/;
|
|
1340
|
+
}
|
|
1341
|
+
break;
|
|
1342
|
+
case 2:
|
|
1343
|
+
if ('function' == typeof matcher) {
|
|
1344
|
+
options = mapper;
|
|
1345
|
+
mapper = matcher;
|
|
1346
|
+
matcher = /\r?\n/;
|
|
1347
|
+
} else if ('object' == typeof mapper) {
|
|
1348
|
+
options = mapper;
|
|
1349
|
+
mapper = noop;
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
options = Object.assign({}, options);
|
|
1353
|
+
options.autoDestroy = true;
|
|
1354
|
+
options.transform = transform;
|
|
1355
|
+
options.flush = flush;
|
|
1356
|
+
options.readableObjectMode = true;
|
|
1357
|
+
const stream = new Transform(options);
|
|
1358
|
+
stream[kLast] = '';
|
|
1359
|
+
stream[kDecoder] = new StringDecoder('utf8');
|
|
1360
|
+
stream.matcher = matcher;
|
|
1361
|
+
stream.mapper = mapper;
|
|
1362
|
+
stream.maxLength = options.maxLength;
|
|
1363
|
+
stream.skipOverflow = options.skipOverflow || false;
|
|
1364
|
+
stream.overflow = false;
|
|
1365
|
+
stream._destroy = function(err, cb) {
|
|
1366
|
+
this._writableState.errorEmitted = false;
|
|
1367
|
+
cb(err);
|
|
1368
|
+
};
|
|
1369
|
+
return stream;
|
|
1370
|
+
}
|
|
1371
|
+
module1.exports = split;
|
|
1372
|
+
},
|
|
1373
|
+
"../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
1374
|
+
"use strict";
|
|
1375
|
+
const { version } = __webpack_require__("../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/package.json");
|
|
1376
|
+
const { EventEmitter } = __webpack_require__("events");
|
|
1377
|
+
const { Worker } = __webpack_require__("worker_threads");
|
|
1378
|
+
const { join } = __webpack_require__("path");
|
|
1379
|
+
const { pathToFileURL } = __webpack_require__("url");
|
|
1380
|
+
const { wait } = __webpack_require__("../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/wait.js");
|
|
1381
|
+
const { WRITE_INDEX, READ_INDEX } = __webpack_require__("../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/indexes.js");
|
|
1382
|
+
const buffer = __webpack_require__("buffer");
|
|
1383
|
+
const assert = __webpack_require__("assert");
|
|
1384
|
+
const kImpl = Symbol('kImpl');
|
|
1385
|
+
const MAX_STRING = buffer.constants.MAX_STRING_LENGTH;
|
|
1386
|
+
class FakeWeakRef {
|
|
1387
|
+
constructor(value){
|
|
1388
|
+
this._value = value;
|
|
1389
|
+
}
|
|
1390
|
+
deref() {
|
|
1391
|
+
return this._value;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
class FakeFinalizationRegistry {
|
|
1395
|
+
register() {}
|
|
1396
|
+
unregister() {}
|
|
1397
|
+
}
|
|
1398
|
+
const FinalizationRegistry1 = process.env.NODE_V8_COVERAGE ? FakeFinalizationRegistry : global.FinalizationRegistry || FakeFinalizationRegistry;
|
|
1399
|
+
const WeakRef1 = process.env.NODE_V8_COVERAGE ? FakeWeakRef : global.WeakRef || FakeWeakRef;
|
|
1400
|
+
const registry = new FinalizationRegistry1((worker)=>{
|
|
1401
|
+
if (worker.exited) return;
|
|
1402
|
+
worker.terminate();
|
|
1403
|
+
});
|
|
1404
|
+
function createWorker(stream, opts) {
|
|
1405
|
+
const { filename, workerData } = opts;
|
|
1406
|
+
const bundlerOverrides = '__bundlerPathsOverrides' in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
1407
|
+
const toExecute = bundlerOverrides['thread-stream-worker'] || join(__dirname, 'lib', 'worker.js');
|
|
1408
|
+
const worker = new Worker(toExecute, {
|
|
1409
|
+
...opts.workerOpts,
|
|
1410
|
+
trackUnmanagedFds: false,
|
|
1411
|
+
workerData: {
|
|
1412
|
+
filename: 0 === filename.indexOf('file://') ? filename : pathToFileURL(filename).href,
|
|
1413
|
+
dataBuf: stream[kImpl].dataBuf,
|
|
1414
|
+
stateBuf: stream[kImpl].stateBuf,
|
|
1415
|
+
workerData: {
|
|
1416
|
+
$context: {
|
|
1417
|
+
threadStreamVersion: version
|
|
1418
|
+
},
|
|
1419
|
+
...workerData
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
worker.stream = new FakeWeakRef(stream);
|
|
1424
|
+
worker.on('message', onWorkerMessage);
|
|
1425
|
+
worker.on('exit', onWorkerExit);
|
|
1426
|
+
registry.register(stream, worker);
|
|
1427
|
+
return worker;
|
|
1428
|
+
}
|
|
1429
|
+
function drain(stream) {
|
|
1430
|
+
assert(!stream[kImpl].sync);
|
|
1431
|
+
if (stream[kImpl].needDrain) {
|
|
1432
|
+
stream[kImpl].needDrain = false;
|
|
1433
|
+
stream.emit('drain');
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
function nextFlush(stream) {
|
|
1437
|
+
const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
|
|
1438
|
+
let leftover = stream[kImpl].data.length - writeIndex;
|
|
1439
|
+
if (leftover > 0) {
|
|
1440
|
+
if (0 === stream[kImpl].buf.length) {
|
|
1441
|
+
stream[kImpl].flushing = false;
|
|
1442
|
+
if (stream[kImpl].ending) end(stream);
|
|
1443
|
+
else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
|
|
1444
|
+
return;
|
|
1445
|
+
}
|
|
1446
|
+
let toWrite = stream[kImpl].buf.slice(0, leftover);
|
|
1447
|
+
let toWriteBytes = Buffer.byteLength(toWrite);
|
|
1448
|
+
if (toWriteBytes <= leftover) {
|
|
1449
|
+
stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
|
|
1450
|
+
write(stream, toWrite, nextFlush.bind(null, stream));
|
|
1451
|
+
} else stream.flush(()=>{
|
|
1452
|
+
if (stream.destroyed) return;
|
|
1453
|
+
Atomics.store(stream[kImpl].state, READ_INDEX, 0);
|
|
1454
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
1455
|
+
while(toWriteBytes > stream[kImpl].data.length){
|
|
1456
|
+
leftover /= 2;
|
|
1457
|
+
toWrite = stream[kImpl].buf.slice(0, leftover);
|
|
1458
|
+
toWriteBytes = Buffer.byteLength(toWrite);
|
|
1459
|
+
}
|
|
1460
|
+
stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
|
|
1461
|
+
write(stream, toWrite, nextFlush.bind(null, stream));
|
|
1462
|
+
});
|
|
1463
|
+
} else if (0 === leftover) {
|
|
1464
|
+
if (0 === writeIndex && 0 === stream[kImpl].buf.length) return;
|
|
1465
|
+
stream.flush(()=>{
|
|
1466
|
+
Atomics.store(stream[kImpl].state, READ_INDEX, 0);
|
|
1467
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
1468
|
+
nextFlush(stream);
|
|
1469
|
+
});
|
|
1470
|
+
} else destroy(stream, new Error('overwritten'));
|
|
1471
|
+
}
|
|
1472
|
+
function onWorkerMessage(msg) {
|
|
1473
|
+
const stream = this.stream.deref();
|
|
1474
|
+
if (void 0 === stream) {
|
|
1475
|
+
this.exited = true;
|
|
1476
|
+
this.terminate();
|
|
1477
|
+
return;
|
|
1478
|
+
}
|
|
1479
|
+
switch(msg.code){
|
|
1480
|
+
case 'READY':
|
|
1481
|
+
this.stream = new WeakRef1(stream);
|
|
1482
|
+
stream.flush(()=>{
|
|
1483
|
+
stream[kImpl].ready = true;
|
|
1484
|
+
stream.emit('ready');
|
|
1485
|
+
});
|
|
1486
|
+
break;
|
|
1487
|
+
case 'ERROR':
|
|
1488
|
+
destroy(stream, msg.err);
|
|
1489
|
+
break;
|
|
1490
|
+
case 'EVENT':
|
|
1491
|
+
if (Array.isArray(msg.args)) stream.emit(msg.name, ...msg.args);
|
|
1492
|
+
else stream.emit(msg.name, msg.args);
|
|
1493
|
+
break;
|
|
1494
|
+
case 'WARNING':
|
|
1495
|
+
process.emitWarning(msg.err);
|
|
1496
|
+
break;
|
|
1497
|
+
default:
|
|
1498
|
+
destroy(stream, new Error('this should not happen: ' + msg.code));
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
function onWorkerExit(code) {
|
|
1502
|
+
const stream = this.stream.deref();
|
|
1503
|
+
if (void 0 === stream) return;
|
|
1504
|
+
registry.unregister(stream);
|
|
1505
|
+
stream.worker.exited = true;
|
|
1506
|
+
stream.worker.off('exit', onWorkerExit);
|
|
1507
|
+
destroy(stream, 0 !== code ? new Error('the worker thread exited') : null);
|
|
1508
|
+
}
|
|
1509
|
+
class ThreadStream extends EventEmitter {
|
|
1510
|
+
constructor(opts = {}){
|
|
1511
|
+
super();
|
|
1512
|
+
if (opts.bufferSize < 4) throw new Error('bufferSize must at least fit a 4-byte utf-8 char');
|
|
1513
|
+
this[kImpl] = {};
|
|
1514
|
+
this[kImpl].stateBuf = new SharedArrayBuffer(128);
|
|
1515
|
+
this[kImpl].state = new Int32Array(this[kImpl].stateBuf);
|
|
1516
|
+
this[kImpl].dataBuf = new SharedArrayBuffer(opts.bufferSize || 4194304);
|
|
1517
|
+
this[kImpl].data = Buffer.from(this[kImpl].dataBuf);
|
|
1518
|
+
this[kImpl].sync = opts.sync || false;
|
|
1519
|
+
this[kImpl].ending = false;
|
|
1520
|
+
this[kImpl].ended = false;
|
|
1521
|
+
this[kImpl].needDrain = false;
|
|
1522
|
+
this[kImpl].destroyed = false;
|
|
1523
|
+
this[kImpl].flushing = false;
|
|
1524
|
+
this[kImpl].ready = false;
|
|
1525
|
+
this[kImpl].finished = false;
|
|
1526
|
+
this[kImpl].errored = null;
|
|
1527
|
+
this[kImpl].closed = false;
|
|
1528
|
+
this[kImpl].buf = '';
|
|
1529
|
+
this.worker = createWorker(this, opts);
|
|
1530
|
+
this.on('message', (message, transferList)=>{
|
|
1531
|
+
this.worker.postMessage(message, transferList);
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
write(data) {
|
|
1535
|
+
if (this[kImpl].destroyed) {
|
|
1536
|
+
error(this, new Error('the worker has exited'));
|
|
1537
|
+
return false;
|
|
1538
|
+
}
|
|
1539
|
+
if (this[kImpl].ending) {
|
|
1540
|
+
error(this, new Error('the worker is ending'));
|
|
1541
|
+
return false;
|
|
1542
|
+
}
|
|
1543
|
+
if (this[kImpl].flushing && this[kImpl].buf.length + data.length >= MAX_STRING) try {
|
|
1544
|
+
writeSync(this);
|
|
1545
|
+
this[kImpl].flushing = true;
|
|
1546
|
+
} catch (err) {
|
|
1547
|
+
destroy(this, err);
|
|
1548
|
+
return false;
|
|
1549
|
+
}
|
|
1550
|
+
this[kImpl].buf += data;
|
|
1551
|
+
if (this[kImpl].sync) try {
|
|
1552
|
+
writeSync(this);
|
|
1553
|
+
return true;
|
|
1554
|
+
} catch (err) {
|
|
1555
|
+
destroy(this, err);
|
|
1556
|
+
return false;
|
|
1557
|
+
}
|
|
1558
|
+
if (!this[kImpl].flushing) {
|
|
1559
|
+
this[kImpl].flushing = true;
|
|
1560
|
+
setImmediate(nextFlush, this);
|
|
1561
|
+
}
|
|
1562
|
+
this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].buf.length - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0;
|
|
1563
|
+
return !this[kImpl].needDrain;
|
|
1564
|
+
}
|
|
1565
|
+
end() {
|
|
1566
|
+
if (this[kImpl].destroyed) return;
|
|
1567
|
+
this[kImpl].ending = true;
|
|
1568
|
+
end(this);
|
|
1569
|
+
}
|
|
1570
|
+
flush(cb) {
|
|
1571
|
+
if (this[kImpl].destroyed) {
|
|
1572
|
+
if ('function' == typeof cb) process.nextTick(cb, new Error('the worker has exited'));
|
|
1573
|
+
return;
|
|
1574
|
+
}
|
|
1575
|
+
const writeIndex = Atomics.load(this[kImpl].state, WRITE_INDEX);
|
|
1576
|
+
wait(this[kImpl].state, READ_INDEX, writeIndex, 1 / 0, (err, res)=>{
|
|
1577
|
+
if (err) {
|
|
1578
|
+
destroy(this, err);
|
|
1579
|
+
process.nextTick(cb, err);
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1582
|
+
if ('not-equal' === res) return void this.flush(cb);
|
|
1583
|
+
process.nextTick(cb);
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
flushSync() {
|
|
1587
|
+
if (this[kImpl].destroyed) return;
|
|
1588
|
+
writeSync(this);
|
|
1589
|
+
flushSync(this);
|
|
1590
|
+
}
|
|
1591
|
+
unref() {
|
|
1592
|
+
this.worker.unref();
|
|
1593
|
+
}
|
|
1594
|
+
ref() {
|
|
1595
|
+
this.worker.ref();
|
|
1596
|
+
}
|
|
1597
|
+
get ready() {
|
|
1598
|
+
return this[kImpl].ready;
|
|
1599
|
+
}
|
|
1600
|
+
get destroyed() {
|
|
1601
|
+
return this[kImpl].destroyed;
|
|
1602
|
+
}
|
|
1603
|
+
get closed() {
|
|
1604
|
+
return this[kImpl].closed;
|
|
1605
|
+
}
|
|
1606
|
+
get writable() {
|
|
1607
|
+
return !this[kImpl].destroyed && !this[kImpl].ending;
|
|
1608
|
+
}
|
|
1609
|
+
get writableEnded() {
|
|
1610
|
+
return this[kImpl].ending;
|
|
1611
|
+
}
|
|
1612
|
+
get writableFinished() {
|
|
1613
|
+
return this[kImpl].finished;
|
|
1614
|
+
}
|
|
1615
|
+
get writableNeedDrain() {
|
|
1616
|
+
return this[kImpl].needDrain;
|
|
1617
|
+
}
|
|
1618
|
+
get writableObjectMode() {
|
|
1619
|
+
return false;
|
|
1620
|
+
}
|
|
1621
|
+
get writableErrored() {
|
|
1622
|
+
return this[kImpl].errored;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
function error(stream, err) {
|
|
1626
|
+
setImmediate(()=>{
|
|
1627
|
+
stream.emit('error', err);
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
function destroy(stream, err) {
|
|
1631
|
+
if (stream[kImpl].destroyed) return;
|
|
1632
|
+
stream[kImpl].destroyed = true;
|
|
1633
|
+
if (err) {
|
|
1634
|
+
stream[kImpl].errored = err;
|
|
1635
|
+
error(stream, err);
|
|
1636
|
+
}
|
|
1637
|
+
if (stream.worker.exited) setImmediate(()=>{
|
|
1638
|
+
stream[kImpl].closed = true;
|
|
1639
|
+
stream.emit('close');
|
|
1640
|
+
});
|
|
1641
|
+
else stream.worker.terminate().catch(()=>{}).then(()=>{
|
|
1642
|
+
stream[kImpl].closed = true;
|
|
1643
|
+
stream.emit('close');
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1646
|
+
function write(stream, data, cb) {
|
|
1647
|
+
const current = Atomics.load(stream[kImpl].state, WRITE_INDEX);
|
|
1648
|
+
const length = Buffer.byteLength(data);
|
|
1649
|
+
stream[kImpl].data.write(data, current);
|
|
1650
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, current + length);
|
|
1651
|
+
Atomics.notify(stream[kImpl].state, WRITE_INDEX);
|
|
1652
|
+
cb();
|
|
1653
|
+
return true;
|
|
1654
|
+
}
|
|
1655
|
+
function end(stream) {
|
|
1656
|
+
if (stream[kImpl].ended || !stream[kImpl].ending || stream[kImpl].flushing) return;
|
|
1657
|
+
stream[kImpl].ended = true;
|
|
1658
|
+
try {
|
|
1659
|
+
stream.flushSync();
|
|
1660
|
+
let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
|
|
1661
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, -1);
|
|
1662
|
+
Atomics.notify(stream[kImpl].state, WRITE_INDEX);
|
|
1663
|
+
let spins = 0;
|
|
1664
|
+
while(-1 !== readIndex){
|
|
1665
|
+
Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1000);
|
|
1666
|
+
readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
|
|
1667
|
+
if (-2 === readIndex) return void destroy(stream, new Error('end() failed'));
|
|
1668
|
+
if (10 === ++spins) return void destroy(stream, new Error('end() took too long (10s)'));
|
|
1669
|
+
}
|
|
1670
|
+
process.nextTick(()=>{
|
|
1671
|
+
stream[kImpl].finished = true;
|
|
1672
|
+
stream.emit('finish');
|
|
1673
|
+
});
|
|
1674
|
+
} catch (err) {
|
|
1675
|
+
destroy(stream, err);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
function writeSync(stream) {
|
|
1679
|
+
const cb = ()=>{
|
|
1680
|
+
if (stream[kImpl].ending) end(stream);
|
|
1681
|
+
else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
|
|
1682
|
+
};
|
|
1683
|
+
stream[kImpl].flushing = false;
|
|
1684
|
+
while(0 !== stream[kImpl].buf.length){
|
|
1685
|
+
const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
|
|
1686
|
+
let leftover = stream[kImpl].data.length - writeIndex;
|
|
1687
|
+
if (0 === leftover) {
|
|
1688
|
+
flushSync(stream);
|
|
1689
|
+
Atomics.store(stream[kImpl].state, READ_INDEX, 0);
|
|
1690
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
1691
|
+
continue;
|
|
1692
|
+
}
|
|
1693
|
+
if (leftover < 0) throw new Error('overwritten');
|
|
1694
|
+
let toWrite = stream[kImpl].buf.slice(0, leftover);
|
|
1695
|
+
let toWriteBytes = Buffer.byteLength(toWrite);
|
|
1696
|
+
if (toWriteBytes <= leftover) {
|
|
1697
|
+
stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
|
|
1698
|
+
write(stream, toWrite, cb);
|
|
1699
|
+
} else {
|
|
1700
|
+
flushSync(stream);
|
|
1701
|
+
Atomics.store(stream[kImpl].state, READ_INDEX, 0);
|
|
1702
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
1703
|
+
while(toWriteBytes > stream[kImpl].buf.length){
|
|
1704
|
+
leftover /= 2;
|
|
1705
|
+
toWrite = stream[kImpl].buf.slice(0, leftover);
|
|
1706
|
+
toWriteBytes = Buffer.byteLength(toWrite);
|
|
1707
|
+
}
|
|
1708
|
+
stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
|
|
1709
|
+
write(stream, toWrite, cb);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
function flushSync(stream) {
|
|
1714
|
+
if (stream[kImpl].flushing) throw new Error('unable to flush while flushing');
|
|
1715
|
+
const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
|
|
1716
|
+
let spins = 0;
|
|
1717
|
+
while(true){
|
|
1718
|
+
const readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
|
|
1719
|
+
if (-2 === readIndex) throw Error('_flushSync failed');
|
|
1720
|
+
if (readIndex !== writeIndex) Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1000);
|
|
1721
|
+
else break;
|
|
1722
|
+
if (10 === ++spins) throw new Error('_flushSync took too long (10s)');
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
module1.exports = ThreadStream;
|
|
1726
|
+
},
|
|
1727
|
+
"../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/indexes.js": function(module1) {
|
|
1728
|
+
"use strict";
|
|
1729
|
+
const WRITE_INDEX = 4;
|
|
1730
|
+
const READ_INDEX = 8;
|
|
1731
|
+
module1.exports = {
|
|
1732
|
+
WRITE_INDEX,
|
|
1733
|
+
READ_INDEX
|
|
1734
|
+
};
|
|
1735
|
+
},
|
|
1736
|
+
"../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/wait.js": function(module1) {
|
|
1737
|
+
"use strict";
|
|
1738
|
+
const MAX_TIMEOUT = 1000;
|
|
1739
|
+
function wait(state, index, expected, timeout, done) {
|
|
1740
|
+
const max = Date.now() + timeout;
|
|
1741
|
+
let current = Atomics.load(state, index);
|
|
1742
|
+
if (current === expected) return void done(null, 'ok');
|
|
1743
|
+
let prior = current;
|
|
1744
|
+
const check = (backoff)=>{
|
|
1745
|
+
if (Date.now() > max) done(null, 'timed-out');
|
|
1746
|
+
else setTimeout(()=>{
|
|
1747
|
+
prior = current;
|
|
1748
|
+
current = Atomics.load(state, index);
|
|
1749
|
+
if (current === prior) check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : 2 * backoff);
|
|
1750
|
+
else current === expected ? done(null, 'ok') : done(null, 'not-equal');
|
|
1751
|
+
}, backoff);
|
|
1752
|
+
};
|
|
1753
|
+
check(1);
|
|
1754
|
+
}
|
|
1755
|
+
function waitDiff(state, index, expected, timeout, done) {
|
|
1756
|
+
const max = Date.now() + timeout;
|
|
1757
|
+
let current = Atomics.load(state, index);
|
|
1758
|
+
if (current !== expected) return void done(null, 'ok');
|
|
1759
|
+
const check = (backoff)=>{
|
|
1760
|
+
if (Date.now() > max) done(null, 'timed-out');
|
|
1761
|
+
else setTimeout(()=>{
|
|
1762
|
+
current = Atomics.load(state, index);
|
|
1763
|
+
if (current !== expected) done(null, 'ok');
|
|
1764
|
+
else check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : 2 * backoff);
|
|
1765
|
+
}, backoff);
|
|
1766
|
+
};
|
|
1767
|
+
check(1);
|
|
1768
|
+
}
|
|
1769
|
+
module1.exports = {
|
|
1770
|
+
wait,
|
|
1771
|
+
waitDiff
|
|
1772
|
+
};
|
|
1773
|
+
},
|
|
1774
|
+
assert: function(module1) {
|
|
1775
|
+
"use strict";
|
|
1776
|
+
module1.exports = require("assert");
|
|
1777
|
+
},
|
|
1778
|
+
buffer: function(module1) {
|
|
1779
|
+
"use strict";
|
|
1780
|
+
module1.exports = require("buffer");
|
|
1781
|
+
},
|
|
1782
|
+
events: function(module1) {
|
|
1783
|
+
"use strict";
|
|
1784
|
+
module1.exports = require("events");
|
|
1785
|
+
},
|
|
1786
|
+
fs: function(module1) {
|
|
1787
|
+
"use strict";
|
|
1788
|
+
module1.exports = require("fs");
|
|
1789
|
+
},
|
|
1790
|
+
module: function(module1) {
|
|
1791
|
+
"use strict";
|
|
1792
|
+
module1.exports = require("module");
|
|
1793
|
+
},
|
|
1794
|
+
"node:events": function(module1) {
|
|
1795
|
+
"use strict";
|
|
1796
|
+
module1.exports = require("node:events");
|
|
1797
|
+
},
|
|
1798
|
+
"node:os": function(module1) {
|
|
1799
|
+
"use strict";
|
|
1800
|
+
module1.exports = require("node:os");
|
|
1801
|
+
},
|
|
1802
|
+
"node:path": function(module1) {
|
|
1803
|
+
"use strict";
|
|
1804
|
+
module1.exports = require("node:path");
|
|
1805
|
+
},
|
|
1806
|
+
"node:stream": function(module1) {
|
|
1807
|
+
"use strict";
|
|
1808
|
+
module1.exports = require("node:stream");
|
|
1809
|
+
},
|
|
1810
|
+
path: function(module1) {
|
|
1811
|
+
"use strict";
|
|
1812
|
+
module1.exports = require("path");
|
|
1813
|
+
},
|
|
1814
|
+
stream: function(module1) {
|
|
1815
|
+
"use strict";
|
|
1816
|
+
module1.exports = require("stream");
|
|
1817
|
+
},
|
|
1818
|
+
string_decoder: function(module1) {
|
|
1819
|
+
"use strict";
|
|
1820
|
+
module1.exports = require("string_decoder");
|
|
1821
|
+
},
|
|
1822
|
+
url: function(module1) {
|
|
1823
|
+
"use strict";
|
|
1824
|
+
module1.exports = require("url");
|
|
1825
|
+
},
|
|
1826
|
+
util: function(module1) {
|
|
1827
|
+
"use strict";
|
|
1828
|
+
module1.exports = require("util");
|
|
1829
|
+
},
|
|
1830
|
+
worker_threads: function(module1) {
|
|
1831
|
+
"use strict";
|
|
1832
|
+
module1.exports = require("worker_threads");
|
|
1833
|
+
},
|
|
1834
|
+
"../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
1835
|
+
"use strict";
|
|
1836
|
+
const errSerializer = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err.js");
|
|
1837
|
+
const errWithCauseSerializer = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-with-cause.js");
|
|
1838
|
+
const reqSerializers = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/req.js");
|
|
1839
|
+
const resSerializers = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/res.js");
|
|
1840
|
+
module1.exports = {
|
|
1841
|
+
err: errSerializer,
|
|
1842
|
+
errWithCause: errWithCauseSerializer,
|
|
1843
|
+
mapHttpRequest: reqSerializers.mapHttpRequest,
|
|
1844
|
+
mapHttpResponse: resSerializers.mapHttpResponse,
|
|
1845
|
+
req: reqSerializers.reqSerializer,
|
|
1846
|
+
res: resSerializers.resSerializer,
|
|
1847
|
+
wrapErrorSerializer: function(customSerializer) {
|
|
1848
|
+
if (customSerializer === errSerializer) return customSerializer;
|
|
1849
|
+
return function(err) {
|
|
1850
|
+
return customSerializer(errSerializer(err));
|
|
1851
|
+
};
|
|
1852
|
+
},
|
|
1853
|
+
wrapRequestSerializer: function(customSerializer) {
|
|
1854
|
+
if (customSerializer === reqSerializers.reqSerializer) return customSerializer;
|
|
1855
|
+
return function(req) {
|
|
1856
|
+
return customSerializer(reqSerializers.reqSerializer(req));
|
|
1857
|
+
};
|
|
1858
|
+
},
|
|
1859
|
+
wrapResponseSerializer: function(customSerializer) {
|
|
1860
|
+
if (customSerializer === resSerializers.resSerializer) return customSerializer;
|
|
1861
|
+
return function(res) {
|
|
1862
|
+
return customSerializer(resSerializers.resSerializer(res));
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
};
|
|
1866
|
+
},
|
|
1867
|
+
"../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-helpers.js": function(module1) {
|
|
1868
|
+
"use strict";
|
|
1869
|
+
const isErrorLike = (err)=>err && 'string' == typeof err.message;
|
|
1870
|
+
const getErrorCause = (err)=>{
|
|
1871
|
+
if (!err) return;
|
|
1872
|
+
const cause = err.cause;
|
|
1873
|
+
if ('function' != typeof cause) return isErrorLike(cause) ? cause : void 0;
|
|
1874
|
+
{
|
|
1875
|
+
const causeResult = err.cause();
|
|
1876
|
+
return isErrorLike(causeResult) ? causeResult : void 0;
|
|
1877
|
+
}
|
|
1878
|
+
};
|
|
1879
|
+
const _stackWithCauses = (err, seen)=>{
|
|
1880
|
+
if (!isErrorLike(err)) return '';
|
|
1881
|
+
const stack = err.stack || '';
|
|
1882
|
+
if (seen.has(err)) return stack + '\ncauses have become circular...';
|
|
1883
|
+
const cause = getErrorCause(err);
|
|
1884
|
+
if (!cause) return stack;
|
|
1885
|
+
seen.add(err);
|
|
1886
|
+
return stack + '\ncaused by: ' + _stackWithCauses(cause, seen);
|
|
1887
|
+
};
|
|
1888
|
+
const stackWithCauses = (err)=>_stackWithCauses(err, new Set());
|
|
1889
|
+
const _messageWithCauses = (err, seen, skip)=>{
|
|
1890
|
+
if (!isErrorLike(err)) return '';
|
|
1891
|
+
const message = skip ? '' : err.message || '';
|
|
1892
|
+
if (seen.has(err)) return message + ': ...';
|
|
1893
|
+
const cause = getErrorCause(err);
|
|
1894
|
+
if (!cause) return message;
|
|
1895
|
+
{
|
|
1896
|
+
seen.add(err);
|
|
1897
|
+
const skipIfVErrorStyleCause = 'function' == typeof err.cause;
|
|
1898
|
+
return message + (skipIfVErrorStyleCause ? '' : ': ') + _messageWithCauses(cause, seen, skipIfVErrorStyleCause);
|
|
1899
|
+
}
|
|
1900
|
+
};
|
|
1901
|
+
const messageWithCauses = (err)=>_messageWithCauses(err, new Set());
|
|
1902
|
+
module1.exports = {
|
|
1903
|
+
isErrorLike,
|
|
1904
|
+
getErrorCause,
|
|
1905
|
+
stackWithCauses,
|
|
1906
|
+
messageWithCauses
|
|
1907
|
+
};
|
|
1908
|
+
},
|
|
1909
|
+
"../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-proto.js": function(module1) {
|
|
1910
|
+
"use strict";
|
|
1911
|
+
const seen = Symbol('circular-ref-tag');
|
|
1912
|
+
const rawSymbol = Symbol('pino-raw-err-ref');
|
|
1913
|
+
const pinoErrProto = Object.create({}, {
|
|
1914
|
+
type: {
|
|
1915
|
+
enumerable: true,
|
|
1916
|
+
writable: true,
|
|
1917
|
+
value: void 0
|
|
1918
|
+
},
|
|
1919
|
+
message: {
|
|
1920
|
+
enumerable: true,
|
|
1921
|
+
writable: true,
|
|
1922
|
+
value: void 0
|
|
1923
|
+
},
|
|
1924
|
+
stack: {
|
|
1925
|
+
enumerable: true,
|
|
1926
|
+
writable: true,
|
|
1927
|
+
value: void 0
|
|
1928
|
+
},
|
|
1929
|
+
aggregateErrors: {
|
|
1930
|
+
enumerable: true,
|
|
1931
|
+
writable: true,
|
|
1932
|
+
value: void 0
|
|
1933
|
+
},
|
|
1934
|
+
raw: {
|
|
1935
|
+
enumerable: false,
|
|
1936
|
+
get: function() {
|
|
1937
|
+
return this[rawSymbol];
|
|
1938
|
+
},
|
|
1939
|
+
set: function(val) {
|
|
1940
|
+
this[rawSymbol] = val;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
});
|
|
1944
|
+
Object.defineProperty(pinoErrProto, rawSymbol, {
|
|
1945
|
+
writable: true,
|
|
1946
|
+
value: {}
|
|
1947
|
+
});
|
|
1948
|
+
module1.exports = {
|
|
1949
|
+
pinoErrProto,
|
|
1950
|
+
pinoErrorSymbols: {
|
|
1951
|
+
seen,
|
|
1952
|
+
rawSymbol
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
},
|
|
1956
|
+
"../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-with-cause.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
1957
|
+
"use strict";
|
|
1958
|
+
module1.exports = errWithCauseSerializer;
|
|
1959
|
+
const { isErrorLike } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-helpers.js");
|
|
1960
|
+
const { pinoErrProto, pinoErrorSymbols } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-proto.js");
|
|
1961
|
+
const { seen } = pinoErrorSymbols;
|
|
1962
|
+
const { toString } = Object.prototype;
|
|
1963
|
+
function errWithCauseSerializer(err) {
|
|
1964
|
+
if (!isErrorLike(err)) return err;
|
|
1965
|
+
err[seen] = void 0;
|
|
1966
|
+
const _err = Object.create(pinoErrProto);
|
|
1967
|
+
_err.type = '[object Function]' === toString.call(err.constructor) ? err.constructor.name : err.name;
|
|
1968
|
+
_err.message = err.message;
|
|
1969
|
+
_err.stack = err.stack;
|
|
1970
|
+
if (Array.isArray(err.errors)) _err.aggregateErrors = err.errors.map((err)=>errWithCauseSerializer(err));
|
|
1971
|
+
if (isErrorLike(err.cause) && !Object.prototype.hasOwnProperty.call(err.cause, seen)) _err.cause = errWithCauseSerializer(err.cause);
|
|
1972
|
+
for(const key in err)if (void 0 === _err[key]) {
|
|
1973
|
+
const val = err[key];
|
|
1974
|
+
if (isErrorLike(val)) {
|
|
1975
|
+
if (!Object.prototype.hasOwnProperty.call(val, seen)) _err[key] = errWithCauseSerializer(val);
|
|
1976
|
+
} else _err[key] = val;
|
|
1977
|
+
}
|
|
1978
|
+
delete err[seen];
|
|
1979
|
+
_err.raw = err;
|
|
1980
|
+
return _err;
|
|
1981
|
+
}
|
|
1982
|
+
},
|
|
1983
|
+
"../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
1984
|
+
"use strict";
|
|
1985
|
+
module1.exports = errSerializer;
|
|
1986
|
+
const { messageWithCauses, stackWithCauses, isErrorLike } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-helpers.js");
|
|
1987
|
+
const { pinoErrProto, pinoErrorSymbols } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-proto.js");
|
|
1988
|
+
const { seen } = pinoErrorSymbols;
|
|
1989
|
+
const { toString } = Object.prototype;
|
|
1990
|
+
function errSerializer(err) {
|
|
1991
|
+
if (!isErrorLike(err)) return err;
|
|
1992
|
+
err[seen] = void 0;
|
|
1993
|
+
const _err = Object.create(pinoErrProto);
|
|
1994
|
+
_err.type = '[object Function]' === toString.call(err.constructor) ? err.constructor.name : err.name;
|
|
1995
|
+
_err.message = messageWithCauses(err);
|
|
1996
|
+
_err.stack = stackWithCauses(err);
|
|
1997
|
+
if (Array.isArray(err.errors)) _err.aggregateErrors = err.errors.map((err)=>errSerializer(err));
|
|
1998
|
+
for(const key in err)if (void 0 === _err[key]) {
|
|
1999
|
+
const val = err[key];
|
|
2000
|
+
if (isErrorLike(val)) {
|
|
2001
|
+
if ('cause' !== key && !Object.prototype.hasOwnProperty.call(val, seen)) _err[key] = errSerializer(val);
|
|
2002
|
+
} else _err[key] = val;
|
|
2003
|
+
}
|
|
2004
|
+
delete err[seen];
|
|
2005
|
+
_err.raw = err;
|
|
2006
|
+
return _err;
|
|
2007
|
+
}
|
|
2008
|
+
},
|
|
2009
|
+
"../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/req.js": function(module1) {
|
|
2010
|
+
"use strict";
|
|
2011
|
+
module1.exports = {
|
|
2012
|
+
mapHttpRequest,
|
|
2013
|
+
reqSerializer
|
|
2014
|
+
};
|
|
2015
|
+
const rawSymbol = Symbol('pino-raw-req-ref');
|
|
2016
|
+
const pinoReqProto = Object.create({}, {
|
|
2017
|
+
id: {
|
|
2018
|
+
enumerable: true,
|
|
2019
|
+
writable: true,
|
|
2020
|
+
value: ''
|
|
2021
|
+
},
|
|
2022
|
+
method: {
|
|
2023
|
+
enumerable: true,
|
|
2024
|
+
writable: true,
|
|
2025
|
+
value: ''
|
|
2026
|
+
},
|
|
2027
|
+
url: {
|
|
2028
|
+
enumerable: true,
|
|
2029
|
+
writable: true,
|
|
2030
|
+
value: ''
|
|
2031
|
+
},
|
|
2032
|
+
query: {
|
|
2033
|
+
enumerable: true,
|
|
2034
|
+
writable: true,
|
|
2035
|
+
value: ''
|
|
2036
|
+
},
|
|
2037
|
+
params: {
|
|
2038
|
+
enumerable: true,
|
|
2039
|
+
writable: true,
|
|
2040
|
+
value: ''
|
|
2041
|
+
},
|
|
2042
|
+
headers: {
|
|
2043
|
+
enumerable: true,
|
|
2044
|
+
writable: true,
|
|
2045
|
+
value: {}
|
|
2046
|
+
},
|
|
2047
|
+
remoteAddress: {
|
|
2048
|
+
enumerable: true,
|
|
2049
|
+
writable: true,
|
|
2050
|
+
value: ''
|
|
2051
|
+
},
|
|
2052
|
+
remotePort: {
|
|
2053
|
+
enumerable: true,
|
|
2054
|
+
writable: true,
|
|
2055
|
+
value: ''
|
|
2056
|
+
},
|
|
2057
|
+
raw: {
|
|
2058
|
+
enumerable: false,
|
|
2059
|
+
get: function() {
|
|
2060
|
+
return this[rawSymbol];
|
|
2061
|
+
},
|
|
2062
|
+
set: function(val) {
|
|
2063
|
+
this[rawSymbol] = val;
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
});
|
|
2067
|
+
Object.defineProperty(pinoReqProto, rawSymbol, {
|
|
2068
|
+
writable: true,
|
|
2069
|
+
value: {}
|
|
2070
|
+
});
|
|
2071
|
+
function reqSerializer(req) {
|
|
2072
|
+
const connection = req.info || req.socket;
|
|
2073
|
+
const _req = Object.create(pinoReqProto);
|
|
2074
|
+
_req.id = 'function' == typeof req.id ? req.id() : req.id || (req.info ? req.info.id : void 0);
|
|
2075
|
+
_req.method = req.method;
|
|
2076
|
+
if (req.originalUrl) _req.url = req.originalUrl;
|
|
2077
|
+
else {
|
|
2078
|
+
const path = req.path;
|
|
2079
|
+
_req.url = 'string' == typeof path ? path : req.url ? req.url.path || req.url : void 0;
|
|
2080
|
+
}
|
|
2081
|
+
if (req.query) _req.query = req.query;
|
|
2082
|
+
if (req.params) _req.params = req.params;
|
|
2083
|
+
_req.headers = req.headers;
|
|
2084
|
+
_req.remoteAddress = connection && connection.remoteAddress;
|
|
2085
|
+
_req.remotePort = connection && connection.remotePort;
|
|
2086
|
+
_req.raw = req.raw || req;
|
|
2087
|
+
return _req;
|
|
2088
|
+
}
|
|
2089
|
+
function mapHttpRequest(req) {
|
|
2090
|
+
return {
|
|
2091
|
+
req: reqSerializer(req)
|
|
2092
|
+
};
|
|
2093
|
+
}
|
|
2094
|
+
},
|
|
2095
|
+
"../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/res.js": function(module1) {
|
|
2096
|
+
"use strict";
|
|
2097
|
+
module1.exports = {
|
|
2098
|
+
mapHttpResponse,
|
|
2099
|
+
resSerializer
|
|
2100
|
+
};
|
|
2101
|
+
const rawSymbol = Symbol('pino-raw-res-ref');
|
|
2102
|
+
const pinoResProto = Object.create({}, {
|
|
2103
|
+
statusCode: {
|
|
2104
|
+
enumerable: true,
|
|
2105
|
+
writable: true,
|
|
2106
|
+
value: 0
|
|
2107
|
+
},
|
|
2108
|
+
headers: {
|
|
2109
|
+
enumerable: true,
|
|
2110
|
+
writable: true,
|
|
2111
|
+
value: ''
|
|
2112
|
+
},
|
|
2113
|
+
raw: {
|
|
2114
|
+
enumerable: false,
|
|
2115
|
+
get: function() {
|
|
2116
|
+
return this[rawSymbol];
|
|
2117
|
+
},
|
|
2118
|
+
set: function(val) {
|
|
2119
|
+
this[rawSymbol] = val;
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
});
|
|
2123
|
+
Object.defineProperty(pinoResProto, rawSymbol, {
|
|
2124
|
+
writable: true,
|
|
2125
|
+
value: {}
|
|
2126
|
+
});
|
|
2127
|
+
function resSerializer(res) {
|
|
2128
|
+
const _res = Object.create(pinoResProto);
|
|
2129
|
+
_res.statusCode = res.headersSent ? res.statusCode : null;
|
|
2130
|
+
_res.headers = res.getHeaders ? res.getHeaders() : res._headers;
|
|
2131
|
+
_res.raw = res;
|
|
2132
|
+
return _res;
|
|
2133
|
+
}
|
|
2134
|
+
function mapHttpResponse(res) {
|
|
2135
|
+
return {
|
|
2136
|
+
res: resSerializer(res)
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
},
|
|
2140
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/caller.js": function(module1) {
|
|
2141
|
+
"use strict";
|
|
2142
|
+
function noOpPrepareStackTrace(_, stack) {
|
|
2143
|
+
return stack;
|
|
2144
|
+
}
|
|
2145
|
+
module1.exports = function() {
|
|
2146
|
+
const originalPrepare = Error.prepareStackTrace;
|
|
2147
|
+
Error.prepareStackTrace = noOpPrepareStackTrace;
|
|
2148
|
+
const stack = new Error().stack;
|
|
2149
|
+
Error.prepareStackTrace = originalPrepare;
|
|
2150
|
+
if (!Array.isArray(stack)) return;
|
|
2151
|
+
const entries = stack.slice(2);
|
|
2152
|
+
const fileNames = [];
|
|
2153
|
+
for (const entry of entries)if (entry) fileNames.push(entry.getFileName());
|
|
2154
|
+
return fileNames;
|
|
2155
|
+
};
|
|
2156
|
+
},
|
|
2157
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/constants.js": function(module1) {
|
|
2158
|
+
const DEFAULT_LEVELS = {
|
|
2159
|
+
trace: 10,
|
|
2160
|
+
debug: 20,
|
|
2161
|
+
info: 30,
|
|
2162
|
+
warn: 40,
|
|
2163
|
+
error: 50,
|
|
2164
|
+
fatal: 60
|
|
2165
|
+
};
|
|
2166
|
+
const SORTING_ORDER = {
|
|
2167
|
+
ASC: 'ASC',
|
|
2168
|
+
DESC: 'DESC'
|
|
2169
|
+
};
|
|
2170
|
+
module1.exports = {
|
|
2171
|
+
DEFAULT_LEVELS,
|
|
2172
|
+
SORTING_ORDER
|
|
2173
|
+
};
|
|
2174
|
+
},
|
|
2175
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/levels.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2176
|
+
"use strict";
|
|
2177
|
+
const { lsCacheSym, levelValSym, useOnlyCustomLevelsSym, streamSym, formattersSym, hooksSym, levelCompSym } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/symbols.js");
|
|
2178
|
+
const { noop, genLog } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/tools.js");
|
|
2179
|
+
const { DEFAULT_LEVELS, SORTING_ORDER } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/constants.js");
|
|
2180
|
+
const levelMethods = {
|
|
2181
|
+
fatal: (hook)=>{
|
|
2182
|
+
const logFatal = genLog(DEFAULT_LEVELS.fatal, hook);
|
|
2183
|
+
return function(...args) {
|
|
2184
|
+
const stream = this[streamSym];
|
|
2185
|
+
logFatal.call(this, ...args);
|
|
2186
|
+
if ('function' == typeof stream.flushSync) try {
|
|
2187
|
+
stream.flushSync();
|
|
2188
|
+
} catch (e) {}
|
|
2189
|
+
};
|
|
2190
|
+
},
|
|
2191
|
+
error: (hook)=>genLog(DEFAULT_LEVELS.error, hook),
|
|
2192
|
+
warn: (hook)=>genLog(DEFAULT_LEVELS.warn, hook),
|
|
2193
|
+
info: (hook)=>genLog(DEFAULT_LEVELS.info, hook),
|
|
2194
|
+
debug: (hook)=>genLog(DEFAULT_LEVELS.debug, hook),
|
|
2195
|
+
trace: (hook)=>genLog(DEFAULT_LEVELS.trace, hook)
|
|
2196
|
+
};
|
|
2197
|
+
const nums = Object.keys(DEFAULT_LEVELS).reduce((o, k)=>{
|
|
2198
|
+
o[DEFAULT_LEVELS[k]] = k;
|
|
2199
|
+
return o;
|
|
2200
|
+
}, {});
|
|
2201
|
+
const initialLsCache = Object.keys(nums).reduce((o, k)=>{
|
|
2202
|
+
o[k] = '{"level":' + Number(k);
|
|
2203
|
+
return o;
|
|
2204
|
+
}, {});
|
|
2205
|
+
function genLsCache(instance) {
|
|
2206
|
+
const formatter = instance[formattersSym].level;
|
|
2207
|
+
const { labels } = instance.levels;
|
|
2208
|
+
const cache = {};
|
|
2209
|
+
for(const label in labels){
|
|
2210
|
+
const level = formatter(labels[label], Number(label));
|
|
2211
|
+
cache[label] = JSON.stringify(level).slice(0, -1);
|
|
2212
|
+
}
|
|
2213
|
+
instance[lsCacheSym] = cache;
|
|
2214
|
+
return instance;
|
|
2215
|
+
}
|
|
2216
|
+
function isStandardLevel(level, useOnlyCustomLevels) {
|
|
2217
|
+
if (useOnlyCustomLevels) return false;
|
|
2218
|
+
switch(level){
|
|
2219
|
+
case 'fatal':
|
|
2220
|
+
case 'error':
|
|
2221
|
+
case 'warn':
|
|
2222
|
+
case 'info':
|
|
2223
|
+
case 'debug':
|
|
2224
|
+
case 'trace':
|
|
2225
|
+
return true;
|
|
2226
|
+
default:
|
|
2227
|
+
return false;
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
function setLevel(level) {
|
|
2231
|
+
const { labels, values } = this.levels;
|
|
2232
|
+
if ('number' == typeof level) {
|
|
2233
|
+
if (void 0 === labels[level]) throw Error('unknown level value' + level);
|
|
2234
|
+
level = labels[level];
|
|
2235
|
+
}
|
|
2236
|
+
if (void 0 === values[level]) throw Error('unknown level ' + level);
|
|
2237
|
+
const preLevelVal = this[levelValSym];
|
|
2238
|
+
const levelVal = this[levelValSym] = values[level];
|
|
2239
|
+
const useOnlyCustomLevelsVal = this[useOnlyCustomLevelsSym];
|
|
2240
|
+
const levelComparison = this[levelCompSym];
|
|
2241
|
+
const hook = this[hooksSym].logMethod;
|
|
2242
|
+
for(const key in values){
|
|
2243
|
+
if (false === levelComparison(values[key], levelVal)) {
|
|
2244
|
+
this[key] = noop;
|
|
2245
|
+
continue;
|
|
2246
|
+
}
|
|
2247
|
+
this[key] = isStandardLevel(key, useOnlyCustomLevelsVal) ? levelMethods[key](hook) : genLog(values[key], hook);
|
|
2248
|
+
}
|
|
2249
|
+
this.emit('level-change', level, levelVal, labels[preLevelVal], preLevelVal, this);
|
|
2250
|
+
}
|
|
2251
|
+
function getLevel(level) {
|
|
2252
|
+
const { levels, levelVal } = this;
|
|
2253
|
+
return levels && levels.labels ? levels.labels[levelVal] : '';
|
|
2254
|
+
}
|
|
2255
|
+
function isLevelEnabled(logLevel) {
|
|
2256
|
+
const { values } = this.levels;
|
|
2257
|
+
const logLevelVal = values[logLevel];
|
|
2258
|
+
return void 0 !== logLevelVal && this[levelCompSym](logLevelVal, this[levelValSym]);
|
|
2259
|
+
}
|
|
2260
|
+
function compareLevel(direction, current, expected) {
|
|
2261
|
+
if (direction === SORTING_ORDER.DESC) return current <= expected;
|
|
2262
|
+
return current >= expected;
|
|
2263
|
+
}
|
|
2264
|
+
function genLevelComparison(levelComparison) {
|
|
2265
|
+
if ('string' == typeof levelComparison) return compareLevel.bind(null, levelComparison);
|
|
2266
|
+
return levelComparison;
|
|
2267
|
+
}
|
|
2268
|
+
function mappings(customLevels = null, useOnlyCustomLevels = false) {
|
|
2269
|
+
const customNums = customLevels ? Object.keys(customLevels).reduce((o, k)=>{
|
|
2270
|
+
o[customLevels[k]] = k;
|
|
2271
|
+
return o;
|
|
2272
|
+
}, {}) : null;
|
|
2273
|
+
const labels = Object.assign(Object.create(Object.prototype, {
|
|
2274
|
+
Infinity: {
|
|
2275
|
+
value: 'silent'
|
|
2276
|
+
}
|
|
2277
|
+
}), useOnlyCustomLevels ? null : nums, customNums);
|
|
2278
|
+
const values = Object.assign(Object.create(Object.prototype, {
|
|
2279
|
+
silent: {
|
|
2280
|
+
value: 1 / 0
|
|
2281
|
+
}
|
|
2282
|
+
}), useOnlyCustomLevels ? null : DEFAULT_LEVELS, customLevels);
|
|
2283
|
+
return {
|
|
2284
|
+
labels,
|
|
2285
|
+
values
|
|
2286
|
+
};
|
|
2287
|
+
}
|
|
2288
|
+
function assertDefaultLevelFound(defaultLevel, customLevels, useOnlyCustomLevels) {
|
|
2289
|
+
if ('number' == typeof defaultLevel) {
|
|
2290
|
+
const values = [].concat(Object.keys(customLevels || {}).map((key)=>customLevels[key]), useOnlyCustomLevels ? [] : Object.keys(nums).map((level)=>+level), 1 / 0);
|
|
2291
|
+
if (!values.includes(defaultLevel)) throw Error(`default level:${defaultLevel} must be included in custom levels`);
|
|
2292
|
+
return;
|
|
2293
|
+
}
|
|
2294
|
+
const labels = Object.assign(Object.create(Object.prototype, {
|
|
2295
|
+
silent: {
|
|
2296
|
+
value: 1 / 0
|
|
2297
|
+
}
|
|
2298
|
+
}), useOnlyCustomLevels ? null : DEFAULT_LEVELS, customLevels);
|
|
2299
|
+
if (!(defaultLevel in labels)) throw Error(`default level:${defaultLevel} must be included in custom levels`);
|
|
2300
|
+
}
|
|
2301
|
+
function assertNoLevelCollisions(levels, customLevels) {
|
|
2302
|
+
const { labels, values } = levels;
|
|
2303
|
+
for(const k in customLevels){
|
|
2304
|
+
if (k in values) throw Error('levels cannot be overridden');
|
|
2305
|
+
if (customLevels[k] in labels) throw Error('pre-existing level values cannot be used for new levels');
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
function assertLevelComparison(levelComparison) {
|
|
2309
|
+
if ('function' == typeof levelComparison) return;
|
|
2310
|
+
if ('string' == typeof levelComparison && Object.values(SORTING_ORDER).includes(levelComparison)) return;
|
|
2311
|
+
throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type');
|
|
2312
|
+
}
|
|
2313
|
+
module1.exports = {
|
|
2314
|
+
initialLsCache,
|
|
2315
|
+
genLsCache,
|
|
2316
|
+
levelMethods,
|
|
2317
|
+
getLevel,
|
|
2318
|
+
setLevel,
|
|
2319
|
+
isLevelEnabled,
|
|
2320
|
+
mappings,
|
|
2321
|
+
assertNoLevelCollisions,
|
|
2322
|
+
assertDefaultLevelFound,
|
|
2323
|
+
genLevelComparison,
|
|
2324
|
+
assertLevelComparison
|
|
2325
|
+
};
|
|
2326
|
+
},
|
|
2327
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/meta.js": function(module1) {
|
|
2328
|
+
"use strict";
|
|
2329
|
+
module1.exports = {
|
|
2330
|
+
version: '9.7.0'
|
|
2331
|
+
};
|
|
2332
|
+
},
|
|
2333
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/multistream.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2334
|
+
"use strict";
|
|
2335
|
+
const metadata = Symbol.for('pino.metadata');
|
|
2336
|
+
const { DEFAULT_LEVELS } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/constants.js");
|
|
2337
|
+
const DEFAULT_INFO_LEVEL = DEFAULT_LEVELS.info;
|
|
2338
|
+
function multistream(streamsArray, opts) {
|
|
2339
|
+
let counter = 0;
|
|
2340
|
+
streamsArray = streamsArray || [];
|
|
2341
|
+
opts = opts || {
|
|
2342
|
+
dedupe: false
|
|
2343
|
+
};
|
|
2344
|
+
const streamLevels = Object.create(DEFAULT_LEVELS);
|
|
2345
|
+
streamLevels.silent = 1 / 0;
|
|
2346
|
+
if (opts.levels && 'object' == typeof opts.levels) Object.keys(opts.levels).forEach((i)=>{
|
|
2347
|
+
streamLevels[i] = opts.levels[i];
|
|
2348
|
+
});
|
|
2349
|
+
const res = {
|
|
2350
|
+
write,
|
|
2351
|
+
add,
|
|
2352
|
+
emit,
|
|
2353
|
+
flushSync,
|
|
2354
|
+
end,
|
|
2355
|
+
minLevel: 0,
|
|
2356
|
+
streams: [],
|
|
2357
|
+
clone,
|
|
2358
|
+
[metadata]: true,
|
|
2359
|
+
streamLevels
|
|
2360
|
+
};
|
|
2361
|
+
if (Array.isArray(streamsArray)) streamsArray.forEach(add, res);
|
|
2362
|
+
else add.call(res, streamsArray);
|
|
2363
|
+
streamsArray = null;
|
|
2364
|
+
return res;
|
|
2365
|
+
function write(data) {
|
|
2366
|
+
let dest;
|
|
2367
|
+
const level = this.lastLevel;
|
|
2368
|
+
const { streams } = this;
|
|
2369
|
+
let recordedLevel = 0;
|
|
2370
|
+
let stream;
|
|
2371
|
+
for(let i = initLoopVar(streams.length, opts.dedupe); checkLoopVar(i, streams.length, opts.dedupe); i = adjustLoopVar(i, opts.dedupe)){
|
|
2372
|
+
dest = streams[i];
|
|
2373
|
+
if (dest.level <= level) {
|
|
2374
|
+
if (0 !== recordedLevel && recordedLevel !== dest.level) break;
|
|
2375
|
+
stream = dest.stream;
|
|
2376
|
+
if (stream[metadata]) {
|
|
2377
|
+
const { lastTime, lastMsg, lastObj, lastLogger } = this;
|
|
2378
|
+
stream.lastLevel = level;
|
|
2379
|
+
stream.lastTime = lastTime;
|
|
2380
|
+
stream.lastMsg = lastMsg;
|
|
2381
|
+
stream.lastObj = lastObj;
|
|
2382
|
+
stream.lastLogger = lastLogger;
|
|
2383
|
+
}
|
|
2384
|
+
stream.write(data);
|
|
2385
|
+
if (opts.dedupe) recordedLevel = dest.level;
|
|
2386
|
+
} else if (!opts.dedupe) break;
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
function emit(...args) {
|
|
2390
|
+
for (const { stream } of this.streams)if ('function' == typeof stream.emit) stream.emit(...args);
|
|
2391
|
+
}
|
|
2392
|
+
function flushSync() {
|
|
2393
|
+
for (const { stream } of this.streams)if ('function' == typeof stream.flushSync) stream.flushSync();
|
|
2394
|
+
}
|
|
2395
|
+
function add(dest) {
|
|
2396
|
+
if (!dest) return res;
|
|
2397
|
+
const isStream = 'function' == typeof dest.write || dest.stream;
|
|
2398
|
+
const stream_ = dest.write ? dest : dest.stream;
|
|
2399
|
+
if (!isStream) throw Error('stream object needs to implement either StreamEntry or DestinationStream interface');
|
|
2400
|
+
const { streams, streamLevels } = this;
|
|
2401
|
+
let level;
|
|
2402
|
+
level = 'number' == typeof dest.levelVal ? dest.levelVal : 'string' == typeof dest.level ? streamLevels[dest.level] : 'number' == typeof dest.level ? dest.level : DEFAULT_INFO_LEVEL;
|
|
2403
|
+
const dest_ = {
|
|
2404
|
+
stream: stream_,
|
|
2405
|
+
level,
|
|
2406
|
+
levelVal: void 0,
|
|
2407
|
+
id: counter++
|
|
2408
|
+
};
|
|
2409
|
+
streams.unshift(dest_);
|
|
2410
|
+
streams.sort(compareByLevel);
|
|
2411
|
+
this.minLevel = streams[0].level;
|
|
2412
|
+
return res;
|
|
2413
|
+
}
|
|
2414
|
+
function end() {
|
|
2415
|
+
for (const { stream } of this.streams){
|
|
2416
|
+
if ('function' == typeof stream.flushSync) stream.flushSync();
|
|
2417
|
+
stream.end();
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
function clone(level) {
|
|
2421
|
+
const streams = new Array(this.streams.length);
|
|
2422
|
+
for(let i = 0; i < streams.length; i++)streams[i] = {
|
|
2423
|
+
level,
|
|
2424
|
+
stream: this.streams[i].stream
|
|
2425
|
+
};
|
|
2426
|
+
return {
|
|
2427
|
+
write,
|
|
2428
|
+
add,
|
|
2429
|
+
minLevel: level,
|
|
2430
|
+
streams,
|
|
2431
|
+
clone,
|
|
2432
|
+
emit,
|
|
2433
|
+
flushSync,
|
|
2434
|
+
[metadata]: true
|
|
2435
|
+
};
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
function compareByLevel(a, b) {
|
|
2439
|
+
return a.level - b.level;
|
|
2440
|
+
}
|
|
2441
|
+
function initLoopVar(length, dedupe) {
|
|
2442
|
+
return dedupe ? length - 1 : 0;
|
|
2443
|
+
}
|
|
2444
|
+
function adjustLoopVar(i, dedupe) {
|
|
2445
|
+
return dedupe ? i - 1 : i + 1;
|
|
2446
|
+
}
|
|
2447
|
+
function checkLoopVar(i, length, dedupe) {
|
|
2448
|
+
return dedupe ? i >= 0 : i < length;
|
|
2449
|
+
}
|
|
2450
|
+
module1.exports = multistream;
|
|
2451
|
+
},
|
|
2452
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/proto.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2453
|
+
"use strict";
|
|
2454
|
+
const { EventEmitter } = __webpack_require__("node:events");
|
|
2455
|
+
const { lsCacheSym, levelValSym, setLevelSym, getLevelSym, chindingsSym, parsedChindingsSym, mixinSym, asJsonSym, writeSym, mixinMergeStrategySym, timeSym, timeSliceIndexSym, streamSym, serializersSym, formattersSym, errorKeySym, messageKeySym, useOnlyCustomLevelsSym, needsMetadataGsym, redactFmtSym, stringifySym, formatOptsSym, stringifiersSym, msgPrefixSym, hooksSym } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/symbols.js");
|
|
2456
|
+
const { getLevel, setLevel, isLevelEnabled, mappings, initialLsCache, genLsCache, assertNoLevelCollisions } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/levels.js");
|
|
2457
|
+
const { asChindings, asJson, buildFormatters, stringify } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/tools.js");
|
|
2458
|
+
const { version } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/meta.js");
|
|
2459
|
+
const redaction = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/redaction.js");
|
|
2460
|
+
const constructor = class {
|
|
2461
|
+
};
|
|
2462
|
+
const prototype = {
|
|
2463
|
+
constructor,
|
|
2464
|
+
child,
|
|
2465
|
+
bindings,
|
|
2466
|
+
setBindings,
|
|
2467
|
+
flush,
|
|
2468
|
+
isLevelEnabled,
|
|
2469
|
+
version,
|
|
2470
|
+
get level () {
|
|
2471
|
+
return this[getLevelSym]();
|
|
2472
|
+
},
|
|
2473
|
+
set level (lvl){
|
|
2474
|
+
this[setLevelSym](lvl);
|
|
2475
|
+
},
|
|
2476
|
+
get levelVal () {
|
|
2477
|
+
return this[levelValSym];
|
|
2478
|
+
},
|
|
2479
|
+
set levelVal (n){
|
|
2480
|
+
throw Error('levelVal is read-only');
|
|
2481
|
+
},
|
|
2482
|
+
[lsCacheSym]: initialLsCache,
|
|
2483
|
+
[writeSym]: write,
|
|
2484
|
+
[asJsonSym]: asJson,
|
|
2485
|
+
[getLevelSym]: getLevel,
|
|
2486
|
+
[setLevelSym]: setLevel
|
|
2487
|
+
};
|
|
2488
|
+
Object.setPrototypeOf(prototype, EventEmitter.prototype);
|
|
2489
|
+
module1.exports = function() {
|
|
2490
|
+
return Object.create(prototype);
|
|
2491
|
+
};
|
|
2492
|
+
const resetChildingsFormatter = (bindings)=>bindings;
|
|
2493
|
+
function child(bindings, options) {
|
|
2494
|
+
if (!bindings) throw Error('missing bindings for child Pino');
|
|
2495
|
+
options = options || {};
|
|
2496
|
+
const serializers = this[serializersSym];
|
|
2497
|
+
const formatters = this[formattersSym];
|
|
2498
|
+
const instance = Object.create(this);
|
|
2499
|
+
if (true === options.hasOwnProperty('serializers')) {
|
|
2500
|
+
instance[serializersSym] = Object.create(null);
|
|
2501
|
+
for(const k in serializers)instance[serializersSym][k] = serializers[k];
|
|
2502
|
+
const parentSymbols = Object.getOwnPropertySymbols(serializers);
|
|
2503
|
+
for(var i = 0; i < parentSymbols.length; i++){
|
|
2504
|
+
const ks = parentSymbols[i];
|
|
2505
|
+
instance[serializersSym][ks] = serializers[ks];
|
|
2506
|
+
}
|
|
2507
|
+
for(const bk in options.serializers)instance[serializersSym][bk] = options.serializers[bk];
|
|
2508
|
+
const bindingsSymbols = Object.getOwnPropertySymbols(options.serializers);
|
|
2509
|
+
for(var bi = 0; bi < bindingsSymbols.length; bi++){
|
|
2510
|
+
const bks = bindingsSymbols[bi];
|
|
2511
|
+
instance[serializersSym][bks] = options.serializers[bks];
|
|
2512
|
+
}
|
|
2513
|
+
} else instance[serializersSym] = serializers;
|
|
2514
|
+
if (options.hasOwnProperty('formatters')) {
|
|
2515
|
+
const { level, bindings: chindings, log } = options.formatters;
|
|
2516
|
+
instance[formattersSym] = buildFormatters(level || formatters.level, chindings || resetChildingsFormatter, log || formatters.log);
|
|
2517
|
+
} else instance[formattersSym] = buildFormatters(formatters.level, resetChildingsFormatter, formatters.log);
|
|
2518
|
+
if (true === options.hasOwnProperty('customLevels')) {
|
|
2519
|
+
assertNoLevelCollisions(this.levels, options.customLevels);
|
|
2520
|
+
instance.levels = mappings(options.customLevels, instance[useOnlyCustomLevelsSym]);
|
|
2521
|
+
genLsCache(instance);
|
|
2522
|
+
}
|
|
2523
|
+
if ('object' == typeof options.redact && null !== options.redact || Array.isArray(options.redact)) {
|
|
2524
|
+
instance.redact = options.redact;
|
|
2525
|
+
const stringifiers = redaction(instance.redact, stringify);
|
|
2526
|
+
const formatOpts = {
|
|
2527
|
+
stringify: stringifiers[redactFmtSym]
|
|
2528
|
+
};
|
|
2529
|
+
instance[stringifySym] = stringify;
|
|
2530
|
+
instance[stringifiersSym] = stringifiers;
|
|
2531
|
+
instance[formatOptsSym] = formatOpts;
|
|
2532
|
+
}
|
|
2533
|
+
if ('string' == typeof options.msgPrefix) instance[msgPrefixSym] = (this[msgPrefixSym] || '') + options.msgPrefix;
|
|
2534
|
+
instance[chindingsSym] = asChindings(instance, bindings);
|
|
2535
|
+
const childLevel = options.level || this.level;
|
|
2536
|
+
instance[setLevelSym](childLevel);
|
|
2537
|
+
this.onChild(instance);
|
|
2538
|
+
return instance;
|
|
2539
|
+
}
|
|
2540
|
+
function bindings() {
|
|
2541
|
+
const chindings = this[chindingsSym];
|
|
2542
|
+
const chindingsJson = `{${chindings.substr(1)}}`;
|
|
2543
|
+
const bindingsFromJson = JSON.parse(chindingsJson);
|
|
2544
|
+
delete bindingsFromJson.pid;
|
|
2545
|
+
delete bindingsFromJson.hostname;
|
|
2546
|
+
return bindingsFromJson;
|
|
2547
|
+
}
|
|
2548
|
+
function setBindings(newBindings) {
|
|
2549
|
+
const chindings = asChindings(this, newBindings);
|
|
2550
|
+
this[chindingsSym] = chindings;
|
|
2551
|
+
delete this[parsedChindingsSym];
|
|
2552
|
+
}
|
|
2553
|
+
function defaultMixinMergeStrategy(mergeObject, mixinObject) {
|
|
2554
|
+
return Object.assign(mixinObject, mergeObject);
|
|
2555
|
+
}
|
|
2556
|
+
function write(_obj, msg, num) {
|
|
2557
|
+
const t = this[timeSym]();
|
|
2558
|
+
const mixin = this[mixinSym];
|
|
2559
|
+
const errorKey = this[errorKeySym];
|
|
2560
|
+
const messageKey = this[messageKeySym];
|
|
2561
|
+
const mixinMergeStrategy = this[mixinMergeStrategySym] || defaultMixinMergeStrategy;
|
|
2562
|
+
let obj;
|
|
2563
|
+
const streamWriteHook = this[hooksSym].streamWrite;
|
|
2564
|
+
if (null == _obj) obj = {};
|
|
2565
|
+
else if (_obj instanceof Error) {
|
|
2566
|
+
obj = {
|
|
2567
|
+
[errorKey]: _obj
|
|
2568
|
+
};
|
|
2569
|
+
if (void 0 === msg) msg = _obj.message;
|
|
2570
|
+
} else {
|
|
2571
|
+
obj = _obj;
|
|
2572
|
+
if (void 0 === msg && void 0 === _obj[messageKey] && _obj[errorKey]) msg = _obj[errorKey].message;
|
|
2573
|
+
}
|
|
2574
|
+
if (mixin) obj = mixinMergeStrategy(obj, mixin(obj, num, this));
|
|
2575
|
+
const s = this[asJsonSym](obj, msg, num, t);
|
|
2576
|
+
const stream = this[streamSym];
|
|
2577
|
+
if (true === stream[needsMetadataGsym]) {
|
|
2578
|
+
stream.lastLevel = num;
|
|
2579
|
+
stream.lastObj = obj;
|
|
2580
|
+
stream.lastMsg = msg;
|
|
2581
|
+
stream.lastTime = t.slice(this[timeSliceIndexSym]);
|
|
2582
|
+
stream.lastLogger = this;
|
|
2583
|
+
}
|
|
2584
|
+
stream.write(streamWriteHook ? streamWriteHook(s) : s);
|
|
2585
|
+
}
|
|
2586
|
+
function noop() {}
|
|
2587
|
+
function flush(cb) {
|
|
2588
|
+
if (null != cb && 'function' != typeof cb) throw Error('callback must be a function');
|
|
2589
|
+
const stream = this[streamSym];
|
|
2590
|
+
if ('function' == typeof stream.flush) stream.flush(cb || noop);
|
|
2591
|
+
else if (cb) cb();
|
|
2592
|
+
}
|
|
2593
|
+
},
|
|
2594
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/redaction.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2595
|
+
"use strict";
|
|
2596
|
+
const fastRedact = __webpack_require__("../../node_modules/.pnpm/fast-redact@3.5.0/node_modules/fast-redact/index.js");
|
|
2597
|
+
const { redactFmtSym, wildcardFirstSym } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/symbols.js");
|
|
2598
|
+
const { rx, validator } = fastRedact;
|
|
2599
|
+
const validate = validator({
|
|
2600
|
+
ERR_PATHS_MUST_BE_STRINGS: ()=>'pino – redacted paths must be strings',
|
|
2601
|
+
ERR_INVALID_PATH: (s)=>`pino – redact paths array contains an invalid path (${s})`
|
|
2602
|
+
});
|
|
2603
|
+
const CENSOR = '[Redacted]';
|
|
2604
|
+
const strict = false;
|
|
2605
|
+
function redaction(opts, serialize) {
|
|
2606
|
+
const { paths, censor } = handle(opts);
|
|
2607
|
+
const shape = paths.reduce((o, str)=>{
|
|
2608
|
+
rx.lastIndex = 0;
|
|
2609
|
+
const first = rx.exec(str);
|
|
2610
|
+
const next = rx.exec(str);
|
|
2611
|
+
let ns = void 0 !== first[1] ? first[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/, '$1') : first[0];
|
|
2612
|
+
if ('*' === ns) ns = wildcardFirstSym;
|
|
2613
|
+
if (null === next) {
|
|
2614
|
+
o[ns] = null;
|
|
2615
|
+
return o;
|
|
2616
|
+
}
|
|
2617
|
+
if (null === o[ns]) return o;
|
|
2618
|
+
const { index } = next;
|
|
2619
|
+
const nextPath = `${str.substr(index, str.length - 1)}`;
|
|
2620
|
+
o[ns] = o[ns] || [];
|
|
2621
|
+
if (ns !== wildcardFirstSym && 0 === o[ns].length) o[ns].push(...o[wildcardFirstSym] || []);
|
|
2622
|
+
if (ns === wildcardFirstSym) Object.keys(o).forEach(function(k) {
|
|
2623
|
+
if (o[k]) o[k].push(nextPath);
|
|
2624
|
+
});
|
|
2625
|
+
o[ns].push(nextPath);
|
|
2626
|
+
return o;
|
|
2627
|
+
}, {});
|
|
2628
|
+
const result = {
|
|
2629
|
+
[redactFmtSym]: fastRedact({
|
|
2630
|
+
paths,
|
|
2631
|
+
censor,
|
|
2632
|
+
serialize,
|
|
2633
|
+
strict
|
|
2634
|
+
})
|
|
2635
|
+
};
|
|
2636
|
+
const topCensor = (...args)=>'function' == typeof censor ? serialize(censor(...args)) : serialize(censor);
|
|
2637
|
+
return [
|
|
2638
|
+
...Object.keys(shape),
|
|
2639
|
+
...Object.getOwnPropertySymbols(shape)
|
|
2640
|
+
].reduce((o, k)=>{
|
|
2641
|
+
if (null === shape[k]) o[k] = (value)=>topCensor(value, [
|
|
2642
|
+
k
|
|
2643
|
+
]);
|
|
2644
|
+
else {
|
|
2645
|
+
const wrappedCensor = 'function' == typeof censor ? (value, path)=>censor(value, [
|
|
2646
|
+
k,
|
|
2647
|
+
...path
|
|
2648
|
+
]) : censor;
|
|
2649
|
+
o[k] = fastRedact({
|
|
2650
|
+
paths: shape[k],
|
|
2651
|
+
censor: wrappedCensor,
|
|
2652
|
+
serialize,
|
|
2653
|
+
strict
|
|
2654
|
+
});
|
|
2655
|
+
}
|
|
2656
|
+
return o;
|
|
2657
|
+
}, result);
|
|
2658
|
+
}
|
|
2659
|
+
function handle(opts) {
|
|
2660
|
+
if (Array.isArray(opts)) {
|
|
2661
|
+
opts = {
|
|
2662
|
+
paths: opts,
|
|
2663
|
+
censor: CENSOR
|
|
2664
|
+
};
|
|
2665
|
+
validate(opts);
|
|
2666
|
+
return opts;
|
|
2667
|
+
}
|
|
2668
|
+
let { paths, censor = CENSOR, remove } = opts;
|
|
2669
|
+
if (false === Array.isArray(paths)) throw Error('pino – redact must contain an array of strings');
|
|
2670
|
+
if (true === remove) censor = void 0;
|
|
2671
|
+
validate({
|
|
2672
|
+
paths,
|
|
2673
|
+
censor
|
|
2674
|
+
});
|
|
2675
|
+
return {
|
|
2676
|
+
paths,
|
|
2677
|
+
censor
|
|
2678
|
+
};
|
|
2679
|
+
}
|
|
2680
|
+
module1.exports = redaction;
|
|
2681
|
+
},
|
|
2682
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/symbols.js": function(module1) {
|
|
2683
|
+
"use strict";
|
|
2684
|
+
const setLevelSym = Symbol('pino.setLevel');
|
|
2685
|
+
const getLevelSym = Symbol('pino.getLevel');
|
|
2686
|
+
const levelValSym = Symbol('pino.levelVal');
|
|
2687
|
+
const levelCompSym = Symbol('pino.levelComp');
|
|
2688
|
+
const useLevelLabelsSym = Symbol('pino.useLevelLabels');
|
|
2689
|
+
const useOnlyCustomLevelsSym = Symbol('pino.useOnlyCustomLevels');
|
|
2690
|
+
const mixinSym = Symbol('pino.mixin');
|
|
2691
|
+
const lsCacheSym = Symbol('pino.lsCache');
|
|
2692
|
+
const chindingsSym = Symbol('pino.chindings');
|
|
2693
|
+
const asJsonSym = Symbol('pino.asJson');
|
|
2694
|
+
const writeSym = Symbol('pino.write');
|
|
2695
|
+
const redactFmtSym = Symbol('pino.redactFmt');
|
|
2696
|
+
const timeSym = Symbol('pino.time');
|
|
2697
|
+
const timeSliceIndexSym = Symbol('pino.timeSliceIndex');
|
|
2698
|
+
const streamSym = Symbol('pino.stream');
|
|
2699
|
+
const stringifySym = Symbol('pino.stringify');
|
|
2700
|
+
const stringifySafeSym = Symbol('pino.stringifySafe');
|
|
2701
|
+
const stringifiersSym = Symbol('pino.stringifiers');
|
|
2702
|
+
const endSym = Symbol('pino.end');
|
|
2703
|
+
const formatOptsSym = Symbol('pino.formatOpts');
|
|
2704
|
+
const messageKeySym = Symbol('pino.messageKey');
|
|
2705
|
+
const errorKeySym = Symbol('pino.errorKey');
|
|
2706
|
+
const nestedKeySym = Symbol('pino.nestedKey');
|
|
2707
|
+
const nestedKeyStrSym = Symbol('pino.nestedKeyStr');
|
|
2708
|
+
const mixinMergeStrategySym = Symbol('pino.mixinMergeStrategy');
|
|
2709
|
+
const msgPrefixSym = Symbol('pino.msgPrefix');
|
|
2710
|
+
const wildcardFirstSym = Symbol('pino.wildcardFirst');
|
|
2711
|
+
const serializersSym = Symbol.for('pino.serializers');
|
|
2712
|
+
const formattersSym = Symbol.for('pino.formatters');
|
|
2713
|
+
const hooksSym = Symbol.for('pino.hooks');
|
|
2714
|
+
const needsMetadataGsym = Symbol.for('pino.metadata');
|
|
2715
|
+
module1.exports = {
|
|
2716
|
+
setLevelSym,
|
|
2717
|
+
getLevelSym,
|
|
2718
|
+
levelValSym,
|
|
2719
|
+
levelCompSym,
|
|
2720
|
+
useLevelLabelsSym,
|
|
2721
|
+
mixinSym,
|
|
2722
|
+
lsCacheSym,
|
|
2723
|
+
chindingsSym,
|
|
2724
|
+
asJsonSym,
|
|
2725
|
+
writeSym,
|
|
2726
|
+
serializersSym,
|
|
2727
|
+
redactFmtSym,
|
|
2728
|
+
timeSym,
|
|
2729
|
+
timeSliceIndexSym,
|
|
2730
|
+
streamSym,
|
|
2731
|
+
stringifySym,
|
|
2732
|
+
stringifySafeSym,
|
|
2733
|
+
stringifiersSym,
|
|
2734
|
+
endSym,
|
|
2735
|
+
formatOptsSym,
|
|
2736
|
+
messageKeySym,
|
|
2737
|
+
errorKeySym,
|
|
2738
|
+
nestedKeySym,
|
|
2739
|
+
wildcardFirstSym,
|
|
2740
|
+
needsMetadataGsym,
|
|
2741
|
+
useOnlyCustomLevelsSym,
|
|
2742
|
+
formattersSym,
|
|
2743
|
+
hooksSym,
|
|
2744
|
+
nestedKeyStrSym,
|
|
2745
|
+
mixinMergeStrategySym,
|
|
2746
|
+
msgPrefixSym
|
|
2747
|
+
};
|
|
2748
|
+
},
|
|
2749
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/time.js": function(module1) {
|
|
2750
|
+
"use strict";
|
|
2751
|
+
const nullTime = ()=>'';
|
|
2752
|
+
const epochTime = ()=>`,"time":${Date.now()}`;
|
|
2753
|
+
const unixTime = ()=>`,"time":${Math.round(Date.now() / 1000.0)}`;
|
|
2754
|
+
const isoTime = ()=>`,"time":"${new Date(Date.now()).toISOString()}"`;
|
|
2755
|
+
module1.exports = {
|
|
2756
|
+
nullTime,
|
|
2757
|
+
epochTime,
|
|
2758
|
+
unixTime,
|
|
2759
|
+
isoTime
|
|
2760
|
+
};
|
|
2761
|
+
},
|
|
2762
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/tools.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2763
|
+
"use strict";
|
|
2764
|
+
const format = __webpack_require__("../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js");
|
|
2765
|
+
const { mapHttpRequest, mapHttpResponse } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/index.js");
|
|
2766
|
+
const SonicBoom = __webpack_require__("../../node_modules/.pnpm/sonic-boom@4.2.0/node_modules/sonic-boom/index.js");
|
|
2767
|
+
const onExit = __webpack_require__("../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js");
|
|
2768
|
+
const { lsCacheSym, chindingsSym, writeSym, serializersSym, formatOptsSym, endSym, stringifiersSym, stringifySym, stringifySafeSym, wildcardFirstSym, nestedKeySym, formattersSym, messageKeySym, errorKeySym, nestedKeyStrSym, msgPrefixSym } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/symbols.js");
|
|
2769
|
+
const { isMainThread } = __webpack_require__("worker_threads");
|
|
2770
|
+
const transport = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/transport.js");
|
|
2771
|
+
function noop() {}
|
|
2772
|
+
function genLog(level, hook) {
|
|
2773
|
+
if (!hook) return LOG;
|
|
2774
|
+
return function(...args) {
|
|
2775
|
+
hook.call(this, args, LOG, level);
|
|
2776
|
+
};
|
|
2777
|
+
function LOG(o, ...n1) {
|
|
2778
|
+
if ('object' == typeof o) {
|
|
2779
|
+
let msg = o;
|
|
2780
|
+
if (null !== o) {
|
|
2781
|
+
if (o.method && o.headers && o.socket) o = mapHttpRequest(o);
|
|
2782
|
+
else if ('function' == typeof o.setHeader) o = mapHttpResponse(o);
|
|
2783
|
+
}
|
|
2784
|
+
let formatParams;
|
|
2785
|
+
if (null === msg && 0 === n1.length) formatParams = [
|
|
2786
|
+
null
|
|
2787
|
+
];
|
|
2788
|
+
else {
|
|
2789
|
+
msg = n1.shift();
|
|
2790
|
+
formatParams = n1;
|
|
2791
|
+
}
|
|
2792
|
+
if ('string' == typeof this[msgPrefixSym] && null != msg) msg = this[msgPrefixSym] + msg;
|
|
2793
|
+
this[writeSym](o, format(msg, formatParams, this[formatOptsSym]), level);
|
|
2794
|
+
} else {
|
|
2795
|
+
let msg = void 0 === o ? n1.shift() : o;
|
|
2796
|
+
if ('string' == typeof this[msgPrefixSym] && null != msg) msg = this[msgPrefixSym] + msg;
|
|
2797
|
+
this[writeSym](null, format(msg, n1, this[formatOptsSym]), level);
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
function asString(str) {
|
|
2802
|
+
let result = '';
|
|
2803
|
+
let last = 0;
|
|
2804
|
+
let found = false;
|
|
2805
|
+
let point = 255;
|
|
2806
|
+
const l = str.length;
|
|
2807
|
+
if (l > 100) return JSON.stringify(str);
|
|
2808
|
+
for(var i = 0; i < l && point >= 32; i++){
|
|
2809
|
+
point = str.charCodeAt(i);
|
|
2810
|
+
if (34 === point || 92 === point) {
|
|
2811
|
+
result += str.slice(last, i) + '\\';
|
|
2812
|
+
last = i;
|
|
2813
|
+
found = true;
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
if (found) result += str.slice(last);
|
|
2817
|
+
else result = str;
|
|
2818
|
+
return point < 32 ? JSON.stringify(str) : '"' + result + '"';
|
|
2819
|
+
}
|
|
2820
|
+
function asJson(obj, msg, num, time) {
|
|
2821
|
+
const stringify = this[stringifySym];
|
|
2822
|
+
const stringifySafe = this[stringifySafeSym];
|
|
2823
|
+
const stringifiers = this[stringifiersSym];
|
|
2824
|
+
const end = this[endSym];
|
|
2825
|
+
const chindings = this[chindingsSym];
|
|
2826
|
+
const serializers = this[serializersSym];
|
|
2827
|
+
const formatters = this[formattersSym];
|
|
2828
|
+
const messageKey = this[messageKeySym];
|
|
2829
|
+
const errorKey = this[errorKeySym];
|
|
2830
|
+
let data = this[lsCacheSym][num] + time;
|
|
2831
|
+
data += chindings;
|
|
2832
|
+
let value;
|
|
2833
|
+
if (formatters.log) obj = formatters.log(obj);
|
|
2834
|
+
const wildcardStringifier = stringifiers[wildcardFirstSym];
|
|
2835
|
+
let propStr = '';
|
|
2836
|
+
for(const key in obj){
|
|
2837
|
+
value = obj[key];
|
|
2838
|
+
if (Object.prototype.hasOwnProperty.call(obj, key) && void 0 !== value) {
|
|
2839
|
+
if (serializers[key]) value = serializers[key](value);
|
|
2840
|
+
else if (key === errorKey && serializers.err) value = serializers.err(value);
|
|
2841
|
+
const stringifier = stringifiers[key] || wildcardStringifier;
|
|
2842
|
+
switch(typeof value){
|
|
2843
|
+
case 'undefined':
|
|
2844
|
+
case 'function':
|
|
2845
|
+
continue;
|
|
2846
|
+
case 'number':
|
|
2847
|
+
if (false === Number.isFinite(value)) value = null;
|
|
2848
|
+
case 'boolean':
|
|
2849
|
+
if (stringifier) value = stringifier(value);
|
|
2850
|
+
break;
|
|
2851
|
+
case 'string':
|
|
2852
|
+
value = (stringifier || asString)(value);
|
|
2853
|
+
break;
|
|
2854
|
+
default:
|
|
2855
|
+
value = (stringifier || stringify)(value, stringifySafe);
|
|
2856
|
+
}
|
|
2857
|
+
if (void 0 === value) continue;
|
|
2858
|
+
const strKey = asString(key);
|
|
2859
|
+
propStr += ',' + strKey + ':' + value;
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
let msgStr = '';
|
|
2863
|
+
if (void 0 !== msg) {
|
|
2864
|
+
value = serializers[messageKey] ? serializers[messageKey](msg) : msg;
|
|
2865
|
+
const stringifier = stringifiers[messageKey] || wildcardStringifier;
|
|
2866
|
+
switch(typeof value){
|
|
2867
|
+
case 'function':
|
|
2868
|
+
break;
|
|
2869
|
+
case 'number':
|
|
2870
|
+
if (false === Number.isFinite(value)) value = null;
|
|
2871
|
+
case 'boolean':
|
|
2872
|
+
if (stringifier) value = stringifier(value);
|
|
2873
|
+
msgStr = ',"' + messageKey + '":' + value;
|
|
2874
|
+
break;
|
|
2875
|
+
case 'string':
|
|
2876
|
+
value = (stringifier || asString)(value);
|
|
2877
|
+
msgStr = ',"' + messageKey + '":' + value;
|
|
2878
|
+
break;
|
|
2879
|
+
default:
|
|
2880
|
+
value = (stringifier || stringify)(value, stringifySafe);
|
|
2881
|
+
msgStr = ',"' + messageKey + '":' + value;
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
if (this[nestedKeySym] && propStr) return data + this[nestedKeyStrSym] + propStr.slice(1) + '}' + msgStr + end;
|
|
2885
|
+
return data + propStr + msgStr + end;
|
|
2886
|
+
}
|
|
2887
|
+
function asChindings(instance, bindings) {
|
|
2888
|
+
let value;
|
|
2889
|
+
let data = instance[chindingsSym];
|
|
2890
|
+
const stringify = instance[stringifySym];
|
|
2891
|
+
const stringifySafe = instance[stringifySafeSym];
|
|
2892
|
+
const stringifiers = instance[stringifiersSym];
|
|
2893
|
+
const wildcardStringifier = stringifiers[wildcardFirstSym];
|
|
2894
|
+
const serializers = instance[serializersSym];
|
|
2895
|
+
const formatter = instance[formattersSym].bindings;
|
|
2896
|
+
bindings = formatter(bindings);
|
|
2897
|
+
for(const key in bindings){
|
|
2898
|
+
value = bindings[key];
|
|
2899
|
+
const valid = 'level' !== key && 'serializers' !== key && 'formatters' !== key && 'customLevels' !== key && bindings.hasOwnProperty(key) && void 0 !== value;
|
|
2900
|
+
if (true === valid) {
|
|
2901
|
+
value = serializers[key] ? serializers[key](value) : value;
|
|
2902
|
+
value = (stringifiers[key] || wildcardStringifier || stringify)(value, stringifySafe);
|
|
2903
|
+
if (void 0 === value) continue;
|
|
2904
|
+
data += ',"' + key + '":' + value;
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
return data;
|
|
2908
|
+
}
|
|
2909
|
+
function hasBeenTampered(stream) {
|
|
2910
|
+
return stream.write !== stream.constructor.prototype.write;
|
|
2911
|
+
}
|
|
2912
|
+
function buildSafeSonicBoom(opts) {
|
|
2913
|
+
const stream = new SonicBoom(opts);
|
|
2914
|
+
stream.on('error', filterBrokenPipe);
|
|
2915
|
+
if (!opts.sync && isMainThread) {
|
|
2916
|
+
onExit.register(stream, autoEnd);
|
|
2917
|
+
stream.on('close', function() {
|
|
2918
|
+
onExit.unregister(stream);
|
|
2919
|
+
});
|
|
2920
|
+
}
|
|
2921
|
+
return stream;
|
|
2922
|
+
function filterBrokenPipe(err) {
|
|
2923
|
+
if ('EPIPE' === err.code) {
|
|
2924
|
+
stream.write = noop;
|
|
2925
|
+
stream.end = noop;
|
|
2926
|
+
stream.flushSync = noop;
|
|
2927
|
+
stream.destroy = noop;
|
|
2928
|
+
return;
|
|
2929
|
+
}
|
|
2930
|
+
stream.removeListener('error', filterBrokenPipe);
|
|
2931
|
+
stream.emit('error', err);
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
function autoEnd(stream, eventName) {
|
|
2935
|
+
if (stream.destroyed) return;
|
|
2936
|
+
if ('beforeExit' === eventName) {
|
|
2937
|
+
stream.flush();
|
|
2938
|
+
stream.on('drain', function() {
|
|
2939
|
+
stream.end();
|
|
2940
|
+
});
|
|
2941
|
+
} else stream.flushSync();
|
|
2942
|
+
}
|
|
2943
|
+
function createArgsNormalizer(defaultOptions) {
|
|
2944
|
+
return function(instance, caller, opts = {}, stream) {
|
|
2945
|
+
if ('string' == typeof opts) {
|
|
2946
|
+
stream = buildSafeSonicBoom({
|
|
2947
|
+
dest: opts
|
|
2948
|
+
});
|
|
2949
|
+
opts = {};
|
|
2950
|
+
} else if ('string' == typeof stream) {
|
|
2951
|
+
if (opts && opts.transport) throw Error('only one of option.transport or stream can be specified');
|
|
2952
|
+
stream = buildSafeSonicBoom({
|
|
2953
|
+
dest: stream
|
|
2954
|
+
});
|
|
2955
|
+
} else if (opts instanceof SonicBoom || opts.writable || opts._writableState) {
|
|
2956
|
+
stream = opts;
|
|
2957
|
+
opts = {};
|
|
2958
|
+
} else if (opts.transport) {
|
|
2959
|
+
if (opts.transport instanceof SonicBoom || opts.transport.writable || opts.transport._writableState) throw Error('option.transport do not allow stream, please pass to option directly. e.g. pino(transport)');
|
|
2960
|
+
if (opts.transport.targets && opts.transport.targets.length && opts.formatters && 'function' == typeof opts.formatters.level) throw Error('option.transport.targets do not allow custom level formatters');
|
|
2961
|
+
let customLevels;
|
|
2962
|
+
if (opts.customLevels) customLevels = opts.useOnlyCustomLevels ? opts.customLevels : Object.assign({}, opts.levels, opts.customLevels);
|
|
2963
|
+
stream = transport({
|
|
2964
|
+
caller,
|
|
2965
|
+
...opts.transport,
|
|
2966
|
+
levels: customLevels
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
opts = Object.assign({}, defaultOptions, opts);
|
|
2970
|
+
opts.serializers = Object.assign({}, defaultOptions.serializers, opts.serializers);
|
|
2971
|
+
opts.formatters = Object.assign({}, defaultOptions.formatters, opts.formatters);
|
|
2972
|
+
if (opts.prettyPrint) throw new Error('prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)');
|
|
2973
|
+
const { enabled, onChild } = opts;
|
|
2974
|
+
if (false === enabled) opts.level = 'silent';
|
|
2975
|
+
if (!onChild) opts.onChild = noop;
|
|
2976
|
+
if (!stream) stream = hasBeenTampered(process.stdout) ? process.stdout : buildSafeSonicBoom({
|
|
2977
|
+
fd: process.stdout.fd || 1
|
|
2978
|
+
});
|
|
2979
|
+
return {
|
|
2980
|
+
opts,
|
|
2981
|
+
stream
|
|
2982
|
+
};
|
|
2983
|
+
};
|
|
2984
|
+
}
|
|
2985
|
+
function stringify(obj, stringifySafeFn) {
|
|
2986
|
+
try {
|
|
2987
|
+
return JSON.stringify(obj);
|
|
2988
|
+
} catch (_) {
|
|
2989
|
+
try {
|
|
2990
|
+
const stringify = stringifySafeFn || this[stringifySafeSym];
|
|
2991
|
+
return stringify(obj);
|
|
2992
|
+
} catch (_) {
|
|
2993
|
+
return '"[unable to serialize, circular reference is too complex to analyze]"';
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
function buildFormatters(level, bindings, log) {
|
|
2998
|
+
return {
|
|
2999
|
+
level,
|
|
3000
|
+
bindings,
|
|
3001
|
+
log
|
|
3002
|
+
};
|
|
3003
|
+
}
|
|
3004
|
+
function normalizeDestFileDescriptor(destination) {
|
|
3005
|
+
const fd = Number(destination);
|
|
3006
|
+
if ('string' == typeof destination && Number.isFinite(fd)) return fd;
|
|
3007
|
+
if (void 0 === destination) return 1;
|
|
3008
|
+
return destination;
|
|
3009
|
+
}
|
|
3010
|
+
module1.exports = {
|
|
3011
|
+
noop,
|
|
3012
|
+
buildSafeSonicBoom,
|
|
3013
|
+
asChindings,
|
|
3014
|
+
asJson,
|
|
3015
|
+
genLog,
|
|
3016
|
+
createArgsNormalizer,
|
|
3017
|
+
stringify,
|
|
3018
|
+
buildFormatters,
|
|
3019
|
+
normalizeDestFileDescriptor
|
|
3020
|
+
};
|
|
3021
|
+
},
|
|
3022
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/transport-stream.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
3023
|
+
"use strict";
|
|
3024
|
+
const { realImport, realRequire } = __webpack_require__("../../node_modules/.pnpm/real-require@0.2.0/node_modules/real-require/src/index.js");
|
|
3025
|
+
module1.exports = loadTransportStreamBuilder;
|
|
3026
|
+
async function loadTransportStreamBuilder(target) {
|
|
3027
|
+
let fn;
|
|
3028
|
+
try {
|
|
3029
|
+
const toLoad = target.startsWith('file://') ? target : 'file://' + target;
|
|
3030
|
+
if (toLoad.endsWith('.ts') || toLoad.endsWith('.cts')) {
|
|
3031
|
+
if (process[Symbol.for('ts-node.register.instance')]) realRequire('ts-node/register');
|
|
3032
|
+
else if (process.env && process.env.TS_NODE_DEV) realRequire('ts-node-dev');
|
|
3033
|
+
fn = realRequire(decodeURIComponent(target));
|
|
3034
|
+
} else fn = await realImport(toLoad);
|
|
3035
|
+
} catch (error) {
|
|
3036
|
+
if ('ENOTDIR' === error.code || 'ERR_MODULE_NOT_FOUND' === error.code) fn = realRequire(target);
|
|
3037
|
+
else if (void 0 === error.code || 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING' === error.code) try {
|
|
3038
|
+
fn = realRequire(decodeURIComponent(target));
|
|
3039
|
+
} catch {
|
|
3040
|
+
throw error;
|
|
3041
|
+
}
|
|
3042
|
+
else throw error;
|
|
3043
|
+
}
|
|
3044
|
+
if ('object' == typeof fn) fn = fn.default;
|
|
3045
|
+
if ('object' == typeof fn) fn = fn.default;
|
|
3046
|
+
if ('function' != typeof fn) throw Error('exported worker is not a function');
|
|
3047
|
+
return fn;
|
|
3048
|
+
}
|
|
3049
|
+
},
|
|
3050
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/transport.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
3051
|
+
"use strict";
|
|
3052
|
+
const { createRequire } = __webpack_require__("module");
|
|
3053
|
+
const getCallers = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/caller.js");
|
|
3054
|
+
const { join, isAbsolute, sep } = __webpack_require__("node:path");
|
|
3055
|
+
const sleep = __webpack_require__("../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js");
|
|
3056
|
+
const onExit = __webpack_require__("../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js");
|
|
3057
|
+
const ThreadStream = __webpack_require__("../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/index.js");
|
|
3058
|
+
function setupOnExit(stream) {
|
|
3059
|
+
onExit.register(stream, autoEnd);
|
|
3060
|
+
onExit.registerBeforeExit(stream, flush);
|
|
3061
|
+
stream.on('close', function() {
|
|
3062
|
+
onExit.unregister(stream);
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
function buildStream(filename, workerData, workerOpts, sync) {
|
|
3066
|
+
const stream = new ThreadStream({
|
|
3067
|
+
filename,
|
|
3068
|
+
workerData,
|
|
3069
|
+
workerOpts,
|
|
3070
|
+
sync
|
|
3071
|
+
});
|
|
3072
|
+
stream.on('ready', onReady);
|
|
3073
|
+
stream.on('close', function() {
|
|
3074
|
+
process.removeListener('exit', onExit);
|
|
3075
|
+
});
|
|
3076
|
+
process.on('exit', onExit);
|
|
3077
|
+
function onReady() {
|
|
3078
|
+
process.removeListener('exit', onExit);
|
|
3079
|
+
stream.unref();
|
|
3080
|
+
if (false !== workerOpts.autoEnd) setupOnExit(stream);
|
|
3081
|
+
}
|
|
3082
|
+
function onExit() {
|
|
3083
|
+
if (stream.closed) return;
|
|
3084
|
+
stream.flushSync();
|
|
3085
|
+
sleep(100);
|
|
3086
|
+
stream.end();
|
|
3087
|
+
}
|
|
3088
|
+
return stream;
|
|
3089
|
+
}
|
|
3090
|
+
function autoEnd(stream) {
|
|
3091
|
+
stream.ref();
|
|
3092
|
+
stream.flushSync();
|
|
3093
|
+
stream.end();
|
|
3094
|
+
stream.once('close', function() {
|
|
3095
|
+
stream.unref();
|
|
3096
|
+
});
|
|
3097
|
+
}
|
|
3098
|
+
function flush(stream) {
|
|
3099
|
+
stream.flushSync();
|
|
3100
|
+
}
|
|
3101
|
+
function transport(fullOptions) {
|
|
3102
|
+
const { pipeline, targets, levels, dedupe, worker = {}, caller = getCallers(), sync = false } = fullOptions;
|
|
3103
|
+
const options = {
|
|
3104
|
+
...fullOptions.options
|
|
3105
|
+
};
|
|
3106
|
+
const callers = 'string' == typeof caller ? [
|
|
3107
|
+
caller
|
|
3108
|
+
] : caller;
|
|
3109
|
+
const bundlerOverrides = '__bundlerPathsOverrides' in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
3110
|
+
let target = fullOptions.target;
|
|
3111
|
+
if (target && targets) throw new Error('only one of target or targets can be specified');
|
|
3112
|
+
if (targets) {
|
|
3113
|
+
target = bundlerOverrides['pino-worker'] || join(__dirname, 'worker.js');
|
|
3114
|
+
options.targets = targets.filter((dest)=>dest.target).map((dest)=>({
|
|
3115
|
+
...dest,
|
|
3116
|
+
target: fixTarget(dest.target)
|
|
3117
|
+
}));
|
|
3118
|
+
options.pipelines = targets.filter((dest)=>dest.pipeline).map((dest)=>dest.pipeline.map((t)=>({
|
|
3119
|
+
...t,
|
|
3120
|
+
level: dest.level,
|
|
3121
|
+
target: fixTarget(t.target)
|
|
3122
|
+
})));
|
|
3123
|
+
} else if (pipeline) {
|
|
3124
|
+
target = bundlerOverrides['pino-worker'] || join(__dirname, 'worker.js');
|
|
3125
|
+
options.pipelines = [
|
|
3126
|
+
pipeline.map((dest)=>({
|
|
3127
|
+
...dest,
|
|
3128
|
+
target: fixTarget(dest.target)
|
|
3129
|
+
}))
|
|
3130
|
+
];
|
|
3131
|
+
}
|
|
3132
|
+
if (levels) options.levels = levels;
|
|
3133
|
+
if (dedupe) options.dedupe = dedupe;
|
|
3134
|
+
options.pinoWillSendConfig = true;
|
|
3135
|
+
return buildStream(fixTarget(target), options, worker, sync);
|
|
3136
|
+
function fixTarget(origin) {
|
|
3137
|
+
origin = bundlerOverrides[origin] || origin;
|
|
3138
|
+
if (isAbsolute(origin) || 0 === origin.indexOf('file://')) return origin;
|
|
3139
|
+
if ('pino/file' === origin) return join(__dirname, '..', 'file.js');
|
|
3140
|
+
let fixTarget;
|
|
3141
|
+
for (const filePath of callers)try {
|
|
3142
|
+
const context = 'node:repl' === filePath ? process.cwd() + sep : filePath;
|
|
3143
|
+
fixTarget = createRequire(context).resolve(origin);
|
|
3144
|
+
break;
|
|
3145
|
+
} catch (err) {
|
|
3146
|
+
continue;
|
|
3147
|
+
}
|
|
3148
|
+
if (!fixTarget) throw new Error(`unable to determine transport target for "${origin}"`);
|
|
3149
|
+
return fixTarget;
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
module1.exports = transport;
|
|
3153
|
+
},
|
|
3154
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/pino.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
3155
|
+
"use strict";
|
|
3156
|
+
const os = __webpack_require__("node:os");
|
|
3157
|
+
const stdSerializers = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/index.js");
|
|
3158
|
+
const caller = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/caller.js");
|
|
3159
|
+
const redaction = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/redaction.js");
|
|
3160
|
+
const time = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/time.js");
|
|
3161
|
+
const proto = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/proto.js");
|
|
3162
|
+
const symbols = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/symbols.js");
|
|
3163
|
+
const { configure } = __webpack_require__("../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js");
|
|
3164
|
+
const { assertDefaultLevelFound, mappings, genLsCache, genLevelComparison, assertLevelComparison } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/levels.js");
|
|
3165
|
+
const { DEFAULT_LEVELS, SORTING_ORDER } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/constants.js");
|
|
3166
|
+
const { createArgsNormalizer, asChindings, buildSafeSonicBoom, buildFormatters, stringify, normalizeDestFileDescriptor, noop } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/tools.js");
|
|
3167
|
+
const { version } = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/meta.js");
|
|
3168
|
+
const { chindingsSym, redactFmtSym, serializersSym, timeSym, timeSliceIndexSym, streamSym, stringifySym, stringifySafeSym, stringifiersSym, setLevelSym, endSym, formatOptsSym, messageKeySym, errorKeySym, nestedKeySym, mixinSym, levelCompSym, useOnlyCustomLevelsSym, formattersSym, hooksSym, nestedKeyStrSym, mixinMergeStrategySym, msgPrefixSym } = symbols;
|
|
3169
|
+
const { epochTime, nullTime } = time;
|
|
3170
|
+
const { pid } = process;
|
|
3171
|
+
const hostname = os.hostname();
|
|
3172
|
+
const defaultErrorSerializer = stdSerializers.err;
|
|
3173
|
+
const defaultOptions = {
|
|
3174
|
+
level: 'info',
|
|
3175
|
+
levelComparison: SORTING_ORDER.ASC,
|
|
3176
|
+
levels: DEFAULT_LEVELS,
|
|
3177
|
+
messageKey: 'msg',
|
|
3178
|
+
errorKey: 'err',
|
|
3179
|
+
nestedKey: null,
|
|
3180
|
+
enabled: true,
|
|
3181
|
+
base: {
|
|
3182
|
+
pid,
|
|
3183
|
+
hostname
|
|
3184
|
+
},
|
|
3185
|
+
serializers: Object.assign(Object.create(null), {
|
|
3186
|
+
err: defaultErrorSerializer
|
|
3187
|
+
}),
|
|
3188
|
+
formatters: Object.assign(Object.create(null), {
|
|
3189
|
+
bindings (bindings) {
|
|
3190
|
+
return bindings;
|
|
3191
|
+
},
|
|
3192
|
+
level (label, number) {
|
|
3193
|
+
return {
|
|
3194
|
+
level: number
|
|
3195
|
+
};
|
|
3196
|
+
}
|
|
3197
|
+
}),
|
|
3198
|
+
hooks: {
|
|
3199
|
+
logMethod: void 0,
|
|
3200
|
+
streamWrite: void 0
|
|
3201
|
+
},
|
|
3202
|
+
timestamp: epochTime,
|
|
3203
|
+
name: void 0,
|
|
3204
|
+
redact: null,
|
|
3205
|
+
customLevels: null,
|
|
3206
|
+
useOnlyCustomLevels: false,
|
|
3207
|
+
depthLimit: 5,
|
|
3208
|
+
edgeLimit: 100
|
|
3209
|
+
};
|
|
3210
|
+
const normalize = createArgsNormalizer(defaultOptions);
|
|
3211
|
+
const serializers = Object.assign(Object.create(null), stdSerializers);
|
|
3212
|
+
function pino(...args) {
|
|
3213
|
+
const instance = {};
|
|
3214
|
+
const { opts, stream } = normalize(instance, caller(), ...args);
|
|
3215
|
+
if (opts.level && 'string' == typeof opts.level && void 0 !== DEFAULT_LEVELS[opts.level.toLowerCase()]) opts.level = opts.level.toLowerCase();
|
|
3216
|
+
const { redact, crlf, serializers, timestamp, messageKey, errorKey, nestedKey, base, name, level, customLevels, levelComparison, mixin, mixinMergeStrategy, useOnlyCustomLevels, formatters, hooks, depthLimit, edgeLimit, onChild, msgPrefix } = opts;
|
|
3217
|
+
const stringifySafe = configure({
|
|
3218
|
+
maximumDepth: depthLimit,
|
|
3219
|
+
maximumBreadth: edgeLimit
|
|
3220
|
+
});
|
|
3221
|
+
const allFormatters = buildFormatters(formatters.level, formatters.bindings, formatters.log);
|
|
3222
|
+
const stringifyFn = stringify.bind({
|
|
3223
|
+
[stringifySafeSym]: stringifySafe
|
|
3224
|
+
});
|
|
3225
|
+
const stringifiers = redact ? redaction(redact, stringifyFn) : {};
|
|
3226
|
+
const formatOpts = redact ? {
|
|
3227
|
+
stringify: stringifiers[redactFmtSym]
|
|
3228
|
+
} : {
|
|
3229
|
+
stringify: stringifyFn
|
|
3230
|
+
};
|
|
3231
|
+
const end = '}' + (crlf ? '\r\n' : '\n');
|
|
3232
|
+
const coreChindings = asChindings.bind(null, {
|
|
3233
|
+
[chindingsSym]: '',
|
|
3234
|
+
[serializersSym]: serializers,
|
|
3235
|
+
[stringifiersSym]: stringifiers,
|
|
3236
|
+
[stringifySym]: stringify,
|
|
3237
|
+
[stringifySafeSym]: stringifySafe,
|
|
3238
|
+
[formattersSym]: allFormatters
|
|
3239
|
+
});
|
|
3240
|
+
let chindings = '';
|
|
3241
|
+
if (null !== base) chindings = void 0 === name ? coreChindings(base) : coreChindings(Object.assign({}, base, {
|
|
3242
|
+
name
|
|
3243
|
+
}));
|
|
3244
|
+
const time = timestamp instanceof Function ? timestamp : timestamp ? epochTime : nullTime;
|
|
3245
|
+
const timeSliceIndex = time().indexOf(':') + 1;
|
|
3246
|
+
if (useOnlyCustomLevels && !customLevels) throw Error('customLevels is required if useOnlyCustomLevels is set true');
|
|
3247
|
+
if (mixin && 'function' != typeof mixin) throw Error(`Unknown mixin type "${typeof mixin}" - expected "function"`);
|
|
3248
|
+
if (msgPrefix && 'string' != typeof msgPrefix) throw Error(`Unknown msgPrefix type "${typeof msgPrefix}" - expected "string"`);
|
|
3249
|
+
assertDefaultLevelFound(level, customLevels, useOnlyCustomLevels);
|
|
3250
|
+
const levels = mappings(customLevels, useOnlyCustomLevels);
|
|
3251
|
+
if ('function' == typeof stream.emit) stream.emit('message', {
|
|
3252
|
+
code: 'PINO_CONFIG',
|
|
3253
|
+
config: {
|
|
3254
|
+
levels,
|
|
3255
|
+
messageKey,
|
|
3256
|
+
errorKey
|
|
3257
|
+
}
|
|
3258
|
+
});
|
|
3259
|
+
assertLevelComparison(levelComparison);
|
|
3260
|
+
const levelCompFunc = genLevelComparison(levelComparison);
|
|
3261
|
+
Object.assign(instance, {
|
|
3262
|
+
levels,
|
|
3263
|
+
[levelCompSym]: levelCompFunc,
|
|
3264
|
+
[useOnlyCustomLevelsSym]: useOnlyCustomLevels,
|
|
3265
|
+
[streamSym]: stream,
|
|
3266
|
+
[timeSym]: time,
|
|
3267
|
+
[timeSliceIndexSym]: timeSliceIndex,
|
|
3268
|
+
[stringifySym]: stringify,
|
|
3269
|
+
[stringifySafeSym]: stringifySafe,
|
|
3270
|
+
[stringifiersSym]: stringifiers,
|
|
3271
|
+
[endSym]: end,
|
|
3272
|
+
[formatOptsSym]: formatOpts,
|
|
3273
|
+
[messageKeySym]: messageKey,
|
|
3274
|
+
[errorKeySym]: errorKey,
|
|
3275
|
+
[nestedKeySym]: nestedKey,
|
|
3276
|
+
[nestedKeyStrSym]: nestedKey ? `,${JSON.stringify(nestedKey)}:{` : '',
|
|
3277
|
+
[serializersSym]: serializers,
|
|
3278
|
+
[mixinSym]: mixin,
|
|
3279
|
+
[mixinMergeStrategySym]: mixinMergeStrategy,
|
|
3280
|
+
[chindingsSym]: chindings,
|
|
3281
|
+
[formattersSym]: allFormatters,
|
|
3282
|
+
[hooksSym]: hooks,
|
|
3283
|
+
silent: noop,
|
|
3284
|
+
onChild,
|
|
3285
|
+
[msgPrefixSym]: msgPrefix
|
|
3286
|
+
});
|
|
3287
|
+
Object.setPrototypeOf(instance, proto());
|
|
3288
|
+
genLsCache(instance);
|
|
3289
|
+
instance[setLevelSym](level);
|
|
3290
|
+
return instance;
|
|
3291
|
+
}
|
|
3292
|
+
module1.exports = pino;
|
|
3293
|
+
module1.exports.destination = (dest = process.stdout.fd)=>{
|
|
3294
|
+
if ('object' != typeof dest) return buildSafeSonicBoom({
|
|
3295
|
+
dest: normalizeDestFileDescriptor(dest),
|
|
3296
|
+
minLength: 0
|
|
3297
|
+
});
|
|
3298
|
+
dest.dest = normalizeDestFileDescriptor(dest.dest || process.stdout.fd);
|
|
3299
|
+
return buildSafeSonicBoom(dest);
|
|
3300
|
+
};
|
|
3301
|
+
module1.exports.transport = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/transport.js");
|
|
3302
|
+
module1.exports.multistream = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/multistream.js");
|
|
3303
|
+
module1.exports.levels = mappings();
|
|
3304
|
+
module1.exports.stdSerializers = serializers;
|
|
3305
|
+
module1.exports.stdTimeFunctions = Object.assign({}, time);
|
|
3306
|
+
module1.exports.symbols = symbols;
|
|
3307
|
+
module1.exports.version = version;
|
|
3308
|
+
module1.exports["default"] = pino;
|
|
3309
|
+
module1.exports.pino = pino;
|
|
3310
|
+
},
|
|
3311
|
+
"../../node_modules/.pnpm/sonic-boom@4.2.0/node_modules/sonic-boom/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
3312
|
+
"use strict";
|
|
3313
|
+
const fs = __webpack_require__("fs");
|
|
3314
|
+
const EventEmitter = __webpack_require__("events");
|
|
3315
|
+
const inherits = __webpack_require__("util").inherits;
|
|
3316
|
+
const path = __webpack_require__("path");
|
|
3317
|
+
const sleep = __webpack_require__("../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js");
|
|
3318
|
+
const assert = __webpack_require__("assert");
|
|
3319
|
+
const BUSY_WRITE_TIMEOUT = 100;
|
|
3320
|
+
const kEmptyBuffer = Buffer.allocUnsafe(0);
|
|
3321
|
+
const MAX_WRITE = 16384;
|
|
3322
|
+
const kContentModeBuffer = 'buffer';
|
|
3323
|
+
const kContentModeUtf8 = 'utf8';
|
|
3324
|
+
const [major, minor] = (process.versions.node || '0.0').split('.').map(Number);
|
|
3325
|
+
const kCopyBuffer = major >= 22 && minor >= 7;
|
|
3326
|
+
function openFile(file, sonic) {
|
|
3327
|
+
sonic._opening = true;
|
|
3328
|
+
sonic._writing = true;
|
|
3329
|
+
sonic._asyncDrainScheduled = false;
|
|
3330
|
+
function fileOpened(err, fd) {
|
|
3331
|
+
if (err) {
|
|
3332
|
+
sonic._reopening = false;
|
|
3333
|
+
sonic._writing = false;
|
|
3334
|
+
sonic._opening = false;
|
|
3335
|
+
if (sonic.sync) process.nextTick(()=>{
|
|
3336
|
+
if (sonic.listenerCount('error') > 0) sonic.emit('error', err);
|
|
3337
|
+
});
|
|
3338
|
+
else sonic.emit('error', err);
|
|
3339
|
+
return;
|
|
3340
|
+
}
|
|
3341
|
+
const reopening = sonic._reopening;
|
|
3342
|
+
sonic.fd = fd;
|
|
3343
|
+
sonic.file = file;
|
|
3344
|
+
sonic._reopening = false;
|
|
3345
|
+
sonic._opening = false;
|
|
3346
|
+
sonic._writing = false;
|
|
3347
|
+
if (sonic.sync) process.nextTick(()=>sonic.emit('ready'));
|
|
3348
|
+
else sonic.emit('ready');
|
|
3349
|
+
if (sonic.destroyed) return;
|
|
3350
|
+
if (!sonic._writing && sonic._len > sonic.minLength || sonic._flushPending) sonic._actualWrite();
|
|
3351
|
+
else if (reopening) process.nextTick(()=>sonic.emit('drain'));
|
|
3352
|
+
}
|
|
3353
|
+
const flags = sonic.append ? 'a' : 'w';
|
|
3354
|
+
const mode = sonic.mode;
|
|
3355
|
+
if (sonic.sync) try {
|
|
3356
|
+
if (sonic.mkdir) fs.mkdirSync(path.dirname(file), {
|
|
3357
|
+
recursive: true
|
|
3358
|
+
});
|
|
3359
|
+
const fd = fs.openSync(file, flags, mode);
|
|
3360
|
+
fileOpened(null, fd);
|
|
3361
|
+
} catch (err) {
|
|
3362
|
+
fileOpened(err);
|
|
3363
|
+
throw err;
|
|
3364
|
+
}
|
|
3365
|
+
else if (sonic.mkdir) fs.mkdir(path.dirname(file), {
|
|
3366
|
+
recursive: true
|
|
3367
|
+
}, (err)=>{
|
|
3368
|
+
if (err) return fileOpened(err);
|
|
3369
|
+
fs.open(file, flags, mode, fileOpened);
|
|
3370
|
+
});
|
|
3371
|
+
else fs.open(file, flags, mode, fileOpened);
|
|
3372
|
+
}
|
|
3373
|
+
function SonicBoom(opts) {
|
|
3374
|
+
if (!(this instanceof SonicBoom)) return new SonicBoom(opts);
|
|
3375
|
+
let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir, retryEAGAIN, fsync, contentMode, mode } = opts || {};
|
|
3376
|
+
fd = fd || dest;
|
|
3377
|
+
this._len = 0;
|
|
3378
|
+
this.fd = -1;
|
|
3379
|
+
this._bufs = [];
|
|
3380
|
+
this._lens = [];
|
|
3381
|
+
this._writing = false;
|
|
3382
|
+
this._ending = false;
|
|
3383
|
+
this._reopening = false;
|
|
3384
|
+
this._asyncDrainScheduled = false;
|
|
3385
|
+
this._flushPending = false;
|
|
3386
|
+
this._hwm = Math.max(minLength || 0, 16387);
|
|
3387
|
+
this.file = null;
|
|
3388
|
+
this.destroyed = false;
|
|
3389
|
+
this.minLength = minLength || 0;
|
|
3390
|
+
this.maxLength = maxLength || 0;
|
|
3391
|
+
this.maxWrite = maxWrite || MAX_WRITE;
|
|
3392
|
+
this._periodicFlush = periodicFlush || 0;
|
|
3393
|
+
this._periodicFlushTimer = void 0;
|
|
3394
|
+
this.sync = sync || false;
|
|
3395
|
+
this.writable = true;
|
|
3396
|
+
this._fsync = fsync || false;
|
|
3397
|
+
this.append = append || false;
|
|
3398
|
+
this.mode = mode;
|
|
3399
|
+
this.retryEAGAIN = retryEAGAIN || (()=>true);
|
|
3400
|
+
this.mkdir = mkdir || false;
|
|
3401
|
+
let fsWriteSync;
|
|
3402
|
+
let fsWrite;
|
|
3403
|
+
if (contentMode === kContentModeBuffer) {
|
|
3404
|
+
this._writingBuf = kEmptyBuffer;
|
|
3405
|
+
this.write = writeBuffer;
|
|
3406
|
+
this.flush = flushBuffer;
|
|
3407
|
+
this.flushSync = flushBufferSync;
|
|
3408
|
+
this._actualWrite = actualWriteBuffer;
|
|
3409
|
+
fsWriteSync = ()=>fs.writeSync(this.fd, this._writingBuf);
|
|
3410
|
+
fsWrite = ()=>fs.write(this.fd, this._writingBuf, this.release);
|
|
3411
|
+
} else if (void 0 === contentMode || contentMode === kContentModeUtf8) {
|
|
3412
|
+
this._writingBuf = '';
|
|
3413
|
+
this.write = write;
|
|
3414
|
+
this.flush = flush;
|
|
3415
|
+
this.flushSync = flushSync;
|
|
3416
|
+
this._actualWrite = actualWrite;
|
|
3417
|
+
fsWriteSync = ()=>fs.writeSync(this.fd, this._writingBuf, 'utf8');
|
|
3418
|
+
fsWrite = ()=>fs.write(this.fd, this._writingBuf, 'utf8', this.release);
|
|
3419
|
+
} else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
|
|
3420
|
+
if ('number' == typeof fd) {
|
|
3421
|
+
this.fd = fd;
|
|
3422
|
+
process.nextTick(()=>this.emit('ready'));
|
|
3423
|
+
} else if ('string' == typeof fd) openFile(fd, this);
|
|
3424
|
+
else throw new Error("SonicBoom supports only file descriptors and files");
|
|
3425
|
+
if (this.minLength >= this.maxWrite) throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);
|
|
3426
|
+
this.release = (err, n1)=>{
|
|
3427
|
+
if (err) {
|
|
3428
|
+
if (('EAGAIN' === err.code || 'EBUSY' === err.code) && this.retryEAGAIN(err, this._writingBuf.length, this._len - this._writingBuf.length)) if (this.sync) try {
|
|
3429
|
+
sleep(BUSY_WRITE_TIMEOUT);
|
|
3430
|
+
this.release(void 0, 0);
|
|
3431
|
+
} catch (err) {
|
|
3432
|
+
this.release(err);
|
|
3433
|
+
}
|
|
3434
|
+
else setTimeout(fsWrite, BUSY_WRITE_TIMEOUT);
|
|
3435
|
+
else {
|
|
3436
|
+
this._writing = false;
|
|
3437
|
+
this.emit('error', err);
|
|
3438
|
+
}
|
|
3439
|
+
return;
|
|
3440
|
+
}
|
|
3441
|
+
this.emit('write', n1);
|
|
3442
|
+
const releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n1);
|
|
3443
|
+
this._len = releasedBufObj.len;
|
|
3444
|
+
this._writingBuf = releasedBufObj.writingBuf;
|
|
3445
|
+
if (this._writingBuf.length) {
|
|
3446
|
+
if (!this.sync) return void fsWrite();
|
|
3447
|
+
try {
|
|
3448
|
+
do {
|
|
3449
|
+
const n1 = fsWriteSync();
|
|
3450
|
+
const releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n1);
|
|
3451
|
+
this._len = releasedBufObj.len;
|
|
3452
|
+
this._writingBuf = releasedBufObj.writingBuf;
|
|
3453
|
+
}while (this._writingBuf.length);
|
|
3454
|
+
} catch (err) {
|
|
3455
|
+
this.release(err);
|
|
3456
|
+
return;
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
if (this._fsync) fs.fsyncSync(this.fd);
|
|
3460
|
+
const len = this._len;
|
|
3461
|
+
if (this._reopening) {
|
|
3462
|
+
this._writing = false;
|
|
3463
|
+
this._reopening = false;
|
|
3464
|
+
this.reopen();
|
|
3465
|
+
} else if (len > this.minLength) this._actualWrite();
|
|
3466
|
+
else if (this._ending) if (len > 0) this._actualWrite();
|
|
3467
|
+
else {
|
|
3468
|
+
this._writing = false;
|
|
3469
|
+
actualClose(this);
|
|
3470
|
+
}
|
|
3471
|
+
else {
|
|
3472
|
+
this._writing = false;
|
|
3473
|
+
if (this.sync) {
|
|
3474
|
+
if (!this._asyncDrainScheduled) {
|
|
3475
|
+
this._asyncDrainScheduled = true;
|
|
3476
|
+
process.nextTick(emitDrain, this);
|
|
3477
|
+
}
|
|
3478
|
+
} else this.emit('drain');
|
|
3479
|
+
}
|
|
3480
|
+
};
|
|
3481
|
+
this.on('newListener', function(name) {
|
|
3482
|
+
if ('drain' === name) this._asyncDrainScheduled = false;
|
|
3483
|
+
});
|
|
3484
|
+
if (0 !== this._periodicFlush) {
|
|
3485
|
+
this._periodicFlushTimer = setInterval(()=>this.flush(null), this._periodicFlush);
|
|
3486
|
+
this._periodicFlushTimer.unref();
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
function releaseWritingBuf(writingBuf, len, n1) {
|
|
3490
|
+
if ('string' == typeof writingBuf && Buffer.byteLength(writingBuf) !== n1) n1 = Buffer.from(writingBuf).subarray(0, n1).toString().length;
|
|
3491
|
+
len = Math.max(len - n1, 0);
|
|
3492
|
+
writingBuf = writingBuf.slice(n1);
|
|
3493
|
+
return {
|
|
3494
|
+
writingBuf,
|
|
3495
|
+
len
|
|
3496
|
+
};
|
|
3497
|
+
}
|
|
3498
|
+
function emitDrain(sonic) {
|
|
3499
|
+
const hasListeners = sonic.listenerCount('drain') > 0;
|
|
3500
|
+
if (!hasListeners) return;
|
|
3501
|
+
sonic._asyncDrainScheduled = false;
|
|
3502
|
+
sonic.emit('drain');
|
|
3503
|
+
}
|
|
3504
|
+
inherits(SonicBoom, EventEmitter);
|
|
3505
|
+
function mergeBuf(bufs, len) {
|
|
3506
|
+
if (0 === bufs.length) return kEmptyBuffer;
|
|
3507
|
+
if (1 === bufs.length) return bufs[0];
|
|
3508
|
+
return Buffer.concat(bufs, len);
|
|
3509
|
+
}
|
|
3510
|
+
function write(data) {
|
|
3511
|
+
if (this.destroyed) throw new Error('SonicBoom destroyed');
|
|
3512
|
+
const len = this._len + data.length;
|
|
3513
|
+
const bufs = this._bufs;
|
|
3514
|
+
if (this.maxLength && len > this.maxLength) {
|
|
3515
|
+
this.emit('drop', data);
|
|
3516
|
+
return this._len < this._hwm;
|
|
3517
|
+
}
|
|
3518
|
+
if (0 === bufs.length || bufs[bufs.length - 1].length + data.length > this.maxWrite) bufs.push('' + data);
|
|
3519
|
+
else bufs[bufs.length - 1] += data;
|
|
3520
|
+
this._len = len;
|
|
3521
|
+
if (!this._writing && this._len >= this.minLength) this._actualWrite();
|
|
3522
|
+
return this._len < this._hwm;
|
|
3523
|
+
}
|
|
3524
|
+
function writeBuffer(data) {
|
|
3525
|
+
if (this.destroyed) throw new Error('SonicBoom destroyed');
|
|
3526
|
+
const len = this._len + data.length;
|
|
3527
|
+
const bufs = this._bufs;
|
|
3528
|
+
const lens = this._lens;
|
|
3529
|
+
if (this.maxLength && len > this.maxLength) {
|
|
3530
|
+
this.emit('drop', data);
|
|
3531
|
+
return this._len < this._hwm;
|
|
3532
|
+
}
|
|
3533
|
+
if (0 === bufs.length || lens[lens.length - 1] + data.length > this.maxWrite) {
|
|
3534
|
+
bufs.push([
|
|
3535
|
+
data
|
|
3536
|
+
]);
|
|
3537
|
+
lens.push(data.length);
|
|
3538
|
+
} else {
|
|
3539
|
+
bufs[bufs.length - 1].push(data);
|
|
3540
|
+
lens[lens.length - 1] += data.length;
|
|
3541
|
+
}
|
|
3542
|
+
this._len = len;
|
|
3543
|
+
if (!this._writing && this._len >= this.minLength) this._actualWrite();
|
|
3544
|
+
return this._len < this._hwm;
|
|
3545
|
+
}
|
|
3546
|
+
function callFlushCallbackOnDrain(cb) {
|
|
3547
|
+
this._flushPending = true;
|
|
3548
|
+
const onDrain = ()=>{
|
|
3549
|
+
if (this._fsync) {
|
|
3550
|
+
this._flushPending = false;
|
|
3551
|
+
cb();
|
|
3552
|
+
} else try {
|
|
3553
|
+
fs.fsync(this.fd, (err)=>{
|
|
3554
|
+
this._flushPending = false;
|
|
3555
|
+
cb(err);
|
|
3556
|
+
});
|
|
3557
|
+
} catch (err) {
|
|
3558
|
+
cb(err);
|
|
3559
|
+
}
|
|
3560
|
+
this.off('error', onError);
|
|
3561
|
+
};
|
|
3562
|
+
const onError = (err)=>{
|
|
3563
|
+
this._flushPending = false;
|
|
3564
|
+
cb(err);
|
|
3565
|
+
this.off('drain', onDrain);
|
|
3566
|
+
};
|
|
3567
|
+
this.once('drain', onDrain);
|
|
3568
|
+
this.once('error', onError);
|
|
3569
|
+
}
|
|
3570
|
+
function flush(cb) {
|
|
3571
|
+
if (null != cb && 'function' != typeof cb) throw new Error('flush cb must be a function');
|
|
3572
|
+
if (this.destroyed) {
|
|
3573
|
+
const error = new Error('SonicBoom destroyed');
|
|
3574
|
+
if (cb) return void cb(error);
|
|
3575
|
+
throw error;
|
|
3576
|
+
}
|
|
3577
|
+
if (this.minLength <= 0) return void cb?.();
|
|
3578
|
+
if (cb) callFlushCallbackOnDrain.call(this, cb);
|
|
3579
|
+
if (this._writing) return;
|
|
3580
|
+
if (0 === this._bufs.length) this._bufs.push('');
|
|
3581
|
+
this._actualWrite();
|
|
3582
|
+
}
|
|
3583
|
+
function flushBuffer(cb) {
|
|
3584
|
+
if (null != cb && 'function' != typeof cb) throw new Error('flush cb must be a function');
|
|
3585
|
+
if (this.destroyed) {
|
|
3586
|
+
const error = new Error('SonicBoom destroyed');
|
|
3587
|
+
if (cb) return void cb(error);
|
|
3588
|
+
throw error;
|
|
3589
|
+
}
|
|
3590
|
+
if (this.minLength <= 0) return void cb?.();
|
|
3591
|
+
if (cb) callFlushCallbackOnDrain.call(this, cb);
|
|
3592
|
+
if (this._writing) return;
|
|
3593
|
+
if (0 === this._bufs.length) {
|
|
3594
|
+
this._bufs.push([]);
|
|
3595
|
+
this._lens.push(0);
|
|
3596
|
+
}
|
|
3597
|
+
this._actualWrite();
|
|
3598
|
+
}
|
|
3599
|
+
SonicBoom.prototype.reopen = function(file) {
|
|
3600
|
+
if (this.destroyed) throw new Error('SonicBoom destroyed');
|
|
3601
|
+
if (this._opening) return void this.once('ready', ()=>{
|
|
3602
|
+
this.reopen(file);
|
|
3603
|
+
});
|
|
3604
|
+
if (this._ending) return;
|
|
3605
|
+
if (!this.file) throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");
|
|
3606
|
+
if (file) this.file = file;
|
|
3607
|
+
this._reopening = true;
|
|
3608
|
+
if (this._writing) return;
|
|
3609
|
+
const fd = this.fd;
|
|
3610
|
+
this.once('ready', ()=>{
|
|
3611
|
+
if (fd !== this.fd) fs.close(fd, (err)=>{
|
|
3612
|
+
if (err) return this.emit('error', err);
|
|
3613
|
+
});
|
|
3614
|
+
});
|
|
3615
|
+
openFile(this.file, this);
|
|
3616
|
+
};
|
|
3617
|
+
SonicBoom.prototype.end = function() {
|
|
3618
|
+
if (this.destroyed) throw new Error('SonicBoom destroyed');
|
|
3619
|
+
if (this._opening) return void this.once('ready', ()=>{
|
|
3620
|
+
this.end();
|
|
3621
|
+
});
|
|
3622
|
+
if (this._ending) return;
|
|
3623
|
+
this._ending = true;
|
|
3624
|
+
if (this._writing) return;
|
|
3625
|
+
if (this._len > 0 && this.fd >= 0) this._actualWrite();
|
|
3626
|
+
else actualClose(this);
|
|
3627
|
+
};
|
|
3628
|
+
function flushSync() {
|
|
3629
|
+
if (this.destroyed) throw new Error('SonicBoom destroyed');
|
|
3630
|
+
if (this.fd < 0) throw new Error('sonic boom is not ready yet');
|
|
3631
|
+
if (!this._writing && this._writingBuf.length > 0) {
|
|
3632
|
+
this._bufs.unshift(this._writingBuf);
|
|
3633
|
+
this._writingBuf = '';
|
|
3634
|
+
}
|
|
3635
|
+
let buf = '';
|
|
3636
|
+
while(this._bufs.length || buf){
|
|
3637
|
+
if (buf.length <= 0) buf = this._bufs[0];
|
|
3638
|
+
try {
|
|
3639
|
+
const n1 = fs.writeSync(this.fd, buf, 'utf8');
|
|
3640
|
+
const releasedBufObj = releaseWritingBuf(buf, this._len, n1);
|
|
3641
|
+
buf = releasedBufObj.writingBuf;
|
|
3642
|
+
this._len = releasedBufObj.len;
|
|
3643
|
+
if (buf.length <= 0) this._bufs.shift();
|
|
3644
|
+
} catch (err) {
|
|
3645
|
+
const shouldRetry = 'EAGAIN' === err.code || 'EBUSY' === err.code;
|
|
3646
|
+
if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) throw err;
|
|
3647
|
+
sleep(BUSY_WRITE_TIMEOUT);
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
try {
|
|
3651
|
+
fs.fsyncSync(this.fd);
|
|
3652
|
+
} catch {}
|
|
3653
|
+
}
|
|
3654
|
+
function flushBufferSync() {
|
|
3655
|
+
if (this.destroyed) throw new Error('SonicBoom destroyed');
|
|
3656
|
+
if (this.fd < 0) throw new Error('sonic boom is not ready yet');
|
|
3657
|
+
if (!this._writing && this._writingBuf.length > 0) {
|
|
3658
|
+
this._bufs.unshift([
|
|
3659
|
+
this._writingBuf
|
|
3660
|
+
]);
|
|
3661
|
+
this._writingBuf = kEmptyBuffer;
|
|
3662
|
+
}
|
|
3663
|
+
let buf = kEmptyBuffer;
|
|
3664
|
+
while(this._bufs.length || buf.length){
|
|
3665
|
+
if (buf.length <= 0) buf = mergeBuf(this._bufs[0], this._lens[0]);
|
|
3666
|
+
try {
|
|
3667
|
+
const n1 = fs.writeSync(this.fd, buf);
|
|
3668
|
+
buf = buf.subarray(n1);
|
|
3669
|
+
this._len = Math.max(this._len - n1, 0);
|
|
3670
|
+
if (buf.length <= 0) {
|
|
3671
|
+
this._bufs.shift();
|
|
3672
|
+
this._lens.shift();
|
|
3673
|
+
}
|
|
3674
|
+
} catch (err) {
|
|
3675
|
+
const shouldRetry = 'EAGAIN' === err.code || 'EBUSY' === err.code;
|
|
3676
|
+
if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) throw err;
|
|
3677
|
+
sleep(BUSY_WRITE_TIMEOUT);
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
SonicBoom.prototype.destroy = function() {
|
|
3682
|
+
if (this.destroyed) return;
|
|
3683
|
+
actualClose(this);
|
|
3684
|
+
};
|
|
3685
|
+
function actualWrite() {
|
|
3686
|
+
const release = this.release;
|
|
3687
|
+
this._writing = true;
|
|
3688
|
+
this._writingBuf = this._writingBuf || this._bufs.shift() || '';
|
|
3689
|
+
if (this.sync) try {
|
|
3690
|
+
const written = fs.writeSync(this.fd, this._writingBuf, 'utf8');
|
|
3691
|
+
release(null, written);
|
|
3692
|
+
} catch (err) {
|
|
3693
|
+
release(err);
|
|
3694
|
+
}
|
|
3695
|
+
else fs.write(this.fd, this._writingBuf, 'utf8', release);
|
|
3696
|
+
}
|
|
3697
|
+
function actualWriteBuffer() {
|
|
3698
|
+
const release = this.release;
|
|
3699
|
+
this._writing = true;
|
|
3700
|
+
this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
|
|
3701
|
+
if (this.sync) try {
|
|
3702
|
+
const written = fs.writeSync(this.fd, this._writingBuf);
|
|
3703
|
+
release(null, written);
|
|
3704
|
+
} catch (err) {
|
|
3705
|
+
release(err);
|
|
3706
|
+
}
|
|
3707
|
+
else {
|
|
3708
|
+
if (kCopyBuffer) this._writingBuf = Buffer.from(this._writingBuf);
|
|
3709
|
+
fs.write(this.fd, this._writingBuf, release);
|
|
3710
|
+
}
|
|
3711
|
+
}
|
|
3712
|
+
function actualClose(sonic) {
|
|
3713
|
+
if (-1 === sonic.fd) return void sonic.once('ready', actualClose.bind(null, sonic));
|
|
3714
|
+
if (void 0 !== sonic._periodicFlushTimer) clearInterval(sonic._periodicFlushTimer);
|
|
3715
|
+
sonic.destroyed = true;
|
|
3716
|
+
sonic._bufs = [];
|
|
3717
|
+
sonic._lens = [];
|
|
3718
|
+
assert('number' == typeof sonic.fd, `sonic.fd must be a number, got ${typeof sonic.fd}`);
|
|
3719
|
+
try {
|
|
3720
|
+
fs.fsync(sonic.fd, closeWrapped);
|
|
3721
|
+
} catch {}
|
|
3722
|
+
function closeWrapped() {
|
|
3723
|
+
if (1 !== sonic.fd && 2 !== sonic.fd) fs.close(sonic.fd, done);
|
|
3724
|
+
else done();
|
|
3725
|
+
}
|
|
3726
|
+
function done(err) {
|
|
3727
|
+
if (err) return void sonic.emit('error', err);
|
|
3728
|
+
if (sonic._ending && !sonic._writing) sonic.emit('finish');
|
|
3729
|
+
sonic.emit('close');
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
SonicBoom.SonicBoom = SonicBoom;
|
|
3733
|
+
SonicBoom.default = SonicBoom;
|
|
3734
|
+
module1.exports = SonicBoom;
|
|
3735
|
+
},
|
|
3736
|
+
"../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/worker.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
3737
|
+
"use strict";
|
|
3738
|
+
const EE = __webpack_require__("node:events");
|
|
3739
|
+
const { pipeline, PassThrough } = __webpack_require__("node:stream");
|
|
3740
|
+
const pino = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/pino.js");
|
|
3741
|
+
const build = __webpack_require__("../../node_modules/.pnpm/pino-abstract-transport@2.0.0/node_modules/pino-abstract-transport/index.js");
|
|
3742
|
+
const loadTransportStreamBuilder = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/transport-stream.js");
|
|
3743
|
+
module1.exports = async function({ targets, pipelines, levels, dedupe }) {
|
|
3744
|
+
const targetStreams = [];
|
|
3745
|
+
if (targets && targets.length) {
|
|
3746
|
+
targets = await Promise.all(targets.map(async (t)=>{
|
|
3747
|
+
const fn = await loadTransportStreamBuilder(t.target);
|
|
3748
|
+
const stream = await fn(t.options);
|
|
3749
|
+
return {
|
|
3750
|
+
level: t.level,
|
|
3751
|
+
stream
|
|
3752
|
+
};
|
|
3753
|
+
}));
|
|
3754
|
+
targetStreams.push(...targets);
|
|
3755
|
+
}
|
|
3756
|
+
if (pipelines && pipelines.length) {
|
|
3757
|
+
pipelines = await Promise.all(pipelines.map(async (p)=>{
|
|
3758
|
+
let level;
|
|
3759
|
+
const pipeDests = await Promise.all(p.map(async (t)=>{
|
|
3760
|
+
level = t.level;
|
|
3761
|
+
const fn = await loadTransportStreamBuilder(t.target);
|
|
3762
|
+
const stream = await fn(t.options);
|
|
3763
|
+
return stream;
|
|
3764
|
+
}));
|
|
3765
|
+
return {
|
|
3766
|
+
level,
|
|
3767
|
+
stream: createPipeline(pipeDests)
|
|
3768
|
+
};
|
|
3769
|
+
}));
|
|
3770
|
+
targetStreams.push(...pipelines);
|
|
3771
|
+
}
|
|
3772
|
+
if (1 === targetStreams.length) return targetStreams[0].stream;
|
|
3773
|
+
return build(process1, {
|
|
3774
|
+
parse: 'lines',
|
|
3775
|
+
metadata: true,
|
|
3776
|
+
close (err, cb) {
|
|
3777
|
+
let expected = 0;
|
|
3778
|
+
for (const transport of targetStreams){
|
|
3779
|
+
expected++;
|
|
3780
|
+
transport.stream.on('close', closeCb);
|
|
3781
|
+
transport.stream.end();
|
|
3782
|
+
}
|
|
3783
|
+
function closeCb() {
|
|
3784
|
+
if (0 === --expected) cb(err);
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
});
|
|
3788
|
+
function process1(stream) {
|
|
3789
|
+
const multi = pino.multistream(targetStreams, {
|
|
3790
|
+
levels,
|
|
3791
|
+
dedupe
|
|
3792
|
+
});
|
|
3793
|
+
stream.on('data', function(chunk) {
|
|
3794
|
+
const { lastTime, lastMsg, lastObj, lastLevel } = this;
|
|
3795
|
+
multi.lastLevel = lastLevel;
|
|
3796
|
+
multi.lastTime = lastTime;
|
|
3797
|
+
multi.lastMsg = lastMsg;
|
|
3798
|
+
multi.lastObj = lastObj;
|
|
3799
|
+
multi.write(chunk + '\n');
|
|
3800
|
+
});
|
|
3801
|
+
}
|
|
3802
|
+
function createPipeline(streams) {
|
|
3803
|
+
const ee = new EE();
|
|
3804
|
+
const stream = new PassThrough({
|
|
3805
|
+
autoDestroy: true,
|
|
3806
|
+
destroy (_, cb) {
|
|
3807
|
+
ee.on('error', cb);
|
|
3808
|
+
ee.on('closed', cb);
|
|
3809
|
+
}
|
|
3810
|
+
});
|
|
3811
|
+
pipeline(stream, ...streams, function(err) {
|
|
3812
|
+
if (err && 'ERR_STREAM_PREMATURE_CLOSE' !== err.code) return void ee.emit('error', err);
|
|
3813
|
+
ee.emit('closed');
|
|
3814
|
+
});
|
|
3815
|
+
return stream;
|
|
3816
|
+
}
|
|
3817
|
+
};
|
|
3818
|
+
},
|
|
3819
|
+
"../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/package.json": function(module1) {
|
|
3820
|
+
"use strict";
|
|
3821
|
+
module1.exports = JSON.parse('{"name":"thread-stream","version":"3.1.0","description":"A streaming way to send data to a Node.js Worker Thread","main":"index.js","types":"index.d.ts","dependencies":{"real-require":"^0.2.0"},"devDependencies":{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5","desm":"^1.3.0","fastbench":"^1.0.1","husky":"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","standard":"^17.0.0","tap":"^16.2.0","ts-node":"^10.8.0","typescript":"^5.3.2","why-is-node-running":"^2.2.2"},"scripts":{"build":"tsc --noEmit","test":"standard && npm run build && npm run transpile && tap \\"test/**/*.test.*js\\" && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":"tap --no-check-coverage --timeout=120 --coverage-report=lcovonly \\"test/**/*.test.*js\\"","test:ci:ts":"tap --ts --no-check-coverage --coverage-report=lcovonly \\"test/**/*.test.*ts\\"","test:yarn":"npm run transpile && tap \\"test/**/*.test.js\\" --no-check-coverage","transpile":"sh ./test/ts/transpile.sh","prepare":"husky install"},"standard":{"ignore":["test/ts/**/*","test/syntax-error.mjs"]},"repository":{"type":"git","url":"git+https://github.com/mcollina/thread-stream.git"},"keywords":["worker","thread","threads","stream"],"author":"Matteo Collina <hello@matteocollina.com>","license":"MIT","bugs":{"url":"https://github.com/mcollina/thread-stream/issues"},"homepage":"https://github.com/mcollina/thread-stream#readme"}');
|
|
3822
|
+
}
|
|
3823
|
+
};
|
|
3824
|
+
var __webpack_module_cache__ = {};
|
|
3825
|
+
function __webpack_require__(moduleId) {
|
|
3826
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
3827
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
3828
|
+
var module1 = __webpack_module_cache__[moduleId] = {
|
|
3829
|
+
exports: {}
|
|
3830
|
+
};
|
|
3831
|
+
__webpack_modules__[moduleId](module1, module1.exports, __webpack_require__);
|
|
3832
|
+
return module1.exports;
|
|
3833
|
+
}
|
|
3834
|
+
var __webpack_exports__ = __webpack_require__("../../node_modules/.pnpm/pino@9.7.0/node_modules/pino/lib/worker.js");
|
|
3835
|
+
module.exports = __webpack_exports__;
|