@agentdocumentformat/cli 0.7.2
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/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/adf.mjs +162 -0
- package/dist/chunks/APEv2Parser-2CNNHMXV.mjs +22 -0
- package/dist/chunks/AiffParser-7BR4RL6G.mjs +162 -0
- package/dist/chunks/App-L5L37JI5.mjs +16747 -0
- package/dist/chunks/AsfParser-VVRSLFOM.mjs +538 -0
- package/dist/chunks/DsdiffParser-CMD4AX7A.mjs +156 -0
- package/dist/chunks/DsfParser-UOGZDS2M.mjs +94 -0
- package/dist/chunks/FlacParser-HB3T3CD4.mjs +23 -0
- package/dist/chunks/MP4Parser-66HBRUSX.mjs +973 -0
- package/dist/chunks/MatroskaParser-J3HUIMEW.mjs +579 -0
- package/dist/chunks/MpegParser-YW6LIUEW.mjs +442 -0
- package/dist/chunks/MusepackParser-PAUSXP7D.mjs +252 -0
- package/dist/chunks/OggParser-NUBV3GWC.mjs +359 -0
- package/dist/chunks/WavPackParser-WQAGT7TC.mjs +171 -0
- package/dist/chunks/WaveParser-EWLQVDX4.mjs +238 -0
- package/dist/chunks/adf-schema-JRU2BTOG.mjs +62 -0
- package/dist/chunks/build-QF5W473T.mjs +60 -0
- package/dist/chunks/chatgpt-subscription-BQGWYZXE.mjs +23 -0
- package/dist/chunks/chunk-2DIECGFL.mjs +6 -0
- package/dist/chunks/chunk-2NAP2ZF7.mjs +60 -0
- package/dist/chunks/chunk-3AT7IIP7.mjs +25696 -0
- package/dist/chunks/chunk-3GNIDM53.mjs +35 -0
- package/dist/chunks/chunk-3M4ZPOA3.mjs +1477 -0
- package/dist/chunks/chunk-4MQPTCXY.mjs +510 -0
- package/dist/chunks/chunk-5PO5PKRV.mjs +366 -0
- package/dist/chunks/chunk-5QU5VY7N.mjs +52 -0
- package/dist/chunks/chunk-5W7KES6P.mjs +436 -0
- package/dist/chunks/chunk-62NE4LG4.mjs +61 -0
- package/dist/chunks/chunk-64OKE4X3.mjs +45 -0
- package/dist/chunks/chunk-6GJ4QHRI.mjs +1278 -0
- package/dist/chunks/chunk-6VQEXLE2.mjs +144 -0
- package/dist/chunks/chunk-6XUV6EK6.mjs +41 -0
- package/dist/chunks/chunk-776TSXEP.mjs +43 -0
- package/dist/chunks/chunk-7CV2SA3H.mjs +285 -0
- package/dist/chunks/chunk-7MTRVW2U.mjs +3103 -0
- package/dist/chunks/chunk-7N2R2VCG.mjs +1434 -0
- package/dist/chunks/chunk-7T2YMTWL.mjs +374 -0
- package/dist/chunks/chunk-7XYNI52E.mjs +149 -0
- package/dist/chunks/chunk-APHX6HSV.mjs +7731 -0
- package/dist/chunks/chunk-APRU6PHC.mjs +40 -0
- package/dist/chunks/chunk-AUYKRQPJ.mjs +499 -0
- package/dist/chunks/chunk-DXWDD5XJ.mjs +136 -0
- package/dist/chunks/chunk-EWL5FG4I.mjs +39 -0
- package/dist/chunks/chunk-EYX2YLJW.mjs +117 -0
- package/dist/chunks/chunk-F5ELW46V.mjs +27 -0
- package/dist/chunks/chunk-G426FACA.mjs +49 -0
- package/dist/chunks/chunk-GEKSJHIV.mjs +2472 -0
- package/dist/chunks/chunk-HBUENVQL.mjs +570 -0
- package/dist/chunks/chunk-HPVFJYXR.mjs +112 -0
- package/dist/chunks/chunk-HWLWPXQ7.mjs +721 -0
- package/dist/chunks/chunk-I2HJYHFT.mjs +665 -0
- package/dist/chunks/chunk-I3UYSITV.mjs +68 -0
- package/dist/chunks/chunk-IC4JDZCI.mjs +3864 -0
- package/dist/chunks/chunk-IHDDCZBS.mjs +112 -0
- package/dist/chunks/chunk-IIGMZHQQ.mjs +10416 -0
- package/dist/chunks/chunk-KWFOS5WC.mjs +41 -0
- package/dist/chunks/chunk-LAZIXV2F.mjs +5290 -0
- package/dist/chunks/chunk-LFMB4PAA.mjs +10814 -0
- package/dist/chunks/chunk-M2RX3S2T.mjs +49 -0
- package/dist/chunks/chunk-M3WPIJYM.mjs +65 -0
- package/dist/chunks/chunk-NBTUWMGP.mjs +263 -0
- package/dist/chunks/chunk-NGK6PVSF.mjs +2676 -0
- package/dist/chunks/chunk-NZ7JTHEO.mjs +85 -0
- package/dist/chunks/chunk-OQN33RGQ.mjs +52 -0
- package/dist/chunks/chunk-RIX34QHC.mjs +2935 -0
- package/dist/chunks/chunk-SGUTYISF.mjs +16 -0
- package/dist/chunks/chunk-SLJ5L7PY.mjs +1473 -0
- package/dist/chunks/chunk-SLUKGXKH.mjs +68 -0
- package/dist/chunks/chunk-TMT32MXT.mjs +419 -0
- package/dist/chunks/chunk-UYY5M2PB.mjs +151 -0
- package/dist/chunks/chunk-VAUOM3IN.mjs +298 -0
- package/dist/chunks/chunk-VMHTYDH4.mjs +172 -0
- package/dist/chunks/chunk-VZS54AA5.mjs +200 -0
- package/dist/chunks/chunk-WFQUVXML.mjs +295 -0
- package/dist/chunks/chunk-X34PDRUH.mjs +809 -0
- package/dist/chunks/chunk-XNPZBLYL.mjs +33 -0
- package/dist/chunks/chunk-XX7OSWTO.mjs +157 -0
- package/dist/chunks/chunk-XYTWGHFS.mjs +600 -0
- package/dist/chunks/chunk-XYV3VCIX.mjs +336 -0
- package/dist/chunks/chunk-Y5ZLKFLE.mjs +1469 -0
- package/dist/chunks/chunk-ZJKXHM4Q.mjs +230 -0
- package/dist/chunks/cli-TCMBNZF6.mjs +1030 -0
- package/dist/chunks/commands-DTEKM4ZL.mjs +20 -0
- package/dist/chunks/daemon-ZC3FZ2P4.mjs +112449 -0
- package/dist/chunks/daemon-control-WDX7PMTC.mjs +300 -0
- package/dist/chunks/daemon-token-WRSULP7G.mjs +23 -0
- package/dist/chunks/devtools-H7CI2ZVG.mjs +85 -0
- package/dist/chunks/discord-IWDQJA7A.mjs +70588 -0
- package/dist/chunks/dist-C57KYFS2.mjs +4952 -0
- package/dist/chunks/dist-I3XBAGDL.mjs +11 -0
- package/dist/chunks/email-V4Q4VJON.mjs +58679 -0
- package/dist/chunks/environment-NX277MQG.mjs +15 -0
- package/dist/chunks/grok-subscription-4PYX7TBF.mjs +19 -0
- package/dist/chunks/layout-EPJQNFAI.mjs +22 -0
- package/dist/chunks/lib-N7FCZWKH.mjs +4038 -0
- package/dist/chunks/open-OTQDGDH5.mjs +36 -0
- package/dist/chunks/parser-JVY2PWSM.mjs +19 -0
- package/dist/chunks/pipeline-executor-BHBSJX2K.mjs +19 -0
- package/dist/chunks/react-IUIDQ5LX.mjs +11 -0
- package/dist/chunks/screen-54BUTYCW.mjs +27 -0
- package/dist/chunks/slack-3L5QTDZX.mjs +8113 -0
- package/dist/chunks/store-WR7TZJZS.mjs +32 -0
- package/dist/chunks/telegram-5ISVFBV3.mjs +14918 -0
- package/dist/chunks/terminal-O5WO7C5U.mjs +48 -0
- package/dist/chunks/theme-NORU4J74.mjs +20 -0
- package/dist/chunks/themes-F2FKU7CP.mjs +23 -0
- package/dist/chunks/token-6G3HCMNX.mjs +54 -0
- package/dist/chunks/token-util-UXYSDQIW.mjs +12 -0
- package/dist/chunks/tui-ODVYUIMT.mjs +197 -0
- package/dist/chunks/welcome-XHXFV7SH.mjs +32 -0
- package/dist/chunks/whatsapp-XSAMNGPJ.mjs +85412 -0
- package/dist/chunks/xterm-headless-YF53XWXE.mjs +3353 -0
- package/package.json +53 -0
- package/resources/wasm/coreutils.LICENSE +18 -0
- package/resources/wasm/coreutils.wasm +0 -0
|
@@ -0,0 +1,1473 @@
|
|
|
1
|
+
import { createRequire as __adfCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __adfFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __adfDirname } from 'node:path';
|
|
4
|
+
const require = __adfCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __adfFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __adfDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
require_atomic_sleep,
|
|
9
|
+
require_on_exit_leak_free,
|
|
10
|
+
require_pino_std_serializers,
|
|
11
|
+
require_quick_format_unescaped,
|
|
12
|
+
require_redact,
|
|
13
|
+
require_safe_stable_stringify,
|
|
14
|
+
require_sonic_boom
|
|
15
|
+
} from "./chunk-7N2R2VCG.mjs";
|
|
16
|
+
import {
|
|
17
|
+
__commonJS,
|
|
18
|
+
__require
|
|
19
|
+
} from "./chunk-M2RX3S2T.mjs";
|
|
20
|
+
|
|
21
|
+
// node_modules/pino/lib/caller.js
|
|
22
|
+
var require_caller = __commonJS({
|
|
23
|
+
"node_modules/pino/lib/caller.js"(exports, module) {
|
|
24
|
+
"use strict";
|
|
25
|
+
function noOpPrepareStackTrace(_, stack) {
|
|
26
|
+
return stack;
|
|
27
|
+
}
|
|
28
|
+
module.exports = function() {
|
|
29
|
+
let originalPrepare = Error.prepareStackTrace;
|
|
30
|
+
Error.prepareStackTrace = noOpPrepareStackTrace;
|
|
31
|
+
let stack = new Error().stack;
|
|
32
|
+
if (Error.prepareStackTrace = originalPrepare, !Array.isArray(stack))
|
|
33
|
+
return;
|
|
34
|
+
let entries = stack.slice(2), fileNames = [];
|
|
35
|
+
for (let entry of entries)
|
|
36
|
+
entry && fileNames.push(entry.getFileName());
|
|
37
|
+
return fileNames;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// node_modules/pino/lib/symbols.js
|
|
43
|
+
var require_symbols = __commonJS({
|
|
44
|
+
"node_modules/pino/lib/symbols.js"(exports, module) {
|
|
45
|
+
"use strict";
|
|
46
|
+
var setLevelSym = /* @__PURE__ */ Symbol("pino.setLevel"), getLevelSym = /* @__PURE__ */ Symbol("pino.getLevel"), levelValSym = /* @__PURE__ */ Symbol("pino.levelVal"), levelCompSym = /* @__PURE__ */ Symbol("pino.levelComp"), useLevelLabelsSym = /* @__PURE__ */ Symbol("pino.useLevelLabels"), useOnlyCustomLevelsSym = /* @__PURE__ */ Symbol("pino.useOnlyCustomLevels"), mixinSym = /* @__PURE__ */ Symbol("pino.mixin"), lsCacheSym = /* @__PURE__ */ Symbol("pino.lsCache"), chindingsSym = /* @__PURE__ */ Symbol("pino.chindings"), asJsonSym = /* @__PURE__ */ Symbol("pino.asJson"), writeSym = /* @__PURE__ */ Symbol("pino.write"), redactFmtSym = /* @__PURE__ */ Symbol("pino.redactFmt"), timeSym = /* @__PURE__ */ Symbol("pino.time"), timeSliceIndexSym = /* @__PURE__ */ Symbol("pino.timeSliceIndex"), streamSym = /* @__PURE__ */ Symbol("pino.stream"), stringifySym = /* @__PURE__ */ Symbol("pino.stringify"), stringifySafeSym = /* @__PURE__ */ Symbol("pino.stringifySafe"), stringifiersSym = /* @__PURE__ */ Symbol("pino.stringifiers"), endSym = /* @__PURE__ */ Symbol("pino.end"), formatOptsSym = /* @__PURE__ */ Symbol("pino.formatOpts"), messageKeySym = /* @__PURE__ */ Symbol("pino.messageKey"), errorKeySym = /* @__PURE__ */ Symbol("pino.errorKey"), nestedKeySym = /* @__PURE__ */ Symbol("pino.nestedKey"), nestedKeyStrSym = /* @__PURE__ */ Symbol("pino.nestedKeyStr"), mixinMergeStrategySym = /* @__PURE__ */ Symbol("pino.mixinMergeStrategy"), msgPrefixSym = /* @__PURE__ */ Symbol("pino.msgPrefix"), wildcardFirstSym = /* @__PURE__ */ Symbol("pino.wildcardFirst"), serializersSym = /* @__PURE__ */ Symbol.for("pino.serializers"), formattersSym = /* @__PURE__ */ Symbol.for("pino.formatters"), hooksSym = /* @__PURE__ */ Symbol.for("pino.hooks"), needsMetadataGsym = /* @__PURE__ */ Symbol.for("pino.metadata");
|
|
47
|
+
module.exports = {
|
|
48
|
+
setLevelSym,
|
|
49
|
+
getLevelSym,
|
|
50
|
+
levelValSym,
|
|
51
|
+
levelCompSym,
|
|
52
|
+
useLevelLabelsSym,
|
|
53
|
+
mixinSym,
|
|
54
|
+
lsCacheSym,
|
|
55
|
+
chindingsSym,
|
|
56
|
+
asJsonSym,
|
|
57
|
+
writeSym,
|
|
58
|
+
serializersSym,
|
|
59
|
+
redactFmtSym,
|
|
60
|
+
timeSym,
|
|
61
|
+
timeSliceIndexSym,
|
|
62
|
+
streamSym,
|
|
63
|
+
stringifySym,
|
|
64
|
+
stringifySafeSym,
|
|
65
|
+
stringifiersSym,
|
|
66
|
+
endSym,
|
|
67
|
+
formatOptsSym,
|
|
68
|
+
messageKeySym,
|
|
69
|
+
errorKeySym,
|
|
70
|
+
nestedKeySym,
|
|
71
|
+
wildcardFirstSym,
|
|
72
|
+
needsMetadataGsym,
|
|
73
|
+
useOnlyCustomLevelsSym,
|
|
74
|
+
formattersSym,
|
|
75
|
+
hooksSym,
|
|
76
|
+
nestedKeyStrSym,
|
|
77
|
+
mixinMergeStrategySym,
|
|
78
|
+
msgPrefixSym
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// node_modules/pino/lib/redaction.js
|
|
84
|
+
var require_redaction = __commonJS({
|
|
85
|
+
"node_modules/pino/lib/redaction.js"(exports, module) {
|
|
86
|
+
"use strict";
|
|
87
|
+
var Redact = require_redact(), { redactFmtSym, wildcardFirstSym } = require_symbols(), rx = /[^.[\]]+|\[([^[\]]*?)\]/g, CENSOR = "[Redacted]", strict = !1;
|
|
88
|
+
function redaction(opts, serialize) {
|
|
89
|
+
let { paths, censor, remove } = handle(opts), shape = paths.reduce((o, str) => {
|
|
90
|
+
rx.lastIndex = 0;
|
|
91
|
+
let first = rx.exec(str), next = rx.exec(str), ns = first[1] !== void 0 ? first[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/, "$1") : first[0];
|
|
92
|
+
if (ns === "*" && (ns = wildcardFirstSym), next === null)
|
|
93
|
+
return o[ns] = null, o;
|
|
94
|
+
if (o[ns] === null)
|
|
95
|
+
return o;
|
|
96
|
+
let { index } = next, nextPath = `${str.substr(index, str.length - 1)}`;
|
|
97
|
+
return o[ns] = o[ns] || [], ns !== wildcardFirstSym && o[ns].length === 0 && o[ns].push(...o[wildcardFirstSym] || []), ns === wildcardFirstSym && Object.keys(o).forEach(function(k) {
|
|
98
|
+
o[k] && o[k].push(nextPath);
|
|
99
|
+
}), o[ns].push(nextPath), o;
|
|
100
|
+
}, {}), result = {
|
|
101
|
+
[redactFmtSym]: Redact({ paths, censor, serialize, strict, remove })
|
|
102
|
+
}, topCensor = (...args) => serialize(typeof censor == "function" ? censor(...args) : censor);
|
|
103
|
+
return [...Object.keys(shape), ...Object.getOwnPropertySymbols(shape)].reduce((o, k) => {
|
|
104
|
+
if (shape[k] === null)
|
|
105
|
+
o[k] = (value) => topCensor(value, [k]);
|
|
106
|
+
else {
|
|
107
|
+
let wrappedCensor = typeof censor == "function" ? (value, path) => censor(value, [k, ...path]) : censor;
|
|
108
|
+
o[k] = Redact({
|
|
109
|
+
paths: shape[k],
|
|
110
|
+
censor: wrappedCensor,
|
|
111
|
+
serialize,
|
|
112
|
+
strict,
|
|
113
|
+
remove
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return o;
|
|
117
|
+
}, result);
|
|
118
|
+
}
|
|
119
|
+
function handle(opts) {
|
|
120
|
+
if (Array.isArray(opts))
|
|
121
|
+
return opts = { paths: opts, censor: CENSOR }, opts;
|
|
122
|
+
let { paths, censor = CENSOR, remove } = opts;
|
|
123
|
+
if (Array.isArray(paths) === !1)
|
|
124
|
+
throw Error("pino \u2013 redact must contain an array of strings");
|
|
125
|
+
return remove === !0 && (censor = void 0), { paths, censor, remove };
|
|
126
|
+
}
|
|
127
|
+
module.exports = redaction;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// node_modules/pino/lib/time.js
|
|
132
|
+
var require_time = __commonJS({
|
|
133
|
+
"node_modules/pino/lib/time.js"(exports, module) {
|
|
134
|
+
"use strict";
|
|
135
|
+
var nullTime = () => "", epochTime = () => `,"time":${Date.now()}`, unixTime = () => `,"time":${Math.round(Date.now() / 1e3)}`, isoTime = () => `,"time":"${new Date(Date.now()).toISOString()}"`, NS_PER_MS = 1000000n, NS_PER_SEC = 1000000000n, startWallTimeNs = BigInt(Date.now()) * NS_PER_MS, startHrTime = process.hrtime.bigint(), isoTimeNano = () => {
|
|
136
|
+
let elapsedNs = process.hrtime.bigint() - startHrTime, currentTimeNs = startWallTimeNs + elapsedNs, secondsSinceEpoch = currentTimeNs / NS_PER_SEC, nanosWithinSecond = currentTimeNs % NS_PER_SEC, msSinceEpoch = Number(secondsSinceEpoch * 1000n + nanosWithinSecond / 1000000n), date = new Date(msSinceEpoch), year = date.getUTCFullYear(), month = (date.getUTCMonth() + 1).toString().padStart(2, "0"), day = date.getUTCDate().toString().padStart(2, "0"), hours = date.getUTCHours().toString().padStart(2, "0"), minutes = date.getUTCMinutes().toString().padStart(2, "0"), seconds = date.getUTCSeconds().toString().padStart(2, "0");
|
|
137
|
+
return `,"time":"${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${nanosWithinSecond.toString().padStart(9, "0")}Z"`;
|
|
138
|
+
};
|
|
139
|
+
module.exports = { nullTime, epochTime, unixTime, isoTime, isoTimeNano };
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// node_modules/thread-stream/package.json
|
|
144
|
+
var require_package = __commonJS({
|
|
145
|
+
"node_modules/thread-stream/package.json"(exports, module) {
|
|
146
|
+
module.exports = {
|
|
147
|
+
name: "thread-stream",
|
|
148
|
+
version: "4.0.0",
|
|
149
|
+
description: "A streaming way to send data to a Node.js Worker Thread",
|
|
150
|
+
main: "index.js",
|
|
151
|
+
types: "index.d.ts",
|
|
152
|
+
engines: {
|
|
153
|
+
node: ">=20"
|
|
154
|
+
},
|
|
155
|
+
dependencies: {
|
|
156
|
+
"real-require": "^0.2.0"
|
|
157
|
+
},
|
|
158
|
+
devDependencies: {
|
|
159
|
+
"@types/node": "^22.0.0",
|
|
160
|
+
"@yao-pkg/pkg": "^6.0.0",
|
|
161
|
+
borp: "^0.21.0",
|
|
162
|
+
desm: "^1.3.0",
|
|
163
|
+
eslint: "^9.39.1",
|
|
164
|
+
fastbench: "^1.0.1",
|
|
165
|
+
husky: "^9.0.6",
|
|
166
|
+
neostandard: "^0.12.2",
|
|
167
|
+
"pino-elasticsearch": "^8.0.0",
|
|
168
|
+
"sonic-boom": "^4.0.1",
|
|
169
|
+
"ts-node": "^10.8.0",
|
|
170
|
+
typescript: "~5.7.3"
|
|
171
|
+
},
|
|
172
|
+
scripts: {
|
|
173
|
+
build: "tsc --noEmit",
|
|
174
|
+
lint: "eslint",
|
|
175
|
+
test: "npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'",
|
|
176
|
+
"test:ci": "npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'",
|
|
177
|
+
"test:yarn": "npm run transpile && borp --pattern 'test/*.test.js'",
|
|
178
|
+
transpile: "sh ./test/ts/transpile.sh",
|
|
179
|
+
prepare: "husky install"
|
|
180
|
+
},
|
|
181
|
+
repository: {
|
|
182
|
+
type: "git",
|
|
183
|
+
url: "git+https://github.com/mcollina/thread-stream.git"
|
|
184
|
+
},
|
|
185
|
+
keywords: [
|
|
186
|
+
"worker",
|
|
187
|
+
"thread",
|
|
188
|
+
"threads",
|
|
189
|
+
"stream"
|
|
190
|
+
],
|
|
191
|
+
author: "Matteo Collina <hello@matteocollina.com>",
|
|
192
|
+
license: "MIT",
|
|
193
|
+
bugs: {
|
|
194
|
+
url: "https://github.com/mcollina/thread-stream/issues"
|
|
195
|
+
},
|
|
196
|
+
homepage: "https://github.com/mcollina/thread-stream#readme"
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// node_modules/thread-stream/lib/wait.js
|
|
202
|
+
var require_wait = __commonJS({
|
|
203
|
+
"node_modules/thread-stream/lib/wait.js"(exports, module) {
|
|
204
|
+
"use strict";
|
|
205
|
+
function wait(state, index, expected, timeout, done) {
|
|
206
|
+
let max = timeout === 1 / 0 ? 1 / 0 : Date.now() + timeout, check = () => {
|
|
207
|
+
let current = Atomics.load(state, index);
|
|
208
|
+
if (current === expected) {
|
|
209
|
+
done(null, "ok");
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (max !== 1 / 0 && Date.now() > max) {
|
|
213
|
+
done(null, "timed-out");
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
let remaining = max === 1 / 0 ? 1e4 : Math.min(1e4, Math.max(1, max - Date.now())), result = Atomics.waitAsync(state, index, current, remaining);
|
|
217
|
+
result.async ? result.value.then(check) : setImmediate(check);
|
|
218
|
+
};
|
|
219
|
+
check();
|
|
220
|
+
}
|
|
221
|
+
function waitDiff(state, index, expected, timeout, done) {
|
|
222
|
+
let max = timeout === 1 / 0 ? 1 / 0 : Date.now() + timeout, check = () => {
|
|
223
|
+
if (Atomics.load(state, index) !== expected) {
|
|
224
|
+
done(null, "ok");
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (max !== 1 / 0 && Date.now() > max) {
|
|
228
|
+
done(null, "timed-out");
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
let remaining = max === 1 / 0 ? 1e4 : Math.min(1e4, Math.max(1, max - Date.now())), result = Atomics.waitAsync(state, index, expected, remaining);
|
|
232
|
+
result.async ? result.value.then(check) : setImmediate(check);
|
|
233
|
+
};
|
|
234
|
+
check();
|
|
235
|
+
}
|
|
236
|
+
module.exports = { wait, waitDiff };
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// node_modules/thread-stream/lib/indexes.js
|
|
241
|
+
var require_indexes = __commonJS({
|
|
242
|
+
"node_modules/thread-stream/lib/indexes.js"(exports, module) {
|
|
243
|
+
"use strict";
|
|
244
|
+
module.exports = {
|
|
245
|
+
WRITE_INDEX: 4,
|
|
246
|
+
READ_INDEX: 8
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// node_modules/thread-stream/index.js
|
|
252
|
+
var require_thread_stream = __commonJS({
|
|
253
|
+
"node_modules/thread-stream/index.js"(exports, module) {
|
|
254
|
+
"use strict";
|
|
255
|
+
var { version } = require_package(), { EventEmitter } = __require("events"), { Worker } = __require("worker_threads"), { join } = __require("path"), { pathToFileURL } = __require("url"), { wait } = require_wait(), {
|
|
256
|
+
WRITE_INDEX,
|
|
257
|
+
READ_INDEX
|
|
258
|
+
} = require_indexes(), buffer = __require("buffer"), assert = __require("assert"), kImpl = /* @__PURE__ */ Symbol("kImpl"), MAX_STRING = buffer.constants.MAX_STRING_LENGTH, FakeWeakRef = class {
|
|
259
|
+
constructor(value) {
|
|
260
|
+
this._value = value;
|
|
261
|
+
}
|
|
262
|
+
deref() {
|
|
263
|
+
return this._value;
|
|
264
|
+
}
|
|
265
|
+
}, FakeFinalizationRegistry = class {
|
|
266
|
+
register() {
|
|
267
|
+
}
|
|
268
|
+
unregister() {
|
|
269
|
+
}
|
|
270
|
+
}, FinalizationRegistry = process.env.NODE_V8_COVERAGE ? FakeFinalizationRegistry : global.FinalizationRegistry || FakeFinalizationRegistry, WeakRef = process.env.NODE_V8_COVERAGE ? FakeWeakRef : global.WeakRef || FakeWeakRef, registry = new FinalizationRegistry((worker) => {
|
|
271
|
+
worker.exited || worker.terminate();
|
|
272
|
+
});
|
|
273
|
+
function createWorker(stream, opts) {
|
|
274
|
+
let { filename, workerData } = opts, toExecute = ("__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {})["thread-stream-worker"] || join(__dirname, "lib", "worker.js"), worker = new Worker(toExecute, {
|
|
275
|
+
...opts.workerOpts,
|
|
276
|
+
trackUnmanagedFds: !1,
|
|
277
|
+
workerData: {
|
|
278
|
+
filename: filename.indexOf("file://") === 0 ? filename : pathToFileURL(filename).href,
|
|
279
|
+
dataBuf: stream[kImpl].dataBuf,
|
|
280
|
+
stateBuf: stream[kImpl].stateBuf,
|
|
281
|
+
workerData: {
|
|
282
|
+
$context: {
|
|
283
|
+
threadStreamVersion: version
|
|
284
|
+
},
|
|
285
|
+
...workerData
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
return worker.stream = new FakeWeakRef(stream), worker.on("message", onWorkerMessage), worker.on("exit", onWorkerExit), registry.register(stream, worker), worker;
|
|
290
|
+
}
|
|
291
|
+
function drain(stream) {
|
|
292
|
+
assert(!stream[kImpl].sync), stream[kImpl].needDrain && (stream[kImpl].needDrain = !1, stream.emit("drain"));
|
|
293
|
+
}
|
|
294
|
+
function nextFlush(stream) {
|
|
295
|
+
let writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX), leftover = stream[kImpl].data.length - writeIndex;
|
|
296
|
+
if (leftover > 0) {
|
|
297
|
+
if (stream[kImpl].buf.length === 0) {
|
|
298
|
+
stream[kImpl].flushing = !1, stream[kImpl].ending ? end(stream) : stream[kImpl].needDrain && process.nextTick(drain, stream);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
let toWrite = stream[kImpl].buf.slice(0, leftover), toWriteBytes = Buffer.byteLength(toWrite);
|
|
302
|
+
toWriteBytes <= leftover ? (stream[kImpl].buf = stream[kImpl].buf.slice(leftover), write(stream, toWrite, nextFlush.bind(null, stream))) : stream.flush(() => {
|
|
303
|
+
if (!stream.destroyed) {
|
|
304
|
+
for (Atomics.store(stream[kImpl].state, READ_INDEX, 0), Atomics.store(stream[kImpl].state, WRITE_INDEX, 0), Atomics.notify(stream[kImpl].state, READ_INDEX); toWriteBytes > stream[kImpl].data.length; )
|
|
305
|
+
leftover = leftover / 2, toWrite = stream[kImpl].buf.slice(0, leftover), toWriteBytes = Buffer.byteLength(toWrite);
|
|
306
|
+
stream[kImpl].buf = stream[kImpl].buf.slice(leftover), write(stream, toWrite, nextFlush.bind(null, stream));
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
} else if (leftover === 0) {
|
|
310
|
+
if (writeIndex === 0 && stream[kImpl].buf.length === 0)
|
|
311
|
+
return;
|
|
312
|
+
stream.flush(() => {
|
|
313
|
+
Atomics.store(stream[kImpl].state, READ_INDEX, 0), Atomics.store(stream[kImpl].state, WRITE_INDEX, 0), Atomics.notify(stream[kImpl].state, READ_INDEX), nextFlush(stream);
|
|
314
|
+
});
|
|
315
|
+
} else
|
|
316
|
+
destroy(stream, new Error("overwritten"));
|
|
317
|
+
}
|
|
318
|
+
function onWorkerMessage(msg) {
|
|
319
|
+
let stream = this.stream.deref();
|
|
320
|
+
if (stream === void 0) {
|
|
321
|
+
this.exited = !0, this.terminate();
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
switch (msg.code) {
|
|
325
|
+
case "READY":
|
|
326
|
+
this.stream = new WeakRef(stream), stream.flush(() => {
|
|
327
|
+
stream[kImpl].ready = !0, stream.emit("ready");
|
|
328
|
+
});
|
|
329
|
+
break;
|
|
330
|
+
case "ERROR":
|
|
331
|
+
destroy(stream, msg.err);
|
|
332
|
+
break;
|
|
333
|
+
case "EVENT":
|
|
334
|
+
Array.isArray(msg.args) ? stream.emit(msg.name, ...msg.args) : stream.emit(msg.name, msg.args);
|
|
335
|
+
break;
|
|
336
|
+
case "WARNING":
|
|
337
|
+
process.emitWarning(msg.err);
|
|
338
|
+
break;
|
|
339
|
+
default:
|
|
340
|
+
destroy(stream, new Error("this should not happen: " + msg.code));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function onWorkerExit(code) {
|
|
344
|
+
let stream = this.stream.deref();
|
|
345
|
+
stream !== void 0 && (registry.unregister(stream), stream.worker.exited = !0, stream.worker.off("exit", onWorkerExit), destroy(stream, code !== 0 ? new Error("the worker thread exited") : null));
|
|
346
|
+
}
|
|
347
|
+
var ThreadStream = class extends EventEmitter {
|
|
348
|
+
constructor(opts = {}) {
|
|
349
|
+
if (super(), opts.bufferSize < 4)
|
|
350
|
+
throw new Error("bufferSize must at least fit a 4-byte utf-8 char");
|
|
351
|
+
this[kImpl] = {}, this[kImpl].stateBuf = new SharedArrayBuffer(128), this[kImpl].state = new Int32Array(this[kImpl].stateBuf), this[kImpl].dataBuf = new SharedArrayBuffer(opts.bufferSize || 4 * 1024 * 1024), this[kImpl].data = Buffer.from(this[kImpl].dataBuf), this[kImpl].sync = opts.sync || !1, this[kImpl].ending = !1, this[kImpl].ended = !1, this[kImpl].needDrain = !1, this[kImpl].destroyed = !1, this[kImpl].flushing = !1, this[kImpl].ready = !1, this[kImpl].finished = !1, this[kImpl].errored = null, this[kImpl].closed = !1, this[kImpl].buf = "", this.worker = createWorker(this, opts), this.on("message", (message, transferList) => {
|
|
352
|
+
this.worker.postMessage(message, transferList);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
write(data) {
|
|
356
|
+
if (this[kImpl].destroyed)
|
|
357
|
+
return error(this, new Error("the worker has exited")), !1;
|
|
358
|
+
if (this[kImpl].ending)
|
|
359
|
+
return error(this, new Error("the worker is ending")), !1;
|
|
360
|
+
if (this[kImpl].flushing && this[kImpl].buf.length + data.length >= MAX_STRING)
|
|
361
|
+
try {
|
|
362
|
+
writeSync(this), this[kImpl].flushing = !0;
|
|
363
|
+
} catch (err) {
|
|
364
|
+
return destroy(this, err), !1;
|
|
365
|
+
}
|
|
366
|
+
if (this[kImpl].buf += data, this[kImpl].sync)
|
|
367
|
+
try {
|
|
368
|
+
return writeSync(this), !0;
|
|
369
|
+
} catch (err) {
|
|
370
|
+
return destroy(this, err), !1;
|
|
371
|
+
}
|
|
372
|
+
return this[kImpl].flushing || (this[kImpl].flushing = !0, setImmediate(nextFlush, this)), this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].buf.length - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0, !this[kImpl].needDrain;
|
|
373
|
+
}
|
|
374
|
+
end() {
|
|
375
|
+
this[kImpl].destroyed || (this[kImpl].ending = !0, end(this));
|
|
376
|
+
}
|
|
377
|
+
flush(cb) {
|
|
378
|
+
if (this[kImpl].destroyed) {
|
|
379
|
+
typeof cb == "function" && process.nextTick(cb, new Error("the worker has exited"));
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
let writeIndex = Atomics.load(this[kImpl].state, WRITE_INDEX);
|
|
383
|
+
wait(this[kImpl].state, READ_INDEX, writeIndex, 1 / 0, (err, res) => {
|
|
384
|
+
if (err) {
|
|
385
|
+
destroy(this, err), process.nextTick(cb, err);
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (res === "not-equal") {
|
|
389
|
+
this.flush(cb);
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
process.nextTick(cb);
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
flushSync() {
|
|
396
|
+
this[kImpl].destroyed || (writeSync(this), flushSync(this));
|
|
397
|
+
}
|
|
398
|
+
unref() {
|
|
399
|
+
this.worker.unref();
|
|
400
|
+
}
|
|
401
|
+
ref() {
|
|
402
|
+
this.worker.ref();
|
|
403
|
+
}
|
|
404
|
+
get ready() {
|
|
405
|
+
return this[kImpl].ready;
|
|
406
|
+
}
|
|
407
|
+
get destroyed() {
|
|
408
|
+
return this[kImpl].destroyed;
|
|
409
|
+
}
|
|
410
|
+
get closed() {
|
|
411
|
+
return this[kImpl].closed;
|
|
412
|
+
}
|
|
413
|
+
get writable() {
|
|
414
|
+
return !this[kImpl].destroyed && !this[kImpl].ending;
|
|
415
|
+
}
|
|
416
|
+
get writableEnded() {
|
|
417
|
+
return this[kImpl].ending;
|
|
418
|
+
}
|
|
419
|
+
get writableFinished() {
|
|
420
|
+
return this[kImpl].finished;
|
|
421
|
+
}
|
|
422
|
+
get writableNeedDrain() {
|
|
423
|
+
return this[kImpl].needDrain;
|
|
424
|
+
}
|
|
425
|
+
get writableObjectMode() {
|
|
426
|
+
return !1;
|
|
427
|
+
}
|
|
428
|
+
get writableErrored() {
|
|
429
|
+
return this[kImpl].errored;
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
function error(stream, err) {
|
|
433
|
+
setImmediate(() => {
|
|
434
|
+
stream.emit("error", err);
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
function destroy(stream, err) {
|
|
438
|
+
stream[kImpl].destroyed || (stream[kImpl].destroyed = !0, err && (stream[kImpl].errored = err, error(stream, err)), stream.worker.exited ? setImmediate(() => {
|
|
439
|
+
stream[kImpl].closed = !0, stream.emit("close");
|
|
440
|
+
}) : stream.worker.terminate().catch(() => {
|
|
441
|
+
}).then(() => {
|
|
442
|
+
stream[kImpl].closed = !0, stream.emit("close");
|
|
443
|
+
}));
|
|
444
|
+
}
|
|
445
|
+
function write(stream, data, cb) {
|
|
446
|
+
let current = Atomics.load(stream[kImpl].state, WRITE_INDEX), length = Buffer.byteLength(data);
|
|
447
|
+
return stream[kImpl].data.write(data, current), Atomics.store(stream[kImpl].state, WRITE_INDEX, current + length), Atomics.notify(stream[kImpl].state, WRITE_INDEX), cb(), !0;
|
|
448
|
+
}
|
|
449
|
+
function end(stream) {
|
|
450
|
+
if (!(stream[kImpl].ended || !stream[kImpl].ending || stream[kImpl].flushing)) {
|
|
451
|
+
stream[kImpl].ended = !0;
|
|
452
|
+
try {
|
|
453
|
+
stream.flushSync();
|
|
454
|
+
let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
|
|
455
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, -1), Atomics.notify(stream[kImpl].state, WRITE_INDEX);
|
|
456
|
+
let spins = 0;
|
|
457
|
+
for (; readIndex !== -1; ) {
|
|
458
|
+
if (Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1e3), readIndex = Atomics.load(stream[kImpl].state, READ_INDEX), readIndex === -2) {
|
|
459
|
+
destroy(stream, new Error("end() failed"));
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if (++spins === 10) {
|
|
463
|
+
destroy(stream, new Error("end() took too long (10s)"));
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
process.nextTick(() => {
|
|
468
|
+
stream[kImpl].finished = !0, stream.emit("finish");
|
|
469
|
+
});
|
|
470
|
+
} catch (err) {
|
|
471
|
+
destroy(stream, err);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
function writeSync(stream) {
|
|
476
|
+
let cb = () => {
|
|
477
|
+
stream[kImpl].ending ? end(stream) : stream[kImpl].needDrain && process.nextTick(drain, stream);
|
|
478
|
+
};
|
|
479
|
+
for (stream[kImpl].flushing = !1; stream[kImpl].buf.length !== 0; ) {
|
|
480
|
+
let writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX), leftover = stream[kImpl].data.length - writeIndex;
|
|
481
|
+
if (leftover === 0) {
|
|
482
|
+
flushSync(stream), Atomics.store(stream[kImpl].state, READ_INDEX, 0), Atomics.store(stream[kImpl].state, WRITE_INDEX, 0), Atomics.notify(stream[kImpl].state, READ_INDEX);
|
|
483
|
+
continue;
|
|
484
|
+
} else if (leftover < 0)
|
|
485
|
+
throw new Error("overwritten");
|
|
486
|
+
let toWrite = stream[kImpl].buf.slice(0, leftover), toWriteBytes = Buffer.byteLength(toWrite);
|
|
487
|
+
if (toWriteBytes <= leftover)
|
|
488
|
+
stream[kImpl].buf = stream[kImpl].buf.slice(leftover), write(stream, toWrite, cb);
|
|
489
|
+
else {
|
|
490
|
+
for (flushSync(stream), Atomics.store(stream[kImpl].state, READ_INDEX, 0), Atomics.store(stream[kImpl].state, WRITE_INDEX, 0), Atomics.notify(stream[kImpl].state, READ_INDEX); toWriteBytes > stream[kImpl].buf.length; )
|
|
491
|
+
leftover = leftover / 2, toWrite = stream[kImpl].buf.slice(0, leftover), toWriteBytes = Buffer.byteLength(toWrite);
|
|
492
|
+
stream[kImpl].buf = stream[kImpl].buf.slice(leftover), write(stream, toWrite, cb);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
function flushSync(stream) {
|
|
497
|
+
if (stream[kImpl].flushing)
|
|
498
|
+
throw new Error("unable to flush while flushing");
|
|
499
|
+
let writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX), spins = 0;
|
|
500
|
+
for (; ; ) {
|
|
501
|
+
let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
|
|
502
|
+
if (readIndex === -2)
|
|
503
|
+
throw Error("_flushSync failed");
|
|
504
|
+
if (readIndex !== writeIndex)
|
|
505
|
+
Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1e3);
|
|
506
|
+
else
|
|
507
|
+
break;
|
|
508
|
+
if (++spins === 10)
|
|
509
|
+
throw new Error("_flushSync took too long (10s)");
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
module.exports = ThreadStream;
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
// node_modules/pino/lib/transport.js
|
|
517
|
+
var require_transport = __commonJS({
|
|
518
|
+
"node_modules/pino/lib/transport.js"(exports, module) {
|
|
519
|
+
"use strict";
|
|
520
|
+
var { createRequire } = __require("module"), { existsSync } = __require("node:fs"), getCallers = require_caller(), { join, isAbsolute, sep } = __require("node:path"), { fileURLToPath } = __require("node:url"), sleep = require_atomic_sleep(), onExit = require_on_exit_leak_free(), ThreadStream = require_thread_stream();
|
|
521
|
+
function setupOnExit(stream) {
|
|
522
|
+
onExit.register(stream, autoEnd), onExit.registerBeforeExit(stream, flush), stream.on("close", function() {
|
|
523
|
+
onExit.unregister(stream);
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
function hasPreloadFlags() {
|
|
527
|
+
let execArgv = process.execArgv;
|
|
528
|
+
for (let i = 0; i < execArgv.length; i++) {
|
|
529
|
+
let arg = execArgv[i];
|
|
530
|
+
if (arg === "--import" || arg === "--require" || arg === "-r" || arg.startsWith("--import=") || arg.startsWith("--require=") || arg.startsWith("-r="))
|
|
531
|
+
return !0;
|
|
532
|
+
}
|
|
533
|
+
return !1;
|
|
534
|
+
}
|
|
535
|
+
function sanitizeNodeOptions(nodeOptions) {
|
|
536
|
+
let tokens = nodeOptions.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);
|
|
537
|
+
if (!tokens)
|
|
538
|
+
return nodeOptions;
|
|
539
|
+
let sanitized = [], changed = !1;
|
|
540
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
541
|
+
let token = tokens[i];
|
|
542
|
+
if (token === "--require" || token === "-r" || token === "--import") {
|
|
543
|
+
let next = tokens[i + 1];
|
|
544
|
+
if (next && shouldDropPreload(next)) {
|
|
545
|
+
changed = !0, i++;
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
sanitized.push(token), next && (sanitized.push(next), i++);
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
if (token.startsWith("--require=") || token.startsWith("-r=") || token.startsWith("--import=")) {
|
|
552
|
+
let value = token.slice(token.indexOf("=") + 1);
|
|
553
|
+
if (shouldDropPreload(value)) {
|
|
554
|
+
changed = !0;
|
|
555
|
+
continue;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
sanitized.push(token);
|
|
559
|
+
}
|
|
560
|
+
return changed ? sanitized.join(" ") : nodeOptions;
|
|
561
|
+
}
|
|
562
|
+
function shouldDropPreload(value) {
|
|
563
|
+
let unquoted = stripQuotes(value);
|
|
564
|
+
if (!unquoted)
|
|
565
|
+
return !1;
|
|
566
|
+
let path = unquoted;
|
|
567
|
+
if (path.startsWith("file://"))
|
|
568
|
+
try {
|
|
569
|
+
path = fileURLToPath(path);
|
|
570
|
+
} catch {
|
|
571
|
+
return !1;
|
|
572
|
+
}
|
|
573
|
+
return isAbsolute(path) && !existsSync(path);
|
|
574
|
+
}
|
|
575
|
+
function stripQuotes(value) {
|
|
576
|
+
let first = value[0], last = value[value.length - 1];
|
|
577
|
+
return first === '"' && last === '"' || first === "'" && last === "'" ? value.slice(1, -1) : value;
|
|
578
|
+
}
|
|
579
|
+
function buildStream(filename, workerData, workerOpts, sync, name) {
|
|
580
|
+
if (!workerOpts.execArgv && hasPreloadFlags() && __require.main === void 0 && (workerOpts = {
|
|
581
|
+
...workerOpts,
|
|
582
|
+
execArgv: []
|
|
583
|
+
}), !workerOpts.env && process.env.NODE_OPTIONS) {
|
|
584
|
+
let nodeOptions = sanitizeNodeOptions(process.env.NODE_OPTIONS);
|
|
585
|
+
nodeOptions !== process.env.NODE_OPTIONS && (workerOpts = {
|
|
586
|
+
...workerOpts,
|
|
587
|
+
env: {
|
|
588
|
+
...process.env,
|
|
589
|
+
NODE_OPTIONS: nodeOptions
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
workerOpts = { ...workerOpts, name };
|
|
594
|
+
let stream = new ThreadStream({
|
|
595
|
+
filename,
|
|
596
|
+
workerData,
|
|
597
|
+
workerOpts,
|
|
598
|
+
sync
|
|
599
|
+
});
|
|
600
|
+
stream.on("ready", onReady), stream.on("close", function() {
|
|
601
|
+
process.removeListener("exit", onExit2);
|
|
602
|
+
}), process.on("exit", onExit2);
|
|
603
|
+
function onReady() {
|
|
604
|
+
process.removeListener("exit", onExit2), stream.unref(), workerOpts.autoEnd !== !1 && setupOnExit(stream);
|
|
605
|
+
}
|
|
606
|
+
function onExit2() {
|
|
607
|
+
stream.closed || (stream.flushSync(), sleep(100), stream.end());
|
|
608
|
+
}
|
|
609
|
+
return stream;
|
|
610
|
+
}
|
|
611
|
+
function autoEnd(stream) {
|
|
612
|
+
stream.ref(), stream.flushSync(), stream.end(), stream.once("close", function() {
|
|
613
|
+
stream.unref();
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
function flush(stream) {
|
|
617
|
+
stream.flushSync();
|
|
618
|
+
}
|
|
619
|
+
function transport(fullOptions) {
|
|
620
|
+
let { pipeline, targets, levels, dedupe, worker = {}, caller = getCallers(), sync = !1 } = fullOptions, options = {
|
|
621
|
+
...fullOptions.options
|
|
622
|
+
}, callers = typeof caller == "string" ? [caller] : caller, bundlerOverrides = typeof globalThis == "object" && Object.prototype.hasOwnProperty.call(globalThis, "__bundlerPathsOverrides") && globalThis.__bundlerPathsOverrides && typeof globalThis.__bundlerPathsOverrides == "object" ? globalThis.__bundlerPathsOverrides : /* @__PURE__ */ Object.create(null), target = fullOptions.target;
|
|
623
|
+
if (target && targets)
|
|
624
|
+
throw new Error("only one of target or targets can be specified");
|
|
625
|
+
targets ? (target = bundlerOverrides["pino-worker"] || join(__dirname, "worker.js"), options.targets = targets.filter((dest) => dest.target).map((dest) => ({
|
|
626
|
+
...dest,
|
|
627
|
+
target: fixTarget(dest.target)
|
|
628
|
+
})), options.pipelines = targets.filter((dest) => dest.pipeline).map((dest) => dest.pipeline.map((t) => ({
|
|
629
|
+
...t,
|
|
630
|
+
level: dest.level,
|
|
631
|
+
// duplicate the pipeline `level` property defined in the upper level
|
|
632
|
+
target: fixTarget(t.target)
|
|
633
|
+
})))) : pipeline && (target = bundlerOverrides["pino-worker"] || join(__dirname, "worker.js"), options.pipelines = [pipeline.map((dest) => ({
|
|
634
|
+
...dest,
|
|
635
|
+
target: fixTarget(dest.target)
|
|
636
|
+
}))]), levels && (options.levels = levels), dedupe && (options.dedupe = dedupe), options.pinoWillSendConfig = !0;
|
|
637
|
+
let name = targets || pipeline ? "pino.transport" : target;
|
|
638
|
+
return buildStream(fixTarget(target), options, worker, sync, name);
|
|
639
|
+
function fixTarget(origin) {
|
|
640
|
+
if (origin = bundlerOverrides[origin] || origin, isAbsolute(origin) || origin.indexOf("file://") === 0)
|
|
641
|
+
return origin;
|
|
642
|
+
if (origin === "pino/file")
|
|
643
|
+
return join(__dirname, "..", "file.js");
|
|
644
|
+
let fixTarget2;
|
|
645
|
+
for (let filePath of callers)
|
|
646
|
+
try {
|
|
647
|
+
let context = filePath === "node:repl" ? process.cwd() + sep : filePath;
|
|
648
|
+
fixTarget2 = createRequire(context).resolve(origin);
|
|
649
|
+
break;
|
|
650
|
+
} catch {
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
if (!fixTarget2)
|
|
654
|
+
throw new Error(`unable to determine transport target for "${origin}"`);
|
|
655
|
+
return fixTarget2;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
module.exports = transport;
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
// node_modules/pino/lib/tools.js
|
|
663
|
+
var require_tools = __commonJS({
|
|
664
|
+
"node_modules/pino/lib/tools.js"(exports, module) {
|
|
665
|
+
"use strict";
|
|
666
|
+
var diagChan = __require("node:diagnostics_channel"), format = require_quick_format_unescaped(), { mapHttpRequest, mapHttpResponse } = require_pino_std_serializers(), SonicBoom = require_sonic_boom(), onExit = require_on_exit_leak_free(), {
|
|
667
|
+
lsCacheSym,
|
|
668
|
+
chindingsSym,
|
|
669
|
+
writeSym,
|
|
670
|
+
serializersSym,
|
|
671
|
+
formatOptsSym,
|
|
672
|
+
endSym,
|
|
673
|
+
stringifiersSym,
|
|
674
|
+
stringifySym,
|
|
675
|
+
stringifySafeSym,
|
|
676
|
+
wildcardFirstSym,
|
|
677
|
+
nestedKeySym,
|
|
678
|
+
formattersSym,
|
|
679
|
+
messageKeySym,
|
|
680
|
+
errorKeySym,
|
|
681
|
+
nestedKeyStrSym,
|
|
682
|
+
msgPrefixSym
|
|
683
|
+
} = require_symbols(), { isMainThread } = __require("worker_threads"), transport = require_transport(), [nodeMajor] = process.versions.node.split(".").map((v) => Number(v)), asJsonChan = diagChan.tracingChannel("pino_asJson"), asString = nodeMajor >= 25 ? (str) => JSON.stringify(str) : _asString;
|
|
684
|
+
function noop() {
|
|
685
|
+
}
|
|
686
|
+
function genLog(level, hook) {
|
|
687
|
+
if (!hook) return LOG;
|
|
688
|
+
return function(...args) {
|
|
689
|
+
hook.call(this, args, LOG, level);
|
|
690
|
+
};
|
|
691
|
+
function LOG(o, ...n) {
|
|
692
|
+
if (typeof o == "object") {
|
|
693
|
+
let msg = o;
|
|
694
|
+
o !== null && (o.method && o.headers && o.socket ? o = mapHttpRequest(o) : typeof o.setHeader == "function" && (o = mapHttpResponse(o)));
|
|
695
|
+
let formatParams;
|
|
696
|
+
msg === null && n.length === 0 ? formatParams = [null] : (msg = n.shift(), formatParams = n), typeof this[msgPrefixSym] == "string" && msg !== void 0 && msg !== null && (msg = this[msgPrefixSym] + msg), this[writeSym](o, format(msg, formatParams, this[formatOptsSym]), level);
|
|
697
|
+
} else {
|
|
698
|
+
let msg = o === void 0 ? n.shift() : o;
|
|
699
|
+
typeof this[msgPrefixSym] == "string" && msg !== void 0 && msg !== null && (msg = this[msgPrefixSym] + msg), this[writeSym](null, format(msg, n, this[formatOptsSym]), level);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
function _asString(str) {
|
|
704
|
+
let result = "", last = 0, found = !1, point = 255, l = str.length;
|
|
705
|
+
if (l > 100)
|
|
706
|
+
return JSON.stringify(str);
|
|
707
|
+
for (var i = 0; i < l && point >= 32; i++)
|
|
708
|
+
point = str.charCodeAt(i), (point === 34 || point === 92) && (result += str.slice(last, i) + "\\", last = i, found = !0);
|
|
709
|
+
return found ? result += str.slice(last) : result = str, point < 32 ? JSON.stringify(str) : '"' + result + '"';
|
|
710
|
+
}
|
|
711
|
+
function asJson(obj, msg, num, time) {
|
|
712
|
+
if (asJsonChan.hasSubscribers === !1)
|
|
713
|
+
return _asJson.call(this, obj, msg, num, time);
|
|
714
|
+
let store = { instance: this, arguments };
|
|
715
|
+
return asJsonChan.traceSync(_asJson, store, this, obj, msg, num, time);
|
|
716
|
+
}
|
|
717
|
+
function _asJson(obj, msg, num, time) {
|
|
718
|
+
let stringify2 = this[stringifySym], stringifySafe = this[stringifySafeSym], stringifiers = this[stringifiersSym], end = this[endSym], chindings = this[chindingsSym], serializers = this[serializersSym], formatters = this[formattersSym], messageKey = this[messageKeySym], errorKey = this[errorKeySym], data = this[lsCacheSym][num] + time;
|
|
719
|
+
data = data + chindings;
|
|
720
|
+
let value;
|
|
721
|
+
formatters.log && (obj = formatters.log(obj));
|
|
722
|
+
let wildcardStringifier = stringifiers[wildcardFirstSym], propStr = "";
|
|
723
|
+
for (let key in obj)
|
|
724
|
+
if (value = obj[key], Object.prototype.hasOwnProperty.call(obj, key) && value !== void 0) {
|
|
725
|
+
serializers[key] ? value = serializers[key](value) : key === errorKey && serializers.err && (value = serializers.err(value));
|
|
726
|
+
let stringifier = stringifiers[key] || wildcardStringifier;
|
|
727
|
+
switch (typeof value) {
|
|
728
|
+
case "undefined":
|
|
729
|
+
case "function":
|
|
730
|
+
continue;
|
|
731
|
+
case "number":
|
|
732
|
+
Number.isFinite(value) === !1 && (value = null);
|
|
733
|
+
// this case explicitly falls through to the next one
|
|
734
|
+
case "boolean":
|
|
735
|
+
stringifier && (value = stringifier(value));
|
|
736
|
+
break;
|
|
737
|
+
case "string":
|
|
738
|
+
value = (stringifier || asString)(value);
|
|
739
|
+
break;
|
|
740
|
+
default:
|
|
741
|
+
value = (stringifier || stringify2)(value, stringifySafe);
|
|
742
|
+
}
|
|
743
|
+
if (value === void 0) continue;
|
|
744
|
+
let strKey = asString(key);
|
|
745
|
+
propStr += "," + strKey + ":" + value;
|
|
746
|
+
}
|
|
747
|
+
let msgStr = "";
|
|
748
|
+
if (msg !== void 0) {
|
|
749
|
+
value = serializers[messageKey] ? serializers[messageKey](msg) : msg;
|
|
750
|
+
let stringifier = stringifiers[messageKey] || wildcardStringifier;
|
|
751
|
+
switch (typeof value) {
|
|
752
|
+
case "function":
|
|
753
|
+
break;
|
|
754
|
+
case "number":
|
|
755
|
+
Number.isFinite(value) === !1 && (value = null);
|
|
756
|
+
// this case explicitly falls through to the next one
|
|
757
|
+
case "boolean":
|
|
758
|
+
stringifier && (value = stringifier(value)), msgStr = ',"' + messageKey + '":' + value;
|
|
759
|
+
break;
|
|
760
|
+
case "string":
|
|
761
|
+
value = (stringifier || asString)(value), msgStr = ',"' + messageKey + '":' + value;
|
|
762
|
+
break;
|
|
763
|
+
default:
|
|
764
|
+
value = (stringifier || stringify2)(value, stringifySafe), msgStr = ',"' + messageKey + '":' + value;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
return this[nestedKeySym] && propStr ? data + this[nestedKeyStrSym] + propStr.slice(1) + "}" + msgStr + end : data + propStr + msgStr + end;
|
|
768
|
+
}
|
|
769
|
+
function asChindings(instance, bindings) {
|
|
770
|
+
let value, data = instance[chindingsSym], stringify2 = instance[stringifySym], stringifySafe = instance[stringifySafeSym], stringifiers = instance[stringifiersSym], wildcardStringifier = stringifiers[wildcardFirstSym], serializers = instance[serializersSym], formatter = instance[formattersSym].bindings;
|
|
771
|
+
bindings = formatter(bindings);
|
|
772
|
+
for (let key in bindings)
|
|
773
|
+
if (value = bindings[key], ((key.length < 5 || key !== "level" && key !== "serializers" && key !== "formatters" && key !== "customLevels") && bindings.hasOwnProperty(key) && value !== void 0) === !0) {
|
|
774
|
+
if (value = serializers[key] ? serializers[key](value) : value, value = (stringifiers[key] || wildcardStringifier || stringify2)(value, stringifySafe), value === void 0) continue;
|
|
775
|
+
data += ',"' + key + '":' + value;
|
|
776
|
+
}
|
|
777
|
+
return data;
|
|
778
|
+
}
|
|
779
|
+
function hasBeenTampered(stream) {
|
|
780
|
+
return stream.write !== stream.constructor.prototype.write;
|
|
781
|
+
}
|
|
782
|
+
function buildSafeSonicBoom(opts) {
|
|
783
|
+
let stream = new SonicBoom(opts);
|
|
784
|
+
return stream.on("error", filterBrokenPipe), !opts.sync && isMainThread && (onExit.register(stream, autoEnd), stream.on("close", function() {
|
|
785
|
+
onExit.unregister(stream);
|
|
786
|
+
})), stream;
|
|
787
|
+
function filterBrokenPipe(err) {
|
|
788
|
+
if (err.code === "EPIPE") {
|
|
789
|
+
stream.write = noop, stream.end = noop, stream.flushSync = noop, stream.destroy = noop;
|
|
790
|
+
return;
|
|
791
|
+
}
|
|
792
|
+
stream.removeListener("error", filterBrokenPipe), stream.emit("error", err);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
function autoEnd(stream, eventName) {
|
|
796
|
+
stream.destroyed || (eventName === "beforeExit" ? (stream.flush(), stream.on("drain", function() {
|
|
797
|
+
stream.end();
|
|
798
|
+
})) : stream.flushSync());
|
|
799
|
+
}
|
|
800
|
+
function createArgsNormalizer(defaultOptions) {
|
|
801
|
+
return function(instance, caller, opts = {}, stream) {
|
|
802
|
+
if (typeof opts == "string")
|
|
803
|
+
stream = buildSafeSonicBoom({ dest: opts }), opts = {};
|
|
804
|
+
else if (typeof stream == "string") {
|
|
805
|
+
if (opts && opts.transport)
|
|
806
|
+
throw Error("only one of option.transport or stream can be specified");
|
|
807
|
+
stream = buildSafeSonicBoom({ dest: stream });
|
|
808
|
+
} else if (opts instanceof SonicBoom || opts.writable || opts._writableState)
|
|
809
|
+
stream = opts, opts = {};
|
|
810
|
+
else if (opts.transport) {
|
|
811
|
+
if (opts.transport instanceof SonicBoom || opts.transport.writable || opts.transport._writableState)
|
|
812
|
+
throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");
|
|
813
|
+
if (opts.transport.targets && opts.transport.targets.length && opts.formatters && typeof opts.formatters.level == "function")
|
|
814
|
+
throw Error("option.transport.targets do not allow custom level formatters");
|
|
815
|
+
let customLevels;
|
|
816
|
+
opts.customLevels && (customLevels = opts.useOnlyCustomLevels ? opts.customLevels : Object.assign({}, opts.levels, opts.customLevels)), stream = transport({ caller, ...opts.transport, levels: customLevels });
|
|
817
|
+
}
|
|
818
|
+
if (opts = Object.assign({}, defaultOptions, opts), opts.serializers = Object.assign({}, defaultOptions.serializers, opts.serializers), opts.formatters = Object.assign({}, defaultOptions.formatters, opts.formatters), opts.prettyPrint)
|
|
819
|
+
throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");
|
|
820
|
+
let { enabled, onChild } = opts;
|
|
821
|
+
return enabled === !1 && (opts.level = "silent"), onChild || (opts.onChild = noop), stream || (hasBeenTampered(process.stdout) ? stream = process.stdout : stream = buildSafeSonicBoom({ fd: process.stdout.fd || 1 })), { opts, stream };
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
function stringify(obj, stringifySafeFn) {
|
|
825
|
+
try {
|
|
826
|
+
return JSON.stringify(obj);
|
|
827
|
+
} catch {
|
|
828
|
+
try {
|
|
829
|
+
return (stringifySafeFn || this[stringifySafeSym])(obj);
|
|
830
|
+
} catch {
|
|
831
|
+
return '"[unable to serialize, circular reference is too complex to analyze]"';
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
function buildFormatters(level, bindings, log) {
|
|
836
|
+
return {
|
|
837
|
+
level,
|
|
838
|
+
bindings,
|
|
839
|
+
log
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
function normalizeDestFileDescriptor(destination) {
|
|
843
|
+
let fd = Number(destination);
|
|
844
|
+
return typeof destination == "string" && Number.isFinite(fd) ? fd : destination === void 0 ? 1 : destination;
|
|
845
|
+
}
|
|
846
|
+
module.exports = {
|
|
847
|
+
noop,
|
|
848
|
+
buildSafeSonicBoom,
|
|
849
|
+
asChindings,
|
|
850
|
+
asJson,
|
|
851
|
+
genLog,
|
|
852
|
+
createArgsNormalizer,
|
|
853
|
+
stringify,
|
|
854
|
+
buildFormatters,
|
|
855
|
+
normalizeDestFileDescriptor
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
|
|
860
|
+
// node_modules/pino/lib/constants.js
|
|
861
|
+
var require_constants = __commonJS({
|
|
862
|
+
"node_modules/pino/lib/constants.js"(exports, module) {
|
|
863
|
+
"use strict";
|
|
864
|
+
var DEFAULT_LEVELS = {
|
|
865
|
+
trace: 10,
|
|
866
|
+
debug: 20,
|
|
867
|
+
info: 30,
|
|
868
|
+
warn: 40,
|
|
869
|
+
error: 50,
|
|
870
|
+
fatal: 60
|
|
871
|
+
}, SORTING_ORDER = {
|
|
872
|
+
ASC: "ASC",
|
|
873
|
+
DESC: "DESC"
|
|
874
|
+
};
|
|
875
|
+
module.exports = {
|
|
876
|
+
DEFAULT_LEVELS,
|
|
877
|
+
SORTING_ORDER
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
|
|
882
|
+
// node_modules/pino/lib/levels.js
|
|
883
|
+
var require_levels = __commonJS({
|
|
884
|
+
"node_modules/pino/lib/levels.js"(exports, module) {
|
|
885
|
+
"use strict";
|
|
886
|
+
var {
|
|
887
|
+
lsCacheSym,
|
|
888
|
+
levelValSym,
|
|
889
|
+
useOnlyCustomLevelsSym,
|
|
890
|
+
streamSym,
|
|
891
|
+
formattersSym,
|
|
892
|
+
hooksSym,
|
|
893
|
+
levelCompSym
|
|
894
|
+
} = require_symbols(), { noop, genLog } = require_tools(), { DEFAULT_LEVELS, SORTING_ORDER } = require_constants(), levelMethods = {
|
|
895
|
+
fatal: (hook) => {
|
|
896
|
+
let logFatal = genLog(DEFAULT_LEVELS.fatal, hook);
|
|
897
|
+
return function(...args) {
|
|
898
|
+
let stream = this[streamSym];
|
|
899
|
+
if (logFatal.call(this, ...args), typeof stream.flushSync == "function")
|
|
900
|
+
try {
|
|
901
|
+
stream.flushSync();
|
|
902
|
+
} catch {
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
},
|
|
906
|
+
error: (hook) => genLog(DEFAULT_LEVELS.error, hook),
|
|
907
|
+
warn: (hook) => genLog(DEFAULT_LEVELS.warn, hook),
|
|
908
|
+
info: (hook) => genLog(DEFAULT_LEVELS.info, hook),
|
|
909
|
+
debug: (hook) => genLog(DEFAULT_LEVELS.debug, hook),
|
|
910
|
+
trace: (hook) => genLog(DEFAULT_LEVELS.trace, hook)
|
|
911
|
+
}, nums = Object.keys(DEFAULT_LEVELS).reduce((o, k) => (o[DEFAULT_LEVELS[k]] = k, o), {}), initialLsCache = Object.keys(nums).reduce((o, k) => (o[k] = '{"level":' + Number(k), o), {});
|
|
912
|
+
function genLsCache(instance) {
|
|
913
|
+
let formatter = instance[formattersSym].level, { labels } = instance.levels, cache = {};
|
|
914
|
+
for (let label in labels) {
|
|
915
|
+
let level = formatter(labels[label], Number(label));
|
|
916
|
+
cache[label] = JSON.stringify(level).slice(0, -1);
|
|
917
|
+
}
|
|
918
|
+
return instance[lsCacheSym] = cache, instance;
|
|
919
|
+
}
|
|
920
|
+
function isStandardLevel(level, useOnlyCustomLevels) {
|
|
921
|
+
if (useOnlyCustomLevels)
|
|
922
|
+
return !1;
|
|
923
|
+
switch (level) {
|
|
924
|
+
case "fatal":
|
|
925
|
+
case "error":
|
|
926
|
+
case "warn":
|
|
927
|
+
case "info":
|
|
928
|
+
case "debug":
|
|
929
|
+
case "trace":
|
|
930
|
+
return !0;
|
|
931
|
+
default:
|
|
932
|
+
return !1;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
function setLevel(level) {
|
|
936
|
+
let { labels, values } = this.levels;
|
|
937
|
+
if (typeof level == "number") {
|
|
938
|
+
if (labels[level] === void 0) throw Error("unknown level value" + level);
|
|
939
|
+
level = labels[level];
|
|
940
|
+
}
|
|
941
|
+
if (values[level] === void 0) throw Error("unknown level " + level);
|
|
942
|
+
let preLevelVal = this[levelValSym], levelVal = this[levelValSym] = values[level], useOnlyCustomLevelsVal = this[useOnlyCustomLevelsSym], levelComparison = this[levelCompSym], hook = this[hooksSym].logMethod;
|
|
943
|
+
for (let key in values) {
|
|
944
|
+
if (levelComparison(values[key], levelVal) === !1) {
|
|
945
|
+
this[key] = noop;
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
this[key] = isStandardLevel(key, useOnlyCustomLevelsVal) ? levelMethods[key](hook) : genLog(values[key], hook);
|
|
949
|
+
}
|
|
950
|
+
this.emit(
|
|
951
|
+
"level-change",
|
|
952
|
+
level,
|
|
953
|
+
levelVal,
|
|
954
|
+
labels[preLevelVal],
|
|
955
|
+
preLevelVal,
|
|
956
|
+
this
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
function getLevel(level) {
|
|
960
|
+
let { levels, levelVal } = this;
|
|
961
|
+
return levels && levels.labels ? levels.labels[levelVal] : "";
|
|
962
|
+
}
|
|
963
|
+
function isLevelEnabled(logLevel) {
|
|
964
|
+
let { values } = this.levels, logLevelVal = values[logLevel];
|
|
965
|
+
return logLevelVal !== void 0 && this[levelCompSym](logLevelVal, this[levelValSym]);
|
|
966
|
+
}
|
|
967
|
+
function compareLevel(direction, current, expected) {
|
|
968
|
+
return direction === SORTING_ORDER.DESC ? current <= expected : current >= expected;
|
|
969
|
+
}
|
|
970
|
+
function genLevelComparison(levelComparison) {
|
|
971
|
+
return typeof levelComparison == "string" ? compareLevel.bind(null, levelComparison) : levelComparison;
|
|
972
|
+
}
|
|
973
|
+
function mappings(customLevels = null, useOnlyCustomLevels = !1) {
|
|
974
|
+
let customNums = customLevels ? Object.keys(customLevels).reduce((o, k) => (o[customLevels[k]] = k, o), {}) : null, labels = Object.assign(
|
|
975
|
+
Object.create(Object.prototype, { Infinity: { value: "silent" } }),
|
|
976
|
+
useOnlyCustomLevels ? null : nums,
|
|
977
|
+
customNums
|
|
978
|
+
), values = Object.assign(
|
|
979
|
+
Object.create(Object.prototype, { silent: { value: 1 / 0 } }),
|
|
980
|
+
useOnlyCustomLevels ? null : DEFAULT_LEVELS,
|
|
981
|
+
customLevels
|
|
982
|
+
);
|
|
983
|
+
return { labels, values };
|
|
984
|
+
}
|
|
985
|
+
function assertDefaultLevelFound(defaultLevel, customLevels, useOnlyCustomLevels) {
|
|
986
|
+
if (typeof defaultLevel == "number") {
|
|
987
|
+
if (![].concat(
|
|
988
|
+
Object.keys(customLevels || {}).map((key) => customLevels[key]),
|
|
989
|
+
useOnlyCustomLevels ? [] : Object.keys(nums).map((level) => +level),
|
|
990
|
+
1 / 0
|
|
991
|
+
).includes(defaultLevel))
|
|
992
|
+
throw Error(`default level:${defaultLevel} must be included in custom levels`);
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
let labels = Object.assign(
|
|
996
|
+
Object.create(Object.prototype, { silent: { value: 1 / 0 } }),
|
|
997
|
+
useOnlyCustomLevels ? null : DEFAULT_LEVELS,
|
|
998
|
+
customLevels
|
|
999
|
+
);
|
|
1000
|
+
if (!(defaultLevel in labels))
|
|
1001
|
+
throw Error(`default level:${defaultLevel} must be included in custom levels`);
|
|
1002
|
+
}
|
|
1003
|
+
function assertNoLevelCollisions(levels, customLevels) {
|
|
1004
|
+
let { labels, values } = levels;
|
|
1005
|
+
for (let k in customLevels) {
|
|
1006
|
+
if (k in values)
|
|
1007
|
+
throw Error("levels cannot be overridden");
|
|
1008
|
+
if (customLevels[k] in labels)
|
|
1009
|
+
throw Error("pre-existing level values cannot be used for new levels");
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
function assertLevelComparison(levelComparison) {
|
|
1013
|
+
if (typeof levelComparison != "function" && !(typeof levelComparison == "string" && Object.values(SORTING_ORDER).includes(levelComparison)))
|
|
1014
|
+
throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type');
|
|
1015
|
+
}
|
|
1016
|
+
module.exports = {
|
|
1017
|
+
initialLsCache,
|
|
1018
|
+
genLsCache,
|
|
1019
|
+
levelMethods,
|
|
1020
|
+
getLevel,
|
|
1021
|
+
setLevel,
|
|
1022
|
+
isLevelEnabled,
|
|
1023
|
+
mappings,
|
|
1024
|
+
assertNoLevelCollisions,
|
|
1025
|
+
assertDefaultLevelFound,
|
|
1026
|
+
genLevelComparison,
|
|
1027
|
+
assertLevelComparison
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
|
|
1032
|
+
// node_modules/pino/lib/meta.js
|
|
1033
|
+
var require_meta = __commonJS({
|
|
1034
|
+
"node_modules/pino/lib/meta.js"(exports, module) {
|
|
1035
|
+
"use strict";
|
|
1036
|
+
module.exports = { version: "10.3.1" };
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
|
|
1040
|
+
// node_modules/pino/lib/proto.js
|
|
1041
|
+
var require_proto = __commonJS({
|
|
1042
|
+
"node_modules/pino/lib/proto.js"(exports, module) {
|
|
1043
|
+
"use strict";
|
|
1044
|
+
var { EventEmitter } = __require("node:events"), {
|
|
1045
|
+
lsCacheSym,
|
|
1046
|
+
levelValSym,
|
|
1047
|
+
setLevelSym,
|
|
1048
|
+
getLevelSym,
|
|
1049
|
+
chindingsSym,
|
|
1050
|
+
mixinSym,
|
|
1051
|
+
asJsonSym,
|
|
1052
|
+
writeSym,
|
|
1053
|
+
mixinMergeStrategySym,
|
|
1054
|
+
timeSym,
|
|
1055
|
+
timeSliceIndexSym,
|
|
1056
|
+
streamSym,
|
|
1057
|
+
serializersSym,
|
|
1058
|
+
formattersSym,
|
|
1059
|
+
errorKeySym,
|
|
1060
|
+
messageKeySym,
|
|
1061
|
+
useOnlyCustomLevelsSym,
|
|
1062
|
+
needsMetadataGsym,
|
|
1063
|
+
redactFmtSym,
|
|
1064
|
+
stringifySym,
|
|
1065
|
+
formatOptsSym,
|
|
1066
|
+
stringifiersSym,
|
|
1067
|
+
msgPrefixSym,
|
|
1068
|
+
hooksSym
|
|
1069
|
+
} = require_symbols(), {
|
|
1070
|
+
getLevel,
|
|
1071
|
+
setLevel,
|
|
1072
|
+
isLevelEnabled,
|
|
1073
|
+
mappings,
|
|
1074
|
+
initialLsCache,
|
|
1075
|
+
genLsCache,
|
|
1076
|
+
assertNoLevelCollisions
|
|
1077
|
+
} = require_levels(), {
|
|
1078
|
+
asChindings,
|
|
1079
|
+
asJson,
|
|
1080
|
+
buildFormatters,
|
|
1081
|
+
stringify,
|
|
1082
|
+
noop
|
|
1083
|
+
} = require_tools(), {
|
|
1084
|
+
version
|
|
1085
|
+
} = require_meta(), redaction = require_redaction(), constructor = class {
|
|
1086
|
+
}, prototype = {
|
|
1087
|
+
constructor,
|
|
1088
|
+
child,
|
|
1089
|
+
bindings,
|
|
1090
|
+
setBindings,
|
|
1091
|
+
flush,
|
|
1092
|
+
isLevelEnabled,
|
|
1093
|
+
version,
|
|
1094
|
+
get level() {
|
|
1095
|
+
return this[getLevelSym]();
|
|
1096
|
+
},
|
|
1097
|
+
set level(lvl) {
|
|
1098
|
+
this[setLevelSym](lvl);
|
|
1099
|
+
},
|
|
1100
|
+
get levelVal() {
|
|
1101
|
+
return this[levelValSym];
|
|
1102
|
+
},
|
|
1103
|
+
set levelVal(n) {
|
|
1104
|
+
throw Error("levelVal is read-only");
|
|
1105
|
+
},
|
|
1106
|
+
get msgPrefix() {
|
|
1107
|
+
return this[msgPrefixSym];
|
|
1108
|
+
},
|
|
1109
|
+
get [Symbol.toStringTag]() {
|
|
1110
|
+
return "Pino";
|
|
1111
|
+
},
|
|
1112
|
+
[lsCacheSym]: initialLsCache,
|
|
1113
|
+
[writeSym]: write,
|
|
1114
|
+
[asJsonSym]: asJson,
|
|
1115
|
+
[getLevelSym]: getLevel,
|
|
1116
|
+
[setLevelSym]: setLevel
|
|
1117
|
+
};
|
|
1118
|
+
Object.setPrototypeOf(prototype, EventEmitter.prototype);
|
|
1119
|
+
module.exports = function() {
|
|
1120
|
+
return Object.create(prototype);
|
|
1121
|
+
};
|
|
1122
|
+
var resetChildingsFormatter = (bindings2) => bindings2;
|
|
1123
|
+
function child(bindings2, options) {
|
|
1124
|
+
if (!bindings2)
|
|
1125
|
+
throw Error("missing bindings for child Pino");
|
|
1126
|
+
let serializers = this[serializersSym], formatters = this[formattersSym], instance = Object.create(this);
|
|
1127
|
+
if (options == null)
|
|
1128
|
+
return instance[formattersSym].bindings !== resetChildingsFormatter && (instance[formattersSym] = buildFormatters(
|
|
1129
|
+
formatters.level,
|
|
1130
|
+
resetChildingsFormatter,
|
|
1131
|
+
formatters.log
|
|
1132
|
+
)), instance[chindingsSym] = asChindings(instance, bindings2), this.onChild !== noop && this.onChild(instance), instance;
|
|
1133
|
+
if (options.hasOwnProperty("serializers") === !0) {
|
|
1134
|
+
instance[serializersSym] = /* @__PURE__ */ Object.create(null);
|
|
1135
|
+
for (let k in serializers)
|
|
1136
|
+
instance[serializersSym][k] = serializers[k];
|
|
1137
|
+
let parentSymbols = Object.getOwnPropertySymbols(serializers);
|
|
1138
|
+
for (var i = 0; i < parentSymbols.length; i++) {
|
|
1139
|
+
let ks = parentSymbols[i];
|
|
1140
|
+
instance[serializersSym][ks] = serializers[ks];
|
|
1141
|
+
}
|
|
1142
|
+
for (let bk in options.serializers)
|
|
1143
|
+
instance[serializersSym][bk] = options.serializers[bk];
|
|
1144
|
+
let bindingsSymbols = Object.getOwnPropertySymbols(options.serializers);
|
|
1145
|
+
for (var bi = 0; bi < bindingsSymbols.length; bi++) {
|
|
1146
|
+
let bks = bindingsSymbols[bi];
|
|
1147
|
+
instance[serializersSym][bks] = options.serializers[bks];
|
|
1148
|
+
}
|
|
1149
|
+
} else instance[serializersSym] = serializers;
|
|
1150
|
+
if (options.hasOwnProperty("formatters")) {
|
|
1151
|
+
let { level, bindings: chindings, log } = options.formatters;
|
|
1152
|
+
instance[formattersSym] = buildFormatters(
|
|
1153
|
+
level || formatters.level,
|
|
1154
|
+
chindings || resetChildingsFormatter,
|
|
1155
|
+
log || formatters.log
|
|
1156
|
+
);
|
|
1157
|
+
} else
|
|
1158
|
+
instance[formattersSym] = buildFormatters(
|
|
1159
|
+
formatters.level,
|
|
1160
|
+
resetChildingsFormatter,
|
|
1161
|
+
formatters.log
|
|
1162
|
+
);
|
|
1163
|
+
if (options.hasOwnProperty("customLevels") === !0 && (assertNoLevelCollisions(this.levels, options.customLevels), instance.levels = mappings(options.customLevels, instance[useOnlyCustomLevelsSym]), genLsCache(instance)), typeof options.redact == "object" && options.redact !== null || Array.isArray(options.redact)) {
|
|
1164
|
+
instance.redact = options.redact;
|
|
1165
|
+
let stringifiers = redaction(instance.redact, stringify), formatOpts = { stringify: stringifiers[redactFmtSym] };
|
|
1166
|
+
instance[stringifySym] = stringify, instance[stringifiersSym] = stringifiers, instance[formatOptsSym] = formatOpts;
|
|
1167
|
+
}
|
|
1168
|
+
if (typeof options.msgPrefix == "string" && (instance[msgPrefixSym] = (this[msgPrefixSym] || "") + options.msgPrefix), instance[chindingsSym] = asChindings(instance, bindings2), options.level !== void 0 && options.level !== this.level || options.hasOwnProperty("customLevels")) {
|
|
1169
|
+
let childLevel = options.level || this.level;
|
|
1170
|
+
instance[setLevelSym](childLevel);
|
|
1171
|
+
}
|
|
1172
|
+
return this.onChild(instance), instance;
|
|
1173
|
+
}
|
|
1174
|
+
function bindings() {
|
|
1175
|
+
let chindingsJson = `{${this[chindingsSym].substr(1)}}`, bindingsFromJson = JSON.parse(chindingsJson);
|
|
1176
|
+
return delete bindingsFromJson.pid, delete bindingsFromJson.hostname, bindingsFromJson;
|
|
1177
|
+
}
|
|
1178
|
+
function setBindings(newBindings) {
|
|
1179
|
+
let chindings = asChindings(this, newBindings);
|
|
1180
|
+
this[chindingsSym] = chindings;
|
|
1181
|
+
}
|
|
1182
|
+
function defaultMixinMergeStrategy(mergeObject, mixinObject) {
|
|
1183
|
+
return Object.assign(mixinObject, mergeObject);
|
|
1184
|
+
}
|
|
1185
|
+
function write(_obj, msg, num) {
|
|
1186
|
+
let t = this[timeSym](), mixin = this[mixinSym], errorKey = this[errorKeySym], messageKey = this[messageKeySym], mixinMergeStrategy = this[mixinMergeStrategySym] || defaultMixinMergeStrategy, obj, streamWriteHook = this[hooksSym].streamWrite;
|
|
1187
|
+
_obj == null ? obj = {} : _obj instanceof Error ? (obj = { [errorKey]: _obj }, msg === void 0 && (msg = _obj.message)) : (obj = _obj, msg === void 0 && _obj[messageKey] === void 0 && _obj[errorKey] && (msg = _obj[errorKey].message)), mixin && (obj = mixinMergeStrategy(obj, mixin(obj, num, this)));
|
|
1188
|
+
let s = this[asJsonSym](obj, msg, num, t), stream = this[streamSym];
|
|
1189
|
+
stream[needsMetadataGsym] === !0 && (stream.lastLevel = num, stream.lastObj = obj, stream.lastMsg = msg, stream.lastTime = t.slice(this[timeSliceIndexSym]), stream.lastLogger = this), stream.write(streamWriteHook ? streamWriteHook(s) : s);
|
|
1190
|
+
}
|
|
1191
|
+
function flush(cb) {
|
|
1192
|
+
if (cb != null && typeof cb != "function")
|
|
1193
|
+
throw Error("callback must be a function");
|
|
1194
|
+
let stream = this[streamSym];
|
|
1195
|
+
typeof stream.flush == "function" ? stream.flush(cb || noop) : cb && cb();
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
|
|
1200
|
+
// node_modules/pino/lib/multistream.js
|
|
1201
|
+
var require_multistream = __commonJS({
|
|
1202
|
+
"node_modules/pino/lib/multistream.js"(exports, module) {
|
|
1203
|
+
"use strict";
|
|
1204
|
+
var metadata = /* @__PURE__ */ Symbol.for("pino.metadata"), { DEFAULT_LEVELS } = require_constants(), DEFAULT_INFO_LEVEL = DEFAULT_LEVELS.info;
|
|
1205
|
+
function multistream(streamsArray, opts) {
|
|
1206
|
+
streamsArray = streamsArray || [], opts = opts || { dedupe: !1 };
|
|
1207
|
+
let streamLevels = Object.create(DEFAULT_LEVELS);
|
|
1208
|
+
streamLevels.silent = 1 / 0, opts.levels && typeof opts.levels == "object" && Object.keys(opts.levels).forEach((i) => {
|
|
1209
|
+
streamLevels[i] = opts.levels[i];
|
|
1210
|
+
});
|
|
1211
|
+
let res = {
|
|
1212
|
+
write,
|
|
1213
|
+
add,
|
|
1214
|
+
remove,
|
|
1215
|
+
emit,
|
|
1216
|
+
flushSync,
|
|
1217
|
+
end,
|
|
1218
|
+
minLevel: 0,
|
|
1219
|
+
lastId: 0,
|
|
1220
|
+
streams: [],
|
|
1221
|
+
clone,
|
|
1222
|
+
[metadata]: !0,
|
|
1223
|
+
streamLevels
|
|
1224
|
+
};
|
|
1225
|
+
return Array.isArray(streamsArray) ? streamsArray.forEach(add, res) : add.call(res, streamsArray), streamsArray = null, res;
|
|
1226
|
+
function write(data) {
|
|
1227
|
+
let dest, level = this.lastLevel, { streams } = this, recordedLevel = 0, stream;
|
|
1228
|
+
for (let i = initLoopVar(streams.length, opts.dedupe); checkLoopVar(i, streams.length, opts.dedupe); i = adjustLoopVar(i, opts.dedupe))
|
|
1229
|
+
if (dest = streams[i], dest.level <= level) {
|
|
1230
|
+
if (recordedLevel !== 0 && recordedLevel !== dest.level)
|
|
1231
|
+
break;
|
|
1232
|
+
if (stream = dest.stream, stream[metadata]) {
|
|
1233
|
+
let { lastTime, lastMsg, lastObj, lastLogger } = this;
|
|
1234
|
+
stream.lastLevel = level, stream.lastTime = lastTime, stream.lastMsg = lastMsg, stream.lastObj = lastObj, stream.lastLogger = lastLogger;
|
|
1235
|
+
}
|
|
1236
|
+
stream.write(data), opts.dedupe && (recordedLevel = dest.level);
|
|
1237
|
+
} else if (!opts.dedupe)
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1240
|
+
function emit(...args) {
|
|
1241
|
+
for (let { stream } of this.streams)
|
|
1242
|
+
typeof stream.emit == "function" && stream.emit(...args);
|
|
1243
|
+
}
|
|
1244
|
+
function flushSync() {
|
|
1245
|
+
for (let { stream } of this.streams)
|
|
1246
|
+
typeof stream.flushSync == "function" && stream.flushSync();
|
|
1247
|
+
}
|
|
1248
|
+
function add(dest) {
|
|
1249
|
+
if (!dest)
|
|
1250
|
+
return res;
|
|
1251
|
+
let isStream = typeof dest.write == "function" || dest.stream, stream_ = dest.write ? dest : dest.stream;
|
|
1252
|
+
if (!isStream)
|
|
1253
|
+
throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");
|
|
1254
|
+
let { streams, streamLevels: streamLevels2 } = this, level;
|
|
1255
|
+
typeof dest.levelVal == "number" ? level = dest.levelVal : typeof dest.level == "string" ? level = streamLevels2[dest.level] : typeof dest.level == "number" ? level = dest.level : level = DEFAULT_INFO_LEVEL;
|
|
1256
|
+
let dest_ = {
|
|
1257
|
+
stream: stream_,
|
|
1258
|
+
level,
|
|
1259
|
+
levelVal: void 0,
|
|
1260
|
+
id: ++res.lastId
|
|
1261
|
+
};
|
|
1262
|
+
return streams.unshift(dest_), streams.sort(compareByLevel), this.minLevel = streams[0].level, res;
|
|
1263
|
+
}
|
|
1264
|
+
function remove(id) {
|
|
1265
|
+
let { streams } = this, index = streams.findIndex((s) => s.id === id);
|
|
1266
|
+
return index >= 0 && (streams.splice(index, 1), streams.sort(compareByLevel), this.minLevel = streams.length > 0 ? streams[0].level : -1), res;
|
|
1267
|
+
}
|
|
1268
|
+
function end() {
|
|
1269
|
+
for (let { stream } of this.streams)
|
|
1270
|
+
typeof stream.flushSync == "function" && stream.flushSync(), stream.end();
|
|
1271
|
+
}
|
|
1272
|
+
function clone(level) {
|
|
1273
|
+
let streams = new Array(this.streams.length);
|
|
1274
|
+
for (let i = 0; i < streams.length; i++)
|
|
1275
|
+
streams[i] = {
|
|
1276
|
+
level,
|
|
1277
|
+
stream: this.streams[i].stream
|
|
1278
|
+
};
|
|
1279
|
+
return {
|
|
1280
|
+
write,
|
|
1281
|
+
add,
|
|
1282
|
+
remove,
|
|
1283
|
+
minLevel: level,
|
|
1284
|
+
streams,
|
|
1285
|
+
clone,
|
|
1286
|
+
emit,
|
|
1287
|
+
flushSync,
|
|
1288
|
+
[metadata]: !0
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
function compareByLevel(a, b) {
|
|
1293
|
+
return a.level - b.level;
|
|
1294
|
+
}
|
|
1295
|
+
function initLoopVar(length, dedupe) {
|
|
1296
|
+
return dedupe ? length - 1 : 0;
|
|
1297
|
+
}
|
|
1298
|
+
function adjustLoopVar(i, dedupe) {
|
|
1299
|
+
return dedupe ? i - 1 : i + 1;
|
|
1300
|
+
}
|
|
1301
|
+
function checkLoopVar(i, length, dedupe) {
|
|
1302
|
+
return dedupe ? i >= 0 : i < length;
|
|
1303
|
+
}
|
|
1304
|
+
module.exports = multistream;
|
|
1305
|
+
}
|
|
1306
|
+
});
|
|
1307
|
+
|
|
1308
|
+
// node_modules/pino/pino.js
|
|
1309
|
+
var require_pino = __commonJS({
|
|
1310
|
+
"node_modules/pino/pino.js"(exports, module) {
|
|
1311
|
+
"use strict";
|
|
1312
|
+
var os = __require("node:os"), stdSerializers = require_pino_std_serializers(), caller = require_caller(), redaction = require_redaction(), time = require_time(), proto = require_proto(), symbols = require_symbols(), { configure } = require_safe_stable_stringify(), { assertDefaultLevelFound, mappings, genLsCache, genLevelComparison, assertLevelComparison } = require_levels(), { DEFAULT_LEVELS, SORTING_ORDER } = require_constants(), {
|
|
1313
|
+
createArgsNormalizer,
|
|
1314
|
+
asChindings,
|
|
1315
|
+
buildSafeSonicBoom,
|
|
1316
|
+
buildFormatters,
|
|
1317
|
+
stringify,
|
|
1318
|
+
normalizeDestFileDescriptor,
|
|
1319
|
+
noop
|
|
1320
|
+
} = require_tools(), { version } = require_meta(), {
|
|
1321
|
+
chindingsSym,
|
|
1322
|
+
redactFmtSym,
|
|
1323
|
+
serializersSym,
|
|
1324
|
+
timeSym,
|
|
1325
|
+
timeSliceIndexSym,
|
|
1326
|
+
streamSym,
|
|
1327
|
+
stringifySym,
|
|
1328
|
+
stringifySafeSym,
|
|
1329
|
+
stringifiersSym,
|
|
1330
|
+
setLevelSym,
|
|
1331
|
+
endSym,
|
|
1332
|
+
formatOptsSym,
|
|
1333
|
+
messageKeySym,
|
|
1334
|
+
errorKeySym,
|
|
1335
|
+
nestedKeySym,
|
|
1336
|
+
mixinSym,
|
|
1337
|
+
levelCompSym,
|
|
1338
|
+
useOnlyCustomLevelsSym,
|
|
1339
|
+
formattersSym,
|
|
1340
|
+
hooksSym,
|
|
1341
|
+
nestedKeyStrSym,
|
|
1342
|
+
mixinMergeStrategySym,
|
|
1343
|
+
msgPrefixSym
|
|
1344
|
+
} = symbols, { epochTime, nullTime } = time, { pid } = process, hostname = os.hostname(), defaultErrorSerializer = stdSerializers.err, defaultOptions = {
|
|
1345
|
+
level: "info",
|
|
1346
|
+
levelComparison: SORTING_ORDER.ASC,
|
|
1347
|
+
levels: DEFAULT_LEVELS,
|
|
1348
|
+
messageKey: "msg",
|
|
1349
|
+
errorKey: "err",
|
|
1350
|
+
nestedKey: null,
|
|
1351
|
+
enabled: !0,
|
|
1352
|
+
base: { pid, hostname },
|
|
1353
|
+
serializers: Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
1354
|
+
err: defaultErrorSerializer
|
|
1355
|
+
}),
|
|
1356
|
+
formatters: Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
1357
|
+
bindings(bindings) {
|
|
1358
|
+
return bindings;
|
|
1359
|
+
},
|
|
1360
|
+
level(label, number) {
|
|
1361
|
+
return { level: number };
|
|
1362
|
+
}
|
|
1363
|
+
}),
|
|
1364
|
+
hooks: {
|
|
1365
|
+
logMethod: void 0,
|
|
1366
|
+
streamWrite: void 0
|
|
1367
|
+
},
|
|
1368
|
+
timestamp: epochTime,
|
|
1369
|
+
name: void 0,
|
|
1370
|
+
redact: null,
|
|
1371
|
+
customLevels: null,
|
|
1372
|
+
useOnlyCustomLevels: !1,
|
|
1373
|
+
depthLimit: 5,
|
|
1374
|
+
edgeLimit: 100
|
|
1375
|
+
}, normalize = createArgsNormalizer(defaultOptions), serializers = Object.assign(/* @__PURE__ */ Object.create(null), stdSerializers);
|
|
1376
|
+
function pino(...args) {
|
|
1377
|
+
let instance = {}, { opts, stream } = normalize(instance, caller(), ...args);
|
|
1378
|
+
opts.level && typeof opts.level == "string" && DEFAULT_LEVELS[opts.level.toLowerCase()] !== void 0 && (opts.level = opts.level.toLowerCase());
|
|
1379
|
+
let {
|
|
1380
|
+
redact,
|
|
1381
|
+
crlf,
|
|
1382
|
+
serializers: serializers2,
|
|
1383
|
+
timestamp,
|
|
1384
|
+
messageKey,
|
|
1385
|
+
errorKey,
|
|
1386
|
+
nestedKey,
|
|
1387
|
+
base,
|
|
1388
|
+
name,
|
|
1389
|
+
level,
|
|
1390
|
+
customLevels,
|
|
1391
|
+
levelComparison,
|
|
1392
|
+
mixin,
|
|
1393
|
+
mixinMergeStrategy,
|
|
1394
|
+
useOnlyCustomLevels,
|
|
1395
|
+
formatters,
|
|
1396
|
+
hooks,
|
|
1397
|
+
depthLimit,
|
|
1398
|
+
edgeLimit,
|
|
1399
|
+
onChild,
|
|
1400
|
+
msgPrefix
|
|
1401
|
+
} = opts, stringifySafe = configure({
|
|
1402
|
+
maximumDepth: depthLimit,
|
|
1403
|
+
maximumBreadth: edgeLimit
|
|
1404
|
+
}), allFormatters = buildFormatters(
|
|
1405
|
+
formatters.level,
|
|
1406
|
+
formatters.bindings,
|
|
1407
|
+
formatters.log
|
|
1408
|
+
), stringifyFn = stringify.bind({
|
|
1409
|
+
[stringifySafeSym]: stringifySafe
|
|
1410
|
+
}), stringifiers = redact ? redaction(redact, stringifyFn) : {}, formatOpts = redact ? { stringify: stringifiers[redactFmtSym] } : { stringify: stringifyFn }, end = "}" + (crlf ? `\r
|
|
1411
|
+
` : `
|
|
1412
|
+
`), coreChindings = asChindings.bind(null, {
|
|
1413
|
+
[chindingsSym]: "",
|
|
1414
|
+
[serializersSym]: serializers2,
|
|
1415
|
+
[stringifiersSym]: stringifiers,
|
|
1416
|
+
[stringifySym]: stringify,
|
|
1417
|
+
[stringifySafeSym]: stringifySafe,
|
|
1418
|
+
[formattersSym]: allFormatters
|
|
1419
|
+
}), chindings = "";
|
|
1420
|
+
base !== null && (name === void 0 ? chindings = coreChindings(base) : chindings = coreChindings(Object.assign({}, base, { name })));
|
|
1421
|
+
let time2 = timestamp instanceof Function ? timestamp : timestamp ? epochTime : nullTime, timeSliceIndex = time2().indexOf(":") + 1;
|
|
1422
|
+
if (useOnlyCustomLevels && !customLevels) throw Error("customLevels is required if useOnlyCustomLevels is set true");
|
|
1423
|
+
if (mixin && typeof mixin != "function") throw Error(`Unknown mixin type "${typeof mixin}" - expected "function"`);
|
|
1424
|
+
if (msgPrefix && typeof msgPrefix != "string") throw Error(`Unknown msgPrefix type "${typeof msgPrefix}" - expected "string"`);
|
|
1425
|
+
assertDefaultLevelFound(level, customLevels, useOnlyCustomLevels);
|
|
1426
|
+
let levels = mappings(customLevels, useOnlyCustomLevels);
|
|
1427
|
+
typeof stream.emit == "function" && stream.emit("message", { code: "PINO_CONFIG", config: { levels, messageKey, errorKey } }), assertLevelComparison(levelComparison);
|
|
1428
|
+
let levelCompFunc = genLevelComparison(levelComparison);
|
|
1429
|
+
return Object.assign(instance, {
|
|
1430
|
+
levels,
|
|
1431
|
+
[levelCompSym]: levelCompFunc,
|
|
1432
|
+
[useOnlyCustomLevelsSym]: useOnlyCustomLevels,
|
|
1433
|
+
[streamSym]: stream,
|
|
1434
|
+
[timeSym]: time2,
|
|
1435
|
+
[timeSliceIndexSym]: timeSliceIndex,
|
|
1436
|
+
[stringifySym]: stringify,
|
|
1437
|
+
[stringifySafeSym]: stringifySafe,
|
|
1438
|
+
[stringifiersSym]: stringifiers,
|
|
1439
|
+
[endSym]: end,
|
|
1440
|
+
[formatOptsSym]: formatOpts,
|
|
1441
|
+
[messageKeySym]: messageKey,
|
|
1442
|
+
[errorKeySym]: errorKey,
|
|
1443
|
+
[nestedKeySym]: nestedKey,
|
|
1444
|
+
// protect against injection
|
|
1445
|
+
[nestedKeyStrSym]: nestedKey ? `,${JSON.stringify(nestedKey)}:{` : "",
|
|
1446
|
+
[serializersSym]: serializers2,
|
|
1447
|
+
[mixinSym]: mixin,
|
|
1448
|
+
[mixinMergeStrategySym]: mixinMergeStrategy,
|
|
1449
|
+
[chindingsSym]: chindings,
|
|
1450
|
+
[formattersSym]: allFormatters,
|
|
1451
|
+
[hooksSym]: hooks,
|
|
1452
|
+
silent: noop,
|
|
1453
|
+
onChild,
|
|
1454
|
+
[msgPrefixSym]: msgPrefix
|
|
1455
|
+
}), Object.setPrototypeOf(instance, proto()), genLsCache(instance), instance[setLevelSym](level), instance;
|
|
1456
|
+
}
|
|
1457
|
+
module.exports = pino;
|
|
1458
|
+
module.exports.destination = (dest = process.stdout.fd) => typeof dest == "object" ? (dest.dest = normalizeDestFileDescriptor(dest.dest || process.stdout.fd), buildSafeSonicBoom(dest)) : buildSafeSonicBoom({ dest: normalizeDestFileDescriptor(dest), minLength: 0 });
|
|
1459
|
+
module.exports.transport = require_transport();
|
|
1460
|
+
module.exports.multistream = require_multistream();
|
|
1461
|
+
module.exports.levels = mappings();
|
|
1462
|
+
module.exports.stdSerializers = serializers;
|
|
1463
|
+
module.exports.stdTimeFunctions = Object.assign({}, time);
|
|
1464
|
+
module.exports.symbols = symbols;
|
|
1465
|
+
module.exports.version = version;
|
|
1466
|
+
module.exports.default = pino;
|
|
1467
|
+
module.exports.pino = pino;
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
|
|
1471
|
+
export {
|
|
1472
|
+
require_pino
|
|
1473
|
+
};
|