codecane 1.0.274 → 1.0.275

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.
Files changed (2) hide show
  1. package/dist/index.js +45 -4260
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7773,4221 +7773,6 @@ __p += '`;
7773
7773
  }).call(exports);
7774
7774
  });
7775
7775
 
7776
- // ../node_modules/pino-std-serializers/lib/err-helpers.js
7777
- var require_err_helpers = __commonJS((exports, module) => {
7778
- var isErrorLike = (err) => {
7779
- return err && typeof err.message === "string";
7780
- };
7781
- var getErrorCause = (err) => {
7782
- if (!err)
7783
- return;
7784
- const cause = err.cause;
7785
- if (typeof cause === "function") {
7786
- const causeResult = err.cause();
7787
- return isErrorLike(causeResult) ? causeResult : undefined;
7788
- } else {
7789
- return isErrorLike(cause) ? cause : undefined;
7790
- }
7791
- };
7792
- var _stackWithCauses = (err, seen) => {
7793
- if (!isErrorLike(err))
7794
- return "";
7795
- const stack = err.stack || "";
7796
- if (seen.has(err)) {
7797
- return stack + `
7798
- causes have become circular...`;
7799
- }
7800
- const cause = getErrorCause(err);
7801
- if (cause) {
7802
- seen.add(err);
7803
- return stack + `
7804
- caused by: ` + _stackWithCauses(cause, seen);
7805
- } else {
7806
- return stack;
7807
- }
7808
- };
7809
- var stackWithCauses = (err) => _stackWithCauses(err, new Set);
7810
- var _messageWithCauses = (err, seen, skip) => {
7811
- if (!isErrorLike(err))
7812
- return "";
7813
- const message = skip ? "" : err.message || "";
7814
- if (seen.has(err)) {
7815
- return message + ": ...";
7816
- }
7817
- const cause = getErrorCause(err);
7818
- if (cause) {
7819
- seen.add(err);
7820
- const skipIfVErrorStyleCause = typeof err.cause === "function";
7821
- return message + (skipIfVErrorStyleCause ? "" : ": ") + _messageWithCauses(cause, seen, skipIfVErrorStyleCause);
7822
- } else {
7823
- return message;
7824
- }
7825
- };
7826
- var messageWithCauses = (err) => _messageWithCauses(err, new Set);
7827
- module.exports = {
7828
- isErrorLike,
7829
- getErrorCause,
7830
- stackWithCauses,
7831
- messageWithCauses
7832
- };
7833
- });
7834
-
7835
- // ../node_modules/pino-std-serializers/lib/err-proto.js
7836
- var require_err_proto = __commonJS((exports, module) => {
7837
- var seen = Symbol("circular-ref-tag");
7838
- var rawSymbol = Symbol("pino-raw-err-ref");
7839
- var pinoErrProto = Object.create({}, {
7840
- type: {
7841
- enumerable: true,
7842
- writable: true,
7843
- value: undefined
7844
- },
7845
- message: {
7846
- enumerable: true,
7847
- writable: true,
7848
- value: undefined
7849
- },
7850
- stack: {
7851
- enumerable: true,
7852
- writable: true,
7853
- value: undefined
7854
- },
7855
- aggregateErrors: {
7856
- enumerable: true,
7857
- writable: true,
7858
- value: undefined
7859
- },
7860
- raw: {
7861
- enumerable: false,
7862
- get: function() {
7863
- return this[rawSymbol];
7864
- },
7865
- set: function(val) {
7866
- this[rawSymbol] = val;
7867
- }
7868
- }
7869
- });
7870
- Object.defineProperty(pinoErrProto, rawSymbol, {
7871
- writable: true,
7872
- value: {}
7873
- });
7874
- module.exports = {
7875
- pinoErrProto,
7876
- pinoErrorSymbols: {
7877
- seen,
7878
- rawSymbol
7879
- }
7880
- };
7881
- });
7882
-
7883
- // ../node_modules/pino-std-serializers/lib/err.js
7884
- var require_err = __commonJS((exports, module) => {
7885
- module.exports = errSerializer;
7886
- var { messageWithCauses, stackWithCauses, isErrorLike } = require_err_helpers();
7887
- var { pinoErrProto, pinoErrorSymbols } = require_err_proto();
7888
- var { seen } = pinoErrorSymbols;
7889
- var { toString } = Object.prototype;
7890
- function errSerializer(err) {
7891
- if (!isErrorLike(err)) {
7892
- return err;
7893
- }
7894
- err[seen] = undefined;
7895
- const _err = Object.create(pinoErrProto);
7896
- _err.type = toString.call(err.constructor) === "[object Function]" ? err.constructor.name : err.name;
7897
- _err.message = messageWithCauses(err);
7898
- _err.stack = stackWithCauses(err);
7899
- if (Array.isArray(err.errors)) {
7900
- _err.aggregateErrors = err.errors.map((err2) => errSerializer(err2));
7901
- }
7902
- for (const key in err) {
7903
- if (_err[key] === undefined) {
7904
- const val = err[key];
7905
- if (isErrorLike(val)) {
7906
- if (key !== "cause" && !Object.prototype.hasOwnProperty.call(val, seen)) {
7907
- _err[key] = errSerializer(val);
7908
- }
7909
- } else {
7910
- _err[key] = val;
7911
- }
7912
- }
7913
- }
7914
- delete err[seen];
7915
- _err.raw = err;
7916
- return _err;
7917
- }
7918
- });
7919
-
7920
- // ../node_modules/pino-std-serializers/lib/err-with-cause.js
7921
- var require_err_with_cause = __commonJS((exports, module) => {
7922
- module.exports = errWithCauseSerializer;
7923
- var { isErrorLike } = require_err_helpers();
7924
- var { pinoErrProto, pinoErrorSymbols } = require_err_proto();
7925
- var { seen } = pinoErrorSymbols;
7926
- var { toString } = Object.prototype;
7927
- function errWithCauseSerializer(err) {
7928
- if (!isErrorLike(err)) {
7929
- return err;
7930
- }
7931
- err[seen] = undefined;
7932
- const _err = Object.create(pinoErrProto);
7933
- _err.type = toString.call(err.constructor) === "[object Function]" ? err.constructor.name : err.name;
7934
- _err.message = err.message;
7935
- _err.stack = err.stack;
7936
- if (Array.isArray(err.errors)) {
7937
- _err.aggregateErrors = err.errors.map((err2) => errWithCauseSerializer(err2));
7938
- }
7939
- if (isErrorLike(err.cause) && !Object.prototype.hasOwnProperty.call(err.cause, seen)) {
7940
- _err.cause = errWithCauseSerializer(err.cause);
7941
- }
7942
- for (const key in err) {
7943
- if (_err[key] === undefined) {
7944
- const val = err[key];
7945
- if (isErrorLike(val)) {
7946
- if (!Object.prototype.hasOwnProperty.call(val, seen)) {
7947
- _err[key] = errWithCauseSerializer(val);
7948
- }
7949
- } else {
7950
- _err[key] = val;
7951
- }
7952
- }
7953
- }
7954
- delete err[seen];
7955
- _err.raw = err;
7956
- return _err;
7957
- }
7958
- });
7959
-
7960
- // ../node_modules/pino-std-serializers/lib/req.js
7961
- var require_req = __commonJS((exports, module) => {
7962
- module.exports = {
7963
- mapHttpRequest,
7964
- reqSerializer
7965
- };
7966
- var rawSymbol = Symbol("pino-raw-req-ref");
7967
- var pinoReqProto = Object.create({}, {
7968
- id: {
7969
- enumerable: true,
7970
- writable: true,
7971
- value: ""
7972
- },
7973
- method: {
7974
- enumerable: true,
7975
- writable: true,
7976
- value: ""
7977
- },
7978
- url: {
7979
- enumerable: true,
7980
- writable: true,
7981
- value: ""
7982
- },
7983
- query: {
7984
- enumerable: true,
7985
- writable: true,
7986
- value: ""
7987
- },
7988
- params: {
7989
- enumerable: true,
7990
- writable: true,
7991
- value: ""
7992
- },
7993
- headers: {
7994
- enumerable: true,
7995
- writable: true,
7996
- value: {}
7997
- },
7998
- remoteAddress: {
7999
- enumerable: true,
8000
- writable: true,
8001
- value: ""
8002
- },
8003
- remotePort: {
8004
- enumerable: true,
8005
- writable: true,
8006
- value: ""
8007
- },
8008
- raw: {
8009
- enumerable: false,
8010
- get: function() {
8011
- return this[rawSymbol];
8012
- },
8013
- set: function(val) {
8014
- this[rawSymbol] = val;
8015
- }
8016
- }
8017
- });
8018
- Object.defineProperty(pinoReqProto, rawSymbol, {
8019
- writable: true,
8020
- value: {}
8021
- });
8022
- function reqSerializer(req) {
8023
- const connection = req.info || req.socket;
8024
- const _req = Object.create(pinoReqProto);
8025
- _req.id = typeof req.id === "function" ? req.id() : req.id || (req.info ? req.info.id : undefined);
8026
- _req.method = req.method;
8027
- if (req.originalUrl) {
8028
- _req.url = req.originalUrl;
8029
- } else {
8030
- const path3 = req.path;
8031
- _req.url = typeof path3 === "string" ? path3 : req.url ? req.url.path || req.url : undefined;
8032
- }
8033
- if (req.query) {
8034
- _req.query = req.query;
8035
- }
8036
- if (req.params) {
8037
- _req.params = req.params;
8038
- }
8039
- _req.headers = req.headers;
8040
- _req.remoteAddress = connection && connection.remoteAddress;
8041
- _req.remotePort = connection && connection.remotePort;
8042
- _req.raw = req.raw || req;
8043
- return _req;
8044
- }
8045
- function mapHttpRequest(req) {
8046
- return {
8047
- req: reqSerializer(req)
8048
- };
8049
- }
8050
- });
8051
-
8052
- // ../node_modules/pino-std-serializers/lib/res.js
8053
- var require_res = __commonJS((exports, module) => {
8054
- module.exports = {
8055
- mapHttpResponse,
8056
- resSerializer
8057
- };
8058
- var rawSymbol = Symbol("pino-raw-res-ref");
8059
- var pinoResProto = Object.create({}, {
8060
- statusCode: {
8061
- enumerable: true,
8062
- writable: true,
8063
- value: 0
8064
- },
8065
- headers: {
8066
- enumerable: true,
8067
- writable: true,
8068
- value: ""
8069
- },
8070
- raw: {
8071
- enumerable: false,
8072
- get: function() {
8073
- return this[rawSymbol];
8074
- },
8075
- set: function(val) {
8076
- this[rawSymbol] = val;
8077
- }
8078
- }
8079
- });
8080
- Object.defineProperty(pinoResProto, rawSymbol, {
8081
- writable: true,
8082
- value: {}
8083
- });
8084
- function resSerializer(res) {
8085
- const _res = Object.create(pinoResProto);
8086
- _res.statusCode = res.headersSent ? res.statusCode : null;
8087
- _res.headers = res.getHeaders ? res.getHeaders() : res._headers;
8088
- _res.raw = res;
8089
- return _res;
8090
- }
8091
- function mapHttpResponse(res) {
8092
- return {
8093
- res: resSerializer(res)
8094
- };
8095
- }
8096
- });
8097
-
8098
- // ../node_modules/pino-std-serializers/index.js
8099
- var require_pino_std_serializers = __commonJS((exports, module) => {
8100
- var errSerializer = require_err();
8101
- var errWithCauseSerializer = require_err_with_cause();
8102
- var reqSerializers = require_req();
8103
- var resSerializers = require_res();
8104
- module.exports = {
8105
- err: errSerializer,
8106
- errWithCause: errWithCauseSerializer,
8107
- mapHttpRequest: reqSerializers.mapHttpRequest,
8108
- mapHttpResponse: resSerializers.mapHttpResponse,
8109
- req: reqSerializers.reqSerializer,
8110
- res: resSerializers.resSerializer,
8111
- wrapErrorSerializer: function wrapErrorSerializer(customSerializer) {
8112
- if (customSerializer === errSerializer)
8113
- return customSerializer;
8114
- return function wrapErrSerializer(err) {
8115
- return customSerializer(errSerializer(err));
8116
- };
8117
- },
8118
- wrapRequestSerializer: function wrapRequestSerializer(customSerializer) {
8119
- if (customSerializer === reqSerializers.reqSerializer)
8120
- return customSerializer;
8121
- return function wrappedReqSerializer(req) {
8122
- return customSerializer(reqSerializers.reqSerializer(req));
8123
- };
8124
- },
8125
- wrapResponseSerializer: function wrapResponseSerializer(customSerializer) {
8126
- if (customSerializer === resSerializers.resSerializer)
8127
- return customSerializer;
8128
- return function wrappedResSerializer(res) {
8129
- return customSerializer(resSerializers.resSerializer(res));
8130
- };
8131
- }
8132
- };
8133
- });
8134
-
8135
- // ../node_modules/pino/lib/caller.js
8136
- var require_caller = __commonJS((exports, module) => {
8137
- function noOpPrepareStackTrace(_, stack) {
8138
- return stack;
8139
- }
8140
- module.exports = function getCallers() {
8141
- const originalPrepare = Error.prepareStackTrace;
8142
- Error.prepareStackTrace = noOpPrepareStackTrace;
8143
- const stack = new Error().stack;
8144
- Error.prepareStackTrace = originalPrepare;
8145
- if (!Array.isArray(stack)) {
8146
- return;
8147
- }
8148
- const entries = stack.slice(2);
8149
- const fileNames = [];
8150
- for (const entry of entries) {
8151
- if (!entry) {
8152
- continue;
8153
- }
8154
- fileNames.push(entry.getFileName());
8155
- }
8156
- return fileNames;
8157
- };
8158
- });
8159
-
8160
- // ../node_modules/fast-redact/lib/validator.js
8161
- var require_validator = __commonJS((exports, module) => {
8162
- module.exports = validator;
8163
- function validator(opts = {}) {
8164
- const {
8165
- ERR_PATHS_MUST_BE_STRINGS = () => "fast-redact - Paths must be (non-empty) strings",
8166
- ERR_INVALID_PATH = (s) => `fast-redact – Invalid path (${s})`
8167
- } = opts;
8168
- return function validate({ paths }) {
8169
- paths.forEach((s) => {
8170
- if (typeof s !== "string") {
8171
- throw Error(ERR_PATHS_MUST_BE_STRINGS());
8172
- }
8173
- try {
8174
- if (/〇/.test(s))
8175
- throw Error();
8176
- const expr = (s[0] === "[" ? "" : ".") + s.replace(/^\*/, "〇").replace(/\.\*/g, ".〇").replace(/\[\*\]/g, "[〇]");
8177
- if (/\n|\r|;/.test(expr))
8178
- throw Error();
8179
- if (/\/\*/.test(expr))
8180
- throw Error();
8181
- Function(`
8182
- 'use strict'
8183
- const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
8184
- const 〇 = null;
8185
- o${expr}
8186
- if ([o${expr}].length !== 1) throw Error()`)();
8187
- } catch (e) {
8188
- throw Error(ERR_INVALID_PATH(s));
8189
- }
8190
- });
8191
- };
8192
- }
8193
- });
8194
-
8195
- // ../node_modules/fast-redact/lib/rx.js
8196
- var require_rx = __commonJS((exports, module) => {
8197
- module.exports = /[^.[\]]+|\[((?:.)*?)\]/g;
8198
- });
8199
-
8200
- // ../node_modules/fast-redact/lib/parse.js
8201
- var require_parse = __commonJS((exports, module) => {
8202
- var rx = require_rx();
8203
- module.exports = parse;
8204
- function parse({ paths }) {
8205
- const wildcards = [];
8206
- var wcLen = 0;
8207
- const secret = paths.reduce(function(o, strPath, ix) {
8208
- var path3 = strPath.match(rx).map((p) => p.replace(/'|"|`/g, ""));
8209
- const leadingBracket = strPath[0] === "[";
8210
- path3 = path3.map((p) => {
8211
- if (p[0] === "[")
8212
- return p.substr(1, p.length - 2);
8213
- else
8214
- return p;
8215
- });
8216
- const star = path3.indexOf("*");
8217
- if (star > -1) {
8218
- const before = path3.slice(0, star);
8219
- const beforeStr = before.join(".");
8220
- const after = path3.slice(star + 1, path3.length);
8221
- const nested = after.length > 0;
8222
- wcLen++;
8223
- wildcards.push({
8224
- before,
8225
- beforeStr,
8226
- after,
8227
- nested
8228
- });
8229
- } else {
8230
- o[strPath] = {
8231
- path: path3,
8232
- val: undefined,
8233
- precensored: false,
8234
- circle: "",
8235
- escPath: JSON.stringify(strPath),
8236
- leadingBracket
8237
- };
8238
- }
8239
- return o;
8240
- }, {});
8241
- return { wildcards, wcLen, secret };
8242
- }
8243
- });
8244
-
8245
- // ../node_modules/fast-redact/lib/redactor.js
8246
- var require_redactor = __commonJS((exports, module) => {
8247
- var rx = require_rx();
8248
- module.exports = redactor;
8249
- function redactor({ secret, serialize, wcLen, strict, isCensorFct, censorFctTakesPath }, state) {
8250
- const redact = Function("o", `
8251
- if (typeof o !== 'object' || o == null) {
8252
- ${strictImpl(strict, serialize)}
8253
- }
8254
- const { censor, secret } = this
8255
- const originalSecret = {}
8256
- const secretKeys = Object.keys(secret)
8257
- for (var i = 0; i < secretKeys.length; i++) {
8258
- originalSecret[secretKeys[i]] = secret[secretKeys[i]]
8259
- }
8260
-
8261
- ${redactTmpl(secret, isCensorFct, censorFctTakesPath)}
8262
- this.compileRestore()
8263
- ${dynamicRedactTmpl(wcLen > 0, isCensorFct, censorFctTakesPath)}
8264
- this.secret = originalSecret
8265
- ${resultTmpl(serialize)}
8266
- `).bind(state);
8267
- redact.state = state;
8268
- if (serialize === false) {
8269
- redact.restore = (o) => state.restore(o);
8270
- }
8271
- return redact;
8272
- }
8273
- function redactTmpl(secret, isCensorFct, censorFctTakesPath) {
8274
- return Object.keys(secret).map((path3) => {
8275
- const { escPath, leadingBracket, path: arrPath } = secret[path3];
8276
- const skip = leadingBracket ? 1 : 0;
8277
- const delim = leadingBracket ? "" : ".";
8278
- const hops = [];
8279
- var match;
8280
- while ((match = rx.exec(path3)) !== null) {
8281
- const [, ix] = match;
8282
- const { index, input } = match;
8283
- if (index > skip)
8284
- hops.push(input.substring(0, index - (ix ? 0 : 1)));
8285
- }
8286
- var existence = hops.map((p) => `o${delim}${p}`).join(" && ");
8287
- if (existence.length === 0)
8288
- existence += `o${delim}${path3} != null`;
8289
- else
8290
- existence += ` && o${delim}${path3} != null`;
8291
- const circularDetection = `
8292
- switch (true) {
8293
- ${hops.reverse().map((p) => `
8294
- case o${delim}${p} === censor:
8295
- secret[${escPath}].circle = ${JSON.stringify(p)}
8296
- break
8297
- `).join(`
8298
- `)}
8299
- }
8300
- `;
8301
- const censorArgs = censorFctTakesPath ? `val, ${JSON.stringify(arrPath)}` : `val`;
8302
- return `
8303
- if (${existence}) {
8304
- const val = o${delim}${path3}
8305
- if (val === censor) {
8306
- secret[${escPath}].precensored = true
8307
- } else {
8308
- secret[${escPath}].val = val
8309
- o${delim}${path3} = ${isCensorFct ? `censor(${censorArgs})` : "censor"}
8310
- ${circularDetection}
8311
- }
8312
- }
8313
- `;
8314
- }).join(`
8315
- `);
8316
- }
8317
- function dynamicRedactTmpl(hasWildcards, isCensorFct, censorFctTakesPath) {
8318
- return hasWildcards === true ? `
8319
- {
8320
- const { wildcards, wcLen, groupRedact, nestedRedact } = this
8321
- for (var i = 0; i < wcLen; i++) {
8322
- const { before, beforeStr, after, nested } = wildcards[i]
8323
- if (nested === true) {
8324
- secret[beforeStr] = secret[beforeStr] || []
8325
- nestedRedact(secret[beforeStr], o, before, after, censor, ${isCensorFct}, ${censorFctTakesPath})
8326
- } else secret[beforeStr] = groupRedact(o, before, censor, ${isCensorFct}, ${censorFctTakesPath})
8327
- }
8328
- }
8329
- ` : "";
8330
- }
8331
- function resultTmpl(serialize) {
8332
- return serialize === false ? `return o` : `
8333
- var s = this.serialize(o)
8334
- this.restore(o)
8335
- return s
8336
- `;
8337
- }
8338
- function strictImpl(strict, serialize) {
8339
- return strict === true ? `throw Error('fast-redact: primitives cannot be redacted')` : serialize === false ? `return o` : `return this.serialize(o)`;
8340
- }
8341
- });
8342
-
8343
- // ../node_modules/fast-redact/lib/modifiers.js
8344
- var require_modifiers = __commonJS((exports, module) => {
8345
- module.exports = {
8346
- groupRedact,
8347
- groupRestore,
8348
- nestedRedact,
8349
- nestedRestore
8350
- };
8351
- function groupRestore({ keys, values, target }) {
8352
- if (target == null || typeof target === "string")
8353
- return;
8354
- const length = keys.length;
8355
- for (var i = 0;i < length; i++) {
8356
- const k = keys[i];
8357
- target[k] = values[i];
8358
- }
8359
- }
8360
- function groupRedact(o, path3, censor, isCensorFct, censorFctTakesPath) {
8361
- const target = get(o, path3);
8362
- if (target == null || typeof target === "string")
8363
- return { keys: null, values: null, target, flat: true };
8364
- const keys = Object.keys(target);
8365
- const keysLength = keys.length;
8366
- const pathLength = path3.length;
8367
- const pathWithKey = censorFctTakesPath ? [...path3] : undefined;
8368
- const values = new Array(keysLength);
8369
- for (var i = 0;i < keysLength; i++) {
8370
- const key = keys[i];
8371
- values[i] = target[key];
8372
- if (censorFctTakesPath) {
8373
- pathWithKey[pathLength] = key;
8374
- target[key] = censor(target[key], pathWithKey);
8375
- } else if (isCensorFct) {
8376
- target[key] = censor(target[key]);
8377
- } else {
8378
- target[key] = censor;
8379
- }
8380
- }
8381
- return { keys, values, target, flat: true };
8382
- }
8383
- function nestedRestore(instructions) {
8384
- for (let i = 0;i < instructions.length; i++) {
8385
- const { target, path: path3, value } = instructions[i];
8386
- let current = target;
8387
- for (let i2 = path3.length - 1;i2 > 0; i2--) {
8388
- current = current[path3[i2]];
8389
- }
8390
- current[path3[0]] = value;
8391
- }
8392
- }
8393
- function nestedRedact(store, o, path3, ns, censor, isCensorFct, censorFctTakesPath) {
8394
- const target = get(o, path3);
8395
- if (target == null)
8396
- return;
8397
- const keys = Object.keys(target);
8398
- const keysLength = keys.length;
8399
- for (var i = 0;i < keysLength; i++) {
8400
- const key = keys[i];
8401
- specialSet(store, target, key, path3, ns, censor, isCensorFct, censorFctTakesPath);
8402
- }
8403
- return store;
8404
- }
8405
- function has(obj, prop) {
8406
- return obj !== undefined && obj !== null ? "hasOwn" in Object ? Object.hasOwn(obj, prop) : Object.prototype.hasOwnProperty.call(obj, prop) : false;
8407
- }
8408
- function specialSet(store, o, k, path3, afterPath, censor, isCensorFct, censorFctTakesPath) {
8409
- const afterPathLen = afterPath.length;
8410
- const lastPathIndex = afterPathLen - 1;
8411
- const originalKey = k;
8412
- var i = -1;
8413
- var n;
8414
- var nv;
8415
- var ov;
8416
- var oov = null;
8417
- var wc = null;
8418
- var kIsWc;
8419
- var wcov;
8420
- var consecutive = false;
8421
- var level = 0;
8422
- var depth = 0;
8423
- var redactPathCurrent = tree();
8424
- ov = n = o[k];
8425
- if (typeof n !== "object")
8426
- return;
8427
- while (n != null && ++i < afterPathLen) {
8428
- depth += 1;
8429
- k = afterPath[i];
8430
- oov = ov;
8431
- if (k !== "*" && !wc && !(typeof n === "object" && (k in n))) {
8432
- break;
8433
- }
8434
- if (k === "*") {
8435
- if (wc === "*") {
8436
- consecutive = true;
8437
- }
8438
- wc = k;
8439
- if (i !== lastPathIndex) {
8440
- continue;
8441
- }
8442
- }
8443
- if (wc) {
8444
- const wcKeys = Object.keys(n);
8445
- for (var j = 0;j < wcKeys.length; j++) {
8446
- const wck = wcKeys[j];
8447
- wcov = n[wck];
8448
- kIsWc = k === "*";
8449
- if (consecutive) {
8450
- redactPathCurrent = node(redactPathCurrent, wck, depth);
8451
- level = i;
8452
- ov = iterateNthLevel(wcov, level - 1, k, path3, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, o[originalKey], depth + 1);
8453
- } else {
8454
- if (kIsWc || typeof wcov === "object" && wcov !== null && k in wcov) {
8455
- if (kIsWc) {
8456
- ov = wcov;
8457
- } else {
8458
- ov = wcov[k];
8459
- }
8460
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [...path3, originalKey, ...afterPath]) : censor(ov) : censor;
8461
- if (kIsWc) {
8462
- const rv = restoreInstr(node(redactPathCurrent, wck, depth), ov, o[originalKey]);
8463
- store.push(rv);
8464
- n[wck] = nv;
8465
- } else {
8466
- if (wcov[k] === nv) {} else if (nv === undefined && censor !== undefined || has(wcov, k) && nv === ov) {
8467
- redactPathCurrent = node(redactPathCurrent, wck, depth);
8468
- } else {
8469
- redactPathCurrent = node(redactPathCurrent, wck, depth);
8470
- const rv = restoreInstr(node(redactPathCurrent, k, depth + 1), ov, o[originalKey]);
8471
- store.push(rv);
8472
- wcov[k] = nv;
8473
- }
8474
- }
8475
- }
8476
- }
8477
- }
8478
- wc = null;
8479
- } else {
8480
- ov = n[k];
8481
- redactPathCurrent = node(redactPathCurrent, k, depth);
8482
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [...path3, originalKey, ...afterPath]) : censor(ov) : censor;
8483
- if (has(n, k) && nv === ov || nv === undefined && censor !== undefined) {} else {
8484
- const rv = restoreInstr(redactPathCurrent, ov, o[originalKey]);
8485
- store.push(rv);
8486
- n[k] = nv;
8487
- }
8488
- n = n[k];
8489
- }
8490
- if (typeof n !== "object")
8491
- break;
8492
- if (ov === oov || typeof ov === "undefined") {}
8493
- }
8494
- }
8495
- function get(o, p) {
8496
- var i = -1;
8497
- var l = p.length;
8498
- var n = o;
8499
- while (n != null && ++i < l) {
8500
- n = n[p[i]];
8501
- }
8502
- return n;
8503
- }
8504
- function iterateNthLevel(wcov, level, k, path3, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, parent, depth) {
8505
- if (level === 0) {
8506
- if (kIsWc || typeof wcov === "object" && wcov !== null && k in wcov) {
8507
- if (kIsWc) {
8508
- ov = wcov;
8509
- } else {
8510
- ov = wcov[k];
8511
- }
8512
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [...path3, originalKey, ...afterPath]) : censor(ov) : censor;
8513
- if (kIsWc) {
8514
- const rv = restoreInstr(redactPathCurrent, ov, parent);
8515
- store.push(rv);
8516
- n[wck] = nv;
8517
- } else {
8518
- if (wcov[k] === nv) {} else if (nv === undefined && censor !== undefined || has(wcov, k) && nv === ov) {} else {
8519
- const rv = restoreInstr(node(redactPathCurrent, k, depth + 1), ov, parent);
8520
- store.push(rv);
8521
- wcov[k] = nv;
8522
- }
8523
- }
8524
- }
8525
- }
8526
- for (const key in wcov) {
8527
- if (typeof wcov[key] === "object") {
8528
- redactPathCurrent = node(redactPathCurrent, key, depth);
8529
- iterateNthLevel(wcov[key], level - 1, k, path3, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, parent, depth + 1);
8530
- }
8531
- }
8532
- }
8533
- function tree() {
8534
- return { parent: null, key: null, children: [], depth: 0 };
8535
- }
8536
- function node(parent, key, depth) {
8537
- if (parent.depth === depth) {
8538
- return node(parent.parent, key, depth);
8539
- }
8540
- var child = {
8541
- parent,
8542
- key,
8543
- depth,
8544
- children: []
8545
- };
8546
- parent.children.push(child);
8547
- return child;
8548
- }
8549
- function restoreInstr(node2, value, target) {
8550
- let current = node2;
8551
- const path3 = [];
8552
- do {
8553
- path3.push(current.key);
8554
- current = current.parent;
8555
- } while (current.parent != null);
8556
- return { path: path3, value, target };
8557
- }
8558
- });
8559
-
8560
- // ../node_modules/fast-redact/lib/restorer.js
8561
- var require_restorer = __commonJS((exports, module) => {
8562
- var { groupRestore, nestedRestore } = require_modifiers();
8563
- module.exports = restorer;
8564
- function restorer() {
8565
- return function compileRestore() {
8566
- if (this.restore) {
8567
- this.restore.state.secret = this.secret;
8568
- return;
8569
- }
8570
- const { secret, wcLen } = this;
8571
- const paths = Object.keys(secret);
8572
- const resetters = resetTmpl(secret, paths);
8573
- const hasWildcards = wcLen > 0;
8574
- const state = hasWildcards ? { secret, groupRestore, nestedRestore } : { secret };
8575
- this.restore = Function("o", restoreTmpl(resetters, paths, hasWildcards)).bind(state);
8576
- this.restore.state = state;
8577
- };
8578
- }
8579
- function resetTmpl(secret, paths) {
8580
- return paths.map((path3) => {
8581
- const { circle, escPath, leadingBracket } = secret[path3];
8582
- const delim = leadingBracket ? "" : ".";
8583
- const reset = circle ? `o.${circle} = secret[${escPath}].val` : `o${delim}${path3} = secret[${escPath}].val`;
8584
- const clear = `secret[${escPath}].val = undefined`;
8585
- return `
8586
- if (secret[${escPath}].val !== undefined) {
8587
- try { ${reset} } catch (e) {}
8588
- ${clear}
8589
- }
8590
- `;
8591
- }).join("");
8592
- }
8593
- function restoreTmpl(resetters, paths, hasWildcards) {
8594
- const dynamicReset = hasWildcards === true ? `
8595
- const keys = Object.keys(secret)
8596
- const len = keys.length
8597
- for (var i = len - 1; i >= ${paths.length}; i--) {
8598
- const k = keys[i]
8599
- const o = secret[k]
8600
- if (o) {
8601
- if (o.flat === true) this.groupRestore(o)
8602
- else this.nestedRestore(o)
8603
- secret[k] = null
8604
- }
8605
- }
8606
- ` : "";
8607
- return `
8608
- const secret = this.secret
8609
- ${dynamicReset}
8610
- ${resetters}
8611
- return o
8612
- `;
8613
- }
8614
- });
8615
-
8616
- // ../node_modules/fast-redact/lib/state.js
8617
- var require_state = __commonJS((exports, module) => {
8618
- module.exports = state;
8619
- function state(o) {
8620
- const {
8621
- secret,
8622
- censor,
8623
- compileRestore,
8624
- serialize,
8625
- groupRedact,
8626
- nestedRedact,
8627
- wildcards,
8628
- wcLen
8629
- } = o;
8630
- const builder = [{ secret, censor, compileRestore }];
8631
- if (serialize !== false)
8632
- builder.push({ serialize });
8633
- if (wcLen > 0)
8634
- builder.push({ groupRedact, nestedRedact, wildcards, wcLen });
8635
- return Object.assign(...builder);
8636
- }
8637
- });
8638
-
8639
- // ../node_modules/fast-redact/index.js
8640
- var require_fast_redact = __commonJS((exports, module) => {
8641
- var validator = require_validator();
8642
- var parse = require_parse();
8643
- var redactor = require_redactor();
8644
- var restorer = require_restorer();
8645
- var { groupRedact, nestedRedact } = require_modifiers();
8646
- var state = require_state();
8647
- var rx = require_rx();
8648
- var validate = validator();
8649
- var noop = (o) => o;
8650
- noop.restore = noop;
8651
- var DEFAULT_CENSOR = "[REDACTED]";
8652
- fastRedact.rx = rx;
8653
- fastRedact.validator = validator;
8654
- module.exports = fastRedact;
8655
- function fastRedact(opts = {}) {
8656
- const paths = Array.from(new Set(opts.paths || []));
8657
- const serialize = "serialize" in opts ? opts.serialize === false ? opts.serialize : typeof opts.serialize === "function" ? opts.serialize : JSON.stringify : JSON.stringify;
8658
- const remove = opts.remove;
8659
- if (remove === true && serialize !== JSON.stringify) {
8660
- throw Error("fast-redact – remove option may only be set when serializer is JSON.stringify");
8661
- }
8662
- const censor = remove === true ? undefined : ("censor" in opts) ? opts.censor : DEFAULT_CENSOR;
8663
- const isCensorFct = typeof censor === "function";
8664
- const censorFctTakesPath = isCensorFct && censor.length > 1;
8665
- if (paths.length === 0)
8666
- return serialize || noop;
8667
- validate({ paths, serialize, censor });
8668
- const { wildcards, wcLen, secret } = parse({ paths, censor });
8669
- const compileRestore = restorer();
8670
- const strict = "strict" in opts ? opts.strict : true;
8671
- return redactor({ secret, wcLen, serialize, strict, isCensorFct, censorFctTakesPath }, state({
8672
- secret,
8673
- censor,
8674
- compileRestore,
8675
- serialize,
8676
- groupRedact,
8677
- nestedRedact,
8678
- wildcards,
8679
- wcLen
8680
- }));
8681
- }
8682
- });
8683
-
8684
- // ../node_modules/pino/lib/symbols.js
8685
- var require_symbols = __commonJS((exports, module) => {
8686
- var setLevelSym = Symbol("pino.setLevel");
8687
- var getLevelSym = Symbol("pino.getLevel");
8688
- var levelValSym = Symbol("pino.levelVal");
8689
- var levelCompSym = Symbol("pino.levelComp");
8690
- var useLevelLabelsSym = Symbol("pino.useLevelLabels");
8691
- var useOnlyCustomLevelsSym = Symbol("pino.useOnlyCustomLevels");
8692
- var mixinSym = Symbol("pino.mixin");
8693
- var lsCacheSym = Symbol("pino.lsCache");
8694
- var chindingsSym = Symbol("pino.chindings");
8695
- var asJsonSym = Symbol("pino.asJson");
8696
- var writeSym = Symbol("pino.write");
8697
- var redactFmtSym = Symbol("pino.redactFmt");
8698
- var timeSym = Symbol("pino.time");
8699
- var timeSliceIndexSym = Symbol("pino.timeSliceIndex");
8700
- var streamSym = Symbol("pino.stream");
8701
- var stringifySym = Symbol("pino.stringify");
8702
- var stringifySafeSym = Symbol("pino.stringifySafe");
8703
- var stringifiersSym = Symbol("pino.stringifiers");
8704
- var endSym = Symbol("pino.end");
8705
- var formatOptsSym = Symbol("pino.formatOpts");
8706
- var messageKeySym = Symbol("pino.messageKey");
8707
- var errorKeySym = Symbol("pino.errorKey");
8708
- var nestedKeySym = Symbol("pino.nestedKey");
8709
- var nestedKeyStrSym = Symbol("pino.nestedKeyStr");
8710
- var mixinMergeStrategySym = Symbol("pino.mixinMergeStrategy");
8711
- var msgPrefixSym = Symbol("pino.msgPrefix");
8712
- var wildcardFirstSym = Symbol("pino.wildcardFirst");
8713
- var serializersSym = Symbol.for("pino.serializers");
8714
- var formattersSym = Symbol.for("pino.formatters");
8715
- var hooksSym = Symbol.for("pino.hooks");
8716
- var needsMetadataGsym = Symbol.for("pino.metadata");
8717
- module.exports = {
8718
- setLevelSym,
8719
- getLevelSym,
8720
- levelValSym,
8721
- levelCompSym,
8722
- useLevelLabelsSym,
8723
- mixinSym,
8724
- lsCacheSym,
8725
- chindingsSym,
8726
- asJsonSym,
8727
- writeSym,
8728
- serializersSym,
8729
- redactFmtSym,
8730
- timeSym,
8731
- timeSliceIndexSym,
8732
- streamSym,
8733
- stringifySym,
8734
- stringifySafeSym,
8735
- stringifiersSym,
8736
- endSym,
8737
- formatOptsSym,
8738
- messageKeySym,
8739
- errorKeySym,
8740
- nestedKeySym,
8741
- wildcardFirstSym,
8742
- needsMetadataGsym,
8743
- useOnlyCustomLevelsSym,
8744
- formattersSym,
8745
- hooksSym,
8746
- nestedKeyStrSym,
8747
- mixinMergeStrategySym,
8748
- msgPrefixSym
8749
- };
8750
- });
8751
-
8752
- // ../node_modules/pino/lib/redaction.js
8753
- var require_redaction = __commonJS((exports, module) => {
8754
- var fastRedact = require_fast_redact();
8755
- var { redactFmtSym, wildcardFirstSym } = require_symbols();
8756
- var { rx, validator } = fastRedact;
8757
- var validate = validator({
8758
- ERR_PATHS_MUST_BE_STRINGS: () => "pino – redacted paths must be strings",
8759
- ERR_INVALID_PATH: (s) => `pino – redact paths array contains an invalid path (${s})`
8760
- });
8761
- var CENSOR = "[Redacted]";
8762
- var strict = false;
8763
- function redaction(opts, serialize) {
8764
- const { paths, censor } = handle(opts);
8765
- const shape = paths.reduce((o, str) => {
8766
- rx.lastIndex = 0;
8767
- const first = rx.exec(str);
8768
- const next = rx.exec(str);
8769
- let ns = first[1] !== undefined ? first[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/, "$1") : first[0];
8770
- if (ns === "*") {
8771
- ns = wildcardFirstSym;
8772
- }
8773
- if (next === null) {
8774
- o[ns] = null;
8775
- return o;
8776
- }
8777
- if (o[ns] === null) {
8778
- return o;
8779
- }
8780
- const { index } = next;
8781
- const nextPath = `${str.substr(index, str.length - 1)}`;
8782
- o[ns] = o[ns] || [];
8783
- if (ns !== wildcardFirstSym && o[ns].length === 0) {
8784
- o[ns].push(...o[wildcardFirstSym] || []);
8785
- }
8786
- if (ns === wildcardFirstSym) {
8787
- Object.keys(o).forEach(function(k) {
8788
- if (o[k]) {
8789
- o[k].push(nextPath);
8790
- }
8791
- });
8792
- }
8793
- o[ns].push(nextPath);
8794
- return o;
8795
- }, {});
8796
- const result = {
8797
- [redactFmtSym]: fastRedact({ paths, censor, serialize, strict })
8798
- };
8799
- const topCensor = (...args) => {
8800
- return typeof censor === "function" ? serialize(censor(...args)) : serialize(censor);
8801
- };
8802
- return [...Object.keys(shape), ...Object.getOwnPropertySymbols(shape)].reduce((o, k) => {
8803
- if (shape[k] === null) {
8804
- o[k] = (value) => topCensor(value, [k]);
8805
- } else {
8806
- const wrappedCensor = typeof censor === "function" ? (value, path3) => {
8807
- return censor(value, [k, ...path3]);
8808
- } : censor;
8809
- o[k] = fastRedact({
8810
- paths: shape[k],
8811
- censor: wrappedCensor,
8812
- serialize,
8813
- strict
8814
- });
8815
- }
8816
- return o;
8817
- }, result);
8818
- }
8819
- function handle(opts) {
8820
- if (Array.isArray(opts)) {
8821
- opts = { paths: opts, censor: CENSOR };
8822
- validate(opts);
8823
- return opts;
8824
- }
8825
- let { paths, censor = CENSOR, remove } = opts;
8826
- if (Array.isArray(paths) === false) {
8827
- throw Error("pino – redact must contain an array of strings");
8828
- }
8829
- if (remove === true)
8830
- censor = undefined;
8831
- validate({ paths, censor });
8832
- return { paths, censor };
8833
- }
8834
- module.exports = redaction;
8835
- });
8836
-
8837
- // ../node_modules/pino/lib/time.js
8838
- var require_time = __commonJS((exports, module) => {
8839
- var nullTime = () => "";
8840
- var epochTime = () => `,"time":${Date.now()}`;
8841
- var unixTime = () => `,"time":${Math.round(Date.now() / 1000)}`;
8842
- var isoTime = () => `,"time":"${new Date(Date.now()).toISOString()}"`;
8843
- module.exports = { nullTime, epochTime, unixTime, isoTime };
8844
- });
8845
-
8846
- // ../node_modules/quick-format-unescaped/index.js
8847
- var require_quick_format_unescaped = __commonJS((exports, module) => {
8848
- function tryStringify(o) {
8849
- try {
8850
- return JSON.stringify(o);
8851
- } catch (e) {
8852
- return '"[Circular]"';
8853
- }
8854
- }
8855
- module.exports = format;
8856
- function format(f, args, opts) {
8857
- var ss = opts && opts.stringify || tryStringify;
8858
- var offset = 1;
8859
- if (typeof f === "object" && f !== null) {
8860
- var len = args.length + offset;
8861
- if (len === 1)
8862
- return f;
8863
- var objects = new Array(len);
8864
- objects[0] = ss(f);
8865
- for (var index = 1;index < len; index++) {
8866
- objects[index] = ss(args[index]);
8867
- }
8868
- return objects.join(" ");
8869
- }
8870
- if (typeof f !== "string") {
8871
- return f;
8872
- }
8873
- var argLen = args.length;
8874
- if (argLen === 0)
8875
- return f;
8876
- var str = "";
8877
- var a = 1 - offset;
8878
- var lastPos = -1;
8879
- var flen = f && f.length || 0;
8880
- for (var i = 0;i < flen; ) {
8881
- if (f.charCodeAt(i) === 37 && i + 1 < flen) {
8882
- lastPos = lastPos > -1 ? lastPos : 0;
8883
- switch (f.charCodeAt(i + 1)) {
8884
- case 100:
8885
- case 102:
8886
- if (a >= argLen)
8887
- break;
8888
- if (args[a] == null)
8889
- break;
8890
- if (lastPos < i)
8891
- str += f.slice(lastPos, i);
8892
- str += Number(args[a]);
8893
- lastPos = i + 2;
8894
- i++;
8895
- break;
8896
- case 105:
8897
- if (a >= argLen)
8898
- break;
8899
- if (args[a] == null)
8900
- break;
8901
- if (lastPos < i)
8902
- str += f.slice(lastPos, i);
8903
- str += Math.floor(Number(args[a]));
8904
- lastPos = i + 2;
8905
- i++;
8906
- break;
8907
- case 79:
8908
- case 111:
8909
- case 106:
8910
- if (a >= argLen)
8911
- break;
8912
- if (args[a] === undefined)
8913
- break;
8914
- if (lastPos < i)
8915
- str += f.slice(lastPos, i);
8916
- var type = typeof args[a];
8917
- if (type === "string") {
8918
- str += "'" + args[a] + "'";
8919
- lastPos = i + 2;
8920
- i++;
8921
- break;
8922
- }
8923
- if (type === "function") {
8924
- str += args[a].name || "<anonymous>";
8925
- lastPos = i + 2;
8926
- i++;
8927
- break;
8928
- }
8929
- str += ss(args[a]);
8930
- lastPos = i + 2;
8931
- i++;
8932
- break;
8933
- case 115:
8934
- if (a >= argLen)
8935
- break;
8936
- if (lastPos < i)
8937
- str += f.slice(lastPos, i);
8938
- str += String(args[a]);
8939
- lastPos = i + 2;
8940
- i++;
8941
- break;
8942
- case 37:
8943
- if (lastPos < i)
8944
- str += f.slice(lastPos, i);
8945
- str += "%";
8946
- lastPos = i + 2;
8947
- i++;
8948
- a--;
8949
- break;
8950
- }
8951
- ++a;
8952
- }
8953
- ++i;
8954
- }
8955
- if (lastPos === -1)
8956
- return f;
8957
- else if (lastPos < flen) {
8958
- str += f.slice(lastPos);
8959
- }
8960
- return str;
8961
- }
8962
- });
8963
-
8964
- // ../node_modules/atomic-sleep/index.js
8965
- var require_atomic_sleep = __commonJS((exports, module) => {
8966
- if (typeof SharedArrayBuffer !== "undefined" && typeof Atomics !== "undefined") {
8967
- let sleep = function(ms) {
8968
- const valid = ms > 0 && ms < Infinity;
8969
- if (valid === false) {
8970
- if (typeof ms !== "number" && typeof ms !== "bigint") {
8971
- throw TypeError("sleep: ms must be a number");
8972
- }
8973
- throw RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");
8974
- }
8975
- Atomics.wait(nil, 0, 0, Number(ms));
8976
- };
8977
- const nil = new Int32Array(new SharedArrayBuffer(4));
8978
- module.exports = sleep;
8979
- } else {
8980
- let sleep = function(ms) {
8981
- const valid = ms > 0 && ms < Infinity;
8982
- if (valid === false) {
8983
- if (typeof ms !== "number" && typeof ms !== "bigint") {
8984
- throw TypeError("sleep: ms must be a number");
8985
- }
8986
- throw RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");
8987
- }
8988
- const target = Date.now() + Number(ms);
8989
- while (target > Date.now()) {}
8990
- };
8991
- module.exports = sleep;
8992
- }
8993
- });
8994
-
8995
- // ../node_modules/sonic-boom/index.js
8996
- var require_sonic_boom = __commonJS((exports, module) => {
8997
- var fs2 = __require("fs");
8998
- var EventEmitter = __require("events");
8999
- var inherits = __require("util").inherits;
9000
- var path3 = __require("path");
9001
- var sleep = require_atomic_sleep();
9002
- var assert = __require("assert");
9003
- var BUSY_WRITE_TIMEOUT = 100;
9004
- var kEmptyBuffer = Buffer.allocUnsafe(0);
9005
- var MAX_WRITE = 16 * 1024;
9006
- var kContentModeBuffer = "buffer";
9007
- var kContentModeUtf8 = "utf8";
9008
- var [major, minor] = (process.versions.node || "0.0").split(".").map(Number);
9009
- var kCopyBuffer = major >= 22 && minor >= 7;
9010
- function openFile(file, sonic) {
9011
- sonic._opening = true;
9012
- sonic._writing = true;
9013
- sonic._asyncDrainScheduled = false;
9014
- function fileOpened(err, fd) {
9015
- if (err) {
9016
- sonic._reopening = false;
9017
- sonic._writing = false;
9018
- sonic._opening = false;
9019
- if (sonic.sync) {
9020
- process.nextTick(() => {
9021
- if (sonic.listenerCount("error") > 0) {
9022
- sonic.emit("error", err);
9023
- }
9024
- });
9025
- } else {
9026
- sonic.emit("error", err);
9027
- }
9028
- return;
9029
- }
9030
- const reopening = sonic._reopening;
9031
- sonic.fd = fd;
9032
- sonic.file = file;
9033
- sonic._reopening = false;
9034
- sonic._opening = false;
9035
- sonic._writing = false;
9036
- if (sonic.sync) {
9037
- process.nextTick(() => sonic.emit("ready"));
9038
- } else {
9039
- sonic.emit("ready");
9040
- }
9041
- if (sonic.destroyed) {
9042
- return;
9043
- }
9044
- if (!sonic._writing && sonic._len > sonic.minLength || sonic._flushPending) {
9045
- sonic._actualWrite();
9046
- } else if (reopening) {
9047
- process.nextTick(() => sonic.emit("drain"));
9048
- }
9049
- }
9050
- const flags = sonic.append ? "a" : "w";
9051
- const mode = sonic.mode;
9052
- if (sonic.sync) {
9053
- try {
9054
- if (sonic.mkdir)
9055
- fs2.mkdirSync(path3.dirname(file), { recursive: true });
9056
- const fd = fs2.openSync(file, flags, mode);
9057
- fileOpened(null, fd);
9058
- } catch (err) {
9059
- fileOpened(err);
9060
- throw err;
9061
- }
9062
- } else if (sonic.mkdir) {
9063
- fs2.mkdir(path3.dirname(file), { recursive: true }, (err) => {
9064
- if (err)
9065
- return fileOpened(err);
9066
- fs2.open(file, flags, mode, fileOpened);
9067
- });
9068
- } else {
9069
- fs2.open(file, flags, mode, fileOpened);
9070
- }
9071
- }
9072
- function SonicBoom(opts) {
9073
- if (!(this instanceof SonicBoom)) {
9074
- return new SonicBoom(opts);
9075
- }
9076
- let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir, retryEAGAIN, fsync, contentMode, mode } = opts || {};
9077
- fd = fd || dest;
9078
- this._len = 0;
9079
- this.fd = -1;
9080
- this._bufs = [];
9081
- this._lens = [];
9082
- this._writing = false;
9083
- this._ending = false;
9084
- this._reopening = false;
9085
- this._asyncDrainScheduled = false;
9086
- this._flushPending = false;
9087
- this._hwm = Math.max(minLength || 0, 16387);
9088
- this.file = null;
9089
- this.destroyed = false;
9090
- this.minLength = minLength || 0;
9091
- this.maxLength = maxLength || 0;
9092
- this.maxWrite = maxWrite || MAX_WRITE;
9093
- this._periodicFlush = periodicFlush || 0;
9094
- this._periodicFlushTimer = undefined;
9095
- this.sync = sync || false;
9096
- this.writable = true;
9097
- this._fsync = fsync || false;
9098
- this.append = append || false;
9099
- this.mode = mode;
9100
- this.retryEAGAIN = retryEAGAIN || (() => true);
9101
- this.mkdir = mkdir || false;
9102
- let fsWriteSync;
9103
- let fsWrite;
9104
- if (contentMode === kContentModeBuffer) {
9105
- this._writingBuf = kEmptyBuffer;
9106
- this.write = writeBuffer;
9107
- this.flush = flushBuffer;
9108
- this.flushSync = flushBufferSync;
9109
- this._actualWrite = actualWriteBuffer;
9110
- fsWriteSync = () => fs2.writeSync(this.fd, this._writingBuf);
9111
- fsWrite = () => fs2.write(this.fd, this._writingBuf, this.release);
9112
- } else if (contentMode === undefined || contentMode === kContentModeUtf8) {
9113
- this._writingBuf = "";
9114
- this.write = write;
9115
- this.flush = flush;
9116
- this.flushSync = flushSync;
9117
- this._actualWrite = actualWrite;
9118
- fsWriteSync = () => fs2.writeSync(this.fd, this._writingBuf, "utf8");
9119
- fsWrite = () => fs2.write(this.fd, this._writingBuf, "utf8", this.release);
9120
- } else {
9121
- throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
9122
- }
9123
- if (typeof fd === "number") {
9124
- this.fd = fd;
9125
- process.nextTick(() => this.emit("ready"));
9126
- } else if (typeof fd === "string") {
9127
- openFile(fd, this);
9128
- } else {
9129
- throw new Error("SonicBoom supports only file descriptors and files");
9130
- }
9131
- if (this.minLength >= this.maxWrite) {
9132
- throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);
9133
- }
9134
- this.release = (err, n) => {
9135
- if (err) {
9136
- if ((err.code === "EAGAIN" || err.code === "EBUSY") && this.retryEAGAIN(err, this._writingBuf.length, this._len - this._writingBuf.length)) {
9137
- if (this.sync) {
9138
- try {
9139
- sleep(BUSY_WRITE_TIMEOUT);
9140
- this.release(undefined, 0);
9141
- } catch (err2) {
9142
- this.release(err2);
9143
- }
9144
- } else {
9145
- setTimeout(fsWrite, BUSY_WRITE_TIMEOUT);
9146
- }
9147
- } else {
9148
- this._writing = false;
9149
- this.emit("error", err);
9150
- }
9151
- return;
9152
- }
9153
- this.emit("write", n);
9154
- const releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n);
9155
- this._len = releasedBufObj.len;
9156
- this._writingBuf = releasedBufObj.writingBuf;
9157
- if (this._writingBuf.length) {
9158
- if (!this.sync) {
9159
- fsWrite();
9160
- return;
9161
- }
9162
- try {
9163
- do {
9164
- const n2 = fsWriteSync();
9165
- const releasedBufObj2 = releaseWritingBuf(this._writingBuf, this._len, n2);
9166
- this._len = releasedBufObj2.len;
9167
- this._writingBuf = releasedBufObj2.writingBuf;
9168
- } while (this._writingBuf.length);
9169
- } catch (err2) {
9170
- this.release(err2);
9171
- return;
9172
- }
9173
- }
9174
- if (this._fsync) {
9175
- fs2.fsyncSync(this.fd);
9176
- }
9177
- const len = this._len;
9178
- if (this._reopening) {
9179
- this._writing = false;
9180
- this._reopening = false;
9181
- this.reopen();
9182
- } else if (len > this.minLength) {
9183
- this._actualWrite();
9184
- } else if (this._ending) {
9185
- if (len > 0) {
9186
- this._actualWrite();
9187
- } else {
9188
- this._writing = false;
9189
- actualClose(this);
9190
- }
9191
- } else {
9192
- this._writing = false;
9193
- if (this.sync) {
9194
- if (!this._asyncDrainScheduled) {
9195
- this._asyncDrainScheduled = true;
9196
- process.nextTick(emitDrain, this);
9197
- }
9198
- } else {
9199
- this.emit("drain");
9200
- }
9201
- }
9202
- };
9203
- this.on("newListener", function(name) {
9204
- if (name === "drain") {
9205
- this._asyncDrainScheduled = false;
9206
- }
9207
- });
9208
- if (this._periodicFlush !== 0) {
9209
- this._periodicFlushTimer = setInterval(() => this.flush(null), this._periodicFlush);
9210
- this._periodicFlushTimer.unref();
9211
- }
9212
- }
9213
- function releaseWritingBuf(writingBuf, len, n) {
9214
- if (typeof writingBuf === "string" && Buffer.byteLength(writingBuf) !== n) {
9215
- n = Buffer.from(writingBuf).subarray(0, n).toString().length;
9216
- }
9217
- len = Math.max(len - n, 0);
9218
- writingBuf = writingBuf.slice(n);
9219
- return { writingBuf, len };
9220
- }
9221
- function emitDrain(sonic) {
9222
- const hasListeners = sonic.listenerCount("drain") > 0;
9223
- if (!hasListeners)
9224
- return;
9225
- sonic._asyncDrainScheduled = false;
9226
- sonic.emit("drain");
9227
- }
9228
- inherits(SonicBoom, EventEmitter);
9229
- function mergeBuf(bufs, len) {
9230
- if (bufs.length === 0) {
9231
- return kEmptyBuffer;
9232
- }
9233
- if (bufs.length === 1) {
9234
- return bufs[0];
9235
- }
9236
- return Buffer.concat(bufs, len);
9237
- }
9238
- function write(data) {
9239
- if (this.destroyed) {
9240
- throw new Error("SonicBoom destroyed");
9241
- }
9242
- const len = this._len + data.length;
9243
- const bufs = this._bufs;
9244
- if (this.maxLength && len > this.maxLength) {
9245
- this.emit("drop", data);
9246
- return this._len < this._hwm;
9247
- }
9248
- if (bufs.length === 0 || bufs[bufs.length - 1].length + data.length > this.maxWrite) {
9249
- bufs.push("" + data);
9250
- } else {
9251
- bufs[bufs.length - 1] += data;
9252
- }
9253
- this._len = len;
9254
- if (!this._writing && this._len >= this.minLength) {
9255
- this._actualWrite();
9256
- }
9257
- return this._len < this._hwm;
9258
- }
9259
- function writeBuffer(data) {
9260
- if (this.destroyed) {
9261
- throw new Error("SonicBoom destroyed");
9262
- }
9263
- const len = this._len + data.length;
9264
- const bufs = this._bufs;
9265
- const lens = this._lens;
9266
- if (this.maxLength && len > this.maxLength) {
9267
- this.emit("drop", data);
9268
- return this._len < this._hwm;
9269
- }
9270
- if (bufs.length === 0 || lens[lens.length - 1] + data.length > this.maxWrite) {
9271
- bufs.push([data]);
9272
- lens.push(data.length);
9273
- } else {
9274
- bufs[bufs.length - 1].push(data);
9275
- lens[lens.length - 1] += data.length;
9276
- }
9277
- this._len = len;
9278
- if (!this._writing && this._len >= this.minLength) {
9279
- this._actualWrite();
9280
- }
9281
- return this._len < this._hwm;
9282
- }
9283
- function callFlushCallbackOnDrain(cb) {
9284
- this._flushPending = true;
9285
- const onDrain = () => {
9286
- if (!this._fsync) {
9287
- try {
9288
- fs2.fsync(this.fd, (err) => {
9289
- this._flushPending = false;
9290
- cb(err);
9291
- });
9292
- } catch (err) {
9293
- cb(err);
9294
- }
9295
- } else {
9296
- this._flushPending = false;
9297
- cb();
9298
- }
9299
- this.off("error", onError);
9300
- };
9301
- const onError = (err) => {
9302
- this._flushPending = false;
9303
- cb(err);
9304
- this.off("drain", onDrain);
9305
- };
9306
- this.once("drain", onDrain);
9307
- this.once("error", onError);
9308
- }
9309
- function flush(cb) {
9310
- if (cb != null && typeof cb !== "function") {
9311
- throw new Error("flush cb must be a function");
9312
- }
9313
- if (this.destroyed) {
9314
- const error = new Error("SonicBoom destroyed");
9315
- if (cb) {
9316
- cb(error);
9317
- return;
9318
- }
9319
- throw error;
9320
- }
9321
- if (this.minLength <= 0) {
9322
- cb?.();
9323
- return;
9324
- }
9325
- if (cb) {
9326
- callFlushCallbackOnDrain.call(this, cb);
9327
- }
9328
- if (this._writing) {
9329
- return;
9330
- }
9331
- if (this._bufs.length === 0) {
9332
- this._bufs.push("");
9333
- }
9334
- this._actualWrite();
9335
- }
9336
- function flushBuffer(cb) {
9337
- if (cb != null && typeof cb !== "function") {
9338
- throw new Error("flush cb must be a function");
9339
- }
9340
- if (this.destroyed) {
9341
- const error = new Error("SonicBoom destroyed");
9342
- if (cb) {
9343
- cb(error);
9344
- return;
9345
- }
9346
- throw error;
9347
- }
9348
- if (this.minLength <= 0) {
9349
- cb?.();
9350
- return;
9351
- }
9352
- if (cb) {
9353
- callFlushCallbackOnDrain.call(this, cb);
9354
- }
9355
- if (this._writing) {
9356
- return;
9357
- }
9358
- if (this._bufs.length === 0) {
9359
- this._bufs.push([]);
9360
- this._lens.push(0);
9361
- }
9362
- this._actualWrite();
9363
- }
9364
- SonicBoom.prototype.reopen = function(file) {
9365
- if (this.destroyed) {
9366
- throw new Error("SonicBoom destroyed");
9367
- }
9368
- if (this._opening) {
9369
- this.once("ready", () => {
9370
- this.reopen(file);
9371
- });
9372
- return;
9373
- }
9374
- if (this._ending) {
9375
- return;
9376
- }
9377
- if (!this.file) {
9378
- throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");
9379
- }
9380
- if (file) {
9381
- this.file = file;
9382
- }
9383
- this._reopening = true;
9384
- if (this._writing) {
9385
- return;
9386
- }
9387
- const fd = this.fd;
9388
- this.once("ready", () => {
9389
- if (fd !== this.fd) {
9390
- fs2.close(fd, (err) => {
9391
- if (err) {
9392
- return this.emit("error", err);
9393
- }
9394
- });
9395
- }
9396
- });
9397
- openFile(this.file, this);
9398
- };
9399
- SonicBoom.prototype.end = function() {
9400
- if (this.destroyed) {
9401
- throw new Error("SonicBoom destroyed");
9402
- }
9403
- if (this._opening) {
9404
- this.once("ready", () => {
9405
- this.end();
9406
- });
9407
- return;
9408
- }
9409
- if (this._ending) {
9410
- return;
9411
- }
9412
- this._ending = true;
9413
- if (this._writing) {
9414
- return;
9415
- }
9416
- if (this._len > 0 && this.fd >= 0) {
9417
- this._actualWrite();
9418
- } else {
9419
- actualClose(this);
9420
- }
9421
- };
9422
- function flushSync() {
9423
- if (this.destroyed) {
9424
- throw new Error("SonicBoom destroyed");
9425
- }
9426
- if (this.fd < 0) {
9427
- throw new Error("sonic boom is not ready yet");
9428
- }
9429
- if (!this._writing && this._writingBuf.length > 0) {
9430
- this._bufs.unshift(this._writingBuf);
9431
- this._writingBuf = "";
9432
- }
9433
- let buf = "";
9434
- while (this._bufs.length || buf) {
9435
- if (buf.length <= 0) {
9436
- buf = this._bufs[0];
9437
- }
9438
- try {
9439
- const n = fs2.writeSync(this.fd, buf, "utf8");
9440
- const releasedBufObj = releaseWritingBuf(buf, this._len, n);
9441
- buf = releasedBufObj.writingBuf;
9442
- this._len = releasedBufObj.len;
9443
- if (buf.length <= 0) {
9444
- this._bufs.shift();
9445
- }
9446
- } catch (err) {
9447
- const shouldRetry = err.code === "EAGAIN" || err.code === "EBUSY";
9448
- if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
9449
- throw err;
9450
- }
9451
- sleep(BUSY_WRITE_TIMEOUT);
9452
- }
9453
- }
9454
- try {
9455
- fs2.fsyncSync(this.fd);
9456
- } catch {}
9457
- }
9458
- function flushBufferSync() {
9459
- if (this.destroyed) {
9460
- throw new Error("SonicBoom destroyed");
9461
- }
9462
- if (this.fd < 0) {
9463
- throw new Error("sonic boom is not ready yet");
9464
- }
9465
- if (!this._writing && this._writingBuf.length > 0) {
9466
- this._bufs.unshift([this._writingBuf]);
9467
- this._writingBuf = kEmptyBuffer;
9468
- }
9469
- let buf = kEmptyBuffer;
9470
- while (this._bufs.length || buf.length) {
9471
- if (buf.length <= 0) {
9472
- buf = mergeBuf(this._bufs[0], this._lens[0]);
9473
- }
9474
- try {
9475
- const n = fs2.writeSync(this.fd, buf);
9476
- buf = buf.subarray(n);
9477
- this._len = Math.max(this._len - n, 0);
9478
- if (buf.length <= 0) {
9479
- this._bufs.shift();
9480
- this._lens.shift();
9481
- }
9482
- } catch (err) {
9483
- const shouldRetry = err.code === "EAGAIN" || err.code === "EBUSY";
9484
- if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
9485
- throw err;
9486
- }
9487
- sleep(BUSY_WRITE_TIMEOUT);
9488
- }
9489
- }
9490
- }
9491
- SonicBoom.prototype.destroy = function() {
9492
- if (this.destroyed) {
9493
- return;
9494
- }
9495
- actualClose(this);
9496
- };
9497
- function actualWrite() {
9498
- const release = this.release;
9499
- this._writing = true;
9500
- this._writingBuf = this._writingBuf || this._bufs.shift() || "";
9501
- if (this.sync) {
9502
- try {
9503
- const written = fs2.writeSync(this.fd, this._writingBuf, "utf8");
9504
- release(null, written);
9505
- } catch (err) {
9506
- release(err);
9507
- }
9508
- } else {
9509
- fs2.write(this.fd, this._writingBuf, "utf8", release);
9510
- }
9511
- }
9512
- function actualWriteBuffer() {
9513
- const release = this.release;
9514
- this._writing = true;
9515
- this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
9516
- if (this.sync) {
9517
- try {
9518
- const written = fs2.writeSync(this.fd, this._writingBuf);
9519
- release(null, written);
9520
- } catch (err) {
9521
- release(err);
9522
- }
9523
- } else {
9524
- if (kCopyBuffer) {
9525
- this._writingBuf = Buffer.from(this._writingBuf);
9526
- }
9527
- fs2.write(this.fd, this._writingBuf, release);
9528
- }
9529
- }
9530
- function actualClose(sonic) {
9531
- if (sonic.fd === -1) {
9532
- sonic.once("ready", actualClose.bind(null, sonic));
9533
- return;
9534
- }
9535
- if (sonic._periodicFlushTimer !== undefined) {
9536
- clearInterval(sonic._periodicFlushTimer);
9537
- }
9538
- sonic.destroyed = true;
9539
- sonic._bufs = [];
9540
- sonic._lens = [];
9541
- assert(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
9542
- try {
9543
- fs2.fsync(sonic.fd, closeWrapped);
9544
- } catch {}
9545
- function closeWrapped() {
9546
- if (sonic.fd !== 1 && sonic.fd !== 2) {
9547
- fs2.close(sonic.fd, done);
9548
- } else {
9549
- done();
9550
- }
9551
- }
9552
- function done(err) {
9553
- if (err) {
9554
- sonic.emit("error", err);
9555
- return;
9556
- }
9557
- if (sonic._ending && !sonic._writing) {
9558
- sonic.emit("finish");
9559
- }
9560
- sonic.emit("close");
9561
- }
9562
- }
9563
- SonicBoom.SonicBoom = SonicBoom;
9564
- SonicBoom.default = SonicBoom;
9565
- module.exports = SonicBoom;
9566
- });
9567
-
9568
- // ../node_modules/on-exit-leak-free/index.js
9569
- var require_on_exit_leak_free = __commonJS((exports, module) => {
9570
- var refs = {
9571
- exit: [],
9572
- beforeExit: []
9573
- };
9574
- var functions = {
9575
- exit: onExit,
9576
- beforeExit: onBeforeExit
9577
- };
9578
- var registry;
9579
- function ensureRegistry() {
9580
- if (registry === undefined) {
9581
- registry = new FinalizationRegistry(clear);
9582
- }
9583
- }
9584
- function install(event) {
9585
- if (refs[event].length > 0) {
9586
- return;
9587
- }
9588
- process.on(event, functions[event]);
9589
- }
9590
- function uninstall(event) {
9591
- if (refs[event].length > 0) {
9592
- return;
9593
- }
9594
- process.removeListener(event, functions[event]);
9595
- if (refs.exit.length === 0 && refs.beforeExit.length === 0) {
9596
- registry = undefined;
9597
- }
9598
- }
9599
- function onExit() {
9600
- callRefs("exit");
9601
- }
9602
- function onBeforeExit() {
9603
- callRefs("beforeExit");
9604
- }
9605
- function callRefs(event) {
9606
- for (const ref of refs[event]) {
9607
- const obj = ref.deref();
9608
- const fn = ref.fn;
9609
- if (obj !== undefined) {
9610
- fn(obj, event);
9611
- }
9612
- }
9613
- refs[event] = [];
9614
- }
9615
- function clear(ref) {
9616
- for (const event of ["exit", "beforeExit"]) {
9617
- const index = refs[event].indexOf(ref);
9618
- refs[event].splice(index, index + 1);
9619
- uninstall(event);
9620
- }
9621
- }
9622
- function _register(event, obj, fn) {
9623
- if (obj === undefined) {
9624
- throw new Error("the object can't be undefined");
9625
- }
9626
- install(event);
9627
- const ref = new WeakRef(obj);
9628
- ref.fn = fn;
9629
- ensureRegistry();
9630
- registry.register(obj, ref);
9631
- refs[event].push(ref);
9632
- }
9633
- function register(obj, fn) {
9634
- _register("exit", obj, fn);
9635
- }
9636
- function registerBeforeExit(obj, fn) {
9637
- _register("beforeExit", obj, fn);
9638
- }
9639
- function unregister(obj) {
9640
- if (registry === undefined) {
9641
- return;
9642
- }
9643
- registry.unregister(obj);
9644
- for (const event of ["exit", "beforeExit"]) {
9645
- refs[event] = refs[event].filter((ref) => {
9646
- const _obj = ref.deref();
9647
- return _obj && _obj !== obj;
9648
- });
9649
- uninstall(event);
9650
- }
9651
- }
9652
- module.exports = {
9653
- register,
9654
- registerBeforeExit,
9655
- unregister
9656
- };
9657
- });
9658
-
9659
- // ../node_modules/thread-stream/package.json
9660
- var require_package = __commonJS((exports, module) => {
9661
- module.exports = {
9662
- name: "thread-stream",
9663
- version: "3.1.0",
9664
- description: "A streaming way to send data to a Node.js Worker Thread",
9665
- main: "index.js",
9666
- types: "index.d.ts",
9667
- dependencies: {
9668
- "real-require": "^0.2.0"
9669
- },
9670
- devDependencies: {
9671
- "@types/node": "^20.1.0",
9672
- "@types/tap": "^15.0.0",
9673
- "@yao-pkg/pkg": "^5.11.5",
9674
- desm: "^1.3.0",
9675
- fastbench: "^1.0.1",
9676
- husky: "^9.0.6",
9677
- "pino-elasticsearch": "^8.0.0",
9678
- "sonic-boom": "^4.0.1",
9679
- standard: "^17.0.0",
9680
- tap: "^16.2.0",
9681
- "ts-node": "^10.8.0",
9682
- typescript: "^5.3.2",
9683
- "why-is-node-running": "^2.2.2"
9684
- },
9685
- scripts: {
9686
- build: "tsc --noEmit",
9687
- test: 'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',
9688
- "test:ci": "standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts",
9689
- "test:ci:js": 'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',
9690
- "test:ci:ts": 'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',
9691
- "test:yarn": 'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',
9692
- transpile: "sh ./test/ts/transpile.sh",
9693
- prepare: "husky install"
9694
- },
9695
- standard: {
9696
- ignore: [
9697
- "test/ts/**/*",
9698
- "test/syntax-error.mjs"
9699
- ]
9700
- },
9701
- repository: {
9702
- type: "git",
9703
- url: "git+https://github.com/mcollina/thread-stream.git"
9704
- },
9705
- keywords: [
9706
- "worker",
9707
- "thread",
9708
- "threads",
9709
- "stream"
9710
- ],
9711
- author: "Matteo Collina <hello@matteocollina.com>",
9712
- license: "MIT",
9713
- bugs: {
9714
- url: "https://github.com/mcollina/thread-stream/issues"
9715
- },
9716
- homepage: "https://github.com/mcollina/thread-stream#readme"
9717
- };
9718
- });
9719
-
9720
- // ../node_modules/thread-stream/lib/wait.js
9721
- var require_wait = __commonJS((exports, module) => {
9722
- var MAX_TIMEOUT = 1000;
9723
- function wait(state, index, expected, timeout, done) {
9724
- const max = Date.now() + timeout;
9725
- let current = Atomics.load(state, index);
9726
- if (current === expected) {
9727
- done(null, "ok");
9728
- return;
9729
- }
9730
- let prior = current;
9731
- const check = (backoff) => {
9732
- if (Date.now() > max) {
9733
- done(null, "timed-out");
9734
- } else {
9735
- setTimeout(() => {
9736
- prior = current;
9737
- current = Atomics.load(state, index);
9738
- if (current === prior) {
9739
- check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : backoff * 2);
9740
- } else {
9741
- if (current === expected)
9742
- done(null, "ok");
9743
- else
9744
- done(null, "not-equal");
9745
- }
9746
- }, backoff);
9747
- }
9748
- };
9749
- check(1);
9750
- }
9751
- function waitDiff(state, index, expected, timeout, done) {
9752
- const max = Date.now() + timeout;
9753
- let current = Atomics.load(state, index);
9754
- if (current !== expected) {
9755
- done(null, "ok");
9756
- return;
9757
- }
9758
- const check = (backoff) => {
9759
- if (Date.now() > max) {
9760
- done(null, "timed-out");
9761
- } else {
9762
- setTimeout(() => {
9763
- current = Atomics.load(state, index);
9764
- if (current !== expected) {
9765
- done(null, "ok");
9766
- } else {
9767
- check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : backoff * 2);
9768
- }
9769
- }, backoff);
9770
- }
9771
- };
9772
- check(1);
9773
- }
9774
- module.exports = { wait, waitDiff };
9775
- });
9776
-
9777
- // ../node_modules/thread-stream/lib/indexes.js
9778
- var require_indexes = __commonJS((exports, module) => {
9779
- var WRITE_INDEX = 4;
9780
- var READ_INDEX = 8;
9781
- module.exports = {
9782
- WRITE_INDEX,
9783
- READ_INDEX
9784
- };
9785
- });
9786
-
9787
- // ../node_modules/thread-stream/index.js
9788
- var require_thread_stream = __commonJS((exports, module) => {
9789
- var __dirname = "/Users/brandonchen/Documents/CodebuffAI/codebuff/node_modules/thread-stream";
9790
- var { version } = require_package();
9791
- var { EventEmitter } = __require("events");
9792
- var { Worker } = __require("worker_threads");
9793
- var { join } = __require("path");
9794
- var { pathToFileURL } = __require("url");
9795
- var { wait } = require_wait();
9796
- var {
9797
- WRITE_INDEX,
9798
- READ_INDEX
9799
- } = require_indexes();
9800
- var buffer = __require("buffer");
9801
- var assert = __require("assert");
9802
- var kImpl = Symbol("kImpl");
9803
- var MAX_STRING = buffer.constants.MAX_STRING_LENGTH;
9804
-
9805
- class FakeWeakRef {
9806
- constructor(value) {
9807
- this._value = value;
9808
- }
9809
- deref() {
9810
- return this._value;
9811
- }
9812
- }
9813
-
9814
- class FakeFinalizationRegistry {
9815
- register() {}
9816
- unregister() {}
9817
- }
9818
- var FinalizationRegistry2 = process.env.NODE_V8_COVERAGE ? FakeFinalizationRegistry : global.FinalizationRegistry || FakeFinalizationRegistry;
9819
- var WeakRef2 = process.env.NODE_V8_COVERAGE ? FakeWeakRef : global.WeakRef || FakeWeakRef;
9820
- var registry = new FinalizationRegistry2((worker) => {
9821
- if (worker.exited) {
9822
- return;
9823
- }
9824
- worker.terminate();
9825
- });
9826
- function createWorker(stream, opts) {
9827
- const { filename, workerData } = opts;
9828
- const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
9829
- const toExecute = bundlerOverrides["thread-stream-worker"] || join(__dirname, "lib", "worker.js");
9830
- const worker = new Worker(toExecute, {
9831
- ...opts.workerOpts,
9832
- trackUnmanagedFds: false,
9833
- workerData: {
9834
- filename: filename.indexOf("file://") === 0 ? filename : pathToFileURL(filename).href,
9835
- dataBuf: stream[kImpl].dataBuf,
9836
- stateBuf: stream[kImpl].stateBuf,
9837
- workerData: {
9838
- $context: {
9839
- threadStreamVersion: version
9840
- },
9841
- ...workerData
9842
- }
9843
- }
9844
- });
9845
- worker.stream = new FakeWeakRef(stream);
9846
- worker.on("message", onWorkerMessage);
9847
- worker.on("exit", onWorkerExit);
9848
- registry.register(stream, worker);
9849
- return worker;
9850
- }
9851
- function drain(stream) {
9852
- assert(!stream[kImpl].sync);
9853
- if (stream[kImpl].needDrain) {
9854
- stream[kImpl].needDrain = false;
9855
- stream.emit("drain");
9856
- }
9857
- }
9858
- function nextFlush(stream) {
9859
- const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
9860
- let leftover = stream[kImpl].data.length - writeIndex;
9861
- if (leftover > 0) {
9862
- if (stream[kImpl].buf.length === 0) {
9863
- stream[kImpl].flushing = false;
9864
- if (stream[kImpl].ending) {
9865
- end(stream);
9866
- } else if (stream[kImpl].needDrain) {
9867
- process.nextTick(drain, stream);
9868
- }
9869
- return;
9870
- }
9871
- let toWrite = stream[kImpl].buf.slice(0, leftover);
9872
- let toWriteBytes = Buffer.byteLength(toWrite);
9873
- if (toWriteBytes <= leftover) {
9874
- stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
9875
- write(stream, toWrite, nextFlush.bind(null, stream));
9876
- } else {
9877
- stream.flush(() => {
9878
- if (stream.destroyed) {
9879
- return;
9880
- }
9881
- Atomics.store(stream[kImpl].state, READ_INDEX, 0);
9882
- Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
9883
- while (toWriteBytes > stream[kImpl].data.length) {
9884
- leftover = leftover / 2;
9885
- toWrite = stream[kImpl].buf.slice(0, leftover);
9886
- toWriteBytes = Buffer.byteLength(toWrite);
9887
- }
9888
- stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
9889
- write(stream, toWrite, nextFlush.bind(null, stream));
9890
- });
9891
- }
9892
- } else if (leftover === 0) {
9893
- if (writeIndex === 0 && stream[kImpl].buf.length === 0) {
9894
- return;
9895
- }
9896
- stream.flush(() => {
9897
- Atomics.store(stream[kImpl].state, READ_INDEX, 0);
9898
- Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
9899
- nextFlush(stream);
9900
- });
9901
- } else {
9902
- destroy(stream, new Error("overwritten"));
9903
- }
9904
- }
9905
- function onWorkerMessage(msg) {
9906
- const stream = this.stream.deref();
9907
- if (stream === undefined) {
9908
- this.exited = true;
9909
- this.terminate();
9910
- return;
9911
- }
9912
- switch (msg.code) {
9913
- case "READY":
9914
- this.stream = new WeakRef2(stream);
9915
- stream.flush(() => {
9916
- stream[kImpl].ready = true;
9917
- stream.emit("ready");
9918
- });
9919
- break;
9920
- case "ERROR":
9921
- destroy(stream, msg.err);
9922
- break;
9923
- case "EVENT":
9924
- if (Array.isArray(msg.args)) {
9925
- stream.emit(msg.name, ...msg.args);
9926
- } else {
9927
- stream.emit(msg.name, msg.args);
9928
- }
9929
- break;
9930
- case "WARNING":
9931
- process.emitWarning(msg.err);
9932
- break;
9933
- default:
9934
- destroy(stream, new Error("this should not happen: " + msg.code));
9935
- }
9936
- }
9937
- function onWorkerExit(code) {
9938
- const stream = this.stream.deref();
9939
- if (stream === undefined) {
9940
- return;
9941
- }
9942
- registry.unregister(stream);
9943
- stream.worker.exited = true;
9944
- stream.worker.off("exit", onWorkerExit);
9945
- destroy(stream, code !== 0 ? new Error("the worker thread exited") : null);
9946
- }
9947
-
9948
- class ThreadStream extends EventEmitter {
9949
- constructor(opts = {}) {
9950
- super();
9951
- if (opts.bufferSize < 4) {
9952
- throw new Error("bufferSize must at least fit a 4-byte utf-8 char");
9953
- }
9954
- this[kImpl] = {};
9955
- this[kImpl].stateBuf = new SharedArrayBuffer(128);
9956
- this[kImpl].state = new Int32Array(this[kImpl].stateBuf);
9957
- this[kImpl].dataBuf = new SharedArrayBuffer(opts.bufferSize || 4 * 1024 * 1024);
9958
- this[kImpl].data = Buffer.from(this[kImpl].dataBuf);
9959
- this[kImpl].sync = opts.sync || false;
9960
- this[kImpl].ending = false;
9961
- this[kImpl].ended = false;
9962
- this[kImpl].needDrain = false;
9963
- this[kImpl].destroyed = false;
9964
- this[kImpl].flushing = false;
9965
- this[kImpl].ready = false;
9966
- this[kImpl].finished = false;
9967
- this[kImpl].errored = null;
9968
- this[kImpl].closed = false;
9969
- this[kImpl].buf = "";
9970
- this.worker = createWorker(this, opts);
9971
- this.on("message", (message, transferList) => {
9972
- this.worker.postMessage(message, transferList);
9973
- });
9974
- }
9975
- write(data) {
9976
- if (this[kImpl].destroyed) {
9977
- error(this, new Error("the worker has exited"));
9978
- return false;
9979
- }
9980
- if (this[kImpl].ending) {
9981
- error(this, new Error("the worker is ending"));
9982
- return false;
9983
- }
9984
- if (this[kImpl].flushing && this[kImpl].buf.length + data.length >= MAX_STRING) {
9985
- try {
9986
- writeSync(this);
9987
- this[kImpl].flushing = true;
9988
- } catch (err) {
9989
- destroy(this, err);
9990
- return false;
9991
- }
9992
- }
9993
- this[kImpl].buf += data;
9994
- if (this[kImpl].sync) {
9995
- try {
9996
- writeSync(this);
9997
- return true;
9998
- } catch (err) {
9999
- destroy(this, err);
10000
- return false;
10001
- }
10002
- }
10003
- if (!this[kImpl].flushing) {
10004
- this[kImpl].flushing = true;
10005
- setImmediate(nextFlush, this);
10006
- }
10007
- this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].buf.length - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0;
10008
- return !this[kImpl].needDrain;
10009
- }
10010
- end() {
10011
- if (this[kImpl].destroyed) {
10012
- return;
10013
- }
10014
- this[kImpl].ending = true;
10015
- end(this);
10016
- }
10017
- flush(cb) {
10018
- if (this[kImpl].destroyed) {
10019
- if (typeof cb === "function") {
10020
- process.nextTick(cb, new Error("the worker has exited"));
10021
- }
10022
- return;
10023
- }
10024
- const writeIndex = Atomics.load(this[kImpl].state, WRITE_INDEX);
10025
- wait(this[kImpl].state, READ_INDEX, writeIndex, Infinity, (err, res) => {
10026
- if (err) {
10027
- destroy(this, err);
10028
- process.nextTick(cb, err);
10029
- return;
10030
- }
10031
- if (res === "not-equal") {
10032
- this.flush(cb);
10033
- return;
10034
- }
10035
- process.nextTick(cb);
10036
- });
10037
- }
10038
- flushSync() {
10039
- if (this[kImpl].destroyed) {
10040
- return;
10041
- }
10042
- writeSync(this);
10043
- flushSync(this);
10044
- }
10045
- unref() {
10046
- this.worker.unref();
10047
- }
10048
- ref() {
10049
- this.worker.ref();
10050
- }
10051
- get ready() {
10052
- return this[kImpl].ready;
10053
- }
10054
- get destroyed() {
10055
- return this[kImpl].destroyed;
10056
- }
10057
- get closed() {
10058
- return this[kImpl].closed;
10059
- }
10060
- get writable() {
10061
- return !this[kImpl].destroyed && !this[kImpl].ending;
10062
- }
10063
- get writableEnded() {
10064
- return this[kImpl].ending;
10065
- }
10066
- get writableFinished() {
10067
- return this[kImpl].finished;
10068
- }
10069
- get writableNeedDrain() {
10070
- return this[kImpl].needDrain;
10071
- }
10072
- get writableObjectMode() {
10073
- return false;
10074
- }
10075
- get writableErrored() {
10076
- return this[kImpl].errored;
10077
- }
10078
- }
10079
- function error(stream, err) {
10080
- setImmediate(() => {
10081
- stream.emit("error", err);
10082
- });
10083
- }
10084
- function destroy(stream, err) {
10085
- if (stream[kImpl].destroyed) {
10086
- return;
10087
- }
10088
- stream[kImpl].destroyed = true;
10089
- if (err) {
10090
- stream[kImpl].errored = err;
10091
- error(stream, err);
10092
- }
10093
- if (!stream.worker.exited) {
10094
- stream.worker.terminate().catch(() => {}).then(() => {
10095
- stream[kImpl].closed = true;
10096
- stream.emit("close");
10097
- });
10098
- } else {
10099
- setImmediate(() => {
10100
- stream[kImpl].closed = true;
10101
- stream.emit("close");
10102
- });
10103
- }
10104
- }
10105
- function write(stream, data, cb) {
10106
- const current = Atomics.load(stream[kImpl].state, WRITE_INDEX);
10107
- const length = Buffer.byteLength(data);
10108
- stream[kImpl].data.write(data, current);
10109
- Atomics.store(stream[kImpl].state, WRITE_INDEX, current + length);
10110
- Atomics.notify(stream[kImpl].state, WRITE_INDEX);
10111
- cb();
10112
- return true;
10113
- }
10114
- function end(stream) {
10115
- if (stream[kImpl].ended || !stream[kImpl].ending || stream[kImpl].flushing) {
10116
- return;
10117
- }
10118
- stream[kImpl].ended = true;
10119
- try {
10120
- stream.flushSync();
10121
- let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
10122
- Atomics.store(stream[kImpl].state, WRITE_INDEX, -1);
10123
- Atomics.notify(stream[kImpl].state, WRITE_INDEX);
10124
- let spins = 0;
10125
- while (readIndex !== -1) {
10126
- Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1000);
10127
- readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
10128
- if (readIndex === -2) {
10129
- destroy(stream, new Error("end() failed"));
10130
- return;
10131
- }
10132
- if (++spins === 10) {
10133
- destroy(stream, new Error("end() took too long (10s)"));
10134
- return;
10135
- }
10136
- }
10137
- process.nextTick(() => {
10138
- stream[kImpl].finished = true;
10139
- stream.emit("finish");
10140
- });
10141
- } catch (err) {
10142
- destroy(stream, err);
10143
- }
10144
- }
10145
- function writeSync(stream) {
10146
- const cb = () => {
10147
- if (stream[kImpl].ending) {
10148
- end(stream);
10149
- } else if (stream[kImpl].needDrain) {
10150
- process.nextTick(drain, stream);
10151
- }
10152
- };
10153
- stream[kImpl].flushing = false;
10154
- while (stream[kImpl].buf.length !== 0) {
10155
- const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
10156
- let leftover = stream[kImpl].data.length - writeIndex;
10157
- if (leftover === 0) {
10158
- flushSync(stream);
10159
- Atomics.store(stream[kImpl].state, READ_INDEX, 0);
10160
- Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
10161
- continue;
10162
- } else if (leftover < 0) {
10163
- throw new Error("overwritten");
10164
- }
10165
- let toWrite = stream[kImpl].buf.slice(0, leftover);
10166
- let toWriteBytes = Buffer.byteLength(toWrite);
10167
- if (toWriteBytes <= leftover) {
10168
- stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
10169
- write(stream, toWrite, cb);
10170
- } else {
10171
- flushSync(stream);
10172
- Atomics.store(stream[kImpl].state, READ_INDEX, 0);
10173
- Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
10174
- while (toWriteBytes > stream[kImpl].buf.length) {
10175
- leftover = leftover / 2;
10176
- toWrite = stream[kImpl].buf.slice(0, leftover);
10177
- toWriteBytes = Buffer.byteLength(toWrite);
10178
- }
10179
- stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
10180
- write(stream, toWrite, cb);
10181
- }
10182
- }
10183
- }
10184
- function flushSync(stream) {
10185
- if (stream[kImpl].flushing) {
10186
- throw new Error("unable to flush while flushing");
10187
- }
10188
- const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
10189
- let spins = 0;
10190
- while (true) {
10191
- const readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
10192
- if (readIndex === -2) {
10193
- throw Error("_flushSync failed");
10194
- }
10195
- if (readIndex !== writeIndex) {
10196
- Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1000);
10197
- } else {
10198
- break;
10199
- }
10200
- if (++spins === 10) {
10201
- throw new Error("_flushSync took too long (10s)");
10202
- }
10203
- }
10204
- }
10205
- module.exports = ThreadStream;
10206
- });
10207
-
10208
- // ../node_modules/pino/lib/transport.js
10209
- var require_transport = __commonJS((exports, module) => {
10210
- var __dirname = "/Users/brandonchen/Documents/CodebuffAI/codebuff/node_modules/pino/lib";
10211
- var { createRequire: createRequire2 } = __require("module");
10212
- var getCallers = require_caller();
10213
- var { join, isAbsolute, sep } = __require("node:path");
10214
- var sleep = require_atomic_sleep();
10215
- var onExit = require_on_exit_leak_free();
10216
- var ThreadStream = require_thread_stream();
10217
- function setupOnExit(stream) {
10218
- onExit.register(stream, autoEnd);
10219
- onExit.registerBeforeExit(stream, flush);
10220
- stream.on("close", function() {
10221
- onExit.unregister(stream);
10222
- });
10223
- }
10224
- function buildStream(filename, workerData, workerOpts) {
10225
- const stream = new ThreadStream({
10226
- filename,
10227
- workerData,
10228
- workerOpts
10229
- });
10230
- stream.on("ready", onReady);
10231
- stream.on("close", function() {
10232
- process.removeListener("exit", onExit2);
10233
- });
10234
- process.on("exit", onExit2);
10235
- function onReady() {
10236
- process.removeListener("exit", onExit2);
10237
- stream.unref();
10238
- if (workerOpts.autoEnd !== false) {
10239
- setupOnExit(stream);
10240
- }
10241
- }
10242
- function onExit2() {
10243
- if (stream.closed) {
10244
- return;
10245
- }
10246
- stream.flushSync();
10247
- sleep(100);
10248
- stream.end();
10249
- }
10250
- return stream;
10251
- }
10252
- function autoEnd(stream) {
10253
- stream.ref();
10254
- stream.flushSync();
10255
- stream.end();
10256
- stream.once("close", function() {
10257
- stream.unref();
10258
- });
10259
- }
10260
- function flush(stream) {
10261
- stream.flushSync();
10262
- }
10263
- function transport(fullOptions) {
10264
- const { pipeline, targets, levels, dedupe, worker = {}, caller = getCallers() } = fullOptions;
10265
- const options = {
10266
- ...fullOptions.options
10267
- };
10268
- const callers = typeof caller === "string" ? [caller] : caller;
10269
- const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
10270
- let target = fullOptions.target;
10271
- if (target && targets) {
10272
- throw new Error("only one of target or targets can be specified");
10273
- }
10274
- if (targets) {
10275
- target = bundlerOverrides["pino-worker"] || join(__dirname, "worker.js");
10276
- options.targets = targets.filter((dest) => dest.target).map((dest) => {
10277
- return {
10278
- ...dest,
10279
- target: fixTarget(dest.target)
10280
- };
10281
- });
10282
- options.pipelines = targets.filter((dest) => dest.pipeline).map((dest) => {
10283
- return dest.pipeline.map((t) => {
10284
- return {
10285
- ...t,
10286
- level: dest.level,
10287
- target: fixTarget(t.target)
10288
- };
10289
- });
10290
- });
10291
- } else if (pipeline) {
10292
- target = bundlerOverrides["pino-worker"] || join(__dirname, "worker.js");
10293
- options.pipelines = [pipeline.map((dest) => {
10294
- return {
10295
- ...dest,
10296
- target: fixTarget(dest.target)
10297
- };
10298
- })];
10299
- }
10300
- if (levels) {
10301
- options.levels = levels;
10302
- }
10303
- if (dedupe) {
10304
- options.dedupe = dedupe;
10305
- }
10306
- options.pinoWillSendConfig = true;
10307
- return buildStream(fixTarget(target), options, worker);
10308
- function fixTarget(origin) {
10309
- origin = bundlerOverrides[origin] || origin;
10310
- if (isAbsolute(origin) || origin.indexOf("file://") === 0) {
10311
- return origin;
10312
- }
10313
- if (origin === "pino/file") {
10314
- return join(__dirname, "..", "file.js");
10315
- }
10316
- let fixTarget2;
10317
- for (const filePath of callers) {
10318
- try {
10319
- const context = filePath === "node:repl" ? process.cwd() + sep : filePath;
10320
- fixTarget2 = createRequire2(context).resolve(origin);
10321
- break;
10322
- } catch (err) {
10323
- continue;
10324
- }
10325
- }
10326
- if (!fixTarget2) {
10327
- throw new Error(`unable to determine transport target for "${origin}"`);
10328
- }
10329
- return fixTarget2;
10330
- }
10331
- }
10332
- module.exports = transport;
10333
- });
10334
-
10335
- // ../node_modules/pino/lib/tools.js
10336
- var require_tools = __commonJS((exports, module) => {
10337
- var format = require_quick_format_unescaped();
10338
- var { mapHttpRequest, mapHttpResponse } = require_pino_std_serializers();
10339
- var SonicBoom = require_sonic_boom();
10340
- var onExit = require_on_exit_leak_free();
10341
- var {
10342
- lsCacheSym,
10343
- chindingsSym,
10344
- writeSym,
10345
- serializersSym,
10346
- formatOptsSym,
10347
- endSym,
10348
- stringifiersSym,
10349
- stringifySym,
10350
- stringifySafeSym,
10351
- wildcardFirstSym,
10352
- nestedKeySym,
10353
- formattersSym,
10354
- messageKeySym,
10355
- errorKeySym,
10356
- nestedKeyStrSym,
10357
- msgPrefixSym
10358
- } = require_symbols();
10359
- var { isMainThread } = __require("worker_threads");
10360
- var transport = require_transport();
10361
- function noop() {}
10362
- function genLog(level, hook) {
10363
- if (!hook)
10364
- return LOG;
10365
- return function hookWrappedLog(...args) {
10366
- hook.call(this, args, LOG, level);
10367
- };
10368
- function LOG(o, ...n) {
10369
- if (typeof o === "object") {
10370
- let msg = o;
10371
- if (o !== null) {
10372
- if (o.method && o.headers && o.socket) {
10373
- o = mapHttpRequest(o);
10374
- } else if (typeof o.setHeader === "function") {
10375
- o = mapHttpResponse(o);
10376
- }
10377
- }
10378
- let formatParams;
10379
- if (msg === null && n.length === 0) {
10380
- formatParams = [null];
10381
- } else {
10382
- msg = n.shift();
10383
- formatParams = n;
10384
- }
10385
- if (typeof this[msgPrefixSym] === "string" && msg !== undefined && msg !== null) {
10386
- msg = this[msgPrefixSym] + msg;
10387
- }
10388
- this[writeSym](o, format(msg, formatParams, this[formatOptsSym]), level);
10389
- } else {
10390
- let msg = o === undefined ? n.shift() : o;
10391
- if (typeof this[msgPrefixSym] === "string" && msg !== undefined && msg !== null) {
10392
- msg = this[msgPrefixSym] + msg;
10393
- }
10394
- this[writeSym](null, format(msg, n, this[formatOptsSym]), level);
10395
- }
10396
- }
10397
- }
10398
- function asString(str) {
10399
- let result = "";
10400
- let last = 0;
10401
- let found = false;
10402
- let point = 255;
10403
- const l = str.length;
10404
- if (l > 100) {
10405
- return JSON.stringify(str);
10406
- }
10407
- for (var i = 0;i < l && point >= 32; i++) {
10408
- point = str.charCodeAt(i);
10409
- if (point === 34 || point === 92) {
10410
- result += str.slice(last, i) + "\\";
10411
- last = i;
10412
- found = true;
10413
- }
10414
- }
10415
- if (!found) {
10416
- result = str;
10417
- } else {
10418
- result += str.slice(last);
10419
- }
10420
- return point < 32 ? JSON.stringify(str) : '"' + result + '"';
10421
- }
10422
- function asJson(obj, msg, num, time) {
10423
- const stringify2 = this[stringifySym];
10424
- const stringifySafe = this[stringifySafeSym];
10425
- const stringifiers = this[stringifiersSym];
10426
- const end = this[endSym];
10427
- const chindings = this[chindingsSym];
10428
- const serializers = this[serializersSym];
10429
- const formatters = this[formattersSym];
10430
- const messageKey = this[messageKeySym];
10431
- const errorKey = this[errorKeySym];
10432
- let data = this[lsCacheSym][num] + time;
10433
- data = data + chindings;
10434
- let value;
10435
- if (formatters.log) {
10436
- obj = formatters.log(obj);
10437
- }
10438
- const wildcardStringifier = stringifiers[wildcardFirstSym];
10439
- let propStr = "";
10440
- for (const key in obj) {
10441
- value = obj[key];
10442
- if (Object.prototype.hasOwnProperty.call(obj, key) && value !== undefined) {
10443
- if (serializers[key]) {
10444
- value = serializers[key](value);
10445
- } else if (key === errorKey && serializers.err) {
10446
- value = serializers.err(value);
10447
- }
10448
- const stringifier = stringifiers[key] || wildcardStringifier;
10449
- switch (typeof value) {
10450
- case "undefined":
10451
- case "function":
10452
- continue;
10453
- case "number":
10454
- if (Number.isFinite(value) === false) {
10455
- value = null;
10456
- }
10457
- case "boolean":
10458
- if (stringifier)
10459
- value = stringifier(value);
10460
- break;
10461
- case "string":
10462
- value = (stringifier || asString)(value);
10463
- break;
10464
- default:
10465
- value = (stringifier || stringify2)(value, stringifySafe);
10466
- }
10467
- if (value === undefined)
10468
- continue;
10469
- const strKey = asString(key);
10470
- propStr += "," + strKey + ":" + value;
10471
- }
10472
- }
10473
- let msgStr = "";
10474
- if (msg !== undefined) {
10475
- value = serializers[messageKey] ? serializers[messageKey](msg) : msg;
10476
- const stringifier = stringifiers[messageKey] || wildcardStringifier;
10477
- switch (typeof value) {
10478
- case "function":
10479
- break;
10480
- case "number":
10481
- if (Number.isFinite(value) === false) {
10482
- value = null;
10483
- }
10484
- case "boolean":
10485
- if (stringifier)
10486
- value = stringifier(value);
10487
- msgStr = ',"' + messageKey + '":' + value;
10488
- break;
10489
- case "string":
10490
- value = (stringifier || asString)(value);
10491
- msgStr = ',"' + messageKey + '":' + value;
10492
- break;
10493
- default:
10494
- value = (stringifier || stringify2)(value, stringifySafe);
10495
- msgStr = ',"' + messageKey + '":' + value;
10496
- }
10497
- }
10498
- if (this[nestedKeySym] && propStr) {
10499
- return data + this[nestedKeyStrSym] + propStr.slice(1) + "}" + msgStr + end;
10500
- } else {
10501
- return data + propStr + msgStr + end;
10502
- }
10503
- }
10504
- function asChindings(instance, bindings) {
10505
- let value;
10506
- let data = instance[chindingsSym];
10507
- const stringify2 = instance[stringifySym];
10508
- const stringifySafe = instance[stringifySafeSym];
10509
- const stringifiers = instance[stringifiersSym];
10510
- const wildcardStringifier = stringifiers[wildcardFirstSym];
10511
- const serializers = instance[serializersSym];
10512
- const formatter = instance[formattersSym].bindings;
10513
- bindings = formatter(bindings);
10514
- for (const key in bindings) {
10515
- value = bindings[key];
10516
- const valid = key !== "level" && key !== "serializers" && key !== "formatters" && key !== "customLevels" && bindings.hasOwnProperty(key) && value !== undefined;
10517
- if (valid === true) {
10518
- value = serializers[key] ? serializers[key](value) : value;
10519
- value = (stringifiers[key] || wildcardStringifier || stringify2)(value, stringifySafe);
10520
- if (value === undefined)
10521
- continue;
10522
- data += ',"' + key + '":' + value;
10523
- }
10524
- }
10525
- return data;
10526
- }
10527
- function hasBeenTampered(stream) {
10528
- return stream.write !== stream.constructor.prototype.write;
10529
- }
10530
- var hasNodeCodeCoverage = process.env.NODE_V8_COVERAGE || process.env.V8_COVERAGE;
10531
- function buildSafeSonicBoom(opts) {
10532
- const stream = new SonicBoom(opts);
10533
- stream.on("error", filterBrokenPipe);
10534
- if (!hasNodeCodeCoverage && !opts.sync && isMainThread) {
10535
- onExit.register(stream, autoEnd);
10536
- stream.on("close", function() {
10537
- onExit.unregister(stream);
10538
- });
10539
- }
10540
- return stream;
10541
- function filterBrokenPipe(err) {
10542
- if (err.code === "EPIPE") {
10543
- stream.write = noop;
10544
- stream.end = noop;
10545
- stream.flushSync = noop;
10546
- stream.destroy = noop;
10547
- return;
10548
- }
10549
- stream.removeListener("error", filterBrokenPipe);
10550
- stream.emit("error", err);
10551
- }
10552
- }
10553
- function autoEnd(stream, eventName) {
10554
- if (stream.destroyed) {
10555
- return;
10556
- }
10557
- if (eventName === "beforeExit") {
10558
- stream.flush();
10559
- stream.on("drain", function() {
10560
- stream.end();
10561
- });
10562
- } else {
10563
- stream.flushSync();
10564
- }
10565
- }
10566
- function createArgsNormalizer(defaultOptions) {
10567
- return function normalizeArgs(instance, caller, opts = {}, stream) {
10568
- if (typeof opts === "string") {
10569
- stream = buildSafeSonicBoom({ dest: opts });
10570
- opts = {};
10571
- } else if (typeof stream === "string") {
10572
- if (opts && opts.transport) {
10573
- throw Error("only one of option.transport or stream can be specified");
10574
- }
10575
- stream = buildSafeSonicBoom({ dest: stream });
10576
- } else if (opts instanceof SonicBoom || opts.writable || opts._writableState) {
10577
- stream = opts;
10578
- opts = {};
10579
- } else if (opts.transport) {
10580
- if (opts.transport instanceof SonicBoom || opts.transport.writable || opts.transport._writableState) {
10581
- throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");
10582
- }
10583
- if (opts.transport.targets && opts.transport.targets.length && opts.formatters && typeof opts.formatters.level === "function") {
10584
- throw Error("option.transport.targets do not allow custom level formatters");
10585
- }
10586
- let customLevels;
10587
- if (opts.customLevels) {
10588
- customLevels = opts.useOnlyCustomLevels ? opts.customLevels : Object.assign({}, opts.levels, opts.customLevels);
10589
- }
10590
- stream = transport({ caller, ...opts.transport, levels: customLevels });
10591
- }
10592
- opts = Object.assign({}, defaultOptions, opts);
10593
- opts.serializers = Object.assign({}, defaultOptions.serializers, opts.serializers);
10594
- opts.formatters = Object.assign({}, defaultOptions.formatters, opts.formatters);
10595
- if (opts.prettyPrint) {
10596
- throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");
10597
- }
10598
- const { enabled, onChild } = opts;
10599
- if (enabled === false)
10600
- opts.level = "silent";
10601
- if (!onChild)
10602
- opts.onChild = noop;
10603
- if (!stream) {
10604
- if (!hasBeenTampered(process.stdout)) {
10605
- stream = buildSafeSonicBoom({ fd: process.stdout.fd || 1 });
10606
- } else {
10607
- stream = process.stdout;
10608
- }
10609
- }
10610
- return { opts, stream };
10611
- };
10612
- }
10613
- function stringify(obj, stringifySafeFn) {
10614
- try {
10615
- return JSON.stringify(obj);
10616
- } catch (_) {
10617
- try {
10618
- const stringify2 = stringifySafeFn || this[stringifySafeSym];
10619
- return stringify2(obj);
10620
- } catch (_2) {
10621
- return '"[unable to serialize, circular reference is too complex to analyze]"';
10622
- }
10623
- }
10624
- }
10625
- function buildFormatters(level, bindings, log) {
10626
- return {
10627
- level,
10628
- bindings,
10629
- log
10630
- };
10631
- }
10632
- function normalizeDestFileDescriptor(destination) {
10633
- const fd = Number(destination);
10634
- if (typeof destination === "string" && Number.isFinite(fd)) {
10635
- return fd;
10636
- }
10637
- if (destination === undefined) {
10638
- return 1;
10639
- }
10640
- return destination;
10641
- }
10642
- module.exports = {
10643
- noop,
10644
- buildSafeSonicBoom,
10645
- asChindings,
10646
- asJson,
10647
- genLog,
10648
- createArgsNormalizer,
10649
- stringify,
10650
- buildFormatters,
10651
- normalizeDestFileDescriptor
10652
- };
10653
- });
10654
-
10655
- // ../node_modules/pino/lib/constants.js
10656
- var require_constants = __commonJS((exports, module) => {
10657
- var DEFAULT_LEVELS = {
10658
- trace: 10,
10659
- debug: 20,
10660
- info: 30,
10661
- warn: 40,
10662
- error: 50,
10663
- fatal: 60
10664
- };
10665
- var SORTING_ORDER = {
10666
- ASC: "ASC",
10667
- DESC: "DESC"
10668
- };
10669
- module.exports = {
10670
- DEFAULT_LEVELS,
10671
- SORTING_ORDER
10672
- };
10673
- });
10674
-
10675
- // ../node_modules/pino/lib/levels.js
10676
- var require_levels = __commonJS((exports, module) => {
10677
- var {
10678
- lsCacheSym,
10679
- levelValSym,
10680
- useOnlyCustomLevelsSym,
10681
- streamSym,
10682
- formattersSym,
10683
- hooksSym,
10684
- levelCompSym
10685
- } = require_symbols();
10686
- var { noop, genLog } = require_tools();
10687
- var { DEFAULT_LEVELS, SORTING_ORDER } = require_constants();
10688
- var levelMethods = {
10689
- fatal: (hook) => {
10690
- const logFatal = genLog(DEFAULT_LEVELS.fatal, hook);
10691
- return function(...args) {
10692
- const stream = this[streamSym];
10693
- logFatal.call(this, ...args);
10694
- if (typeof stream.flushSync === "function") {
10695
- try {
10696
- stream.flushSync();
10697
- } catch (e) {}
10698
- }
10699
- };
10700
- },
10701
- error: (hook) => genLog(DEFAULT_LEVELS.error, hook),
10702
- warn: (hook) => genLog(DEFAULT_LEVELS.warn, hook),
10703
- info: (hook) => genLog(DEFAULT_LEVELS.info, hook),
10704
- debug: (hook) => genLog(DEFAULT_LEVELS.debug, hook),
10705
- trace: (hook) => genLog(DEFAULT_LEVELS.trace, hook)
10706
- };
10707
- var nums = Object.keys(DEFAULT_LEVELS).reduce((o, k) => {
10708
- o[DEFAULT_LEVELS[k]] = k;
10709
- return o;
10710
- }, {});
10711
- var initialLsCache = Object.keys(nums).reduce((o, k) => {
10712
- o[k] = '{"level":' + Number(k);
10713
- return o;
10714
- }, {});
10715
- function genLsCache(instance) {
10716
- const formatter = instance[formattersSym].level;
10717
- const { labels } = instance.levels;
10718
- const cache = {};
10719
- for (const label in labels) {
10720
- const level = formatter(labels[label], Number(label));
10721
- cache[label] = JSON.stringify(level).slice(0, -1);
10722
- }
10723
- instance[lsCacheSym] = cache;
10724
- return instance;
10725
- }
10726
- function isStandardLevel(level, useOnlyCustomLevels) {
10727
- if (useOnlyCustomLevels) {
10728
- return false;
10729
- }
10730
- switch (level) {
10731
- case "fatal":
10732
- case "error":
10733
- case "warn":
10734
- case "info":
10735
- case "debug":
10736
- case "trace":
10737
- return true;
10738
- default:
10739
- return false;
10740
- }
10741
- }
10742
- function setLevel(level) {
10743
- const { labels, values } = this.levels;
10744
- if (typeof level === "number") {
10745
- if (labels[level] === undefined)
10746
- throw Error("unknown level value" + level);
10747
- level = labels[level];
10748
- }
10749
- if (values[level] === undefined)
10750
- throw Error("unknown level " + level);
10751
- const preLevelVal = this[levelValSym];
10752
- const levelVal = this[levelValSym] = values[level];
10753
- const useOnlyCustomLevelsVal = this[useOnlyCustomLevelsSym];
10754
- const levelComparison = this[levelCompSym];
10755
- const hook = this[hooksSym].logMethod;
10756
- for (const key in values) {
10757
- if (levelComparison(values[key], levelVal) === false) {
10758
- this[key] = noop;
10759
- continue;
10760
- }
10761
- this[key] = isStandardLevel(key, useOnlyCustomLevelsVal) ? levelMethods[key](hook) : genLog(values[key], hook);
10762
- }
10763
- this.emit("level-change", level, levelVal, labels[preLevelVal], preLevelVal, this);
10764
- }
10765
- function getLevel(level) {
10766
- const { levels, levelVal } = this;
10767
- return levels && levels.labels ? levels.labels[levelVal] : "";
10768
- }
10769
- function isLevelEnabled(logLevel) {
10770
- const { values } = this.levels;
10771
- const logLevelVal = values[logLevel];
10772
- return logLevelVal !== undefined && this[levelCompSym](logLevelVal, this[levelValSym]);
10773
- }
10774
- function compareLevel(direction, current, expected) {
10775
- if (direction === SORTING_ORDER.DESC) {
10776
- return current <= expected;
10777
- }
10778
- return current >= expected;
10779
- }
10780
- function genLevelComparison(levelComparison) {
10781
- if (typeof levelComparison === "string") {
10782
- return compareLevel.bind(null, levelComparison);
10783
- }
10784
- return levelComparison;
10785
- }
10786
- function mappings(customLevels = null, useOnlyCustomLevels = false) {
10787
- const customNums = customLevels ? Object.keys(customLevels).reduce((o, k) => {
10788
- o[customLevels[k]] = k;
10789
- return o;
10790
- }, {}) : null;
10791
- const labels = Object.assign(Object.create(Object.prototype, { Infinity: { value: "silent" } }), useOnlyCustomLevels ? null : nums, customNums);
10792
- const values = Object.assign(Object.create(Object.prototype, { silent: { value: Infinity } }), useOnlyCustomLevels ? null : DEFAULT_LEVELS, customLevels);
10793
- return { labels, values };
10794
- }
10795
- function assertDefaultLevelFound(defaultLevel, customLevels, useOnlyCustomLevels) {
10796
- if (typeof defaultLevel === "number") {
10797
- const values = [].concat(Object.keys(customLevels || {}).map((key) => customLevels[key]), useOnlyCustomLevels ? [] : Object.keys(nums).map((level) => +level), Infinity);
10798
- if (!values.includes(defaultLevel)) {
10799
- throw Error(`default level:${defaultLevel} must be included in custom levels`);
10800
- }
10801
- return;
10802
- }
10803
- const labels = Object.assign(Object.create(Object.prototype, { silent: { value: Infinity } }), useOnlyCustomLevels ? null : DEFAULT_LEVELS, customLevels);
10804
- if (!(defaultLevel in labels)) {
10805
- throw Error(`default level:${defaultLevel} must be included in custom levels`);
10806
- }
10807
- }
10808
- function assertNoLevelCollisions(levels, customLevels) {
10809
- const { labels, values } = levels;
10810
- for (const k in customLevels) {
10811
- if (k in values) {
10812
- throw Error("levels cannot be overridden");
10813
- }
10814
- if (customLevels[k] in labels) {
10815
- throw Error("pre-existing level values cannot be used for new levels");
10816
- }
10817
- }
10818
- }
10819
- function assertLevelComparison(levelComparison) {
10820
- if (typeof levelComparison === "function") {
10821
- return;
10822
- }
10823
- if (typeof levelComparison === "string" && Object.values(SORTING_ORDER).includes(levelComparison)) {
10824
- return;
10825
- }
10826
- throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type');
10827
- }
10828
- module.exports = {
10829
- initialLsCache,
10830
- genLsCache,
10831
- levelMethods,
10832
- getLevel,
10833
- setLevel,
10834
- isLevelEnabled,
10835
- mappings,
10836
- assertNoLevelCollisions,
10837
- assertDefaultLevelFound,
10838
- genLevelComparison,
10839
- assertLevelComparison
10840
- };
10841
- });
10842
-
10843
- // ../node_modules/pino/lib/meta.js
10844
- var require_meta = __commonJS((exports, module) => {
10845
- module.exports = { version: "9.4.0" };
10846
- });
10847
-
10848
- // ../node_modules/pino/lib/proto.js
10849
- var require_proto = __commonJS((exports, module) => {
10850
- var { EventEmitter } = __require("node:events");
10851
- var {
10852
- lsCacheSym,
10853
- levelValSym,
10854
- setLevelSym,
10855
- getLevelSym,
10856
- chindingsSym,
10857
- parsedChindingsSym,
10858
- mixinSym,
10859
- asJsonSym,
10860
- writeSym,
10861
- mixinMergeStrategySym,
10862
- timeSym,
10863
- timeSliceIndexSym,
10864
- streamSym,
10865
- serializersSym,
10866
- formattersSym,
10867
- errorKeySym,
10868
- messageKeySym,
10869
- useOnlyCustomLevelsSym,
10870
- needsMetadataGsym,
10871
- redactFmtSym,
10872
- stringifySym,
10873
- formatOptsSym,
10874
- stringifiersSym,
10875
- msgPrefixSym
10876
- } = require_symbols();
10877
- var {
10878
- getLevel,
10879
- setLevel,
10880
- isLevelEnabled,
10881
- mappings,
10882
- initialLsCache,
10883
- genLsCache,
10884
- assertNoLevelCollisions
10885
- } = require_levels();
10886
- var {
10887
- asChindings,
10888
- asJson,
10889
- buildFormatters,
10890
- stringify
10891
- } = require_tools();
10892
- var {
10893
- version
10894
- } = require_meta();
10895
- var redaction = require_redaction();
10896
- var constructor = class Pino {
10897
- };
10898
- var prototype = {
10899
- constructor,
10900
- child,
10901
- bindings,
10902
- setBindings,
10903
- flush,
10904
- isLevelEnabled,
10905
- version,
10906
- get level() {
10907
- return this[getLevelSym]();
10908
- },
10909
- set level(lvl) {
10910
- this[setLevelSym](lvl);
10911
- },
10912
- get levelVal() {
10913
- return this[levelValSym];
10914
- },
10915
- set levelVal(n) {
10916
- throw Error("levelVal is read-only");
10917
- },
10918
- [lsCacheSym]: initialLsCache,
10919
- [writeSym]: write,
10920
- [asJsonSym]: asJson,
10921
- [getLevelSym]: getLevel,
10922
- [setLevelSym]: setLevel
10923
- };
10924
- Object.setPrototypeOf(prototype, EventEmitter.prototype);
10925
- module.exports = function() {
10926
- return Object.create(prototype);
10927
- };
10928
- var resetChildingsFormatter = (bindings2) => bindings2;
10929
- function child(bindings2, options) {
10930
- if (!bindings2) {
10931
- throw Error("missing bindings for child Pino");
10932
- }
10933
- options = options || {};
10934
- const serializers = this[serializersSym];
10935
- const formatters = this[formattersSym];
10936
- const instance = Object.create(this);
10937
- if (options.hasOwnProperty("serializers") === true) {
10938
- instance[serializersSym] = Object.create(null);
10939
- for (const k in serializers) {
10940
- instance[serializersSym][k] = serializers[k];
10941
- }
10942
- const parentSymbols = Object.getOwnPropertySymbols(serializers);
10943
- for (var i = 0;i < parentSymbols.length; i++) {
10944
- const ks = parentSymbols[i];
10945
- instance[serializersSym][ks] = serializers[ks];
10946
- }
10947
- for (const bk in options.serializers) {
10948
- instance[serializersSym][bk] = options.serializers[bk];
10949
- }
10950
- const bindingsSymbols = Object.getOwnPropertySymbols(options.serializers);
10951
- for (var bi = 0;bi < bindingsSymbols.length; bi++) {
10952
- const bks = bindingsSymbols[bi];
10953
- instance[serializersSym][bks] = options.serializers[bks];
10954
- }
10955
- } else
10956
- instance[serializersSym] = serializers;
10957
- if (options.hasOwnProperty("formatters")) {
10958
- const { level, bindings: chindings, log } = options.formatters;
10959
- instance[formattersSym] = buildFormatters(level || formatters.level, chindings || resetChildingsFormatter, log || formatters.log);
10960
- } else {
10961
- instance[formattersSym] = buildFormatters(formatters.level, resetChildingsFormatter, formatters.log);
10962
- }
10963
- if (options.hasOwnProperty("customLevels") === true) {
10964
- assertNoLevelCollisions(this.levels, options.customLevels);
10965
- instance.levels = mappings(options.customLevels, instance[useOnlyCustomLevelsSym]);
10966
- genLsCache(instance);
10967
- }
10968
- if (typeof options.redact === "object" && options.redact !== null || Array.isArray(options.redact)) {
10969
- instance.redact = options.redact;
10970
- const stringifiers = redaction(instance.redact, stringify);
10971
- const formatOpts = { stringify: stringifiers[redactFmtSym] };
10972
- instance[stringifySym] = stringify;
10973
- instance[stringifiersSym] = stringifiers;
10974
- instance[formatOptsSym] = formatOpts;
10975
- }
10976
- if (typeof options.msgPrefix === "string") {
10977
- instance[msgPrefixSym] = (this[msgPrefixSym] || "") + options.msgPrefix;
10978
- }
10979
- instance[chindingsSym] = asChindings(instance, bindings2);
10980
- const childLevel = options.level || this.level;
10981
- instance[setLevelSym](childLevel);
10982
- this.onChild(instance);
10983
- return instance;
10984
- }
10985
- function bindings() {
10986
- const chindings = this[chindingsSym];
10987
- const chindingsJson = `{${chindings.substr(1)}}`;
10988
- const bindingsFromJson = JSON.parse(chindingsJson);
10989
- delete bindingsFromJson.pid;
10990
- delete bindingsFromJson.hostname;
10991
- return bindingsFromJson;
10992
- }
10993
- function setBindings(newBindings) {
10994
- const chindings = asChindings(this, newBindings);
10995
- this[chindingsSym] = chindings;
10996
- delete this[parsedChindingsSym];
10997
- }
10998
- function defaultMixinMergeStrategy(mergeObject, mixinObject) {
10999
- return Object.assign(mixinObject, mergeObject);
11000
- }
11001
- function write(_obj, msg, num) {
11002
- const t = this[timeSym]();
11003
- const mixin = this[mixinSym];
11004
- const errorKey = this[errorKeySym];
11005
- const messageKey = this[messageKeySym];
11006
- const mixinMergeStrategy = this[mixinMergeStrategySym] || defaultMixinMergeStrategy;
11007
- let obj;
11008
- if (_obj === undefined || _obj === null) {
11009
- obj = {};
11010
- } else if (_obj instanceof Error) {
11011
- obj = { [errorKey]: _obj };
11012
- if (msg === undefined) {
11013
- msg = _obj.message;
11014
- }
11015
- } else {
11016
- obj = _obj;
11017
- if (msg === undefined && _obj[messageKey] === undefined && _obj[errorKey]) {
11018
- msg = _obj[errorKey].message;
11019
- }
11020
- }
11021
- if (mixin) {
11022
- obj = mixinMergeStrategy(obj, mixin(obj, num, this));
11023
- }
11024
- const s = this[asJsonSym](obj, msg, num, t);
11025
- const stream = this[streamSym];
11026
- if (stream[needsMetadataGsym] === true) {
11027
- stream.lastLevel = num;
11028
- stream.lastObj = obj;
11029
- stream.lastMsg = msg;
11030
- stream.lastTime = t.slice(this[timeSliceIndexSym]);
11031
- stream.lastLogger = this;
11032
- }
11033
- stream.write(s);
11034
- }
11035
- function noop() {}
11036
- function flush(cb) {
11037
- if (cb != null && typeof cb !== "function") {
11038
- throw Error("callback must be a function");
11039
- }
11040
- const stream = this[streamSym];
11041
- if (typeof stream.flush === "function") {
11042
- stream.flush(cb || noop);
11043
- } else if (cb)
11044
- cb();
11045
- }
11046
- });
11047
-
11048
- // ../node_modules/safe-stable-stringify/index.js
11049
- var require_safe_stable_stringify = __commonJS((exports, module) => {
11050
- var { hasOwnProperty } = Object.prototype;
11051
- var stringify = configure();
11052
- stringify.configure = configure;
11053
- stringify.stringify = stringify;
11054
- stringify.default = stringify;
11055
- exports.stringify = stringify;
11056
- exports.configure = configure;
11057
- module.exports = stringify;
11058
- var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
11059
- function strEscape(str) {
11060
- if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {
11061
- return `"${str}"`;
11062
- }
11063
- return JSON.stringify(str);
11064
- }
11065
- function sort(array, comparator) {
11066
- if (array.length > 200 || comparator) {
11067
- return array.sort(comparator);
11068
- }
11069
- for (let i = 1;i < array.length; i++) {
11070
- const currentValue = array[i];
11071
- let position = i;
11072
- while (position !== 0 && array[position - 1] > currentValue) {
11073
- array[position] = array[position - 1];
11074
- position--;
11075
- }
11076
- array[position] = currentValue;
11077
- }
11078
- return array;
11079
- }
11080
- var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)), Symbol.toStringTag).get;
11081
- function isTypedArrayWithEntries(value) {
11082
- return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0;
11083
- }
11084
- function stringifyTypedArray(array, separator, maximumBreadth) {
11085
- if (array.length < maximumBreadth) {
11086
- maximumBreadth = array.length;
11087
- }
11088
- const whitespace = separator === "," ? "" : " ";
11089
- let res = `"0":${whitespace}${array[0]}`;
11090
- for (let i = 1;i < maximumBreadth; i++) {
11091
- res += `${separator}"${i}":${whitespace}${array[i]}`;
11092
- }
11093
- return res;
11094
- }
11095
- function getCircularValueOption(options) {
11096
- if (hasOwnProperty.call(options, "circularValue")) {
11097
- const circularValue = options.circularValue;
11098
- if (typeof circularValue === "string") {
11099
- return `"${circularValue}"`;
11100
- }
11101
- if (circularValue == null) {
11102
- return circularValue;
11103
- }
11104
- if (circularValue === Error || circularValue === TypeError) {
11105
- return {
11106
- toString() {
11107
- throw new TypeError("Converting circular structure to JSON");
11108
- }
11109
- };
11110
- }
11111
- throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
11112
- }
11113
- return '"[Circular]"';
11114
- }
11115
- function getDeterministicOption(options) {
11116
- let value;
11117
- if (hasOwnProperty.call(options, "deterministic")) {
11118
- value = options.deterministic;
11119
- if (typeof value !== "boolean" && typeof value !== "function") {
11120
- throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
11121
- }
11122
- }
11123
- return value === undefined ? true : value;
11124
- }
11125
- function getBooleanOption(options, key) {
11126
- let value;
11127
- if (hasOwnProperty.call(options, key)) {
11128
- value = options[key];
11129
- if (typeof value !== "boolean") {
11130
- throw new TypeError(`The "${key}" argument must be of type boolean`);
11131
- }
11132
- }
11133
- return value === undefined ? true : value;
11134
- }
11135
- function getPositiveIntegerOption(options, key) {
11136
- let value;
11137
- if (hasOwnProperty.call(options, key)) {
11138
- value = options[key];
11139
- if (typeof value !== "number") {
11140
- throw new TypeError(`The "${key}" argument must be of type number`);
11141
- }
11142
- if (!Number.isInteger(value)) {
11143
- throw new TypeError(`The "${key}" argument must be an integer`);
11144
- }
11145
- if (value < 1) {
11146
- throw new RangeError(`The "${key}" argument must be >= 1`);
11147
- }
11148
- }
11149
- return value === undefined ? Infinity : value;
11150
- }
11151
- function getItemCount(number) {
11152
- if (number === 1) {
11153
- return "1 item";
11154
- }
11155
- return `${number} items`;
11156
- }
11157
- function getUniqueReplacerSet(replacerArray) {
11158
- const replacerSet = new Set;
11159
- for (const value of replacerArray) {
11160
- if (typeof value === "string" || typeof value === "number") {
11161
- replacerSet.add(String(value));
11162
- }
11163
- }
11164
- return replacerSet;
11165
- }
11166
- function getStrictOption(options) {
11167
- if (hasOwnProperty.call(options, "strict")) {
11168
- const value = options.strict;
11169
- if (typeof value !== "boolean") {
11170
- throw new TypeError('The "strict" argument must be of type boolean');
11171
- }
11172
- if (value) {
11173
- return (value2) => {
11174
- let message = `Object can not safely be stringified. Received type ${typeof value2}`;
11175
- if (typeof value2 !== "function")
11176
- message += ` (${value2.toString()})`;
11177
- throw new Error(message);
11178
- };
11179
- }
11180
- }
11181
- }
11182
- function configure(options) {
11183
- options = { ...options };
11184
- const fail = getStrictOption(options);
11185
- if (fail) {
11186
- if (options.bigint === undefined) {
11187
- options.bigint = false;
11188
- }
11189
- if (!("circularValue" in options)) {
11190
- options.circularValue = Error;
11191
- }
11192
- }
11193
- const circularValue = getCircularValueOption(options);
11194
- const bigint = getBooleanOption(options, "bigint");
11195
- const deterministic = getDeterministicOption(options);
11196
- const comparator = typeof deterministic === "function" ? deterministic : undefined;
11197
- const maximumDepth = getPositiveIntegerOption(options, "maximumDepth");
11198
- const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth");
11199
- function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
11200
- let value = parent[key];
11201
- if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
11202
- value = value.toJSON(key);
11203
- }
11204
- value = replacer.call(parent, key, value);
11205
- switch (typeof value) {
11206
- case "string":
11207
- return strEscape(value);
11208
- case "object": {
11209
- if (value === null) {
11210
- return "null";
11211
- }
11212
- if (stack.indexOf(value) !== -1) {
11213
- return circularValue;
11214
- }
11215
- let res = "";
11216
- let join = ",";
11217
- const originalIndentation = indentation;
11218
- if (Array.isArray(value)) {
11219
- if (value.length === 0) {
11220
- return "[]";
11221
- }
11222
- if (maximumDepth < stack.length + 1) {
11223
- return '"[Array]"';
11224
- }
11225
- stack.push(value);
11226
- if (spacer !== "") {
11227
- indentation += spacer;
11228
- res += `
11229
- ${indentation}`;
11230
- join = `,
11231
- ${indentation}`;
11232
- }
11233
- const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
11234
- let i = 0;
11235
- for (;i < maximumValuesToStringify - 1; i++) {
11236
- const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
11237
- res += tmp2 !== undefined ? tmp2 : "null";
11238
- res += join;
11239
- }
11240
- const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
11241
- res += tmp !== undefined ? tmp : "null";
11242
- if (value.length - 1 > maximumBreadth) {
11243
- const removedKeys = value.length - maximumBreadth - 1;
11244
- res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
11245
- }
11246
- if (spacer !== "") {
11247
- res += `
11248
- ${originalIndentation}`;
11249
- }
11250
- stack.pop();
11251
- return `[${res}]`;
11252
- }
11253
- let keys = Object.keys(value);
11254
- const keyLength = keys.length;
11255
- if (keyLength === 0) {
11256
- return "{}";
11257
- }
11258
- if (maximumDepth < stack.length + 1) {
11259
- return '"[Object]"';
11260
- }
11261
- let whitespace = "";
11262
- let separator = "";
11263
- if (spacer !== "") {
11264
- indentation += spacer;
11265
- join = `,
11266
- ${indentation}`;
11267
- whitespace = " ";
11268
- }
11269
- const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
11270
- if (deterministic && !isTypedArrayWithEntries(value)) {
11271
- keys = sort(keys, comparator);
11272
- }
11273
- stack.push(value);
11274
- for (let i = 0;i < maximumPropertiesToStringify; i++) {
11275
- const key2 = keys[i];
11276
- const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
11277
- if (tmp !== undefined) {
11278
- res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
11279
- separator = join;
11280
- }
11281
- }
11282
- if (keyLength > maximumBreadth) {
11283
- const removedKeys = keyLength - maximumBreadth;
11284
- res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
11285
- separator = join;
11286
- }
11287
- if (spacer !== "" && separator.length > 1) {
11288
- res = `
11289
- ${indentation}${res}
11290
- ${originalIndentation}`;
11291
- }
11292
- stack.pop();
11293
- return `{${res}}`;
11294
- }
11295
- case "number":
11296
- return isFinite(value) ? String(value) : fail ? fail(value) : "null";
11297
- case "boolean":
11298
- return value === true ? "true" : "false";
11299
- case "undefined":
11300
- return;
11301
- case "bigint":
11302
- if (bigint) {
11303
- return String(value);
11304
- }
11305
- default:
11306
- return fail ? fail(value) : undefined;
11307
- }
11308
- }
11309
- function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
11310
- if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
11311
- value = value.toJSON(key);
11312
- }
11313
- switch (typeof value) {
11314
- case "string":
11315
- return strEscape(value);
11316
- case "object": {
11317
- if (value === null) {
11318
- return "null";
11319
- }
11320
- if (stack.indexOf(value) !== -1) {
11321
- return circularValue;
11322
- }
11323
- const originalIndentation = indentation;
11324
- let res = "";
11325
- let join = ",";
11326
- if (Array.isArray(value)) {
11327
- if (value.length === 0) {
11328
- return "[]";
11329
- }
11330
- if (maximumDepth < stack.length + 1) {
11331
- return '"[Array]"';
11332
- }
11333
- stack.push(value);
11334
- if (spacer !== "") {
11335
- indentation += spacer;
11336
- res += `
11337
- ${indentation}`;
11338
- join = `,
11339
- ${indentation}`;
11340
- }
11341
- const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
11342
- let i = 0;
11343
- for (;i < maximumValuesToStringify - 1; i++) {
11344
- const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
11345
- res += tmp2 !== undefined ? tmp2 : "null";
11346
- res += join;
11347
- }
11348
- const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
11349
- res += tmp !== undefined ? tmp : "null";
11350
- if (value.length - 1 > maximumBreadth) {
11351
- const removedKeys = value.length - maximumBreadth - 1;
11352
- res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
11353
- }
11354
- if (spacer !== "") {
11355
- res += `
11356
- ${originalIndentation}`;
11357
- }
11358
- stack.pop();
11359
- return `[${res}]`;
11360
- }
11361
- stack.push(value);
11362
- let whitespace = "";
11363
- if (spacer !== "") {
11364
- indentation += spacer;
11365
- join = `,
11366
- ${indentation}`;
11367
- whitespace = " ";
11368
- }
11369
- let separator = "";
11370
- for (const key2 of replacer) {
11371
- const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
11372
- if (tmp !== undefined) {
11373
- res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
11374
- separator = join;
11375
- }
11376
- }
11377
- if (spacer !== "" && separator.length > 1) {
11378
- res = `
11379
- ${indentation}${res}
11380
- ${originalIndentation}`;
11381
- }
11382
- stack.pop();
11383
- return `{${res}}`;
11384
- }
11385
- case "number":
11386
- return isFinite(value) ? String(value) : fail ? fail(value) : "null";
11387
- case "boolean":
11388
- return value === true ? "true" : "false";
11389
- case "undefined":
11390
- return;
11391
- case "bigint":
11392
- if (bigint) {
11393
- return String(value);
11394
- }
11395
- default:
11396
- return fail ? fail(value) : undefined;
11397
- }
11398
- }
11399
- function stringifyIndent(key, value, stack, spacer, indentation) {
11400
- switch (typeof value) {
11401
- case "string":
11402
- return strEscape(value);
11403
- case "object": {
11404
- if (value === null) {
11405
- return "null";
11406
- }
11407
- if (typeof value.toJSON === "function") {
11408
- value = value.toJSON(key);
11409
- if (typeof value !== "object") {
11410
- return stringifyIndent(key, value, stack, spacer, indentation);
11411
- }
11412
- if (value === null) {
11413
- return "null";
11414
- }
11415
- }
11416
- if (stack.indexOf(value) !== -1) {
11417
- return circularValue;
11418
- }
11419
- const originalIndentation = indentation;
11420
- if (Array.isArray(value)) {
11421
- if (value.length === 0) {
11422
- return "[]";
11423
- }
11424
- if (maximumDepth < stack.length + 1) {
11425
- return '"[Array]"';
11426
- }
11427
- stack.push(value);
11428
- indentation += spacer;
11429
- let res2 = `
11430
- ${indentation}`;
11431
- const join2 = `,
11432
- ${indentation}`;
11433
- const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
11434
- let i = 0;
11435
- for (;i < maximumValuesToStringify - 1; i++) {
11436
- const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
11437
- res2 += tmp2 !== undefined ? tmp2 : "null";
11438
- res2 += join2;
11439
- }
11440
- const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
11441
- res2 += tmp !== undefined ? tmp : "null";
11442
- if (value.length - 1 > maximumBreadth) {
11443
- const removedKeys = value.length - maximumBreadth - 1;
11444
- res2 += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
11445
- }
11446
- res2 += `
11447
- ${originalIndentation}`;
11448
- stack.pop();
11449
- return `[${res2}]`;
11450
- }
11451
- let keys = Object.keys(value);
11452
- const keyLength = keys.length;
11453
- if (keyLength === 0) {
11454
- return "{}";
11455
- }
11456
- if (maximumDepth < stack.length + 1) {
11457
- return '"[Object]"';
11458
- }
11459
- indentation += spacer;
11460
- const join = `,
11461
- ${indentation}`;
11462
- let res = "";
11463
- let separator = "";
11464
- let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
11465
- if (isTypedArrayWithEntries(value)) {
11466
- res += stringifyTypedArray(value, join, maximumBreadth);
11467
- keys = keys.slice(value.length);
11468
- maximumPropertiesToStringify -= value.length;
11469
- separator = join;
11470
- }
11471
- if (deterministic) {
11472
- keys = sort(keys, comparator);
11473
- }
11474
- stack.push(value);
11475
- for (let i = 0;i < maximumPropertiesToStringify; i++) {
11476
- const key2 = keys[i];
11477
- const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
11478
- if (tmp !== undefined) {
11479
- res += `${separator}${strEscape(key2)}: ${tmp}`;
11480
- separator = join;
11481
- }
11482
- }
11483
- if (keyLength > maximumBreadth) {
11484
- const removedKeys = keyLength - maximumBreadth;
11485
- res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
11486
- separator = join;
11487
- }
11488
- if (separator !== "") {
11489
- res = `
11490
- ${indentation}${res}
11491
- ${originalIndentation}`;
11492
- }
11493
- stack.pop();
11494
- return `{${res}}`;
11495
- }
11496
- case "number":
11497
- return isFinite(value) ? String(value) : fail ? fail(value) : "null";
11498
- case "boolean":
11499
- return value === true ? "true" : "false";
11500
- case "undefined":
11501
- return;
11502
- case "bigint":
11503
- if (bigint) {
11504
- return String(value);
11505
- }
11506
- default:
11507
- return fail ? fail(value) : undefined;
11508
- }
11509
- }
11510
- function stringifySimple(key, value, stack) {
11511
- switch (typeof value) {
11512
- case "string":
11513
- return strEscape(value);
11514
- case "object": {
11515
- if (value === null) {
11516
- return "null";
11517
- }
11518
- if (typeof value.toJSON === "function") {
11519
- value = value.toJSON(key);
11520
- if (typeof value !== "object") {
11521
- return stringifySimple(key, value, stack);
11522
- }
11523
- if (value === null) {
11524
- return "null";
11525
- }
11526
- }
11527
- if (stack.indexOf(value) !== -1) {
11528
- return circularValue;
11529
- }
11530
- let res = "";
11531
- const hasLength = value.length !== undefined;
11532
- if (hasLength && Array.isArray(value)) {
11533
- if (value.length === 0) {
11534
- return "[]";
11535
- }
11536
- if (maximumDepth < stack.length + 1) {
11537
- return '"[Array]"';
11538
- }
11539
- stack.push(value);
11540
- const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
11541
- let i = 0;
11542
- for (;i < maximumValuesToStringify - 1; i++) {
11543
- const tmp2 = stringifySimple(String(i), value[i], stack);
11544
- res += tmp2 !== undefined ? tmp2 : "null";
11545
- res += ",";
11546
- }
11547
- const tmp = stringifySimple(String(i), value[i], stack);
11548
- res += tmp !== undefined ? tmp : "null";
11549
- if (value.length - 1 > maximumBreadth) {
11550
- const removedKeys = value.length - maximumBreadth - 1;
11551
- res += `,"... ${getItemCount(removedKeys)} not stringified"`;
11552
- }
11553
- stack.pop();
11554
- return `[${res}]`;
11555
- }
11556
- let keys = Object.keys(value);
11557
- const keyLength = keys.length;
11558
- if (keyLength === 0) {
11559
- return "{}";
11560
- }
11561
- if (maximumDepth < stack.length + 1) {
11562
- return '"[Object]"';
11563
- }
11564
- let separator = "";
11565
- let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
11566
- if (hasLength && isTypedArrayWithEntries(value)) {
11567
- res += stringifyTypedArray(value, ",", maximumBreadth);
11568
- keys = keys.slice(value.length);
11569
- maximumPropertiesToStringify -= value.length;
11570
- separator = ",";
11571
- }
11572
- if (deterministic) {
11573
- keys = sort(keys, comparator);
11574
- }
11575
- stack.push(value);
11576
- for (let i = 0;i < maximumPropertiesToStringify; i++) {
11577
- const key2 = keys[i];
11578
- const tmp = stringifySimple(key2, value[key2], stack);
11579
- if (tmp !== undefined) {
11580
- res += `${separator}${strEscape(key2)}:${tmp}`;
11581
- separator = ",";
11582
- }
11583
- }
11584
- if (keyLength > maximumBreadth) {
11585
- const removedKeys = keyLength - maximumBreadth;
11586
- res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
11587
- }
11588
- stack.pop();
11589
- return `{${res}}`;
11590
- }
11591
- case "number":
11592
- return isFinite(value) ? String(value) : fail ? fail(value) : "null";
11593
- case "boolean":
11594
- return value === true ? "true" : "false";
11595
- case "undefined":
11596
- return;
11597
- case "bigint":
11598
- if (bigint) {
11599
- return String(value);
11600
- }
11601
- default:
11602
- return fail ? fail(value) : undefined;
11603
- }
11604
- }
11605
- function stringify2(value, replacer, space) {
11606
- if (arguments.length > 1) {
11607
- let spacer = "";
11608
- if (typeof space === "number") {
11609
- spacer = " ".repeat(Math.min(space, 10));
11610
- } else if (typeof space === "string") {
11611
- spacer = space.slice(0, 10);
11612
- }
11613
- if (replacer != null) {
11614
- if (typeof replacer === "function") {
11615
- return stringifyFnReplacer("", { "": value }, [], replacer, spacer, "");
11616
- }
11617
- if (Array.isArray(replacer)) {
11618
- return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, "");
11619
- }
11620
- }
11621
- if (spacer.length !== 0) {
11622
- return stringifyIndent("", value, [], spacer, "");
11623
- }
11624
- }
11625
- return stringifySimple("", value, []);
11626
- }
11627
- return stringify2;
11628
- }
11629
- });
11630
-
11631
- // ../node_modules/pino/lib/multistream.js
11632
- var require_multistream = __commonJS((exports, module) => {
11633
- var metadata = Symbol.for("pino.metadata");
11634
- var { DEFAULT_LEVELS } = require_constants();
11635
- var DEFAULT_INFO_LEVEL = DEFAULT_LEVELS.info;
11636
- function multistream(streamsArray, opts) {
11637
- let counter = 0;
11638
- streamsArray = streamsArray || [];
11639
- opts = opts || { dedupe: false };
11640
- const streamLevels = Object.create(DEFAULT_LEVELS);
11641
- streamLevels.silent = Infinity;
11642
- if (opts.levels && typeof opts.levels === "object") {
11643
- Object.keys(opts.levels).forEach((i) => {
11644
- streamLevels[i] = opts.levels[i];
11645
- });
11646
- }
11647
- const res = {
11648
- write,
11649
- add,
11650
- emit,
11651
- flushSync,
11652
- end,
11653
- minLevel: 0,
11654
- streams: [],
11655
- clone,
11656
- [metadata]: true,
11657
- streamLevels
11658
- };
11659
- if (Array.isArray(streamsArray)) {
11660
- streamsArray.forEach(add, res);
11661
- } else {
11662
- add.call(res, streamsArray);
11663
- }
11664
- streamsArray = null;
11665
- return res;
11666
- function write(data) {
11667
- let dest;
11668
- const level = this.lastLevel;
11669
- const { streams } = this;
11670
- let recordedLevel = 0;
11671
- let stream;
11672
- for (let i = initLoopVar(streams.length, opts.dedupe);checkLoopVar(i, streams.length, opts.dedupe); i = adjustLoopVar(i, opts.dedupe)) {
11673
- dest = streams[i];
11674
- if (dest.level <= level) {
11675
- if (recordedLevel !== 0 && recordedLevel !== dest.level) {
11676
- break;
11677
- }
11678
- stream = dest.stream;
11679
- if (stream[metadata]) {
11680
- const { lastTime, lastMsg, lastObj, lastLogger } = this;
11681
- stream.lastLevel = level;
11682
- stream.lastTime = lastTime;
11683
- stream.lastMsg = lastMsg;
11684
- stream.lastObj = lastObj;
11685
- stream.lastLogger = lastLogger;
11686
- }
11687
- stream.write(data);
11688
- if (opts.dedupe) {
11689
- recordedLevel = dest.level;
11690
- }
11691
- } else if (!opts.dedupe) {
11692
- break;
11693
- }
11694
- }
11695
- }
11696
- function emit(...args) {
11697
- for (const { stream } of this.streams) {
11698
- if (typeof stream.emit === "function") {
11699
- stream.emit(...args);
11700
- }
11701
- }
11702
- }
11703
- function flushSync() {
11704
- for (const { stream } of this.streams) {
11705
- if (typeof stream.flushSync === "function") {
11706
- stream.flushSync();
11707
- }
11708
- }
11709
- }
11710
- function add(dest) {
11711
- if (!dest) {
11712
- return res;
11713
- }
11714
- const isStream = typeof dest.write === "function" || dest.stream;
11715
- const stream_ = dest.write ? dest : dest.stream;
11716
- if (!isStream) {
11717
- throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");
11718
- }
11719
- const { streams, streamLevels: streamLevels2 } = this;
11720
- let level;
11721
- if (typeof dest.levelVal === "number") {
11722
- level = dest.levelVal;
11723
- } else if (typeof dest.level === "string") {
11724
- level = streamLevels2[dest.level];
11725
- } else if (typeof dest.level === "number") {
11726
- level = dest.level;
11727
- } else {
11728
- level = DEFAULT_INFO_LEVEL;
11729
- }
11730
- const dest_ = {
11731
- stream: stream_,
11732
- level,
11733
- levelVal: undefined,
11734
- id: counter++
11735
- };
11736
- streams.unshift(dest_);
11737
- streams.sort(compareByLevel);
11738
- this.minLevel = streams[0].level;
11739
- return res;
11740
- }
11741
- function end() {
11742
- for (const { stream } of this.streams) {
11743
- if (typeof stream.flushSync === "function") {
11744
- stream.flushSync();
11745
- }
11746
- stream.end();
11747
- }
11748
- }
11749
- function clone(level) {
11750
- const streams = new Array(this.streams.length);
11751
- for (let i = 0;i < streams.length; i++) {
11752
- streams[i] = {
11753
- level,
11754
- stream: this.streams[i].stream
11755
- };
11756
- }
11757
- return {
11758
- write,
11759
- add,
11760
- minLevel: level,
11761
- streams,
11762
- clone,
11763
- emit,
11764
- flushSync,
11765
- [metadata]: true
11766
- };
11767
- }
11768
- }
11769
- function compareByLevel(a, b) {
11770
- return a.level - b.level;
11771
- }
11772
- function initLoopVar(length, dedupe) {
11773
- return dedupe ? length - 1 : 0;
11774
- }
11775
- function adjustLoopVar(i, dedupe) {
11776
- return dedupe ? i - 1 : i + 1;
11777
- }
11778
- function checkLoopVar(i, length, dedupe) {
11779
- return dedupe ? i >= 0 : i < length;
11780
- }
11781
- module.exports = multistream;
11782
- });
11783
-
11784
- // ../node_modules/pino/pino.js
11785
- var require_pino = __commonJS((exports, module) => {
11786
- var os2 = __require("node:os");
11787
- var stdSerializers = require_pino_std_serializers();
11788
- var caller = require_caller();
11789
- var redaction = require_redaction();
11790
- var time = require_time();
11791
- var proto = require_proto();
11792
- var symbols = require_symbols();
11793
- var { configure } = require_safe_stable_stringify();
11794
- var { assertDefaultLevelFound, mappings, genLsCache, genLevelComparison, assertLevelComparison } = require_levels();
11795
- var { DEFAULT_LEVELS, SORTING_ORDER } = require_constants();
11796
- var {
11797
- createArgsNormalizer,
11798
- asChindings,
11799
- buildSafeSonicBoom,
11800
- buildFormatters,
11801
- stringify,
11802
- normalizeDestFileDescriptor,
11803
- noop
11804
- } = require_tools();
11805
- var { version } = require_meta();
11806
- var {
11807
- chindingsSym,
11808
- redactFmtSym,
11809
- serializersSym,
11810
- timeSym,
11811
- timeSliceIndexSym,
11812
- streamSym,
11813
- stringifySym,
11814
- stringifySafeSym,
11815
- stringifiersSym,
11816
- setLevelSym,
11817
- endSym,
11818
- formatOptsSym,
11819
- messageKeySym,
11820
- errorKeySym,
11821
- nestedKeySym,
11822
- mixinSym,
11823
- levelCompSym,
11824
- useOnlyCustomLevelsSym,
11825
- formattersSym,
11826
- hooksSym,
11827
- nestedKeyStrSym,
11828
- mixinMergeStrategySym,
11829
- msgPrefixSym
11830
- } = symbols;
11831
- var { epochTime, nullTime } = time;
11832
- var { pid } = process;
11833
- var hostname = os2.hostname();
11834
- var defaultErrorSerializer = stdSerializers.err;
11835
- var defaultOptions = {
11836
- level: "info",
11837
- levelComparison: SORTING_ORDER.ASC,
11838
- levels: DEFAULT_LEVELS,
11839
- messageKey: "msg",
11840
- errorKey: "err",
11841
- nestedKey: null,
11842
- enabled: true,
11843
- base: { pid, hostname },
11844
- serializers: Object.assign(Object.create(null), {
11845
- err: defaultErrorSerializer
11846
- }),
11847
- formatters: Object.assign(Object.create(null), {
11848
- bindings(bindings) {
11849
- return bindings;
11850
- },
11851
- level(label, number) {
11852
- return { level: number };
11853
- }
11854
- }),
11855
- hooks: {
11856
- logMethod: undefined
11857
- },
11858
- timestamp: epochTime,
11859
- name: undefined,
11860
- redact: null,
11861
- customLevels: null,
11862
- useOnlyCustomLevels: false,
11863
- depthLimit: 5,
11864
- edgeLimit: 100
11865
- };
11866
- var normalize = createArgsNormalizer(defaultOptions);
11867
- var serializers = Object.assign(Object.create(null), stdSerializers);
11868
- function pino(...args) {
11869
- const instance = {};
11870
- const { opts, stream } = normalize(instance, caller(), ...args);
11871
- if (opts.level && typeof opts.level === "string" && DEFAULT_LEVELS[opts.level.toLowerCase()] !== undefined)
11872
- opts.level = opts.level.toLowerCase();
11873
- const {
11874
- redact,
11875
- crlf,
11876
- serializers: serializers2,
11877
- timestamp,
11878
- messageKey,
11879
- errorKey,
11880
- nestedKey,
11881
- base,
11882
- name,
11883
- level,
11884
- customLevels,
11885
- levelComparison,
11886
- mixin,
11887
- mixinMergeStrategy,
11888
- useOnlyCustomLevels,
11889
- formatters,
11890
- hooks,
11891
- depthLimit,
11892
- edgeLimit,
11893
- onChild,
11894
- msgPrefix
11895
- } = opts;
11896
- const stringifySafe = configure({
11897
- maximumDepth: depthLimit,
11898
- maximumBreadth: edgeLimit
11899
- });
11900
- const allFormatters = buildFormatters(formatters.level, formatters.bindings, formatters.log);
11901
- const stringifyFn = stringify.bind({
11902
- [stringifySafeSym]: stringifySafe
11903
- });
11904
- const stringifiers = redact ? redaction(redact, stringifyFn) : {};
11905
- const formatOpts = redact ? { stringify: stringifiers[redactFmtSym] } : { stringify: stringifyFn };
11906
- const end = "}" + (crlf ? `\r
11907
- ` : `
11908
- `);
11909
- const coreChindings = asChindings.bind(null, {
11910
- [chindingsSym]: "",
11911
- [serializersSym]: serializers2,
11912
- [stringifiersSym]: stringifiers,
11913
- [stringifySym]: stringify,
11914
- [stringifySafeSym]: stringifySafe,
11915
- [formattersSym]: allFormatters
11916
- });
11917
- let chindings = "";
11918
- if (base !== null) {
11919
- if (name === undefined) {
11920
- chindings = coreChindings(base);
11921
- } else {
11922
- chindings = coreChindings(Object.assign({}, base, { name }));
11923
- }
11924
- }
11925
- const time2 = timestamp instanceof Function ? timestamp : timestamp ? epochTime : nullTime;
11926
- const timeSliceIndex = time2().indexOf(":") + 1;
11927
- if (useOnlyCustomLevels && !customLevels)
11928
- throw Error("customLevels is required if useOnlyCustomLevels is set true");
11929
- if (mixin && typeof mixin !== "function")
11930
- throw Error(`Unknown mixin type "${typeof mixin}" - expected "function"`);
11931
- if (msgPrefix && typeof msgPrefix !== "string")
11932
- throw Error(`Unknown msgPrefix type "${typeof msgPrefix}" - expected "string"`);
11933
- assertDefaultLevelFound(level, customLevels, useOnlyCustomLevels);
11934
- const levels = mappings(customLevels, useOnlyCustomLevels);
11935
- if (typeof stream.emit === "function") {
11936
- stream.emit("message", { code: "PINO_CONFIG", config: { levels, messageKey, errorKey } });
11937
- }
11938
- assertLevelComparison(levelComparison);
11939
- const levelCompFunc = genLevelComparison(levelComparison);
11940
- Object.assign(instance, {
11941
- levels,
11942
- [levelCompSym]: levelCompFunc,
11943
- [useOnlyCustomLevelsSym]: useOnlyCustomLevels,
11944
- [streamSym]: stream,
11945
- [timeSym]: time2,
11946
- [timeSliceIndexSym]: timeSliceIndex,
11947
- [stringifySym]: stringify,
11948
- [stringifySafeSym]: stringifySafe,
11949
- [stringifiersSym]: stringifiers,
11950
- [endSym]: end,
11951
- [formatOptsSym]: formatOpts,
11952
- [messageKeySym]: messageKey,
11953
- [errorKeySym]: errorKey,
11954
- [nestedKeySym]: nestedKey,
11955
- [nestedKeyStrSym]: nestedKey ? `,${JSON.stringify(nestedKey)}:{` : "",
11956
- [serializersSym]: serializers2,
11957
- [mixinSym]: mixin,
11958
- [mixinMergeStrategySym]: mixinMergeStrategy,
11959
- [chindingsSym]: chindings,
11960
- [formattersSym]: allFormatters,
11961
- [hooksSym]: hooks,
11962
- silent: noop,
11963
- onChild,
11964
- [msgPrefixSym]: msgPrefix
11965
- });
11966
- Object.setPrototypeOf(instance, proto());
11967
- genLsCache(instance);
11968
- instance[setLevelSym](level);
11969
- return instance;
11970
- }
11971
- module.exports = pino;
11972
- module.exports.destination = (dest = process.stdout.fd) => {
11973
- if (typeof dest === "object") {
11974
- dest.dest = normalizeDestFileDescriptor(dest.dest || process.stdout.fd);
11975
- return buildSafeSonicBoom(dest);
11976
- } else {
11977
- return buildSafeSonicBoom({ dest: normalizeDestFileDescriptor(dest), minLength: 0 });
11978
- }
11979
- };
11980
- module.exports.transport = require_transport();
11981
- module.exports.multistream = require_multistream();
11982
- module.exports.levels = mappings();
11983
- module.exports.stdSerializers = serializers;
11984
- module.exports.stdTimeFunctions = Object.assign({}, time);
11985
- module.exports.symbols = symbols;
11986
- module.exports.version = version;
11987
- module.exports.default = pino;
11988
- module.exports.pino = pino;
11989
- });
11990
-
11991
7776
  // ../common/node_modules/ignore/index.js
11992
7777
  var require_ignore = __commonJS((exports, module) => {
11993
7778
  function makeArray(subject) {
@@ -17048,7 +12833,7 @@ var require_inflate = __commonJS((exports) => {
17048
12833
  });
17049
12834
 
17050
12835
  // ../node_modules/pako/lib/zlib/constants.js
17051
- var require_constants2 = __commonJS((exports, module) => {
12836
+ var require_constants = __commonJS((exports, module) => {
17052
12837
  module.exports = {
17053
12838
  Z_NO_FLUSH: 0,
17054
12839
  Z_PARTIAL_FLUSH: 1,
@@ -17102,7 +12887,7 @@ var require_inflate2 = __commonJS((exports) => {
17102
12887
  var zlib_inflate = require_inflate();
17103
12888
  var utils = require_common();
17104
12889
  var strings = require_strings();
17105
- var c = require_constants2();
12890
+ var c = require_constants();
17106
12891
  var msg = require_messages();
17107
12892
  var ZStream = require_zstream();
17108
12893
  var GZheader = require_gzheader();
@@ -17271,7 +13056,7 @@ var require_pako = __commonJS((exports, module) => {
17271
13056
  var assign = require_common().assign;
17272
13057
  var deflate = require_deflate2();
17273
13058
  var inflate = require_inflate2();
17274
- var constants = require_constants2();
13059
+ var constants = require_constants();
17275
13060
  var pako = {};
17276
13061
  assign(pako, deflate, inflate, constants);
17277
13062
  module.exports = pako;
@@ -36980,7 +32765,7 @@ var require_iterate = __commonJS((exports, module) => {
36980
32765
  });
36981
32766
 
36982
32767
  // ../node_modules/asynckit/lib/state.js
36983
- var require_state2 = __commonJS((exports, module) => {
32768
+ var require_state = __commonJS((exports, module) => {
36984
32769
  module.exports = state;
36985
32770
  function state(list, sortMethod) {
36986
32771
  var isNamedList = !Array.isArray(list), initState = {
@@ -37017,7 +32802,7 @@ var require_terminator = __commonJS((exports, module) => {
37017
32802
  // ../node_modules/asynckit/parallel.js
37018
32803
  var require_parallel = __commonJS((exports, module) => {
37019
32804
  var iterate = require_iterate();
37020
- var initState = require_state2();
32805
+ var initState = require_state();
37021
32806
  var terminator = require_terminator();
37022
32807
  module.exports = parallel;
37023
32808
  function parallel(list, iterator, callback) {
@@ -37042,7 +32827,7 @@ var require_parallel = __commonJS((exports, module) => {
37042
32827
  // ../node_modules/asynckit/serialOrdered.js
37043
32828
  var require_serialOrdered = __commonJS((exports, module) => {
37044
32829
  var iterate = require_iterate();
37045
- var initState = require_state2();
32830
+ var initState = require_state();
37046
32831
  var terminator = require_terminator();
37047
32832
  module.exports = serialOrdered;
37048
32833
  module.exports.ascending = ascending;
@@ -60168,7 +55953,7 @@ var require_Deferred = __commonJS((exports) => {
60168
55953
  });
60169
55954
 
60170
55955
  // ../node_modules/chromium-bidi/lib/cjs/utils/time.js
60171
- var require_time2 = __commonJS((exports) => {
55956
+ var require_time = __commonJS((exports) => {
60172
55957
  Object.defineProperty(exports, "__esModule", { value: true });
60173
55958
  exports.getTimestamp = getTimestamp;
60174
55959
  function getTimestamp() {
@@ -60783,7 +56568,7 @@ var require_NavigationTracker = __commonJS((exports) => {
60783
56568
  var protocol_js_1 = require_protocol();
60784
56569
  var Deferred_js_1 = require_Deferred();
60785
56570
  var log_js_1 = require_log();
60786
- var time_js_1 = require_time2();
56571
+ var time_js_1 = require_time();
60787
56572
  var urlHelpers_js_1 = require_urlHelpers();
60788
56573
  var uuid_js_1 = require_uuid();
60789
56574
 
@@ -61012,7 +56797,7 @@ var require_BrowsingContextImpl = __commonJS((exports) => {
61012
56797
  var assert_js_1 = require_assert();
61013
56798
  var Deferred_js_1 = require_Deferred();
61014
56799
  var log_js_1 = require_log();
61015
- var time_js_1 = require_time2();
56800
+ var time_js_1 = require_time();
61016
56801
  var unitConversions_js_1 = require_unitConversions();
61017
56802
  var SharedId_js_1 = require_SharedId();
61018
56803
  var WindowRealm_js_1 = require_WindowRealm();
@@ -71343,7 +67128,7 @@ class NodeWebSocketTransport {
71343
67128
  var init_NodeWebSocketTransport = () => {};
71344
67129
 
71345
67130
  // ../node_modules/@puppeteer/browsers/node_modules/semver/internal/constants.js
71346
- var require_constants3 = __commonJS((exports, module) => {
67131
+ var require_constants2 = __commonJS((exports, module) => {
71347
67132
  var SEMVER_SPEC_VERSION = "2.0.0";
71348
67133
  var MAX_LENGTH = 256;
71349
67134
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
@@ -71382,7 +67167,7 @@ var require_re = __commonJS((exports, module) => {
71382
67167
  MAX_SAFE_COMPONENT_LENGTH,
71383
67168
  MAX_SAFE_BUILD_LENGTH,
71384
67169
  MAX_LENGTH
71385
- } = require_constants3();
67170
+ } = require_constants2();
71386
67171
  var debug2 = require_debug2();
71387
67172
  exports = module.exports = {};
71388
67173
  var re = exports.re = [];
@@ -71499,7 +67284,7 @@ var require_identifiers = __commonJS((exports, module) => {
71499
67284
  // ../node_modules/@puppeteer/browsers/node_modules/semver/classes/semver.js
71500
67285
  var require_semver = __commonJS((exports, module) => {
71501
67286
  var debug2 = require_debug2();
71502
- var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants3();
67287
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants2();
71503
67288
  var { safeRe: re, safeSrc: src, t: t2 } = require_re();
71504
67289
  var parseOptions = require_parse_options();
71505
67290
  var { compareIdentifiers } = require_identifiers();
@@ -71749,7 +67534,7 @@ var require_semver = __commonJS((exports, module) => {
71749
67534
  });
71750
67535
 
71751
67536
  // ../node_modules/@puppeteer/browsers/node_modules/semver/functions/parse.js
71752
- var require_parse2 = __commonJS((exports, module) => {
67537
+ var require_parse = __commonJS((exports, module) => {
71753
67538
  var SemVer = require_semver();
71754
67539
  var parse = (version, options, throwErrors = false) => {
71755
67540
  if (version instanceof SemVer) {
@@ -71769,7 +67554,7 @@ var require_parse2 = __commonJS((exports, module) => {
71769
67554
 
71770
67555
  // ../node_modules/@puppeteer/browsers/node_modules/semver/functions/valid.js
71771
67556
  var require_valid = __commonJS((exports, module) => {
71772
- var parse = require_parse2();
67557
+ var parse = require_parse();
71773
67558
  var valid = (version, options) => {
71774
67559
  const v2 = parse(version, options);
71775
67560
  return v2 ? v2.version : null;
@@ -71779,7 +67564,7 @@ var require_valid = __commonJS((exports, module) => {
71779
67564
 
71780
67565
  // ../node_modules/@puppeteer/browsers/node_modules/semver/functions/clean.js
71781
67566
  var require_clean = __commonJS((exports, module) => {
71782
- var parse = require_parse2();
67567
+ var parse = require_parse();
71783
67568
  var clean = (version, options) => {
71784
67569
  const s2 = parse(version.trim().replace(/^[=v]+/, ""), options);
71785
67570
  return s2 ? s2.version : null;
@@ -71807,7 +67592,7 @@ var require_inc = __commonJS((exports, module) => {
71807
67592
 
71808
67593
  // ../node_modules/@puppeteer/browsers/node_modules/semver/functions/diff.js
71809
67594
  var require_diff = __commonJS((exports, module) => {
71810
- var parse = require_parse2();
67595
+ var parse = require_parse();
71811
67596
  var diff2 = (version1, version2) => {
71812
67597
  const v1 = parse(version1, null, true);
71813
67598
  const v2 = parse(version2, null, true);
@@ -71869,7 +67654,7 @@ var require_patch = __commonJS((exports, module) => {
71869
67654
 
71870
67655
  // ../node_modules/@puppeteer/browsers/node_modules/semver/functions/prerelease.js
71871
67656
  var require_prerelease = __commonJS((exports, module) => {
71872
- var parse = require_parse2();
67657
+ var parse = require_parse();
71873
67658
  var prerelease = (version, options) => {
71874
67659
  const parsed = parse(version, options);
71875
67660
  return parsed && parsed.prerelease.length ? parsed.prerelease : null;
@@ -72015,7 +67800,7 @@ var require_cmp = __commonJS((exports, module) => {
72015
67800
  // ../node_modules/@puppeteer/browsers/node_modules/semver/functions/coerce.js
72016
67801
  var require_coerce = __commonJS((exports, module) => {
72017
67802
  var SemVer = require_semver();
72018
- var parse = require_parse2();
67803
+ var parse = require_parse();
72019
67804
  var { safeRe: re, t: t2 } = require_re();
72020
67805
  var coerce2 = (version, options) => {
72021
67806
  if (version instanceof SemVer) {
@@ -72245,7 +68030,7 @@ var require_range2 = __commonJS((exports, module) => {
72245
68030
  tildeTrimReplace,
72246
68031
  caretTrimReplace
72247
68032
  } = require_re();
72248
- var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants3();
68033
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants2();
72249
68034
  var isNullSet = (c2) => c2.value === "<0.0.0-0";
72250
68035
  var isAny = (c2) => c2.value === "";
72251
68036
  var isSatisfiable = (comparators, options) => {
@@ -73015,10 +68800,10 @@ var require_subset = __commonJS((exports, module) => {
73015
68800
  // ../node_modules/@puppeteer/browsers/node_modules/semver/index.js
73016
68801
  var require_semver2 = __commonJS((exports, module) => {
73017
68802
  var internalRe = require_re();
73018
- var constants = require_constants3();
68803
+ var constants = require_constants2();
73019
68804
  var SemVer = require_semver();
73020
68805
  var identifiers = require_identifiers();
73021
- var parse = require_parse2();
68806
+ var parse = require_parse();
73022
68807
  var valid = require_valid();
73023
68808
  var clean = require_clean();
73024
68809
  var inc = require_inc();
@@ -76281,7 +72066,7 @@ var require_smartbuffer = __commonJS((exports) => {
76281
72066
  });
76282
72067
 
76283
72068
  // ../node_modules/socks/build/common/constants.js
76284
- var require_constants4 = __commonJS((exports) => {
72069
+ var require_constants3 = __commonJS((exports) => {
76285
72070
  Object.defineProperty(exports, "__esModule", { value: true });
76286
72071
  exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = undefined;
76287
72072
  var DEFAULT_TIMEOUT2 = 30000;
@@ -76437,7 +72222,7 @@ var require_common6 = __commonJS((exports) => {
76437
72222
  });
76438
72223
 
76439
72224
  // ../node_modules/ip-address/dist/v4/constants.js
76440
- var require_constants5 = __commonJS((exports) => {
72225
+ var require_constants4 = __commonJS((exports) => {
76441
72226
  Object.defineProperty(exports, "__esModule", { value: true });
76442
72227
  exports.RE_SUBNET_STRING = exports.RE_ADDRESS = exports.GROUPS = exports.BITS = undefined;
76443
72228
  exports.BITS = 32;
@@ -78120,7 +73905,7 @@ var require_ipv4 = __commonJS((exports) => {
78120
73905
  Object.defineProperty(exports, "__esModule", { value: true });
78121
73906
  exports.Address4 = undefined;
78122
73907
  var common2 = __importStar(require_common6());
78123
- var constants = __importStar(require_constants5());
73908
+ var constants = __importStar(require_constants4());
78124
73909
  var address_error_1 = require_address_error();
78125
73910
  var jsbn_1 = require_jsbn();
78126
73911
  var sprintf_js_1 = require_sprintf();
@@ -78260,7 +74045,7 @@ var require_ipv4 = __commonJS((exports) => {
78260
74045
  });
78261
74046
 
78262
74047
  // ../node_modules/ip-address/dist/v6/constants.js
78263
- var require_constants6 = __commonJS((exports) => {
74048
+ var require_constants5 = __commonJS((exports) => {
78264
74049
  Object.defineProperty(exports, "__esModule", { value: true });
78265
74050
  exports.RE_URL_WITH_PORT = exports.RE_URL = exports.RE_ZONE_STRING = exports.RE_SUBNET_STRING = exports.RE_BAD_ADDRESS = exports.RE_BAD_CHARACTERS = exports.TYPES = exports.SCOPES = exports.GROUPS = exports.BITS = undefined;
78266
74051
  exports.BITS = 128;
@@ -78377,7 +74162,7 @@ var require_regular_expressions = __commonJS((exports) => {
78377
74162
  };
78378
74163
  Object.defineProperty(exports, "__esModule", { value: true });
78379
74164
  exports.possibleElisions = exports.simpleRegularExpression = exports.ADDRESS_BOUNDARY = exports.padGroup = exports.groupPossibilities = undefined;
78380
- var v6 = __importStar(require_constants6());
74165
+ var v6 = __importStar(require_constants5());
78381
74166
  var sprintf_js_1 = require_sprintf();
78382
74167
  function groupPossibilities(possibilities) {
78383
74168
  return (0, sprintf_js_1.sprintf)("(%s)", possibilities.join("|"));
@@ -78473,8 +74258,8 @@ var require_ipv6 = __commonJS((exports) => {
78473
74258
  Object.defineProperty(exports, "__esModule", { value: true });
78474
74259
  exports.Address6 = undefined;
78475
74260
  var common2 = __importStar(require_common6());
78476
- var constants4 = __importStar(require_constants5());
78477
- var constants6 = __importStar(require_constants6());
74261
+ var constants4 = __importStar(require_constants4());
74262
+ var constants6 = __importStar(require_constants5());
78478
74263
  var helpers = __importStar(require_helpers2());
78479
74264
  var ipv4_1 = require_ipv4();
78480
74265
  var regular_expressions_1 = require_regular_expressions();
@@ -79093,7 +74878,7 @@ var require_helpers3 = __commonJS((exports) => {
79093
74878
  Object.defineProperty(exports, "__esModule", { value: true });
79094
74879
  exports.ipToBuffer = exports.int32ToIpv4 = exports.ipv4ToInt32 = exports.validateSocksClientChainOptions = exports.validateSocksClientOptions = undefined;
79095
74880
  var util_1 = require_util();
79096
- var constants_1 = require_constants4();
74881
+ var constants_1 = require_constants3();
79097
74882
  var stream = __require("stream");
79098
74883
  var ip_address_1 = require_ip_address();
79099
74884
  var net = __require("net");
@@ -79272,7 +75057,7 @@ var require_socksclient = __commonJS((exports) => {
79272
75057
  var events_1 = __require("events");
79273
75058
  var net = __require("net");
79274
75059
  var smart_buffer_1 = require_smartbuffer();
79275
- var constants_1 = require_constants4();
75060
+ var constants_1 = require_constants3();
79276
75061
  var helpers_1 = require_helpers3();
79277
75062
  var receivebuffer_1 = require_receivebuffer();
79278
75063
  var util_1 = require_util();
@@ -86185,7 +81970,7 @@ var require_source_map = __commonJS((exports) => {
86185
81970
  });
86186
81971
 
86187
81972
  // ../node_modules/escodegen/package.json
86188
- var require_package2 = __commonJS((exports, module) => {
81973
+ var require_package = __commonJS((exports, module) => {
86189
81974
  module.exports = {
86190
81975
  name: "escodegen",
86191
81976
  description: "ECMAScript code generator",
@@ -88295,7 +84080,7 @@ var require_escodegen = __commonJS((exports) => {
88295
84080
  semicolons: false
88296
84081
  };
88297
84082
  FORMAT_DEFAULTS = getDefaultOptions().format;
88298
- exports.version = require_package2().version;
84083
+ exports.version = require_package().version;
88299
84084
  exports.generate = generate;
88300
84085
  exports.attachComments = estraverse.attachComments;
88301
84086
  exports.Precedence = updateDeeply({}, Precedence);
@@ -106711,7 +102496,7 @@ var require_extract = __commonJS((exports, module) => {
106711
102496
  });
106712
102497
 
106713
102498
  // ../node_modules/@puppeteer/browsers/node_modules/tar-fs/node_modules/tar-stream/constants.js
106714
- var require_constants7 = __commonJS((exports, module) => {
102499
+ var require_constants6 = __commonJS((exports, module) => {
106715
102500
  var constants = {
106716
102501
  S_IFMT: 61440,
106717
102502
  S_IFDIR: 16384,
@@ -106731,7 +102516,7 @@ var require_constants7 = __commonJS((exports, module) => {
106731
102516
  var require_pack = __commonJS((exports, module) => {
106732
102517
  var { Readable, Writable, getStreamError } = require_streamx();
106733
102518
  var b4a = require_b4a();
106734
- var constants = require_constants7();
102519
+ var constants = require_constants6();
106735
102520
  var headers = require_headers();
106736
102521
  var DMODE = 493;
106737
102522
  var FMODE = 420;
@@ -112235,7 +108020,7 @@ var init_helpers = __esm(() => {
112235
108020
  });
112236
108021
 
112237
108022
  // ../node_modules/systeminformation/package.json
112238
- var require_package3 = __commonJS((exports, module) => {
108023
+ var require_package2 = __commonJS((exports, module) => {
112239
108024
  module.exports = {
112240
108025
  name: "systeminformation",
112241
108026
  version: "5.23.4",
@@ -127193,7 +122978,7 @@ var require_bluetooth = __commonJS((exports) => {
127193
122978
 
127194
122979
  // ../node_modules/systeminformation/lib/index.js
127195
122980
  var require_lib3 = __commonJS((exports) => {
127196
- var lib_version = require_package3().version;
122981
+ var lib_version = require_package2().version;
127197
122982
  var util4 = require_util4();
127198
122983
  var system = require_system();
127199
122984
  var osInfo = require_osinfo();
@@ -129966,7 +125751,7 @@ var require_buffer_list = __commonJS((exports, module) => {
129966
125751
  });
129967
125752
 
129968
125753
  // ../node_modules/readable-stream/lib/internal/streams/state.js
129969
- var require_state3 = __commonJS((exports, module) => {
125754
+ var require_state2 = __commonJS((exports, module) => {
129970
125755
  var { MathFloor, NumberIsInteger } = require_primordials();
129971
125756
  var { validateInteger } = require_validators();
129972
125757
  var { ERR_INVALID_ARG_VALUE } = require_errors2().codes;
@@ -130376,7 +126161,7 @@ var require_readable = __commonJS((exports, module) => {
130376
126161
  });
130377
126162
  var BufferList = require_buffer_list();
130378
126163
  var destroyImpl = require_destroy();
130379
- var { getHighWaterMark, getDefaultHighWaterMark } = require_state3();
126164
+ var { getHighWaterMark, getDefaultHighWaterMark } = require_state2();
130380
126165
  var {
130381
126166
  aggregateTwoErrors,
130382
126167
  codes: {
@@ -131358,7 +127143,7 @@ var require_writable = __commonJS((exports, module) => {
131358
127143
  var { Buffer: Buffer2 } = __require("buffer");
131359
127144
  var destroyImpl = require_destroy();
131360
127145
  var { addAbortSignal } = require_add_abort_signal();
131361
- var { getHighWaterMark, getDefaultHighWaterMark } = require_state3();
127146
+ var { getHighWaterMark, getDefaultHighWaterMark } = require_state2();
131362
127147
  var {
131363
127148
  ERR_INVALID_ARG_TYPE,
131364
127149
  ERR_METHOD_NOT_IMPLEMENTED,
@@ -132411,7 +128196,7 @@ var require_transform = __commonJS((exports, module) => {
132411
128196
  module.exports = Transform;
132412
128197
  var { ERR_METHOD_NOT_IMPLEMENTED } = require_errors2().codes;
132413
128198
  var Duplex = require_duplex();
132414
- var { getHighWaterMark } = require_state3();
128199
+ var { getHighWaterMark } = require_state2();
132415
128200
  ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype);
132416
128201
  ObjectSetPrototypeOf(Transform, Duplex);
132417
128202
  var kCallback = Symbol2("kCallback");
@@ -133546,7 +129331,7 @@ var require_stream = __commonJS((exports, module) => {
133546
129331
  codes: { ERR_ILLEGAL_CONSTRUCTOR }
133547
129332
  } = require_errors2();
133548
129333
  var compose = require_compose();
133549
- var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state3();
129334
+ var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state2();
133550
129335
  var { pipeline } = require_pipeline();
133551
129336
  var { destroyer } = require_destroy();
133552
129337
  var eos = require_end_of_stream2();
@@ -137644,7 +133429,7 @@ var import_picocolors20 = __toESM(require_picocolors2(), 1);
137644
133429
  // package.json
137645
133430
  var package_default = {
137646
133431
  name: "codecane",
137647
- version: "1.0.274",
133432
+ version: "1.0.275",
137648
133433
  description: "AI dev assistant",
137649
133434
  license: "MIT",
137650
133435
  main: "dist/index.js",
@@ -137938,7 +133723,7 @@ var CREDENTIALS_PATH = path2.join(CONFIG_DIR, "credentials.json");
137938
133723
  import { mkdirSync as mkdirSync2 } from "fs";
137939
133724
  import path8, { dirname as dirname2 } from "path";
137940
133725
  import { format as stringFormat } from "util";
137941
- var import_pino = __toESM(require_pino(), 1);
133726
+ import pino from "pino";
137942
133727
 
137943
133728
  // src/project-files.ts
137944
133729
  import { exec } from "child_process";
@@ -139626,7 +135411,7 @@ function setLogPath(p) {
139626
135411
  }
139627
135412
  logPath = p;
139628
135413
  mkdirSync2(dirname2(p), { recursive: true });
139629
- pinoLogger = import_pino.default({
135414
+ pinoLogger = pino({
139630
135415
  level: "debug",
139631
135416
  formatters: {
139632
135417
  level: (label) => {
@@ -139634,7 +135419,7 @@ function setLogPath(p) {
139634
135419
  }
139635
135420
  },
139636
135421
  timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`
139637
- }, import_pino.default.transport({
135422
+ }, pino.transport({
139638
135423
  target: "pino/file",
139639
135424
  options: { destination: p },
139640
135425
  level: "debug"