@gonvex/protocol 0.1.26 → 0.1.28

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 (2) hide show
  1. package/dist/index.d.ts +94 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -40,7 +40,12 @@ export type FunctionDependencies = {
40
40
  table: string;
41
41
  columns?: string[];
42
42
  }>;
43
+ readsEphemeral?: boolean;
44
+ writesEphemeral?: boolean;
43
45
  shareByPermissions?: boolean;
46
+ shareByVisibility?: string;
47
+ shareResultFrom?: string;
48
+ shareResultField?: string;
44
49
  };
45
50
  export type SubscriptionRevision = {
46
51
  epoch: string;
@@ -57,6 +62,8 @@ export type MessageTrace = {
57
62
  serverSubscriptionStartedAtMs?: number;
58
63
  serverSubscriptionSentAtMs?: number;
59
64
  serverDurationMs?: number;
65
+ /** Non-semantic top-level query performance metadata from result.perf. */
66
+ queryPerf?: JsonValue;
60
67
  };
61
68
  export type BrowserTelemetryInfo = {
62
69
  userAgent?: string;
@@ -97,8 +104,12 @@ export type ServerCapabilities = {
97
104
  syncIntegrity?: 1;
98
105
  /** Server accepts `query.subscribeMany` batched subscription frames. */
99
106
  queryBatch?: 1;
107
+ /** Server emits several independent query updates in one WebSocket frame. */
108
+ queryResultBatch?: 1;
100
109
  /** Server accepts `mutation.callMany` batched offline-queue flushes. */
101
110
  mutationBatch?: 1;
111
+ /** Server emits connection-level sync revision watermarks. */
112
+ syncWatermark?: 1;
102
113
  };
103
114
  export type QuerySubscribeRequest = {
104
115
  id: string;
@@ -128,6 +139,31 @@ export type SyncReady = {
128
139
  cursor: SyncCursor;
129
140
  mode?: "eager" | "progressive";
130
141
  digest?: string;
142
+ truncated?: boolean;
143
+ };
144
+ export type ClientCapabilities = {
145
+ /** Client accepts coalesced `sync.readyMany` server frames. */
146
+ syncReadyMany?: 1;
147
+ /** Client accepts connection-level `sync.watermark` server frames. */
148
+ syncWatermark?: 1;
149
+ /** Client accepts keyed patches for object results with a `page` row array. */
150
+ queryPagePatch?: 1;
151
+ /** Client atomically applies keyed patches to named arrays in object results. */
152
+ queryObjectPatch?: 1;
153
+ /** Client applies compact front/back order deltas on keyed patches. */
154
+ queryOrderDelta?: 1;
155
+ /** Client accepts one query payload fanned out to multiple subscription IDs. */
156
+ queryFanout?: 1;
157
+ /** Client accepts several independent query updates in one WebSocket frame. */
158
+ queryResultBatch?: 1;
159
+ };
160
+ export type KeyedCollectionPatch = {
161
+ inserted?: JsonValue[];
162
+ updated?: JsonValue[];
163
+ deleted?: string[];
164
+ order?: string[];
165
+ prepend?: string[];
166
+ append?: string[];
131
167
  };
132
168
  export type GonvexManifest = {
133
169
  project: string;
@@ -142,6 +178,7 @@ export type ClientMessage = {
142
178
  project?: string;
143
179
  tenant?: string;
144
180
  device?: BrowserTelemetryInfo;
181
+ capabilities?: ClientCapabilities;
145
182
  } | {
146
183
  type: "query.subscribe";
147
184
  id: string;
@@ -200,6 +237,30 @@ export type ClientMessage = {
200
237
  device?: BrowserTelemetryInfo;
201
238
  };
202
239
  export type ServerMessage = {
240
+ type: "query.batch";
241
+ messages: ServerMessage[];
242
+ } | {
243
+ type: "query.fanout";
244
+ queryType: "query.result" | "query.progress" | "query.patch" | "query.pagePatch" | "query.objectPatch";
245
+ ids: string[];
246
+ path?: string;
247
+ result?: JsonValue;
248
+ reason?: "initial" | "invalidate" | "recover";
249
+ trace?: MessageTrace;
250
+ cacheScope?: string;
251
+ cacheRevision?: string;
252
+ subscriptionRevision?: SubscriptionRevision;
253
+ baseRevision?: SubscriptionRevision;
254
+ throughRevision?: SubscriptionRevision;
255
+ inserted?: JsonValue[];
256
+ updated?: JsonValue[];
257
+ deleted?: string[];
258
+ order?: string[];
259
+ prepend?: string[];
260
+ append?: string[];
261
+ collections?: Record<string, KeyedCollectionPatch>;
262
+ mutationIds?: string[];
263
+ } | {
203
264
  type: "session.ready";
204
265
  project?: string;
205
266
  tenant?: string;
@@ -244,6 +305,36 @@ export type ServerMessage = {
244
305
  updated?: JsonValue[];
245
306
  deleted?: string[];
246
307
  order?: string[];
308
+ prepend?: string[];
309
+ append?: string[];
310
+ cacheScope?: string;
311
+ cacheRevision?: string;
312
+ trace?: MessageTrace;
313
+ } | {
314
+ type: "query.pagePatch";
315
+ id: string;
316
+ path?: string;
317
+ reason?: "initial" | "invalidate" | "recover";
318
+ baseRevision: SubscriptionRevision;
319
+ subscriptionRevision: SubscriptionRevision;
320
+ result?: JsonValue;
321
+ inserted?: JsonValue[];
322
+ updated?: JsonValue[];
323
+ deleted?: string[];
324
+ order?: string[];
325
+ prepend?: string[];
326
+ append?: string[];
327
+ cacheScope?: string;
328
+ cacheRevision?: string;
329
+ trace?: MessageTrace;
330
+ } | {
331
+ type: "query.objectPatch";
332
+ id: string;
333
+ path?: string;
334
+ reason?: "initial" | "invalidate" | "recover";
335
+ baseRevision: SubscriptionRevision;
336
+ subscriptionRevision: SubscriptionRevision;
337
+ collections: Record<string, KeyedCollectionPatch>;
247
338
  cacheScope?: string;
248
339
  cacheRevision?: string;
249
340
  trace?: MessageTrace;
@@ -276,6 +367,9 @@ export type ServerMessage = {
276
367
  } & SyncReady) | {
277
368
  type: "sync.readyMany";
278
369
  ready: SyncReady[];
370
+ } | {
371
+ type: "sync.watermark";
372
+ revision: number;
279
373
  } | {
280
374
  type: "sync.needHashes";
281
375
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonvex/protocol",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"