autotel 6.4.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -23
- package/dist/{attribute-redacting-processor-Pk7lAzWd.d.cts → attribute-redacting-processor-CvBE0z1p.d.cts} +33 -1
- package/dist/{attribute-redacting-processor-Pk7lAzWd.d.ts → attribute-redacting-processor-CvBE0z1p.d.ts} +33 -1
- package/dist/attribute-redacting-processor.cjs +34 -32
- package/dist/attribute-redacting-processor.d.cts +1 -1
- package/dist/attribute-redacting-processor.d.ts +1 -1
- package/dist/attribute-redacting-processor.js +35 -32
- package/dist/{attributes-aDmJYral.cjs → attributes-Cxys8tgr.cjs} +34 -35
- package/dist/{attributes-B7wix2VG.js → attributes-Dt4YUYbP.js} +34 -35
- package/dist/attributes.cjs +1 -1
- package/dist/attributes.d.cts +1 -1
- package/dist/attributes.d.ts +1 -1
- package/dist/attributes.js +1 -1
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/business-baggage.cjs +19 -12
- package/dist/business-baggage.d.cts +8 -3
- package/dist/business-baggage.d.ts +8 -3
- package/dist/business-baggage.js +19 -12
- package/dist/{canonical-log-line-processor-DxtBGZIi.cjs → canonical-log-line-processor-DolzdawH.cjs} +43 -32
- package/dist/{canonical-log-line-processor-B4WgG-VS.d.cts → canonical-log-line-processor-cPB4Axk-.d.ts} +4 -3
- package/dist/{canonical-log-line-processor-B0vq_QR6.js → canonical-log-line-processor-hFUmS__K.js} +43 -32
- package/dist/{canonical-log-line-processor-CL_J7gb5.d.ts → canonical-log-line-processor-l0Aqe6yp.d.cts} +4 -3
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{correlated-events-kSwLo3mi.cjs → correlated-events-CcuknWnU.cjs} +2 -1
- package/dist/{correlated-events-Bzh5y-UB.js → correlated-events-DwMMbItg.js} +3 -1
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/db.cjs +34 -19
- package/dist/db.js +34 -19
- package/dist/decorators.cjs +4 -2
- package/dist/decorators.d.cts +16 -11
- package/dist/decorators.d.ts +16 -11
- package/dist/decorators.js +4 -2
- package/dist/{define-event-CGG048HE.d.cts → define-event-BNeuKUPv.d.cts} +1 -1
- package/dist/{define-event-B2z1SBe7.d.ts → define-event-Bd8f8mST.d.ts} +1 -1
- package/dist/diagnostics.cjs +18 -16
- package/dist/diagnostics.d.cts +14 -10
- package/dist/diagnostics.d.ts +14 -10
- package/dist/diagnostics.js +18 -16
- package/dist/{event-subscriber-CWh8sTGh.d.cts → event-subscriber-DMACQA-1.d.cts} +19 -9
- package/dist/{event-subscriber-CWh8sTGh.d.ts → event-subscriber-DMACQA-1.d.ts} +19 -9
- package/dist/event-subscriber.d.cts +2 -2
- package/dist/event-subscriber.d.ts +2 -2
- package/dist/{event-testing-D0qWfqAy.d.cts → event-testing-CBtnJXE5.d.cts} +1 -1
- package/dist/{event-testing-CA2mIx1E.d.ts → event-testing-CkPgV3Ii.d.ts} +1 -1
- package/dist/event-testing.d.cts +1 -1
- package/dist/event-testing.d.ts +1 -1
- package/dist/event.cjs +1 -1
- package/dist/event.d.cts +5 -5
- package/dist/event.d.ts +5 -5
- package/dist/event.js +1 -1
- package/dist/exception-fingerprint.cjs +133 -0
- package/dist/exception-fingerprint.d.cts +51 -0
- package/dist/exception-fingerprint.d.ts +51 -0
- package/dist/exception-fingerprint.js +126 -0
- package/dist/{functional-AT22vCw6.d.ts → functional-CJn2zY4o.d.cts} +96 -39
- package/dist/{functional-e6jw5zQj.d.cts → functional-DXy1cHFF.d.ts} +96 -39
- package/dist/{functional-qZxRcIBp.cjs → functional-Da6Yv64r.cjs} +27 -15
- package/dist/{functional-0o9xSedq.js → functional-uSbNnnxK.js} +27 -15
- package/dist/functional.cjs +1 -1
- package/dist/functional.d.cts +2 -2
- package/dist/functional.d.ts +2 -2
- package/dist/functional.js +1 -1
- package/dist/http.cjs +11 -8
- package/dist/http.js +11 -8
- package/dist/{index-DolOVX6F.d.ts → index-CwrNAsgk.d.ts} +22 -26
- package/dist/{index-BPcxVucm.d.cts → index-DQHf4cNl.d.cts} +22 -26
- package/dist/index.cjs +41 -35
- package/dist/index.d.cts +45 -30
- package/dist/index.d.ts +45 -30
- package/dist/index.js +41 -35
- package/dist/{init-CsODvlau.d.ts → init-BgnYi2sm.d.ts} +94 -90
- package/dist/{init-BnxHAi2M.cjs → init-D4m5rCmD.cjs} +142 -123
- package/dist/{init-Cc7-vvzj.d.cts → init-DrlL1eis.d.cts} +94 -90
- package/dist/{init-BxfZ3Vbw.js → init-JtX-KKz_.js} +137 -124
- package/dist/instrumentation.cjs +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{logger-D3Ej3DII.js → logger-DdPp__xW.js} +63 -54
- package/dist/{logger-CN4xpzMd.d.cts → logger-S1Fgl0g3.d.cts} +0 -20
- package/dist/{logger-CN4xpzMd.d.ts → logger-S1Fgl0g3.d.ts} +0 -20
- package/dist/{logger-thMPLpOG.cjs → logger-Sm66cjKl.cjs} +63 -54
- package/dist/logger.cjs +1 -1
- package/dist/logger.d.cts +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/dist/messaging-adapters.cjs +26 -12
- package/dist/messaging-adapters.d.cts +0 -30
- package/dist/messaging-adapters.d.ts +0 -30
- package/dist/messaging-adapters.js +26 -12
- package/dist/messaging.cjs +37 -34
- package/dist/messaging.d.cts +21 -62
- package/dist/messaging.d.ts +21 -62
- package/dist/messaging.js +37 -34
- package/dist/{metric-testing-CpvP3ZIa.d.cts → metric-testing-86WO1wan.d.cts} +1 -1
- package/dist/{metric-testing-CWm6UhaR.d.ts → metric-testing-CbCxdPBp.d.ts} +1 -1
- package/dist/metric-testing.d.cts +1 -1
- package/dist/metric-testing.d.ts +1 -1
- package/dist/metric.d.cts +3 -3
- package/dist/metric.d.ts +3 -3
- package/dist/{node-require-vROmTeJ8.js → node-require-DSPjaw_l.js} +3 -2
- package/dist/{node-require-PFqDihze.cjs → node-require-EifOMikz.cjs} +3 -2
- package/dist/parse-error.cjs +18 -12
- package/dist/parse-error.d.cts +2 -1
- package/dist/parse-error.d.ts +2 -1
- package/dist/parse-error.js +19 -12
- package/dist/policy.cjs +0 -0
- package/dist/policy.js +0 -0
- package/dist/processors.cjs +1 -1
- package/dist/processors.d.cts +1 -1
- package/dist/processors.d.ts +1 -1
- package/dist/processors.js +1 -1
- package/dist/{sampling-BR9fkSwx.d.cts → sampling-CM5S2Lp3.d.ts} +5 -6
- package/dist/{sampling-CP3e7-Yr.d.ts → sampling-CmRdnXUi.d.cts} +5 -6
- package/dist/sampling.cjs +3 -2
- package/dist/sampling.d.cts +1 -1
- package/dist/sampling.d.ts +1 -1
- package/dist/sampling.js +3 -2
- package/dist/semantic-helpers.cjs +9 -9
- package/dist/semantic-helpers.d.cts +1 -1
- package/dist/semantic-helpers.d.ts +1 -1
- package/dist/semantic-helpers.js +9 -9
- package/dist/{stable-hash-ChFBIhNt.js → stable-hash-BkoAYVks.js} +4 -3
- package/dist/{stable-hash-CS9BxvVQ.cjs → stable-hash-C0pOegH_.cjs} +4 -3
- package/dist/{structured-error-CHg7DoIQ.cjs → structured-error--_wXpd_C.cjs} +34 -25
- package/dist/{structured-error-9--cxBay.js → structured-error-YIuka-FE.js} +34 -25
- package/dist/test-span-collector.cjs +15 -8
- package/dist/test-span-collector.js +15 -8
- package/dist/testing.cjs +16 -18
- package/dist/testing.d.cts +7 -6
- package/dist/testing.d.ts +7 -6
- package/dist/testing.js +16 -18
- package/dist/{trace-context-IuyoPyNq.d.cts → trace-context-C1Cn1q0y.d.cts} +8 -7
- package/dist/{trace-context-IuyoPyNq.d.ts → trace-context-f89xPJbK.d.ts} +8 -7
- package/dist/trace-helpers.cjs +16 -13
- package/dist/trace-helpers.d.cts +9 -4
- package/dist/trace-helpers.d.ts +9 -4
- package/dist/trace-helpers.js +16 -13
- package/dist/tracer-provider.cjs +8 -12
- package/dist/tracer-provider.js +8 -12
- package/dist/validate.cjs +22 -20
- package/dist/validate.d.cts +3 -2
- package/dist/validate.d.ts +3 -2
- package/dist/validate.js +22 -20
- package/dist/values-BenyvWKz.js +141 -0
- package/dist/values-CeMH-mYG.d.cts +8 -0
- package/dist/values-CeMH-mYG.d.ts +8 -0
- package/dist/values-DApyq53y.cjs +267 -0
- package/dist/webhook.cjs +3 -3
- package/dist/webhook.d.cts +1 -1
- package/dist/webhook.d.ts +1 -1
- package/dist/webhook.js +3 -3
- package/dist/workflow-distributed.cjs +9 -7
- package/dist/workflow-distributed.d.cts +9 -8
- package/dist/workflow-distributed.d.ts +9 -8
- package/dist/workflow-distributed.js +9 -7
- package/dist/workflow.cjs +26 -17
- package/dist/workflow.d.cts +1 -28
- package/dist/workflow.d.ts +1 -28
- package/dist/workflow.js +26 -17
- package/dist/yaml-config.cjs +26 -11
- package/dist/yaml-config.d.cts +9 -3
- package/dist/yaml-config.d.ts +9 -3
- package/dist/yaml-config.js +26 -11
- package/package.json +6 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MetricsValue, c as createMetricsCollector, i as MetricsOutcome, n as MetricsEvent, o as assertEventTracked, r as MetricsFunnelStep, s as assertOutcomeTracked, t as MetricsCollector } from "./metric-testing-
|
|
1
|
+
import { a as MetricsValue, c as createMetricsCollector, i as MetricsOutcome, n as MetricsEvent, o as assertEventTracked, r as MetricsFunnelStep, s as assertOutcomeTracked, t as MetricsCollector } from "./metric-testing-86WO1wan.cjs";
|
|
2
2
|
export { MetricsCollector, MetricsEvent, MetricsFunnelStep, MetricsOutcome, MetricsValue, assertEventTracked, assertOutcomeTracked, createMetricsCollector };
|
package/dist/metric-testing.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MetricsValue, c as createMetricsCollector, i as MetricsOutcome, n as MetricsEvent, o as assertEventTracked, r as MetricsFunnelStep, s as assertOutcomeTracked, t as MetricsCollector } from "./metric-testing-
|
|
1
|
+
import { a as MetricsValue, c as createMetricsCollector, i as MetricsOutcome, n as MetricsEvent, o as assertEventTracked, r as MetricsFunnelStep, s as assertOutcomeTracked, t as MetricsCollector } from "./metric-testing-CbCxdPBp.js";
|
|
2
2
|
export { MetricsCollector, MetricsEvent, MetricsFunnelStep, MetricsOutcome, MetricsValue, assertEventTracked, assertOutcomeTracked, createMetricsCollector };
|
package/dist/metric.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as Logger } from "./logger-
|
|
2
|
-
import { c as
|
|
3
|
-
import { t as MetricsCollector } from "./metric-testing-
|
|
1
|
+
import { s as Logger } from "./logger-S1Fgl0g3.cjs";
|
|
2
|
+
import { c as FunnelStatus, l as OutcomeStatus, r as EventAttributes } from "./event-subscriber-DMACQA-1.cjs";
|
|
3
|
+
import { t as MetricsCollector } from "./metric-testing-86WO1wan.cjs";
|
|
4
4
|
//#region src/metric.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Metrics class for tracking business metrics in OpenTelemetry
|
package/dist/metric.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as Logger } from "./logger-
|
|
2
|
-
import { c as
|
|
3
|
-
import { t as MetricsCollector } from "./metric-testing-
|
|
1
|
+
import { s as Logger } from "./logger-S1Fgl0g3.js";
|
|
2
|
+
import { c as FunnelStatus, l as OutcomeStatus, r as EventAttributes } from "./event-subscriber-DMACQA-1.js";
|
|
3
|
+
import { t as MetricsCollector } from "./metric-testing-CbCxdPBp.js";
|
|
4
4
|
//#region src/metric.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Metrics class for tracking business metrics in OpenTelemetry
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as readProperty, l as asString } from "./values-BenyvWKz.js";
|
|
1
2
|
import * as nodeModule from "node:module";
|
|
2
3
|
|
|
3
4
|
//#region src/node-require.ts
|
|
@@ -14,7 +15,7 @@ import * as nodeModule from "node:module";
|
|
|
14
15
|
let cachedRequire;
|
|
15
16
|
function getNodeRequire() {
|
|
16
17
|
if (cachedRequire) return cachedRequire;
|
|
17
|
-
const base =
|
|
18
|
+
const base = asString(globalThis.__filename) ?? import.meta.url;
|
|
18
19
|
if (!base) throw Object.assign(/* @__PURE__ */ new Error("node require() is unavailable in this runtime"), { code: "MODULE_NOT_FOUND" });
|
|
19
20
|
cachedRequire = nodeModule.createRequire(base);
|
|
20
21
|
return cachedRequire;
|
|
@@ -40,7 +41,7 @@ function safeRequire(id) {
|
|
|
40
41
|
try {
|
|
41
42
|
return getNodeRequire()(id);
|
|
42
43
|
} catch (error) {
|
|
43
|
-
if (error
|
|
44
|
+
if (asString(readProperty(error, "code")) === "MODULE_NOT_FOUND") return;
|
|
44
45
|
throw error;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
2
|
+
const require_values = require('./values-DApyq53y.cjs');
|
|
2
3
|
let node_module = require("node:module");
|
|
3
4
|
node_module = require_rolldown_runtime.__toESM(node_module, 1);
|
|
4
5
|
|
|
@@ -16,7 +17,7 @@ node_module = require_rolldown_runtime.__toESM(node_module, 1);
|
|
|
16
17
|
let cachedRequire;
|
|
17
18
|
function getNodeRequire() {
|
|
18
19
|
if (cachedRequire) return cachedRequire;
|
|
19
|
-
const base =
|
|
20
|
+
const base = require_values.asString(globalThis.__filename) ?? require("url").pathToFileURL(__filename).href;
|
|
20
21
|
if (!base) throw Object.assign(/* @__PURE__ */ new Error("node require() is unavailable in this runtime"), { code: "MODULE_NOT_FOUND" });
|
|
21
22
|
cachedRequire = node_module.createRequire(base);
|
|
22
23
|
return cachedRequire;
|
|
@@ -42,7 +43,7 @@ function safeRequire(id) {
|
|
|
42
43
|
try {
|
|
43
44
|
return getNodeRequire()(id);
|
|
44
45
|
} catch (error) {
|
|
45
|
-
if (error
|
|
46
|
+
if (require_values.asString(require_values.readProperty(error, "code")) === "MODULE_NOT_FOUND") return;
|
|
46
47
|
throw error;
|
|
47
48
|
}
|
|
48
49
|
}
|
package/dist/parse-error.cjs
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_values = require('./values-DApyq53y.cjs');
|
|
2
3
|
|
|
3
4
|
//#region src/parse-error.ts
|
|
5
|
+
/** An HTTP-ish status, however the library that threw chose to spell it. */
|
|
4
6
|
function toStatus(value) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const n = Number(value);
|
|
8
|
-
if (Number.isFinite(n)) return n;
|
|
9
|
-
}
|
|
7
|
+
const text = require_values.asString(value);
|
|
8
|
+
return text === void 0 ? require_values.asNumber(value) : require_values.asNumber(Number(text)) ?? void 0;
|
|
10
9
|
}
|
|
11
10
|
function pickString(value) {
|
|
12
|
-
|
|
11
|
+
const text = require_values.asString(value);
|
|
12
|
+
return text !== void 0 && text.length > 0 ? text : void 0;
|
|
13
13
|
}
|
|
14
14
|
function pickCode(value) {
|
|
15
|
-
|
|
15
|
+
return require_values.asString(value) ?? require_values.asNumber(value);
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* A plain object of extra fields. Only a plain one: an Error, a Response or a
|
|
19
|
+
* class instance carries behaviour, and copying it onto a log line as details
|
|
20
|
+
* would serialise something the thrower never meant to publish.
|
|
21
|
+
*/
|
|
17
22
|
function pickDetails(value) {
|
|
18
|
-
|
|
23
|
+
const record = require_values.asRecord(value);
|
|
24
|
+
return record?.constructor === Object ? record : void 0;
|
|
19
25
|
}
|
|
20
26
|
function parseError(error) {
|
|
21
27
|
if (error instanceof Error) {
|
|
@@ -31,10 +37,10 @@ function parseError(error) {
|
|
|
31
37
|
raw: error
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const data =
|
|
37
|
-
const payload = (
|
|
40
|
+
const err = require_values.asRecord(error);
|
|
41
|
+
if (err) {
|
|
42
|
+
const data = require_values.asRecord(err.data);
|
|
43
|
+
const payload = require_values.asRecord(require_values.readProperty(data, "data")) ?? data;
|
|
38
44
|
return {
|
|
39
45
|
message: pickString(data?.statusText) || pickString(data?.statusMessage) || pickString(data?.message) || pickString(payload?.statusText) || pickString(payload?.statusMessage) || pickString(payload?.message) || pickString(err.message) || "An error occurred",
|
|
40
46
|
status: toStatus(payload?.status) || toStatus(payload?.statusCode) || toStatus(err.status) || toStatus(err.statusCode) || 500,
|
package/dist/parse-error.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as UnknownRecord } from "./values-CeMH-mYG.cjs";
|
|
1
2
|
//#region src/parse-error.d.ts
|
|
2
3
|
interface ParsedError {
|
|
3
4
|
message: string;
|
|
@@ -6,7 +7,7 @@ interface ParsedError {
|
|
|
6
7
|
fix?: string;
|
|
7
8
|
link?: string;
|
|
8
9
|
code?: string | number;
|
|
9
|
-
details?:
|
|
10
|
+
details?: UnknownRecord;
|
|
10
11
|
raw: unknown;
|
|
11
12
|
}
|
|
12
13
|
declare function parseError(error: unknown): ParsedError;
|
package/dist/parse-error.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as UnknownRecord } from "./values-CeMH-mYG.js";
|
|
1
2
|
//#region src/parse-error.d.ts
|
|
2
3
|
interface ParsedError {
|
|
3
4
|
message: string;
|
|
@@ -6,7 +7,7 @@ interface ParsedError {
|
|
|
6
7
|
fix?: string;
|
|
7
8
|
link?: string;
|
|
8
9
|
code?: string | number;
|
|
9
|
-
details?:
|
|
10
|
+
details?: UnknownRecord;
|
|
10
11
|
raw: unknown;
|
|
11
12
|
}
|
|
12
13
|
declare function parseError(error: unknown): ParsedError;
|
package/dist/parse-error.js
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
|
+
import { _ as readProperty, i as asNumber, l as asString, s as asRecord } from "./values-BenyvWKz.js";
|
|
2
|
+
|
|
1
3
|
//#region src/parse-error.ts
|
|
4
|
+
/** An HTTP-ish status, however the library that threw chose to spell it. */
|
|
2
5
|
function toStatus(value) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const n = Number(value);
|
|
6
|
-
if (Number.isFinite(n)) return n;
|
|
7
|
-
}
|
|
6
|
+
const text = asString(value);
|
|
7
|
+
return text === void 0 ? asNumber(value) : asNumber(Number(text)) ?? void 0;
|
|
8
8
|
}
|
|
9
9
|
function pickString(value) {
|
|
10
|
-
|
|
10
|
+
const text = asString(value);
|
|
11
|
+
return text !== void 0 && text.length > 0 ? text : void 0;
|
|
11
12
|
}
|
|
12
13
|
function pickCode(value) {
|
|
13
|
-
|
|
14
|
+
return asString(value) ?? asNumber(value);
|
|
14
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* A plain object of extra fields. Only a plain one: an Error, a Response or a
|
|
18
|
+
* class instance carries behaviour, and copying it onto a log line as details
|
|
19
|
+
* would serialise something the thrower never meant to publish.
|
|
20
|
+
*/
|
|
15
21
|
function pickDetails(value) {
|
|
16
|
-
|
|
22
|
+
const record = asRecord(value);
|
|
23
|
+
return record?.constructor === Object ? record : void 0;
|
|
17
24
|
}
|
|
18
25
|
function parseError(error) {
|
|
19
26
|
if (error instanceof Error) {
|
|
@@ -29,10 +36,10 @@ function parseError(error) {
|
|
|
29
36
|
raw: error
|
|
30
37
|
};
|
|
31
38
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const data = err.data
|
|
35
|
-
const payload = (data
|
|
39
|
+
const err = asRecord(error);
|
|
40
|
+
if (err) {
|
|
41
|
+
const data = asRecord(err.data);
|
|
42
|
+
const payload = asRecord(readProperty(data, "data")) ?? data;
|
|
36
43
|
return {
|
|
37
44
|
message: pickString(data?.statusText) || pickString(data?.statusMessage) || pickString(data?.message) || pickString(payload?.statusText) || pickString(payload?.statusMessage) || pickString(payload?.message) || pickString(err.message) || "An error occurred",
|
|
38
45
|
status: toStatus(payload?.status) || toStatus(payload?.statusCode) || toStatus(err.status) || toStatus(err.statusCode) || 500,
|
package/dist/policy.cjs
CHANGED
|
Binary file
|
package/dist/policy.js
CHANGED
|
Binary file
|
package/dist/processors.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_canonical_log_line_processor = require('./canonical-log-line-processor-
|
|
2
|
+
const require_canonical_log_line_processor = require('./canonical-log-line-processor-DolzdawH.cjs');
|
|
3
3
|
let _opentelemetry_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, 'BatchSpanProcessor', {
|
package/dist/processors.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as CanonicalLogLineProcessor, t as CanonicalLogLineOptions } from "./canonical-log-line-processor-
|
|
1
|
+
import { n as CanonicalLogLineProcessor, t as CanonicalLogLineOptions } from "./canonical-log-line-processor-l0Aqe6yp.cjs";
|
|
2
2
|
import { BatchSpanProcessor, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
3
3
|
export { BatchSpanProcessor, type CanonicalLogLineOptions, CanonicalLogLineProcessor, SimpleSpanProcessor };
|
package/dist/processors.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as CanonicalLogLineProcessor, t as CanonicalLogLineOptions } from "./canonical-log-line-processor-
|
|
1
|
+
import { n as CanonicalLogLineProcessor, t as CanonicalLogLineOptions } from "./canonical-log-line-processor-cPB4Axk-.js";
|
|
2
2
|
import { BatchSpanProcessor, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
3
3
|
export { BatchSpanProcessor, type CanonicalLogLineOptions, CanonicalLogLineProcessor, SimpleSpanProcessor };
|
package/dist/processors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CanonicalLogLineProcessor } from "./canonical-log-line-processor-
|
|
1
|
+
import { t as CanonicalLogLineProcessor } from "./canonical-log-line-processor-hFUmS__K.js";
|
|
2
2
|
import { BatchSpanProcessor, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
3
3
|
|
|
4
4
|
export { BatchSpanProcessor, CanonicalLogLineProcessor, SimpleSpanProcessor };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as UnknownRecord } from "./values-CeMH-mYG.js";
|
|
2
|
+
import { s as Logger } from "./logger-S1Fgl0g3.js";
|
|
2
3
|
import { Attributes, Link } from "@opentelemetry/api";
|
|
3
4
|
//#region src/sampling.d.ts
|
|
4
5
|
/**
|
|
@@ -76,7 +77,7 @@ interface SamplingContext {
|
|
|
76
77
|
/** Method arguments (for extracting user IDs, etc.) */
|
|
77
78
|
args: unknown[];
|
|
78
79
|
/** Optional metadata (e.g., feature flags, request headers) */
|
|
79
|
-
metadata?:
|
|
80
|
+
metadata?: UnknownRecord;
|
|
80
81
|
/** Optional span links for links-based sampling */
|
|
81
82
|
links?: Link[];
|
|
82
83
|
}
|
|
@@ -355,7 +356,7 @@ declare class FeatureFlagSampler implements Sampler {
|
|
|
355
356
|
constructor(options: {
|
|
356
357
|
baselineSampleRate?: number;
|
|
357
358
|
alwaysSampleFlags?: string[];
|
|
358
|
-
extractFlags: (args: unknown[], metadata?:
|
|
359
|
+
extractFlags: (args: unknown[], metadata?: UnknownRecord) => string[] | undefined;
|
|
359
360
|
logger?: Logger;
|
|
360
361
|
});
|
|
361
362
|
shouldSample(context: SamplingContext): boolean;
|
|
@@ -460,8 +461,6 @@ declare function createLinkFromHeaders(headers: Record<string, string>, attribut
|
|
|
460
461
|
* });
|
|
461
462
|
* ```
|
|
462
463
|
*/
|
|
463
|
-
declare function extractLinksFromBatch(messages:
|
|
464
|
-
[key: string]: unknown;
|
|
465
|
-
}>, headersKey?: string): Link[];
|
|
464
|
+
declare function extractLinksFromBatch(messages: UnknownRecord[], headersKey?: string): Link[];
|
|
466
465
|
//#endregion
|
|
467
466
|
export { createLinkFromHeaders as _, AlwaysSampler as a, resolveSamplingPreset as b, FeatureFlagSampler as c, OperationResult as d, RandomSampler as f, UserIdSampler as g, SamplingPreset as h, AdaptiveSampler as i, KeyTargetRateSampler as l, SamplingContext as m, AUTOTEL_SAMPLING_TAIL_EVALUATED as n, CompositeSampler as o, Sampler as p, AUTOTEL_SAMPLING_TAIL_KEEP as r, DeterministicSampler as s, AUTOTEL_SAMPLING_RATE as t, NeverSampler as u, extractLinksFromBatch as v, samplingPresets as x, hashUnitInterval as y };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as UnknownRecord } from "./values-CeMH-mYG.cjs";
|
|
2
|
+
import { s as Logger } from "./logger-S1Fgl0g3.cjs";
|
|
2
3
|
import { Attributes, Link } from "@opentelemetry/api";
|
|
3
4
|
//#region src/sampling.d.ts
|
|
4
5
|
/**
|
|
@@ -76,7 +77,7 @@ interface SamplingContext {
|
|
|
76
77
|
/** Method arguments (for extracting user IDs, etc.) */
|
|
77
78
|
args: unknown[];
|
|
78
79
|
/** Optional metadata (e.g., feature flags, request headers) */
|
|
79
|
-
metadata?:
|
|
80
|
+
metadata?: UnknownRecord;
|
|
80
81
|
/** Optional span links for links-based sampling */
|
|
81
82
|
links?: Link[];
|
|
82
83
|
}
|
|
@@ -355,7 +356,7 @@ declare class FeatureFlagSampler implements Sampler {
|
|
|
355
356
|
constructor(options: {
|
|
356
357
|
baselineSampleRate?: number;
|
|
357
358
|
alwaysSampleFlags?: string[];
|
|
358
|
-
extractFlags: (args: unknown[], metadata?:
|
|
359
|
+
extractFlags: (args: unknown[], metadata?: UnknownRecord) => string[] | undefined;
|
|
359
360
|
logger?: Logger;
|
|
360
361
|
});
|
|
361
362
|
shouldSample(context: SamplingContext): boolean;
|
|
@@ -460,8 +461,6 @@ declare function createLinkFromHeaders(headers: Record<string, string>, attribut
|
|
|
460
461
|
* });
|
|
461
462
|
* ```
|
|
462
463
|
*/
|
|
463
|
-
declare function extractLinksFromBatch(messages:
|
|
464
|
-
[key: string]: unknown;
|
|
465
|
-
}>, headersKey?: string): Link[];
|
|
464
|
+
declare function extractLinksFromBatch(messages: UnknownRecord[], headersKey?: string): Link[];
|
|
466
465
|
//#endregion
|
|
467
466
|
export { createLinkFromHeaders as _, AlwaysSampler as a, resolveSamplingPreset as b, FeatureFlagSampler as c, OperationResult as d, RandomSampler as f, UserIdSampler as g, SamplingPreset as h, AdaptiveSampler as i, KeyTargetRateSampler as l, SamplingContext as m, AUTOTEL_SAMPLING_TAIL_EVALUATED as n, CompositeSampler as o, Sampler as p, AUTOTEL_SAMPLING_TAIL_KEEP as r, DeterministicSampler as s, AUTOTEL_SAMPLING_RATE as t, NeverSampler as u, extractLinksFromBatch as v, samplingPresets as x, hashUnitInterval as y };
|
package/dist/sampling.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_values = require('./values-DApyq53y.cjs');
|
|
2
3
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
3
4
|
|
|
4
5
|
//#region src/sampling.ts
|
|
@@ -544,8 +545,8 @@ function createLinkFromHeaders(headers, attributes) {
|
|
|
544
545
|
function extractLinksFromBatch(messages, headersKey = "headers") {
|
|
545
546
|
const links = [];
|
|
546
547
|
for (const msg of messages) {
|
|
547
|
-
const msgHeaders = msg[headersKey];
|
|
548
|
-
if (msgHeaders
|
|
548
|
+
const msgHeaders = require_values.asStringRecord(msg[headersKey]);
|
|
549
|
+
if (msgHeaders) {
|
|
549
550
|
const link = createLinkFromHeaders(msgHeaders, { "messaging.batch.message_index": links.length });
|
|
550
551
|
if (link) links.push(link);
|
|
551
552
|
}
|
package/dist/sampling.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as createLinkFromHeaders, a as AlwaysSampler, b as resolveSamplingPreset, c as FeatureFlagSampler, d as OperationResult, f as RandomSampler, g as UserIdSampler, h as SamplingPreset, i as AdaptiveSampler, l as KeyTargetRateSampler, m as SamplingContext, n as AUTOTEL_SAMPLING_TAIL_EVALUATED, o as CompositeSampler, p as Sampler, r as AUTOTEL_SAMPLING_TAIL_KEEP, s as DeterministicSampler, t as AUTOTEL_SAMPLING_RATE, u as NeverSampler, v as extractLinksFromBatch, x as samplingPresets, y as hashUnitInterval } from "./sampling-
|
|
1
|
+
import { _ as createLinkFromHeaders, a as AlwaysSampler, b as resolveSamplingPreset, c as FeatureFlagSampler, d as OperationResult, f as RandomSampler, g as UserIdSampler, h as SamplingPreset, i as AdaptiveSampler, l as KeyTargetRateSampler, m as SamplingContext, n as AUTOTEL_SAMPLING_TAIL_EVALUATED, o as CompositeSampler, p as Sampler, r as AUTOTEL_SAMPLING_TAIL_KEEP, s as DeterministicSampler, t as AUTOTEL_SAMPLING_RATE, u as NeverSampler, v as extractLinksFromBatch, x as samplingPresets, y as hashUnitInterval } from "./sampling-CmRdnXUi.cjs";
|
|
2
2
|
export { AUTOTEL_SAMPLING_RATE, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, CompositeSampler, DeterministicSampler, FeatureFlagSampler, KeyTargetRateSampler, NeverSampler, OperationResult, RandomSampler, Sampler, SamplingContext, SamplingPreset, UserIdSampler, createLinkFromHeaders, extractLinksFromBatch, hashUnitInterval, resolveSamplingPreset, samplingPresets };
|
package/dist/sampling.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as createLinkFromHeaders, a as AlwaysSampler, b as resolveSamplingPreset, c as FeatureFlagSampler, d as OperationResult, f as RandomSampler, g as UserIdSampler, h as SamplingPreset, i as AdaptiveSampler, l as KeyTargetRateSampler, m as SamplingContext, n as AUTOTEL_SAMPLING_TAIL_EVALUATED, o as CompositeSampler, p as Sampler, r as AUTOTEL_SAMPLING_TAIL_KEEP, s as DeterministicSampler, t as AUTOTEL_SAMPLING_RATE, u as NeverSampler, v as extractLinksFromBatch, x as samplingPresets, y as hashUnitInterval } from "./sampling-
|
|
1
|
+
import { _ as createLinkFromHeaders, a as AlwaysSampler, b as resolveSamplingPreset, c as FeatureFlagSampler, d as OperationResult, f as RandomSampler, g as UserIdSampler, h as SamplingPreset, i as AdaptiveSampler, l as KeyTargetRateSampler, m as SamplingContext, n as AUTOTEL_SAMPLING_TAIL_EVALUATED, o as CompositeSampler, p as Sampler, r as AUTOTEL_SAMPLING_TAIL_KEEP, s as DeterministicSampler, t as AUTOTEL_SAMPLING_RATE, u as NeverSampler, v as extractLinksFromBatch, x as samplingPresets, y as hashUnitInterval } from "./sampling-CM5S2Lp3.js";
|
|
2
2
|
export { AUTOTEL_SAMPLING_RATE, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, CompositeSampler, DeterministicSampler, FeatureFlagSampler, KeyTargetRateSampler, NeverSampler, OperationResult, RandomSampler, Sampler, SamplingContext, SamplingPreset, UserIdSampler, createLinkFromHeaders, extractLinksFromBatch, hashUnitInterval, resolveSamplingPreset, samplingPresets };
|
package/dist/sampling.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { d as asStringRecord } from "./values-BenyvWKz.js";
|
|
1
2
|
import { TraceFlags } from "@opentelemetry/api";
|
|
2
3
|
|
|
3
4
|
//#region src/sampling.ts
|
|
@@ -543,8 +544,8 @@ function createLinkFromHeaders(headers, attributes) {
|
|
|
543
544
|
function extractLinksFromBatch(messages, headersKey = "headers") {
|
|
544
545
|
const links = [];
|
|
545
546
|
for (const msg of messages) {
|
|
546
|
-
const msgHeaders = msg[headersKey];
|
|
547
|
-
if (msgHeaders
|
|
547
|
+
const msgHeaders = asStringRecord(msg[headersKey]);
|
|
548
|
+
if (msgHeaders) {
|
|
548
549
|
const link = createLinkFromHeaders(msgHeaders, { "messaging.batch.message_index": links.length });
|
|
549
550
|
if (link) links.push(link);
|
|
550
551
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_values = require('./values-DApyq53y.cjs');
|
|
3
|
+
const require_functional = require('./functional-Da6Yv64r.cjs');
|
|
3
4
|
const require_trace_factory_validation = require('./trace-factory-validation-Dc8epn87.cjs');
|
|
4
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
5
6
|
|
|
@@ -15,9 +16,8 @@ let _opentelemetry_api = require("@opentelemetry/api");
|
|
|
15
16
|
function setConfiguredAttributes(ctx, attributes) {
|
|
16
17
|
if (!attributes) return;
|
|
17
18
|
for (const [key, value] of Object.entries(attributes)) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
ctx.setAttribute(key, attributeValue);
|
|
19
|
+
const attributeValue = require_values.toAttributeValue(value);
|
|
20
|
+
if (attributeValue !== void 0) ctx.setAttribute(key, attributeValue);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -49,8 +49,8 @@ function wrapSemantic(helperName, name, spanKind, configure, fn) {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
function traceDB(config, fn) {
|
|
52
|
-
if (
|
|
53
|
-
if (
|
|
52
|
+
if (require_values.asRecord(config) === void 0) throw new TypeError("traceDB: config must be an object");
|
|
53
|
+
if (require_values.nonEmptyString(config.system) === void 0) throw new TypeError("traceDB: config.system must be a non-empty string");
|
|
54
54
|
const target = config.collection ?? config.database;
|
|
55
55
|
const spanName = (config.querySummary ?? [config.operation, target].filter(Boolean).join(" ")) || config.system;
|
|
56
56
|
const configure = (ctx) => {
|
|
@@ -71,7 +71,7 @@ function traceDB(config, fn) {
|
|
|
71
71
|
return wrapSemantic("traceDB", spanName, _opentelemetry_api.SpanKind.CLIENT, configure, fn);
|
|
72
72
|
}
|
|
73
73
|
function traceHTTP(config, fn) {
|
|
74
|
-
if (
|
|
74
|
+
if (require_values.asRecord(config) === void 0) throw new TypeError("traceHTTP: config must be an object");
|
|
75
75
|
const method = config.method?.toUpperCase() || "HTTP";
|
|
76
76
|
const target = config.route ?? config.urlTemplate;
|
|
77
77
|
const spanName = target ? `${method} ${target}` : method;
|
|
@@ -85,8 +85,8 @@ function traceHTTP(config, fn) {
|
|
|
85
85
|
return wrapSemantic("traceHTTP", spanName, _opentelemetry_api.SpanKind.CLIENT, configure, fn);
|
|
86
86
|
}
|
|
87
87
|
function traceMessaging(config, fn) {
|
|
88
|
-
if (
|
|
89
|
-
if (
|
|
88
|
+
if (require_values.asRecord(config) === void 0) throw new TypeError("traceMessaging: config must be an object");
|
|
89
|
+
if (require_values.nonEmptyString(config.system) === void 0) throw new TypeError("traceMessaging: config.system must be a non-empty string");
|
|
90
90
|
const operation = config.operation ?? "messaging";
|
|
91
91
|
const spanName = [operation, config.destination].filter(Boolean).join(" ");
|
|
92
92
|
const operationType = operation === "publish" ? "send" : operation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TraceContext } from "./trace-context-
|
|
1
|
+
import { n as TraceContext } from "./trace-context-C1Cn1q0y.cjs";
|
|
2
2
|
import { Attributes } from "@opentelemetry/api";
|
|
3
3
|
//#region src/semantic-helpers.d.ts
|
|
4
4
|
type SemanticHandler<TArgs extends unknown[], TReturn> = (...args: TArgs) => TReturn | Promise<TReturn>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TraceContext } from "./trace-context-
|
|
1
|
+
import { n as TraceContext } from "./trace-context-f89xPJbK.js";
|
|
2
2
|
import { Attributes } from "@opentelemetry/api";
|
|
3
3
|
//#region src/semantic-helpers.d.ts
|
|
4
4
|
type SemanticHandler<TArgs extends unknown[], TReturn> = (...args: TArgs) => TReturn | Promise<TReturn>;
|
package/dist/semantic-helpers.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as toAttributeValue, g as nonEmptyString, s as asRecord } from "./values-BenyvWKz.js";
|
|
2
|
+
import { c as withTracing } from "./functional-uSbNnnxK.js";
|
|
2
3
|
import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
|
|
3
4
|
import { SpanKind } from "@opentelemetry/api";
|
|
4
5
|
|
|
@@ -14,9 +15,8 @@ import { SpanKind } from "@opentelemetry/api";
|
|
|
14
15
|
function setConfiguredAttributes(ctx, attributes) {
|
|
15
16
|
if (!attributes) return;
|
|
16
17
|
for (const [key, value] of Object.entries(attributes)) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ctx.setAttribute(key, attributeValue);
|
|
18
|
+
const attributeValue = toAttributeValue(value);
|
|
19
|
+
if (attributeValue !== void 0) ctx.setAttribute(key, attributeValue);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -48,8 +48,8 @@ function wrapSemantic(helperName, name, spanKind, configure, fn) {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
function traceDB(config, fn) {
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
51
|
+
if (asRecord(config) === void 0) throw new TypeError("traceDB: config must be an object");
|
|
52
|
+
if (nonEmptyString(config.system) === void 0) throw new TypeError("traceDB: config.system must be a non-empty string");
|
|
53
53
|
const target = config.collection ?? config.database;
|
|
54
54
|
const spanName = (config.querySummary ?? [config.operation, target].filter(Boolean).join(" ")) || config.system;
|
|
55
55
|
const configure = (ctx) => {
|
|
@@ -70,7 +70,7 @@ function traceDB(config, fn) {
|
|
|
70
70
|
return wrapSemantic("traceDB", spanName, SpanKind.CLIENT, configure, fn);
|
|
71
71
|
}
|
|
72
72
|
function traceHTTP(config, fn) {
|
|
73
|
-
if (
|
|
73
|
+
if (asRecord(config) === void 0) throw new TypeError("traceHTTP: config must be an object");
|
|
74
74
|
const method = config.method?.toUpperCase() || "HTTP";
|
|
75
75
|
const target = config.route ?? config.urlTemplate;
|
|
76
76
|
const spanName = target ? `${method} ${target}` : method;
|
|
@@ -84,8 +84,8 @@ function traceHTTP(config, fn) {
|
|
|
84
84
|
return wrapSemantic("traceHTTP", spanName, SpanKind.CLIENT, configure, fn);
|
|
85
85
|
}
|
|
86
86
|
function traceMessaging(config, fn) {
|
|
87
|
-
if (
|
|
88
|
-
if (
|
|
87
|
+
if (asRecord(config) === void 0) throw new TypeError("traceMessaging: config must be an object");
|
|
88
|
+
if (nonEmptyString(config.system) === void 0) throw new TypeError("traceMessaging: config.system must be a non-empty string");
|
|
89
89
|
const operation = config.operation ?? "messaging";
|
|
90
90
|
const spanName = [operation, config.destination].filter(Boolean).join(" ");
|
|
91
91
|
const operationType = operation === "publish" ? "send" : operation;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { s as asRecord } from "./values-BenyvWKz.js";
|
|
1
2
|
import * as nodeCrypto from "node:crypto";
|
|
2
3
|
|
|
3
4
|
//#region src/stable-hash.ts
|
|
@@ -8,10 +9,10 @@ import * as nodeCrypto from "node:crypto";
|
|
|
8
9
|
* hashes.
|
|
9
10
|
*/
|
|
10
11
|
function stableStringify(value) {
|
|
11
|
-
if (value === null || value === void 0 || typeof value !== "object") return JSON.stringify(value);
|
|
12
12
|
if (Array.isArray(value)) return "[" + value.map((v) => stableStringify(v)).join(",") + "]";
|
|
13
|
-
const
|
|
14
|
-
|
|
13
|
+
const record = asRecord(value);
|
|
14
|
+
if (record === void 0) return JSON.stringify(value);
|
|
15
|
+
return "{" + Object.keys(record).toSorted().map((k) => JSON.stringify(k) + ":" + stableStringify(record[k])).join(",") + "}";
|
|
15
16
|
}
|
|
16
17
|
/** Stable sha256 of any JSON-serializable value. */
|
|
17
18
|
function hashJson(value) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
2
|
+
const require_values = require('./values-DApyq53y.cjs');
|
|
2
3
|
let node_crypto = require("node:crypto");
|
|
3
4
|
node_crypto = require_rolldown_runtime.__toESM(node_crypto, 1);
|
|
4
5
|
|
|
@@ -10,10 +11,10 @@ node_crypto = require_rolldown_runtime.__toESM(node_crypto, 1);
|
|
|
10
11
|
* hashes.
|
|
11
12
|
*/
|
|
12
13
|
function stableStringify(value) {
|
|
13
|
-
if (value === null || value === void 0 || typeof value !== "object") return JSON.stringify(value);
|
|
14
14
|
if (Array.isArray(value)) return "[" + value.map((v) => stableStringify(v)).join(",") + "]";
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const record = require_values.asRecord(value);
|
|
16
|
+
if (record === void 0) return JSON.stringify(value);
|
|
17
|
+
return "{" + Object.keys(record).toSorted().map((k) => JSON.stringify(k) + ":" + stableStringify(record[k])).join(",") + "}";
|
|
17
18
|
}
|
|
18
19
|
/** Stable sha256 of any JSON-serializable value. */
|
|
19
20
|
function hashJson(value) {
|