@rocicorp/zero 1.11.0-canary.37 → 1.11.0-canary.39

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 (76) hide show
  1. package/out/shared/src/valita.d.ts +75 -0
  2. package/out/shared/src/valita.d.ts.map +1 -1
  3. package/out/shared/src/valita.js +119 -1
  4. package/out/shared/src/valita.js.map +1 -1
  5. package/out/zero/package.js +1 -1
  6. package/out/zero/package.js.map +1 -1
  7. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +12 -2
  8. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +1 -1
  9. package/out/zero-cache/src/services/view-syncer/inspect-handler.js +27 -3
  10. package/out/zero-cache/src/services/view-syncer/inspect-handler.js.map +1 -1
  11. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
  12. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  13. package/out/zero-cache/src/workers/connection.d.ts +2 -1
  14. package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
  15. package/out/zero-cache/src/workers/connection.js +9 -1
  16. package/out/zero-cache/src/workers/connection.js.map +1 -1
  17. package/out/zero-client/src/client/storage-version.d.ts +23 -0
  18. package/out/zero-client/src/client/storage-version.d.ts.map +1 -0
  19. package/out/zero-client/src/client/version.js +1 -1
  20. package/out/zero-client/src/client/zero.d.ts.map +1 -1
  21. package/out/zero-client/src/client/zero.js +1 -1
  22. package/out/zero-client/src/client/zero.js.map +1 -1
  23. package/out/zero-protocol/src/analyze-query-result.d.ts +12 -12
  24. package/out/zero-protocol/src/analyze-query-result.d.ts.map +1 -1
  25. package/out/zero-protocol/src/analyze-query-result.js +3 -3
  26. package/out/zero-protocol/src/analyze-query-result.js.map +1 -1
  27. package/out/zero-protocol/src/ast.d.ts +24 -0
  28. package/out/zero-protocol/src/ast.d.ts.map +1 -1
  29. package/out/zero-protocol/src/ast.js +26 -2
  30. package/out/zero-protocol/src/ast.js.map +1 -1
  31. package/out/zero-protocol/src/down.d.ts +5 -5
  32. package/out/zero-protocol/src/inspect-down.d.ts +15 -15
  33. package/out/zero-protocol/src/inspect-up.d.ts +158 -61
  34. package/out/zero-protocol/src/inspect-up.d.ts.map +1 -1
  35. package/out/zero-protocol/src/inspect-up.js +12 -6
  36. package/out/zero-protocol/src/inspect-up.js.map +1 -1
  37. package/out/zero-protocol/src/protocol-version.d.ts +4 -1
  38. package/out/zero-protocol/src/protocol-version.d.ts.map +1 -1
  39. package/out/zero-protocol/src/protocol-version.js.map +1 -1
  40. package/out/zero-protocol/src/queries-patch.js +2 -2
  41. package/out/zero-protocol/src/queries-patch.js.map +1 -1
  42. package/out/zero-protocol/src/up.d.ts +766 -256
  43. package/out/zero-protocol/src/up.d.ts.map +1 -1
  44. package/out/zero-protocol/src/up.js +25 -3
  45. package/out/zero-protocol/src/up.js.map +1 -1
  46. package/out/zero-server/src/adapters/drizzle.d.ts +14 -3
  47. package/out/zero-server/src/adapters/drizzle.d.ts.map +1 -1
  48. package/out/zero-server/src/adapters/drizzle.js +7 -4
  49. package/out/zero-server/src/adapters/drizzle.js.map +1 -1
  50. package/out/zero-server/src/adapters/kysely.d.ts +4 -2
  51. package/out/zero-server/src/adapters/kysely.d.ts.map +1 -1
  52. package/out/zero-server/src/adapters/kysely.js +8 -4
  53. package/out/zero-server/src/adapters/kysely.js.map +1 -1
  54. package/out/zero-server/src/adapters/pg.d.ts +3 -2
  55. package/out/zero-server/src/adapters/pg.d.ts.map +1 -1
  56. package/out/zero-server/src/adapters/pg.js +7 -4
  57. package/out/zero-server/src/adapters/pg.js.map +1 -1
  58. package/out/zero-server/src/adapters/postgresjs.d.ts +3 -2
  59. package/out/zero-server/src/adapters/postgresjs.d.ts.map +1 -1
  60. package/out/zero-server/src/adapters/postgresjs.js +8 -4
  61. package/out/zero-server/src/adapters/postgresjs.js.map +1 -1
  62. package/out/zero-server/src/adapters/prisma.d.ts +14 -3
  63. package/out/zero-server/src/adapters/prisma.d.ts.map +1 -1
  64. package/out/zero-server/src/adapters/prisma.js +12 -4
  65. package/out/zero-server/src/adapters/prisma.js.map +1 -1
  66. package/out/zero-server/src/mod.d.ts +1 -0
  67. package/out/zero-server/src/mod.d.ts.map +1 -1
  68. package/out/zero-server/src/transaction-options.d.ts +24 -0
  69. package/out/zero-server/src/transaction-options.d.ts.map +1 -0
  70. package/out/zero-server/src/transaction-options.js +11 -0
  71. package/out/zero-server/src/transaction-options.js.map +1 -0
  72. package/out/zql/src/query/query-registry.js +1 -1
  73. package/out/zqlite/src/sqlite-cost-model.d.ts.map +1 -1
  74. package/out/zqlite/src/sqlite-cost-model.js +1 -0
  75. package/out/zqlite/src/sqlite-cost-model.js.map +1 -1
  76. package/package.json +1 -1
@@ -117,12 +117,12 @@ export declare const inspectAnalyzeQueryDownSchema: v.ObjectType<Omit<{
117
117
  flipPattern: number;
118
118
  joinStates: {
119
119
  join: string;
120
- type: "flipped" | "semi" | "unflippable";
120
+ type: "flipped" | "semi" | "unflippable" | v.Unrecognized<string>;
121
121
  }[];
122
122
  } | {
123
123
  type: "node-constraint";
124
124
  attemptNumber?: number | undefined;
125
- nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus";
125
+ nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus" | v.Unrecognized<string>;
126
126
  node: string;
127
127
  branchPattern: number[];
128
128
  constraint?: Record<string, unknown> | null | undefined;
@@ -174,12 +174,12 @@ export declare const inspectAnalyzeQueryDownSchema: v.ObjectType<Omit<{
174
174
  flipPattern: number;
175
175
  joinStates: {
176
176
  join: string;
177
- type: "flipped" | "semi" | "unflippable";
177
+ type: "flipped" | "semi" | "unflippable" | v.Unrecognized<string>;
178
178
  }[];
179
179
  } | {
180
180
  type: "node-cost";
181
181
  attemptNumber?: number | undefined;
182
- nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus";
182
+ nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus" | v.Unrecognized<string>;
183
183
  node: string;
184
184
  branchPattern: number[];
185
185
  downstreamChildSelectivity: number;
@@ -193,7 +193,7 @@ export declare const inspectAnalyzeQueryDownSchema: v.ObjectType<Omit<{
193
193
  };
194
194
  filters?: import("./ast.ts").Condition | undefined;
195
195
  ordering?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
196
- joinType?: "flipped" | "semi" | "unflippable" | undefined;
196
+ joinType?: "flipped" | "semi" | "unflippable" | v.Unrecognized<string> | undefined;
197
197
  })[]>;
198
198
  }, undefined>;
199
199
  }, undefined>;
@@ -283,12 +283,12 @@ export declare const inspectDownBodySchema: v.UnionType<[v.ObjectType<Omit<{
283
283
  flipPattern: number;
284
284
  joinStates: {
285
285
  join: string;
286
- type: "flipped" | "semi" | "unflippable";
286
+ type: "flipped" | "semi" | "unflippable" | v.Unrecognized<string>;
287
287
  }[];
288
288
  } | {
289
289
  type: "node-constraint";
290
290
  attemptNumber?: number | undefined;
291
- nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus";
291
+ nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus" | v.Unrecognized<string>;
292
292
  node: string;
293
293
  branchPattern: number[];
294
294
  constraint?: Record<string, unknown> | null | undefined;
@@ -340,12 +340,12 @@ export declare const inspectDownBodySchema: v.UnionType<[v.ObjectType<Omit<{
340
340
  flipPattern: number;
341
341
  joinStates: {
342
342
  join: string;
343
- type: "flipped" | "semi" | "unflippable";
343
+ type: "flipped" | "semi" | "unflippable" | v.Unrecognized<string>;
344
344
  }[];
345
345
  } | {
346
346
  type: "node-cost";
347
347
  attemptNumber?: number | undefined;
348
- nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus";
348
+ nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus" | v.Unrecognized<string>;
349
349
  node: string;
350
350
  branchPattern: number[];
351
351
  downstreamChildSelectivity: number;
@@ -359,7 +359,7 @@ export declare const inspectDownBodySchema: v.UnionType<[v.ObjectType<Omit<{
359
359
  };
360
360
  filters?: import("./ast.ts").Condition | undefined;
361
361
  ordering?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
362
- joinType?: "flipped" | "semi" | "unflippable" | undefined;
362
+ joinType?: "flipped" | "semi" | "unflippable" | v.Unrecognized<string> | undefined;
363
363
  })[]>;
364
364
  }, undefined>;
365
365
  }, undefined>, v.ObjectType<Omit<{
@@ -446,12 +446,12 @@ export declare const inspectDownMessageSchema: v.TupleType<[v.Type<"inspect">, v
446
446
  flipPattern: number;
447
447
  joinStates: {
448
448
  join: string;
449
- type: "flipped" | "semi" | "unflippable";
449
+ type: "flipped" | "semi" | "unflippable" | v.Unrecognized<string>;
450
450
  }[];
451
451
  } | {
452
452
  type: "node-constraint";
453
453
  attemptNumber?: number | undefined;
454
- nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus";
454
+ nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus" | v.Unrecognized<string>;
455
455
  node: string;
456
456
  branchPattern: number[];
457
457
  constraint?: Record<string, unknown> | null | undefined;
@@ -503,12 +503,12 @@ export declare const inspectDownMessageSchema: v.TupleType<[v.Type<"inspect">, v
503
503
  flipPattern: number;
504
504
  joinStates: {
505
505
  join: string;
506
- type: "flipped" | "semi" | "unflippable";
506
+ type: "flipped" | "semi" | "unflippable" | v.Unrecognized<string>;
507
507
  }[];
508
508
  } | {
509
509
  type: "node-cost";
510
510
  attemptNumber?: number | undefined;
511
- nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus";
511
+ nodeType: "connection" | "fan-in" | "fan-out" | "filter" | "join" | "terminus" | v.Unrecognized<string>;
512
512
  node: string;
513
513
  branchPattern: number[];
514
514
  downstreamChildSelectivity: number;
@@ -522,7 +522,7 @@ export declare const inspectDownMessageSchema: v.TupleType<[v.Type<"inspect">, v
522
522
  };
523
523
  filters?: import("./ast.ts").Condition | undefined;
524
524
  ordering?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
525
- joinType?: "flipped" | "semi" | "unflippable" | undefined;
525
+ joinType?: "flipped" | "semi" | "unflippable" | v.Unrecognized<string> | undefined;
526
526
  })[]>;
527
527
  }, undefined>;
528
528
  }, undefined>, v.ObjectType<Omit<{
@@ -113,75 +113,172 @@ export declare const inspectUpMessageSchema: v.TupleType<[v.Type<"inspect">, v.U
113
113
  name: v.Optional<string>;
114
114
  args: v.Optional<readonly import("../../shared/src/json.ts").ReadonlyJSONValue[]>;
115
115
  }, undefined>]>]>;
116
- declare const unparsedInspectUpBodySchema: v.UnionType<[v.ObjectType<Omit<{
117
- id: v.Type<string>;
118
- }, "clientID" | "op"> & {
119
- op: v.Type<"queries">;
120
- clientID: v.Optional<string>;
121
- }, undefined>, v.ObjectType<Omit<{
122
- id: v.Type<string>;
123
- }, "op"> & {
124
- op: v.Type<"metrics">;
125
- }, undefined>, v.ObjectType<Omit<{
126
- id: v.Type<string>;
127
- }, "op"> & {
128
- op: v.Type<"version">;
129
- }, undefined>, v.ObjectType<Omit<{
130
- id: v.Type<string>;
131
- }, "op" | "value"> & {
132
- op: v.Type<"authenticate">;
133
- value: v.Type<string>;
134
- }, undefined>, v.ObjectType<Omit<{
135
- id: v.Type<string>;
136
- }, "args" | "ast" | "name" | "op" | "options" | "value"> & {
137
- op: v.Type<"analyze-query">;
138
- /** @deprecated Use {@linkcode ast} instead */
139
- value: v.Optional<unknown>;
140
- options: v.Optional<{
116
+ export declare const unparsedInspectUpBodySchema: v.Type<{
117
+ id: string;
118
+ op: "queries";
119
+ clientID?: string | undefined;
120
+ } | {
121
+ id: string;
122
+ op: "metrics";
123
+ } | {
124
+ id: string;
125
+ op: "version";
126
+ } | {
127
+ id: string;
128
+ op: "authenticate";
129
+ value: string;
130
+ } | {
131
+ id: string;
132
+ op: "analyze-query";
133
+ value?: unknown;
134
+ options?: {
141
135
  vendedRows?: boolean | undefined;
142
136
  syncedRows?: boolean | undefined;
143
137
  joinPlans?: boolean | undefined;
144
- }>;
145
- ast: v.Optional<unknown>;
146
- name: v.Optional<string>;
147
- args: v.Optional<readonly import("../../shared/src/json.ts").ReadonlyJSONValue[]>;
148
- }, undefined>]>;
149
- export declare const unparsedInspectUpMessageSchema: v.TupleType<[v.Type<"inspect">, v.UnionType<[v.ObjectType<Omit<{
150
- id: v.Type<string>;
151
- }, "clientID" | "op"> & {
152
- op: v.Type<"queries">;
153
- clientID: v.Optional<string>;
154
- }, undefined>, v.ObjectType<Omit<{
155
- id: v.Type<string>;
156
- }, "op"> & {
157
- op: v.Type<"metrics">;
158
- }, undefined>, v.ObjectType<Omit<{
159
- id: v.Type<string>;
160
- }, "op"> & {
161
- op: v.Type<"version">;
162
- }, undefined>, v.ObjectType<Omit<{
163
- id: v.Type<string>;
164
- }, "op" | "value"> & {
165
- op: v.Type<"authenticate">;
166
- value: v.Type<string>;
167
- }, undefined>, v.ObjectType<Omit<{
168
- id: v.Type<string>;
169
- }, "args" | "ast" | "name" | "op" | "options" | "value"> & {
170
- op: v.Type<"analyze-query">;
171
- /** @deprecated Use {@linkcode ast} instead */
172
- value: v.Optional<unknown>;
173
- options: v.Optional<{
138
+ } | undefined;
139
+ ast?: unknown;
140
+ name?: string | undefined;
141
+ args?: readonly import("../../shared/src/json.ts").ReadonlyJSONValue[] | undefined;
142
+ } | v.UnrecognizedObject<"op">> & {
143
+ isKnown(value: {
144
+ id: string;
145
+ op: "queries";
146
+ clientID?: string | undefined;
147
+ } | {
148
+ id: string;
149
+ op: "metrics";
150
+ } | {
151
+ id: string;
152
+ op: "version";
153
+ } | {
154
+ id: string;
155
+ op: "authenticate";
156
+ value: string;
157
+ } | {
158
+ id: string;
159
+ op: "analyze-query";
160
+ value?: unknown;
161
+ options?: {
162
+ vendedRows?: boolean | undefined;
163
+ syncedRows?: boolean | undefined;
164
+ joinPlans?: boolean | undefined;
165
+ } | undefined;
166
+ ast?: unknown;
167
+ name?: string | undefined;
168
+ args?: readonly import("../../shared/src/json.ts").ReadonlyJSONValue[] | undefined;
169
+ } | v.UnrecognizedObject<"op">): value is {
170
+ id: string;
171
+ op: "queries";
172
+ clientID?: string | undefined;
173
+ } | {
174
+ id: string;
175
+ op: "metrics";
176
+ } | {
177
+ id: string;
178
+ op: "version";
179
+ } | {
180
+ id: string;
181
+ op: "authenticate";
182
+ value: string;
183
+ } | {
184
+ id: string;
185
+ op: "analyze-query";
186
+ value?: unknown;
187
+ options?: {
188
+ vendedRows?: boolean | undefined;
189
+ syncedRows?: boolean | undefined;
190
+ joinPlans?: boolean | undefined;
191
+ } | undefined;
192
+ ast?: unknown;
193
+ name?: string | undefined;
194
+ args?: readonly import("../../shared/src/json.ts").ReadonlyJSONValue[] | undefined;
195
+ };
196
+ };
197
+ export declare const unparsedInspectUpMessageSchema: v.TupleType<[v.Type<"inspect">, v.Type<{
198
+ id: string;
199
+ op: "queries";
200
+ clientID?: string | undefined;
201
+ } | {
202
+ id: string;
203
+ op: "metrics";
204
+ } | {
205
+ id: string;
206
+ op: "version";
207
+ } | {
208
+ id: string;
209
+ op: "authenticate";
210
+ value: string;
211
+ } | {
212
+ id: string;
213
+ op: "analyze-query";
214
+ value?: unknown;
215
+ options?: {
174
216
  vendedRows?: boolean | undefined;
175
217
  syncedRows?: boolean | undefined;
176
218
  joinPlans?: boolean | undefined;
177
- }>;
178
- ast: v.Optional<unknown>;
179
- name: v.Optional<string>;
180
- args: v.Optional<readonly import("../../shared/src/json.ts").ReadonlyJSONValue[]>;
181
- }, undefined>]>]>;
219
+ } | undefined;
220
+ ast?: unknown;
221
+ name?: string | undefined;
222
+ args?: readonly import("../../shared/src/json.ts").ReadonlyJSONValue[] | undefined;
223
+ } | v.UnrecognizedObject<"op">> & {
224
+ isKnown(value: {
225
+ id: string;
226
+ op: "queries";
227
+ clientID?: string | undefined;
228
+ } | {
229
+ id: string;
230
+ op: "metrics";
231
+ } | {
232
+ id: string;
233
+ op: "version";
234
+ } | {
235
+ id: string;
236
+ op: "authenticate";
237
+ value: string;
238
+ } | {
239
+ id: string;
240
+ op: "analyze-query";
241
+ value?: unknown;
242
+ options?: {
243
+ vendedRows?: boolean | undefined;
244
+ syncedRows?: boolean | undefined;
245
+ joinPlans?: boolean | undefined;
246
+ } | undefined;
247
+ ast?: unknown;
248
+ name?: string | undefined;
249
+ args?: readonly import("../../shared/src/json.ts").ReadonlyJSONValue[] | undefined;
250
+ } | v.UnrecognizedObject<"op">): value is {
251
+ id: string;
252
+ op: "queries";
253
+ clientID?: string | undefined;
254
+ } | {
255
+ id: string;
256
+ op: "metrics";
257
+ } | {
258
+ id: string;
259
+ op: "version";
260
+ } | {
261
+ id: string;
262
+ op: "authenticate";
263
+ value: string;
264
+ } | {
265
+ id: string;
266
+ op: "analyze-query";
267
+ value?: unknown;
268
+ options?: {
269
+ vendedRows?: boolean | undefined;
270
+ syncedRows?: boolean | undefined;
271
+ joinPlans?: boolean | undefined;
272
+ } | undefined;
273
+ ast?: unknown;
274
+ name?: string | undefined;
275
+ args?: readonly import("../../shared/src/json.ts").ReadonlyJSONValue[] | undefined;
276
+ };
277
+ }]>;
182
278
  export type InspectUpMessage = v.Infer<typeof inspectUpMessageSchema>;
183
279
  export type InspectUpBody = v.Infer<typeof inspectUpBodySchema>;
184
280
  export type UnparsedInspectUpMessage = v.Infer<typeof unparsedInspectUpMessageSchema>;
185
- export type UnparsedInspectUpBody = v.Infer<typeof unparsedInspectUpBodySchema>;
281
+ /** An inspect request with an op this build knows. */
282
+ export type UnparsedInspectUpBody = Exclude<v.Infer<typeof unparsedInspectUpBodySchema>, v.UnrecognizedObject<'op'>>;
186
283
  export {};
187
284
  //# sourceMappingURL=inspect-up.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspect-up.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/inspect-up.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAOhD,QAAA,MAAM,0BAA0B;;;;;aAG9B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,QAAA,MAAM,sBAAsB;;;;aAE1B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E,QAAA,MAAM,sBAAsB;;;;aAE1B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E,eAAO,MAAM,2BAA2B;;;;;aAGtC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,2BAA2B,CACnC,CAAC;AAEF,QAAA,MAAM,yBAAyB;;;;aAI7B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;IAEtC,8CAA8C;;;;;;;;;;aAM9C,CAAC;AAYH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,2BAA2B,CACnC,CAAC;AAEF,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;IAtBvB,8CAA8C;;;;;;;;;;eA4B/C,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;IA9BjC,8CAA8C;;;;;;;;;;iBAiC9C,CAAC;AAEH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;IAzB/B,8CAA8C;;;;;;;;;;eA+B/C,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;IAjCzC,8CAA8C;;;;;;;;;;iBAoC9C,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
1
+ {"version":3,"file":"inspect-up.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/inspect-up.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAOhD,QAAA,MAAM,0BAA0B;;;;;aAG9B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,QAAA,MAAM,sBAAsB;;;;aAE1B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E,QAAA,MAAM,sBAAsB;;;;aAE1B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E,eAAO,MAAM,2BAA2B;;;;;aAGtC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,2BAA2B,CACnC,CAAC;AAEF,QAAA,MAAM,yBAAyB;;;;aAI7B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;IAEtC,8CAA8C;;;;;;;;;;aAM9C,CAAC;AAYH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,2BAA2B,CACnC,CAAC;AAEF,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;IAtBvB,8CAA8C;;;;;;;;;;eA4B/C,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;IA9BjC,8CAA8C;;;;;;;;;;iBAiC9C,CAAC;AAIH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUvC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGzC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,EAC3C,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAC3B,CAAC"}
@@ -1,6 +1,6 @@
1
- import { readonlyArray, valita_exports } from "../../shared/src/valita.js";
1
+ import { readonlyArray, taggedObjectUnion, valita_exports } from "../../shared/src/valita.js";
2
2
  import { jsonSchema } from "../../shared/src/json-schema.js";
3
- import { astSchema } from "./ast.js";
3
+ import { strictASTSchema } from "./ast.js";
4
4
  //#region ../zero-protocol/src/inspect-up.ts
5
5
  var inspectUpBase = valita_exports.object({ id: valita_exports.string() });
6
6
  var inspectQueriesUpBodySchema = inspectUpBase.extend({
@@ -21,9 +21,9 @@ var analyzeQueryOptionsSchema = valita_exports.object({
21
21
  var inspectAnalyzeQueryUpSchema = inspectUpBase.extend({
22
22
  op: valita_exports.literal("analyze-query"),
23
23
  /** @deprecated Use {@linkcode ast} instead */
24
- value: astSchema.optional(),
24
+ value: strictASTSchema.optional(),
25
25
  options: analyzeQueryOptionsSchema.optional(),
26
- ast: astSchema.optional(),
26
+ ast: strictASTSchema.optional(),
27
27
  name: valita_exports.string().optional(),
28
28
  args: readonlyArray(jsonSchema).optional()
29
29
  });
@@ -38,9 +38,15 @@ var unparsedInspectAnalyzeQueryUpSchema = inspectUpBase.extend({
38
38
  });
39
39
  var inspectUpBodySchema = valita_exports.union(inspectQueriesUpBodySchema, inspectMetricsUpSchema, inspectVersionUpSchema, inspectAuthenticateUpSchema, inspectAnalyzeQueryUpSchema);
40
40
  var inspectUpMessageSchema = valita_exports.tuple([valita_exports.literal("inspect"), inspectUpBodySchema]);
41
- var unparsedInspectUpBodySchema = valita_exports.union(inspectQueriesUpBodySchema, inspectMetricsUpSchema, inspectVersionUpSchema, inspectAuthenticateUpSchema, unparsedInspectAnalyzeQueryUpSchema);
41
+ var unparsedInspectUpBodySchema = taggedObjectUnion("op", [
42
+ inspectQueriesUpBodySchema,
43
+ inspectMetricsUpSchema,
44
+ inspectVersionUpSchema,
45
+ inspectAuthenticateUpSchema,
46
+ unparsedInspectAnalyzeQueryUpSchema
47
+ ], { open: true });
42
48
  var unparsedInspectUpMessageSchema = valita_exports.tuple([valita_exports.literal("inspect"), unparsedInspectUpBodySchema]);
43
49
  //#endregion
44
- export { inspectAnalyzeQueryUpSchema, inspectUpMessageSchema, unparsedInspectUpMessageSchema };
50
+ export { inspectAnalyzeQueryUpSchema, inspectUpMessageSchema, unparsedInspectUpBodySchema, unparsedInspectUpMessageSchema };
45
51
 
46
52
  //# sourceMappingURL=inspect-up.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspect-up.js","names":[],"sources":["../../../../zero-protocol/src/inspect-up.ts"],"sourcesContent":["import {jsonSchema} from '../../shared/src/json-schema.ts';\nimport * as v from '../../shared/src/valita.ts';\nimport {astSchema} from './ast.ts';\n\nconst inspectUpBase = v.object({\n id: v.string(),\n});\n\nconst inspectQueriesUpBodySchema = inspectUpBase.extend({\n op: v.literal('queries'),\n clientID: v.string().optional(),\n});\n\nexport type InspectQueriesUpBody = v.Infer<typeof inspectQueriesUpBodySchema>;\n\nconst inspectMetricsUpSchema = inspectUpBase.extend({\n op: v.literal('metrics'),\n});\n\nexport type InspectMetricsUpBody = v.Infer<typeof inspectMetricsUpSchema>;\n\nconst inspectVersionUpSchema = inspectUpBase.extend({\n op: v.literal('version'),\n});\n\nexport type InspectVersionUpBody = v.Infer<typeof inspectVersionUpSchema>;\n\nexport const inspectAuthenticateUpSchema = inspectUpBase.extend({\n op: v.literal('authenticate'),\n value: v.string(),\n});\n\nexport type InspectAuthenticateUpBody = v.Infer<\n typeof inspectAuthenticateUpSchema\n>;\n\nconst analyzeQueryOptionsSchema = v.object({\n vendedRows: v.boolean().optional(),\n syncedRows: v.boolean().optional(),\n joinPlans: v.boolean().optional(),\n});\n\nexport type AnalyzeQueryOptions = v.Infer<typeof analyzeQueryOptionsSchema>;\n\nexport const inspectAnalyzeQueryUpSchema = inspectUpBase.extend({\n op: v.literal('analyze-query'),\n /** @deprecated Use {@linkcode ast} instead */\n value: astSchema.optional(),\n options: analyzeQueryOptionsSchema.optional(),\n ast: astSchema.optional(),\n name: v.string().optional(),\n args: v.readonlyArray(jsonSchema).optional(),\n});\n\nconst unparsedInspectAnalyzeQueryUpSchema = inspectUpBase.extend({\n op: v.literal('analyze-query'),\n /** @deprecated Use {@linkcode ast} instead */\n value: v.unknown().optional(),\n options: analyzeQueryOptionsSchema.optional(),\n ast: v.unknown().optional(),\n name: v.string().optional(),\n args: v.readonlyArray(jsonSchema).optional(),\n});\n\nexport type InspectAnalyzeQueryUpBody = v.Infer<\n typeof inspectAnalyzeQueryUpSchema\n>;\n\nconst inspectUpBodySchema = v.union(\n inspectQueriesUpBodySchema,\n inspectMetricsUpSchema,\n inspectVersionUpSchema,\n inspectAuthenticateUpSchema,\n inspectAnalyzeQueryUpSchema,\n);\n\nexport const inspectUpMessageSchema = v.tuple([\n v.literal('inspect'),\n inspectUpBodySchema,\n]);\n\nconst unparsedInspectUpBodySchema = v.union(\n inspectQueriesUpBodySchema,\n inspectMetricsUpSchema,\n inspectVersionUpSchema,\n inspectAuthenticateUpSchema,\n unparsedInspectAnalyzeQueryUpSchema,\n);\n\nexport const unparsedInspectUpMessageSchema = v.tuple([\n v.literal('inspect'),\n unparsedInspectUpBodySchema,\n]);\n\nexport type InspectUpMessage = v.Infer<typeof inspectUpMessageSchema>;\n\nexport type InspectUpBody = v.Infer<typeof inspectUpBodySchema>;\n\nexport type UnparsedInspectUpMessage = v.Infer<\n typeof unparsedInspectUpMessageSchema\n>;\n\nexport type UnparsedInspectUpBody = v.Infer<typeof unparsedInspectUpBodySchema>;\n"],"mappings":";;;;AAIA,IAAM,gBAAgB,eAAE,OAAO,EAC7B,IAAI,eAAE,OAAO,EACf,CAAC;AAED,IAAM,6BAA6B,cAAc,OAAO;CACtD,IAAI,eAAE,QAAQ,SAAS;CACvB,UAAU,eAAE,OAAO,EAAE,SAAS;AAChC,CAAC;AAID,IAAM,yBAAyB,cAAc,OAAO,EAClD,IAAI,eAAE,QAAQ,SAAS,EACzB,CAAC;AAID,IAAM,yBAAyB,cAAc,OAAO,EAClD,IAAI,eAAE,QAAQ,SAAS,EACzB,CAAC;AAID,IAAa,8BAA8B,cAAc,OAAO;CAC9D,IAAI,eAAE,QAAQ,cAAc;CAC5B,OAAO,eAAE,OAAO;AAClB,CAAC;AAMD,IAAM,4BAA4B,eAAE,OAAO;CACzC,YAAY,eAAE,QAAQ,EAAE,SAAS;CACjC,YAAY,eAAE,QAAQ,EAAE,SAAS;CACjC,WAAW,eAAE,QAAQ,EAAE,SAAS;AAClC,CAAC;AAID,IAAa,8BAA8B,cAAc,OAAO;CAC9D,IAAI,eAAE,QAAQ,eAAe;;CAE7B,OAAO,UAAU,SAAS;CAC1B,SAAS,0BAA0B,SAAS;CAC5C,KAAK,UAAU,SAAS;CACxB,MAAM,eAAE,OAAO,EAAE,SAAS;CAC1B,MAAM,cAAgB,UAAU,EAAE,SAAS;AAC7C,CAAC;AAED,IAAM,sCAAsC,cAAc,OAAO;CAC/D,IAAI,eAAE,QAAQ,eAAe;;CAE7B,OAAO,eAAE,QAAQ,EAAE,SAAS;CAC5B,SAAS,0BAA0B,SAAS;CAC5C,KAAK,eAAE,QAAQ,EAAE,SAAS;CAC1B,MAAM,eAAE,OAAO,EAAE,SAAS;CAC1B,MAAM,cAAgB,UAAU,EAAE,SAAS;AAC7C,CAAC;AAMD,IAAM,sBAAsB,eAAE,MAC5B,4BACA,wBACA,wBACA,6BACA,2BACF;AAEA,IAAa,yBAAyB,eAAE,MAAM,CAC5C,eAAE,QAAQ,SAAS,GACnB,mBACF,CAAC;AAED,IAAM,8BAA8B,eAAE,MACpC,4BACA,wBACA,wBACA,6BACA,mCACF;AAEA,IAAa,iCAAiC,eAAE,MAAM,CACpD,eAAE,QAAQ,SAAS,GACnB,2BACF,CAAC"}
1
+ {"version":3,"file":"inspect-up.js","names":[],"sources":["../../../../zero-protocol/src/inspect-up.ts"],"sourcesContent":["import {jsonSchema} from '../../shared/src/json-schema.ts';\nimport * as v from '../../shared/src/valita.ts';\nimport {strictASTSchema} from './ast.ts';\n\nconst inspectUpBase = v.object({\n id: v.string(),\n});\n\nconst inspectQueriesUpBodySchema = inspectUpBase.extend({\n op: v.literal('queries'),\n clientID: v.string().optional(),\n});\n\nexport type InspectQueriesUpBody = v.Infer<typeof inspectQueriesUpBodySchema>;\n\nconst inspectMetricsUpSchema = inspectUpBase.extend({\n op: v.literal('metrics'),\n});\n\nexport type InspectMetricsUpBody = v.Infer<typeof inspectMetricsUpSchema>;\n\nconst inspectVersionUpSchema = inspectUpBase.extend({\n op: v.literal('version'),\n});\n\nexport type InspectVersionUpBody = v.Infer<typeof inspectVersionUpSchema>;\n\nexport const inspectAuthenticateUpSchema = inspectUpBase.extend({\n op: v.literal('authenticate'),\n value: v.string(),\n});\n\nexport type InspectAuthenticateUpBody = v.Infer<\n typeof inspectAuthenticateUpSchema\n>;\n\nconst analyzeQueryOptionsSchema = v.object({\n vendedRows: v.boolean().optional(),\n syncedRows: v.boolean().optional(),\n joinPlans: v.boolean().optional(),\n});\n\nexport type AnalyzeQueryOptions = v.Infer<typeof analyzeQueryOptionsSchema>;\n\nexport const inspectAnalyzeQueryUpSchema = inspectUpBase.extend({\n op: v.literal('analyze-query'),\n /** @deprecated Use {@linkcode ast} instead */\n value: strictASTSchema.optional(),\n options: analyzeQueryOptionsSchema.optional(),\n ast: strictASTSchema.optional(),\n name: v.string().optional(),\n args: v.readonlyArray(jsonSchema).optional(),\n});\n\nconst unparsedInspectAnalyzeQueryUpSchema = inspectUpBase.extend({\n op: v.literal('analyze-query'),\n /** @deprecated Use {@linkcode ast} instead */\n value: v.unknown().optional(),\n options: analyzeQueryOptionsSchema.optional(),\n ast: v.unknown().optional(),\n name: v.string().optional(),\n args: v.readonlyArray(jsonSchema).optional(),\n});\n\nexport type InspectAnalyzeQueryUpBody = v.Infer<\n typeof inspectAnalyzeQueryUpSchema\n>;\n\nconst inspectUpBodySchema = v.union(\n inspectQueriesUpBodySchema,\n inspectMetricsUpSchema,\n inspectVersionUpSchema,\n inspectAuthenticateUpSchema,\n inspectAnalyzeQueryUpSchema,\n);\n\nexport const inspectUpMessageSchema = v.tuple([\n v.literal('inspect'),\n inspectUpBodySchema,\n]);\n\n// zero-cache answers an op from a newer client with an error for that request\n// instead of closing the connection.\nexport const unparsedInspectUpBodySchema = v.taggedObjectUnion(\n 'op',\n [\n inspectQueriesUpBodySchema,\n inspectMetricsUpSchema,\n inspectVersionUpSchema,\n inspectAuthenticateUpSchema,\n unparsedInspectAnalyzeQueryUpSchema,\n ],\n {open: true},\n);\n\nexport const unparsedInspectUpMessageSchema = v.tuple([\n v.literal('inspect'),\n unparsedInspectUpBodySchema,\n]);\n\nexport type InspectUpMessage = v.Infer<typeof inspectUpMessageSchema>;\n\nexport type InspectUpBody = v.Infer<typeof inspectUpBodySchema>;\n\nexport type UnparsedInspectUpMessage = v.Infer<\n typeof unparsedInspectUpMessageSchema\n>;\n\n/** An inspect request with an op this build knows. */\nexport type UnparsedInspectUpBody = Exclude<\n v.Infer<typeof unparsedInspectUpBodySchema>,\n v.UnrecognizedObject<'op'>\n>;\n"],"mappings":";;;;AAIA,IAAM,gBAAgB,eAAE,OAAO,EAC7B,IAAI,eAAE,OAAO,EACf,CAAC;AAED,IAAM,6BAA6B,cAAc,OAAO;CACtD,IAAI,eAAE,QAAQ,SAAS;CACvB,UAAU,eAAE,OAAO,EAAE,SAAS;AAChC,CAAC;AAID,IAAM,yBAAyB,cAAc,OAAO,EAClD,IAAI,eAAE,QAAQ,SAAS,EACzB,CAAC;AAID,IAAM,yBAAyB,cAAc,OAAO,EAClD,IAAI,eAAE,QAAQ,SAAS,EACzB,CAAC;AAID,IAAa,8BAA8B,cAAc,OAAO;CAC9D,IAAI,eAAE,QAAQ,cAAc;CAC5B,OAAO,eAAE,OAAO;AAClB,CAAC;AAMD,IAAM,4BAA4B,eAAE,OAAO;CACzC,YAAY,eAAE,QAAQ,EAAE,SAAS;CACjC,YAAY,eAAE,QAAQ,EAAE,SAAS;CACjC,WAAW,eAAE,QAAQ,EAAE,SAAS;AAClC,CAAC;AAID,IAAa,8BAA8B,cAAc,OAAO;CAC9D,IAAI,eAAE,QAAQ,eAAe;;CAE7B,OAAO,gBAAgB,SAAS;CAChC,SAAS,0BAA0B,SAAS;CAC5C,KAAK,gBAAgB,SAAS;CAC9B,MAAM,eAAE,OAAO,EAAE,SAAS;CAC1B,MAAM,cAAgB,UAAU,EAAE,SAAS;AAC7C,CAAC;AAED,IAAM,sCAAsC,cAAc,OAAO;CAC/D,IAAI,eAAE,QAAQ,eAAe;;CAE7B,OAAO,eAAE,QAAQ,EAAE,SAAS;CAC5B,SAAS,0BAA0B,SAAS;CAC5C,KAAK,eAAE,QAAQ,EAAE,SAAS;CAC1B,MAAM,eAAE,OAAO,EAAE,SAAS;CAC1B,MAAM,cAAgB,UAAU,EAAE,SAAS;AAC7C,CAAC;AAMD,IAAM,sBAAsB,eAAE,MAC5B,4BACA,wBACA,wBACA,6BACA,2BACF;AAEA,IAAa,yBAAyB,eAAE,MAAM,CAC5C,eAAE,QAAQ,SAAS,GACnB,mBACF,CAAC;AAID,IAAa,8BAA8B,kBACzC,MACA;CACE;CACA;CACA;CACA;CACA;AACF,GACA,EAAC,MAAM,KAAI,CACb;AAEA,IAAa,iCAAiC,eAAE,MAAM,CACpD,eAAE,QAAQ,SAAS,GACnB,2BACF,CAAC"}
@@ -3,7 +3,10 @@
3
3
  *
4
4
  * The `PROTOCOL_VERSION` encompasses both the wire-protocol of the `/sync/...`
5
5
  * connection between the browser and `zero-cache`, as well as the format of
6
- * the `AST` objects stored in both components (i.e. IDB and CVR).
6
+ * the `AST` objects stored in the CVR. The client's local database has its
7
+ * own version, `STORAGE_VERSION` in zero-client. A bump that changes what the
8
+ * client stores (as version 23 did by adding mutation results) must bump that
9
+ * too.
7
10
  *
8
11
  * A change in the `AST` schema (e.g. new functionality added) must be
9
12
  * accompanied by an increment of the `PROTOCOL_VERSION` and a new major
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-version.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/protocol-version.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAiDH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kCAAkC,KAAK,CAAC"}
1
+ {"version":3,"file":"protocol-version.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/protocol-version.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAiDH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kCAAkC,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-version.js","names":[],"sources":["../../../../zero-protocol/src/protocol-version.ts"],"sourcesContent":["import {assert} from '../../shared/src/asserts.ts';\n\n/**\n * The current `PROTOCOL_VERSION` of the code.\n *\n * The `PROTOCOL_VERSION` encompasses both the wire-protocol of the `/sync/...`\n * connection between the browser and `zero-cache`, as well as the format of\n * the `AST` objects stored in both components (i.e. IDB and CVR).\n *\n * A change in the `AST` schema (e.g. new functionality added) must be\n * accompanied by an increment of the `PROTOCOL_VERSION` and a new major\n * release. The server (`zero-cache`) must be deployed before clients start\n * running the new code.\n */\n// History:\n// -- Version 5 adds support for `pokeEnd.cookie`. (0.14)\n// -- Version 6 makes `pokeStart.cookie` optional. (0.16)\n// -- Version 7 introduces the initConnection.clientSchema field. (0.17)\n// -- Version 8 drops support for Version 5 (0.18).\n// -- Version 11 adds inspect queries. (0.18)\n// -- Version 12 adds 'timestamp' and 'date' types to the ClientSchema ValueType. (not shipped, reversed by version 14)\n// -- Version 14 removes 'timestamp' and 'date' types from the ClientSchema ValueType. (0.18)\n// -- Version 15 adds a `userPushParams` field to `initConnection` (0.19)\n// -- Version 16 adds a new error type (alreadyProcessed) to mutation responses (0.19)\n// -- Version 17 deprecates `AST` in downstream query puts. It was never used anyway. (0.21)\n// -- Version 18 adds `name` and `args` to the `queries-patch` protocol (0.21)\n// -- Version 19 adds `activeClients` to the `initConnection` protocol (0.22)\n// -- Version 20 changes inspector down message (0.22)\n// -- Version 21 removes `AST` in downstream query puts which was deprecated in Version 17, removes support for versions < 18 (0.22)\n// -- Version 22 adds an optional 'userQueryParams' field to `initConnection` (0.22)\n// -- Version 23 add `mutationResults` to poke (0.22)\n// -- Version 24 adds `ackMutationResults` to upstream (0.22).\n// -- version 25 modifies `mutationsResults` to include `del` patches (0.22)\n// -- version 26 adds inspect/metrics and adds metrics to inspect/query (0.23)\n// -- version 27 adds inspect/version (0.23)\n// -- version 28 adds more inspect/metrics (0.23)\n// -- version 29 adds error responses for custom queries (0.23)\n// -- version 30 adds an optional primaryKey to the ClientSchema (0.24)\n// -- version 31 adds admin password authentication to inspector RPC calls (0.24)\n// -- version 32 adds analyze-query to the inspector RPC calls (0.24)\n// -- version 33 adds `flip` to CorrelatedSubquery (0.25)\n// -- version 34 moves `flip` from CorrelatedSubquery to CorrelatedSubqueryCondition (0.25)\n// -- version 35 adds `readRows`, `readRowCountsByQuery` and `readRowCount` to analyze-query result (0.25)\n// -- version 36 changes inspector analyze-query and adds error response to RPC (0.25)\n// -- version 37 adds `elapsed` to AnalyzeQueryResult (0.25)\n// -- version 38 adds structured push/transform error responses (0.25)\n// -- version 39 removes per-transform error types and adds `message` to app error (0.25)\n// -- version 40 adds `dbRowScansByQuery` to AnalyzeQueryResult (0.25)\n// -- version 41 makes ClientSchema.primaryKey required (0.25)\n// -- version 42 adds planner events to AnalyzeQueryResult (0.25)\n// -- version 43 renames `plans` to `sqlitePlans`, `plannerEvents` to `joinPlans`, and `plannerDebug` option to `joinPlans` (0.25)\n// -- version 44 adds profileID to connection URL (0.25)\n// -- version 45 adds userPushHeaders and userQueryHeaders to initConnection (0.25)\n// -- version 46 adds scalarSubquery condition type to AST\n// -- version 47 adds optional auth token to push body\n// -- version 48 adds updateAuth\n// -- version 49 adds `scalar` to CorrelatedSubqueryCondition, removes scalarSubquery\n// -- version 50 adds OTEL headers to push and query messages\n// -- version 51 changes inspector metrics fields\n// -- version 52 replaces JSON pokePart messages with binary poke chunks for\n// clients using protocol version 52 or newer. Older clients retain pokePart.\n// -- version 53 adds 'filter' node type to AnalyzeQueryResult\nexport const PROTOCOL_VERSION = 53;\n\n/**\n * The minimum server-supported sync protocol version (i.e. the version\n * declared in the \"/sync/v{#}/connect\" URL).\n *\n * CloudZero can serve applications running old client releases indefinitely.\n * Consequently, this value must never be increased: `zero-cache` must continue\n * to support every sync protocol from this version through `PROTOCOL_VERSION`.\n * A wire change that an old client cannot ignore must branch on the client's\n * protocol version and retain the old behavior. Keep each compatibility fork\n * isolated at the boundary that owns the changed behavior and test both sides\n * of its version cutoff.\n *\n * Client connections from protocol versions before this historical floor are\n * closed with a `VersionNotSupported` error.\n */\nexport const MIN_SERVER_SUPPORTED_SYNC_PROTOCOL = 30;\n\nassert(\n MIN_SERVER_SUPPORTED_SYNC_PROTOCOL < PROTOCOL_VERSION,\n 'MIN_SERVER_SUPPORTED_SYNC_PROTOCOL must be less than PROTOCOL_VERSION',\n);\n"],"mappings":";AAiFA,OAAA,MAEE,uEACF"}
1
+ {"version":3,"file":"protocol-version.js","names":[],"sources":["../../../../zero-protocol/src/protocol-version.ts"],"sourcesContent":["import {assert} from '../../shared/src/asserts.ts';\n\n/**\n * The current `PROTOCOL_VERSION` of the code.\n *\n * The `PROTOCOL_VERSION` encompasses both the wire-protocol of the `/sync/...`\n * connection between the browser and `zero-cache`, as well as the format of\n * the `AST` objects stored in the CVR. The client's local database has its\n * own version, `STORAGE_VERSION` in zero-client. A bump that changes what the\n * client stores (as version 23 did by adding mutation results) must bump that\n * too.\n *\n * A change in the `AST` schema (e.g. new functionality added) must be\n * accompanied by an increment of the `PROTOCOL_VERSION` and a new major\n * release. The server (`zero-cache`) must be deployed before clients start\n * running the new code.\n */\n// History:\n// -- Version 5 adds support for `pokeEnd.cookie`. (0.14)\n// -- Version 6 makes `pokeStart.cookie` optional. (0.16)\n// -- Version 7 introduces the initConnection.clientSchema field. (0.17)\n// -- Version 8 drops support for Version 5 (0.18).\n// -- Version 11 adds inspect queries. (0.18)\n// -- Version 12 adds 'timestamp' and 'date' types to the ClientSchema ValueType. (not shipped, reversed by version 14)\n// -- Version 14 removes 'timestamp' and 'date' types from the ClientSchema ValueType. (0.18)\n// -- Version 15 adds a `userPushParams` field to `initConnection` (0.19)\n// -- Version 16 adds a new error type (alreadyProcessed) to mutation responses (0.19)\n// -- Version 17 deprecates `AST` in downstream query puts. It was never used anyway. (0.21)\n// -- Version 18 adds `name` and `args` to the `queries-patch` protocol (0.21)\n// -- Version 19 adds `activeClients` to the `initConnection` protocol (0.22)\n// -- Version 20 changes inspector down message (0.22)\n// -- Version 21 removes `AST` in downstream query puts which was deprecated in Version 17, removes support for versions < 18 (0.22)\n// -- Version 22 adds an optional 'userQueryParams' field to `initConnection` (0.22)\n// -- Version 23 add `mutationResults` to poke (0.22)\n// -- Version 24 adds `ackMutationResults` to upstream (0.22).\n// -- version 25 modifies `mutationsResults` to include `del` patches (0.22)\n// -- version 26 adds inspect/metrics and adds metrics to inspect/query (0.23)\n// -- version 27 adds inspect/version (0.23)\n// -- version 28 adds more inspect/metrics (0.23)\n// -- version 29 adds error responses for custom queries (0.23)\n// -- version 30 adds an optional primaryKey to the ClientSchema (0.24)\n// -- version 31 adds admin password authentication to inspector RPC calls (0.24)\n// -- version 32 adds analyze-query to the inspector RPC calls (0.24)\n// -- version 33 adds `flip` to CorrelatedSubquery (0.25)\n// -- version 34 moves `flip` from CorrelatedSubquery to CorrelatedSubqueryCondition (0.25)\n// -- version 35 adds `readRows`, `readRowCountsByQuery` and `readRowCount` to analyze-query result (0.25)\n// -- version 36 changes inspector analyze-query and adds error response to RPC (0.25)\n// -- version 37 adds `elapsed` to AnalyzeQueryResult (0.25)\n// -- version 38 adds structured push/transform error responses (0.25)\n// -- version 39 removes per-transform error types and adds `message` to app error (0.25)\n// -- version 40 adds `dbRowScansByQuery` to AnalyzeQueryResult (0.25)\n// -- version 41 makes ClientSchema.primaryKey required (0.25)\n// -- version 42 adds planner events to AnalyzeQueryResult (0.25)\n// -- version 43 renames `plans` to `sqlitePlans`, `plannerEvents` to `joinPlans`, and `plannerDebug` option to `joinPlans` (0.25)\n// -- version 44 adds profileID to connection URL (0.25)\n// -- version 45 adds userPushHeaders and userQueryHeaders to initConnection (0.25)\n// -- version 46 adds scalarSubquery condition type to AST\n// -- version 47 adds optional auth token to push body\n// -- version 48 adds updateAuth\n// -- version 49 adds `scalar` to CorrelatedSubqueryCondition, removes scalarSubquery\n// -- version 50 adds OTEL headers to push and query messages\n// -- version 51 changes inspector metrics fields\n// -- version 52 replaces JSON pokePart messages with binary poke chunks for\n// clients using protocol version 52 or newer. Older clients retain pokePart.\n// -- version 53 adds 'filter' node type to AnalyzeQueryResult\nexport const PROTOCOL_VERSION = 53;\n\n/**\n * The minimum server-supported sync protocol version (i.e. the version\n * declared in the \"/sync/v{#}/connect\" URL).\n *\n * CloudZero can serve applications running old client releases indefinitely.\n * Consequently, this value must never be increased: `zero-cache` must continue\n * to support every sync protocol from this version through `PROTOCOL_VERSION`.\n * A wire change that an old client cannot ignore must branch on the client's\n * protocol version and retain the old behavior. Keep each compatibility fork\n * isolated at the boundary that owns the changed behavior and test both sides\n * of its version cutoff.\n *\n * Client connections from protocol versions before this historical floor are\n * closed with a `VersionNotSupported` error.\n */\nexport const MIN_SERVER_SUPPORTED_SYNC_PROTOCOL = 30;\n\nassert(\n MIN_SERVER_SUPPORTED_SYNC_PROTOCOL < PROTOCOL_VERSION,\n 'MIN_SERVER_SUPPORTED_SYNC_PROTOCOL must be less than PROTOCOL_VERSION',\n);\n"],"mappings":";AAoFA,OAAA,MAEE,uEACF"}
@@ -1,6 +1,6 @@
1
1
  import { readonly, valita_exports } from "../../shared/src/valita.js";
2
2
  import { jsonSchema } from "../../shared/src/json-schema.js";
3
- import { astSchema } from "./ast.js";
3
+ import { strictASTSchema } from "./ast.js";
4
4
  //#region ../zero-protocol/src/queries-patch.ts
5
5
  var putOpSchema = valita_exports.object({
6
6
  op: valita_exports.literal("put"),
@@ -8,7 +8,7 @@ var putOpSchema = valita_exports.object({
8
8
  ttl: valita_exports.number().optional()
9
9
  });
10
10
  var upPutOpSchema = putOpSchema.extend({
11
- ast: astSchema.optional(),
11
+ ast: strictASTSchema.optional(),
12
12
  name: valita_exports.string().optional(),
13
13
  args: readonly(valita_exports.array(jsonSchema)).optional()
14
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"queries-patch.js","names":[],"sources":["../../../../zero-protocol/src/queries-patch.ts"],"sourcesContent":["import {jsonSchema} from '../../shared/src/json-schema.ts';\nimport * as v from '../../shared/src/valita.ts';\nimport {astSchema} from './ast.ts';\n\nexport const putOpSchema = v.object({\n op: v.literal('put'),\n hash: v.string(),\n ttl: v.number().optional(),\n});\n\nexport const upPutOpSchema = putOpSchema.extend({\n // All fields are optional in this transitional period.\n // - ast is filled in for client queries\n // - name and args are filled in for custom queries\n ast: astSchema.optional(),\n name: v.string().optional(),\n args: v.readonly(v.array(jsonSchema)).optional(),\n});\n\nconst delOpSchema = v.object({\n op: v.literal('del'),\n hash: v.string(),\n});\n\nconst clearOpSchema = v.object({\n op: v.literal('clear'),\n});\n\nconst patchOpSchema = v.union(putOpSchema, delOpSchema, clearOpSchema);\nconst upPatchOpSchema = v.union(upPutOpSchema, delOpSchema, clearOpSchema);\n\nexport const queriesPatchSchema = v.array(patchOpSchema);\nexport const upQueriesPatchSchema = v.array(upPatchOpSchema);\n\nexport type QueriesPutOp = v.Infer<typeof putOpSchema>;\nexport type QueriesDelOp = v.Infer<typeof delOpSchema>;\nexport type QueriesClearOp = v.Infer<typeof clearOpSchema>;\nexport type QueriesPatchOp = v.Infer<typeof patchOpSchema>;\nexport type UpQueriesPatchOp = v.Infer<typeof upPatchOpSchema>;\nexport type QueriesPatch = v.Infer<typeof queriesPatchSchema>;\nexport type UpQueriesPatch = v.Infer<typeof upQueriesPatchSchema>;\n"],"mappings":";;;;AAIA,IAAa,cAAc,eAAE,OAAO;CAClC,IAAI,eAAE,QAAQ,KAAK;CACnB,MAAM,eAAE,OAAO;CACf,KAAK,eAAE,OAAO,EAAE,SAAS;AAC3B,CAAC;AAED,IAAa,gBAAgB,YAAY,OAAO;CAI9C,KAAK,UAAU,SAAS;CACxB,MAAM,eAAE,OAAO,EAAE,SAAS;CAC1B,MAAM,SAAW,eAAE,MAAM,UAAU,CAAC,EAAE,SAAS;AACjD,CAAC;AAED,IAAM,cAAc,eAAE,OAAO;CAC3B,IAAI,eAAE,QAAQ,KAAK;CACnB,MAAM,eAAE,OAAO;AACjB,CAAC;AAED,IAAM,gBAAgB,eAAE,OAAO,EAC7B,IAAI,eAAE,QAAQ,OAAO,EACvB,CAAC;AAED,IAAM,gBAAgB,eAAE,MAAM,aAAa,aAAa,aAAa;AACrE,IAAM,kBAAkB,eAAE,MAAM,eAAe,aAAa,aAAa;AAEzE,IAAa,qBAAqB,eAAE,MAAM,aAAa;AACvD,IAAa,uBAAuB,eAAE,MAAM,eAAe"}
1
+ {"version":3,"file":"queries-patch.js","names":[],"sources":["../../../../zero-protocol/src/queries-patch.ts"],"sourcesContent":["import {jsonSchema} from '../../shared/src/json-schema.ts';\nimport * as v from '../../shared/src/valita.ts';\nimport {strictASTSchema} from './ast.ts';\n\nexport const putOpSchema = v.object({\n op: v.literal('put'),\n hash: v.string(),\n ttl: v.number().optional(),\n});\n\nexport const upPutOpSchema = putOpSchema.extend({\n // All fields are optional in this transitional period.\n // - ast is filled in for client queries\n // - name and args are filled in for custom queries\n ast: strictASTSchema.optional(),\n name: v.string().optional(),\n args: v.readonly(v.array(jsonSchema)).optional(),\n});\n\nconst delOpSchema = v.object({\n op: v.literal('del'),\n hash: v.string(),\n});\n\nconst clearOpSchema = v.object({\n op: v.literal('clear'),\n});\n\nconst patchOpSchema = v.union(putOpSchema, delOpSchema, clearOpSchema);\nconst upPatchOpSchema = v.union(upPutOpSchema, delOpSchema, clearOpSchema);\n\nexport const queriesPatchSchema = v.array(patchOpSchema);\nexport const upQueriesPatchSchema = v.array(upPatchOpSchema);\n\nexport type QueriesPutOp = v.Infer<typeof putOpSchema>;\nexport type QueriesDelOp = v.Infer<typeof delOpSchema>;\nexport type QueriesClearOp = v.Infer<typeof clearOpSchema>;\nexport type QueriesPatchOp = v.Infer<typeof patchOpSchema>;\nexport type UpQueriesPatchOp = v.Infer<typeof upPatchOpSchema>;\nexport type QueriesPatch = v.Infer<typeof queriesPatchSchema>;\nexport type UpQueriesPatch = v.Infer<typeof upQueriesPatchSchema>;\n"],"mappings":";;;;AAIA,IAAa,cAAc,eAAE,OAAO;CAClC,IAAI,eAAE,QAAQ,KAAK;CACnB,MAAM,eAAE,OAAO;CACf,KAAK,eAAE,OAAO,EAAE,SAAS;AAC3B,CAAC;AAED,IAAa,gBAAgB,YAAY,OAAO;CAI9C,KAAK,gBAAgB,SAAS;CAC9B,MAAM,eAAE,OAAO,EAAE,SAAS;CAC1B,MAAM,SAAW,eAAE,MAAM,UAAU,CAAC,EAAE,SAAS;AACjD,CAAC;AAED,IAAM,cAAc,eAAE,OAAO;CAC3B,IAAI,eAAE,QAAQ,KAAK;CACnB,MAAM,eAAE,OAAO;AACjB,CAAC;AAED,IAAM,gBAAgB,eAAE,OAAO,EAC7B,IAAI,eAAE,QAAQ,OAAO,EACvB,CAAC;AAED,IAAM,gBAAgB,eAAE,MAAM,aAAa,aAAa,aAAa;AACrE,IAAM,kBAAkB,eAAE,MAAM,eAAe,aAAa,aAAa;AAEzE,IAAa,qBAAqB,eAAE,MAAM,aAAa;AACvD,IAAa,uBAAuB,eAAE,MAAM,eAAe"}