@selvajs/platform 0.17.0-beta.3 → 0.18.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 +25 -28
- package/dist/access/rules.d.ts +20 -26
- package/dist/access/rules.d.ts.map +1 -1
- package/dist/access/rules.js +16 -16
- package/dist/access/rules.js.map +1 -1
- package/dist/auth/interface.d.ts +99 -116
- package/dist/auth/interface.d.ts.map +1 -1
- package/dist/auth/types.d.ts +1 -4
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/bindings/interface.d.ts +19 -32
- package/dist/bindings/interface.d.ts.map +1 -1
- package/dist/bindings/interface.js +6 -12
- package/dist/bindings/interface.js.map +1 -1
- package/dist/computeServer/interface.d.ts +34 -41
- package/dist/computeServer/interface.d.ts.map +1 -1
- package/dist/computeServer/secrets.d.ts +16 -20
- package/dist/computeServer/secrets.d.ts.map +1 -1
- package/dist/computeServer/secrets.js +11 -12
- package/dist/computeServer/secrets.js.map +1 -1
- package/dist/computeServer/types.d.ts +15 -17
- package/dist/computeServer/types.d.ts.map +1 -1
- package/dist/computeServer/types.js.map +1 -1
- package/dist/computeServer/utils.d.ts +8 -14
- package/dist/computeServer/utils.d.ts.map +1 -1
- package/dist/computeServer/utils.js +8 -16
- package/dist/computeServer/utils.js.map +1 -1
- package/dist/config.d.ts +16 -39
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -2
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +12 -19
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +6 -10
- package/dist/context.js.map +1 -1
- package/dist/data/interface.d.ts +32 -47
- package/dist/data/interface.d.ts.map +1 -1
- package/dist/data/interface.js +7 -10
- package/dist/data/interface.js.map +1 -1
- package/dist/definitions/interface.d.ts +24 -31
- package/dist/definitions/interface.d.ts.map +1 -1
- package/dist/definitions/schemas.d.ts.map +1 -1
- package/dist/definitions/schemas.js +6 -9
- package/dist/definitions/schemas.js.map +1 -1
- package/dist/definitions/types.d.ts +26 -42
- package/dist/definitions/types.d.ts.map +1 -1
- package/dist/definitions/types.js +0 -1
- package/dist/definitions/types.js.map +1 -1
- package/dist/errors/interface.d.ts +4 -8
- package/dist/errors/interface.d.ts.map +1 -1
- package/dist/errors/interface.js.map +1 -1
- package/dist/errors.d.ts +2 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +2 -5
- package/dist/errors.js.map +1 -1
- package/dist/events/audit.d.ts +13 -26
- package/dist/events/audit.d.ts.map +1 -1
- package/dist/events/interface.d.ts +17 -33
- package/dist/events/interface.d.ts.map +1 -1
- package/dist/events/interface.js +7 -22
- package/dist/events/interface.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/invites/interface.d.ts +3 -9
- package/dist/invites/interface.d.ts.map +1 -1
- package/dist/invites/types.d.ts +13 -10
- package/dist/invites/types.d.ts.map +1 -1
- package/dist/logging/interface.d.ts +19 -33
- package/dist/logging/interface.d.ts.map +1 -1
- package/dist/logging/interface.js +9 -17
- package/dist/logging/interface.js.map +1 -1
- package/dist/metrics/interface.d.ts +16 -31
- package/dist/metrics/interface.d.ts.map +1 -1
- package/dist/metrics/interface.js +1 -5
- package/dist/metrics/interface.js.map +1 -1
- package/dist/organizations/interface.d.ts +14 -23
- package/dist/organizations/interface.d.ts.map +1 -1
- package/dist/organizations/paths.d.ts +9 -12
- package/dist/organizations/paths.d.ts.map +1 -1
- package/dist/organizations/paths.js +12 -16
- package/dist/organizations/paths.js.map +1 -1
- package/dist/organizations/schemas.d.ts +10 -19
- package/dist/organizations/schemas.d.ts.map +1 -1
- package/dist/organizations/schemas.js +10 -19
- package/dist/organizations/schemas.js.map +1 -1
- package/dist/organizations/types.d.ts +3 -4
- package/dist/organizations/types.d.ts.map +1 -1
- package/dist/pagination.d.ts +13 -21
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/permissions/interface.d.ts +12 -21
- package/dist/permissions/interface.d.ts.map +1 -1
- package/dist/permissions/types.d.ts +5 -5
- package/dist/permissions/types.js +5 -5
- package/dist/platformProjects/interface.d.ts +7 -14
- package/dist/platformProjects/interface.d.ts.map +1 -1
- package/dist/platformProjects/types.d.ts +1 -4
- package/dist/platformProjects/types.d.ts.map +1 -1
- package/dist/projects/interface.d.ts +12 -17
- package/dist/projects/interface.d.ts.map +1 -1
- package/dist/shareLinks/interface.d.ts +5 -8
- package/dist/shareLinks/interface.d.ts.map +1 -1
- package/dist/shareLinks/schemas.d.ts.map +1 -1
- package/dist/shareLinks/schemas.js +1 -5
- package/dist/shareLinks/schemas.js.map +1 -1
- package/dist/shareLinks/types.d.ts +5 -6
- package/dist/shareLinks/types.d.ts.map +1 -1
- package/dist/shareLinks/types.js.map +1 -1
- package/dist/solveCache/interface.d.ts +32 -46
- package/dist/solveCache/interface.d.ts.map +1 -1
- package/dist/solveCache/interface.js.map +1 -1
- package/dist/storage/assetClasses.d.ts +16 -24
- package/dist/storage/assetClasses.d.ts.map +1 -1
- package/dist/storage/assetClasses.js +21 -28
- package/dist/storage/assetClasses.js.map +1 -1
- package/dist/storage/cacheBust.d.ts +12 -14
- package/dist/storage/cacheBust.d.ts.map +1 -1
- package/dist/storage/cacheBust.js +12 -14
- package/dist/storage/cacheBust.js.map +1 -1
- package/dist/storage/image.d.ts +9 -13
- package/dist/storage/image.d.ts.map +1 -1
- package/dist/storage/image.js +9 -13
- package/dist/storage/image.js.map +1 -1
- package/dist/userProfile/interface.d.ts +1 -1
- package/dist/userProfile/types.d.ts +1 -5
- package/dist/userProfile/types.d.ts.map +1 -1
- package/dist/userProfile/types.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/definitions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,IA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AE,WAAW;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/definitions/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,aAAa,GAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAa,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3F,MAAM,CAAC,MAAM,yBAAyB,GAAa,CAAC,GAAG,aAAa,EAAE,GAAG,sBAAsB,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,yBAAyB,GAA2B;IAChE,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;CACnB,CAAC;AA+GF,MAAM,UAAU,oBAAoB,CAAC,CAAmB;IACvD,OAAO;QACN,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,SAAS,EAAE,CAAC,CAAC,SAAS;KACtB,CAAC;AACH,CAAC"}
|
|
@@ -6,15 +6,11 @@
|
|
|
6
6
|
* only non-sensitive routing/identity fields are surfaced here.
|
|
7
7
|
*/
|
|
8
8
|
export interface ErrorContext {
|
|
9
|
-
/** HTTP method, when the error happened inside a request. */
|
|
10
9
|
method?: string;
|
|
11
|
-
/**
|
|
10
|
+
/** Never the query string — it can carry share tokens. */
|
|
12
11
|
route?: string;
|
|
13
|
-
/** Acting user id, when known. */
|
|
14
12
|
userId?: string;
|
|
15
|
-
/** Org the user was acting as, when known. */
|
|
16
13
|
orgId?: string;
|
|
17
|
-
/** Non-sensitive tags for grouping/search in the backend. */
|
|
18
14
|
tags?: Record<string, string>;
|
|
19
15
|
}
|
|
20
16
|
/**
|
|
@@ -27,9 +23,9 @@ export interface ErrorContext {
|
|
|
27
23
|
*/
|
|
28
24
|
export interface IErrorReporter {
|
|
29
25
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
26
|
+
* `error` is whatever was thrown/rejected — often an `Error`, but adapters
|
|
27
|
+
* occasionally reject with a plain object, so implementations must render
|
|
28
|
+
* defensively.
|
|
33
29
|
*/
|
|
34
30
|
capture(error: unknown, context?: ErrorContext): void;
|
|
35
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/errors/interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B,
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/errors/interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACtD;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IACvD,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI;CACvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/errors/interface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/errors/interface.ts"],"names":[],"mappings":"AAiCA;;;;GAIG;AACH,MAAM,OAAO,iBAAiB;IAC7B,OAAO,CAAC,MAAe,EAAE,QAAuB,IAAS,CAAC;CAC1D"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Thrown by providers to signal an expected failure
|
|
3
|
-
*
|
|
4
|
-
* plain `Error` and become 500s.
|
|
5
|
-
*
|
|
6
|
-
* Conventional values: 400, 401, 403, 404, 409, 422, 429, 500.
|
|
2
|
+
* Thrown by providers to signal an expected failure the API layer forwards with
|
|
3
|
+
* a specific status. Unknown errors should propagate as plain `Error` and become 500s.
|
|
7
4
|
*/
|
|
8
5
|
export declare class ProviderError extends Error {
|
|
9
6
|
readonly statusCode: number;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,OAAO,EAAE,MAAM,EAAE,UAAU,GAAE,MAAY;CAKrD"}
|
package/dist/errors.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Thrown by providers to signal an expected failure
|
|
3
|
-
*
|
|
4
|
-
* plain `Error` and become 500s.
|
|
5
|
-
*
|
|
6
|
-
* Conventional values: 400, 401, 403, 404, 409, 422, 429, 500.
|
|
2
|
+
* Thrown by providers to signal an expected failure the API layer forwards with
|
|
3
|
+
* a specific status. Unknown errors should propagate as plain `Error` and become 500s.
|
|
7
4
|
*/
|
|
8
5
|
export class ProviderError extends Error {
|
|
9
6
|
statusCode;
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC9B,UAAU,CAAS;IAE5B,YAAY,OAAe,EAAE,aAAqB,GAAG;QACpD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;CACD"}
|
package/dist/events/audit.d.ts
CHANGED
|
@@ -1,59 +1,46 @@
|
|
|
1
1
|
import type { RequestContext } from '../context.js';
|
|
2
2
|
import type { DomainEvent, DomainEventType } from './interface.js';
|
|
3
3
|
/**
|
|
4
|
-
* Read-side counterpart to `IEventSink
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `auditQuery` simply stays undefined on the data provider.
|
|
10
|
-
* - future webhook-dispatcher sinks aren't forced to implement a query path.
|
|
11
|
-
* - the contract here can throw on backend failure without violating the
|
|
12
|
-
* sink's "MUST NOT throw" rule.
|
|
4
|
+
* Read-side counterpart to `IEventSink`, kept as its own interface: a
|
|
5
|
+
* dev-mode `NoopEventSink` doesn't need a fake `query`, a future
|
|
6
|
+
* webhook-dispatcher sink isn't forced to implement one, and this contract
|
|
7
|
+
* can throw on backend failure without violating the sink's "MUST NOT throw"
|
|
8
|
+
* rule.
|
|
13
9
|
*
|
|
14
10
|
* Authorisation is the caller's job — implementations read from a privileged
|
|
15
|
-
* client (Supabase service-role, etc.) and assume the route layer
|
|
11
|
+
* client (Supabase service-role, etc.) and assume the route layer already
|
|
16
12
|
* gated on `instance_admin`.
|
|
17
13
|
*/
|
|
18
14
|
export interface AuditEventRow {
|
|
19
|
-
/** Stable row id from the persistent store (e.g. uuid). */
|
|
20
15
|
id: string;
|
|
21
|
-
/** ISO 8601.
|
|
16
|
+
/** ISO 8601. When the row was persisted, not when the mutation occurred. */
|
|
22
17
|
occurredAt: string;
|
|
23
18
|
type: DomainEventType;
|
|
24
19
|
actorId: string;
|
|
25
|
-
/** The full `DomainEvent` payload as recorded. */
|
|
26
20
|
data: DomainEvent;
|
|
27
21
|
}
|
|
28
22
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* rows on page boundaries.
|
|
23
|
+
* `(occurredAt, id)` lexicographic — `occurredAt` alone isn't unique under
|
|
24
|
+
* bursty writes, so the tie-breaker avoids skipping rows on page boundaries.
|
|
32
25
|
*/
|
|
33
26
|
export interface AuditCursor {
|
|
34
27
|
occurredAt: string;
|
|
35
28
|
id: string;
|
|
36
29
|
}
|
|
37
30
|
export interface AuditQueryFilters {
|
|
38
|
-
/**
|
|
31
|
+
/** Empty/undefined = all types. */
|
|
39
32
|
types?: readonly DomainEventType[];
|
|
40
|
-
/** Restrict to events emitted by this actor id (or `'system'`). */
|
|
41
33
|
actorId?: string;
|
|
42
|
-
/** Inclusive
|
|
34
|
+
/** Inclusive bounds, ISO 8601. */
|
|
43
35
|
sinceIso?: string;
|
|
44
|
-
/** Inclusive upper bound on `occurredAt`. ISO 8601. */
|
|
45
36
|
untilIso?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Page size. Implementations clamp to a sane upper bound (≤200) — callers
|
|
48
|
-
* shouldn't be able to request unbounded reads.
|
|
49
|
-
*/
|
|
37
|
+
/** Implementations clamp to a sane upper bound (<=200). */
|
|
50
38
|
limit?: number;
|
|
51
|
-
/** Keyset cursor from a previous page's `nextCursor`. */
|
|
52
39
|
cursor?: AuditCursor;
|
|
53
40
|
}
|
|
54
41
|
export interface AuditQueryResult {
|
|
55
42
|
rows: AuditEventRow[];
|
|
56
|
-
/** Null
|
|
43
|
+
/** Null past the last page. */
|
|
57
44
|
nextCursor: AuditCursor | null;
|
|
58
45
|
}
|
|
59
46
|
export interface IAuditQuery {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/events/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/events/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,aAAa;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,WAAW,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,iBAAiB;IACjC,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,+BAA+B;IAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACjF"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domain-event sink. Stores call `emit` AFTER a successful mutation; failed
|
|
3
|
-
* writes do not emit. `emit` MUST NOT throw — failures are the sink's
|
|
4
|
-
* problem to log and swallow.
|
|
5
|
-
*
|
|
6
|
-
* `actorId` is the user who triggered the change, or `'system'` for
|
|
7
|
-
* SYSTEM_CONTEXT mutations (bootstrap, janitor, migrations).
|
|
8
|
-
*/
|
|
9
1
|
export type DomainEvent = {
|
|
10
2
|
type: 'org.created';
|
|
11
3
|
orgId: string;
|
|
@@ -97,6 +89,7 @@ export type DomainEvent = {
|
|
|
97
89
|
type: 'invite.created';
|
|
98
90
|
inviteId: string;
|
|
99
91
|
orgId: string;
|
|
92
|
+
/** Plain text, unlike every other identifier here — redacted on erasure via `redact_audit_event_email`. */
|
|
100
93
|
email: string;
|
|
101
94
|
actorId: string;
|
|
102
95
|
} | {
|
|
@@ -136,47 +129,38 @@ export type DomainEvent = {
|
|
|
136
129
|
};
|
|
137
130
|
export type DomainEventType = DomainEvent['type'];
|
|
138
131
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
132
|
+
* A durable sink (e.g. Supabase `audit_events.event_version`) stamps every row
|
|
133
|
+
* with this so a reader dispatches on an explicit version instead of
|
|
134
|
+
* inferring the shape. Bump when the union's persisted form changes in a
|
|
135
|
+
* non-additive way.
|
|
143
136
|
*/
|
|
144
137
|
export declare const AUDIT_EVENT_VERSION = 1;
|
|
145
138
|
export interface IEventSink {
|
|
146
139
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
140
|
+
* Stores call this AFTER a successful mutation; a failed write does not
|
|
141
|
+
* emit.
|
|
149
142
|
*
|
|
150
|
-
* MUST NOT throw —
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* persistent failures internally and log them; the only side effect
|
|
155
|
-
* visible to the caller is a fulfilled promise.
|
|
143
|
+
* MUST NOT throw — an exception here would surface as a failed write even
|
|
144
|
+
* though the mutation already committed. Implementations must catch
|
|
145
|
+
* network errors, queue overflows, and other failures internally and log
|
|
146
|
+
* them; the caller only ever sees a fulfilled promise.
|
|
156
147
|
*
|
|
157
|
-
* MAY be fire-and-forget
|
|
158
|
-
*
|
|
159
|
-
* asynchronously are
|
|
148
|
+
* MAY be fire-and-forget: the contract is best-effort durable recording,
|
|
149
|
+
* not synchronous persistence. Adapters that queue and flush
|
|
150
|
+
* asynchronously are fine as long as they preserve event ordering per
|
|
160
151
|
* `actorId`.
|
|
161
152
|
*/
|
|
162
153
|
emit(event: DomainEvent): Promise<void>;
|
|
163
154
|
}
|
|
164
155
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* `userId === ''` denotes a server-internal caller (bootstrap, janitors,
|
|
168
|
-
* migrations).
|
|
156
|
+
* `ctx.userId === ''` is the `SYSTEM_CONTEXT` convention for a server-internal
|
|
157
|
+
* caller (bootstrap, janitors, migrations), which resolves to `'system'` here.
|
|
169
158
|
*/
|
|
170
159
|
export declare function actorFrom(ctx: {
|
|
171
160
|
userId: string;
|
|
172
161
|
system?: boolean;
|
|
173
162
|
}): string;
|
|
174
|
-
/**
|
|
175
|
-
* Default `IEventSink` — discards every event. Used when `SelvaConfig.events`
|
|
176
|
-
* is omitted, and as the safe fallback for adapters whose data layer has no
|
|
177
|
-
* event log (local-provider). Drop-in replace via `SelvaConfig.events` once a
|
|
178
|
-
* real dispatcher is wired.
|
|
179
|
-
*/
|
|
163
|
+
/** Discards every event. Used when `SelvaConfig.events` is omitted. */
|
|
180
164
|
export declare class NoopEventSink implements IEventSink {
|
|
181
165
|
emit(_event: DomainEvent): Promise<void>;
|
|
182
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/events/interface.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/events/interface.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GACpB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC5E;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC9E;IACA,IAAI,EAAE,yBAAyB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACf,GACD;IACA,IAAI,EAAE,gCAAgC,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;CACf,GACD;IAAE,IA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AO,EAAE,MAAM,CAAC;CACf,GACD;IACA,IAAI,EAAE,sBAAsB,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACf,CAAC;AAEL,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,MAAM,WAAW,UAAU;IAC1B;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAE3E;AAED,uEAAuE;AACvE,qBAAa,aAAc,YAAW,UAAU;IACzC,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAC9C"}
|
package/dist/events/interface.js
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `actorId` is the user who triggered the change, or `'system'` for
|
|
7
|
-
* SYSTEM_CONTEXT mutations (bootstrap, janitor, migrations).
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Schema version of the persisted `DomainEvent` payload (audit D3). A durable
|
|
11
|
-
* sink (e.g. Supabase `audit_events.event_version`) stamps every row with this
|
|
12
|
-
* so a later reader dispatches on an explicit version instead of inferring the
|
|
13
|
-
* shape. Bump when the union's persisted form changes in a non-additive way.
|
|
2
|
+
* A durable sink (e.g. Supabase `audit_events.event_version`) stamps every row
|
|
3
|
+
* with this so a reader dispatches on an explicit version instead of
|
|
4
|
+
* inferring the shape. Bump when the union's persisted form changes in a
|
|
5
|
+
* non-additive way.
|
|
14
6
|
*/
|
|
15
7
|
export const AUDIT_EVENT_VERSION = 1;
|
|
16
8
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `userId === ''` denotes a server-internal caller (bootstrap, janitors,
|
|
20
|
-
* migrations).
|
|
9
|
+
* `ctx.userId === ''` is the `SYSTEM_CONTEXT` convention for a server-internal
|
|
10
|
+
* caller (bootstrap, janitors, migrations), which resolves to `'system'` here.
|
|
21
11
|
*/
|
|
22
12
|
export function actorFrom(ctx) {
|
|
23
13
|
return ctx.userId || 'system';
|
|
24
14
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Default `IEventSink` — discards every event. Used when `SelvaConfig.events`
|
|
27
|
-
* is omitted, and as the safe fallback for adapters whose data layer has no
|
|
28
|
-
* event log (local-provider). Drop-in replace via `SelvaConfig.events` once a
|
|
29
|
-
* real dispatcher is wired.
|
|
30
|
-
*/
|
|
15
|
+
/** Discards every event. Used when `SelvaConfig.events` is omitted. */
|
|
31
16
|
export class NoopEventSink {
|
|
32
17
|
async emit(_event) { }
|
|
33
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/events/interface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/events/interface.ts"],"names":[],"mappings":"AAgFA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAoBrC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,GAAyC;IAClE,OAAO,GAAG,CAAC,MAAM,IAAI,QAAQ,CAAC;AAC/B,CAAC;AAED,uEAAuE;AACvE,MAAM,OAAO,aAAa;IACzB,KAAK,CAAC,IAAI,CAAC,MAAmB,IAAkB,CAAC;CACjD"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|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AAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAMvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAWtD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAYzE,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,MAAM,0BAA0B,CAAC;AAclC,OAAO,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAatF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAU7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAMjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAM9D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMhE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AASrE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -12,10 +12,8 @@ import type { Invite } from './types.js';
|
|
|
12
12
|
export interface IInviteStore {
|
|
13
13
|
create(ctx: RequestContext, invite: Invite): Promise<void>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* passes the digest here. Returns null for unknown, expired, or
|
|
18
|
-
* consumed invites.
|
|
15
|
+
* Caller hashes the inbound raw token and passes the digest here. Returns
|
|
16
|
+
* null for unknown, expired, or consumed invites.
|
|
19
17
|
*/
|
|
20
18
|
getByTokenHash(ctx: RequestContext, tokenHash: string): Promise<Invite | null>;
|
|
21
19
|
listByOrg(ctx: RequestContext, orgId: string, opts?: ListOptions): Promise<Page<Invite>>;
|
|
@@ -23,11 +21,7 @@ export interface IInviteStore {
|
|
|
23
21
|
markAccepted(ctx: RequestContext, id: string, userId: string): Promise<void>;
|
|
24
22
|
/** No-op if already consumed or missing. */
|
|
25
23
|
revoke(ctx: RequestContext, id: string): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Hard-delete every invite belonging to an org. Called from `deleteOrg`
|
|
28
|
-
* cascade — pending invites to a deleted org are unredeemable, so leaving
|
|
29
|
-
* them behind only creates orphans.
|
|
30
|
-
*/
|
|
24
|
+
/** Called from the `deleteOrg` cascade — invites to a deleted org are unredeemable orphans otherwise. */
|
|
31
25
|
deleteByOrg(ctx: RequestContext, orgId: string): Promise<void>;
|
|
32
26
|
}
|
|
33
27
|
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/invites/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/invites/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D;;;OAGG;IACH,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE/E,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzF,iCAAiC;IACjC,YAAY,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E,4CAA4C;IAC5C,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD,yGAAyG;IACzG,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D"}
|
package/dist/invites/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OrgRole, OrgPermission } from '../organizations/schemas.js';
|
|
2
|
+
import type { PlatformPermission } from '../permissions/types.js';
|
|
2
3
|
/**
|
|
3
4
|
* "The holder of the raw token whose hash is `tokenHash` may join `orgId` at
|
|
4
5
|
* `orgRole` with these org permissions." Accepting creates the user (if
|
|
@@ -14,25 +15,27 @@ import type { OrgRole, OrgPermission } from '../organizations/schemas.js';
|
|
|
14
15
|
*/
|
|
15
16
|
export interface Invite {
|
|
16
17
|
id: string;
|
|
17
|
-
/**
|
|
18
|
-
* `HMAC-SHA256(SELVA_HMAC_KEY, rawToken)` — base64url. The raw token
|
|
19
|
-
* never crosses the store boundary; the route layer hashes inbound tokens
|
|
20
|
-
* before lookup.
|
|
21
|
-
*/
|
|
18
|
+
/** `HMAC-SHA256(SELVA_HMAC_KEY, rawToken)`, base64url. The raw token never crosses the store boundary. */
|
|
22
19
|
tokenHash: string;
|
|
23
|
-
/** Lowercase
|
|
20
|
+
/** Lowercase. */
|
|
24
21
|
email: string;
|
|
25
22
|
orgId: string;
|
|
26
23
|
orgRole: OrgRole;
|
|
24
|
+
/** May be empty — adapters may seed from `DEFAULT_ORG_PERMISSIONS` in that case. */
|
|
25
|
+
orgPermissions: OrgPermission[];
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* Instance-wide permissions granted on accept — usually empty.
|
|
28
|
+
*
|
|
29
|
+
* Only a caller who already holds `instance_admin` may mint an invite
|
|
30
|
+
* carrying these; the mint route enforces that, because anyone able to set
|
|
31
|
+
* this field can hand out `instance_admin` and escalate past org scope.
|
|
32
|
+
* Optional so invites stored before this field existed still parse.
|
|
30
33
|
*/
|
|
31
|
-
|
|
34
|
+
platformPermissions?: PlatformPermission[];
|
|
32
35
|
invitedBy: string;
|
|
33
36
|
createdAt: string;
|
|
34
37
|
expiresAt: string;
|
|
35
|
-
/** Set when consumed
|
|
38
|
+
/** Set when consumed; consumed invites are not re-usable. */
|
|
36
39
|
acceptedAt?: string;
|
|
37
40
|
acceptedByUserId?: string;
|
|
38
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/invites/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/invites/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,MAAM;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,0GAA0G;IAC1G,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Structured logging seam
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* hard pino import would impose a logger (and its transport config) on every
|
|
10
|
-
* embedder, including ones that already own their logging stack.
|
|
11
|
-
* - Tests capture log output by passing a fake, with no transport to stub.
|
|
12
|
-
* - Call sites stay honest: they describe WHAT happened and hand over fields;
|
|
13
|
-
* formatting, redaction and routing are the backend's business.
|
|
2
|
+
* Structured logging seam: the interface + a safe default live here, the real
|
|
3
|
+
* backend (pino) ships from `@selvajs/server` so `@selvajs/platform` never
|
|
4
|
+
* gains a logging dependency and browser-side consumers never pull a Node
|
|
5
|
+
* logger into a bundle. A hard pino import would also impose a transport
|
|
6
|
+
* config on every embedder, including ones that already own a logging stack.
|
|
7
|
+
* Call sites describe WHAT happened and hand over fields; formatting,
|
|
8
|
+
* redaction and routing are the backend's business.
|
|
14
9
|
*/
|
|
15
10
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* being flattened into a message string the way the old `console.log`
|
|
20
|
-
* template-literal calls did.
|
|
11
|
+
* Fields attached to one log record. Values are `unknown`, not `string`, so a
|
|
12
|
+
* field survives as typed JSON (numbers stay numbers, queryable by range)
|
|
13
|
+
* instead of being flattened into a message string.
|
|
21
14
|
*
|
|
22
15
|
* Never put secrets here — session tokens, API keys, refresh tokens, raw share
|
|
23
|
-
* tokens. Log records
|
|
24
|
-
*
|
|
16
|
+
* tokens. Log records leave the box (stdout to collector to third-party index)
|
|
17
|
+
* and outlive the credential.
|
|
25
18
|
*/
|
|
26
19
|
export type LogFields = Record<string, unknown>;
|
|
27
20
|
/**
|
|
28
|
-
* Severity levels, ordered
|
|
29
|
-
*
|
|
21
|
+
* Severity levels, ordered to match pino's set so the backend is a thin
|
|
22
|
+
* pass-through and operators get the level names they expect.
|
|
30
23
|
*
|
|
31
|
-
* Guidance, since the old `console.*` calls used levels inconsistently:
|
|
32
24
|
* - `debug` — detail only useful when actively diagnosing; off in production.
|
|
33
25
|
* - `info` — a thing happened that an operator would want in the record
|
|
34
26
|
* (boot, config resolved, request completed).
|
|
@@ -51,12 +43,9 @@ export interface ILogger {
|
|
|
51
43
|
warn(message: string, fields?: LogFields): void;
|
|
52
44
|
error(message: string, fields?: LogFields): void;
|
|
53
45
|
/**
|
|
54
|
-
* Derive a logger that stamps `fields` onto every record it writes.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* (plus method/route) ONCE, and every downstream call site logs without
|
|
58
|
-
* knowing a request id exists. Correlation stops being each call site's
|
|
59
|
-
* problem — which is exactly why the 199 `console.*` calls had none.
|
|
46
|
+
* Derive a logger that stamps `fields` onto every record it writes. The
|
|
47
|
+
* request hook binds `requestId` (plus method/route) once via `child`, so
|
|
48
|
+
* every downstream call site logs without knowing a request id exists.
|
|
60
49
|
*
|
|
61
50
|
* Children compose; a child of a child carries both parents' fields. A
|
|
62
51
|
* child's field overwrites a parent's on key collision.
|
|
@@ -66,11 +55,8 @@ export interface ILogger {
|
|
|
66
55
|
/**
|
|
67
56
|
* Default `ILogger` — discards everything. Lets library code log
|
|
68
57
|
* unconditionally without a configured backend, and keeps test output clean.
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* a real logger at its composition root. A library consumer that wires nothing
|
|
72
|
-
* gets silence rather than unsolicited stdout writes — the same bargain
|
|
73
|
-
* `NoopErrorReporter` makes.
|
|
58
|
+
* The app wires a real logger at its composition root; a consumer that wires
|
|
59
|
+
* nothing gets silence rather than unsolicited stdout writes.
|
|
74
60
|
*/
|
|
75
61
|
export declare class NoopLogger implements ILogger {
|
|
76
62
|
debug(_message: string, _fields?: LogFields): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/logging/interface.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/logging/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACvB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACjD;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;CAClC;AAED;;;;;GAKG;AACH,qBAAa,UAAW,YAAW,OAAO;IACzC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI;IAClD,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI;IACjD,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI;IACjD,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI;IAClD,KAAK,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO;CAGlC"}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Structured logging seam
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* hard pino import would impose a logger (and its transport config) on every
|
|
10
|
-
* embedder, including ones that already own their logging stack.
|
|
11
|
-
* - Tests capture log output by passing a fake, with no transport to stub.
|
|
12
|
-
* - Call sites stay honest: they describe WHAT happened and hand over fields;
|
|
13
|
-
* formatting, redaction and routing are the backend's business.
|
|
2
|
+
* Structured logging seam: the interface + a safe default live here, the real
|
|
3
|
+
* backend (pino) ships from `@selvajs/server` so `@selvajs/platform` never
|
|
4
|
+
* gains a logging dependency and browser-side consumers never pull a Node
|
|
5
|
+
* logger into a bundle. A hard pino import would also impose a transport
|
|
6
|
+
* config on every embedder, including ones that already own a logging stack.
|
|
7
|
+
* Call sites describe WHAT happened and hand over fields; formatting,
|
|
8
|
+
* redaction and routing are the backend's business.
|
|
14
9
|
*/
|
|
15
10
|
/**
|
|
16
11
|
* Default `ILogger` — discards everything. Lets library code log
|
|
17
12
|
* unconditionally without a configured backend, and keeps test output clean.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* a real logger at its composition root. A library consumer that wires nothing
|
|
21
|
-
* gets silence rather than unsolicited stdout writes — the same bargain
|
|
22
|
-
* `NoopErrorReporter` makes.
|
|
13
|
+
* The app wires a real logger at its composition root; a consumer that wires
|
|
14
|
+
* nothing gets silence rather than unsolicited stdout writes.
|
|
23
15
|
*/
|
|
24
16
|
export class NoopLogger {
|
|
25
17
|
debug(_message, _fields) { }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/logging/interface.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/logging/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkDH;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IACtB,KAAK,CAAC,QAAgB,EAAE,OAAmB,IAAS,CAAC;IACrD,IAAI,CAAC,QAAgB,EAAE,OAAmB,IAAS,CAAC;IACpD,IAAI,CAAC,QAAgB,EAAE,OAAmB,IAAS,CAAC;IACpD,KAAK,CAAC,QAAgB,EAAE,OAAmB,IAAS,CAAC;IACrD,KAAK,CAAC,OAAkB;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|