@autter/runtime-node 1.5.0 → 1.6.1
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 +139 -1
- package/dist/{chunk-GI47WGRR.cjs → chunk-4MVWIRBI.cjs} +120 -39
- package/dist/{chunk-3TJHUCZ6.js → chunk-5KISVAVB.js} +326 -54
- package/dist/{chunk-L6SRL65J.cjs → chunk-7OTD2YPT.cjs} +11 -11
- package/dist/{chunk-L7HWKMCZ.js → chunk-HRDELHZP.js} +112 -31
- package/dist/{chunk-ZS4WQJQR.js → chunk-L5ENELB2.js} +1 -1
- package/dist/{chunk-P4VRTFAV.cjs → chunk-UXTIMS3G.cjs} +353 -81
- package/dist/cli.cjs +29 -9
- package/dist/cli.js +22 -2
- package/dist/index.cjs +668 -272
- package/dist/index.d.cts +160 -7
- package/dist/index.d.ts +160 -7
- package/dist/index.js +529 -133
- package/dist/{sinks-RFV76lF1.d.cts → sinks-CPGDyfU8.d.cts} +29 -1
- package/dist/{sinks-RFV76lF1.d.ts → sinks-CPGDyfU8.d.ts} +29 -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 +3 -1
|
@@ -222,6 +222,34 @@ interface RuntimeCarrier {
|
|
|
222
222
|
traceparent?: string;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Breadcrumbs — the steps before an error (sink contract §1), shared by the
|
|
227
|
+
* Node SDK (request-scoped trail, `autter.breadcrumbs` span attribute) and
|
|
228
|
+
* the browser relay (re-validating what browsers send). Dependency-free.
|
|
229
|
+
*/
|
|
230
|
+
type BreadcrumbType = "console" | "request" | "navigation" | "click" | "log" | "custom";
|
|
231
|
+
type BreadcrumbLevel = "debug" | "info" | "warning" | "error";
|
|
232
|
+
interface Breadcrumb {
|
|
233
|
+
type: BreadcrumbType;
|
|
234
|
+
/** ISO timestamp. */
|
|
235
|
+
at: string;
|
|
236
|
+
level?: BreadcrumbLevel;
|
|
237
|
+
/** At most 500 characters, scrubbed. */
|
|
238
|
+
message: string;
|
|
239
|
+
/** At most 10 keys; strings at most 200 characters, scrubbed. */
|
|
240
|
+
data?: Record<string, string | number | boolean | null>;
|
|
241
|
+
}
|
|
242
|
+
interface BreadcrumbInput {
|
|
243
|
+
/** Default "custom". */
|
|
244
|
+
type?: BreadcrumbType;
|
|
245
|
+
message: string;
|
|
246
|
+
level?: BreadcrumbLevel;
|
|
247
|
+
/** Primitive values only; at most 10 keys are kept. */
|
|
248
|
+
data?: Record<string, unknown>;
|
|
249
|
+
/** Default now. */
|
|
250
|
+
at?: string | number | Date;
|
|
251
|
+
}
|
|
252
|
+
|
|
225
253
|
/**
|
|
226
254
|
* Where runtime records go. The logger pipeline is
|
|
227
255
|
* `enrich → redact/bound → sinks[]`; each sink receives the same immutable
|
|
@@ -310,4 +338,4 @@ interface MemorySink extends RuntimeSink {
|
|
|
310
338
|
/** Keeps every record in memory — for tests (`@autter/runtime-node/testing`). */
|
|
311
339
|
declare function memorySink(): MemorySink;
|
|
312
340
|
|
|
313
|
-
export {
|
|
341
|
+
export { errorAttributes as A, type BreadcrumbInput as B, type CapturedException as C, fileSink as D, isRuntimeErrorLike as E, type FileSinkOptions as F, otlpSink as G, redactAttributes as H, redactText as I, toClientError as J, type MemorySink as M, type OtlpSinkOptions as O, type RuntimeEvent as R, type RuntimeOutcome as a, type RedactOptions as b, type Redactor$1 as c, type RuntimeLogLevel as d, type RuntimeOperationKind as e, type RuntimeSink as f, type RuntimeLogContext as g, type RuntimeCarrier as h, type Breadcrumb as i, type BreadcrumbLevel as j, type BreadcrumbType as k, CODE_PATTERN as l, memorySink as m, type ClientErrorBody as n, type ConsoleSinkOptions as o, RuntimeError as p, type RuntimeErrorCatalog as q, type RuntimeErrorDefinition as r, type RuntimeErrorExtras as s, type RuntimeErrorFactory as t, type RuntimeErrorLike as u, type RuntimeErrorOptions as v, type RuntimeLogContextValue as w, type RuntimeSinkContext as x, consoleSink as y, defineRuntimeErrors as z };
|
|
@@ -222,6 +222,34 @@ interface RuntimeCarrier {
|
|
|
222
222
|
traceparent?: string;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Breadcrumbs — the steps before an error (sink contract §1), shared by the
|
|
227
|
+
* Node SDK (request-scoped trail, `autter.breadcrumbs` span attribute) and
|
|
228
|
+
* the browser relay (re-validating what browsers send). Dependency-free.
|
|
229
|
+
*/
|
|
230
|
+
type BreadcrumbType = "console" | "request" | "navigation" | "click" | "log" | "custom";
|
|
231
|
+
type BreadcrumbLevel = "debug" | "info" | "warning" | "error";
|
|
232
|
+
interface Breadcrumb {
|
|
233
|
+
type: BreadcrumbType;
|
|
234
|
+
/** ISO timestamp. */
|
|
235
|
+
at: string;
|
|
236
|
+
level?: BreadcrumbLevel;
|
|
237
|
+
/** At most 500 characters, scrubbed. */
|
|
238
|
+
message: string;
|
|
239
|
+
/** At most 10 keys; strings at most 200 characters, scrubbed. */
|
|
240
|
+
data?: Record<string, string | number | boolean | null>;
|
|
241
|
+
}
|
|
242
|
+
interface BreadcrumbInput {
|
|
243
|
+
/** Default "custom". */
|
|
244
|
+
type?: BreadcrumbType;
|
|
245
|
+
message: string;
|
|
246
|
+
level?: BreadcrumbLevel;
|
|
247
|
+
/** Primitive values only; at most 10 keys are kept. */
|
|
248
|
+
data?: Record<string, unknown>;
|
|
249
|
+
/** Default now. */
|
|
250
|
+
at?: string | number | Date;
|
|
251
|
+
}
|
|
252
|
+
|
|
225
253
|
/**
|
|
226
254
|
* Where runtime records go. The logger pipeline is
|
|
227
255
|
* `enrich → redact/bound → sinks[]`; each sink receives the same immutable
|
|
@@ -310,4 +338,4 @@ interface MemorySink extends RuntimeSink {
|
|
|
310
338
|
/** Keeps every record in memory — for tests (`@autter/runtime-node/testing`). */
|
|
311
339
|
declare function memorySink(): MemorySink;
|
|
312
340
|
|
|
313
|
-
export {
|
|
341
|
+
export { errorAttributes as A, type BreadcrumbInput as B, type CapturedException as C, fileSink as D, isRuntimeErrorLike as E, type FileSinkOptions as F, otlpSink as G, redactAttributes as H, redactText as I, toClientError as J, type MemorySink as M, type OtlpSinkOptions as O, type RuntimeEvent as R, type RuntimeOutcome as a, type RedactOptions as b, type Redactor$1 as c, type RuntimeLogLevel as d, type RuntimeOperationKind as e, type RuntimeSink as f, type RuntimeLogContext as g, type RuntimeCarrier as h, type Breadcrumb as i, type BreadcrumbLevel as j, type BreadcrumbType as k, CODE_PATTERN as l, memorySink as m, type ClientErrorBody as n, type ConsoleSinkOptions as o, RuntimeError as p, type RuntimeErrorCatalog as q, type RuntimeErrorDefinition as r, type RuntimeErrorExtras as s, type RuntimeErrorFactory as t, type RuntimeErrorLike as u, type RuntimeErrorOptions as v, type RuntimeLogContextValue as w, type RuntimeSinkContext as x, consoleSink as y, defineRuntimeErrors as z };
|
package/dist/testing.cjs
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkUXTIMS3Gcjs = require('./chunk-UXTIMS3G.cjs');
|
|
6
|
+
require('./chunk-4MVWIRBI.cjs');
|
|
7
7
|
|
|
8
8
|
// src/testing.ts
|
|
9
9
|
function captureRuntime() {
|
|
10
|
-
const sink =
|
|
11
|
-
const remove =
|
|
10
|
+
const sink = _chunkUXTIMS3Gcjs.memorySink.call(void 0, );
|
|
11
|
+
const remove = _chunkUXTIMS3Gcjs.addRuntimeSink.call(void 0, sink);
|
|
12
12
|
return {
|
|
13
13
|
get events() {
|
|
14
14
|
return [...sink.events];
|
|
15
15
|
},
|
|
16
16
|
get operations() {
|
|
17
|
-
return sink.events.filter(
|
|
17
|
+
return sink.events.filter(_chunkUXTIMS3Gcjs.isSummary);
|
|
18
18
|
},
|
|
19
19
|
get logs() {
|
|
20
|
-
return sink.events.filter((event) => !
|
|
20
|
+
return sink.events.filter((event) => !_chunkUXTIMS3Gcjs.isSummary.call(void 0, event));
|
|
21
21
|
},
|
|
22
22
|
get exceptions() {
|
|
23
23
|
return [...sink.exceptions];
|
|
@@ -98,7 +98,7 @@ var OperationExpectation = class {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
function expectOperation(source, name) {
|
|
101
|
-
const events = Array.isArray(source) ? source.filter(
|
|
101
|
+
const events = Array.isArray(source) ? source.filter(_chunkUXTIMS3Gcjs.isSummary) : source.operations;
|
|
102
102
|
const matches = events.filter((event2) => {
|
|
103
103
|
const actual = String(_nullishCoalesce(event2.attributes["autter.operation.name"], () => ( "")));
|
|
104
104
|
return typeof name === "string" ? actual === name : name.test(actual);
|
|
@@ -118,4 +118,4 @@ function expectOperation(source, name) {
|
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
exports.captureRuntime = captureRuntime; exports.expectOperation = expectOperation; exports.memorySink =
|
|
121
|
+
exports.captureRuntime = captureRuntime; exports.expectOperation = expectOperation; exports.memorySink = _chunkUXTIMS3Gcjs.memorySink;
|
package/dist/testing.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RuntimeEvent, a as RuntimeOutcome, C as CapturedException } from './sinks-
|
|
2
|
-
export { M as MemorySink, m as memorySink } from './sinks-
|
|
1
|
+
import { R as RuntimeEvent, a as RuntimeOutcome, C as CapturedException } from './sinks-CPGDyfU8.cjs';
|
|
2
|
+
export { M as MemorySink, m as memorySink } from './sinks-CPGDyfU8.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Test helpers — `@autter/runtime-node/testing`. No ingester, no network:
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RuntimeEvent, a as RuntimeOutcome, C as CapturedException } from './sinks-
|
|
2
|
-
export { M as MemorySink, m as memorySink } from './sinks-
|
|
1
|
+
import { R as RuntimeEvent, a as RuntimeOutcome, C as CapturedException } from './sinks-CPGDyfU8.js';
|
|
2
|
+
export { M as MemorySink, m as memorySink } from './sinks-CPGDyfU8.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Test helpers — `@autter/runtime-node/testing`. No ingester, no network:
|
package/dist/testing.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autter/runtime-node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Autter Runtime for Node.js: request wide events, coded errors, operation logging, same-origin browser relay and a curated OpenTelemetry server tracker",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -51,6 +51,8 @@
|
|
|
51
51
|
"@autter/runtime-core": "0.0.0",
|
|
52
52
|
"@types/node": "^22.10.0",
|
|
53
53
|
"express": "^4.21.2",
|
|
54
|
+
"fastify": "^5.12.5",
|
|
55
|
+
"koa": "^3.2.1",
|
|
54
56
|
"tsup": "^8.3.5",
|
|
55
57
|
"typescript": "^5.7.0"
|
|
56
58
|
},
|