@syncular/core 0.0.6-95 → 0.1.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.
Files changed (159) hide show
  1. package/dist/blobs.d.ts +14 -7
  2. package/dist/blobs.d.ts.map +1 -1
  3. package/dist/blobs.js.map +1 -1
  4. package/dist/column-codecs.d.ts +3 -0
  5. package/dist/column-codecs.d.ts.map +1 -1
  6. package/dist/column-codecs.js +32 -4
  7. package/dist/column-codecs.js.map +1 -1
  8. package/dist/conflict.js.map +1 -1
  9. package/dist/database.js +1 -1
  10. package/dist/database.js.map +1 -1
  11. package/dist/error-responses.d.ts +393 -0
  12. package/dist/error-responses.d.ts.map +1 -0
  13. package/dist/error-responses.js +393 -0
  14. package/dist/error-responses.js.map +1 -0
  15. package/dist/http/api-client.d.ts +11 -0
  16. package/dist/http/api-client.d.ts.map +1 -0
  17. package/dist/http/api-client.js +30 -0
  18. package/dist/http/api-client.js.map +1 -0
  19. package/dist/http/blob.d.ts +6 -0
  20. package/dist/http/blob.d.ts.map +1 -0
  21. package/dist/http/blob.js +46 -0
  22. package/dist/http/blob.js.map +1 -0
  23. package/dist/http/generated/api.d.ts +5241 -0
  24. package/dist/http/generated/api.d.ts.map +1 -0
  25. package/dist/http/generated/api.js +6 -0
  26. package/dist/http/generated/api.js.map +1 -0
  27. package/dist/http/index.d.ts +18 -0
  28. package/dist/http/index.d.ts.map +1 -0
  29. package/dist/http/index.js +212 -0
  30. package/dist/http/index.js.map +1 -0
  31. package/dist/http/shared.d.ts +45 -0
  32. package/dist/http/shared.d.ts.map +1 -0
  33. package/dist/http/shared.js +122 -0
  34. package/dist/http/shared.js.map +1 -0
  35. package/dist/http/transport-client.d.ts +31 -0
  36. package/dist/http/transport-client.d.ts.map +1 -0
  37. package/dist/http/transport-client.js +193 -0
  38. package/dist/http/transport-client.js.map +1 -0
  39. package/dist/index.d.ts +2 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +19 -15
  42. package/dist/index.js.map +1 -1
  43. package/dist/kysely-column-codecs.d.ts +17 -1
  44. package/dist/kysely-column-codecs.d.ts.map +1 -1
  45. package/dist/kysely-column-codecs.js +56 -70
  46. package/dist/kysely-column-codecs.js.map +1 -1
  47. package/dist/logger.js +1 -1
  48. package/dist/logger.js.map +1 -1
  49. package/dist/schemas/blobs.d.ts +7 -1
  50. package/dist/schemas/blobs.d.ts.map +1 -1
  51. package/dist/schemas/blobs.js +1 -0
  52. package/dist/schemas/blobs.js.map +1 -1
  53. package/dist/schemas/common.d.ts +73 -1
  54. package/dist/schemas/common.d.ts.map +1 -1
  55. package/dist/schemas/common.js +38 -0
  56. package/dist/schemas/common.js.map +1 -1
  57. package/dist/schemas/index.js +3 -3
  58. package/dist/schemas/sync.d.ts +712 -38
  59. package/dist/schemas/sync.d.ts.map +1 -1
  60. package/dist/schemas/sync.js +209 -5
  61. package/dist/schemas/sync.js.map +1 -1
  62. package/dist/scopes/index.d.ts +5 -0
  63. package/dist/scopes/index.d.ts.map +1 -1
  64. package/dist/scopes/index.js +27 -0
  65. package/dist/scopes/index.js.map +1 -1
  66. package/dist/sentry.d.ts +31 -0
  67. package/dist/sentry.d.ts.map +1 -0
  68. package/dist/sentry.js +147 -0
  69. package/dist/sentry.js.map +1 -0
  70. package/dist/snapshot-chunks.d.ts +104 -20
  71. package/dist/snapshot-chunks.d.ts.map +1 -1
  72. package/dist/snapshot-chunks.js +665 -72
  73. package/dist/snapshot-chunks.js.map +1 -1
  74. package/dist/sync-packs.d.ts +33 -0
  75. package/dist/sync-packs.d.ts.map +1 -0
  76. package/dist/sync-packs.js +821 -0
  77. package/dist/sync-packs.js.map +1 -0
  78. package/dist/telemetry.d.ts.map +1 -1
  79. package/dist/telemetry.js +3 -2
  80. package/dist/telemetry.js.map +1 -1
  81. package/dist/transforms.js.map +1 -1
  82. package/dist/types.d.ts +48 -7
  83. package/dist/types.d.ts.map +1 -1
  84. package/dist/types.js.map +1 -1
  85. package/dist/utils/bytes.d.ts +4 -0
  86. package/dist/utils/bytes.d.ts.map +1 -0
  87. package/dist/utils/bytes.js +66 -0
  88. package/dist/utils/bytes.js.map +1 -0
  89. package/dist/utils/compression.d.ts +11 -3
  90. package/dist/utils/compression.d.ts.map +1 -1
  91. package/dist/utils/compression.js +102 -50
  92. package/dist/utils/compression.js.map +1 -1
  93. package/dist/utils/crypto.d.ts +7 -1
  94. package/dist/utils/crypto.d.ts.map +1 -1
  95. package/dist/utils/crypto.js +89 -7
  96. package/dist/utils/crypto.js.map +1 -1
  97. package/dist/utils/id.d.ts.map +1 -1
  98. package/dist/utils/id.js +4 -1
  99. package/dist/utils/id.js.map +1 -1
  100. package/dist/utils/index.d.ts +5 -0
  101. package/dist/utils/index.d.ts.map +1 -1
  102. package/dist/utils/index.js +9 -4
  103. package/dist/utils/index.js.map +1 -1
  104. package/dist/utils/internal-runtime.d.ts +16 -0
  105. package/dist/utils/internal-runtime.d.ts.map +1 -0
  106. package/dist/utils/internal-runtime.js +14 -0
  107. package/dist/utils/internal-runtime.js.map +1 -0
  108. package/dist/utils/object.js.map +1 -1
  109. package/dist/utils/realtime-change-index.d.ts +9 -0
  110. package/dist/utils/realtime-change-index.d.ts.map +1 -0
  111. package/dist/utils/realtime-change-index.js +36 -0
  112. package/dist/utils/realtime-change-index.js.map +1 -0
  113. package/dist/utils/realtime-connection-registry.d.ts +40 -0
  114. package/dist/utils/realtime-connection-registry.d.ts.map +1 -0
  115. package/dist/utils/realtime-connection-registry.js +237 -0
  116. package/dist/utils/realtime-connection-registry.js.map +1 -0
  117. package/dist/utils/table-registry.d.ts +10 -0
  118. package/dist/utils/table-registry.d.ts.map +1 -0
  119. package/dist/utils/table-registry.js +54 -0
  120. package/dist/utils/table-registry.js.map +1 -0
  121. package/dist/utils/url.d.ts +3 -0
  122. package/dist/utils/url.d.ts.map +1 -0
  123. package/dist/utils/url.js +20 -0
  124. package/dist/utils/url.js.map +1 -0
  125. package/package.json +52 -7
  126. package/src/blobs.ts +24 -7
  127. package/src/column-codecs.ts +36 -8
  128. package/src/error-responses.ts +423 -0
  129. package/src/http/api-client.ts +39 -0
  130. package/src/http/blob.ts +95 -0
  131. package/src/http/generated/api.ts +5241 -0
  132. package/src/http/index.ts +365 -0
  133. package/src/http/shared.ts +220 -0
  134. package/src/http/transport-client.ts +314 -0
  135. package/src/index.ts +4 -0
  136. package/src/kysely-column-codecs.ts +81 -86
  137. package/src/schemas/blobs.ts +10 -1
  138. package/src/schemas/common.ts +44 -0
  139. package/src/schemas/sync.ts +298 -7
  140. package/src/scopes/index.ts +42 -0
  141. package/src/sentry.ts +200 -0
  142. package/src/snapshot-chunks.ts +921 -69
  143. package/src/sync-packs.ts +1096 -0
  144. package/src/telemetry.ts +7 -2
  145. package/src/types.ts +63 -8
  146. package/src/utils/bytes.ts +75 -0
  147. package/src/utils/compression.ts +147 -51
  148. package/src/utils/crypto.ts +120 -7
  149. package/src/utils/id.ts +11 -1
  150. package/src/utils/index.ts +5 -0
  151. package/src/utils/internal-runtime.ts +39 -0
  152. package/src/utils/realtime-change-index.ts +44 -0
  153. package/src/utils/realtime-connection-registry.ts +286 -0
  154. package/src/utils/table-registry.ts +67 -0
  155. package/src/utils/url.ts +29 -0
  156. package/src/__tests__/compression.test.ts +0 -54
  157. package/src/__tests__/conflict.test.ts +0 -325
  158. package/src/__tests__/telemetry.test.ts +0 -170
  159. package/src/__tests__/utils.test.ts +0 -27
@@ -16,6 +16,120 @@ export type SyncOp = z.infer<typeof SyncOpSchema>;
16
16
  * Scope values in a subscription request (can be arrays)
17
17
  */
18
18
  export declare const ScopeValuesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
19
+ export declare const SYNC_AUTH_LEASE_VERSION = 1;
20
+ export declare const SYNC_AUTH_LEASE_PROTOCOL_VERSION = 1;
21
+ export declare const SYNC_AUTH_LEASE_ALG_ES256 = "ES256";
22
+ export declare const SYNC_AUTH_LEASE_TYP = "syncular-auth-lease+jws";
23
+ export declare const SYNC_AUTH_LEASE_CODE_MISSING = "sync.auth_lease_missing";
24
+ export declare const SYNC_AUTH_LEASE_CODE_INVALID = "sync.auth_lease_invalid";
25
+ export declare const SYNC_AUTH_LEASE_CODE_EXPIRED = "sync.auth_lease_expired";
26
+ export declare const SYNC_AUTH_LEASE_CODE_SCHEMA_MISMATCH = "sync.auth_lease_schema_mismatch";
27
+ export declare const SYNC_AUTH_LEASE_CODE_SCOPE_MISMATCH = "sync.auth_lease_scope_mismatch";
28
+ export declare const SYNC_AUTH_LEASE_CODE_SCOPE_REVOKED = "sync.auth_lease_scope_revoked";
29
+ export declare const SYNC_AUTH_LEASE_CODE_BUSINESS_REJECTED = "sync.auth_lease_business_rejected";
30
+ export declare const SyncAuthLeaseProtectedHeaderSchema: z.ZodObject<{
31
+ alg: z.ZodLiteral<"ES256">;
32
+ kid: z.ZodString;
33
+ typ: z.ZodLiteral<"syncular-auth-lease+jws">;
34
+ }, z.core.$strip>;
35
+ export type SyncAuthLeaseProtectedHeader = z.infer<typeof SyncAuthLeaseProtectedHeaderSchema>;
36
+ export declare const SyncAuthLeaseCapabilitiesSchema: z.ZodObject<{
37
+ allowBlobs: z.ZodBoolean;
38
+ allowCrdt: z.ZodBoolean;
39
+ allowEncryptedFields: z.ZodBoolean;
40
+ }, z.core.$strip>;
41
+ export type SyncAuthLeaseCapabilities = z.infer<typeof SyncAuthLeaseCapabilitiesSchema>;
42
+ export declare const SyncAuthLeaseScopeSchema: z.ZodObject<{
43
+ subscriptionId: z.ZodString;
44
+ table: z.ZodString;
45
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
46
+ operations: z.ZodArray<z.ZodEnum<{
47
+ delete: "delete";
48
+ upsert: "upsert";
49
+ }>>;
50
+ }, z.core.$strip>;
51
+ export type SyncAuthLeaseScope = z.infer<typeof SyncAuthLeaseScopeSchema>;
52
+ export declare const SyncAuthLeasePayloadSchema: z.ZodObject<{
53
+ version: z.ZodLiteral<1>;
54
+ leaseId: z.ZodString;
55
+ issuer: z.ZodString;
56
+ audience: z.ZodString;
57
+ actorId: z.ZodString;
58
+ subject: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
59
+ schemaVersion: z.ZodNumber;
60
+ protocolVersion: z.ZodLiteral<1>;
61
+ issuedAtMs: z.ZodNumber;
62
+ notBeforeMs: z.ZodNumber;
63
+ expiresAtMs: z.ZodNumber;
64
+ maxClockSkewMs: z.ZodNumber;
65
+ scopes: z.ZodArray<z.ZodObject<{
66
+ subscriptionId: z.ZodString;
67
+ table: z.ZodString;
68
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
69
+ operations: z.ZodArray<z.ZodEnum<{
70
+ delete: "delete";
71
+ upsert: "upsert";
72
+ }>>;
73
+ }, z.core.$strip>>;
74
+ capabilities: z.ZodObject<{
75
+ allowBlobs: z.ZodBoolean;
76
+ allowCrdt: z.ZodBoolean;
77
+ allowEncryptedFields: z.ZodBoolean;
78
+ }, z.core.$strip>;
79
+ }, z.core.$strip>;
80
+ export type SyncAuthLeasePayload = z.infer<typeof SyncAuthLeasePayloadSchema>;
81
+ export declare const SyncAuthLeaseIssueRequestSchema: z.ZodObject<{
82
+ schemaVersion: z.ZodNumber;
83
+ ttlMs: z.ZodOptional<z.ZodNumber>;
84
+ scopes: z.ZodArray<z.ZodObject<{
85
+ subscriptionId: z.ZodString;
86
+ table: z.ZodString;
87
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
88
+ operations: z.ZodArray<z.ZodEnum<{
89
+ delete: "delete";
90
+ upsert: "upsert";
91
+ }>>;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>;
94
+ export type SyncAuthLeaseIssueRequest = z.infer<typeof SyncAuthLeaseIssueRequestSchema>;
95
+ export declare const SyncAuthLeaseIssueResponseSchema: z.ZodObject<{
96
+ ok: z.ZodLiteral<true>;
97
+ token: z.ZodString;
98
+ protectedHeader: z.ZodObject<{
99
+ alg: z.ZodLiteral<"ES256">;
100
+ kid: z.ZodString;
101
+ typ: z.ZodLiteral<"syncular-auth-lease+jws">;
102
+ }, z.core.$strip>;
103
+ payload: z.ZodObject<{
104
+ version: z.ZodLiteral<1>;
105
+ leaseId: z.ZodString;
106
+ issuer: z.ZodString;
107
+ audience: z.ZodString;
108
+ actorId: z.ZodString;
109
+ subject: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
110
+ schemaVersion: z.ZodNumber;
111
+ protocolVersion: z.ZodLiteral<1>;
112
+ issuedAtMs: z.ZodNumber;
113
+ notBeforeMs: z.ZodNumber;
114
+ expiresAtMs: z.ZodNumber;
115
+ maxClockSkewMs: z.ZodNumber;
116
+ scopes: z.ZodArray<z.ZodObject<{
117
+ subscriptionId: z.ZodString;
118
+ table: z.ZodString;
119
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
120
+ operations: z.ZodArray<z.ZodEnum<{
121
+ delete: "delete";
122
+ upsert: "upsert";
123
+ }>>;
124
+ }, z.core.$strip>>;
125
+ capabilities: z.ZodObject<{
126
+ allowBlobs: z.ZodBoolean;
127
+ allowCrdt: z.ZodBoolean;
128
+ allowEncryptedFields: z.ZodBoolean;
129
+ }, z.core.$strip>;
130
+ }, z.core.$strip>;
131
+ }, z.core.$strip>;
132
+ export type SyncAuthLeaseIssueResponse = z.infer<typeof SyncAuthLeaseIssueResponseSchema>;
19
133
  export declare const SyncOperationSchema: z.ZodObject<{
20
134
  table: z.ZodString;
21
135
  row_id: z.ZodString;
@@ -27,6 +141,14 @@ export declare const SyncOperationSchema: z.ZodObject<{
27
141
  base_version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
28
142
  }, z.core.$strip>;
29
143
  export type SyncOperation = z.infer<typeof SyncOperationSchema>;
144
+ export declare const SyncAuthLeaseProvenanceSchema: z.ZodObject<{
145
+ leaseId: z.ZodString;
146
+ leaseExpiresAtMs: z.ZodNumber;
147
+ leaseStatusAtEnqueue: z.ZodString;
148
+ leaseScopeSummaryJson: z.ZodOptional<z.ZodString>;
149
+ leaseToken: z.ZodOptional<z.ZodString>;
150
+ }, z.core.$strip>;
151
+ export type SyncAuthLeaseProvenance = z.infer<typeof SyncAuthLeaseProvenanceSchema>;
30
152
  export declare const SyncPushRequestSchema: z.ZodObject<{
31
153
  clientId: z.ZodString;
32
154
  clientCommitId: z.ZodString;
@@ -41,8 +163,37 @@ export declare const SyncPushRequestSchema: z.ZodObject<{
41
163
  base_version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
42
164
  }, z.core.$strip>>;
43
165
  schemaVersion: z.ZodNumber;
166
+ authLease: z.ZodOptional<z.ZodObject<{
167
+ leaseId: z.ZodString;
168
+ leaseExpiresAtMs: z.ZodNumber;
169
+ leaseStatusAtEnqueue: z.ZodString;
170
+ leaseScopeSummaryJson: z.ZodOptional<z.ZodString>;
171
+ leaseToken: z.ZodOptional<z.ZodString>;
172
+ }, z.core.$strip>>;
44
173
  }, z.core.$strip>;
45
174
  export type SyncPushRequest = z.infer<typeof SyncPushRequestSchema>;
175
+ export declare const SyncPushCommitRequestSchema: z.ZodObject<{
176
+ clientCommitId: z.ZodString;
177
+ operations: z.ZodArray<z.ZodObject<{
178
+ table: z.ZodString;
179
+ row_id: z.ZodString;
180
+ op: z.ZodEnum<{
181
+ delete: "delete";
182
+ upsert: "upsert";
183
+ }>;
184
+ payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
185
+ base_version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
186
+ }, z.core.$strip>>;
187
+ schemaVersion: z.ZodNumber;
188
+ authLease: z.ZodOptional<z.ZodObject<{
189
+ leaseId: z.ZodString;
190
+ leaseExpiresAtMs: z.ZodNumber;
191
+ leaseStatusAtEnqueue: z.ZodString;
192
+ leaseScopeSummaryJson: z.ZodOptional<z.ZodString>;
193
+ leaseToken: z.ZodOptional<z.ZodString>;
194
+ }, z.core.$strip>>;
195
+ }, z.core.$strip>;
196
+ export type SyncPushCommitRequest = z.infer<typeof SyncPushCommitRequestSchema>;
46
197
  export declare const SyncOperationResultSchema: z.ZodUnion<readonly [z.ZodObject<{
47
198
  opIndex: z.ZodNumber;
48
199
  status: z.ZodLiteral<"applied">;
@@ -50,6 +201,7 @@ export declare const SyncOperationResultSchema: z.ZodUnion<readonly [z.ZodObject
50
201
  opIndex: z.ZodNumber;
51
202
  status: z.ZodLiteral<"conflict">;
52
203
  message: z.ZodString;
204
+ code: z.ZodOptional<z.ZodString>;
53
205
  server_version: z.ZodNumber;
54
206
  server_row: z.ZodUnknown;
55
207
  }, z.core.$strip>, z.ZodObject<{
@@ -75,6 +227,7 @@ export declare const SyncPushResponseSchema: z.ZodObject<{
75
227
  opIndex: z.ZodNumber;
76
228
  status: z.ZodLiteral<"conflict">;
77
229
  message: z.ZodString;
230
+ code: z.ZodOptional<z.ZodString>;
78
231
  server_version: z.ZodNumber;
79
232
  server_row: z.ZodUnknown;
80
233
  }, z.core.$strip>, z.ZodObject<{
@@ -86,6 +239,90 @@ export declare const SyncPushResponseSchema: z.ZodObject<{
86
239
  }, z.core.$strip>]>>;
87
240
  }, z.core.$strip>;
88
241
  export type SyncPushResponse = z.infer<typeof SyncPushResponseSchema>;
242
+ export declare const SyncPushBatchCommitResponseSchema: z.ZodObject<{
243
+ ok: z.ZodLiteral<true>;
244
+ status: z.ZodEnum<{
245
+ applied: "applied";
246
+ cached: "cached";
247
+ rejected: "rejected";
248
+ }>;
249
+ commitSeq: z.ZodOptional<z.ZodNumber>;
250
+ results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
251
+ opIndex: z.ZodNumber;
252
+ status: z.ZodLiteral<"applied">;
253
+ }, z.core.$strip>, z.ZodObject<{
254
+ opIndex: z.ZodNumber;
255
+ status: z.ZodLiteral<"conflict">;
256
+ message: z.ZodString;
257
+ code: z.ZodOptional<z.ZodString>;
258
+ server_version: z.ZodNumber;
259
+ server_row: z.ZodUnknown;
260
+ }, z.core.$strip>, z.ZodObject<{
261
+ opIndex: z.ZodNumber;
262
+ status: z.ZodLiteral<"error">;
263
+ error: z.ZodString;
264
+ code: z.ZodOptional<z.ZodString>;
265
+ retriable: z.ZodOptional<z.ZodBoolean>;
266
+ }, z.core.$strip>]>>;
267
+ clientCommitId: z.ZodString;
268
+ }, z.core.$strip>;
269
+ export type SyncPushBatchCommitResponse = z.infer<typeof SyncPushBatchCommitResponseSchema>;
270
+ export declare const SyncPushBatchRequestSchema: z.ZodObject<{
271
+ clientId: z.ZodString;
272
+ commits: z.ZodArray<z.ZodObject<{
273
+ clientCommitId: z.ZodString;
274
+ operations: z.ZodArray<z.ZodObject<{
275
+ table: z.ZodString;
276
+ row_id: z.ZodString;
277
+ op: z.ZodEnum<{
278
+ delete: "delete";
279
+ upsert: "upsert";
280
+ }>;
281
+ payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
282
+ base_version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
283
+ }, z.core.$strip>>;
284
+ schemaVersion: z.ZodNumber;
285
+ authLease: z.ZodOptional<z.ZodObject<{
286
+ leaseId: z.ZodString;
287
+ leaseExpiresAtMs: z.ZodNumber;
288
+ leaseStatusAtEnqueue: z.ZodString;
289
+ leaseScopeSummaryJson: z.ZodOptional<z.ZodString>;
290
+ leaseToken: z.ZodOptional<z.ZodString>;
291
+ }, z.core.$strip>>;
292
+ }, z.core.$strip>>;
293
+ }, z.core.$strip>;
294
+ export type SyncPushBatchRequest = z.infer<typeof SyncPushBatchRequestSchema>;
295
+ export declare const SyncPushBatchResponseSchema: z.ZodObject<{
296
+ ok: z.ZodLiteral<true>;
297
+ commits: z.ZodArray<z.ZodObject<{
298
+ ok: z.ZodLiteral<true>;
299
+ status: z.ZodEnum<{
300
+ applied: "applied";
301
+ cached: "cached";
302
+ rejected: "rejected";
303
+ }>;
304
+ commitSeq: z.ZodOptional<z.ZodNumber>;
305
+ results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
306
+ opIndex: z.ZodNumber;
307
+ status: z.ZodLiteral<"applied">;
308
+ }, z.core.$strip>, z.ZodObject<{
309
+ opIndex: z.ZodNumber;
310
+ status: z.ZodLiteral<"conflict">;
311
+ message: z.ZodString;
312
+ code: z.ZodOptional<z.ZodString>;
313
+ server_version: z.ZodNumber;
314
+ server_row: z.ZodUnknown;
315
+ }, z.core.$strip>, z.ZodObject<{
316
+ opIndex: z.ZodNumber;
317
+ status: z.ZodLiteral<"error">;
318
+ error: z.ZodString;
319
+ code: z.ZodOptional<z.ZodString>;
320
+ retriable: z.ZodOptional<z.ZodBoolean>;
321
+ }, z.core.$strip>]>>;
322
+ clientCommitId: z.ZodString;
323
+ }, z.core.$strip>>;
324
+ }, z.core.$strip>;
325
+ export type SyncPushBatchResponse = z.infer<typeof SyncPushBatchResponseSchema>;
89
326
  export declare const SyncBootstrapStateSchema: z.ZodObject<{
90
327
  asOfCommitSeq: z.ZodNumber;
91
328
  tables: z.ZodArray<z.ZodString>;
@@ -93,6 +330,15 @@ export declare const SyncBootstrapStateSchema: z.ZodObject<{
93
330
  rowCursor: z.ZodNullable<z.ZodString>;
94
331
  }, z.core.$strip>;
95
332
  export type SyncBootstrapState = z.infer<typeof SyncBootstrapStateSchema>;
333
+ export declare const SyncCrdtStateVectorHintSchema: z.ZodObject<{
334
+ rowId: z.ZodString;
335
+ field: z.ZodString;
336
+ stateColumn: z.ZodString;
337
+ stateVectorBase64: z.ZodString;
338
+ syncMode: z.ZodString;
339
+ updatedAt: z.ZodNumber;
340
+ }, z.core.$strip>;
341
+ export type SyncCrdtStateVectorHint = z.infer<typeof SyncCrdtStateVectorHintSchema>;
96
342
  export declare const SyncSubscriptionRequestSchema: z.ZodObject<{
97
343
  id: z.ZodString;
98
344
  table: z.ZodString;
@@ -105,14 +351,40 @@ export declare const SyncSubscriptionRequestSchema: z.ZodObject<{
105
351
  tableIndex: z.ZodNumber;
106
352
  rowCursor: z.ZodNullable<z.ZodString>;
107
353
  }, z.core.$strip>>>;
354
+ verifiedRoot: z.ZodOptional<z.ZodString>;
355
+ crdtStateVectors: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
356
+ rowId: z.ZodString;
357
+ field: z.ZodString;
358
+ stateColumn: z.ZodString;
359
+ stateVectorBase64: z.ZodString;
360
+ syncMode: z.ZodString;
361
+ updatedAt: z.ZodNumber;
362
+ }, z.core.$strip>>>>;
108
363
  }, z.core.$strip>;
109
364
  export type SyncSubscriptionRequest = z.infer<typeof SyncSubscriptionRequestSchema>;
365
+ export declare const SyncSnapshotChunkEncodingSchema: z.ZodEnum<{
366
+ "binary-table-v1": "binary-table-v1";
367
+ }>;
368
+ export declare const SyncScopedSnapshotArtifactKindSchema: z.ZodLiteral<"sqlite-snapshot-v1">;
369
+ export declare const SyncSnapshotArtifactCompressionSchema: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
370
+ export declare const SyncSnapshotArtifactsRequestSchema: z.ZodObject<{
371
+ artifactKinds: z.ZodArray<z.ZodLiteral<"sqlite-snapshot-v1">>;
372
+ compressions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>>>;
373
+ featureSet: z.ZodOptional<z.ZodArray<z.ZodString>>;
374
+ }, z.core.$strip>;
375
+ export type SyncSnapshotArtifactsRequest = z.infer<typeof SyncSnapshotArtifactsRequestSchema>;
110
376
  export declare const SyncPullRequestSchema: z.ZodObject<{
111
377
  clientId: z.ZodString;
378
+ schemaVersion: z.ZodNumber;
112
379
  limitCommits: z.ZodNumber;
113
380
  limitSnapshotRows: z.ZodOptional<z.ZodNumber>;
114
381
  maxSnapshotPages: z.ZodOptional<z.ZodNumber>;
115
382
  dedupeRows: z.ZodOptional<z.ZodBoolean>;
383
+ snapshotArtifacts: z.ZodOptional<z.ZodObject<{
384
+ artifactKinds: z.ZodArray<z.ZodLiteral<"sqlite-snapshot-v1">>;
385
+ compressions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>>>;
386
+ featureSet: z.ZodOptional<z.ZodArray<z.ZodString>>;
387
+ }, z.core.$strip>>;
116
388
  subscriptions: z.ZodArray<z.ZodObject<{
117
389
  id: z.ZodString;
118
390
  table: z.ZodString;
@@ -125,6 +397,15 @@ export declare const SyncPullRequestSchema: z.ZodObject<{
125
397
  tableIndex: z.ZodNumber;
126
398
  rowCursor: z.ZodNullable<z.ZodString>;
127
399
  }, z.core.$strip>>>;
400
+ verifiedRoot: z.ZodOptional<z.ZodString>;
401
+ crdtStateVectors: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
402
+ rowId: z.ZodString;
403
+ field: z.ZodString;
404
+ stateColumn: z.ZodString;
405
+ stateVectorBase64: z.ZodString;
406
+ syncMode: z.ZodString;
407
+ updatedAt: z.ZodNumber;
408
+ }, z.core.$strip>>>>;
128
409
  }, z.core.$strip>>;
129
410
  }, z.core.$strip>;
130
411
  export type SyncPullRequest = z.infer<typeof SyncPullRequestSchema>;
@@ -157,14 +438,110 @@ export declare const SyncCommitSchema: z.ZodObject<{
157
438
  }, z.core.$strip>>;
158
439
  }, z.core.$strip>;
159
440
  export type SyncCommit = z.infer<typeof SyncCommitSchema>;
441
+ export declare const SyncPullSubscriptionIntegritySchema: z.ZodObject<{
442
+ partitionId: z.ZodString;
443
+ previousChainRoot: z.ZodString;
444
+ commitChainRoot: z.ZodString;
445
+ commitSeq: z.ZodNumber;
446
+ }, z.core.$strip>;
447
+ export type SyncPullSubscriptionIntegrity = z.infer<typeof SyncPullSubscriptionIntegritySchema>;
160
448
  export declare const SyncSnapshotChunkRefSchema: z.ZodObject<{
161
449
  id: z.ZodString;
162
450
  byteLength: z.ZodNumber;
163
451
  sha256: z.ZodString;
164
- encoding: z.ZodLiteral<"json-row-frame-v1">;
452
+ encoding: z.ZodEnum<{
453
+ "binary-table-v1": "binary-table-v1";
454
+ }>;
165
455
  compression: z.ZodLiteral<"gzip">;
166
456
  }, z.core.$strip>;
167
457
  export type SyncSnapshotChunkRef = z.infer<typeof SyncSnapshotChunkRefSchema>;
458
+ export declare const SyncSnapshotManifestChunkSchema: z.ZodObject<{
459
+ id: z.ZodString;
460
+ byteLength: z.ZodNumber;
461
+ sha256: z.ZodString;
462
+ encoding: z.ZodEnum<{
463
+ "binary-table-v1": "binary-table-v1";
464
+ }>;
465
+ compression: z.ZodLiteral<"gzip">;
466
+ }, z.core.$strip>;
467
+ export declare const SyncSnapshotManifestSchema: z.ZodObject<{
468
+ version: z.ZodLiteral<1>;
469
+ digest: z.ZodString;
470
+ table: z.ZodString;
471
+ asOfCommitSeq: z.ZodNumber;
472
+ scopeDigest: z.ZodString;
473
+ rowCursor: z.ZodNullable<z.ZodString>;
474
+ rowLimit: z.ZodNumber;
475
+ nextRowCursor: z.ZodNullable<z.ZodString>;
476
+ isFirstPage: z.ZodBoolean;
477
+ isLastPage: z.ZodBoolean;
478
+ chunks: z.ZodArray<z.ZodObject<{
479
+ id: z.ZodString;
480
+ byteLength: z.ZodNumber;
481
+ sha256: z.ZodString;
482
+ encoding: z.ZodEnum<{
483
+ "binary-table-v1": "binary-table-v1";
484
+ }>;
485
+ compression: z.ZodLiteral<"gzip">;
486
+ }, z.core.$strip>>;
487
+ }, z.core.$strip>;
488
+ export type SyncSnapshotManifest = z.infer<typeof SyncSnapshotManifestSchema>;
489
+ export declare const SyncScopedSnapshotArtifactManifestSchema: z.ZodObject<{
490
+ version: z.ZodLiteral<1>;
491
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
492
+ digest: z.ZodString;
493
+ partitionId: z.ZodString;
494
+ subscriptionId: z.ZodString;
495
+ table: z.ZodString;
496
+ schemaVersion: z.ZodString;
497
+ asOfCommitSeq: z.ZodNumber;
498
+ scopeDigest: z.ZodString;
499
+ rowCursor: z.ZodNullable<z.ZodString>;
500
+ rowLimit: z.ZodNumber;
501
+ rowCount: z.ZodNumber;
502
+ nextRowCursor: z.ZodNullable<z.ZodString>;
503
+ isFirstPage: z.ZodBoolean;
504
+ isLastPage: z.ZodBoolean;
505
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
506
+ byteLength: z.ZodNumber;
507
+ sha256: z.ZodString;
508
+ featureSet: z.ZodArray<z.ZodString>;
509
+ }, z.core.$strip>;
510
+ export type SyncScopedSnapshotArtifactManifest = z.infer<typeof SyncScopedSnapshotArtifactManifestSchema>;
511
+ export declare const SyncSnapshotArtifactRefSchema: z.ZodObject<{
512
+ id: z.ZodString;
513
+ byteLength: z.ZodNumber;
514
+ sha256: z.ZodString;
515
+ manifestDigest: z.ZodString;
516
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
517
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
518
+ rowCount: z.ZodNumber;
519
+ nextRowCursor: z.ZodNullable<z.ZodString>;
520
+ isFirstPage: z.ZodBoolean;
521
+ isLastPage: z.ZodBoolean;
522
+ manifest: z.ZodObject<{
523
+ version: z.ZodLiteral<1>;
524
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
525
+ digest: z.ZodString;
526
+ partitionId: z.ZodString;
527
+ subscriptionId: z.ZodString;
528
+ table: z.ZodString;
529
+ schemaVersion: z.ZodString;
530
+ asOfCommitSeq: z.ZodNumber;
531
+ scopeDigest: z.ZodString;
532
+ rowCursor: z.ZodNullable<z.ZodString>;
533
+ rowLimit: z.ZodNumber;
534
+ rowCount: z.ZodNumber;
535
+ nextRowCursor: z.ZodNullable<z.ZodString>;
536
+ isFirstPage: z.ZodBoolean;
537
+ isLastPage: z.ZodBoolean;
538
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
539
+ byteLength: z.ZodNumber;
540
+ sha256: z.ZodString;
541
+ featureSet: z.ZodArray<z.ZodString>;
542
+ }, z.core.$strip>;
543
+ }, z.core.$strip>;
544
+ export type SyncSnapshotArtifactRef = z.infer<typeof SyncSnapshotArtifactRefSchema>;
168
545
  export declare const SyncSnapshotSchema: z.ZodObject<{
169
546
  table: z.ZodString;
170
547
  rows: z.ZodArray<z.ZodUnknown>;
@@ -172,11 +549,73 @@ export declare const SyncSnapshotSchema: z.ZodObject<{
172
549
  id: z.ZodString;
173
550
  byteLength: z.ZodNumber;
174
551
  sha256: z.ZodString;
175
- encoding: z.ZodLiteral<"json-row-frame-v1">;
552
+ encoding: z.ZodEnum<{
553
+ "binary-table-v1": "binary-table-v1";
554
+ }>;
176
555
  compression: z.ZodLiteral<"gzip">;
177
556
  }, z.core.$strip>>>;
557
+ manifest: z.ZodOptional<z.ZodObject<{
558
+ version: z.ZodLiteral<1>;
559
+ digest: z.ZodString;
560
+ table: z.ZodString;
561
+ asOfCommitSeq: z.ZodNumber;
562
+ scopeDigest: z.ZodString;
563
+ rowCursor: z.ZodNullable<z.ZodString>;
564
+ rowLimit: z.ZodNumber;
565
+ nextRowCursor: z.ZodNullable<z.ZodString>;
566
+ isFirstPage: z.ZodBoolean;
567
+ isLastPage: z.ZodBoolean;
568
+ chunks: z.ZodArray<z.ZodObject<{
569
+ id: z.ZodString;
570
+ byteLength: z.ZodNumber;
571
+ sha256: z.ZodString;
572
+ encoding: z.ZodEnum<{
573
+ "binary-table-v1": "binary-table-v1";
574
+ }>;
575
+ compression: z.ZodLiteral<"gzip">;
576
+ }, z.core.$strip>>;
577
+ }, z.core.$strip>>;
578
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
579
+ id: z.ZodString;
580
+ byteLength: z.ZodNumber;
581
+ sha256: z.ZodString;
582
+ manifestDigest: z.ZodString;
583
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
584
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
585
+ rowCount: z.ZodNumber;
586
+ nextRowCursor: z.ZodNullable<z.ZodString>;
587
+ isFirstPage: z.ZodBoolean;
588
+ isLastPage: z.ZodBoolean;
589
+ manifest: z.ZodObject<{
590
+ version: z.ZodLiteral<1>;
591
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
592
+ digest: z.ZodString;
593
+ partitionId: z.ZodString;
594
+ subscriptionId: z.ZodString;
595
+ table: z.ZodString;
596
+ schemaVersion: z.ZodString;
597
+ asOfCommitSeq: z.ZodNumber;
598
+ scopeDigest: z.ZodString;
599
+ rowCursor: z.ZodNullable<z.ZodString>;
600
+ rowLimit: z.ZodNumber;
601
+ rowCount: z.ZodNumber;
602
+ nextRowCursor: z.ZodNullable<z.ZodString>;
603
+ isFirstPage: z.ZodBoolean;
604
+ isLastPage: z.ZodBoolean;
605
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
606
+ byteLength: z.ZodNumber;
607
+ sha256: z.ZodString;
608
+ featureSet: z.ZodArray<z.ZodString>;
609
+ }, z.core.$strip>;
610
+ }, z.core.$strip>>>;
178
611
  isFirstPage: z.ZodBoolean;
179
612
  isLastPage: z.ZodBoolean;
613
+ bootstrapStateAfter: z.ZodOptional<z.ZodNullable<z.ZodObject<{
614
+ asOfCommitSeq: z.ZodNumber;
615
+ tables: z.ZodArray<z.ZodString>;
616
+ tableIndex: z.ZodNumber;
617
+ rowCursor: z.ZodNullable<z.ZodString>;
618
+ }, z.core.$strip>>>;
180
619
  }, z.core.$strip>;
181
620
  export type SyncSnapshot = z.infer<typeof SyncSnapshotSchema>;
182
621
  export declare const SyncPullSubscriptionResponseSchema: z.ZodObject<{
@@ -194,6 +633,12 @@ export declare const SyncPullSubscriptionResponseSchema: z.ZodObject<{
194
633
  rowCursor: z.ZodNullable<z.ZodString>;
195
634
  }, z.core.$strip>>>;
196
635
  nextCursor: z.ZodNumber;
636
+ integrity: z.ZodOptional<z.ZodObject<{
637
+ partitionId: z.ZodString;
638
+ previousChainRoot: z.ZodString;
639
+ commitChainRoot: z.ZodString;
640
+ commitSeq: z.ZodNumber;
641
+ }, z.core.$strip>>;
197
642
  commits: z.ZodArray<z.ZodObject<{
198
643
  commitSeq: z.ZodNumber;
199
644
  createdAt: z.ZodString;
@@ -217,11 +662,73 @@ export declare const SyncPullSubscriptionResponseSchema: z.ZodObject<{
217
662
  id: z.ZodString;
218
663
  byteLength: z.ZodNumber;
219
664
  sha256: z.ZodString;
220
- encoding: z.ZodLiteral<"json-row-frame-v1">;
665
+ encoding: z.ZodEnum<{
666
+ "binary-table-v1": "binary-table-v1";
667
+ }>;
221
668
  compression: z.ZodLiteral<"gzip">;
222
669
  }, z.core.$strip>>>;
670
+ manifest: z.ZodOptional<z.ZodObject<{
671
+ version: z.ZodLiteral<1>;
672
+ digest: z.ZodString;
673
+ table: z.ZodString;
674
+ asOfCommitSeq: z.ZodNumber;
675
+ scopeDigest: z.ZodString;
676
+ rowCursor: z.ZodNullable<z.ZodString>;
677
+ rowLimit: z.ZodNumber;
678
+ nextRowCursor: z.ZodNullable<z.ZodString>;
679
+ isFirstPage: z.ZodBoolean;
680
+ isLastPage: z.ZodBoolean;
681
+ chunks: z.ZodArray<z.ZodObject<{
682
+ id: z.ZodString;
683
+ byteLength: z.ZodNumber;
684
+ sha256: z.ZodString;
685
+ encoding: z.ZodEnum<{
686
+ "binary-table-v1": "binary-table-v1";
687
+ }>;
688
+ compression: z.ZodLiteral<"gzip">;
689
+ }, z.core.$strip>>;
690
+ }, z.core.$strip>>;
691
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
692
+ id: z.ZodString;
693
+ byteLength: z.ZodNumber;
694
+ sha256: z.ZodString;
695
+ manifestDigest: z.ZodString;
696
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
697
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
698
+ rowCount: z.ZodNumber;
699
+ nextRowCursor: z.ZodNullable<z.ZodString>;
700
+ isFirstPage: z.ZodBoolean;
701
+ isLastPage: z.ZodBoolean;
702
+ manifest: z.ZodObject<{
703
+ version: z.ZodLiteral<1>;
704
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
705
+ digest: z.ZodString;
706
+ partitionId: z.ZodString;
707
+ subscriptionId: z.ZodString;
708
+ table: z.ZodString;
709
+ schemaVersion: z.ZodString;
710
+ asOfCommitSeq: z.ZodNumber;
711
+ scopeDigest: z.ZodString;
712
+ rowCursor: z.ZodNullable<z.ZodString>;
713
+ rowLimit: z.ZodNumber;
714
+ rowCount: z.ZodNumber;
715
+ nextRowCursor: z.ZodNullable<z.ZodString>;
716
+ isFirstPage: z.ZodBoolean;
717
+ isLastPage: z.ZodBoolean;
718
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
719
+ byteLength: z.ZodNumber;
720
+ sha256: z.ZodString;
721
+ featureSet: z.ZodArray<z.ZodString>;
722
+ }, z.core.$strip>;
723
+ }, z.core.$strip>>>;
223
724
  isFirstPage: z.ZodBoolean;
224
725
  isLastPage: z.ZodBoolean;
726
+ bootstrapStateAfter: z.ZodOptional<z.ZodNullable<z.ZodObject<{
727
+ asOfCommitSeq: z.ZodNumber;
728
+ tables: z.ZodArray<z.ZodString>;
729
+ tableIndex: z.ZodNumber;
730
+ rowCursor: z.ZodNullable<z.ZodString>;
731
+ }, z.core.$strip>>>;
225
732
  }, z.core.$strip>>>;
226
733
  }, z.core.$strip>;
227
734
  export type SyncPullSubscriptionResponse = z.infer<typeof SyncPullSubscriptionResponseSchema>;
@@ -242,6 +749,12 @@ export declare const SyncPullResponseSchema: z.ZodObject<{
242
749
  rowCursor: z.ZodNullable<z.ZodString>;
243
750
  }, z.core.$strip>>>;
244
751
  nextCursor: z.ZodNumber;
752
+ integrity: z.ZodOptional<z.ZodObject<{
753
+ partitionId: z.ZodString;
754
+ previousChainRoot: z.ZodString;
755
+ commitChainRoot: z.ZodString;
756
+ commitSeq: z.ZodNumber;
757
+ }, z.core.$strip>>;
245
758
  commits: z.ZodArray<z.ZodObject<{
246
759
  commitSeq: z.ZodNumber;
247
760
  createdAt: z.ZodString;
@@ -265,11 +778,73 @@ export declare const SyncPullResponseSchema: z.ZodObject<{
265
778
  id: z.ZodString;
266
779
  byteLength: z.ZodNumber;
267
780
  sha256: z.ZodString;
268
- encoding: z.ZodLiteral<"json-row-frame-v1">;
781
+ encoding: z.ZodEnum<{
782
+ "binary-table-v1": "binary-table-v1";
783
+ }>;
269
784
  compression: z.ZodLiteral<"gzip">;
270
785
  }, z.core.$strip>>>;
786
+ manifest: z.ZodOptional<z.ZodObject<{
787
+ version: z.ZodLiteral<1>;
788
+ digest: z.ZodString;
789
+ table: z.ZodString;
790
+ asOfCommitSeq: z.ZodNumber;
791
+ scopeDigest: z.ZodString;
792
+ rowCursor: z.ZodNullable<z.ZodString>;
793
+ rowLimit: z.ZodNumber;
794
+ nextRowCursor: z.ZodNullable<z.ZodString>;
795
+ isFirstPage: z.ZodBoolean;
796
+ isLastPage: z.ZodBoolean;
797
+ chunks: z.ZodArray<z.ZodObject<{
798
+ id: z.ZodString;
799
+ byteLength: z.ZodNumber;
800
+ sha256: z.ZodString;
801
+ encoding: z.ZodEnum<{
802
+ "binary-table-v1": "binary-table-v1";
803
+ }>;
804
+ compression: z.ZodLiteral<"gzip">;
805
+ }, z.core.$strip>>;
806
+ }, z.core.$strip>>;
807
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
808
+ id: z.ZodString;
809
+ byteLength: z.ZodNumber;
810
+ sha256: z.ZodString;
811
+ manifestDigest: z.ZodString;
812
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
813
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
814
+ rowCount: z.ZodNumber;
815
+ nextRowCursor: z.ZodNullable<z.ZodString>;
816
+ isFirstPage: z.ZodBoolean;
817
+ isLastPage: z.ZodBoolean;
818
+ manifest: z.ZodObject<{
819
+ version: z.ZodLiteral<1>;
820
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
821
+ digest: z.ZodString;
822
+ partitionId: z.ZodString;
823
+ subscriptionId: z.ZodString;
824
+ table: z.ZodString;
825
+ schemaVersion: z.ZodString;
826
+ asOfCommitSeq: z.ZodNumber;
827
+ scopeDigest: z.ZodString;
828
+ rowCursor: z.ZodNullable<z.ZodString>;
829
+ rowLimit: z.ZodNumber;
830
+ rowCount: z.ZodNumber;
831
+ nextRowCursor: z.ZodNullable<z.ZodString>;
832
+ isFirstPage: z.ZodBoolean;
833
+ isLastPage: z.ZodBoolean;
834
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
835
+ byteLength: z.ZodNumber;
836
+ sha256: z.ZodString;
837
+ featureSet: z.ZodArray<z.ZodString>;
838
+ }, z.core.$strip>;
839
+ }, z.core.$strip>>>;
271
840
  isFirstPage: z.ZodBoolean;
272
841
  isLastPage: z.ZodBoolean;
842
+ bootstrapStateAfter: z.ZodOptional<z.ZodNullable<z.ZodObject<{
843
+ asOfCommitSeq: z.ZodNumber;
844
+ tables: z.ZodArray<z.ZodString>;
845
+ tableIndex: z.ZodNumber;
846
+ rowCursor: z.ZodNullable<z.ZodString>;
847
+ }, z.core.$strip>>>;
273
848
  }, z.core.$strip>>>;
274
849
  }, z.core.$strip>>;
275
850
  }, z.core.$strip>;
@@ -277,24 +852,39 @@ export type SyncPullResponse = z.infer<typeof SyncPullResponseSchema>;
277
852
  export declare const SyncCombinedRequestSchema: z.ZodObject<{
278
853
  clientId: z.ZodString;
279
854
  push: z.ZodOptional<z.ZodObject<{
280
- clientCommitId: z.ZodString;
281
- operations: z.ZodArray<z.ZodObject<{
282
- table: z.ZodString;
283
- row_id: z.ZodString;
284
- op: z.ZodEnum<{
285
- delete: "delete";
286
- upsert: "upsert";
287
- }>;
288
- payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
289
- base_version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
855
+ commits: z.ZodArray<z.ZodObject<{
856
+ clientCommitId: z.ZodString;
857
+ operations: z.ZodArray<z.ZodObject<{
858
+ table: z.ZodString;
859
+ row_id: z.ZodString;
860
+ op: z.ZodEnum<{
861
+ delete: "delete";
862
+ upsert: "upsert";
863
+ }>;
864
+ payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
865
+ base_version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
866
+ }, z.core.$strip>>;
867
+ schemaVersion: z.ZodNumber;
868
+ authLease: z.ZodOptional<z.ZodObject<{
869
+ leaseId: z.ZodString;
870
+ leaseExpiresAtMs: z.ZodNumber;
871
+ leaseStatusAtEnqueue: z.ZodString;
872
+ leaseScopeSummaryJson: z.ZodOptional<z.ZodString>;
873
+ leaseToken: z.ZodOptional<z.ZodString>;
874
+ }, z.core.$strip>>;
290
875
  }, z.core.$strip>>;
291
- schemaVersion: z.ZodNumber;
292
876
  }, z.core.$strip>>;
293
877
  pull: z.ZodOptional<z.ZodObject<{
878
+ schemaVersion: z.ZodNumber;
294
879
  limitCommits: z.ZodNumber;
295
880
  limitSnapshotRows: z.ZodOptional<z.ZodNumber>;
296
881
  maxSnapshotPages: z.ZodOptional<z.ZodNumber>;
297
882
  dedupeRows: z.ZodOptional<z.ZodBoolean>;
883
+ snapshotArtifacts: z.ZodOptional<z.ZodObject<{
884
+ artifactKinds: z.ZodArray<z.ZodLiteral<"sqlite-snapshot-v1">>;
885
+ compressions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>>>;
886
+ featureSet: z.ZodOptional<z.ZodArray<z.ZodString>>;
887
+ }, z.core.$strip>>;
298
888
  subscriptions: z.ZodArray<z.ZodObject<{
299
889
  id: z.ZodString;
300
890
  table: z.ZodString;
@@ -307,36 +897,52 @@ export declare const SyncCombinedRequestSchema: z.ZodObject<{
307
897
  tableIndex: z.ZodNumber;
308
898
  rowCursor: z.ZodNullable<z.ZodString>;
309
899
  }, z.core.$strip>>>;
900
+ verifiedRoot: z.ZodOptional<z.ZodString>;
901
+ crdtStateVectors: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
902
+ rowId: z.ZodString;
903
+ field: z.ZodString;
904
+ stateColumn: z.ZodString;
905
+ stateVectorBase64: z.ZodString;
906
+ syncMode: z.ZodString;
907
+ updatedAt: z.ZodNumber;
908
+ }, z.core.$strip>>>>;
310
909
  }, z.core.$strip>>;
311
910
  }, z.core.$strip>>;
312
911
  }, z.core.$strip>;
313
912
  export type SyncCombinedRequest = z.infer<typeof SyncCombinedRequestSchema>;
314
913
  export declare const SyncCombinedResponseSchema: z.ZodObject<{
315
914
  ok: z.ZodLiteral<true>;
915
+ requiredSchemaVersion: z.ZodOptional<z.ZodNumber>;
916
+ latestSchemaVersion: z.ZodOptional<z.ZodNumber>;
316
917
  push: z.ZodOptional<z.ZodObject<{
317
918
  ok: z.ZodLiteral<true>;
318
- status: z.ZodEnum<{
319
- applied: "applied";
320
- cached: "cached";
321
- rejected: "rejected";
322
- }>;
323
- commitSeq: z.ZodOptional<z.ZodNumber>;
324
- results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
325
- opIndex: z.ZodNumber;
326
- status: z.ZodLiteral<"applied">;
327
- }, z.core.$strip>, z.ZodObject<{
328
- opIndex: z.ZodNumber;
329
- status: z.ZodLiteral<"conflict">;
330
- message: z.ZodString;
331
- server_version: z.ZodNumber;
332
- server_row: z.ZodUnknown;
333
- }, z.core.$strip>, z.ZodObject<{
334
- opIndex: z.ZodNumber;
335
- status: z.ZodLiteral<"error">;
336
- error: z.ZodString;
337
- code: z.ZodOptional<z.ZodString>;
338
- retriable: z.ZodOptional<z.ZodBoolean>;
339
- }, z.core.$strip>]>>;
919
+ commits: z.ZodArray<z.ZodObject<{
920
+ ok: z.ZodLiteral<true>;
921
+ status: z.ZodEnum<{
922
+ applied: "applied";
923
+ cached: "cached";
924
+ rejected: "rejected";
925
+ }>;
926
+ commitSeq: z.ZodOptional<z.ZodNumber>;
927
+ results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
928
+ opIndex: z.ZodNumber;
929
+ status: z.ZodLiteral<"applied">;
930
+ }, z.core.$strip>, z.ZodObject<{
931
+ opIndex: z.ZodNumber;
932
+ status: z.ZodLiteral<"conflict">;
933
+ message: z.ZodString;
934
+ code: z.ZodOptional<z.ZodString>;
935
+ server_version: z.ZodNumber;
936
+ server_row: z.ZodUnknown;
937
+ }, z.core.$strip>, z.ZodObject<{
938
+ opIndex: z.ZodNumber;
939
+ status: z.ZodLiteral<"error">;
940
+ error: z.ZodString;
941
+ code: z.ZodOptional<z.ZodString>;
942
+ retriable: z.ZodOptional<z.ZodBoolean>;
943
+ }, z.core.$strip>]>>;
944
+ clientCommitId: z.ZodString;
945
+ }, z.core.$strip>>;
340
946
  }, z.core.$strip>>;
341
947
  pull: z.ZodOptional<z.ZodObject<{
342
948
  ok: z.ZodLiteral<true>;
@@ -355,6 +961,12 @@ export declare const SyncCombinedResponseSchema: z.ZodObject<{
355
961
  rowCursor: z.ZodNullable<z.ZodString>;
356
962
  }, z.core.$strip>>>;
357
963
  nextCursor: z.ZodNumber;
964
+ integrity: z.ZodOptional<z.ZodObject<{
965
+ partitionId: z.ZodString;
966
+ previousChainRoot: z.ZodString;
967
+ commitChainRoot: z.ZodString;
968
+ commitSeq: z.ZodNumber;
969
+ }, z.core.$strip>>;
358
970
  commits: z.ZodArray<z.ZodObject<{
359
971
  commitSeq: z.ZodNumber;
360
972
  createdAt: z.ZodString;
@@ -378,11 +990,73 @@ export declare const SyncCombinedResponseSchema: z.ZodObject<{
378
990
  id: z.ZodString;
379
991
  byteLength: z.ZodNumber;
380
992
  sha256: z.ZodString;
381
- encoding: z.ZodLiteral<"json-row-frame-v1">;
993
+ encoding: z.ZodEnum<{
994
+ "binary-table-v1": "binary-table-v1";
995
+ }>;
382
996
  compression: z.ZodLiteral<"gzip">;
383
997
  }, z.core.$strip>>>;
998
+ manifest: z.ZodOptional<z.ZodObject<{
999
+ version: z.ZodLiteral<1>;
1000
+ digest: z.ZodString;
1001
+ table: z.ZodString;
1002
+ asOfCommitSeq: z.ZodNumber;
1003
+ scopeDigest: z.ZodString;
1004
+ rowCursor: z.ZodNullable<z.ZodString>;
1005
+ rowLimit: z.ZodNumber;
1006
+ nextRowCursor: z.ZodNullable<z.ZodString>;
1007
+ isFirstPage: z.ZodBoolean;
1008
+ isLastPage: z.ZodBoolean;
1009
+ chunks: z.ZodArray<z.ZodObject<{
1010
+ id: z.ZodString;
1011
+ byteLength: z.ZodNumber;
1012
+ sha256: z.ZodString;
1013
+ encoding: z.ZodEnum<{
1014
+ "binary-table-v1": "binary-table-v1";
1015
+ }>;
1016
+ compression: z.ZodLiteral<"gzip">;
1017
+ }, z.core.$strip>>;
1018
+ }, z.core.$strip>>;
1019
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1020
+ id: z.ZodString;
1021
+ byteLength: z.ZodNumber;
1022
+ sha256: z.ZodString;
1023
+ manifestDigest: z.ZodString;
1024
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
1025
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
1026
+ rowCount: z.ZodNumber;
1027
+ nextRowCursor: z.ZodNullable<z.ZodString>;
1028
+ isFirstPage: z.ZodBoolean;
1029
+ isLastPage: z.ZodBoolean;
1030
+ manifest: z.ZodObject<{
1031
+ version: z.ZodLiteral<1>;
1032
+ artifactKind: z.ZodLiteral<"sqlite-snapshot-v1">;
1033
+ digest: z.ZodString;
1034
+ partitionId: z.ZodString;
1035
+ subscriptionId: z.ZodString;
1036
+ table: z.ZodString;
1037
+ schemaVersion: z.ZodString;
1038
+ asOfCommitSeq: z.ZodNumber;
1039
+ scopeDigest: z.ZodString;
1040
+ rowCursor: z.ZodNullable<z.ZodString>;
1041
+ rowLimit: z.ZodNumber;
1042
+ rowCount: z.ZodNumber;
1043
+ nextRowCursor: z.ZodNullable<z.ZodString>;
1044
+ isFirstPage: z.ZodBoolean;
1045
+ isLastPage: z.ZodBoolean;
1046
+ compression: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"gzip">]>;
1047
+ byteLength: z.ZodNumber;
1048
+ sha256: z.ZodString;
1049
+ featureSet: z.ZodArray<z.ZodString>;
1050
+ }, z.core.$strip>;
1051
+ }, z.core.$strip>>>;
384
1052
  isFirstPage: z.ZodBoolean;
385
1053
  isLastPage: z.ZodBoolean;
1054
+ bootstrapStateAfter: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1055
+ asOfCommitSeq: z.ZodNumber;
1056
+ tables: z.ZodArray<z.ZodString>;
1057
+ tableIndex: z.ZodNumber;
1058
+ rowCursor: z.ZodNullable<z.ZodString>;
1059
+ }, z.core.$strip>>>;
386
1060
  }, z.core.$strip>>>;
387
1061
  }, z.core.$strip>>;
388
1062
  }, z.core.$strip>>;