@substrat-run/kernel 0.116.0 → 0.117.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/dist/capability.d.ts +220 -0
- package/dist/capability.d.ts.map +1 -0
- package/dist/capability.js +537 -0
- package/dist/capability.js.map +1 -0
- package/dist/check-key.d.ts +30 -0
- package/dist/check-key.d.ts.map +1 -0
- package/dist/check-key.js +37 -0
- package/dist/check-key.js.map +1 -0
- package/dist/denial-query.d.ts +32 -1
- package/dist/denial-query.d.ts.map +1 -1
- package/dist/denial-query.js +66 -28
- package/dist/denial-query.js.map +1 -1
- package/dist/index.d.ts +19 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/outbox-event.d.ts +131 -0
- package/dist/outbox-event.d.ts.map +1 -0
- package/dist/outbox-event.js +185 -0
- package/dist/outbox-event.js.map +1 -0
- package/dist/permission-checker.d.ts +8 -1
- package/dist/permission-checker.d.ts.map +1 -1
- package/dist/permission-checker.js +18 -0
- package/dist/permission-checker.js.map +1 -1
- package/dist/permission-eval.d.ts +8 -0
- package/dist/permission-eval.d.ts.map +1 -1
- package/dist/permission-eval.js +164 -91
- package/dist/permission-eval.js.map +1 -1
- package/dist/platform-request-query.d.ts +58 -1
- package/dist/platform-request-query.d.ts.map +1 -1
- package/dist/platform-request-query.js +61 -1
- package/dist/platform-request-query.js.map +1 -1
- package/dist/platform-sweep.d.ts +123 -8
- package/dist/platform-sweep.d.ts.map +1 -1
- package/dist/platform-sweep.js +158 -34
- package/dist/platform-sweep.js.map +1 -1
- package/dist/row-decode.d.ts +107 -0
- package/dist/row-decode.d.ts.map +1 -0
- package/dist/row-decode.js +93 -0
- package/dist/row-decode.js.map +1 -0
- package/dist/scope-host.d.ts +211 -9
- package/dist/scope-host.d.ts.map +1 -1
- package/dist/scope-host.js +33 -0
- package/dist/scope-host.js.map +1 -1
- package/dist/scope-tuple-seat.d.ts +72 -0
- package/dist/scope-tuple-seat.d.ts.map +1 -0
- package/dist/scope-tuple-seat.js +93 -0
- package/dist/scope-tuple-seat.js.map +1 -0
- package/dist/subject-redaction.d.ts +160 -0
- package/dist/subject-redaction.d.ts.map +1 -0
- package/dist/subject-redaction.js +210 -0
- package/dist/subject-redaction.js.map +1 -0
- package/dist/system-switch.d.ts +108 -0
- package/dist/system-switch.d.ts.map +1 -0
- package/dist/system-switch.js +145 -0
- package/dist/system-switch.js.map +1 -0
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.js +109 -57
- package/dist/timeline.js.map +1 -1
- package/package.json +2 -2
package/dist/denial-query.d.ts
CHANGED
|
@@ -37,7 +37,22 @@ export interface DenialRow {
|
|
|
37
37
|
* stringified. Round-trips exactly what `recordDenial` wrote in both adapters.
|
|
38
38
|
*/
|
|
39
39
|
export declare function storedActor(input: string): string;
|
|
40
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Turn a stored row into the contract shape — TOLERANTLY, and saying so (#1636).
|
|
42
|
+
*
|
|
43
|
+
* Every read of this log is a LIST, and the decode used to `JSON.parse` while mapping: one
|
|
44
|
+
* row whose `actor` or `impersonation` would not parse threw for the page, which for the
|
|
45
|
+
* only witness to a refused check is the worst read to lose. Each field is now decoded
|
|
46
|
+
* against its own contract field and whatever did not decode is named in `decodeError`,
|
|
47
|
+
* on `rowDecoder`'s rules — an undecodable actor reads as {@link UNDECODED_ACTOR}, and a
|
|
48
|
+
* row whose id, tenant or time does not decode still throws, naming them.
|
|
49
|
+
*
|
|
50
|
+
* `permission` is the exception to that last rule, deliberately. A malformed key is not
|
|
51
|
+
* only a dump's doing: nothing validates a checked key at runtime, so a module that casts
|
|
52
|
+
* one is refused and the refusal is recorded with it — and this log is where someone comes
|
|
53
|
+
* to find out why. Throwing would hide the evidence along with the list. So it reads as
|
|
54
|
+
* {@link UNDECODED_PERMISSION}, and `decodeError` quotes the stored key verbatim.
|
|
55
|
+
*/
|
|
41
56
|
export declare function mapDenialRow(row: DenialRow): PermissionDenial;
|
|
42
57
|
/** A bounded page of raw denial rows, newest first. */
|
|
43
58
|
export declare function denialListQuery(filter?: DenialFilter): {
|
|
@@ -70,6 +85,13 @@ export interface DenialBucketRow {
|
|
|
70
85
|
first_at: string;
|
|
71
86
|
last_at: string;
|
|
72
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* One (actor, permission) bucket, tolerantly (#1636). The buckets are `GROUP BY actor`, so a
|
|
90
|
+
* stored actor that would not parse is its own bucket — and used to throw the whole summary,
|
|
91
|
+
* the read a console opens first. It reads as {@link UNDECODED_ACTOR} now, still counted,
|
|
92
|
+
* with `decodeError` saying why. A malformed permission key is its own bucket too, and reads
|
|
93
|
+
* as {@link UNDECODED_PERMISSION} with the stored key quoted — `mapDenialRow` says why.
|
|
94
|
+
*/
|
|
73
95
|
export declare function mapDenialBucketRow(row: DenialBucketRow): DenialBucket;
|
|
74
96
|
export interface DenialOperationBucketRow {
|
|
75
97
|
operation: string | null;
|
|
@@ -77,6 +99,15 @@ export interface DenialOperationBucketRow {
|
|
|
77
99
|
first_at: string;
|
|
78
100
|
last_at: string;
|
|
79
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* One operation bucket, tolerantly (#1643) — the sibling `mapDenialBucketRow` already was.
|
|
104
|
+
*
|
|
105
|
+
* `operation` is the only column with an empty value its schema accepts: one that is not
|
|
106
|
+
* text reads as `null`, and `decodeError` says so, which is what keeps it from reading as
|
|
107
|
+
* the bucket for a refusal that ran outside an operation. `count` and the two times are
|
|
108
|
+
* required scalars: a bucket that breaks one throws, naming them, rather than being
|
|
109
|
+
* returned typed as valid.
|
|
110
|
+
*/
|
|
80
111
|
export declare function mapDenialOperationBucketRow(row: DenialOperationBucketRow): DenialOperationBucket;
|
|
81
112
|
/** The half of a `DenialSummary` the grouped query answers; the facts are the other half. */
|
|
82
113
|
export type DenialSummaryBuckets = Pick<DenialActorSummary, 'groupBy' | 'buckets'> | Pick<DenialOperationSummary, 'groupBy' | 'buckets'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"denial-query.d.ts","sourceRoot":"","sources":["../src/denial-query.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"denial-query.d.ts","sourceRoot":"","sources":["../src/denial-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;;;GAWG;AAEH,gFAAgF;AAChF,eAAO,MAAM,cAAc,wGAC4E,CAAC;AAExG,0DAA0D;AAC1D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gFAAgF;IAChF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kFAAkF;IAClF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,SAAS,GAAG,gBAAgB,CAkB7D;AAgCD,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CA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;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,QAGL,CAAC;AAE5B,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB"}
|
package/dist/denial-query.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_DENIAL_LIMIT, denialFilter, } from '@substrat-run/contracts';
|
|
1
|
+
import { DEFAULT_DENIAL_LIMIT, denialBucket, denialFilter, denialOperationBucket, permissionDenial, } from '@substrat-run/contracts';
|
|
2
|
+
import { rowDecoder, UNDECODED_ACTOR, UNDECODED_PERMISSION } from './row-decode.js';
|
|
2
3
|
/**
|
|
3
4
|
* The SELECTs behind every read of a scope's denial log (#867, K-35's stated tail).
|
|
4
5
|
*
|
|
@@ -30,23 +31,40 @@ export function storedActor(input) {
|
|
|
30
31
|
return JSON.stringify(input);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Turn a stored row into the contract shape — TOLERANTLY, and saying so (#1636).
|
|
36
|
+
*
|
|
37
|
+
* Every read of this log is a LIST, and the decode used to `JSON.parse` while mapping: one
|
|
38
|
+
* row whose `actor` or `impersonation` would not parse threw for the page, which for the
|
|
39
|
+
* only witness to a refused check is the worst read to lose. Each field is now decoded
|
|
40
|
+
* against its own contract field and whatever did not decode is named in `decodeError`,
|
|
41
|
+
* on `rowDecoder`'s rules — an undecodable actor reads as {@link UNDECODED_ACTOR}, and a
|
|
42
|
+
* row whose id, tenant or time does not decode still throws, naming them.
|
|
43
|
+
*
|
|
44
|
+
* `permission` is the exception to that last rule, deliberately. A malformed key is not
|
|
45
|
+
* only a dump's doing: nothing validates a checked key at runtime, so a module that casts
|
|
46
|
+
* one is refused and the refusal is recorded with it — and this log is where someone comes
|
|
47
|
+
* to find out why. Throwing would hide the evidence along with the list. So it reads as
|
|
48
|
+
* {@link UNDECODED_PERMISSION}, and `decodeError` quotes the stored key verbatim.
|
|
49
|
+
*/
|
|
34
50
|
export function mapDenialRow(row) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
const shape = permissionDenial.shape;
|
|
52
|
+
const d = rowDecoder(`denial row ${JSON.stringify(row.id)}`, 'PermissionDenial');
|
|
53
|
+
return d.finish({
|
|
54
|
+
id: d.required('id', shape.id, row.id),
|
|
55
|
+
actor: d.json('actor', shape.actor, row.actor, UNDECODED_ACTOR),
|
|
56
|
+
permission: d.marked('permission', shape.permission, row.permission, UNDECODED_PERMISSION),
|
|
57
|
+
tenantId: d.required('tenant_id', shape.tenantId, row.tenant_id),
|
|
58
|
+
scopeId: d.nullable('scope_id', shape.scopeId, row.scope_id ?? null),
|
|
59
|
+
operation: d.nullable('operation', shape.operation, row.operation ?? null),
|
|
60
|
+
impersonation: d.json('impersonation', shape.impersonation, row.impersonation ?? null, null),
|
|
43
61
|
// #1525: which CALL was refused, not merely which operation — the join that lets
|
|
44
62
|
// "same call" reach a request's refusals. `?? null` rather than a bare read, for
|
|
45
63
|
// the row a legacy store hands back with the column absent.
|
|
46
|
-
invocationId: row.invocation_id ?? null,
|
|
47
|
-
at: row.at,
|
|
48
|
-
drainedAt: row.drained_at ?? null,
|
|
49
|
-
};
|
|
64
|
+
invocationId: d.nullable('invocation_id', shape.invocationId, row.invocation_id ?? null),
|
|
65
|
+
at: d.required('at', shape.at, row.at),
|
|
66
|
+
drainedAt: d.nullable('drained_at', shape.drainedAt, row.drained_at ?? null),
|
|
67
|
+
});
|
|
50
68
|
}
|
|
51
69
|
/** The WHERE fragment shared by the row read and the summary. */
|
|
52
70
|
function where(f) {
|
|
@@ -122,23 +140,43 @@ export function denialSummaryQuery(filter) {
|
|
|
122
140
|
groupBy,
|
|
123
141
|
};
|
|
124
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* One (actor, permission) bucket, tolerantly (#1636). The buckets are `GROUP BY actor`, so a
|
|
145
|
+
* stored actor that would not parse is its own bucket — and used to throw the whole summary,
|
|
146
|
+
* the read a console opens first. It reads as {@link UNDECODED_ACTOR} now, still counted,
|
|
147
|
+
* with `decodeError` saying why. A malformed permission key is its own bucket too, and reads
|
|
148
|
+
* as {@link UNDECODED_PERMISSION} with the stored key quoted — `mapDenialRow` says why.
|
|
149
|
+
*/
|
|
125
150
|
export function mapDenialBucketRow(row) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
151
|
+
const shape = denialBucket.shape;
|
|
152
|
+
const d = rowDecoder(`denial bucket for ${JSON.stringify(row.permission)}`, 'DenialBucket');
|
|
153
|
+
return d.finish({
|
|
154
|
+
actor: d.json('actor', shape.actor, row.actor, UNDECODED_ACTOR),
|
|
155
|
+
permission: d.marked('permission', shape.permission, row.permission, UNDECODED_PERMISSION),
|
|
156
|
+
count: d.required('count', shape.count, Number(row.count)),
|
|
157
|
+
operations: d.required('operations', shape.operations, Number(row.operations)),
|
|
158
|
+
firstAt: d.required('first_at', shape.firstAt, row.first_at),
|
|
159
|
+
lastAt: d.required('last_at', shape.lastAt, row.last_at),
|
|
160
|
+
});
|
|
134
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* One operation bucket, tolerantly (#1643) — the sibling `mapDenialBucketRow` already was.
|
|
164
|
+
*
|
|
165
|
+
* `operation` is the only column with an empty value its schema accepts: one that is not
|
|
166
|
+
* text reads as `null`, and `decodeError` says so, which is what keeps it from reading as
|
|
167
|
+
* the bucket for a refusal that ran outside an operation. `count` and the two times are
|
|
168
|
+
* required scalars: a bucket that breaks one throws, naming them, rather than being
|
|
169
|
+
* returned typed as valid.
|
|
170
|
+
*/
|
|
135
171
|
export function mapDenialOperationBucketRow(row) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
172
|
+
const shape = denialOperationBucket.shape;
|
|
173
|
+
const d = rowDecoder(`denial operation bucket ${JSON.stringify(row.operation ?? null)}`, 'DenialOperationBucket');
|
|
174
|
+
return d.finish({
|
|
175
|
+
operation: d.nullable('operation', shape.operation, row.operation ?? null),
|
|
176
|
+
count: d.required('count', shape.count, Number(row.count)),
|
|
177
|
+
firstAt: d.required('first_at', shape.firstAt, row.first_at),
|
|
178
|
+
lastAt: d.required('last_at', shape.lastAt, row.last_at),
|
|
179
|
+
});
|
|
142
180
|
}
|
|
143
181
|
/**
|
|
144
182
|
* Map the rows `denialSummaryQuery` came back with, under the grouping it reported —
|
package/dist/denial-query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"denial-query.js","sourceRoot":"","sources":["../src/denial-query.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,YAAY,
|
|
1
|
+
{"version":3,"file":"denial-query.js","sourceRoot":"","sources":["../src/denial-query.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,GAQjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEpF;;;;;;;;;;;GAWG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GACzB,qGAAqG,CAAC;AAkBxG;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC;AAED;;;;;;;;;;;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B,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,oDAAoD;IACpD,qEAAqE;IACrE,yBAAyB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { AccessLogFilter, AttachmentUploadInput, AuditLogFilter, BlobStoreProvisionInput, BlobStoreRecord, ConsumerHandler, ExecutorDeadLetter, ExecutorDrainReport, ExecutorHandler, ExecutorRetryPolicy, ConnectorConnection, ScopedConnectorConnection, ConnectorContext, ConnectorHandler, ConnectorOptions, ConnectorRequestInit, ConnectorResponse, Clock, FetchLike, GuardPredicate, HostAdmin, MigrateScopeOutcome, MigrationFrontier, ModuleRegistration, ConsumersOf, EventContract, EventPayloadOf, EventTypeOf, TypedConsumerHandler, TypedConsumers, OpenedAttachment, OperationContext, PageParams, OperationHandler, AppliedMigration, OpsFailureFilter, OpsFailureInput, IssueFilter, SweepRunFilter, SweepRunInput, ProvisionScopeInput, RoleFilter, FreshnessRegistration, FreshnessReport, LiveChange, LiveReadSurface, LiveUpgradeRequest, ScheduleRegistration, ScheduleRunReport, ScopeAttachments, ScopedSql, ScopeFilter, ScopeHost, ScopeStub, ScopeStubOptions, InvokeOptions, SqlMigration, SqlValue, TenantBlobStore, TenantRelationalStore, TenantStoreProvisionInput, TenantStoreRecord, } from './scope-host.js';
|
|
2
|
-
export { assertRedrainWindow, attachmentBlobKey, consumersFor, entitlementDenial, backoffAt, globalFetch, parseValidationRecords, resolveRetryPolicy, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, ISSUE_RETENTION_DAYS, } from './scope-host.js';
|
|
2
|
+
export { assertRedrainWindow, attachmentBlobKey, consumersFor, entitlementDenial, backoffAt, globalFetch, parseValidationRecords, resolveRetryPolicy, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, SWEEP_RUNS_INTENT_INDEX, sweepRunsIntentHasKind, ISSUE_RETENTION_DAYS, } from './scope-host.js';
|
|
3
3
|
export { isSecretBoxConfigured, SecretBoxUnconfiguredError, unconfiguredSecretBox, webCryptoSecretBox, } from './secret-box.js';
|
|
4
4
|
export type { SealedSecret, SecretBox } from './secret-box.js';
|
|
5
5
|
export { ConnectionSealingKeyUnavailableError, generateSealingKeyPair, noSealingKeyMessage, openSealed, sealTo, SealedKeyUnavailableError, } from './sealed-box.js';
|
|
@@ -9,10 +9,12 @@ export type { SubjectKeyRecords, SubjectKeyRow, SubjectKeys } from './subject-ke
|
|
|
9
9
|
export { resolveScopeRecord } from './scope-record.js';
|
|
10
10
|
export type { ResolvedScopeRecord } from './scope-record.js';
|
|
11
11
|
export { assertAllowed, denyAllChecker, PermissionDenied, UNSAFE_allowAllChecker, } from './permission-checker.js';
|
|
12
|
-
export { asPrincipal } from './permission-checker.js';
|
|
12
|
+
export { actorOf, asPrincipal } from './permission-checker.js';
|
|
13
13
|
export type { PermissionChecker } from './permission-checker.js';
|
|
14
14
|
export { createTupleEvaluator } from './permission-eval.js';
|
|
15
15
|
export type { PermissionTupleReader, PermissionTupleRow, ScopeTupleReader, } from './permission-eval.js';
|
|
16
|
+
export { CAPABILITY_COLUMNS, CAPABILITY_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_SESSION_PRUNE_BATCH, WITHHELD_SECRET, assertNoSecret, capabilityByIdQuery, capabilityExchangeable, capabilityGrantOf, capabilityLive, capabilityRecordOf, capabilityTokenHash, carriesSecret, checkBecomeInput, createCapabilityVerbs, exchangeCapability, guardSecrets, mintBecomeCapability, mintCapabilitySecret, mintCapabilitySessionToken, persistedText, plausibleSessionToken, redactSecrets, resolveCapabilitySession, revokeCapabilityAsPlatform, } from './capability.js';
|
|
17
|
+
export type { CapabilityGrantView, CapabilityRow, CapabilityVerbDeps, CapabilityVerbs, } from './capability.js';
|
|
16
18
|
export { createAtomic } from './sub-transaction.js';
|
|
17
19
|
export type { RunSub, AtomicMarks } from './sub-transaction.js';
|
|
18
20
|
export { DEFAULT_SEARCH_LIMIT, MAX_SEARCH_LIMIT, MIN_SEARCH_TERM, NotSearchable, SEARCH_INDEX_PREFIX, SearchTermTooShort, isSearchIndexTable, searchIndexDdl, searchIndexMigrations, searchIndexPlans, searchLimit, searchMatchExpression, searchPlansByEntityType, searchQuery, } from './search-index.js';
|
|
@@ -24,24 +26,37 @@ export type { ManualClock } from './clock.js';
|
|
|
24
26
|
export { createUlid, ulid, ulidTime, type UlidMint } from './ulid.js';
|
|
25
27
|
export { assertReadOnlyQuery } from './read-only-sql.js';
|
|
26
28
|
export { assertNoSpineWrite, guardSpine } from './spine-guard.js';
|
|
29
|
+
export { assertPermissionKey } from './check-key.js';
|
|
27
30
|
export { assertModuleEnqueueableKind } from './platform-kinds.js';
|
|
28
31
|
export { readRoutedNode, RouterAssertionError } from './routed-node.js';
|
|
29
32
|
export type { RoutedNode, HeaderReader, ReadRoutedNodeOptions } from './routed-node.js';
|
|
30
33
|
export { assertPlatformCall, PlatformCallError, PLATFORM_SECRET_HEADER, PLATFORM_REQUEST_HEADER, CONNECTOR_ATTACHMENT_RECORD_HEADER, } from './platform-call.js';
|
|
31
34
|
export { signConnectState, verifyConnectState, ConnectStateError, CONNECT_STATE_PURPOSE, } from './connect-state.js';
|
|
32
35
|
export type { ConnectStateClaim } from './connect-state.js';
|
|
33
|
-
export { PLATFORM_REQUEST_COLUMNS, platformRequestHistoryQuery, } from './platform-request-query.js';
|
|
36
|
+
export { PLATFORM_REQUEST_COLUMNS, platformRequestHistoryQuery, platformRequestOf, UNDECODED_REQUESTER, } from './platform-request-query.js';
|
|
37
|
+
export type { PlatformRequestRawRow } from './platform-request-query.js';
|
|
38
|
+
export { CANCELLED_INTENT_NOTE, intentPayloadCarriesSubject, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, REDACTED_INTENT_MARKER, REDACTED_INTENT_NOTE, redactedIntentPayload, } from './subject-redaction.js';
|
|
39
|
+
export type { PlatformRequestRedactionCandidate, SubjectRedactionCounts, } from './subject-redaction.js';
|
|
40
|
+
export { effectiveRoleGrantQuery, seatScopeTuple } from './scope-tuple-seat.js';
|
|
41
|
+
export { SYSTEM_SWITCH_OFF_PREDICATE, SYSTEM_SWITCH_OFF_RELATION, switchSystemSchedules, systemScheduleState, systemSwitchedOff, systemSwitchedOffMessage, } from './system-switch.js';
|
|
42
|
+
export type { SwitchOutcome, SwitchSql, SystemScheduleState } from './system-switch.js';
|
|
34
43
|
export { DENIAL_COLUMNS, DENIAL_WINDOW_QUERY, denialListQuery, denialSummaryQuery, denialTotalsQuery, mapDenialRow, mapDenialBucketRow, mapDenialOperationBucketRow, mapDenialSummaryBuckets, storedActor, type DenialRow, type DenialBucketRow, type DenialOperationBucketRow, type DenialSummaryBuckets, type DenialWindowRow, } from './denial-query.js';
|
|
35
44
|
export { entityVersionQuery, entityVersionOf, assertIfMatch, OUTBOX_ENTITY_INDEX, type EntityVersion, type EntityVersionRow, } from './entity-version.js';
|
|
36
45
|
export { IMPERSONATION_COLUMNS, IMPERSONATION_DDL, ImpersonationRefused, assertImpersonationWrites, assertSessionUsable, impersonationByIdQuery, impersonationListQuery, impersonationRowValues, impersonationStampOf, mapImpersonationRow, newImpersonationSession, type ImpersonationRow, } from './impersonation.js';
|
|
37
46
|
export { readTimeline, readHistory, facetEvents, walkEventCause, walkEventEffects, readInvocation, readDeadLetters } from './timeline.js';
|
|
38
47
|
export type { TimelineReader } from './timeline.js';
|
|
48
|
+
export { rowDecoder, UNDECODED_ACTOR, UNDECODED_PERMISSION } from './row-decode.js';
|
|
49
|
+
export type { RowDecoder } from './row-decode.js';
|
|
50
|
+
export { domainEventOf, drainedEventOf, readUndrainedOutbox, undrainedEventsOf, UNDRAINED_SCAN_FACTOR, UNDRAINED_SKIPPED_IDS, } from './outbox-event.js';
|
|
51
|
+
export type { OutboxEnvelopeRow, OutboxDrainRow, UndrainedEvents, UndrainedRead, UndrainedSkipped, } from './outbox-event.js';
|
|
39
52
|
export { IDEMPOTENCY_DDL, assertIdempotencyKey, idempotencyLookupQuery, idempotencyPruneStatement, idempotencyRecordStatement, idempotencySubject, idempotencyOptedOutMessage, replayFor, type IdempotencyRow, type IdempotentReplay, } from './idempotency.js';
|
|
40
53
|
export { JOB_RUN_DDL, JOB_DRIVE_LIMIT, JOB_DRIVE_SCAN_MAX, JOB_RUN_LIST_LIMIT, JOB_RUN_LIST_MAX, jobRunListLimit, JOB_STEP_REUSED, assertQueueSafe, jobRunOf, runDueJobRuns, runJobPass, startJobRun, } from './job-run.js';
|
|
41
54
|
export type { JobDriveReport, JobHandler, JobPassContext, JobPassOutcome, JobPassResult, JobRun, JobRunFilter, JobRunKey, JobRunPatch, JobRunRow, JobRunStatus, JobRunStore, JobStepRow, StartJobRunInput, } from './job-run.js';
|
|
42
55
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
43
56
|
export { runPlatformSweep, startPlatformSweeper, SCHEDULE_STATE_DDL, SCHEDULE_STATE_REBUILD, scheduleStateHasKind, } from './platform-sweep.js';
|
|
44
|
-
export type { AccessLogSink, EventSink, EventDrainReport, AccessLogSweepReport, ConnectorSweeper, MigrationSweepReport, PlatformSweepOptions, PlatformSweepReport, PlatformSweeperHandle, ScheduleSweepReport, ScheduleStateKind, StartPlatformSweeperOptions, } from './platform-sweep.js';
|
|
57
|
+
export type { AccessLogSink, EventSink, EventDrainReport, EventDrainSkipped, AccessLogSweepReport, ConnectorSweeper, MigrationSweepReport, PlatformSweepOptions, PlatformSweepReport, PlatformSweeperHandle, ScheduleSweepReport, ScheduleStateKind, StartPlatformSweeperOptions, } from './platform-sweep.js';
|
|
58
|
+
export { isPrimaryScope, runningVersionOf, PROVISION_RECONCILE_BATCH, PROVISION_RECONCILE_REPORTED_IDS, } from './platform-sweep.js';
|
|
59
|
+
export type { ProvisionReconcileReport, ServingPointer } from './platform-sweep.js';
|
|
45
60
|
export { MIGRATION_FLAG_THRESHOLD, migrationFleet, migrationProgress, migrationSummary, scopeMigrationState, } from './migration-progress.js';
|
|
46
61
|
export type { ScopeMigrationState } from './migration-progress.js';
|
|
47
62
|
export { foldMeterReading } from './meters.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EACL,oCAAoC,EACpC,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,MAAM,EACN,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,gB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,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,0BAA0B,EAC1B,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export { assertRedrainWindow, attachmentBlobKey, consumersFor, entitlementDenial, backoffAt, globalFetch, parseValidationRecords, resolveRetryPolicy, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, ISSUE_RETENTION_DAYS, } from './scope-host.js';
|
|
1
|
+
export { assertRedrainWindow, attachmentBlobKey, consumersFor, entitlementDenial, backoffAt, globalFetch, parseValidationRecords, resolveRetryPolicy, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, SWEEP_RUNS_INTENT_INDEX, sweepRunsIntentHasKind, ISSUE_RETENTION_DAYS, } from './scope-host.js';
|
|
2
2
|
export { isSecretBoxConfigured, SecretBoxUnconfiguredError, unconfiguredSecretBox, webCryptoSecretBox, } from './secret-box.js';
|
|
3
3
|
export { ConnectionSealingKeyUnavailableError, generateSealingKeyPair, noSealingKeyMessage, openSealed, sealTo, SealedKeyUnavailableError, } from './sealed-box.js';
|
|
4
4
|
export { createSubjectKeys } from './subject-keys.js';
|
|
5
5
|
export { resolveScopeRecord } from './scope-record.js';
|
|
6
6
|
export { assertAllowed, denyAllChecker, PermissionDenied, UNSAFE_allowAllChecker, } from './permission-checker.js';
|
|
7
|
-
export { asPrincipal } from './permission-checker.js';
|
|
7
|
+
export { actorOf, asPrincipal } from './permission-checker.js';
|
|
8
8
|
export { createTupleEvaluator } from './permission-eval.js';
|
|
9
|
+
export { CAPABILITY_COLUMNS, CAPABILITY_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_SESSION_PRUNE_BATCH, WITHHELD_SECRET, assertNoSecret, capabilityByIdQuery, capabilityExchangeable, capabilityGrantOf, capabilityLive, capabilityRecordOf, capabilityTokenHash, carriesSecret, checkBecomeInput, createCapabilityVerbs, exchangeCapability, guardSecrets, mintBecomeCapability, mintCapabilitySecret, mintCapabilitySessionToken, persistedText, plausibleSessionToken, redactSecrets, resolveCapabilitySession, revokeCapabilityAsPlatform, } from './capability.js';
|
|
9
10
|
export { createAtomic } from './sub-transaction.js';
|
|
10
11
|
export { DEFAULT_SEARCH_LIMIT, MAX_SEARCH_LIMIT, MIN_SEARCH_TERM, NotSearchable, SEARCH_INDEX_PREFIX, SearchTermTooShort, isSearchIndexTable, searchIndexDdl, searchIndexMigrations, searchIndexPlans, searchLimit, searchMatchExpression, searchPlansByEntityType, searchQuery, } from './search-index.js';
|
|
11
12
|
export { FilterNotDeclared, LIST_INDEX_PREFIX, NotListable, SortNotDeclared, cursorOf, isListIndexName, listIndexColumns, listIndexDdl, listIndexMigrations, listIndexPlans, listPlansByEntityType, listQuery, splitCursor, } from './list-index.js';
|
|
@@ -13,19 +14,29 @@ export { frozenClock, manualClock } from './clock.js';
|
|
|
13
14
|
export { createUlid, ulid, ulidTime } from './ulid.js';
|
|
14
15
|
export { assertReadOnlyQuery } from './read-only-sql.js';
|
|
15
16
|
export { assertNoSpineWrite, guardSpine } from './spine-guard.js';
|
|
17
|
+
export { assertPermissionKey } from './check-key.js';
|
|
16
18
|
export { assertModuleEnqueueableKind } from './platform-kinds.js';
|
|
17
19
|
export { readRoutedNode, RouterAssertionError } from './routed-node.js';
|
|
18
20
|
export { assertPlatformCall, PlatformCallError, PLATFORM_SECRET_HEADER, PLATFORM_REQUEST_HEADER, CONNECTOR_ATTACHMENT_RECORD_HEADER, } from './platform-call.js';
|
|
19
21
|
export { signConnectState, verifyConnectState, ConnectStateError, CONNECT_STATE_PURPOSE, } from './connect-state.js';
|
|
20
|
-
export { PLATFORM_REQUEST_COLUMNS, platformRequestHistoryQuery, } from './platform-request-query.js';
|
|
22
|
+
export { PLATFORM_REQUEST_COLUMNS, platformRequestHistoryQuery, platformRequestOf, UNDECODED_REQUESTER, } from './platform-request-query.js';
|
|
23
|
+
export { CANCELLED_INTENT_NOTE, intentPayloadCarriesSubject, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, REDACTED_INTENT_MARKER, REDACTED_INTENT_NOTE, redactedIntentPayload, } from './subject-redaction.js';
|
|
24
|
+
export { effectiveRoleGrantQuery, seatScopeTuple } from './scope-tuple-seat.js';
|
|
25
|
+
export { SYSTEM_SWITCH_OFF_PREDICATE, SYSTEM_SWITCH_OFF_RELATION, switchSystemSchedules, systemScheduleState, systemSwitchedOff, systemSwitchedOffMessage, } from './system-switch.js';
|
|
21
26
|
export { DENIAL_COLUMNS, DENIAL_WINDOW_QUERY, denialListQuery, denialSummaryQuery, denialTotalsQuery, mapDenialRow, mapDenialBucketRow, mapDenialOperationBucketRow, mapDenialSummaryBuckets, storedActor, } from './denial-query.js';
|
|
22
27
|
export { entityVersionQuery, entityVersionOf, assertIfMatch, OUTBOX_ENTITY_INDEX, } from './entity-version.js';
|
|
23
28
|
export { IMPERSONATION_COLUMNS, IMPERSONATION_DDL, ImpersonationRefused, assertImpersonationWrites, assertSessionUsable, impersonationByIdQuery, impersonationListQuery, impersonationRowValues, impersonationStampOf, mapImpersonationRow, newImpersonationSession, } from './impersonation.js';
|
|
24
29
|
export { readTimeline, readHistory, facetEvents, walkEventCause, walkEventEffects, readInvocation, readDeadLetters } from './timeline.js';
|
|
30
|
+
// #1636: one undecodable spine row no longer takes a list — or a delivery loop — with it.
|
|
31
|
+
export { rowDecoder, UNDECODED_ACTOR, UNDECODED_PERMISSION } from './row-decode.js';
|
|
32
|
+
export { domainEventOf, drainedEventOf, readUndrainedOutbox, undrainedEventsOf, UNDRAINED_SCAN_FACTOR, UNDRAINED_SKIPPED_IDS, } from './outbox-event.js';
|
|
25
33
|
export { IDEMPOTENCY_DDL, assertIdempotencyKey, idempotencyLookupQuery, idempotencyPruneStatement, idempotencyRecordStatement, idempotencySubject, idempotencyOptedOutMessage, replayFor, } from './idempotency.js';
|
|
26
34
|
export { JOB_RUN_DDL, JOB_DRIVE_LIMIT, JOB_DRIVE_SCAN_MAX, JOB_RUN_LIST_LIMIT, JOB_RUN_LIST_MAX, jobRunListLimit, JOB_STEP_REUSED, assertQueueSafe, jobRunOf, runDueJobRuns, runJobPass, startJobRun, } from './job-run.js';
|
|
27
35
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
28
36
|
export { runPlatformSweep, startPlatformSweeper, SCHEDULE_STATE_DDL, SCHEDULE_STATE_REBUILD, scheduleStateHasKind, } from './platform-sweep.js';
|
|
37
|
+
// #1653: which scopes are the real install, and which version runs on them — shared so
|
|
38
|
+
// every receipt writer and the sweep answer both questions the same way.
|
|
39
|
+
export { isPrimaryScope, runningVersionOf, PROVISION_RECONCILE_BATCH, PROVISION_RECONCILE_REPORTED_IDS, } from './platform-sweep.js';
|
|
29
40
|
export { MIGRATION_FLAG_THRESHOLD, migrationFleet, migrationProgress, migrationSummary, scopeMigrationState, } from './migration-progress.js';
|
|
30
41
|
export { foldMeterReading } from './meters.js';
|
|
31
42
|
export { MODEL_USAGE_RETENTION_DAYS, foldModelUsage, } from './model-usage.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,oCAAoC,EACpC,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,MAAM,EACN,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC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yB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAgB7B,uFAAuF;AACvF,yEAAyE;AACzE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,0BAA0B,EAC1B,cAAc,GAIf,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type DomainEvent, type DrainedEvent } from '@substrat-run/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* Decoding a stored `_substrat_outbox` row into the envelope work is done with (#1636).
|
|
4
|
+
*
|
|
5
|
+
* The READ side of the outbox is tolerant (`readHistory` and the walks, via `rowDecoder`):
|
|
6
|
+
* a row that does not decode comes back beside its neighbours, saying why. This is the
|
|
7
|
+
* other side — the rows that are EXECUTED. A consumer's handler, an executor's handler and
|
|
8
|
+
* the Tier-2 drain each act on the event, and a half-decoded event is not one any of them
|
|
9
|
+
* may act on: a consumer built from stand-ins would record effects nobody asked for, and a
|
|
10
|
+
* lake row built from them would be exact history that is not. So this decode is strict and
|
|
11
|
+
* throws, and what changed is WHERE the throw lands. It used to sit above each loop's
|
|
12
|
+
* per-event containment, so one bad row halted every event behind it on every pass:
|
|
13
|
+
*
|
|
14
|
+
* - consumer delivery never delivered anything of that type after it;
|
|
15
|
+
* - executor dispatch failed the executor's whole pending list;
|
|
16
|
+
* - the Tier-2 drain stalled for the scope, because a row that never ships is never
|
|
17
|
+
* stamped, so the next pass read it first again.
|
|
18
|
+
*
|
|
19
|
+
* Each caller now contains it per event — a dead letter for a delivery, a skip for the
|
|
20
|
+
* drain — and the event behind it moves.
|
|
21
|
+
*
|
|
22
|
+
* One decoder, where there were two copies of the same `domainEvent.parse` in the two
|
|
23
|
+
* adapters: both now decode through here, so a row cannot deliver on one and dead-letter
|
|
24
|
+
* on the other.
|
|
25
|
+
*/
|
|
26
|
+
/** The `_substrat_outbox` columns the envelope is built from, as either adapter hands them back. */
|
|
27
|
+
export interface OutboxEnvelopeRow {
|
|
28
|
+
id: string;
|
|
29
|
+
type: string;
|
|
30
|
+
schema_version: number;
|
|
31
|
+
occurred_at: string;
|
|
32
|
+
tenant_id: string;
|
|
33
|
+
scope_id: string;
|
|
34
|
+
actor: string;
|
|
35
|
+
entity_type: string;
|
|
36
|
+
entity_id: string;
|
|
37
|
+
pii_class: string;
|
|
38
|
+
subject_id: string | null;
|
|
39
|
+
authorization: string | null;
|
|
40
|
+
impersonation: string | null;
|
|
41
|
+
operation: string | null;
|
|
42
|
+
payload: string | null;
|
|
43
|
+
}
|
|
44
|
+
/** …plus the columns the Tier-2 drain lifts beside the envelope (#1242, #1237). */
|
|
45
|
+
export interface OutboxDrainRow extends OutboxEnvelopeRow {
|
|
46
|
+
version?: string | null;
|
|
47
|
+
caused_by?: string | null;
|
|
48
|
+
invocation_id?: string | null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The stored row → the `DomainEvent` a consumer or executor is handed, or a throw naming
|
|
52
|
+
* EVERY column that did not decode.
|
|
53
|
+
*
|
|
54
|
+
* A row the kernel wrote decodes exactly as it always did — the same candidate into the same
|
|
55
|
+
* `domainEvent.parse`. The throw's message never quotes the stored text (see `rowDecoder`):
|
|
56
|
+
* it is written into a dead letter, which is stored beside the event and survives an erasure
|
|
57
|
+
* of its payload.
|
|
58
|
+
*/
|
|
59
|
+
export declare function domainEventOf(row: OutboxEnvelopeRow): DomainEvent;
|
|
60
|
+
/**
|
|
61
|
+
* The stored row → the `DrainedEvent` the Tier-2 drain ships, or a throw (`domainEventOf`'s).
|
|
62
|
+
*
|
|
63
|
+
* The WHOLE event is parsed by the published `drainedEvent` schema — the envelope and the
|
|
64
|
+
* columns lifted beside it (`operation`, `version`, `caused_by`, `invocation_id`), which the
|
|
65
|
+
* envelope does not carry. They used to be copied onto an already-validated envelope as
|
|
66
|
+
* stored, into a value merely TYPED as a `DrainedEvent` (#1641 review): a restored row with
|
|
67
|
+
* `version: ''` or a `caused_by` that is not an event id reached the lake, append-only, and
|
|
68
|
+
* was stamped as having left. Parsed here, it throws, and `readUndrainedOutbox` skips it and
|
|
69
|
+
* says so. A row the kernel wrote passes unchanged: each lifted column is written from a
|
|
70
|
+
* validated value or as NULL.
|
|
71
|
+
*/
|
|
72
|
+
export declare function drainedEventOf(row: OutboxDrainRow): DrainedEvent;
|
|
73
|
+
/**
|
|
74
|
+
* What a Tier-2 read passed over (#1636): rows that would not decode, so were neither
|
|
75
|
+
* returned nor — since nothing ships them — ever stamped.
|
|
76
|
+
*
|
|
77
|
+
* `eventIds` is capped at {@link UNDRAINED_SKIPPED_IDS}; `count` is exact. Ids only, never
|
|
78
|
+
* a reason: this travels to the control plane's sweep report and its log, and a decode
|
|
79
|
+
* message is one step from the stored text it describes.
|
|
80
|
+
*/
|
|
81
|
+
export interface UndrainedSkipped {
|
|
82
|
+
count: number;
|
|
83
|
+
eventIds: string[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* `readUndrainedEvents`' answer: the events, oldest first — an ARRAY, because every caller
|
|
87
|
+
* already reads one — with what the read skipped riding beside them as an optional
|
|
88
|
+
* property. Absent when every row it read decoded, so a clean read is the array it always
|
|
89
|
+
* was.
|
|
90
|
+
*
|
|
91
|
+
* A property on an array does not survive `JSON.stringify` or an RPC hop, so each hop that
|
|
92
|
+
* carries this says so explicitly (the DO's `undrainedEventsRead`, the vertical's
|
|
93
|
+
* `/internal/undrained-events?withSkipped=1`); it is only ever attached in-process.
|
|
94
|
+
*/
|
|
95
|
+
export type UndrainedEvents = DrainedEvent[] & {
|
|
96
|
+
skipped?: UndrainedSkipped;
|
|
97
|
+
};
|
|
98
|
+
/** The same answer, as a plain object — the shape that crosses an RPC or HTTP hop. */
|
|
99
|
+
export interface UndrainedRead {
|
|
100
|
+
events: DrainedEvent[];
|
|
101
|
+
skipped?: UndrainedSkipped;
|
|
102
|
+
}
|
|
103
|
+
/** How many rows past `limit` one read may look through, as a multiple of `limit`. */
|
|
104
|
+
export declare const UNDRAINED_SCAN_FACTOR = 10;
|
|
105
|
+
/** How many skipped ids a read names; the count past it stays exact. */
|
|
106
|
+
export declare const UNDRAINED_SKIPPED_IDS = 50;
|
|
107
|
+
/**
|
|
108
|
+
* The Tier-2 drain's read over one scope's outbox (#1334), CONTAINED per row (#1636) — the
|
|
109
|
+
* one implementation both adapters run, so they cannot disagree about what is skipped.
|
|
110
|
+
*
|
|
111
|
+
* `page(offset, count)` is the adapter's
|
|
112
|
+
* `SELECT * … WHERE drained_at IS NULL ORDER BY id LIMIT count OFFSET offset`. Offset
|
|
113
|
+
* rather than an id cursor on purpose: the rows being stepped over are exactly the ones
|
|
114
|
+
* whose `id` may be the column that is broken.
|
|
115
|
+
*
|
|
116
|
+
* A row that does not decode is SKIPPED: not returned, so no sink ever receives an event
|
|
117
|
+
* built from stand-ins — the lake is append-only, and a wrong row there cannot be taken
|
|
118
|
+
* back — and not stamped, so `drained_at` stays an exact record of what left. The read
|
|
119
|
+
* keeps going past it, so the healthy rows behind it still ship. The cost is stated rather
|
|
120
|
+
* than hidden: a skipped row never reaches the lake, and every pass reads it again. It
|
|
121
|
+
* stays visible in Tier 1, where `readHistory` returns it with a `decodeError`.
|
|
122
|
+
*
|
|
123
|
+
* Bounded: at most `limit × UNDRAINED_SCAN_FACTOR` rows are looked at. A scope whose next
|
|
124
|
+
* that-many undrained rows ALL fail to decode ships nothing, pass after pass — at that
|
|
125
|
+
* point the spine is broken wholesale, which is a restore to repair rather than a row to
|
|
126
|
+
* step over, and the skipped count in the sweep report is what says so.
|
|
127
|
+
*/
|
|
128
|
+
export declare function readUndrainedOutbox(page: (offset: number, count: number) => OutboxDrainRow[], limit: number): UndrainedRead;
|
|
129
|
+
/** An `UndrainedRead` → the in-process array shape, the skip attached only when there is one. */
|
|
130
|
+
export declare function undrainedEventsOf(read: UndrainedRead): UndrainedEvents;
|
|
131
|
+
//# sourceMappingURL=outbox-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbox-event.d.ts","sourceRoot":"","sources":["../src/outbox-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGzG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,oGAAoG;AACpG,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,mFAAmF;AACnF,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAA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