apitally 0.21.1 → 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.
- package/dist/adonisjs/provider.cjs +441 -603
- package/dist/adonisjs/provider.cjs.map +1 -1
- package/dist/adonisjs/provider.js +441 -603
- package/dist/adonisjs/provider.js.map +1 -1
- package/dist/express/index.cjs +435 -597
- package/dist/express/index.cjs.map +1 -1
- package/dist/express/index.js +435 -597
- package/dist/express/index.js.map +1 -1
- package/dist/express/middleware.cjs +435 -597
- package/dist/express/middleware.cjs.map +1 -1
- package/dist/express/middleware.js +435 -597
- package/dist/express/middleware.js.map +1 -1
- package/dist/fastify/index.cjs +435 -597
- package/dist/fastify/index.cjs.map +1 -1
- package/dist/fastify/index.js +435 -597
- package/dist/fastify/index.js.map +1 -1
- package/dist/fastify/plugin.cjs +435 -597
- package/dist/fastify/plugin.cjs.map +1 -1
- package/dist/fastify/plugin.js +435 -597
- package/dist/fastify/plugin.js.map +1 -1
- package/dist/hapi/index.cjs +441 -603
- package/dist/hapi/index.cjs.map +1 -1
- package/dist/hapi/index.js +441 -603
- package/dist/hapi/index.js.map +1 -1
- package/dist/hapi/plugin.cjs +441 -603
- package/dist/hapi/plugin.cjs.map +1 -1
- package/dist/hapi/plugin.js +441 -603
- package/dist/hapi/plugin.js.map +1 -1
- package/dist/hono/index.cjs +14 -10
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.js +14 -10
- package/dist/hono/index.js.map +1 -1
- package/dist/hono/middleware.cjs +14 -10
- package/dist/hono/middleware.cjs.map +1 -1
- package/dist/hono/middleware.js +14 -10
- package/dist/hono/middleware.js.map +1 -1
- package/dist/hono/utils.cjs +14 -10
- package/dist/hono/utils.cjs.map +1 -1
- package/dist/hono/utils.js +14 -10
- package/dist/hono/utils.js.map +1 -1
- package/dist/loggers/index.cjs +441 -603
- package/dist/loggers/index.cjs.map +1 -1
- package/dist/loggers/index.js +441 -603
- package/dist/loggers/index.js.map +1 -1
- package/dist/loggers/pino.cjs +435 -597
- package/dist/loggers/pino.cjs.map +1 -1
- package/dist/loggers/pino.js +435 -597
- package/dist/loggers/pino.js.map +1 -1
- package/dist/nestjs/index.cjs +436 -598
- package/dist/nestjs/index.cjs.map +1 -1
- package/dist/nestjs/index.js +436 -598
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +2 -2
package/dist/nestjs/index.cjs
CHANGED
|
@@ -12826,619 +12826,458 @@ var require_caller = __commonJS({
|
|
|
12826
12826
|
}
|
|
12827
12827
|
});
|
|
12828
12828
|
|
|
12829
|
-
// node_modules/
|
|
12830
|
-
var
|
|
12831
|
-
"node_modules/
|
|
12832
|
-
"use strict";
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
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
|
-
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12848
|
-
|
|
12849
|
-
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12853
|
-
|
|
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
|
-
|
|
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
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
secret
|
|
12915
|
-
};
|
|
12896
|
+
}
|
|
12897
|
+
if (current) {
|
|
12898
|
+
parts.push(current);
|
|
12899
|
+
}
|
|
12900
|
+
return parts;
|
|
12916
12901
|
}
|
|
12917
|
-
__name(
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
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;
|
|
12909
|
+
}
|
|
12910
|
+
if (typeof current[key] !== "object" || current[key] === null) {
|
|
12911
|
+
return false;
|
|
12986
12912
|
}
|
|
12913
|
+
current = current[key];
|
|
12987
12914
|
}
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
|
|
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(
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
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(
|
|
13015
|
-
function
|
|
13016
|
-
|
|
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(
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
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
|
-
|
|
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(
|
|
13076
|
-
function
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
|
|
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 (
|
|
13129
|
-
if (
|
|
13130
|
-
|
|
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
|
-
|
|
13133
|
-
if (
|
|
13134
|
-
|
|
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
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
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
|
-
|
|
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
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
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
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
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
|
-
|
|
13195
|
-
|
|
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(
|
|
13200
|
-
function
|
|
13201
|
-
|
|
13202
|
-
|
|
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
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
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
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
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
|
-
|
|
13232
|
-
store.push(rv);
|
|
13233
|
-
wcov[k] = nv;
|
|
13188
|
+
cloned[key] = source[key];
|
|
13234
13189
|
}
|
|
13235
13190
|
}
|
|
13236
13191
|
}
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
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(
|
|
13246
|
-
function
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
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(
|
|
13283
|
-
|
|
13284
|
-
}
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
|
|
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
|
|
13299
|
-
const
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
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
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
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(
|
|
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
|
|
13359
|
+
var Redact = require_redact();
|
|
13521
13360
|
var { redactFmtSym, wildcardFirstSym } = require_symbols();
|
|
13522
|
-
var
|
|
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]:
|
|
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] =
|
|
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");
|
|
@@ -15431,7 +15264,7 @@ var require_tools = __commonJS({
|
|
|
15431
15264
|
bindings = formatter(bindings);
|
|
15432
15265
|
for (const key in bindings) {
|
|
15433
15266
|
value = bindings[key];
|
|
15434
|
-
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;
|
|
15435
15268
|
if (valid === true) {
|
|
15436
15269
|
value = serializers[key] ? serializers[key](value) : value;
|
|
15437
15270
|
value = (stringifiers[key] || wildcardStringifier || stringify2)(value, stringifySafe);
|
|
@@ -15805,7 +15638,7 @@ var require_meta = __commonJS({
|
|
|
15805
15638
|
"node_modules/pino/lib/meta.js"(exports2, module2) {
|
|
15806
15639
|
"use strict";
|
|
15807
15640
|
module2.exports = {
|
|
15808
|
-
version: "9.
|
|
15641
|
+
version: "9.14.0"
|
|
15809
15642
|
};
|
|
15810
15643
|
}
|
|
15811
15644
|
});
|
|
@@ -15817,7 +15650,7 @@ var require_proto = __commonJS({
|
|
|
15817
15650
|
var { EventEmitter } = require("events");
|
|
15818
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();
|
|
15819
15652
|
var { getLevel, setLevel, isLevelEnabled, mappings, initialLsCache, genLsCache, assertNoLevelCollisions } = require_levels();
|
|
15820
|
-
var { asChindings, asJson, buildFormatters, stringify } = require_tools();
|
|
15653
|
+
var { asChindings, asJson, buildFormatters, stringify, noop } = require_tools();
|
|
15821
15654
|
var { version } = require_meta();
|
|
15822
15655
|
var redaction = require_redaction();
|
|
15823
15656
|
var _a4;
|
|
@@ -15864,10 +15697,20 @@ var require_proto = __commonJS({
|
|
|
15864
15697
|
if (!bindings2) {
|
|
15865
15698
|
throw Error("missing bindings for child Pino");
|
|
15866
15699
|
}
|
|
15867
|
-
options = options || {};
|
|
15868
15700
|
const serializers = this[serializersSym];
|
|
15869
15701
|
const formatters = this[formattersSym];
|
|
15870
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
|
+
}
|
|
15871
15714
|
if (options.hasOwnProperty("serializers") === true) {
|
|
15872
15715
|
instance[serializersSym] = /* @__PURE__ */ Object.create(null);
|
|
15873
15716
|
for (const k in serializers) {
|
|
@@ -15912,10 +15755,8 @@ var require_proto = __commonJS({
|
|
|
15912
15755
|
instance[msgPrefixSym] = (this[msgPrefixSym] || "") + options.msgPrefix;
|
|
15913
15756
|
}
|
|
15914
15757
|
instance[chindingsSym] = asChindings(instance, bindings2);
|
|
15915
|
-
|
|
15916
|
-
|
|
15917
|
-
instance[setLevelSym](childLevel);
|
|
15918
|
-
}
|
|
15758
|
+
const childLevel = options.level || this.level;
|
|
15759
|
+
instance[setLevelSym](childLevel);
|
|
15919
15760
|
this.onChild(instance);
|
|
15920
15761
|
return instance;
|
|
15921
15762
|
}
|
|
@@ -15977,9 +15818,6 @@ var require_proto = __commonJS({
|
|
|
15977
15818
|
stream.write(streamWriteHook ? streamWriteHook(s) : s);
|
|
15978
15819
|
}
|
|
15979
15820
|
__name(write, "write");
|
|
15980
|
-
function noop() {
|
|
15981
|
-
}
|
|
15982
|
-
__name(noop, "noop");
|
|
15983
15821
|
function flush(cb) {
|
|
15984
15822
|
if (cb != null && typeof cb !== "function") {
|
|
15985
15823
|
throw Error("callback must be a function");
|