@rocicorp/zero 1.11.0-canary.38 → 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.
- package/out/shared/src/valita.d.ts +75 -0
- package/out/shared/src/valita.d.ts.map +1 -1
- package/out/shared/src/valita.js +119 -1
- package/out/shared/src/valita.js.map +1 -1
- package/out/zero/package.js +1 -1
- package/out/zero/package.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +2 -2
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/inspect-handler.js +11 -2
- package/out/zero-cache/src/services/view-syncer/inspect-handler.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +2 -1
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js +9 -1
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-client/src/client/storage-version.d.ts +23 -0
- package/out/zero-client/src/client/storage-version.d.ts.map +1 -0
- package/out/zero-client/src/client/version.js +1 -1
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.js +1 -1
- package/out/zero-client/src/client/zero.js.map +1 -1
- package/out/zero-protocol/src/analyze-query-result.d.ts +12 -12
- package/out/zero-protocol/src/analyze-query-result.d.ts.map +1 -1
- package/out/zero-protocol/src/analyze-query-result.js +3 -3
- package/out/zero-protocol/src/analyze-query-result.js.map +1 -1
- package/out/zero-protocol/src/ast.d.ts +5 -0
- package/out/zero-protocol/src/ast.d.ts.map +1 -1
- package/out/zero-protocol/src/ast.js +5 -7
- package/out/zero-protocol/src/ast.js.map +1 -1
- package/out/zero-protocol/src/down.d.ts +5 -5
- package/out/zero-protocol/src/inspect-down.d.ts +15 -15
- package/out/zero-protocol/src/inspect-up.d.ts +158 -61
- package/out/zero-protocol/src/inspect-up.d.ts.map +1 -1
- package/out/zero-protocol/src/inspect-up.js +12 -6
- package/out/zero-protocol/src/inspect-up.js.map +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts +4 -1
- package/out/zero-protocol/src/protocol-version.d.ts.map +1 -1
- package/out/zero-protocol/src/protocol-version.js.map +1 -1
- package/out/zero-protocol/src/queries-patch.js +2 -2
- package/out/zero-protocol/src/queries-patch.js.map +1 -1
- package/out/zero-protocol/src/up.d.ts +766 -256
- package/out/zero-protocol/src/up.d.ts.map +1 -1
- package/out/zero-protocol/src/up.js +25 -3
- package/out/zero-protocol/src/up.js.map +1 -1
- package/out/zero-server/src/adapters/drizzle.d.ts +14 -3
- package/out/zero-server/src/adapters/drizzle.d.ts.map +1 -1
- package/out/zero-server/src/adapters/drizzle.js +7 -4
- package/out/zero-server/src/adapters/drizzle.js.map +1 -1
- package/out/zero-server/src/adapters/kysely.d.ts +4 -2
- package/out/zero-server/src/adapters/kysely.d.ts.map +1 -1
- package/out/zero-server/src/adapters/kysely.js +8 -4
- package/out/zero-server/src/adapters/kysely.js.map +1 -1
- package/out/zero-server/src/adapters/pg.d.ts +3 -2
- package/out/zero-server/src/adapters/pg.d.ts.map +1 -1
- package/out/zero-server/src/adapters/pg.js +7 -4
- package/out/zero-server/src/adapters/pg.js.map +1 -1
- package/out/zero-server/src/adapters/postgresjs.d.ts +3 -2
- package/out/zero-server/src/adapters/postgresjs.d.ts.map +1 -1
- package/out/zero-server/src/adapters/postgresjs.js +8 -4
- package/out/zero-server/src/adapters/postgresjs.js.map +1 -1
- package/out/zero-server/src/adapters/prisma.d.ts +14 -3
- package/out/zero-server/src/adapters/prisma.d.ts.map +1 -1
- package/out/zero-server/src/adapters/prisma.js +12 -4
- package/out/zero-server/src/adapters/prisma.js.map +1 -1
- package/out/zero-server/src/mod.d.ts +1 -0
- package/out/zero-server/src/mod.d.ts.map +1 -1
- package/out/zero-server/src/transaction-options.d.ts +24 -0
- package/out/zero-server/src/transaction-options.d.ts.map +1 -0
- package/out/zero-server/src/transaction-options.js +11 -0
- package/out/zero-server/src/transaction-options.js.map +1 -0
- package/out/zqlite/src/sqlite-cost-model.d.ts.map +1 -1
- package/out/zqlite/src/sqlite-cost-model.js +1 -0
- package/out/zqlite/src/sqlite-cost-model.js.map +1 -1
- package/package.json +1 -1
|
@@ -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.
|
|
117
|
-
id:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
op:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
op:
|
|
133
|
-
value
|
|
134
|
-
|
|
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
|
|
146
|
-
name
|
|
147
|
-
args
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
|
179
|
-
name
|
|
180
|
-
args
|
|
181
|
-
}
|
|
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
|
-
|
|
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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AO,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 {
|
|
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:
|
|
24
|
+
value: strictASTSchema.optional(),
|
|
25
25
|
options: analyzeQueryOptionsSchema.optional(),
|
|
26
|
-
ast:
|
|
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 =
|
|
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 {
|
|
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,IAA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;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
|
|
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
|
|
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
|
|
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 {
|
|
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:
|
|
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 {
|
|
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"}
|