@autter/runtime-node 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/{chunk-RV4MJNM2.cjs → chunk-37W7YYXO.cjs} +89 -51
- package/dist/{chunk-HKVFURYT.cjs → chunk-7H3FCV4P.cjs} +11 -11
- package/dist/{chunk-LG52CW3V.js → chunk-B5ZMOCEM.js} +15 -1
- package/dist/{chunk-GYTQLITW.cjs → chunk-MOZOUEMA.cjs} +15 -1
- package/dist/{chunk-KA4AOZX2.js → chunk-QKY2OQSO.js} +39 -1
- package/dist/{chunk-QUC6OUE7.js → chunk-UC3QH4PC.js} +1 -1
- package/dist/cli.cjs +8 -8
- package/dist/cli.js +2 -2
- package/dist/index.cjs +186 -164
- package/dist/index.d.cts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +25 -3
- package/dist/{sinks-CPGDyfU8.d.cts → sinks-CIdlmYwy.d.cts} +21 -1
- package/dist/{sinks-CPGDyfU8.d.ts → sinks-CIdlmYwy.d.ts} +21 -1
- package/dist/testing.cjs +8 -8
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
noteCompatFeature,
|
|
3
3
|
observeIngesterResponse,
|
|
4
4
|
sharedSlot
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-B5ZMOCEM.js";
|
|
6
6
|
|
|
7
7
|
// ../runtime-core/dist/index.js
|
|
8
8
|
var SENSITIVE_KEY_PATTERNS = [
|
|
@@ -974,6 +974,43 @@ function splitFingerprint(attributes) {
|
|
|
974
974
|
const { fingerprint, ...rest } = attributes;
|
|
975
975
|
return { attributes: rest, fingerprint };
|
|
976
976
|
}
|
|
977
|
+
function testPattern(pattern, type, message) {
|
|
978
|
+
if (typeof pattern === "string") {
|
|
979
|
+
return pattern !== "" && (message.includes(pattern) || type.includes(pattern));
|
|
980
|
+
}
|
|
981
|
+
if (!(pattern instanceof RegExp)) return false;
|
|
982
|
+
const re = pattern.global || pattern.sticky ? new RegExp(pattern.source, pattern.flags.replace(/[gy]/g, "")) : pattern;
|
|
983
|
+
return re.test(message) || type !== "" && (re.test(type) || re.test(`${type}: ${message}`));
|
|
984
|
+
}
|
|
985
|
+
function isIgnoredError(patterns, type, message) {
|
|
986
|
+
if (!patterns?.length) return false;
|
|
987
|
+
for (const pattern of patterns) {
|
|
988
|
+
try {
|
|
989
|
+
if (testPattern(pattern, type, message)) return true;
|
|
990
|
+
} catch {
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
return false;
|
|
994
|
+
}
|
|
995
|
+
function effectiveSampleRate(rate) {
|
|
996
|
+
return typeof rate === "number" && Number.isFinite(rate) && rate >= 0 && rate < 1 ? rate : null;
|
|
997
|
+
}
|
|
998
|
+
function createErrorFilter(options = {}, random = Math.random) {
|
|
999
|
+
const patterns = Array.isArray(options.ignoreErrors) ? options.ignoreErrors.slice() : [];
|
|
1000
|
+
const rate = effectiveSampleRate(options.sampleRate);
|
|
1001
|
+
if (!patterns.length && rate === null) return () => true;
|
|
1002
|
+
return (input) => {
|
|
1003
|
+
try {
|
|
1004
|
+
if (isIgnoredError(patterns, input.type ?? "", input.message ?? "")) return false;
|
|
1005
|
+
if (rate === null || input.crash) return true;
|
|
1006
|
+
const severity = input.severity ?? "error";
|
|
1007
|
+
if (severity !== "error") return true;
|
|
1008
|
+
return random() < rate;
|
|
1009
|
+
} catch {
|
|
1010
|
+
return true;
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
977
1014
|
|
|
978
1015
|
// src/breadcrumbs.ts
|
|
979
1016
|
import { trace as trace2 } from "@opentelemetry/api";
|
|
@@ -1924,6 +1961,7 @@ export {
|
|
|
1924
1961
|
fingerprintValues,
|
|
1925
1962
|
fingerprintEventAttributes,
|
|
1926
1963
|
splitFingerprint,
|
|
1964
|
+
createErrorFilter,
|
|
1927
1965
|
addBreadcrumb,
|
|
1928
1966
|
breadcrumbEventAttributes,
|
|
1929
1967
|
otlpSink,
|
package/dist/cli.cjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunk7H3FCV4Pcjs = require('./chunk-7H3FCV4P.cjs');
|
|
8
|
+
require('./chunk-MOZOUEMA.cjs');
|
|
9
9
|
|
|
10
10
|
// src/cli.ts
|
|
11
11
|
var _child_process = require('child_process');
|
|
@@ -31,22 +31,22 @@ async function main(argv) {
|
|
|
31
31
|
return 64;
|
|
32
32
|
}
|
|
33
33
|
if (command !== "doctor") {
|
|
34
|
-
console.log(
|
|
34
|
+
console.log(_chunk7H3FCV4Pcjs.DOCTOR_USAGE);
|
|
35
35
|
return command === void 0 || command === "--help" || command === "-h" ? 0 : 64;
|
|
36
36
|
}
|
|
37
|
-
const parsed =
|
|
37
|
+
const parsed = _chunk7H3FCV4Pcjs.parseDoctorArgs.call(void 0, rest);
|
|
38
38
|
if ("help" in parsed) {
|
|
39
|
-
console.log(
|
|
39
|
+
console.log(_chunk7H3FCV4Pcjs.DOCTOR_USAGE);
|
|
40
40
|
return 0;
|
|
41
41
|
}
|
|
42
42
|
if ("error" in parsed) {
|
|
43
43
|
console.error(`${parsed.error}
|
|
44
44
|
|
|
45
|
-
${
|
|
45
|
+
${_chunk7H3FCV4Pcjs.DOCTOR_USAGE}`);
|
|
46
46
|
return 64;
|
|
47
47
|
}
|
|
48
|
-
const report = await
|
|
49
|
-
console.log(parsed.json ? JSON.stringify(report, null, 2) :
|
|
48
|
+
const report = await _chunk7H3FCV4Pcjs.runDoctor.call(void 0, parsed);
|
|
49
|
+
console.log(parsed.json ? JSON.stringify(report, null, 2) : _chunk7H3FCV4Pcjs.formatDoctorReport.call(void 0, report));
|
|
50
50
|
return report.exitCode;
|
|
51
51
|
}
|
|
52
52
|
main(process.argv.slice(2)).then(
|
package/dist/cli.js
CHANGED