@opendatalabs/personal-server-ts-lite 0.0.1-canary.052d47e → 0.0.1-canary.05cdd81
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/account-mode-store.d.ts +11 -0
- package/dist/account-mode-store.d.ts.map +1 -0
- package/dist/account-mode-store.js +68 -0
- package/dist/account-mode-store.js.map +1 -0
- package/dist/additions-crypto.d.ts +3 -0
- package/dist/additions-crypto.d.ts.map +1 -0
- package/dist/additions-crypto.js +42 -0
- package/dist/additions-crypto.js.map +1 -0
- package/dist/additions-protocol.d.ts +56 -0
- package/dist/additions-protocol.d.ts.map +1 -0
- package/dist/additions-protocol.js +17 -0
- package/dist/additions-protocol.js.map +1 -0
- package/dist/additions-session.d.ts +20 -0
- package/dist/additions-session.d.ts.map +1 -0
- package/dist/additions-session.js +215 -0
- package/dist/additions-session.js.map +1 -0
- package/dist/additions-transport.d.ts +72 -0
- package/dist/additions-transport.d.ts.map +1 -0
- package/dist/additions-transport.js +428 -0
- package/dist/additions-transport.js.map +1 -0
- package/dist/additions-worker.bundle.js +31252 -0
- package/dist/additions-worker.d.ts +2 -0
- package/dist/additions-worker.d.ts.map +1 -0
- package/dist/additions-worker.js +308 -0
- package/dist/additions-worker.js.map +1 -0
- package/dist/bridge.d.ts +3 -0
- package/dist/bridge.d.ts.map +1 -1
- package/dist/bridge.js +4 -0
- package/dist/bridge.js.map +1 -1
- package/dist/browser-runtime.d.ts +111 -1
- package/dist/browser-runtime.d.ts.map +1 -1
- package/dist/browser-runtime.js +176 -11
- package/dist/browser-runtime.js.map +1 -1
- package/dist/canonical-persistence.d.ts +53 -0
- package/dist/canonical-persistence.d.ts.map +1 -0
- package/dist/canonical-persistence.js +13 -0
- package/dist/canonical-persistence.js.map +1 -0
- package/dist/canonical-store.d.ts +395 -0
- package/dist/canonical-store.d.ts.map +1 -0
- package/dist/canonical-store.js +1807 -0
- package/dist/canonical-store.js.map +1 -0
- package/dist/client.d.ts +24 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +214 -1
- package/dist/client.js.map +1 -1
- package/dist/derivatives.d.ts.map +1 -1
- package/dist/derivatives.js +4 -2
- package/dist/derivatives.js.map +1 -1
- package/dist/diagnostics.d.ts +3 -0
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +9 -1
- package/dist/diagnostics.js.map +1 -1
- package/dist/history-probe-worker.bundle.js +31274 -0
- package/dist/history-probe.worker.d.ts +35 -0
- package/dist/history-probe.worker.d.ts.map +1 -0
- package/dist/history-probe.worker.js +161 -0
- package/dist/history-probe.worker.js.map +1 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/localdb-port.d.ts +28 -0
- package/dist/localdb-port.d.ts.map +1 -0
- package/dist/localdb-port.js +30 -0
- package/dist/localdb-port.js.map +1 -0
- package/dist/mcp-store.d.ts +1 -1
- package/dist/mcp-store.d.ts.map +1 -1
- package/dist/mcp-store.js +144 -15
- package/dist/mcp-store.js.map +1 -1
- package/dist/oura-import.d.ts +2 -0
- package/dist/oura-import.d.ts.map +1 -0
- package/dist/oura-import.js +3 -0
- package/dist/oura-import.js.map +1 -0
- package/dist/owner-binding.d.ts +5 -0
- package/dist/owner-binding.d.ts.map +1 -1
- package/dist/owner-binding.js +4 -8
- package/dist/owner-binding.js.map +1 -1
- package/dist/persistence.d.ts +1 -1
- package/dist/persistence.d.ts.map +1 -1
- package/dist/persistence.js +2 -2
- package/dist/persistence.js.map +1 -1
- package/dist/pull-signals.d.ts +38 -0
- package/dist/pull-signals.d.ts.map +1 -0
- package/dist/pull-signals.js +73 -0
- package/dist/pull-signals.js.map +1 -0
- package/dist/relay-tls.d.ts.map +1 -1
- package/dist/relay-tls.js +10 -0
- package/dist/relay-tls.js.map +1 -1
- package/dist/relay.d.ts +91 -3
- package/dist/relay.d.ts.map +1 -1
- package/dist/relay.js +522 -75
- package/dist/relay.js.map +1 -1
- package/dist/replication-coordinator-state.d.ts +19 -0
- package/dist/replication-coordinator-state.d.ts.map +1 -0
- package/dist/replication-coordinator-state.js +20 -0
- package/dist/replication-coordinator-state.js.map +1 -0
- package/dist/replication-door.d.ts +17 -0
- package/dist/replication-door.d.ts.map +1 -0
- package/dist/replication-door.js +23 -0
- package/dist/replication-door.js.map +1 -0
- package/dist/replication-engine.d.ts +49 -0
- package/dist/replication-engine.d.ts.map +1 -0
- package/dist/replication-engine.js +589 -0
- package/dist/replication-engine.js.map +1 -0
- package/dist/replication-host.d.ts +92 -0
- package/dist/replication-host.d.ts.map +1 -0
- package/dist/replication-host.js +135 -0
- package/dist/replication-host.js.map +1 -0
- package/dist/replication-ports.d.ts +194 -0
- package/dist/replication-ports.d.ts.map +1 -0
- package/dist/replication-ports.js +58 -0
- package/dist/replication-ports.js.map +1 -0
- package/dist/replication-runtime.d.ts +64 -0
- package/dist/replication-runtime.d.ts.map +1 -0
- package/dist/replication-runtime.js +79 -0
- package/dist/replication-runtime.js.map +1 -0
- package/dist/replication-storage.d.ts +42 -0
- package/dist/replication-storage.d.ts.map +1 -0
- package/dist/replication-storage.js +173 -0
- package/dist/replication-storage.js.map +1 -0
- package/dist/runtime.d.ts +85 -6
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +561 -37
- package/dist/runtime.js.map +1 -1
- package/dist/seed-staging.d.ts +8 -0
- package/dist/seed-staging.d.ts.map +1 -0
- package/dist/seed-staging.js +106 -0
- package/dist/seed-staging.js.map +1 -0
- package/dist/state.d.ts +16 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +93 -23
- package/dist/state.js.map +1 -1
- package/dist/storage-utils.d.ts.map +1 -1
- package/dist/storage-utils.js +11 -3
- package/dist/storage-utils.js.map +1 -1
- package/dist/storage.d.ts +59 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +601 -150
- package/dist/storage.js.map +1 -1
- package/dist/stream-sync-budget.d.ts +3 -0
- package/dist/stream-sync-budget.d.ts.map +1 -0
- package/dist/stream-sync-budget.js +3 -0
- package/dist/stream-sync-budget.js.map +1 -0
- package/dist/sync.d.ts +104 -3
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +377 -62
- package/dist/sync.js.map +1 -1
- package/package.json +12 -5
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { type ReplicaOperation } from "@opendatalabs/personal-server-ts-core/replication/envelope";
|
|
2
|
+
import { type MergeContext } from "@opendatalabs/personal-server-ts-core/replication/merge-plan";
|
|
3
|
+
import { type PdppRecordRow } from "@opendatalabs/personal-server-ts-core/storage/pdpp-records/portable";
|
|
4
|
+
import { type CompletionOperation } from "@opendatalabs/personal-server-ts-core/replication/completion";
|
|
5
|
+
import { type ReplicaReader, type ReplicaVisibilityPolicy } from "@opendatalabs/personal-server-ts-core/replication/visibility-policy";
|
|
6
|
+
import { type LiteCanonicalPersistence, type LiteBlobDescriptor, type LiteStagingId } from "./canonical-persistence.js";
|
|
7
|
+
/**
|
|
8
|
+
* A refusal that the batch's content or the store's immutable state decides:
|
|
9
|
+
* the same input fails the same way on every retry. A replica import that
|
|
10
|
+
* throws it stops retrying (`ReplicaCopyRefused` on the engine host).
|
|
11
|
+
*/
|
|
12
|
+
export declare class LiteCanonicalRefusal extends Error {
|
|
13
|
+
readonly reason: "batch_too_large" | "operation_too_large" | "wrong_owner" | "connection_binding_mismatch" | "partition_too_large" | "commit_id_reused" | "blob_metadata_conflict";
|
|
14
|
+
readonly code = "lite_canonical_refused";
|
|
15
|
+
constructor(reason: "batch_too_large" | "operation_too_large" | "wrong_owner" | "connection_binding_mismatch" | "partition_too_large" | "commit_id_reused" | "blob_metadata_conflict", message: string);
|
|
16
|
+
}
|
|
17
|
+
export type LiteOperationDraft = ReplicaOperation extends infer T ? T extends ReplicaOperation ? Omit<T, "revision"> : never : never;
|
|
18
|
+
interface Connection {
|
|
19
|
+
sourceId: string;
|
|
20
|
+
methodId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface LiteCommitReceipt {
|
|
23
|
+
sequence: number;
|
|
24
|
+
operationCount: number;
|
|
25
|
+
}
|
|
26
|
+
export interface LiteReplicaReadOptions {
|
|
27
|
+
reader?: ReplicaReader;
|
|
28
|
+
}
|
|
29
|
+
export type LiteVisibleRecord = PdppRecordRow;
|
|
30
|
+
/** One local commit, in sequence order. It points at the retained operation. */
|
|
31
|
+
interface LogEntry {
|
|
32
|
+
batchId: string;
|
|
33
|
+
operationKey: string;
|
|
34
|
+
sequence: number;
|
|
35
|
+
/** The record row's version after this operation (record operations only). */
|
|
36
|
+
rowVersion?: number;
|
|
37
|
+
}
|
|
38
|
+
/** The fingerprint `stagePending` and `pendingBatch` report for an envelope. */
|
|
39
|
+
export declare const litePendingFingerprint: (envelope: unknown) => string;
|
|
40
|
+
export declare function createLiteCanonicalStore(deps: {
|
|
41
|
+
persistence: LiteCanonicalPersistence;
|
|
42
|
+
context: () => MergeContext;
|
|
43
|
+
authenticateReplica: (credential: unknown) => string | undefined;
|
|
44
|
+
enabled?: boolean;
|
|
45
|
+
visibilityPolicy?: ReplicaVisibilityPolicy;
|
|
46
|
+
newId?: () => string;
|
|
47
|
+
/** Called after each local batch commits, so replication steps soon. */
|
|
48
|
+
localCommitted?: () => void;
|
|
49
|
+
}): {
|
|
50
|
+
/** Host hook: caller authenticates/decrypts transport and verifies its hash before staging. */
|
|
51
|
+
stagePending(input: {
|
|
52
|
+
id: string;
|
|
53
|
+
envelope: unknown;
|
|
54
|
+
credential: unknown;
|
|
55
|
+
blobs?: {
|
|
56
|
+
stagingId: LiteStagingId;
|
|
57
|
+
descriptor: LiteBlobDescriptor;
|
|
58
|
+
}[];
|
|
59
|
+
}): Promise<{
|
|
60
|
+
fingerprint: string;
|
|
61
|
+
state: "confirmed" | "quarantined";
|
|
62
|
+
} | {
|
|
63
|
+
fingerprint: string;
|
|
64
|
+
state: "pending";
|
|
65
|
+
}>;
|
|
66
|
+
/** Trusted finality hook; fingerprint must come from independently verified finalized evidence. */
|
|
67
|
+
promotePending(input: {
|
|
68
|
+
id: string;
|
|
69
|
+
credential: unknown;
|
|
70
|
+
fingerprint: string;
|
|
71
|
+
}): Promise<LiteCommitReceipt>;
|
|
72
|
+
quarantinePending(input: {
|
|
73
|
+
id: string;
|
|
74
|
+
credential: unknown;
|
|
75
|
+
reason: string;
|
|
76
|
+
}): Promise<void>;
|
|
77
|
+
/** Trusted host provisioning only; never called by replica or collector input. */
|
|
78
|
+
provisionConnection(id: string, connection: Connection): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Replication's writer identity (host contract §3.2): local operations
|
|
81
|
+
* from now on name `writerId`. The first time a writer binds, every
|
|
82
|
+
* unpublished local operation is dropped from the outbox and the current
|
|
83
|
+
* canonical state is re-exported under it (`reexport`), so a phone with
|
|
84
|
+
* local writes before its first enable, or after a writer rotation,
|
|
85
|
+
* still converges. Binding the writer already exported is a no-op.
|
|
86
|
+
*/
|
|
87
|
+
rebaseline(writerId: string): Promise<{
|
|
88
|
+
reissued: number;
|
|
89
|
+
skipped: number;
|
|
90
|
+
} | undefined>;
|
|
91
|
+
/** A staged pending batch's state and fingerprint, if any. */
|
|
92
|
+
pendingBatch(id: string): Promise<{
|
|
93
|
+
state: "pending" | "confirmed" | "quarantined";
|
|
94
|
+
fingerprint: string;
|
|
95
|
+
} | undefined>;
|
|
96
|
+
commitLocal: (id: string, operations: LiteOperationDraft[], blobs?: {
|
|
97
|
+
stagingId: LiteStagingId;
|
|
98
|
+
descriptor: LiteBlobDescriptor;
|
|
99
|
+
}[]) => Promise<LiteCommitReceipt>;
|
|
100
|
+
import: (input: {
|
|
101
|
+
id: string;
|
|
102
|
+
envelope: unknown;
|
|
103
|
+
credential: unknown;
|
|
104
|
+
blobs?: {
|
|
105
|
+
stagingId: LiteStagingId;
|
|
106
|
+
descriptor: LiteBlobDescriptor;
|
|
107
|
+
}[];
|
|
108
|
+
}) => Promise<LiteCommitReceipt>;
|
|
109
|
+
/** True when reconcile withdraws this connection from every reader. */
|
|
110
|
+
isConnectionQuarantined(connectionId: string): Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* Trusted host hook for a terminal batch (contract v3.1 A, H): record
|
|
113
|
+
* the absorbing connection-quarantine fact and withdraw the connection
|
|
114
|
+
* from every reader in the same transaction. The view revisions advance,
|
|
115
|
+
* so open page cursors expire. Rows stay retained; nothing is deleted.
|
|
116
|
+
*/
|
|
117
|
+
quarantineConnection(input: {
|
|
118
|
+
credential: unknown;
|
|
119
|
+
connectionId: string;
|
|
120
|
+
reason: string;
|
|
121
|
+
}): Promise<void>;
|
|
122
|
+
/** Invoke after trusted declaration/validator changes. Continue until after is absent. */
|
|
123
|
+
retry(input: {
|
|
124
|
+
credential: unknown;
|
|
125
|
+
after?: string;
|
|
126
|
+
}): Promise<{
|
|
127
|
+
after: string | undefined;
|
|
128
|
+
}>;
|
|
129
|
+
readRecord(connection: string, stream: string, key: string, options?: LiteReplicaReadOptions): Promise<PdppRecordRow | undefined>;
|
|
130
|
+
/**
|
|
131
|
+
* The certified completions of a connection's canonical streams, by
|
|
132
|
+
* stream. A completion describes canonical rows as stored, so a reader
|
|
133
|
+
* that sees the pending preview gets none, as on Node.
|
|
134
|
+
*/
|
|
135
|
+
readStreamCompletions(connection: string, options?: LiteReplicaReadOptions): Promise<CompletionOperation[]>;
|
|
136
|
+
/** Host-only current-row page. Includes tombstones; not a public query cursor. */
|
|
137
|
+
readConnectionPage(connection: string, after?: string, options?: LiteReplicaReadOptions): Promise<{
|
|
138
|
+
rows: PdppRecordRow[];
|
|
139
|
+
after: string | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
/**
|
|
142
|
+
* Internal bounded page of every local commit after a sequence, including
|
|
143
|
+
* acknowledged ones. Never a public PDPP cursor or grant-relative read.
|
|
144
|
+
*/
|
|
145
|
+
readLogPage(afterSequence?: number): Promise<{
|
|
146
|
+
entries: (LogEntry & {
|
|
147
|
+
operation: ReplicaOperation;
|
|
148
|
+
})[];
|
|
149
|
+
nextAfterSequence: number;
|
|
150
|
+
hasMore: boolean;
|
|
151
|
+
}>;
|
|
152
|
+
/** Local commits after `afterSequence` that are not yet acknowledged. */
|
|
153
|
+
readOutboxPage(afterSequence?: number): Promise<{
|
|
154
|
+
entries: {
|
|
155
|
+
sequence: number;
|
|
156
|
+
batchId: string;
|
|
157
|
+
operation: {
|
|
158
|
+
kind: "upsert";
|
|
159
|
+
data: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
160
|
+
[key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
|
|
161
|
+
} | null)[] | {
|
|
162
|
+
[key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
163
|
+
} | null)[] | {
|
|
164
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
165
|
+
} | null)[] | {
|
|
166
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
167
|
+
} | null)[] | {
|
|
168
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
169
|
+
} | null)[] | {
|
|
170
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
171
|
+
} | null)[] | {
|
|
172
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
173
|
+
} | null)[] | {
|
|
174
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
175
|
+
} | null)[] | {
|
|
176
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
177
|
+
} | null)[] | {
|
|
178
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
179
|
+
} | null)[] | {
|
|
180
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
181
|
+
} | null)[] | {
|
|
182
|
+
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
183
|
+
} | null>;
|
|
184
|
+
blobs: {
|
|
185
|
+
blobId: string;
|
|
186
|
+
sha256: string;
|
|
187
|
+
mimeType: string;
|
|
188
|
+
sizeBytes: number;
|
|
189
|
+
}[];
|
|
190
|
+
declaration: {
|
|
191
|
+
digest: string;
|
|
192
|
+
version: string;
|
|
193
|
+
stream: string;
|
|
194
|
+
semantics: "append_only" | "mutable_state";
|
|
195
|
+
primaryKey: string[];
|
|
196
|
+
schemaDigest: string;
|
|
197
|
+
};
|
|
198
|
+
recordKey: string;
|
|
199
|
+
emittedAt: string;
|
|
200
|
+
owner: string;
|
|
201
|
+
sourceId: string;
|
|
202
|
+
connectionId: string;
|
|
203
|
+
methodId: string;
|
|
204
|
+
generation: number;
|
|
205
|
+
revision: {
|
|
206
|
+
counter: number;
|
|
207
|
+
writerId: string;
|
|
208
|
+
operationId: string;
|
|
209
|
+
origin?: {
|
|
210
|
+
writerId: string;
|
|
211
|
+
operationId: string;
|
|
212
|
+
} | undefined;
|
|
213
|
+
};
|
|
214
|
+
} | {
|
|
215
|
+
kind: "delete";
|
|
216
|
+
deletedAt: string;
|
|
217
|
+
declaration: {
|
|
218
|
+
digest: string;
|
|
219
|
+
version: string;
|
|
220
|
+
stream: string;
|
|
221
|
+
semantics: "append_only" | "mutable_state";
|
|
222
|
+
primaryKey: string[];
|
|
223
|
+
schemaDigest: string;
|
|
224
|
+
};
|
|
225
|
+
recordKey: string;
|
|
226
|
+
emittedAt: string;
|
|
227
|
+
owner: string;
|
|
228
|
+
sourceId: string;
|
|
229
|
+
connectionId: string;
|
|
230
|
+
methodId: string;
|
|
231
|
+
generation: number;
|
|
232
|
+
revision: {
|
|
233
|
+
counter: number;
|
|
234
|
+
writerId: string;
|
|
235
|
+
operationId: string;
|
|
236
|
+
origin?: {
|
|
237
|
+
writerId: string;
|
|
238
|
+
operationId: string;
|
|
239
|
+
} | undefined;
|
|
240
|
+
};
|
|
241
|
+
} | {
|
|
242
|
+
kind: "connection-register";
|
|
243
|
+
generation: 1;
|
|
244
|
+
owner: string;
|
|
245
|
+
sourceId: string;
|
|
246
|
+
connectionId: string;
|
|
247
|
+
methodId: string;
|
|
248
|
+
revision: {
|
|
249
|
+
counter: number;
|
|
250
|
+
writerId: string;
|
|
251
|
+
operationId: string;
|
|
252
|
+
origin?: {
|
|
253
|
+
writerId: string;
|
|
254
|
+
operationId: string;
|
|
255
|
+
} | undefined;
|
|
256
|
+
};
|
|
257
|
+
} | {
|
|
258
|
+
kind: "connection-reset";
|
|
259
|
+
previousGeneration: number;
|
|
260
|
+
owner: string;
|
|
261
|
+
sourceId: string;
|
|
262
|
+
connectionId: string;
|
|
263
|
+
methodId: string;
|
|
264
|
+
generation: number;
|
|
265
|
+
revision: {
|
|
266
|
+
counter: number;
|
|
267
|
+
writerId: string;
|
|
268
|
+
operationId: string;
|
|
269
|
+
origin?: {
|
|
270
|
+
writerId: string;
|
|
271
|
+
operationId: string;
|
|
272
|
+
} | undefined;
|
|
273
|
+
};
|
|
274
|
+
} | {
|
|
275
|
+
kind: "connection-delete";
|
|
276
|
+
owner: string;
|
|
277
|
+
sourceId: string;
|
|
278
|
+
connectionId: string;
|
|
279
|
+
methodId: string;
|
|
280
|
+
generation: number;
|
|
281
|
+
revision: {
|
|
282
|
+
counter: number;
|
|
283
|
+
writerId: string;
|
|
284
|
+
operationId: string;
|
|
285
|
+
origin?: {
|
|
286
|
+
writerId: string;
|
|
287
|
+
operationId: string;
|
|
288
|
+
} | undefined;
|
|
289
|
+
};
|
|
290
|
+
} | {
|
|
291
|
+
kind: "blob-claim";
|
|
292
|
+
blob: {
|
|
293
|
+
blobId: string;
|
|
294
|
+
sha256: string;
|
|
295
|
+
mimeType: string;
|
|
296
|
+
sizeBytes: number;
|
|
297
|
+
};
|
|
298
|
+
owner: string;
|
|
299
|
+
sourceId: string;
|
|
300
|
+
connectionId: string;
|
|
301
|
+
methodId: string;
|
|
302
|
+
generation: number;
|
|
303
|
+
revision: {
|
|
304
|
+
counter: number;
|
|
305
|
+
writerId: string;
|
|
306
|
+
operationId: string;
|
|
307
|
+
origin?: {
|
|
308
|
+
writerId: string;
|
|
309
|
+
operationId: string;
|
|
310
|
+
} | undefined;
|
|
311
|
+
};
|
|
312
|
+
} | {
|
|
313
|
+
kind: "stream-invalidate";
|
|
314
|
+
declaration: {
|
|
315
|
+
digest: string;
|
|
316
|
+
version: string;
|
|
317
|
+
stream: string;
|
|
318
|
+
semantics: "append_only" | "mutable_state";
|
|
319
|
+
primaryKey: string[];
|
|
320
|
+
schemaDigest: string;
|
|
321
|
+
};
|
|
322
|
+
owner: string;
|
|
323
|
+
sourceId: string;
|
|
324
|
+
connectionId: string;
|
|
325
|
+
methodId: string;
|
|
326
|
+
generation: number;
|
|
327
|
+
revision: {
|
|
328
|
+
counter: number;
|
|
329
|
+
writerId: string;
|
|
330
|
+
operationId: string;
|
|
331
|
+
origin?: {
|
|
332
|
+
writerId: string;
|
|
333
|
+
operationId: string;
|
|
334
|
+
} | undefined;
|
|
335
|
+
};
|
|
336
|
+
} | {
|
|
337
|
+
kind: "stream-complete";
|
|
338
|
+
declaration: {
|
|
339
|
+
digest: string;
|
|
340
|
+
version: string;
|
|
341
|
+
stream: string;
|
|
342
|
+
semantics: "append_only" | "mutable_state";
|
|
343
|
+
primaryKey: string[];
|
|
344
|
+
schemaDigest: string;
|
|
345
|
+
};
|
|
346
|
+
sourceCollectedAt: string;
|
|
347
|
+
liveCount: number;
|
|
348
|
+
snapshotSha256: string;
|
|
349
|
+
proof: {
|
|
350
|
+
kind: "native";
|
|
351
|
+
snapshotSha256: string;
|
|
352
|
+
collectionTimeBasis: "host_run_finished";
|
|
353
|
+
} | {
|
|
354
|
+
kind: "producer-asserted";
|
|
355
|
+
snapshotSha256: null;
|
|
356
|
+
collectionTimeBasis: null;
|
|
357
|
+
};
|
|
358
|
+
dependencies: {
|
|
359
|
+
writerId: string;
|
|
360
|
+
operationId: string;
|
|
361
|
+
digest: string;
|
|
362
|
+
}[];
|
|
363
|
+
owner: string;
|
|
364
|
+
sourceId: string;
|
|
365
|
+
connectionId: string;
|
|
366
|
+
methodId: string;
|
|
367
|
+
generation: number;
|
|
368
|
+
revision: {
|
|
369
|
+
counter: number;
|
|
370
|
+
writerId: string;
|
|
371
|
+
operationId: string;
|
|
372
|
+
origin?: {
|
|
373
|
+
writerId: string;
|
|
374
|
+
operationId: string;
|
|
375
|
+
} | undefined;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
}[];
|
|
379
|
+
nextAfterSequence: number;
|
|
380
|
+
hasMore: boolean;
|
|
381
|
+
}>;
|
|
382
|
+
/** Moves the outbox past `next`. The log keeps every entry. */
|
|
383
|
+
acknowledgeOutbox(expected: number, next: number): Promise<void>;
|
|
384
|
+
/**
|
|
385
|
+
* The engine published every outbox operation up to `next` and the
|
|
386
|
+
* gateway confirmed its registration: move the outbox past them. The log
|
|
387
|
+
* keeps every entry. Monotonic; a lower or repeated acknowledgment is a
|
|
388
|
+
* no-op.
|
|
389
|
+
*/
|
|
390
|
+
acknowledgePublished(next: number): Promise<void>;
|
|
391
|
+
stageBlob(descriptor: LiteBlobDescriptor, chunks: AsyncIterable<Uint8Array>, signal?: AbortSignal): Promise<LiteStagingId>;
|
|
392
|
+
readBlob(blobId: string, options?: LiteReplicaReadOptions): AsyncGenerator<Uint8Array<ArrayBufferLike>, void, unknown>;
|
|
393
|
+
};
|
|
394
|
+
export {};
|
|
395
|
+
//# sourceMappingURL=canonical-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical-store.d.ts","sourceRoot":"","sources":["../src/canonical-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,gBAAgB,EAGtB,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,qEAAqE,CAAC;AAY7E,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,8DAA8D,CAAC;AAOtE,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC7B,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAGL,KAAK,wBAAwB,EAE7B,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAC;AAEpC;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAG3C,QAAQ,CAAC,MAAM,EACX,iBAAiB,GACjB,qBAAqB,GACrB,aAAa,GACb,6BAA6B,GAC7B,qBAAqB,GACrB,kBAAkB,GAClB,wBAAwB;IAT9B,QAAQ,CAAC,IAAI,4BAA4B;gBAE9B,MAAM,EACX,iBAAiB,GACjB,qBAAqB,GACrB,aAAa,GACb,6BAA6B,GAC7B,qBAAqB,GACrB,kBAAkB,GAClB,wBAAwB,EAC5B,OAAO,EAAE,MAAM;C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