@fixback/node 0.3.2 → 0.3.4
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 +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/context.js +1 -1
- package/dist/host-identity.d.ts +2 -2
- package/dist/host-identity.js +1 -1
- package/dist/index.js +1 -1
- package/dist/transport.d.ts +2 -2
- package/dist/transport.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wire.d.ts +5 -5
- package/dist/wire.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The Fixback **backend error SDK** for Node servers. Capture unhandled crashes and
|
|
4
4
|
manually-reported errors and file them into the same Fixback pipeline your frontend
|
|
5
|
-
uses — one queue for your whole product (ADR-
|
|
5
|
+
uses — one queue for your whole product (ADR-0061/0062/0028, spec #224).
|
|
6
6
|
|
|
7
7
|
Backend errors authenticate with the Project **secret key**, so they arrive
|
|
8
8
|
**Internal** tier and tagged `platform: node`. Fleet-wide crash-loops collapse into a
|
package/dist/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-request correlation via Node **AsyncLocalStorage** (spec §D9, ADR-
|
|
2
|
+
* Per-request correlation via Node **AsyncLocalStorage** (spec §D9, ADR-0060) — so a
|
|
3
3
|
* captured error carries the in-flight request's context without the developer
|
|
4
4
|
* threading a context object through every call.
|
|
5
5
|
*
|
package/dist/context.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Per-request correlation via Node **AsyncLocalStorage** (spec §D9, ADR-
|
|
3
|
+
* Per-request correlation via Node **AsyncLocalStorage** (spec §D9, ADR-0060) — so a
|
|
4
4
|
* captured error carries the in-flight request's context without the developer
|
|
5
5
|
* threading a context object through every call.
|
|
6
6
|
*
|
package/dist/host-identity.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* **Host identity** minting (ADR-
|
|
2
|
+
* **Host identity** minting (ADR-0066; ticket #251) — the escape hatch for a backend
|
|
3
3
|
* that already knows who its users are.
|
|
4
4
|
*
|
|
5
5
|
* A Host identity is a compact `HS256` JWT the customer's own server mints with the
|
|
@@ -43,7 +43,7 @@ export interface MintHostIdentityOptions {
|
|
|
43
43
|
/**
|
|
44
44
|
* How long the token is valid, in seconds. Defaults to one hour. `exp` is
|
|
45
45
|
* mandatory — an identity assertion that never expires is exactly what an
|
|
46
|
-
* escape-hatch credential must not be (ADR-
|
|
46
|
+
* escape-hatch credential must not be (ADR-0066) — so this is always set.
|
|
47
47
|
*/
|
|
48
48
|
readonly expiresInSeconds?: number;
|
|
49
49
|
}
|
package/dist/host-identity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* **Host identity** minting (ADR-
|
|
3
|
+
* **Host identity** minting (ADR-0066; ticket #251) — the escape hatch for a backend
|
|
4
4
|
* that already knows who its users are.
|
|
5
5
|
*
|
|
6
6
|
* A Host identity is a compact `HS256` JWT the customer's own server mints with the
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ Object.defineProperty(exports, "setUser", { enumerable: true, get: function () {
|
|
|
32
32
|
// Configuration.
|
|
33
33
|
var config_1 = require("./config");
|
|
34
34
|
Object.defineProperty(exports, "DEFAULT_API_URL", { enumerable: true, get: function () { return config_1.DEFAULT_API_URL; } });
|
|
35
|
-
// Host identity (ADR-
|
|
35
|
+
// Host identity (ADR-0066) — mint a server-signed identity JWT a capture SDK presents
|
|
36
36
|
// as its `hostIdentity`, so a backend can tier its own users without Connect.
|
|
37
37
|
var host_identity_1 = require("./host-identity");
|
|
38
38
|
Object.defineProperty(exports, "mintHostIdentity", { enumerable: true, get: function () { return host_identity_1.mintHostIdentity; } });
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The **batched secret-key transport** (ADR-
|
|
2
|
+
* The **batched secret-key transport** (ADR-0061): the SDK buffers captured errors
|
|
3
3
|
* and flushes them to `POST /api/errors` as a JSON batch authenticated with the
|
|
4
4
|
* Project secret key as an `Authorization: Bearer` token.
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* (on the batch cap, on an interval, on demand, and on `close`).
|
|
8
8
|
* - **Coalesced:** repeats of one fingerprint in a flush window fold into a single
|
|
9
9
|
* item with a summed occurrence count — the client half of the crash-loop defence
|
|
10
|
-
* (the server folds across flushes, ADR-
|
|
10
|
+
* (the server folds across flushes, ADR-0062).
|
|
11
11
|
* - **Backed off:** a `429` opens the shared-core {@link AutoReportBackoff} window
|
|
12
12
|
* (honouring `Retry-After`); while it is open captures are shed without a request.
|
|
13
13
|
* - **Fail-quiet (story 34):** an unreachable, timing-out, or refusing endpoint never
|
package/dist/transport.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* The **batched secret-key transport** (ADR-
|
|
3
|
+
* The **batched secret-key transport** (ADR-0061): the SDK buffers captured errors
|
|
4
4
|
* and flushes them to `POST /api/errors` as a JSON batch authenticated with the
|
|
5
5
|
* Project secret key as an `Authorization: Bearer` token.
|
|
6
6
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* (on the batch cap, on an interval, on demand, and on `close`).
|
|
9
9
|
* - **Coalesced:** repeats of one fingerprint in a flush window fold into a single
|
|
10
10
|
* item with a summed occurrence count — the client half of the crash-loop defence
|
|
11
|
-
* (the server folds across flushes, ADR-
|
|
11
|
+
* (the server folds across flushes, ADR-0062).
|
|
12
12
|
* - **Backed off:** a `429` opens the shared-core {@link AutoReportBackoff} window
|
|
13
13
|
* (honouring `Retry-After`); while it is open captures are shed without a request.
|
|
14
14
|
* - **Fail-quiet (story 34):** an unreachable, timing-out, or refusing endpoint never
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dist/wire.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `@fixback/node` **vendors** this contract (the ticket #47 convention, reaffirmed by
|
|
7
7
|
* ADR-0028: the shared core carries pure logic and value shapes, not the ingest
|
|
8
8
|
* envelope). It is kept in lock-step with the server endpoint that parses it —
|
|
9
|
-
* `POST /api/errors` (`apps/api/src/errors/errors.controller.ts`, ADR-
|
|
9
|
+
* `POST /api/errors` (`apps/api/src/errors/errors.controller.ts`, ADR-0061/0062).
|
|
10
10
|
* `CapturedFrame` (the structured stack-frame shape) is the one type reused from the
|
|
11
11
|
* shared core, so the browser and node SDKs describe a frame identically.
|
|
12
12
|
*/
|
|
@@ -14,7 +14,7 @@ import type { CapturedFrame } from "@fixback/sdk-core";
|
|
|
14
14
|
/** A severity for {@link FixbackErrorEvent} messages — Sentry's level vocabulary. */
|
|
15
15
|
export type Severity = "fatal" | "error" | "warning" | "info" | "debug";
|
|
16
16
|
/**
|
|
17
|
-
* The **server context** captured for a backend error (ADR-
|
|
17
|
+
* The **server context** captured for a backend error (ADR-0060, spec #224).
|
|
18
18
|
* Private-by-default: the route **pattern** (never the concrete path with values),
|
|
19
19
|
* the HTTP method, the resolved status, a correlation id, and an **app-supplied**
|
|
20
20
|
* user ref only. Never request/response bodies, never `Authorization`/`Cookie`
|
|
@@ -49,7 +49,7 @@ export interface FixbackErrorEvent {
|
|
|
49
49
|
type: string;
|
|
50
50
|
/** The error message (or the message text for a `captureMessage`). */
|
|
51
51
|
value: string;
|
|
52
|
-
/** `false` = an uncaught process crash, `true` = a caught/manual capture (ADR-
|
|
52
|
+
/** `false` = an uncaught process crash, `true` = a caught/manual capture (ADR-0060). */
|
|
53
53
|
handled?: boolean;
|
|
54
54
|
/** The severity of a `captureMessage` (event-only; unset for a `captureException`). */
|
|
55
55
|
level?: Severity;
|
|
@@ -73,7 +73,7 @@ export interface FixbackErrorEvent {
|
|
|
73
73
|
export type BeforeSend = (event: FixbackErrorEvent) => FixbackErrorEvent | null;
|
|
74
74
|
/**
|
|
75
75
|
* One captured backend error **on the wire** — the payload item the SDK posts.
|
|
76
|
-
* `errorSignature` is required (the ADR-
|
|
76
|
+
* `errorSignature` is required (the ADR-0062 fold key); everything else is optional.
|
|
77
77
|
* Mirrors the server's `errorItemBody`. `server` rides along for forward
|
|
78
78
|
* compatibility — the current endpoint strips unknown keys, so it is harmless today
|
|
79
79
|
* and ready for when the server persists it.
|
|
@@ -93,7 +93,7 @@ export interface ServerErrorPayload {
|
|
|
93
93
|
* against the endpoint's contract rather than assembled inline.
|
|
94
94
|
*
|
|
95
95
|
* The endpoint's *response* is deliberately not modelled: the transport reads only
|
|
96
|
-
* the status and `Retry-After` (ADR-
|
|
96
|
+
* the status and `Retry-After` (ADR-0061's partial-failure results are for the
|
|
97
97
|
* dashboard, not the SDK), and an unread shape would be a contract to keep in
|
|
98
98
|
* lock-step for nothing.
|
|
99
99
|
*/
|
package/dist/wire.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `@fixback/node` **vendors** this contract (the ticket #47 convention, reaffirmed by
|
|
8
8
|
* ADR-0028: the shared core carries pure logic and value shapes, not the ingest
|
|
9
9
|
* envelope). It is kept in lock-step with the server endpoint that parses it —
|
|
10
|
-
* `POST /api/errors` (`apps/api/src/errors/errors.controller.ts`, ADR-
|
|
10
|
+
* `POST /api/errors` (`apps/api/src/errors/errors.controller.ts`, ADR-0061/0062).
|
|
11
11
|
* `CapturedFrame` (the structured stack-frame shape) is the one type reused from the
|
|
12
12
|
* shared core, so the browser and node SDKs describe a frame identically.
|
|
13
13
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fixback/node",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "The Fixback backend error SDK for Node servers — one-call init, batched secret-key capture, process handlers, and Express + NestJS adapters.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@fixback/sdk-core": "0.
|
|
53
|
+
"@fixback/sdk-core": "0.5.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@nestjs/common": ">=10.0.0",
|