@syncular/client 0.15.45 → 0.15.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -41
- package/dist/http.d.ts +5 -1
- package/dist/http.js +68 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/node-database.d.ts +6 -29
- package/dist/node-database.js +7 -69
- package/dist/query-guard.d.ts +2 -2
- package/dist/query-guard.js +2 -2
- package/dist/remote.d.ts +76 -0
- package/dist/remote.js +441 -0
- package/dist/sqlite-bun.d.ts +2 -0
- package/dist/sqlite-bun.js +4 -0
- package/dist/sqlite-node.d.ts +2 -0
- package/dist/sqlite-node.js +4 -0
- package/dist/transport.d.ts +11 -0
- package/package.json +12 -14
- package/src/http.ts +99 -7
- package/src/index.ts +2 -1
- package/src/node-database.ts +11 -108
- package/src/query-guard.ts +2 -2
- package/src/remote.ts +724 -0
- package/src/sqlite-bun.ts +6 -0
- package/src/sqlite-node.ts +6 -0
- package/src/transport.ts +19 -0
package/src/transport.ts
CHANGED
|
@@ -8,6 +8,25 @@
|
|
|
8
8
|
/** One combined push+pull round trip: SSP2 request bytes → response bytes. */
|
|
9
9
|
export type SyncTransport = (request: Uint8Array) => Promise<Uint8Array>;
|
|
10
10
|
|
|
11
|
+
/** One registered authoritative query or command request. */
|
|
12
|
+
export type RemoteOperationTransport = (
|
|
13
|
+
request: Uint8Array,
|
|
14
|
+
) => Promise<Uint8Array>;
|
|
15
|
+
|
|
16
|
+
export interface RemoteOperationRealtimeHandlers {
|
|
17
|
+
onMessage(bytes: Uint8Array): void;
|
|
18
|
+
onClose?(): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface RemoteOperationRealtimeSocket {
|
|
22
|
+
send(bytes: Uint8Array): void;
|
|
23
|
+
close(): void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type RemoteOperationRealtimeConnector = (
|
|
27
|
+
handlers: RemoteOperationRealtimeHandlers,
|
|
28
|
+
) => RemoteOperationRealtimeSocket | Promise<RemoteOperationRealtimeSocket>;
|
|
29
|
+
|
|
11
30
|
export interface SegmentFetchRequest {
|
|
12
31
|
readonly segmentId: string;
|
|
13
32
|
readonly table: string;
|