@rife/logger 0.0.6-beta.10 → 0.0.6-beta.11
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/pino/index.cjs +118 -67
- package/dist/cjs/pino/worker/pino-file.cjs +3353 -0
- package/dist/cjs/pino/worker/pino-pretty.cjs +2870 -0
- package/dist/cjs/pino/worker/pino-rotate.cjs +604 -0
- package/dist/cjs/pino/worker/pino-worker.cjs +3666 -0
- package/dist/cjs/pino/worker/thread-stream.cjs +172 -0
- package/dist/cjs/test.cjs +5 -5
- package/dist/cjs/trace.cjs +1 -1
- package/dist/esm/pino/index.mjs +61 -12
- package/dist/esm/pino/worker/pino-file.cjs +3353 -0
- package/dist/esm/pino/worker/pino-pretty.cjs +2870 -0
- package/dist/esm/pino/worker/pino-rotate.cjs +604 -0
- package/dist/esm/pino/worker/pino-worker.cjs +3666 -0
- package/dist/esm/pino/worker/thread-stream.cjs +172 -0
- package/dist/esm/test.mjs +5 -5
- package/dist/worker/pino-file.cjs +428 -597
- package/dist/worker/pino-pretty.cjs +290 -276
- package/dist/worker/pino-rotate.cjs +2 -2
- package/dist/worker/pino-worker.cjs +497 -666
- package/package.json +6 -6
- package/src/common.ts +4 -4
- package/src/pino/index.ts +120 -102
- package/src/pino/rotate.ts +32 -32
- package/src/test.ts +19 -19
- package/src/trace.ts +15 -15
- package/tsconfig.json +12 -12
|
@@ -1,4 +1,302 @@
|
|
|
1
1
|
var __webpack_modules__ = {
|
|
2
|
+
"../../node_modules/.pnpm/@pinojs+redact@0.4.0/node_modules/@pinojs/redact/index.js": function(module1) {
|
|
3
|
+
"use strict";
|
|
4
|
+
function deepClone(obj) {
|
|
5
|
+
if (null === obj || 'object' != typeof obj) return obj;
|
|
6
|
+
if (obj instanceof Date) return new Date(obj.getTime());
|
|
7
|
+
if (obj instanceof Array) {
|
|
8
|
+
const cloned = [];
|
|
9
|
+
for(let i = 0; i < obj.length; i++)cloned[i] = deepClone(obj[i]);
|
|
10
|
+
return cloned;
|
|
11
|
+
}
|
|
12
|
+
if ('object' == typeof obj) {
|
|
13
|
+
const cloned = Object.create(Object.getPrototypeOf(obj));
|
|
14
|
+
for(const key in obj)if (Object.prototype.hasOwnProperty.call(obj, key)) cloned[key] = deepClone(obj[key]);
|
|
15
|
+
return cloned;
|
|
16
|
+
}
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
19
|
+
function parsePath(path) {
|
|
20
|
+
const parts = [];
|
|
21
|
+
let current = '';
|
|
22
|
+
let inBrackets = false;
|
|
23
|
+
let inQuotes = false;
|
|
24
|
+
let quoteChar = '';
|
|
25
|
+
for(let i = 0; i < path.length; i++){
|
|
26
|
+
const char = path[i];
|
|
27
|
+
if (inBrackets || '.' !== char) if ('[' === char) {
|
|
28
|
+
if (current) {
|
|
29
|
+
parts.push(current);
|
|
30
|
+
current = '';
|
|
31
|
+
}
|
|
32
|
+
inBrackets = true;
|
|
33
|
+
} else if (']' === char && inBrackets) {
|
|
34
|
+
parts.push(current);
|
|
35
|
+
current = '';
|
|
36
|
+
inBrackets = false;
|
|
37
|
+
inQuotes = false;
|
|
38
|
+
} else if (('"' === char || "'" === char) && inBrackets) if (inQuotes) if (char === quoteChar) {
|
|
39
|
+
inQuotes = false;
|
|
40
|
+
quoteChar = '';
|
|
41
|
+
} else current += char;
|
|
42
|
+
else {
|
|
43
|
+
inQuotes = true;
|
|
44
|
+
quoteChar = char;
|
|
45
|
+
}
|
|
46
|
+
else current += char;
|
|
47
|
+
else if (current) {
|
|
48
|
+
parts.push(current);
|
|
49
|
+
current = '';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (current) parts.push(current);
|
|
53
|
+
return parts;
|
|
54
|
+
}
|
|
55
|
+
function setValue(obj, parts, value) {
|
|
56
|
+
let current = obj;
|
|
57
|
+
for(let i = 0; i < parts.length - 1; i++){
|
|
58
|
+
const key = parts[i];
|
|
59
|
+
if ('object' != typeof current || null === current || !(key in current)) return false;
|
|
60
|
+
if ('object' != typeof current[key] || null === current[key]) return false;
|
|
61
|
+
current = current[key];
|
|
62
|
+
}
|
|
63
|
+
const lastKey = parts[parts.length - 1];
|
|
64
|
+
if ('*' === lastKey) {
|
|
65
|
+
if (Array.isArray(current)) for(let i = 0; i < current.length; i++)current[i] = value;
|
|
66
|
+
else if ('object' == typeof current && null !== current) {
|
|
67
|
+
for(const key in current)if (Object.prototype.hasOwnProperty.call(current, key)) current[key] = value;
|
|
68
|
+
}
|
|
69
|
+
} else if ('object' == typeof current && null !== current && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) current[lastKey] = value;
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
function removeKey(obj, parts) {
|
|
73
|
+
let current = obj;
|
|
74
|
+
for(let i = 0; i < parts.length - 1; i++){
|
|
75
|
+
const key = parts[i];
|
|
76
|
+
if ('object' != typeof current || null === current || !(key in current)) return false;
|
|
77
|
+
if ('object' != typeof current[key] || null === current[key]) return false;
|
|
78
|
+
current = current[key];
|
|
79
|
+
}
|
|
80
|
+
const lastKey = parts[parts.length - 1];
|
|
81
|
+
if ('*' === lastKey) {
|
|
82
|
+
if (Array.isArray(current)) for(let i = 0; i < current.length; i++)current[i] = void 0;
|
|
83
|
+
else if ('object' == typeof current && null !== current) {
|
|
84
|
+
for(const key in current)if (Object.prototype.hasOwnProperty.call(current, key)) delete current[key];
|
|
85
|
+
}
|
|
86
|
+
} else if ('object' == typeof current && null !== current && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) delete current[lastKey];
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
const PATH_NOT_FOUND = Symbol('PATH_NOT_FOUND');
|
|
90
|
+
function getValueIfExists(obj, parts) {
|
|
91
|
+
let current = obj;
|
|
92
|
+
for (const part of parts){
|
|
93
|
+
if (null == current) return PATH_NOT_FOUND;
|
|
94
|
+
if ('object' != typeof current || null === current) return PATH_NOT_FOUND;
|
|
95
|
+
if (!(part in current)) return PATH_NOT_FOUND;
|
|
96
|
+
current = current[part];
|
|
97
|
+
}
|
|
98
|
+
return current;
|
|
99
|
+
}
|
|
100
|
+
function getValue(obj, parts) {
|
|
101
|
+
let current = obj;
|
|
102
|
+
for (const part of parts){
|
|
103
|
+
if (null == current) return;
|
|
104
|
+
if ('object' != typeof current || null === current) return;
|
|
105
|
+
current = current[part];
|
|
106
|
+
}
|
|
107
|
+
return current;
|
|
108
|
+
}
|
|
109
|
+
function redactPaths(obj, paths, censor, remove = false) {
|
|
110
|
+
for (const path of paths){
|
|
111
|
+
const parts = parsePath(path);
|
|
112
|
+
if (parts.includes('*')) redactWildcardPath(obj, parts, censor, path, remove);
|
|
113
|
+
else if (remove) removeKey(obj, parts);
|
|
114
|
+
else {
|
|
115
|
+
const value = getValueIfExists(obj, parts);
|
|
116
|
+
if (value === PATH_NOT_FOUND) continue;
|
|
117
|
+
const actualCensor = 'function' == typeof censor ? censor(value, parts) : censor;
|
|
118
|
+
setValue(obj, parts, actualCensor);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function redactWildcardPath(obj, parts, censor, originalPath, remove = false) {
|
|
123
|
+
const wildcardIndex = parts.indexOf('*');
|
|
124
|
+
if (wildcardIndex === parts.length - 1) {
|
|
125
|
+
const parentParts = parts.slice(0, -1);
|
|
126
|
+
let current = obj;
|
|
127
|
+
for (const part of parentParts){
|
|
128
|
+
if (null == current) return;
|
|
129
|
+
if ('object' != typeof current || null === current) return;
|
|
130
|
+
current = current[part];
|
|
131
|
+
}
|
|
132
|
+
if (Array.isArray(current)) if (remove) for(let i = 0; i < current.length; i++)current[i] = void 0;
|
|
133
|
+
else for(let i = 0; i < current.length; i++){
|
|
134
|
+
const indexPath = [
|
|
135
|
+
...parentParts,
|
|
136
|
+
i.toString()
|
|
137
|
+
];
|
|
138
|
+
const actualCensor = 'function' == typeof censor ? censor(current[i], indexPath) : censor;
|
|
139
|
+
current[i] = actualCensor;
|
|
140
|
+
}
|
|
141
|
+
else if ('object' == typeof current && null !== current) if (remove) {
|
|
142
|
+
const keysToDelete = [];
|
|
143
|
+
for(const key in current)if (Object.prototype.hasOwnProperty.call(current, key)) keysToDelete.push(key);
|
|
144
|
+
for (const key of keysToDelete)delete current[key];
|
|
145
|
+
} else for(const key in current){
|
|
146
|
+
const keyPath = [
|
|
147
|
+
...parentParts,
|
|
148
|
+
key
|
|
149
|
+
];
|
|
150
|
+
const actualCensor = 'function' == typeof censor ? censor(current[key], keyPath) : censor;
|
|
151
|
+
current[key] = actualCensor;
|
|
152
|
+
}
|
|
153
|
+
} else redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove);
|
|
154
|
+
}
|
|
155
|
+
function redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove = false) {
|
|
156
|
+
const beforeWildcard = parts.slice(0, wildcardIndex);
|
|
157
|
+
const afterWildcard = parts.slice(wildcardIndex + 1);
|
|
158
|
+
const pathArray = [];
|
|
159
|
+
function traverse(current, pathLength) {
|
|
160
|
+
if (pathLength === beforeWildcard.length) {
|
|
161
|
+
if (Array.isArray(current)) for(let i = 0; i < current.length; i++){
|
|
162
|
+
pathArray[pathLength] = i.toString();
|
|
163
|
+
traverse(current[i], pathLength + 1);
|
|
164
|
+
}
|
|
165
|
+
else if ('object' == typeof current && null !== current) for(const key in current){
|
|
166
|
+
pathArray[pathLength] = key;
|
|
167
|
+
traverse(current[key], pathLength + 1);
|
|
168
|
+
}
|
|
169
|
+
} else if (pathLength < beforeWildcard.length) {
|
|
170
|
+
const nextKey = beforeWildcard[pathLength];
|
|
171
|
+
if (current && 'object' == typeof current && null !== current && nextKey in current) {
|
|
172
|
+
pathArray[pathLength] = nextKey;
|
|
173
|
+
traverse(current[nextKey], pathLength + 1);
|
|
174
|
+
}
|
|
175
|
+
} else if (afterWildcard.includes('*')) {
|
|
176
|
+
const wrappedCensor = 'function' == typeof censor ? (value, path)=>{
|
|
177
|
+
const fullPath = [
|
|
178
|
+
...pathArray.slice(0, pathLength),
|
|
179
|
+
...path
|
|
180
|
+
];
|
|
181
|
+
return censor(value, fullPath);
|
|
182
|
+
} : censor;
|
|
183
|
+
redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
|
|
184
|
+
} else if (remove) removeKey(current, afterWildcard);
|
|
185
|
+
else {
|
|
186
|
+
const actualCensor = 'function' == typeof censor ? censor(getValue(current, afterWildcard), [
|
|
187
|
+
...pathArray.slice(0, pathLength),
|
|
188
|
+
...afterWildcard
|
|
189
|
+
]) : censor;
|
|
190
|
+
setValue(current, afterWildcard, actualCensor);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (0 === beforeWildcard.length) traverse(obj, 0);
|
|
194
|
+
else {
|
|
195
|
+
let current = obj;
|
|
196
|
+
for(let i = 0; i < beforeWildcard.length; i++){
|
|
197
|
+
const part = beforeWildcard[i];
|
|
198
|
+
if (null == current) return;
|
|
199
|
+
if ('object' != typeof current || null === current) return;
|
|
200
|
+
current = current[part];
|
|
201
|
+
pathArray[i] = part;
|
|
202
|
+
}
|
|
203
|
+
if (null != current) traverse(current, beforeWildcard.length);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function buildPathStructure(pathsToClone) {
|
|
207
|
+
if (0 === pathsToClone.length) return null;
|
|
208
|
+
const pathStructure = new Map();
|
|
209
|
+
for (const path of pathsToClone){
|
|
210
|
+
const parts = parsePath(path);
|
|
211
|
+
let current = pathStructure;
|
|
212
|
+
for(let i = 0; i < parts.length; i++){
|
|
213
|
+
const part = parts[i];
|
|
214
|
+
if (!current.has(part)) current.set(part, new Map());
|
|
215
|
+
current = current.get(part);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return pathStructure;
|
|
219
|
+
}
|
|
220
|
+
function selectiveClone(obj, pathStructure) {
|
|
221
|
+
if (!pathStructure) return obj;
|
|
222
|
+
function cloneSelectively(source, pathMap, depth = 0) {
|
|
223
|
+
if (!pathMap || 0 === pathMap.size) return source;
|
|
224
|
+
if (null === source || 'object' != typeof source) return source;
|
|
225
|
+
if (source instanceof Date) return new Date(source.getTime());
|
|
226
|
+
if (Array.isArray(source)) {
|
|
227
|
+
const cloned = [];
|
|
228
|
+
for(let i = 0; i < source.length; i++){
|
|
229
|
+
const indexStr = i.toString();
|
|
230
|
+
if (pathMap.has(indexStr) || pathMap.has('*')) cloned[i] = cloneSelectively(source[i], pathMap.get(indexStr) || pathMap.get('*'));
|
|
231
|
+
else cloned[i] = source[i];
|
|
232
|
+
}
|
|
233
|
+
return cloned;
|
|
234
|
+
}
|
|
235
|
+
const cloned = Object.create(Object.getPrototypeOf(source));
|
|
236
|
+
for(const key in source)if (Object.prototype.hasOwnProperty.call(source, key)) if (pathMap.has(key) || pathMap.has('*')) cloned[key] = cloneSelectively(source[key], pathMap.get(key) || pathMap.get('*'));
|
|
237
|
+
else cloned[key] = source[key];
|
|
238
|
+
return cloned;
|
|
239
|
+
}
|
|
240
|
+
return cloneSelectively(obj, pathStructure);
|
|
241
|
+
}
|
|
242
|
+
function validatePath(path) {
|
|
243
|
+
if ('string' != typeof path) throw new Error('Paths must be (non-empty) strings');
|
|
244
|
+
if ('' === path) throw new Error('Invalid redaction path ()');
|
|
245
|
+
if (path.includes('..')) throw new Error(`Invalid redaction path (${path})`);
|
|
246
|
+
if (path.includes(',')) throw new Error(`Invalid redaction path (${path})`);
|
|
247
|
+
let bracketCount = 0;
|
|
248
|
+
let inQuotes = false;
|
|
249
|
+
let quoteChar = '';
|
|
250
|
+
for(let i = 0; i < path.length; i++){
|
|
251
|
+
const char = path[i];
|
|
252
|
+
if (('"' === char || "'" === char) && bracketCount > 0) if (inQuotes) {
|
|
253
|
+
if (char === quoteChar) {
|
|
254
|
+
inQuotes = false;
|
|
255
|
+
quoteChar = '';
|
|
256
|
+
}
|
|
257
|
+
} else {
|
|
258
|
+
inQuotes = true;
|
|
259
|
+
quoteChar = char;
|
|
260
|
+
}
|
|
261
|
+
else if ('[' !== char || inQuotes) {
|
|
262
|
+
if (']' === char && !inQuotes) {
|
|
263
|
+
bracketCount--;
|
|
264
|
+
if (bracketCount < 0) throw new Error(`Invalid redaction path (${path})`);
|
|
265
|
+
}
|
|
266
|
+
} else bracketCount++;
|
|
267
|
+
}
|
|
268
|
+
if (0 !== bracketCount) throw new Error(`Invalid redaction path (${path})`);
|
|
269
|
+
}
|
|
270
|
+
function validatePaths(paths) {
|
|
271
|
+
if (!Array.isArray(paths)) throw new TypeError('paths must be an array');
|
|
272
|
+
for (const path of paths)validatePath(path);
|
|
273
|
+
}
|
|
274
|
+
function slowRedact(options = {}) {
|
|
275
|
+
const { paths = [], censor = '[REDACTED]', serialize = JSON.stringify, strict = true, remove = false } = options;
|
|
276
|
+
validatePaths(paths);
|
|
277
|
+
const pathStructure = buildPathStructure(paths);
|
|
278
|
+
return function(obj) {
|
|
279
|
+
if (strict && (null === obj || 'object' != typeof obj)) {
|
|
280
|
+
if (null == obj) return serialize ? serialize(obj) : obj;
|
|
281
|
+
if ('object' != typeof obj) return serialize ? serialize(obj) : obj;
|
|
282
|
+
}
|
|
283
|
+
const cloned = selectiveClone(obj, pathStructure);
|
|
284
|
+
const original = obj;
|
|
285
|
+
let actualCensor = censor;
|
|
286
|
+
if ('function' == typeof censor) actualCensor = censor;
|
|
287
|
+
redactPaths(cloned, paths, actualCensor, remove);
|
|
288
|
+
if (false === serialize) {
|
|
289
|
+
cloned.restore = function() {
|
|
290
|
+
return deepClone(original);
|
|
291
|
+
};
|
|
292
|
+
return cloned;
|
|
293
|
+
}
|
|
294
|
+
if ('function' == typeof serialize) return serialize(cloned);
|
|
295
|
+
return JSON.stringify(cloned);
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
module1.exports = slowRedact;
|
|
299
|
+
},
|
|
2
300
|
"../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js": function(module1) {
|
|
3
301
|
"use strict";
|
|
4
302
|
if ('undefined' != typeof SharedArrayBuffer && 'undefined' != typeof Atomics) {
|
|
@@ -25,524 +323,6 @@ var __webpack_modules__ = {
|
|
|
25
323
|
module1.exports = sleep1;
|
|
26
324
|
}
|
|
27
325
|
},
|
|
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
326
|
"../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js": function(module1) {
|
|
547
327
|
"use strict";
|
|
548
328
|
const refs = {
|
|
@@ -1791,6 +1571,10 @@ var __webpack_modules__ = {
|
|
|
1791
1571
|
"use strict";
|
|
1792
1572
|
module1.exports = require("module");
|
|
1793
1573
|
},
|
|
1574
|
+
"node:diagnostics_channel": function(module1) {
|
|
1575
|
+
"use strict";
|
|
1576
|
+
module1.exports = require("node:diagnostics_channel");
|
|
1577
|
+
},
|
|
1794
1578
|
"node:events": function(module1) {
|
|
1795
1579
|
"use strict";
|
|
1796
1580
|
module1.exports = require("node:events");
|
|
@@ -1831,6 +1615,89 @@ var __webpack_modules__ = {
|
|
|
1831
1615
|
"use strict";
|
|
1832
1616
|
module1.exports = require("worker_threads");
|
|
1833
1617
|
},
|
|
1618
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/worker.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
1619
|
+
"use strict";
|
|
1620
|
+
const EE = __webpack_require__("node:events");
|
|
1621
|
+
const { pipeline, PassThrough } = __webpack_require__("node:stream");
|
|
1622
|
+
const pino = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/pino.js");
|
|
1623
|
+
const build = __webpack_require__("../../node_modules/.pnpm/pino-abstract-transport@2.0.0/node_modules/pino-abstract-transport/index.js");
|
|
1624
|
+
const loadTransportStreamBuilder = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/transport-stream.js");
|
|
1625
|
+
module1.exports = async function({ targets, pipelines, levels, dedupe }) {
|
|
1626
|
+
const targetStreams = [];
|
|
1627
|
+
if (targets && targets.length) {
|
|
1628
|
+
targets = await Promise.all(targets.map(async (t)=>{
|
|
1629
|
+
const fn = await loadTransportStreamBuilder(t.target);
|
|
1630
|
+
const stream = await fn(t.options);
|
|
1631
|
+
return {
|
|
1632
|
+
level: t.level,
|
|
1633
|
+
stream
|
|
1634
|
+
};
|
|
1635
|
+
}));
|
|
1636
|
+
targetStreams.push(...targets);
|
|
1637
|
+
}
|
|
1638
|
+
if (pipelines && pipelines.length) {
|
|
1639
|
+
pipelines = await Promise.all(pipelines.map(async (p)=>{
|
|
1640
|
+
let level;
|
|
1641
|
+
const pipeDests = await Promise.all(p.map(async (t)=>{
|
|
1642
|
+
level = t.level;
|
|
1643
|
+
const fn = await loadTransportStreamBuilder(t.target);
|
|
1644
|
+
const stream = await fn(t.options);
|
|
1645
|
+
return stream;
|
|
1646
|
+
}));
|
|
1647
|
+
return {
|
|
1648
|
+
level,
|
|
1649
|
+
stream: createPipeline(pipeDests)
|
|
1650
|
+
};
|
|
1651
|
+
}));
|
|
1652
|
+
targetStreams.push(...pipelines);
|
|
1653
|
+
}
|
|
1654
|
+
if (1 === targetStreams.length) return targetStreams[0].stream;
|
|
1655
|
+
return build(process1, {
|
|
1656
|
+
parse: 'lines',
|
|
1657
|
+
metadata: true,
|
|
1658
|
+
close (err, cb) {
|
|
1659
|
+
let expected = 0;
|
|
1660
|
+
for (const transport of targetStreams){
|
|
1661
|
+
expected++;
|
|
1662
|
+
transport.stream.on('close', closeCb);
|
|
1663
|
+
transport.stream.end();
|
|
1664
|
+
}
|
|
1665
|
+
function closeCb() {
|
|
1666
|
+
if (0 === --expected) cb(err);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
});
|
|
1670
|
+
function process1(stream) {
|
|
1671
|
+
const multi = pino.multistream(targetStreams, {
|
|
1672
|
+
levels,
|
|
1673
|
+
dedupe
|
|
1674
|
+
});
|
|
1675
|
+
stream.on('data', function(chunk) {
|
|
1676
|
+
const { lastTime, lastMsg, lastObj, lastLevel } = this;
|
|
1677
|
+
multi.lastLevel = lastLevel;
|
|
1678
|
+
multi.lastTime = lastTime;
|
|
1679
|
+
multi.lastMsg = lastMsg;
|
|
1680
|
+
multi.lastObj = lastObj;
|
|
1681
|
+
multi.write(chunk + '\n');
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
function createPipeline(streams) {
|
|
1685
|
+
const ee = new EE();
|
|
1686
|
+
const stream = new PassThrough({
|
|
1687
|
+
autoDestroy: true,
|
|
1688
|
+
destroy (_, cb) {
|
|
1689
|
+
ee.on('error', cb);
|
|
1690
|
+
ee.on('closed', cb);
|
|
1691
|
+
}
|
|
1692
|
+
});
|
|
1693
|
+
pipeline(stream, ...streams, function(err) {
|
|
1694
|
+
if (err && 'ERR_STREAM_PREMATURE_CLOSE' !== err.code) return void ee.emit('error', err);
|
|
1695
|
+
ee.emit('closed');
|
|
1696
|
+
});
|
|
1697
|
+
return stream;
|
|
1698
|
+
}
|
|
1699
|
+
};
|
|
1700
|
+
},
|
|
1834
1701
|
"../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
1835
1702
|
"use strict";
|
|
1836
1703
|
const errSerializer = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err.js");
|
|
@@ -2137,7 +2004,7 @@ var __webpack_modules__ = {
|
|
|
2137
2004
|
};
|
|
2138
2005
|
}
|
|
2139
2006
|
},
|
|
2140
|
-
"../../node_modules/.pnpm/pino@
|
|
2007
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/caller.js": function(module1) {
|
|
2141
2008
|
"use strict";
|
|
2142
2009
|
function noOpPrepareStackTrace(_, stack) {
|
|
2143
2010
|
return stack;
|
|
@@ -2154,7 +2021,7 @@ var __webpack_modules__ = {
|
|
|
2154
2021
|
return fileNames;
|
|
2155
2022
|
};
|
|
2156
2023
|
},
|
|
2157
|
-
"../../node_modules/.pnpm/pino@
|
|
2024
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/constants.js": function(module1) {
|
|
2158
2025
|
const DEFAULT_LEVELS = {
|
|
2159
2026
|
trace: 10,
|
|
2160
2027
|
debug: 20,
|
|
@@ -2172,11 +2039,11 @@ var __webpack_modules__ = {
|
|
|
2172
2039
|
SORTING_ORDER
|
|
2173
2040
|
};
|
|
2174
2041
|
},
|
|
2175
|
-
"../../node_modules/.pnpm/pino@
|
|
2042
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/levels.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2176
2043
|
"use strict";
|
|
2177
|
-
const { lsCacheSym, levelValSym, useOnlyCustomLevelsSym, streamSym, formattersSym, hooksSym, levelCompSym } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2178
|
-
const { noop, genLog } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2179
|
-
const { DEFAULT_LEVELS, SORTING_ORDER } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2044
|
+
const { lsCacheSym, levelValSym, useOnlyCustomLevelsSym, streamSym, formattersSym, hooksSym, levelCompSym } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
|
|
2045
|
+
const { noop, genLog } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/tools.js");
|
|
2046
|
+
const { DEFAULT_LEVELS, SORTING_ORDER } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/constants.js");
|
|
2180
2047
|
const levelMethods = {
|
|
2181
2048
|
fatal: (hook)=>{
|
|
2182
2049
|
const logFatal = genLog(DEFAULT_LEVELS.fatal, hook);
|
|
@@ -2324,19 +2191,18 @@ var __webpack_modules__ = {
|
|
|
2324
2191
|
assertLevelComparison
|
|
2325
2192
|
};
|
|
2326
2193
|
},
|
|
2327
|
-
"../../node_modules/.pnpm/pino@
|
|
2194
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/meta.js": function(module1) {
|
|
2328
2195
|
"use strict";
|
|
2329
2196
|
module1.exports = {
|
|
2330
|
-
version: '
|
|
2197
|
+
version: '10.1.0'
|
|
2331
2198
|
};
|
|
2332
2199
|
},
|
|
2333
|
-
"../../node_modules/.pnpm/pino@
|
|
2200
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/multistream.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2334
2201
|
"use strict";
|
|
2335
2202
|
const metadata = Symbol.for('pino.metadata');
|
|
2336
|
-
const { DEFAULT_LEVELS } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2203
|
+
const { DEFAULT_LEVELS } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/constants.js");
|
|
2337
2204
|
const DEFAULT_INFO_LEVEL = DEFAULT_LEVELS.info;
|
|
2338
2205
|
function multistream(streamsArray, opts) {
|
|
2339
|
-
let counter = 0;
|
|
2340
2206
|
streamsArray = streamsArray || [];
|
|
2341
2207
|
opts = opts || {
|
|
2342
2208
|
dedupe: false
|
|
@@ -2349,10 +2215,12 @@ var __webpack_modules__ = {
|
|
|
2349
2215
|
const res = {
|
|
2350
2216
|
write,
|
|
2351
2217
|
add,
|
|
2218
|
+
remove,
|
|
2352
2219
|
emit,
|
|
2353
2220
|
flushSync,
|
|
2354
2221
|
end,
|
|
2355
2222
|
minLevel: 0,
|
|
2223
|
+
lastId: 0,
|
|
2356
2224
|
streams: [],
|
|
2357
2225
|
clone,
|
|
2358
2226
|
[metadata]: true,
|
|
@@ -2404,13 +2272,23 @@ var __webpack_modules__ = {
|
|
|
2404
2272
|
stream: stream_,
|
|
2405
2273
|
level,
|
|
2406
2274
|
levelVal: void 0,
|
|
2407
|
-
id:
|
|
2275
|
+
id: ++res.lastId
|
|
2408
2276
|
};
|
|
2409
2277
|
streams.unshift(dest_);
|
|
2410
2278
|
streams.sort(compareByLevel);
|
|
2411
2279
|
this.minLevel = streams[0].level;
|
|
2412
2280
|
return res;
|
|
2413
2281
|
}
|
|
2282
|
+
function remove(id) {
|
|
2283
|
+
const { streams } = this;
|
|
2284
|
+
const index = streams.findIndex((s)=>s.id === id);
|
|
2285
|
+
if (index >= 0) {
|
|
2286
|
+
streams.splice(index, 1);
|
|
2287
|
+
streams.sort(compareByLevel);
|
|
2288
|
+
this.minLevel = streams.length > 0 ? streams[0].level : -1;
|
|
2289
|
+
}
|
|
2290
|
+
return res;
|
|
2291
|
+
}
|
|
2414
2292
|
function end() {
|
|
2415
2293
|
for (const { stream } of this.streams){
|
|
2416
2294
|
if ('function' == typeof stream.flushSync) stream.flushSync();
|
|
@@ -2426,6 +2304,7 @@ var __webpack_modules__ = {
|
|
|
2426
2304
|
return {
|
|
2427
2305
|
write,
|
|
2428
2306
|
add,
|
|
2307
|
+
remove,
|
|
2429
2308
|
minLevel: level,
|
|
2430
2309
|
streams,
|
|
2431
2310
|
clone,
|
|
@@ -2449,14 +2328,14 @@ var __webpack_modules__ = {
|
|
|
2449
2328
|
}
|
|
2450
2329
|
module1.exports = multistream;
|
|
2451
2330
|
},
|
|
2452
|
-
"../../node_modules/.pnpm/pino@
|
|
2331
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/proto.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2453
2332
|
"use strict";
|
|
2454
2333
|
const { EventEmitter } = __webpack_require__("node:events");
|
|
2455
|
-
const { lsCacheSym, levelValSym, setLevelSym, getLevelSym, chindingsSym,
|
|
2456
|
-
const { getLevel, setLevel, isLevelEnabled, mappings, initialLsCache, genLsCache, assertNoLevelCollisions } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2457
|
-
const { asChindings, asJson, buildFormatters, stringify } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2458
|
-
const { version } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2459
|
-
const redaction = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2334
|
+
const { lsCacheSym, levelValSym, setLevelSym, getLevelSym, chindingsSym, 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@10.1.0/node_modules/pino/lib/symbols.js");
|
|
2335
|
+
const { getLevel, setLevel, isLevelEnabled, mappings, initialLsCache, genLsCache, assertNoLevelCollisions } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/levels.js");
|
|
2336
|
+
const { asChindings, asJson, buildFormatters, stringify, noop } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/tools.js");
|
|
2337
|
+
const { version } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/meta.js");
|
|
2338
|
+
const redaction = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/redaction.js");
|
|
2460
2339
|
const constructor = class {
|
|
2461
2340
|
};
|
|
2462
2341
|
const prototype = {
|
|
@@ -2479,6 +2358,12 @@ var __webpack_modules__ = {
|
|
|
2479
2358
|
set levelVal (n){
|
|
2480
2359
|
throw Error('levelVal is read-only');
|
|
2481
2360
|
},
|
|
2361
|
+
get msgPrefix () {
|
|
2362
|
+
return this[msgPrefixSym];
|
|
2363
|
+
},
|
|
2364
|
+
get [Symbol.toStringTag] () {
|
|
2365
|
+
return 'Pino';
|
|
2366
|
+
},
|
|
2482
2367
|
[lsCacheSym]: initialLsCache,
|
|
2483
2368
|
[writeSym]: write,
|
|
2484
2369
|
[asJsonSym]: asJson,
|
|
@@ -2492,10 +2377,15 @@ var __webpack_modules__ = {
|
|
|
2492
2377
|
const resetChildingsFormatter = (bindings)=>bindings;
|
|
2493
2378
|
function child(bindings, options) {
|
|
2494
2379
|
if (!bindings) throw Error('missing bindings for child Pino');
|
|
2495
|
-
options = options || {};
|
|
2496
2380
|
const serializers = this[serializersSym];
|
|
2497
2381
|
const formatters = this[formattersSym];
|
|
2498
2382
|
const instance = Object.create(this);
|
|
2383
|
+
if (null == options) {
|
|
2384
|
+
if (instance[formattersSym].bindings !== resetChildingsFormatter) instance[formattersSym] = buildFormatters(formatters.level, resetChildingsFormatter, formatters.log);
|
|
2385
|
+
instance[chindingsSym] = asChindings(instance, bindings);
|
|
2386
|
+
if (this.onChild !== noop) this.onChild(instance);
|
|
2387
|
+
return instance;
|
|
2388
|
+
}
|
|
2499
2389
|
if (true === options.hasOwnProperty('serializers')) {
|
|
2500
2390
|
instance[serializersSym] = Object.create(null);
|
|
2501
2391
|
for(const k in serializers)instance[serializersSym][k] = serializers[k];
|
|
@@ -2532,8 +2422,10 @@ var __webpack_modules__ = {
|
|
|
2532
2422
|
}
|
|
2533
2423
|
if ('string' == typeof options.msgPrefix) instance[msgPrefixSym] = (this[msgPrefixSym] || '') + options.msgPrefix;
|
|
2534
2424
|
instance[chindingsSym] = asChindings(instance, bindings);
|
|
2535
|
-
|
|
2536
|
-
|
|
2425
|
+
if (void 0 !== options.level && options.level !== this.level || options.hasOwnProperty('customLevels')) {
|
|
2426
|
+
const childLevel = options.level || this.level;
|
|
2427
|
+
instance[setLevelSym](childLevel);
|
|
2428
|
+
}
|
|
2537
2429
|
this.onChild(instance);
|
|
2538
2430
|
return instance;
|
|
2539
2431
|
}
|
|
@@ -2548,7 +2440,6 @@ var __webpack_modules__ = {
|
|
|
2548
2440
|
function setBindings(newBindings) {
|
|
2549
2441
|
const chindings = asChindings(this, newBindings);
|
|
2550
2442
|
this[chindingsSym] = chindings;
|
|
2551
|
-
delete this[parsedChindingsSym];
|
|
2552
2443
|
}
|
|
2553
2444
|
function defaultMixinMergeStrategy(mergeObject, mixinObject) {
|
|
2554
2445
|
return Object.assign(mixinObject, mergeObject);
|
|
@@ -2583,7 +2474,6 @@ var __webpack_modules__ = {
|
|
|
2583
2474
|
}
|
|
2584
2475
|
stream.write(streamWriteHook ? streamWriteHook(s) : s);
|
|
2585
2476
|
}
|
|
2586
|
-
function noop() {}
|
|
2587
2477
|
function flush(cb) {
|
|
2588
2478
|
if (null != cb && 'function' != typeof cb) throw Error('callback must be a function');
|
|
2589
2479
|
const stream = this[streamSym];
|
|
@@ -2591,19 +2481,15 @@ var __webpack_modules__ = {
|
|
|
2591
2481
|
else if (cb) cb();
|
|
2592
2482
|
}
|
|
2593
2483
|
},
|
|
2594
|
-
"../../node_modules/.pnpm/pino@
|
|
2484
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/redaction.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2595
2485
|
"use strict";
|
|
2596
|
-
const
|
|
2597
|
-
const { redactFmtSym, wildcardFirstSym } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2598
|
-
const
|
|
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
|
-
});
|
|
2486
|
+
const Redact = __webpack_require__("../../node_modules/.pnpm/@pinojs+redact@0.4.0/node_modules/@pinojs/redact/index.js");
|
|
2487
|
+
const { redactFmtSym, wildcardFirstSym } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
|
|
2488
|
+
const rx = /[^.[\]]+|\[([^[\]]*?)\]/g;
|
|
2603
2489
|
const CENSOR = '[Redacted]';
|
|
2604
2490
|
const strict = false;
|
|
2605
2491
|
function redaction(opts, serialize) {
|
|
2606
|
-
const { paths, censor } = handle(opts);
|
|
2492
|
+
const { paths, censor, remove } = handle(opts);
|
|
2607
2493
|
const shape = paths.reduce((o, str)=>{
|
|
2608
2494
|
rx.lastIndex = 0;
|
|
2609
2495
|
const first = rx.exec(str);
|
|
@@ -2626,11 +2512,12 @@ var __webpack_modules__ = {
|
|
|
2626
2512
|
return o;
|
|
2627
2513
|
}, {});
|
|
2628
2514
|
const result = {
|
|
2629
|
-
[redactFmtSym]:
|
|
2515
|
+
[redactFmtSym]: Redact({
|
|
2630
2516
|
paths,
|
|
2631
2517
|
censor,
|
|
2632
2518
|
serialize,
|
|
2633
|
-
strict
|
|
2519
|
+
strict,
|
|
2520
|
+
remove
|
|
2634
2521
|
})
|
|
2635
2522
|
};
|
|
2636
2523
|
const topCensor = (...args)=>'function' == typeof censor ? serialize(censor(...args)) : serialize(censor);
|
|
@@ -2646,11 +2533,12 @@ var __webpack_modules__ = {
|
|
|
2646
2533
|
k,
|
|
2647
2534
|
...path
|
|
2648
2535
|
]) : censor;
|
|
2649
|
-
o[k] =
|
|
2536
|
+
o[k] = Redact({
|
|
2650
2537
|
paths: shape[k],
|
|
2651
2538
|
censor: wrappedCensor,
|
|
2652
2539
|
serialize,
|
|
2653
|
-
strict
|
|
2540
|
+
strict,
|
|
2541
|
+
remove
|
|
2654
2542
|
});
|
|
2655
2543
|
}
|
|
2656
2544
|
return o;
|
|
@@ -2662,24 +2550,20 @@ var __webpack_modules__ = {
|
|
|
2662
2550
|
paths: opts,
|
|
2663
2551
|
censor: CENSOR
|
|
2664
2552
|
};
|
|
2665
|
-
validate(opts);
|
|
2666
2553
|
return opts;
|
|
2667
2554
|
}
|
|
2668
2555
|
let { paths, censor = CENSOR, remove } = opts;
|
|
2669
2556
|
if (false === Array.isArray(paths)) throw Error('pino – redact must contain an array of strings');
|
|
2670
2557
|
if (true === remove) censor = void 0;
|
|
2671
|
-
validate({
|
|
2672
|
-
paths,
|
|
2673
|
-
censor
|
|
2674
|
-
});
|
|
2675
2558
|
return {
|
|
2676
2559
|
paths,
|
|
2677
|
-
censor
|
|
2560
|
+
censor,
|
|
2561
|
+
remove
|
|
2678
2562
|
};
|
|
2679
2563
|
}
|
|
2680
2564
|
module1.exports = redaction;
|
|
2681
2565
|
},
|
|
2682
|
-
"../../node_modules/.pnpm/pino@
|
|
2566
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js": function(module1) {
|
|
2683
2567
|
"use strict";
|
|
2684
2568
|
const setLevelSym = Symbol('pino.setLevel');
|
|
2685
2569
|
const getLevelSym = Symbol('pino.getLevel');
|
|
@@ -2746,28 +2630,50 @@ var __webpack_modules__ = {
|
|
|
2746
2630
|
msgPrefixSym
|
|
2747
2631
|
};
|
|
2748
2632
|
},
|
|
2749
|
-
"../../node_modules/.pnpm/pino@
|
|
2633
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/time.js": function(module1) {
|
|
2750
2634
|
"use strict";
|
|
2751
2635
|
const nullTime = ()=>'';
|
|
2752
2636
|
const epochTime = ()=>`,"time":${Date.now()}`;
|
|
2753
2637
|
const unixTime = ()=>`,"time":${Math.round(Date.now() / 1000.0)}`;
|
|
2754
2638
|
const isoTime = ()=>`,"time":"${new Date(Date.now()).toISOString()}"`;
|
|
2639
|
+
const NS_PER_MS = 1000000n;
|
|
2640
|
+
const NS_PER_SEC = 1000000000n;
|
|
2641
|
+
const startWallTimeNs = BigInt(Date.now()) * NS_PER_MS;
|
|
2642
|
+
const startHrTime = process.hrtime.bigint();
|
|
2643
|
+
const isoTimeNano = ()=>{
|
|
2644
|
+
const elapsedNs = process.hrtime.bigint() - startHrTime;
|
|
2645
|
+
const currentTimeNs = startWallTimeNs + elapsedNs;
|
|
2646
|
+
const secondsSinceEpoch = currentTimeNs / NS_PER_SEC;
|
|
2647
|
+
const nanosWithinSecond = currentTimeNs % NS_PER_SEC;
|
|
2648
|
+
const msSinceEpoch = Number(1000n * secondsSinceEpoch + nanosWithinSecond / 1000000n);
|
|
2649
|
+
const date = new Date(msSinceEpoch);
|
|
2650
|
+
const year = date.getUTCFullYear();
|
|
2651
|
+
const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');
|
|
2652
|
+
const day = date.getUTCDate().toString().padStart(2, '0');
|
|
2653
|
+
const hours = date.getUTCHours().toString().padStart(2, '0');
|
|
2654
|
+
const minutes = date.getUTCMinutes().toString().padStart(2, '0');
|
|
2655
|
+
const seconds = date.getUTCSeconds().toString().padStart(2, '0');
|
|
2656
|
+
return `,"time":"${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${nanosWithinSecond.toString().padStart(9, '0')}Z"`;
|
|
2657
|
+
};
|
|
2755
2658
|
module1.exports = {
|
|
2756
2659
|
nullTime,
|
|
2757
2660
|
epochTime,
|
|
2758
2661
|
unixTime,
|
|
2759
|
-
isoTime
|
|
2662
|
+
isoTime,
|
|
2663
|
+
isoTimeNano
|
|
2760
2664
|
};
|
|
2761
2665
|
},
|
|
2762
|
-
"../../node_modules/.pnpm/pino@
|
|
2666
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/tools.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
2763
2667
|
"use strict";
|
|
2668
|
+
const diagChan = __webpack_require__("node:diagnostics_channel");
|
|
2764
2669
|
const format = __webpack_require__("../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js");
|
|
2765
2670
|
const { mapHttpRequest, mapHttpResponse } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/index.js");
|
|
2766
2671
|
const SonicBoom = __webpack_require__("../../node_modules/.pnpm/sonic-boom@4.2.0/node_modules/sonic-boom/index.js");
|
|
2767
2672
|
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@
|
|
2673
|
+
const { lsCacheSym, chindingsSym, writeSym, serializersSym, formatOptsSym, endSym, stringifiersSym, stringifySym, stringifySafeSym, wildcardFirstSym, nestedKeySym, formattersSym, messageKeySym, errorKeySym, nestedKeyStrSym, msgPrefixSym } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
|
|
2769
2674
|
const { isMainThread } = __webpack_require__("worker_threads");
|
|
2770
|
-
const transport = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2675
|
+
const transport = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/transport.js");
|
|
2676
|
+
const asJsonChan = diagChan.tracingChannel('pino_asJson');
|
|
2771
2677
|
function noop() {}
|
|
2772
2678
|
function genLog(level, hook) {
|
|
2773
2679
|
if (!hook) return LOG;
|
|
@@ -2818,6 +2724,14 @@ var __webpack_modules__ = {
|
|
|
2818
2724
|
return point < 32 ? JSON.stringify(str) : '"' + result + '"';
|
|
2819
2725
|
}
|
|
2820
2726
|
function asJson(obj, msg, num, time) {
|
|
2727
|
+
if (false === asJsonChan.hasSubscribers) return _asJson.call(this, obj, msg, num, time);
|
|
2728
|
+
const store = {
|
|
2729
|
+
instance: this,
|
|
2730
|
+
arguments
|
|
2731
|
+
};
|
|
2732
|
+
return asJsonChan.traceSync(_asJson, store, this, obj, msg, num, time);
|
|
2733
|
+
}
|
|
2734
|
+
function _asJson(obj, msg, num, time) {
|
|
2821
2735
|
const stringify = this[stringifySym];
|
|
2822
2736
|
const stringifySafe = this[stringifySafeSym];
|
|
2823
2737
|
const stringifiers = this[stringifiersSym];
|
|
@@ -2896,7 +2810,7 @@ var __webpack_modules__ = {
|
|
|
2896
2810
|
bindings = formatter(bindings);
|
|
2897
2811
|
for(const key in bindings){
|
|
2898
2812
|
value = bindings[key];
|
|
2899
|
-
const valid = 'level' !== key && 'serializers' !== key && 'formatters' !== key && 'customLevels' !== key && bindings.hasOwnProperty(key) && void 0 !== value;
|
|
2813
|
+
const valid = (key.length < 5 || 'level' !== key && 'serializers' !== key && 'formatters' !== key && 'customLevels' !== key) && bindings.hasOwnProperty(key) && void 0 !== value;
|
|
2900
2814
|
if (true === valid) {
|
|
2901
2815
|
value = serializers[key] ? serializers[key](value) : value;
|
|
2902
2816
|
value = (stringifiers[key] || wildcardStringifier || stringify)(value, stringifySafe);
|
|
@@ -3019,7 +2933,7 @@ var __webpack_modules__ = {
|
|
|
3019
2933
|
normalizeDestFileDescriptor
|
|
3020
2934
|
};
|
|
3021
2935
|
},
|
|
3022
|
-
"../../node_modules/.pnpm/pino@
|
|
2936
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/transport-stream.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
3023
2937
|
"use strict";
|
|
3024
2938
|
const { realImport, realRequire } = __webpack_require__("../../node_modules/.pnpm/real-require@0.2.0/node_modules/real-require/src/index.js");
|
|
3025
2939
|
module1.exports = loadTransportStreamBuilder;
|
|
@@ -3047,10 +2961,10 @@ var __webpack_modules__ = {
|
|
|
3047
2961
|
return fn;
|
|
3048
2962
|
}
|
|
3049
2963
|
},
|
|
3050
|
-
"../../node_modules/.pnpm/pino@
|
|
2964
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/transport.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
3051
2965
|
"use strict";
|
|
3052
2966
|
const { createRequire } = __webpack_require__("module");
|
|
3053
|
-
const getCallers = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
2967
|
+
const getCallers = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/caller.js");
|
|
3054
2968
|
const { join, isAbsolute, sep } = __webpack_require__("node:path");
|
|
3055
2969
|
const sleep = __webpack_require__("../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js");
|
|
3056
2970
|
const onExit = __webpack_require__("../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js");
|
|
@@ -3151,20 +3065,20 @@ var __webpack_modules__ = {
|
|
|
3151
3065
|
}
|
|
3152
3066
|
module1.exports = transport;
|
|
3153
3067
|
},
|
|
3154
|
-
"../../node_modules/.pnpm/pino@
|
|
3068
|
+
"../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/pino.js": function(module1, __unused_webpack_exports, __webpack_require__) {
|
|
3155
3069
|
"use strict";
|
|
3156
3070
|
const os = __webpack_require__("node:os");
|
|
3157
3071
|
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@
|
|
3159
|
-
const redaction = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3160
|
-
const time = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3161
|
-
const proto = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3162
|
-
const symbols = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3072
|
+
const caller = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/caller.js");
|
|
3073
|
+
const redaction = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/redaction.js");
|
|
3074
|
+
const time = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/time.js");
|
|
3075
|
+
const proto = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/proto.js");
|
|
3076
|
+
const symbols = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
|
|
3163
3077
|
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@
|
|
3165
|
-
const { DEFAULT_LEVELS, SORTING_ORDER } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3166
|
-
const { createArgsNormalizer, asChindings, buildSafeSonicBoom, buildFormatters, stringify, normalizeDestFileDescriptor, noop } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3167
|
-
const { version } = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3078
|
+
const { assertDefaultLevelFound, mappings, genLsCache, genLevelComparison, assertLevelComparison } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/levels.js");
|
|
3079
|
+
const { DEFAULT_LEVELS, SORTING_ORDER } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/constants.js");
|
|
3080
|
+
const { createArgsNormalizer, asChindings, buildSafeSonicBoom, buildFormatters, stringify, normalizeDestFileDescriptor, noop } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/tools.js");
|
|
3081
|
+
const { version } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/meta.js");
|
|
3168
3082
|
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
3083
|
const { epochTime, nullTime } = time;
|
|
3170
3084
|
const { pid } = process;
|
|
@@ -3298,8 +3212,8 @@ var __webpack_modules__ = {
|
|
|
3298
3212
|
dest.dest = normalizeDestFileDescriptor(dest.dest || process.stdout.fd);
|
|
3299
3213
|
return buildSafeSonicBoom(dest);
|
|
3300
3214
|
};
|
|
3301
|
-
module1.exports.transport = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3302
|
-
module1.exports.multistream = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3215
|
+
module1.exports.transport = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/transport.js");
|
|
3216
|
+
module1.exports.multistream = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/multistream.js");
|
|
3303
3217
|
module1.exports.levels = mappings();
|
|
3304
3218
|
module1.exports.stdSerializers = serializers;
|
|
3305
3219
|
module1.exports.stdTimeFunctions = Object.assign({}, time);
|
|
@@ -3733,89 +3647,6 @@ var __webpack_modules__ = {
|
|
|
3733
3647
|
SonicBoom.default = SonicBoom;
|
|
3734
3648
|
module1.exports = SonicBoom;
|
|
3735
3649
|
},
|
|
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
3650
|
"../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/package.json": function(module1) {
|
|
3820
3651
|
"use strict";
|
|
3821
3652
|
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"}');
|
|
@@ -3831,5 +3662,5 @@ function __webpack_require__(moduleId) {
|
|
|
3831
3662
|
__webpack_modules__[moduleId](module1, module1.exports, __webpack_require__);
|
|
3832
3663
|
return module1.exports;
|
|
3833
3664
|
}
|
|
3834
|
-
var __webpack_exports__ = __webpack_require__("../../node_modules/.pnpm/pino@
|
|
3665
|
+
var __webpack_exports__ = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/worker.js");
|
|
3835
3666
|
module.exports = __webpack_exports__;
|