@abloatai/transaction 0.54.0 → 0.56.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/auth/hostedEndpoints.d.ts +21 -5
- package/dist/auth/hostedEndpoints.d.ts.map +1 -1
- package/dist/auth/hostedEndpoints.js +21 -5
- package/dist/auth/hostedEndpoints.js.map +1 -1
- package/dist/auth/index.d.ts +1 -7
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +1 -1
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/schema.d.ts +6 -2
- package/dist/coordination/schema.d.ts.map +1 -1
- package/dist/coordination/schema.js +8 -5
- package/dist/coordination/schema.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +4 -1
- package/dist/errors.js.map +1 -1
- package/dist/log/syncDeltaRow.d.ts +3 -3
- package/dist/resources/writeOptionsSchema.d.ts.map +1 -1
- package/dist/resources/writeOptionsSchema.js +3 -2
- package/dist/resources/writeOptionsSchema.js.map +1 -1
- package/dist/schema/openapi.d.ts.map +1 -1
- package/dist/schema/openapi.js +17 -0
- package/dist/schema/openapi.js.map +1 -1
- package/dist/syncLog/contract.d.ts +50 -2
- package/dist/syncLog/contract.d.ts.map +1 -1
- package/dist/syncLog/contract.js +50 -4
- package/dist/syncLog/contract.js.map +1 -1
- package/dist/wire/auth.d.ts.map +1 -1
- package/dist/wire/auth.js +6 -3
- package/dist/wire/auth.js.map +1 -1
- package/dist/wire/commit.js +5 -4
- package/dist/wire/commit.js.map +1 -1
- package/dist/wire/deltaDelivery.d.ts +45 -0
- package/dist/wire/deltaDelivery.d.ts.map +1 -0
- package/dist/wire/deltaDelivery.js +43 -0
- package/dist/wire/deltaDelivery.js.map +1 -0
- package/dist/wire/index.d.ts +2 -0
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +3 -0
- package/dist/wire/index.js.map +1 -1
- package/dist/wire/modelMutations.js +3 -2
- package/dist/wire/modelMutations.js.map +1 -1
- package/package.json +1 -1
- package/src/auth/hostedEndpoints.ts +23 -5
- package/src/auth/index.ts +2 -7
- package/src/coordination/index.ts +1 -1
- package/src/coordination/schema.ts +10 -6
- package/src/errors.ts +4 -1
- package/src/resources/writeOptionsSchema.ts +2 -2
- package/src/schema/openapi.ts +21 -0
- package/src/syncLog/contract.ts +54 -5
- package/src/wire/auth.ts +6 -3
- package/src/wire/commit.ts +4 -4
- package/src/wire/deltaDelivery.ts +47 -0
- package/src/wire/index.ts +5 -0
- package/src/wire/modelMutations.ts +2 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `GET /v1/logs/delivery` answers: of the changes this plane recorded,
|
|
3
|
+
* how many could reach anyone.
|
|
4
|
+
*
|
|
5
|
+
* The engine already knows. A delta whose `sync_groups` is empty is an upstream
|
|
6
|
+
* invariant violation — `buildDeltaSyncGroups` guarantees at least one group —
|
|
7
|
+
* so the fan-out excludes it from delivery, counts it, and warns. All three land
|
|
8
|
+
* on Ablo's side of the boundary. The row is in the customer's database, the
|
|
9
|
+
* commit confirmed, every configuration check green, and nobody is told. This
|
|
10
|
+
* response moves that fact to the side the person debugging it is standing on.
|
|
11
|
+
*
|
|
12
|
+
* Counts and one sample, never row data: `model` and `id` are what the warning
|
|
13
|
+
* already names, and they are what turns "realtime is broken" into a row to look
|
|
14
|
+
* at.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
/** The model and row of one undeliverable change — enough to find it, no more. */
|
|
18
|
+
export declare const deliverySampleSchema: z.ZodObject<{
|
|
19
|
+
model: z.ZodString;
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
at: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type DeliverySample = z.infer<typeof deliverySampleSchema>;
|
|
24
|
+
/**
|
|
25
|
+
* `GET /v1/logs/delivery` — the plane's fan-out verdict over a fixed recent
|
|
26
|
+
* window.
|
|
27
|
+
*
|
|
28
|
+
* `recorded` and `unroutable` are the verdict and always present. `sample` is
|
|
29
|
+
* optional in the reader's stance the rest of this surface takes: a deployment
|
|
30
|
+
* that omits it must still be readable, because refusing to parse would refuse
|
|
31
|
+
* the diagnosis along with it.
|
|
32
|
+
*/
|
|
33
|
+
export declare const logDeliveryResponseSchema: z.ZodObject<{
|
|
34
|
+
object: z.ZodOptional<z.ZodLiteral<"log_delivery">>;
|
|
35
|
+
window_seconds: z.ZodNumber;
|
|
36
|
+
recorded: z.ZodNumber;
|
|
37
|
+
unroutable: z.ZodNumber;
|
|
38
|
+
sample: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
39
|
+
model: z.ZodString;
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
at: z.ZodString;
|
|
42
|
+
}, z.core.$strip>>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export type LogDeliveryResponse = z.infer<typeof logDeliveryResponseSchema>;
|
|
45
|
+
//# sourceMappingURL=deltaDelivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deltaDelivery.d.ts","sourceRoot":"","sources":["../../src/wire/deltaDelivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kFAAkF;AAClF,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;iBAUpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `GET /v1/logs/delivery` answers: of the changes this plane recorded,
|
|
3
|
+
* how many could reach anyone.
|
|
4
|
+
*
|
|
5
|
+
* The engine already knows. A delta whose `sync_groups` is empty is an upstream
|
|
6
|
+
* invariant violation — `buildDeltaSyncGroups` guarantees at least one group —
|
|
7
|
+
* so the fan-out excludes it from delivery, counts it, and warns. All three land
|
|
8
|
+
* on Ablo's side of the boundary. The row is in the customer's database, the
|
|
9
|
+
* commit confirmed, every configuration check green, and nobody is told. This
|
|
10
|
+
* response moves that fact to the side the person debugging it is standing on.
|
|
11
|
+
*
|
|
12
|
+
* Counts and one sample, never row data: `model` and `id` are what the warning
|
|
13
|
+
* already names, and they are what turns "realtime is broken" into a row to look
|
|
14
|
+
* at.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
/** The model and row of one undeliverable change — enough to find it, no more. */
|
|
18
|
+
export const deliverySampleSchema = z.object({
|
|
19
|
+
model: z.string(),
|
|
20
|
+
id: z.string(),
|
|
21
|
+
at: z.string(),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* `GET /v1/logs/delivery` — the plane's fan-out verdict over a fixed recent
|
|
25
|
+
* window.
|
|
26
|
+
*
|
|
27
|
+
* `recorded` and `unroutable` are the verdict and always present. `sample` is
|
|
28
|
+
* optional in the reader's stance the rest of this surface takes: a deployment
|
|
29
|
+
* that omits it must still be readable, because refusing to parse would refuse
|
|
30
|
+
* the diagnosis along with it.
|
|
31
|
+
*/
|
|
32
|
+
export const logDeliveryResponseSchema = z.object({
|
|
33
|
+
object: z.literal('log_delivery').optional(),
|
|
34
|
+
/** The window the counts cover, so a reader never hardcodes it. */
|
|
35
|
+
window_seconds: z.number(),
|
|
36
|
+
/** Deltas this plane recorded in the window. */
|
|
37
|
+
recorded: z.number(),
|
|
38
|
+
/** Of those, the ones excluded from delivery for having no sync group. */
|
|
39
|
+
unroutable: z.number(),
|
|
40
|
+
/** The most recent undeliverable change, when there is one. */
|
|
41
|
+
sample: deliverySampleSchema.nullable().optional(),
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=deltaDelivery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deltaDelivery.js","sourceRoot":"","sources":["../../src/wire/deltaDelivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAGH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IAC5C,mEAAmE;IACnE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,gDAAgD;IAChD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,0EAA0E;IAC1E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,+DAA+D;IAC/D,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC"}
|
package/dist/wire/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export { claimEventSchema } from './claimEvent.js';
|
|
|
23
23
|
export type { ClaimEvent } from './claimEvent.js';
|
|
24
24
|
export { feedEventSchema, logListResponseSchema, logQuerySchema, } from './feedEvent.js';
|
|
25
25
|
export type { FeedEvent, LogListResponse, LogQuery } from './feedEvent.js';
|
|
26
|
+
export { logDeliveryResponseSchema, deliverySampleSchema } from './deltaDelivery.js';
|
|
27
|
+
export type { LogDeliveryResponse, DeliverySample } from './deltaDelivery.js';
|
|
26
28
|
export { feedCursorSchema, parseFeedCursor, formatFeedCursor, feedCursorAdvanced, FEED_CURSOR_START, FEED_CURSOR_FORMAT, FEED_CURSOR_EXAMPLE, } from './feedCursor.js';
|
|
27
29
|
export type { FeedCursor } from './feedCursor.js';
|
|
28
30
|
export { bootstrapReasonSchema } from './bootstrapReason.js';
|
package/dist/wire/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wire/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wire/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB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AAmB,EACnB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,WAAW,CAAC"}
|
package/dist/wire/index.js
CHANGED
|
@@ -21,6 +21,9 @@ export { listEnvelopeSchema, listEnvelope, CURSOR_PARAM, CURSOR_PARAM_ALIAS, CUR
|
|
|
21
21
|
// carries a position in each.
|
|
22
22
|
export { claimEventSchema } from './claimEvent.js';
|
|
23
23
|
export { feedEventSchema, logListResponseSchema, logQuerySchema, } from './feedEvent.js';
|
|
24
|
+
// The same feed's delivery verdict — how much of what it recorded could reach
|
|
25
|
+
// anyone. Read by `ablo doctor`.
|
|
26
|
+
export { logDeliveryResponseSchema, deliverySampleSchema } from './deltaDelivery.js';
|
|
24
27
|
export { feedCursorSchema, parseFeedCursor, formatFeedCursor, feedCursorAdvanced, FEED_CURSOR_START, FEED_CURSOR_FORMAT, FEED_CURSOR_EXAMPLE, } from './feedCursor.js';
|
|
25
28
|
export { bootstrapReasonSchema } from './bootstrapReason.js';
|
|
26
29
|
// The write-path frame contract: the message shapes shared by the client and
|
package/dist/wire/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wire/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB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uBAAuB,CAAC;AAqB/B,2EAA2E;AAC3E,wEAAwE;AACxE,sBAAsB;AACtB,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,0BAA0B,CAAC;AAclC,4EAA4E;AAC5E,8BAA8B;AAC9B,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAS5B,+EAA+E;AAC/E,qDAAqD;AACrD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,WAAW,CAAC"}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* the server validates against this and the reference is generated from it.
|
|
16
16
|
*/
|
|
17
17
|
import { z } from 'zod';
|
|
18
|
-
import {
|
|
18
|
+
import { logPositionSchema } from '../syncLog/contract.js';
|
|
19
|
+
import { onStaleModeSchema, MAX_READ_SET_ENTRIES, readDependencyListSchema, readSetProjectionEntryCount, trackDependencyListSchema, } from '../coordination/schema.js';
|
|
19
20
|
export const modelMutationRequestSchema = z.object({
|
|
20
21
|
/** The record. Its shape is your schema's; everything around it is protocol. */
|
|
21
22
|
data: z.record(z.string(), z.unknown()).nullish(),
|
|
@@ -41,7 +42,7 @@ export const modelMutationRequestSchema = z.object({
|
|
|
41
42
|
* the read. Ablo rejects the write if the row moved in between, which is
|
|
42
43
|
* what makes read → decide → write safe without a lock across the deciding.
|
|
43
44
|
*/
|
|
44
|
-
readAt:
|
|
45
|
+
readAt: logPositionSchema.nullish(),
|
|
45
46
|
/** Commit-lifetime dependencies checked with the single model operation. */
|
|
46
47
|
reads: readDependencyListSchema.nullish(),
|
|
47
48
|
/** Durable dependencies registered with the single model operation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelMutations.js","sourceRoot":"","sources":["../../src/wire/modelMutations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"modelMutations.js","sourceRoot":"","sources":["../../src/wire/modelMutations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,gFAAgF;IAChF,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACjD;;;;;;;;;;;OAWG;IACH,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IACxB,gEAAgE;IAChE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC3B,2EAA2E;IAC3E,OAAO,EAAE,iBAAiB,CAAC,OAAO,EAAE;IACpC;;;;OAIG;IACH,MAAM,EAAE,iBAAiB,CAAC,OAAO,EAAE;IACnC,4EAA4E;IAC5E,KAAK,EAAE,wBAAwB,CAAC,OAAO,EAAE;IACzC,uEAAuE;IACvE,KAAK,EAAE,yBAAyB,CAAC,OAAO,EAAE;IAC1C;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAChC,wEAAwE;IACxE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,2BAA2B,CAAC,KAAK,CAAC,IAAI,oBAAoB,EAAE;IAC/E,IAAI,EAAE,CAAC,OAAO,CAAC;IACf,OAAO,EAAE,uCAAuC,oBAAoB,mBAAmB;CACxF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abloatai/transaction",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"description": "The headless Ablo transaction client and canonical contracts for reads, commits, confirmation, claims, and durable observation.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The hosted Ablo
|
|
2
|
+
* The hosted Ablo hosts, with no dependencies of their own.
|
|
3
3
|
*
|
|
4
|
-
* This is the single place
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* This is the single place each published Ablo domain is declared: the API the
|
|
5
|
+
* SDK calls, the documentation site every error link and descriptor points at,
|
|
6
|
+
* and the marketing site that carries signup and the legal pages. URL
|
|
7
|
+
* resolution, the CLI's default URL, the data-source connector's base, the
|
|
8
|
+
* generated OpenAPI server entry, the error registry's `doc_url`, and the
|
|
9
|
+
* published discovery descriptors all import from here, so changing a domain is
|
|
10
|
+
* a one-line edit.
|
|
8
11
|
*
|
|
9
12
|
* These constants are kept dependency-free deliberately: several low-level
|
|
10
13
|
* modules consume them, and routing those modules through the auth layer would
|
|
@@ -22,3 +25,18 @@ export const ABLO_HOSTED_HTTP_BASE_URL = `https://${ABLO_HOSTED_API_DOMAIN}`;
|
|
|
22
25
|
* {@link ABLO_HOSTED_HTTP_BASE_URL}; kept as a distinct name because it is
|
|
23
26
|
* the documented client-options default. */
|
|
24
27
|
export const ABLO_DEFAULT_BASE_URL = ABLO_HOSTED_HTTP_BASE_URL;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The documentation site. Canonical target of every error `doc_url`, of the
|
|
31
|
+
* published OpenAPI document, and of the discovery descriptors under
|
|
32
|
+
* `/.well-known`, which is why it is declared beside the API host rather than
|
|
33
|
+
* retyped at each of those call sites.
|
|
34
|
+
*/
|
|
35
|
+
export const ABLO_DOCS_BASE_URL = 'https://docs.abloatai.com';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The marketing site: signup, the CLI device-flow approval page, and the legal
|
|
39
|
+
* pages a machine-readable onboarding descriptor has to cite. The apex
|
|
40
|
+
* redirects here, so this is the form to publish.
|
|
41
|
+
*/
|
|
42
|
+
export const ABLO_SITE_BASE_URL = 'https://www.abloatai.com';
|
package/src/auth/index.ts
CHANGED
|
@@ -26,18 +26,13 @@ import type {
|
|
|
26
26
|
} from './capability.js';
|
|
27
27
|
export {
|
|
28
28
|
ABLO_DEFAULT_BASE_URL,
|
|
29
|
+
ABLO_DOCS_BASE_URL,
|
|
29
30
|
ABLO_HOSTED_API_DOMAIN,
|
|
30
31
|
ABLO_HOSTED_HTTP_BASE_URL,
|
|
32
|
+
ABLO_SITE_BASE_URL,
|
|
31
33
|
} from './hostedEndpoints.js';
|
|
32
34
|
export { normalizeAbloBaseUrl } from './baseUrl.js';
|
|
33
35
|
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Use {@link CapabilityMintResponse}. Removed in 0.55.0. This is a
|
|
36
|
-
* type-only rename bridge; both names resolve to the same canonical Zod
|
|
37
|
-
* contract and no runtime parser or schema is duplicated.
|
|
38
|
-
*/
|
|
39
|
-
export type CapabilityExchangeResponse = CapabilityMintResponse;
|
|
40
|
-
|
|
41
36
|
export type {
|
|
42
37
|
EphemeralKeyResponse,
|
|
43
38
|
IdentityResolveResponse,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { logPositionSchema, type LogPosition } from '../syncLog/contract.js';
|
|
2
3
|
import {
|
|
3
4
|
syncGroupInputSchema,
|
|
4
5
|
syncGroupRefSchema,
|
|
@@ -267,9 +268,12 @@ const streamTargetSchema = targetRefSchema
|
|
|
267
268
|
export const onStaleModeSchema = z.enum(['reject', 'overwrite', 'notify']);
|
|
268
269
|
export type OnStaleMode = z.infer<typeof onStaleModeSchema>;
|
|
269
270
|
|
|
270
|
-
/**
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
/** @deprecated A ReadSet entry retains a {@link logPositionSchema} like every
|
|
272
|
+
* other position; the reader is the owner, and the owner belongs in the field
|
|
273
|
+
* name rather than in a second type. Removed in 0.57.0. */
|
|
274
|
+
export const readSetWatermarkSchema = logPositionSchema;
|
|
275
|
+
/** @deprecated Use {@link LogPosition}. Removed in 0.57.0. */
|
|
276
|
+
export type ReadSetWatermark = LogPosition;
|
|
273
277
|
|
|
274
278
|
/** Maximum decision-input entries one logical commit may ask the server to scan. */
|
|
275
279
|
export const MAX_READ_SET_ENTRIES = 500;
|
|
@@ -285,7 +289,7 @@ export type TrackOnStale = z.infer<typeof trackOnStaleSchema>;
|
|
|
285
289
|
* claim — see the claim layer below.
|
|
286
290
|
*/
|
|
287
291
|
export const writeGuardSchema = z.object({
|
|
288
|
-
readAt:
|
|
292
|
+
readAt: logPositionSchema.nullish(),
|
|
289
293
|
onStale: onStaleModeSchema.nullish(),
|
|
290
294
|
bypass: z.boolean().optional(),
|
|
291
295
|
});
|
|
@@ -489,7 +493,7 @@ export type PersistedReadSetTarget = z.infer<typeof persistedReadSetTargetSchema
|
|
|
489
493
|
/** One exact input to the decision made by this commit. */
|
|
490
494
|
export const commitReadSetEntrySchema = z.object({
|
|
491
495
|
target: commitReadSetTargetSchema,
|
|
492
|
-
watermark:
|
|
496
|
+
watermark: logPositionSchema,
|
|
493
497
|
lifetime: z.literal('commit'),
|
|
494
498
|
onStale: onStaleModeSchema,
|
|
495
499
|
});
|
|
@@ -498,7 +502,7 @@ export type CommitReadSetEntry = z.infer<typeof commitReadSetEntrySchema>;
|
|
|
498
502
|
/** One exact input retained after the declaring commit settles. */
|
|
499
503
|
export const persistedReadSetEntrySchema = z.object({
|
|
500
504
|
target: persistedReadSetTargetSchema,
|
|
501
|
-
watermark:
|
|
505
|
+
watermark: logPositionSchema,
|
|
502
506
|
lifetime: z.literal('persisted'),
|
|
503
507
|
onStale: trackOnStaleSchema,
|
|
504
508
|
});
|
package/src/errors.ts
CHANGED
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import type { ErrorCode } from './errorCodes.js';
|
|
20
|
+
// Dependency-free by design, so the error registry can name the docs host
|
|
21
|
+
// without pulling the auth layer into this module's import graph.
|
|
22
|
+
import { ABLO_DOCS_BASE_URL } from './auth/hostedEndpoints.js';
|
|
20
23
|
import { errorCodeSpec, classifyRecovery } from './errorCodes.js';
|
|
21
24
|
import {
|
|
22
25
|
wireClaimSummarySchema,
|
|
@@ -156,7 +159,7 @@ export class AbloError extends Error {
|
|
|
156
159
|
* a `doc_url` automatically.
|
|
157
160
|
*/
|
|
158
161
|
export function docUrlForCode(code: ErrorCode): string {
|
|
159
|
-
return
|
|
162
|
+
return `${ABLO_DOCS_BASE_URL}/errors#${code}`;
|
|
160
163
|
}
|
|
161
164
|
|
|
162
165
|
/** 401 — invalid/missing/expired credentials. */
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { z } from 'zod';
|
|
20
|
+
import { logPositionSchema } from '../syncLog/contract.js';
|
|
20
21
|
import type { MutationOptions } from '../resources/mutationOptions.js';
|
|
21
22
|
import { AbloValidationError } from '../errors.js';
|
|
22
23
|
import { commitWaitSchema } from '../wire/commit.js';
|
|
@@ -24,7 +25,6 @@ import {
|
|
|
24
25
|
onStaleModeSchema,
|
|
25
26
|
MAX_READ_SET_ENTRIES,
|
|
26
27
|
readDependencyListSchema,
|
|
27
|
-
readSetWatermarkSchema,
|
|
28
28
|
readSetProjectionEntryCount,
|
|
29
29
|
trackDependencyListSchema,
|
|
30
30
|
} from '../coordination/schema.js';
|
|
@@ -46,7 +46,7 @@ export const writeOptionsSchema = z.object({
|
|
|
46
46
|
/** Resolve when queued locally (default) or once the server confirms. */
|
|
47
47
|
wait: commitWaitSchema.optional(),
|
|
48
48
|
/** Stale guard: the sync watermark the caller's reasoning was based on. */
|
|
49
|
-
readAt:
|
|
49
|
+
readAt: logPositionSchema.nullish(),
|
|
50
50
|
/** What the server does when the target moved past `readAt`. */
|
|
51
51
|
onStale: onStaleModeSchema.nullish(),
|
|
52
52
|
/** The held claim's fencing token (Option B), sourced from the claim handle
|
package/src/schema/openapi.ts
CHANGED
|
@@ -56,6 +56,7 @@ import { errorEnvelopeSchema } from '../wire/errorEnvelope.js';
|
|
|
56
56
|
import { modelReadResponseSchema, modelListResponseSchema } from '../wire/modelResponses.js';
|
|
57
57
|
import { modelMutationRequestSchema } from '../wire/modelMutations.js';
|
|
58
58
|
import { logListResponseSchema, logQuerySchema } from '../wire/feedEvent.js';
|
|
59
|
+
import { logDeliveryResponseSchema } from '../wire/deltaDelivery.js';
|
|
59
60
|
import { schemaReadResponseSchema } from '../wire/accountResponses.js';
|
|
60
61
|
import {
|
|
61
62
|
ephemeralKeyRequestSchema,
|
|
@@ -161,6 +162,7 @@ const ABLO_OPERATION_IDS: Readonly<Record<string, string>> = {
|
|
|
161
162
|
'POST /v1/capabilities/{id}/rotate': 'rotateCapability',
|
|
162
163
|
'GET /v1/schema': 'getSchema',
|
|
163
164
|
'GET /v1/logs': 'listLogEntries',
|
|
165
|
+
'GET /v1/logs/delivery': 'getLogDelivery',
|
|
164
166
|
'GET /v1/commits': 'listCommits',
|
|
165
167
|
'POST /v1/commits': 'commit',
|
|
166
168
|
'GET /v1/commits/{id}': 'getCommit',
|
|
@@ -902,6 +904,25 @@ export function abloOpenApi(options: SchemaToOpenApiOptions = {}): Json {
|
|
|
902
904
|
},
|
|
903
905
|
},
|
|
904
906
|
},
|
|
907
|
+
'/v1/logs/delivery': {
|
|
908
|
+
get: {
|
|
909
|
+
tags: ['logs'],
|
|
910
|
+
summary: 'How much of what was recorded could reach anyone',
|
|
911
|
+
description:
|
|
912
|
+
'The fan-out verdict for your plane over a recent window. `recorded` ' +
|
|
913
|
+
'counts the changes the log accepted; `unroutable` counts the ones ' +
|
|
914
|
+
'excluded from delivery because they carried no sync group, which is ' +
|
|
915
|
+
'the state a row reaches when it was written into your database ' +
|
|
916
|
+
'outside Ablo and so carries no tenancy value. Any number above zero ' +
|
|
917
|
+
'means writes are landing that no subscriber is told about.',
|
|
918
|
+
responses: {
|
|
919
|
+
'200': jsonResp(
|
|
920
|
+
'The counts, plus the most recent undeliverable change when there is one.',
|
|
921
|
+
derive(logDeliveryResponseSchema, 'output'),
|
|
922
|
+
),
|
|
923
|
+
},
|
|
924
|
+
},
|
|
925
|
+
},
|
|
905
926
|
'/v1/commits': {
|
|
906
927
|
get: {
|
|
907
928
|
tags: ['commits'],
|
package/src/syncLog/contract.ts
CHANGED
|
@@ -1,9 +1,58 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Canonical sync-log identity and position contracts shared by client/server.
|
|
3
|
+
*
|
|
4
|
+
* ## A log position means ONE thing
|
|
5
|
+
*
|
|
6
|
+
* It is an ordinal in `sync_deltas`: a point in the single, totally ordered
|
|
7
|
+
* log. Nothing else. Every number in this engine that answers "how far along"
|
|
8
|
+
* is this type, and there is one definition of it, below.
|
|
9
|
+
*
|
|
10
|
+
* What varies is never the meaning. It is **who is making the claim**, and the
|
|
11
|
+
* owner belongs in the field name, never in a second type:
|
|
12
|
+
*
|
|
13
|
+
* | Owner | Claims |
|
|
14
|
+
* | ---------------------------------- | ----------------------------------------- |
|
|
15
|
+
* | `current_settled_sync_id()` | nothing at or below is still in flight |
|
|
16
|
+
* | `getCommittedSyncId` | committed, without waiting for the barrier|
|
|
17
|
+
* | `sync_broadcast_cursors.published_through` | the fan-out published through |
|
|
18
|
+
* | `Client.lastSentSyncId` | this recipient was offered through |
|
|
19
|
+
* | `Client.lastAckedSyncId` | this recipient confirmed through |
|
|
20
|
+
* | `LogPosition.applied` | the client processed on arrival through |
|
|
21
|
+
* | `LogPosition.persisted` | the client durably holds through, in
|
|
22
|
+
* DELIVERED order, not numeric order |
|
|
23
|
+
* | `RowWatermarks` | this one row reflects the log through |
|
|
24
|
+
* | `sync_state_checkpoint.up_to_sync_id` | the checkpoint folded through |
|
|
25
|
+
*
|
|
26
|
+
* ## The comparison that is not safe
|
|
27
|
+
*
|
|
28
|
+
* `current_settled_sync_id` takes a per-plane advisory lock but reads the
|
|
29
|
+
* GLOBAL sequence, so its value moves for writers in other planes. Every other
|
|
30
|
+
* owner above is scoped: to a plane, a project, a recipient, or a row. "The
|
|
31
|
+
* head of the log" and "how far I have been served" are therefore different
|
|
32
|
+
* questions, and a scoped cursor sitting below the global head is the normal
|
|
33
|
+
* resting state, not a gap.
|
|
34
|
+
*
|
|
35
|
+
* Treating one as the other is what left every client permanently short of its
|
|
36
|
+
* own head, re-taking the plane lock on every catch-up poll
|
|
37
|
+
* (docs/plans/delivery-verify-at-read.md). Before comparing two positions, say
|
|
38
|
+
* out loud which owner each belongs to.
|
|
39
|
+
*/
|
|
2
40
|
|
|
3
41
|
import { z } from 'zod';
|
|
4
42
|
|
|
5
|
-
|
|
6
|
-
|
|
43
|
+
/**
|
|
44
|
+
* A point in the sync log. The one definition; every other position name in
|
|
45
|
+
* the codebase derives from this one rather than restating the primitive.
|
|
46
|
+
*/
|
|
47
|
+
export const logPositionSchema = z.number().int().nonnegative();
|
|
48
|
+
export type LogPosition = z.infer<typeof logPositionSchema>;
|
|
49
|
+
|
|
50
|
+
/** @deprecated One position type, one name: use {@link logPositionSchema}.
|
|
51
|
+
* This spelling is removed in 0.57.0. It resolves to the definition above, so
|
|
52
|
+
* the two cannot drift while both are exported. */
|
|
53
|
+
export const deltaPositionSchema = logPositionSchema;
|
|
54
|
+
/** @deprecated One position type, one name: use {@link LogPosition}. Removed in 0.57.0. */
|
|
55
|
+
export type DeltaPosition = LogPosition;
|
|
7
56
|
|
|
8
57
|
export const clientMutationIdSchema = z.string().min(1).max(255);
|
|
9
58
|
export type ClientMutationId = z.infer<typeof clientMutationIdSchema>;
|
|
@@ -21,8 +70,8 @@ export const commitDispatchMarkerSchema = z.strictObject({
|
|
|
21
70
|
kind: z.literal('sync_deltas'),
|
|
22
71
|
organizationId: z.string().min(1),
|
|
23
72
|
branchId: z.string().min(1),
|
|
24
|
-
firstSyncId:
|
|
25
|
-
lastSyncId:
|
|
73
|
+
firstSyncId: logPositionSchema,
|
|
74
|
+
lastSyncId: logPositionSchema,
|
|
26
75
|
}).superRefine((value, ctx) => {
|
|
27
76
|
if (value.firstSyncId <= 0 || value.lastSyncId < value.firstSyncId) {
|
|
28
77
|
ctx.addIssue({ code: 'custom', message: 'invalid delta position range' });
|
package/src/wire/auth.ts
CHANGED
|
@@ -34,9 +34,12 @@ export const ephemeralKeyRequestSchema = z.object({
|
|
|
34
34
|
/** The participant this session acts as. */
|
|
35
35
|
user: ephemeralKeyUserSchema,
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
* `organization:act-as` scope
|
|
39
|
-
*
|
|
37
|
+
* Open the session in a DIFFERENT organization, one the caller does not
|
|
38
|
+
* belong to. Requires the `organization:act-as` scope. This is the identity
|
|
39
|
+
* provider case, where each organization is an account in its own right.
|
|
40
|
+
*
|
|
41
|
+
* A platform serving its own customers does not use this: its customers are
|
|
42
|
+
* rows in its own schema, and a session reaches them through `syncGroups`.
|
|
40
43
|
*/
|
|
41
44
|
organizationId: z.string().min(1).optional(),
|
|
42
45
|
/**
|
package/src/wire/commit.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { z } from 'zod';
|
|
21
|
+
import { logPositionSchema } from '../syncLog/contract.js';
|
|
21
22
|
import {
|
|
22
23
|
onStaleModeSchema,
|
|
23
24
|
MAX_READ_SET_ENTRIES,
|
|
@@ -25,7 +26,6 @@ import {
|
|
|
25
26
|
readSetRowTargetSchema,
|
|
26
27
|
readSetProjectionEntryCount,
|
|
27
28
|
readSetSchema,
|
|
28
|
-
readSetWatermarkSchema,
|
|
29
29
|
participantKindSchema,
|
|
30
30
|
staleNotificationSchema,
|
|
31
31
|
trackDependencyListSchema,
|
|
@@ -61,7 +61,7 @@ export const confirmedCommitStatusSchema = z
|
|
|
61
61
|
.strictObject({
|
|
62
62
|
status: confirmedStatusSchema,
|
|
63
63
|
statusAt: commitTimestampSchema,
|
|
64
|
-
lastSyncId:
|
|
64
|
+
lastSyncId: logPositionSchema,
|
|
65
65
|
correlationId: correlationIdSchema.optional(),
|
|
66
66
|
})
|
|
67
67
|
.refine(({ correlationId, lastSyncId }) => correlationId === undefined || lastSyncId > 0, {
|
|
@@ -375,7 +375,7 @@ export type MutationCommitResult = z.infer<typeof mutationCommitResultSchema>;
|
|
|
375
375
|
export const clientCommitReceiptSchema = z.strictObject({
|
|
376
376
|
id: z.string().min(1),
|
|
377
377
|
status: z.union([queuedStatusSchema, confirmedStatusSchema]),
|
|
378
|
-
lastSyncId:
|
|
378
|
+
lastSyncId: logPositionSchema.optional(),
|
|
379
379
|
notifications: notificationsSchema.optional(),
|
|
380
380
|
missingIds: missingIdsSchema.optional(),
|
|
381
381
|
operationResults: operationResultsSchema.optional(),
|
|
@@ -400,7 +400,7 @@ export const commitOperationControlShape = {
|
|
|
400
400
|
id: z.string().nullish(),
|
|
401
401
|
transactionId: z.string().nullish(),
|
|
402
402
|
claimId: z.string().min(1).nullish(),
|
|
403
|
-
readAt:
|
|
403
|
+
readAt: logPositionSchema.nullish(),
|
|
404
404
|
onStale: onStaleModeSchema.nullish(),
|
|
405
405
|
fenceToken: z.number().nullish(),
|
|
406
406
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `GET /v1/logs/delivery` answers: of the changes this plane recorded,
|
|
3
|
+
* how many could reach anyone.
|
|
4
|
+
*
|
|
5
|
+
* The engine already knows. A delta whose `sync_groups` is empty is an upstream
|
|
6
|
+
* invariant violation — `buildDeltaSyncGroups` guarantees at least one group —
|
|
7
|
+
* so the fan-out excludes it from delivery, counts it, and warns. All three land
|
|
8
|
+
* on Ablo's side of the boundary. The row is in the customer's database, the
|
|
9
|
+
* commit confirmed, every configuration check green, and nobody is told. This
|
|
10
|
+
* response moves that fact to the side the person debugging it is standing on.
|
|
11
|
+
*
|
|
12
|
+
* Counts and one sample, never row data: `model` and `id` are what the warning
|
|
13
|
+
* already names, and they are what turns "realtime is broken" into a row to look
|
|
14
|
+
* at.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
|
|
19
|
+
/** The model and row of one undeliverable change — enough to find it, no more. */
|
|
20
|
+
export const deliverySampleSchema = z.object({
|
|
21
|
+
model: z.string(),
|
|
22
|
+
id: z.string(),
|
|
23
|
+
at: z.string(),
|
|
24
|
+
});
|
|
25
|
+
export type DeliverySample = z.infer<typeof deliverySampleSchema>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* `GET /v1/logs/delivery` — the plane's fan-out verdict over a fixed recent
|
|
29
|
+
* window.
|
|
30
|
+
*
|
|
31
|
+
* `recorded` and `unroutable` are the verdict and always present. `sample` is
|
|
32
|
+
* optional in the reader's stance the rest of this surface takes: a deployment
|
|
33
|
+
* that omits it must still be readable, because refusing to parse would refuse
|
|
34
|
+
* the diagnosis along with it.
|
|
35
|
+
*/
|
|
36
|
+
export const logDeliveryResponseSchema = z.object({
|
|
37
|
+
object: z.literal('log_delivery').optional(),
|
|
38
|
+
/** The window the counts cover, so a reader never hardcodes it. */
|
|
39
|
+
window_seconds: z.number(),
|
|
40
|
+
/** Deltas this plane recorded in the window. */
|
|
41
|
+
recorded: z.number(),
|
|
42
|
+
/** Of those, the ones excluded from delivery for having no sync group. */
|
|
43
|
+
unroutable: z.number(),
|
|
44
|
+
/** The most recent undeliverable change, when there is one. */
|
|
45
|
+
sample: deliverySampleSchema.nullable().optional(),
|
|
46
|
+
});
|
|
47
|
+
export type LogDeliveryResponse = z.infer<typeof logDeliveryResponseSchema>;
|
package/src/wire/index.ts
CHANGED
|
@@ -41,6 +41,11 @@ export {
|
|
|
41
41
|
logQuerySchema,
|
|
42
42
|
} from './feedEvent.js';
|
|
43
43
|
export type { FeedEvent, LogListResponse, LogQuery } from './feedEvent.js';
|
|
44
|
+
|
|
45
|
+
// The same feed's delivery verdict — how much of what it recorded could reach
|
|
46
|
+
// anyone. Read by `ablo doctor`.
|
|
47
|
+
export { logDeliveryResponseSchema, deliverySampleSchema } from './deltaDelivery.js';
|
|
48
|
+
export type { LogDeliveryResponse, DeliverySample } from './deltaDelivery.js';
|
|
44
49
|
export {
|
|
45
50
|
feedCursorSchema,
|
|
46
51
|
parseFeedCursor,
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { z } from 'zod';
|
|
19
|
+
import { logPositionSchema } from '../syncLog/contract.js';
|
|
19
20
|
import {
|
|
20
21
|
onStaleModeSchema,
|
|
21
22
|
MAX_READ_SET_ENTRIES,
|
|
22
23
|
readDependencyListSchema,
|
|
23
24
|
readSetProjectionEntryCount,
|
|
24
|
-
readSetWatermarkSchema,
|
|
25
25
|
trackDependencyListSchema,
|
|
26
26
|
} from '../coordination/schema.js';
|
|
27
27
|
|
|
@@ -50,7 +50,7 @@ export const modelMutationRequestSchema = z.object({
|
|
|
50
50
|
* the read. Ablo rejects the write if the row moved in between, which is
|
|
51
51
|
* what makes read → decide → write safe without a lock across the deciding.
|
|
52
52
|
*/
|
|
53
|
-
readAt:
|
|
53
|
+
readAt: logPositionSchema.nullish(),
|
|
54
54
|
/** Commit-lifetime dependencies checked with the single model operation. */
|
|
55
55
|
reads: readDependencyListSchema.nullish(),
|
|
56
56
|
/** Durable dependencies registered with the single model operation. */
|