@kky42/pievo-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +17 -0
- package/.output/public/assets/CodeField-dOzyFQNH.js +34 -0
- package/.output/public/assets/LoopView-B4H9QibC.js +55 -0
- package/.output/public/assets/Modal-D33gNSgx.js +1 -0
- package/.output/public/assets/SignIn-SHuRRyOv.js +1 -0
- package/.output/public/assets/actionUi-ChGGALzg.js +1 -0
- package/.output/public/assets/app-DElSo_jy.css +2 -0
- package/.output/public/assets/artifactView-DFuubXLJ.js +66 -0
- package/.output/public/assets/index-DfpTWRSz.js +12 -0
- package/.output/public/assets/invite._token-DJtd-XE2.js +1 -0
- package/.output/public/assets/invite._token-T8oo4Qtw.js +1 -0
- package/.output/public/assets/jsx-runtime-BseJUIpC.js +1 -0
- package/.output/public/assets/lifecycleUi-DKkChdnU.js +1 -0
- package/.output/public/assets/loopApi-BM2nj71x.js +3 -0
- package/.output/public/assets/loops._loopId-B19Jw7jC.js +5 -0
- package/.output/public/assets/loops._loopId_.runs._runId-_CflHV38.js +3 -0
- package/.output/public/assets/notifyFns-DCubjpRy.js +1 -0
- package/.output/public/assets/preload-helper-CKUiEq3b.js +3 -0
- package/.output/public/assets/routes-B9tgli5f.js +1 -0
- package/.output/public/assets/routes-CTtlM_qt.js +1 -0
- package/.output/public/assets/t._teamId-Bm21mngW.js +1 -0
- package/.output/public/assets/t._teamId-gR7BVKkR.js +1 -0
- package/.output/public/assets/ui-Dp88qUWh.js +1 -0
- package/.output/public/assets/useRouter-DsjH8G0p.js +1 -0
- package/.output/public/favicon.svg +12 -0
- package/.output/public/fonts/GeistPixel-Square.woff2 +0 -0
- package/.output/server/_chunks/ssr-renderer.mjs +26 -0
- package/.output/server/_libs/@aws-crypto/crc32+[...].mjs +419 -0
- package/.output/server/_libs/@aws-sdk/checksums+[...].mjs +10732 -0
- package/.output/server/_libs/@aws-sdk/client-s3+[...].mjs +9475 -0
- package/.output/server/_libs/@aws-sdk/credential-provider-http+[...].mjs +137 -0
- package/.output/server/_libs/@aws-sdk/credential-provider-ini+[...].mjs +440 -0
- package/.output/server/_libs/@aws-sdk/credential-provider-process+[...].mjs +62 -0
- package/.output/server/_libs/@aws-sdk/credential-provider-sso+[...].mjs +818 -0
- package/.output/server/_libs/@aws-sdk/credential-provider-web-identity+[...].mjs +59 -0
- package/.output/server/_libs/@base-ui/react+[...].mjs +11125 -0
- package/.output/server/_libs/@codemirror/autocomplete+[...].mjs +19713 -0
- package/.output/server/_libs/@codemirror/lang-css+[...].mjs +2636 -0
- package/.output/server/_libs/@codemirror/lang-html+[...].mjs +2247 -0
- package/.output/server/_libs/@codemirror/lang-json+[...].mjs +79 -0
- package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1736 -0
- package/.output/server/_libs/@smithy/credential-provider-imds+[...].mjs +342 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +14300 -0
- package/.output/server/_libs/@uiw/codemirror-extensions-basic-setup+[...].mjs +76 -0
- package/.output/server/_libs/atomic-sleep.mjs +27 -0
- package/.output/server/_libs/aws-crypto__crc32c.mjs +314 -0
- package/.output/server/_libs/aws-sdk__nested-clients.mjs +2671 -0
- package/.output/server/_libs/babel__runtime.mjs +30 -0
- package/.output/server/_libs/clsx.mjs +16 -0
- package/.output/server/_libs/codemirror__commands.mjs +1725 -0
- package/.output/server/_libs/codemirror__lint.mjs +565 -0
- package/.output/server/_libs/codemirror__search.mjs +1138 -0
- package/.output/server/_libs/codemirror__theme-one-dark.mjs +161 -0
- package/.output/server/_libs/colorette.mjs +129 -0
- package/.output/server/_libs/croner.mjs +735 -0
- package/.output/server/_libs/d3-array.mjs +231 -0
- package/.output/server/_libs/d3-color.mjs +330 -0
- package/.output/server/_libs/d3-format.mjs +252 -0
- package/.output/server/_libs/d3-interpolate.mjs +163 -0
- package/.output/server/_libs/d3-path.mjs +77 -0
- package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
- package/.output/server/_libs/d3-shape.mjs +689 -0
- package/.output/server/_libs/dateformat.mjs +341 -0
- package/.output/server/_libs/decimal.js-light.mjs +884 -0
- package/.output/server/_libs/diff.mjs +732 -0
- package/.output/server/_libs/dom-serializer+[...].mjs +708 -0
- package/.output/server/_libs/domhandler.mjs +461 -0
- package/.output/server/_libs/dompurify.mjs +2111 -0
- package/.output/server/_libs/domutils.mjs +868 -0
- package/.output/server/_libs/drizzle-orm+postgres.mjs +7689 -0
- package/.output/server/_libs/electric-sql__pglite.mjs +14674 -0
- package/.output/server/_libs/end-of-stream+once+wrappy.mjs +145 -0
- package/.output/server/_libs/es-toolkit.mjs +1737 -0
- package/.output/server/_libs/eventemitter3.mjs +236 -0
- package/.output/server/_libs/fast-copy.mjs +285 -0
- package/.output/server/_libs/fast-safe-stringify.mjs +172 -0
- package/.output/server/_libs/h3+rou3+srvx.mjs +1201 -0
- package/.output/server/_libs/html-dom-parser+htmlparser2.mjs +1560 -0
- package/.output/server/_libs/html-react-parser+[...].mjs +1360 -0
- package/.output/server/_libs/initdb.wasm +0 -0
- package/.output/server/_libs/marked.mjs +1548 -0
- package/.output/server/_libs/on-exit-leak-free.mjs +80 -0
- package/.output/server/_libs/pglite.data +37667 -8
- package/.output/server/_libs/pglite.wasm +0 -0
- package/.output/server/_libs/pino+[...].mjs +3196 -0
- package/.output/server/_libs/pino-abstract-transport+split2.mjs +194 -0
- package/.output/server/_libs/pino-pretty+[...].mjs +1623 -0
- package/.output/server/_libs/pinojs__redact.mjs +280 -0
- package/.output/server/_libs/react-redux+[...].mjs +205 -0
- package/.output/server/_libs/recharts+victory-vendor.mjs +15875 -0
- package/.output/server/_libs/tanstack__history.mjs +342 -0
- package/.output/server/_libs/ufo.mjs +64 -0
- package/.output/server/_libs/uiw__codemirror-themes.mjs +32 -0
- package/.output/server/_libs/uiw__react-codemirror.mjs +354 -0
- package/.output/server/_runtime.mjs +37 -0
- package/.output/server/_ssr/CodeField-tm4rr6G3.mjs +143 -0
- package/.output/server/_ssr/DashboardView-CC7htv28.mjs +2795 -0
- package/.output/server/_ssr/LoopPlaybook-BXH8mhiX.mjs +2105 -0
- package/.output/server/_ssr/LoopView-DCugEbHx.mjs +1106 -0
- package/.output/server/_ssr/Modal-DpKZHLZK.mjs +49 -0
- package/.output/server/_ssr/SignIn-dTndU6Hw.mjs +67 -0
- package/.output/server/_ssr/actionUi-CZbEixbf.mjs +119 -0
- package/.output/server/_ssr/adapters-BS8XosjF.mjs +130 -0
- package/.output/server/_ssr/artifactFiles-Cagtj7J0.mjs +61 -0
- package/.output/server/_ssr/artifactKind-BW0isV8L.mjs +37 -0
- package/.output/server/_ssr/artifactView-DS4O22wl.mjs +304 -0
- package/.output/server/_ssr/artifacts-DngKyW2u.mjs +2 -0
- package/.output/server/_ssr/auth-DY1DuYZd.mjs +38429 -0
- package/.output/server/_ssr/boot-BbtG0ImW.mjs +9010 -0
- package/.output/server/_ssr/boot-CMHTxQpJ.mjs +2 -0
- package/.output/server/_ssr/bun-sqlite-dialect-BW9W1_Ps-CU1Spd6z.mjs +162 -0
- package/.output/server/_ssr/core-RrmWoKne.mjs +5 -0
- package/.output/server/_ssr/createServerRpc-BD8Xn_0_.mjs +12 -0
- package/.output/server/_ssr/d1-sqlite-dialect-BLC8LXE6-DfG7tB8s.mjs +112 -0
- package/.output/server/_ssr/db-DWAuZq1o.mjs +2 -0
- package/.output/server/_ssr/dist-BIxFFVZg.mjs +342 -0
- package/.output/server/_ssr/empty-plugin-adapters-DKUlnwwl.mjs +5 -0
- package/.output/server/_ssr/factory-Blq0DYfT.mjs +6903 -0
- package/.output/server/_ssr/invite._token-BRCo9LGB.mjs +36 -0
- package/.output/server/_ssr/invite._token-DJxGLILJ.mjs +28 -0
- package/.output/server/_ssr/invite._token-NewFt27g.mjs +92 -0
- package/.output/server/_ssr/kysely-adapter-D3XTe64J.mjs +2 -0
- package/.output/server/_ssr/kysely-migration-tables-JkVUjPF_-bPAX9LR_.mjs +19 -0
- package/.output/server/_ssr/lifecycleUi-C9lg1r3r.mjs +38 -0
- package/.output/server/_ssr/logger-Dw82jNjH.mjs +2 -0
- package/.output/server/_ssr/loopApi-BtfkZQYK.mjs +532 -0
- package/.output/server/_ssr/loopApi-Cxe8WyOB.mjs +105 -0
- package/.output/server/_ssr/loops._loopId-7NQJPB9W.mjs +30 -0
- package/.output/server/_ssr/loops._loopId-DhnArGdL.mjs +1635 -0
- package/.output/server/_ssr/loops._loopId_.runs._runId-Bvuo2nki.mjs +29 -0
- package/.output/server/_ssr/loops._loopId_.runs._runId-Dip5Xk-q.mjs +674 -0
- package/.output/server/_ssr/machineFns-Dvr5ICUy.mjs +266 -0
- package/.output/server/_ssr/node-sqlite-dialect-DhyOpJTX.mjs +162 -0
- package/.output/server/_ssr/notifyFns-BcMRY5kP.mjs +118 -0
- package/.output/server/_ssr/notifyFns-Q458pZmE.mjs +580 -0
- package/.output/server/_ssr/router-J8KZ30xw.mjs +678 -0
- package/.output/server/_ssr/routes-Bcs4T1ox.mjs +28 -0
- package/.output/server/_ssr/routes-BoGrcf-b.mjs +43 -0
- package/.output/server/_ssr/routes-D4am3Zff.mjs +28 -0
- package/.output/server/_ssr/runDiff-CpEFqo7G.mjs +113 -0
- package/.output/server/_ssr/ssr.mjs +5837 -0
- package/.output/server/_ssr/start-4ifArtKx.mjs +4 -0
- package/.output/server/_ssr/store-b3JcQ08F.mjs +2 -0
- package/.output/server/_ssr/t._teamId-CeUhzgzT.mjs +32 -0
- package/.output/server/_ssr/t._teamId-DR-hQK7o.mjs +47 -0
- package/.output/server/_ssr/t._teamId-Dy_McbRt.mjs +31 -0
- package/.output/server/_ssr/teamCookie-B7hLOIie.mjs +10 -0
- package/.output/server/_ssr/teamFns-BIDnsg2A.mjs +473 -0
- package/.output/server/_ssr/teamFns-DA4ovI5g.mjs +33 -0
- package/.output/server/_ssr/tokens-ytd60FUt.mjs +2 -0
- package/.output/server/_ssr/ui-Dej2qjuS.mjs +267 -0
- package/.output/server/_tanstack-start-manifest_v-CVS6c7re.mjs +95 -0
- package/.output/server/drizzle/0000_round_marauders.sql +193 -0
- package/.output/server/drizzle/0001_naive_silver_fox.sql +25 -0
- package/.output/server/drizzle/0002_funny_sage.sql +12 -0
- package/.output/server/drizzle/0003_optimal_slapstick.sql +102 -0
- package/.output/server/drizzle/0004_remove_grok_agent.sql +5 -0
- package/.output/server/drizzle/0005_heavy_gauntlet.sql +8 -0
- package/.output/server/drizzle/0006_tranquil_sharon_carter.sql +1 -0
- package/.output/server/drizzle/0007_faulty_starbolt.sql +30 -0
- package/.output/server/drizzle/0008_durable_lifecycle_evidence.sql +15 -0
- package/.output/server/drizzle/meta/0000_snapshot.json +1333 -0
- package/.output/server/drizzle/meta/0001_snapshot.json +1498 -0
- package/.output/server/drizzle/meta/0002_snapshot.json +1576 -0
- package/.output/server/drizzle/meta/0003_snapshot.json +1666 -0
- package/.output/server/drizzle/meta/0005_snapshot.json +1666 -0
- package/.output/server/drizzle/meta/0006_snapshot.json +1672 -0
- package/.output/server/drizzle/meta/0007_snapshot.json +1787 -0
- package/.output/server/drizzle/meta/_journal.json +69 -0
- package/.output/server/index.mjs +464 -0
- package/.output/server/node_modules/tslib/modules/index.js +70 -0
- package/.output/server/node_modules/tslib/modules/package.json +3 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/package.json +9 -0
- package/LICENSE +21 -0
- package/drizzle/0000_round_marauders.sql +193 -0
- package/drizzle/0001_naive_silver_fox.sql +25 -0
- package/drizzle/0002_funny_sage.sql +12 -0
- package/drizzle/0003_optimal_slapstick.sql +102 -0
- package/drizzle/0004_remove_grok_agent.sql +5 -0
- package/drizzle/0005_heavy_gauntlet.sql +8 -0
- package/drizzle/0006_tranquil_sharon_carter.sql +1 -0
- package/drizzle/0007_faulty_starbolt.sql +30 -0
- package/drizzle/0008_durable_lifecycle_evidence.sql +15 -0
- package/drizzle/meta/0000_snapshot.json +1333 -0
- package/drizzle/meta/0001_snapshot.json +1498 -0
- package/drizzle/meta/0002_snapshot.json +1576 -0
- package/drizzle/meta/0003_snapshot.json +1666 -0
- package/drizzle/meta/0005_snapshot.json +1666 -0
- package/drizzle/meta/0006_snapshot.json +1672 -0
- package/drizzle/meta/0007_snapshot.json +1787 -0
- package/drizzle/meta/_journal.json +69 -0
- package/package.json +84 -0
- package/scripts/pievo-server.mjs +390 -0
- package/scripts/prestart.mjs +66 -0
- package/scripts/server-cli-lib.mjs +451 -0
|
@@ -0,0 +1,1623 @@
|
|
|
1
|
+
import { i as __require, t as __commonJSMin } from "../_runtime.mjs";
|
|
2
|
+
import { n as require_sonic_boom } from "./pino+[...].mjs";
|
|
3
|
+
import { t as require_on_exit_leak_free } from "./on-exit-leak-free.mjs";
|
|
4
|
+
import { t as require_colorette } from "./colorette.mjs";
|
|
5
|
+
import { n as require_once, t as require_end_of_stream } from "./end-of-stream+once+wrappy.mjs";
|
|
6
|
+
import { t as require_pino_abstract_transport } from "./pino-abstract-transport+split2.mjs";
|
|
7
|
+
import { t as require_cjs } from "./fast-copy.mjs";
|
|
8
|
+
import { t as require_dateformat } from "./dateformat.mjs";
|
|
9
|
+
import { t as require_fast_safe_stringify } from "./fast-safe-stringify.mjs";
|
|
10
|
+
//#region ../../node_modules/.pnpm/pump@3.0.4/node_modules/pump/index.js
|
|
11
|
+
var require_pump = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12
|
+
var once = require_once();
|
|
13
|
+
var eos = require_end_of_stream();
|
|
14
|
+
var fs;
|
|
15
|
+
try {
|
|
16
|
+
fs = __require("fs");
|
|
17
|
+
} catch (e) {}
|
|
18
|
+
var noop = function() {};
|
|
19
|
+
var ancient = typeof process === "undefined" ? false : /^v?\.0/.test(process.version);
|
|
20
|
+
var isFn = function(fn) {
|
|
21
|
+
return typeof fn === "function";
|
|
22
|
+
};
|
|
23
|
+
var isFS = function(stream) {
|
|
24
|
+
if (!ancient) return false;
|
|
25
|
+
if (!fs) return false;
|
|
26
|
+
return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close);
|
|
27
|
+
};
|
|
28
|
+
var isRequest = function(stream) {
|
|
29
|
+
return stream.setHeader && isFn(stream.abort);
|
|
30
|
+
};
|
|
31
|
+
var destroyer = function(stream, reading, writing, callback) {
|
|
32
|
+
callback = once(callback);
|
|
33
|
+
var closed = false;
|
|
34
|
+
stream.on("close", function() {
|
|
35
|
+
closed = true;
|
|
36
|
+
});
|
|
37
|
+
eos(stream, {
|
|
38
|
+
readable: reading,
|
|
39
|
+
writable: writing
|
|
40
|
+
}, function(err) {
|
|
41
|
+
if (err) return callback(err);
|
|
42
|
+
closed = true;
|
|
43
|
+
callback();
|
|
44
|
+
});
|
|
45
|
+
var destroyed = false;
|
|
46
|
+
return function(err) {
|
|
47
|
+
if (closed) return;
|
|
48
|
+
if (destroyed) return;
|
|
49
|
+
destroyed = true;
|
|
50
|
+
if (isFS(stream)) return stream.close(noop);
|
|
51
|
+
if (isRequest(stream)) return stream.abort();
|
|
52
|
+
if (isFn(stream.destroy)) return stream.destroy();
|
|
53
|
+
callback(err || /* @__PURE__ */ new Error("stream was destroyed"));
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
var call = function(fn) {
|
|
57
|
+
fn();
|
|
58
|
+
};
|
|
59
|
+
var pipe = function(from, to) {
|
|
60
|
+
return from.pipe(to);
|
|
61
|
+
};
|
|
62
|
+
var pump = function() {
|
|
63
|
+
var streams = Array.prototype.slice.call(arguments);
|
|
64
|
+
var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop;
|
|
65
|
+
if (Array.isArray(streams[0])) streams = streams[0];
|
|
66
|
+
if (streams.length < 2) throw new Error("pump requires two streams per minimum");
|
|
67
|
+
var error;
|
|
68
|
+
var destroys = streams.map(function(stream, i) {
|
|
69
|
+
var reading = i < streams.length - 1;
|
|
70
|
+
return destroyer(stream, reading, i > 0, function(err) {
|
|
71
|
+
if (!error) error = err;
|
|
72
|
+
if (err) destroys.forEach(call);
|
|
73
|
+
if (reading) return;
|
|
74
|
+
destroys.forEach(call);
|
|
75
|
+
callback(error);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
return streams.reduce(pipe);
|
|
79
|
+
};
|
|
80
|
+
module.exports = pump;
|
|
81
|
+
}));
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/constants.js
|
|
84
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
85
|
+
/**
|
|
86
|
+
* A set of property names that indicate the value represents an error object.
|
|
87
|
+
*
|
|
88
|
+
* @typedef {string[]} K_ERROR_LIKE_KEYS
|
|
89
|
+
*/
|
|
90
|
+
module.exports = {
|
|
91
|
+
DATE_FORMAT: "yyyy-mm-dd HH:MM:ss.l o",
|
|
92
|
+
DATE_FORMAT_SIMPLE: "HH:MM:ss.l",
|
|
93
|
+
/**
|
|
94
|
+
* @type {K_ERROR_LIKE_KEYS}
|
|
95
|
+
*/
|
|
96
|
+
ERROR_LIKE_KEYS: ["err", "error"],
|
|
97
|
+
MESSAGE_KEY: "msg",
|
|
98
|
+
LEVEL_KEY: "level",
|
|
99
|
+
LEVEL_LABEL: "levelLabel",
|
|
100
|
+
TIMESTAMP_KEY: "time",
|
|
101
|
+
LEVELS: {
|
|
102
|
+
default: "USERLVL",
|
|
103
|
+
60: "FATAL",
|
|
104
|
+
50: "ERROR",
|
|
105
|
+
40: "WARN",
|
|
106
|
+
30: "INFO",
|
|
107
|
+
20: "DEBUG",
|
|
108
|
+
10: "TRACE"
|
|
109
|
+
},
|
|
110
|
+
LEVEL_NAMES: {
|
|
111
|
+
fatal: 60,
|
|
112
|
+
error: 50,
|
|
113
|
+
warn: 40,
|
|
114
|
+
info: 30,
|
|
115
|
+
debug: 20,
|
|
116
|
+
trace: 10
|
|
117
|
+
},
|
|
118
|
+
LOGGER_KEYS: [
|
|
119
|
+
"pid",
|
|
120
|
+
"hostname",
|
|
121
|
+
"name",
|
|
122
|
+
"level",
|
|
123
|
+
"time",
|
|
124
|
+
"timestamp",
|
|
125
|
+
"caller"
|
|
126
|
+
]
|
|
127
|
+
};
|
|
128
|
+
}));
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/get-level-label-data.js
|
|
131
|
+
var require_get_level_label_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
132
|
+
module.exports = getLevelLabelData;
|
|
133
|
+
var { LEVELS, LEVEL_NAMES } = require_constants();
|
|
134
|
+
/**
|
|
135
|
+
* Given initial settings for custom levels/names and use of only custom props
|
|
136
|
+
* get the level label that corresponds with a given level number
|
|
137
|
+
*
|
|
138
|
+
* @param {boolean} useOnlyCustomProps
|
|
139
|
+
* @param {object} customLevels
|
|
140
|
+
* @param {object} customLevelNames
|
|
141
|
+
*
|
|
142
|
+
* @returns {function} A function that takes a number level and returns the level's label string
|
|
143
|
+
*/
|
|
144
|
+
function getLevelLabelData(useOnlyCustomProps, customLevels, customLevelNames) {
|
|
145
|
+
const levels = useOnlyCustomProps ? customLevels || LEVELS : Object.assign({}, LEVELS, customLevels);
|
|
146
|
+
const levelNames = useOnlyCustomProps ? customLevelNames || LEVEL_NAMES : Object.assign({}, LEVEL_NAMES, customLevelNames);
|
|
147
|
+
return function(level) {
|
|
148
|
+
let levelNum = "default";
|
|
149
|
+
if (Number.isInteger(+level)) levelNum = Object.prototype.hasOwnProperty.call(levels, level) ? level : levelNum;
|
|
150
|
+
else levelNum = Object.prototype.hasOwnProperty.call(levelNames, level.toLowerCase()) ? levelNames[level.toLowerCase()] : levelNum;
|
|
151
|
+
return [levels[levelNum], levelNum];
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/colors.js
|
|
157
|
+
var require_colors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
158
|
+
var nocolor = (input) => input;
|
|
159
|
+
var plain = {
|
|
160
|
+
default: nocolor,
|
|
161
|
+
60: nocolor,
|
|
162
|
+
50: nocolor,
|
|
163
|
+
40: nocolor,
|
|
164
|
+
30: nocolor,
|
|
165
|
+
20: nocolor,
|
|
166
|
+
10: nocolor,
|
|
167
|
+
message: nocolor,
|
|
168
|
+
greyMessage: nocolor,
|
|
169
|
+
property: nocolor
|
|
170
|
+
};
|
|
171
|
+
var { createColors } = require_colorette();
|
|
172
|
+
var getLevelLabelData = require_get_level_label_data();
|
|
173
|
+
var availableColors = createColors({ useColor: true });
|
|
174
|
+
var { white, bgRed, red, yellow, green, blue, gray, cyan, magenta } = availableColors;
|
|
175
|
+
var colored = {
|
|
176
|
+
default: white,
|
|
177
|
+
60: bgRed,
|
|
178
|
+
50: red,
|
|
179
|
+
40: yellow,
|
|
180
|
+
30: green,
|
|
181
|
+
20: blue,
|
|
182
|
+
10: gray,
|
|
183
|
+
message: cyan,
|
|
184
|
+
greyMessage: gray,
|
|
185
|
+
property: magenta
|
|
186
|
+
};
|
|
187
|
+
function resolveCustomColoredColorizer(customColors) {
|
|
188
|
+
return customColors.reduce(function(agg, [level, color]) {
|
|
189
|
+
agg[level] = typeof availableColors[color] === "function" ? availableColors[color] : white;
|
|
190
|
+
return agg;
|
|
191
|
+
}, {
|
|
192
|
+
default: white,
|
|
193
|
+
message: cyan,
|
|
194
|
+
greyMessage: gray,
|
|
195
|
+
property: magenta
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function colorizeLevel(useOnlyCustomProps) {
|
|
199
|
+
return function(level, colorizer, { customLevels, customLevelNames } = {}) {
|
|
200
|
+
const [levelStr, levelNum] = getLevelLabelData(useOnlyCustomProps, customLevels, customLevelNames)(level);
|
|
201
|
+
return Object.prototype.hasOwnProperty.call(colorizer, levelNum) ? colorizer[levelNum](levelStr) : colorizer.default(levelStr);
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function plainColorizer(useOnlyCustomProps) {
|
|
205
|
+
const newPlainColorizer = colorizeLevel(useOnlyCustomProps);
|
|
206
|
+
const customColoredColorizer = function(level, opts) {
|
|
207
|
+
return newPlainColorizer(level, plain, opts);
|
|
208
|
+
};
|
|
209
|
+
customColoredColorizer.message = plain.message;
|
|
210
|
+
customColoredColorizer.greyMessage = plain.greyMessage;
|
|
211
|
+
customColoredColorizer.property = plain.property;
|
|
212
|
+
customColoredColorizer.colors = createColors({ useColor: false });
|
|
213
|
+
return customColoredColorizer;
|
|
214
|
+
}
|
|
215
|
+
function coloredColorizer(useOnlyCustomProps) {
|
|
216
|
+
const newColoredColorizer = colorizeLevel(useOnlyCustomProps);
|
|
217
|
+
const customColoredColorizer = function(level, opts) {
|
|
218
|
+
return newColoredColorizer(level, colored, opts);
|
|
219
|
+
};
|
|
220
|
+
customColoredColorizer.message = colored.message;
|
|
221
|
+
customColoredColorizer.property = colored.property;
|
|
222
|
+
customColoredColorizer.greyMessage = colored.greyMessage;
|
|
223
|
+
customColoredColorizer.colors = availableColors;
|
|
224
|
+
return customColoredColorizer;
|
|
225
|
+
}
|
|
226
|
+
function customColoredColorizerFactory(customColors, useOnlyCustomProps) {
|
|
227
|
+
const onlyCustomColored = resolveCustomColoredColorizer(customColors);
|
|
228
|
+
const customColored = useOnlyCustomProps ? onlyCustomColored : Object.assign({}, colored, onlyCustomColored);
|
|
229
|
+
const colorizeLevelCustom = colorizeLevel(useOnlyCustomProps);
|
|
230
|
+
const customColoredColorizer = function(level, opts) {
|
|
231
|
+
return colorizeLevelCustom(level, customColored, opts);
|
|
232
|
+
};
|
|
233
|
+
customColoredColorizer.colors = availableColors;
|
|
234
|
+
customColoredColorizer.message = customColoredColorizer.message || customColored.message;
|
|
235
|
+
customColoredColorizer.property = customColoredColorizer.property || customColored.property;
|
|
236
|
+
customColoredColorizer.greyMessage = customColoredColorizer.greyMessage || customColored.greyMessage;
|
|
237
|
+
return customColoredColorizer;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Applies colorization, if possible, to a string representing the passed in
|
|
241
|
+
* `level`. For example, the default colorizer will return a "green" colored
|
|
242
|
+
* string for the "info" level.
|
|
243
|
+
*
|
|
244
|
+
* @typedef {function} ColorizerFunc
|
|
245
|
+
* @param {string|number} level In either case, the input will map to a color
|
|
246
|
+
* for the specified level or to the color for `USERLVL` if the level is not
|
|
247
|
+
* recognized.
|
|
248
|
+
* @property {function} message Accepts one string parameter that will be
|
|
249
|
+
* colorized to a predefined color.
|
|
250
|
+
* @property {Colorette.Colorette} colors Available color functions based on `useColor` (or `colorize`) context
|
|
251
|
+
*/
|
|
252
|
+
/**
|
|
253
|
+
* Factory function get a function to colorized levels. The returned function
|
|
254
|
+
* also includes a `.message(str)` method to colorize strings.
|
|
255
|
+
*
|
|
256
|
+
* @param {boolean} [useColors=false] When `true` a function that applies standard
|
|
257
|
+
* terminal colors is returned.
|
|
258
|
+
* @param {array[]} [customColors] Tuple where first item of each array is the
|
|
259
|
+
* level index and the second item is the color
|
|
260
|
+
* @param {boolean} [useOnlyCustomProps] When `true`, only use the provided
|
|
261
|
+
* custom colors provided and not fallback to default
|
|
262
|
+
*
|
|
263
|
+
* @returns {ColorizerFunc} `function (level) {}` has a `.message(str)` method to
|
|
264
|
+
* apply colorization to a string. The core function accepts either an integer
|
|
265
|
+
* `level` or a `string` level. The integer level will map to a known level
|
|
266
|
+
* string or to `USERLVL` if not known. The string `level` will map to the same
|
|
267
|
+
* colors as the integer `level` and will also default to `USERLVL` if the given
|
|
268
|
+
* string is not a recognized level name.
|
|
269
|
+
*/
|
|
270
|
+
module.exports = function getColorizer(useColors = false, customColors, useOnlyCustomProps) {
|
|
271
|
+
if (useColors && customColors !== void 0) return customColoredColorizerFactory(customColors, useOnlyCustomProps);
|
|
272
|
+
else if (useColors) return coloredColorizer(useOnlyCustomProps);
|
|
273
|
+
return plainColorizer(useOnlyCustomProps);
|
|
274
|
+
};
|
|
275
|
+
}));
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/noop.js
|
|
278
|
+
var require_noop = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
279
|
+
module.exports = function noop() {};
|
|
280
|
+
}));
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js
|
|
283
|
+
var require_build_safe_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
284
|
+
module.exports = buildSafeSonicBoom;
|
|
285
|
+
var { isMainThread } = __require("node:worker_threads");
|
|
286
|
+
var SonicBoom = require_sonic_boom();
|
|
287
|
+
var noop = require_noop();
|
|
288
|
+
/**
|
|
289
|
+
* Creates a safe SonicBoom instance
|
|
290
|
+
*
|
|
291
|
+
* @param {object} opts Options for SonicBoom
|
|
292
|
+
*
|
|
293
|
+
* @returns {object} A new SonicBoom stream
|
|
294
|
+
*/
|
|
295
|
+
function buildSafeSonicBoom(opts) {
|
|
296
|
+
const stream = new SonicBoom(opts);
|
|
297
|
+
stream.on("error", filterBrokenPipe);
|
|
298
|
+
if (!opts.sync && isMainThread) setupOnExit(stream);
|
|
299
|
+
return stream;
|
|
300
|
+
function filterBrokenPipe(err) {
|
|
301
|
+
if (err.code === "EPIPE") {
|
|
302
|
+
stream.write = noop;
|
|
303
|
+
stream.end = noop;
|
|
304
|
+
stream.flushSync = noop;
|
|
305
|
+
stream.destroy = noop;
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
stream.removeListener("error", filterBrokenPipe);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function setupOnExit(stream) {
|
|
312
|
+
/* istanbul ignore next */
|
|
313
|
+
if (global.WeakRef && global.WeakMap && global.FinalizationRegistry) {
|
|
314
|
+
const onExit = require_on_exit_leak_free();
|
|
315
|
+
onExit.register(stream, autoEnd);
|
|
316
|
+
stream.on("close", function() {
|
|
317
|
+
onExit.unregister(stream);
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
/* istanbul ignore next */
|
|
322
|
+
function autoEnd(stream, eventName) {
|
|
323
|
+
if (stream.destroyed) return;
|
|
324
|
+
if (eventName === "beforeExit") {
|
|
325
|
+
stream.flush();
|
|
326
|
+
stream.on("drain", function() {
|
|
327
|
+
stream.end();
|
|
328
|
+
});
|
|
329
|
+
} else stream.flushSync();
|
|
330
|
+
}
|
|
331
|
+
}));
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/is-valid-date.js
|
|
334
|
+
var require_is_valid_date = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
335
|
+
module.exports = isValidDate;
|
|
336
|
+
/**
|
|
337
|
+
* Checks if the argument is a JS Date and not 'Invalid Date'.
|
|
338
|
+
*
|
|
339
|
+
* @param {Date} date The date to check.
|
|
340
|
+
*
|
|
341
|
+
* @returns {boolean} true if the argument is a JS Date and not 'Invalid Date'.
|
|
342
|
+
*/
|
|
343
|
+
function isValidDate(date) {
|
|
344
|
+
return date instanceof Date && !Number.isNaN(date.getTime());
|
|
345
|
+
}
|
|
346
|
+
}));
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/create-date.js
|
|
349
|
+
var require_create_date = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
350
|
+
module.exports = createDate;
|
|
351
|
+
var isValidDate = require_is_valid_date();
|
|
352
|
+
/**
|
|
353
|
+
* Constructs a JS Date from a number or string. Accepts any single number
|
|
354
|
+
* or single string argument that is valid for the Date() constructor,
|
|
355
|
+
* or an epoch as a string.
|
|
356
|
+
*
|
|
357
|
+
* @param {string|number} epoch The representation of the Date.
|
|
358
|
+
*
|
|
359
|
+
* @returns {Date} The constructed Date.
|
|
360
|
+
*/
|
|
361
|
+
function createDate(epoch) {
|
|
362
|
+
let date = new Date(epoch);
|
|
363
|
+
if (isValidDate(date)) return date;
|
|
364
|
+
date = /* @__PURE__ */ new Date(+epoch);
|
|
365
|
+
return date;
|
|
366
|
+
}
|
|
367
|
+
}));
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/split-property-key.js
|
|
370
|
+
var require_split_property_key = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
371
|
+
module.exports = splitPropertyKey;
|
|
372
|
+
/**
|
|
373
|
+
* Splits the property key delimited by a dot character but not when it is preceded
|
|
374
|
+
* by a backslash.
|
|
375
|
+
*
|
|
376
|
+
* @param {string} key A string identifying the property.
|
|
377
|
+
*
|
|
378
|
+
* @returns {string[]} Returns a list of string containing each delimited property.
|
|
379
|
+
* e.g. `'prop2\.domain\.corp.prop2'` should return [ 'prop2.domain.com', 'prop2' ]
|
|
380
|
+
*/
|
|
381
|
+
function splitPropertyKey(key) {
|
|
382
|
+
const result = [];
|
|
383
|
+
let backslash = false;
|
|
384
|
+
let segment = "";
|
|
385
|
+
for (let i = 0; i < key.length; i++) {
|
|
386
|
+
const c = key.charAt(i);
|
|
387
|
+
if (c === "\\") {
|
|
388
|
+
backslash = true;
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
if (backslash) {
|
|
392
|
+
backslash = false;
|
|
393
|
+
segment += c;
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
if (c === ".") {
|
|
397
|
+
result.push(segment);
|
|
398
|
+
segment = "";
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
segment += c;
|
|
402
|
+
}
|
|
403
|
+
if (segment.length) result.push(segment);
|
|
404
|
+
return result;
|
|
405
|
+
}
|
|
406
|
+
}));
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/get-property-value.js
|
|
409
|
+
var require_get_property_value = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
410
|
+
module.exports = getPropertyValue;
|
|
411
|
+
var splitPropertyKey = require_split_property_key();
|
|
412
|
+
/**
|
|
413
|
+
* Gets a specified property from an object if it exists.
|
|
414
|
+
*
|
|
415
|
+
* @param {object} obj The object to be searched.
|
|
416
|
+
* @param {string|string[]} property A string, or an array of strings, identifying
|
|
417
|
+
* the property to be retrieved from the object.
|
|
418
|
+
* Accepts nested properties delimited by a `.`.
|
|
419
|
+
* Delimiter can be escaped to preserve property names that contain the delimiter.
|
|
420
|
+
* e.g. `'prop1.prop2'` or `'prop2\.domain\.corp.prop2'`.
|
|
421
|
+
*
|
|
422
|
+
* @returns {*}
|
|
423
|
+
*/
|
|
424
|
+
function getPropertyValue(obj, property) {
|
|
425
|
+
const props = Array.isArray(property) ? property : splitPropertyKey(property);
|
|
426
|
+
for (const prop of props) {
|
|
427
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop)) return;
|
|
428
|
+
obj = obj[prop];
|
|
429
|
+
}
|
|
430
|
+
return obj;
|
|
431
|
+
}
|
|
432
|
+
}));
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/delete-log-property.js
|
|
435
|
+
var require_delete_log_property = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
436
|
+
module.exports = deleteLogProperty;
|
|
437
|
+
var getPropertyValue = require_get_property_value();
|
|
438
|
+
var splitPropertyKey = require_split_property_key();
|
|
439
|
+
/**
|
|
440
|
+
* Deletes a specified property from a log object if it exists.
|
|
441
|
+
* This function mutates the passed in `log` object.
|
|
442
|
+
*
|
|
443
|
+
* @param {object} log The log object to be modified.
|
|
444
|
+
* @param {string} property A string identifying the property to be deleted from
|
|
445
|
+
* the log object. Accepts nested properties delimited by a `.`
|
|
446
|
+
* Delimiter can be escaped to preserve property names that contain the delimiter.
|
|
447
|
+
* e.g. `'prop1.prop2'` or `'prop2\.domain\.corp.prop2'`
|
|
448
|
+
*/
|
|
449
|
+
function deleteLogProperty(log, property) {
|
|
450
|
+
const props = splitPropertyKey(property);
|
|
451
|
+
const propToDelete = props.pop();
|
|
452
|
+
log = getPropertyValue(log, props);
|
|
453
|
+
/* istanbul ignore else */
|
|
454
|
+
if (log !== null && typeof log === "object" && Object.prototype.hasOwnProperty.call(log, propToDelete)) delete log[propToDelete];
|
|
455
|
+
}
|
|
456
|
+
}));
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/filter-log.js
|
|
459
|
+
var require_filter_log = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
460
|
+
module.exports = filterLog;
|
|
461
|
+
var { createCopier } = require_cjs();
|
|
462
|
+
var fastCopy = createCopier({});
|
|
463
|
+
var deleteLogProperty = require_delete_log_property();
|
|
464
|
+
/**
|
|
465
|
+
* @typedef {object} FilterLogParams
|
|
466
|
+
* @property {object} log The log object to be modified.
|
|
467
|
+
* @property {PrettyContext} context The context object built from parsing
|
|
468
|
+
* the options.
|
|
469
|
+
*/
|
|
470
|
+
/**
|
|
471
|
+
* Filter a log object by removing or including keys accordingly.
|
|
472
|
+
* When `includeKeys` is passed, `ignoredKeys` will be ignored.
|
|
473
|
+
* One of ignoreKeys or includeKeys must be pass in.
|
|
474
|
+
*
|
|
475
|
+
* @param {FilterLogParams} input
|
|
476
|
+
*
|
|
477
|
+
* @returns {object} A new `log` object instance that
|
|
478
|
+
* either only includes the keys in ignoreKeys
|
|
479
|
+
* or does not include those in ignoredKeys.
|
|
480
|
+
*/
|
|
481
|
+
function filterLog({ log, context }) {
|
|
482
|
+
const { ignoreKeys, includeKeys } = context;
|
|
483
|
+
const logCopy = fastCopy(log);
|
|
484
|
+
if (includeKeys) {
|
|
485
|
+
const logIncluded = {};
|
|
486
|
+
includeKeys.forEach((key) => {
|
|
487
|
+
logIncluded[key] = logCopy[key];
|
|
488
|
+
});
|
|
489
|
+
return logIncluded;
|
|
490
|
+
}
|
|
491
|
+
ignoreKeys.forEach((ignoreKey) => {
|
|
492
|
+
deleteLogProperty(logCopy, ignoreKey);
|
|
493
|
+
});
|
|
494
|
+
return logCopy;
|
|
495
|
+
}
|
|
496
|
+
}));
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/format-time.js
|
|
499
|
+
var require_format_time = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
500
|
+
module.exports = formatTime;
|
|
501
|
+
var { DATE_FORMAT, DATE_FORMAT_SIMPLE } = require_constants();
|
|
502
|
+
var dateformat = require_dateformat();
|
|
503
|
+
var createDate = require_create_date();
|
|
504
|
+
var isValidDate = require_is_valid_date();
|
|
505
|
+
/**
|
|
506
|
+
* Converts a given `epoch` to a desired display format.
|
|
507
|
+
*
|
|
508
|
+
* @param {number|string} epoch The time to convert. May be any value that is
|
|
509
|
+
* valid for `new Date()`.
|
|
510
|
+
* @param {boolean|string} [translateTime=false] When `false`, the given `epoch`
|
|
511
|
+
* will simply be returned. When `true`, the given `epoch` will be converted
|
|
512
|
+
* to a string at UTC using the `DATE_FORMAT_SIMPLE` constant. If `translateTime` is
|
|
513
|
+
* a string, the following rules are available:
|
|
514
|
+
*
|
|
515
|
+
* - `<format string>`: The string is a literal format string. This format
|
|
516
|
+
* string will be used to interpret the `epoch` and return a display string
|
|
517
|
+
* at UTC.
|
|
518
|
+
* - `SYS:STANDARD`: The returned display string will follow the `DATE_FORMAT`
|
|
519
|
+
* constant at the system's local timezone.
|
|
520
|
+
* - `SYS:<format string>`: The returned display string will follow the given
|
|
521
|
+
* `<format string>` at the system's local timezone.
|
|
522
|
+
* - `UTC:<format string>`: The returned display string will follow the given
|
|
523
|
+
* `<format string>` at UTC.
|
|
524
|
+
*
|
|
525
|
+
* @returns {number|string} The formatted time.
|
|
526
|
+
*/
|
|
527
|
+
function formatTime(epoch, translateTime = false) {
|
|
528
|
+
if (translateTime === false) return epoch;
|
|
529
|
+
const instant = createDate(epoch);
|
|
530
|
+
if (!isValidDate(instant)) return epoch;
|
|
531
|
+
if (translateTime === true) return dateformat(instant, DATE_FORMAT_SIMPLE);
|
|
532
|
+
const upperFormat = translateTime.toUpperCase();
|
|
533
|
+
if (upperFormat === "SYS:STANDARD") return dateformat(instant, DATE_FORMAT);
|
|
534
|
+
const prefix = upperFormat.substr(0, 4);
|
|
535
|
+
if (prefix === "SYS:" || prefix === "UTC:") {
|
|
536
|
+
if (prefix === "UTC:") return dateformat(instant, translateTime);
|
|
537
|
+
return dateformat(instant, translateTime.slice(4));
|
|
538
|
+
}
|
|
539
|
+
return dateformat(instant, `UTC:${translateTime}`);
|
|
540
|
+
}
|
|
541
|
+
}));
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.js
|
|
544
|
+
var require_handle_custom_levels_names_opts = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
545
|
+
module.exports = handleCustomLevelsNamesOpts;
|
|
546
|
+
/**
|
|
547
|
+
* Parse a CSV string or options object that maps level
|
|
548
|
+
* labels to level values.
|
|
549
|
+
*
|
|
550
|
+
* @param {string|object} cLevels An object mapping level
|
|
551
|
+
* names to level values, e.g. `{ info: 30, debug: 65 }`, or a
|
|
552
|
+
* CSV string in the format `level_name:level_value`, e.g.
|
|
553
|
+
* `info:30,debug:65`.
|
|
554
|
+
*
|
|
555
|
+
* @returns {object} An object mapping levels names to level values
|
|
556
|
+
* e.g. `{ info: 30, debug: 65 }`.
|
|
557
|
+
*/
|
|
558
|
+
function handleCustomLevelsNamesOpts(cLevels) {
|
|
559
|
+
if (!cLevels) return {};
|
|
560
|
+
if (typeof cLevels === "string") return cLevels.split(",").reduce((agg, value, idx) => {
|
|
561
|
+
const [levelName, levelNum = idx] = value.split(":");
|
|
562
|
+
agg[levelName.toLowerCase()] = levelNum;
|
|
563
|
+
return agg;
|
|
564
|
+
}, {});
|
|
565
|
+
else if (Object.prototype.toString.call(cLevels) === "[object Object]") return Object.keys(cLevels).reduce((agg, levelName) => {
|
|
566
|
+
agg[levelName.toLowerCase()] = cLevels[levelName];
|
|
567
|
+
return agg;
|
|
568
|
+
}, {});
|
|
569
|
+
else return {};
|
|
570
|
+
}
|
|
571
|
+
}));
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.js
|
|
574
|
+
var require_handle_custom_levels_opts = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
575
|
+
module.exports = handleCustomLevelsOpts;
|
|
576
|
+
/**
|
|
577
|
+
* Parse a CSV string or options object that specifies
|
|
578
|
+
* configuration for custom levels.
|
|
579
|
+
*
|
|
580
|
+
* @param {string|object} cLevels An object mapping level
|
|
581
|
+
* names to values, e.g. `{ info: 30, debug: 65 }`, or a
|
|
582
|
+
* CSV string in the format `level_name:level_value`, e.g.
|
|
583
|
+
* `info:30,debug:65`.
|
|
584
|
+
*
|
|
585
|
+
* @returns {object} An object mapping levels to labels that
|
|
586
|
+
* appear in logs, e.g. `{ '30': 'INFO', '65': 'DEBUG' }`.
|
|
587
|
+
*/
|
|
588
|
+
function handleCustomLevelsOpts(cLevels) {
|
|
589
|
+
if (!cLevels) return {};
|
|
590
|
+
if (typeof cLevels === "string") return cLevels.split(",").reduce((agg, value, idx) => {
|
|
591
|
+
const [levelName, levelNum = idx] = value.split(":");
|
|
592
|
+
agg[levelNum] = levelName.toUpperCase();
|
|
593
|
+
return agg;
|
|
594
|
+
}, { default: "USERLVL" });
|
|
595
|
+
else if (Object.prototype.toString.call(cLevels) === "[object Object]") return Object.keys(cLevels).reduce((agg, levelName) => {
|
|
596
|
+
agg[cLevels[levelName]] = levelName.toUpperCase();
|
|
597
|
+
return agg;
|
|
598
|
+
}, { default: "USERLVL" });
|
|
599
|
+
else return {};
|
|
600
|
+
}
|
|
601
|
+
}));
|
|
602
|
+
//#endregion
|
|
603
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/interpret-conditionals.js
|
|
604
|
+
var require_interpret_conditionals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
605
|
+
module.exports = interpretConditionals;
|
|
606
|
+
var getPropertyValue = require_get_property_value();
|
|
607
|
+
/**
|
|
608
|
+
* Translates all conditional blocks from within the messageFormat. Translates
|
|
609
|
+
* any matching {if key}{key}{end} statements and returns everything between
|
|
610
|
+
* if and else blocks if the key provided was found in log.
|
|
611
|
+
*
|
|
612
|
+
* @param {MessageFormatString|MessageFormatFunction} messageFormat A format
|
|
613
|
+
* string or function that defines how the logged message should be
|
|
614
|
+
* conditionally formatted.
|
|
615
|
+
* @param {object} log The log object to be modified.
|
|
616
|
+
*
|
|
617
|
+
* @returns {string} The parsed messageFormat.
|
|
618
|
+
*/
|
|
619
|
+
function interpretConditionals(messageFormat, log) {
|
|
620
|
+
messageFormat = messageFormat.replace(/{if (.*?)}(.*?){end}/g, replacer);
|
|
621
|
+
messageFormat = messageFormat.replace(/{if (.*?)}/g, "");
|
|
622
|
+
messageFormat = messageFormat.replace(/{end}/g, "");
|
|
623
|
+
return messageFormat.replace(/\s+/g, " ").trim();
|
|
624
|
+
function replacer(_, key, value) {
|
|
625
|
+
const propertyValue = getPropertyValue(log, key);
|
|
626
|
+
if (propertyValue && value.includes(key)) return value.replace(new RegExp("{" + key + "}", "g"), propertyValue);
|
|
627
|
+
else return "";
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}));
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/is-object.js
|
|
633
|
+
var require_is_object = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
634
|
+
module.exports = isObject;
|
|
635
|
+
function isObject(input) {
|
|
636
|
+
return Object.prototype.toString.apply(input) === "[object Object]";
|
|
637
|
+
}
|
|
638
|
+
}));
|
|
639
|
+
//#endregion
|
|
640
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.js
|
|
641
|
+
var require_join_lines_with_indentation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
642
|
+
module.exports = joinLinesWithIndentation;
|
|
643
|
+
/**
|
|
644
|
+
* @typedef {object} JoinLinesWithIndentationParams
|
|
645
|
+
* @property {string} input The string to split and reformat.
|
|
646
|
+
* @property {string} [ident] The indentation string. Default: ` ` (4 spaces).
|
|
647
|
+
* @property {string} [eol] The end of line sequence to use when rejoining
|
|
648
|
+
* the lines. Default: `'\n'`.
|
|
649
|
+
*/
|
|
650
|
+
/**
|
|
651
|
+
* Given a string with line separators, either `\r\n` or `\n`, add indentation
|
|
652
|
+
* to all lines subsequent to the first line and rejoin the lines using an
|
|
653
|
+
* end of line sequence.
|
|
654
|
+
*
|
|
655
|
+
* @param {JoinLinesWithIndentationParams} input
|
|
656
|
+
*
|
|
657
|
+
* @returns {string} A string with lines subsequent to the first indented
|
|
658
|
+
* with the given indentation sequence.
|
|
659
|
+
*/
|
|
660
|
+
function joinLinesWithIndentation({ input, ident = " ", eol = "\n" }) {
|
|
661
|
+
const lines = input.split(/\r?\n/);
|
|
662
|
+
for (let i = 1; i < lines.length; i += 1) lines[i] = ident + lines[i];
|
|
663
|
+
return lines.join(eol);
|
|
664
|
+
}
|
|
665
|
+
}));
|
|
666
|
+
//#endregion
|
|
667
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/parse-factory-options.js
|
|
668
|
+
var require_parse_factory_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
669
|
+
module.exports = parseFactoryOptions;
|
|
670
|
+
var { LEVEL_NAMES } = require_constants();
|
|
671
|
+
var colors = require_colors();
|
|
672
|
+
var handleCustomLevelsOpts = require_handle_custom_levels_opts();
|
|
673
|
+
var handleCustomLevelsNamesOpts = require_handle_custom_levels_names_opts();
|
|
674
|
+
var handleLevelLabelData = require_get_level_label_data();
|
|
675
|
+
/**
|
|
676
|
+
* A `PrettyContext` is an object to be used by the various functions that
|
|
677
|
+
* process log data. It is derived from the provided {@link PinoPrettyOptions}.
|
|
678
|
+
* It may be used as a `this` context.
|
|
679
|
+
*
|
|
680
|
+
* @typedef {object} PrettyContext
|
|
681
|
+
* @property {string} EOL The escape sequence chosen as the line terminator.
|
|
682
|
+
* @property {string} IDENT The string to use as the indentation sequence.
|
|
683
|
+
* @property {ColorizerFunc} colorizer A configured colorizer function.
|
|
684
|
+
* @property {Array[Array<number, string>]} customColors A set of custom color
|
|
685
|
+
* names associated with level numbers.
|
|
686
|
+
* @property {object} customLevelNames A hash of level numbers to level names,
|
|
687
|
+
* e.g. `{ 30: "info" }`.
|
|
688
|
+
* @property {object} customLevels A hash of level names to level numbers,
|
|
689
|
+
* e.g. `{ info: 30 }`.
|
|
690
|
+
* @property {CustomPrettifiers} customPrettifiers A hash of custom prettifier
|
|
691
|
+
* functions.
|
|
692
|
+
* @property {object} customProperties Comprised of `customLevels` and
|
|
693
|
+
* `customLevelNames` if such options are provided.
|
|
694
|
+
* @property {string[]} errorLikeObjectKeys The key names in the log data that
|
|
695
|
+
* should be considered as holding error objects.
|
|
696
|
+
* @property {string[]} errorProps A list of error object keys that should be
|
|
697
|
+
* included in the output.
|
|
698
|
+
* @property {function} getLevelLabelData Pass a numeric level to return [levelLabelString,levelNum]
|
|
699
|
+
* @property {boolean} hideObject Indicates the prettifier should omit objects
|
|
700
|
+
* in the output.
|
|
701
|
+
* @property {string[]} ignoreKeys Set of log data keys to omit.
|
|
702
|
+
* @property {string[]} includeKeys Opposite of `ignoreKeys`.
|
|
703
|
+
* @property {boolean} levelFirst Indicates the level should be printed first.
|
|
704
|
+
* @property {string} levelKey Name of the key in the log data that contains
|
|
705
|
+
* the message.
|
|
706
|
+
* @property {string} levelLabel Format token to represent the position of the
|
|
707
|
+
* level name in the output string.
|
|
708
|
+
* @property {MessageFormatString|MessageFormatFunction} messageFormat
|
|
709
|
+
* @property {string} messageKey Name of the key in the log data that contains
|
|
710
|
+
* the message.
|
|
711
|
+
* @property {string|number} minimumLevel The minimum log level to process
|
|
712
|
+
* and output.
|
|
713
|
+
* @property {ColorizerFunc} objectColorizer
|
|
714
|
+
* @property {boolean} singleLine Indicates objects should be printed on a
|
|
715
|
+
* single output line.
|
|
716
|
+
* @property {string} timestampKey The name of the key in the log data that
|
|
717
|
+
* contains the log timestamp.
|
|
718
|
+
* @property {boolean} translateTime Indicates if timestamps should be
|
|
719
|
+
* translated to a human-readable string.
|
|
720
|
+
* @property {boolean} useOnlyCustomProps
|
|
721
|
+
*/
|
|
722
|
+
/**
|
|
723
|
+
* @param {PinoPrettyOptions} options The user supplied object of options.
|
|
724
|
+
*
|
|
725
|
+
* @returns {PrettyContext}
|
|
726
|
+
*/
|
|
727
|
+
function parseFactoryOptions(options) {
|
|
728
|
+
const EOL = options.crlf ? "\r\n" : "\n";
|
|
729
|
+
const IDENT = " ";
|
|
730
|
+
const { customPrettifiers, errorLikeObjectKeys, hideObject, levelFirst, levelKey, levelLabel, messageFormat, messageKey, minimumLevel, singleLine, timestampKey, translateTime } = options;
|
|
731
|
+
const errorProps = options.errorProps.split(",");
|
|
732
|
+
const useOnlyCustomProps = typeof options.useOnlyCustomProps === "boolean" ? options.useOnlyCustomProps : options.useOnlyCustomProps === "true";
|
|
733
|
+
const customLevels = handleCustomLevelsOpts(options.customLevels);
|
|
734
|
+
const customLevelNames = handleCustomLevelsNamesOpts(options.customLevels);
|
|
735
|
+
const getLevelLabelData = handleLevelLabelData(useOnlyCustomProps, customLevels, customLevelNames);
|
|
736
|
+
let customColors;
|
|
737
|
+
if (options.customColors) if (typeof options.customColors === "string") customColors = options.customColors.split(",").reduce((agg, value) => {
|
|
738
|
+
const [level, color] = value.split(":");
|
|
739
|
+
const levelNum = (useOnlyCustomProps ? options.customLevels : customLevelNames[level] !== void 0) ? customLevelNames[level] : LEVEL_NAMES[level];
|
|
740
|
+
const colorIdx = levelNum !== void 0 ? levelNum : level;
|
|
741
|
+
agg.push([colorIdx, color]);
|
|
742
|
+
return agg;
|
|
743
|
+
}, []);
|
|
744
|
+
else if (typeof options.customColors === "object") customColors = Object.keys(options.customColors).reduce((agg, value) => {
|
|
745
|
+
const [level, color] = [value, options.customColors[value]];
|
|
746
|
+
const levelNum = (useOnlyCustomProps ? options.customLevels : customLevelNames[level] !== void 0) ? customLevelNames[level] : LEVEL_NAMES[level];
|
|
747
|
+
const colorIdx = levelNum !== void 0 ? levelNum : level;
|
|
748
|
+
agg.push([colorIdx, color]);
|
|
749
|
+
return agg;
|
|
750
|
+
}, []);
|
|
751
|
+
else throw new Error("options.customColors must be of type string or object.");
|
|
752
|
+
const customProperties = {
|
|
753
|
+
customLevels,
|
|
754
|
+
customLevelNames
|
|
755
|
+
};
|
|
756
|
+
if (useOnlyCustomProps === true && !options.customLevels) {
|
|
757
|
+
customProperties.customLevels = void 0;
|
|
758
|
+
customProperties.customLevelNames = void 0;
|
|
759
|
+
}
|
|
760
|
+
const includeKeys = options.include !== void 0 ? new Set(options.include.split(",")) : void 0;
|
|
761
|
+
const ignoreKeys = !includeKeys && options.ignore ? new Set(options.ignore.split(",")) : void 0;
|
|
762
|
+
const colorizer = colors(options.colorize, customColors, useOnlyCustomProps);
|
|
763
|
+
const objectColorizer = options.colorizeObjects ? colorizer : colors(false, [], false);
|
|
764
|
+
return {
|
|
765
|
+
EOL,
|
|
766
|
+
IDENT,
|
|
767
|
+
colorizer,
|
|
768
|
+
customColors,
|
|
769
|
+
customLevelNames,
|
|
770
|
+
customLevels,
|
|
771
|
+
customPrettifiers,
|
|
772
|
+
customProperties,
|
|
773
|
+
errorLikeObjectKeys,
|
|
774
|
+
errorProps,
|
|
775
|
+
getLevelLabelData,
|
|
776
|
+
hideObject,
|
|
777
|
+
ignoreKeys,
|
|
778
|
+
includeKeys,
|
|
779
|
+
levelFirst,
|
|
780
|
+
levelKey,
|
|
781
|
+
levelLabel,
|
|
782
|
+
messageFormat,
|
|
783
|
+
messageKey,
|
|
784
|
+
minimumLevel,
|
|
785
|
+
objectColorizer,
|
|
786
|
+
singleLine,
|
|
787
|
+
timestampKey,
|
|
788
|
+
translateTime,
|
|
789
|
+
useOnlyCustomProps
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
}));
|
|
793
|
+
//#endregion
|
|
794
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-error.js
|
|
795
|
+
var require_prettify_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
796
|
+
module.exports = prettifyError;
|
|
797
|
+
var joinLinesWithIndentation = require_join_lines_with_indentation();
|
|
798
|
+
/**
|
|
799
|
+
* @typedef {object} PrettifyErrorParams
|
|
800
|
+
* @property {string} keyName The key assigned to this error in the log object.
|
|
801
|
+
* @property {string} lines The STRINGIFIED error. If the error field has a
|
|
802
|
+
* custom prettifier, that should be pre-applied as well.
|
|
803
|
+
* @property {string} ident The indentation sequence to use.
|
|
804
|
+
* @property {string} eol The EOL sequence to use.
|
|
805
|
+
*/
|
|
806
|
+
/**
|
|
807
|
+
* Prettifies an error string into a multi-line format.
|
|
808
|
+
*
|
|
809
|
+
* @param {PrettifyErrorParams} input
|
|
810
|
+
*
|
|
811
|
+
* @returns {string}
|
|
812
|
+
*/
|
|
813
|
+
function prettifyError({ keyName, lines, eol, ident }) {
|
|
814
|
+
let result = "";
|
|
815
|
+
const splitLines = `${ident}${keyName}: ${joinLinesWithIndentation({
|
|
816
|
+
input: lines,
|
|
817
|
+
ident,
|
|
818
|
+
eol
|
|
819
|
+
})}${eol}`.split(eol);
|
|
820
|
+
for (let j = 0; j < splitLines.length; j += 1) {
|
|
821
|
+
if (j !== 0) result += eol;
|
|
822
|
+
const line = splitLines[j];
|
|
823
|
+
if (/^\s*"stack"/.test(line)) {
|
|
824
|
+
const matches = /^(\s*"stack":)\s*(".*"),?$/.exec(line);
|
|
825
|
+
/* istanbul ignore else */
|
|
826
|
+
if (matches && matches.length === 3) {
|
|
827
|
+
const indentSize = /^\s*/.exec(line)[0].length + 4;
|
|
828
|
+
const indentation = " ".repeat(indentSize);
|
|
829
|
+
const stackMessage = matches[2];
|
|
830
|
+
result += matches[1] + eol + indentation + JSON.parse(stackMessage).replace(/\n/g, eol + indentation);
|
|
831
|
+
} else result += line;
|
|
832
|
+
} else result += line;
|
|
833
|
+
}
|
|
834
|
+
return result;
|
|
835
|
+
}
|
|
836
|
+
}));
|
|
837
|
+
//#endregion
|
|
838
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-object.js
|
|
839
|
+
var require_prettify_object = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
840
|
+
module.exports = prettifyObject;
|
|
841
|
+
var { LOGGER_KEYS } = require_constants();
|
|
842
|
+
var stringifySafe = require_fast_safe_stringify();
|
|
843
|
+
var joinLinesWithIndentation = require_join_lines_with_indentation();
|
|
844
|
+
var prettifyError = require_prettify_error();
|
|
845
|
+
/**
|
|
846
|
+
* @typedef {object} PrettifyObjectParams
|
|
847
|
+
* @property {object} log The object to prettify.
|
|
848
|
+
* @property {boolean} [excludeLoggerKeys] Indicates if known logger specific
|
|
849
|
+
* keys should be excluded from prettification. Default: `true`.
|
|
850
|
+
* @property {string[]} [skipKeys] A set of object keys to exclude from the
|
|
851
|
+
* * prettified result. Default: `[]`.
|
|
852
|
+
* @property {PrettyContext} context The context object built from parsing
|
|
853
|
+
* the options.
|
|
854
|
+
*/
|
|
855
|
+
/**
|
|
856
|
+
* Prettifies a standard object. Special care is taken when processing the object
|
|
857
|
+
* to handle child objects that are attached to keys known to contain error
|
|
858
|
+
* objects.
|
|
859
|
+
*
|
|
860
|
+
* @param {PrettifyObjectParams} input
|
|
861
|
+
*
|
|
862
|
+
* @returns {string} The prettified string. This can be as little as `''` if
|
|
863
|
+
* there was nothing to prettify.
|
|
864
|
+
*/
|
|
865
|
+
function prettifyObject({ log, excludeLoggerKeys = true, skipKeys = [], context }) {
|
|
866
|
+
const { EOL: eol, IDENT: ident, customPrettifiers, errorLikeObjectKeys: errorLikeKeys, objectColorizer, singleLine, colorizer } = context;
|
|
867
|
+
const keysToIgnore = [].concat(skipKeys);
|
|
868
|
+
/* istanbul ignore else */
|
|
869
|
+
if (excludeLoggerKeys === true) Array.prototype.push.apply(keysToIgnore, LOGGER_KEYS);
|
|
870
|
+
let result = "";
|
|
871
|
+
const { plain, errors } = Object.entries(log).reduce(({ plain, errors }, [k, v]) => {
|
|
872
|
+
if (keysToIgnore.includes(k) === false) {
|
|
873
|
+
const pretty = typeof customPrettifiers[k] === "function" ? customPrettifiers[k](v, k, log, { colors: colorizer.colors }) : v;
|
|
874
|
+
if (errorLikeKeys.includes(k)) errors[k] = pretty;
|
|
875
|
+
else plain[k] = pretty;
|
|
876
|
+
}
|
|
877
|
+
return {
|
|
878
|
+
plain,
|
|
879
|
+
errors
|
|
880
|
+
};
|
|
881
|
+
}, {
|
|
882
|
+
plain: {},
|
|
883
|
+
errors: {}
|
|
884
|
+
});
|
|
885
|
+
if (singleLine) {
|
|
886
|
+
/* istanbul ignore else */
|
|
887
|
+
if (Object.keys(plain).length > 0) result += objectColorizer.greyMessage(stringifySafe(plain));
|
|
888
|
+
result += eol;
|
|
889
|
+
result = result.replace(/\\\\/gi, "\\");
|
|
890
|
+
} else Object.entries(plain).forEach(([keyName, keyValue]) => {
|
|
891
|
+
let lines = typeof customPrettifiers[keyName] === "function" ? keyValue : stringifySafe(keyValue, null, 2);
|
|
892
|
+
if (lines === void 0) return;
|
|
893
|
+
lines = lines.replace(/\\\\/gi, "\\");
|
|
894
|
+
const joinedLines = joinLinesWithIndentation({
|
|
895
|
+
input: lines,
|
|
896
|
+
ident,
|
|
897
|
+
eol
|
|
898
|
+
});
|
|
899
|
+
result += `${ident}${objectColorizer.property(keyName)}:${joinedLines.startsWith(eol) ? "" : " "}${joinedLines}${eol}`;
|
|
900
|
+
});
|
|
901
|
+
Object.entries(errors).forEach(([keyName, keyValue]) => {
|
|
902
|
+
const lines = typeof customPrettifiers[keyName] === "function" ? keyValue : stringifySafe(keyValue, null, 2);
|
|
903
|
+
if (lines === void 0) return;
|
|
904
|
+
result += prettifyError({
|
|
905
|
+
keyName,
|
|
906
|
+
lines,
|
|
907
|
+
eol,
|
|
908
|
+
ident
|
|
909
|
+
});
|
|
910
|
+
});
|
|
911
|
+
return result;
|
|
912
|
+
}
|
|
913
|
+
}));
|
|
914
|
+
//#endregion
|
|
915
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-error-log.js
|
|
916
|
+
var require_prettify_error_log = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
917
|
+
module.exports = prettifyErrorLog;
|
|
918
|
+
var { LOGGER_KEYS } = require_constants();
|
|
919
|
+
var isObject = require_is_object();
|
|
920
|
+
var joinLinesWithIndentation = require_join_lines_with_indentation();
|
|
921
|
+
var prettifyObject = require_prettify_object();
|
|
922
|
+
/**
|
|
923
|
+
* @typedef {object} PrettifyErrorLogParams
|
|
924
|
+
* @property {object} log The error log to prettify.
|
|
925
|
+
* @property {PrettyContext} context The context object built from parsing
|
|
926
|
+
* the options.
|
|
927
|
+
*/
|
|
928
|
+
/**
|
|
929
|
+
* Given a log object that has a `type: 'Error'` key, prettify the object and
|
|
930
|
+
* return the result. In other
|
|
931
|
+
*
|
|
932
|
+
* @param {PrettifyErrorLogParams} input
|
|
933
|
+
*
|
|
934
|
+
* @returns {string} A string that represents the prettified error log.
|
|
935
|
+
*/
|
|
936
|
+
function prettifyErrorLog({ log, context }) {
|
|
937
|
+
const { EOL: eol, IDENT: ident, errorProps: errorProperties, messageKey } = context;
|
|
938
|
+
const stack = log.stack;
|
|
939
|
+
let result = `${ident}${joinLinesWithIndentation({
|
|
940
|
+
input: stack,
|
|
941
|
+
ident,
|
|
942
|
+
eol
|
|
943
|
+
})}${eol}`;
|
|
944
|
+
if (errorProperties.length > 0) {
|
|
945
|
+
const excludeProperties = LOGGER_KEYS.concat(messageKey, "type", "stack");
|
|
946
|
+
let propertiesToPrint;
|
|
947
|
+
if (errorProperties[0] === "*") propertiesToPrint = Object.keys(log).filter((k) => excludeProperties.includes(k) === false);
|
|
948
|
+
else propertiesToPrint = errorProperties.filter((k) => excludeProperties.includes(k) === false);
|
|
949
|
+
for (let i = 0; i < propertiesToPrint.length; i += 1) {
|
|
950
|
+
const key = propertiesToPrint[i];
|
|
951
|
+
if (key in log === false) continue;
|
|
952
|
+
if (isObject(log[key])) {
|
|
953
|
+
const prettifiedObject = prettifyObject({
|
|
954
|
+
log: log[key],
|
|
955
|
+
excludeLoggerKeys: false,
|
|
956
|
+
context: {
|
|
957
|
+
...context,
|
|
958
|
+
IDENT: ident + ident
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
result = `${result}${ident}${key}: {${eol}${prettifiedObject}${ident}}${eol}`;
|
|
962
|
+
continue;
|
|
963
|
+
}
|
|
964
|
+
result = `${result}${ident}${key}: ${log[key]}${eol}`;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
return result;
|
|
968
|
+
}
|
|
969
|
+
}));
|
|
970
|
+
//#endregion
|
|
971
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-level.js
|
|
972
|
+
var require_prettify_level = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
973
|
+
module.exports = prettifyLevel;
|
|
974
|
+
var getPropertyValue = require_get_property_value();
|
|
975
|
+
/**
|
|
976
|
+
* @typedef {object} PrettifyLevelParams
|
|
977
|
+
* @property {object} log The log object.
|
|
978
|
+
* @property {PrettyContext} context The context object built from parsing
|
|
979
|
+
* the options.
|
|
980
|
+
*/
|
|
981
|
+
/**
|
|
982
|
+
* Checks if the passed in log has a `level` value and returns a prettified
|
|
983
|
+
* string for that level if so.
|
|
984
|
+
*
|
|
985
|
+
* @param {PrettifyLevelParams} input
|
|
986
|
+
*
|
|
987
|
+
* @returns {undefined|string} If `log` does not have a `level` property then
|
|
988
|
+
* `undefined` will be returned. Otherwise, a string from the specified
|
|
989
|
+
* `colorizer` is returned.
|
|
990
|
+
*/
|
|
991
|
+
function prettifyLevel({ log, context }) {
|
|
992
|
+
const { colorizer, customLevels, customLevelNames, levelKey, getLevelLabelData } = context;
|
|
993
|
+
const prettifier = context.customPrettifiers?.level;
|
|
994
|
+
const output = getPropertyValue(log, levelKey);
|
|
995
|
+
if (output === void 0) return void 0;
|
|
996
|
+
const labelColorized = colorizer(output, {
|
|
997
|
+
customLevels,
|
|
998
|
+
customLevelNames
|
|
999
|
+
});
|
|
1000
|
+
if (prettifier) {
|
|
1001
|
+
const [label] = getLevelLabelData(output);
|
|
1002
|
+
return prettifier(output, levelKey, log, {
|
|
1003
|
+
label,
|
|
1004
|
+
labelColorized,
|
|
1005
|
+
colors: colorizer.colors
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
return labelColorized;
|
|
1009
|
+
}
|
|
1010
|
+
}));
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-message.js
|
|
1013
|
+
var require_prettify_message = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1014
|
+
module.exports = prettifyMessage;
|
|
1015
|
+
var { LEVELS } = require_constants();
|
|
1016
|
+
var getPropertyValue = require_get_property_value();
|
|
1017
|
+
var interpretConditionals = require_interpret_conditionals();
|
|
1018
|
+
/**
|
|
1019
|
+
* @typedef {object} PrettifyMessageParams
|
|
1020
|
+
* @property {object} log The log object with the message to colorize.
|
|
1021
|
+
* @property {PrettyContext} context The context object built from parsing
|
|
1022
|
+
* the options.
|
|
1023
|
+
*/
|
|
1024
|
+
/**
|
|
1025
|
+
* Prettifies a message string if the given `log` has a message property.
|
|
1026
|
+
*
|
|
1027
|
+
* @param {PrettifyMessageParams} input
|
|
1028
|
+
*
|
|
1029
|
+
* @returns {undefined|string} If the message key is not found, or the message
|
|
1030
|
+
* key is not a string, then `undefined` will be returned. Otherwise, a string
|
|
1031
|
+
* that is the prettified message.
|
|
1032
|
+
*/
|
|
1033
|
+
function prettifyMessage({ log, context }) {
|
|
1034
|
+
const { colorizer, customLevels, levelKey, levelLabel, messageFormat, messageKey, useOnlyCustomProps } = context;
|
|
1035
|
+
if (messageFormat && typeof messageFormat === "string") {
|
|
1036
|
+
const parsedMessageFormat = interpretConditionals(messageFormat, log);
|
|
1037
|
+
const message = String(parsedMessageFormat).replace(/{([^{}]+)}/g, function(match, p1) {
|
|
1038
|
+
let level;
|
|
1039
|
+
if (p1 === levelLabel && (level = getPropertyValue(log, levelKey)) !== void 0) return (useOnlyCustomProps ? customLevels === void 0 : customLevels[level] === void 0) ? LEVELS[level] : customLevels[level];
|
|
1040
|
+
const value = getPropertyValue(log, p1);
|
|
1041
|
+
return value !== void 0 ? value : "";
|
|
1042
|
+
});
|
|
1043
|
+
return colorizer.message(message);
|
|
1044
|
+
}
|
|
1045
|
+
if (messageFormat && typeof messageFormat === "function") {
|
|
1046
|
+
const msg = messageFormat(log, messageKey, levelLabel, { colors: colorizer.colors });
|
|
1047
|
+
return colorizer.message(msg);
|
|
1048
|
+
}
|
|
1049
|
+
if (messageKey in log === false) return void 0;
|
|
1050
|
+
if (typeof log[messageKey] !== "string" && typeof log[messageKey] !== "number" && typeof log[messageKey] !== "boolean") return void 0;
|
|
1051
|
+
return colorizer.message(log[messageKey]);
|
|
1052
|
+
}
|
|
1053
|
+
}));
|
|
1054
|
+
//#endregion
|
|
1055
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-metadata.js
|
|
1056
|
+
var require_prettify_metadata = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1057
|
+
module.exports = prettifyMetadata;
|
|
1058
|
+
/**
|
|
1059
|
+
* @typedef {object} PrettifyMetadataParams
|
|
1060
|
+
* @property {object} log The log that may or may not contain metadata to
|
|
1061
|
+
* be prettified.
|
|
1062
|
+
* @property {PrettyContext} context The context object built from parsing
|
|
1063
|
+
* the options.
|
|
1064
|
+
*/
|
|
1065
|
+
/**
|
|
1066
|
+
* Prettifies metadata that is usually present in a Pino log line. It looks for
|
|
1067
|
+
* fields `name`, `pid`, `hostname`, and `caller` and returns a formatted string using
|
|
1068
|
+
* the fields it finds.
|
|
1069
|
+
*
|
|
1070
|
+
* @param {PrettifyMetadataParams} input
|
|
1071
|
+
*
|
|
1072
|
+
* @returns {undefined|string} If no metadata is found then `undefined` is
|
|
1073
|
+
* returned. Otherwise, a string of prettified metadata is returned.
|
|
1074
|
+
*/
|
|
1075
|
+
function prettifyMetadata({ log, context }) {
|
|
1076
|
+
const { customPrettifiers: prettifiers, colorizer } = context;
|
|
1077
|
+
let line = "";
|
|
1078
|
+
if (log.name || log.pid || log.hostname) {
|
|
1079
|
+
line += "(";
|
|
1080
|
+
if (log.name) line += prettifiers.name ? prettifiers.name(log.name, "name", log, { colors: colorizer.colors }) : log.name;
|
|
1081
|
+
if (log.pid) {
|
|
1082
|
+
const prettyPid = prettifiers.pid ? prettifiers.pid(log.pid, "pid", log, { colors: colorizer.colors }) : log.pid;
|
|
1083
|
+
if (log.name && log.pid) line += "/" + prettyPid;
|
|
1084
|
+
else line += prettyPid;
|
|
1085
|
+
}
|
|
1086
|
+
if (log.hostname) {
|
|
1087
|
+
const prettyHostname = prettifiers.hostname ? prettifiers.hostname(log.hostname, "hostname", log, { colors: colorizer.colors }) : log.hostname;
|
|
1088
|
+
line += `${line === "(" ? "on" : " on"} ${prettyHostname}`;
|
|
1089
|
+
}
|
|
1090
|
+
line += ")";
|
|
1091
|
+
}
|
|
1092
|
+
if (log.caller) {
|
|
1093
|
+
const prettyCaller = prettifiers.caller ? prettifiers.caller(log.caller, "caller", log, { colors: colorizer.colors }) : log.caller;
|
|
1094
|
+
line += `${line === "" ? "" : " "}<${prettyCaller}>`;
|
|
1095
|
+
}
|
|
1096
|
+
if (line === "") return;
|
|
1097
|
+
else return line;
|
|
1098
|
+
}
|
|
1099
|
+
}));
|
|
1100
|
+
//#endregion
|
|
1101
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/prettify-time.js
|
|
1102
|
+
var require_prettify_time = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1103
|
+
module.exports = prettifyTime;
|
|
1104
|
+
var formatTime = require_format_time();
|
|
1105
|
+
/**
|
|
1106
|
+
* @typedef {object} PrettifyTimeParams
|
|
1107
|
+
* @property {object} log The log object with the timestamp to be prettified.
|
|
1108
|
+
* @property {PrettyContext} context The context object built from parsing
|
|
1109
|
+
* the options.
|
|
1110
|
+
*/
|
|
1111
|
+
/**
|
|
1112
|
+
* Prettifies a timestamp if the given `log` has either `time`, `timestamp` or custom specified timestamp
|
|
1113
|
+
* property.
|
|
1114
|
+
*
|
|
1115
|
+
* @param {PrettifyTimeParams} input
|
|
1116
|
+
*
|
|
1117
|
+
* @returns {undefined|string} If a timestamp property cannot be found then
|
|
1118
|
+
* `undefined` is returned. Otherwise, the prettified time is returned as a
|
|
1119
|
+
* string.
|
|
1120
|
+
*/
|
|
1121
|
+
function prettifyTime({ log, context }) {
|
|
1122
|
+
const { timestampKey, translateTime: translateFormat } = context;
|
|
1123
|
+
const prettifier = context.customPrettifiers?.time;
|
|
1124
|
+
let time = null;
|
|
1125
|
+
if (timestampKey in log) time = log[timestampKey];
|
|
1126
|
+
else if ("timestamp" in log) time = log.timestamp;
|
|
1127
|
+
if (time === null) return void 0;
|
|
1128
|
+
const output = translateFormat ? formatTime(time, translateFormat) : time;
|
|
1129
|
+
return prettifier ? prettifier(output) : `[${output}]`;
|
|
1130
|
+
}
|
|
1131
|
+
}));
|
|
1132
|
+
//#endregion
|
|
1133
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/index.js
|
|
1134
|
+
var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1135
|
+
module.exports = {
|
|
1136
|
+
buildSafeSonicBoom: require_build_safe_sonic_boom(),
|
|
1137
|
+
createDate: require_create_date(),
|
|
1138
|
+
deleteLogProperty: require_delete_log_property(),
|
|
1139
|
+
filterLog: require_filter_log(),
|
|
1140
|
+
formatTime: require_format_time(),
|
|
1141
|
+
getPropertyValue: require_get_property_value(),
|
|
1142
|
+
handleCustomLevelsNamesOpts: require_handle_custom_levels_names_opts(),
|
|
1143
|
+
handleCustomLevelsOpts: require_handle_custom_levels_opts(),
|
|
1144
|
+
interpretConditionals: require_interpret_conditionals(),
|
|
1145
|
+
isObject: require_is_object(),
|
|
1146
|
+
isValidDate: require_is_valid_date(),
|
|
1147
|
+
joinLinesWithIndentation: require_join_lines_with_indentation(),
|
|
1148
|
+
noop: require_noop(),
|
|
1149
|
+
parseFactoryOptions: require_parse_factory_options(),
|
|
1150
|
+
prettifyErrorLog: require_prettify_error_log(),
|
|
1151
|
+
prettifyError: require_prettify_error(),
|
|
1152
|
+
prettifyLevel: require_prettify_level(),
|
|
1153
|
+
prettifyMessage: require_prettify_message(),
|
|
1154
|
+
prettifyMetadata: require_prettify_metadata(),
|
|
1155
|
+
prettifyObject: require_prettify_object(),
|
|
1156
|
+
prettifyTime: require_prettify_time(),
|
|
1157
|
+
splitPropertyKey: require_split_property_key(),
|
|
1158
|
+
getLevelLabelData: require_get_level_label_data()
|
|
1159
|
+
};
|
|
1160
|
+
}));
|
|
1161
|
+
/**
|
|
1162
|
+
* A hash of log property names mapped to prettifier functions. When the
|
|
1163
|
+
* incoming log data is being processed for prettification, any key on the log
|
|
1164
|
+
* that matches a key in a custom prettifiers hash will be prettified using
|
|
1165
|
+
* that matching custom prettifier. The value passed to the custom prettifier
|
|
1166
|
+
* will the value associated with the corresponding log key.
|
|
1167
|
+
*
|
|
1168
|
+
* The hash may contain any arbitrary keys for arbitrary log properties, but it
|
|
1169
|
+
* may also contain a set of predefined key names that map to well-known log
|
|
1170
|
+
* properties. These keys are:
|
|
1171
|
+
*
|
|
1172
|
+
* + `time` (for the timestamp field)
|
|
1173
|
+
* + `level` (for the level label field; value may be a level number instead
|
|
1174
|
+
* of a level label)
|
|
1175
|
+
* + `hostname`
|
|
1176
|
+
* + `pid`
|
|
1177
|
+
* + `name`
|
|
1178
|
+
* + `caller`
|
|
1179
|
+
*
|
|
1180
|
+
* @typedef {Object.<string, CustomPrettifierFunc>} CustomPrettifiers
|
|
1181
|
+
*/
|
|
1182
|
+
/**
|
|
1183
|
+
* A synchronous function to be used for prettifying a log property. It must
|
|
1184
|
+
* return a string.
|
|
1185
|
+
*
|
|
1186
|
+
* @typedef {function} CustomPrettifierFunc
|
|
1187
|
+
* @param {any} value The value to be prettified for the key associated with
|
|
1188
|
+
* the prettifier.
|
|
1189
|
+
* @returns {string}
|
|
1190
|
+
*/
|
|
1191
|
+
/**
|
|
1192
|
+
* A tokenized string that indicates how the prettified log line should be
|
|
1193
|
+
* formatted. Tokens are either log properties enclosed in curly braces, e.g.
|
|
1194
|
+
* `{levelLabel}`, `{pid}`, or `{req.url}`, or conditional directives in curly
|
|
1195
|
+
* braces. The only conditional directives supported are `if` and `end`, e.g.
|
|
1196
|
+
* `{if pid}{pid}{end}`; every `if` must have a matching `end`. Nested
|
|
1197
|
+
* conditions are not supported.
|
|
1198
|
+
*
|
|
1199
|
+
* @typedef {string} MessageFormatString
|
|
1200
|
+
*
|
|
1201
|
+
* @example
|
|
1202
|
+
* `{levelLabel} - {if pid}{pid} - {end}url:{req.url}`
|
|
1203
|
+
*/
|
|
1204
|
+
/**
|
|
1205
|
+
* @typedef {object} PrettifyMessageExtras
|
|
1206
|
+
* @property {object} colors Available color functions based on `useColor` (or `colorize`) context
|
|
1207
|
+
* the options.
|
|
1208
|
+
*/
|
|
1209
|
+
/**
|
|
1210
|
+
* A function that accepts a log object, name of the message key, and name of
|
|
1211
|
+
* the level label key and returns a formatted log line.
|
|
1212
|
+
*
|
|
1213
|
+
* Note: this function must be synchronous.
|
|
1214
|
+
*
|
|
1215
|
+
* @typedef {function} MessageFormatFunction
|
|
1216
|
+
* @param {object} log The log object to be processed.
|
|
1217
|
+
* @param {string} messageKey The name of the key in the `log` object that
|
|
1218
|
+
* contains the log message.
|
|
1219
|
+
* @param {string} levelLabel The name of the key in the `log` object that
|
|
1220
|
+
* contains the log level name.
|
|
1221
|
+
* @param {PrettifyMessageExtras} extras Additional data available for message context
|
|
1222
|
+
* @returns {string}
|
|
1223
|
+
*
|
|
1224
|
+
* @example
|
|
1225
|
+
* function (log, messageKey, levelLabel) {
|
|
1226
|
+
* return `${log[levelLabel]} - ${log[messageKey]}`
|
|
1227
|
+
* }
|
|
1228
|
+
*/
|
|
1229
|
+
//#endregion
|
|
1230
|
+
//#region ../../node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.js
|
|
1231
|
+
var require_secure_json_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1232
|
+
var hasBuffer = typeof Buffer !== "undefined";
|
|
1233
|
+
var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
1234
|
+
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
1235
|
+
/**
|
|
1236
|
+
* @description Internal parse function that parses JSON text with security checks.
|
|
1237
|
+
* @private
|
|
1238
|
+
* @param {string|Buffer} text - The JSON text string or Buffer to parse.
|
|
1239
|
+
* @param {Function} [reviver] - The JSON.parse() optional reviver argument.
|
|
1240
|
+
* @param {import('./types').ParseOptions} [options] - Optional configuration object.
|
|
1241
|
+
* @returns {*} The parsed object.
|
|
1242
|
+
* @throws {SyntaxError} If a forbidden prototype property is found and `options.protoAction` or
|
|
1243
|
+
* `options.constructorAction` is `'error'`.
|
|
1244
|
+
*/
|
|
1245
|
+
function _parse(text, reviver, options) {
|
|
1246
|
+
if (options == null) {
|
|
1247
|
+
if (reviver !== null && typeof reviver === "object") {
|
|
1248
|
+
options = reviver;
|
|
1249
|
+
reviver = void 0;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
if (hasBuffer && Buffer.isBuffer(text)) text = text.toString();
|
|
1253
|
+
if (text && text.charCodeAt(0) === 65279) text = text.slice(1);
|
|
1254
|
+
const obj = JSON.parse(text, reviver);
|
|
1255
|
+
if (obj === null || typeof obj !== "object") return obj;
|
|
1256
|
+
const protoAction = options && options.protoAction || "error";
|
|
1257
|
+
const constructorAction = options && options.constructorAction || "error";
|
|
1258
|
+
if (protoAction === "ignore" && constructorAction === "ignore") return obj;
|
|
1259
|
+
if (protoAction !== "ignore" && constructorAction !== "ignore") {
|
|
1260
|
+
if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) return obj;
|
|
1261
|
+
} else if (protoAction !== "ignore" && constructorAction === "ignore") {
|
|
1262
|
+
if (suspectProtoRx.test(text) === false) return obj;
|
|
1263
|
+
} else if (suspectConstructorRx.test(text) === false) return obj;
|
|
1264
|
+
return filter(obj, {
|
|
1265
|
+
protoAction,
|
|
1266
|
+
constructorAction,
|
|
1267
|
+
safe: options && options.safe
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* @description Scans and filters an object for forbidden prototype properties.
|
|
1272
|
+
* @param {Object} obj - The object being scanned.
|
|
1273
|
+
* @param {import('./types').ParseOptions} [options] - Optional configuration object.
|
|
1274
|
+
* @returns {Object|null} The filtered object, or `null` if safe mode is enabled and issues are found.
|
|
1275
|
+
* @throws {SyntaxError} If a forbidden prototype property is found and `options.protoAction` or
|
|
1276
|
+
* `options.constructorAction` is `'error'`.
|
|
1277
|
+
*/
|
|
1278
|
+
function filter(obj, { protoAction = "error", constructorAction = "error", safe } = {}) {
|
|
1279
|
+
let next = [obj];
|
|
1280
|
+
while (next.length) {
|
|
1281
|
+
const nodes = next;
|
|
1282
|
+
next = [];
|
|
1283
|
+
for (const node of nodes) {
|
|
1284
|
+
if (protoAction !== "ignore" && Object.prototype.hasOwnProperty.call(node, "__proto__")) {
|
|
1285
|
+
if (safe === true) return null;
|
|
1286
|
+
else if (protoAction === "error") throw new SyntaxError("Object contains forbidden prototype property");
|
|
1287
|
+
delete node.__proto__;
|
|
1288
|
+
}
|
|
1289
|
+
if (constructorAction !== "ignore" && Object.prototype.hasOwnProperty.call(node, "constructor") && node.constructor !== null && typeof node.constructor === "object" && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) {
|
|
1290
|
+
if (safe === true) return null;
|
|
1291
|
+
else if (constructorAction === "error") throw new SyntaxError("Object contains forbidden prototype property");
|
|
1292
|
+
delete node.constructor;
|
|
1293
|
+
}
|
|
1294
|
+
for (const key in node) {
|
|
1295
|
+
const value = node[key];
|
|
1296
|
+
if (value && typeof value === "object") next.push(value);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
return obj;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* @description Parses a given JSON-formatted text into an object.
|
|
1304
|
+
* @param {string|Buffer} text - The JSON text string or Buffer to parse.
|
|
1305
|
+
* @param {Function} [reviver] - The `JSON.parse()` optional reviver argument, or options object.
|
|
1306
|
+
* @param {import('./types').ParseOptions} [options] - Optional configuration object.
|
|
1307
|
+
* @returns {*} The parsed object.
|
|
1308
|
+
* @throws {SyntaxError} If the JSON text is malformed or contains forbidden prototype properties
|
|
1309
|
+
* when `options.protoAction` or `options.constructorAction` is `'error'`.
|
|
1310
|
+
*/
|
|
1311
|
+
function parse(text, reviver, options) {
|
|
1312
|
+
const { stackTraceLimit } = Error;
|
|
1313
|
+
Error.stackTraceLimit = 0;
|
|
1314
|
+
try {
|
|
1315
|
+
return _parse(text, reviver, options);
|
|
1316
|
+
} finally {
|
|
1317
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* @description Safely parses a given JSON-formatted text into an object.
|
|
1322
|
+
* @param {string|Buffer} text - The JSON text string or Buffer to parse.
|
|
1323
|
+
* @param {Function} [reviver] - The `JSON.parse()` optional reviver argument.
|
|
1324
|
+
* @returns {*|null|undefined} The parsed object, `null` if security issues found, or `undefined` on parse error.
|
|
1325
|
+
*/
|
|
1326
|
+
function safeParse(text, reviver) {
|
|
1327
|
+
const { stackTraceLimit } = Error;
|
|
1328
|
+
Error.stackTraceLimit = 0;
|
|
1329
|
+
try {
|
|
1330
|
+
return _parse(text, reviver, { safe: true });
|
|
1331
|
+
} catch {
|
|
1332
|
+
return;
|
|
1333
|
+
} finally {
|
|
1334
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
module.exports = parse;
|
|
1338
|
+
module.exports.default = parse;
|
|
1339
|
+
module.exports.parse = parse;
|
|
1340
|
+
module.exports.safeParse = safeParse;
|
|
1341
|
+
module.exports.scan = filter;
|
|
1342
|
+
}));
|
|
1343
|
+
//#endregion
|
|
1344
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/pretty.js
|
|
1345
|
+
var require_pretty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1346
|
+
module.exports = pretty;
|
|
1347
|
+
var sjs = require_secure_json_parse();
|
|
1348
|
+
var isObject = require_is_object();
|
|
1349
|
+
var prettifyErrorLog = require_prettify_error_log();
|
|
1350
|
+
var prettifyLevel = require_prettify_level();
|
|
1351
|
+
var prettifyMessage = require_prettify_message();
|
|
1352
|
+
var prettifyMetadata = require_prettify_metadata();
|
|
1353
|
+
var prettifyObject = require_prettify_object();
|
|
1354
|
+
var prettifyTime = require_prettify_time();
|
|
1355
|
+
var filterLog = require_filter_log();
|
|
1356
|
+
var { LEVELS, LEVEL_KEY, LEVEL_NAMES } = require_constants();
|
|
1357
|
+
var jsonParser = (input) => {
|
|
1358
|
+
try {
|
|
1359
|
+
return { value: sjs.parse(input, { protoAction: "remove" }) };
|
|
1360
|
+
} catch (err) {
|
|
1361
|
+
return { err };
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
/**
|
|
1365
|
+
* Orchestrates processing the received log data according to the provided
|
|
1366
|
+
* configuration and returns a prettified log string.
|
|
1367
|
+
*
|
|
1368
|
+
* @typedef {function} LogPrettifierFunc
|
|
1369
|
+
* @param {string|object} inputData A log string or a log-like object.
|
|
1370
|
+
* @returns {string} A string that represents the prettified log data.
|
|
1371
|
+
*/
|
|
1372
|
+
function pretty(inputData) {
|
|
1373
|
+
let log;
|
|
1374
|
+
if (!isObject(inputData)) {
|
|
1375
|
+
const parsed = jsonParser(inputData);
|
|
1376
|
+
if (parsed.err || !isObject(parsed.value)) return inputData + this.EOL;
|
|
1377
|
+
log = parsed.value;
|
|
1378
|
+
} else log = inputData;
|
|
1379
|
+
if (this.minimumLevel) {
|
|
1380
|
+
let condition;
|
|
1381
|
+
if (this.useOnlyCustomProps) condition = this.customLevels;
|
|
1382
|
+
else condition = this.customLevelNames[this.minimumLevel] !== void 0;
|
|
1383
|
+
let minimum;
|
|
1384
|
+
if (condition) minimum = this.customLevelNames[this.minimumLevel];
|
|
1385
|
+
else minimum = LEVEL_NAMES[this.minimumLevel];
|
|
1386
|
+
if (!minimum) minimum = typeof this.minimumLevel === "string" ? LEVEL_NAMES[this.minimumLevel] : LEVEL_NAMES[LEVELS[this.minimumLevel].toLowerCase()];
|
|
1387
|
+
if (log[this.levelKey === void 0 ? LEVEL_KEY : this.levelKey] < minimum) return;
|
|
1388
|
+
}
|
|
1389
|
+
const prettifiedMessage = prettifyMessage({
|
|
1390
|
+
log,
|
|
1391
|
+
context: this.context
|
|
1392
|
+
});
|
|
1393
|
+
if (this.ignoreKeys || this.includeKeys) log = filterLog({
|
|
1394
|
+
log,
|
|
1395
|
+
context: this.context
|
|
1396
|
+
});
|
|
1397
|
+
const prettifiedLevel = prettifyLevel({
|
|
1398
|
+
log,
|
|
1399
|
+
context: {
|
|
1400
|
+
...this.context,
|
|
1401
|
+
...this.context.customProperties
|
|
1402
|
+
}
|
|
1403
|
+
});
|
|
1404
|
+
const prettifiedMetadata = prettifyMetadata({
|
|
1405
|
+
log,
|
|
1406
|
+
context: this.context
|
|
1407
|
+
});
|
|
1408
|
+
const prettifiedTime = prettifyTime({
|
|
1409
|
+
log,
|
|
1410
|
+
context: this.context
|
|
1411
|
+
});
|
|
1412
|
+
let line = "";
|
|
1413
|
+
if (this.levelFirst && prettifiedLevel) line = `${prettifiedLevel}`;
|
|
1414
|
+
if (prettifiedTime && line === "") line = `${prettifiedTime}`;
|
|
1415
|
+
else if (prettifiedTime) line = `${line} ${prettifiedTime}`;
|
|
1416
|
+
if (!this.levelFirst && prettifiedLevel) if (line.length > 0) line = `${line} ${prettifiedLevel}`;
|
|
1417
|
+
else line = prettifiedLevel;
|
|
1418
|
+
if (prettifiedMetadata) if (line.length > 0) line = `${line} ${prettifiedMetadata}:`;
|
|
1419
|
+
else line = prettifiedMetadata;
|
|
1420
|
+
if (line.endsWith(":") === false && line !== "") line += ":";
|
|
1421
|
+
if (prettifiedMessage !== void 0) if (line.length > 0) line = `${line} ${prettifiedMessage}`;
|
|
1422
|
+
else line = prettifiedMessage;
|
|
1423
|
+
if (line.length > 0 && !this.singleLine) line += this.EOL;
|
|
1424
|
+
if (log.type === "Error" && typeof log.stack === "string") {
|
|
1425
|
+
const prettifiedErrorLog = prettifyErrorLog({
|
|
1426
|
+
log,
|
|
1427
|
+
context: this.context
|
|
1428
|
+
});
|
|
1429
|
+
if (this.singleLine) line += this.EOL;
|
|
1430
|
+
line += prettifiedErrorLog;
|
|
1431
|
+
} else if (this.hideObject === false) {
|
|
1432
|
+
const skipKeys = [
|
|
1433
|
+
this.messageKey,
|
|
1434
|
+
this.levelKey,
|
|
1435
|
+
this.timestampKey
|
|
1436
|
+
].map((key) => key.replaceAll(/\\/g, "")).filter((key) => {
|
|
1437
|
+
return typeof log[key] === "string" || typeof log[key] === "number" || typeof log[key] === "boolean";
|
|
1438
|
+
});
|
|
1439
|
+
const prettifiedObject = prettifyObject({
|
|
1440
|
+
log,
|
|
1441
|
+
skipKeys,
|
|
1442
|
+
context: this.context
|
|
1443
|
+
});
|
|
1444
|
+
if (this.singleLine && !/^\s$/.test(prettifiedObject)) line += " ";
|
|
1445
|
+
line += prettifiedObject;
|
|
1446
|
+
}
|
|
1447
|
+
return line;
|
|
1448
|
+
}
|
|
1449
|
+
}));
|
|
1450
|
+
//#endregion
|
|
1451
|
+
//#region ../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/index.js
|
|
1452
|
+
var require_pino_pretty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1453
|
+
var { isColorSupported } = require_colorette();
|
|
1454
|
+
var pump = require_pump();
|
|
1455
|
+
var { Transform } = __require("node:stream");
|
|
1456
|
+
var abstractTransport = require_pino_abstract_transport();
|
|
1457
|
+
var colors = require_colors();
|
|
1458
|
+
var { ERROR_LIKE_KEYS, LEVEL_KEY, LEVEL_LABEL, MESSAGE_KEY, TIMESTAMP_KEY } = require_constants();
|
|
1459
|
+
var { buildSafeSonicBoom, parseFactoryOptions } = require_utils();
|
|
1460
|
+
var pretty = require_pretty();
|
|
1461
|
+
/**
|
|
1462
|
+
* @typedef {object} PinoPrettyOptions
|
|
1463
|
+
* @property {boolean} [colorize] Indicates if colors should be used when
|
|
1464
|
+
* prettifying. The default will be determined by the terminal capabilities at
|
|
1465
|
+
* run time.
|
|
1466
|
+
* @property {boolean} [colorizeObjects=true] Apply coloring to rendered objects
|
|
1467
|
+
* when coloring is enabled.
|
|
1468
|
+
* @property {boolean} [crlf=false] End lines with `\r\n` instead of `\n`.
|
|
1469
|
+
* @property {string|null} [customColors=null] A comma separated list of colors
|
|
1470
|
+
* to use for specific level labels, e.g. `err:red,info:blue`.
|
|
1471
|
+
* @property {string|null} [customLevels=null] A comma separated list of user
|
|
1472
|
+
* defined level names and numbers, e.g. `err:99,info:1`.
|
|
1473
|
+
* @property {CustomPrettifiers} [customPrettifiers={}] A set of prettifier
|
|
1474
|
+
* functions to apply to keys defined in this object.
|
|
1475
|
+
* @property {K_ERROR_LIKE_KEYS} [errorLikeObjectKeys] A list of string property
|
|
1476
|
+
* names to consider as error objects.
|
|
1477
|
+
* @property {string} [errorProps=''] A comma separated list of properties on
|
|
1478
|
+
* error objects to include in the output.
|
|
1479
|
+
* @property {boolean} [hideObject=false] When `true`, data objects will be
|
|
1480
|
+
* omitted from the output (except for error objects).
|
|
1481
|
+
* @property {string} [ignore='hostname'] A comma separated list of log keys
|
|
1482
|
+
* to omit when outputting the prettified log information.
|
|
1483
|
+
* @property {undefined|string} [include=undefined] A comma separated list of
|
|
1484
|
+
* log keys to include in the prettified log information. Only the keys in this
|
|
1485
|
+
* list will be included in the output.
|
|
1486
|
+
* @property {boolean} [levelFirst=false] When true, the log level will be the
|
|
1487
|
+
* first field in the prettified output.
|
|
1488
|
+
* @property {string} [levelKey='level'] The key name in the log data that
|
|
1489
|
+
* contains the level value for the log.
|
|
1490
|
+
* @property {string} [levelLabel='levelLabel'] Token name to use in
|
|
1491
|
+
* `messageFormat` to represent the name of the logged level.
|
|
1492
|
+
* @property {null|MessageFormatString|MessageFormatFunction} [messageFormat=null]
|
|
1493
|
+
* When a string, defines how the prettified line should be formatted according
|
|
1494
|
+
* to defined tokens. When a function, a synchronous function that returns a
|
|
1495
|
+
* formatted string.
|
|
1496
|
+
* @property {string} [messageKey='msg'] Defines the key in incoming logs that
|
|
1497
|
+
* contains the message of the log, if present.
|
|
1498
|
+
* @property {undefined|string|number} [minimumLevel=undefined] The minimum
|
|
1499
|
+
* level for logs that should be processed. Any logs below this level will
|
|
1500
|
+
* be omitted.
|
|
1501
|
+
* @property {object} [outputStream=process.stdout] The stream to write
|
|
1502
|
+
* prettified log lines to.
|
|
1503
|
+
* @property {boolean} [singleLine=false] When `true` any objects, except error
|
|
1504
|
+
* objects, in the log data will be printed as a single line instead as multiple
|
|
1505
|
+
* lines.
|
|
1506
|
+
* @property {string} [timestampKey='time'] Defines the key in incoming logs
|
|
1507
|
+
* that contains the timestamp of the log, if present.
|
|
1508
|
+
* @property {boolean|string} [translateTime=true] When true, will translate a
|
|
1509
|
+
* JavaScript date integer into a human-readable string. If set to a string,
|
|
1510
|
+
* it must be a format string.
|
|
1511
|
+
* @property {boolean} [useOnlyCustomProps=true] When true, only custom levels
|
|
1512
|
+
* and colors will be used if they have been provided.
|
|
1513
|
+
*/
|
|
1514
|
+
/**
|
|
1515
|
+
* The default options that will be used when prettifying log lines.
|
|
1516
|
+
*
|
|
1517
|
+
* @type {PinoPrettyOptions}
|
|
1518
|
+
*/
|
|
1519
|
+
var defaultOptions = {
|
|
1520
|
+
colorize: isColorSupported,
|
|
1521
|
+
colorizeObjects: true,
|
|
1522
|
+
crlf: false,
|
|
1523
|
+
customColors: null,
|
|
1524
|
+
customLevels: null,
|
|
1525
|
+
customPrettifiers: {},
|
|
1526
|
+
errorLikeObjectKeys: ERROR_LIKE_KEYS,
|
|
1527
|
+
errorProps: "",
|
|
1528
|
+
hideObject: false,
|
|
1529
|
+
ignore: "hostname",
|
|
1530
|
+
include: void 0,
|
|
1531
|
+
levelFirst: false,
|
|
1532
|
+
levelKey: LEVEL_KEY,
|
|
1533
|
+
levelLabel: LEVEL_LABEL,
|
|
1534
|
+
messageFormat: null,
|
|
1535
|
+
messageKey: MESSAGE_KEY,
|
|
1536
|
+
minimumLevel: void 0,
|
|
1537
|
+
outputStream: process.stdout,
|
|
1538
|
+
singleLine: false,
|
|
1539
|
+
timestampKey: TIMESTAMP_KEY,
|
|
1540
|
+
translateTime: true,
|
|
1541
|
+
useOnlyCustomProps: true
|
|
1542
|
+
};
|
|
1543
|
+
/**
|
|
1544
|
+
* Processes the supplied options and returns a function that accepts log data
|
|
1545
|
+
* and produces a prettified log string.
|
|
1546
|
+
*
|
|
1547
|
+
* @param {PinoPrettyOptions} options Configuration for the prettifier.
|
|
1548
|
+
* @returns {LogPrettifierFunc}
|
|
1549
|
+
*/
|
|
1550
|
+
function prettyFactory(options) {
|
|
1551
|
+
const context = parseFactoryOptions(Object.assign({}, defaultOptions, options));
|
|
1552
|
+
return pretty.bind({
|
|
1553
|
+
...context,
|
|
1554
|
+
context
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
/**
|
|
1558
|
+
* @typedef {PinoPrettyOptions} BuildStreamOpts
|
|
1559
|
+
* @property {object|number|string} [destination] A destination stream, file
|
|
1560
|
+
* descriptor, or target path to a file.
|
|
1561
|
+
* @property {boolean} [append]
|
|
1562
|
+
* @property {boolean} [mkdir]
|
|
1563
|
+
* @property {boolean} [sync=false]
|
|
1564
|
+
*/
|
|
1565
|
+
/**
|
|
1566
|
+
* Constructs a {@link LogPrettifierFunc} and a stream to which the produced
|
|
1567
|
+
* prettified log data will be written.
|
|
1568
|
+
*
|
|
1569
|
+
* @param {BuildStreamOpts} opts
|
|
1570
|
+
* @returns {Transform | (Transform & OnUnknown)}
|
|
1571
|
+
*/
|
|
1572
|
+
function build(opts = {}) {
|
|
1573
|
+
let pretty = prettyFactory(opts);
|
|
1574
|
+
let destination;
|
|
1575
|
+
return abstractTransport(function(source) {
|
|
1576
|
+
source.on("message", function pinoConfigListener(message) {
|
|
1577
|
+
if (!message || message.code !== "PINO_CONFIG") return;
|
|
1578
|
+
Object.assign(opts, {
|
|
1579
|
+
messageKey: message.config.messageKey,
|
|
1580
|
+
errorLikeObjectKeys: Array.from(new Set([...opts.errorLikeObjectKeys || ERROR_LIKE_KEYS, message.config.errorKey])),
|
|
1581
|
+
customLevels: message.config.levels.values
|
|
1582
|
+
});
|
|
1583
|
+
pretty = prettyFactory(opts);
|
|
1584
|
+
source.off("message", pinoConfigListener);
|
|
1585
|
+
});
|
|
1586
|
+
const stream = new Transform({
|
|
1587
|
+
objectMode: true,
|
|
1588
|
+
autoDestroy: true,
|
|
1589
|
+
transform(chunk, enc, cb) {
|
|
1590
|
+
cb(null, pretty(chunk));
|
|
1591
|
+
}
|
|
1592
|
+
});
|
|
1593
|
+
if (typeof opts.destination === "object" && typeof opts.destination.write === "function") destination = opts.destination;
|
|
1594
|
+
else destination = buildSafeSonicBoom({
|
|
1595
|
+
dest: opts.destination || 1,
|
|
1596
|
+
append: opts.append,
|
|
1597
|
+
mkdir: opts.mkdir,
|
|
1598
|
+
sync: opts.sync
|
|
1599
|
+
});
|
|
1600
|
+
source.on("unknown", function(line) {
|
|
1601
|
+
destination.write(line + "\n");
|
|
1602
|
+
});
|
|
1603
|
+
pump(source, stream, destination);
|
|
1604
|
+
return stream;
|
|
1605
|
+
}, {
|
|
1606
|
+
parse: "lines",
|
|
1607
|
+
close(err, cb) {
|
|
1608
|
+
destination.on("close", () => {
|
|
1609
|
+
cb(err);
|
|
1610
|
+
});
|
|
1611
|
+
}
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
module.exports = build;
|
|
1615
|
+
module.exports.build = build;
|
|
1616
|
+
module.exports.PinoPretty = build;
|
|
1617
|
+
module.exports.prettyFactory = prettyFactory;
|
|
1618
|
+
module.exports.colorizerFactory = colors;
|
|
1619
|
+
module.exports.isColorSupported = isColorSupported;
|
|
1620
|
+
module.exports.default = build;
|
|
1621
|
+
}));
|
|
1622
|
+
//#endregion
|
|
1623
|
+
export { require_pino_pretty as t };
|