@niscorp/vex 0.3.0 → 0.4.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 (52) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/DESIGN.md +30 -14
  3. package/DOCS.md +65 -13
  4. package/dist/adapters/express/index.cjs +7 -25
  5. package/dist/adapters/express/index.cjs.map +1 -1
  6. package/dist/adapters/express/index.d.cts +3 -2
  7. package/dist/adapters/express/index.d.ts +3 -2
  8. package/dist/adapters/express/index.js +3 -2
  9. package/dist/adapters/express/index.js.map +1 -1
  10. package/dist/adapters/hono/index.cjs +7 -25
  11. package/dist/adapters/hono/index.cjs.map +1 -1
  12. package/dist/adapters/hono/index.d.cts +3 -2
  13. package/dist/adapters/hono/index.d.ts +3 -2
  14. package/dist/adapters/hono/index.js +3 -2
  15. package/dist/adapters/hono/index.js.map +1 -1
  16. package/dist/adapters/pglite/index.cjs.map +1 -1
  17. package/dist/adapters/pglite/index.js.map +1 -1
  18. package/dist/agent/index.cjs +9 -14
  19. package/dist/agent/index.cjs.map +1 -1
  20. package/dist/agent/index.d.cts +3 -2
  21. package/dist/agent/index.d.ts +3 -2
  22. package/dist/agent/index.js +8 -9
  23. package/dist/agent/index.js.map +1 -1
  24. package/dist/{chunk-IQM4SQE2.js → chunk-7F2OH4IP.js} +8 -22
  25. package/dist/chunk-7F2OH4IP.js.map +1 -0
  26. package/dist/chunk-F7RDSWYF.js +7 -0
  27. package/dist/chunk-F7RDSWYF.js.map +1 -0
  28. package/dist/{chunk-H4BHW76Q.js → chunk-UPQMKAAX.js} +6 -24
  29. package/dist/chunk-UPQMKAAX.js.map +1 -0
  30. package/dist/chunk-XTOK7YOR.js +18 -0
  31. package/dist/chunk-XTOK7YOR.js.map +1 -0
  32. package/dist/{handler-BGCL6_Si.d.ts → handler-Bw7xVmBM.d.ts} +2 -1
  33. package/dist/{handler-CMrjTXNx.d.cts → handler-Cy0gNM6K.d.cts} +2 -1
  34. package/dist/index.cjs +44 -90
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +17 -63
  37. package/dist/index.d.ts +17 -63
  38. package/dist/index.js +46 -74
  39. package/dist/index.js.map +1 -1
  40. package/dist/migrations/index.cjs +173 -0
  41. package/dist/migrations/index.cjs.map +1 -0
  42. package/dist/migrations/index.d.cts +20 -0
  43. package/dist/migrations/index.d.ts +20 -0
  44. package/dist/migrations/index.js +23 -0
  45. package/dist/migrations/index.js.map +1 -0
  46. package/dist/query.schema-B-LVNfyX.d.cts +461 -0
  47. package/dist/query.schema-B-LVNfyX.d.ts +461 -0
  48. package/dist/{types-Bi-Lg86b.d.cts → types-Bs_9VM9p.d.ts} +16 -583
  49. package/dist/{types-Bi-Lg86b.d.ts → types-DO-rYZci.d.cts} +16 -583
  50. package/package.json +17 -7
  51. package/dist/chunk-H4BHW76Q.js.map +0 -1
  52. package/dist/chunk-IQM4SQE2.js.map +0 -1
@@ -0,0 +1,461 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const ContextRefSchema: z.ZodObject<{
4
+ $context: z.ZodString;
5
+ }, z.core.$strict>;
6
+ declare const ScopeRefSchema: z.ZodObject<{
7
+ $scope: z.ZodString;
8
+ }, z.core.$strict>;
9
+ declare const FieldOrValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
10
+ $context: z.ZodString;
11
+ }, z.core.$strict>, z.ZodObject<{
12
+ $scope: z.ZodString;
13
+ }, z.core.$strict>]>;
14
+ type ContextRef = z.infer<typeof ContextRefSchema>;
15
+ type ScopeRef = z.infer<typeof ScopeRefSchema>;
16
+ type FieldOrValue = z.infer<typeof FieldOrValueSchema>;
17
+
18
+ type ExistsQuery = {
19
+ from: string[];
20
+ filter?: Filter;
21
+ };
22
+ type Filter = {
23
+ exists: ExistsQuery;
24
+ } | {
25
+ eq: [FieldOrValue, FieldOrValue];
26
+ } | {
27
+ neq: [FieldOrValue, FieldOrValue];
28
+ } | {
29
+ gt: [FieldOrValue, FieldOrValue];
30
+ } | {
31
+ gte: [FieldOrValue, FieldOrValue];
32
+ } | {
33
+ lt: [FieldOrValue, FieldOrValue];
34
+ } | {
35
+ lte: [FieldOrValue, FieldOrValue];
36
+ } | {
37
+ in: [string, FieldOrValue[] | ContextRef | ScopeRef];
38
+ } | {
39
+ notIn: [string, FieldOrValue[] | ContextRef | ScopeRef];
40
+ } | {
41
+ like: [string, FieldOrValue];
42
+ } | {
43
+ ilike: [string, FieldOrValue];
44
+ } | {
45
+ isNull: string;
46
+ } | {
47
+ isNotNull: string;
48
+ } | {
49
+ and: Filter[];
50
+ } | {
51
+ or: Filter[];
52
+ } | {
53
+ not: Filter;
54
+ } | {
55
+ semantic: {
56
+ field: string;
57
+ query: ContextRef | ScopeRef;
58
+ minScore?: number;
59
+ };
60
+ } | {
61
+ fuzzy: {
62
+ field: string;
63
+ query: ContextRef | ScopeRef;
64
+ maxDistance?: number;
65
+ };
66
+ } | {
67
+ optional: {
68
+ key: string | string[];
69
+ then: Filter;
70
+ };
71
+ };
72
+ declare const FilterSchema: z.ZodType<Filter>;
73
+
74
+ declare const ComputeExpressionSchema: z.ZodUnion<readonly [z.ZodObject<{
75
+ add: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
76
+ $context: z.ZodString;
77
+ }, z.core.$strict>, z.ZodObject<{
78
+ $scope: z.ZodString;
79
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
80
+ $context: z.ZodString;
81
+ }, z.core.$strict>, z.ZodObject<{
82
+ $scope: z.ZodString;
83
+ }, z.core.$strict>]>], null>;
84
+ }, z.core.$strict>, z.ZodObject<{
85
+ subtract: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
86
+ $context: z.ZodString;
87
+ }, z.core.$strict>, z.ZodObject<{
88
+ $scope: z.ZodString;
89
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
90
+ $context: z.ZodString;
91
+ }, z.core.$strict>, z.ZodObject<{
92
+ $scope: z.ZodString;
93
+ }, z.core.$strict>]>], null>;
94
+ }, z.core.$strict>, z.ZodObject<{
95
+ multiply: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
96
+ $context: z.ZodString;
97
+ }, z.core.$strict>, z.ZodObject<{
98
+ $scope: z.ZodString;
99
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
100
+ $context: z.ZodString;
101
+ }, z.core.$strict>, z.ZodObject<{
102
+ $scope: z.ZodString;
103
+ }, z.core.$strict>]>], null>;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ divide: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
106
+ $context: z.ZodString;
107
+ }, z.core.$strict>, z.ZodObject<{
108
+ $scope: z.ZodString;
109
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
110
+ $context: z.ZodString;
111
+ }, z.core.$strict>, z.ZodObject<{
112
+ $scope: z.ZodString;
113
+ }, z.core.$strict>]>], null>;
114
+ }, z.core.$strict>, z.ZodObject<{
115
+ concat: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
116
+ $context: z.ZodString;
117
+ }, z.core.$strict>, z.ZodObject<{
118
+ $scope: z.ZodString;
119
+ }, z.core.$strict>]>>;
120
+ }, z.core.$strict>, z.ZodObject<{
121
+ coalesce: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
122
+ $context: z.ZodString;
123
+ }, z.core.$strict>, z.ZodObject<{
124
+ $scope: z.ZodString;
125
+ }, z.core.$strict>]>>;
126
+ }, z.core.$strict>, z.ZodObject<{
127
+ case: z.ZodObject<{
128
+ when: z.ZodArray<z.ZodObject<{
129
+ condition: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
130
+ then: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
131
+ $context: z.ZodString;
132
+ }, z.core.$strict>, z.ZodObject<{
133
+ $scope: z.ZodString;
134
+ }, z.core.$strict>]>;
135
+ }, z.core.$strict>>;
136
+ else: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
137
+ $context: z.ZodString;
138
+ }, z.core.$strict>, z.ZodObject<{
139
+ $scope: z.ZodString;
140
+ }, z.core.$strict>]>;
141
+ }, z.core.$strict>;
142
+ }, z.core.$strict>]>;
143
+ type ComputeExpression = z.infer<typeof ComputeExpressionSchema>;
144
+
145
+ declare const AggregateExpressionSchema: z.ZodUnion<readonly [z.ZodObject<{
146
+ count: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
147
+ }, z.core.$strict>, z.ZodObject<{
148
+ countDistinct: z.ZodString;
149
+ }, z.core.$strict>, z.ZodObject<{
150
+ sum: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
151
+ add: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
152
+ $context: z.ZodString;
153
+ }, z.core.$strict>, z.ZodObject<{
154
+ $scope: z.ZodString;
155
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
156
+ $context: z.ZodString;
157
+ }, z.core.$strict>, z.ZodObject<{
158
+ $scope: z.ZodString;
159
+ }, z.core.$strict>]>], null>;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ subtract: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
162
+ $context: z.ZodString;
163
+ }, z.core.$strict>, z.ZodObject<{
164
+ $scope: z.ZodString;
165
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
166
+ $context: z.ZodString;
167
+ }, z.core.$strict>, z.ZodObject<{
168
+ $scope: z.ZodString;
169
+ }, z.core.$strict>]>], null>;
170
+ }, z.core.$strict>, z.ZodObject<{
171
+ multiply: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
172
+ $context: z.ZodString;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ $scope: z.ZodString;
175
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
176
+ $context: z.ZodString;
177
+ }, z.core.$strict>, z.ZodObject<{
178
+ $scope: z.ZodString;
179
+ }, z.core.$strict>]>], null>;
180
+ }, z.core.$strict>, z.ZodObject<{
181
+ divide: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
182
+ $context: z.ZodString;
183
+ }, z.core.$strict>, z.ZodObject<{
184
+ $scope: z.ZodString;
185
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
186
+ $context: z.ZodString;
187
+ }, z.core.$strict>, z.ZodObject<{
188
+ $scope: z.ZodString;
189
+ }, z.core.$strict>]>], null>;
190
+ }, z.core.$strict>, z.ZodObject<{
191
+ concat: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
192
+ $context: z.ZodString;
193
+ }, z.core.$strict>, z.ZodObject<{
194
+ $scope: z.ZodString;
195
+ }, z.core.$strict>]>>;
196
+ }, z.core.$strict>, z.ZodObject<{
197
+ coalesce: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
198
+ $context: z.ZodString;
199
+ }, z.core.$strict>, z.ZodObject<{
200
+ $scope: z.ZodString;
201
+ }, z.core.$strict>]>>;
202
+ }, z.core.$strict>, z.ZodObject<{
203
+ case: z.ZodObject<{
204
+ when: z.ZodArray<z.ZodObject<{
205
+ condition: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
206
+ then: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
207
+ $context: z.ZodString;
208
+ }, z.core.$strict>, z.ZodObject<{
209
+ $scope: z.ZodString;
210
+ }, z.core.$strict>]>;
211
+ }, z.core.$strict>>;
212
+ else: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
213
+ $context: z.ZodString;
214
+ }, z.core.$strict>, z.ZodObject<{
215
+ $scope: z.ZodString;
216
+ }, z.core.$strict>]>;
217
+ }, z.core.$strict>;
218
+ }, z.core.$strict>]>]>;
219
+ }, z.core.$strict>, z.ZodObject<{
220
+ avg: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
221
+ add: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
222
+ $context: z.ZodString;
223
+ }, z.core.$strict>, z.ZodObject<{
224
+ $scope: z.ZodString;
225
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
226
+ $context: z.ZodString;
227
+ }, z.core.$strict>, z.ZodObject<{
228
+ $scope: z.ZodString;
229
+ }, z.core.$strict>]>], null>;
230
+ }, z.core.$strict>, z.ZodObject<{
231
+ subtract: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
232
+ $context: z.ZodString;
233
+ }, z.core.$strict>, z.ZodObject<{
234
+ $scope: z.ZodString;
235
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
236
+ $context: z.ZodString;
237
+ }, z.core.$strict>, z.ZodObject<{
238
+ $scope: z.ZodString;
239
+ }, z.core.$strict>]>], null>;
240
+ }, z.core.$strict>, z.ZodObject<{
241
+ multiply: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
242
+ $context: z.ZodString;
243
+ }, z.core.$strict>, z.ZodObject<{
244
+ $scope: z.ZodString;
245
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
246
+ $context: z.ZodString;
247
+ }, z.core.$strict>, z.ZodObject<{
248
+ $scope: z.ZodString;
249
+ }, z.core.$strict>]>], null>;
250
+ }, z.core.$strict>, z.ZodObject<{
251
+ divide: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
252
+ $context: z.ZodString;
253
+ }, z.core.$strict>, z.ZodObject<{
254
+ $scope: z.ZodString;
255
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
256
+ $context: z.ZodString;
257
+ }, z.core.$strict>, z.ZodObject<{
258
+ $scope: z.ZodString;
259
+ }, z.core.$strict>]>], null>;
260
+ }, z.core.$strict>, z.ZodObject<{
261
+ concat: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
262
+ $context: z.ZodString;
263
+ }, z.core.$strict>, z.ZodObject<{
264
+ $scope: z.ZodString;
265
+ }, z.core.$strict>]>>;
266
+ }, z.core.$strict>, z.ZodObject<{
267
+ coalesce: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
268
+ $context: z.ZodString;
269
+ }, z.core.$strict>, z.ZodObject<{
270
+ $scope: z.ZodString;
271
+ }, z.core.$strict>]>>;
272
+ }, z.core.$strict>, z.ZodObject<{
273
+ case: z.ZodObject<{
274
+ when: z.ZodArray<z.ZodObject<{
275
+ condition: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
276
+ then: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
277
+ $context: z.ZodString;
278
+ }, z.core.$strict>, z.ZodObject<{
279
+ $scope: z.ZodString;
280
+ }, z.core.$strict>]>;
281
+ }, z.core.$strict>>;
282
+ else: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
283
+ $context: z.ZodString;
284
+ }, z.core.$strict>, z.ZodObject<{
285
+ $scope: z.ZodString;
286
+ }, z.core.$strict>]>;
287
+ }, z.core.$strict>;
288
+ }, z.core.$strict>]>]>;
289
+ }, z.core.$strict>, z.ZodObject<{
290
+ min: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
291
+ add: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
292
+ $context: z.ZodString;
293
+ }, z.core.$strict>, z.ZodObject<{
294
+ $scope: z.ZodString;
295
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
296
+ $context: z.ZodString;
297
+ }, z.core.$strict>, z.ZodObject<{
298
+ $scope: z.ZodString;
299
+ }, z.core.$strict>]>], null>;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ subtract: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
302
+ $context: z.ZodString;
303
+ }, z.core.$strict>, z.ZodObject<{
304
+ $scope: z.ZodString;
305
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
306
+ $context: z.ZodString;
307
+ }, z.core.$strict>, z.ZodObject<{
308
+ $scope: z.ZodString;
309
+ }, z.core.$strict>]>], null>;
310
+ }, z.core.$strict>, z.ZodObject<{
311
+ multiply: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
312
+ $context: z.ZodString;
313
+ }, z.core.$strict>, z.ZodObject<{
314
+ $scope: z.ZodString;
315
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
316
+ $context: z.ZodString;
317
+ }, z.core.$strict>, z.ZodObject<{
318
+ $scope: z.ZodString;
319
+ }, z.core.$strict>]>], null>;
320
+ }, z.core.$strict>, z.ZodObject<{
321
+ divide: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
322
+ $context: z.ZodString;
323
+ }, z.core.$strict>, z.ZodObject<{
324
+ $scope: z.ZodString;
325
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
326
+ $context: z.ZodString;
327
+ }, z.core.$strict>, z.ZodObject<{
328
+ $scope: z.ZodString;
329
+ }, z.core.$strict>]>], null>;
330
+ }, z.core.$strict>, z.ZodObject<{
331
+ concat: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
332
+ $context: z.ZodString;
333
+ }, z.core.$strict>, z.ZodObject<{
334
+ $scope: z.ZodString;
335
+ }, z.core.$strict>]>>;
336
+ }, z.core.$strict>, z.ZodObject<{
337
+ coalesce: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
338
+ $context: z.ZodString;
339
+ }, z.core.$strict>, z.ZodObject<{
340
+ $scope: z.ZodString;
341
+ }, z.core.$strict>]>>;
342
+ }, z.core.$strict>, z.ZodObject<{
343
+ case: z.ZodObject<{
344
+ when: z.ZodArray<z.ZodObject<{
345
+ condition: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
346
+ then: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
347
+ $context: z.ZodString;
348
+ }, z.core.$strict>, z.ZodObject<{
349
+ $scope: z.ZodString;
350
+ }, z.core.$strict>]>;
351
+ }, z.core.$strict>>;
352
+ else: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
353
+ $context: z.ZodString;
354
+ }, z.core.$strict>, z.ZodObject<{
355
+ $scope: z.ZodString;
356
+ }, z.core.$strict>]>;
357
+ }, z.core.$strict>;
358
+ }, z.core.$strict>]>]>;
359
+ }, z.core.$strict>, z.ZodObject<{
360
+ max: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
361
+ add: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
362
+ $context: z.ZodString;
363
+ }, z.core.$strict>, z.ZodObject<{
364
+ $scope: z.ZodString;
365
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
366
+ $context: z.ZodString;
367
+ }, z.core.$strict>, z.ZodObject<{
368
+ $scope: z.ZodString;
369
+ }, z.core.$strict>]>], null>;
370
+ }, z.core.$strict>, z.ZodObject<{
371
+ subtract: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
372
+ $context: z.ZodString;
373
+ }, z.core.$strict>, z.ZodObject<{
374
+ $scope: z.ZodString;
375
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
376
+ $context: z.ZodString;
377
+ }, z.core.$strict>, z.ZodObject<{
378
+ $scope: z.ZodString;
379
+ }, z.core.$strict>]>], null>;
380
+ }, z.core.$strict>, z.ZodObject<{
381
+ multiply: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
382
+ $context: z.ZodString;
383
+ }, z.core.$strict>, z.ZodObject<{
384
+ $scope: z.ZodString;
385
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
386
+ $context: z.ZodString;
387
+ }, z.core.$strict>, z.ZodObject<{
388
+ $scope: z.ZodString;
389
+ }, z.core.$strict>]>], null>;
390
+ }, z.core.$strict>, z.ZodObject<{
391
+ divide: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
392
+ $context: z.ZodString;
393
+ }, z.core.$strict>, z.ZodObject<{
394
+ $scope: z.ZodString;
395
+ }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
396
+ $context: z.ZodString;
397
+ }, z.core.$strict>, z.ZodObject<{
398
+ $scope: z.ZodString;
399
+ }, z.core.$strict>]>], null>;
400
+ }, z.core.$strict>, z.ZodObject<{
401
+ concat: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
402
+ $context: z.ZodString;
403
+ }, z.core.$strict>, z.ZodObject<{
404
+ $scope: z.ZodString;
405
+ }, z.core.$strict>]>>;
406
+ }, z.core.$strict>, z.ZodObject<{
407
+ coalesce: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
408
+ $context: z.ZodString;
409
+ }, z.core.$strict>, z.ZodObject<{
410
+ $scope: z.ZodString;
411
+ }, z.core.$strict>]>>;
412
+ }, z.core.$strict>, z.ZodObject<{
413
+ case: z.ZodObject<{
414
+ when: z.ZodArray<z.ZodObject<{
415
+ condition: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
416
+ then: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
417
+ $context: z.ZodString;
418
+ }, z.core.$strict>, z.ZodObject<{
419
+ $scope: z.ZodString;
420
+ }, z.core.$strict>]>;
421
+ }, z.core.$strict>>;
422
+ else: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
423
+ $context: z.ZodString;
424
+ }, z.core.$strict>, z.ZodObject<{
425
+ $scope: z.ZodString;
426
+ }, z.core.$strict>]>;
427
+ }, z.core.$strict>;
428
+ }, z.core.$strict>]>]>;
429
+ }, z.core.$strict>]>;
430
+ type AggregateExpression = z.infer<typeof AggregateExpressionSchema>;
431
+
432
+ declare const SortEntrySchema: z.ZodObject<{
433
+ field: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
434
+ dir: z.ZodDefault<z.ZodEnum<{
435
+ asc: "asc";
436
+ desc: "desc";
437
+ }>>;
438
+ }, z.core.$strict>;
439
+ type SortEntry = z.infer<typeof SortEntrySchema>;
440
+ type Source = string | {
441
+ as: string;
442
+ query: Query;
443
+ };
444
+ type FieldRef = string | {
445
+ field: string;
446
+ as: string;
447
+ };
448
+ type Query = {
449
+ from: Source[];
450
+ fields?: FieldRef[];
451
+ filter?: Filter;
452
+ compute?: Record<string, ComputeExpression>;
453
+ aggregate?: Record<string, AggregateExpression>;
454
+ groupBy?: string[];
455
+ sort?: SortEntry[];
456
+ limit?: number;
457
+ distinct?: boolean;
458
+ };
459
+ declare const QuerySchema: z.ZodType<Query>;
460
+
461
+ export { type AggregateExpression as A, type ComputeExpression as C, type FieldOrValue as F, type Query as Q, type ScopeRef as S, type Filter as a, AggregateExpressionSchema as b, ComputeExpressionSchema as c, type ContextRef as d, FilterSchema as e, QuerySchema as f, type SortEntry as g, type Source as h };