apitally 0.21.0 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/adonisjs/configure.cjs +6 -1
  2. package/dist/adonisjs/configure.cjs.map +1 -1
  3. package/dist/adonisjs/configure.js +6 -1
  4. package/dist/adonisjs/configure.js.map +1 -1
  5. package/dist/adonisjs/index.cjs +6 -1
  6. package/dist/adonisjs/index.cjs.map +1 -1
  7. package/dist/adonisjs/index.js +6 -1
  8. package/dist/adonisjs/index.js.map +1 -1
  9. package/dist/adonisjs/provider.cjs +487 -601
  10. package/dist/adonisjs/provider.cjs.map +1 -1
  11. package/dist/adonisjs/provider.js +487 -601
  12. package/dist/adonisjs/provider.js.map +1 -1
  13. package/dist/adonisjs/stubs/config/apitally.stub +9 -0
  14. package/dist/elysia/plugin.d.cts +3 -0
  15. package/dist/elysia/plugin.d.ts +3 -0
  16. package/dist/express/index.cjs +481 -595
  17. package/dist/express/index.cjs.map +1 -1
  18. package/dist/express/index.js +481 -595
  19. package/dist/express/index.js.map +1 -1
  20. package/dist/express/middleware.cjs +481 -595
  21. package/dist/express/middleware.cjs.map +1 -1
  22. package/dist/express/middleware.js +481 -595
  23. package/dist/express/middleware.js.map +1 -1
  24. package/dist/fastify/index.cjs +481 -595
  25. package/dist/fastify/index.cjs.map +1 -1
  26. package/dist/fastify/index.js +481 -595
  27. package/dist/fastify/index.js.map +1 -1
  28. package/dist/fastify/plugin.cjs +481 -595
  29. package/dist/fastify/plugin.cjs.map +1 -1
  30. package/dist/fastify/plugin.js +481 -595
  31. package/dist/fastify/plugin.js.map +1 -1
  32. package/dist/hapi/index.cjs +487 -601
  33. package/dist/hapi/index.cjs.map +1 -1
  34. package/dist/hapi/index.js +487 -601
  35. package/dist/hapi/index.js.map +1 -1
  36. package/dist/hapi/plugin.cjs +487 -601
  37. package/dist/hapi/plugin.cjs.map +1 -1
  38. package/dist/hapi/plugin.js +487 -601
  39. package/dist/hapi/plugin.js.map +1 -1
  40. package/dist/hono/index.cjs +14 -10
  41. package/dist/hono/index.cjs.map +1 -1
  42. package/dist/hono/index.js +14 -10
  43. package/dist/hono/index.js.map +1 -1
  44. package/dist/hono/middleware.cjs +14 -10
  45. package/dist/hono/middleware.cjs.map +1 -1
  46. package/dist/hono/middleware.js +14 -10
  47. package/dist/hono/middleware.js.map +1 -1
  48. package/dist/hono/utils.cjs +14 -10
  49. package/dist/hono/utils.cjs.map +1 -1
  50. package/dist/hono/utils.js +14 -10
  51. package/dist/hono/utils.js.map +1 -1
  52. package/dist/loggers/index.cjs +487 -601
  53. package/dist/loggers/index.cjs.map +1 -1
  54. package/dist/loggers/index.js +487 -601
  55. package/dist/loggers/index.js.map +1 -1
  56. package/dist/loggers/pino.cjs +481 -595
  57. package/dist/loggers/pino.cjs.map +1 -1
  58. package/dist/loggers/pino.js +481 -595
  59. package/dist/loggers/pino.js.map +1 -1
  60. package/dist/nestjs/index.cjs +482 -596
  61. package/dist/nestjs/index.cjs.map +1 -1
  62. package/dist/nestjs/index.js +482 -596
  63. package/dist/nestjs/index.js.map +1 -1
  64. package/package.json +4 -3
@@ -12826,619 +12826,458 @@ var require_caller = __commonJS({
12826
12826
  }
12827
12827
  });
12828
12828
 
12829
- // node_modules/fast-redact/lib/validator.js
12830
- var require_validator = __commonJS({
12831
- "node_modules/fast-redact/lib/validator.js"(exports2, module2) {
12832
- "use strict";
12833
- module2.exports = validator;
12834
- function validator(opts = {}) {
12835
- const { ERR_PATHS_MUST_BE_STRINGS = /* @__PURE__ */ __name(() => "fast-redact - Paths must be (non-empty) strings", "ERR_PATHS_MUST_BE_STRINGS"), ERR_INVALID_PATH = /* @__PURE__ */ __name((s) => `fast-redact \u2013 Invalid path (${s})`, "ERR_INVALID_PATH") } = opts;
12836
- return /* @__PURE__ */ __name(function validate({ paths }) {
12837
- paths.forEach((s) => {
12838
- if (typeof s !== "string") {
12839
- throw Error(ERR_PATHS_MUST_BE_STRINGS());
12829
+ // node_modules/@pinojs/redact/index.js
12830
+ var require_redact = __commonJS({
12831
+ "node_modules/@pinojs/redact/index.js"(exports2, module2) {
12832
+ "use strict";
12833
+ function deepClone(obj) {
12834
+ if (obj === null || typeof obj !== "object") {
12835
+ return obj;
12836
+ }
12837
+ if (obj instanceof Date) {
12838
+ return new Date(obj.getTime());
12839
+ }
12840
+ if (obj instanceof Array) {
12841
+ const cloned = [];
12842
+ for (let i = 0; i < obj.length; i++) {
12843
+ cloned[i] = deepClone(obj[i]);
12844
+ }
12845
+ return cloned;
12846
+ }
12847
+ if (typeof obj === "object") {
12848
+ const cloned = Object.create(Object.getPrototypeOf(obj));
12849
+ for (const key in obj) {
12850
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
12851
+ cloned[key] = deepClone(obj[key]);
12840
12852
  }
12841
- try {
12842
- if (/〇/.test(s)) throw Error();
12843
- const expr = (s[0] === "[" ? "" : ".") + s.replace(/^\*/, "\u3007").replace(/\.\*/g, ".\u3007").replace(/\[\*\]/g, "[\u3007]");
12844
- if (/\n|\r|;/.test(expr)) throw Error();
12845
- if (/\/\*/.test(expr)) throw Error();
12846
- Function(`
12847
- 'use strict'
12848
- const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
12849
- const \u3007 = null;
12850
- o${expr}
12851
- if ([o${expr}].length !== 1) throw Error()`)();
12852
- } catch (e) {
12853
- throw Error(ERR_INVALID_PATH(s));
12853
+ }
12854
+ return cloned;
12855
+ }
12856
+ return obj;
12857
+ }
12858
+ __name(deepClone, "deepClone");
12859
+ function parsePath(path) {
12860
+ const parts = [];
12861
+ let current = "";
12862
+ let inBrackets = false;
12863
+ let inQuotes = false;
12864
+ let quoteChar = "";
12865
+ for (let i = 0; i < path.length; i++) {
12866
+ const char = path[i];
12867
+ if (!inBrackets && char === ".") {
12868
+ if (current) {
12869
+ parts.push(current);
12870
+ current = "";
12871
+ }
12872
+ } else if (char === "[") {
12873
+ if (current) {
12874
+ parts.push(current);
12875
+ current = "";
12876
+ }
12877
+ inBrackets = true;
12878
+ } else if (char === "]" && inBrackets) {
12879
+ parts.push(current);
12880
+ current = "";
12881
+ inBrackets = false;
12882
+ inQuotes = false;
12883
+ } else if ((char === '"' || char === "'") && inBrackets) {
12884
+ if (!inQuotes) {
12885
+ inQuotes = true;
12886
+ quoteChar = char;
12887
+ } else if (char === quoteChar) {
12888
+ inQuotes = false;
12889
+ quoteChar = "";
12890
+ } else {
12891
+ current += char;
12854
12892
  }
12855
- });
12856
- }, "validate");
12857
- }
12858
- __name(validator, "validator");
12859
- }
12860
- });
12861
-
12862
- // node_modules/fast-redact/lib/rx.js
12863
- var require_rx = __commonJS({
12864
- "node_modules/fast-redact/lib/rx.js"(exports2, module2) {
12865
- "use strict";
12866
- module2.exports = /[^.[\]]+|\[((?:.)*?)\]/g;
12867
- }
12868
- });
12869
-
12870
- // node_modules/fast-redact/lib/parse.js
12871
- var require_parse = __commonJS({
12872
- "node_modules/fast-redact/lib/parse.js"(exports2, module2) {
12873
- "use strict";
12874
- var rx = require_rx();
12875
- module2.exports = parse;
12876
- function parse({ paths }) {
12877
- const wildcards = [];
12878
- var wcLen = 0;
12879
- const secret = paths.reduce(function(o, strPath, ix) {
12880
- var path = strPath.match(rx).map((p) => p.replace(/'|"|`/g, ""));
12881
- const leadingBracket = strPath[0] === "[";
12882
- path = path.map((p) => {
12883
- if (p[0] === "[") return p.substr(1, p.length - 2);
12884
- else return p;
12885
- });
12886
- const star = path.indexOf("*");
12887
- if (star > -1) {
12888
- const before = path.slice(0, star);
12889
- const beforeStr = before.join(".");
12890
- const after = path.slice(star + 1, path.length);
12891
- const nested = after.length > 0;
12892
- wcLen++;
12893
- wildcards.push({
12894
- before,
12895
- beforeStr,
12896
- after,
12897
- nested
12898
- });
12899
12893
  } else {
12900
- o[strPath] = {
12901
- path,
12902
- val: void 0,
12903
- precensored: false,
12904
- circle: "",
12905
- escPath: JSON.stringify(strPath),
12906
- leadingBracket
12907
- };
12894
+ current += char;
12908
12895
  }
12909
- return o;
12910
- }, {});
12911
- return {
12912
- wildcards,
12913
- wcLen,
12914
- secret
12915
- };
12896
+ }
12897
+ if (current) {
12898
+ parts.push(current);
12899
+ }
12900
+ return parts;
12916
12901
  }
12917
- __name(parse, "parse");
12918
- }
12919
- });
12920
-
12921
- // node_modules/fast-redact/lib/redactor.js
12922
- var require_redactor = __commonJS({
12923
- "node_modules/fast-redact/lib/redactor.js"(exports2, module2) {
12924
- "use strict";
12925
- var rx = require_rx();
12926
- module2.exports = redactor;
12927
- function redactor({ secret, serialize, wcLen, strict, isCensorFct, censorFctTakesPath }, state) {
12928
- const redact = Function("o", `
12929
- if (typeof o !== 'object' || o == null) {
12930
- ${strictImpl(strict, serialize)}
12931
- }
12932
- const { censor, secret } = this
12933
- const originalSecret = {}
12934
- const secretKeys = Object.keys(secret)
12935
- for (var i = 0; i < secretKeys.length; i++) {
12936
- originalSecret[secretKeys[i]] = secret[secretKeys[i]]
12937
- }
12938
-
12939
- ${redactTmpl(secret, isCensorFct, censorFctTakesPath)}
12940
- this.compileRestore()
12941
- ${dynamicRedactTmpl(wcLen > 0, isCensorFct, censorFctTakesPath)}
12942
- this.secret = originalSecret
12943
- ${resultTmpl(serialize)}
12944
- `).bind(state);
12945
- redact.state = state;
12946
- if (serialize === false) {
12947
- redact.restore = (o) => state.restore(o);
12948
- }
12949
- return redact;
12950
- }
12951
- __name(redactor, "redactor");
12952
- function redactTmpl(secret, isCensorFct, censorFctTakesPath) {
12953
- return Object.keys(secret).map((path) => {
12954
- const { escPath, leadingBracket, path: arrPath } = secret[path];
12955
- const skip = leadingBracket ? 1 : 0;
12956
- const delim = leadingBracket ? "" : ".";
12957
- const hops = [];
12958
- var match;
12959
- while ((match = rx.exec(path)) !== null) {
12960
- const [, ix] = match;
12961
- const { index, input } = match;
12962
- if (index > skip) hops.push(input.substring(0, index - (ix ? 0 : 1)));
12963
- }
12964
- var existence = hops.map((p) => `o${delim}${p}`).join(" && ");
12965
- if (existence.length === 0) existence += `o${delim}${path} != null`;
12966
- else existence += ` && o${delim}${path} != null`;
12967
- const circularDetection = `
12968
- switch (true) {
12969
- ${hops.reverse().map((p) => `
12970
- case o${delim}${p} === censor:
12971
- secret[${escPath}].circle = ${JSON.stringify(p)}
12972
- break
12973
- `).join("\n")}
12974
- }
12975
- `;
12976
- const censorArgs = censorFctTakesPath ? `val, ${JSON.stringify(arrPath)}` : `val`;
12977
- return `
12978
- if (${existence}) {
12979
- const val = o${delim}${path}
12980
- if (val === censor) {
12981
- secret[${escPath}].precensored = true
12982
- } else {
12983
- secret[${escPath}].val = val
12984
- o${delim}${path} = ${isCensorFct ? `censor(${censorArgs})` : "censor"}
12985
- ${circularDetection}
12902
+ __name(parsePath, "parsePath");
12903
+ function setValue(obj, parts, value) {
12904
+ let current = obj;
12905
+ for (let i = 0; i < parts.length - 1; i++) {
12906
+ const key = parts[i];
12907
+ if (typeof current !== "object" || current === null || !(key in current)) {
12908
+ return false;
12986
12909
  }
12910
+ if (typeof current[key] !== "object" || current[key] === null) {
12911
+ return false;
12912
+ }
12913
+ current = current[key];
12987
12914
  }
12988
- `;
12989
- }).join("\n");
12990
- }
12991
- __name(redactTmpl, "redactTmpl");
12992
- function dynamicRedactTmpl(hasWildcards, isCensorFct, censorFctTakesPath) {
12993
- return hasWildcards === true ? `
12994
- {
12995
- const { wildcards, wcLen, groupRedact, nestedRedact } = this
12996
- for (var i = 0; i < wcLen; i++) {
12997
- const { before, beforeStr, after, nested } = wildcards[i]
12998
- if (nested === true) {
12999
- secret[beforeStr] = secret[beforeStr] || []
13000
- nestedRedact(secret[beforeStr], o, before, after, censor, ${isCensorFct}, ${censorFctTakesPath})
13001
- } else secret[beforeStr] = groupRedact(o, before, censor, ${isCensorFct}, ${censorFctTakesPath})
12915
+ const lastKey = parts[parts.length - 1];
12916
+ if (lastKey === "*") {
12917
+ if (Array.isArray(current)) {
12918
+ for (let i = 0; i < current.length; i++) {
12919
+ current[i] = value;
12920
+ }
12921
+ } else if (typeof current === "object" && current !== null) {
12922
+ for (const key in current) {
12923
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
12924
+ current[key] = value;
12925
+ }
12926
+ }
12927
+ }
12928
+ } else {
12929
+ if (typeof current === "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) {
12930
+ current[lastKey] = value;
12931
+ }
13002
12932
  }
12933
+ return true;
13003
12934
  }
13004
- ` : "";
12935
+ __name(setValue, "setValue");
12936
+ function removeKey(obj, parts) {
12937
+ let current = obj;
12938
+ for (let i = 0; i < parts.length - 1; i++) {
12939
+ const key = parts[i];
12940
+ if (typeof current !== "object" || current === null || !(key in current)) {
12941
+ return false;
12942
+ }
12943
+ if (typeof current[key] !== "object" || current[key] === null) {
12944
+ return false;
12945
+ }
12946
+ current = current[key];
12947
+ }
12948
+ const lastKey = parts[parts.length - 1];
12949
+ if (lastKey === "*") {
12950
+ if (Array.isArray(current)) {
12951
+ for (let i = 0; i < current.length; i++) {
12952
+ current[i] = void 0;
12953
+ }
12954
+ } else if (typeof current === "object" && current !== null) {
12955
+ for (const key in current) {
12956
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
12957
+ delete current[key];
12958
+ }
12959
+ }
12960
+ }
12961
+ } else {
12962
+ if (typeof current === "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) {
12963
+ delete current[lastKey];
12964
+ }
12965
+ }
12966
+ return true;
13005
12967
  }
13006
- __name(dynamicRedactTmpl, "dynamicRedactTmpl");
13007
- function resultTmpl(serialize) {
13008
- return serialize === false ? `return o` : `
13009
- var s = this.serialize(o)
13010
- this.restore(o)
13011
- return s
13012
- `;
12968
+ __name(removeKey, "removeKey");
12969
+ var PATH_NOT_FOUND = Symbol("PATH_NOT_FOUND");
12970
+ function getValueIfExists(obj, parts) {
12971
+ let current = obj;
12972
+ for (const part of parts) {
12973
+ if (current === null || current === void 0) {
12974
+ return PATH_NOT_FOUND;
12975
+ }
12976
+ if (typeof current !== "object" || current === null) {
12977
+ return PATH_NOT_FOUND;
12978
+ }
12979
+ if (!(part in current)) {
12980
+ return PATH_NOT_FOUND;
12981
+ }
12982
+ current = current[part];
12983
+ }
12984
+ return current;
13013
12985
  }
13014
- __name(resultTmpl, "resultTmpl");
13015
- function strictImpl(strict, serialize) {
13016
- return strict === true ? `throw Error('fast-redact: primitives cannot be redacted')` : serialize === false ? `return o` : `return this.serialize(o)`;
12986
+ __name(getValueIfExists, "getValueIfExists");
12987
+ function getValue(obj, parts) {
12988
+ let current = obj;
12989
+ for (const part of parts) {
12990
+ if (current === null || current === void 0) {
12991
+ return void 0;
12992
+ }
12993
+ if (typeof current !== "object" || current === null) {
12994
+ return void 0;
12995
+ }
12996
+ current = current[part];
12997
+ }
12998
+ return current;
13017
12999
  }
13018
- __name(strictImpl, "strictImpl");
13019
- }
13020
- });
13021
-
13022
- // node_modules/fast-redact/lib/modifiers.js
13023
- var require_modifiers = __commonJS({
13024
- "node_modules/fast-redact/lib/modifiers.js"(exports2, module2) {
13025
- "use strict";
13026
- module2.exports = {
13027
- groupRedact,
13028
- groupRestore,
13029
- nestedRedact,
13030
- nestedRestore
13031
- };
13032
- function groupRestore({ keys, values, target }) {
13033
- if (target == null || typeof target === "string") return;
13034
- const length = keys.length;
13035
- for (var i = 0; i < length; i++) {
13036
- const k = keys[i];
13037
- target[k] = values[i];
13038
- }
13039
- }
13040
- __name(groupRestore, "groupRestore");
13041
- function groupRedact(o, path, censor, isCensorFct, censorFctTakesPath) {
13042
- const target = get(o, path);
13043
- if (target == null || typeof target === "string") return {
13044
- keys: null,
13045
- values: null,
13046
- target,
13047
- flat: true
13048
- };
13049
- const keys = Object.keys(target);
13050
- const keysLength = keys.length;
13051
- const pathLength = path.length;
13052
- const pathWithKey = censorFctTakesPath ? [
13053
- ...path
13054
- ] : void 0;
13055
- const values = new Array(keysLength);
13056
- for (var i = 0; i < keysLength; i++) {
13057
- const key = keys[i];
13058
- values[i] = target[key];
13059
- if (censorFctTakesPath) {
13060
- pathWithKey[pathLength] = key;
13061
- target[key] = censor(target[key], pathWithKey);
13062
- } else if (isCensorFct) {
13063
- target[key] = censor(target[key]);
13000
+ __name(getValue, "getValue");
13001
+ function redactPaths(obj, paths, censor, remove = false) {
13002
+ for (const path of paths) {
13003
+ const parts = parsePath(path);
13004
+ if (parts.includes("*")) {
13005
+ redactWildcardPath(obj, parts, censor, path, remove);
13064
13006
  } else {
13065
- target[key] = censor;
13007
+ if (remove) {
13008
+ removeKey(obj, parts);
13009
+ } else {
13010
+ const value = getValueIfExists(obj, parts);
13011
+ if (value === PATH_NOT_FOUND) {
13012
+ continue;
13013
+ }
13014
+ const actualCensor = typeof censor === "function" ? censor(value, parts) : censor;
13015
+ setValue(obj, parts, actualCensor);
13016
+ }
13066
13017
  }
13067
13018
  }
13068
- return {
13069
- keys,
13070
- values,
13071
- target,
13072
- flat: true
13073
- };
13074
13019
  }
13075
- __name(groupRedact, "groupRedact");
13076
- function nestedRestore(instructions) {
13077
- for (let i = 0; i < instructions.length; i++) {
13078
- const { target, path, value } = instructions[i];
13079
- let current = target;
13080
- for (let i2 = path.length - 1; i2 > 0; i2--) {
13081
- current = current[path[i2]];
13082
- }
13083
- current[path[0]] = value;
13084
- }
13085
- }
13086
- __name(nestedRestore, "nestedRestore");
13087
- function nestedRedact(store, o, path, ns, censor, isCensorFct, censorFctTakesPath) {
13088
- const target = get(o, path);
13089
- if (target == null) return;
13090
- const keys = Object.keys(target);
13091
- const keysLength = keys.length;
13092
- for (var i = 0; i < keysLength; i++) {
13093
- const key = keys[i];
13094
- specialSet(store, target, key, path, ns, censor, isCensorFct, censorFctTakesPath);
13095
- }
13096
- return store;
13097
- }
13098
- __name(nestedRedact, "nestedRedact");
13099
- function has(obj, prop) {
13100
- return obj !== void 0 && obj !== null ? "hasOwn" in Object ? Object.hasOwn(obj, prop) : Object.prototype.hasOwnProperty.call(obj, prop) : false;
13101
- }
13102
- __name(has, "has");
13103
- function specialSet(store, o, k, path, afterPath, censor, isCensorFct, censorFctTakesPath) {
13104
- const afterPathLen = afterPath.length;
13105
- const lastPathIndex = afterPathLen - 1;
13106
- const originalKey = k;
13107
- var i = -1;
13108
- var n;
13109
- var nv;
13110
- var ov;
13111
- var oov = null;
13112
- var wc = null;
13113
- var kIsWc;
13114
- var wcov;
13115
- var consecutive = false;
13116
- var level = 0;
13117
- var depth = 0;
13118
- var redactPathCurrent = tree();
13119
- ov = n = o[k];
13120
- if (typeof n !== "object") return;
13121
- while (n != null && ++i < afterPathLen) {
13122
- depth += 1;
13123
- k = afterPath[i];
13124
- oov = ov;
13125
- if (k !== "*" && !wc && !(typeof n === "object" && k in n)) {
13126
- break;
13020
+ __name(redactPaths, "redactPaths");
13021
+ function redactWildcardPath(obj, parts, censor, originalPath, remove = false) {
13022
+ const wildcardIndex = parts.indexOf("*");
13023
+ if (wildcardIndex === parts.length - 1) {
13024
+ const parentParts = parts.slice(0, -1);
13025
+ let current = obj;
13026
+ for (const part of parentParts) {
13027
+ if (current === null || current === void 0) return;
13028
+ if (typeof current !== "object" || current === null) return;
13029
+ current = current[part];
13127
13030
  }
13128
- if (k === "*") {
13129
- if (wc === "*") {
13130
- consecutive = true;
13031
+ if (Array.isArray(current)) {
13032
+ if (remove) {
13033
+ for (let i = 0; i < current.length; i++) {
13034
+ current[i] = void 0;
13035
+ }
13036
+ } else {
13037
+ for (let i = 0; i < current.length; i++) {
13038
+ const indexPath = [
13039
+ ...parentParts,
13040
+ i.toString()
13041
+ ];
13042
+ const actualCensor = typeof censor === "function" ? censor(current[i], indexPath) : censor;
13043
+ current[i] = actualCensor;
13044
+ }
13131
13045
  }
13132
- wc = k;
13133
- if (i !== lastPathIndex) {
13134
- continue;
13046
+ } else if (typeof current === "object" && current !== null) {
13047
+ if (remove) {
13048
+ const keysToDelete = [];
13049
+ for (const key in current) {
13050
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
13051
+ keysToDelete.push(key);
13052
+ }
13053
+ }
13054
+ for (const key of keysToDelete) {
13055
+ delete current[key];
13056
+ }
13057
+ } else {
13058
+ for (const key in current) {
13059
+ const keyPath = [
13060
+ ...parentParts,
13061
+ key
13062
+ ];
13063
+ const actualCensor = typeof censor === "function" ? censor(current[key], keyPath) : censor;
13064
+ current[key] = actualCensor;
13065
+ }
13135
13066
  }
13136
13067
  }
13137
- if (wc) {
13138
- const wcKeys = Object.keys(n);
13139
- for (var j = 0; j < wcKeys.length; j++) {
13140
- const wck = wcKeys[j];
13141
- wcov = n[wck];
13142
- kIsWc = k === "*";
13143
- if (consecutive) {
13144
- redactPathCurrent = node(redactPathCurrent, wck, depth);
13145
- level = i;
13146
- ov = iterateNthLevel(wcov, level - 1, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, o[originalKey], depth + 1);
13147
- } else {
13148
- if (kIsWc || typeof wcov === "object" && wcov !== null && k in wcov) {
13149
- if (kIsWc) {
13150
- ov = wcov;
13151
- } else {
13152
- ov = wcov[k];
13153
- }
13154
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
13155
- ...path,
13156
- originalKey,
13157
- ...afterPath
13158
- ]) : censor(ov) : censor;
13159
- if (kIsWc) {
13160
- const rv = restoreInstr(node(redactPathCurrent, wck, depth), ov, o[originalKey]);
13161
- store.push(rv);
13162
- n[wck] = nv;
13163
- } else {
13164
- if (wcov[k] === nv) {
13165
- } else if (nv === void 0 && censor !== void 0 || has(wcov, k) && nv === ov) {
13166
- redactPathCurrent = node(redactPathCurrent, wck, depth);
13167
- } else {
13168
- redactPathCurrent = node(redactPathCurrent, wck, depth);
13169
- const rv = restoreInstr(node(redactPathCurrent, k, depth + 1), ov, o[originalKey]);
13170
- store.push(rv);
13171
- wcov[k] = nv;
13172
- }
13173
- }
13174
- }
13068
+ } else {
13069
+ redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove);
13070
+ }
13071
+ }
13072
+ __name(redactWildcardPath, "redactWildcardPath");
13073
+ function redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove = false) {
13074
+ const beforeWildcard = parts.slice(0, wildcardIndex);
13075
+ const afterWildcard = parts.slice(wildcardIndex + 1);
13076
+ const pathArray = [];
13077
+ function traverse(current, pathLength) {
13078
+ if (pathLength === beforeWildcard.length) {
13079
+ if (Array.isArray(current)) {
13080
+ for (let i = 0; i < current.length; i++) {
13081
+ pathArray[pathLength] = i.toString();
13082
+ traverse(current[i], pathLength + 1);
13083
+ }
13084
+ } else if (typeof current === "object" && current !== null) {
13085
+ for (const key in current) {
13086
+ pathArray[pathLength] = key;
13087
+ traverse(current[key], pathLength + 1);
13175
13088
  }
13176
13089
  }
13177
- wc = null;
13090
+ } else if (pathLength < beforeWildcard.length) {
13091
+ const nextKey = beforeWildcard[pathLength];
13092
+ if (current && typeof current === "object" && current !== null && nextKey in current) {
13093
+ pathArray[pathLength] = nextKey;
13094
+ traverse(current[nextKey], pathLength + 1);
13095
+ }
13178
13096
  } else {
13179
- ov = n[k];
13180
- redactPathCurrent = node(redactPathCurrent, k, depth);
13181
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
13182
- ...path,
13183
- originalKey,
13184
- ...afterPath
13185
- ]) : censor(ov) : censor;
13186
- if (has(n, k) && nv === ov || nv === void 0 && censor !== void 0) {
13097
+ if (afterWildcard.includes("*")) {
13098
+ const wrappedCensor = typeof censor === "function" ? (value, path) => {
13099
+ const fullPath = [
13100
+ ...pathArray.slice(0, pathLength),
13101
+ ...path
13102
+ ];
13103
+ return censor(value, fullPath);
13104
+ } : censor;
13105
+ redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
13187
13106
  } else {
13188
- const rv = restoreInstr(redactPathCurrent, ov, o[originalKey]);
13189
- store.push(rv);
13190
- n[k] = nv;
13107
+ if (remove) {
13108
+ removeKey(current, afterWildcard);
13109
+ } else {
13110
+ const actualCensor = typeof censor === "function" ? censor(getValue(current, afterWildcard), [
13111
+ ...pathArray.slice(0, pathLength),
13112
+ ...afterWildcard
13113
+ ]) : censor;
13114
+ setValue(current, afterWildcard, actualCensor);
13115
+ }
13191
13116
  }
13192
- n = n[k];
13193
13117
  }
13194
- if (typeof n !== "object") break;
13195
- if (ov === oov || typeof ov === "undefined") {
13118
+ }
13119
+ __name(traverse, "traverse");
13120
+ if (beforeWildcard.length === 0) {
13121
+ traverse(obj, 0);
13122
+ } else {
13123
+ let current = obj;
13124
+ for (let i = 0; i < beforeWildcard.length; i++) {
13125
+ const part = beforeWildcard[i];
13126
+ if (current === null || current === void 0) return;
13127
+ if (typeof current !== "object" || current === null) return;
13128
+ current = current[part];
13129
+ pathArray[i] = part;
13130
+ }
13131
+ if (current !== null && current !== void 0) {
13132
+ traverse(current, beforeWildcard.length);
13133
+ }
13134
+ }
13135
+ }
13136
+ __name(redactIntermediateWildcard, "redactIntermediateWildcard");
13137
+ function buildPathStructure(pathsToClone) {
13138
+ if (pathsToClone.length === 0) {
13139
+ return null;
13140
+ }
13141
+ const pathStructure = /* @__PURE__ */ new Map();
13142
+ for (const path of pathsToClone) {
13143
+ const parts = parsePath(path);
13144
+ let current = pathStructure;
13145
+ for (let i = 0; i < parts.length; i++) {
13146
+ const part = parts[i];
13147
+ if (!current.has(part)) {
13148
+ current.set(part, /* @__PURE__ */ new Map());
13149
+ }
13150
+ current = current.get(part);
13196
13151
  }
13197
13152
  }
13153
+ return pathStructure;
13198
13154
  }
13199
- __name(specialSet, "specialSet");
13200
- function get(o, p) {
13201
- var i = -1;
13202
- var l = p.length;
13203
- var n = o;
13204
- while (n != null && ++i < l) {
13205
- n = n[p[i]];
13155
+ __name(buildPathStructure, "buildPathStructure");
13156
+ function selectiveClone(obj, pathStructure) {
13157
+ if (!pathStructure) {
13158
+ return obj;
13206
13159
  }
13207
- return n;
13208
- }
13209
- __name(get, "get");
13210
- function iterateNthLevel(wcov, level, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, parent, depth) {
13211
- if (level === 0) {
13212
- if (kIsWc || typeof wcov === "object" && wcov !== null && k in wcov) {
13213
- if (kIsWc) {
13214
- ov = wcov;
13215
- } else {
13216
- ov = wcov[k];
13160
+ function cloneSelectively(source, pathMap, depth = 0) {
13161
+ if (!pathMap || pathMap.size === 0) {
13162
+ return source;
13163
+ }
13164
+ if (source === null || typeof source !== "object") {
13165
+ return source;
13166
+ }
13167
+ if (source instanceof Date) {
13168
+ return new Date(source.getTime());
13169
+ }
13170
+ if (Array.isArray(source)) {
13171
+ const cloned2 = [];
13172
+ for (let i = 0; i < source.length; i++) {
13173
+ const indexStr = i.toString();
13174
+ if (pathMap.has(indexStr) || pathMap.has("*")) {
13175
+ cloned2[i] = cloneSelectively(source[i], pathMap.get(indexStr) || pathMap.get("*"));
13176
+ } else {
13177
+ cloned2[i] = source[i];
13178
+ }
13217
13179
  }
13218
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
13219
- ...path,
13220
- originalKey,
13221
- ...afterPath
13222
- ]) : censor(ov) : censor;
13223
- if (kIsWc) {
13224
- const rv = restoreInstr(redactPathCurrent, ov, parent);
13225
- store.push(rv);
13226
- n[wck] = nv;
13227
- } else {
13228
- if (wcov[k] === nv) {
13229
- } else if (nv === void 0 && censor !== void 0 || has(wcov, k) && nv === ov) {
13180
+ return cloned2;
13181
+ }
13182
+ const cloned = Object.create(Object.getPrototypeOf(source));
13183
+ for (const key in source) {
13184
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
13185
+ if (pathMap.has(key) || pathMap.has("*")) {
13186
+ cloned[key] = cloneSelectively(source[key], pathMap.get(key) || pathMap.get("*"));
13230
13187
  } else {
13231
- const rv = restoreInstr(node(redactPathCurrent, k, depth + 1), ov, parent);
13232
- store.push(rv);
13233
- wcov[k] = nv;
13188
+ cloned[key] = source[key];
13234
13189
  }
13235
13190
  }
13236
13191
  }
13237
- }
13238
- for (const key in wcov) {
13239
- if (typeof wcov[key] === "object") {
13240
- redactPathCurrent = node(redactPathCurrent, key, depth);
13241
- iterateNthLevel(wcov[key], level - 1, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, parent, depth + 1);
13192
+ return cloned;
13193
+ }
13194
+ __name(cloneSelectively, "cloneSelectively");
13195
+ return cloneSelectively(obj, pathStructure);
13196
+ }
13197
+ __name(selectiveClone, "selectiveClone");
13198
+ function validatePath(path) {
13199
+ if (typeof path !== "string") {
13200
+ throw new Error("Paths must be (non-empty) strings");
13201
+ }
13202
+ if (path === "") {
13203
+ throw new Error("Invalid redaction path ()");
13204
+ }
13205
+ if (path.includes("..")) {
13206
+ throw new Error(`Invalid redaction path (${path})`);
13207
+ }
13208
+ if (path.includes(",")) {
13209
+ throw new Error(`Invalid redaction path (${path})`);
13210
+ }
13211
+ let bracketCount = 0;
13212
+ let inQuotes = false;
13213
+ let quoteChar = "";
13214
+ for (let i = 0; i < path.length; i++) {
13215
+ const char = path[i];
13216
+ if ((char === '"' || char === "'") && bracketCount > 0) {
13217
+ if (!inQuotes) {
13218
+ inQuotes = true;
13219
+ quoteChar = char;
13220
+ } else if (char === quoteChar) {
13221
+ inQuotes = false;
13222
+ quoteChar = "";
13223
+ }
13224
+ } else if (char === "[" && !inQuotes) {
13225
+ bracketCount++;
13226
+ } else if (char === "]" && !inQuotes) {
13227
+ bracketCount--;
13228
+ if (bracketCount < 0) {
13229
+ throw new Error(`Invalid redaction path (${path})`);
13230
+ }
13242
13231
  }
13243
13232
  }
13233
+ if (bracketCount !== 0) {
13234
+ throw new Error(`Invalid redaction path (${path})`);
13235
+ }
13244
13236
  }
13245
- __name(iterateNthLevel, "iterateNthLevel");
13246
- function tree() {
13247
- return {
13248
- parent: null,
13249
- key: null,
13250
- children: [],
13251
- depth: 0
13252
- };
13253
- }
13254
- __name(tree, "tree");
13255
- function node(parent, key, depth) {
13256
- if (parent.depth === depth) {
13257
- return node(parent.parent, key, depth);
13237
+ __name(validatePath, "validatePath");
13238
+ function validatePaths(paths) {
13239
+ if (!Array.isArray(paths)) {
13240
+ throw new TypeError("paths must be an array");
13241
+ }
13242
+ for (const path of paths) {
13243
+ validatePath(path);
13258
13244
  }
13259
- var child = {
13260
- parent,
13261
- key,
13262
- depth,
13263
- children: []
13264
- };
13265
- parent.children.push(child);
13266
- return child;
13267
- }
13268
- __name(node, "node");
13269
- function restoreInstr(node2, value, target) {
13270
- let current = node2;
13271
- const path = [];
13272
- do {
13273
- path.push(current.key);
13274
- current = current.parent;
13275
- } while (current.parent != null);
13276
- return {
13277
- path,
13278
- value,
13279
- target
13280
- };
13281
13245
  }
13282
- __name(restoreInstr, "restoreInstr");
13283
- }
13284
- });
13285
-
13286
- // node_modules/fast-redact/lib/restorer.js
13287
- var require_restorer = __commonJS({
13288
- "node_modules/fast-redact/lib/restorer.js"(exports2, module2) {
13289
- "use strict";
13290
- var { groupRestore, nestedRestore } = require_modifiers();
13291
- module2.exports = restorer;
13292
- function restorer() {
13293
- return /* @__PURE__ */ __name(function compileRestore() {
13294
- if (this.restore) {
13295
- this.restore.state.secret = this.secret;
13296
- return;
13246
+ __name(validatePaths, "validatePaths");
13247
+ function slowRedact(options = {}) {
13248
+ const { paths = [], censor = "[REDACTED]", serialize = JSON.stringify, strict = true, remove = false } = options;
13249
+ validatePaths(paths);
13250
+ const pathStructure = buildPathStructure(paths);
13251
+ return /* @__PURE__ */ __name(function redact(obj) {
13252
+ if (strict && (obj === null || typeof obj !== "object")) {
13253
+ if (obj === null || obj === void 0) {
13254
+ return serialize ? serialize(obj) : obj;
13255
+ }
13256
+ if (typeof obj !== "object") {
13257
+ return serialize ? serialize(obj) : obj;
13258
+ }
13297
13259
  }
13298
- const { secret, wcLen } = this;
13299
- const paths = Object.keys(secret);
13300
- const resetters = resetTmpl(secret, paths);
13301
- const hasWildcards = wcLen > 0;
13302
- const state = hasWildcards ? {
13303
- secret,
13304
- groupRestore,
13305
- nestedRestore
13306
- } : {
13307
- secret
13308
- };
13309
- this.restore = Function("o", restoreTmpl(resetters, paths, hasWildcards)).bind(state);
13310
- this.restore.state = state;
13311
- }, "compileRestore");
13312
- }
13313
- __name(restorer, "restorer");
13314
- function resetTmpl(secret, paths) {
13315
- return paths.map((path) => {
13316
- const { circle, escPath, leadingBracket } = secret[path];
13317
- const delim = leadingBracket ? "" : ".";
13318
- const reset = circle ? `o.${circle} = secret[${escPath}].val` : `o${delim}${path} = secret[${escPath}].val`;
13319
- const clear = `secret[${escPath}].val = undefined`;
13320
- return `
13321
- if (secret[${escPath}].val !== undefined) {
13322
- try { ${reset} } catch (e) {}
13323
- ${clear}
13324
- }
13325
- `;
13326
- }).join("");
13327
- }
13328
- __name(resetTmpl, "resetTmpl");
13329
- function restoreTmpl(resetters, paths, hasWildcards) {
13330
- const dynamicReset = hasWildcards === true ? `
13331
- const keys = Object.keys(secret)
13332
- const len = keys.length
13333
- for (var i = len - 1; i >= ${paths.length}; i--) {
13334
- const k = keys[i]
13335
- const o = secret[k]
13336
- if (o) {
13337
- if (o.flat === true) this.groupRestore(o)
13338
- else this.nestedRestore(o)
13339
- secret[k] = null
13340
- }
13341
- }
13342
- ` : "";
13343
- return `
13344
- const secret = this.secret
13345
- ${dynamicReset}
13346
- ${resetters}
13347
- return o
13348
- `;
13349
- }
13350
- __name(restoreTmpl, "restoreTmpl");
13351
- }
13352
- });
13353
-
13354
- // node_modules/fast-redact/lib/state.js
13355
- var require_state = __commonJS({
13356
- "node_modules/fast-redact/lib/state.js"(exports2, module2) {
13357
- "use strict";
13358
- module2.exports = state;
13359
- function state(o) {
13360
- const { secret, censor, compileRestore, serialize, groupRedact, nestedRedact, wildcards, wcLen } = o;
13361
- const builder = [
13362
- {
13363
- secret,
13364
- censor,
13365
- compileRestore
13260
+ const cloned = selectiveClone(obj, pathStructure);
13261
+ const original = obj;
13262
+ let actualCensor = censor;
13263
+ if (typeof censor === "function") {
13264
+ actualCensor = censor;
13366
13265
  }
13367
- ];
13368
- if (serialize !== false) builder.push({
13369
- serialize
13370
- });
13371
- if (wcLen > 0) builder.push({
13372
- groupRedact,
13373
- nestedRedact,
13374
- wildcards,
13375
- wcLen
13376
- });
13377
- return Object.assign(...builder);
13378
- }
13379
- __name(state, "state");
13380
- }
13381
- });
13382
-
13383
- // node_modules/fast-redact/index.js
13384
- var require_fast_redact = __commonJS({
13385
- "node_modules/fast-redact/index.js"(exports2, module2) {
13386
- "use strict";
13387
- var validator = require_validator();
13388
- var parse = require_parse();
13389
- var redactor = require_redactor();
13390
- var restorer = require_restorer();
13391
- var { groupRedact, nestedRedact } = require_modifiers();
13392
- var state = require_state();
13393
- var rx = require_rx();
13394
- var validate = validator();
13395
- var noop = /* @__PURE__ */ __name((o) => o, "noop");
13396
- noop.restore = noop;
13397
- var DEFAULT_CENSOR = "[REDACTED]";
13398
- fastRedact.rx = rx;
13399
- fastRedact.validator = validator;
13400
- module2.exports = fastRedact;
13401
- function fastRedact(opts = {}) {
13402
- const paths = Array.from(new Set(opts.paths || []));
13403
- const serialize = "serialize" in opts ? opts.serialize === false ? opts.serialize : typeof opts.serialize === "function" ? opts.serialize : JSON.stringify : JSON.stringify;
13404
- const remove = opts.remove;
13405
- if (remove === true && serialize !== JSON.stringify) {
13406
- throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");
13407
- }
13408
- const censor = remove === true ? void 0 : "censor" in opts ? opts.censor : DEFAULT_CENSOR;
13409
- const isCensorFct = typeof censor === "function";
13410
- const censorFctTakesPath = isCensorFct && censor.length > 1;
13411
- if (paths.length === 0) return serialize || noop;
13412
- validate({
13413
- paths,
13414
- serialize,
13415
- censor
13416
- });
13417
- const { wildcards, wcLen, secret } = parse({
13418
- paths,
13419
- censor
13420
- });
13421
- const compileRestore = restorer();
13422
- const strict = "strict" in opts ? opts.strict : true;
13423
- return redactor({
13424
- secret,
13425
- wcLen,
13426
- serialize,
13427
- strict,
13428
- isCensorFct,
13429
- censorFctTakesPath
13430
- }, state({
13431
- secret,
13432
- censor,
13433
- compileRestore,
13434
- serialize,
13435
- groupRedact,
13436
- nestedRedact,
13437
- wildcards,
13438
- wcLen
13439
- }));
13266
+ redactPaths(cloned, paths, actualCensor, remove);
13267
+ if (serialize === false) {
13268
+ cloned.restore = function() {
13269
+ return deepClone(original);
13270
+ };
13271
+ return cloned;
13272
+ }
13273
+ if (typeof serialize === "function") {
13274
+ return serialize(cloned);
13275
+ }
13276
+ return JSON.stringify(cloned);
13277
+ }, "redact");
13440
13278
  }
13441
- __name(fastRedact, "fastRedact");
13279
+ __name(slowRedact, "slowRedact");
13280
+ module2.exports = slowRedact;
13442
13281
  }
13443
13282
  });
13444
13283
 
@@ -13517,17 +13356,13 @@ var require_symbols = __commonJS({
13517
13356
  var require_redaction = __commonJS({
13518
13357
  "node_modules/pino/lib/redaction.js"(exports2, module2) {
13519
13358
  "use strict";
13520
- var fastRedact = require_fast_redact();
13359
+ var Redact = require_redact();
13521
13360
  var { redactFmtSym, wildcardFirstSym } = require_symbols();
13522
- var { rx, validator } = fastRedact;
13523
- var validate = validator({
13524
- ERR_PATHS_MUST_BE_STRINGS: /* @__PURE__ */ __name(() => "pino \u2013 redacted paths must be strings", "ERR_PATHS_MUST_BE_STRINGS"),
13525
- ERR_INVALID_PATH: /* @__PURE__ */ __name((s) => `pino \u2013 redact paths array contains an invalid path (${s})`, "ERR_INVALID_PATH")
13526
- });
13361
+ var rx = /[^.[\]]+|\[([^[\]]*?)\]/g;
13527
13362
  var CENSOR = "[Redacted]";
13528
13363
  var strict = false;
13529
13364
  function redaction(opts, serialize) {
13530
- const { paths, censor } = handle(opts);
13365
+ const { paths, censor, remove } = handle(opts);
13531
13366
  const shape = paths.reduce((o, str) => {
13532
13367
  rx.lastIndex = 0;
13533
13368
  const first = rx.exec(str);
@@ -13560,11 +13395,12 @@ var require_redaction = __commonJS({
13560
13395
  return o;
13561
13396
  }, {});
13562
13397
  const result = {
13563
- [redactFmtSym]: fastRedact({
13398
+ [redactFmtSym]: Redact({
13564
13399
  paths,
13565
13400
  censor,
13566
13401
  serialize,
13567
- strict
13402
+ strict,
13403
+ remove
13568
13404
  })
13569
13405
  };
13570
13406
  const topCensor = /* @__PURE__ */ __name((...args) => {
@@ -13585,11 +13421,12 @@ var require_redaction = __commonJS({
13585
13421
  ...path
13586
13422
  ]);
13587
13423
  } : censor;
13588
- o[k] = fastRedact({
13424
+ o[k] = Redact({
13589
13425
  paths: shape[k],
13590
13426
  censor: wrappedCensor,
13591
13427
  serialize,
13592
- strict
13428
+ strict,
13429
+ remove
13593
13430
  });
13594
13431
  }
13595
13432
  return o;
@@ -13602,7 +13439,6 @@ var require_redaction = __commonJS({
13602
13439
  paths: opts,
13603
13440
  censor: CENSOR
13604
13441
  };
13605
- validate(opts);
13606
13442
  return opts;
13607
13443
  }
13608
13444
  let { paths, censor = CENSOR, remove } = opts;
@@ -13610,13 +13446,10 @@ var require_redaction = __commonJS({
13610
13446
  throw Error("pino \u2013 redact must contain an array of strings");
13611
13447
  }
13612
13448
  if (remove === true) censor = void 0;
13613
- validate({
13614
- paths,
13615
- censor
13616
- });
13617
13449
  return {
13618
13450
  paths,
13619
- censor
13451
+ censor,
13452
+ remove
13620
13453
  };
13621
13454
  }
13622
13455
  __name(handle, "handle");
@@ -13632,11 +13465,31 @@ var require_time = __commonJS({
13632
13465
  var epochTime = /* @__PURE__ */ __name(() => `,"time":${Date.now()}`, "epochTime");
13633
13466
  var unixTime = /* @__PURE__ */ __name(() => `,"time":${Math.round(Date.now() / 1e3)}`, "unixTime");
13634
13467
  var isoTime = /* @__PURE__ */ __name(() => `,"time":"${new Date(Date.now()).toISOString()}"`, "isoTime");
13468
+ var NS_PER_MS = 1000000n;
13469
+ var NS_PER_SEC = 1000000000n;
13470
+ var startWallTimeNs = BigInt(Date.now()) * NS_PER_MS;
13471
+ var startHrTime = process.hrtime.bigint();
13472
+ var isoTimeNano = /* @__PURE__ */ __name(() => {
13473
+ const elapsedNs = process.hrtime.bigint() - startHrTime;
13474
+ const currentTimeNs = startWallTimeNs + elapsedNs;
13475
+ const secondsSinceEpoch = currentTimeNs / NS_PER_SEC;
13476
+ const nanosWithinSecond = currentTimeNs % NS_PER_SEC;
13477
+ const msSinceEpoch = Number(secondsSinceEpoch * 1000n + nanosWithinSecond / 1000000n);
13478
+ const date = new Date(msSinceEpoch);
13479
+ const year = date.getUTCFullYear();
13480
+ const month = (date.getUTCMonth() + 1).toString().padStart(2, "0");
13481
+ const day = date.getUTCDate().toString().padStart(2, "0");
13482
+ const hours = date.getUTCHours().toString().padStart(2, "0");
13483
+ const minutes = date.getUTCMinutes().toString().padStart(2, "0");
13484
+ const seconds = date.getUTCSeconds().toString().padStart(2, "0");
13485
+ return `,"time":"${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${nanosWithinSecond.toString().padStart(9, "0")}Z"`;
13486
+ }, "isoTimeNano");
13635
13487
  module2.exports = {
13636
13488
  nullTime,
13637
13489
  epochTime,
13638
13490
  unixTime,
13639
- isoTime
13491
+ isoTime,
13492
+ isoTimeNano
13640
13493
  };
13641
13494
  }
13642
13495
  });
@@ -15220,6 +15073,7 @@ var require_transport = __commonJS({
15220
15073
  var require_tools = __commonJS({
15221
15074
  "node_modules/pino/lib/tools.js"(exports2, module2) {
15222
15075
  "use strict";
15076
+ var diagChan = require("diagnostics_channel");
15223
15077
  var format5 = require_quick_format_unescaped();
15224
15078
  var { mapHttpRequest, mapHttpResponse } = require_pino_std_serializers();
15225
15079
  var SonicBoom = require_sonic_boom();
@@ -15227,6 +15081,17 @@ var require_tools = __commonJS({
15227
15081
  var { lsCacheSym, chindingsSym, writeSym, serializersSym, formatOptsSym, endSym, stringifiersSym, stringifySym, stringifySafeSym, wildcardFirstSym, nestedKeySym, formattersSym, messageKeySym, errorKeySym, nestedKeyStrSym, msgPrefixSym } = require_symbols();
15228
15082
  var { isMainThread } = require("worker_threads");
15229
15083
  var transport = require_transport();
15084
+ var asJsonChan;
15085
+ if (typeof diagChan.tracingChannel === "function") {
15086
+ asJsonChan = diagChan.tracingChannel("pino_asJson");
15087
+ } else {
15088
+ asJsonChan = {
15089
+ hasSubscribers: false,
15090
+ traceSync(fn, store, thisArg, ...args) {
15091
+ return fn.call(thisArg, ...args);
15092
+ }
15093
+ };
15094
+ }
15230
15095
  function noop() {
15231
15096
  }
15232
15097
  __name(noop, "noop");
@@ -15295,6 +15160,17 @@ var require_tools = __commonJS({
15295
15160
  }
15296
15161
  __name(asString, "asString");
15297
15162
  function asJson(obj, msg, num, time) {
15163
+ if (asJsonChan.hasSubscribers === false) {
15164
+ return _asJson.call(this, obj, msg, num, time);
15165
+ }
15166
+ const store = {
15167
+ instance: this,
15168
+ arguments
15169
+ };
15170
+ return asJsonChan.traceSync(_asJson, store, this, obj, msg, num, time);
15171
+ }
15172
+ __name(asJson, "asJson");
15173
+ function _asJson(obj, msg, num, time) {
15298
15174
  const stringify2 = this[stringifySym];
15299
15175
  const stringifySafe = this[stringifySafeSym];
15300
15176
  const stringifiers = this[stringifiersSym];
@@ -15375,7 +15251,7 @@ var require_tools = __commonJS({
15375
15251
  return data + propStr + msgStr + end;
15376
15252
  }
15377
15253
  }
15378
- __name(asJson, "asJson");
15254
+ __name(_asJson, "_asJson");
15379
15255
  function asChindings(instance, bindings) {
15380
15256
  let value;
15381
15257
  let data = instance[chindingsSym];
@@ -15388,7 +15264,7 @@ var require_tools = __commonJS({
15388
15264
  bindings = formatter(bindings);
15389
15265
  for (const key in bindings) {
15390
15266
  value = bindings[key];
15391
- const valid = key !== "level" && key !== "serializers" && key !== "formatters" && key !== "customLevels" && bindings.hasOwnProperty(key) && value !== void 0;
15267
+ const valid = (key.length < 5 || key !== "level" && key !== "serializers" && key !== "formatters" && key !== "customLevels") && bindings.hasOwnProperty(key) && value !== void 0;
15392
15268
  if (valid === true) {
15393
15269
  value = serializers[key] ? serializers[key](value) : value;
15394
15270
  value = (stringifiers[key] || wildcardStringifier || stringify2)(value, stringifySafe);
@@ -15762,7 +15638,7 @@ var require_meta = __commonJS({
15762
15638
  "node_modules/pino/lib/meta.js"(exports2, module2) {
15763
15639
  "use strict";
15764
15640
  module2.exports = {
15765
- version: "9.9.0"
15641
+ version: "9.14.0"
15766
15642
  };
15767
15643
  }
15768
15644
  });
@@ -15774,7 +15650,7 @@ var require_proto = __commonJS({
15774
15650
  var { EventEmitter } = require("events");
15775
15651
  var { lsCacheSym, levelValSym, setLevelSym, getLevelSym, chindingsSym, parsedChindingsSym, mixinSym, asJsonSym, writeSym, mixinMergeStrategySym, timeSym, timeSliceIndexSym, streamSym, serializersSym, formattersSym, errorKeySym, messageKeySym, useOnlyCustomLevelsSym, needsMetadataGsym, redactFmtSym, stringifySym, formatOptsSym, stringifiersSym, msgPrefixSym, hooksSym } = require_symbols();
15776
15652
  var { getLevel, setLevel, isLevelEnabled, mappings, initialLsCache, genLsCache, assertNoLevelCollisions } = require_levels();
15777
- var { asChindings, asJson, buildFormatters, stringify } = require_tools();
15653
+ var { asChindings, asJson, buildFormatters, stringify, noop } = require_tools();
15778
15654
  var { version } = require_meta();
15779
15655
  var redaction = require_redaction();
15780
15656
  var _a4;
@@ -15803,6 +15679,9 @@ var require_proto = __commonJS({
15803
15679
  get msgPrefix() {
15804
15680
  return this[msgPrefixSym];
15805
15681
  },
15682
+ get [Symbol.toStringTag]() {
15683
+ return "Pino";
15684
+ },
15806
15685
  [lsCacheSym]: initialLsCache,
15807
15686
  [writeSym]: write,
15808
15687
  [asJsonSym]: asJson,
@@ -15818,10 +15697,20 @@ var require_proto = __commonJS({
15818
15697
  if (!bindings2) {
15819
15698
  throw Error("missing bindings for child Pino");
15820
15699
  }
15821
- options = options || {};
15822
15700
  const serializers = this[serializersSym];
15823
15701
  const formatters = this[formattersSym];
15824
15702
  const instance = Object.create(this);
15703
+ if (options == null) {
15704
+ if (instance[formattersSym].bindings !== resetChildingsFormatter) {
15705
+ instance[formattersSym] = buildFormatters(formatters.level, resetChildingsFormatter, formatters.log);
15706
+ }
15707
+ instance[chindingsSym] = asChindings(instance, bindings2);
15708
+ instance[setLevelSym](this.level);
15709
+ if (this.onChild !== noop) {
15710
+ this.onChild(instance);
15711
+ }
15712
+ return instance;
15713
+ }
15825
15714
  if (options.hasOwnProperty("serializers") === true) {
15826
15715
  instance[serializersSym] = /* @__PURE__ */ Object.create(null);
15827
15716
  for (const k in serializers) {
@@ -15929,9 +15818,6 @@ var require_proto = __commonJS({
15929
15818
  stream.write(streamWriteHook ? streamWriteHook(s) : s);
15930
15819
  }
15931
15820
  __name(write, "write");
15932
- function noop() {
15933
- }
15934
- __name(noop, "noop");
15935
15821
  function flush(cb) {
15936
15822
  if (cb != null && typeof cb !== "function") {
15937
15823
  throw Error("callback must be a function");